relay-ide 0.1.0 → 0.2.0-rc.1

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 (442) hide show
  1. package/README.md +135 -202
  2. package/dist/bin/node-credential-file.js +29 -0
  3. package/dist/bin/relay-ide.js +6542 -72
  4. package/dist/bin/relayctl.js +740 -0
  5. package/dist/frontend/assets/App-Cv-k2TxO.js +257 -0
  6. package/dist/frontend/assets/App-DtockWI7.css +32 -0
  7. package/dist/frontend/assets/index-BIFXFy2O.js +1 -0
  8. package/dist/frontend/assets/index-Bh_lB7Xu.js +1 -0
  9. package/dist/frontend/assets/index-Bn959Ab2.js +153 -0
  10. package/dist/frontend/assets/index-C-Jlb3CN.js +1 -0
  11. package/dist/frontend/assets/index-Cm4dl4Wz.js +13 -0
  12. package/dist/frontend/assets/index-CxWHzrFD.js +1 -0
  13. package/dist/frontend/assets/index-D-gq106U.js +1 -0
  14. package/dist/frontend/assets/index-DAAVAocY.js +7 -0
  15. package/dist/frontend/assets/index-DANn_-AZ.js +3 -0
  16. package/dist/frontend/assets/index-DEACxXa5.js +1 -0
  17. package/dist/frontend/assets/index-DXIelFwt.js +6 -0
  18. package/dist/frontend/assets/index-DgxjJOLb.js +1 -0
  19. package/dist/frontend/assets/index-_OsY6l1a.js +2 -0
  20. package/dist/frontend/assets/main-BHhqbMno.css +1 -0
  21. package/dist/frontend/assets/main-fVFzGb1d.js +292 -0
  22. package/dist/frontend/assets/ruby-B2Rjki9n.js +1 -0
  23. package/dist/frontend/assets/shell-CjFT_Tl9.js +1 -0
  24. package/dist/frontend/assets/test-terminal-8ZJUzF03.css +1 -0
  25. package/dist/frontend/assets/test-terminal-A7z64Ztw.js +1 -0
  26. package/dist/frontend/assets/toml-Bm5Em-hy.js +1 -0
  27. package/dist/frontend/icon-192.png +0 -0
  28. package/dist/frontend/icon-512.png +0 -0
  29. package/dist/frontend/index.html +4 -2
  30. package/dist/frontend/sw.js +7 -10
  31. package/dist/frontend/test-terminal.html +15 -0
  32. package/dist/scripts/agent-browser-cli.js +108 -0
  33. package/dist/scripts/channel-memory-load.js +139 -0
  34. package/dist/scripts/dev-backend-config-path.js +15 -0
  35. package/dist/scripts/dev-mode.js +142 -0
  36. package/dist/scripts/dev-supervisor.js +204 -0
  37. package/dist/scripts/dev.js +136 -0
  38. package/dist/scripts/orchestrator-peer.js +365 -0
  39. package/dist/scripts/sandbox-cli.js +62 -0
  40. package/dist/scripts/seed-channel-chat.js +108 -0
  41. package/dist/server/adapters/claude-telemetry.js +118 -0
  42. package/dist/server/adapters/codex-telemetry.js +225 -0
  43. package/dist/server/adapters/opencode-telemetry.js +174 -0
  44. package/dist/server/agent-browser.js +65 -0
  45. package/dist/server/agent-profile-router.js +374 -0
  46. package/dist/server/agent-profile-store.js +547 -0
  47. package/dist/server/analytics.js +210 -111
  48. package/dist/server/anchor-file-fetcher.js +385 -0
  49. package/dist/server/anchor-resolution.js +140 -0
  50. package/dist/server/auth.js +240 -2
  51. package/dist/server/automation-run-finalizers.js +156 -0
  52. package/dist/server/automation-runs.js +318 -0
  53. package/dist/server/browser-content.js +6 -1
  54. package/dist/server/channel-agent-binder.js +1714 -0
  55. package/dist/server/channel-agent-bridge.js +978 -0
  56. package/dist/server/channel-agent-runtime.js +210 -0
  57. package/dist/server/channel-attachments.js +336 -0
  58. package/dist/server/channel-chat-router.js +1230 -0
  59. package/dist/server/channel-context-packet.js +287 -0
  60. package/dist/server/channel-hub.js +554 -0
  61. package/dist/server/channel-message-store.js +2069 -0
  62. package/dist/server/claude-stream-client.js +331 -0
  63. package/dist/server/cli-gateway-actor-auth.js +780 -0
  64. package/dist/server/cli-gateway-event-bus.js +102 -0
  65. package/dist/server/cli-gateway-events.js +312 -0
  66. package/dist/server/cli-gateway-settings.js +243 -0
  67. package/dist/server/clipboard.js +56 -1
  68. package/dist/server/codex-app-server-client.js +239 -0
  69. package/dist/server/codex-hooks-adapter.js +10 -1
  70. package/dist/server/command-center-executor.js +583 -0
  71. package/dist/server/command-center-intent-resolver.js +243 -0
  72. package/dist/server/config.js +126 -188
  73. package/dist/server/confirmation-challenges.js +687 -0
  74. package/dist/server/context-adapters/file-range.js +254 -0
  75. package/dist/server/context-packets.js +508 -0
  76. package/dist/server/control-engine.js +294 -0
  77. package/dist/server/credential-rotation-scheduler.js +166 -0
  78. package/dist/server/diagnostics-bundle.js +461 -0
  79. package/dist/server/features/automation-run-router.js +246 -0
  80. package/dist/server/features/context-inbox-router.js +1183 -0
  81. package/dist/server/features/context-inbox-store-adapter.js +183 -0
  82. package/dist/server/features/frameworks.js +78 -0
  83. package/dist/server/features/ia-tree.js +0 -0
  84. package/dist/server/features/ia-workspace-router.js +323 -0
  85. package/dist/server/features/pr-overseer-router.js +257 -0
  86. package/dist/server/features/repo-inventory.js +44 -0
  87. package/dist/server/features/repo-router.js +554 -0
  88. package/dist/server/features/work-context-artifact-router.js +1239 -0
  89. package/dist/server/features/work-context-message-router.js +489 -0
  90. package/dist/server/features/workflow-run-router.js +234 -0
  91. package/dist/server/file-rpc.js +947 -0
  92. package/dist/server/frameworks.js +92 -0
  93. package/dist/server/gh.js +212 -92
  94. package/dist/server/git-routes.js +93 -82
  95. package/dist/server/git.js +581 -123
  96. package/dist/server/github-app.js +1 -1
  97. package/dist/server/github-graphql.js +53 -49
  98. package/dist/server/handoff-planner.js +477 -0
  99. package/dist/server/handoff-transfer.js +516 -0
  100. package/dist/server/handoffs.js +247 -0
  101. package/dist/server/harness-state-adapter.js +1 -0
  102. package/dist/server/health.js +80 -0
  103. package/dist/server/high-risk-approvals.js +307 -0
  104. package/dist/server/hooks.js +19 -348
  105. package/dist/server/hub-node-link.js +606 -0
  106. package/dist/server/hub-node-registry.js +2440 -0
  107. package/dist/server/hub-node-router.js +3455 -0
  108. package/dist/server/hub-policy-evaluator.js +397 -0
  109. package/dist/server/hub-session-aggregator.js +218 -0
  110. package/dist/server/ia-store.js +406 -0
  111. package/dist/server/ia-workspace-migration.js +189 -0
  112. package/dist/server/index.js +3225 -600
  113. package/dist/server/intervention-log.js +207 -0
  114. package/dist/server/local-logs.js +259 -0
  115. package/dist/server/local-node.js +37 -0
  116. package/dist/server/local-workspace-seed.js +83 -0
  117. package/dist/server/log-events.js +136 -0
  118. package/dist/server/logger.js +144 -2
  119. package/dist/server/node-link-client.js +412 -0
  120. package/dist/server/node-link-pty-host.js +326 -0
  121. package/dist/server/node-link-rpc-host.js +588 -0
  122. package/dist/server/node-logs.js +178 -0
  123. package/dist/server/node-manifest-build.js +300 -0
  124. package/dist/server/node-manifest.js +193 -0
  125. package/dist/server/node-source-diagnostics.js +181 -0
  126. package/dist/server/node-version-skew.js +93 -0
  127. package/dist/server/opencode-relay.js +6 -6
  128. package/dist/server/orchestrator-credential-lifecycle.js +233 -0
  129. package/dist/server/org-dashboard.js +134 -185
  130. package/dist/server/persistence-startup.js +113 -0
  131. package/dist/server/port-allocator.js +572 -0
  132. package/dist/server/port-reconciliation.js +40 -0
  133. package/dist/server/pr-overseer-github.js +304 -0
  134. package/dist/server/pr-overseer.js +345 -0
  135. package/dist/server/process-tree.js +405 -0
  136. package/dist/server/project-workspace.js +184 -0
  137. package/dist/server/protocol-adapter-v2.js +43 -0
  138. package/dist/server/protocol-adapter.js +46 -0
  139. package/dist/server/protocol-adapters/adapter-utils.js +10 -0
  140. package/dist/server/protocol-adapters/attached-runtime-adapter.js +65 -0
  141. package/dist/server/protocol-adapters/claude-adapter.js +2340 -0
  142. package/dist/server/protocol-adapters/codex-native-adapter.js +2401 -0
  143. package/dist/server/protocol-adapters/hermes-adapter.js +1326 -0
  144. package/dist/server/protocol-adapters/index.js +77 -0
  145. package/dist/server/protocol-adapters/legacy-v2-bridge.js +98 -0
  146. package/dist/server/protocol-adapters/mock-adapter.js +377 -0
  147. package/dist/server/protocol-adapters/mock-v2-adapter.js +475 -0
  148. package/dist/server/protocol-adapters/opencode-adapter.js +808 -0
  149. package/dist/server/protocol-adapters/opencode-attached-adapter.js +251 -0
  150. package/dist/server/provider-state/claude-jsonl-state-adapter.js +805 -0
  151. package/dist/server/provider-state/index.js +1 -0
  152. package/dist/server/pty-handler.js +353 -457
  153. package/dist/server/relay-pty-session.js +188 -0
  154. package/dist/server/repo-inventory.js +197 -0
  155. package/dist/server/review-poller.js +113 -125
  156. package/dist/server/runtime-state-paths.js +77 -0
  157. package/dist/server/sandbox.js +128 -0
  158. package/dist/server/security-audit-log.js +383 -0
  159. package/dist/server/self-update.js +394 -0
  160. package/dist/server/service.js +373 -18
  161. package/dist/server/session-attachment.js +215 -0
  162. package/dist/server/session-attribution.js +42 -0
  163. package/dist/server/session-capacity.js +39 -0
  164. package/dist/server/session-control-api.js +134 -0
  165. package/dist/server/session-envelope-registry.js +409 -0
  166. package/dist/server/session-image-ingress.js +95 -0
  167. package/dist/server/session-rename-resolver.js +266 -0
  168. package/dist/server/sessions.js +1209 -362
  169. package/dist/server/startup-restore.js +40 -0
  170. package/dist/server/supervisor-actions.js +526 -0
  171. package/dist/server/supervisor-route-handlers.js +167 -0
  172. package/dist/server/supervisor-snapshot.js +201 -0
  173. package/dist/server/telemetry-adapter.js +14 -0
  174. package/dist/server/telemetry.js +56 -128
  175. package/dist/server/terminal-attention.js +30 -0
  176. package/dist/server/terminal-model-backend.js +153 -0
  177. package/dist/server/ticket-transitions.js +50 -47
  178. package/dist/server/types.js +41 -2
  179. package/dist/server/utils.js +61 -12
  180. package/dist/server/watcher.js +506 -171
  181. package/dist/server/webhook-manager.js +53 -61
  182. package/dist/server/webhooks.js +37 -9
  183. package/dist/server/work-context-artifacts.js +831 -0
  184. package/dist/server/work-context-message-templates.js +366 -0
  185. package/dist/server/work-context-messages.js +349 -0
  186. package/dist/server/work-context-resume-packet.js +781 -0
  187. package/dist/server/work-contexts.js +1288 -0
  188. package/dist/server/workbench-custom-blocks.js +618 -0
  189. package/dist/server/workbench-layout.js +252 -0
  190. package/dist/server/workbench-prompt-hooks.js +507 -0
  191. package/dist/server/workflow-runs.js +211 -0
  192. package/dist/server/workspace-evidence.js +827 -0
  193. package/dist/server/workspace-groups.js +123 -85
  194. package/dist/server/workspace-surfaces.js +544 -0
  195. package/dist/server/workspace-topics.js +1072 -0
  196. package/dist/server/workspaces.js +967 -269
  197. package/dist/server/worktree-cleanup.js +176 -0
  198. package/dist/server/ws-backpressure.js +289 -0
  199. package/dist/server/ws.js +586 -40
  200. package/dist/shared/action-descriptor.js +62 -0
  201. package/dist/shared/agent-chat-protocol-v2.js +1071 -0
  202. package/dist/shared/agent-chat-v1-compat.js +464 -0
  203. package/dist/shared/agent-continuation.js +572 -0
  204. package/dist/shared/agent-profile.js +258 -0
  205. package/dist/shared/agent-roster.js +37 -0
  206. package/dist/shared/agent-view-artifact.js +556 -0
  207. package/dist/shared/automation-run.js +446 -0
  208. package/dist/shared/bench.js +31 -0
  209. package/dist/shared/bootstrap-diagnostics.js +207 -0
  210. package/dist/shared/channel-chat-protocol.js +870 -0
  211. package/dist/shared/chat-events.js +71 -0
  212. package/dist/shared/cli-gateway-claude-tools.js +143 -0
  213. package/dist/shared/cli-gateway-codex-tools.js +286 -0
  214. package/dist/shared/cli-gateway-contract.js +5890 -0
  215. package/dist/shared/cli-gateway-hermes-tools.js +263 -0
  216. package/dist/shared/cli-gateway-runtime.js +527 -0
  217. package/dist/shared/cli-gateway-sessions-wait.js +8 -0
  218. package/dist/shared/command-center-execution.js +1 -0
  219. package/dist/shared/command-center-resolver-corpus.js +87 -0
  220. package/dist/shared/command-center-resolver.js +521 -0
  221. package/dist/shared/context-packet.js +631 -0
  222. package/dist/shared/control-state.js +128 -0
  223. package/dist/shared/dm-channels.js +90 -0
  224. package/dist/shared/environment-option.js +229 -0
  225. package/dist/shared/file-resource-ref.js +172 -0
  226. package/dist/shared/file-rpc.js +15 -0
  227. package/dist/shared/handoff-destination.js +383 -0
  228. package/dist/shared/handoff.js +420 -0
  229. package/dist/shared/hermes-metadata-events.js +617 -0
  230. package/dist/shared/identity.js +56 -0
  231. package/dist/shared/index.js +16 -0
  232. package/dist/shared/log-event.js +101 -0
  233. package/dist/shared/mention-contacts.js +92 -0
  234. package/dist/shared/node-boundary.js +71 -0
  235. package/dist/shared/node-identity-keys.js +278 -0
  236. package/dist/shared/node-manifest.js +179 -0
  237. package/dist/shared/node-pairing-requests.js +95 -0
  238. package/dist/shared/operator-handshake-grants.js +789 -0
  239. package/dist/shared/pipeline-handoff-artifact.js +700 -0
  240. package/dist/shared/pr-overseer.js +824 -0
  241. package/dist/shared/project.js +145 -0
  242. package/dist/shared/prompt-attachment.js +184 -0
  243. package/dist/shared/provider-native-session-state.js +1 -0
  244. package/dist/shared/relay-command-manifest.js +323 -0
  245. package/dist/shared/relay-node-protocol.js +11 -0
  246. package/dist/shared/repo-identity.js +168 -0
  247. package/dist/shared/repo-inventory.js +159 -0
  248. package/dist/shared/safe-defaults.js +108 -0
  249. package/dist/shared/scoped-actor-credentials.js +584 -0
  250. package/dist/shared/security-audit.js +311 -0
  251. package/dist/shared/security-policy.js +308 -0
  252. package/dist/shared/session-durability.js +59 -0
  253. package/dist/shared/session-envelope.js +159 -0
  254. package/dist/shared/session-lane.js +5 -0
  255. package/dist/shared/session-replay.js +241 -0
  256. package/dist/shared/stable-json.js +27 -0
  257. package/dist/shared/supervisor-actions.js +69 -0
  258. package/dist/shared/terminal-cockpit.js +488 -0
  259. package/dist/shared/work-context-message.js +388 -0
  260. package/dist/shared/work-context.js +289 -0
  261. package/dist/shared/workbench-block-environment.js +193 -0
  262. package/dist/shared/workbench-block-types.js +33 -0
  263. package/dist/shared/workbench-custom-blocks.js +102 -0
  264. package/dist/shared/workbench-layout-types.js +180 -0
  265. package/dist/shared/workbench-prompt-hooks.js +227 -0
  266. package/dist/shared/workflow-run.js +355 -0
  267. package/dist/shared/workspace-evidence.js +47 -0
  268. package/dist/shared/workspace-surfaces.js +195 -0
  269. package/dist/shared/workspace-topics.js +981 -0
  270. package/dist/shared/workspace.js +94 -0
  271. package/package.json +78 -14
  272. package/scripts/agent-browser-cli.ts +120 -0
  273. package/scripts/channel-memory-load.ts +161 -0
  274. package/scripts/dev-backend-config-path.ts +19 -0
  275. package/scripts/dev-mode.ts +219 -0
  276. package/scripts/dev-resync.sh +60 -0
  277. package/scripts/dev-supervisor.ts +234 -0
  278. package/scripts/dev.ts +182 -0
  279. package/scripts/orchestrator-peer.ts +548 -0
  280. package/scripts/postinstall.js +121 -0
  281. package/scripts/sandbox-cli.ts +74 -0
  282. package/scripts/seed-channel-chat.ts +126 -0
  283. package/dist/bin/claude-remote-cli.js +0 -390
  284. package/dist/frontend/assets/main-CL5_Wlhv.css +0 -32
  285. package/dist/frontend/assets/main-Czet4Z1x.js +0 -371
  286. package/dist/server/belayer/executor.js +0 -200
  287. package/dist/server/belayer/intake.js +0 -27
  288. package/dist/server/belayer/pipeline.js +0 -97
  289. package/dist/server/belayer/pr-lifecycle.js +0 -69
  290. package/dist/server/belayer/prompts.js +0 -154
  291. package/dist/server/belayer/types.js +0 -23
  292. package/dist/server/integration-linear.js +0 -176
  293. package/dist/server/output-parsers/claude-parser.js +0 -56
  294. package/dist/server/output-parsers/codex-parser.js +0 -13
  295. package/dist/server/output-parsers/index.js +0 -14
  296. package/dist/server/output-parsers/null-parser.js +0 -12
  297. package/dist/server/output-parsers/opencode-parser.js +0 -77
  298. package/dist/server/sdk-handler.js +0 -539
  299. package/dist/test/EmptyState.spec.js +0 -51
  300. package/dist/test/action-coverage.test.js +0 -139
  301. package/dist/test/actions/registry.test.js +0 -59
  302. package/dist/test/actions/shortcuts.test.js +0 -79
  303. package/dist/test/agent-events.test.js +0 -151
  304. package/dist/test/analytics.test.js +0 -158
  305. package/dist/test/attention.test.js +0 -91
  306. package/dist/test/auth.test.js +0 -105
  307. package/dist/test/backend-state.test.js +0 -47
  308. package/dist/test/belayer-executor.test.js +0 -33
  309. package/dist/test/belayer-intake.test.js +0 -44
  310. package/dist/test/belayer-pipeline.test.js +0 -113
  311. package/dist/test/belayer-pr-lifecycle.test.js +0 -26
  312. package/dist/test/belayer-prompts.test.js +0 -60
  313. package/dist/test/belayer-types.test.js +0 -69
  314. package/dist/test/bin/claude-remote-cli.js +0 -214
  315. package/dist/test/boot-state.test.js +0 -133
  316. package/dist/test/branch-lifecycle.test.js +0 -75
  317. package/dist/test/branch-linker.test.js +0 -236
  318. package/dist/test/branch-rename.test.js +0 -45
  319. package/dist/test/branch-watcher.test.js +0 -115
  320. package/dist/test/browser-cli.test.js +0 -91
  321. package/dist/test/browser-content.test.js +0 -93
  322. package/dist/test/browser-tabs-ui.test.js +0 -39
  323. package/dist/test/changed-files-api.test.js +0 -140
  324. package/dist/test/clipboard.test.js +0 -12
  325. package/dist/test/codex-hooks-adapter.test.js +0 -237
  326. package/dist/test/components/EmptyState.spec.js +0 -51
  327. package/dist/test/components/ErrorToast.spec.js +0 -65
  328. package/dist/test/components/TuiCheckbox.spec.js +0 -120
  329. package/dist/test/components/TuiInput.spec.js +0 -186
  330. package/dist/test/components/leaf-component-migration.spec.js +0 -104
  331. package/dist/test/config-freshness.test.js +0 -63
  332. package/dist/test/config.test.js +0 -813
  333. package/dist/test/diff-summary.test.js +0 -98
  334. package/dist/test/display-state.test.js +0 -179
  335. package/dist/test/event-message-types.test.js +0 -32
  336. package/dist/test/file-tree-utils.test.js +0 -167
  337. package/dist/test/framework-types.test.js +0 -183
  338. package/dist/test/frameworks-api.test.js +0 -93
  339. package/dist/test/frontend/src/lib/pr-state.js +0 -114
  340. package/dist/test/fs-browse.test.js +0 -246
  341. package/dist/test/fuzzy-scorer.test.js +0 -145
  342. package/dist/test/gh-routes.test.js +0 -156
  343. package/dist/test/git-changed-files.test.js +0 -152
  344. package/dist/test/git-routes.test.js +0 -146
  345. package/dist/test/git-utils.test.js +0 -68
  346. package/dist/test/git-watcher.test.js +0 -110
  347. package/dist/test/git.test.js +0 -140
  348. package/dist/test/github-app.test.js +0 -455
  349. package/dist/test/github-graphql.test.js +0 -301
  350. package/dist/test/greetings.test.js +0 -83
  351. package/dist/test/hooks-agent-event.test.js +0 -412
  352. package/dist/test/hooks.test.js +0 -149
  353. package/dist/test/integration-github.test.js +0 -220
  354. package/dist/test/integration-jira.test.js +0 -238
  355. package/dist/test/integration-linear.test.js +0 -293
  356. package/dist/test/mobile-input.test.js +0 -235
  357. package/dist/test/opencode-relay.test.js +0 -107
  358. package/dist/test/org-dashboard.test.js +0 -349
  359. package/dist/test/output-parser.test.js +0 -217
  360. package/dist/test/paths.test.js +0 -32
  361. package/dist/test/pr-state.test.js +0 -407
  362. package/dist/test/pr-status.test.js +0 -82
  363. package/dist/test/presets.test.js +0 -242
  364. package/dist/test/pty-handler-multi-agent.test.js +0 -149
  365. package/dist/test/pty-handler.test.js +0 -146
  366. package/dist/test/pull-requests.test.js +0 -78
  367. package/dist/test/review-poller.test.js +0 -349
  368. package/dist/test/server/analytics.js +0 -121
  369. package/dist/test/server/auth.js +0 -63
  370. package/dist/test/server/branch-linker.js +0 -124
  371. package/dist/test/server/clipboard.js +0 -56
  372. package/dist/test/server/config.js +0 -137
  373. package/dist/test/server/git.js +0 -308
  374. package/dist/test/server/hooks.js +0 -196
  375. package/dist/test/server/index.js +0 -1124
  376. package/dist/test/server/integration-github.js +0 -117
  377. package/dist/test/server/integration-jira.js +0 -164
  378. package/dist/test/server/integration-linear.js +0 -176
  379. package/dist/test/server/mobile-input-pipeline.js +0 -123
  380. package/dist/test/server/org-dashboard.js +0 -184
  381. package/dist/test/server/output-parsers/claude-parser.js +0 -54
  382. package/dist/test/server/output-parsers/codex-parser.js +0 -13
  383. package/dist/test/server/output-parsers/index.js +0 -7
  384. package/dist/test/server/pty-handler.js +0 -310
  385. package/dist/test/server/push.js +0 -80
  386. package/dist/test/server/review-poller.js +0 -218
  387. package/dist/test/server/service.js +0 -169
  388. package/dist/test/server/sessions.js +0 -434
  389. package/dist/test/server/ticket-transitions.js +0 -216
  390. package/dist/test/server/types.js +0 -20
  391. package/dist/test/server/utils.js +0 -22
  392. package/dist/test/server/watcher.js +0 -139
  393. package/dist/test/server/workspaces.js +0 -657
  394. package/dist/test/server/ws.js +0 -152
  395. package/dist/test/server-startup.test.js +0 -62
  396. package/dist/test/service.test.js +0 -43
  397. package/dist/test/session-analytics-api.test.js +0 -123
  398. package/dist/test/session-analytics.test.js +0 -425
  399. package/dist/test/session-intent.test.js +0 -249
  400. package/dist/test/sessions.test.js +0 -1152
  401. package/dist/test/sidebar-items.test.js +0 -164
  402. package/dist/test/stores/boot-state-store.test.js +0 -165
  403. package/dist/test/stores/sessions-logic.test.js +0 -191
  404. package/dist/test/stores/toasts-store.test.js +0 -66
  405. package/dist/test/stores/ui-store.test.js +0 -203
  406. package/dist/test/stores/unread-store.test.js +0 -97
  407. package/dist/test/telemetry-api.test.js +0 -54
  408. package/dist/test/telemetry-sync.test.js +0 -68
  409. package/dist/test/telemetry.test.js +0 -295
  410. package/dist/test/terminal-zoom.test.js +0 -102
  411. package/dist/test/test/analytics.test.js +0 -152
  412. package/dist/test/test/auth.test.js +0 -95
  413. package/dist/test/test/branch-linker.test.js +0 -231
  414. package/dist/test/test/branch-rename.test.js +0 -45
  415. package/dist/test/test/clipboard.test.js +0 -12
  416. package/dist/test/test/config.test.js +0 -281
  417. package/dist/test/test/fs-browse.test.js +0 -202
  418. package/dist/test/test/git.test.js +0 -67
  419. package/dist/test/test/hooks.test.js +0 -139
  420. package/dist/test/test/integration-github.test.js +0 -203
  421. package/dist/test/test/integration-jira.test.js +0 -294
  422. package/dist/test/test/integration-linear.test.js +0 -293
  423. package/dist/test/test/mobile-input.test.js +0 -193
  424. package/dist/test/test/org-dashboard.test.js +0 -240
  425. package/dist/test/test/output-parser.test.js +0 -95
  426. package/dist/test/test/paths.test.js +0 -32
  427. package/dist/test/test/pr-state.test.js +0 -220
  428. package/dist/test/test/pull-requests.test.js +0 -67
  429. package/dist/test/test/review-poller.test.js +0 -235
  430. package/dist/test/test/service.test.js +0 -43
  431. package/dist/test/test/sessions.test.js +0 -750
  432. package/dist/test/test/ticket-transitions.test.js +0 -130
  433. package/dist/test/test/version.test.js +0 -34
  434. package/dist/test/test/worktrees.test.js +0 -256
  435. package/dist/test/ticket-transitions.test.js +0 -312
  436. package/dist/test/unread.test.js +0 -23
  437. package/dist/test/version.test.js +0 -34
  438. package/dist/test/webhook-manager.test.js +0 -484
  439. package/dist/test/webhooks.test.js +0 -208
  440. package/dist/test/workspace-groups.test.js +0 -377
  441. package/dist/test/worktrees.test.js +0 -531
  442. /package/dist/{server → shared}/mobile-input-pipeline.js +0 -0
