@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,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subprocess budget tests for AntigravityCliAdapter (#257).
|
|
3
|
-
*
|
|
4
|
-
* `child_process` is mocked so every spawn is recorded; the real process
|
|
5
|
-
* utilities and AgentManager run on top of it. Detection must never use the
|
|
6
|
-
* synchronous child_process APIs and must reuse the shared snapshot.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import * as fs from "fs";
|
|
10
|
-
import * as os from "os";
|
|
11
|
-
import * as path from "path";
|
|
12
|
-
import * as childProcess from "child_process";
|
|
13
|
-
|
|
14
|
-
import { AntigravityCliAdapter } from "../../../harnesses/antigravity/AntigravityCliAdapter.js";
|
|
15
|
-
import type { ProcessInfo } from "../../../adapters/AgentAdapter.js";
|
|
16
|
-
import { AgentManager } from "../../../AgentManager.js";
|
|
17
|
-
import { AgentRegistry } from "../../../utils/AgentRegistry.js";
|
|
18
|
-
import { createProcessSnapshotCapture } from "../../../utils/process.js";
|
|
19
|
-
|
|
20
|
-
vi.mock("child_process", async (importOriginal) => {
|
|
21
|
-
const actual = (await importOriginal()) as typeof import("child_process");
|
|
22
|
-
const forbidden = (name: string) =>
|
|
23
|
-
vi.fn(() => {
|
|
24
|
-
throw new Error(`unexpected child_process.${name} call`);
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
...actual,
|
|
28
|
-
execFile: vi.fn(),
|
|
29
|
-
exec: forbidden("exec"),
|
|
30
|
-
spawn: forbidden("spawn"),
|
|
31
|
-
execFileSync: forbidden("execFileSync"),
|
|
32
|
-
execSync: forbidden("execSync"),
|
|
33
|
-
spawnSync: forbidden("spawnSync"),
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const AGY_PID = 4242;
|
|
38
|
-
const AGY_CWD = "/Users/dev/my-project";
|
|
39
|
-
|
|
40
|
-
type ExecFileCallback = (error: Error | null, stdout: string, stderr: string) => void;
|
|
41
|
-
|
|
42
|
-
/** Fake `ps`/`lsof` output for one running agy process plus an unrelated one. */
|
|
43
|
-
function fakeExecFile(file: string, args: readonly string[]): string {
|
|
44
|
-
if (file === "ps" && args[0] === "-axo") {
|
|
45
|
-
return [`${AGY_PID} 1 ttys010 /usr/local/bin/agy`, "77 1 ttys011 node server.js"].join("\n");
|
|
46
|
-
}
|
|
47
|
-
if (file === "lsof") return `p${AGY_PID}\nn${AGY_CWD}\n`;
|
|
48
|
-
if (file === "ps" && args[0] === "-o") return `${AGY_PID} Wed Mar 18 23:18:01 2026\n`;
|
|
49
|
-
throw new Error(`unexpected execFile ${file} ${args.join(" ")}`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const mockedExecFile = childProcess.execFile as unknown as ReturnType<typeof vi.fn>;
|
|
53
|
-
const syncApis = ["execFileSync", "execSync", "spawnSync"] as const;
|
|
54
|
-
const allSpawnApis = [...syncApis, "execFile", "exec", "spawn"] as const;
|
|
55
|
-
|
|
56
|
-
function callCount(api: (typeof allSpawnApis)[number]): number {
|
|
57
|
-
return (childProcess[api] as unknown as ReturnType<typeof vi.fn>).mock.calls.length;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
describe("AntigravityCliAdapter subprocess usage", () => {
|
|
61
|
-
let base: string;
|
|
62
|
-
|
|
63
|
-
beforeEach(() => {
|
|
64
|
-
base = fs.mkdtempSync(path.join(os.tmpdir(), "agy-subprocess-test-"));
|
|
65
|
-
process.env.ANTIGRAVITY_CLI_HOME = base;
|
|
66
|
-
for (const api of allSpawnApis) {
|
|
67
|
-
(childProcess[api] as unknown as ReturnType<typeof vi.fn>).mockClear();
|
|
68
|
-
}
|
|
69
|
-
mockedExecFile.mockImplementation(
|
|
70
|
-
(file: string, args: readonly string[], _opts: unknown, cb: ExecFileCallback) => {
|
|
71
|
-
try {
|
|
72
|
-
cb(null, fakeExecFile(file, args), "");
|
|
73
|
-
} catch (error) {
|
|
74
|
-
cb(error as Error, "", "");
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
afterEach(() => {
|
|
81
|
-
delete process.env.ANTIGRAVITY_CLI_HOME;
|
|
82
|
-
fs.rmSync(base, { recursive: true, force: true });
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("spawns no subprocess when the injected snapshot has no agy process", async () => {
|
|
86
|
-
const adapter = new AntigravityCliAdapter();
|
|
87
|
-
const snapshot: ProcessInfo[] = [{ pid: 77, command: "node server.js", cwd: "/x", tty: "" }];
|
|
88
|
-
|
|
89
|
-
expect(await adapter.detectAgents({ processes: snapshot })).toEqual([]);
|
|
90
|
-
|
|
91
|
-
for (const api of allSpawnApis) expect(callCount(api)).toBe(0);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("spawns no subprocess when the injected snapshot contains an agy process", async () => {
|
|
95
|
-
const adapter = new AntigravityCliAdapter();
|
|
96
|
-
const snapshot: ProcessInfo[] = [
|
|
97
|
-
{ pid: AGY_PID, command: "agy", cwd: AGY_CWD, tty: "ttys010", startTime: new Date() },
|
|
98
|
-
];
|
|
99
|
-
|
|
100
|
-
const agents = await adapter.detectAgents({ processes: snapshot });
|
|
101
|
-
|
|
102
|
-
expect(agents.map((agent) => agent.pid)).toEqual([AGY_PID]);
|
|
103
|
-
for (const api of allSpawnApis) expect(callCount(api)).toBe(0);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it("never calls synchronous child_process APIs when capturing its own snapshot", async () => {
|
|
107
|
-
const adapter = new AntigravityCliAdapter();
|
|
108
|
-
|
|
109
|
-
const agents = await adapter.detectAgents();
|
|
110
|
-
|
|
111
|
-
expect(agents).toHaveLength(1);
|
|
112
|
-
expect(agents[0]).toMatchObject({ pid: AGY_PID, projectPath: AGY_CWD });
|
|
113
|
-
for (const api of syncApis) expect(callCount(api)).toBe(0);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("makes a full listAgents() refresh spawn exactly one ps + lsof + ps lstart set", async () => {
|
|
117
|
-
// A fresh capture: the shared one caches start times from earlier tests (#266).
|
|
118
|
-
const manager = new AgentManager(
|
|
119
|
-
new AgentRegistry(path.join(base, "agents.json")),
|
|
120
|
-
createProcessSnapshotCapture(),
|
|
121
|
-
);
|
|
122
|
-
manager.registerAdapter(new AntigravityCliAdapter());
|
|
123
|
-
|
|
124
|
-
const agents = await manager.listAgents();
|
|
125
|
-
|
|
126
|
-
expect(agents.map((agent) => agent.pid)).toEqual([AGY_PID]);
|
|
127
|
-
const spawned = mockedExecFile.mock.calls.map(
|
|
128
|
-
([file, args]) => `${file} ${(args as string[])[0]}`,
|
|
129
|
-
);
|
|
130
|
-
expect(spawned.sort()).toEqual(["lsof -a", "ps -axo", "ps -o"]);
|
|
131
|
-
for (const api of syncApis) expect(callCount(api)).toBe(0);
|
|
132
|
-
});
|
|
133
|
-
});
|
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for AntigravityCliAdapter
|
|
3
|
-
*
|
|
4
|
-
* The adapter resolves a live `agy` process to its conversation via
|
|
5
|
-
* ~/.gemini/antigravity-cli/cache/last_conversations.json (cwd -> conversationId)
|
|
6
|
-
* and reads session details from brain/<id>/.system_generated/logs/transcript.jsonl.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import type { MockedFunction } from "vitest";
|
|
10
|
-
import * as fs from "fs";
|
|
11
|
-
import * as os from "os";
|
|
12
|
-
import * as path from "path";
|
|
13
|
-
|
|
14
|
-
import { AntigravityCliAdapter } from "../../../harnesses/antigravity/AntigravityCliAdapter.js";
|
|
15
|
-
import type { ProcessInfo } from "../../../adapters/AgentAdapter.js";
|
|
16
|
-
import { AgentStatus } from "../../../adapters/AgentAdapter.js";
|
|
17
|
-
import {
|
|
18
|
-
listAgentProcesses,
|
|
19
|
-
enrichProcesses,
|
|
20
|
-
captureProcessSnapshot,
|
|
21
|
-
} from "../../../utils/process.js";
|
|
22
|
-
import { generateAgentName } from "../../../utils/matching.js";
|
|
23
|
-
|
|
24
|
-
vi.mock("../../../utils/process.js", async (importOriginal) => {
|
|
25
|
-
const actual = (await importOriginal()) as typeof import("../../../utils/process.js");
|
|
26
|
-
return {
|
|
27
|
-
...actual,
|
|
28
|
-
listAgentProcesses: vi.fn(),
|
|
29
|
-
enrichProcesses: vi.fn(),
|
|
30
|
-
captureProcessSnapshot: vi.fn(),
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
vi.mock("../../../utils/matching.js", async (importOriginal) => {
|
|
35
|
-
const actual = (await importOriginal()) as typeof import("../../../utils/matching.js");
|
|
36
|
-
return {
|
|
37
|
-
...actual,
|
|
38
|
-
generateAgentName: vi.fn(),
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const mockedListAgentProcesses = listAgentProcesses as MockedFunction<typeof listAgentProcesses>;
|
|
43
|
-
const mockedEnrichProcesses = enrichProcesses as MockedFunction<typeof enrichProcesses>;
|
|
44
|
-
const mockedCaptureProcessSnapshot = captureProcessSnapshot as MockedFunction<
|
|
45
|
-
typeof captureProcessSnapshot
|
|
46
|
-
>;
|
|
47
|
-
const mockedGenerateAgentName = generateAgentName as MockedFunction<typeof generateAgentName>;
|
|
48
|
-
|
|
49
|
-
const CONVERSATION_ID = "10485e13-2742-4e9e-b286-ac0606f0cb1e";
|
|
50
|
-
|
|
51
|
-
const iso = (d: Date) => d.toISOString().replace(/\.\d+Z$/, "Z");
|
|
52
|
-
/** A user transcript record: real prompt wrapped in <USER_REQUEST> like agy writes it. */
|
|
53
|
-
const userRecord = (text: string, at?: Date) => ({
|
|
54
|
-
source: "USER_EXPLICIT",
|
|
55
|
-
type: "USER_INPUT",
|
|
56
|
-
created_at: iso(at ?? new Date()),
|
|
57
|
-
content: `<USER_REQUEST>\n${text}\n</USER_REQUEST>\n<ADDITIONAL_CONTEXT>ignored</ADDITIONAL_CONTEXT>`,
|
|
58
|
-
});
|
|
59
|
-
const modelRecord = (text: string, at?: Date) => ({
|
|
60
|
-
source: "MODEL",
|
|
61
|
-
type: "PLANNER_RESPONSE",
|
|
62
|
-
created_at: iso(at ?? new Date()),
|
|
63
|
-
content: text,
|
|
64
|
-
});
|
|
65
|
-
/** A MODEL tool-call record (e.g. RUN_COMMAND) — execution detail, not a reply. */
|
|
66
|
-
const toolRecord = (text: string, at?: Date) => ({
|
|
67
|
-
source: "MODEL",
|
|
68
|
-
type: "RUN_COMMAND",
|
|
69
|
-
created_at: iso(at ?? new Date()),
|
|
70
|
-
content: text,
|
|
71
|
-
});
|
|
72
|
-
const systemRecord = (text: string, at?: Date) => ({
|
|
73
|
-
source: "SYSTEM",
|
|
74
|
-
type: "CHECKPOINT",
|
|
75
|
-
created_at: iso(at ?? new Date()),
|
|
76
|
-
content: text,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
describe("AntigravityCliAdapter", () => {
|
|
80
|
-
let adapter: AntigravityCliAdapter;
|
|
81
|
-
let base: string;
|
|
82
|
-
let cwd: string;
|
|
83
|
-
|
|
84
|
-
beforeEach(() => {
|
|
85
|
-
base = fs.mkdtempSync(path.join(os.tmpdir(), "agy-adapter-test-"));
|
|
86
|
-
process.env.ANTIGRAVITY_CLI_HOME = base;
|
|
87
|
-
cwd = "/Users/dev/my-project";
|
|
88
|
-
|
|
89
|
-
adapter = new AntigravityCliAdapter();
|
|
90
|
-
|
|
91
|
-
mockedListAgentProcesses.mockReset();
|
|
92
|
-
mockedEnrichProcesses.mockReset();
|
|
93
|
-
mockedCaptureProcessSnapshot.mockReset();
|
|
94
|
-
mockedGenerateAgentName.mockReset();
|
|
95
|
-
|
|
96
|
-
mockedEnrichProcesses.mockImplementation((procs) => procs);
|
|
97
|
-
mockedGenerateAgentName.mockImplementation(
|
|
98
|
-
(c: string, pid: number) => `${path.basename(c) || "unknown"}-${pid}`,
|
|
99
|
-
);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
afterEach(() => {
|
|
103
|
-
delete process.env.ANTIGRAVITY_CLI_HOME;
|
|
104
|
-
fs.rmSync(base, { recursive: true, force: true });
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
/** Write brain/<id>/.system_generated/logs/transcript.jsonl. */
|
|
108
|
-
function writeTranscript(opts: {
|
|
109
|
-
id?: string;
|
|
110
|
-
records?: object[];
|
|
111
|
-
transcript?: boolean;
|
|
112
|
-
}): string {
|
|
113
|
-
const id = opts.id ?? CONVERSATION_ID;
|
|
114
|
-
const dir = path.join(base, "brain", id, ".system_generated", "logs");
|
|
115
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
116
|
-
if (opts.transcript !== false) {
|
|
117
|
-
const records = opts.records ?? [userRecord("fix the bug")];
|
|
118
|
-
fs.writeFileSync(
|
|
119
|
-
path.join(dir, "transcript.jsonl"),
|
|
120
|
-
records.map((r) => JSON.stringify(r)).join("\n"),
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
return path.join(dir, "transcript.jsonl");
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Write cache/last_conversations.json (cwd -> conversationId). */
|
|
127
|
-
function writeRegistry(map: Record<string, string>): void {
|
|
128
|
-
const dir = path.join(base, "cache");
|
|
129
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
130
|
-
fs.writeFileSync(path.join(dir, "last_conversations.json"), JSON.stringify(map));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function proc(overrides: Partial<ProcessInfo> = {}): ProcessInfo {
|
|
134
|
-
return {
|
|
135
|
-
pid: 4242,
|
|
136
|
-
ppid: 1,
|
|
137
|
-
command: "agy",
|
|
138
|
-
cwd,
|
|
139
|
-
tty: "ttys010",
|
|
140
|
-
startTime: new Date(),
|
|
141
|
-
...overrides,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
it("exposes the antigravity_cli type and the agy process name", () => {
|
|
146
|
-
expect(adapter.type).toBe("antigravity_cli");
|
|
147
|
-
expect(adapter.processNames).toEqual(["agy"]);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
describe("canHandle", () => {
|
|
151
|
-
it("returns true for a plain agy command", () => {
|
|
152
|
-
expect(adapter.canHandle(proc({ command: "agy" }))).toBe(true);
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
it("returns true for agy with a full path and args", () => {
|
|
156
|
-
expect(
|
|
157
|
-
adapter.canHandle(
|
|
158
|
-
proc({ command: "/Users/dev/.local/bin/agy --dangerously-skip-permissions" }),
|
|
159
|
-
),
|
|
160
|
-
).toBe(true);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it("returns false for non-agy processes", () => {
|
|
164
|
-
expect(adapter.canHandle(proc({ command: "node app.js" }))).toBe(false);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it("returns true for agy installed under a path containing spaces", () => {
|
|
168
|
-
const executable = path.join(base, "Antigravity App.app", "bin", "agy");
|
|
169
|
-
fs.mkdirSync(path.dirname(executable), { recursive: true });
|
|
170
|
-
fs.writeFileSync(executable, "");
|
|
171
|
-
|
|
172
|
-
expect(adapter.canHandle(proc({ command: `${executable} --prompt fix it` }))).toBe(true);
|
|
173
|
-
expect(adapter.canHandle(proc({ command: "/usr/bin/vim My Notes/agy" }))).toBe(false);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it('returns false when "agy" appears only in an argument path', () => {
|
|
177
|
-
expect(adapter.canHandle(proc({ command: "node /path/to/agy-thing.js" }))).toBe(false);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
describe("detectAgents", () => {
|
|
182
|
-
it("uses context.processes when provided and never captures its own snapshot", async () => {
|
|
183
|
-
writeTranscript({});
|
|
184
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
185
|
-
|
|
186
|
-
const agents = await adapter.detectAgents({
|
|
187
|
-
processes: [proc(), proc({ pid: 7, command: "node server.js" })],
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
expect(agents.map((a) => a.pid)).toEqual([4242]);
|
|
191
|
-
expect(agents[0].sessionId).toBe(CONVERSATION_ID);
|
|
192
|
-
expect(mockedCaptureProcessSnapshot).not.toHaveBeenCalled();
|
|
193
|
-
expect(mockedListAgentProcesses).not.toHaveBeenCalled();
|
|
194
|
-
expect(mockedEnrichProcesses).not.toHaveBeenCalled();
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it("falls back to the async captureProcessSnapshot without context", async () => {
|
|
198
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([]);
|
|
199
|
-
|
|
200
|
-
expect(await adapter.detectAgents()).toEqual([]);
|
|
201
|
-
expect(mockedCaptureProcessSnapshot).toHaveBeenCalledWith(["agy"], {
|
|
202
|
-
isCandidate: expect.any(Function),
|
|
203
|
-
});
|
|
204
|
-
expect(mockedListAgentProcesses).not.toHaveBeenCalled();
|
|
205
|
-
expect(mockedEnrichProcesses).not.toHaveBeenCalled();
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it("resolves the conversation via last_conversations.json (cwd -> id)", async () => {
|
|
209
|
-
writeTranscript({});
|
|
210
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
211
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
212
|
-
|
|
213
|
-
const agents = await adapter.detectAgents();
|
|
214
|
-
|
|
215
|
-
expect(agents).toHaveLength(1);
|
|
216
|
-
expect(agents[0]).toMatchObject({
|
|
217
|
-
type: "antigravity_cli",
|
|
218
|
-
pid: 4242,
|
|
219
|
-
projectPath: cwd,
|
|
220
|
-
sessionId: CONVERSATION_ID,
|
|
221
|
-
summary: "fix the bug",
|
|
222
|
-
});
|
|
223
|
-
expect(agents[0].sessionFilePath).toBe(
|
|
224
|
-
path.join(base, "brain", CONVERSATION_ID, ".system_generated", "logs", "transcript.jsonl"),
|
|
225
|
-
);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it("falls back to a process-only RUNNING agent when the cwd is not in the registry", async () => {
|
|
229
|
-
writeTranscript({});
|
|
230
|
-
writeRegistry({ "/some/other/cwd": CONVERSATION_ID });
|
|
231
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
232
|
-
|
|
233
|
-
const agents = await adapter.detectAgents();
|
|
234
|
-
|
|
235
|
-
expect(agents).toHaveLength(1);
|
|
236
|
-
expect(agents[0].status).toBe(AgentStatus.RUNNING);
|
|
237
|
-
expect(agents[0].sessionId).toBe("pid-4242");
|
|
238
|
-
expect(agents[0].sessionFilePath).toBeUndefined();
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
it("is process-only when the mapped conversation has no transcript", async () => {
|
|
242
|
-
writeTranscript({ transcript: false });
|
|
243
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
244
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
245
|
-
|
|
246
|
-
const agents = await adapter.detectAgents();
|
|
247
|
-
|
|
248
|
-
expect(agents[0].sessionId).toBe("pid-4242");
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
describe("getConversation", () => {
|
|
253
|
-
it("maps USER_INPUT (<USER_REQUEST>) and MODEL records to roles", () => {
|
|
254
|
-
const file = writeTranscript({ records: [userRecord("hi"), modelRecord("hello")] });
|
|
255
|
-
expect(adapter.getConversation(file)).toEqual([
|
|
256
|
-
{ role: "user", content: "hi" },
|
|
257
|
-
{ role: "assistant", content: "hello" },
|
|
258
|
-
]);
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
it("skips malformed lines", () => {
|
|
262
|
-
const file = writeTranscript({ records: [userRecord("hi")] });
|
|
263
|
-
fs.appendFileSync(file, "\n{bad json");
|
|
264
|
-
expect(adapter.getConversation(file)).toEqual([{ role: "user", content: "hi" }]);
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it("excludes SYSTEM records unless verbose", () => {
|
|
268
|
-
const file = writeTranscript({ records: [systemRecord("checkpoint"), userRecord("go")] });
|
|
269
|
-
expect(adapter.getConversation(file)).toEqual([{ role: "user", content: "go" }]);
|
|
270
|
-
expect(adapter.getConversation(file, { verbose: true }).map((m) => m.role)).toEqual([
|
|
271
|
-
"system",
|
|
272
|
-
"user",
|
|
273
|
-
]);
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
it("excludes MODEL tool-call (RUN_COMMAND) records except in verbose", () => {
|
|
277
|
-
const file = writeTranscript({
|
|
278
|
-
records: [userRecord("go"), toolRecord("ran: echo hi"), modelRecord("done")],
|
|
279
|
-
});
|
|
280
|
-
// A tool call is not an assistant reply; only USER_INPUT + PLANNER_RESPONSE show.
|
|
281
|
-
expect(adapter.getConversation(file)).toEqual([
|
|
282
|
-
{ role: "user", content: "go" },
|
|
283
|
-
{ role: "assistant", content: "done" },
|
|
284
|
-
]);
|
|
285
|
-
expect(adapter.getConversation(file, { verbose: true }).map((m) => m.role)).toEqual([
|
|
286
|
-
"user",
|
|
287
|
-
"system",
|
|
288
|
-
"assistant",
|
|
289
|
-
]);
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
describe("detectAgents status + summary mapping", () => {
|
|
294
|
-
const detectFirst = async () => (await adapter.detectAgents())[0];
|
|
295
|
-
|
|
296
|
-
it("marks WAITING when the last reply is a PLANNER_RESPONSE (after a tool call)", async () => {
|
|
297
|
-
writeTranscript({
|
|
298
|
-
records: [userRecord("go"), toolRecord("ran: echo hi"), modelRecord("done")],
|
|
299
|
-
});
|
|
300
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
301
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
302
|
-
expect((await detectFirst()).status).toBe(AgentStatus.WAITING);
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
it("marks RUNNING when the last transcript turn is a USER_INPUT message", async () => {
|
|
306
|
-
writeTranscript({ records: [userRecord("still there?")] });
|
|
307
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
308
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
309
|
-
expect((await detectFirst()).status).toBe(AgentStatus.RUNNING);
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
it("marks IDLE when the last created_at is older than the threshold", async () => {
|
|
313
|
-
const old = new Date(Date.now() - 10 * 60 * 1000);
|
|
314
|
-
writeTranscript({ records: [userRecord("go", old)] });
|
|
315
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
316
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
317
|
-
expect((await detectFirst()).status).toBe(AgentStatus.IDLE);
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
it("uses the last user request as the agent summary", async () => {
|
|
321
|
-
writeTranscript({ records: [userRecord("refactor the parser"), modelRecord("on it")] });
|
|
322
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
323
|
-
mockedCaptureProcessSnapshot.mockResolvedValue([proc()]);
|
|
324
|
-
expect((await detectFirst()).summary).toBe("refactor the parser");
|
|
325
|
-
});
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
describe("listSessions", () => {
|
|
329
|
-
it("returns [] when there is no registry", async () => {
|
|
330
|
-
expect(await adapter.listSessions()).toEqual([]);
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
it("ignores a malformed registry and non-string conversation ids", async () => {
|
|
334
|
-
writeTranscript({});
|
|
335
|
-
fs.mkdirSync(path.join(base, "cache"), { recursive: true });
|
|
336
|
-
fs.writeFileSync(path.join(base, "cache", "last_conversations.json"), "{not json");
|
|
337
|
-
expect(await adapter.listSessions()).toEqual([]);
|
|
338
|
-
|
|
339
|
-
writeRegistry({ [cwd]: 42 as unknown as string, "/Users/dev/other": "" });
|
|
340
|
-
expect(await adapter.listSessions()).toEqual([]);
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
it("lists sessions from the registry with cwd + first user message", async () => {
|
|
344
|
-
writeTranscript({});
|
|
345
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
346
|
-
const summaries = await adapter.listSessions();
|
|
347
|
-
expect(summaries).toHaveLength(1);
|
|
348
|
-
expect(summaries[0]).toMatchObject({
|
|
349
|
-
type: "antigravity_cli",
|
|
350
|
-
sessionId: CONVERSATION_ID,
|
|
351
|
-
cwd,
|
|
352
|
-
firstUserMessage: "fix the bug",
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
it("applies the cwd filter", async () => {
|
|
357
|
-
writeTranscript({ id: "aaa0000a-0000-4000-8000-00000000000a", records: [userRecord("a")] });
|
|
358
|
-
writeTranscript({ id: "bbb0000b-0000-4000-8000-00000000000b", records: [userRecord("b")] });
|
|
359
|
-
writeRegistry({
|
|
360
|
-
"/Users/dev/project-a": "aaa0000a-0000-4000-8000-00000000000a",
|
|
361
|
-
"/Users/dev/project-b": "bbb0000b-0000-4000-8000-00000000000b",
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
const all = await adapter.listSessions();
|
|
365
|
-
expect(all).toHaveLength(2);
|
|
366
|
-
|
|
367
|
-
const filtered = await adapter.listSessions({ cwd: "/Users/dev/project-a" });
|
|
368
|
-
expect(filtered).toHaveLength(1);
|
|
369
|
-
expect(filtered[0].cwd).toBe("/Users/dev/project-a");
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
describe("findSessionsById", () => {
|
|
374
|
-
it("finds a registered conversation by id", async () => {
|
|
375
|
-
writeTranscript({});
|
|
376
|
-
writeRegistry({ [cwd]: CONVERSATION_ID });
|
|
377
|
-
|
|
378
|
-
expect(await adapter.findSessionsById(CONVERSATION_ID)).toEqual([
|
|
379
|
-
expect.objectContaining({
|
|
380
|
-
type: "antigravity_cli",
|
|
381
|
-
sessionId: CONVERSATION_ID,
|
|
382
|
-
cwd,
|
|
383
|
-
firstUserMessage: "fix the bug",
|
|
384
|
-
}),
|
|
385
|
-
]);
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
it("ignores transcripts that are not in the registry, like listSessions", async () => {
|
|
389
|
-
writeTranscript({});
|
|
390
|
-
writeRegistry({});
|
|
391
|
-
|
|
392
|
-
expect(await adapter.findSessionsById(CONVERSATION_ID)).toEqual([]);
|
|
393
|
-
expect(await adapter.listSessions()).toEqual([]);
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as os from "os";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
|
|
5
|
-
import { AGENT_TYPES } from "../../adapters/AgentAdapter.js";
|
|
6
|
-
import { createBuiltinAdapters } from "../../harnesses/index.js";
|
|
7
|
-
import { AgentRegistry } from "../../utils/AgentRegistry.js";
|
|
8
|
-
|
|
9
|
-
describe("createBuiltinAdapters", () => {
|
|
10
|
-
let tmpDir: string;
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "builtin-adapters-"));
|
|
14
|
-
// Several adapters default to AgentRegistry.default(), which opens ~/.ai-devkit/agents.db.
|
|
15
|
-
vi.spyOn(AgentRegistry, "default").mockReturnValue(
|
|
16
|
-
new AgentRegistry(path.join(tmpDir, "agents.json")),
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
vi.restoreAllMocks();
|
|
22
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("returns exactly one adapter per built-in agent type", () => {
|
|
26
|
-
const adapters = createBuiltinAdapters();
|
|
27
|
-
try {
|
|
28
|
-
expect(adapters.map((adapter) => adapter.type).sort()).toEqual([...AGENT_TYPES].sort());
|
|
29
|
-
} finally {
|
|
30
|
-
for (const adapter of adapters) (adapter as { close?: () => void }).close?.();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { AgentStatus, type ProcessInfo } from "../../../adapters/AgentAdapter.js";
|
|
4
|
-
import { ClaudeAgentMapper } from "../../../harnesses/claude/ClaudeAgentMapper.js";
|
|
5
|
-
import type { ClaudeSession } from "../../../harnesses/claude/ClaudeSessionParser.js";
|
|
6
|
-
import type { SessionFile } from "../../../utils/session.js";
|
|
7
|
-
|
|
8
|
-
function makeProcess(overrides: Partial<ProcessInfo> = {}): ProcessInfo {
|
|
9
|
-
return {
|
|
10
|
-
pid: 123,
|
|
11
|
-
command: "claude",
|
|
12
|
-
cwd: "/repo/my-app",
|
|
13
|
-
tty: "ttys001",
|
|
14
|
-
...overrides,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function makeSession(overrides: Partial<ClaudeSession> = {}): ClaudeSession {
|
|
19
|
-
return {
|
|
20
|
-
sessionId: "session-1",
|
|
21
|
-
projectPath: "/repo/my-app",
|
|
22
|
-
sessionStart: new Date("2026-08-23T10:00:00.000Z"),
|
|
23
|
-
lastActive: new Date("2026-08-23T10:05:00.000Z"),
|
|
24
|
-
lastEntryType: "assistant",
|
|
25
|
-
isInterrupted: false,
|
|
26
|
-
lastUserMessage: "Review this change",
|
|
27
|
-
...overrides,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function makeSessionFile(overrides: Partial<SessionFile> = {}): SessionFile {
|
|
32
|
-
return {
|
|
33
|
-
sessionId: "session-1",
|
|
34
|
-
filePath: "/home/.claude/projects/-repo-my-app/session-1.jsonl",
|
|
35
|
-
projectDir: "/home/.claude/projects/-repo-my-app",
|
|
36
|
-
birthtimeMs: new Date("2026-08-23T10:00:00.000Z").getTime(),
|
|
37
|
-
resolvedCwd: "/repo/my-app",
|
|
38
|
-
...overrides,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
describe("ClaudeAgentMapper", () => {
|
|
43
|
-
it("prefers live PID-file status and waiting reason over JSONL-derived status", () => {
|
|
44
|
-
const mapper = new ClaudeAgentMapper();
|
|
45
|
-
|
|
46
|
-
const agent = mapper.mapSessionToAgent({
|
|
47
|
-
session: makeSession({ lastEntryType: "assistant" }),
|
|
48
|
-
processInfo: makeProcess(),
|
|
49
|
-
sessionFile: makeSessionFile(),
|
|
50
|
-
liveInfo: {
|
|
51
|
-
pidStatus: AgentStatus.WAITING,
|
|
52
|
-
waitingFor: "approve Read",
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
expect(agent).toMatchObject({
|
|
57
|
-
name: "my-app-123",
|
|
58
|
-
type: "claude",
|
|
59
|
-
status: AgentStatus.WAITING,
|
|
60
|
-
summary: "Review this change — waiting for approve Read",
|
|
61
|
-
pid: 123,
|
|
62
|
-
projectPath: "/repo/my-app",
|
|
63
|
-
sessionId: "session-1",
|
|
64
|
-
sessionFilePath: "/home/.claude/projects/-repo-my-app/session-1.jsonl",
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("maps unmatched processes to the shared process-only placeholder", () => {
|
|
69
|
-
const mapper = new ClaudeAgentMapper();
|
|
70
|
-
|
|
71
|
-
const agent = mapper.mapProcessOnlyAgent(makeProcess({ pid: 456, cwd: "/repo/tooling" }));
|
|
72
|
-
|
|
73
|
-
expect(agent).toMatchObject({
|
|
74
|
-
name: "tooling-456",
|
|
75
|
-
type: "claude",
|
|
76
|
-
status: AgentStatus.RUNNING,
|
|
77
|
-
summary: "Claude Code process running",
|
|
78
|
-
pid: 456,
|
|
79
|
-
projectPath: "/repo/tooling",
|
|
80
|
-
sessionId: "pid-456",
|
|
81
|
-
});
|
|
82
|
-
expect(agent.lastActive).toBeInstanceOf(Date);
|
|
83
|
-
});
|
|
84
|
-
});
|