@cluesmith/codev 3.2.3 → 3.3.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/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
- package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-JCbkpAcV.js} +33 -33
- package/dashboard-dist/assets/index-JCbkpAcV.js.map +1 -0
- package/dashboard-dist/index.html +2 -2
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +173 -0
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/attach.js +2 -2
- package/dist/agent-farm/commands/attach.js.map +1 -1
- package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
- package/dist/agent-farm/commands/cleanup.js +16 -0
- package/dist/agent-farm/commands/cleanup.js.map +1 -1
- package/dist/agent-farm/commands/inbox.d.ts +42 -0
- package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
- package/dist/agent-farm/commands/inbox.js +129 -0
- package/dist/agent-farm/commands/inbox.js.map +1 -0
- package/dist/agent-farm/commands/interrupt.d.ts +20 -0
- package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
- package/dist/agent-farm/commands/interrupt.js +65 -0
- package/dist/agent-farm/commands/interrupt.js.map +1 -0
- package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
- package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/constants.js +52 -0
- package/dist/agent-farm/commands/reset/constants.js.map +1 -0
- package/dist/agent-farm/commands/reset/context.d.ts +230 -0
- package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/context.js +428 -0
- package/dist/agent-farm/commands/reset/context.js.map +1 -0
- package/dist/agent-farm/commands/reset/index.d.ts +192 -0
- package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/index.js +488 -0
- package/dist/agent-farm/commands/reset/index.js.map +1 -0
- package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
- package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/receipt.js +149 -0
- package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
- package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
- package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/reorient.js +313 -0
- package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
- package/dist/agent-farm/commands/reset.d.ts +19 -0
- package/dist/agent-farm/commands/reset.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset.js +292 -0
- package/dist/agent-farm/commands/reset.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts +2 -2
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +52 -11
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/setup.d.ts +4 -1
- package/dist/agent-farm/commands/setup.d.ts.map +1 -1
- package/dist/agent-farm/commands/setup.js +8 -4
- package/dist/agent-farm/commands/setup.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.d.ts +116 -6
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +345 -74
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +13 -1
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +105 -9
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/tower-sweep-husks.d.ts +6 -0
- package/dist/agent-farm/commands/tower-sweep-husks.d.ts.map +1 -0
- package/dist/agent-farm/commands/tower-sweep-husks.js +77 -0
- package/dist/agent-farm/commands/tower-sweep-husks.js.map +1 -0
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +34 -0
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/commands/whoami.d.ts +65 -0
- package/dist/agent-farm/commands/whoami.d.ts.map +1 -0
- package/dist/agent-farm/commands/whoami.js +196 -0
- package/dist/agent-farm/commands/whoami.js.map +1 -0
- package/dist/agent-farm/db/index.d.ts +1 -1
- package/dist/agent-farm/db/index.d.ts.map +1 -1
- package/dist/agent-farm/db/index.js +80 -1
- package/dist/agent-farm/db/index.js.map +1 -1
- package/dist/agent-farm/db/mailbox.d.ts +222 -0
- package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
- package/dist/agent-farm/db/mailbox.js +304 -0
- package/dist/agent-farm/db/mailbox.js.map +1 -0
- package/dist/agent-farm/db/schema.d.ts +1 -1
- package/dist/agent-farm/db/schema.d.ts.map +1 -1
- package/dist/agent-farm/db/schema.js +35 -0
- package/dist/agent-farm/db/schema.js.map +1 -1
- package/dist/agent-farm/db/types.d.ts +45 -0
- package/dist/agent-farm/db/types.d.ts.map +1 -1
- package/dist/agent-farm/db/types.js.map +1 -1
- package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
- package/dist/agent-farm/lib/builder-lookup.js +2 -2
- package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
- package/dist/agent-farm/lib/reconnect-backoff.d.ts +54 -0
- package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
- package/dist/agent-farm/lib/reconnect-backoff.js +47 -0
- package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
- package/dist/agent-farm/lib/tower-client.d.ts +16 -6
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tower-client.js +37 -6
- package/dist/agent-farm/lib/tower-client.js.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.js +218 -27
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- package/dist/agent-farm/servers/architect-session-holder.d.ts +133 -0
- package/dist/agent-farm/servers/architect-session-holder.d.ts.map +1 -0
- package/dist/agent-farm/servers/architect-session-holder.js +268 -0
- package/dist/agent-farm/servers/architect-session-holder.js.map +1 -0
- package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
- package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
- package/dist/agent-farm/servers/cron-delivery.js +80 -0
- package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
- package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
- package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
- package/dist/agent-farm/servers/delayed-send.js +165 -0
- package/dist/agent-farm/servers/delayed-send.js.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.js +113 -0
- package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
- package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
- package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
- package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
- package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
- package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
- package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
- package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
- package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
- package/dist/agent-farm/servers/message-write.d.ts +53 -1
- package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
- package/dist/agent-farm/servers/message-write.js +63 -0
- package/dist/agent-farm/servers/message-write.js.map +1 -1
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +23 -4
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/process-census.d.ts +41 -0
- package/dist/agent-farm/servers/process-census.d.ts.map +1 -0
- package/dist/agent-farm/servers/process-census.js +62 -0
- package/dist/agent-farm/servers/process-census.js.map +1 -0
- package/dist/agent-farm/servers/render-gate.d.ts +141 -0
- package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
- package/dist/agent-farm/servers/render-gate.js +251 -0
- package/dist/agent-farm/servers/render-gate.js.map +1 -0
- package/dist/agent-farm/servers/session-log-sweep.d.ts +93 -0
- package/dist/agent-farm/servers/session-log-sweep.d.ts.map +1 -0
- package/dist/agent-farm/servers/session-log-sweep.js +165 -0
- package/dist/agent-farm/servers/session-log-sweep.js.map +1 -0
- package/dist/agent-farm/servers/session-submit.d.ts +90 -0
- package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
- package/dist/agent-farm/servers/session-submit.js +127 -0
- package/dist/agent-farm/servers/session-submit.js.map +1 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.d.ts +87 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.d.ts.map +1 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.js +129 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.js.map +1 -0
- package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
- package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-cron.js +58 -53
- package/dist/agent-farm/servers/tower-cron.js.map +1 -1
- package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +128 -19
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
- package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-messages.js +106 -1
- package/dist/agent-farm/servers/tower-messages.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +807 -99
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +241 -15
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +17 -2
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +139 -124
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +63 -4
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/servers/tower-types.d.ts +2 -1
- package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.d.ts +99 -1
- package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.js +242 -6
- package/dist/agent-farm/servers/tower-utils.js.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +6 -21
- package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
- package/dist/agent-farm/servers/write-queue.d.ts +35 -0
- package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
- package/dist/agent-farm/servers/write-queue.js +56 -0
- package/dist/agent-farm/servers/write-queue.js.map +1 -0
- package/dist/agent-farm/state.d.ts +6 -1
- package/dist/agent-farm/state.d.ts.map +1 -1
- package/dist/agent-farm/state.js +5 -2
- package/dist/agent-farm/state.js.map +1 -1
- package/dist/agent-farm/types.d.ts +39 -0
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.d.ts +2 -2
- package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.js +3 -3
- package/dist/agent-farm/utils/agent-names.js.map +1 -1
- package/dist/agent-farm/utils/architect-name.d.ts +2 -2
- package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
- package/dist/agent-farm/utils/architect-name.js +3 -3
- package/dist/agent-farm/utils/architect-name.js.map +1 -1
- package/dist/agent-farm/utils/config.d.ts +13 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +33 -1
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/harness.d.ts +103 -7
- package/dist/agent-farm/utils/harness.d.ts.map +1 -1
- package/dist/agent-farm/utils/harness.js +126 -19
- package/dist/agent-farm/utils/harness.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -32
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts +3 -2
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +7 -6
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/consult/agy-auth-cache.d.ts +97 -0
- package/dist/commands/consult/agy-auth-cache.d.ts.map +1 -0
- package/dist/commands/consult/agy-auth-cache.js +320 -0
- package/dist/commands/consult/agy-auth-cache.js.map +1 -0
- package/dist/commands/consult/cli-options.d.ts +34 -0
- package/dist/commands/consult/cli-options.d.ts.map +1 -0
- package/dist/commands/consult/cli-options.js +67 -0
- package/dist/commands/consult/cli-options.js.map +1 -0
- package/dist/commands/consult/index.d.ts +56 -2
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +330 -27
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/consult/metrics.d.ts +42 -0
- package/dist/commands/consult/metrics.d.ts.map +1 -1
- package/dist/commands/consult/metrics.js +129 -9
- package/dist/commands/consult/metrics.js.map +1 -1
- package/dist/commands/doctor.d.ts +28 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +258 -22
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +3 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/porch/checks.d.ts +23 -0
- package/dist/commands/porch/checks.d.ts.map +1 -1
- package/dist/commands/porch/checks.js +60 -0
- package/dist/commands/porch/checks.js.map +1 -1
- package/dist/commands/porch/config.d.ts +20 -0
- package/dist/commands/porch/config.d.ts.map +1 -1
- package/dist/commands/porch/config.js +20 -0
- package/dist/commands/porch/config.js.map +1 -1
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +32 -36
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +2 -41
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/commands/update.d.ts +4 -4
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +9 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/config.d.ts +70 -3
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +67 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/consult-lanes.d.ts +149 -0
- package/dist/lib/consult-lanes.d.ts.map +1 -0
- package/dist/lib/consult-lanes.js +360 -0
- package/dist/lib/consult-lanes.js.map +1 -0
- package/dist/lib/default-branch.d.ts +1 -1
- package/dist/lib/default-branch.js +1 -1
- package/dist/lib/github.js +1 -1
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/gitignore.d.ts +25 -2
- package/dist/lib/gitignore.d.ts.map +1 -1
- package/dist/lib/gitignore.js +70 -0
- package/dist/lib/gitignore.js.map +1 -1
- package/dist/lib/migration-backup-audit.d.ts +64 -0
- package/dist/lib/migration-backup-audit.d.ts.map +1 -0
- package/dist/lib/migration-backup-audit.js +145 -0
- package/dist/lib/migration-backup-audit.js.map +1 -0
- package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
- package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
- package/dist/lib/prompt-behavior-metrics.js +290 -0
- package/dist/lib/prompt-behavior-metrics.js.map +1 -0
- package/dist/lib/protocol-drift-audit.d.ts +118 -0
- package/dist/lib/protocol-drift-audit.d.ts.map +1 -0
- package/dist/lib/protocol-drift-audit.js +217 -0
- package/dist/lib/protocol-drift-audit.js.map +1 -0
- package/dist/lib/scaffold.d.ts +10 -3
- package/dist/lib/scaffold.d.ts.map +1 -1
- package/dist/lib/scaffold.js +29 -26
- package/dist/lib/scaffold.js.map +1 -1
- package/dist/lib/skeleton.d.ts +22 -1
- package/dist/lib/skeleton.d.ts.map +1 -1
- package/dist/lib/skeleton.js +120 -0
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/test-env.d.ts +74 -0
- package/dist/lib/test-env.d.ts.map +1 -0
- package/dist/lib/test-env.js +92 -0
- package/dist/lib/test-env.js.map +1 -0
- package/dist/terminal/pty-manager.d.ts +9 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +32 -6
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +156 -4
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +307 -42
- package/dist/terminal/pty-session.js.map +1 -1
- package/dist/terminal/ring-buffer.d.ts +39 -6
- package/dist/terminal/ring-buffer.d.ts.map +1 -1
- package/dist/terminal/ring-buffer.js +74 -6
- package/dist/terminal/ring-buffer.js.map +1 -1
- package/dist/terminal/session-manager.d.ts +129 -0
- package/dist/terminal/session-manager.d.ts.map +1 -1
- package/dist/terminal/session-manager.js +337 -44
- package/dist/terminal/session-manager.js.map +1 -1
- package/dist/terminal/session-screen.d.ts +91 -0
- package/dist/terminal/session-screen.d.ts.map +1 -0
- package/dist/terminal/session-screen.js +135 -0
- package/dist/terminal/session-screen.js.map +1 -0
- package/dist/terminal/shellper-client.d.ts +19 -4
- package/dist/terminal/shellper-client.d.ts.map +1 -1
- package/dist/terminal/shellper-client.js +70 -8
- package/dist/terminal/shellper-client.js.map +1 -1
- package/dist/terminal/shellper-main.js +2 -1
- package/dist/terminal/shellper-main.js.map +1 -1
- package/dist/terminal/shellper-process.d.ts +1 -1
- package/dist/terminal/shellper-process.d.ts.map +1 -1
- package/dist/terminal/shellper-process.js +33 -9
- package/dist/terminal/shellper-process.js.map +1 -1
- package/dist/terminal/shellper-protocol.d.ts +40 -2
- package/dist/terminal/shellper-protocol.d.ts.map +1 -1
- package/dist/terminal/shellper-protocol.js +72 -5
- package/dist/terminal/shellper-protocol.js.map +1 -1
- package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
- package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
- package/dist/terminal/shellper-replay-buffer.js +167 -31
- package/dist/terminal/shellper-replay-buffer.js.map +1 -1
- package/package.json +11 -9
- package/skeleton/.claude/skills/afx/SKILL.md +27 -1
- package/skeleton/.claude/skills/arch-init/SKILL.md +135 -0
- package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.claude/skills/codev/SKILL.md +33 -2
- package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/.codex/skills/afx/SKILL.md +170 -0
- package/skeleton/.codex/skills/arch-init/SKILL.md +135 -0
- package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.codex/skills/codev/SKILL.md +90 -0
- package/skeleton/.codex/skills/consult/SKILL.md +96 -0
- package/skeleton/.codex/skills/generate-image/SKILL.md +45 -0
- package/skeleton/.codex/skills/porch/SKILL.md +60 -0
- package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/.codex/skills/update-arch-docs/SKILL.md +132 -0
- package/skeleton/protocols/air/builder-prompt.md +28 -47
- package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
- package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
- package/skeleton/protocols/air/prompts/implement.md +20 -73
- package/skeleton/protocols/air/prompts/pr.md +22 -54
- package/skeleton/protocols/air/protocol.md +40 -71
- package/skeleton/protocols/aspir/builder-prompt.md +29 -66
- package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
- package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
- package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
- package/skeleton/protocols/aspir/prompts/implement.md +27 -196
- package/skeleton/protocols/aspir/prompts/plan.md +21 -85
- package/skeleton/protocols/aspir/prompts/review.md +29 -228
- package/skeleton/protocols/aspir/prompts/specify.md +25 -111
- package/skeleton/protocols/aspir/protocol.json +10 -0
- package/skeleton/protocols/aspir/protocol.md +36 -82
- package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
- package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
- package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
- package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
- package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
- package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
- package/skeleton/protocols/bugfix/protocol.md +44 -50
- package/skeleton/protocols/experiment/builder-prompt.md +25 -58
- package/skeleton/protocols/experiment/protocol.md +22 -188
- package/skeleton/protocols/experiment/templates/notes.md +11 -71
- package/skeleton/protocols/maintain/builder-prompt.md +24 -45
- package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
- package/skeleton/protocols/maintain/protocol.md +32 -266
- package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
- package/skeleton/protocols/pir/builder-prompt.md +30 -64
- package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
- package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
- package/skeleton/protocols/pir/prompts/implement.md +1 -2
- package/skeleton/protocols/pir/prompts/plan.md +0 -3
- package/skeleton/protocols/pir/prompts/review.md +1 -1
- package/skeleton/protocols/pir/protocol.md +54 -177
- package/skeleton/protocols/research/builder-prompt.md +27 -58
- package/skeleton/protocols/research/protocol.md +28 -153
- package/skeleton/protocols/spike/builder-prompt.md +30 -48
- package/skeleton/protocols/spike/protocol.md +24 -107
- package/skeleton/protocols/spike/templates/findings.md +9 -39
- package/skeleton/protocols/spir/builder-prompt.md +33 -62
- package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
- package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
- package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
- package/skeleton/protocols/spir/prompts/implement.md +26 -195
- package/skeleton/protocols/spir/prompts/plan.md +20 -84
- package/skeleton/protocols/spir/prompts/review.md +28 -227
- package/skeleton/protocols/spir/prompts/specify.md +24 -110
- package/skeleton/protocols/spir/protocol.json +10 -0
- package/skeleton/protocols/spir/protocol.md +84 -633
- package/skeleton/protocols/spir/templates/plan.md +28 -147
- package/skeleton/protocols/spir/templates/review.md +21 -80
- package/skeleton/protocols/spir/templates/spec.md +24 -118
- package/skeleton/resources/commands/agent-farm.md +348 -0
- package/skeleton/resources/commands/codev.md +5 -0
- package/skeleton/resources/commands/consult.md +262 -8
- package/skeleton/resources/commands/overview.md +1 -0
- package/skeleton/roles/architect.md +67 -306
- package/skeleton/roles/builder.md +77 -191
- package/skeleton/templates/AGENTS.md +2 -0
- package/skeleton/templates/CLAUDE.md +2 -0
- package/templates/tower.html +39 -2
- package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
- package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
- package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
- package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
- package/dist/agent-farm/servers/send-buffer.js +0 -103
- package/dist/agent-farm/servers/send-buffer.js.map +0 -1
- package/skeleton/porch/prompts/defend.md +0 -108
- package/skeleton/porch/prompts/diagnose.md +0 -70
- package/skeleton/porch/prompts/evaluate.md +0 -132
- package/skeleton/porch/prompts/fix.md +0 -59
- package/skeleton/porch/prompts/implement.md +0 -88
- package/skeleton/porch/prompts/plan.md +0 -74
- package/skeleton/porch/prompts/pr.md +0 -84
- package/skeleton/porch/prompts/review.md +0 -249
- package/skeleton/porch/prompts/specify.md +0 -53
- package/skeleton/porch/prompts/test.md +0 -63
- package/skeleton/protocols/aspir/templates/plan.md +0 -184
- package/skeleton/protocols/aspir/templates/review.md +0 -120
- package/skeleton/protocols/aspir/templates/spec.md +0 -154
|
@@ -2,15 +2,37 @@
|
|
|
2
2
|
* Fixed-size circular buffer for storing terminal output lines.
|
|
3
3
|
* Used for reconnection replay — stores last N lines in memory.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Ceiling on the incomplete-line partial (#1205). Sits between the 1MB replay
|
|
7
|
+
* seed and the 4MB level at which Tower's partial monitor warns, so a partial
|
|
8
|
+
* that trips this cap is already far past anything a viewer needs.
|
|
9
|
+
*/
|
|
10
|
+
const MAX_PARTIAL_CHARS = 2 * 1024 * 1024;
|
|
11
|
+
/** Bound on how far past a trim point we scan for an ESC to align to. */
|
|
12
|
+
const ESC_ALIGN_SCAN_LIMIT = 4096;
|
|
13
|
+
/**
|
|
14
|
+
* Nudge a trim offset forward to the next ESC, so the retained tail doesn't
|
|
15
|
+
* begin partway through an escape sequence. Falls back to the raw offset when
|
|
16
|
+
* no ESC is within the scan window.
|
|
17
|
+
*/
|
|
18
|
+
function alignToEscape(text, offset) {
|
|
19
|
+
const found = text.indexOf('\x1b', offset);
|
|
20
|
+
if (found !== -1 && found - offset <= ESC_ALIGN_SCAN_LIMIT)
|
|
21
|
+
return found;
|
|
22
|
+
return offset;
|
|
23
|
+
}
|
|
5
24
|
export class RingBuffer {
|
|
6
25
|
capacity;
|
|
26
|
+
maxPartialChars;
|
|
7
27
|
buffer;
|
|
8
28
|
head = 0;
|
|
9
29
|
count = 0;
|
|
10
30
|
seq = 0; // monotonically increasing sequence number
|
|
11
31
|
partial = ''; // incomplete line from previous pushData call
|
|
12
|
-
|
|
32
|
+
bytes = 0; // cumulative chars ever appended via pushData (monotone; see bytesWritten)
|
|
33
|
+
constructor(capacity = 1000, maxPartialChars = MAX_PARTIAL_CHARS) {
|
|
13
34
|
this.capacity = capacity;
|
|
35
|
+
this.maxPartialChars = maxPartialChars;
|
|
14
36
|
this.buffer = new Array(capacity);
|
|
15
37
|
}
|
|
16
38
|
/** Push a complete line into the buffer. Returns the assigned sequence number. */
|
|
@@ -33,15 +55,28 @@ export class RingBuffer {
|
|
|
33
55
|
* Scans only the incoming `data` for newlines (never re-splits the whole
|
|
34
56
|
* accumulated `partial + data`), so per-call work is O(|data|) rather than
|
|
35
57
|
* O(|partial|) — the O(n²) re-scan that pegged Tower's CPU on no-newline
|
|
36
|
-
* full-screen-TUI streams (Issue #1047).
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
58
|
+
* full-screen-TUI streams (Issue #1047).
|
|
59
|
+
*
|
|
60
|
+
* The `partial` was originally kept whole and unbounded, on the reasoning
|
|
61
|
+
* that a TUI in the alternate screen buffer encodes its state in the
|
|
62
|
+
* cumulative byte stream from the alt-screen-enter onward, so truncating the
|
|
63
|
+
* front would corrupt the replay. That is true, but the growth it licensed
|
|
64
|
+
* was unbounded for the life of the session (#1205), and every layer above
|
|
65
|
+
* already accepts exactly this trade: the replay seed, the send cap, and the
|
|
66
|
+
* frame-skip path are all lossy tail-cuts that rely on the client's
|
|
67
|
+
* post-connect repaint nudge. So the partial is now capped too, with cuts
|
|
68
|
+
* ESC-aligned to avoid starting the tail inside an escape sequence.
|
|
41
69
|
*
|
|
42
70
|
* Returns last sequence number.
|
|
43
71
|
*/
|
|
44
72
|
pushData(data) {
|
|
73
|
+
// Monotone total of every char ever fed in (Spec 1313 render-gate round 2). Advances
|
|
74
|
+
// here — before any split/trim — so it counts ALL output regardless of newlines, and
|
|
75
|
+
// NEVER decreases (unlike `partialBytes`, which drops when `trimPartial` cuts the front).
|
|
76
|
+
// It is the render-gate's change token: the mailbox delivery path samples it around the
|
|
77
|
+
// async classify to detect a mid-render keystroke, and the verdict memo keys on it. A
|
|
78
|
+
// decreasing signal would let two different screens share a token and alias a stale verdict.
|
|
79
|
+
this.bytes += data.length;
|
|
45
80
|
let start = 0;
|
|
46
81
|
let nl = data.indexOf('\n');
|
|
47
82
|
while (nl !== -1) {
|
|
@@ -54,9 +89,27 @@ export class RingBuffer {
|
|
|
54
89
|
// Remainder has no newline — append to the partial (cons-string, O(|data|)).
|
|
55
90
|
if (start < data.length) {
|
|
56
91
|
this.partial += data.slice(start);
|
|
92
|
+
this.trimPartial();
|
|
57
93
|
}
|
|
58
94
|
return this.seq;
|
|
59
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Enforce the partial ceiling, keeping the most recent characters.
|
|
98
|
+
*
|
|
99
|
+
* Trimming back to *half* the ceiling rather than exactly to it is what makes
|
|
100
|
+
* this affordable. Cutting to the ceiling would put the partial back over it
|
|
101
|
+
* on the very next append, so every subsequent call would copy the whole
|
|
102
|
+
* multi-megabyte partial: an O(|partial|)-per-call cost on the hot path that
|
|
103
|
+
* #1047 specifically restructured to be O(|data|). Halving amortises the copy
|
|
104
|
+
* over the next half-ceiling of growth, giving O(1) per byte, and bounds the
|
|
105
|
+
* partial at the ceiling rather than letting it drift above it.
|
|
106
|
+
*/
|
|
107
|
+
trimPartial() {
|
|
108
|
+
if (this.partial.length <= this.maxPartialChars)
|
|
109
|
+
return;
|
|
110
|
+
const target = Math.floor(this.maxPartialChars / 2);
|
|
111
|
+
this.partial = this.partial.slice(alignToEscape(this.partial, this.partial.length - target));
|
|
112
|
+
}
|
|
60
113
|
/** Get all stored lines in order, including any incomplete trailing line. */
|
|
61
114
|
getAll() {
|
|
62
115
|
const result = [];
|
|
@@ -110,6 +163,21 @@ export class RingBuffer {
|
|
|
110
163
|
get partialBytes() {
|
|
111
164
|
return this.partial.length;
|
|
112
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Cumulative chars ever appended via `pushData` (Spec 1313 render-gate round 2).
|
|
168
|
+
*
|
|
169
|
+
* Monotonically non-decreasing: it counts every byte of output for the life of the
|
|
170
|
+
* session and is NEVER reset by `trimPartial` (which drops `partialBytes`) nor by
|
|
171
|
+
* `clear()` (which keeps `seq` for the same monotonicity reason). That is exactly the
|
|
172
|
+
* property the render-gate's change token needs — `(currentSeq, partialBytes)` was
|
|
173
|
+
* non-monotone once #1205 capped the partial (a trim makes `partialBytes` fall, so two
|
|
174
|
+
* distinct screens could produce the same token and alias a stale memoized verdict).
|
|
175
|
+
* `bytesWritten` advances on ANY output and can never collide, so an unchanged value is
|
|
176
|
+
* a sound proof that the classified screen has not moved.
|
|
177
|
+
*/
|
|
178
|
+
get bytesWritten() {
|
|
179
|
+
return this.bytes;
|
|
180
|
+
}
|
|
113
181
|
/** Clear the buffer and release memory. */
|
|
114
182
|
clear() {
|
|
115
183
|
this.buffer = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ring-buffer.js","sourceRoot":"","sources":["../../src/terminal/ring-buffer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,OAAO,UAAU;
|
|
1
|
+
{"version":3,"file":"ring-buffer.js","sourceRoot":"","sources":["../../src/terminal/ring-buffer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC;;;;GAIG;AACH,SAAS,aAAa,CAAC,IAAY,EAAE,MAAc;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,MAAM,IAAI,oBAAoB;QAA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CAAC;IACpB,CAAC;IAED,wEAAwE;IACxE,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,2CAA2C;IAC3C,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,2CAA2C;IAC7C,CAAC;CACF"}
|
|
@@ -30,6 +30,41 @@ export interface CrashLoopFallback {
|
|
|
30
30
|
/** Fired once when the fallback is applied (caller repairs persisted state, logs). */
|
|
31
31
|
onApply?: () => void;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Issue #1264: how to relaunch the harness after a *clean* exit.
|
|
35
|
+
*
|
|
36
|
+
* A clean exit means the user ended the harness on purpose (double Ctrl-C,
|
|
37
|
+
* `/quit`, `exit`). The session and its shellper survive that — only the
|
|
38
|
+
* harness is rerun, and it is rerun **without recovery**: a fresh
|
|
39
|
+
* conversation, not a `--resume` of the one just abandoned. Restarting a
|
|
40
|
+
* crash is the opposite: that one *should* resume, which is what recovery
|
|
41
|
+
* exists for.
|
|
42
|
+
*
|
|
43
|
+
* A factory rather than a precomputed arg list, because every clean exit
|
|
44
|
+
* starts a genuinely new conversation and so needs its own freshly minted
|
|
45
|
+
* session id. This layer stays agnostic of what the args mean; the caller
|
|
46
|
+
* mints, persists, and returns them.
|
|
47
|
+
*
|
|
48
|
+
* Returning null (or omitting the option entirely) means "relaunch with the
|
|
49
|
+
* args as they stand" — correct for sessions that have no recovery concept,
|
|
50
|
+
* such as plain shells.
|
|
51
|
+
*
|
|
52
|
+
* Returning `{ stop: true }` means "do NOT relaunch — end the session instead."
|
|
53
|
+
* next() can only influence the args/env; the launch `command` is retained by
|
|
54
|
+
* SessionManager. So when the harness has become invalid since launch (Issue
|
|
55
|
+
* #1338: a retired harness, whose retained command may itself be the retired
|
|
56
|
+
* binary), rerunning would be fail-open. `stop` lets the factory fail closed:
|
|
57
|
+
* SessionManager tears the session down with a visible reason rather than
|
|
58
|
+
* respawning the retired command.
|
|
59
|
+
*/
|
|
60
|
+
export interface FreshLaunch {
|
|
61
|
+
next: () => {
|
|
62
|
+
args: string[];
|
|
63
|
+
env?: Record<string, string>;
|
|
64
|
+
} | {
|
|
65
|
+
stop: true;
|
|
66
|
+
} | null;
|
|
67
|
+
}
|
|
33
68
|
export interface CreateSessionOptions {
|
|
34
69
|
sessionId: string;
|
|
35
70
|
command: string;
|
|
@@ -43,6 +78,7 @@ export interface CreateSessionOptions {
|
|
|
43
78
|
maxRestarts?: number;
|
|
44
79
|
restartResetAfter?: number;
|
|
45
80
|
crashLoopFallback?: CrashLoopFallback;
|
|
81
|
+
freshLaunch?: FreshLaunch;
|
|
46
82
|
}
|
|
47
83
|
export interface ReconnectRestartOptions {
|
|
48
84
|
command: string;
|
|
@@ -53,11 +89,38 @@ export interface ReconnectRestartOptions {
|
|
|
53
89
|
maxRestarts?: number;
|
|
54
90
|
restartResetAfter?: number;
|
|
55
91
|
crashLoopFallback?: CrashLoopFallback;
|
|
92
|
+
freshLaunch?: FreshLaunch;
|
|
56
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Issue #1264 safety valve. Clean-exit reruns are deliberately unlimited —
|
|
96
|
+
* quitting your agent is a gesture, not a failure, and a long-lived architect
|
|
97
|
+
* can out-quit any budget. But "unlimited" must not become an infinite spawn
|
|
98
|
+
* loop when the harness is broken rather than being quit: a misconfigured
|
|
99
|
+
* command that exits 0 immediately would otherwise respawn forever.
|
|
100
|
+
*
|
|
101
|
+
* A human cannot produce a deliberate quit within a couple of seconds of the
|
|
102
|
+
* harness starting, so a clean exit that fast is evidence of a broken command,
|
|
103
|
+
* not a gesture. Only those count, and only consecutively — a single fast exit
|
|
104
|
+
* followed by a healthy session resets the counter. This restores the bound
|
|
105
|
+
* that both #1241 (end the session) and pre-3.2.4 (maxRestarts) had, without
|
|
106
|
+
* charging real gestures for it.
|
|
107
|
+
*/
|
|
108
|
+
export declare const FAST_CLEAN_EXIT_MS = 2000;
|
|
109
|
+
export declare const MAX_FAST_CLEAN_EXITS = 5;
|
|
57
110
|
/** Failing exits inside this window count toward crash-loop detection. */
|
|
58
111
|
export declare const CRASH_LOOP_WINDOW_MS = 30000;
|
|
59
112
|
/** Failing exits within the window needed to declare a crash loop. */
|
|
60
113
|
export declare const CRASH_LOOP_THRESHOLD = 3;
|
|
114
|
+
/**
|
|
115
|
+
* #1198 in-place reconnect tuning. When a session's socket closes without an
|
|
116
|
+
* EXIT frame but the shellper process is still alive, the connection is
|
|
117
|
+
* re-established instead of tearing the session down: backoff per attempt
|
|
118
|
+
* within one recovery round, a stability window that resets the round
|
|
119
|
+
* counter, and a cap on consecutive unstable rounds.
|
|
120
|
+
*/
|
|
121
|
+
export declare const RECONNECT_BACKOFF_MS: number[];
|
|
122
|
+
export declare const RECONNECT_STABILITY_MS = 30000;
|
|
123
|
+
export declare const MAX_RECOVERY_ROUNDS = 3;
|
|
61
124
|
/**
|
|
62
125
|
* Issue #1149: true when the recorded failing-exit timestamps amount to a
|
|
63
126
|
* crash loop (>= CRASH_LOOP_THRESHOLD failures inside the trailing
|
|
@@ -90,11 +153,49 @@ export declare class SessionManager extends EventEmitter {
|
|
|
90
153
|
private sessions;
|
|
91
154
|
private readonly log;
|
|
92
155
|
constructor(config: SessionManagerConfig);
|
|
156
|
+
/**
|
|
157
|
+
* This instance's socket directory. Issue #1227: the husk sweep and fleet
|
|
158
|
+
* observability route handlers need it to reuse the exact scope-marker
|
|
159
|
+
* technique findShellperProcesses() uses, so they never touch (or count)
|
|
160
|
+
* another Tower instance's shellpers.
|
|
161
|
+
*/
|
|
162
|
+
get socketDir(): string;
|
|
93
163
|
/**
|
|
94
164
|
* Spawn a new shellper process and connect to it.
|
|
95
165
|
* Returns the connected client.
|
|
96
166
|
*/
|
|
97
167
|
createSession(opts: CreateSessionOptions): Promise<IShellperClient>;
|
|
168
|
+
/**
|
|
169
|
+
* Subscribe to a session client's lifecycle events (exit, error, close) and
|
|
170
|
+
* set up auto-restart when configured. Called on session creation, on
|
|
171
|
+
* reconnection after a Tower restart, and again for the replacement client
|
|
172
|
+
* after an in-place reconnect (#1198), so all three paths behave identically.
|
|
173
|
+
*/
|
|
174
|
+
private wireClientEvents;
|
|
175
|
+
/**
|
|
176
|
+
* #1198: attempt to re-establish a session's shellper connection after an
|
|
177
|
+
* unexpected socket close. The shellper protocol is built for reconnection
|
|
178
|
+
* (that is how sessions survive Tower restarts), so a transient socket
|
|
179
|
+
* error must not tear down a healthy shellper: doing so unlinks the live
|
|
180
|
+
* socket and orphans the process. Falls through to the historical
|
|
181
|
+
* dead-session path when the process is gone or every attempt fails.
|
|
182
|
+
*/
|
|
183
|
+
private recoverSession;
|
|
184
|
+
/**
|
|
185
|
+
* Whether the session's recorded shellper process is still the one running
|
|
186
|
+
* under its PID: alive, and with a matching start time (guards PID reuse).
|
|
187
|
+
*/
|
|
188
|
+
private isShellperProcessCurrent;
|
|
189
|
+
/**
|
|
190
|
+
* Whether an in-place reconnect can possibly succeed: the shellper process
|
|
191
|
+
* is current (alive, same start time) and its socket file still exists.
|
|
192
|
+
*/
|
|
193
|
+
private canReachShellper;
|
|
194
|
+
/**
|
|
195
|
+
* The historical unexpected-death path: remove the session, clean up its
|
|
196
|
+
* socket, and emit 'session-error' so the Tower layer can log the loss.
|
|
197
|
+
*/
|
|
198
|
+
private declareSessionDead;
|
|
98
199
|
/**
|
|
99
200
|
* Reconnect to an existing shellper process after Tower restart.
|
|
100
201
|
* Validates PID is alive and start time matches.
|
|
@@ -170,7 +271,35 @@ export declare class SessionManager extends EventEmitter {
|
|
|
170
271
|
* Remove a dead session from the map, clear its timers, and clean up socket.
|
|
171
272
|
* Called when a session exits naturally (no restart) or exhausts maxRestarts.
|
|
172
273
|
*/
|
|
274
|
+
/**
|
|
275
|
+
* Removal for sessions whose CHILD process ended (clean exit, or restart
|
|
276
|
+
* exhaustion). The shellper deliberately lingers after its child exits to
|
|
277
|
+
* serve late connections (#905), so it is a spent husk here: unlink the
|
|
278
|
+
* socket unconditionally — that is what marks the lingering shellper
|
|
279
|
+
* unresponsive so killOrphanedShellpers reaps it. Preserving the socket on
|
|
280
|
+
* this path leaks an immortal empty shellper per exited session (#1198
|
|
281
|
+
* e2e regression).
|
|
282
|
+
*/
|
|
173
283
|
private removeDeadSession;
|
|
284
|
+
/**
|
|
285
|
+
* #1198: removal for sessions whose CONNECTION died (recovery exhausted or
|
|
286
|
+
* shellper unreachable). Unlike the child-exit path, the shellper may
|
|
287
|
+
* still host a live conversation, and unlinking a live shellper's socket
|
|
288
|
+
* makes it unreachable AND flags it for the orphan sweeper's kill path —
|
|
289
|
+
* so this path preserves the socket while the recorded process is current,
|
|
290
|
+
* degrading to a recoverable orphan (re-adoptable, attachable), never a
|
|
291
|
+
* killed live process.
|
|
292
|
+
*/
|
|
293
|
+
private removeUnreachableSession;
|
|
294
|
+
private detachSessionFromMap;
|
|
295
|
+
/**
|
|
296
|
+
* Socket cleanup for the connection-failure path: unlink only when the
|
|
297
|
+
* recorded shellper process is gone. The check uses the same start-time
|
|
298
|
+
* guard as reconnection, so a reused PID counts as "gone" and a dead
|
|
299
|
+
* shellper's socket/log files do not leak. Async and best-effort by
|
|
300
|
+
* design; the map mutation stays sync in the caller.
|
|
301
|
+
*/
|
|
302
|
+
private cleanupDeadSessionSocket;
|
|
174
303
|
private getSocketPath;
|
|
175
304
|
private unlinkSocketIfExists;
|
|
176
305
|
private readShellperInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/terminal/session-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAAE,YAA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