Перейти к содержимому

Неймспейсы бэкенда

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.

Числовые лимиты

ЛимитЗначениеГде
значение kv256 КБhost-policy.ts
неймспейс метаданных треда256 КиБbackend-contract.ts
вывод CLI (stdout + stderr)1 МиБ, отклоняется целикомbackend-contract.ts
requestInputpayload 64 КиБ · title 160 символов · таймаут 10 мин по умолчанию, потолок 1 часplugin-interaction-limits.ts
метки строк presentation80 символовhost-policy.ts
инструкции к tool и любой вклад в инструкции4096 символовhost-policy.ts
выбор configure256 idhost-policy.ts
переопределение параметров tool128 КиБhost-policy.ts
experimental_bridgeOptions64 КиБ, валидируется и замораживается при регистрацииhost-policy.ts
записи provider env32 имени, [A-Z_][A-Z0-9_]*host-policy.ts
фабрика плагина30 сplugin-runtime.ts
хук диспетчеризации10 с, fail-closedplugin-hook-registry.ts
search для упоминания2 с, изолирован от сбоевbackend-contract.ts
resource окружения16 КиБbackend-events.md
хостовый RPC32 МиБ вход / 8 МиБ выход, 30 с по умолчанию, потолок 30 минутplugin-host-rpc.ts
хостовый артефакт256 МиБ, проверяется по sha256host-daemon-contract/src/protocol.ts
остановка сервиса5 с → degradedplugin-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 (helper
  • bb.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).