chatroom-cli 1.31.1 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +61 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +10 -0
- package/dist/api.js.map +1 -0
- package/dist/commands/artifact/deps.d.ts +6 -0
- package/dist/commands/artifact/deps.d.ts.map +1 -0
- package/dist/commands/artifact/deps.js +2 -0
- package/dist/commands/artifact/deps.js.map +1 -0
- package/dist/commands/artifact/index.d.ts +43 -0
- package/dist/commands/artifact/index.d.ts.map +1 -0
- package/dist/commands/artifact/index.js +205 -0
- package/dist/commands/artifact/index.js.map +1 -0
- package/dist/commands/artifact/index.test.d.ts +8 -0
- package/dist/commands/artifact/index.test.d.ts.map +1 -0
- package/dist/commands/artifact/index.test.js +188 -0
- package/dist/commands/artifact/index.test.js.map +1 -0
- package/dist/commands/auth-login/deps.d.ts +50 -0
- package/dist/commands/auth-login/deps.d.ts.map +1 -0
- package/dist/commands/auth-login/deps.js +9 -0
- package/dist/commands/auth-login/deps.js.map +1 -0
- package/dist/commands/auth-login/index.d.ts +22 -0
- package/dist/commands/auth-login/index.d.ts.map +1 -0
- package/dist/commands/auth-login/index.js +246 -0
- package/dist/commands/auth-login/index.js.map +1 -0
- package/dist/commands/auth-login/index.test.d.ts +9 -0
- package/dist/commands/auth-login/index.test.d.ts.map +1 -0
- package/dist/commands/auth-login/index.test.js +297 -0
- package/dist/commands/auth-login/index.test.js.map +1 -0
- package/dist/commands/auth-logout/deps.d.ts +20 -0
- package/dist/commands/auth-logout/deps.d.ts.map +1 -0
- package/dist/commands/auth-logout/deps.js +7 -0
- package/dist/commands/auth-logout/deps.js.map +1 -0
- package/dist/commands/auth-logout/index.d.ts +8 -0
- package/dist/commands/auth-logout/index.d.ts.map +1 -0
- package/dist/commands/auth-logout/index.js +34 -0
- package/dist/commands/auth-logout/index.js.map +1 -0
- package/dist/commands/auth-logout/index.test.d.ts +8 -0
- package/dist/commands/auth-logout/index.test.d.ts.map +1 -0
- package/dist/commands/auth-logout/index.test.js +85 -0
- package/dist/commands/auth-logout/index.test.js.map +1 -0
- package/dist/commands/auth-status/deps.d.ts +35 -0
- package/dist/commands/auth-status/deps.d.ts.map +1 -0
- package/dist/commands/auth-status/deps.js +7 -0
- package/dist/commands/auth-status/deps.js.map +1 -0
- package/dist/commands/auth-status/index.d.ts +8 -0
- package/dist/commands/auth-status/index.d.ts.map +1 -0
- package/dist/commands/auth-status/index.js +80 -0
- package/dist/commands/auth-status/index.js.map +1 -0
- package/dist/commands/auth-status/index.test.d.ts +8 -0
- package/dist/commands/auth-status/index.test.d.ts.map +1 -0
- package/dist/commands/auth-status/index.test.js +116 -0
- package/dist/commands/auth-status/index.test.js.map +1 -0
- package/dist/commands/backlog/deps.d.ts +21 -0
- package/dist/commands/backlog/deps.d.ts.map +1 -0
- package/dist/commands/backlog/deps.js +5 -0
- package/dist/commands/backlog/deps.js.map +1 -0
- package/dist/commands/backlog/index.d.ts +129 -0
- package/dist/commands/backlog/index.d.ts.map +1 -0
- package/dist/commands/backlog/index.js +694 -0
- package/dist/commands/backlog/index.js.map +1 -0
- package/dist/commands/backlog/index.test.d.ts +7 -0
- package/dist/commands/backlog/index.test.d.ts.map +1 -0
- package/dist/commands/backlog/index.test.js +395 -0
- package/dist/commands/backlog/index.test.js.map +1 -0
- package/dist/commands/classify/deps.d.ts +18 -0
- package/dist/commands/classify/deps.d.ts.map +1 -0
- package/dist/commands/classify/deps.js +8 -0
- package/dist/commands/classify/deps.js.map +1 -0
- package/dist/commands/classify/index.d.ts +19 -0
- package/dist/commands/classify/index.d.ts.map +1 -0
- package/dist/commands/classify/index.js +162 -0
- package/dist/commands/classify/index.js.map +1 -0
- package/dist/commands/classify/index.test.d.ts +9 -0
- package/dist/commands/classify/index.test.d.ts.map +1 -0
- package/dist/commands/classify/index.test.js +263 -0
- package/dist/commands/classify/index.test.js.map +1 -0
- package/dist/commands/context/deps.d.ts +6 -0
- package/dist/commands/context/deps.d.ts.map +1 -0
- package/dist/commands/context/deps.js +2 -0
- package/dist/commands/context/deps.js.map +1 -0
- package/dist/commands/context/index.d.ts +42 -0
- package/dist/commands/context/index.d.ts.map +1 -0
- package/dist/commands/context/index.js +324 -0
- package/dist/commands/context/index.js.map +1 -0
- package/dist/commands/context/index.test.d.ts +9 -0
- package/dist/commands/context/index.test.d.ts.map +1 -0
- package/dist/commands/context/index.test.js +272 -0
- package/dist/commands/context/index.test.js.map +1 -0
- package/dist/commands/get-next-task/index.d.ts +20 -0
- package/dist/commands/get-next-task/index.d.ts.map +1 -0
- package/dist/commands/get-next-task/index.js +156 -0
- package/dist/commands/get-next-task/index.js.map +1 -0
- package/dist/commands/get-next-task/index.test.d.ts +9 -0
- package/dist/commands/get-next-task/index.test.d.ts.map +1 -0
- package/dist/commands/get-next-task/index.test.js +125 -0
- package/dist/commands/get-next-task/index.test.js.map +1 -0
- package/dist/commands/get-next-task/session.d.ts +127 -0
- package/dist/commands/get-next-task/session.d.ts.map +1 -0
- package/dist/commands/get-next-task/session.js +335 -0
- package/dist/commands/get-next-task/session.js.map +1 -0
- package/dist/commands/get-next-task/session.test.d.ts +11 -0
- package/dist/commands/get-next-task/session.test.d.ts.map +1 -0
- package/dist/commands/get-next-task/session.test.js +367 -0
- package/dist/commands/get-next-task/session.test.js.map +1 -0
- package/dist/commands/get-system-prompt/deps.d.ts +14 -0
- package/dist/commands/get-system-prompt/deps.d.ts.map +1 -0
- package/dist/commands/get-system-prompt/deps.js +7 -0
- package/dist/commands/get-system-prompt/deps.js.map +1 -0
- package/dist/commands/get-system-prompt/index.d.ts +16 -0
- package/dist/commands/get-system-prompt/index.d.ts.map +1 -0
- package/dist/commands/get-system-prompt/index.js +70 -0
- package/dist/commands/get-system-prompt/index.js.map +1 -0
- package/dist/commands/guidelines/deps.d.ts +14 -0
- package/dist/commands/guidelines/deps.d.ts.map +1 -0
- package/dist/commands/guidelines/deps.js +7 -0
- package/dist/commands/guidelines/deps.js.map +1 -0
- package/dist/commands/guidelines/index.d.ts +19 -0
- package/dist/commands/guidelines/index.d.ts.map +1 -0
- package/dist/commands/guidelines/index.js +92 -0
- package/dist/commands/guidelines/index.js.map +1 -0
- package/dist/commands/guidelines/index.test.d.ts +8 -0
- package/dist/commands/guidelines/index.test.d.ts.map +1 -0
- package/dist/commands/guidelines/index.test.js +140 -0
- package/dist/commands/guidelines/index.test.js.map +1 -0
- package/dist/commands/handoff/deps.d.ts +9 -0
- package/dist/commands/handoff/deps.d.ts.map +1 -0
- package/dist/commands/handoff/deps.js +5 -0
- package/dist/commands/handoff/deps.js.map +1 -0
- package/dist/commands/handoff/index.d.ts +23 -0
- package/dist/commands/handoff/index.d.ts.map +1 -0
- package/dist/commands/handoff/index.js +226 -0
- package/dist/commands/handoff/index.js.map +1 -0
- package/dist/commands/handoff/index.test.d.ts +9 -0
- package/dist/commands/handoff/index.test.d.ts.map +1 -0
- package/dist/commands/handoff/index.test.js +189 -0
- package/dist/commands/handoff/index.test.js.map +1 -0
- package/dist/commands/init/deps.d.ts +21 -0
- package/dist/commands/init/deps.d.ts.map +1 -0
- package/dist/commands/init/deps.js +8 -0
- package/dist/commands/init/deps.js.map +1 -0
- package/dist/commands/init/index.d.ts +22 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/init/index.js +181 -0
- package/dist/commands/init/index.js.map +1 -0
- package/dist/commands/init/index.test.d.ts +8 -0
- package/dist/commands/init/index.test.d.ts.map +1 -0
- package/dist/commands/init/index.test.js +170 -0
- package/dist/commands/init/index.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/command-loop.d.ts +15 -0
- package/dist/commands/machine/daemon-start/command-loop.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/command-loop.js +295 -0
- package/dist/commands/machine/daemon-start/command-loop.js.map +1 -0
- package/dist/commands/machine/daemon-start/command-loop.test.d.ts +13 -0
- package/dist/commands/machine/daemon-start/command-loop.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/command-loop.test.js +156 -0
- package/dist/commands/machine/daemon-start/command-loop.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/command-sync-heartbeat.d.ts +12 -0
- package/dist/commands/machine/daemon-start/command-sync-heartbeat.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/command-sync-heartbeat.js +58 -0
- package/dist/commands/machine/daemon-start/command-sync-heartbeat.js.map +1 -0
- package/dist/commands/machine/daemon-start/deps.d.ts +85 -0
- package/dist/commands/machine/daemon-start/deps.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/deps.js +14 -0
- package/dist/commands/machine/daemon-start/deps.js.map +1 -0
- package/dist/commands/machine/daemon-start/event-bus.test.d.ts +2 -0
- package/dist/commands/machine/daemon-start/event-bus.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/event-bus.test.js +100 -0
- package/dist/commands/machine/daemon-start/event-bus.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/event-listeners.test.d.ts +2 -0
- package/dist/commands/machine/daemon-start/event-listeners.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/event-listeners.test.js +155 -0
- package/dist/commands/machine/daemon-start/event-listeners.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/file-content-fulfillment.d.ts +12 -0
- package/dist/commands/machine/daemon-start/file-content-fulfillment.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/file-content-fulfillment.js +120 -0
- package/dist/commands/machine/daemon-start/file-content-fulfillment.js.map +1 -0
- package/dist/commands/machine/daemon-start/file-content-subscription.d.ts +29 -0
- package/dist/commands/machine/daemon-start/file-content-subscription.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/file-content-subscription.js +55 -0
- package/dist/commands/machine/daemon-start/file-content-subscription.js.map +1 -0
- package/dist/commands/machine/daemon-start/file-tree-subscription.d.ts +22 -0
- package/dist/commands/machine/daemon-start/file-tree-subscription.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/file-tree-subscription.js +83 -0
- package/dist/commands/machine/daemon-start/file-tree-subscription.js.map +1 -0
- package/dist/commands/machine/daemon-start/git-heartbeat.d.ts +18 -0
- package/dist/commands/machine/daemon-start/git-heartbeat.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/git-heartbeat.js +218 -0
- package/dist/commands/machine/daemon-start/git-heartbeat.js.map +1 -0
- package/dist/commands/machine/daemon-start/git-subscription.d.ts +60 -0
- package/dist/commands/machine/daemon-start/git-subscription.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/git-subscription.js +389 -0
- package/dist/commands/machine/daemon-start/git-subscription.js.map +1 -0
- package/dist/commands/machine/daemon-start/git-subscription.test.d.ts +2 -0
- package/dist/commands/machine/daemon-start/git-subscription.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/git-subscription.test.js +103 -0
- package/dist/commands/machine/daemon-start/git-subscription.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/command-runner.d.ts +23 -0
- package/dist/commands/machine/daemon-start/handlers/command-runner.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/command-runner.js +236 -0
- package/dist/commands/machine/daemon-start/handlers/command-runner.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/ping.d.ts +6 -0
- package/dist/commands/machine/daemon-start/handlers/ping.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/ping.js +8 -0
- package/dist/commands/machine/daemon-start/handlers/ping.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/ping.test.d.ts +5 -0
- package/dist/commands/machine/daemon-start/handlers/ping.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/ping.test.js +23 -0
- package/dist/commands/machine/daemon-start/handlers/ping.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/shared.d.ts +11 -0
- package/dist/commands/machine/daemon-start/handlers/shared.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/shared.js +25 -0
- package/dist/commands/machine/daemon-start/handlers/shared.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.d.ts +19 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.js +61 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.test.d.ts +8 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.test.js +98 -0
- package/dist/commands/machine/daemon-start/handlers/state-recovery.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/status.d.ts +6 -0
- package/dist/commands/machine/daemon-start/handlers/status.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/status.js +13 -0
- package/dist/commands/machine/daemon-start/handlers/status.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/status.test.d.ts +5 -0
- package/dist/commands/machine/daemon-start/handlers/status.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/status.test.js +51 -0
- package/dist/commands/machine/daemon-start/handlers/status.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.d.ts +21 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.js +36 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.js.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.test.d.ts +7 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.test.js +135 -0
- package/dist/commands/machine/daemon-start/handlers/stop-agent.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/index.d.ts +16 -0
- package/dist/commands/machine/daemon-start/index.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/index.js +21 -0
- package/dist/commands/machine/daemon-start/index.js.map +1 -0
- package/dist/commands/machine/daemon-start/init.d.ts +23 -0
- package/dist/commands/machine/daemon-start/init.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/init.js +338 -0
- package/dist/commands/machine/daemon-start/init.js.map +1 -0
- package/dist/commands/machine/daemon-start/init.test.d.ts +8 -0
- package/dist/commands/machine/daemon-start/init.test.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/init.test.js +385 -0
- package/dist/commands/machine/daemon-start/init.test.js.map +1 -0
- package/dist/commands/machine/daemon-start/testing/index.d.ts +5 -0
- package/dist/commands/machine/daemon-start/testing/index.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/testing/index.js +5 -0
- package/dist/commands/machine/daemon-start/testing/index.js.map +1 -0
- package/dist/commands/machine/daemon-start/testing/mock-daemon-deps.d.ts +26 -0
- package/dist/commands/machine/daemon-start/testing/mock-daemon-deps.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/testing/mock-daemon-deps.js +68 -0
- package/dist/commands/machine/daemon-start/testing/mock-daemon-deps.js.map +1 -0
- package/dist/commands/machine/daemon-start/types.d.ts +89 -0
- package/dist/commands/machine/daemon-start/types.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/types.js +5 -0
- package/dist/commands/machine/daemon-start/types.js.map +1 -0
- package/dist/commands/machine/daemon-start/utils.d.ts +8 -0
- package/dist/commands/machine/daemon-start/utils.d.ts.map +1 -0
- package/dist/commands/machine/daemon-start/utils.js +10 -0
- package/dist/commands/machine/daemon-start/utils.js.map +1 -0
- package/dist/commands/machine/daemon-status.d.ts +10 -0
- package/dist/commands/machine/daemon-status.d.ts.map +1 -0
- package/dist/commands/machine/daemon-status.js +23 -0
- package/dist/commands/machine/daemon-status.js.map +1 -0
- package/dist/commands/machine/daemon-stop.d.ts +10 -0
- package/dist/commands/machine/daemon-stop.d.ts.map +1 -0
- package/dist/commands/machine/daemon-stop.js +44 -0
- package/dist/commands/machine/daemon-stop.js.map +1 -0
- package/dist/commands/machine/index.d.ts +9 -0
- package/dist/commands/machine/index.d.ts.map +1 -0
- package/dist/commands/machine/index.js +9 -0
- package/dist/commands/machine/index.js.map +1 -0
- package/dist/commands/machine/pid.d.ts +48 -0
- package/dist/commands/machine/pid.d.ts.map +1 -0
- package/dist/commands/machine/pid.js +141 -0
- package/dist/commands/machine/pid.js.map +1 -0
- package/dist/commands/messages/deps.d.ts +6 -0
- package/dist/commands/messages/deps.d.ts.map +1 -0
- package/dist/commands/messages/deps.js +2 -0
- package/dist/commands/messages/deps.js.map +1 -0
- package/dist/commands/messages/index.d.ts +28 -0
- package/dist/commands/messages/index.d.ts.map +1 -0
- package/dist/commands/messages/index.js +166 -0
- package/dist/commands/messages/index.js.map +1 -0
- package/dist/commands/messages/index.test.d.ts +8 -0
- package/dist/commands/messages/index.test.d.ts.map +1 -0
- package/dist/commands/messages/index.test.js +159 -0
- package/dist/commands/messages/index.test.js.map +1 -0
- package/dist/commands/opencode-install/deps.d.ts +32 -0
- package/dist/commands/opencode-install/deps.d.ts.map +1 -0
- package/dist/commands/opencode-install/deps.js +8 -0
- package/dist/commands/opencode-install/deps.js.map +1 -0
- package/dist/commands/opencode-install/index.d.ts +31 -0
- package/dist/commands/opencode-install/index.d.ts.map +1 -0
- package/dist/commands/opencode-install/index.js +440 -0
- package/dist/commands/opencode-install/index.js.map +1 -0
- package/dist/commands/opencode-install/index.test.d.ts +8 -0
- package/dist/commands/opencode-install/index.test.d.ts.map +1 -0
- package/dist/commands/opencode-install/index.test.js +123 -0
- package/dist/commands/opencode-install/index.test.js.map +1 -0
- package/dist/commands/register-agent/deps.d.ts +12 -0
- package/dist/commands/register-agent/deps.d.ts.map +1 -0
- package/dist/commands/register-agent/deps.js +8 -0
- package/dist/commands/register-agent/deps.js.map +1 -0
- package/dist/commands/register-agent/index.d.ts +15 -0
- package/dist/commands/register-agent/index.d.ts.map +1 -0
- package/dist/commands/register-agent/index.js +118 -0
- package/dist/commands/register-agent/index.js.map +1 -0
- package/dist/commands/register-agent/index.test.d.ts +9 -0
- package/dist/commands/register-agent/index.test.d.ts.map +1 -0
- package/dist/commands/register-agent/index.test.js +204 -0
- package/dist/commands/register-agent/index.test.js.map +1 -0
- package/dist/commands/report-progress/deps.d.ts +9 -0
- package/dist/commands/report-progress/deps.d.ts.map +1 -0
- package/dist/commands/report-progress/deps.js +5 -0
- package/dist/commands/report-progress/deps.js.map +1 -0
- package/dist/commands/report-progress/index.d.ts +14 -0
- package/dist/commands/report-progress/index.d.ts.map +1 -0
- package/dist/commands/report-progress/index.js +110 -0
- package/dist/commands/report-progress/index.js.map +1 -0
- package/dist/commands/report-progress/index.test.d.ts +8 -0
- package/dist/commands/report-progress/index.test.d.ts.map +1 -0
- package/dist/commands/report-progress/index.test.js +114 -0
- package/dist/commands/report-progress/index.test.js.map +1 -0
- package/dist/commands/skill/deps.d.ts +9 -0
- package/dist/commands/skill/deps.d.ts.map +1 -0
- package/dist/commands/skill/deps.js +5 -0
- package/dist/commands/skill/deps.js.map +1 -0
- package/dist/commands/skill/index.d.ts +20 -0
- package/dist/commands/skill/index.d.ts.map +1 -0
- package/dist/commands/skill/index.js +86 -0
- package/dist/commands/skill/index.js.map +1 -0
- package/dist/commands/skill/index.test.d.ts +8 -0
- package/dist/commands/skill/index.test.d.ts.map +1 -0
- package/dist/commands/skill/index.test.js +166 -0
- package/dist/commands/skill/index.test.js.map +1 -0
- package/dist/commands/task/read/deps.d.ts +18 -0
- package/dist/commands/task/read/deps.d.ts.map +1 -0
- package/dist/commands/task/read/deps.js +8 -0
- package/dist/commands/task/read/deps.js.map +1 -0
- package/dist/commands/task/read/index.d.ts +17 -0
- package/dist/commands/task/read/index.d.ts.map +1 -0
- package/dist/commands/task/read/index.js +144 -0
- package/dist/commands/task/read/index.js.map +1 -0
- package/dist/commands/telegram/deps.d.ts +13 -0
- package/dist/commands/telegram/deps.d.ts.map +1 -0
- package/dist/commands/telegram/deps.js +5 -0
- package/dist/commands/telegram/deps.js.map +1 -0
- package/dist/commands/telegram/index.d.ts +18 -0
- package/dist/commands/telegram/index.d.ts.map +1 -0
- package/dist/commands/telegram/index.js +94 -0
- package/dist/commands/telegram/index.js.map +1 -0
- package/dist/commands/update/deps.d.ts +21 -0
- package/dist/commands/update/deps.d.ts.map +1 -0
- package/dist/commands/update/deps.js +8 -0
- package/dist/commands/update/deps.js.map +1 -0
- package/dist/commands/update/index.d.ts +8 -0
- package/dist/commands/update/index.d.ts.map +1 -0
- package/dist/commands/update/index.js +70 -0
- package/dist/commands/update/index.js.map +1 -0
- package/dist/commands/update/index.test.d.ts +8 -0
- package/dist/commands/update/index.test.d.ts.map +1 -0
- package/dist/commands/update/index.test.js +108 -0
- package/dist/commands/update/index.test.js.map +1 -0
- package/dist/commands/workflow/deps.d.ts +9 -0
- package/dist/commands/workflow/deps.d.ts.map +1 -0
- package/dist/commands/workflow/deps.js +5 -0
- package/dist/commands/workflow/deps.js.map +1 -0
- package/dist/commands/workflow/index.d.ts +73 -0
- package/dist/commands/workflow/index.d.ts.map +1 -0
- package/dist/commands/workflow/index.js +545 -0
- package/dist/commands/workflow/index.js.map +1 -0
- package/dist/commands/workflow/index.test.d.ts +7 -0
- package/dist/commands/workflow/index.test.d.ts.map +1 -0
- package/dist/commands/workflow/index.test.js +315 -0
- package/dist/commands/workflow/index.test.js.map +1 -0
- package/dist/config/defaults.d.ts +10 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +79 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/loader.d.ts +52 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +202 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/schema.d.ts +50 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +99 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -0
- package/dist/events/daemon/agent/on-agent-exited.d.ts +26 -0
- package/dist/events/daemon/agent/on-agent-exited.d.ts.map +1 -0
- package/dist/events/daemon/agent/on-agent-exited.js +20 -0
- package/dist/events/daemon/agent/on-agent-exited.js.map +1 -0
- package/dist/events/daemon/agent/on-agent-started.d.ts +16 -0
- package/dist/events/daemon/agent/on-agent-started.d.ts.map +1 -0
- package/dist/events/daemon/agent/on-agent-started.js +11 -0
- package/dist/events/daemon/agent/on-agent-started.js.map +1 -0
- package/dist/events/daemon/agent/on-agent-stopped.d.ts +14 -0
- package/dist/events/daemon/agent/on-agent-stopped.d.ts.map +1 -0
- package/dist/events/daemon/agent/on-agent-stopped.js +11 -0
- package/dist/events/daemon/agent/on-agent-stopped.js.map +1 -0
- package/dist/events/daemon/agent/on-request-start-agent.d.ts +19 -0
- package/dist/events/daemon/agent/on-request-start-agent.d.ts.map +1 -0
- package/dist/events/daemon/agent/on-request-start-agent.js +55 -0
- package/dist/events/daemon/agent/on-request-start-agent.js.map +1 -0
- package/dist/events/daemon/agent/on-request-start-agent.test.d.ts +2 -0
- package/dist/events/daemon/agent/on-request-start-agent.test.d.ts.map +1 -0
- package/dist/events/daemon/agent/on-request-start-agent.test.js +96 -0
- package/dist/events/daemon/agent/on-request-start-agent.test.js.map +1 -0
- package/dist/events/daemon/agent/on-request-stop-agent.d.ts +16 -0
- package/dist/events/daemon/agent/on-request-stop-agent.d.ts.map +1 -0
- package/dist/events/daemon/agent/on-request-stop-agent.js +19 -0
- package/dist/events/daemon/agent/on-request-stop-agent.js.map +1 -0
- package/dist/events/daemon/event-bus.d.ts +87 -0
- package/dist/events/daemon/event-bus.d.ts.map +1 -0
- package/dist/events/daemon/event-bus.js +50 -0
- package/dist/events/daemon/event-bus.js.map +1 -0
- package/dist/events/daemon/register-listeners.d.ts +9 -0
- package/dist/events/daemon/register-listeners.d.ts.map +1 -0
- package/dist/events/daemon/register-listeners.js +21 -0
- package/dist/events/daemon/register-listeners.js.map +1 -0
- package/dist/events/lifecycle/on-daemon-shutdown.d.ts +9 -0
- package/dist/events/lifecycle/on-daemon-shutdown.d.ts.map +1 -0
- package/dist/events/lifecycle/on-daemon-shutdown.js +43 -0
- package/dist/events/lifecycle/on-daemon-shutdown.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +315 -25
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/auth/middleware.d.ts +21 -0
- package/dist/infrastructure/auth/middleware.d.ts.map +1 -0
- package/dist/infrastructure/auth/middleware.js +106 -0
- package/dist/infrastructure/auth/middleware.js.map +1 -0
- package/dist/infrastructure/auth/storage.d.ts +59 -0
- package/dist/infrastructure/auth/storage.d.ts.map +1 -0
- package/dist/infrastructure/auth/storage.js +242 -0
- package/dist/infrastructure/auth/storage.js.map +1 -0
- package/dist/infrastructure/convex/client.d.ts +28 -0
- package/dist/infrastructure/convex/client.d.ts.map +1 -0
- package/dist/infrastructure/convex/client.js +77 -0
- package/dist/infrastructure/convex/client.js.map +1 -0
- package/dist/infrastructure/deps/backend.d.ts +13 -0
- package/dist/infrastructure/deps/backend.d.ts.map +1 -0
- package/dist/infrastructure/deps/backend.js +8 -0
- package/dist/infrastructure/deps/backend.js.map +1 -0
- package/dist/infrastructure/deps/clock.d.ts +13 -0
- package/dist/infrastructure/deps/clock.d.ts.map +1 -0
- package/dist/infrastructure/deps/clock.js +8 -0
- package/dist/infrastructure/deps/clock.js.map +1 -0
- package/dist/infrastructure/deps/fs.d.ts +12 -0
- package/dist/infrastructure/deps/fs.d.ts.map +1 -0
- package/dist/infrastructure/deps/fs.js +8 -0
- package/dist/infrastructure/deps/fs.js.map +1 -0
- package/dist/infrastructure/deps/index.d.ts +12 -0
- package/dist/infrastructure/deps/index.d.ts.map +1 -0
- package/dist/infrastructure/deps/index.js +8 -0
- package/dist/infrastructure/deps/index.js.map +1 -0
- package/dist/infrastructure/deps/process.d.ts +11 -0
- package/dist/infrastructure/deps/process.d.ts.map +1 -0
- package/dist/infrastructure/deps/process.js +8 -0
- package/dist/infrastructure/deps/process.js.map +1 -0
- package/dist/infrastructure/deps/session.d.ts +16 -0
- package/dist/infrastructure/deps/session.d.ts.map +1 -0
- package/dist/infrastructure/deps/session.js +8 -0
- package/dist/infrastructure/deps/session.js.map +1 -0
- package/dist/infrastructure/git/git-reader.d.ts +206 -0
- package/dist/infrastructure/git/git-reader.d.ts.map +1 -0
- package/dist/infrastructure/git/git-reader.js +711 -0
- package/dist/infrastructure/git/git-reader.js.map +1 -0
- package/dist/infrastructure/git/git-reader.test.d.ts +8 -0
- package/dist/infrastructure/git/git-reader.test.d.ts.map +1 -0
- package/dist/infrastructure/git/git-reader.test.js +598 -0
- package/dist/infrastructure/git/git-reader.test.js.map +1 -0
- package/dist/infrastructure/git/git-writer.d.ts +48 -0
- package/dist/infrastructure/git/git-writer.d.ts.map +1 -0
- package/dist/infrastructure/git/git-writer.js +127 -0
- package/dist/infrastructure/git/git-writer.js.map +1 -0
- package/dist/infrastructure/git/index.d.ts +10 -0
- package/dist/infrastructure/git/index.d.ts.map +1 -0
- package/dist/infrastructure/git/index.js +9 -0
- package/dist/infrastructure/git/index.js.map +1 -0
- package/dist/infrastructure/git/types.d.ts +127 -0
- package/dist/infrastructure/git/types.d.ts.map +1 -0
- package/dist/infrastructure/git/types.js +20 -0
- package/dist/infrastructure/git/types.js.map +1 -0
- package/dist/infrastructure/history/storage.d.ts +21 -0
- package/dist/infrastructure/history/storage.d.ts.map +1 -0
- package/dist/infrastructure/history/storage.js +56 -0
- package/dist/infrastructure/history/storage.js.map +1 -0
- package/dist/infrastructure/lifecycle-heartbeat.d.ts +18 -0
- package/dist/infrastructure/lifecycle-heartbeat.d.ts.map +1 -0
- package/dist/infrastructure/lifecycle-heartbeat.js +21 -0
- package/dist/infrastructure/lifecycle-heartbeat.js.map +1 -0
- package/dist/infrastructure/local-actions/execute-local-action.d.ts +33 -0
- package/dist/infrastructure/local-actions/execute-local-action.d.ts.map +1 -0
- package/dist/infrastructure/local-actions/execute-local-action.js +109 -0
- package/dist/infrastructure/local-actions/execute-local-action.js.map +1 -0
- package/dist/infrastructure/local-actions/index.d.ts +9 -0
- package/dist/infrastructure/local-actions/index.d.ts.map +1 -0
- package/dist/infrastructure/local-actions/index.js +8 -0
- package/dist/infrastructure/local-actions/index.js.map +1 -0
- package/dist/infrastructure/local-api/cors.d.ts +19 -0
- package/dist/infrastructure/local-api/cors.d.ts.map +1 -0
- package/dist/infrastructure/local-api/cors.js +50 -0
- package/dist/infrastructure/local-api/cors.js.map +1 -0
- package/dist/infrastructure/local-api/identity.test.d.ts +8 -0
- package/dist/infrastructure/local-api/identity.test.d.ts.map +1 -0
- package/dist/infrastructure/local-api/identity.test.js +71 -0
- package/dist/infrastructure/local-api/identity.test.js.map +1 -0
- package/dist/infrastructure/local-api/index.d.ts +10 -0
- package/dist/infrastructure/local-api/index.d.ts.map +1 -0
- package/dist/infrastructure/local-api/index.js +8 -0
- package/dist/infrastructure/local-api/index.js.map +1 -0
- package/dist/infrastructure/local-api/open-finder.test.d.ts +13 -0
- package/dist/infrastructure/local-api/open-finder.test.d.ts.map +1 -0
- package/dist/infrastructure/local-api/open-finder.test.js +112 -0
- package/dist/infrastructure/local-api/open-finder.test.js.map +1 -0
- package/dist/infrastructure/local-api/open-github-desktop.test.d.ts +12 -0
- package/dist/infrastructure/local-api/open-github-desktop.test.d.ts.map +1 -0
- package/dist/infrastructure/local-api/open-github-desktop.test.js +129 -0
- package/dist/infrastructure/local-api/open-github-desktop.test.js.map +1 -0
- package/dist/infrastructure/local-api/open-vscode.test.d.ts +12 -0
- package/dist/infrastructure/local-api/open-vscode.test.d.ts.map +1 -0
- package/dist/infrastructure/local-api/open-vscode.test.js +130 -0
- package/dist/infrastructure/local-api/open-vscode.test.js.map +1 -0
- package/dist/infrastructure/local-api/router.d.ts +28 -0
- package/dist/infrastructure/local-api/router.d.ts.map +1 -0
- package/dist/infrastructure/local-api/router.js +60 -0
- package/dist/infrastructure/local-api/router.js.map +1 -0
- package/dist/infrastructure/local-api/router.test.d.ts +8 -0
- package/dist/infrastructure/local-api/router.test.d.ts.map +1 -0
- package/dist/infrastructure/local-api/router.test.js +142 -0
- package/dist/infrastructure/local-api/router.test.js.map +1 -0
- package/dist/infrastructure/local-api/routes/identity.d.ts +28 -0
- package/dist/infrastructure/local-api/routes/identity.d.ts.map +1 -0
- package/dist/infrastructure/local-api/routes/identity.js +42 -0
- package/dist/infrastructure/local-api/routes/identity.js.map +1 -0
- package/dist/infrastructure/local-api/routes/open-finder.d.ts +25 -0
- package/dist/infrastructure/local-api/routes/open-finder.d.ts.map +1 -0
- package/dist/infrastructure/local-api/routes/open-finder.js +58 -0
- package/dist/infrastructure/local-api/routes/open-finder.js.map +1 -0
- package/dist/infrastructure/local-api/routes/open-github-desktop.d.ts +21 -0
- package/dist/infrastructure/local-api/routes/open-github-desktop.d.ts.map +1 -0
- package/dist/infrastructure/local-api/routes/open-github-desktop.js +43 -0
- package/dist/infrastructure/local-api/routes/open-github-desktop.js.map +1 -0
- package/dist/infrastructure/local-api/routes/open-vscode.d.ts +23 -0
- package/dist/infrastructure/local-api/routes/open-vscode.d.ts.map +1 -0
- package/dist/infrastructure/local-api/routes/open-vscode.js +51 -0
- package/dist/infrastructure/local-api/routes/open-vscode.js.map +1 -0
- package/dist/infrastructure/local-api/routes/shared-utils.d.ts +51 -0
- package/dist/infrastructure/local-api/routes/shared-utils.d.ts.map +1 -0
- package/dist/infrastructure/local-api/routes/shared-utils.js +96 -0
- package/dist/infrastructure/local-api/routes/shared-utils.js.map +1 -0
- package/dist/infrastructure/local-api/server.d.ts +40 -0
- package/dist/infrastructure/local-api/server.d.ts.map +1 -0
- package/dist/infrastructure/local-api/server.js +153 -0
- package/dist/infrastructure/local-api/server.js.map +1 -0
- package/dist/infrastructure/local-api/types.d.ts +48 -0
- package/dist/infrastructure/local-api/types.d.ts.map +1 -0
- package/dist/infrastructure/local-api/types.js +8 -0
- package/dist/infrastructure/local-api/types.js.map +1 -0
- package/dist/infrastructure/machine/crash-loop-tracker.d.ts +69 -0
- package/dist/infrastructure/machine/crash-loop-tracker.d.ts.map +1 -0
- package/dist/infrastructure/machine/crash-loop-tracker.js +116 -0
- package/dist/infrastructure/machine/crash-loop-tracker.js.map +1 -0
- package/dist/infrastructure/machine/crash-loop-tracker.test.d.ts +8 -0
- package/dist/infrastructure/machine/crash-loop-tracker.test.d.ts.map +1 -0
- package/dist/infrastructure/machine/crash-loop-tracker.test.js +210 -0
- package/dist/infrastructure/machine/crash-loop-tracker.test.js.map +1 -0
- package/dist/infrastructure/machine/daemon-state.d.ts +96 -0
- package/dist/infrastructure/machine/daemon-state.d.ts.map +1 -0
- package/dist/infrastructure/machine/daemon-state.js +183 -0
- package/dist/infrastructure/machine/daemon-state.js.map +1 -0
- package/dist/infrastructure/machine/daemon-state.test.d.ts +10 -0
- package/dist/infrastructure/machine/daemon-state.test.d.ts.map +1 -0
- package/dist/infrastructure/machine/daemon-state.test.js +128 -0
- package/dist/infrastructure/machine/daemon-state.test.js.map +1 -0
- package/dist/infrastructure/machine/detection.d.ts +27 -0
- package/dist/infrastructure/machine/detection.d.ts.map +1 -0
- package/dist/infrastructure/machine/detection.js +47 -0
- package/dist/infrastructure/machine/detection.js.map +1 -0
- package/dist/infrastructure/machine/index.d.ts +10 -0
- package/dist/infrastructure/machine/index.d.ts.map +1 -0
- package/dist/infrastructure/machine/index.js +11 -0
- package/dist/infrastructure/machine/index.js.map +1 -0
- package/dist/infrastructure/machine/stop-reason.d.ts +26 -0
- package/dist/infrastructure/machine/stop-reason.d.ts.map +1 -0
- package/dist/infrastructure/machine/stop-reason.js +22 -0
- package/dist/infrastructure/machine/stop-reason.js.map +1 -0
- package/dist/infrastructure/machine/stop-reason.test.d.ts +2 -0
- package/dist/infrastructure/machine/stop-reason.test.d.ts.map +1 -0
- package/dist/infrastructure/machine/stop-reason.test.js +32 -0
- package/dist/infrastructure/machine/stop-reason.test.js.map +1 -0
- package/dist/infrastructure/machine/storage.d.ts +42 -0
- package/dist/infrastructure/machine/storage.d.ts.map +1 -0
- package/dist/infrastructure/machine/storage.js +156 -0
- package/dist/infrastructure/machine/storage.js.map +1 -0
- package/dist/infrastructure/machine/types.d.ts +58 -0
- package/dist/infrastructure/machine/types.d.ts.map +1 -0
- package/dist/infrastructure/machine/types.js +11 -0
- package/dist/infrastructure/machine/types.js.map +1 -0
- package/dist/infrastructure/retry-queue.d.ts +17 -0
- package/dist/infrastructure/retry-queue.d.ts.map +1 -0
- package/dist/infrastructure/retry-queue.js +33 -0
- package/dist/infrastructure/retry-queue.js.map +1 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.d.ts +142 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.d.ts.map +1 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.js +567 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.js.map +1 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.test.d.ts +2 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.test.d.ts.map +1 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.test.js +692 -0
- package/dist/infrastructure/services/agent-process-manager/agent-process-manager.test.js.map +1 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.d.ts +47 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.d.ts.map +1 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.js +68 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.js.map +1 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.test.d.ts +2 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.test.d.ts.map +1 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.test.js +149 -0
- package/dist/infrastructure/services/harness-spawning/harness-spawning-service.test.js.map +1 -0
- package/dist/infrastructure/services/harness-spawning/index.d.ts +5 -0
- package/dist/infrastructure/services/harness-spawning/index.d.ts.map +1 -0
- package/dist/infrastructure/services/harness-spawning/index.js +3 -0
- package/dist/infrastructure/services/harness-spawning/index.js.map +1 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.d.ts +45 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.d.ts.map +1 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.js +84 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.js.map +1 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.test.d.ts +2 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.test.d.ts.map +1 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.test.js +179 -0
- package/dist/infrastructure/services/harness-spawning/rate-limiter.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.d.ts +77 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.js +149 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.test.js +273 -0
- package/dist/infrastructure/services/remote-agents/base-cli-agent-service.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-code-agent-service.d.ts +30 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-code-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-code-agent-service.js +186 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-code-agent-service.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-stream-reader.d.ts +42 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-stream-reader.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-stream-reader.js +92 -0
- package/dist/infrastructure/services/remote-agents/claude/claude-stream-reader.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/claude/index.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/claude/index.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/claude/index.js +2 -0
- package/dist/infrastructure/services/remote-agents/claude/index.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-agent-service.d.ts +44 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-agent-service.js +160 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-agent-service.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.d.ts +59 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.js +100 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.test.js +105 -0
- package/dist/infrastructure/services/remote-agents/copilot/copilot-stream-reader.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/index.d.ts +3 -0
- package/dist/infrastructure/services/remote-agents/copilot/index.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/copilot/index.js +3 -0
- package/dist/infrastructure/services/remote-agents/copilot/index.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.d.ts +29 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.js +219 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.test.js +223 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-agent-service.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.d.ts +41 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.js +95 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.test.js +334 -0
- package/dist/infrastructure/services/remote-agents/cursor/cursor-stream-reader.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/index.d.ts +3 -0
- package/dist/infrastructure/services/remote-agents/cursor/index.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/cursor/index.js +2 -0
- package/dist/infrastructure/services/remote-agents/cursor/index.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/index.d.ts +8 -0
- package/dist/infrastructure/services/remote-agents/index.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/index.js +7 -0
- package/dist/infrastructure/services/remote-agents/index.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/init-registry.d.ts +3 -0
- package/dist/infrastructure/services/remote-agents/init-registry.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/init-registry.js +19 -0
- package/dist/infrastructure/services/remote-agents/init-registry.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/index.d.ts +4 -0
- package/dist/infrastructure/services/remote-agents/opencode/index.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/index.js +3 -0
- package/dist/infrastructure/services/remote-agents/opencode/index.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.d.ts +32 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.js +225 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.test.js +226 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-agent-service.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.d.ts +46 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.js +104 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.test.js +268 -0
- package/dist/infrastructure/services/remote-agents/opencode/opencode-json-reader.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/index.d.ts +3 -0
- package/dist/infrastructure/services/remote-agents/pi/index.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/index.js +2 -0
- package/dist/infrastructure/services/remote-agents/pi/index.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.d.ts +35 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.js +253 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.test.js +348 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-agent-service.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.d.ts +50 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.js +120 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.test.d.ts +2 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.test.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.test.js +288 -0
- package/dist/infrastructure/services/remote-agents/pi/pi-rpc-reader.test.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/registry.d.ts +8 -0
- package/dist/infrastructure/services/remote-agents/registry.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/registry.js +14 -0
- package/dist/infrastructure/services/remote-agents/registry.js.map +1 -0
- package/dist/infrastructure/services/remote-agents/remote-agent-service.d.ts +79 -0
- package/dist/infrastructure/services/remote-agents/remote-agent-service.d.ts.map +1 -0
- package/dist/infrastructure/services/remote-agents/remote-agent-service.js +9 -0
- package/dist/infrastructure/services/remote-agents/remote-agent-service.js.map +1 -0
- package/dist/infrastructure/services/workspace/command-discovery.d.ts +65 -0
- package/dist/infrastructure/services/workspace/command-discovery.d.ts.map +1 -0
- package/dist/infrastructure/services/workspace/command-discovery.js +193 -0
- package/dist/infrastructure/services/workspace/command-discovery.js.map +1 -0
- package/dist/infrastructure/services/workspace/command-discovery.test.d.ts +7 -0
- package/dist/infrastructure/services/workspace/command-discovery.test.d.ts.map +1 -0
- package/dist/infrastructure/services/workspace/command-discovery.test.js +182 -0
- package/dist/infrastructure/services/workspace/command-discovery.test.js.map +1 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.d.ts +47 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.d.ts.map +1 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.js +159 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.js.map +1 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.test.d.ts +2 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.test.d.ts.map +1 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.test.js +132 -0
- package/dist/infrastructure/services/workspace/file-tree-scanner.test.js.map +1 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.d.ts +34 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.d.ts.map +1 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.js +187 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.js.map +1 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.test.d.ts +5 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.test.d.ts.map +1 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.test.js +152 -0
- package/dist/infrastructure/services/workspace/workspace-resolver.test.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +5 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/output.d.ts +50 -0
- package/dist/tools/output.d.ts.map +1 -0
- package/dist/tools/output.js +78 -0
- package/dist/tools/output.js.map +1 -0
- package/dist/tools/output.test.d.ts +8 -0
- package/dist/tools/output.test.d.ts.map +1 -0
- package/dist/tools/output.test.js +120 -0
- package/dist/tools/output.test.js.map +1 -0
- package/dist/tools/parse-pdf/deps.d.ts +42 -0
- package/dist/tools/parse-pdf/deps.d.ts.map +1 -0
- package/dist/tools/parse-pdf/deps.js +8 -0
- package/dist/tools/parse-pdf/deps.js.map +1 -0
- package/dist/tools/parse-pdf/index.d.ts +18 -0
- package/dist/tools/parse-pdf/index.d.ts.map +1 -0
- package/dist/tools/parse-pdf/index.js +160 -0
- package/dist/tools/parse-pdf/index.js.map +1 -0
- package/dist/tools/parse-pdf/index.test.d.ts +8 -0
- package/dist/tools/parse-pdf/index.test.d.ts.map +1 -0
- package/dist/tools/parse-pdf/index.test.js +183 -0
- package/dist/tools/parse-pdf/index.test.js.map +1 -0
- package/dist/tools/types.d.ts +12 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +5 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/utils/convex-error.d.ts +19 -0
- package/dist/utils/convex-error.d.ts.map +1 -0
- package/dist/utils/convex-error.js +38 -0
- package/dist/utils/convex-error.js.map +1 -0
- package/dist/utils/convex-error.test.d.ts +7 -0
- package/dist/utils/convex-error.test.d.ts.map +1 -0
- package/dist/utils/convex-error.test.js +71 -0
- package/dist/utils/convex-error.test.js.map +1 -0
- package/dist/utils/error-formatting.d.ts +33 -0
- package/dist/utils/error-formatting.d.ts.map +1 -0
- package/dist/utils/error-formatting.js +96 -0
- package/dist/utils/error-formatting.js.map +1 -0
- package/dist/utils/file-content.d.ts +24 -0
- package/dist/utils/file-content.d.ts.map +1 -0
- package/dist/utils/file-content.js +35 -0
- package/dist/utils/file-content.js.map +1 -0
- package/dist/utils/serialization/decode/index.d.ts +71 -0
- package/dist/utils/serialization/decode/index.d.ts.map +1 -0
- package/dist/utils/serialization/decode/index.js +167 -0
- package/dist/utils/serialization/decode/index.js.map +1 -0
- package/dist/utils/serialization/decode/index.test.d.ts +5 -0
- package/dist/utils/serialization/decode/index.test.d.ts.map +1 -0
- package/dist/utils/serialization/decode/index.test.js +226 -0
- package/dist/utils/serialization/decode/index.test.js.map +1 -0
- package/dist/utils/stdin.d.ts +6 -0
- package/dist/utils/stdin.d.ts.map +1 -0
- package/dist/utils/stdin.js +19 -0
- package/dist/utils/stdin.js.map +1 -0
- package/dist/utils/terminal-safety.d.ts +7 -0
- package/dist/utils/terminal-safety.d.ts.map +1 -0
- package/dist/utils/terminal-safety.js +17 -0
- package/dist/utils/terminal-safety.js.map +1 -0
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +43 -0
- package/dist/version.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local API — Open GitHub Desktop Route
|
|
3
|
+
*
|
|
4
|
+
* POST /api/open-github-desktop
|
|
5
|
+
*
|
|
6
|
+
* Opens a workspace directory in GitHub Desktop using the `github` CLI tool
|
|
7
|
+
* that GitHub Desktop installs. Checks for CLI availability first.
|
|
8
|
+
*
|
|
9
|
+
* Request body (JSON): `{ workingDir: string }`
|
|
10
|
+
* Response (JSON):
|
|
11
|
+
* - `{ success: true }` — command dispatched successfully
|
|
12
|
+
* - `{ success: false, error: "GitHub Desktop CLI not found" }` — CLI not installed
|
|
13
|
+
* - `{ success: false, error: string }` — validation failure or path error
|
|
14
|
+
*/
|
|
15
|
+
import { parseWorkingDir, escapeShellArg, isCliAvailable, execFireAndForget, jsonResponse, } from './shared-utils.js';
|
|
16
|
+
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* Handle POST /api/open-github-desktop.
|
|
19
|
+
*/
|
|
20
|
+
async function handleOpenGitHubDesktop(req) {
|
|
21
|
+
const parsed = await parseWorkingDir(req);
|
|
22
|
+
if (!parsed.ok)
|
|
23
|
+
return parsed.response;
|
|
24
|
+
// Check if `github` CLI is available
|
|
25
|
+
const available = await isCliAvailable('github');
|
|
26
|
+
if (!available) {
|
|
27
|
+
return jsonResponse(200, { success: false, error: 'GitHub Desktop CLI not found' });
|
|
28
|
+
}
|
|
29
|
+
// Fire-and-forget: open GitHub Desktop
|
|
30
|
+
execFireAndForget(`github ${escapeShellArg(parsed.workingDir)}`, 'open-github-desktop');
|
|
31
|
+
return jsonResponse(200, { success: true });
|
|
32
|
+
}
|
|
33
|
+
// ─── Route Definition ─────────────────────────────────────────────────────────
|
|
34
|
+
/**
|
|
35
|
+
* Route registration entry for POST /api/open-github-desktop.
|
|
36
|
+
* Import and pass to {@link LocalApiRouter.registerRoute} at server startup.
|
|
37
|
+
*/
|
|
38
|
+
export const openGitHubDesktopRoute = {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
path: '/api/open-github-desktop',
|
|
41
|
+
handler: (req) => handleOpenGitHubDesktop(req),
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=open-github-desktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-github-desktop.js","sourceRoot":"","sources":["../../../../src/infrastructure/local-api/routes/open-github-desktop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,gFAAgF;AAEhF;;GAEG;AACH,KAAK,UAAU,uBAAuB,CAAC,GAAoB;IACzD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC;IAEvC,qCAAqC;IACrC,MAAM,SAAS,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,YAAY,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,8BAA8B,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,uCAAuC;IACvC,iBAAiB,CAAC,UAAU,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;IAExF,OAAO,YAAY,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,CAAC;CAC/C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local API — Open VS Code Route
|
|
3
|
+
*
|
|
4
|
+
* POST /api/open-vscode
|
|
5
|
+
*
|
|
6
|
+
* Opens a workspace directory in Visual Studio Code using the `code` CLI tool.
|
|
7
|
+
* Checks for CLI availability first.
|
|
8
|
+
*
|
|
9
|
+
* Install the `code` CLI via: VS Code → Cmd+Shift+P → "Shell Command: Install code in PATH"
|
|
10
|
+
*
|
|
11
|
+
* Request body (JSON): `{ workingDir: string }`
|
|
12
|
+
* Response (JSON):
|
|
13
|
+
* - `{ success: true }` — command dispatched successfully
|
|
14
|
+
* - `{ success: false, error: "VS Code CLI (code) not found. Install via: ..." }` — CLI not installed
|
|
15
|
+
* - `{ success: false, error: string }` — validation failure or path error
|
|
16
|
+
*/
|
|
17
|
+
import type { LocalApiRoute } from '../types.js';
|
|
18
|
+
/**
|
|
19
|
+
* Route registration entry for POST /api/open-vscode.
|
|
20
|
+
* Import and pass to {@link LocalApiRouter.registerRoute} at server startup.
|
|
21
|
+
*/
|
|
22
|
+
export declare const openVSCodeRoute: LocalApiRoute;
|
|
23
|
+
//# sourceMappingURL=open-vscode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-vscode.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/local-api/routes/open-vscode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAqC,aAAa,EAAE,MAAM,aAAa,CAAC;AAyCpF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAI7B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local API — Open VS Code Route
|
|
3
|
+
*
|
|
4
|
+
* POST /api/open-vscode
|
|
5
|
+
*
|
|
6
|
+
* Opens a workspace directory in Visual Studio Code using the `code` CLI tool.
|
|
7
|
+
* Checks for CLI availability first.
|
|
8
|
+
*
|
|
9
|
+
* Install the `code` CLI via: VS Code → Cmd+Shift+P → "Shell Command: Install code in PATH"
|
|
10
|
+
*
|
|
11
|
+
* Request body (JSON): `{ workingDir: string }`
|
|
12
|
+
* Response (JSON):
|
|
13
|
+
* - `{ success: true }` — command dispatched successfully
|
|
14
|
+
* - `{ success: false, error: "VS Code CLI (code) not found. Install via: ..." }` — CLI not installed
|
|
15
|
+
* - `{ success: false, error: string }` — validation failure or path error
|
|
16
|
+
*/
|
|
17
|
+
import { parseWorkingDir, escapeShellArg, isCliAvailable, execFireAndForget, jsonResponse, } from './shared-utils.js';
|
|
18
|
+
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* Error message returned when the `code` CLI is not found on PATH.
|
|
21
|
+
* Includes install instructions for discoverability.
|
|
22
|
+
*/
|
|
23
|
+
const CODE_CLI_NOT_FOUND = "VS Code CLI (code) not found. Install via: VS Code → Cmd+Shift+P → 'Shell Command: Install code in PATH'";
|
|
24
|
+
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
25
|
+
/**
|
|
26
|
+
* Handle POST /api/open-vscode.
|
|
27
|
+
*/
|
|
28
|
+
async function handleOpenVSCode(req) {
|
|
29
|
+
const parsed = await parseWorkingDir(req);
|
|
30
|
+
if (!parsed.ok)
|
|
31
|
+
return parsed.response;
|
|
32
|
+
// Check if `code` CLI is available
|
|
33
|
+
const available = await isCliAvailable('code');
|
|
34
|
+
if (!available) {
|
|
35
|
+
return jsonResponse(200, { success: false, error: CODE_CLI_NOT_FOUND });
|
|
36
|
+
}
|
|
37
|
+
// Fire-and-forget: open VS Code
|
|
38
|
+
execFireAndForget(`code ${escapeShellArg(parsed.workingDir)}`, 'open-vscode');
|
|
39
|
+
return jsonResponse(200, { success: true });
|
|
40
|
+
}
|
|
41
|
+
// ─── Route Definition ─────────────────────────────────────────────────────────
|
|
42
|
+
/**
|
|
43
|
+
* Route registration entry for POST /api/open-vscode.
|
|
44
|
+
* Import and pass to {@link LocalApiRouter.registerRoute} at server startup.
|
|
45
|
+
*/
|
|
46
|
+
export const openVSCodeRoute = {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
path: '/api/open-vscode',
|
|
49
|
+
handler: (req) => handleOpenVSCode(req),
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=open-vscode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-vscode.js","sourceRoot":"","sources":["../../../../src/infrastructure/local-api/routes/open-vscode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,kBAAkB,GACtB,0GAA0G,CAAC;AAE7G,gFAAgF;AAEhF;;GAEG;AACH,KAAK,UAAU,gBAAgB,CAAC,GAAoB;IAClD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC;IAEvC,mCAAmC;IACnC,MAAM,SAAS,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,YAAY,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,gCAAgC;IAChC,iBAAiB,CAAC,QAAQ,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IAE9E,OAAO,YAAY,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkB;IAC5C,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC;CACxC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Route Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common helpers used by local API route handlers that accept a
|
|
5
|
+
* `{ workingDir: string }` JSON body, validate the path, and shell out.
|
|
6
|
+
*
|
|
7
|
+
* Extracted from open-finder, open-vscode, and open-github-desktop routes
|
|
8
|
+
* to eliminate duplication.
|
|
9
|
+
*/
|
|
10
|
+
import type { LocalApiRequest, LocalApiResponse } from '../types.js';
|
|
11
|
+
/** Discriminated result from {@link parseWorkingDir}. */
|
|
12
|
+
export type ParseResult = {
|
|
13
|
+
ok: true;
|
|
14
|
+
workingDir: string;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
response: LocalApiResponse;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Build a JSON {@link LocalApiResponse}.
|
|
21
|
+
*/
|
|
22
|
+
export declare function jsonResponse(status: number, body: Record<string, unknown>): LocalApiResponse;
|
|
23
|
+
/**
|
|
24
|
+
* Parse the request body as JSON, extract and validate `workingDir`,
|
|
25
|
+
* and verify the directory exists on disk.
|
|
26
|
+
*
|
|
27
|
+
* Returns either the validated `workingDir` string or a ready-to-send
|
|
28
|
+
* error response — callers can return it directly.
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseWorkingDir(req: LocalApiRequest): Promise<ParseResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Escape a filesystem path for safe use as a shell argument.
|
|
33
|
+
* Wraps the path in double quotes and escapes any embedded double quotes.
|
|
34
|
+
*/
|
|
35
|
+
export declare function escapeShellArg(arg: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the platform-specific command used to locate an executable.
|
|
38
|
+
* - POSIX: `which <name>`
|
|
39
|
+
* - Windows: `where <name>`
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveWhichCommand(name: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Check whether a CLI command is available on PATH.
|
|
44
|
+
* Resolves to `true` if found, `false` otherwise.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isCliAvailable(cliName: string): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Fire-and-forget: execute a shell command and log errors without propagating.
|
|
49
|
+
*/
|
|
50
|
+
export declare function execFireAndForget(command: string, logTag: string): void;
|
|
51
|
+
//# sourceMappingURL=shared-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-utils.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/local-api/routes/shared-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIrE,yDAAyD;AACzD,MAAM,MAAM,WAAW,GACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAI9C;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAM5F;AAID;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CA6BhF;AAID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAMvE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Route Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common helpers used by local API route handlers that accept a
|
|
5
|
+
* `{ workingDir: string }` JSON body, validate the path, and shell out.
|
|
6
|
+
*
|
|
7
|
+
* Extracted from open-finder, open-vscode, and open-github-desktop routes
|
|
8
|
+
* to eliminate duplication.
|
|
9
|
+
*/
|
|
10
|
+
import { exec } from 'node:child_process';
|
|
11
|
+
import { access } from 'node:fs/promises';
|
|
12
|
+
// ─── JSON Response Helper ─────────────────────────────────────────────────────
|
|
13
|
+
/**
|
|
14
|
+
* Build a JSON {@link LocalApiResponse}.
|
|
15
|
+
*/
|
|
16
|
+
export function jsonResponse(status, body) {
|
|
17
|
+
return {
|
|
18
|
+
status,
|
|
19
|
+
headers: { 'Content-Type': 'application/json' },
|
|
20
|
+
body: JSON.stringify(body),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// ─── Body Parsing & Validation ────────────────────────────────────────────────
|
|
24
|
+
/**
|
|
25
|
+
* Parse the request body as JSON, extract and validate `workingDir`,
|
|
26
|
+
* and verify the directory exists on disk.
|
|
27
|
+
*
|
|
28
|
+
* Returns either the validated `workingDir` string or a ready-to-send
|
|
29
|
+
* error response — callers can return it directly.
|
|
30
|
+
*/
|
|
31
|
+
export async function parseWorkingDir(req) {
|
|
32
|
+
// Parse JSON body
|
|
33
|
+
let body = {};
|
|
34
|
+
try {
|
|
35
|
+
if (req.body) {
|
|
36
|
+
body = JSON.parse(req.body);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return { ok: false, response: jsonResponse(400, { success: false, error: 'Invalid JSON body' }) };
|
|
41
|
+
}
|
|
42
|
+
const { workingDir } = body;
|
|
43
|
+
// Validate workingDir
|
|
44
|
+
if (!workingDir || typeof workingDir !== 'string' || workingDir.trim() === '') {
|
|
45
|
+
return { ok: false, response: jsonResponse(400, { success: false, error: 'workingDir is required' }) };
|
|
46
|
+
}
|
|
47
|
+
// Verify path exists
|
|
48
|
+
try {
|
|
49
|
+
await access(workingDir);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return {
|
|
53
|
+
ok: false,
|
|
54
|
+
response: jsonResponse(400, { success: false, error: `Directory not found: ${workingDir}` }),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return { ok: true, workingDir };
|
|
58
|
+
}
|
|
59
|
+
// ─── Shell Helpers ────────────────────────────────────────────────────────────
|
|
60
|
+
/**
|
|
61
|
+
* Escape a filesystem path for safe use as a shell argument.
|
|
62
|
+
* Wraps the path in double quotes and escapes any embedded double quotes.
|
|
63
|
+
*/
|
|
64
|
+
export function escapeShellArg(arg) {
|
|
65
|
+
return `"${arg.replace(/"/g, '\\"')}"`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve the platform-specific command used to locate an executable.
|
|
69
|
+
* - POSIX: `which <name>`
|
|
70
|
+
* - Windows: `where <name>`
|
|
71
|
+
*/
|
|
72
|
+
export function resolveWhichCommand(name) {
|
|
73
|
+
return process.platform === 'win32' ? `where ${name}` : `which ${name}`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Check whether a CLI command is available on PATH.
|
|
77
|
+
* Resolves to `true` if found, `false` otherwise.
|
|
78
|
+
*/
|
|
79
|
+
export function isCliAvailable(cliName) {
|
|
80
|
+
return new Promise((resolve) => {
|
|
81
|
+
exec(resolveWhichCommand(cliName), (err) => {
|
|
82
|
+
resolve(!err);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Fire-and-forget: execute a shell command and log errors without propagating.
|
|
88
|
+
*/
|
|
89
|
+
export function execFireAndForget(command, logTag) {
|
|
90
|
+
exec(command, (err) => {
|
|
91
|
+
if (err) {
|
|
92
|
+
console.warn(`[${logTag}] exec failed: ${err.message}`);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=shared-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-utils.js","sourceRoot":"","sources":["../../../../src/infrastructure/local-api/routes/shared-utils.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local API Server
|
|
3
|
+
*
|
|
4
|
+
* Lightweight HTTP server bound to 127.0.0.1 that exposes the local daemon API.
|
|
5
|
+
* The webapp uses this to detect whether it is running on the same machine as the
|
|
6
|
+
* daemon and to access local capabilities (e.g. identity, future editor integration).
|
|
7
|
+
*
|
|
8
|
+
* The server:
|
|
9
|
+
* - Binds only to localhost (not exposed to the network)
|
|
10
|
+
* - Registers all known routes on startup
|
|
11
|
+
* - Handles port conflicts gracefully (warns and continues)
|
|
12
|
+
* - Returns a stop handle for clean shutdown
|
|
13
|
+
*/
|
|
14
|
+
import type { DaemonContext } from './types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Default port for the local daemon API.
|
|
17
|
+
* Override with the CHATROOM_LOCAL_API_PORT environment variable.
|
|
18
|
+
*/
|
|
19
|
+
export declare const LOCAL_API_PORT = 19847;
|
|
20
|
+
/**
|
|
21
|
+
* Handle returned by {@link startLocalApi}.
|
|
22
|
+
* Call `stop()` to gracefully shut down the server.
|
|
23
|
+
*/
|
|
24
|
+
export interface LocalApiHandle {
|
|
25
|
+
/** Shut down the HTTP server. Resolves once all connections are closed. */
|
|
26
|
+
stop: () => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Start the local daemon API HTTP server.
|
|
30
|
+
*
|
|
31
|
+
* Binds to 127.0.0.1 on the configured port (default: {@link LOCAL_API_PORT}).
|
|
32
|
+
* If the port is already in use, logs a warning and resolves with a no-op stop handle
|
|
33
|
+
* so that a port conflict does not crash the daemon.
|
|
34
|
+
*
|
|
35
|
+
* @param ctx - Daemon context passed to route handlers.
|
|
36
|
+
* @param port - Port to bind (defaults to {@link resolvePort}).
|
|
37
|
+
* @returns A handle with a `stop()` method for clean shutdown.
|
|
38
|
+
*/
|
|
39
|
+
export declare function startLocalApi(ctx: DaemonContext, port?: number): Promise<LocalApiHandle>;
|
|
40
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/local-api/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,YAAY,CAAC;AAIjE;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAIpC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAgFD;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,IAAI,GAAE,MAAsB,GAC3B,OAAO,CAAC,cAAc,CAAC,CAoDzB"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local API Server
|
|
3
|
+
*
|
|
4
|
+
* Lightweight HTTP server bound to 127.0.0.1 that exposes the local daemon API.
|
|
5
|
+
* The webapp uses this to detect whether it is running on the same machine as the
|
|
6
|
+
* daemon and to access local capabilities (e.g. identity, future editor integration).
|
|
7
|
+
*
|
|
8
|
+
* The server:
|
|
9
|
+
* - Binds only to localhost (not exposed to the network)
|
|
10
|
+
* - Registers all known routes on startup
|
|
11
|
+
* - Handles port conflicts gracefully (warns and continues)
|
|
12
|
+
* - Returns a stop handle for clean shutdown
|
|
13
|
+
*/
|
|
14
|
+
import { createServer } from 'node:http';
|
|
15
|
+
import { identityRoute } from './routes/identity.js';
|
|
16
|
+
import { openFinderRoute } from './routes/open-finder.js';
|
|
17
|
+
import { openGitHubDesktopRoute } from './routes/open-github-desktop.js';
|
|
18
|
+
import { openVSCodeRoute } from './routes/open-vscode.js';
|
|
19
|
+
import { LocalApiRouter } from './router.js';
|
|
20
|
+
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
21
|
+
/**
|
|
22
|
+
* Default port for the local daemon API.
|
|
23
|
+
* Override with the CHATROOM_LOCAL_API_PORT environment variable.
|
|
24
|
+
*/
|
|
25
|
+
export const LOCAL_API_PORT = 19847;
|
|
26
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Read the full request body from an incoming Node.js HTTP request.
|
|
29
|
+
*/
|
|
30
|
+
function readBody(req) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const chunks = [];
|
|
33
|
+
req.on('data', (chunk) => chunks.push(chunk));
|
|
34
|
+
req.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
|
|
35
|
+
req.on('error', reject);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Normalize a Node.js IncomingMessage into a {@link LocalApiRequest}.
|
|
40
|
+
*/
|
|
41
|
+
async function normalizeRequest(req) {
|
|
42
|
+
const body = await readBody(req);
|
|
43
|
+
const headers = {};
|
|
44
|
+
for (const [key, value] of Object.entries(req.headers)) {
|
|
45
|
+
if (typeof value === 'string') {
|
|
46
|
+
headers[key] = value;
|
|
47
|
+
}
|
|
48
|
+
else if (Array.isArray(value)) {
|
|
49
|
+
headers[key] = value.join(', ');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
method: (req.method ?? 'GET').toUpperCase(),
|
|
54
|
+
url: req.url ?? '/',
|
|
55
|
+
headers,
|
|
56
|
+
body: body || undefined,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Write a {@link LocalApiResponse} to a Node.js ServerResponse.
|
|
61
|
+
*/
|
|
62
|
+
function writeResponse(res, status, headers, body) {
|
|
63
|
+
res.writeHead(status, headers);
|
|
64
|
+
res.end(body);
|
|
65
|
+
}
|
|
66
|
+
// ─── Server Lifecycle ─────────────────────────────────────────────────────────
|
|
67
|
+
/**
|
|
68
|
+
* Create a router pre-loaded with all known local API routes.
|
|
69
|
+
*/
|
|
70
|
+
function createRouter() {
|
|
71
|
+
const router = new LocalApiRouter();
|
|
72
|
+
router.registerRoute(identityRoute);
|
|
73
|
+
router.registerRoute(openFinderRoute);
|
|
74
|
+
router.registerRoute(openGitHubDesktopRoute);
|
|
75
|
+
router.registerRoute(openVSCodeRoute);
|
|
76
|
+
return router;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Resolve the port to bind, preferring the CHATROOM_LOCAL_API_PORT environment variable.
|
|
80
|
+
*/
|
|
81
|
+
function resolvePort() {
|
|
82
|
+
const envPort = process.env.CHATROOM_LOCAL_API_PORT;
|
|
83
|
+
if (envPort) {
|
|
84
|
+
const parsed = parseInt(envPort, 10);
|
|
85
|
+
if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
|
|
86
|
+
return parsed;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return LOCAL_API_PORT;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Format an ISO timestamp prefix for log lines (consistent with daemon logging).
|
|
93
|
+
*/
|
|
94
|
+
function ts() {
|
|
95
|
+
return new Date().toISOString().replace('T', ' ').slice(0, 19);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Start the local daemon API HTTP server.
|
|
99
|
+
*
|
|
100
|
+
* Binds to 127.0.0.1 on the configured port (default: {@link LOCAL_API_PORT}).
|
|
101
|
+
* If the port is already in use, logs a warning and resolves with a no-op stop handle
|
|
102
|
+
* so that a port conflict does not crash the daemon.
|
|
103
|
+
*
|
|
104
|
+
* @param ctx - Daemon context passed to route handlers.
|
|
105
|
+
* @param port - Port to bind (defaults to {@link resolvePort}).
|
|
106
|
+
* @returns A handle with a `stop()` method for clean shutdown.
|
|
107
|
+
*/
|
|
108
|
+
export async function startLocalApi(ctx, port = resolvePort()) {
|
|
109
|
+
const router = createRouter();
|
|
110
|
+
const server = createServer(async (req, res) => {
|
|
111
|
+
try {
|
|
112
|
+
const localReq = await normalizeRequest(req);
|
|
113
|
+
const localRes = await router.handleRequest(localReq, ctx);
|
|
114
|
+
writeResponse(res, localRes.status, { 'Content-Type': 'application/json', ...(localRes.headers ?? {}) }, localRes.body);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
writeResponse(res, 500, { 'Content-Type': 'application/json' }, JSON.stringify({ error: 'Internal server error' }));
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
// Attempt to bind the server; handle port-in-use gracefully
|
|
121
|
+
await new Promise((resolve) => {
|
|
122
|
+
server.listen(port, '127.0.0.1', () => {
|
|
123
|
+
console.log(`[${ts()}] 🌐 Local API started on http://localhost:${port}`);
|
|
124
|
+
resolve();
|
|
125
|
+
});
|
|
126
|
+
server.on('error', (err) => {
|
|
127
|
+
if (err.code === 'EADDRINUSE') {
|
|
128
|
+
console.warn(`[${ts()}] ⚠️ Local API port ${port} already in use — skipping local API`);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
console.warn(`[${ts()}] ⚠️ Local API failed to start: ${err.message}`);
|
|
132
|
+
}
|
|
133
|
+
resolve(); // Non-fatal — resolve so the daemon continues
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
const stop = () => new Promise((resolve, reject) => {
|
|
137
|
+
if (!server.listening) {
|
|
138
|
+
resolve();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
server.close((err) => {
|
|
142
|
+
if (err) {
|
|
143
|
+
reject(err);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
console.log(`[${ts()}] 🌐 Local API stopped`);
|
|
147
|
+
resolve();
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
return { stop };
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/infrastructure/local-api/server.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local API Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the lightweight HTTP server that allows the webapp
|
|
5
|
+
* to detect and communicate with a daemon running on the same machine.
|
|
6
|
+
*/
|
|
7
|
+
import type { DaemonContext } from '../../commands/machine/daemon-start/types.js';
|
|
8
|
+
export type { DaemonContext };
|
|
9
|
+
/**
|
|
10
|
+
* Normalized HTTP request passed to route handlers.
|
|
11
|
+
*/
|
|
12
|
+
export interface LocalApiRequest {
|
|
13
|
+
/** HTTP method (uppercase) */
|
|
14
|
+
method: string;
|
|
15
|
+
/** Full request URL (e.g. "/api/identity") */
|
|
16
|
+
url: string;
|
|
17
|
+
/** Request headers as a plain string record */
|
|
18
|
+
headers: Record<string, string>;
|
|
19
|
+
/** Raw request body, if any */
|
|
20
|
+
body?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Normalized HTTP response returned by route handlers.
|
|
24
|
+
*/
|
|
25
|
+
export interface LocalApiResponse {
|
|
26
|
+
/** HTTP status code */
|
|
27
|
+
status: number;
|
|
28
|
+
/** Optional response headers */
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
/** Response body (JSON string recommended) */
|
|
31
|
+
body: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A single route registered with the local API router.
|
|
35
|
+
* Each route declares the HTTP method, path, and handler function.
|
|
36
|
+
*/
|
|
37
|
+
export interface LocalApiRoute {
|
|
38
|
+
/** HTTP method this route responds to */
|
|
39
|
+
method: 'GET' | 'POST';
|
|
40
|
+
/** Exact path this route matches (e.g. "/api/identity") */
|
|
41
|
+
path: string;
|
|
42
|
+
/**
|
|
43
|
+
* Handler function called when the route is matched.
|
|
44
|
+
* Receives the normalized request and the current daemon context.
|
|
45
|
+
*/
|
|
46
|
+
handler: (req: LocalApiRequest, ctx: DaemonContext) => Promise<LocalApiResponse>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/local-api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAIlF,YAAY,EAAE,aAAa,EAAE,CAAC;AAI9B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAID;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/infrastructure/local-api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CrashLoopTracker — detects rapid restart loops per (chatroomId, role).
|
|
3
|
+
*
|
|
4
|
+
* Uses a sliding window with progressive backoff: records timestamps of recent
|
|
5
|
+
* restarts and checks whether the agent should be allowed to restart based on
|
|
6
|
+
* the backoff schedule. If not, the caller should schedule a retry.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Maximum number of restarts within WINDOW_MS before the loop is halted.
|
|
10
|
+
* Expanded from 3 to 10 to accommodate progressive backoff.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CRASH_LOOP_MAX_RESTARTS = 10;
|
|
13
|
+
/**
|
|
14
|
+
* Sliding window duration in milliseconds.
|
|
15
|
+
* Expanded to accommodate 10 restarts with backoff (~9.5 minutes total).
|
|
16
|
+
*/
|
|
17
|
+
export declare const CRASH_LOOP_WINDOW_MS: number;
|
|
18
|
+
/**
|
|
19
|
+
* Backoff intervals in milliseconds.
|
|
20
|
+
* - Attempt 1: immediate (0ms)
|
|
21
|
+
* - Attempt 2: 30 seconds
|
|
22
|
+
* - Attempts 3-10: 1 minute each (sustained backoff)
|
|
23
|
+
*/
|
|
24
|
+
export declare const BACKOFF_INTERVALS: readonly number[];
|
|
25
|
+
/**
|
|
26
|
+
* Result of a restart-allowance check.
|
|
27
|
+
*/
|
|
28
|
+
export interface CrashLoopCheckResult {
|
|
29
|
+
/** Whether the restart is allowed immediately. */
|
|
30
|
+
allowed: boolean;
|
|
31
|
+
/** Total number of restart attempts (including blocked). */
|
|
32
|
+
restartCount: number;
|
|
33
|
+
/** The window duration used for the check. */
|
|
34
|
+
windowMs: number;
|
|
35
|
+
/** When the next restart is allowed (ms since epoch). Undefined if allowed immediately. */
|
|
36
|
+
nextAllowedAt?: number;
|
|
37
|
+
/** How long to wait before retrying (0 if immediate). Undefined if allowed immediately. */
|
|
38
|
+
waitMs?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Tracks restart timestamps per `${chatroomId}:${role}` key.
|
|
42
|
+
* Exported for testing only — use the singleton instance in production.
|
|
43
|
+
*/
|
|
44
|
+
export declare class CrashLoopTracker {
|
|
45
|
+
/** Map of agent key → sorted list of restart timestamps (oldest first). */
|
|
46
|
+
private readonly history;
|
|
47
|
+
/**
|
|
48
|
+
* Record a restart attempt and check whether the agent is in a crash loop.
|
|
49
|
+
*
|
|
50
|
+
* Call this BEFORE spawning. If the result is `allowed: false`, do not spawn
|
|
51
|
+
* and schedule a retry after `waitMs` instead.
|
|
52
|
+
*
|
|
53
|
+
* @param chatroomId - Chatroom identifier
|
|
54
|
+
* @param role - Agent role (case-insensitive)
|
|
55
|
+
* @param now - Current timestamp in ms (defaults to Date.now())
|
|
56
|
+
*/
|
|
57
|
+
record(chatroomId: string, role: string, now?: number): CrashLoopCheckResult;
|
|
58
|
+
/**
|
|
59
|
+
* Clear the restart history for an agent.
|
|
60
|
+
* Call when the agent is intentionally stopped (user.stop) to reset the window.
|
|
61
|
+
*/
|
|
62
|
+
clear(chatroomId: string, role: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the number of successful restarts recorded in the current window for this agent.
|
|
65
|
+
* Does NOT record a new restart — use for inspection only.
|
|
66
|
+
*/
|
|
67
|
+
getCount(chatroomId: string, role: string, now?: number): number;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=crash-loop-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crash-loop-tracker.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/machine/crash-loop-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAiB,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAI9C,CAAC;AAIF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,oBAAoB;IA8DxF;;;OAGG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAK7C;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM;CAM7E"}
|