@graychennpm/codebridge 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +217 -2
- package/README.zh-CN.md +222 -0
- package/apps/web/public/brand/agent-logo-carbon.svg +1 -0
- package/apps/web/public/brand/agent-logo.svg +1 -0
- package/docs/zh-CN/npm-release.md +77 -0
- package/node_modules/@codebridge/agent-registry/dist/index.d.ts +32 -0
- package/node_modules/@codebridge/agent-registry/dist/index.js +177 -0
- package/node_modules/@codebridge/agent-registry/dist/setup.d.ts +9 -0
- package/node_modules/@codebridge/agent-registry/dist/setup.js +115 -0
- package/node_modules/@codebridge/agent-registry/package.json +17 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-active-session.d.ts +12 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-active-session.js +57 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-claude-activity.d.ts +9 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-claude-activity.js +49 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-config-options.d.ts +46 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-config-options.js +220 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-doctor.d.ts +3 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-doctor.js +18 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-event-mapper.d.ts +5 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-event-mapper.js +136 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-kill.d.ts +10 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-kill.js +24 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-race.d.ts +6 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-race.js +29 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-session-list.d.ts +32 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-session-list.js +218 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-session-pool.d.ts +85 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-session-pool.js +165 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-session-runner.d.ts +78 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-session-runner.js +550 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-spawn-profiles.d.ts +9 -0
- package/node_modules/@codebridge/backends/dist/acp/acp-spawn-profiles.js +28 -0
- package/node_modules/@codebridge/backends/dist/acp/headless-client.d.ts +19 -0
- package/node_modules/@codebridge/backends/dist/acp/headless-client.js +47 -0
- package/node_modules/@codebridge/backends/dist/acp/index.d.ts +9 -0
- package/node_modules/@codebridge/backends/dist/acp/index.js +9 -0
- package/node_modules/@codebridge/backends/dist/agent-setup.d.ts +60 -0
- package/node_modules/@codebridge/backends/dist/agent-setup.js +504 -0
- package/node_modules/@codebridge/backends/dist/attachment-prompt.d.ts +8 -0
- package/node_modules/@codebridge/backends/dist/attachment-prompt.js +28 -0
- package/node_modules/@codebridge/backends/dist/auth-error-hints.d.ts +8 -0
- package/node_modules/@codebridge/backends/dist/auth-error-hints.js +33 -0
- package/node_modules/@codebridge/backends/dist/codex-skill-commands.d.ts +3 -0
- package/node_modules/@codebridge/backends/dist/codex-skill-commands.js +88 -0
- package/node_modules/@codebridge/backends/dist/index.d.ts +18 -0
- package/node_modules/@codebridge/backends/dist/index.js +34 -0
- package/node_modules/@codebridge/backends/dist/pi-providers.d.ts +45 -0
- package/node_modules/@codebridge/backends/dist/pi-providers.js +148 -0
- package/node_modules/@codebridge/backends/dist/pi-session-runner.d.ts +85 -0
- package/node_modules/@codebridge/backends/dist/pi-session-runner.js +460 -0
- package/node_modules/@codebridge/backends/dist/provider-connection.d.ts +17 -0
- package/node_modules/@codebridge/backends/dist/provider-connection.js +99 -0
- package/node_modules/@codebridge/backends/dist/session-discovery.d.ts +23 -0
- package/node_modules/@codebridge/backends/dist/session-discovery.js +340 -0
- package/node_modules/@codebridge/backends/dist/skill-control-plane.d.ts +147 -0
- package/node_modules/@codebridge/backends/dist/skill-control-plane.js +832 -0
- package/node_modules/@codebridge/backends/package.json +22 -0
- package/node_modules/@codebridge/bridge/dist/alert-notification-rules.d.ts +14 -0
- package/node_modules/@codebridge/bridge/dist/alert-notification-rules.js +37 -0
- package/node_modules/@codebridge/bridge/dist/channel-config.d.ts +4 -0
- package/node_modules/@codebridge/bridge/dist/channel-config.js +9 -0
- package/node_modules/@codebridge/bridge/dist/channel-ingress.d.ts +5 -0
- package/node_modules/@codebridge/bridge/dist/channel-ingress.js +403 -0
- package/node_modules/@codebridge/bridge/dist/cli.d.ts +3 -0
- package/node_modules/@codebridge/bridge/dist/cli.js +581 -0
- package/node_modules/@codebridge/bridge/dist/deployment.d.ts +46 -0
- package/node_modules/@codebridge/bridge/dist/deployment.js +174 -0
- package/node_modules/@codebridge/bridge/dist/event-loop-lag.d.ts +19 -0
- package/node_modules/@codebridge/bridge/dist/event-loop-lag.js +33 -0
- package/node_modules/@codebridge/bridge/dist/feishu-alert-monitor.d.ts +70 -0
- package/node_modules/@codebridge/bridge/dist/feishu-alert-monitor.js +591 -0
- package/node_modules/@codebridge/bridge/dist/init-wizard.d.ts +52 -0
- package/node_modules/@codebridge/bridge/dist/init-wizard.js +571 -0
- package/node_modules/@codebridge/bridge/dist/mcp-api.d.ts +4 -0
- package/node_modules/@codebridge/bridge/dist/mcp-api.js +100 -0
- package/node_modules/@codebridge/bridge/dist/outbound-api.d.ts +31 -0
- package/node_modules/@codebridge/bridge/dist/outbound-api.js +184 -0
- package/node_modules/@codebridge/bridge/dist/outbound-publishers.d.ts +54 -0
- package/node_modules/@codebridge/bridge/dist/outbound-publishers.js +213 -0
- package/node_modules/@codebridge/bridge/dist/project-api.d.ts +4 -0
- package/node_modules/@codebridge/bridge/dist/project-api.js +161 -0
- package/node_modules/@codebridge/bridge/dist/secrets-command.d.ts +13 -0
- package/node_modules/@codebridge/bridge/dist/secrets-command.js +34 -0
- package/node_modules/@codebridge/bridge/dist/session-api.d.ts +26 -0
- package/node_modules/@codebridge/bridge/dist/session-api.js +1378 -0
- package/node_modules/@codebridge/bridge/dist/session-history-import.d.ts +24 -0
- package/node_modules/@codebridge/bridge/dist/session-history-import.js +82 -0
- package/node_modules/@codebridge/bridge/dist/session-runtime-api.d.ts +19 -0
- package/node_modules/@codebridge/bridge/dist/session-runtime-api.js +453 -0
- package/node_modules/@codebridge/bridge/dist/session-runtime-migration.d.ts +21 -0
- package/node_modules/@codebridge/bridge/dist/session-runtime-migration.js +43 -0
- package/node_modules/@codebridge/bridge/dist/session-runtime-types.d.ts +85 -0
- package/node_modules/@codebridge/bridge/dist/session-runtime-types.js +98 -0
- package/node_modules/@codebridge/bridge/dist/skill-api.d.ts +28 -0
- package/node_modules/@codebridge/bridge/dist/skill-api.js +129 -0
- package/node_modules/@codebridge/bridge/dist/startup-surfaces.d.ts +15 -0
- package/node_modules/@codebridge/bridge/dist/startup-surfaces.js +13 -0
- package/node_modules/@codebridge/bridge/dist/web-frontend.d.ts +8 -0
- package/node_modules/@codebridge/bridge/dist/web-frontend.js +76 -0
- package/node_modules/@codebridge/bridge/dist/work-item-api.d.ts +6 -0
- package/node_modules/@codebridge/bridge/dist/work-item-api.js +414 -0
- package/node_modules/@codebridge/bridge/package.json +28 -0
- package/node_modules/@codebridge/channel-feishu/dist/alert-reactions.d.ts +6 -0
- package/node_modules/@codebridge/channel-feishu/dist/alert-reactions.js +58 -0
- package/node_modules/@codebridge/channel-feishu/dist/alert-types.d.ts +35 -0
- package/node_modules/@codebridge/channel-feishu/dist/alert-types.js +2 -0
- package/node_modules/@codebridge/channel-feishu/dist/bridge.d.ts +130 -0
- package/node_modules/@codebridge/channel-feishu/dist/bridge.js +1231 -0
- package/node_modules/@codebridge/channel-feishu/dist/cardkit-writer.d.ts +48 -0
- package/node_modules/@codebridge/channel-feishu/dist/cardkit-writer.js +153 -0
- package/node_modules/@codebridge/channel-feishu/dist/chain-topics.d.ts +20 -0
- package/node_modules/@codebridge/channel-feishu/dist/chain-topics.js +35 -0
- package/node_modules/@codebridge/channel-feishu/dist/coalescing-card-writer.d.ts +12 -0
- package/node_modules/@codebridge/channel-feishu/dist/coalescing-card-writer.js +53 -0
- package/node_modules/@codebridge/channel-feishu/dist/delivery-reconciler.d.ts +19 -0
- package/node_modules/@codebridge/channel-feishu/dist/delivery-reconciler.js +53 -0
- package/node_modules/@codebridge/channel-feishu/dist/durable-markdown-card.d.ts +19 -0
- package/node_modules/@codebridge/channel-feishu/dist/durable-markdown-card.js +77 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-extra-events.d.ts +27 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-extra-events.js +24 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-http.d.ts +4 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-http.js +25 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-context.d.ts +13 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-context.js +45 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-media.d.ts +22 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-media.js +273 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-mention-gate.d.ts +13 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-mention-gate.js +22 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-outbound-file.d.ts +12 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-outbound-file.js +38 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-quoted-message.d.ts +30 -0
- package/node_modules/@codebridge/channel-feishu/dist/feishu-quoted-message.js +183 -0
- package/node_modules/@codebridge/channel-feishu/dist/index.d.ts +7 -0
- package/node_modules/@codebridge/channel-feishu/dist/index.js +3 -0
- package/node_modules/@codebridge/channel-feishu/dist/redacting-logger.d.ts +17 -0
- package/node_modules/@codebridge/channel-feishu/dist/redacting-logger.js +41 -0
- package/node_modules/@codebridge/channel-feishu/dist/run-status.d.ts +39 -0
- package/node_modules/@codebridge/channel-feishu/dist/run-status.js +166 -0
- package/node_modules/@codebridge/channel-feishu/dist/session-watcher.d.ts +98 -0
- package/node_modules/@codebridge/channel-feishu/dist/session-watcher.js +655 -0
- package/node_modules/@codebridge/channel-feishu/package.json +19 -0
- package/node_modules/@codebridge/channel-telegram/dist/coalescing-message-writer.d.ts +14 -0
- package/node_modules/@codebridge/channel-telegram/dist/coalescing-message-writer.js +56 -0
- package/node_modules/@codebridge/channel-telegram/dist/index.d.ts +3 -0
- package/node_modules/@codebridge/channel-telegram/dist/index.js +3 -0
- package/node_modules/@codebridge/channel-telegram/dist/telegram-api.d.ts +62 -0
- package/node_modules/@codebridge/channel-telegram/dist/telegram-api.js +72 -0
- package/node_modules/@codebridge/channel-telegram/dist/telegram-bridge.d.ts +64 -0
- package/node_modules/@codebridge/channel-telegram/dist/telegram-bridge.js +469 -0
- package/node_modules/@codebridge/channel-telegram/dist/telegram-session-watcher.d.ts +41 -0
- package/node_modules/@codebridge/channel-telegram/dist/telegram-session-watcher.js +184 -0
- package/node_modules/@codebridge/channel-telegram/package.json +18 -0
- package/node_modules/@codebridge/core/dist/config-schema.d.ts +1195 -0
- package/node_modules/@codebridge/core/dist/config-schema.js +293 -0
- package/node_modules/@codebridge/core/dist/config-store.d.ts +48 -0
- package/node_modules/@codebridge/core/dist/config-store.js +207 -0
- package/node_modules/@codebridge/core/dist/index.d.ts +11 -0
- package/node_modules/@codebridge/core/dist/index.js +10 -0
- package/node_modules/@codebridge/core/dist/json-file-store.d.ts +16 -0
- package/node_modules/@codebridge/core/dist/json-file-store.js +46 -0
- package/node_modules/@codebridge/core/dist/mcp-types.d.ts +7 -0
- package/node_modules/@codebridge/core/dist/mcp-types.js +2 -0
- package/node_modules/@codebridge/core/dist/mentions.d.ts +36 -0
- package/node_modules/@codebridge/core/dist/mentions.js +138 -0
- package/node_modules/@codebridge/core/dist/secret-migration.d.ts +14 -0
- package/node_modules/@codebridge/core/dist/secret-migration.js +55 -0
- package/node_modules/@codebridge/core/dist/secret-refs.d.ts +34 -0
- package/node_modules/@codebridge/core/dist/secret-refs.js +142 -0
- package/node_modules/@codebridge/core/dist/session-event-wire.d.ts +17 -0
- package/node_modules/@codebridge/core/dist/session-event-wire.js +28 -0
- package/node_modules/@codebridge/core/dist/types.d.ts +363 -0
- package/node_modules/@codebridge/core/dist/types.js +22 -0
- package/node_modules/@codebridge/core/dist/workspace-key.d.ts +11 -0
- package/node_modules/@codebridge/core/dist/workspace-key.js +25 -0
- package/node_modules/@codebridge/core/package.json +22 -0
- package/node_modules/@codebridge/mcp-runtime/dist/.tsbuildinfo +1 -0
- package/node_modules/@codebridge/mcp-runtime/dist/index.d.ts +92 -0
- package/node_modules/@codebridge/mcp-runtime/dist/index.js +377 -0
- package/node_modules/@codebridge/mcp-runtime/package.json +19 -0
- package/node_modules/@codebridge/policy/dist/capability-runtime.d.ts +123 -0
- package/node_modules/@codebridge/policy/dist/capability-runtime.js +195 -0
- package/node_modules/@codebridge/policy/dist/demo-capabilities.d.ts +4 -0
- package/node_modules/@codebridge/policy/dist/demo-capabilities.js +134 -0
- package/node_modules/@codebridge/policy/dist/equity-capabilities.d.ts +8 -0
- package/node_modules/@codebridge/policy/dist/equity-capabilities.js +35 -0
- package/node_modules/@codebridge/policy/dist/index.d.ts +107 -0
- package/node_modules/@codebridge/policy/dist/index.js +317 -0
- package/node_modules/@codebridge/policy/package.json +17 -0
- package/node_modules/@codebridge/project-catalog/dist/index.d.ts +145 -0
- package/node_modules/@codebridge/project-catalog/dist/index.js +699 -0
- package/node_modules/@codebridge/project-catalog/package.json +18 -0
- package/node_modules/@codebridge/router/dist/channel-stream-projector.d.ts +19 -0
- package/node_modules/@codebridge/router/dist/channel-stream-projector.js +68 -0
- package/node_modules/@codebridge/router/dist/command-help.d.ts +14 -0
- package/node_modules/@codebridge/router/dist/command-help.js +151 -0
- package/node_modules/@codebridge/router/dist/feishu-stream-presenter.d.ts +18 -0
- package/node_modules/@codebridge/router/dist/feishu-stream-presenter.js +193 -0
- package/node_modules/@codebridge/router/dist/index.d.ts +9 -0
- package/node_modules/@codebridge/router/dist/index.js +9 -0
- package/node_modules/@codebridge/router/dist/model-effort.d.ts +5 -0
- package/node_modules/@codebridge/router/dist/model-effort.js +33 -0
- package/node_modules/@codebridge/router/dist/orchestrator.d.ts +56 -0
- package/node_modules/@codebridge/router/dist/orchestrator.js +290 -0
- package/node_modules/@codebridge/router/dist/session-list-format.d.ts +19 -0
- package/node_modules/@codebridge/router/dist/session-list-format.js +97 -0
- package/node_modules/@codebridge/router/dist/session-rotation.d.ts +9 -0
- package/node_modules/@codebridge/router/dist/session-rotation.js +31 -0
- package/node_modules/@codebridge/router/dist/session-router.d.ts +59 -0
- package/node_modules/@codebridge/router/dist/session-router.js +182 -0
- package/node_modules/@codebridge/router/dist/slash-commands.d.ts +78 -0
- package/node_modules/@codebridge/router/dist/slash-commands.js +874 -0
- package/node_modules/@codebridge/router/package.json +18 -0
- package/node_modules/@codebridge/run-executor/dist/agent-event-aggregator.d.ts +18 -0
- package/node_modules/@codebridge/run-executor/dist/agent-event-aggregator.js +88 -0
- package/node_modules/@codebridge/run-executor/dist/index.d.ts +55 -0
- package/node_modules/@codebridge/run-executor/dist/index.js +754 -0
- package/node_modules/@codebridge/run-executor/dist/run-heartbeat.d.ts +14 -0
- package/node_modules/@codebridge/run-executor/dist/run-heartbeat.js +24 -0
- package/node_modules/@codebridge/run-executor/package.json +20 -0
- package/node_modules/@codebridge/runner-client/dist/index.d.ts +142 -0
- package/node_modules/@codebridge/runner-client/dist/index.js +439 -0
- package/node_modules/@codebridge/runner-client/package.json +18 -0
- package/node_modules/@codebridge/runner-host/dist/cli.d.ts +3 -0
- package/node_modules/@codebridge/runner-host/dist/cli.js +58 -0
- package/node_modules/@codebridge/runner-host/dist/codex-session-ownership.d.ts +13 -0
- package/node_modules/@codebridge/runner-host/dist/codex-session-ownership.js +79 -0
- package/node_modules/@codebridge/runner-host/dist/deployment-mcp-server.d.ts +10 -0
- package/node_modules/@codebridge/runner-host/dist/deployment-mcp-server.js +54 -0
- package/node_modules/@codebridge/runner-host/dist/fcb-script.d.ts +3 -0
- package/node_modules/@codebridge/runner-host/dist/fcb-script.js +99 -0
- package/node_modules/@codebridge/runner-host/dist/index.d.ts +3 -0
- package/node_modules/@codebridge/runner-host/dist/index.js +2 -0
- package/node_modules/@codebridge/runner-host/dist/materialize-attachments.d.ts +4 -0
- package/node_modules/@codebridge/runner-host/dist/materialize-attachments.js +62 -0
- package/node_modules/@codebridge/runner-host/dist/server.d.ts +150 -0
- package/node_modules/@codebridge/runner-host/dist/server.js +1295 -0
- package/node_modules/@codebridge/runner-host/dist/session-lease.d.ts +12 -0
- package/node_modules/@codebridge/runner-host/dist/session-lease.js +146 -0
- package/node_modules/@codebridge/runner-host/package.json +26 -0
- package/node_modules/@codebridge/session-catalog/dist/index.d.ts +124 -0
- package/node_modules/@codebridge/session-catalog/dist/index.js +411 -0
- package/node_modules/@codebridge/session-catalog/package.json +17 -0
- package/node_modules/@codebridge/session-coordinator/dist/coordinator.d.ts +111 -0
- package/node_modules/@codebridge/session-coordinator/dist/coordinator.js +364 -0
- package/node_modules/@codebridge/session-coordinator/dist/index.d.ts +5 -0
- package/node_modules/@codebridge/session-coordinator/dist/index.js +5 -0
- package/node_modules/@codebridge/session-coordinator/dist/lease.d.ts +14 -0
- package/node_modules/@codebridge/session-coordinator/dist/lease.js +26 -0
- package/node_modules/@codebridge/session-coordinator/dist/queued-claim.d.ts +20 -0
- package/node_modules/@codebridge/session-coordinator/dist/queued-claim.js +45 -0
- package/node_modules/@codebridge/session-coordinator/dist/recovery.d.ts +31 -0
- package/node_modules/@codebridge/session-coordinator/dist/recovery.js +114 -0
- package/node_modules/@codebridge/session-coordinator/package.json +17 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/node_modules/@codebridge/web/dist/assets/abnfDiagram-N423BO3Z-C-JdFv0U.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/arc-DsNROjzU.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/architecture-TIHT7OUA-ZEBHG2JZ.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/architectureDiagram-T3A2C74G-OsrxcwPM.js +36 -0
- package/node_modules/@codebridge/web/dist/assets/array-BifhSqXX.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/blockDiagram-VBNYF7ZC-DRgfNeNW.js +132 -0
- package/node_modules/@codebridge/web/dist/assets/c4Diagram-5PPSVZJV-BtOGKTh8.js +10 -0
- package/node_modules/@codebridge/web/dist/assets/channel-MhXyjxUS.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-2GRJ4B5K-Dy1gJ7sY.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-4I5QYGJK-1pOLR_SG.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-5RXB4S5H-CP43rgsO.js +231 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-6Q2QTUOP-Bi3Xrp6W.js +88 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-7Z6QIM7H-CILAW2Nk.js +10 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-GF5L2VYU-CAp09yhq.js +206 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-I66GZJ75-B_rJXmNu.js +128 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-JQJVKLGR-OVeOJFCx.js +156 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-KBJHAD2P-uaupp0k5.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-KEIR6QF5-BICK3FdT.js +161 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-NSK5VX7P-fIHF5wwn.js +2 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-QR6OTTB3-DxkJuF2b.js +62 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-RYQCIY6F-CC5j3u-X.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-UBXNYLIW-DB35O-6R.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-W5SLKNZC-bkRBsbq-.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-WRU74C26-DwvEoD-1.js +70 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-XXDRQBXY-DRyYA-HY.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/classDiagram-JCYQIIEL-B8r7z8ii.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/classDiagram-v2-OCEON4UE-B8r7z8ii.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/cose-bilkent-JH36ORCC-CLkwlrX7.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/cynefin-VYW2F7L2-C3_Llw02.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/cynefinDiagram-MW4NZA55-D5v7UnJy.js +62 -0
- package/node_modules/@codebridge/web/dist/assets/cytoscape.esm-B-NFISlW.js +321 -0
- package/node_modules/@codebridge/web/dist/assets/dagre-Buvkdvvj.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/dagre-VZM6K2ZE-Cr0IibwW.js +4 -0
- package/node_modules/@codebridge/web/dist/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/diagram-7IWD3JNH-CpQXDIzA.js +30 -0
- package/node_modules/@codebridge/web/dist/assets/diagram-B4RE2ZJO-VaOkH0Ya.js +3 -0
- package/node_modules/@codebridge/web/dist/assets/diagram-LBJQPF4R-D0iXyNks.js +24 -0
- package/node_modules/@codebridge/web/dist/assets/diagram-Q27KOJAE-CtqYk01P.js +24 -0
- package/node_modules/@codebridge/web/dist/assets/diagram-UB23O5K3-CFnd3H1_.js +41 -0
- package/node_modules/@codebridge/web/dist/assets/dist-D2L7nRdk.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/ebnfDiagram-BXEA7PRR-B0GIbJYt.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/erDiagram-JOGREHBK-BApaLGVA.js +85 -0
- package/node_modules/@codebridge/web/dist/assets/eventmodeling-45OFAUF4-DqGGjcld.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/flowDiagram-UKHOOZJN-I_qlizLH.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/ganttDiagram-PKOTCBZU-B-QZ-J82.js +292 -0
- package/node_modules/@codebridge/web/dist/assets/gitGraph-TEB2WS4Q-DK2SJ2Ne.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/gitGraphDiagram-DS77QQ5N-B6Z-pu0D.js +106 -0
- package/node_modules/@codebridge/web/dist/assets/graphlib-DS17s2tU.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/index-8BzpyygS.js +559 -0
- package/node_modules/@codebridge/web/dist/assets/index-Bzaz89LE.css +1 -0
- package/node_modules/@codebridge/web/dist/assets/info-DKCQHKI2-CGWxt_Py.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/infoDiagram-6WML65LV-77XjrPZs.js +2 -0
- package/node_modules/@codebridge/web/dist/assets/init-C-OQMol4.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/ishikawaDiagram-WSZJBQD7-P1bZAz2x.js +70 -0
- package/node_modules/@codebridge/web/dist/assets/journeyDiagram-NVQOT4AX-C4rwMcBY.js +139 -0
- package/node_modules/@codebridge/web/dist/assets/kanban-definition-27J2QSJJ-mtw4a9bc.js +89 -0
- package/node_modules/@codebridge/web/dist/assets/line-DP4RkYqm.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/linear-DMg3PPio.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/map-BaFkSB1l.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/mermaid-parser.core-HY84kHw1.js +7 -0
- package/node_modules/@codebridge/web/dist/assets/mermaid.core-DdgCdsnM.js +42 -0
- package/node_modules/@codebridge/web/dist/assets/mindmap-definition-FAOFIHXS-Cw1EnbhZ.js +96 -0
- package/node_modules/@codebridge/web/dist/assets/ordinal-BDEzSJ7C.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/packet-7NZHBO7P-CEbrbJH3.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/path-fybaL0A-.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/pegDiagram-VL7TDLO6-CEc1Gedb.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/pie-RZYD4A2V-DPXVs-IW.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/pieDiagram-7S7Q4E2Y-hoQeGMFH.js +39 -0
- package/node_modules/@codebridge/web/dist/assets/quadrantDiagram-CIZ2JOQS-C-Nmxx0f.js +7 -0
- package/node_modules/@codebridge/web/dist/assets/radar-I7S5WNFK-BVd3X3Pd.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/railroad-3IZDKUUU-CxLxzr_v.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/railroad-abnf-AHOZXSZD-MA1zPI84.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/railroad-ebnf-EBAXGLYW-Bqug_umD.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/railroad-peg-LSFZ7HO6-DRcRFwpq.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/railroadDiagram-AXF67PYL-B007ZkL9.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/requirementDiagram-LRYGKXZP-LrTCcEi5.js +84 -0
- package/node_modules/@codebridge/web/dist/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/sankeyDiagram-W5VNT64P-Ch4mzHck.js +40 -0
- package/node_modules/@codebridge/web/dist/assets/sequenceDiagram-SI44F4Z6-CHg4OzLX.js +162 -0
- package/node_modules/@codebridge/web/dist/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/src-BrO6_odD.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/stateDiagram-OKZ733FA-7cVkr5nR.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/stateDiagram-v2-UEYNNEHI-CTy_mAXb.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/swimlanes-SLNWSIFB-BwSVF5qy.js +2 -0
- package/node_modules/@codebridge/web/dist/assets/swimlanesDiagram-ULZ7WXOC-BBQnfZ1j.js +8 -0
- package/node_modules/@codebridge/web/dist/assets/timeline-definition-Z64GVDOM-BaHEkVDV.js +120 -0
- package/node_modules/@codebridge/web/dist/assets/treeView-QDETBFTQ-CF0kLN62.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/treemap-6X3UGDF4-BB8A8uux.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/vennDiagram-T6HMQDX7-BFK12Iro.js +34 -0
- package/node_modules/@codebridge/web/dist/assets/wardley-OPB4EBWU-C_3y61zk.js +1 -0
- package/node_modules/@codebridge/web/dist/assets/wardleyDiagram-T6FBY63Y-W2oGu4WK.js +78 -0
- package/node_modules/@codebridge/web/dist/assets/xychartDiagram-ELKLHX3M-BiVRnbvz.js +7 -0
- package/node_modules/@codebridge/web/dist/brand/agent-logo-carbon.svg +1 -0
- package/node_modules/@codebridge/web/dist/brand/agent-logo.svg +1 -0
- package/node_modules/@codebridge/web/dist/brand/agnet-logo-carbon.svg +1 -0
- package/node_modules/@codebridge/web/dist/brand/agnet-logo.svg +1 -0
- package/node_modules/@codebridge/web/dist/brand/agnet-mark-carbon.svg +1 -0
- package/node_modules/@codebridge/web/dist/brand/agnet-mark.svg +1 -0
- package/node_modules/@codebridge/web/dist/fonts/CommitMono-400-Regular.otf +0 -0
- package/node_modules/@codebridge/web/dist/fonts/CommitMono-700-Regular.otf +0 -0
- package/node_modules/@codebridge/web/dist/fonts/CommitMono-OFL.txt +21 -0
- package/node_modules/@codebridge/web/dist/fonts/DepartureMono-OFL.txt +21 -0
- package/node_modules/@codebridge/web/dist/fonts/DepartureMono-Regular.woff2 +0 -0
- package/node_modules/@codebridge/web/dist/index.html +25 -0
- package/node_modules/@codebridge/web/package.json +7 -0
- package/node_modules/@codebridge/work-items/dist/index.d.ts +371 -0
- package/node_modules/@codebridge/work-items/dist/index.js +1784 -0
- package/node_modules/@codebridge/work-items/dist/session-projector.d.ts +4 -0
- package/node_modules/@codebridge/work-items/dist/session-projector.js +506 -0
- package/node_modules/@codebridge/work-items/dist/session-runtime.d.ts +274 -0
- package/node_modules/@codebridge/work-items/dist/session-runtime.js +1103 -0
- package/node_modules/@codebridge/work-items/dist/session-schema.d.ts +9 -0
- package/node_modules/@codebridge/work-items/dist/session-schema.js +292 -0
- package/node_modules/@codebridge/work-items/package.json +20 -0
- package/package.json +75 -4
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { methods, } from "@agentclientprotocol/sdk";
|
|
2
|
+
/** 展平 select 选项(可能是「分组」结构),拿到全部可选值 */
|
|
3
|
+
function flattenSelectOptions(option) {
|
|
4
|
+
if (option.type !== "select")
|
|
5
|
+
return [];
|
|
6
|
+
const out = [];
|
|
7
|
+
for (const entry of option.options) {
|
|
8
|
+
if ("group" in entry)
|
|
9
|
+
out.push(...entry.options);
|
|
10
|
+
else
|
|
11
|
+
out.push(entry);
|
|
12
|
+
}
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 把用户输入(如 `sonnet` / `opus` / `medium`)匹配到 advertise 的某个 value id:
|
|
17
|
+
* 精确 value → 大小写不敏感 name → 大小写不敏感 value 前缀(把 `opus` 映射到 `opus[1m]`)。
|
|
18
|
+
* 匹配不到返回 undefined。
|
|
19
|
+
*/
|
|
20
|
+
const TRAILING_BRACKET_HINT = /\[[^\]]*\]$/;
|
|
21
|
+
/** 去掉末尾一个方括号提示(如 `[1m]`),供上下文窗口变体不一致时兜底匹配 */
|
|
22
|
+
function stripTrailingHint(value) {
|
|
23
|
+
return value.replace(TRAILING_BRACKET_HINT, "");
|
|
24
|
+
}
|
|
25
|
+
export function matchConfigValue(option, desired) {
|
|
26
|
+
const opts = flattenSelectOptions(option);
|
|
27
|
+
const want = desired.trim().toLowerCase();
|
|
28
|
+
const wantStripped = stripTrailingHint(want);
|
|
29
|
+
return (opts.find((o) => o.value.toLowerCase() === want)?.value ??
|
|
30
|
+
opts.find((o) => o.name.toLowerCase() === want)?.value ??
|
|
31
|
+
opts.find((o) => o.value.toLowerCase().startsWith(want))?.value ??
|
|
32
|
+
opts.find((o) => stripTrailingHint(o.value.toLowerCase()) === wantStripped)
|
|
33
|
+
?.value);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 由 RunContext + 全局 permission 策略解析本轮想要的三项 ACP 配置:
|
|
37
|
+
* - model/effort:有则设、无则不设(尊重适配器默认);
|
|
38
|
+
* - mode:三个后端都接受 `/permission` 的显式会话覆盖;Claude 未覆盖时再使用兼容配置或
|
|
39
|
+
* acpPermissionPolicy 推导默认值,让 requestPermission 处理器与全局策略保持一致。
|
|
40
|
+
*/
|
|
41
|
+
export function resolveDesiredConfig(ctx, permissionPolicy) {
|
|
42
|
+
const bc = ctx.backendConfig;
|
|
43
|
+
const desired = {
|
|
44
|
+
model: ctx.model ?? bc.model,
|
|
45
|
+
effort: ctx.effort ?? bc.effort,
|
|
46
|
+
permissionMode: ctx.mode,
|
|
47
|
+
strictModel: bc.strictModel ?? false,
|
|
48
|
+
};
|
|
49
|
+
if (bc.type === "claude-code") {
|
|
50
|
+
// prompt_deny / prompt_feishu 都需要适配器真的「发问」(default 模式):
|
|
51
|
+
// prompt_deny 由客户端 handler 拒,prompt_feishu 转发飞书等 /approve。
|
|
52
|
+
// 只有 auto_allow 才使用 bypassPermissions(不问直接放行)。
|
|
53
|
+
desired.permissionMode ??=
|
|
54
|
+
ctx.claudePermissionMode ??
|
|
55
|
+
bc.claudePermissionMode ??
|
|
56
|
+
(permissionPolicy === "auto_allow" ? "bypassPermissions" : "default");
|
|
57
|
+
}
|
|
58
|
+
return desired;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 把 SDK 的 configOptions(含分组 select)映射为跨包共享的精简形态,供 /model 等
|
|
62
|
+
* 动态列表展示。select 和 boolean 都保留,供 /model 与通用 /config 使用。
|
|
63
|
+
*/
|
|
64
|
+
export function mapSessionConfigOptions(options) {
|
|
65
|
+
const out = [];
|
|
66
|
+
for (const option of options) {
|
|
67
|
+
if (option.type === "boolean") {
|
|
68
|
+
out.push({
|
|
69
|
+
id: option.id,
|
|
70
|
+
name: option.name,
|
|
71
|
+
type: "boolean",
|
|
72
|
+
category: option.category ?? undefined,
|
|
73
|
+
currentValue: String(option.currentValue),
|
|
74
|
+
values: [
|
|
75
|
+
{ value: "true", name: "On" },
|
|
76
|
+
{ value: "false", name: "Off" },
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
out.push({
|
|
82
|
+
id: option.id,
|
|
83
|
+
name: option.name,
|
|
84
|
+
type: "select",
|
|
85
|
+
category: option.category ?? undefined,
|
|
86
|
+
currentValue: option.currentValue,
|
|
87
|
+
values: flattenSelectOptions(option).map((v) => ({
|
|
88
|
+
value: v.value,
|
|
89
|
+
name: v.name || undefined,
|
|
90
|
+
description: v.description ?? undefined,
|
|
91
|
+
})),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/** desired 里想设的项与 advertise 选项的 category 映射 */
|
|
97
|
+
const CATEGORY_BY_FIELD = {
|
|
98
|
+
model: "model",
|
|
99
|
+
effort: "thought_level",
|
|
100
|
+
permissionMode: "mode",
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* 会话打开后、首个 prompt 之前,用 ACP 标准 `session/set_config_option`(Zed 同款机制)把
|
|
104
|
+
* 想要的 model/effort/permission 应用到会话上。适配器 advertise 的选项来自
|
|
105
|
+
* `newSessionResponse.configOptions`(新建 + claude 续聊均带)。每次运行都要重设:续聊到新
|
|
106
|
+
* 适配器进程时 model 会退回适配器默认(实测 Fable 5)。匹配不到的项只收集非致命 warning、不中断
|
|
107
|
+
* ——适配器没有对应 category 时就自然跳过(除非 desired.strictModel 对 model 字段要求硬失败)。
|
|
108
|
+
*/
|
|
109
|
+
export async function applySessionConfigOptions(agent, sessionId, configOptions, desired, custom = {}) {
|
|
110
|
+
const warnings = [];
|
|
111
|
+
let currentOptions = configOptions;
|
|
112
|
+
let modelMismatch;
|
|
113
|
+
for (const [field, category] of Object.entries(CATEGORY_BY_FIELD)) {
|
|
114
|
+
const wanted = desired[field];
|
|
115
|
+
if (!wanted || typeof wanted !== "string")
|
|
116
|
+
continue;
|
|
117
|
+
const option = currentOptions.find((o) => o.category === category);
|
|
118
|
+
if (!option) {
|
|
119
|
+
if (field === "model" && desired.strictModel) {
|
|
120
|
+
throw new Error(`ACP model=${wanted} 未生效:当前会话未提供 model 配置项(strictModel 已启用,本轮已终止)。`);
|
|
121
|
+
}
|
|
122
|
+
warnings.push(`ACP 会话未提供 ${field} 选项,${field}=${wanted} 未生效。`);
|
|
123
|
+
if (field === "model")
|
|
124
|
+
modelMismatch = { requested: wanted };
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const value = matchConfigValue(option, wanted);
|
|
128
|
+
if (!value) {
|
|
129
|
+
const offered = flattenSelectOptions(option).map((o) => o.value);
|
|
130
|
+
const offeredText = offered.length > 0 ? offered.join("、") : "(空)";
|
|
131
|
+
console.warn(`[acp-config-options] session=${sessionId} field=${field} wanted=${wanted} offered=[${offeredText}] currentValue=${String(option.currentValue)}`);
|
|
132
|
+
if (field === "model" && desired.strictModel) {
|
|
133
|
+
throw new Error(`ACP model=${wanted} 不在可选值内(strictModel 已启用,本轮已终止)。 适配器本次提供:${offeredText}。`);
|
|
134
|
+
}
|
|
135
|
+
warnings.push(`ACP ${field}=${wanted} 不在可选值内,未生效。 适配器本次提供:${offeredText}。`);
|
|
136
|
+
if (field === "model") {
|
|
137
|
+
modelMismatch = {
|
|
138
|
+
requested: wanted,
|
|
139
|
+
...(typeof option.currentValue === "string"
|
|
140
|
+
? { effective: option.currentValue }
|
|
141
|
+
: {}),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const response = await agent.request(methods.agent.session.setConfigOption, {
|
|
148
|
+
sessionId,
|
|
149
|
+
configId: option.id,
|
|
150
|
+
value,
|
|
151
|
+
});
|
|
152
|
+
currentOptions = response.configOptions;
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
156
|
+
warnings.push(`ACP 设置 ${field}=${value} 失败:${msg}`);
|
|
157
|
+
if (field === "model") {
|
|
158
|
+
modelMismatch = {
|
|
159
|
+
requested: wanted,
|
|
160
|
+
...(typeof option.currentValue === "string"
|
|
161
|
+
? { effective: option.currentValue }
|
|
162
|
+
: {}),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
for (const [configId, wanted] of Object.entries(custom)) {
|
|
168
|
+
const option = currentOptions.find((candidate) => candidate.id === configId);
|
|
169
|
+
if (!option) {
|
|
170
|
+
warnings.push(`ACP config=${configId} 未在当前会话能力中找到,未生效。`);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
let params;
|
|
174
|
+
if (option.type === "boolean") {
|
|
175
|
+
if (typeof wanted !== "boolean") {
|
|
176
|
+
warnings.push(`ACP config=${configId} 需要 boolean 值,未生效。`);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
params = { sessionId, configId, type: "boolean", value: wanted };
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
if (typeof wanted !== "string") {
|
|
183
|
+
warnings.push(`ACP config=${configId} 需要 select 值,未生效。`);
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const value = matchConfigValue(option, wanted);
|
|
187
|
+
if (!value) {
|
|
188
|
+
warnings.push(`ACP config=${configId}=${wanted} 不在可选值内,未生效。`);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
params = { sessionId, configId, value };
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const response = (await agent.request(methods.agent.session.setConfigOption, params));
|
|
195
|
+
currentOptions = response.configOptions;
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
199
|
+
warnings.push(`ACP 设置 config=${configId} 失败:${msg}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// 读回本轮 set-config 回合后 model 分类的实际 currentValue:适配器可能规范化了 value,
|
|
203
|
+
// 或(未 strictModel 时)压根没采纳 desired.model,这里给上层一个真相来源而非「想要的值」。
|
|
204
|
+
const modelOption = currentOptions.find((o) => o.category === "model");
|
|
205
|
+
const modelCurrentValue = modelOption?.currentValue;
|
|
206
|
+
const effectiveModel = typeof modelCurrentValue === "string" ? modelCurrentValue : undefined;
|
|
207
|
+
if (modelMismatch && effectiveModel !== undefined) {
|
|
208
|
+
modelMismatch = { ...modelMismatch, effective: effectiveModel };
|
|
209
|
+
}
|
|
210
|
+
// 适配器的 value 是机器口径(`opus[1m]`、`grok-4.6[effort=high,fast=true]`),
|
|
211
|
+
// 同一条目自带可读的 name(`Opus 5`、`grok-4.6`)。带上 name,让上层能说人话。
|
|
212
|
+
if (modelMismatch?.effective && modelOption) {
|
|
213
|
+
const name = flattenSelectOptions(modelOption).find((candidate) => candidate.value === modelMismatch.effective)?.name;
|
|
214
|
+
if (name && name !== modelMismatch.effective) {
|
|
215
|
+
modelMismatch = { ...modelMismatch, effectiveName: name };
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return { warnings, configOptions: currentOptions, effectiveModel, modelMismatch };
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=acp-config-options.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { probeAcpInitialize } from "./acp-session-list.js";
|
|
2
|
+
import { probePiSdk } from "../pi-session-runner.js";
|
|
3
|
+
export async function detectBackend(id, profile, cwd) {
|
|
4
|
+
const acp = profile.type === "pi-sdk"
|
|
5
|
+
? await probePiSdk(cwd)
|
|
6
|
+
: await probeAcpInitialize(profile, cwd);
|
|
7
|
+
return {
|
|
8
|
+
ok: acp.ok,
|
|
9
|
+
checks: [
|
|
10
|
+
{
|
|
11
|
+
name: `${id}:${profile.type === "pi-sdk" ? "sdk" : "acp-initialize"}`,
|
|
12
|
+
ok: acp.ok,
|
|
13
|
+
message: acp.message,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=acp-doctor.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AgentEvent } from "@codebridge/core";
|
|
2
|
+
import type { SessionUpdate } from "@agentclientprotocol/sdk";
|
|
3
|
+
/** Map ACP session/update payloads to bridge AgentEvent stream. */
|
|
4
|
+
export declare function mapSessionUpdate(update: SessionUpdate): AgentEvent[];
|
|
5
|
+
//# sourceMappingURL=acp-event-mapper.d.ts.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { mapSessionConfigOptions } from "./acp-config-options.js";
|
|
2
|
+
function codexMessagePhase(update) {
|
|
3
|
+
const phase = update._meta?.codex?.phase;
|
|
4
|
+
return phase === "commentary" || phase === "final_answer"
|
|
5
|
+
? phase
|
|
6
|
+
: undefined;
|
|
7
|
+
}
|
|
8
|
+
function textFromContent(content) {
|
|
9
|
+
if (content.type === "text" && typeof content.text === "string") {
|
|
10
|
+
return content.text;
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
/** Map ACP session/update payloads to bridge AgentEvent stream. */
|
|
15
|
+
export function mapSessionUpdate(update) {
|
|
16
|
+
switch (update.sessionUpdate) {
|
|
17
|
+
case "agent_message_chunk": {
|
|
18
|
+
const text = textFromContent(update.content);
|
|
19
|
+
const phase = codexMessagePhase(update);
|
|
20
|
+
return text
|
|
21
|
+
? [
|
|
22
|
+
{
|
|
23
|
+
type: "text_delta",
|
|
24
|
+
text,
|
|
25
|
+
...(update.messageId ? { messageId: update.messageId } : {}),
|
|
26
|
+
...(phase ? { phase } : {}),
|
|
27
|
+
},
|
|
28
|
+
]
|
|
29
|
+
: [];
|
|
30
|
+
}
|
|
31
|
+
case "agent_thought_chunk": {
|
|
32
|
+
const text = textFromContent(update.content);
|
|
33
|
+
return text
|
|
34
|
+
? [
|
|
35
|
+
{
|
|
36
|
+
type: "thought_delta",
|
|
37
|
+
text,
|
|
38
|
+
...(update.messageId ? { messageId: update.messageId } : {}),
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
: [];
|
|
42
|
+
}
|
|
43
|
+
case "tool_call": {
|
|
44
|
+
const name = update.title || update.kind || "tool";
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
type: "tool_start",
|
|
48
|
+
toolCallId: update.toolCallId,
|
|
49
|
+
name,
|
|
50
|
+
...(update.kind ? { kind: update.kind } : {}),
|
|
51
|
+
...(update.status ? { status: update.status } : {}),
|
|
52
|
+
input: update.rawInput ?? update,
|
|
53
|
+
...(update.content ? { content: update.content } : {}),
|
|
54
|
+
...(update.locations ? { locations: update.locations } : {}),
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
case "tool_call_update": {
|
|
59
|
+
const name = update.title || update.kind;
|
|
60
|
+
if (update.status === "completed" || update.status === "failed") {
|
|
61
|
+
return [
|
|
62
|
+
{
|
|
63
|
+
type: "tool_end",
|
|
64
|
+
toolCallId: update.toolCallId,
|
|
65
|
+
...(name ? { name } : {}),
|
|
66
|
+
...(update.status ? { status: update.status } : {}),
|
|
67
|
+
...(update.rawOutput !== undefined
|
|
68
|
+
? { output: update.rawOutput }
|
|
69
|
+
: {}),
|
|
70
|
+
...(update.content ? { content: update.content } : {}),
|
|
71
|
+
...(update.locations ? { locations: update.locations } : {}),
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
return [
|
|
76
|
+
{
|
|
77
|
+
type: "tool_update",
|
|
78
|
+
toolCallId: update.toolCallId,
|
|
79
|
+
...(name ? { name } : {}),
|
|
80
|
+
...(update.status ? { status: update.status } : {}),
|
|
81
|
+
...(update.content ? { content: update.content } : {}),
|
|
82
|
+
...(update.locations ? { locations: update.locations } : {}),
|
|
83
|
+
...(update.rawOutput !== undefined
|
|
84
|
+
? { output: update.rawOutput }
|
|
85
|
+
: {}),
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
case "plan":
|
|
90
|
+
return [{ type: "plan", entries: update.entries }];
|
|
91
|
+
case "plan_update":
|
|
92
|
+
return [{ type: "plan_update", plan: update.plan }];
|
|
93
|
+
case "plan_removed":
|
|
94
|
+
return [{ type: "plan_removed", planId: update.planId }];
|
|
95
|
+
case "available_commands_update":
|
|
96
|
+
return [
|
|
97
|
+
{
|
|
98
|
+
type: "available_commands_update",
|
|
99
|
+
availableCommands: update.availableCommands,
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
case "current_mode_update":
|
|
103
|
+
return [
|
|
104
|
+
{ type: "current_mode_update", currentModeId: update.currentModeId },
|
|
105
|
+
];
|
|
106
|
+
case "config_option_update":
|
|
107
|
+
return [
|
|
108
|
+
{
|
|
109
|
+
type: "config_option_update",
|
|
110
|
+
configOptions: mapSessionConfigOptions(update.configOptions),
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
case "session_info_update":
|
|
114
|
+
return [
|
|
115
|
+
{
|
|
116
|
+
type: "session_info_update",
|
|
117
|
+
...(update.title !== undefined ? { title: update.title } : {}),
|
|
118
|
+
...(update.updatedAt !== undefined
|
|
119
|
+
? { updatedAt: update.updatedAt }
|
|
120
|
+
: {}),
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
case "usage_update":
|
|
124
|
+
return [
|
|
125
|
+
{
|
|
126
|
+
type: "usage_update",
|
|
127
|
+
used: update.used,
|
|
128
|
+
size: update.size,
|
|
129
|
+
...(update.cost !== undefined ? { cost: update.cost } : {}),
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
default:
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=acp-event-mapper.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
/**
|
|
3
|
+
* 杀掉 agent 子进程的整棵进程树。适配器链常有孙进程(如 codex-acp 底下的
|
|
4
|
+
* `codex app-server`):SIGTERM 会沿链转发、全树退出,但 SIGKILL 不转发——
|
|
5
|
+
* 兜底升级到 SIGKILL 时只杀包装进程会把孙进程留成孤儿。因此 spawn 时用
|
|
6
|
+
* `detached: true` 让子进程自成进程组,这里对整组(-pid)发信号;万一组
|
|
7
|
+
* 信号失败(进程已死/平台差异)退回单进程 kill。
|
|
8
|
+
*/
|
|
9
|
+
export declare function killProcessTree(child: ChildProcess, signal: NodeJS.Signals): void;
|
|
10
|
+
//# sourceMappingURL=acp-kill.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 杀掉 agent 子进程的整棵进程树。适配器链常有孙进程(如 codex-acp 底下的
|
|
3
|
+
* `codex app-server`):SIGTERM 会沿链转发、全树退出,但 SIGKILL 不转发——
|
|
4
|
+
* 兜底升级到 SIGKILL 时只杀包装进程会把孙进程留成孤儿。因此 spawn 时用
|
|
5
|
+
* `detached: true` 让子进程自成进程组,这里对整组(-pid)发信号;万一组
|
|
6
|
+
* 信号失败(进程已死/平台差异)退回单进程 kill。
|
|
7
|
+
*/
|
|
8
|
+
export function killProcessTree(child, signal) {
|
|
9
|
+
const pid = child.pid;
|
|
10
|
+
if (pid === undefined)
|
|
11
|
+
return;
|
|
12
|
+
try {
|
|
13
|
+
process.kill(-pid, signal);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
try {
|
|
17
|
+
child.kill(signal);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// 进程已不存在
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=acp-kill.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class AcpTimeoutError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
/** 轮询 abort + 总超时,避免 session/load 等 RPC 永久挂起 */
|
|
5
|
+
export declare function raceWithAbort<T>(promise: Promise<T>, isAborted: () => boolean, timeoutMs: number, timeoutMessage: string): Promise<T>;
|
|
6
|
+
//# sourceMappingURL=acp-race.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class AcpTimeoutError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = "AcpTimeoutError";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
async function sleep(ms) {
|
|
8
|
+
await new Promise((r) => setTimeout(r, ms));
|
|
9
|
+
}
|
|
10
|
+
/** 轮询 abort + 总超时,避免 session/load 等 RPC 永久挂起 */
|
|
11
|
+
export async function raceWithAbort(promise, isAborted, timeoutMs, timeoutMessage) {
|
|
12
|
+
const deadline = Date.now() + timeoutMs;
|
|
13
|
+
while (true) {
|
|
14
|
+
if (isAborted()) {
|
|
15
|
+
throw new Error("aborted");
|
|
16
|
+
}
|
|
17
|
+
const remaining = deadline - Date.now();
|
|
18
|
+
if (remaining <= 0) {
|
|
19
|
+
throw new AcpTimeoutError(timeoutMessage);
|
|
20
|
+
}
|
|
21
|
+
const result = await Promise.race([
|
|
22
|
+
promise,
|
|
23
|
+
sleep(Math.min(remaining, 40)).then(() => "tick"),
|
|
24
|
+
]);
|
|
25
|
+
if (result !== "tick")
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=acp-race.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ListSessionsRequest, type ListSessionsResponse, type SessionUpdate } from "@agentclientprotocol/sdk";
|
|
2
|
+
import type { BackendConfigOption, BackendProfile } from "@codebridge/core";
|
|
3
|
+
import type { CliSessionSummary, ProviderSessionHistoryEvent } from "../session-discovery.js";
|
|
4
|
+
export declare function collectAcpSessionHistory(updates: Array<{
|
|
5
|
+
sessionId: string;
|
|
6
|
+
update: SessionUpdate;
|
|
7
|
+
}>): ProviderSessionHistoryEvent[];
|
|
8
|
+
export declare function loadAcpSessionHistory(backendId: string, profile: BackendProfile, cwd: string, sessionId: string, options?: {
|
|
9
|
+
additionalDirectories?: string[];
|
|
10
|
+
}): Promise<ProviderSessionHistoryEvent[]>;
|
|
11
|
+
export declare function hasAcpSessionCapability(response: unknown, capability: "close" | "delete" | "resume"): boolean;
|
|
12
|
+
export declare function deleteAcpSession(profile: BackendProfile, cwd: string, sessionId: string, timeoutMs?: number): Promise<void>;
|
|
13
|
+
export declare function listAcpSessions(backendId: string, profile: BackendProfile, cwd: string, options?: {
|
|
14
|
+
limit?: number;
|
|
15
|
+
all?: boolean;
|
|
16
|
+
}): Promise<CliSessionSummary[]>;
|
|
17
|
+
export declare function collectAcpSessions(backendId: string, cwd: string, requestPage: (params: ListSessionsRequest) => Promise<ListSessionsResponse>, options?: {
|
|
18
|
+
limit?: number;
|
|
19
|
+
all?: boolean;
|
|
20
|
+
}): Promise<CliSessionSummary[]>;
|
|
21
|
+
/**
|
|
22
|
+
* 拉取 ACP 适配器 advertise 的会话配置项(/model 动态列表用):短暂 spawn 适配器,
|
|
23
|
+
* initialize + session/new 读 configOptions 后立即销毁。不发 prompt,无推理成本;
|
|
24
|
+
* claude 适配器对未发过 prompt 的会话不持久化(实测 resume 报 Resource not found)。
|
|
25
|
+
* 超时/失败直接抛出,调用方展示 adapter 的真实错误,不回退到过期静态列表。
|
|
26
|
+
*/
|
|
27
|
+
export declare function listAcpConfigOptions(profile: BackendProfile, cwd: string, timeoutMs?: number): Promise<BackendConfigOption[]>;
|
|
28
|
+
export declare function probeAcpInitialize(profile: BackendProfile, cwd: string, timeoutMs?: number): Promise<{
|
|
29
|
+
ok: boolean;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=acp-session-list.d.ts.map
|