bifrost-agy-adapter
Use when changing packages/bifrost/src/agy - the generated Antigravity aux-pane server, page runtime client.js, effects, token and preload contract, HTML renderer or bifrost.css - or when an agy pane misbehaves for every plugin rather than one.
- License 许可
- MIT
- 最近更新
- 2026-10-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- bifrost-agy-adapter
- description
- Use when changing packages/bifrost/src/agy - the generated Antigravity aux-pane server, page runtime client.js, effects, token and preload contract, HTML renderer or bifrost.css - or when an agy pane misbehaves for every plugin rather than one.
03 SKILL.md 正文
Antigravity (agy) adapter
bifrost build emits dist/sidecars/<mod>/server.mjs (one bundle: plugin + framework + CSS + page
runtime) and sidecar.json (one aux-pane view per pane). The server renders the plugin's components.
Routes
| Route | Purpose |
|---|---|
GET /, GET /pane/<id> |
shell: /_bf/style.css, /preload.js, <main id="bf-root" data-pane>, /_bf/client.js |
POST /_bf/render |
{ pane, initial, columns, workspaceUris, selection } → { html, effects, version }; initial runs onOpen |
POST /_bf/event |
{ pane, id, kind: press/input/submit/select, value, … }: runs the handler drawn under that id, then renders |
GET /_bf/stream |
SSE change when state changes; the page re-renders |
GET /preload.js |
sidecar_sdk/preload.js if installed, else a built-in window.sidecar stand-in (no token) |
GET /api/health |
{ status, name, version } |
Handler ids are element keys (generated otherwise). The handler's host reads the current request from
async context: host.selection() is the text selected when the button was pressed.
Contract
- Loopback only, port
ANTIGRAVITY_SIDECAR_WEB_PORT;ANTIGRAVITY_SIDECAR_UI_TOKENon every route but/preload.js(X-Sidecar-Tokenor?token=; the shell forwards it to its assets). - Workspace URIs (
file:///…, POSIX, Windows) becomehost.cwd(); before the page reports one, process cwd. - Config: env
<PLUGIN>_<KEY>, else theconfigdefault. - Effects run in the page:
prompt→add-chat-context+insert-promptpostMessages and the clipboard;submit→window.sidecar.agent.sendMessage;toast;focusby element key. dev: truebuilds exit when the bundle changes; Antigravity (restart_policy: always) restarts them.agy/bifrost.cssmaps host theme variables (--background,--foreground,--muted-foreground,--border,--accent) onto thebf-*classesagy/html.tsemits. The host sets its variables inline on the root (--mutedis a background there): every property the stylesheet declares is--bf-*.bifrost buildemptiesdist/sidecars/<mod>instead of deleting it: a running server's cwd cannot be removed on Windows.
Changing a route, effect or class name changes generated output: treat it as a breaking change (AGENTS.md).
Verifying
agy.test.tsx:createAgyApp(plugin, { token, env, fs })with an inline fixture plugin.- By hand: build any plugin,
ANTIGRAVITY_SIDECAR_WEB_PORT=4700 node plugins/<mod>/dist/sidecars/<mod>/server.mjs,curl -X POST :4700/_bf/render -d '{"pane":"<id>","initial":true}'.
04 同仓库更多 Skills
__MOD_NAME__
__MOD_DESCRIPTION__
cross-mod
Hub for building plugins that run in both Claude Code and Google Antigravity (agy) with the Bifrost framework. Use when starting any plugin work in this repository to find the right specialized skill and the end-to-end workflow.
ref-pane
Inspect and navigate project artifact references (such as RV-1, FB-2, T-3, ADR-4) in the Auxiliary Pane.
bifrost-dev
Use when changing @gidragir/bifrost itself (packages/bifrost) - adding or renaming an export, Host member, primitive or component, changing codegen or the adapters, bumping its version or releasing it - and not when building a plugin under plugins/<mod>.
bifrost-claude-adapter
Use when changing packages/bifrost/src/claude or src/cli codegen, or when a generated hooks module fails claude plugin validate/test for a reason the framework (not the plugin) causes - scanner errors, missing state contract keys, guard hooks, next(e) chaining.
releasing
Use when asked to release, publish or tag a plugin or the Bifrost framework in this repository, to bump versions, push release tags (<mod>-v*, framework-v*), or when a Release Plugins / Publish Bifrost Framework run on GitHub failed.