@ai-devkit/agent-manager 0.42.3 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentManager.d.ts +14 -5
- package/dist/AgentManager.d.ts.map +1 -1
- package/dist/AgentManager.js +32 -13
- package/dist/AgentManager.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
- package/.swcrc +0 -27
- package/dist/__tests__/AgentManager.test.js +0 -1596
- package/dist/__tests__/AgentManager.test.js.map +0 -1
- package/dist/__tests__/adapters/IncrementalSessionRefresh.test.js +0 -486
- package/dist/__tests__/adapters/IncrementalSessionRefresh.test.js.map +0 -1
- package/dist/__tests__/adapters/adapterProcessImports.test.js +0 -52
- package/dist/__tests__/adapters/adapterProcessImports.test.js.map +0 -1
- package/dist/__tests__/adapters/adapterSnapshotCandidates.test.js +0 -247
- package/dist/__tests__/adapters/adapterSnapshotCandidates.test.js.map +0 -1
- package/dist/__tests__/capacity/anthropic.test.js +0 -115
- package/dist/__tests__/capacity/anthropic.test.js.map +0 -1
- package/dist/__tests__/capacity/boundaries.test.js +0 -45
- package/dist/__tests__/capacity/boundaries.test.js.map +0 -1
- package/dist/__tests__/capacity/claude.test.js +0 -485
- package/dist/__tests__/capacity/claude.test.js.map +0 -1
- package/dist/__tests__/capacity/codex.test.js +0 -339
- package/dist/__tests__/capacity/codex.test.js.map +0 -1
- package/dist/__tests__/capacity/devin.test.js +0 -239
- package/dist/__tests__/capacity/devin.test.js.map +0 -1
- package/dist/__tests__/capacity/index.test.js +0 -53
- package/dist/__tests__/capacity/index.test.js.map +0 -1
- package/dist/__tests__/capacity/openai.test.js +0 -687
- package/dist/__tests__/capacity/openai.test.js.map +0 -1
- package/dist/__tests__/capacity/wham.test.js +0 -159
- package/dist/__tests__/capacity/wham.test.js.map +0 -1
- package/dist/__tests__/capacity/zai.test.js +0 -212
- package/dist/__tests__/capacity/zai.test.js.map +0 -1
- package/dist/__tests__/fixtures.test.js +0 -218
- package/dist/__tests__/fixtures.test.js.map +0 -1
- package/dist/__tests__/harnesses/BoundedSummarySkip.test.js +0 -568
- package/dist/__tests__/harnesses/BoundedSummarySkip.test.js.map +0 -1
- package/dist/__tests__/harnesses/SessionSummaryEquivalence.test.js +0 -1089
- package/dist/__tests__/harnesses/SessionSummaryEquivalence.test.js.map +0 -1
- package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.subprocess.test.js +0 -143
- package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.subprocess.test.js.map +0 -1
- package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.test.js +0 -462
- package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/builtinAdapters.test.js +0 -33
- package/dist/__tests__/harnesses/builtinAdapters.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/ClaudeAgentMapper.test.js +0 -79
- package/dist/__tests__/harnesses/claude/ClaudeAgentMapper.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/ClaudeCodeAdapter.test.js +0 -1881
- package/dist/__tests__/harnesses/claude/ClaudeCodeAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/ClaudeSessionLocator.test.js +0 -425
- package/dist/__tests__/harnesses/claude/ClaudeSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/ClaudeSessionParser.test.js +0 -314
- package/dist/__tests__/harnesses/claude/ClaudeSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudeCliProbe.test.js +0 -49
- package/dist/__tests__/harnesses/claude/durable/ClaudeCliProbe.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js +0 -76
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgentService.test.js +0 -173
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgentService.test.js.map +0 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.js +0 -181
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/CodexAdapter.test.js +0 -685
- package/dist/__tests__/harnesses/codex/CodexAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/CodexSessionLocator.test.js +0 -463
- package/dist/__tests__/harnesses/codex/CodexSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/CodexSessionMapping.test.js +0 -86
- package/dist/__tests__/harnesses/codex/CodexSessionMapping.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/CodexSessionParser.test.js +0 -254
- package/dist/__tests__/harnesses/codex/CodexSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js +0 -121
- package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/durable/CodexDurableAgentRepository.test.js +0 -84
- package/dist/__tests__/harnesses/codex/durable/CodexDurableAgentRepository.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js +0 -128
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js +0 -246
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js.map +0 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js +0 -384
- package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js.map +0 -1
- package/dist/__tests__/harnesses/copilot/CopilotAdapter.test.js +0 -659
- package/dist/__tests__/harnesses/copilot/CopilotAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/copilot/CopilotRefreshIO.test.js +0 -290
- package/dist/__tests__/harnesses/copilot/CopilotRefreshIO.test.js.map +0 -1
- package/dist/__tests__/harnesses/devin/DevinAdapter.test.js +0 -597
- package/dist/__tests__/harnesses/devin/DevinAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js +0 -99
- package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js.map +0 -1
- package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js +0 -192
- package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js +0 -407
- package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/devin/fixtures.js +0 -95
- package/dist/__tests__/harnesses/devin/fixtures.js.map +0 -1
- package/dist/__tests__/harnesses/gemini/GeminiCliAdapter.test.js +0 -1454
- package/dist/__tests__/harnesses/gemini/GeminiCliAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/gemini/GeminiSessionJsonl.test.js +0 -491
- package/dist/__tests__/harnesses/gemini/GeminiSessionJsonl.test.js.map +0 -1
- package/dist/__tests__/harnesses/gemini/GeminiSessionLocator.test.js +0 -399
- package/dist/__tests__/harnesses/gemini/GeminiSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/grok/GrokAgentMapper.test.js +0 -56
- package/dist/__tests__/harnesses/grok/GrokAgentMapper.test.js.map +0 -1
- package/dist/__tests__/harnesses/grok/GrokCliAdapter.test.js +0 -421
- package/dist/__tests__/harnesses/grok/GrokCliAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/grok/GrokIncrementalRefresh.test.js +0 -167
- package/dist/__tests__/harnesses/grok/GrokIncrementalRefresh.test.js.map +0 -1
- package/dist/__tests__/harnesses/grok/GrokSessionLocator.test.js +0 -133
- package/dist/__tests__/harnesses/grok/GrokSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/grok/GrokSessionParser.test.js +0 -301
- package/dist/__tests__/harnesses/grok/GrokSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/kiro/KiroAdapter.test.js +0 -662
- package/dist/__tests__/harnesses/kiro/KiroAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/muse/MuseAdapter.test.js +0 -247
- package/dist/__tests__/harnesses/muse/MuseAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/muse/MuseAgentMapper.test.js +0 -81
- package/dist/__tests__/harnesses/muse/MuseAgentMapper.test.js.map +0 -1
- package/dist/__tests__/harnesses/muse/MuseSessionLocator.test.js +0 -185
- package/dist/__tests__/harnesses/muse/MuseSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/muse/MuseSessionParser.test.js +0 -328
- package/dist/__tests__/harnesses/muse/MuseSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/opencode/OpenCodeAdapter.test.js +0 -213
- package/dist/__tests__/harnesses/opencode/OpenCodeAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/opencode/OpenCodeAgentMapper.test.js +0 -108
- package/dist/__tests__/harnesses/opencode/OpenCodeAgentMapper.test.js.map +0 -1
- package/dist/__tests__/harnesses/opencode/OpenCodeSessionLocator.test.js +0 -94
- package/dist/__tests__/harnesses/opencode/OpenCodeSessionLocator.test.js.map +0 -1
- package/dist/__tests__/harnesses/opencode/OpenCodeSessionParser.test.js +0 -147
- package/dist/__tests__/harnesses/opencode/OpenCodeSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/PiAdapter.test.js +0 -367
- package/dist/__tests__/harnesses/pi/PiAdapter.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/PiDiscoveryIO.test.js +0 -382
- package/dist/__tests__/harnesses/pi/PiDiscoveryIO.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/PiSessionParser.test.js +0 -416
- package/dist/__tests__/harnesses/pi/PiSessionParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/PiSessionTracker.test.js +0 -108
- package/dist/__tests__/harnesses/pi/PiSessionTracker.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js +0 -70
- package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/durable/PiDurableAgentRepository.test.js +0 -43
- package/dist/__tests__/harnesses/pi/durable/PiDurableAgentRepository.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js +0 -192
- package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/durable/PiPrintProtocol.test.js +0 -119
- package/dist/__tests__/harnesses/pi/durable/PiPrintProtocol.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js +0 -382
- package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js.map +0 -1
- package/dist/__tests__/harnesses/pi/durable/PiStreamParser.test.js +0 -34
- package/dist/__tests__/harnesses/pi/durable/PiStreamParser.test.js.map +0 -1
- package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js +0 -446
- package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js.map +0 -1
- package/dist/__tests__/harnesses/runtimeProfiles.test.js +0 -101
- package/dist/__tests__/harnesses/runtimeProfiles.test.js.map +0 -1
- package/dist/__tests__/print/DurableAgent.test.js +0 -15
- package/dist/__tests__/print/DurableAgent.test.js.map +0 -1
- package/dist/__tests__/print/DurableAgentRepository.sqlite.test.js +0 -186
- package/dist/__tests__/print/DurableAgentRepository.sqlite.test.js.map +0 -1
- package/dist/__tests__/print/DurableAgentRepository.test.js +0 -249
- package/dist/__tests__/print/DurableAgentRepository.test.js.map +0 -1
- package/dist/__tests__/readiness-fixtures.test.js +0 -54
- package/dist/__tests__/readiness-fixtures.test.js.map +0 -1
- package/dist/__tests__/runtime/AgentRuntime.test.js +0 -13
- package/dist/__tests__/runtime/AgentRuntime.test.js.map +0 -1
- package/dist/__tests__/runtime/HerdrAgentDiscovery.test.js +0 -164
- package/dist/__tests__/runtime/HerdrAgentDiscovery.test.js.map +0 -1
- package/dist/__tests__/runtime/HerdrAgentRuntime.test.js +0 -488
- package/dist/__tests__/runtime/HerdrAgentRuntime.test.js.map +0 -1
- package/dist/__tests__/runtime/ManagedAgentRuntime.test.js +0 -637
- package/dist/__tests__/runtime/ManagedAgentRuntime.test.js.map +0 -1
- package/dist/__tests__/terminal/GhosttyBackend.test.js +0 -334
- package/dist/__tests__/terminal/GhosttyBackend.test.js.map +0 -1
- package/dist/__tests__/terminal/TerminalFocusManager.test.js +0 -253
- package/dist/__tests__/terminal/TerminalFocusManager.test.js.map +0 -1
- package/dist/__tests__/terminal/TmuxManager.test.js +0 -168
- package/dist/__tests__/terminal/TmuxManager.test.js.map +0 -1
- package/dist/__tests__/terminal/TtyWriter.test.js +0 -386
- package/dist/__tests__/terminal/TtyWriter.test.js.map +0 -1
- package/dist/__tests__/utils/AgentRegistry.test.js +0 -636
- package/dist/__tests__/utils/AgentRegistry.test.js.map +0 -1
- package/dist/__tests__/utils/IncrementalJsonlSummary.test.js +0 -650
- package/dist/__tests__/utils/IncrementalJsonlSummary.test.js.map +0 -1
- package/dist/__tests__/utils/agent-requests.test.js +0 -90
- package/dist/__tests__/utils/agent-requests.test.js.map +0 -1
- package/dist/__tests__/utils/conversationTail.bench.test.js +0 -258
- package/dist/__tests__/utils/conversationTail.bench.test.js.map +0 -1
- package/dist/__tests__/utils/conversationTailParity.test.js +0 -588
- package/dist/__tests__/utils/conversationTailParity.test.js.map +0 -1
- package/dist/__tests__/utils/jsonlTail.test.js +0 -360
- package/dist/__tests__/utils/jsonlTail.test.js.map +0 -1
- package/dist/__tests__/utils/matching.test.js +0 -324
- package/dist/__tests__/utils/matching.test.js.map +0 -1
- package/dist/__tests__/utils/matchingConstants.test.js +0 -35
- package/dist/__tests__/utils/matchingConstants.test.js.map +0 -1
- package/dist/__tests__/utils/process.test.js +0 -818
- package/dist/__tests__/utils/process.test.js.map +0 -1
- package/dist/__tests__/utils/session.test.js +0 -175
- package/dist/__tests__/utils/session.test.js.map +0 -1
- package/project.json +0 -29
- package/scripts/benchmark-cold-start.mjs +0 -350
- package/src/AgentManager.ts +0 -530
- package/src/__tests__/AgentManager.test.ts +0 -1483
- package/src/__tests__/adapters/IncrementalSessionRefresh.test.ts +0 -437
- package/src/__tests__/adapters/adapterProcessImports.test.ts +0 -58
- package/src/__tests__/adapters/adapterSnapshotCandidates.test.ts +0 -243
- package/src/__tests__/capacity/anthropic.test.ts +0 -105
- package/src/__tests__/capacity/boundaries.test.ts +0 -36
- package/src/__tests__/capacity/claude.test.ts +0 -462
- package/src/__tests__/capacity/codex.test.ts +0 -311
- package/src/__tests__/capacity/devin.test.ts +0 -210
- package/src/__tests__/capacity/fixtures/claude-credentials.json +0 -7
- package/src/__tests__/capacity/fixtures/claude-usage-malformed.json +0 -1
- package/src/__tests__/capacity/fixtures/claude-usage-partial.json +0 -15
- package/src/__tests__/capacity/fixtures/claude-usage.json +0 -63
- package/src/__tests__/capacity/fixtures/devin-config.json +0 -6
- package/src/__tests__/capacity/fixtures/devin-credentials.toml +0 -4
- package/src/__tests__/capacity/fixtures/devin-quota-nonplan.json +0 -5
- package/src/__tests__/capacity/fixtures/devin-quota.json +0 -10
- package/src/__tests__/capacity/fixtures/openai-auth.json +0 -6
- package/src/__tests__/capacity/fixtures/openai-codex-auth.json +0 -9
- package/src/__tests__/capacity/fixtures/openai-usage-completions.json +0 -67
- package/src/__tests__/capacity/fixtures/openai-usage-responses.json +0 -20
- package/src/__tests__/capacity/fixtures/wham-usage.json +0 -45
- package/src/__tests__/capacity/fixtures/zai-auth.json +0 -6
- package/src/__tests__/capacity/fixtures/zai-quota-invalid.json +0 -7
- package/src/__tests__/capacity/fixtures/zai-quota.json +0 -38
- package/src/__tests__/capacity/index.test.ts +0 -54
- package/src/__tests__/capacity/openai.test.ts +0 -571
- package/src/__tests__/capacity/wham.test.ts +0 -122
- package/src/__tests__/capacity/zai.test.ts +0 -151
- package/src/__tests__/fixtures.test.ts +0 -245
- package/src/__tests__/harnesses/BoundedSummarySkip.test.ts +0 -496
- package/src/__tests__/harnesses/SessionSummaryEquivalence.test.ts +0 -726
- package/src/__tests__/harnesses/antigravity/AntigravityCliAdapter.subprocess.test.ts +0 -133
- package/src/__tests__/harnesses/antigravity/AntigravityCliAdapter.test.ts +0 -396
- package/src/__tests__/harnesses/builtinAdapters.test.ts +0 -33
- package/src/__tests__/harnesses/claude/ClaudeAgentMapper.test.ts +0 -84
- package/src/__tests__/harnesses/claude/ClaudeCodeAdapter.test.ts +0 -1793
- package/src/__tests__/harnesses/claude/ClaudeSessionLocator.test.ts +0 -423
- package/src/__tests__/harnesses/claude/ClaudeSessionParser.test.ts +0 -300
- package/src/__tests__/harnesses/claude/durable/ClaudeCliProbe.test.ts +0 -34
- package/src/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.ts +0 -61
- package/src/__tests__/harnesses/claude/durable/ClaudePrintAgentService.test.ts +0 -129
- package/src/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.ts +0 -152
- package/src/__tests__/harnesses/codex/CodexAdapter.test.ts +0 -652
- package/src/__tests__/harnesses/codex/CodexSessionLocator.test.ts +0 -419
- package/src/__tests__/harnesses/codex/CodexSessionMapping.test.ts +0 -63
- package/src/__tests__/harnesses/codex/CodexSessionParser.test.ts +0 -192
- package/src/__tests__/harnesses/codex/durable/CodexCliProbe.test.ts +0 -80
- package/src/__tests__/harnesses/codex/durable/CodexDurableAgentRepository.test.ts +0 -65
- package/src/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.ts +0 -104
- package/src/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.ts +0 -201
- package/src/__tests__/harnesses/codex/durable/CodexPrintRunner.test.ts +0 -299
- package/src/__tests__/harnesses/copilot/CopilotAdapter.test.ts +0 -614
- package/src/__tests__/harnesses/copilot/CopilotRefreshIO.test.ts +0 -270
- package/src/__tests__/harnesses/devin/DevinAdapter.test.ts +0 -290
- package/src/__tests__/harnesses/devin/DevinAgentMapper.test.ts +0 -101
- package/src/__tests__/harnesses/devin/DevinSessionLocator.test.ts +0 -139
- package/src/__tests__/harnesses/devin/DevinSessionParser.test.ts +0 -212
- package/src/__tests__/harnesses/devin/fixtures.ts +0 -144
- package/src/__tests__/harnesses/gemini/GeminiCliAdapter.test.ts +0 -1336
- package/src/__tests__/harnesses/gemini/GeminiSessionJsonl.test.ts +0 -402
- package/src/__tests__/harnesses/gemini/GeminiSessionLocator.test.ts +0 -396
- package/src/__tests__/harnesses/grok/GrokAgentMapper.test.ts +0 -57
- package/src/__tests__/harnesses/grok/GrokCliAdapter.test.ts +0 -376
- package/src/__tests__/harnesses/grok/GrokIncrementalRefresh.test.ts +0 -170
- package/src/__tests__/harnesses/grok/GrokSessionLocator.test.ts +0 -106
- package/src/__tests__/harnesses/grok/GrokSessionParser.test.ts +0 -230
- package/src/__tests__/harnesses/kiro/KiroAdapter.test.ts +0 -552
- package/src/__tests__/harnesses/muse/MuseAdapter.test.ts +0 -197
- package/src/__tests__/harnesses/muse/MuseAgentMapper.test.ts +0 -83
- package/src/__tests__/harnesses/muse/MuseSessionLocator.test.ts +0 -177
- package/src/__tests__/harnesses/muse/MuseSessionParser.test.ts +0 -279
- package/src/__tests__/harnesses/opencode/OpenCodeAdapter.test.ts +0 -215
- package/src/__tests__/harnesses/opencode/OpenCodeAgentMapper.test.ts +0 -101
- package/src/__tests__/harnesses/opencode/OpenCodeSessionLocator.test.ts +0 -84
- package/src/__tests__/harnesses/opencode/OpenCodeSessionParser.test.ts +0 -149
- package/src/__tests__/harnesses/pi/PiAdapter.test.ts +0 -325
- package/src/__tests__/harnesses/pi/PiDiscoveryIO.test.ts +0 -337
- package/src/__tests__/harnesses/pi/PiSessionParser.test.ts +0 -280
- package/src/__tests__/harnesses/pi/PiSessionTracker.test.ts +0 -79
- package/src/__tests__/harnesses/pi/durable/PiCliProbe.test.ts +0 -50
- package/src/__tests__/harnesses/pi/durable/PiDurableAgentRepository.test.ts +0 -33
- package/src/__tests__/harnesses/pi/durable/PiPrintAgentService.test.ts +0 -138
- package/src/__tests__/harnesses/pi/durable/PiPrintProtocol.test.ts +0 -71
- package/src/__tests__/harnesses/pi/durable/PiPrintRunner.test.ts +0 -252
- package/src/__tests__/harnesses/pi/durable/PiStreamParser.test.ts +0 -26
- package/src/__tests__/harnesses/readiness/AgentReadiness.test.ts +0 -362
- package/src/__tests__/harnesses/runtimeProfiles.test.ts +0 -123
- package/src/__tests__/print/DurableAgent.test.ts +0 -15
- package/src/__tests__/print/DurableAgentRepository.sqlite.test.ts +0 -128
- package/src/__tests__/print/DurableAgentRepository.test.ts +0 -184
- package/src/__tests__/readiness-fixtures.test.ts +0 -79
- package/src/__tests__/runtime/AgentRuntime.test.ts +0 -8
- package/src/__tests__/runtime/HerdrAgentDiscovery.test.ts +0 -131
- package/src/__tests__/runtime/HerdrAgentRuntime.test.ts +0 -377
- package/src/__tests__/runtime/ManagedAgentRuntime.test.ts +0 -590
- package/src/__tests__/terminal/GhosttyBackend.test.ts +0 -271
- package/src/__tests__/terminal/TerminalFocusManager.test.ts +0 -280
- package/src/__tests__/terminal/TmuxManager.test.ts +0 -185
- package/src/__tests__/terminal/TtyWriter.test.ts +0 -454
- package/src/__tests__/utils/AgentRegistry.test.ts +0 -532
- package/src/__tests__/utils/IncrementalJsonlSummary.test.ts +0 -414
- package/src/__tests__/utils/agent-requests.test.ts +0 -94
- package/src/__tests__/utils/conversationTail.bench.test.ts +0 -193
- package/src/__tests__/utils/conversationTailParity.test.ts +0 -365
- package/src/__tests__/utils/jsonlTail.test.ts +0 -317
- package/src/__tests__/utils/matching.test.ts +0 -234
- package/src/__tests__/utils/matchingConstants.test.ts +0 -40
- package/src/__tests__/utils/process.test.ts +0 -596
- package/src/__tests__/utils/session.test.ts +0 -158
- package/src/adapters/AgentAdapter.ts +0 -255
- package/src/capacity/index.ts +0 -127
- package/src/capacity/providers/anthropic.ts +0 -198
- package/src/capacity/providers/devin.ts +0 -121
- package/src/capacity/providers/openai-platform.ts +0 -150
- package/src/capacity/providers/openai-subscription.ts +0 -184
- package/src/capacity/providers/zai.ts +0 -155
- package/src/capacity/sources/claude.ts +0 -30
- package/src/capacity/sources/codex.ts +0 -251
- package/src/capacity/sources/devin.ts +0 -49
- package/src/capacity/sources/pi.ts +0 -131
- package/src/capacity/types.ts +0 -29
- package/src/database/connection.ts +0 -96
- package/src/database/index.ts +0 -7
- package/src/database/migrations/001_initial.sql +0 -12
- package/src/database/migrations/002_pins.sql +0 -1
- package/src/database/migrations/003_durable_agents.sql +0 -43
- package/src/database/migrations/004_codex_durable_sessions.sql +0 -1
- package/src/database/migrations/005_agent_runtime.sql +0 -2
- package/src/database/schema.ts +0 -64
- package/src/durable/DurableAgent.ts +0 -139
- package/src/durable/DurableAgentRepository.ts +0 -485
- package/src/durable/process.ts +0 -29
- package/src/durable/run.ts +0 -84
- package/src/durable/utils.ts +0 -66
- package/src/fixtures/bundle.ts +0 -130
- package/src/fixtures/capture.ts +0 -364
- package/src/harnesses/antigravity/AntigravityAgentMapper.ts +0 -34
- package/src/harnesses/antigravity/AntigravityCliAdapter.ts +0 -126
- package/src/harnesses/antigravity/AntigravitySessionLocator.ts +0 -75
- package/src/harnesses/antigravity/AntigravitySessionParser.ts +0 -252
- package/src/harnesses/claude/ClaudeAgentMapper.ts +0 -55
- package/src/harnesses/claude/ClaudeCodeAdapter.ts +0 -175
- package/src/harnesses/claude/ClaudeSessionLocator.ts +0 -358
- package/src/harnesses/claude/ClaudeSessionParser.ts +0 -524
- package/src/harnesses/claude/credentials.ts +0 -122
- package/src/harnesses/claude/durable/ClaudeCliProbe.ts +0 -57
- package/src/harnesses/claude/durable/ClaudePrintAgentService.ts +0 -79
- package/src/harnesses/claude/durable/ClaudePrintRunner.ts +0 -102
- package/src/harnesses/claude/durable/ClaudeStreamParser.ts +0 -108
- package/src/harnesses/claude/readiness.ts +0 -69
- package/src/harnesses/codex/CodexAdapter.ts +0 -337
- package/src/harnesses/codex/CodexAgentMapper.ts +0 -26
- package/src/harnesses/codex/CodexSessionLocator.ts +0 -509
- package/src/harnesses/codex/CodexSessionMapping.ts +0 -89
- package/src/harnesses/codex/CodexSessionParser.ts +0 -462
- package/src/harnesses/codex/credentials.ts +0 -81
- package/src/harnesses/codex/durable/CodexCliProbe.ts +0 -68
- package/src/harnesses/codex/durable/CodexPrintAgentService.ts +0 -79
- package/src/harnesses/codex/durable/CodexPrintRunner.ts +0 -104
- package/src/harnesses/codex/durable/CodexStreamParser.ts +0 -117
- package/src/harnesses/codex/readiness.ts +0 -72
- package/src/harnesses/copilot/CopilotAdapter.ts +0 -161
- package/src/harnesses/copilot/CopilotAgentMapper.ts +0 -27
- package/src/harnesses/copilot/CopilotSessionLocator.ts +0 -161
- package/src/harnesses/copilot/CopilotSessionParser.ts +0 -380
- package/src/harnesses/copilot/readiness.ts +0 -33
- package/src/harnesses/devin/DevinAdapter.ts +0 -212
- package/src/harnesses/devin/DevinAgentMapper.ts +0 -39
- package/src/harnesses/devin/DevinSessionLocator.ts +0 -230
- package/src/harnesses/devin/DevinSessionParser.ts +0 -227
- package/src/harnesses/devin/credentials.ts +0 -88
- package/src/harnesses/devin/readiness.ts +0 -36
- package/src/harnesses/gemini/GeminiAgentMapper.ts +0 -27
- package/src/harnesses/gemini/GeminiCliAdapter.ts +0 -272
- package/src/harnesses/gemini/GeminiSessionLocator.ts +0 -394
- package/src/harnesses/gemini/GeminiSessionParser.ts +0 -395
- package/src/harnesses/gemini/fileSignature.ts +0 -10
- package/src/harnesses/grok/GrokAgentMapper.ts +0 -32
- package/src/harnesses/grok/GrokCliAdapter.ts +0 -126
- package/src/harnesses/grok/GrokSessionLocator.ts +0 -179
- package/src/harnesses/grok/GrokSessionParser.ts +0 -251
- package/src/harnesses/index.ts +0 -32
- package/src/harnesses/kiro/KiroAdapter.ts +0 -143
- package/src/harnesses/kiro/KiroAgentMapper.ts +0 -34
- package/src/harnesses/kiro/KiroSessionLocator.ts +0 -143
- package/src/harnesses/kiro/KiroSessionParser.ts +0 -376
- package/src/harnesses/muse/MuseAdapter.ts +0 -157
- package/src/harnesses/muse/MuseAgentMapper.ts +0 -33
- package/src/harnesses/muse/MuseSessionLocator.ts +0 -286
- package/src/harnesses/muse/MuseSessionParser.ts +0 -435
- package/src/harnesses/muse/readiness.ts +0 -38
- package/src/harnesses/opencode/OpenCodeAdapter.ts +0 -110
- package/src/harnesses/opencode/OpenCodeAgentMapper.ts +0 -49
- package/src/harnesses/opencode/OpenCodeSessionLocator.ts +0 -151
- package/src/harnesses/opencode/OpenCodeSessionParser.ts +0 -146
- package/src/harnesses/opencode/readiness.ts +0 -48
- package/src/harnesses/pi/PiAdapter.ts +0 -197
- package/src/harnesses/pi/PiAgentMapper.ts +0 -27
- package/src/harnesses/pi/PiSessionLocator.ts +0 -288
- package/src/harnesses/pi/PiSessionParser.ts +0 -488
- package/src/harnesses/pi/PiSessionTracker.ts +0 -87
- package/src/harnesses/pi/credentials.ts +0 -129
- package/src/harnesses/pi/durable/PiCliProbe.ts +0 -56
- package/src/harnesses/pi/durable/PiPrintAgentService.ts +0 -77
- package/src/harnesses/pi/durable/PiPrintProtocol.ts +0 -41
- package/src/harnesses/pi/durable/PiPrintRunner.ts +0 -95
- package/src/harnesses/pi/durable/PiStreamParser.ts +0 -94
- package/src/harnesses/pi/readiness.ts +0 -104
- package/src/harnesses/readiness/AgentReadiness.ts +0 -91
- package/src/harnesses/readiness/checks.ts +0 -336
- package/src/harnesses/readiness/types.ts +0 -90
- package/src/harnesses/runtimeProfiles.ts +0 -105
- package/src/harnesses/shared.ts +0 -124
- package/src/index.ts +0 -70
- package/src/runtime/ManagedAgentRuntime.ts +0 -253
- package/src/runtime/RuntimeFactory.ts +0 -13
- package/src/runtime/errors.ts +0 -50
- package/src/runtime/herdr/HerdrAgentDiscovery.ts +0 -166
- package/src/runtime/herdr/HerdrAgentRuntime.ts +0 -216
- package/src/runtime/herdr/HerdrCliClient.ts +0 -78
- package/src/runtime/herdr/HerdrErrors.ts +0 -9
- package/src/runtime/herdr/HerdrResponseParsers.ts +0 -86
- package/src/runtime/herdr/HerdrRuntimeRef.ts +0 -41
- package/src/runtime/tmux/PidPolling.ts +0 -34
- package/src/runtime/tmux/TmuxAgentRuntime.ts +0 -113
- package/src/runtime/tmux/TmuxManager.ts +0 -102
- package/src/runtime/tmux/TmuxRuntimeRef.ts +0 -9
- package/src/runtime/types.ts +0 -56
- package/src/terminal/TerminalFocusManager.ts +0 -52
- package/src/terminal/TtyWriter.ts +0 -26
- package/src/terminal/backends/ghostty.ts +0 -180
- package/src/terminal/backends/index.ts +0 -23
- package/src/terminal/backends/iterm2.ts +0 -126
- package/src/terminal/backends/shared.ts +0 -47
- package/src/terminal/backends/terminal-app.ts +0 -122
- package/src/terminal/backends/tmux.ts +0 -62
- package/src/terminal/backends/wezterm.ts +0 -65
- package/src/terminal/types.ts +0 -23
- package/src/utils/AgentRegistry.ts +0 -351
- package/src/utils/IncrementalJsonlSummary.ts +0 -306
- package/src/utils/agent-requests.ts +0 -28
- package/src/utils/applescript.ts +0 -10
- package/src/utils/jsonlTail.ts +0 -349
- package/src/utils/matching.ts +0 -96
- package/src/utils/matchingConstants.ts +0 -15
- package/src/utils/process.ts +0 -604
- package/src/utils/session.ts +0 -144
- package/src/utils/sortAgents.ts +0 -54
- package/tsconfig.json +0 -11
- package/vitest.config.ts +0 -20
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { DurableAgentRepository } from "../../durable/DurableAgentRepository.js";
|
|
6
|
-
|
|
7
|
-
const tempDirs: string[] = [];
|
|
8
|
-
|
|
9
|
-
afterEach(() => {
|
|
10
|
-
for (const dir of tempDirs.splice(0)) fs.rmSync(dir, { recursive: true, force: true });
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
function fixture(): { root: string; cwd: string; dbPath: string } {
|
|
14
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "durable-agent-store-"));
|
|
15
|
-
tempDirs.push(root);
|
|
16
|
-
const cwd = path.join(root, "project");
|
|
17
|
-
fs.mkdirSync(cwd);
|
|
18
|
-
return { root, cwd, dbPath: path.join(root, "state", "agents.db") };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
describe("DurableAgentRepository create/list/resolve", () => {
|
|
22
|
-
it("creates distinct durable identities with a canonical cwd and lists them", async () => {
|
|
23
|
-
const { cwd, dbPath } = fixture();
|
|
24
|
-
const repository = new DurableAgentRepository({
|
|
25
|
-
dbPath,
|
|
26
|
-
now: () => new Date("2026-08-07T09:00:00Z"),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const agent = await repository.create({ name: "reviewer", cwd });
|
|
30
|
-
|
|
31
|
-
expect(agent).toMatchObject({
|
|
32
|
-
name: "reviewer",
|
|
33
|
-
provider: "claude",
|
|
34
|
-
mode: "durable",
|
|
35
|
-
cwd: fs.realpathSync(cwd),
|
|
36
|
-
state: "ready",
|
|
37
|
-
sessionHealth: "uninitialized",
|
|
38
|
-
activeRun: null,
|
|
39
|
-
});
|
|
40
|
-
expect(agent.id).toMatch(/^[0-9a-f-]{36}$/);
|
|
41
|
-
expect(agent.providerSessionId).toMatch(/^[0-9a-f-]{36}$/);
|
|
42
|
-
expect(agent.id).not.toBe(agent.providerSessionId);
|
|
43
|
-
expect(await repository.list()).toEqual([agent]);
|
|
44
|
-
expect(fs.existsSync(dbPath)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("resolves exact ids and names and rejects duplicate names", async () => {
|
|
48
|
-
const { cwd, dbPath } = fixture();
|
|
49
|
-
const repository = new DurableAgentRepository({ dbPath });
|
|
50
|
-
const agent = await repository.create({ name: "Reviewer", cwd });
|
|
51
|
-
|
|
52
|
-
expect(await repository.resolve(agent.id)).toMatchObject({ id: agent.id });
|
|
53
|
-
expect(await repository.resolve("reviewer")).toMatchObject({ id: agent.id });
|
|
54
|
-
expect(await repository.resolve("view")).toBeNull();
|
|
55
|
-
await expect(repository.create({ name: "reviewer", cwd })).rejects.toMatchObject({
|
|
56
|
-
code: "DURABLE_AGENT_NAME_CONFLICT",
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("rejects a missing cwd", async () => {
|
|
61
|
-
const { root, dbPath } = fixture();
|
|
62
|
-
const repository = new DurableAgentRepository({ dbPath });
|
|
63
|
-
|
|
64
|
-
await expect(
|
|
65
|
-
repository.create({ name: "missing", cwd: path.join(root, "missing") }),
|
|
66
|
-
).rejects.toMatchObject({ code: "DURABLE_AGENT_REPOSITORY" });
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe("DurableAgentRepository run ownership", () => {
|
|
71
|
-
it("fails fast when another exact owner is live and completes only for its token", async () => {
|
|
72
|
-
const { cwd, dbPath } = fixture();
|
|
73
|
-
const live = new Map<number, string>([[process.pid, "owner-start"]]);
|
|
74
|
-
const processInspector = {
|
|
75
|
-
getIdentity: (pid: number) => {
|
|
76
|
-
const startedAt = live.get(pid);
|
|
77
|
-
return startedAt ? { pid, startedAt } : null;
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
const repository = new DurableAgentRepository({ dbPath, processInspector });
|
|
81
|
-
const agent = await repository.create({ name: "runner", cwd });
|
|
82
|
-
|
|
83
|
-
const acquired = await repository.acquireRun(agent.id);
|
|
84
|
-
await expect(repository.acquireRun(agent.id)).rejects.toMatchObject({
|
|
85
|
-
code: "DURABLE_AGENT_BUSY",
|
|
86
|
-
});
|
|
87
|
-
await expect(
|
|
88
|
-
repository.completeRun(agent.id, "wrong-token", {
|
|
89
|
-
status: "succeeded",
|
|
90
|
-
exitCode: 0,
|
|
91
|
-
summary: "done",
|
|
92
|
-
sessionHealth: "healthy",
|
|
93
|
-
}),
|
|
94
|
-
).rejects.toMatchObject({ code: "DURABLE_AGENT_REPOSITORY" });
|
|
95
|
-
|
|
96
|
-
const completed = await repository.completeRun(agent.id, acquired.token, {
|
|
97
|
-
status: "succeeded",
|
|
98
|
-
exitCode: 0,
|
|
99
|
-
summary: "done",
|
|
100
|
-
sessionHealth: "healthy",
|
|
101
|
-
});
|
|
102
|
-
expect(completed).toMatchObject({ state: "ready", sessionHealth: "healthy", activeRun: null });
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("retains busy for a live provider then recovers a dead run without signaling it", async () => {
|
|
106
|
-
const { cwd, dbPath } = fixture();
|
|
107
|
-
const live = new Map<number, string>([
|
|
108
|
-
[process.pid, "owner-start"],
|
|
109
|
-
[4242, "provider-start"],
|
|
110
|
-
]);
|
|
111
|
-
const processInspector = {
|
|
112
|
-
getIdentity: (pid: number) => {
|
|
113
|
-
const startedAt = live.get(pid);
|
|
114
|
-
return startedAt ? { pid, startedAt } : null;
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
const first = new DurableAgentRepository({ dbPath, processInspector });
|
|
118
|
-
const agent = await first.create({ name: "recoverable", cwd });
|
|
119
|
-
const run = await first.acquireRun(agent.id);
|
|
120
|
-
await first.recordProviderProcess(agent.id, run.token, {
|
|
121
|
-
pid: 4242,
|
|
122
|
-
startedAt: "provider-start",
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
live.delete(process.pid);
|
|
126
|
-
await expect(first.acquireRun(agent.id)).rejects.toMatchObject({ code: "DURABLE_AGENT_BUSY" });
|
|
127
|
-
|
|
128
|
-
live.delete(4242);
|
|
129
|
-
live.set(process.pid, "replacement-owner-start");
|
|
130
|
-
const recovered = await first.acquireRun(agent.id);
|
|
131
|
-
expect(recovered.agent).toMatchObject({
|
|
132
|
-
state: "running",
|
|
133
|
-
lastResult: { status: "interrupted" },
|
|
134
|
-
});
|
|
135
|
-
await first.completeRun(agent.id, recovered.token, {
|
|
136
|
-
status: "failed",
|
|
137
|
-
exitCode: 1,
|
|
138
|
-
summary: "failed",
|
|
139
|
-
sessionHealth: "unknown",
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it("reconciles an interrupted run to degraded during list", async () => {
|
|
144
|
-
const { cwd, dbPath } = fixture();
|
|
145
|
-
const live = new Map<number, string>([[process.pid, "owner-start"]]);
|
|
146
|
-
const repository = new DurableAgentRepository({
|
|
147
|
-
dbPath,
|
|
148
|
-
incompleteLockGraceMs: 10,
|
|
149
|
-
processInspector: {
|
|
150
|
-
getIdentity: (pid: number) => {
|
|
151
|
-
const startedAt = live.get(pid);
|
|
152
|
-
return startedAt ? { pid, startedAt } : null;
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
});
|
|
156
|
-
const agent = await repository.create({ name: "crashed", cwd });
|
|
157
|
-
await repository.acquireRun(agent.id);
|
|
158
|
-
live.clear();
|
|
159
|
-
|
|
160
|
-
const listed = await repository.list();
|
|
161
|
-
|
|
162
|
-
expect(listed[0]).toMatchObject({
|
|
163
|
-
state: "degraded",
|
|
164
|
-
sessionHealth: "unknown",
|
|
165
|
-
activeRun: null,
|
|
166
|
-
lastResult: { status: "interrupted" },
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
it("rejects send acquisition when the bound cwd is replaced by a symlink", async () => {
|
|
171
|
-
const { root, cwd, dbPath } = fixture();
|
|
172
|
-
const repository = new DurableAgentRepository({ dbPath });
|
|
173
|
-
const agent = await repository.create({ name: "bound", cwd });
|
|
174
|
-
const moved = path.join(root, "moved-project");
|
|
175
|
-
const other = path.join(root, "other-project");
|
|
176
|
-
fs.renameSync(cwd, moved);
|
|
177
|
-
fs.mkdirSync(other);
|
|
178
|
-
fs.symlinkSync(other, cwd);
|
|
179
|
-
|
|
180
|
-
await expect(repository.acquireRun(agent.id)).rejects.toMatchObject({
|
|
181
|
-
code: "DURABLE_AGENT_REPOSITORY",
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Readiness fixture replay: each committed bundle under
|
|
3
|
-
* `fixtures/readiness/` provides the injectable seams (files,
|
|
4
|
-
* executables, command outputs, codexAuth) plus `expected` — the
|
|
5
|
-
* byte-identical reports the readiness probes must produce replaying
|
|
6
|
-
* the same bundle through their injectable seams.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { describe, it, expect } from "vitest";
|
|
10
|
-
import * as fs from "node:fs";
|
|
11
|
-
import * as path from "node:path";
|
|
12
|
-
import {
|
|
13
|
-
getAgentReadinessReports,
|
|
14
|
-
type AgentReadinessOptions,
|
|
15
|
-
} from "../harnesses/readiness/AgentReadiness.js";
|
|
16
|
-
|
|
17
|
-
interface ReadinessBundle {
|
|
18
|
-
options: {
|
|
19
|
-
homeDir: string;
|
|
20
|
-
path: string;
|
|
21
|
-
assetRoot?: string;
|
|
22
|
-
builtInSkillNames?: string[];
|
|
23
|
-
skillRoots?: Record<string, string>;
|
|
24
|
-
};
|
|
25
|
-
/** Absolute path → contents, or "<dir>" for a directory entry. */
|
|
26
|
-
files: Record<string, string>;
|
|
27
|
-
/** Paths that answer X_OK access. */
|
|
28
|
-
executables: string[];
|
|
29
|
-
/** `"command arg1 arg2"` → output; `ok: false` rejects like execFile. */
|
|
30
|
-
commands: Record<string, { stdout: string; stderr?: string; ok?: boolean }>;
|
|
31
|
-
codexAuth?: boolean | null;
|
|
32
|
-
expected: Record<string, unknown>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const READINESS_ROOT = path.resolve(__dirname, "../../../..", "fixtures", "readiness");
|
|
36
|
-
|
|
37
|
-
const bundlePaths = fs.existsSync(READINESS_ROOT)
|
|
38
|
-
? fs
|
|
39
|
-
.readdirSync(READINESS_ROOT)
|
|
40
|
-
.filter((f) => f.endsWith(".json") && !f.startsWith("live"))
|
|
41
|
-
.sort()
|
|
42
|
-
.map((f) => path.join(READINESS_ROOT, f))
|
|
43
|
-
: [];
|
|
44
|
-
|
|
45
|
-
function replay(bundle: ReadinessBundle): Promise<Record<string, unknown>> {
|
|
46
|
-
const executableSet = new Set(bundle.executables);
|
|
47
|
-
const options: AgentReadinessOptions = {
|
|
48
|
-
homeDir: bundle.options.homeDir,
|
|
49
|
-
path: bundle.options.path,
|
|
50
|
-
assetRoot: bundle.options.assetRoot,
|
|
51
|
-
builtInSkillNames: bundle.options.builtInSkillNames ?? [],
|
|
52
|
-
skillRoots: bundle.options.skillRoots ?? {},
|
|
53
|
-
readFile: async (target) => {
|
|
54
|
-
if (!(target in bundle.files)) throw new Error("missing");
|
|
55
|
-
return bundle.files[target];
|
|
56
|
-
},
|
|
57
|
-
access: async (target) => {
|
|
58
|
-
if (executableSet.has(target) || target in bundle.files) return;
|
|
59
|
-
throw new Error("missing");
|
|
60
|
-
},
|
|
61
|
-
runCommand: async (command, args) => {
|
|
62
|
-
const key = [command, ...args].join(" ");
|
|
63
|
-
const stub = bundle.commands[key];
|
|
64
|
-
if (!stub) throw new Error(`unexpected command ${key}`);
|
|
65
|
-
if (stub.ok === false) throw new Error(`command failed: ${key}`);
|
|
66
|
-
return { stdout: stub.stdout, stderr: stub.stderr ?? "" };
|
|
67
|
-
},
|
|
68
|
-
codexAuth: async () => bundle.codexAuth ?? null,
|
|
69
|
-
};
|
|
70
|
-
return getAgentReadinessReports(options);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
describe("readiness fixture replay", () => {
|
|
74
|
-
it.each(bundlePaths)("%s", async (bundlePath) => {
|
|
75
|
-
const bundle = JSON.parse(fs.readFileSync(bundlePath, "utf8")) as ReadinessBundle;
|
|
76
|
-
const reports = await replay(bundle);
|
|
77
|
-
expect(reports).toEqual(bundle.expected);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createInteractiveRuntime } from "../../runtime/RuntimeFactory.js";
|
|
2
|
-
|
|
3
|
-
describe("AgentRuntime", () => {
|
|
4
|
-
it("creates a runtime for each supported interactive provider", () => {
|
|
5
|
-
expect(createInteractiveRuntime("herdr")).toMatchObject({ provider: "herdr" });
|
|
6
|
-
expect(createInteractiveRuntime("tmux")).toMatchObject({ provider: "tmux" });
|
|
7
|
-
});
|
|
8
|
-
});
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
extractHerdrAgentPanes,
|
|
3
|
-
fetchHerdrAgentPanes,
|
|
4
|
-
findMatchingHerdrPane,
|
|
5
|
-
} from "../../runtime/herdr/HerdrAgentDiscovery.js";
|
|
6
|
-
import type { HerdrCommandRunner } from "../../runtime/herdr/HerdrCliClient.js";
|
|
7
|
-
|
|
8
|
-
function jsonResponse(value: unknown): { stdout: string; stderr: string } {
|
|
9
|
-
return { stdout: JSON.stringify(value), stderr: "" };
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
describe("HerdrAgentDiscovery", () => {
|
|
13
|
-
it("extracts agent panes from pane list responses", () => {
|
|
14
|
-
const panes = extractHerdrAgentPanes({
|
|
15
|
-
result: {
|
|
16
|
-
panes: [
|
|
17
|
-
{
|
|
18
|
-
agent: "codex",
|
|
19
|
-
agent_session: { value: "session-1" },
|
|
20
|
-
cwd: "/repo",
|
|
21
|
-
pane_id: "w32:p1",
|
|
22
|
-
workspace_id: "w32",
|
|
23
|
-
tab_id: "w32:t1",
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
expect(panes).toEqual([
|
|
30
|
-
{
|
|
31
|
-
agent: "codex",
|
|
32
|
-
agentSessionId: "session-1",
|
|
33
|
-
cwd: "/repo",
|
|
34
|
-
paneId: "w32:p1",
|
|
35
|
-
workspaceId: "w32",
|
|
36
|
-
tabId: "w32:t1",
|
|
37
|
-
},
|
|
38
|
-
]);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("matches by foreground PID before falling back to ambiguous cwd and type", () => {
|
|
42
|
-
const pane = findMatchingHerdrPane(
|
|
43
|
-
{
|
|
44
|
-
type: "codex",
|
|
45
|
-
projectPath: "/repo",
|
|
46
|
-
sessionId: "pid-64904",
|
|
47
|
-
pid: 64904,
|
|
48
|
-
},
|
|
49
|
-
[
|
|
50
|
-
{ agent: "codex", cwd: "/repo", paneId: "w31:p1", foregroundPids: [44290] },
|
|
51
|
-
{ agent: "codex", cwd: "/repo", paneId: "w32:p1", foregroundPids: [64904] },
|
|
52
|
-
],
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
expect(pane?.paneId).toBe("w32:p1");
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("prefers a foreground PID match over a shell PID match", () => {
|
|
59
|
-
const pane = findMatchingHerdrPane(
|
|
60
|
-
{
|
|
61
|
-
type: "codex",
|
|
62
|
-
projectPath: "/repo",
|
|
63
|
-
sessionId: "pid-64904",
|
|
64
|
-
pid: 64904,
|
|
65
|
-
},
|
|
66
|
-
[
|
|
67
|
-
{ agent: "codex", cwd: "/repo", paneId: "w31:p1", shellPid: 64904 },
|
|
68
|
-
{ agent: "codex", cwd: "/repo", paneId: "w32:p1", foregroundPids: [64904] },
|
|
69
|
-
],
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
expect(pane?.paneId).toBe("w32:p1");
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("enriches pane list output with foreground process IDs", async () => {
|
|
76
|
-
const runner = vi
|
|
77
|
-
.fn<HerdrCommandRunner>()
|
|
78
|
-
.mockResolvedValueOnce(
|
|
79
|
-
jsonResponse({
|
|
80
|
-
result: {
|
|
81
|
-
panes: [
|
|
82
|
-
{ agent: "codex", cwd: "/repo", pane_id: "w31:p1" },
|
|
83
|
-
{ agent: "codex", cwd: "/repo", pane_id: "w32:p1" },
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
}),
|
|
87
|
-
)
|
|
88
|
-
.mockResolvedValueOnce(
|
|
89
|
-
jsonResponse({
|
|
90
|
-
result: {
|
|
91
|
-
process_info: {
|
|
92
|
-
pane_id: "w31:p1",
|
|
93
|
-
shell_pid: 111,
|
|
94
|
-
foreground_processes: [{ pid: 44290 }],
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
}),
|
|
98
|
-
)
|
|
99
|
-
.mockResolvedValueOnce(
|
|
100
|
-
jsonResponse({
|
|
101
|
-
result: {
|
|
102
|
-
process_info: {
|
|
103
|
-
pane_id: "w32:p1",
|
|
104
|
-
shell_pid: 222,
|
|
105
|
-
foreground_processes: [{ pid: 64904 }],
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const panes = await fetchHerdrAgentPanes(runner);
|
|
112
|
-
|
|
113
|
-
expect(runner).toHaveBeenNthCalledWith(1, "herdr", ["pane", "list"]);
|
|
114
|
-
expect(runner).toHaveBeenNthCalledWith(2, "herdr", [
|
|
115
|
-
"pane",
|
|
116
|
-
"process-info",
|
|
117
|
-
"--pane",
|
|
118
|
-
"w31:p1",
|
|
119
|
-
]);
|
|
120
|
-
expect(runner).toHaveBeenNthCalledWith(3, "herdr", [
|
|
121
|
-
"pane",
|
|
122
|
-
"process-info",
|
|
123
|
-
"--pane",
|
|
124
|
-
"w32:p1",
|
|
125
|
-
]);
|
|
126
|
-
expect(panes).toMatchObject([
|
|
127
|
-
{ paneId: "w31:p1", foregroundPids: [44290], shellPid: 111 },
|
|
128
|
-
{ paneId: "w32:p1", foregroundPids: [64904], shellPid: 222 },
|
|
129
|
-
]);
|
|
130
|
-
});
|
|
131
|
-
});
|