# @google-labs/breadboard-web

> The Web runtime for Breadboard

Latest version **1.10.1** (published 2024-06-29) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @google-labs/breadboard-web
pnpm add @google-labs/breadboard-web
yarn add @google-labs/breadboard-web
bun add @google-labs/breadboard-web
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.10.1 |
| Published | 2024-06-29 |
| First published | 2024-01-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 21 |
| Unpacked size | 14.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 432 |
| Author | Google Labs Team |

## Links

- npm: https://www.npmjs.com/package/@google-labs/breadboard-web
- Repository: https://github.com/breadboard-ai/breadboard
- Homepage: https://github.com/breadboard-ai/breadboard/tree/main/packages/breadboard-web#readme
- Issues: https://github.com/breadboard-ai/breadboard/issues
- npm.io page: https://npm.io/package/@google-labs/breadboard-web

## Dependencies (21)

- [idb](https://npm.io/package/idb.md) ^8.0.0
- [lit](https://npm.io/package/lit.md) ^3.1.4
- [codemirror](https://npm.io/package/codemirror.md) ^6.0.1
- [idb-keyval](https://npm.io/package/idb-keyval.md) ^6.2.1
- [@lit/context](https://npm.io/package/@lit/context.md) ^1.1.2
- [@breadboard-ai/build](https://npm.io/package/@breadboard-ai/build.md) 0.7.0
- [@codemirror/commands](https://npm.io/package/@codemirror/commands.md) ^6.6.0
- [@google-labs/core-kit](https://npm.io/package/@google-labs/core-kit.md) ^0.10.1
- [@google-labs/json-kit](https://npm.io/package/@google-labs/json-kit.md) ^0.3.2
- [@google-labs/palm-kit](https://npm.io/package/@google-labs/palm-kit.md) ^0.0.15
- [@google-labs/agent-kit](https://npm.io/package/@google-labs/agent-kit.md) ^0.8.0
- [@google-labs/breadboard](https://npm.io/package/@google-labs/breadboard.md) ^0.21.0
- [@google-labs/gemini-kit](https://npm.io/package/@google-labs/gemini-kit.md) ^0.5.1
- [@codemirror/autocomplete](https://npm.io/package/@codemirror/autocomplete.md) ^6.16.3
- [@google-labs/template-kit](https://npm.io/package/@google-labs/template-kit.md) ^0.3.4
- [@breadboard-ai/python-wasm](https://npm.io/package/@breadboard-ai/python-wasm.md) 0.1.2
- [@google-labs/breadboard-ui](https://npm.io/package/@google-labs/breadboard-ui.md) ^0.9.0
- [@codemirror/lang-javascript](https://npm.io/package/@codemirror/lang-javascript.md) ^6.2.2
- [@google-labs/node-nursery-web](https://npm.io/package/@google-labs/node-nursery-web.md) ^1.1.4
- [@breadboard-ai/google-drive-kit](https://npm.io/package/@breadboard-ai/google-drive-kit.md) 0.1.3
- [@google-labs/breadboard-manifest](https://npm.io/package/@google-labs/breadboard-manifest.md) ^0.2.0

## Recent versions

- 1.10.1 (latest) — 2024-06-29
- 1.10.0 — 2024-06-28
- 1.9.0 — 2024-05-15
- 1.8.1 — 2024-05-01
- 1.8.0 — 2024-05-01
- 1.7.0 — 2024-04-17
- 1.6.0 — 2024-04-08
- 1.5.1 — 2024-04-03
- 1.5.0 — 2024-04-01
- 1.4.0 — 2024-03-28
- 1.3.1 — 2024-03-22
- 1.3.0 — 2024-03-22
- 1.2.2 — 2024-02-24
- 1.2.1 — 2024-02-23
- 1.2.0 — 2024-02-19
- … 7 more at https://npm.io/package/@google-labs/breadboard-web/versions

## README

# Breadboard Web Runtime

This is the package that contains all necessary infrastructure to run a Breadboard application in a web browser.

## The Worker Communication Protocol

The worker communicates with its host using a simple message protocol. The protocol is defined in [protocol.ts](src/protocol.ts) and documented in the [API documentation](docs/api/README.md).

The general message format used to communicate with the worker consists of three parts:

- The `id` of the message (optional)
- The `type` of the message
- The `data` payload of the message

The payload will vary depending on the type of the message.

Some messages are "one-way" messages and some are "round-trip" messages. The difference is that the sender of a "round-trip" message expects a response from the receiver.

The presence of the `id` field indicates that this is a "round-trip" message. The receiver of this message must respond with a message of the same type and the same id.

The protocol allows the following types of messages:

- `load` -- sent by the host to load the board
- `start` -- sent by the host to load the board and to start running it
- `input` -- sent by the worker when the board is requesting input (a round-trip message)
- `output` -- sent by the worker when the board is producing output
- `beforehandler` -- sent by the worker when the board is about to run a handler for a node. These messages are useful for indicating the progress of the board's run.
- `proxy` -- sent by the worker when the board is requesting a proxy object (a round-trip message)
- `end` -- sent by the worker when the board is done running
- `error` -- sent by the worker when an error occurs

Any other types of messages cause an error to be thrown by the worker and abort running of the board.

## Typical Lifecycle

The typical worker lifecycle is as follows:

1. The host sends a `load` message to the worker, supplying the board to load.
2. The worker loads the board and sends a `load` message with the information about the board back to the host.
3. The host sends a `start` message to the worker.
4. The worker loads the board and sends a `beforehandler` message to the host for each node that is about to be run.
5. The worker sends an `input` message to the host for each node that requires input.
6. The host responds to each `input` message with an `input` message containing the input values for the node.
7. The worker sends an `output` message to the host for each node that is producing output.
8. The worker sends a `proxy` message to the host for each node that is requesting a proxy object.
9. The host responds to each `proxy` message with a `proxy` message containing the proxy object for the node.
10. The worker sends an `end` message to the host when the board is done running.
11. If an error occurs, the worker sends an `error` message to the host.

# Firebase bits

Must have firebase CLI installed:

```bash
npm install -g firebase-tools
```

Set project (PROJECT_ID is the ID of the project in the Firebase console):

```bash
firebase use --add ${PROJECT_ID}
```

---
_Source: https://npm.io/package/@google-labs/breadboard-web · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
