@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,340 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
/** Claude Code: ~/.claude/projects/<encoded-cwd>/<sessionId>.jsonl */
|
|
5
|
+
export function encodeClaudeProjectDir(cwd) {
|
|
6
|
+
return path.resolve(cwd).replace(/\//g, "-");
|
|
7
|
+
}
|
|
8
|
+
export function collectClaudeSessionHistory(entries) {
|
|
9
|
+
const result = [];
|
|
10
|
+
for (const entry of entries) {
|
|
11
|
+
if (!entry || typeof entry !== "object")
|
|
12
|
+
continue;
|
|
13
|
+
const value = entry;
|
|
14
|
+
if (value.isMeta === true || value.isSidechain === true)
|
|
15
|
+
continue;
|
|
16
|
+
if (value.type === "attachment" && value.attachment?.type === "skill_listing") {
|
|
17
|
+
const names = Array.isArray(value.attachment.names)
|
|
18
|
+
? value.attachment.names.filter((name) => typeof name === "string" && Boolean(name))
|
|
19
|
+
: [];
|
|
20
|
+
const lines = typeof value.attachment.content === "string"
|
|
21
|
+
? value.attachment.content.split("\n")
|
|
22
|
+
: [];
|
|
23
|
+
if (names.length) {
|
|
24
|
+
result.push({
|
|
25
|
+
kind: "agent_event",
|
|
26
|
+
event: {
|
|
27
|
+
type: "available_commands_update",
|
|
28
|
+
availableCommands: names.map((name) => {
|
|
29
|
+
const prefix = `- ${name}: `;
|
|
30
|
+
const description = lines.find((line) => line.startsWith(prefix))?.slice(prefix.length).trim();
|
|
31
|
+
return { name, description: description || "Agent Skill" };
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (value.type !== "user" && value.type !== "assistant")
|
|
39
|
+
continue;
|
|
40
|
+
const role = value.message?.role;
|
|
41
|
+
const content = value.message?.content;
|
|
42
|
+
if (role === "assistant") {
|
|
43
|
+
const blocks = Array.isArray(content) ? content : [{ type: "text", text: content }];
|
|
44
|
+
for (const block of blocks) {
|
|
45
|
+
if (!block || typeof block !== "object")
|
|
46
|
+
continue;
|
|
47
|
+
const item = block;
|
|
48
|
+
if (item.type === "text" && typeof item.text === "string" && item.text) {
|
|
49
|
+
result.push({
|
|
50
|
+
kind: "agent_event",
|
|
51
|
+
event: {
|
|
52
|
+
type: "text_delta",
|
|
53
|
+
text: item.text,
|
|
54
|
+
...(typeof value.uuid === "string" ? { messageId: value.uuid } : {}),
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else if (item.type === "tool_use" && typeof item.id === "string") {
|
|
59
|
+
result.push({
|
|
60
|
+
kind: "agent_event",
|
|
61
|
+
event: {
|
|
62
|
+
type: "tool_start",
|
|
63
|
+
toolCallId: item.id,
|
|
64
|
+
name: typeof item.name === "string" ? item.name : "tool",
|
|
65
|
+
input: item.input,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (role !== "user")
|
|
73
|
+
continue;
|
|
74
|
+
if (typeof content === "string") {
|
|
75
|
+
if (content && !isClaudeInternalUserMessage(content))
|
|
76
|
+
result.push({ kind: "message", text: content });
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (!Array.isArray(content))
|
|
80
|
+
continue;
|
|
81
|
+
const userText = [];
|
|
82
|
+
for (const block of content) {
|
|
83
|
+
if (!block || typeof block !== "object")
|
|
84
|
+
continue;
|
|
85
|
+
const item = block;
|
|
86
|
+
if (item.type === "text" && typeof item.text === "string" && !isClaudeInternalUserMessage(item.text)) {
|
|
87
|
+
userText.push(item.text);
|
|
88
|
+
}
|
|
89
|
+
else if (item.type === "tool_result" && typeof item.tool_use_id === "string") {
|
|
90
|
+
result.push({
|
|
91
|
+
kind: "agent_event",
|
|
92
|
+
event: {
|
|
93
|
+
type: "tool_end",
|
|
94
|
+
toolCallId: item.tool_use_id,
|
|
95
|
+
status: item.is_error === true ? "failed" : "completed",
|
|
96
|
+
output: textFromClaudeContent(item.content),
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (userText.length)
|
|
102
|
+
result.push({ kind: "message", text: userText.join("") });
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
function isClaudeInternalUserMessage(text) {
|
|
107
|
+
const normalized = text.trimStart();
|
|
108
|
+
return normalized.startsWith("<command-name>")
|
|
109
|
+
|| normalized.startsWith("<local-command-stdout>")
|
|
110
|
+
|| normalized.startsWith("<local-command-stderr>");
|
|
111
|
+
}
|
|
112
|
+
export async function loadClaudeSessionHistory(cwd, sessionId) {
|
|
113
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(sessionId)) {
|
|
114
|
+
throw new Error(`Invalid Claude session id: ${sessionId}`);
|
|
115
|
+
}
|
|
116
|
+
const file = path.join(os.homedir(), ".claude", "projects", encodeClaudeProjectDir(cwd), `${sessionId}.jsonl`);
|
|
117
|
+
const lines = (await fs.readFile(file, "utf8")).split("\n").filter(Boolean);
|
|
118
|
+
const entries = lines.flatMap((line) => {
|
|
119
|
+
try {
|
|
120
|
+
return [JSON.parse(line)];
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
return collectClaudeSessionHistory(entries);
|
|
127
|
+
}
|
|
128
|
+
export function collectCodexSessionHistory(entries) {
|
|
129
|
+
const result = [];
|
|
130
|
+
const hasEventUserMessages = entries.some((entry) => {
|
|
131
|
+
if (!entry || typeof entry !== "object")
|
|
132
|
+
return false;
|
|
133
|
+
const value = entry;
|
|
134
|
+
if (value.type !== "event_msg" || !value.payload || typeof value.payload !== "object")
|
|
135
|
+
return false;
|
|
136
|
+
const payload = value.payload;
|
|
137
|
+
return payload.type === "user_message" && typeof payload.message === "string";
|
|
138
|
+
});
|
|
139
|
+
const hasEventAgentMessages = entries.some((entry) => {
|
|
140
|
+
if (!entry || typeof entry !== "object")
|
|
141
|
+
return false;
|
|
142
|
+
const value = entry;
|
|
143
|
+
if (value.type !== "event_msg" || !value.payload || typeof value.payload !== "object")
|
|
144
|
+
return false;
|
|
145
|
+
const payload = value.payload;
|
|
146
|
+
return payload.type === "agent_message" && typeof payload.message === "string";
|
|
147
|
+
});
|
|
148
|
+
for (const entry of entries) {
|
|
149
|
+
if (!entry || typeof entry !== "object")
|
|
150
|
+
continue;
|
|
151
|
+
const value = entry;
|
|
152
|
+
if (!value.payload || typeof value.payload !== "object")
|
|
153
|
+
continue;
|
|
154
|
+
const payload = value.payload;
|
|
155
|
+
if (value.type === "event_msg" && payload.type === "user_message" && typeof payload.message === "string") {
|
|
156
|
+
result.push({ kind: "message", text: payload.message });
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (value.type === "event_msg" && payload.type === "agent_message" && typeof payload.message === "string") {
|
|
160
|
+
const phase = payload.phase === "commentary" || payload.phase === "final_answer"
|
|
161
|
+
? payload.phase
|
|
162
|
+
: undefined;
|
|
163
|
+
result.push({
|
|
164
|
+
kind: "agent_event",
|
|
165
|
+
event: { type: "text_delta", text: payload.message, ...(phase ? { phase } : {}) },
|
|
166
|
+
});
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (value.type !== "response_item")
|
|
170
|
+
continue;
|
|
171
|
+
if (payload.type === "message" && payload.role === "user" && !hasEventUserMessages) {
|
|
172
|
+
const content = Array.isArray(payload.content) ? payload.content : [];
|
|
173
|
+
const text = content
|
|
174
|
+
.filter((item) => Boolean(item && typeof item === "object"))
|
|
175
|
+
.filter((item) => item.type === "input_text" && typeof item.text === "string")
|
|
176
|
+
.map((item) => item.text)
|
|
177
|
+
.filter((text) => !isCodexContextMessage(text))
|
|
178
|
+
.join("");
|
|
179
|
+
if (text)
|
|
180
|
+
result.push({ kind: "message", text });
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (payload.type === "agent_message" && !hasEventAgentMessages) {
|
|
184
|
+
const content = Array.isArray(payload.content) ? payload.content : [];
|
|
185
|
+
for (const item of content) {
|
|
186
|
+
if (!item || typeof item !== "object")
|
|
187
|
+
continue;
|
|
188
|
+
const block = item;
|
|
189
|
+
if (block.type !== "input_text" || typeof block.text !== "string" || !block.text)
|
|
190
|
+
continue;
|
|
191
|
+
result.push({
|
|
192
|
+
kind: "agent_event",
|
|
193
|
+
event: {
|
|
194
|
+
type: "text_delta",
|
|
195
|
+
text: block.text,
|
|
196
|
+
...(typeof payload.id === "string" ? { messageId: payload.id } : {}),
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (payload.type === "function_call" || payload.type === "custom_tool_call") {
|
|
203
|
+
const toolCallId = typeof payload.call_id === "string" ? payload.call_id : undefined;
|
|
204
|
+
if (!toolCallId)
|
|
205
|
+
continue;
|
|
206
|
+
let input = payload.arguments ?? payload.input;
|
|
207
|
+
if (typeof input === "string") {
|
|
208
|
+
try {
|
|
209
|
+
input = JSON.parse(input);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
// Keep non-JSON provider input as text.
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
result.push({
|
|
216
|
+
kind: "agent_event",
|
|
217
|
+
event: {
|
|
218
|
+
type: "tool_start",
|
|
219
|
+
toolCallId,
|
|
220
|
+
name: typeof payload.name === "string" ? payload.name : "tool",
|
|
221
|
+
input,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (payload.type === "function_call_output" || payload.type === "custom_tool_call_output") {
|
|
227
|
+
const toolCallId = typeof payload.call_id === "string" ? payload.call_id : undefined;
|
|
228
|
+
if (!toolCallId)
|
|
229
|
+
continue;
|
|
230
|
+
result.push({
|
|
231
|
+
kind: "agent_event",
|
|
232
|
+
event: {
|
|
233
|
+
type: "tool_end",
|
|
234
|
+
toolCallId,
|
|
235
|
+
status: "completed",
|
|
236
|
+
output: payload.output,
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (payload.type === "reasoning" && Array.isArray(payload.summary)) {
|
|
242
|
+
for (const item of payload.summary) {
|
|
243
|
+
if (!item || typeof item !== "object")
|
|
244
|
+
continue;
|
|
245
|
+
const text = item.text;
|
|
246
|
+
if (typeof text === "string" && text) {
|
|
247
|
+
result.push({ kind: "agent_event", event: { type: "thought_delta", text } });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (payload.type !== "message" || payload.role !== "assistant" || !Array.isArray(payload.content) || hasEventAgentMessages)
|
|
253
|
+
continue;
|
|
254
|
+
const phase = payload.phase === "commentary" || payload.phase === "final_answer"
|
|
255
|
+
? payload.phase
|
|
256
|
+
: undefined;
|
|
257
|
+
for (const item of payload.content) {
|
|
258
|
+
if (!item || typeof item !== "object")
|
|
259
|
+
continue;
|
|
260
|
+
const block = item;
|
|
261
|
+
if (block.type !== "output_text" || typeof block.text !== "string" || !block.text)
|
|
262
|
+
continue;
|
|
263
|
+
result.push({
|
|
264
|
+
kind: "agent_event",
|
|
265
|
+
event: {
|
|
266
|
+
type: "text_delta",
|
|
267
|
+
text: block.text,
|
|
268
|
+
...(typeof payload.id === "string" ? { messageId: payload.id } : {}),
|
|
269
|
+
...(phase ? { phase } : {}),
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
function isCodexContextMessage(text) {
|
|
277
|
+
return [
|
|
278
|
+
"# AGENTS.md instructions",
|
|
279
|
+
"<environment_context>",
|
|
280
|
+
"<permissions instructions>",
|
|
281
|
+
"<collaboration_mode>",
|
|
282
|
+
"<plugins_instructions>",
|
|
283
|
+
"<skills_instructions>",
|
|
284
|
+
"Another language model started to solve this problem",
|
|
285
|
+
].some((prefix) => text.startsWith(prefix));
|
|
286
|
+
}
|
|
287
|
+
export async function loadCodexSessionHistory(sessionId) {
|
|
288
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(sessionId)) {
|
|
289
|
+
throw new Error(`Invalid Codex session id: ${sessionId}`);
|
|
290
|
+
}
|
|
291
|
+
const file = await findCodexSessionFile(path.join(os.homedir(), ".codex", "sessions"), sessionId);
|
|
292
|
+
if (!file)
|
|
293
|
+
throw new Error(`Codex session not found: ${sessionId}`);
|
|
294
|
+
const lines = (await fs.readFile(file, "utf8")).split("\n").filter(Boolean);
|
|
295
|
+
const entries = lines.flatMap((line) => {
|
|
296
|
+
try {
|
|
297
|
+
return [JSON.parse(line)];
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
return collectCodexSessionHistory(entries);
|
|
304
|
+
}
|
|
305
|
+
async function findCodexSessionFile(directory, sessionId) {
|
|
306
|
+
let entries;
|
|
307
|
+
try {
|
|
308
|
+
entries = await fs.readdir(directory, { withFileTypes: true });
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
for (const entry of entries) {
|
|
314
|
+
const candidate = path.join(directory, entry.name);
|
|
315
|
+
if (entry.isDirectory()) {
|
|
316
|
+
const nested = await findCodexSessionFile(candidate, sessionId);
|
|
317
|
+
if (nested)
|
|
318
|
+
return nested;
|
|
319
|
+
}
|
|
320
|
+
else if (entry.isFile() && entry.name.endsWith(`-${sessionId}.jsonl`)) {
|
|
321
|
+
return candidate;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
function textFromClaudeContent(content) {
|
|
327
|
+
if (typeof content === "string")
|
|
328
|
+
return content;
|
|
329
|
+
if (!Array.isArray(content))
|
|
330
|
+
return content == null ? "" : JSON.stringify(content);
|
|
331
|
+
return content.map((item) => {
|
|
332
|
+
if (typeof item === "string")
|
|
333
|
+
return item;
|
|
334
|
+
if (!item || typeof item !== "object")
|
|
335
|
+
return "";
|
|
336
|
+
const block = item;
|
|
337
|
+
return block.type === "text" && typeof block.text === "string" ? block.text : "";
|
|
338
|
+
}).join("");
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=session-discovery.js.map
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export declare const SKILL_AGENT_IDS: readonly ["codex", "claude", "cursor", "opencode", "pi"];
|
|
2
|
+
export type SkillAgentId = (typeof SKILL_AGENT_IDS)[number];
|
|
3
|
+
export type SkillSourceKind = "shared" | "disabled" | "adopted" | "agent_native";
|
|
4
|
+
export type SkillGlobalState = "enabled" | "disabled" | "split_brain" | "external" | "invalid";
|
|
5
|
+
export type SkillDeliveryMode = "shared_native" | "symlink_projection";
|
|
6
|
+
export type SkillOwnership = "codebridge_managed" | "external_observed" | "native_managed";
|
|
7
|
+
export type SkillProjectionState = "follows_global" | "linked" | "absent" | "conflict" | "broken";
|
|
8
|
+
export interface SkillTargetView {
|
|
9
|
+
agent_id: SkillAgentId;
|
|
10
|
+
delivery_mode: SkillDeliveryMode;
|
|
11
|
+
target_path: string;
|
|
12
|
+
state: SkillProjectionState;
|
|
13
|
+
mutable: boolean;
|
|
14
|
+
detail: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface SkillCatalogEntry {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string | null;
|
|
20
|
+
source_path: string;
|
|
21
|
+
source_kind: SkillSourceKind;
|
|
22
|
+
package_revision: string;
|
|
23
|
+
revision: string;
|
|
24
|
+
global_state: SkillGlobalState;
|
|
25
|
+
ownership: SkillOwnership;
|
|
26
|
+
can_apply: boolean;
|
|
27
|
+
tags: string[];
|
|
28
|
+
updated_at: string;
|
|
29
|
+
targets: SkillTargetView[];
|
|
30
|
+
}
|
|
31
|
+
export interface SkillTargetDefinition {
|
|
32
|
+
agent_id: SkillAgentId;
|
|
33
|
+
display_name: string;
|
|
34
|
+
root_path: string;
|
|
35
|
+
delivery_mode: SkillDeliveryMode;
|
|
36
|
+
}
|
|
37
|
+
export interface SkillCatalogSnapshot {
|
|
38
|
+
skills: SkillCatalogEntry[];
|
|
39
|
+
targets: SkillTargetDefinition[];
|
|
40
|
+
summary: {
|
|
41
|
+
total: number;
|
|
42
|
+
sources: number;
|
|
43
|
+
linked: number;
|
|
44
|
+
issues: number;
|
|
45
|
+
recovery_required?: number;
|
|
46
|
+
};
|
|
47
|
+
scanned_at: string;
|
|
48
|
+
}
|
|
49
|
+
export type SkillMutationKind = "global_state" | "assignment" | "adopt" | "unmanage";
|
|
50
|
+
export interface SkillMutationStep {
|
|
51
|
+
action: "move" | "create_link" | "remove_link" | "set_ownership" | "set_assignment";
|
|
52
|
+
source_path?: string;
|
|
53
|
+
target_path?: string;
|
|
54
|
+
detail: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SkillMutationPlan {
|
|
57
|
+
plan_id: string;
|
|
58
|
+
actor_id: string;
|
|
59
|
+
kind: SkillMutationKind;
|
|
60
|
+
skill_id: string;
|
|
61
|
+
package_revision: string;
|
|
62
|
+
source_path: string;
|
|
63
|
+
target_path: string;
|
|
64
|
+
source_fingerprint: string;
|
|
65
|
+
target_fingerprint: string;
|
|
66
|
+
expires_at: string;
|
|
67
|
+
steps: SkillMutationStep[];
|
|
68
|
+
can_apply: boolean;
|
|
69
|
+
detail: string | null;
|
|
70
|
+
request: {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
agent_id?: SkillAgentId;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface SkillMutationResult {
|
|
76
|
+
plan_id: string;
|
|
77
|
+
transaction_id: string;
|
|
78
|
+
snapshot: SkillCatalogSnapshot;
|
|
79
|
+
}
|
|
80
|
+
export interface SkillControlPlaneOptions {
|
|
81
|
+
dataDir: string;
|
|
82
|
+
homeDirectory?: string;
|
|
83
|
+
sharedRoot?: string;
|
|
84
|
+
disabledRoot?: string;
|
|
85
|
+
targetRoots?: Record<SkillAgentId, string>;
|
|
86
|
+
}
|
|
87
|
+
export type SkillControlPlaneErrorCode = "skill_not_found" | "skill_source_invalid" | "skill_target_unknown" | "skill_target_conflict" | "skill_unlink_forbidden" | "skill_package_invalid" | "skill_identity_mismatch" | "skill_split_brain" | "skill_revision_mismatch" | "skill_plan_not_found" | "skill_plan_expired" | "skill_plan_actor_mismatch" | "skill_adopt_forbidden" | "skill_transaction_recovery_required";
|
|
88
|
+
export declare class SkillControlPlaneError extends Error {
|
|
89
|
+
readonly code: SkillControlPlaneErrorCode;
|
|
90
|
+
readonly status: 400 | 404 | 409 | 422;
|
|
91
|
+
readonly name = "SkillControlPlaneError";
|
|
92
|
+
constructor(code: SkillControlPlaneErrorCode, message: string, status?: 400 | 404 | 409 | 422);
|
|
93
|
+
}
|
|
94
|
+
export declare class SkillControlPlane {
|
|
95
|
+
private readonly homeDirectory;
|
|
96
|
+
private readonly sharedRoot;
|
|
97
|
+
private readonly disabledRoot;
|
|
98
|
+
private readonly targetRoots;
|
|
99
|
+
private readonly sources;
|
|
100
|
+
private readonly ownership;
|
|
101
|
+
private readonly assignments;
|
|
102
|
+
private readonly plans;
|
|
103
|
+
private readonly transactions;
|
|
104
|
+
constructor(options: SkillControlPlaneOptions);
|
|
105
|
+
scan(): SkillCatalogSnapshot;
|
|
106
|
+
addSource(rawPath: string): SkillCatalogSnapshot;
|
|
107
|
+
previewAdopt(input: {
|
|
108
|
+
skill_id: string;
|
|
109
|
+
actor_id: string;
|
|
110
|
+
}): SkillMutationPlan;
|
|
111
|
+
previewAssignment(input: {
|
|
112
|
+
skill_id: string;
|
|
113
|
+
agent_id: SkillAgentId;
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
actor_id: string;
|
|
116
|
+
}): SkillMutationPlan;
|
|
117
|
+
previewGlobalState(input: {
|
|
118
|
+
skill_id: string;
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
actor_id: string;
|
|
121
|
+
}): SkillMutationPlan;
|
|
122
|
+
previewUnmanage(input: {
|
|
123
|
+
skill_id: string;
|
|
124
|
+
actor_id: string;
|
|
125
|
+
}): SkillMutationPlan;
|
|
126
|
+
applyPlan(input: {
|
|
127
|
+
plan_id: string;
|
|
128
|
+
actor_id: string;
|
|
129
|
+
}): SkillMutationResult;
|
|
130
|
+
private createPlan;
|
|
131
|
+
private assertPackageCanMutate;
|
|
132
|
+
private executePlan;
|
|
133
|
+
private recoverPendingTransactions;
|
|
134
|
+
private executeAdopt;
|
|
135
|
+
private executeAssignment;
|
|
136
|
+
private executeGlobalState;
|
|
137
|
+
private ownsProjectedLink;
|
|
138
|
+
private updateTransaction;
|
|
139
|
+
private findSkill;
|
|
140
|
+
private collectRoot;
|
|
141
|
+
private skillDirectories;
|
|
142
|
+
private resolveSkillDirectory;
|
|
143
|
+
private toCatalogEntry;
|
|
144
|
+
private inspectTarget;
|
|
145
|
+
private isManagedLink;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=skill-control-plane.d.ts.map
|