@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,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codebridge/project-catalog",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@codebridge/work-items": "0.1.0",
|
|
16
|
+
"yaml": "2.9.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentEvent } from "@codebridge/core";
|
|
2
|
+
export interface ChannelStreamSnapshot {
|
|
3
|
+
thinking: string;
|
|
4
|
+
progress: string;
|
|
5
|
+
result: string;
|
|
6
|
+
liveText: string;
|
|
7
|
+
finalText: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ChannelStreamProjectorOptions {
|
|
10
|
+
showThinking?: boolean;
|
|
11
|
+
maxProgressChars?: number;
|
|
12
|
+
emptyFinalText?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ChannelStreamProjector {
|
|
15
|
+
apply(event: AgentEvent): ChannelStreamSnapshot;
|
|
16
|
+
snapshot(): ChannelStreamSnapshot;
|
|
17
|
+
}
|
|
18
|
+
export declare function createChannelStreamProjector(options?: ChannelStreamProjectorOptions): ChannelStreamProjector;
|
|
19
|
+
//# sourceMappingURL=channel-stream-projector.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createFeishuStreamPresenter } from "./feishu-stream-presenter.js";
|
|
2
|
+
function mergeProgressText(previous, next, sameMessage) {
|
|
3
|
+
if (!previous)
|
|
4
|
+
return next;
|
|
5
|
+
if (!next || next === previous)
|
|
6
|
+
return previous;
|
|
7
|
+
if (next.startsWith(previous))
|
|
8
|
+
return next;
|
|
9
|
+
if (previous.startsWith(next))
|
|
10
|
+
return previous;
|
|
11
|
+
if (!sameMessage)
|
|
12
|
+
return next;
|
|
13
|
+
for (let size = Math.min(previous.length, next.length); size > 0; size -= 1) {
|
|
14
|
+
if (previous.endsWith(next.slice(0, size))) {
|
|
15
|
+
return previous + next.slice(size);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return previous + next;
|
|
19
|
+
}
|
|
20
|
+
export function createChannelStreamProjector(options = {}) {
|
|
21
|
+
const maxProgressChars = options.maxProgressChars ?? 1200;
|
|
22
|
+
const emptyFinalText = options.emptyFinalText ?? "(本次无输出)";
|
|
23
|
+
const { present } = createFeishuStreamPresenter({
|
|
24
|
+
showThinking: options.showThinking,
|
|
25
|
+
});
|
|
26
|
+
let thinking = "";
|
|
27
|
+
let progress = "";
|
|
28
|
+
let result = "";
|
|
29
|
+
let progressMessageId;
|
|
30
|
+
const snapshot = () => {
|
|
31
|
+
const liveSections = [
|
|
32
|
+
thinking || undefined,
|
|
33
|
+
progress ? `**最新进度**\n${progress}` : undefined,
|
|
34
|
+
result || undefined,
|
|
35
|
+
].filter((value) => Boolean(value));
|
|
36
|
+
return {
|
|
37
|
+
thinking,
|
|
38
|
+
progress,
|
|
39
|
+
result,
|
|
40
|
+
liveText: liveSections.join("\n\n---\n\n"),
|
|
41
|
+
finalText: result.trim() || emptyFinalText,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
apply(event) {
|
|
46
|
+
const part = present(event);
|
|
47
|
+
if (!part)
|
|
48
|
+
return snapshot();
|
|
49
|
+
if (part.zone === "thinking") {
|
|
50
|
+
thinking += part.text;
|
|
51
|
+
}
|
|
52
|
+
else if (part.zone === "progress") {
|
|
53
|
+
const sameMessage = !(part.messageId
|
|
54
|
+
&& progressMessageId
|
|
55
|
+
&& part.messageId !== progressMessageId);
|
|
56
|
+
progress = mergeProgressText(progress, part.text, sameMessage).slice(-maxProgressChars);
|
|
57
|
+
if (part.messageId)
|
|
58
|
+
progressMessageId = part.messageId;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
result += part.text;
|
|
62
|
+
}
|
|
63
|
+
return snapshot();
|
|
64
|
+
},
|
|
65
|
+
snapshot,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=channel-stream-projector.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CommandHelpItem {
|
|
2
|
+
command: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
}
|
|
5
|
+
export type CommandHelpFormat = "markdown" | "plain";
|
|
6
|
+
export declare const SLASH_COMMANDS: CommandHelpItem[];
|
|
7
|
+
/** 飞书机器人自定义菜单 event_key → 模拟用户发送的文本 */
|
|
8
|
+
export declare const BOT_MENU_EVENT_KEYS: Record<string, string>;
|
|
9
|
+
export declare function formatCompactCommandHelp(format?: CommandHelpFormat): string;
|
|
10
|
+
export declare function formatFullCommandHelp(format?: CommandHelpFormat): string;
|
|
11
|
+
export declare function formatWelcomeMessage(botName?: string): string;
|
|
12
|
+
export declare function formatCompactCommandHint(): string;
|
|
13
|
+
export declare function formatBotMenuSetupGuide(): string[];
|
|
14
|
+
//# sourceMappingURL=command-help.d.ts.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const COMMAND_HELP_GROUPS = [
|
|
2
|
+
{
|
|
3
|
+
title: "常用",
|
|
4
|
+
items: [
|
|
5
|
+
{ command: "/help [full]", summary: "查看快捷菜单或全部命令" },
|
|
6
|
+
{ command: "/menu", summary: "查看手机快捷菜单" },
|
|
7
|
+
{ command: "/status", summary: "查看 backend、目录、模型和任务状态(别名 /s)" },
|
|
8
|
+
],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
title: "任务控制",
|
|
12
|
+
items: [
|
|
13
|
+
{ command: "/stop", summary: "停止当前 Agent 任务(别名 /cancel、/x)" },
|
|
14
|
+
{ command: "/continue", summary: "恢复暂停队列(别名 /c)" },
|
|
15
|
+
{ command: "/steer <指令>", summary: "向运行中的 ACP turn 注入补充指令" },
|
|
16
|
+
{ command: "/approve", summary: "允许当前 Agent 工具权限请求(别名 /a)" },
|
|
17
|
+
{ command: "/deny", summary: "拒绝当前 Agent 工具权限请求(别名 /d)" },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: "会话管理",
|
|
22
|
+
items: [
|
|
23
|
+
{ command: "/new", summary: "新建会话(别名 /reset)" },
|
|
24
|
+
{ command: "/resume", summary: "列出当前目录的本机 session(别名 /r)" },
|
|
25
|
+
{ command: "/resume <N>", summary: "绑定列表中第 N 条 session" },
|
|
26
|
+
{ command: "/resume last", summary: "绑定最近一条 session" },
|
|
27
|
+
{ command: "/resume all", summary: "列出全部目录的本机 session" },
|
|
28
|
+
{ command: "/session close <sessionId>", summary: "关闭指定 ACP session" },
|
|
29
|
+
{ command: "/session delete <sessionId>", summary: "永久删除指定 ACP session" },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "Agent 与模型",
|
|
34
|
+
items: [
|
|
35
|
+
{ command: "/backend <cursor|claude|codex|pi|opencode|default>", summary: "切换 Agent(别名 /b)" },
|
|
36
|
+
{ command: "/transport", summary: "兼容命令;当前仅支持 ACP,无需切换" },
|
|
37
|
+
{ command: "/model [list|名称|default]", summary: "列出或切换实时模型" },
|
|
38
|
+
{ command: "/effort [list|级别|default]", summary: "列出或切换实时推理强度" },
|
|
39
|
+
{
|
|
40
|
+
command: "/permission [list|模式|default]",
|
|
41
|
+
summary: "列出或切换实时 mode/权限(别名 /perm)",
|
|
42
|
+
},
|
|
43
|
+
{ command: "/config [id value|default]", summary: "查看或设置 ACP 实时配置(含 boolean)" },
|
|
44
|
+
{ command: "/thinking [on|off]", summary: "显示或隐藏思考/工具过程(别名 /think)" },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "目录与工作区",
|
|
49
|
+
items: [
|
|
50
|
+
{ command: "/cd <绝对路径>", summary: "切换项目目录" },
|
|
51
|
+
{ command: "/roots", summary: "列出 ACP 附加目录" },
|
|
52
|
+
{ command: "/root add|remove|rm <绝对路径>", summary: "管理 ACP 附加目录" },
|
|
53
|
+
{ command: "/ws list", summary: "列出命名工作区" },
|
|
54
|
+
{ command: "/ws save <名称>", summary: "保存当前目录为工作区" },
|
|
55
|
+
{ command: "/ws use <名称>", summary: "切换到命名工作区" },
|
|
56
|
+
{ command: "/ws remove <名称>", summary: "删除命名工作区" },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: "文件与 Git",
|
|
61
|
+
items: [
|
|
62
|
+
{ command: "/send <文件路径>", summary: "把本机文件发到当前聊天" },
|
|
63
|
+
{ command: "/clone <git-url> [目录名]", summary: "克隆仓库并切换目录" },
|
|
64
|
+
{ command: "/pull", summary: "在当前目录执行 git pull --ff-only" },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
export const SLASH_COMMANDS = COMMAND_HELP_GROUPS.flatMap((group) => group.items);
|
|
69
|
+
const COMPACT_COMMANDS = [
|
|
70
|
+
{ command: "/s", summary: "查看当前状态(/status)" },
|
|
71
|
+
{ command: "/c", summary: "恢复暂停队列(/continue)" },
|
|
72
|
+
{ command: "/r last", summary: "续聊最近会话(/resume last)" },
|
|
73
|
+
{ command: "/new", summary: "新建会话" },
|
|
74
|
+
{ command: "/x", summary: "停止当前任务(/stop)" },
|
|
75
|
+
{ command: "/b", summary: "切换 Agent(cursor / claude / codex / pi / opencode)" },
|
|
76
|
+
{ command: "/model", summary: "查看或切换模型" },
|
|
77
|
+
{ command: "/permission", summary: "查看或切换权限" },
|
|
78
|
+
{ command: "/ws list", summary: "查看工作区" },
|
|
79
|
+
];
|
|
80
|
+
/** 飞书机器人自定义菜单 event_key → 模拟用户发送的文本 */
|
|
81
|
+
export const BOT_MENU_EVENT_KEYS = {
|
|
82
|
+
fcb_help: "/help",
|
|
83
|
+
fcb_status: "/status",
|
|
84
|
+
fcb_resume: "/resume",
|
|
85
|
+
fcb_resume_last: "/resume last",
|
|
86
|
+
fcb_new: "/new",
|
|
87
|
+
fcb_stop: "/stop",
|
|
88
|
+
fcb_backend_cursor: "/backend cursor",
|
|
89
|
+
fcb_backend_claude: "/backend claude",
|
|
90
|
+
fcb_backend_codex: "/backend codex",
|
|
91
|
+
fcb_model: "/model",
|
|
92
|
+
fcb_permission: "/permission",
|
|
93
|
+
fcb_ws_list: "/ws list",
|
|
94
|
+
};
|
|
95
|
+
function heading(text, format) {
|
|
96
|
+
return format === "markdown" ? `**${text}**` : text;
|
|
97
|
+
}
|
|
98
|
+
function commandLine(item, format) {
|
|
99
|
+
const command = format === "markdown" ? `\`${item.command}\`` : item.command;
|
|
100
|
+
return `${command} — ${item.summary}`;
|
|
101
|
+
}
|
|
102
|
+
export function formatCompactCommandHelp(format = "markdown") {
|
|
103
|
+
return [
|
|
104
|
+
heading("码桥快捷菜单", format),
|
|
105
|
+
"",
|
|
106
|
+
...COMPACT_COMMANDS.map((item) => commandLine(item, format)),
|
|
107
|
+
"",
|
|
108
|
+
commandLine({ command: "/help full", summary: "查看全部命令" }, format),
|
|
109
|
+
].join("\n");
|
|
110
|
+
}
|
|
111
|
+
export function formatFullCommandHelp(format = "markdown") {
|
|
112
|
+
const lines = [heading("码桥全部命令", format)];
|
|
113
|
+
for (const group of COMMAND_HELP_GROUPS) {
|
|
114
|
+
lines.push("", heading(group.title, format), ...group.items.map((item) => commandLine(item, format)));
|
|
115
|
+
}
|
|
116
|
+
return lines.join("\n");
|
|
117
|
+
}
|
|
118
|
+
export function formatWelcomeMessage(botName = "CodeBridge") {
|
|
119
|
+
const quick = [
|
|
120
|
+
"`/s` 查看状态(`/status`)",
|
|
121
|
+
"`/r last` 续聊最近 session(`/resume last`)",
|
|
122
|
+
"`/b` 切换 Agent(`/backend`:cursor / claude / codex / pi / opencode)",
|
|
123
|
+
"`/menu` 快捷菜单",
|
|
124
|
+
];
|
|
125
|
+
return [
|
|
126
|
+
`👋 欢迎使用 **${botName}**`,
|
|
127
|
+
"",
|
|
128
|
+
"在飞书里远程驱动本机 Cursor / Claude Code / Codex / Pi / OpenCode。",
|
|
129
|
+
"直接发消息开始;也可用斜杠命令:",
|
|
130
|
+
"",
|
|
131
|
+
...quick.map((line) => `- ${line}`),
|
|
132
|
+
"",
|
|
133
|
+
"---",
|
|
134
|
+
"💡 在飞书开放平台为机器人配置**自定义菜单**后,常用命令可固定在输入框上方。",
|
|
135
|
+
"配置说明见项目 `docs/zh-CN/feishu-bot-menu.md`",
|
|
136
|
+
].join("\n");
|
|
137
|
+
}
|
|
138
|
+
export function formatCompactCommandHint() {
|
|
139
|
+
return "快捷:`/menu` · `/s` · `/c` · `/r last` · `/x` · `/new` · `/b`";
|
|
140
|
+
}
|
|
141
|
+
export function formatBotMenuSetupGuide() {
|
|
142
|
+
return [
|
|
143
|
+
"建议在飞书开放平台 → 机器人 → 自定义菜单 中配置(单聊):",
|
|
144
|
+
" · 展示样式:悬浮菜单",
|
|
145
|
+
" · 动作类型:发送文字 或 推送事件",
|
|
146
|
+
" · 发送文字示例:/status、/resume last、/new",
|
|
147
|
+
" · 推送事件 event_key 见 docs/zh-CN/feishu-bot-menu.md",
|
|
148
|
+
" · 订阅事件:application.bot.menu_v6、im.chat.access_event.bot_p2p_chat_entered_v1",
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=command-help.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentEvent } from "@codebridge/core";
|
|
2
|
+
export type FeishuStreamZone = "thinking" | "progress" | "result";
|
|
3
|
+
export interface FeishuStreamPart {
|
|
4
|
+
zone: FeishuStreamZone;
|
|
5
|
+
text: string;
|
|
6
|
+
messageId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FeishuStreamPresenterOptions {
|
|
9
|
+
/** false 时隐藏内部思考/工具,但保留进度检查点与最终答案;缺省 true */
|
|
10
|
+
showThinking?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** 飞书流式:思考区与结果区直通渲染,不做汇总或去重 */
|
|
13
|
+
export declare function createFeishuStreamPresenter(options?: FeishuStreamPresenterOptions): {
|
|
14
|
+
present: (event: AgentEvent) => FeishuStreamPart | null;
|
|
15
|
+
};
|
|
16
|
+
/** @deprecated 使用 createFeishuStreamPresenter */
|
|
17
|
+
export declare function createFeishuStreamFormatter(): (event: AgentEvent) => string;
|
|
18
|
+
//# sourceMappingURL=feishu-stream-presenter.d.ts.map
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/** 飞书流式:思考区与结果区直通渲染,不做汇总或去重 */
|
|
2
|
+
export function createFeishuStreamPresenter(options = {}) {
|
|
3
|
+
const showThinking = options.showThinking ?? true;
|
|
4
|
+
const toolStatuses = new Map();
|
|
5
|
+
const toolNames = new Map();
|
|
6
|
+
let lastPlan;
|
|
7
|
+
let latestUsage;
|
|
8
|
+
let lastMode;
|
|
9
|
+
let lastConfigKey;
|
|
10
|
+
let lastCommandsKey;
|
|
11
|
+
let lastSessionTitle;
|
|
12
|
+
let lastResultMessageId;
|
|
13
|
+
let resultTrailingNewlines = 0;
|
|
14
|
+
const present = (event) => {
|
|
15
|
+
switch (event.type) {
|
|
16
|
+
case "tool_start":
|
|
17
|
+
if (event.toolCallId)
|
|
18
|
+
toolNames.set(event.toolCallId, event.name);
|
|
19
|
+
if (event.toolCallId && event.status) {
|
|
20
|
+
toolStatuses.set(event.toolCallId, event.status);
|
|
21
|
+
}
|
|
22
|
+
return showThinking
|
|
23
|
+
? { zone: "thinking", text: `\n- \`${event.name}\`\n` }
|
|
24
|
+
: null;
|
|
25
|
+
case "tool_update": {
|
|
26
|
+
const key = event.toolCallId;
|
|
27
|
+
const name = event.name ?? toolNames.get(key) ?? "tool";
|
|
28
|
+
if (event.name)
|
|
29
|
+
toolNames.set(key, event.name);
|
|
30
|
+
if (!showThinking)
|
|
31
|
+
return null;
|
|
32
|
+
const state = event.status ?? "in_progress";
|
|
33
|
+
if (toolStatuses.get(key) === state)
|
|
34
|
+
return null;
|
|
35
|
+
toolStatuses.set(key, state);
|
|
36
|
+
return {
|
|
37
|
+
zone: "thinking",
|
|
38
|
+
text: `\n ↳ \`${name}\`(${state})\n`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
case "tool_end": {
|
|
42
|
+
const name = event.name ??
|
|
43
|
+
(event.toolCallId ? toolNames.get(event.toolCallId) : undefined) ??
|
|
44
|
+
"tool";
|
|
45
|
+
if (event.toolCallId) {
|
|
46
|
+
toolStatuses.delete(event.toolCallId);
|
|
47
|
+
toolNames.delete(event.toolCallId);
|
|
48
|
+
}
|
|
49
|
+
if (!showThinking)
|
|
50
|
+
return null;
|
|
51
|
+
return event.status === "failed"
|
|
52
|
+
? { zone: "thinking", text: `\n✗ \`${name}\`(failed)\n` }
|
|
53
|
+
: { zone: "thinking", text: `\n✓ \`${name}\`\n` };
|
|
54
|
+
}
|
|
55
|
+
case "thought_delta":
|
|
56
|
+
return showThinking ? { zone: "thinking", text: event.text } : null;
|
|
57
|
+
case "text_delta": {
|
|
58
|
+
if (event.phase === "commentary") {
|
|
59
|
+
return {
|
|
60
|
+
zone: "progress",
|
|
61
|
+
text: event.text,
|
|
62
|
+
messageId: event.messageId,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
let text = event.text;
|
|
66
|
+
if (event.messageId &&
|
|
67
|
+
lastResultMessageId &&
|
|
68
|
+
event.messageId !== lastResultMessageId) {
|
|
69
|
+
const leadingNewlines = text.match(/^\n*/)?.[0].length ?? 0;
|
|
70
|
+
text =
|
|
71
|
+
"\n".repeat(Math.max(0, 2 - resultTrailingNewlines - leadingNewlines)) + text;
|
|
72
|
+
}
|
|
73
|
+
if (event.messageId)
|
|
74
|
+
lastResultMessageId = event.messageId;
|
|
75
|
+
resultTrailingNewlines = Math.min(2, text.match(/\n*$/)?.[0].length ?? 0);
|
|
76
|
+
return { zone: "result", text, messageId: event.messageId };
|
|
77
|
+
}
|
|
78
|
+
case "plan": {
|
|
79
|
+
if (!showThinking)
|
|
80
|
+
return null;
|
|
81
|
+
const text = event.entries
|
|
82
|
+
.map((entry) => {
|
|
83
|
+
const mark = entry.status === "completed"
|
|
84
|
+
? "x"
|
|
85
|
+
: entry.status === "in_progress"
|
|
86
|
+
? ">"
|
|
87
|
+
: " ";
|
|
88
|
+
return `- [${mark}] ${entry.content}`;
|
|
89
|
+
})
|
|
90
|
+
.join("\n");
|
|
91
|
+
const rendered = `\n**计划**\n${text}\n`;
|
|
92
|
+
if (rendered === lastPlan)
|
|
93
|
+
return null;
|
|
94
|
+
lastPlan = rendered;
|
|
95
|
+
return { zone: "thinking", text: rendered };
|
|
96
|
+
}
|
|
97
|
+
case "plan_update": {
|
|
98
|
+
if (!showThinking)
|
|
99
|
+
return null;
|
|
100
|
+
const plan = event.plan;
|
|
101
|
+
const rendered = plan?.type === "markdown"
|
|
102
|
+
? `\n**计划**\n${plan.content ?? ""}\n`
|
|
103
|
+
: plan?.type === "file"
|
|
104
|
+
? `\n**计划文件**:${plan.uri ?? "(unknown)"}\n`
|
|
105
|
+
: plan?.entries
|
|
106
|
+
? `\n**计划**\n${plan.entries
|
|
107
|
+
.map((entry) => `- ${entry.status}: ${entry.content}`)
|
|
108
|
+
.join("\n")}\n`
|
|
109
|
+
: "";
|
|
110
|
+
if (!rendered || rendered === lastPlan)
|
|
111
|
+
return null;
|
|
112
|
+
lastPlan = rendered;
|
|
113
|
+
return { zone: "thinking", text: rendered };
|
|
114
|
+
}
|
|
115
|
+
case "plan_removed":
|
|
116
|
+
lastPlan = undefined;
|
|
117
|
+
return null;
|
|
118
|
+
case "usage_update":
|
|
119
|
+
latestUsage = event;
|
|
120
|
+
return null;
|
|
121
|
+
case "current_mode_update":
|
|
122
|
+
if (!showThinking || lastMode === event.currentModeId)
|
|
123
|
+
return null;
|
|
124
|
+
lastMode = event.currentModeId;
|
|
125
|
+
return {
|
|
126
|
+
zone: "thinking",
|
|
127
|
+
text: `\n⚙️ mode: \`${event.currentModeId}\`\n`,
|
|
128
|
+
};
|
|
129
|
+
case "config_option_update": {
|
|
130
|
+
if (!showThinking)
|
|
131
|
+
return null;
|
|
132
|
+
const key = JSON.stringify(event.configOptions.map((option) => [option.id, option.currentValue]));
|
|
133
|
+
if (key === lastConfigKey)
|
|
134
|
+
return null;
|
|
135
|
+
lastConfigKey = key;
|
|
136
|
+
const values = event.configOptions
|
|
137
|
+
.filter((option) => option.currentValue !== undefined)
|
|
138
|
+
.map((option) => `${option.name}=\`${option.currentValue}\``)
|
|
139
|
+
.join(" · ");
|
|
140
|
+
return values
|
|
141
|
+
? { zone: "thinking", text: `\n⚙️ config: ${values}\n` }
|
|
142
|
+
: null;
|
|
143
|
+
}
|
|
144
|
+
case "available_commands_update": {
|
|
145
|
+
if (!showThinking)
|
|
146
|
+
return null;
|
|
147
|
+
const key = JSON.stringify(event.availableCommands);
|
|
148
|
+
if (key === lastCommandsKey)
|
|
149
|
+
return null;
|
|
150
|
+
lastCommandsKey = key;
|
|
151
|
+
const commands = event.availableCommands
|
|
152
|
+
.map((command) => `/${command.name}`)
|
|
153
|
+
.join(" ");
|
|
154
|
+
return commands
|
|
155
|
+
? { zone: "thinking", text: `\n⌘ 可用命令: ${commands}\n` }
|
|
156
|
+
: null;
|
|
157
|
+
}
|
|
158
|
+
case "session_info_update":
|
|
159
|
+
if (!showThinking || !event.title || event.title === lastSessionTitle) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
lastSessionTitle = event.title;
|
|
163
|
+
return { zone: "thinking", text: `\n📝 ${event.title}\n` };
|
|
164
|
+
case "error":
|
|
165
|
+
return { zone: "result", text: `\n❌ ${event.message}\n` };
|
|
166
|
+
case "done":
|
|
167
|
+
if (showThinking && event.exitCode === 0 && latestUsage) {
|
|
168
|
+
const usage = latestUsage;
|
|
169
|
+
latestUsage = undefined;
|
|
170
|
+
const cost = usage.cost
|
|
171
|
+
? ` · ${usage.cost.amount} ${usage.cost.currency}`
|
|
172
|
+
: "";
|
|
173
|
+
return {
|
|
174
|
+
zone: "thinking",
|
|
175
|
+
text: `\n📊 context ${usage.used.toLocaleString()}/${usage.size.toLocaleString()}${cost}\n`,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
latestUsage = undefined;
|
|
179
|
+
return event.exitCode === 0
|
|
180
|
+
? null
|
|
181
|
+
: { zone: "result", text: `\n(退出码 ${event.exitCode})\n` };
|
|
182
|
+
default:
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
return { present };
|
|
187
|
+
}
|
|
188
|
+
/** @deprecated 使用 createFeishuStreamPresenter */
|
|
189
|
+
export function createFeishuStreamFormatter() {
|
|
190
|
+
const { present } = createFeishuStreamPresenter();
|
|
191
|
+
return (event) => present(event)?.text ?? "";
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=feishu-stream-presenter.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./channel-stream-projector.js";
|
|
2
|
+
export * from "./command-help.js";
|
|
3
|
+
export * from "./feishu-stream-presenter.js";
|
|
4
|
+
export * from "./orchestrator.js";
|
|
5
|
+
export * from "./session-list-format.js";
|
|
6
|
+
export * from "./session-router.js";
|
|
7
|
+
export * from "./session-rotation.js";
|
|
8
|
+
export * from "./slash-commands.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./channel-stream-projector.js";
|
|
2
|
+
export * from "./command-help.js";
|
|
3
|
+
export * from "./feishu-stream-presenter.js";
|
|
4
|
+
export * from "./orchestrator.js";
|
|
5
|
+
export * from "./session-list-format.js";
|
|
6
|
+
export * from "./session-router.js";
|
|
7
|
+
export * from "./session-rotation.js";
|
|
8
|
+
export * from "./slash-commands.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BackendConfigOption } from "@codebridge/core";
|
|
2
|
+
export declare function formatDynamicOptionHelp(backendId: string, label: string, command: string, option: BackendConfigOption, current?: string): string;
|
|
3
|
+
export declare function formatDynamicModelHelp(backendId: string, option: BackendConfigOption, current?: string): string;
|
|
4
|
+
export declare function matchBackendConfigValue(option: BackendConfigOption, desired: string): string | undefined;
|
|
5
|
+
//# sourceMappingURL=model-effort.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function formatOptionValue(value, currentValue) {
|
|
2
|
+
const label = value.name && value.name.toLowerCase() !== value.value.toLowerCase()
|
|
3
|
+
? `\`${value.value}\` — ${value.name}`
|
|
4
|
+
: `\`${value.value}\``;
|
|
5
|
+
const current = currentValue === value.value ? "(适配器默认)" : "";
|
|
6
|
+
const description = value.description ? `:${value.description}` : "";
|
|
7
|
+
return `- ${label}${current}${description}`;
|
|
8
|
+
}
|
|
9
|
+
export function formatDynamicOptionHelp(backendId, label, command, option, current) {
|
|
10
|
+
const lines = [
|
|
11
|
+
`**${backendId}** 可用 ${label}(适配器实时列表):`,
|
|
12
|
+
...option.values.map((value) => formatOptionValue(value, option.currentValue)),
|
|
13
|
+
];
|
|
14
|
+
if (current)
|
|
15
|
+
lines.push("", `当前会话: \`${current}\``);
|
|
16
|
+
lines.push("", `用法: \`/${command} <名称>\` | \`/${command} default\` 恢复适配器默认`);
|
|
17
|
+
return lines.join("\n");
|
|
18
|
+
}
|
|
19
|
+
export function formatDynamicModelHelp(backendId, option, current) {
|
|
20
|
+
return formatDynamicOptionHelp(backendId, "model", "model", option, current);
|
|
21
|
+
}
|
|
22
|
+
export function matchBackendConfigValue(option, desired) {
|
|
23
|
+
const want = desired.trim().toLowerCase();
|
|
24
|
+
const exactValue = option.values.find((value) => value.value.toLowerCase() === want);
|
|
25
|
+
if (exactValue)
|
|
26
|
+
return exactValue.value;
|
|
27
|
+
const exactName = option.values.find((value) => value.name?.toLowerCase() === want);
|
|
28
|
+
if (exactName)
|
|
29
|
+
return exactName.value;
|
|
30
|
+
const prefixes = option.values.filter((value) => value.value.toLowerCase().startsWith(want));
|
|
31
|
+
return prefixes.length === 1 ? prefixes[0].value : undefined;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=model-effort.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ActiveRunStatus, AgentEvent, AppConfig, BackendConfigOption, RunAttachment } from "@codebridge/core";
|
|
2
|
+
import { type CliSessionSummary } from "@codebridge/runner-client";
|
|
3
|
+
import { SessionRouter } from "./session-router.js";
|
|
4
|
+
export interface OrchestratorOptions {
|
|
5
|
+
dataDir: string;
|
|
6
|
+
config: AppConfig;
|
|
7
|
+
onEvent?: (runId: string, event: AgentEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare class RunOrchestrator {
|
|
10
|
+
private readonly options;
|
|
11
|
+
readonly router: SessionRouter;
|
|
12
|
+
private readonly client;
|
|
13
|
+
private readonly activeChatRuns;
|
|
14
|
+
constructor(options: OrchestratorOptions);
|
|
15
|
+
updateConfig(config: AppConfig): void;
|
|
16
|
+
private chatRunKey;
|
|
17
|
+
hasActiveRun(chatId: string, topicId?: string): boolean;
|
|
18
|
+
/** 活跃任务已运行的毫秒数;无活跃任务时返回 undefined */
|
|
19
|
+
activeRunElapsedMs(chatId: string, topicId?: string): number | undefined;
|
|
20
|
+
activeRunStatus(chatId: string, topicId?: string): ActiveRunStatus | undefined;
|
|
21
|
+
cancelActiveForChat(chatId: string, topicId?: string): Promise<boolean>;
|
|
22
|
+
steerActiveForChat(chatId: string, topicId: string | undefined, prompt: string): Promise<{
|
|
23
|
+
ok: boolean;
|
|
24
|
+
outcome?: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
}>;
|
|
27
|
+
runAgent(chatId: string, topicId: string | undefined, prompt: string, attachments?: RunAttachment[]): AsyncGenerator<AgentEvent>;
|
|
28
|
+
doctor(): Promise<unknown>;
|
|
29
|
+
health(): Promise<{
|
|
30
|
+
ok: boolean;
|
|
31
|
+
version?: string;
|
|
32
|
+
}>;
|
|
33
|
+
authorizeDirectory(directory: string): Promise<{
|
|
34
|
+
ok: boolean;
|
|
35
|
+
path?: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
}>;
|
|
38
|
+
listSessions(chatId: string, topicId?: string, options?: {
|
|
39
|
+
all?: boolean;
|
|
40
|
+
limit?: number;
|
|
41
|
+
}): Promise<CliSessionSummary[]>;
|
|
42
|
+
/** prompt_feishu:把 /approve /deny 转给当前 run 挂起的权限请求 */
|
|
43
|
+
resolveActivePermission(chatId: string, topicId: string | undefined, approve: boolean): Promise<boolean>;
|
|
44
|
+
listConfigOptions(chatId: string, topicId?: string): Promise<BackendConfigOption[]>;
|
|
45
|
+
closeSession(chatId: string, topicId: string | undefined, sessionId: string): Promise<{
|
|
46
|
+
ok: boolean;
|
|
47
|
+
error?: string;
|
|
48
|
+
}>;
|
|
49
|
+
deleteSession(chatId: string, topicId: string | undefined, sessionId: string): Promise<{
|
|
50
|
+
ok: boolean;
|
|
51
|
+
error?: string;
|
|
52
|
+
}>;
|
|
53
|
+
private manageSession;
|
|
54
|
+
}
|
|
55
|
+
export declare function agentEventToMarkdown(event: AgentEvent): string;
|
|
56
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|