package/README.md CHANGED
@@ -1,258 +1,191 @@
1
1
  # relay-ide
2
2
 
3
- Control Claude Code from your phone or any browser — manage multiple terminal sessions across repos and worktrees with a mobile-friendly web UI.
3
+ Relay is a channel-first workspace for collaborating with AI coding agents from
4
+ any device. A channel is the durable conversation, a DM is a channel with one
5
+ agent profile, and agents participate alongside people. Relay keeps the
6
+ conversation, mentions, threads, agent output, and orchestration in one
7
+ Slack-style interface while local or paired nodes run the actual coding tools
8
+ and terminals.
9
+
10
+ The hub serves the React application and stable JSON gateway. Nodes provide
11
+ agent CLIs, shells, files, repositories, and `relay-pty` terminal execution.
12
+ Claude Code, Codex, OpenCode, Hermes, and custom profiles can participate in
13
+ channels without turning provider-specific process state into the product
14
+ model.
15
+
16
+ ## What is built
17
+
18
+ - Durable channels and DMs backed by SQLite conversation history.
19
+ - Human, agent, and system messages with Markdown, streaming updates, native
20
+ image attachments, mentions, and threaded replies.
21
+ - Rich agent output in the live channel timeline: collapsible reasoning, tool,
22
+ code, output, and diff cards with syntax highlighting.
23
+ - Agent profiles with built-in vendor profiles, custom profile configuration,
24
+ availability state, and channel rosters.
25
+ - Mention routing that starts or reuses the addressed profile's runtime,
26
+ supplies bounded channel context, and mirrors the response into the same
27
+ conversation.
28
+ - A persistent channel orchestrator that can route work to child agents;
29
+ lineage is visible in the operator cockpit.
30
+ - Mobile-ready channel navigation, unread state, agent status, approvals,
31
+ interrupt controls, and terminal fallback.
32
+ - A hub/node execution model for local and paired machines, plus a versioned
33
+ `relay-ide v1 ... --json` gateway for agent-operable actions.
4
34
 
