Неймспейсы бэкенда
bb 0.43.3SDK 0.4.104пин e865697 (desktop-v0.43.3)
Серверная точка входа получает единственный объект. Ниже перечислены его 22 неймспейса и метод onDispose в порядке объявления, а также приведены числовые лимиты. Ровно пять корневых полей имеют префикс experimental_; у hosts и sdk его нет, хотя он есть у их основных полей.
Неймспейсы, которых не существует
Что часто ищут по ошибке: bb.info, bb.ws, bb.threads, bb.dispatch, bb.metadata, bb.commands, bb.schedules, bb.services, bb.machines (на самом деле bb.experimental_machines), bb.ai, bb.browsers, bb.host в единственном числе, bb.db, bb.defineCli (это отдельная функция).
Веб-сокеты лежат в bb.http.experimental_websocket, браузеры — в bb.sdk.experimental_desktopBrowsers, крон — в bb.background.schedule, а метаданные треда — в bb.sdk.threads.getPluginMetadata.
Числовые лимиты
| Лимит | Значение | Где |
|---|---|---|
значение kv | 256 КБ | host-policy.ts |
| неймспейс метаданных треда | 256 КиБ | backend-contract.ts |
| вывод CLI (stdout + stderr) | 1 МиБ, отклоняется целиком | backend-contract.ts |
requestInput | payload 64 КиБ · title 160 символов · таймаут 10 мин по умолчанию, потолок 1 час | plugin-interaction-limits.ts |
| метки строк presentation | 80 символов | host-policy.ts |
| инструкции к tool и любой вклад в инструкции | 4096 символов | host-policy.ts |
выбор configure | 256 id | host-policy.ts |
| переопределение параметров tool | 128 КиБ | host-policy.ts |
experimental_bridgeOptions | 64 КиБ, валидируется и замораживается при регистрации | host-policy.ts |
| записи provider env | 32 имени, [A-Z_][A-Z0-9_]* | host-policy.ts |
| фабрика плагина | 30 с | plugin-runtime.ts |
| хук диспетчеризации | 10 с, fail-closed | plugin-hook-registry.ts |
search для упоминания | 2 с, изолирован от сбоев | backend-contract.ts |
resource окружения | 16 КиБ | backend-events.md |
| хостовый RPC | 32 МиБ вход / 8 МиБ выход, 30 с по умолчанию, потолок 30 минут | plugin-host-rpc.ts |
| хостовый артефакт | 256 МиБ, проверяется по sha256 | host-daemon-contract/src/protocol.ts |
| остановка сервиса | 5 с → degraded | plugin-runtime.ts |
Неймспейсы
Описания неймспейсов — doc-комментарии из исходников bb; они приводятся на английском, как в коде.
bb.agentsстабильный Per-turn agent context contributions (design §4.4).bb.backgroundстабильный Long-lived services + cron schedules (design §4.8).bb.cliстабильный Agent-facing `bb` CLI subcommand (design §4.4).bb.eventsстабильный Additive plugin lifecycle listeners (design §4.5). Announcements core makes: a handler's return value is ignored.bb.experimental_aiServicesэкспериментальный AI services this plugin serves from its `bb.host` entry (helperbb.experimental_environmentsэкспериментальный Environment targets: places a thread can run that this plugin provisions (plans/plugin-environment-providers.md). Experimental: see docs/api_to_audit.md.bb.experimental_hooksэкспериментальный Questions core asks and acts on the answer to. Today: the dispatch checkpoint messages pass through on their way to a provider (a user's reason, or refuse.bb.experimental_machinesэкспериментальный Machine providers provision execution machines. Experimental: see docs/api_to_audit.md.bb.experimental_serverAccessэкспериментальныйbb.hostsстабильный Server-to-daemon host control-plane declarations.bb.httpстабильный HTTP routes under /api/v1/plugins/<id>/http/* (design §4.6).bb.logстабильный Leveled, plugin-scoped logger.bb.onDisposeстабильный Register cleanup to run on reload/disable/shutdown. Hooks run LIFO. The sanctioned place to clear timers and close connections.bb.pluginIdстабильный The plugin's own id (namespaces storage, routes, commands).bb.providersстабильный Agent provider registration (docs/provider-plugin-api.md §1).bb.realtimeстабильный Ephemeral push to connected frontends (design §4.7).bb.rpcстабильный RPC methods under /api/v1/plugins/<id>/rpc/<method> (design §4.6).bb.sdkстабильный The full BB SDK, bound to this server over loopback (design §4.1). Bind-gated: reading this before the host binds the SDK throws. The real server binds it before loading plugins, so it is available from the moment factories run there — but isolated harnesses may not, so prefer using it from handlers, services, and timers for portability. `threads.spawn` and `threads.fork` default `origin` to "plugin" and, for that origin, `originPluginId` to this plugin's id unless you set them. Seeding `pluginMetadata` always attributes the new thread to this plugin, overriding an explicit `origin` or `originPluginId`.bb.serverстабильный Read-only facts about the running server (loopback base URL).bb.settingsстабильный Declarative settings (design §4.2).bb.statusстабильный Plugin-reported status (needs-configuration).bb.storageстабильный Namespaced KV + per-plugin database (design §4.3).bb.uiстабильный Host-rendered UI contributions (design §4.9).