chatroom-cli 1.30.1 → 1.32.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/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 +254 -30
- 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/index.d.ts +9 -0
- package/dist/infrastructure/git/index.d.ts.map +1 -0
- package/dist/infrastructure/git/index.js +8 -0
- package/dist/infrastructure/git/index.js.map +1 -0
- package/dist/infrastructure/git/types.d.ts +102 -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 +30 -0
- package/dist/infrastructure/local-actions/execute-local-action.d.ts.map +1 -0
- package/dist/infrastructure/local-actions/execute-local-action.js +76 -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,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Request Subscription — reactive subscription for on-demand workspace git requests.
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to `api.workspaces.getPendingRequests` via Convex WebSocket,
|
|
5
|
+
* processing requests instantly when they appear (replacing the previous
|
|
6
|
+
* 5-second setInterval polling loop).
|
|
7
|
+
*
|
|
8
|
+
* Processes pending requests from the backend:
|
|
9
|
+
* - `full_diff` → run `getFullDiff()`, push via `upsertFullDiff()`
|
|
10
|
+
* - `commit_detail` → run `getCommitDetail()` + `getCommitMetadata()`, push via `upsertCommitDetail()`
|
|
11
|
+
* - `more_commits` → run `getRecentCommits()` with skip offset, push via `appendMoreCommits()`
|
|
12
|
+
*
|
|
13
|
+
* The heartbeat loop (every 30s) is responsible for pushing incremental
|
|
14
|
+
* git state (branch, isDirty, diffStat, recentCommits) when state changes.
|
|
15
|
+
* This subscription is only for on-demand requests that require low latency.
|
|
16
|
+
*/
|
|
17
|
+
import { exec } from 'child_process';
|
|
18
|
+
import { gzipSync } from 'node:zlib';
|
|
19
|
+
import { promisify } from 'util';
|
|
20
|
+
import { formatTimestamp } from './utils.js';
|
|
21
|
+
import { api } from '../../../api.js';
|
|
22
|
+
import * as gitReader from '../../../infrastructure/git/git-reader.js';
|
|
23
|
+
import { COMMITS_PER_PAGE } from '../../../infrastructure/git/types.js';
|
|
24
|
+
import { getErrorMessage } from '../../../utils/convex-error.js';
|
|
25
|
+
import { pushGitState } from './git-heartbeat.js';
|
|
26
|
+
/**
|
|
27
|
+
* Start the reactive git request subscription.
|
|
28
|
+
*
|
|
29
|
+
* Subscribes to `api.workspaces.getPendingRequests` via the Convex WebSocket
|
|
30
|
+
* client. When new pending requests appear, they are processed immediately.
|
|
31
|
+
*
|
|
32
|
+
* Called once during daemon startup, after the heartbeat loop is running.
|
|
33
|
+
* Returns a handle with a `stop()` method for clean shutdown.
|
|
34
|
+
*
|
|
35
|
+
* @param ctx - Daemon context (session, machineId, deps)
|
|
36
|
+
* @param wsClient - Convex WebSocket client for reactive subscriptions
|
|
37
|
+
*/
|
|
38
|
+
export function startGitRequestSubscription(ctx, wsClient) {
|
|
39
|
+
// Session-scoped dedup — prevents re-processing the same request within a single daemon run.
|
|
40
|
+
// Map<requestId, processedAt timestamp>. Entries are evicted when older than 5 minutes.
|
|
41
|
+
const processedRequestIds = new Map();
|
|
42
|
+
const DEDUP_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
43
|
+
// Track whether we're currently processing to avoid overlapping batches
|
|
44
|
+
let processing = false;
|
|
45
|
+
const unsubscribe = wsClient.onUpdate(api.workspaces.getPendingRequests, {
|
|
46
|
+
sessionId: ctx.sessionId,
|
|
47
|
+
machineId: ctx.machineId,
|
|
48
|
+
}, (requests) => {
|
|
49
|
+
if (!requests || requests.length === 0)
|
|
50
|
+
return;
|
|
51
|
+
if (processing)
|
|
52
|
+
return; // Skip if still processing previous batch
|
|
53
|
+
processing = true;
|
|
54
|
+
processRequests(ctx, requests, processedRequestIds, DEDUP_TTL_MS)
|
|
55
|
+
.catch((err) => {
|
|
56
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Git request processing failed: ${getErrorMessage(err)}`);
|
|
57
|
+
})
|
|
58
|
+
.finally(() => {
|
|
59
|
+
processing = false;
|
|
60
|
+
});
|
|
61
|
+
}, (err) => {
|
|
62
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Git request subscription error: ${getErrorMessage(err)}`);
|
|
63
|
+
});
|
|
64
|
+
console.log(`[${formatTimestamp()}] 🔀 Git request subscription started (reactive)`);
|
|
65
|
+
return {
|
|
66
|
+
stop: () => {
|
|
67
|
+
unsubscribe();
|
|
68
|
+
console.log(`[${formatTimestamp()}] 🔀 Git request subscription stopped`);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// ─── Internal Helpers ────────────────────────────────────────────────────────
|
|
73
|
+
/**
|
|
74
|
+
* Extract diff statistics from `git show` output.
|
|
75
|
+
*
|
|
76
|
+
* The `--stat` portion of `git show` includes a summary line like:
|
|
77
|
+
* " 3 files changed, 45 insertions(+), 12 deletions(-)"
|
|
78
|
+
* This appears before the diff hunks (which start with "diff --git").
|
|
79
|
+
*/
|
|
80
|
+
export function extractDiffStatFromShowOutput(content) {
|
|
81
|
+
for (const line of content.split('\n')) {
|
|
82
|
+
if (/\d+\s+file.*changed/.test(line)) {
|
|
83
|
+
return gitReader.parseDiffStatLine(line);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { filesChanged: 0, insertions: 0, deletions: 0 };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Process a `full_diff` request:
|
|
90
|
+
* Run `git diff HEAD`, parse stats, push via `upsertFullDiff`.
|
|
91
|
+
*/
|
|
92
|
+
async function processFullDiff(ctx, req) {
|
|
93
|
+
const result = await gitReader.getFullDiff(req.workingDir);
|
|
94
|
+
if (result.status === 'available' || result.status === 'truncated') {
|
|
95
|
+
// Fetch diff stat separately (more reliable than parsing from diff content)
|
|
96
|
+
const diffStatResult = await gitReader.getDiffStat(req.workingDir);
|
|
97
|
+
const diffStat = diffStatResult.status === 'available'
|
|
98
|
+
? diffStatResult.diffStat
|
|
99
|
+
: { filesChanged: 0, insertions: 0, deletions: 0 };
|
|
100
|
+
// Compress diff content for efficient transport
|
|
101
|
+
const compressed = gzipSync(Buffer.from(result.content));
|
|
102
|
+
const diffContentCompressed = compressed.toString('base64');
|
|
103
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertFullDiffV2, {
|
|
104
|
+
sessionId: ctx.sessionId,
|
|
105
|
+
machineId: ctx.machineId,
|
|
106
|
+
workingDir: req.workingDir,
|
|
107
|
+
data: { compression: 'gzip', content: diffContentCompressed },
|
|
108
|
+
truncated: result.truncated,
|
|
109
|
+
diffStat,
|
|
110
|
+
});
|
|
111
|
+
console.log(`[${formatTimestamp()}] 📄 Full diff pushed: ${req.workingDir} (${diffStat.filesChanged} files, ${(Buffer.byteLength(result.content) / 1024).toFixed(1)}KB → ${(compressed.length / 1024).toFixed(1)}KB gzip, ${result.truncated ? 'truncated' : 'complete'})`);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// For not_found / no_commits / error — push empty diff
|
|
115
|
+
// Empty diff — compress empty string for consistency
|
|
116
|
+
const emptyCompressed = gzipSync(Buffer.from('')).toString('base64');
|
|
117
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertFullDiffV2, {
|
|
118
|
+
sessionId: ctx.sessionId,
|
|
119
|
+
machineId: ctx.machineId,
|
|
120
|
+
workingDir: req.workingDir,
|
|
121
|
+
data: { compression: 'gzip', content: emptyCompressed },
|
|
122
|
+
truncated: false,
|
|
123
|
+
diffStat: { filesChanged: 0, insertions: 0, deletions: 0 },
|
|
124
|
+
});
|
|
125
|
+
console.log(`[${formatTimestamp()}] 📄 Full diff pushed (empty): ${req.workingDir} (${result.status})`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Process a `pr_diff` request:
|
|
130
|
+
* Run `git diff origin/<baseBranch>...HEAD`, get diff stat, push via `upsertPRDiff`.
|
|
131
|
+
*/
|
|
132
|
+
async function processPRDiff(ctx, req) {
|
|
133
|
+
const baseBranch = req.baseBranch ?? 'main';
|
|
134
|
+
// If a PR number is specified, use `gh pr diff <number>` for the exact PR diff
|
|
135
|
+
if (req.prNumber) {
|
|
136
|
+
const result = await gitReader.getPRDiffByNumber(req.workingDir, req.prNumber);
|
|
137
|
+
if (result.status === 'available' || result.status === 'truncated') {
|
|
138
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertPRDiff, {
|
|
139
|
+
sessionId: ctx.sessionId,
|
|
140
|
+
machineId: ctx.machineId,
|
|
141
|
+
workingDir: req.workingDir,
|
|
142
|
+
baseBranch,
|
|
143
|
+
diffContent: result.content,
|
|
144
|
+
truncated: result.truncated,
|
|
145
|
+
diffStat: { filesChanged: 0, insertions: 0, deletions: 0 },
|
|
146
|
+
});
|
|
147
|
+
console.log(`[${formatTimestamp()}] 📄 PR diff pushed: ${req.workingDir} (#${req.prNumber}, ${result.truncated ? 'truncated' : 'complete'})`);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertPRDiff, {
|
|
151
|
+
sessionId: ctx.sessionId,
|
|
152
|
+
machineId: ctx.machineId,
|
|
153
|
+
workingDir: req.workingDir,
|
|
154
|
+
baseBranch,
|
|
155
|
+
diffContent: '',
|
|
156
|
+
truncated: false,
|
|
157
|
+
diffStat: { filesChanged: 0, insertions: 0, deletions: 0 },
|
|
158
|
+
});
|
|
159
|
+
console.log(`[${formatTimestamp()}] 📄 PR diff pushed (empty): ${req.workingDir} (#${req.prNumber}, ${result.status})`);
|
|
160
|
+
}
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// Fallback: use branch comparison (origin/<baseBranch>...HEAD)
|
|
164
|
+
const result = await gitReader.getPRDiff(req.workingDir, baseBranch);
|
|
165
|
+
if (result.status === 'available' || result.status === 'truncated') {
|
|
166
|
+
const diffStatResult = await gitReader.getPRDiffStat(req.workingDir, baseBranch);
|
|
167
|
+
const diffStat = diffStatResult.status === 'available'
|
|
168
|
+
? diffStatResult.diffStat
|
|
169
|
+
: { filesChanged: 0, insertions: 0, deletions: 0 };
|
|
170
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertPRDiff, {
|
|
171
|
+
sessionId: ctx.sessionId,
|
|
172
|
+
machineId: ctx.machineId,
|
|
173
|
+
workingDir: req.workingDir,
|
|
174
|
+
baseBranch,
|
|
175
|
+
diffContent: result.content,
|
|
176
|
+
truncated: result.truncated,
|
|
177
|
+
diffStat,
|
|
178
|
+
});
|
|
179
|
+
console.log(`[${formatTimestamp()}] 📄 PR diff pushed: ${req.workingDir} (${baseBranch}...HEAD, ${diffStat.filesChanged} files, ${result.truncated ? 'truncated' : 'complete'})`);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertPRDiff, {
|
|
183
|
+
sessionId: ctx.sessionId,
|
|
184
|
+
machineId: ctx.machineId,
|
|
185
|
+
workingDir: req.workingDir,
|
|
186
|
+
baseBranch,
|
|
187
|
+
diffContent: '',
|
|
188
|
+
truncated: false,
|
|
189
|
+
diffStat: { filesChanged: 0, insertions: 0, deletions: 0 },
|
|
190
|
+
});
|
|
191
|
+
console.log(`[${formatTimestamp()}] 📄 PR diff pushed (empty): ${req.workingDir} (${result.status})`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Process a `pr_action` request:
|
|
196
|
+
* Execute the appropriate `gh` CLI command for merge/close.
|
|
197
|
+
*/
|
|
198
|
+
async function processPRAction(ctx, req) {
|
|
199
|
+
const prNumber = req.prNumber;
|
|
200
|
+
const action = req.prAction;
|
|
201
|
+
if (!prNumber || !action) {
|
|
202
|
+
throw new Error('pr_action request missing prNumber or prAction');
|
|
203
|
+
}
|
|
204
|
+
let cmd;
|
|
205
|
+
switch (action) {
|
|
206
|
+
case 'merge_squash':
|
|
207
|
+
cmd = `gh pr merge ${prNumber} --squash --delete-branch`;
|
|
208
|
+
break;
|
|
209
|
+
case 'merge_no_squash':
|
|
210
|
+
cmd = `gh pr merge ${prNumber} --merge`;
|
|
211
|
+
break;
|
|
212
|
+
case 'close':
|
|
213
|
+
cmd = `gh pr close ${prNumber}`;
|
|
214
|
+
break;
|
|
215
|
+
default:
|
|
216
|
+
throw new Error(`Unknown PR action: ${action}`);
|
|
217
|
+
}
|
|
218
|
+
const execAsync = promisify(exec);
|
|
219
|
+
const result = await execAsync(cmd, { cwd: req.workingDir });
|
|
220
|
+
console.log(`[${formatTimestamp()}] ✅ PR action: ${action} on #${prNumber}${result.stdout ? ` — ${result.stdout.trim()}` : ''}`);
|
|
221
|
+
// Refresh git state so the UI updates (PR list, branch, etc.)
|
|
222
|
+
await pushGitState(ctx).catch((err) => {
|
|
223
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Failed to refresh git state after PR action: ${getErrorMessage(err)}`);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Process a `pr_commits` request:
|
|
228
|
+
* Run `gh pr view <number> --json commits`, push via `upsertPRCommits`.
|
|
229
|
+
*/
|
|
230
|
+
async function processPRCommits(ctx, req) {
|
|
231
|
+
const prNumber = req.prNumber;
|
|
232
|
+
if (!prNumber) {
|
|
233
|
+
throw new Error('pr_commits request missing prNumber');
|
|
234
|
+
}
|
|
235
|
+
const commits = await gitReader.getPRCommits(req.workingDir, prNumber);
|
|
236
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertPRCommits, {
|
|
237
|
+
sessionId: ctx.sessionId,
|
|
238
|
+
machineId: ctx.machineId,
|
|
239
|
+
workingDir: req.workingDir,
|
|
240
|
+
prNumber,
|
|
241
|
+
commits,
|
|
242
|
+
});
|
|
243
|
+
console.log(`[${formatTimestamp()}] 📋 PR commits pushed: ${req.workingDir} (#${prNumber}, ${commits.length} commits)`);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Process a `commit_detail` request:
|
|
247
|
+
* Run `git show <sha>`, get commit metadata, push via `upsertCommitDetail`.
|
|
248
|
+
*/
|
|
249
|
+
async function processCommitDetail(ctx, req) {
|
|
250
|
+
if (!req.sha) {
|
|
251
|
+
throw new Error('commit_detail request missing sha');
|
|
252
|
+
}
|
|
253
|
+
const [result, metadata] = await Promise.all([
|
|
254
|
+
gitReader.getCommitDetail(req.workingDir, req.sha),
|
|
255
|
+
gitReader.getCommitMetadata(req.workingDir, req.sha),
|
|
256
|
+
]);
|
|
257
|
+
if (result.status === 'not_found') {
|
|
258
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertCommitDetailV2, {
|
|
259
|
+
sessionId: ctx.sessionId,
|
|
260
|
+
machineId: ctx.machineId,
|
|
261
|
+
workingDir: req.workingDir,
|
|
262
|
+
sha: req.sha,
|
|
263
|
+
status: 'not_found',
|
|
264
|
+
message: metadata?.message,
|
|
265
|
+
author: metadata?.author,
|
|
266
|
+
date: metadata?.date,
|
|
267
|
+
});
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (result.status === 'error') {
|
|
271
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertCommitDetailV2, {
|
|
272
|
+
sessionId: ctx.sessionId,
|
|
273
|
+
machineId: ctx.machineId,
|
|
274
|
+
workingDir: req.workingDir,
|
|
275
|
+
sha: req.sha,
|
|
276
|
+
status: 'error',
|
|
277
|
+
errorMessage: result.message,
|
|
278
|
+
message: metadata?.message,
|
|
279
|
+
author: metadata?.author,
|
|
280
|
+
date: metadata?.date,
|
|
281
|
+
});
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
// result.status is 'available' or 'truncated'
|
|
285
|
+
const diffStat = extractDiffStatFromShowOutput(result.content);
|
|
286
|
+
// Compress diff content for efficient transport
|
|
287
|
+
const compressed = gzipSync(Buffer.from(result.content));
|
|
288
|
+
const diffContentCompressed = compressed.toString('base64');
|
|
289
|
+
await ctx.deps.backend.mutation(api.workspaces.upsertCommitDetailV2, {
|
|
290
|
+
sessionId: ctx.sessionId,
|
|
291
|
+
machineId: ctx.machineId,
|
|
292
|
+
workingDir: req.workingDir,
|
|
293
|
+
sha: req.sha,
|
|
294
|
+
status: 'available',
|
|
295
|
+
data: { compression: 'gzip', content: diffContentCompressed },
|
|
296
|
+
truncated: result.truncated,
|
|
297
|
+
message: metadata?.message,
|
|
298
|
+
author: metadata?.author,
|
|
299
|
+
date: metadata?.date,
|
|
300
|
+
diffStat,
|
|
301
|
+
});
|
|
302
|
+
console.log(`[${formatTimestamp()}] 🔍 Commit detail pushed: ${req.sha.slice(0, 7)} in ${req.workingDir} (${(Buffer.byteLength(result.content) / 1024).toFixed(1)}KB → ${(compressed.length / 1024).toFixed(1)}KB gzip)`);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Process a `more_commits` request:
|
|
306
|
+
* Run `git log` with skip offset, push via `appendMoreCommits`.
|
|
307
|
+
*/
|
|
308
|
+
async function processMoreCommits(ctx, req) {
|
|
309
|
+
const offset = req.offset ?? 0;
|
|
310
|
+
const commits = await gitReader.getRecentCommits(req.workingDir, COMMITS_PER_PAGE, offset);
|
|
311
|
+
const hasMoreCommits = commits.length >= COMMITS_PER_PAGE;
|
|
312
|
+
await ctx.deps.backend.mutation(api.workspaces.appendMoreCommits, {
|
|
313
|
+
sessionId: ctx.sessionId,
|
|
314
|
+
machineId: ctx.machineId,
|
|
315
|
+
workingDir: req.workingDir,
|
|
316
|
+
commits,
|
|
317
|
+
hasMoreCommits,
|
|
318
|
+
});
|
|
319
|
+
console.log(`[${formatTimestamp()}] 📜 More commits appended: ${req.workingDir} (+${commits.length} commits, offset=${offset})`);
|
|
320
|
+
}
|
|
321
|
+
// ─── Request Processing ───────────────────────────────────────────────────────
|
|
322
|
+
/**
|
|
323
|
+
* Process a batch of pending requests from a subscription update.
|
|
324
|
+
*
|
|
325
|
+
* Handles deduplication and transitions each request through
|
|
326
|
+
* `pending` → `processing` → `done` | `error`.
|
|
327
|
+
*/
|
|
328
|
+
export async function processRequests(ctx, requests, processedRequestIds, dedupTtlMs) {
|
|
329
|
+
// Evict stale dedup entries
|
|
330
|
+
const evictBefore = Date.now() - dedupTtlMs;
|
|
331
|
+
for (const [id, ts] of processedRequestIds) {
|
|
332
|
+
if (ts < evictBefore)
|
|
333
|
+
processedRequestIds.delete(id);
|
|
334
|
+
}
|
|
335
|
+
// Process each request sequentially
|
|
336
|
+
for (const req of requests) {
|
|
337
|
+
const requestId = req._id.toString();
|
|
338
|
+
// Skip already-processed requests (dedup within this daemon session)
|
|
339
|
+
if (processedRequestIds.has(requestId))
|
|
340
|
+
continue;
|
|
341
|
+
processedRequestIds.set(requestId, Date.now());
|
|
342
|
+
try {
|
|
343
|
+
// Mark as processing
|
|
344
|
+
await ctx.deps.backend.mutation(api.workspaces.updateRequestStatus, {
|
|
345
|
+
sessionId: ctx.sessionId,
|
|
346
|
+
requestId: req._id,
|
|
347
|
+
status: 'processing',
|
|
348
|
+
});
|
|
349
|
+
switch (req.requestType) {
|
|
350
|
+
case 'full_diff':
|
|
351
|
+
await processFullDiff(ctx, req);
|
|
352
|
+
break;
|
|
353
|
+
case 'commit_detail':
|
|
354
|
+
await processCommitDetail(ctx, req);
|
|
355
|
+
break;
|
|
356
|
+
case 'more_commits':
|
|
357
|
+
await processMoreCommits(ctx, req);
|
|
358
|
+
break;
|
|
359
|
+
case 'pr_diff':
|
|
360
|
+
await processPRDiff(ctx, req);
|
|
361
|
+
break;
|
|
362
|
+
case 'pr_action':
|
|
363
|
+
await processPRAction(ctx, req);
|
|
364
|
+
break;
|
|
365
|
+
case 'pr_commits':
|
|
366
|
+
await processPRCommits(ctx, req);
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
// Mark as done
|
|
370
|
+
await ctx.deps.backend.mutation(api.workspaces.updateRequestStatus, {
|
|
371
|
+
sessionId: ctx.sessionId,
|
|
372
|
+
requestId: req._id,
|
|
373
|
+
status: 'done',
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
catch (err) {
|
|
377
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Failed to process ${req.requestType} request: ${getErrorMessage(err)}`);
|
|
378
|
+
// Best-effort: mark as error (don't abort the loop on mutation failure)
|
|
379
|
+
await ctx.deps.backend
|
|
380
|
+
.mutation(api.workspaces.updateRequestStatus, {
|
|
381
|
+
sessionId: ctx.sessionId,
|
|
382
|
+
requestId: req._id,
|
|
383
|
+
status: 'error',
|
|
384
|
+
})
|
|
385
|
+
.catch(() => { });
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=git-subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-subscription.js","sourceRoot":"","sources":["../../../../src/commands/machine/daemon-start/git-subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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AAG;gBAClB,MAAM,EAAE,OAAO;aAChB,CAAC;iBACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-subscription.test.d.ts","sourceRoot":"","sources":["../../../../src/commands/machine/daemon-start/git-subscription.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { describe, test, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { processRequests } from './git-subscription.js';
|
|
3
|
+
// ─── Test Helpers ────────────────────────────────────────────────────────────
|
|
4
|
+
/** Create a minimal mock DaemonContext with spied backend methods. */
|
|
5
|
+
function makeMockContext() {
|
|
6
|
+
return {
|
|
7
|
+
client: null,
|
|
8
|
+
sessionId: 'test-session',
|
|
9
|
+
machineId: 'test-machine',
|
|
10
|
+
config: null,
|
|
11
|
+
events: {},
|
|
12
|
+
agentServices: new Map(),
|
|
13
|
+
lastPushedGitState: new Map(),
|
|
14
|
+
deps: {
|
|
15
|
+
backend: {
|
|
16
|
+
mutation: vi.fn().mockResolvedValue(undefined),
|
|
17
|
+
query: vi.fn().mockResolvedValue([]),
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Create a fake pending request with the given ID and type. */
|
|
23
|
+
function makeRequest(id, requestType = 'full_diff', extra = {}) {
|
|
24
|
+
return {
|
|
25
|
+
_id: id,
|
|
26
|
+
machineId: 'test-machine',
|
|
27
|
+
workingDir: '/test/repo',
|
|
28
|
+
requestType,
|
|
29
|
+
status: 'pending',
|
|
30
|
+
requestedAt: Date.now(),
|
|
31
|
+
updatedAt: Date.now(),
|
|
32
|
+
...extra,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// ─── Tests ───────────────────────────────────────────────────────────────────
|
|
36
|
+
describe('processRequests', () => {
|
|
37
|
+
let ctx;
|
|
38
|
+
let processedRequestIds;
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
ctx = makeMockContext();
|
|
41
|
+
processedRequestIds = new Map();
|
|
42
|
+
});
|
|
43
|
+
test('processes new requests and marks them in dedup map', async () => {
|
|
44
|
+
const requests = [makeRequest('req-1'), makeRequest('req-2')];
|
|
45
|
+
// Mock git operations to avoid actual git calls
|
|
46
|
+
vi.doMock('../../../infrastructure/git/git-reader.js', () => ({
|
|
47
|
+
getFullDiff: vi.fn().mockResolvedValue({ status: 'not_found' }),
|
|
48
|
+
getDiffStat: vi
|
|
49
|
+
.fn()
|
|
50
|
+
.mockResolvedValue({
|
|
51
|
+
status: 'available',
|
|
52
|
+
diffStat: { filesChanged: 0, insertions: 0, deletions: 0 },
|
|
53
|
+
}),
|
|
54
|
+
}));
|
|
55
|
+
await processRequests(ctx, requests, processedRequestIds, 5 * 60 * 1000);
|
|
56
|
+
expect(processedRequestIds.has('req-1')).toBe(true);
|
|
57
|
+
expect(processedRequestIds.has('req-2')).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
test('skips already-processed requests (dedup)', async () => {
|
|
60
|
+
// Pre-populate dedup map
|
|
61
|
+
processedRequestIds.set('req-1', Date.now());
|
|
62
|
+
const requests = [makeRequest('req-1'), makeRequest('req-2')];
|
|
63
|
+
await processRequests(ctx, requests, processedRequestIds, 5 * 60 * 1000);
|
|
64
|
+
// req-1 should have been skipped — only req-2 should trigger updateRequestStatus
|
|
65
|
+
const mutationCalls = ctx.deps.backend.mutation.mock.calls;
|
|
66
|
+
// req-2: mark processing, upsertFullDiff, mark done = 3 calls
|
|
67
|
+
// (req-1 was skipped entirely)
|
|
68
|
+
const processingCalls = mutationCalls.filter((call) => {
|
|
69
|
+
const args = call[1];
|
|
70
|
+
return args?.requestId === 'req-1' && args?.status === 'processing';
|
|
71
|
+
});
|
|
72
|
+
expect(processingCalls.length).toBe(0);
|
|
73
|
+
});
|
|
74
|
+
test('evicts stale dedup entries older than TTL', async () => {
|
|
75
|
+
const DEDUP_TTL_MS = 100; // Short TTL for testing
|
|
76
|
+
// Add an old entry
|
|
77
|
+
processedRequestIds.set('old-req', Date.now() - 200);
|
|
78
|
+
// Add a fresh entry
|
|
79
|
+
processedRequestIds.set('fresh-req', Date.now());
|
|
80
|
+
await processRequests(ctx, [], processedRequestIds, DEDUP_TTL_MS);
|
|
81
|
+
expect(processedRequestIds.has('old-req')).toBe(false);
|
|
82
|
+
expect(processedRequestIds.has('fresh-req')).toBe(true);
|
|
83
|
+
});
|
|
84
|
+
test('does not evict entries within TTL', async () => {
|
|
85
|
+
const DEDUP_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
86
|
+
processedRequestIds.set('recent-req', Date.now() - 1000); // 1 second ago
|
|
87
|
+
await processRequests(ctx, [], processedRequestIds, DEDUP_TTL_MS);
|
|
88
|
+
expect(processedRequestIds.has('recent-req')).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
test('marks failed requests as error status', async () => {
|
|
91
|
+
const requests = [makeRequest('req-fail')];
|
|
92
|
+
// Make the first mutation (mark processing) succeed,
|
|
93
|
+
// then the processing itself will fail because git-reader isn't mocked
|
|
94
|
+
const mutationFn = ctx.deps.backend.mutation;
|
|
95
|
+
mutationFn.mockResolvedValue(undefined);
|
|
96
|
+
// processFullDiff will throw because getFullDiff is not available in test context
|
|
97
|
+
// The catch block should mark it as error
|
|
98
|
+
await processRequests(ctx, requests, processedRequestIds, 5 * 60 * 1000);
|
|
99
|
+
// The request should still be in the dedup map (it was attempted)
|
|
100
|
+
expect(processedRequestIds.has('req-fail')).toBe(true);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=git-subscription.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-subscription.test.js","sourceRoot":"","sources":["../../../../src/commands/machine/daemon-start/git-subscription.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE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AAC,CAAC,eAAe;QAEzE,MAAM,eAAe,CAAC,GAAG,EAAE,EAAE,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC;QAElE,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,QAAQ,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;QAE3C,qDAAqD;QACrD,uEAAuE;QACvE,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAoC,CAAC;QACzE,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAExC,kFAAkF;QAClF,0CAA0C;QAC1C,MAAM,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAEzE,kEAAkE;QAClE,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Runner — handles command.run and command.stop events from the daemon event stream.
|
|
3
|
+
*
|
|
4
|
+
* Spawns child processes, captures stdout/stderr, buffers output, and flushes
|
|
5
|
+
* to the backend every few seconds to minimize DB writes.
|
|
6
|
+
*/
|
|
7
|
+
import type { DaemonContext } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Handle a command.run event: spawn the process and set up output streaming.
|
|
10
|
+
*/
|
|
11
|
+
export declare function onCommandRun(ctx: DaemonContext, event: {
|
|
12
|
+
workingDir: string;
|
|
13
|
+
commandName: string;
|
|
14
|
+
script: string;
|
|
15
|
+
runId: any;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Handle a command.stop event: kill the running process.
|
|
19
|
+
*/
|
|
20
|
+
export declare function onCommandStop(ctx: DaemonContext, event: {
|
|
21
|
+
runId: any;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=command-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-runner.d.ts","sourceRoot":"","sources":["../../../../../src/commands/machine/daemon-start/handlers/command-runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAsG5D;;GAEG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE;IACL,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;CACZ,GACA,OAAO,CAAC,IAAI,CAAC,CA+Hf;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|