@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.
Files changed (434) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +217 -2
  4. package/README.zh-CN.md +222 -0
  5. package/apps/web/public/brand/agent-logo-carbon.svg +1 -0
  6. package/apps/web/public/brand/agent-logo.svg +1 -0
  7. package/docs/zh-CN/npm-release.md +77 -0
  8. package/node_modules/@codebridge/agent-registry/dist/index.d.ts +32 -0
  9. package/node_modules/@codebridge/agent-registry/dist/index.js +177 -0
  10. package/node_modules/@codebridge/agent-registry/dist/setup.d.ts +9 -0
  11. package/node_modules/@codebridge/agent-registry/dist/setup.js +115 -0
  12. package/node_modules/@codebridge/agent-registry/package.json +17 -0
  13. package/node_modules/@codebridge/backends/dist/acp/acp-active-session.d.ts +12 -0
  14. package/node_modules/@codebridge/backends/dist/acp/acp-active-session.js +57 -0
  15. package/node_modules/@codebridge/backends/dist/acp/acp-claude-activity.d.ts +9 -0
  16. package/node_modules/@codebridge/backends/dist/acp/acp-claude-activity.js +49 -0
  17. package/node_modules/@codebridge/backends/dist/acp/acp-config-options.d.ts +46 -0
  18. package/node_modules/@codebridge/backends/dist/acp/acp-config-options.js +220 -0
  19. package/node_modules/@codebridge/backends/dist/acp/acp-doctor.d.ts +3 -0
  20. package/node_modules/@codebridge/backends/dist/acp/acp-doctor.js +18 -0
  21. package/node_modules/@codebridge/backends/dist/acp/acp-event-mapper.d.ts +5 -0
  22. package/node_modules/@codebridge/backends/dist/acp/acp-event-mapper.js +136 -0
  23. package/node_modules/@codebridge/backends/dist/acp/acp-kill.d.ts +10 -0
  24. package/node_modules/@codebridge/backends/dist/acp/acp-kill.js +24 -0
  25. package/node_modules/@codebridge/backends/dist/acp/acp-race.d.ts +6 -0
  26. package/node_modules/@codebridge/backends/dist/acp/acp-race.js +29 -0
  27. package/node_modules/@codebridge/backends/dist/acp/acp-session-list.d.ts +32 -0
  28. package/node_modules/@codebridge/backends/dist/acp/acp-session-list.js +218 -0
  29. package/node_modules/@codebridge/backends/dist/acp/acp-session-pool.d.ts +85 -0
  30. package/node_modules/@codebridge/backends/dist/acp/acp-session-pool.js +165 -0
  31. package/node_modules/@codebridge/backends/dist/acp/acp-session-runner.d.ts +78 -0
  32. package/node_modules/@codebridge/backends/dist/acp/acp-session-runner.js +550 -0
  33. package/node_modules/@codebridge/backends/dist/acp/acp-spawn-profiles.d.ts +9 -0
  34. package/node_modules/@codebridge/backends/dist/acp/acp-spawn-profiles.js +28 -0
  35. package/node_modules/@codebridge/backends/dist/acp/headless-client.d.ts +19 -0
  36. package/node_modules/@codebridge/backends/dist/acp/headless-client.js +47 -0
  37. package/node_modules/@codebridge/backends/dist/acp/index.d.ts +9 -0
  38. package/node_modules/@codebridge/backends/dist/acp/index.js +9 -0
  39. package/node_modules/@codebridge/backends/dist/agent-setup.d.ts +60 -0
  40. package/node_modules/@codebridge/backends/dist/agent-setup.js +504 -0
  41. package/node_modules/@codebridge/backends/dist/attachment-prompt.d.ts +8 -0
  42. package/node_modules/@codebridge/backends/dist/attachment-prompt.js +28 -0
  43. package/node_modules/@codebridge/backends/dist/auth-error-hints.d.ts +8 -0
  44. package/node_modules/@codebridge/backends/dist/auth-error-hints.js +33 -0
  45. package/node_modules/@codebridge/backends/dist/codex-skill-commands.d.ts +3 -0
  46. package/node_modules/@codebridge/backends/dist/codex-skill-commands.js +88 -0
  47. package/node_modules/@codebridge/backends/dist/index.d.ts +18 -0
  48. package/node_modules/@codebridge/backends/dist/index.js +34 -0
  49. package/node_modules/@codebridge/backends/dist/pi-providers.d.ts +45 -0
  50. package/node_modules/@codebridge/backends/dist/pi-providers.js +148 -0
  51. package/node_modules/@codebridge/backends/dist/pi-session-runner.d.ts +85 -0
  52. package/node_modules/@codebridge/backends/dist/pi-session-runner.js +460 -0
  53. package/node_modules/@codebridge/backends/dist/provider-connection.d.ts +17 -0
  54. package/node_modules/@codebridge/backends/dist/provider-connection.js +99 -0
  55. package/node_modules/@codebridge/backends/dist/session-discovery.d.ts +23 -0
  56. package/node_modules/@codebridge/backends/dist/session-discovery.js +340 -0
  57. package/node_modules/@codebridge/backends/dist/skill-control-plane.d.ts +147 -0
  58. package/node_modules/@codebridge/backends/dist/skill-control-plane.js +832 -0
  59. package/node_modules/@codebridge/backends/package.json +22 -0
  60. package/node_modules/@codebridge/bridge/dist/alert-notification-rules.d.ts +14 -0
  61. package/node_modules/@codebridge/bridge/dist/alert-notification-rules.js +37 -0
  62. package/node_modules/@codebridge/bridge/dist/channel-config.d.ts +4 -0
  63. package/node_modules/@codebridge/bridge/dist/channel-config.js +9 -0
  64. package/node_modules/@codebridge/bridge/dist/channel-ingress.d.ts +5 -0
  65. package/node_modules/@codebridge/bridge/dist/channel-ingress.js +403 -0
  66. package/node_modules/@codebridge/bridge/dist/cli.d.ts +3 -0
  67. package/node_modules/@codebridge/bridge/dist/cli.js +581 -0
  68. package/node_modules/@codebridge/bridge/dist/deployment.d.ts +46 -0
  69. package/node_modules/@codebridge/bridge/dist/deployment.js +174 -0
  70. package/node_modules/@codebridge/bridge/dist/event-loop-lag.d.ts +19 -0
  71. package/node_modules/@codebridge/bridge/dist/event-loop-lag.js +33 -0
  72. package/node_modules/@codebridge/bridge/dist/feishu-alert-monitor.d.ts +70 -0
  73. package/node_modules/@codebridge/bridge/dist/feishu-alert-monitor.js +591 -0
  74. package/node_modules/@codebridge/bridge/dist/init-wizard.d.ts +52 -0
  75. package/node_modules/@codebridge/bridge/dist/init-wizard.js +571 -0
  76. package/node_modules/@codebridge/bridge/dist/mcp-api.d.ts +4 -0
  77. package/node_modules/@codebridge/bridge/dist/mcp-api.js +100 -0
  78. package/node_modules/@codebridge/bridge/dist/outbound-api.d.ts +31 -0
  79. package/node_modules/@codebridge/bridge/dist/outbound-api.js +184 -0
  80. package/node_modules/@codebridge/bridge/dist/outbound-publishers.d.ts +54 -0
  81. package/node_modules/@codebridge/bridge/dist/outbound-publishers.js +213 -0
  82. package/node_modules/@codebridge/bridge/dist/project-api.d.ts +4 -0
  83. package/node_modules/@codebridge/bridge/dist/project-api.js +161 -0
  84. package/node_modules/@codebridge/bridge/dist/secrets-command.d.ts +13 -0
  85. package/node_modules/@codebridge/bridge/dist/secrets-command.js +34 -0
  86. package/node_modules/@codebridge/bridge/dist/session-api.d.ts +26 -0
  87. package/node_modules/@codebridge/bridge/dist/session-api.js +1378 -0
  88. package/node_modules/@codebridge/bridge/dist/session-history-import.d.ts +24 -0
  89. package/node_modules/@codebridge/bridge/dist/session-history-import.js +82 -0
  90. package/node_modules/@codebridge/bridge/dist/session-runtime-api.d.ts +19 -0
  91. package/node_modules/@codebridge/bridge/dist/session-runtime-api.js +453 -0
  92. package/node_modules/@codebridge/bridge/dist/session-runtime-migration.d.ts +21 -0
  93. package/node_modules/@codebridge/bridge/dist/session-runtime-migration.js +43 -0
  94. package/node_modules/@codebridge/bridge/dist/session-runtime-types.d.ts +85 -0
  95. package/node_modules/@codebridge/bridge/dist/session-runtime-types.js +98 -0
  96. package/node_modules/@codebridge/bridge/dist/skill-api.d.ts +28 -0
  97. package/node_modules/@codebridge/bridge/dist/skill-api.js +129 -0
  98. package/node_modules/@codebridge/bridge/dist/startup-surfaces.d.ts +15 -0
  99. package/node_modules/@codebridge/bridge/dist/startup-surfaces.js +13 -0
  100. package/node_modules/@codebridge/bridge/dist/web-frontend.d.ts +8 -0
  101. package/node_modules/@codebridge/bridge/dist/web-frontend.js +76 -0
  102. package/node_modules/@codebridge/bridge/dist/work-item-api.d.ts +6 -0
  103. package/node_modules/@codebridge/bridge/dist/work-item-api.js +414 -0
  104. package/node_modules/@codebridge/bridge/package.json +28 -0
  105. package/node_modules/@codebridge/channel-feishu/dist/alert-reactions.d.ts +6 -0
  106. package/node_modules/@codebridge/channel-feishu/dist/alert-reactions.js +58 -0
  107. package/node_modules/@codebridge/channel-feishu/dist/alert-types.d.ts +35 -0
  108. package/node_modules/@codebridge/channel-feishu/dist/alert-types.js +2 -0
  109. package/node_modules/@codebridge/channel-feishu/dist/bridge.d.ts +130 -0
  110. package/node_modules/@codebridge/channel-feishu/dist/bridge.js +1231 -0
  111. package/node_modules/@codebridge/channel-feishu/dist/cardkit-writer.d.ts +48 -0
  112. package/node_modules/@codebridge/channel-feishu/dist/cardkit-writer.js +153 -0
  113. package/node_modules/@codebridge/channel-feishu/dist/chain-topics.d.ts +20 -0
  114. package/node_modules/@codebridge/channel-feishu/dist/chain-topics.js +35 -0
  115. package/node_modules/@codebridge/channel-feishu/dist/coalescing-card-writer.d.ts +12 -0
  116. package/node_modules/@codebridge/channel-feishu/dist/coalescing-card-writer.js +53 -0
  117. package/node_modules/@codebridge/channel-feishu/dist/delivery-reconciler.d.ts +19 -0
  118. package/node_modules/@codebridge/channel-feishu/dist/delivery-reconciler.js +53 -0
  119. package/node_modules/@codebridge/channel-feishu/dist/durable-markdown-card.d.ts +19 -0
  120. package/node_modules/@codebridge/channel-feishu/dist/durable-markdown-card.js +77 -0
  121. package/node_modules/@codebridge/channel-feishu/dist/feishu-extra-events.d.ts +27 -0
  122. package/node_modules/@codebridge/channel-feishu/dist/feishu-extra-events.js +24 -0
  123. package/node_modules/@codebridge/channel-feishu/dist/feishu-http.d.ts +4 -0
  124. package/node_modules/@codebridge/channel-feishu/dist/feishu-http.js +25 -0
  125. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-context.d.ts +13 -0
  126. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-context.js +45 -0
  127. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-media.d.ts +22 -0
  128. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-media.js +273 -0
  129. package/node_modules/@codebridge/channel-feishu/dist/feishu-mention-gate.d.ts +13 -0
  130. package/node_modules/@codebridge/channel-feishu/dist/feishu-mention-gate.js +22 -0
  131. package/node_modules/@codebridge/channel-feishu/dist/feishu-outbound-file.d.ts +12 -0
  132. package/node_modules/@codebridge/channel-feishu/dist/feishu-outbound-file.js +38 -0
  133. package/node_modules/@codebridge/channel-feishu/dist/feishu-quoted-message.d.ts +30 -0
  134. package/node_modules/@codebridge/channel-feishu/dist/feishu-quoted-message.js +183 -0
  135. package/node_modules/@codebridge/channel-feishu/dist/index.d.ts +7 -0
  136. package/node_modules/@codebridge/channel-feishu/dist/index.js +3 -0
  137. package/node_modules/@codebridge/channel-feishu/dist/redacting-logger.d.ts +17 -0
  138. package/node_modules/@codebridge/channel-feishu/dist/redacting-logger.js +41 -0
  139. package/node_modules/@codebridge/channel-feishu/dist/run-status.d.ts +39 -0
  140. package/node_modules/@codebridge/channel-feishu/dist/run-status.js +166 -0
  141. package/node_modules/@codebridge/channel-feishu/dist/session-watcher.d.ts +98 -0
  142. package/node_modules/@codebridge/channel-feishu/dist/session-watcher.js +655 -0
  143. package/node_modules/@codebridge/channel-feishu/package.json +19 -0
  144. package/node_modules/@codebridge/channel-telegram/dist/coalescing-message-writer.d.ts +14 -0
  145. package/node_modules/@codebridge/channel-telegram/dist/coalescing-message-writer.js +56 -0
  146. package/node_modules/@codebridge/channel-telegram/dist/index.d.ts +3 -0
  147. package/node_modules/@codebridge/channel-telegram/dist/index.js +3 -0
  148. package/node_modules/@codebridge/channel-telegram/dist/telegram-api.d.ts +62 -0
  149. package/node_modules/@codebridge/channel-telegram/dist/telegram-api.js +72 -0
  150. package/node_modules/@codebridge/channel-telegram/dist/telegram-bridge.d.ts +64 -0
  151. package/node_modules/@codebridge/channel-telegram/dist/telegram-bridge.js +469 -0
  152. package/node_modules/@codebridge/channel-telegram/dist/telegram-session-watcher.d.ts +41 -0
  153. package/node_modules/@codebridge/channel-telegram/dist/telegram-session-watcher.js +184 -0
  154. package/node_modules/@codebridge/channel-telegram/package.json +18 -0
  155. package/node_modules/@codebridge/core/dist/config-schema.d.ts +1195 -0
  156. package/node_modules/@codebridge/core/dist/config-schema.js +293 -0
  157. package/node_modules/@codebridge/core/dist/config-store.d.ts +48 -0
  158. package/node_modules/@codebridge/core/dist/config-store.js +207 -0
  159. package/node_modules/@codebridge/core/dist/index.d.ts +11 -0
  160. package/node_modules/@codebridge/core/dist/index.js +10 -0
  161. package/node_modules/@codebridge/core/dist/json-file-store.d.ts +16 -0
  162. package/node_modules/@codebridge/core/dist/json-file-store.js +46 -0
  163. package/node_modules/@codebridge/core/dist/mcp-types.d.ts +7 -0
  164. package/node_modules/@codebridge/core/dist/mcp-types.js +2 -0
  165. package/node_modules/@codebridge/core/dist/mentions.d.ts +36 -0
  166. package/node_modules/@codebridge/core/dist/mentions.js +138 -0
  167. package/node_modules/@codebridge/core/dist/secret-migration.d.ts +14 -0
  168. package/node_modules/@codebridge/core/dist/secret-migration.js +55 -0
  169. package/node_modules/@codebridge/core/dist/secret-refs.d.ts +34 -0
  170. package/node_modules/@codebridge/core/dist/secret-refs.js +142 -0
  171. package/node_modules/@codebridge/core/dist/session-event-wire.d.ts +17 -0
  172. package/node_modules/@codebridge/core/dist/session-event-wire.js +28 -0
  173. package/node_modules/@codebridge/core/dist/types.d.ts +363 -0
  174. package/node_modules/@codebridge/core/dist/types.js +22 -0
  175. package/node_modules/@codebridge/core/dist/workspace-key.d.ts +11 -0
  176. package/node_modules/@codebridge/core/dist/workspace-key.js +25 -0
  177. package/node_modules/@codebridge/core/package.json +22 -0
  178. package/node_modules/@codebridge/mcp-runtime/dist/.tsbuildinfo +1 -0
  179. package/node_modules/@codebridge/mcp-runtime/dist/index.d.ts +92 -0
  180. package/node_modules/@codebridge/mcp-runtime/dist/index.js +377 -0
  181. package/node_modules/@codebridge/mcp-runtime/package.json +19 -0
  182. package/node_modules/@codebridge/policy/dist/capability-runtime.d.ts +123 -0
  183. package/node_modules/@codebridge/policy/dist/capability-runtime.js +195 -0
  184. package/node_modules/@codebridge/policy/dist/demo-capabilities.d.ts +4 -0
  185. package/node_modules/@codebridge/policy/dist/demo-capabilities.js +134 -0
  186. package/node_modules/@codebridge/policy/dist/equity-capabilities.d.ts +8 -0
  187. package/node_modules/@codebridge/policy/dist/equity-capabilities.js +35 -0
  188. package/node_modules/@codebridge/policy/dist/index.d.ts +107 -0
  189. package/node_modules/@codebridge/policy/dist/index.js +317 -0
  190. package/node_modules/@codebridge/policy/package.json +17 -0
  191. package/node_modules/@codebridge/project-catalog/dist/index.d.ts +145 -0
  192. package/node_modules/@codebridge/project-catalog/dist/index.js +699 -0
  193. package/node_modules/@codebridge/project-catalog/package.json +18 -0
  194. package/node_modules/@codebridge/router/dist/channel-stream-projector.d.ts +19 -0
  195. package/node_modules/@codebridge/router/dist/channel-stream-projector.js +68 -0
  196. package/node_modules/@codebridge/router/dist/command-help.d.ts +14 -0
  197. package/node_modules/@codebridge/router/dist/command-help.js +151 -0
  198. package/node_modules/@codebridge/router/dist/feishu-stream-presenter.d.ts +18 -0
  199. package/node_modules/@codebridge/router/dist/feishu-stream-presenter.js +193 -0
  200. package/node_modules/@codebridge/router/dist/index.d.ts +9 -0
  201. package/node_modules/@codebridge/router/dist/index.js +9 -0
  202. package/node_modules/@codebridge/router/dist/model-effort.d.ts +5 -0
  203. package/node_modules/@codebridge/router/dist/model-effort.js +33 -0
  204. package/node_modules/@codebridge/router/dist/orchestrator.d.ts +56 -0
  205. package/node_modules/@codebridge/router/dist/orchestrator.js +290 -0
  206. package/node_modules/@codebridge/router/dist/session-list-format.d.ts +19 -0
  207. package/node_modules/@codebridge/router/dist/session-list-format.js +97 -0
  208. package/node_modules/@codebridge/router/dist/session-rotation.d.ts +9 -0
  209. package/node_modules/@codebridge/router/dist/session-rotation.js +31 -0
  210. package/node_modules/@codebridge/router/dist/session-router.d.ts +59 -0
  211. package/node_modules/@codebridge/router/dist/session-router.js +182 -0
  212. package/node_modules/@codebridge/router/dist/slash-commands.d.ts +78 -0
  213. package/node_modules/@codebridge/router/dist/slash-commands.js +874 -0
  214. package/node_modules/@codebridge/router/package.json +18 -0
  215. package/node_modules/@codebridge/run-executor/dist/agent-event-aggregator.d.ts +18 -0
  216. package/node_modules/@codebridge/run-executor/dist/agent-event-aggregator.js +88 -0
  217. package/node_modules/@codebridge/run-executor/dist/index.d.ts +55 -0
  218. package/node_modules/@codebridge/run-executor/dist/index.js +754 -0
  219. package/node_modules/@codebridge/run-executor/dist/run-heartbeat.d.ts +14 -0
  220. package/node_modules/@codebridge/run-executor/dist/run-heartbeat.js +24 -0
  221. package/node_modules/@codebridge/run-executor/package.json +20 -0
  222. package/node_modules/@codebridge/runner-client/dist/index.d.ts +142 -0
  223. package/node_modules/@codebridge/runner-client/dist/index.js +439 -0
  224. package/node_modules/@codebridge/runner-client/package.json +18 -0
  225. package/node_modules/@codebridge/runner-host/dist/cli.d.ts +3 -0
  226. package/node_modules/@codebridge/runner-host/dist/cli.js +58 -0
  227. package/node_modules/@codebridge/runner-host/dist/codex-session-ownership.d.ts +13 -0
  228. package/node_modules/@codebridge/runner-host/dist/codex-session-ownership.js +79 -0
  229. package/node_modules/@codebridge/runner-host/dist/deployment-mcp-server.d.ts +10 -0
  230. package/node_modules/@codebridge/runner-host/dist/deployment-mcp-server.js +54 -0
  231. package/node_modules/@codebridge/runner-host/dist/fcb-script.d.ts +3 -0
  232. package/node_modules/@codebridge/runner-host/dist/fcb-script.js +99 -0
  233. package/node_modules/@codebridge/runner-host/dist/index.d.ts +3 -0
  234. package/node_modules/@codebridge/runner-host/dist/index.js +2 -0
  235. package/node_modules/@codebridge/runner-host/dist/materialize-attachments.d.ts +4 -0
  236. package/node_modules/@codebridge/runner-host/dist/materialize-attachments.js +62 -0
  237. package/node_modules/@codebridge/runner-host/dist/server.d.ts +150 -0
  238. package/node_modules/@codebridge/runner-host/dist/server.js +1295 -0
  239. package/node_modules/@codebridge/runner-host/dist/session-lease.d.ts +12 -0
  240. package/node_modules/@codebridge/runner-host/dist/session-lease.js +146 -0
  241. package/node_modules/@codebridge/runner-host/package.json +26 -0
  242. package/node_modules/@codebridge/session-catalog/dist/index.d.ts +124 -0
  243. package/node_modules/@codebridge/session-catalog/dist/index.js +411 -0
  244. package/node_modules/@codebridge/session-catalog/package.json +17 -0
  245. package/node_modules/@codebridge/session-coordinator/dist/coordinator.d.ts +111 -0
  246. package/node_modules/@codebridge/session-coordinator/dist/coordinator.js +364 -0
  247. package/node_modules/@codebridge/session-coordinator/dist/index.d.ts +5 -0
  248. package/node_modules/@codebridge/session-coordinator/dist/index.js +5 -0
  249. package/node_modules/@codebridge/session-coordinator/dist/lease.d.ts +14 -0
  250. package/node_modules/@codebridge/session-coordinator/dist/lease.js +26 -0
  251. package/node_modules/@codebridge/session-coordinator/dist/queued-claim.d.ts +20 -0
  252. package/node_modules/@codebridge/session-coordinator/dist/queued-claim.js +45 -0
  253. package/node_modules/@codebridge/session-coordinator/dist/recovery.d.ts +31 -0
  254. package/node_modules/@codebridge/session-coordinator/dist/recovery.js +114 -0
  255. package/node_modules/@codebridge/session-coordinator/package.json +17 -0
  256. package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  257. package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  258. package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  259. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  260. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  261. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  262. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  263. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  264. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  265. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  266. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  267. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  268. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  269. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  270. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  271. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  272. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  273. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  274. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  275. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  276. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  277. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  278. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  279. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  280. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  281. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  282. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  283. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  284. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  285. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  286. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  287. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  288. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  289. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  290. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  291. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  292. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  293. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  294. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  295. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  296. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  297. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  298. package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  299. package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  300. package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  301. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  302. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  303. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  304. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  305. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  306. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  307. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  308. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  309. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  310. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  311. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  312. package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  313. package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  314. package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  315. package/node_modules/@codebridge/web/dist/assets/abnfDiagram-N423BO3Z-C-JdFv0U.js +1 -0
  316. package/node_modules/@codebridge/web/dist/assets/arc-DsNROjzU.js +1 -0
  317. package/node_modules/@codebridge/web/dist/assets/architecture-TIHT7OUA-ZEBHG2JZ.js +1 -0
  318. package/node_modules/@codebridge/web/dist/assets/architectureDiagram-T3A2C74G-OsrxcwPM.js +36 -0
  319. package/node_modules/@codebridge/web/dist/assets/array-BifhSqXX.js +1 -0
  320. package/node_modules/@codebridge/web/dist/assets/blockDiagram-VBNYF7ZC-DRgfNeNW.js +132 -0
  321. package/node_modules/@codebridge/web/dist/assets/c4Diagram-5PPSVZJV-BtOGKTh8.js +10 -0
  322. package/node_modules/@codebridge/web/dist/assets/channel-MhXyjxUS.js +1 -0
  323. package/node_modules/@codebridge/web/dist/assets/chunk-2GRJ4B5K-Dy1gJ7sY.js +1 -0
  324. package/node_modules/@codebridge/web/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  325. package/node_modules/@codebridge/web/dist/assets/chunk-4I5QYGJK-1pOLR_SG.js +1 -0
  326. package/node_modules/@codebridge/web/dist/assets/chunk-5RXB4S5H-CP43rgsO.js +231 -0
  327. package/node_modules/@codebridge/web/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  328. package/node_modules/@codebridge/web/dist/assets/chunk-6Q2QTUOP-Bi3Xrp6W.js +88 -0
  329. package/node_modules/@codebridge/web/dist/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  330. package/node_modules/@codebridge/web/dist/assets/chunk-7Z6QIM7H-CILAW2Nk.js +10 -0
  331. package/node_modules/@codebridge/web/dist/assets/chunk-GF5L2VYU-CAp09yhq.js +206 -0
  332. package/node_modules/@codebridge/web/dist/assets/chunk-I66GZJ75-B_rJXmNu.js +128 -0
  333. package/node_modules/@codebridge/web/dist/assets/chunk-JQJVKLGR-OVeOJFCx.js +156 -0
  334. package/node_modules/@codebridge/web/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  335. package/node_modules/@codebridge/web/dist/assets/chunk-KBJHAD2P-uaupp0k5.js +1 -0
  336. package/node_modules/@codebridge/web/dist/assets/chunk-KEIR6QF5-BICK3FdT.js +161 -0
  337. package/node_modules/@codebridge/web/dist/assets/chunk-NSK5VX7P-fIHF5wwn.js +2 -0
  338. package/node_modules/@codebridge/web/dist/assets/chunk-QR6OTTB3-DxkJuF2b.js +62 -0
  339. package/node_modules/@codebridge/web/dist/assets/chunk-RYQCIY6F-CC5j3u-X.js +1 -0
  340. package/node_modules/@codebridge/web/dist/assets/chunk-UBXNYLIW-DB35O-6R.js +1 -0
  341. package/node_modules/@codebridge/web/dist/assets/chunk-W5SLKNZC-bkRBsbq-.js +1 -0
  342. package/node_modules/@codebridge/web/dist/assets/chunk-WRU74C26-DwvEoD-1.js +70 -0
  343. package/node_modules/@codebridge/web/dist/assets/chunk-XXDRQBXY-DRyYA-HY.js +1 -0
  344. package/node_modules/@codebridge/web/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  345. package/node_modules/@codebridge/web/dist/assets/classDiagram-JCYQIIEL-B8r7z8ii.js +1 -0
  346. package/node_modules/@codebridge/web/dist/assets/classDiagram-v2-OCEON4UE-B8r7z8ii.js +1 -0
  347. package/node_modules/@codebridge/web/dist/assets/cose-bilkent-JH36ORCC-CLkwlrX7.js +1 -0
  348. package/node_modules/@codebridge/web/dist/assets/cynefin-VYW2F7L2-C3_Llw02.js +1 -0
  349. package/node_modules/@codebridge/web/dist/assets/cynefinDiagram-MW4NZA55-D5v7UnJy.js +62 -0
  350. package/node_modules/@codebridge/web/dist/assets/cytoscape.esm-B-NFISlW.js +321 -0
  351. package/node_modules/@codebridge/web/dist/assets/dagre-Buvkdvvj.js +1 -0
  352. package/node_modules/@codebridge/web/dist/assets/dagre-VZM6K2ZE-Cr0IibwW.js +4 -0
  353. package/node_modules/@codebridge/web/dist/assets/defaultLocale-BFoDCU3G.js +1 -0
  354. package/node_modules/@codebridge/web/dist/assets/diagram-7IWD3JNH-CpQXDIzA.js +30 -0
  355. package/node_modules/@codebridge/web/dist/assets/diagram-B4RE2ZJO-VaOkH0Ya.js +3 -0
  356. package/node_modules/@codebridge/web/dist/assets/diagram-LBJQPF4R-D0iXyNks.js +24 -0
  357. package/node_modules/@codebridge/web/dist/assets/diagram-Q27KOJAE-CtqYk01P.js +24 -0
  358. package/node_modules/@codebridge/web/dist/assets/diagram-UB23O5K3-CFnd3H1_.js +41 -0
  359. package/node_modules/@codebridge/web/dist/assets/dist-D2L7nRdk.js +1 -0
  360. package/node_modules/@codebridge/web/dist/assets/ebnfDiagram-BXEA7PRR-B0GIbJYt.js +1 -0
  361. package/node_modules/@codebridge/web/dist/assets/erDiagram-JOGREHBK-BApaLGVA.js +85 -0
  362. package/node_modules/@codebridge/web/dist/assets/eventmodeling-45OFAUF4-DqGGjcld.js +1 -0
  363. package/node_modules/@codebridge/web/dist/assets/flowDiagram-UKHOOZJN-I_qlizLH.js +1 -0
  364. package/node_modules/@codebridge/web/dist/assets/ganttDiagram-PKOTCBZU-B-QZ-J82.js +292 -0
  365. package/node_modules/@codebridge/web/dist/assets/gitGraph-TEB2WS4Q-DK2SJ2Ne.js +1 -0
  366. package/node_modules/@codebridge/web/dist/assets/gitGraphDiagram-DS77QQ5N-B6Z-pu0D.js +106 -0
  367. package/node_modules/@codebridge/web/dist/assets/graphlib-DS17s2tU.js +1 -0
  368. package/node_modules/@codebridge/web/dist/assets/index-8BzpyygS.js +559 -0
  369. package/node_modules/@codebridge/web/dist/assets/index-Bzaz89LE.css +1 -0
  370. package/node_modules/@codebridge/web/dist/assets/info-DKCQHKI2-CGWxt_Py.js +1 -0
  371. package/node_modules/@codebridge/web/dist/assets/infoDiagram-6WML65LV-77XjrPZs.js +2 -0
  372. package/node_modules/@codebridge/web/dist/assets/init-C-OQMol4.js +1 -0
  373. package/node_modules/@codebridge/web/dist/assets/ishikawaDiagram-WSZJBQD7-P1bZAz2x.js +70 -0
  374. package/node_modules/@codebridge/web/dist/assets/journeyDiagram-NVQOT4AX-C4rwMcBY.js +139 -0
  375. package/node_modules/@codebridge/web/dist/assets/kanban-definition-27J2QSJJ-mtw4a9bc.js +89 -0
  376. package/node_modules/@codebridge/web/dist/assets/line-DP4RkYqm.js +1 -0
  377. package/node_modules/@codebridge/web/dist/assets/linear-DMg3PPio.js +1 -0
  378. package/node_modules/@codebridge/web/dist/assets/map-BaFkSB1l.js +1 -0
  379. package/node_modules/@codebridge/web/dist/assets/mermaid-parser.core-HY84kHw1.js +7 -0
  380. package/node_modules/@codebridge/web/dist/assets/mermaid.core-DdgCdsnM.js +42 -0
  381. package/node_modules/@codebridge/web/dist/assets/mindmap-definition-FAOFIHXS-Cw1EnbhZ.js +96 -0
  382. package/node_modules/@codebridge/web/dist/assets/ordinal-BDEzSJ7C.js +1 -0
  383. package/node_modules/@codebridge/web/dist/assets/packet-7NZHBO7P-CEbrbJH3.js +1 -0
  384. package/node_modules/@codebridge/web/dist/assets/path-fybaL0A-.js +1 -0
  385. package/node_modules/@codebridge/web/dist/assets/pegDiagram-VL7TDLO6-CEc1Gedb.js +1 -0
  386. package/node_modules/@codebridge/web/dist/assets/pie-RZYD4A2V-DPXVs-IW.js +1 -0
  387. package/node_modules/@codebridge/web/dist/assets/pieDiagram-7S7Q4E2Y-hoQeGMFH.js +39 -0
  388. package/node_modules/@codebridge/web/dist/assets/quadrantDiagram-CIZ2JOQS-C-Nmxx0f.js +7 -0
  389. package/node_modules/@codebridge/web/dist/assets/radar-I7S5WNFK-BVd3X3Pd.js +1 -0
  390. package/node_modules/@codebridge/web/dist/assets/railroad-3IZDKUUU-CxLxzr_v.js +1 -0
  391. package/node_modules/@codebridge/web/dist/assets/railroad-abnf-AHOZXSZD-MA1zPI84.js +1 -0
  392. package/node_modules/@codebridge/web/dist/assets/railroad-ebnf-EBAXGLYW-Bqug_umD.js +1 -0
  393. package/node_modules/@codebridge/web/dist/assets/railroad-peg-LSFZ7HO6-DRcRFwpq.js +1 -0
  394. package/node_modules/@codebridge/web/dist/assets/railroadDiagram-AXF67PYL-B007ZkL9.js +1 -0
  395. package/node_modules/@codebridge/web/dist/assets/requirementDiagram-LRYGKXZP-LrTCcEi5.js +84 -0
  396. package/node_modules/@codebridge/web/dist/assets/rough.esm-Dy-Kn_BL.js +1 -0
  397. package/node_modules/@codebridge/web/dist/assets/sankeyDiagram-W5VNT64P-Ch4mzHck.js +40 -0
  398. package/node_modules/@codebridge/web/dist/assets/sequenceDiagram-SI44F4Z6-CHg4OzLX.js +162 -0
  399. package/node_modules/@codebridge/web/dist/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  400. package/node_modules/@codebridge/web/dist/assets/src-BrO6_odD.js +1 -0
  401. package/node_modules/@codebridge/web/dist/assets/stateDiagram-OKZ733FA-7cVkr5nR.js +1 -0
  402. package/node_modules/@codebridge/web/dist/assets/stateDiagram-v2-UEYNNEHI-CTy_mAXb.js +1 -0
  403. package/node_modules/@codebridge/web/dist/assets/swimlanes-SLNWSIFB-BwSVF5qy.js +2 -0
  404. package/node_modules/@codebridge/web/dist/assets/swimlanesDiagram-ULZ7WXOC-BBQnfZ1j.js +8 -0
  405. package/node_modules/@codebridge/web/dist/assets/timeline-definition-Z64GVDOM-BaHEkVDV.js +120 -0
  406. package/node_modules/@codebridge/web/dist/assets/treeView-QDETBFTQ-CF0kLN62.js +1 -0
  407. package/node_modules/@codebridge/web/dist/assets/treemap-6X3UGDF4-BB8A8uux.js +1 -0
  408. package/node_modules/@codebridge/web/dist/assets/vennDiagram-T6HMQDX7-BFK12Iro.js +34 -0
  409. package/node_modules/@codebridge/web/dist/assets/wardley-OPB4EBWU-C_3y61zk.js +1 -0
  410. package/node_modules/@codebridge/web/dist/assets/wardleyDiagram-T6FBY63Y-W2oGu4WK.js +78 -0
  411. package/node_modules/@codebridge/web/dist/assets/xychartDiagram-ELKLHX3M-BiVRnbvz.js +7 -0
  412. package/node_modules/@codebridge/web/dist/brand/agent-logo-carbon.svg +1 -0
  413. package/node_modules/@codebridge/web/dist/brand/agent-logo.svg +1 -0
  414. package/node_modules/@codebridge/web/dist/brand/agnet-logo-carbon.svg +1 -0
  415. package/node_modules/@codebridge/web/dist/brand/agnet-logo.svg +1 -0
  416. package/node_modules/@codebridge/web/dist/brand/agnet-mark-carbon.svg +1 -0
  417. package/node_modules/@codebridge/web/dist/brand/agnet-mark.svg +1 -0
  418. package/node_modules/@codebridge/web/dist/fonts/CommitMono-400-Regular.otf +0 -0
  419. package/node_modules/@codebridge/web/dist/fonts/CommitMono-700-Regular.otf +0 -0
  420. package/node_modules/@codebridge/web/dist/fonts/CommitMono-OFL.txt +21 -0
  421. package/node_modules/@codebridge/web/dist/fonts/DepartureMono-OFL.txt +21 -0
  422. package/node_modules/@codebridge/web/dist/fonts/DepartureMono-Regular.woff2 +0 -0
  423. package/node_modules/@codebridge/web/dist/index.html +25 -0
  424. package/node_modules/@codebridge/web/package.json +7 -0
  425. package/node_modules/@codebridge/work-items/dist/index.d.ts +371 -0
  426. package/node_modules/@codebridge/work-items/dist/index.js +1784 -0
  427. package/node_modules/@codebridge/work-items/dist/session-projector.d.ts +4 -0
  428. package/node_modules/@codebridge/work-items/dist/session-projector.js +506 -0
  429. package/node_modules/@codebridge/work-items/dist/session-runtime.d.ts +274 -0
  430. package/node_modules/@codebridge/work-items/dist/session-runtime.js +1103 -0
  431. package/node_modules/@codebridge/work-items/dist/session-schema.d.ts +9 -0
  432. package/node_modules/@codebridge/work-items/dist/session-schema.js +292 -0
  433. package/node_modules/@codebridge/work-items/package.json +20 -0
  434. package/package.json +75 -4
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import { ConfigStore, VERSION } from "@codebridge/core";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ async function main() {
6
+ const args = process.argv.slice(2);
7
+ if (args.includes("--version") || args.includes("-V")) {
8
+ console.log(VERSION);
9
+ return;
10
+ }
11
+ if (args.includes("--help") || args.includes("-h")) {
12
+ console.log("Usage: codebridge-runner [-c <config.yaml>] [--version] [--help]");
13
+ return;
14
+ }
15
+ const configFlag = args.indexOf("-c");
16
+ const configFile = configFlag >= 0 ? args[configFlag + 1] : undefined;
17
+ if (configFile) {
18
+ process.env.DATA_DIR = path.dirname(path.resolve(configFile));
19
+ }
20
+ // The Runner only needs its own token; never fail on Feishu/Telegram secrets it does not use.
21
+ const store = new ConfigStore({ resolve: ["runner.token"] });
22
+ const config = store.reload();
23
+ const listen = config.runnerHost?.listen ??
24
+ process.env.RUNNER_LISTEN ??
25
+ "127.0.0.1:19789";
26
+ const [hostname, portStr] = listen.split(":");
27
+ const port = Number(portStr);
28
+ const { serve } = await import("@hono/node-server");
29
+ const { createRunnerApp, RunnerHost } = await import("./server.js");
30
+ const runnerHost = new RunnerHost({
31
+ token: config.runner.token,
32
+ config,
33
+ maxConcurrentRuns: config.runnerHost?.maxConcurrentRuns,
34
+ dataDir: path.dirname(store.path),
35
+ deploymentMcpServerPath: fileURLToPath(new URL("./deployment-mcp-server.js", import.meta.url)),
36
+ });
37
+ const app = createRunnerApp(runnerHost, config.runner.token);
38
+ console.log(`codebridge-runner listening on http://${hostname}:${port}`);
39
+ serve({ fetch: app.fetch, hostname, port });
40
+ // 适配器子进程是 detached(自成进程组),不会随 runner 死——退出前必须同步清场
41
+ //(池内空闲进程 + 在飞 run),否则每次 stop/重启都会留孤儿。start.sh 的
42
+ // SIGTERM→0.5s→SIGKILL 窗口内同步 kill 来得及。
43
+ const shutdown = () => {
44
+ try {
45
+ runnerHost.shutdown();
46
+ }
47
+ finally {
48
+ process.exit(0);
49
+ }
50
+ };
51
+ process.on("SIGTERM", shutdown);
52
+ process.on("SIGINT", shutdown);
53
+ }
54
+ main().catch((err) => {
55
+ console.error(err);
56
+ process.exit(1);
57
+ });
58
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,13 @@
1
+ type ExecFileResult = {
2
+ stdout: string;
3
+ };
4
+ type ExecFileRunner = (file: string, args: string[]) => Promise<ExecFileResult>;
5
+ export interface CodexSessionOwnershipOptions {
6
+ codexHome?: string;
7
+ platform?: NodeJS.Platform;
8
+ execFile?: ExecFileRunner;
9
+ }
10
+ export declare function filterForeignOwnerPids(pids: number[], allowedProcessGroups: ReadonlySet<number>, processGroupOf: (pid: number) => Promise<number | undefined>): Promise<number[]>;
11
+ export declare function inspectForeignCodexSessionOwners(sessionId: string, allowedProcessGroups: ReadonlySet<number>, options?: CodexSessionOwnershipOptions): Promise<number[]>;
12
+ export {};
13
+ //# sourceMappingURL=codex-session-ownership.d.ts.map
@@ -0,0 +1,79 @@
1
+ import fs from "node:fs/promises";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { execFile } from "node:child_process";
5
+ import { promisify } from "node:util";
6
+ const execFileAsync = promisify(execFile);
7
+ const defaultExecFile = async (file, args) => {
8
+ const { stdout } = await execFileAsync(file, args);
9
+ return { stdout: String(stdout) };
10
+ };
11
+ export async function filterForeignOwnerPids(pids, allowedProcessGroups, processGroupOf) {
12
+ const foreign = [];
13
+ for (const pid of pids) {
14
+ const group = await processGroupOf(pid);
15
+ if (group === undefined || !allowedProcessGroups.has(group))
16
+ foreign.push(pid);
17
+ }
18
+ return foreign;
19
+ }
20
+ async function findRolloutPath(directory, suffix, depth) {
21
+ if (depth < 0)
22
+ return undefined;
23
+ const entries = await fs
24
+ .readdir(directory, { withFileTypes: true })
25
+ .catch(() => undefined);
26
+ if (!entries)
27
+ return undefined;
28
+ for (const entry of entries) {
29
+ const candidate = path.join(directory, entry.name);
30
+ if (entry.isFile() && entry.name.endsWith(suffix))
31
+ return candidate;
32
+ if (entry.isDirectory()) {
33
+ const found = await findRolloutPath(candidate, suffix, depth - 1);
34
+ if (found)
35
+ return found;
36
+ }
37
+ }
38
+ return undefined;
39
+ }
40
+ async function processGroupOf(pid, run) {
41
+ try {
42
+ const { stdout } = await run("ps", ["-o", "pgid=", "-p", String(pid)]);
43
+ const value = Number.parseInt(stdout.trim(), 10);
44
+ return Number.isFinite(value) ? value : undefined;
45
+ }
46
+ catch {
47
+ return undefined;
48
+ }
49
+ }
50
+ export async function inspectForeignCodexSessionOwners(sessionId, allowedProcessGroups, options = {}) {
51
+ if ((options.platform ?? process.platform) !== "darwin")
52
+ return [];
53
+ const codexHome = options.codexHome ?? path.join(os.homedir(), ".codex");
54
+ const run = options.execFile ?? defaultExecFile;
55
+ const suffix = `-${sessionId}.jsonl`;
56
+ const rolloutPath = (await findRolloutPath(path.join(codexHome, "sessions"), suffix, 4)) ??
57
+ (await findRolloutPath(path.join(codexHome, "archived_sessions"), suffix, 1));
58
+ if (!rolloutPath)
59
+ return [];
60
+ let stdout = "";
61
+ try {
62
+ ({ stdout } = await run("lsof", ["-t", rolloutPath]));
63
+ }
64
+ catch (error) {
65
+ const result = error;
66
+ if (result.code === 1 || result.code === "ENOENT")
67
+ return [];
68
+ if (typeof result.stdout === "string")
69
+ stdout = result.stdout;
70
+ else
71
+ throw error;
72
+ }
73
+ const pids = [...new Set(stdout
74
+ .split(/\s+/)
75
+ .map((value) => Number.parseInt(value, 10))
76
+ .filter((value) => Number.isFinite(value)))];
77
+ return filterForeignOwnerPids(pids, allowedProcessGroups, (pid) => processGroupOf(pid, run));
78
+ }
79
+ //# sourceMappingURL=codex-session-ownership.js.map
@@ -0,0 +1,10 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { StdioMcpServerConfig } from "@codebridge/core";
3
+ export interface DeploymentMcpContext {
4
+ api: string;
5
+ token: string;
6
+ runId: string;
7
+ }
8
+ export declare function createDeploymentMcpServer(deployment?: DeploymentMcpContext): McpServer;
9
+ export declare function createDeploymentMcpServerConfig(scriptPath: string, deployment: DeploymentMcpContext): StdioMcpServerConfig;
10
+ //# sourceMappingURL=deployment-mcp-server.d.ts.map
@@ -0,0 +1,54 @@
1
+ import path from "node:path";
2
+ import { z } from "zod";
3
+ import { fileURLToPath } from "node:url";
4
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
+ const DeploymentInputSchema = z.object({
7
+ action: z.enum(["prepare", "publish", "status", "cancel", "rollback"]),
8
+ ref: z.string().optional(),
9
+ releaseId: z.string().optional(),
10
+ publishAfterPrepare: z.boolean().optional(),
11
+ }).strict();
12
+ export function createDeploymentMcpServer(deployment) {
13
+ const server = new McpServer({ name: "codebridge-internal", version: "1.0.0" });
14
+ if (deployment)
15
+ server.registerTool("codebridge_deploy", {
16
+ description: "CodeBridge 安全发布:准备候选、按用户明确授权上线、查询状态、取消或回滚。身份由当前任务绑定;无需 shell 网络或放宽沙箱。发布与回滚仍由 Bridge 校验飞书原始授权。",
17
+ inputSchema: DeploymentInputSchema,
18
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
19
+ }, async (input) => {
20
+ if (!deployment.runId || !deployment.token || !deployment.api) {
21
+ return { isError: true, content: [{ type: "text", text: "发布工具缺少当前任务身份或连接配置,已拒绝执行。" }] };
22
+ }
23
+ try {
24
+ const response = await fetch(`${deployment.api}/deploy/command`, {
25
+ method: "POST",
26
+ headers: { authorization: `Bearer ${deployment.token}`, "content-type": "application/json" },
27
+ body: JSON.stringify({ ...DeploymentInputSchema.parse(input), runId: deployment.runId }),
28
+ signal: AbortSignal.timeout(15_000),
29
+ });
30
+ const text = await response.text();
31
+ return { isError: !response.ok, content: [{ type: "text", text }] };
32
+ }
33
+ catch {
34
+ return { isError: true, content: [{ type: "text", text: "暂时联系不上本机 Bridge 发布接口,请稍后重试。" }] };
35
+ }
36
+ });
37
+ return server;
38
+ }
39
+ export function createDeploymentMcpServerConfig(scriptPath, deployment) {
40
+ if (!path.isAbsolute(scriptPath))
41
+ throw new Error("Internal MCP server path must be absolute");
42
+ return { name: "codebridge-internal", command: process.execPath, args: [scriptPath],
43
+ env: { FCB_API: deployment.api, FCB_TOKEN: deployment.token, FCB_RUN_ID: deployment.runId } };
44
+ }
45
+ async function main() {
46
+ const server = createDeploymentMcpServer(process.env.FCB_API === undefined ? undefined : {
47
+ api: process.env.FCB_API, token: process.env.FCB_TOKEN ?? "", runId: process.env.FCB_RUN_ID ?? "",
48
+ });
49
+ await server.connect(new StdioServerTransport());
50
+ }
51
+ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
52
+ main().catch((error) => { console.error(error instanceof Error ? error.message : String(error)); process.exitCode = 1; });
53
+ }
54
+ //# sourceMappingURL=deployment-mcp-server.js.map
@@ -0,0 +1,3 @@
1
+ /** 把 fcb 写入 <dataDir>/bin/fcb 并加执行位,返回 bin 目录 */
2
+ export declare function writeFcbScript(dataDir: string): Promise<string>;
3
+ //# sourceMappingURL=fcb-script.d.ts.map
@@ -0,0 +1,99 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ /**
4
+ * fcb — 注入到 Agent 子进程 PATH 的小命令,通过 Bridge 出站 API
5
+ * 把文件/消息发回当前飞书聊天。纯 node 实现,无外部依赖。
6
+ */
7
+ const FCB_SCRIPT = `#!/usr/bin/env node
8
+ // fcb — 在 CodeBridge Agent 任务里把文件/消息发回当前聊天
9
+ // 用法: fcb send <文件路径> | fcb say <消息> | fcb mention <对象引用> <消息> | fcb alert status <状态> <证据或待办> | fcb deploy prepare [--publish] [--ref <commit>] | fcb deploy apply/status/cancel/rollback [release]
10
+ const path = require("node:path");
11
+ const fs = require("node:fs");
12
+
13
+ const api = process.env.FCB_API;
14
+ const token = process.env.FCB_TOKEN;
15
+ // Destination is resolved by Bridge from FCB_RUN_ID; never use FCB_CHAT_ID to send.
16
+ const runId = process.env.FCB_RUN_ID;
17
+
18
+ function fail(msg) {
19
+ console.error(msg);
20
+ process.exit(1);
21
+ }
22
+
23
+ async function post(route, body) {
24
+ const res = await fetch(api + route, {
25
+ method: "POST",
26
+ headers: {
27
+ "content-type": "application/json",
28
+ authorization: "Bearer " + token,
29
+ },
30
+ body: JSON.stringify(body),
31
+ });
32
+ const text = await res.text();
33
+ if (!res.ok) fail("fcb: " + res.status + " " + text);
34
+ console.log(text);
35
+ }
36
+
37
+ async function main() {
38
+ if (!api || !token || !runId) {
39
+ fail("fcb: 缺少 FCB_API/FCB_TOKEN/FCB_RUN_ID(仅在 CodeBridge 任务中可用)");
40
+ }
41
+ const [cmd, ...rest] = process.argv.slice(2);
42
+ if (cmd === "deploy") {
43
+ if (!runId) fail("fcb: 发布操作缺少当前任务身份,不能执行");
44
+ const actions = {prepare: "prepare", apply: "publish", status: "status", cancel: "cancel", rollback: "rollback"};
45
+ const action = actions[rest[0]];
46
+ if (!action) fail("fcb: 发布操作支持 prepare/apply/status/cancel/rollback");
47
+ const body = {runId, action};
48
+ const args = rest.slice(1);
49
+ if (action === "prepare") {
50
+ for (let i = 0; i < args.length; i++) {
51
+ if (args[i] === "--publish") body.publishAfterPrepare = true;
52
+ else if (args[i] === "--ref" && args[i + 1] && !args[i + 1].startsWith("-")) body.ref = args[++i];
53
+ else fail("fcb: 未识别的发布参数 " + args[i]);
54
+ }
55
+ } else {
56
+ if (args.length > 1 || (args[0] && args[0].startsWith("-"))) fail("fcb: 请只提供一个发布编号或省略");
57
+ if (args[0]) body.releaseId = args[0];
58
+ }
59
+ await post("/deploy/command", body);
60
+ } else if (cmd === "send" && rest[0]) {
61
+ await post("/outbound/file", {
62
+ runId,
63
+ path: path.resolve(rest[0]),
64
+ });
65
+ } else if (cmd === "say" && rest.length) {
66
+ await post("/outbound/markdown", {
67
+ runId,
68
+ markdown: rest.join(" "),
69
+ });
70
+ } else if (cmd === "mention" && rest[0] && rest.length > 1) {
71
+ await post("/outbound/mention", {
72
+ runId,
73
+ ref: rest[0],
74
+ text: rest.slice(1).join(" "),
75
+ });
76
+ } else if (cmd === "alert" && rest[0] === "status" && rest[1] && rest.length > 2) {
77
+ await post("/outbound/alert-status", {runId, status: rest[1], summary: rest.slice(2).join(" ")});
78
+ } else {
79
+ fail("用法: fcb send <文件路径> | fcb say <消息> | fcb mention <对象引用> <消息> | fcb alert status <状态> <证据或待办> | fcb deploy prepare [--publish] [--ref <commit>] | fcb deploy apply/status/cancel/rollback [release]");
80
+ }
81
+ }
82
+
83
+ main().catch((err) => {
84
+ if (process.argv[2] === "deploy" && ["EPERM", "EACCES"].includes(err.cause?.code)) {
85
+ fail("fcb: 当前执行沙箱禁止本机网络,请使用 codebridge_deploy MCP 工具;不要关闭沙箱或重启服务。");
86
+ }
87
+ fail("fcb: " + (err instanceof Error ? err.message : String(err)));
88
+ });
89
+ `;
90
+ /** 把 fcb 写入 <dataDir>/bin/fcb 并加执行位,返回 bin 目录 */
91
+ export async function writeFcbScript(dataDir) {
92
+ const binDir = path.join(dataDir, "bin");
93
+ await fs.mkdir(binDir, { recursive: true });
94
+ const file = path.join(binDir, "fcb");
95
+ await fs.writeFile(file, FCB_SCRIPT, { mode: 0o755 });
96
+ await fs.chmod(file, 0o755);
97
+ return binDir;
98
+ }
99
+ //# sourceMappingURL=fcb-script.js.map
@@ -0,0 +1,3 @@
1
+ export { RunnerHost, createRunnerApp } from "./server.js";
2
+ export type { RunnerHostOptions } from "./server.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { RunnerHost, createRunnerApp } from "./server.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import type { LocalMediaPath, RunAttachment } from "@codebridge/core";
2
+ export declare function materializeAttachments(dataDir: string, runId: string, attachments?: RunAttachment[]): Promise<LocalMediaPath[]>;
3
+ export declare function cleanupAttachments(dataDir: string, runId: string): Promise<void>;
4
+ //# sourceMappingURL=materialize-attachments.d.ts.map
@@ -0,0 +1,62 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ function truncateUtf8(value, maxBytes) {
4
+ let bytes = 0;
5
+ const characters = [];
6
+ for (const character of value) {
7
+ bytes += Buffer.byteLength(character, "utf8");
8
+ if (bytes > maxBytes)
9
+ break;
10
+ characters.push(character);
11
+ }
12
+ return characters.join("");
13
+ }
14
+ export async function materializeAttachments(dataDir, runId, attachments) {
15
+ if (!attachments?.length)
16
+ return [];
17
+ const dir = path.join(dataDir, "attachments", runId);
18
+ await fs.mkdir(dir, { recursive: true });
19
+ const out = [];
20
+ const usedNames = new Set();
21
+ try {
22
+ for (let i = 0; i < attachments.length; i++) {
23
+ const att = attachments[i];
24
+ const basename = path.posix.basename((att.name || "").replace(/\\/g, "/"));
25
+ const sanitized = basename.normalize("NFC")
26
+ .replace(/[\x00-\x1f\x7f<>:"|?*]/g, "_")
27
+ .replace(/[. ]+$/g, "");
28
+ const originalName = sanitized || `attachment-${i + 1}.bin`;
29
+ const originalExtension = path.extname(originalName);
30
+ // Keep normal format extensions; an oversized suffix is filename content.
31
+ const extension = Buffer.byteLength(originalExtension, "utf8") <= 32
32
+ ? originalExtension
33
+ : "";
34
+ const stem = originalName.slice(0, originalName.length - extension.length);
35
+ const stemBudget = 255 - Buffer.byteLength(extension, "utf8");
36
+ let safeName = `${truncateUtf8(stem, stemBudget)}${extension}`;
37
+ let suffix = 2;
38
+ while (usedNames.has(safeName.toLowerCase())) {
39
+ const collisionSuffix = `-${suffix++}`;
40
+ safeName = `${truncateUtf8(stem, stemBudget - collisionSuffix.length)}${collisionSuffix}${extension}`;
41
+ }
42
+ usedNames.add(safeName.toLowerCase());
43
+ const filePath = path.join(dir, safeName);
44
+ await fs.writeFile(filePath, Buffer.from(att.dataBase64, "base64"));
45
+ out.push({
46
+ path: filePath,
47
+ mimeType: att.mimeType,
48
+ name: safeName,
49
+ });
50
+ }
51
+ }
52
+ catch (error) {
53
+ await cleanupAttachments(dataDir, runId);
54
+ throw error;
55
+ }
56
+ return out;
57
+ }
58
+ export async function cleanupAttachments(dataDir, runId) {
59
+ const dir = path.join(dataDir, "attachments", runId);
60
+ await fs.rm(dir, { recursive: true, force: true }).catch(() => { });
61
+ }
62
+ //# sourceMappingURL=materialize-attachments.js.map
@@ -0,0 +1,150 @@
1
+ import { AgentSetupService, forkPiSession, SkillControlPlane, type AgentAuthProbe, type AgentSetupInstallResult, type AgentSetupRecord, type CliSessionSummary, type PiSession, type PiSessionLifecycleResult, type ProviderSessionHistoryEvent, type SkillAgentId, type SkillCatalogSnapshot, type SkillMutationPlan, type SkillMutationResult } from "@codebridge/backends";
2
+ import type { AgentAvailableCommand, AgentEvent, AppConfig, BackendConfigOption, RunContext, RunRequest } from "@codebridge/core";
3
+ import { Hono } from "hono";
4
+ export interface RunnerHostOptions {
5
+ token: string;
6
+ config: AppConfig;
7
+ maxConcurrentRuns?: number;
8
+ dataDir?: string;
9
+ agentSetupService?: AgentSetupService;
10
+ /** Test/embedding hook; production uses the native Pi Node SDK factory. */
11
+ piSessionFactory?: (ctx: RunContext) => Promise<PiSession>;
12
+ /** Test/embedding hook for provider-native session fork. */
13
+ piSessionForker?: typeof forkPiSession;
14
+ inspectSessionOwners?: (sessionId: string, allowedProcessGroups: ReadonlySet<number>) => Promise<number[]>;
15
+ /** Host-native directory chooser. Production uses the macOS folder panel. */
16
+ directoryPicker?: () => Promise<string | null>;
17
+ /** Test/embedding hook for Codex app-server Skill discovery. */
18
+ codexSkillLister?: (cwd: string) => Promise<AgentAvailableCommand[]>;
19
+ /** Absolute built entrypoint for the Bridge-owned read-only MCP server. */
20
+ deploymentMcpServerPath?: string;
21
+ /** Test/embedding hook; production owns local Skill filesystem projection here. */
22
+ skillControlPlane?: Pick<SkillControlPlane, "scan" | "addSource" | "previewAdopt" | "previewAssignment" | "previewGlobalState" | "previewUnmanage" | "applyPlan">;
23
+ }
24
+ export declare class RunnerHost {
25
+ private readonly options;
26
+ private readonly registry;
27
+ private readonly active;
28
+ private readonly runLifecycles;
29
+ private readonly maxConcurrent;
30
+ private readonly dataDir;
31
+ private readonly acpPermissionPolicy;
32
+ private readonly acpRunOptions;
33
+ private readonly fcbBinDir;
34
+ private readonly sessionLeases;
35
+ private readonly inspectSessionOwners;
36
+ /** 长驻 ACP 会话池:同会话消息复用适配器进程(kill switch: runnerHost.acpSessionPool) */
37
+ private readonly sessionPool;
38
+ private readonly agentSetup;
39
+ private readonly skillControlPlane;
40
+ /**
41
+ * prompt_feishu:每个 run 的挂起权限请求队列(FIFO)。claude 通常一次只挂一个,
42
+ * 但并行工具可能并发请求——用队列而非单槽,避免互相覆盖、/approve 只回给最早的那个。
43
+ */
44
+ private readonly pendingPermissions;
45
+ private readonly deploymentMcpServerPath;
46
+ constructor(options: RunnerHostOptions);
47
+ /** Agent 子进程环境:fcb 出站 API 凭据 + 把 fcb 挂到 PATH */
48
+ private buildAgentEnv;
49
+ get registryIds(): string[];
50
+ doctor(): Promise<{
51
+ ok: boolean;
52
+ checks: Array<{
53
+ name: string;
54
+ ok: boolean;
55
+ message?: string;
56
+ }>;
57
+ version: string;
58
+ backends: string[];
59
+ authProbes: Record<string, AgentAuthProbe>;
60
+ }>;
61
+ /**
62
+ * 每个已配置的 ACP 后端各探一次登录状态,纯展示用:探测失败/未知也照样返回,绝不让
63
+ * doctor 整体失败,调用方也绝不能拿这个当拦截运行的硬门槛(见 AgentAuthProbe 注释)。
64
+ */
65
+ private probeConfiguredBackendAuth;
66
+ listAgentSetup(): Promise<AgentSetupRecord[]>;
67
+ detectAgent(agentId: string): Promise<AgentSetupRecord>;
68
+ installAgent(agentId: string, strategyId: string): Promise<AgentSetupInstallResult>;
69
+ cancel(runId: string): boolean;
70
+ cancelAndWait(runId: string): Promise<boolean>;
71
+ private createRunLifecycle;
72
+ steer(runId: string, prompt: string): Promise<{
73
+ ok: boolean;
74
+ outcome?: string;
75
+ error?: string;
76
+ }>;
77
+ listSessions(backendId: string, cwd: string, options?: {
78
+ limit?: number;
79
+ all?: boolean;
80
+ }): Promise<{
81
+ sessions: CliSessionSummary[];
82
+ error?: string;
83
+ }>;
84
+ loadSessionHistory(backendId: string, rawCwd: string, sessionId: string, additionalDirectories?: string[]): Promise<ProviderSessionHistoryEvent[]>;
85
+ authorizeDirectory(rawPath: string): Promise<{
86
+ ok: boolean;
87
+ path?: string;
88
+ error?: string;
89
+ }>;
90
+ listDirectory(rawRoot: string, relativePath?: string): Promise<{
91
+ ok: boolean;
92
+ root?: string;
93
+ path?: string;
94
+ relativePath?: string;
95
+ entries?: Array<{
96
+ name: string;
97
+ path: string;
98
+ absolutePath: string;
99
+ kind: "directory" | "file";
100
+ }>;
101
+ error?: string;
102
+ }>;
103
+ pickDirectory(): Promise<{
104
+ ok: boolean;
105
+ path?: string;
106
+ cancelled?: boolean;
107
+ error?: string;
108
+ }>;
109
+ closeSession(backendId: string, cwd: string, sessionId: string): Promise<{
110
+ ok: boolean;
111
+ error?: string;
112
+ }>;
113
+ deleteSession(backendId: string, cwd: string, sessionId: string): Promise<{
114
+ ok: boolean;
115
+ error?: string;
116
+ }>;
117
+ forkSession(backendId: string, cwd: string, sessionId: string, targetCwd: string): Promise<PiSessionLifecycleResult>;
118
+ private manageSession;
119
+ /** /model 动态列表:拉取 ACP 适配器 advertise 的会话配置项 */
120
+ listConfigOptions(backendId: string, cwd: string, model?: string | null): Promise<{
121
+ options: BackendConfigOption[];
122
+ error?: string;
123
+ }>;
124
+ listCommands(backendId: string, cwd: string): Promise<{
125
+ commands: AgentAvailableCommand[];
126
+ error?: string;
127
+ }>;
128
+ scanSkills(): SkillCatalogSnapshot;
129
+ addSkillSource(sourcePath: string): SkillCatalogSnapshot;
130
+ previewSkillAdopt(skillId: string, actorId: string): SkillMutationPlan;
131
+ previewSkillAssignment(input: {
132
+ skill_id: string;
133
+ agent_id: SkillAgentId;
134
+ enabled: boolean;
135
+ actor_id: string;
136
+ }): SkillMutationPlan;
137
+ previewSkillGlobalState(skillId: string, enabled: boolean, actorId: string): SkillMutationPlan;
138
+ previewSkillUnmanage(skillId: string, actorId: string): SkillMutationPlan;
139
+ applySkillPlan(planId: string, actorId: string): SkillMutationResult;
140
+ executeRun(request: RunRequest): AsyncGenerator<AgentEvent>;
141
+ private executeRunInner;
142
+ private executeAcpRun;
143
+ private executePiRun;
144
+ /** runner 退出前清场:杀池内空闲进程 + 取消在飞 run(子进程 detached,不清就孤儿) */
145
+ shutdown(): void;
146
+ /** /approve /deny:回应当前 run 最早挂起的权限请求(FIFO) */
147
+ resolvePermission(runId: string, approve: boolean): boolean;
148
+ }
149
+ export declare function createRunnerApp(host: RunnerHost, token: string): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
150
+ //# sourceMappingURL=server.d.ts.map