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.
- package/README.md +135 -202
- package/dist/bin/node-credential-file.js +29 -0
- package/dist/bin/relay-ide.js +6542 -72
- package/dist/bin/relayctl.js +740 -0
- package/dist/frontend/assets/App-Cv-k2TxO.js +257 -0
- package/dist/frontend/assets/App-DtockWI7.css +32 -0
- package/dist/frontend/assets/index-BIFXFy2O.js +1 -0
- package/dist/frontend/assets/index-Bh_lB7Xu.js +1 -0
- package/dist/frontend/assets/index-Bn959Ab2.js +153 -0
- package/dist/frontend/assets/index-C-Jlb3CN.js +1 -0
- package/dist/frontend/assets/index-Cm4dl4Wz.js +13 -0
- package/dist/frontend/assets/index-CxWHzrFD.js +1 -0
- package/dist/frontend/assets/index-D-gq106U.js +1 -0
- package/dist/frontend/assets/index-DAAVAocY.js +7 -0
- package/dist/frontend/assets/index-DANn_-AZ.js +3 -0
- package/dist/frontend/assets/index-DEACxXa5.js +1 -0
- package/dist/frontend/assets/index-DXIelFwt.js +6 -0
- package/dist/frontend/assets/index-DgxjJOLb.js +1 -0
- package/dist/frontend/assets/index-_OsY6l1a.js +2 -0
- package/dist/frontend/assets/main-BHhqbMno.css +1 -0
- package/dist/frontend/assets/main-fVFzGb1d.js +292 -0
- package/dist/frontend/assets/ruby-B2Rjki9n.js +1 -0
- package/dist/frontend/assets/shell-CjFT_Tl9.js +1 -0
- package/dist/frontend/assets/test-terminal-8ZJUzF03.css +1 -0
- package/dist/frontend/assets/test-terminal-A7z64Ztw.js +1 -0
- package/dist/frontend/assets/toml-Bm5Em-hy.js +1 -0
- package/dist/frontend/icon-192.png +0 -0
- package/dist/frontend/icon-512.png +0 -0
- package/dist/frontend/index.html +4 -2
- package/dist/frontend/sw.js +7 -10
- package/dist/frontend/test-terminal.html +15 -0
- package/dist/scripts/agent-browser-cli.js +108 -0
- package/dist/scripts/channel-memory-load.js +139 -0
- package/dist/scripts/dev-backend-config-path.js +15 -0
- package/dist/scripts/dev-mode.js +142 -0
- package/dist/scripts/dev-supervisor.js +204 -0
- package/dist/scripts/dev.js +136 -0
- package/dist/scripts/orchestrator-peer.js +365 -0
- package/dist/scripts/sandbox-cli.js +62 -0
- package/dist/scripts/seed-channel-chat.js +108 -0
- package/dist/server/adapters/claude-telemetry.js +118 -0
- package/dist/server/adapters/codex-telemetry.js +225 -0
- package/dist/server/adapters/opencode-telemetry.js +174 -0
- package/dist/server/agent-browser.js +65 -0
- package/dist/server/agent-profile-router.js +374 -0
- package/dist/server/agent-profile-store.js +547 -0
- package/dist/server/analytics.js +210 -111
- package/dist/server/anchor-file-fetcher.js +385 -0
- package/dist/server/anchor-resolution.js +140 -0
- package/dist/server/auth.js +240 -2
- package/dist/server/automation-run-finalizers.js +156 -0
- package/dist/server/automation-runs.js +318 -0
- package/dist/server/browser-content.js +6 -1
- package/dist/server/channel-agent-binder.js +1714 -0
- package/dist/server/channel-agent-bridge.js +978 -0
- package/dist/server/channel-agent-runtime.js +210 -0
- package/dist/server/channel-attachments.js +336 -0
- package/dist/server/channel-chat-router.js +1230 -0
- package/dist/server/channel-context-packet.js +287 -0
- package/dist/server/channel-hub.js +554 -0
- package/dist/server/channel-message-store.js +2069 -0
- package/dist/server/claude-stream-client.js +331 -0
- package/dist/server/cli-gateway-actor-auth.js +780 -0
- package/dist/server/cli-gateway-event-bus.js +102 -0
- package/dist/server/cli-gateway-events.js +312 -0
- package/dist/server/cli-gateway-settings.js +243 -0
- package/dist/server/clipboard.js +56 -1
- package/dist/server/codex-app-server-client.js +239 -0
- package/dist/server/codex-hooks-adapter.js +10 -1
- package/dist/server/command-center-executor.js +583 -0
- package/dist/server/command-center-intent-resolver.js +243 -0
- package/dist/server/config.js +126 -188
- package/dist/server/confirmation-challenges.js +687 -0
- package/dist/server/context-adapters/file-range.js +254 -0
- package/dist/server/context-packets.js +508 -0
- package/dist/server/control-engine.js +294 -0
- package/dist/server/credential-rotation-scheduler.js +166 -0
- package/dist/server/diagnostics-bundle.js +461 -0
- package/dist/server/features/automation-run-router.js +246 -0
- package/dist/server/features/context-inbox-router.js +1183 -0
- package/dist/server/features/context-inbox-store-adapter.js +183 -0
- package/dist/server/features/frameworks.js +78 -0
- package/dist/server/features/ia-tree.js +0 -0
- package/dist/server/features/ia-workspace-router.js +323 -0
- package/dist/server/features/pr-overseer-router.js +257 -0
- package/dist/server/features/repo-inventory.js +44 -0
- package/dist/server/features/repo-router.js +554 -0
- package/dist/server/features/work-context-artifact-router.js +1239 -0
- package/dist/server/features/work-context-message-router.js +489 -0
- package/dist/server/features/workflow-run-router.js +234 -0
- package/dist/server/file-rpc.js +947 -0
- package/dist/server/frameworks.js +92 -0
- package/dist/server/gh.js +212 -92
- package/dist/server/git-routes.js +93 -82
- package/dist/server/git.js +581 -123
- package/dist/server/github-app.js +1 -1
- package/dist/server/github-graphql.js +53 -49
- package/dist/server/handoff-planner.js +477 -0
- package/dist/server/handoff-transfer.js +516 -0
- package/dist/server/handoffs.js +247 -0
- package/dist/server/harness-state-adapter.js +1 -0
- package/dist/server/health.js +80 -0
- package/dist/server/high-risk-approvals.js +307 -0
- package/dist/server/hooks.js +19 -348
- package/dist/server/hub-node-link.js +606 -0
- package/dist/server/hub-node-registry.js +2440 -0
- package/dist/server/hub-node-router.js +3455 -0
- package/dist/server/hub-policy-evaluator.js +397 -0
- package/dist/server/hub-session-aggregator.js +218 -0
- package/dist/server/ia-store.js +406 -0
- package/dist/server/ia-workspace-migration.js +189 -0
- package/dist/server/index.js +3225 -600
- package/dist/server/intervention-log.js +207 -0
- package/dist/server/local-logs.js +259 -0
- package/dist/server/local-node.js +37 -0
- package/dist/server/local-workspace-seed.js +83 -0
- package/dist/server/log-events.js +136 -0
- package/dist/server/logger.js +144 -2
- package/dist/server/node-link-client.js +412 -0
- package/dist/server/node-link-pty-host.js +326 -0
- package/dist/server/node-link-rpc-host.js +588 -0
- package/dist/server/node-logs.js +178 -0
- package/dist/server/node-manifest-build.js +300 -0
- package/dist/server/node-manifest.js +193 -0
- package/dist/server/node-source-diagnostics.js +181 -0
- package/dist/server/node-version-skew.js +93 -0
- package/dist/server/opencode-relay.js +6 -6
- package/dist/server/orchestrator-credential-lifecycle.js +233 -0
- package/dist/server/org-dashboard.js +134 -185
- package/dist/server/persistence-startup.js +113 -0
- package/dist/server/port-allocator.js +572 -0
- package/dist/server/port-reconciliation.js +40 -0
- package/dist/server/pr-overseer-github.js +304 -0
- package/dist/server/pr-overseer.js +345 -0
- package/dist/server/process-tree.js +405 -0
- package/dist/server/project-workspace.js +184 -0
- package/dist/server/protocol-adapter-v2.js +43 -0
- package/dist/server/protocol-adapter.js +46 -0
- package/dist/server/protocol-adapters/adapter-utils.js +10 -0
- package/dist/server/protocol-adapters/attached-runtime-adapter.js +65 -0
- package/dist/server/protocol-adapters/claude-adapter.js +2340 -0
- package/dist/server/protocol-adapters/codex-native-adapter.js +2401 -0
- package/dist/server/protocol-adapters/hermes-adapter.js +1326 -0
- package/dist/server/protocol-adapters/index.js +77 -0
- package/dist/server/protocol-adapters/legacy-v2-bridge.js +98 -0
- package/dist/server/protocol-adapters/mock-adapter.js +377 -0
- package/dist/server/protocol-adapters/mock-v2-adapter.js +475 -0
- package/dist/server/protocol-adapters/opencode-adapter.js +808 -0
- package/dist/server/protocol-adapters/opencode-attached-adapter.js +251 -0
- package/dist/server/provider-state/claude-jsonl-state-adapter.js +805 -0
- package/dist/server/provider-state/index.js +1 -0
- package/dist/server/pty-handler.js +353 -457
- package/dist/server/relay-pty-session.js +188 -0
- package/dist/server/repo-inventory.js +197 -0
- package/dist/server/review-poller.js +113 -125
- package/dist/server/runtime-state-paths.js +77 -0
- package/dist/server/sandbox.js +128 -0
- package/dist/server/security-audit-log.js +383 -0
- package/dist/server/self-update.js +394 -0
- package/dist/server/service.js +373 -18
- package/dist/server/session-attachment.js +215 -0
- package/dist/server/session-attribution.js +42 -0
- package/dist/server/session-capacity.js +39 -0
- package/dist/server/session-control-api.js +134 -0
- package/dist/server/session-envelope-registry.js +409 -0
- package/dist/server/session-image-ingress.js +95 -0
- package/dist/server/session-rename-resolver.js +266 -0
- package/dist/server/sessions.js +1209 -362
- package/dist/server/startup-restore.js +40 -0
- package/dist/server/supervisor-actions.js +526 -0
- package/dist/server/supervisor-route-handlers.js +167 -0
- package/dist/server/supervisor-snapshot.js +201 -0
- package/dist/server/telemetry-adapter.js +14 -0
- package/dist/server/telemetry.js +56 -128
- package/dist/server/terminal-attention.js +30 -0
- package/dist/server/terminal-model-backend.js +153 -0
- package/dist/server/ticket-transitions.js +50 -47
- package/dist/server/types.js +41 -2
- package/dist/server/utils.js +61 -12
- package/dist/server/watcher.js +506 -171
- package/dist/server/webhook-manager.js +53 -61
- package/dist/server/webhooks.js +37 -9
- package/dist/server/work-context-artifacts.js +831 -0
- package/dist/server/work-context-message-templates.js +366 -0
- package/dist/server/work-context-messages.js +349 -0
- package/dist/server/work-context-resume-packet.js +781 -0
- package/dist/server/work-contexts.js +1288 -0
- package/dist/server/workbench-custom-blocks.js +618 -0
- package/dist/server/workbench-layout.js +252 -0
- package/dist/server/workbench-prompt-hooks.js +507 -0
- package/dist/server/workflow-runs.js +211 -0
- package/dist/server/workspace-evidence.js +827 -0
- package/dist/server/workspace-groups.js +123 -85
- package/dist/server/workspace-surfaces.js +544 -0
- package/dist/server/workspace-topics.js +1072 -0
- package/dist/server/workspaces.js +967 -269
- package/dist/server/worktree-cleanup.js +176 -0
- package/dist/server/ws-backpressure.js +289 -0
- package/dist/server/ws.js +586 -40
- package/dist/shared/action-descriptor.js +62 -0
- package/dist/shared/agent-chat-protocol-v2.js +1071 -0
- package/dist/shared/agent-chat-v1-compat.js +464 -0
- package/dist/shared/agent-continuation.js +572 -0
- package/dist/shared/agent-profile.js +258 -0
- package/dist/shared/agent-roster.js +37 -0
- package/dist/shared/agent-view-artifact.js +556 -0
- package/dist/shared/automation-run.js +446 -0
- package/dist/shared/bench.js +31 -0
- package/dist/shared/bootstrap-diagnostics.js +207 -0
- package/dist/shared/channel-chat-protocol.js +870 -0
- package/dist/shared/chat-events.js +71 -0
- package/dist/shared/cli-gateway-claude-tools.js +143 -0
- package/dist/shared/cli-gateway-codex-tools.js +286 -0
- package/dist/shared/cli-gateway-contract.js +5890 -0
- package/dist/shared/cli-gateway-hermes-tools.js +263 -0
- package/dist/shared/cli-gateway-runtime.js +527 -0
- package/dist/shared/cli-gateway-sessions-wait.js +8 -0
- package/dist/shared/command-center-execution.js +1 -0
- package/dist/shared/command-center-resolver-corpus.js +87 -0
- package/dist/shared/command-center-resolver.js +521 -0
- package/dist/shared/context-packet.js +631 -0
- package/dist/shared/control-state.js +128 -0
- package/dist/shared/dm-channels.js +90 -0
- package/dist/shared/environment-option.js +229 -0
- package/dist/shared/file-resource-ref.js +172 -0
- package/dist/shared/file-rpc.js +15 -0
- package/dist/shared/handoff-destination.js +383 -0
- package/dist/shared/handoff.js +420 -0
- package/dist/shared/hermes-metadata-events.js +617 -0
- package/dist/shared/identity.js +56 -0
- package/dist/shared/index.js +16 -0
- package/dist/shared/log-event.js +101 -0
- package/dist/shared/mention-contacts.js +92 -0
- package/dist/shared/node-boundary.js +71 -0
- package/dist/shared/node-identity-keys.js +278 -0
- package/dist/shared/node-manifest.js +179 -0
- package/dist/shared/node-pairing-requests.js +95 -0
- package/dist/shared/operator-handshake-grants.js +789 -0
- package/dist/shared/pipeline-handoff-artifact.js +700 -0
- package/dist/shared/pr-overseer.js +824 -0
- package/dist/shared/project.js +145 -0
- package/dist/shared/prompt-attachment.js +184 -0
- package/dist/shared/provider-native-session-state.js +1 -0
- package/dist/shared/relay-command-manifest.js +323 -0
- package/dist/shared/relay-node-protocol.js +11 -0
- package/dist/shared/repo-identity.js +168 -0
- package/dist/shared/repo-inventory.js +159 -0
- package/dist/shared/safe-defaults.js +108 -0
- package/dist/shared/scoped-actor-credentials.js +584 -0
- package/dist/shared/security-audit.js +311 -0
- package/dist/shared/security-policy.js +308 -0
- package/dist/shared/session-durability.js +59 -0
- package/dist/shared/session-envelope.js +159 -0
- package/dist/shared/session-lane.js +5 -0
- package/dist/shared/session-replay.js +241 -0
- package/dist/shared/stable-json.js +27 -0
- package/dist/shared/supervisor-actions.js +69 -0
- package/dist/shared/terminal-cockpit.js +488 -0
- package/dist/shared/work-context-message.js +388 -0
- package/dist/shared/work-context.js +289 -0
- package/dist/shared/workbench-block-environment.js +193 -0
- package/dist/shared/workbench-block-types.js +33 -0
- package/dist/shared/workbench-custom-blocks.js +102 -0
- package/dist/shared/workbench-layout-types.js +180 -0
- package/dist/shared/workbench-prompt-hooks.js +227 -0
- package/dist/shared/workflow-run.js +355 -0
- package/dist/shared/workspace-evidence.js +47 -0
- package/dist/shared/workspace-surfaces.js +195 -0
- package/dist/shared/workspace-topics.js +981 -0
- package/dist/shared/workspace.js +94 -0
- package/package.json +78 -14
- package/scripts/agent-browser-cli.ts +120 -0
- package/scripts/channel-memory-load.ts +161 -0
- package/scripts/dev-backend-config-path.ts +19 -0
- package/scripts/dev-mode.ts +219 -0
- package/scripts/dev-resync.sh +60 -0
- package/scripts/dev-supervisor.ts +234 -0
- package/scripts/dev.ts +182 -0
- package/scripts/orchestrator-peer.ts +548 -0
- package/scripts/postinstall.js +121 -0
- package/scripts/sandbox-cli.ts +74 -0
- package/scripts/seed-channel-chat.ts +126 -0
- package/dist/bin/claude-remote-cli.js +0 -390
- package/dist/frontend/assets/main-CL5_Wlhv.css +0 -32
- package/dist/frontend/assets/main-Czet4Z1x.js +0 -371
- package/dist/server/belayer/executor.js +0 -200
- package/dist/server/belayer/intake.js +0 -27
- package/dist/server/belayer/pipeline.js +0 -97
- package/dist/server/belayer/pr-lifecycle.js +0 -69
- package/dist/server/belayer/prompts.js +0 -154
- package/dist/server/belayer/types.js +0 -23
- package/dist/server/integration-linear.js +0 -176
- package/dist/server/output-parsers/claude-parser.js +0 -56
- package/dist/server/output-parsers/codex-parser.js +0 -13
- package/dist/server/output-parsers/index.js +0 -14
- package/dist/server/output-parsers/null-parser.js +0 -12
- package/dist/server/output-parsers/opencode-parser.js +0 -77
- package/dist/server/sdk-handler.js +0 -539
- package/dist/test/EmptyState.spec.js +0 -51
- package/dist/test/action-coverage.test.js +0 -139
- package/dist/test/actions/registry.test.js +0 -59
- package/dist/test/actions/shortcuts.test.js +0 -79
- package/dist/test/agent-events.test.js +0 -151
- package/dist/test/analytics.test.js +0 -158
- package/dist/test/attention.test.js +0 -91
- package/dist/test/auth.test.js +0 -105
- package/dist/test/backend-state.test.js +0 -47
- package/dist/test/belayer-executor.test.js +0 -33
- package/dist/test/belayer-intake.test.js +0 -44
- package/dist/test/belayer-pipeline.test.js +0 -113
- package/dist/test/belayer-pr-lifecycle.test.js +0 -26
- package/dist/test/belayer-prompts.test.js +0 -60
- package/dist/test/belayer-types.test.js +0 -69
- package/dist/test/bin/claude-remote-cli.js +0 -214
- package/dist/test/boot-state.test.js +0 -133
- package/dist/test/branch-lifecycle.test.js +0 -75
- package/dist/test/branch-linker.test.js +0 -236
- package/dist/test/branch-rename.test.js +0 -45
- package/dist/test/branch-watcher.test.js +0 -115
- package/dist/test/browser-cli.test.js +0 -91
- package/dist/test/browser-content.test.js +0 -93
- package/dist/test/browser-tabs-ui.test.js +0 -39
- package/dist/test/changed-files-api.test.js +0 -140
- package/dist/test/clipboard.test.js +0 -12
- package/dist/test/codex-hooks-adapter.test.js +0 -237
- package/dist/test/components/EmptyState.spec.js +0 -51
- package/dist/test/components/ErrorToast.spec.js +0 -65
- package/dist/test/components/TuiCheckbox.spec.js +0 -120
- package/dist/test/components/TuiInput.spec.js +0 -186
- package/dist/test/components/leaf-component-migration.spec.js +0 -104
- package/dist/test/config-freshness.test.js +0 -63
- package/dist/test/config.test.js +0 -813
- package/dist/test/diff-summary.test.js +0 -98
- package/dist/test/display-state.test.js +0 -179
- package/dist/test/event-message-types.test.js +0 -32
- package/dist/test/file-tree-utils.test.js +0 -167
- package/dist/test/framework-types.test.js +0 -183
- package/dist/test/frameworks-api.test.js +0 -93
- package/dist/test/frontend/src/lib/pr-state.js +0 -114
- package/dist/test/fs-browse.test.js +0 -246
- package/dist/test/fuzzy-scorer.test.js +0 -145
- package/dist/test/gh-routes.test.js +0 -156
- package/dist/test/git-changed-files.test.js +0 -152
- package/dist/test/git-routes.test.js +0 -146
- package/dist/test/git-utils.test.js +0 -68
- package/dist/test/git-watcher.test.js +0 -110
- package/dist/test/git.test.js +0 -140
- package/dist/test/github-app.test.js +0 -455
- package/dist/test/github-graphql.test.js +0 -301
- package/dist/test/greetings.test.js +0 -83
- package/dist/test/hooks-agent-event.test.js +0 -412
- package/dist/test/hooks.test.js +0 -149
- package/dist/test/integration-github.test.js +0 -220
- package/dist/test/integration-jira.test.js +0 -238
- package/dist/test/integration-linear.test.js +0 -293
- package/dist/test/mobile-input.test.js +0 -235
- package/dist/test/opencode-relay.test.js +0 -107
- package/dist/test/org-dashboard.test.js +0 -349
- package/dist/test/output-parser.test.js +0 -217
- package/dist/test/paths.test.js +0 -32
- package/dist/test/pr-state.test.js +0 -407
- package/dist/test/pr-status.test.js +0 -82
- package/dist/test/presets.test.js +0 -242
- package/dist/test/pty-handler-multi-agent.test.js +0 -149
- package/dist/test/pty-handler.test.js +0 -146
- package/dist/test/pull-requests.test.js +0 -78
- package/dist/test/review-poller.test.js +0 -349
- package/dist/test/server/analytics.js +0 -121
- package/dist/test/server/auth.js +0 -63
- package/dist/test/server/branch-linker.js +0 -124
- package/dist/test/server/clipboard.js +0 -56
- package/dist/test/server/config.js +0 -137
- package/dist/test/server/git.js +0 -308
- package/dist/test/server/hooks.js +0 -196
- package/dist/test/server/index.js +0 -1124
- package/dist/test/server/integration-github.js +0 -117
- package/dist/test/server/integration-jira.js +0 -164
- package/dist/test/server/integration-linear.js +0 -176
- package/dist/test/server/mobile-input-pipeline.js +0 -123
- package/dist/test/server/org-dashboard.js +0 -184
- package/dist/test/server/output-parsers/claude-parser.js +0 -54
- package/dist/test/server/output-parsers/codex-parser.js +0 -13
- package/dist/test/server/output-parsers/index.js +0 -7
- package/dist/test/server/pty-handler.js +0 -310
- package/dist/test/server/push.js +0 -80
- package/dist/test/server/review-poller.js +0 -218
- package/dist/test/server/service.js +0 -169
- package/dist/test/server/sessions.js +0 -434
- package/dist/test/server/ticket-transitions.js +0 -216
- package/dist/test/server/types.js +0 -20
- package/dist/test/server/utils.js +0 -22
- package/dist/test/server/watcher.js +0 -139
- package/dist/test/server/workspaces.js +0 -657
- package/dist/test/server/ws.js +0 -152
- package/dist/test/server-startup.test.js +0 -62
- package/dist/test/service.test.js +0 -43
- package/dist/test/session-analytics-api.test.js +0 -123
- package/dist/test/session-analytics.test.js +0 -425
- package/dist/test/session-intent.test.js +0 -249
- package/dist/test/sessions.test.js +0 -1152
- package/dist/test/sidebar-items.test.js +0 -164
- package/dist/test/stores/boot-state-store.test.js +0 -165
- package/dist/test/stores/sessions-logic.test.js +0 -191
- package/dist/test/stores/toasts-store.test.js +0 -66
- package/dist/test/stores/ui-store.test.js +0 -203
- package/dist/test/stores/unread-store.test.js +0 -97
- package/dist/test/telemetry-api.test.js +0 -54
- package/dist/test/telemetry-sync.test.js +0 -68
- package/dist/test/telemetry.test.js +0 -295
- package/dist/test/terminal-zoom.test.js +0 -102
- package/dist/test/test/analytics.test.js +0 -152
- package/dist/test/test/auth.test.js +0 -95
- package/dist/test/test/branch-linker.test.js +0 -231
- package/dist/test/test/branch-rename.test.js +0 -45
- package/dist/test/test/clipboard.test.js +0 -12
- package/dist/test/test/config.test.js +0 -281
- package/dist/test/test/fs-browse.test.js +0 -202
- package/dist/test/test/git.test.js +0 -67
- package/dist/test/test/hooks.test.js +0 -139
- package/dist/test/test/integration-github.test.js +0 -203
- package/dist/test/test/integration-jira.test.js +0 -294
- package/dist/test/test/integration-linear.test.js +0 -293
- package/dist/test/test/mobile-input.test.js +0 -193
- package/dist/test/test/org-dashboard.test.js +0 -240
- package/dist/test/test/output-parser.test.js +0 -95
- package/dist/test/test/paths.test.js +0 -32
- package/dist/test/test/pr-state.test.js +0 -220
- package/dist/test/test/pull-requests.test.js +0 -67
- package/dist/test/test/review-poller.test.js +0 -235
- package/dist/test/test/service.test.js +0 -43
- package/dist/test/test/sessions.test.js +0 -750
- package/dist/test/test/ticket-transitions.test.js +0 -130
- package/dist/test/test/version.test.js +0 -34
- package/dist/test/test/worktrees.test.js +0 -256
- package/dist/test/ticket-transitions.test.js +0 -312
- package/dist/test/unread.test.js +0 -23
- package/dist/test/version.test.js +0 -34
- package/dist/test/webhook-manager.test.js +0 -484
- package/dist/test/webhooks.test.js +0 -208
- package/dist/test/workspace-groups.test.js +0 -377
- package/dist/test/worktrees.test.js +0 -531
- /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
|
-
|
|
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
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
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
|
-
##
|
|
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
|
-
|
|
51
|
+
Or install the background hub service:
|
|
23
52
|
|
|
24
53
|
```bash
|
|
25
|
-
relay-ide
|
|
54
|
+
relay-ide hub install
|
|
26
55
|
```
|
|
27
56
|
|
|
28
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
70
|
+
## Start a conversation
|
|
57
71
|
|
|
58
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
94
|
+
Useful commands:
|
|
112
95
|
|
|
113
96
|
```bash
|
|
114
|
-
|
|
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
|
-
|
|
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
|
-
|
|
120
|
-
relay-ide install --port 4000
|
|
121
|
-
```
|
|
109
|
+
## Hub and nodes
|
|
122
110
|
|
|
123
|
-
|
|
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
|
|
127
|
-
relay-ide
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
128
|
+
Runtime data lives under the configured Relay config directory, not in the
|
|
129
|
+
source checkout:
|
|
138
130
|
|
|
139
|
-
|
|
131
|
+
- global: `~/.config/relay-ide/`
|
|
132
|
+
- source development: `~/.config/relay-ide/dev/<slug>-<hash>/`
|
|
140
133
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
139
|
+
## CLI
|
|
152
140
|
|
|
153
|
-
|
|
141
|
+
Run `relay-ide --help` for the exact installed command set. Main command
|
|
142
|
+
families:
|
|
154
143
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
relay-ide
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
184
|
+
## Platform support
|
|
227
185
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
+
}
|