5
35
  ## Prerequisites
6
36
 
7
- | Dependency | Why |
8
- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
9
- | **[Node.js 24+](https://nodejs.org/)** | Runtime for the server |
10
- | **[Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code)** | Default coding agent must be in your `PATH` |
11
- | **[Codex CLI](https://github.com/openai/codex)** | _Optional_ alternative coding agent. Install if you want to use Codex sessions |
12
- | **[GitHub CLI (`gh`)](https://cli.github.com/)** | _Optional_ required for the **PRs tab**. Run `gh auth login` after installing. |
37
+ | Dependency | Why |
38
+ | ------------------------------------------------------ | ------------------------------------------------------------------------------------- |
39
+ | [Node.js 24+](https://nodejs.org/) | Runtime and build target |
40
+ | Agent CLI such as Claude Code, Codex, OpenCode, Hermes | Relay launches configured frameworks as private channel runtimes from the node `PATH` |
41
+ | [GitHub CLI (`gh`)](https://cli.github.com/) | Optional PR and CI integration |
42
+ | [Tailscale](https://tailscale.com/) | Recommended private phone/tablet access |
13
43
 
14
- ## Getting Started
15
-
16
- ### 1. Install
44
+ ## Install and run
17
45
 
18
46
  ```bash
19
47
  npm install -g relay-ide
48
+ relay-ide
20
49
  ```
21
50
 
22
- ### 2. Start the server
51
+ Or install the background hub service:
23
52
 
24
53
  ```bash
25
- relay-ide --bg
54
+ relay-ide hub install
26
55
  ```
27
56
 
28
- This installs a persistent background service (launchd on macOS, systemd on Linux) that starts on login and restarts on crash. See [Background Service](#background-service) for more options.
57
+ Open `http://localhost:3456`. Relay requires a PIN before accepting browser
58
+ traffic. Foreground startup prompts in an interactive terminal when needed;
59
+ background startup can complete setup in the browser.
29
60
 
30
- Or run in the foreground:
61
+ Reset the PIN from the host:
31
62
 
32
63
  ```bash
33
- relay-ide
34
- ```
35
-
36
- ### 3. Set your PIN
37
-
38
- Open `http://localhost:3456` in your browser. On first visit you'll be prompted to create a PIN that protects access to your Claude sessions.
39
-
40
- If you started the server in the foreground, you can set the PIN in the terminal instead.
41
-
42
- ### 4. Add your project directories
43
-
44
- Click **Settings** in the app to add root directories — these are parent folders that contain your git repos (scanned one level deep).
45
-
46
- You can also edit `~/.config/relay-ide/config.json` directly:
47
-
48
- ```json
49
- {
50
- "rootDirs": ["/home/you/projects", "/home/you/work"]
51
- }
64
+ relay-ide pin reset
52
65
  ```
53
66
 
54
- ### 5. Access from your phone
67
+ Do not expose Relay directly to the public internet. For another device, prefer
68
+ Tailscale and open `http://<tailscale-ip>:3456` from the same tailnet.
55
69
 
56
- Relay IDE binds to `0.0.0.0` by default, but you should **not** expose it to the public internet. Use [Tailscale](https://tailscale.com/) for a private encrypted connection between your devices — see [Remote Access](#remote-access) below.
70
+ ## Start a conversation
57
71
 
58
- ## Remote Access
72
+ 1. Open a workspace in Relay.
73
+ 2. Choose a channel or start a DM with an agent profile.
74
+ 3. Write normally or mention a profile, such as `@codex`, in a channel.
75
+ 4. Keep follow-up discussion in the channel or open a message thread.
76
+ 5. Use the channel roster and orchestrator controls to inspect or interrupt
77
+ active agents.
59
78
 
60
- The recommended way to access Relay IDE from another device (phone, tablet, laptop) is [Tailscale](https://tailscale.com/), which creates a private encrypted network using WireGuard.
79
+ Channels own conversation history. Agent runtimes are replaceable execution
80
+ details bound behind profile identities; they are not separate chat
81
+ destinations.
61
82
 
62
- 1. **Install Tailscale** on your computer and on your phone/tablet
63
- - macOS: `brew install tailscale` or download from [tailscale.com/download](https://tailscale.com/download)
64
- - Linux: follow the [install guide](https://tailscale.com/download/linux)
65
- - iOS/Android: install the Tailscale app from your app store
83
+ ## Source development
66
84
 
67
- 2. **Sign in** to the same Tailscale account on both devices
68
-
69
- 3. **Find your computer's Tailscale IP** — run `tailscale ip` or check the admin console (looks like `100.x.y.z`)
70
-
71
- 4. **Open the app** on your phone at `http://100.x.y.z:3456`
72
-
73
- Your traffic is encrypted end-to-end, no ports are exposed to the internet, and only devices on your Tailscale network can reach the server.
74
-
75
- > **Alternatives:** [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) or [ngrok](https://ngrok.com/) also work, but they expose your server to the public internet and rely on the PIN as your only defense.
76
-
77
- ## Platform Support
78
-
79
- Tested on **macOS** and **Linux**. Windows is not currently tested — file watching and PTY spawning may behave differently.
80
-
81
- ## CLI Usage
82
-
83
- ```
84
- Usage: relay-ide [options]
85
- relay-ide <command>
86
-
87
- Commands:
88
- update Update to the latest version from npm
89
- install Install as a background service (survives reboot)
90
- uninstall Stop and remove the background service
91
- status Show whether the service is running
92
- worktree Manage git worktrees (wraps git worktree)
93
- add [path] [-b branch] [--yolo] Create worktree and launch Claude
94
- remove <path> Forward to git worktree remove
95
- list Forward to git worktree list
96
- pin Manage authentication PIN
97
- reset Reset the PIN (interactive, requires TTY)
98
-
99
- Options:
100
- --bg Shortcut: install and start as background service
101
- --port <port> Override server port (default: 3456)
102
- --host <host> Override bind address (default: 0.0.0.0)
103
- --config <path> Path to config.json (default: ~/.config/relay-ide/config.json)
104
- --yolo With 'worktree add': pass --dangerously-skip-permissions to Claude
105
- --version, -v Show version
106
- --help, -h Show this help
85
+ ```bash
86
+ npm install
87
+ npm run dev
107
88
  ```
108
89
 
109
- ## Background Service
90
+ `npm run dev` builds the TypeScript backend, starts an isolated backend on
91
+ `127.0.0.1:3457`, and runs the Vite frontend on `127.0.0.1:5173`. Vite proxies
92
+ REST and WebSocket traffic to the backend.
110
93
 
111
- Run as a persistent service that starts on login and restarts on crash:
94
+ Useful commands:
112
95
 
113
96
  ```bash
114
- relay-ide --bg
97
+ npm run dev:self
98
+ npm run dev:backend
99
+ npm run dev:vite
100
+ npm run check
101
+ npm test
102
+ npm run build
115
103
  ```
116
104
 
117
- Or with custom options:
105
+ Use `npm run dev:self` when Relay is developing Relay so the child instance gets
106
+ isolated config, ports, and process identity. See
107
+ [`docs/SELF_HOSTING.md`](docs/SELF_HOSTING.md).
118
108
 
119
- ```bash
120
- relay-ide install --port 4000
121
- ```
109
+ ## Hub and nodes
122
110
 
123
- Manage the service:
111
+ Bare `relay-ide` and `relay-ide hub` run the hub. A node can pair with the hub,
112
+ publish a capability manifest, and hold a reverse node-link WebSocket:
124
113
 
125
114
  ```bash
126
- relay-ide status # Check if running
127
- relay-ide uninstall # Stop and remove
115
+ relay-ide manifest
116
+ relay-ide node doctor --hub http://hub.example:3456
117
+ relay-ide node pair http://hub.example:3456
118
+ relay-ide node link --hub http://hub.example:3456
128
119
  ```
129
120
 
130
- - **macOS**: Uses launchd (`~/Library/LaunchAgents/`)
131
- - **Linux**: Uses systemd user units (`~/.config/systemd/user/`)
132
- - **Logs (macOS)**: `~/.config/relay-ide/logs/`
133
- - **Logs (Linux)**: `journalctl --user -u relay-ide -f`
121
+ The hub owns browser auth, channels, routing, policy, and federated views. Each
122
+ node owns its local processes, filesystem paths, and repository checkouts.
123
+ Remote file browsing is available for online nodes; remote git actions remain
124
+ more limited than local repository actions.
134
125
 
135
126
  ## Configuration
136
127
 
137
- Config is stored at `~/.config/relay-ide/config.json` (created on first run).
128
+ Runtime data lives under the configured Relay config directory, not in the
129
+ source checkout:
138
130
 
139
- When running from source, it uses `./config.json` in the project root instead.
131
+ - global: `~/.config/relay-ide/`
132
+ - source development: `~/.config/relay-ide/dev/<slug>-<hash>/`
140
133
 
141
- | Field | Default | Description |
142
- | --------------- | --------- | -------------------------------------------------------------- |
143
- | `host` | `0.0.0.0` | Bind address |
144
- | `port` | `3456` | Server port |
145
- | `cookieTTL` | `24h` | Auth cookie lifetime (e.g. `30m`, `12h`, `7d`) |
146
- | `rootDirs` | `[]` | Directories containing your git repos (scanned one level deep) |
147
- | `claudeCommand` | `claude` | Path to the Claude Code CLI binary |
148
- | `claudeArgs` | `[]` | Extra arguments passed to every session |
149
- | `defaultAgent` | `claude` | Default coding agent CLI (`claude` or `codex`) |
134
+ The main config file is `config.json`. Common fields include `host`, `port`,
135
+ `cookieTTL`, `rootDirs`, `repos`, `workspaces`, `defaultFramework`,
136
+ `frameworks`, `updateChannel`, and optional GitHub integration settings.
137
+ Channel history and other durable stores live beside it.
150
138
 
151
- Root directories can also be managed from the **Settings** button in the app.
139
+ ## CLI
152
140
 
153
- ### PIN Management
141
+ Run `relay-ide --help` for the exact installed command set. Main command
142
+ families:
154
143
 
155
- The PIN hash is stored in config under `pinHash`.
156
-
157
- **Reset via CLI** (recommended):
158
-
159
- ```bash
160
- relay-ide pin reset
144
+ ```text
145
+ relay-ide run the hub
146
+ relay-ide hub ... install, status, logs, nodes, doctor
147
+ relay-ide node ... pair, connect, install, link, diagnose
148
+ relay-ide v1 ... --json stable agent-facing gateway
149
+ relay-ide worktree ... git worktree helper
150
+ relay-ide browser <path> open an HTML artifact
151
+ relay-ide diag bundle ... write a redacted diagnostics bundle
152
+ relay-ide audit verify ... verify the security audit chain
153
+ relay-ide pin reset reset browser authentication
161
154
  ```
162
155
 
163
- This requires an interactive terminal. You'll be asked to verify your current PIN (if set), then enter a new one.
164
-
165
- **Reset manually:**
166
-
167
- 1. Delete the `pinHash` field from `~/.config/relay-ide/config.json`
168
- 2. Restart the server (`relay-ide uninstall && relay-ide --bg`)
169
- 3. Open the web UI and set a new PIN
170
-
171
- ## Features
172
-
173
- ### Session Management
174
-
175
- - **Multi-agent support** — choose between Claude Code and Codex as the coding agent per session, with a configurable default in Settings
176
- - **Repo sessions** — click any idle repo to instantly open Claude with `--continue` (no dialog), or start fresh from the new-session dialog
177
- - **Branch-aware worktrees** — create worktrees from new or existing branches with a type-to-search branch picker
178
- - **Worktree isolation** — each worktree session runs in its own git worktree under `.worktrees/`
179
- - **Resume sessions** — click inactive worktrees to reconnect with `--continue`
180
- - **Persistent session names** — display names, branch names, and timestamps survive server restarts
181
- - **Scrollback buffer** — reconnect to a session and see prior output
182
- - **Yolo mode** — skip permission prompts with `--dangerously-skip-permissions` (per-session pill button)
183
- - **Worktree cleanup** — delete inactive worktrees via the trash pill button (removes worktree, prunes refs, deletes branch)
184
-
185
- ### Pull Requests
186
-
187
- - **Pull requests tab** — view your open PRs (authored and review-requested) via `gh` CLI, organized in collapsible per-repo groups with count badges, Author/Reviewer filter, and one-click session creation from any PR branch
188
-
189
- ### GitHub Webhooks (real-time PR / CI updates)
190
-
191
- By default the app polls GitHub every 30 seconds for PR and CI status. Connect a webhook for instant updates instead:
192
-
193
- 1. **Connect GitHub** — open **Settings → Integrations → GitHub** and authorise the OAuth App. This requests the `repo` and `admin:repo_hook` scopes so the app can manage webhooks on your behalf.
194
- 2. **Set up webhooks** — open **Settings → Integrations → Webhooks**. Click **Setup Webhook** next to any repo. The app creates a GitHub webhook pointing at a [smee.io](https://smee.io/) proxy channel and starts a local smee client to relay events.
195
- 3. **Verify** — the webhook panel shows a health indicator (last event timestamp). Once connected, polling stops for that repo and updates arrive in real time.
196
-
197
- > No public server is required. The smee.io proxy forwards GitHub webhook payloads to your local instance over a persistent SSE connection.
198
-
199
- ### UI
200
-
201
- - **Tabbed sidebar** — switch between Repos, Worktrees, and PRs views with shared filters and item counts
202
- - **Sidebar filters** — filter by root directory, repo, or text search
203
- - **Inline actions** — pill buttons on session cards for rename, YOLO, worktree creation, and delete (hover on desktop, long-press on mobile)
204
- - **Resizable sidebar** — drag the sidebar edge to resize; collapse/expand with a button (persisted to localStorage)
205
- - **Responsive layout** — works on desktop and mobile with slide-out sidebar
206
- - **Touch toolbar** — mobile-friendly buttons for special keys (hidden on desktop)
207
- - **Clipboard image paste** — paste screenshots directly into remote terminal sessions (macOS clipboard + xclip on Linux)
208
-
209
- ### Settings
210
-
211
- - **Full-screen Settings dialog** — redesigned as a scrollable full-screen modal with a table-of-contents drawer for quick section navigation
212
- - **GitHub integration** — connect via OAuth App (Device Flow) for PR data, CI status, and webhook management
213
- - **Webhook management** — self-service webhook CRUD per repo with smee.io proxy, health state, and auto-provision backfill
214
- - **Jira integration** — connect Jira and configure project mappings for the org dashboard tickets panel
156
+ ## Architecture
215
157
 
216
- ### Operations
158
+ ```text
159
+ browser
160
+ ├─ ChannelView → ChannelTimeline → ChannelMessageRow
161
+ ├─ ChannelComposer / ChannelThreadPanel / roster controls
162
+ └─ terminal, file, diff, artifact, and settings surfaces
163
+
164
+
165
+ Relay hub
166
+ ├─ channel router + durable message/attachment stores
167
+ ├─ live channel fan-out + mention binder + agent bridge
168
+ ├─ profile, roster, orchestration, auth, policy, and CLI gateway
169
+ └─ local node + routed paired-node links
170
+
171
+
172
+ local and paired nodes
173
+ └─ agent CLIs, relay-pty terminals, files, repos, worktrees
174
+ ```
217
175
 
218
- - **PIN-protected access** with rate limiting
219
- - **Real-time updates** — worktree changes on disk are pushed to the browser instantly via WebSocket
220
- - **Smart polling** — falls back to 30-second polling for repos without webhooks; switches off automatically once a webhook is active
221
- - **Update notifications** — toast notification when a new version is available, with one-click update
222
- - **CLI self-update** — `relay-ide update` to update from npm
176
+ Start with [`docs/README.md`](docs/README.md), then read:
223
177
 
224
- ## Architecture
178
+ - [`docs/CHANNEL_CHAT.md`](docs/CHANNEL_CHAT.md) — conversation and agent model
179
+ - [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — backend and protocol map
180
+ - [`docs/FRONTEND.md`](docs/FRONTEND.md) — live React surface map
181
+ - [`DESIGN.md`](DESIGN.md) — visual system
182
+ - [`docs/QUALITY.md`](docs/QUALITY.md) — tests and release gates
225
183
 
226
- TypeScript + ESM backend (Express + node-pty + WebSocket) compiled to `dist/`. Svelte 5 frontend (runes + Vite) compiled to `dist/frontend/`.
184
+ ## Platform support
227
185
 
228
- ```
229
- relay-ide/
230
- ├── bin/
231
- │ └── relay-ide.ts # CLI entry point
232
- ├── server/
233
- │ ├── index.ts # Express server, REST API routes
234
- │ ├── sessions.ts # PTY session manager (node-pty)
235
- │ ├── ws.ts # WebSocket relay (PTY ↔ browser)
236
- │ ├── watcher.ts # File watcher for .worktrees/ changes
237
- │ ├── auth.ts # PIN hashing, verification, rate limiting
238
- │ ├── config.ts # Config loading/saving, worktree metadata
239
- │ ├── clipboard.ts # System clipboard operations (image paste)
240
- │ ├── service.ts # Background service management (launchd/systemd)
241
- │ └── types.ts # Shared TypeScript interfaces
242
- ├── frontend/
243
- │ └── src/
244
- │ ├── components/ # Svelte 5 components (Sidebar, Terminal, SessionList, etc.)
245
- │ ├── lib/state/ # Reactive state modules (.svelte.ts)
246
- │ ├── lib/api.ts # REST API client
247
- │ ├── lib/ws.ts # WebSocket connection management
248
- │ ├── lib/types.ts # Frontend TypeScript interfaces
249
- │ ├── lib/utils.ts # Shared utilities (path display, time formatting, device detection)
250
- │ └── lib/actions.ts # Svelte actions (scroll-on-hover, longpress-click)
251
- ├── test/ # Unit tests (node:test)
252
- ├── dist/ # Compiled output (gitignored)
253
- ├── config.example.json
254
- └── package.json
255
- ```
186
+ Linux and macOS are the primary host platforms. WSL2 nodes are supported with
187
+ documented limitations. Browser access works from desktop and mobile devices;
188
+ mobile behavior should be verified on the real target browser when changed.
256
189
 
257
190
  ## License
258
191
 
@@ -0,0 +1,29 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { randomUUID } from 'node:crypto';
4
+ export function writeNodeCredentialFile(credentialPath, credential, options = {}) {
5
+ const dir = path.dirname(credentialPath);
6
+ const tempSuffix = options.tempSuffix?.() ?? `${process.pid}-${Date.now()}-${randomUUID()}`;
7
+ const tempPath = path.join(dir, `.${path.basename(credentialPath)}.${tempSuffix}.tmp`);
8
+ const fileSystem = {
9
+ mkdirSync: fs.mkdirSync,
10
+ writeFileSync: fs.writeFileSync,
11
+ chmodSync: fs.chmodSync,
12
+ renameSync: fs.renameSync,
13
+ rmSync: fs.rmSync,
14
+ ...options.fs,
15
+ };
16
+ fileSystem.mkdirSync(dir, { recursive: true });
17
+ try {
18
+ fileSystem.writeFileSync(tempPath, `${JSON.stringify(credential, null, 2)}\n`, {
19
+ mode: 0o600,
20
+ flag: 'wx',
21
+ });
22
+ fileSystem.chmodSync(tempPath, 0o600);
23
+ fileSystem.renameSync(tempPath, credentialPath);
24
+ }
25
+ catch (error) {
26
+ fileSystem.rmSync(tempPath, { force: true });
27
+ throw error;
28
+ }
29
+ }