@ai-devkit/agent-manager 0.43.0 → 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/package.json +8 -3
- package/.swcrc +0 -27
- package/dist/__tests__/AgentManager.test.js +0 -1727
- 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 -559
- package/src/__tests__/AgentManager.test.ts +0 -1578
- 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 -71
- 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,79 +0,0 @@
|
|
|
1
|
-
import type { DurableAgent, ProcessIdentity } from "../../../durable/DurableAgent.js";
|
|
2
|
-
import { ClaudePrintError } from "../../../durable/DurableAgent.js";
|
|
3
|
-
import { ClaudeCliProbe } from "./ClaudeCliProbe.js";
|
|
4
|
-
import { ClaudePrintRunner, type ClaudePrintRunResult } from "./ClaudePrintRunner.js";
|
|
5
|
-
import {
|
|
6
|
-
DurableAgentRepository,
|
|
7
|
-
type CreateDurableAgentInput,
|
|
8
|
-
} from "../../../durable/DurableAgentRepository.js";
|
|
9
|
-
import { runDurableAgent, type DurableRunRepository } from "../../../durable/run.js";
|
|
10
|
-
|
|
11
|
-
interface RepositoryLike extends DurableRunRepository {
|
|
12
|
-
create(input: CreateDurableAgentInput): Promise<DurableAgent>;
|
|
13
|
-
list(): Promise<DurableAgent[]>;
|
|
14
|
-
recordProviderProcess(id: string, token: string, identity: ProcessIdentity): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface ProbeLike {
|
|
18
|
-
validate(): Promise<{ executable: string; version: string }>;
|
|
19
|
-
}
|
|
20
|
-
interface RunnerLike {
|
|
21
|
-
run(request: Parameters<ClaudePrintRunner["run"]>[0]): Promise<ClaudePrintRunResult>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ClaudePrintAgentServiceOptions {
|
|
25
|
-
repository?: RepositoryLike;
|
|
26
|
-
probe?: ProbeLike;
|
|
27
|
-
runner?: RunnerLike;
|
|
28
|
-
executable?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ClaudePrintSendResult extends ClaudePrintRunResult {
|
|
32
|
-
agentId: string;
|
|
33
|
-
agentName: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export class ClaudePrintAgentService {
|
|
37
|
-
readonly repository: RepositoryLike;
|
|
38
|
-
private readonly probe: ProbeLike;
|
|
39
|
-
private readonly runner: RunnerLike;
|
|
40
|
-
private readonly executable?: string;
|
|
41
|
-
|
|
42
|
-
constructor(options: ClaudePrintAgentServiceOptions = {}) {
|
|
43
|
-
this.repository = options.repository ?? new DurableAgentRepository();
|
|
44
|
-
this.probe = options.probe ?? new ClaudeCliProbe();
|
|
45
|
-
this.runner = options.runner ?? new ClaudePrintRunner();
|
|
46
|
-
this.executable = options.executable;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async create(input: CreateDurableAgentInput): Promise<DurableAgent> {
|
|
50
|
-
await this.probe.validate();
|
|
51
|
-
return this.repository.create(input);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async send(reference: string, prompt: string): Promise<ClaudePrintSendResult> {
|
|
55
|
-
const completed = await runDurableAgent({
|
|
56
|
-
reference,
|
|
57
|
-
provider: "claude",
|
|
58
|
-
repository: this.repository,
|
|
59
|
-
ambiguousError: () =>
|
|
60
|
-
new ClaudePrintError(
|
|
61
|
-
`Multiple durable agents match "${reference}".`,
|
|
62
|
-
"DURABLE_AGENT_AMBIGUOUS",
|
|
63
|
-
),
|
|
64
|
-
providerError: () =>
|
|
65
|
-
new ClaudePrintError("Durable agent provider is not Claude.", "CLAUDE_PRINT_UNSUPPORTED"),
|
|
66
|
-
execute: (agent, token) =>
|
|
67
|
-
this.runner.run({
|
|
68
|
-
agent,
|
|
69
|
-
prompt,
|
|
70
|
-
executable: this.executable,
|
|
71
|
-
firstRun: agent.sessionHealth === "uninitialized",
|
|
72
|
-
onSpawn: (identity) => this.repository.recordProviderProcess(agent.id, token, identity),
|
|
73
|
-
}),
|
|
74
|
-
isSessionMismatch: (error) =>
|
|
75
|
-
error instanceof ClaudePrintError && error.code === "CLAUDE_SESSION_MISMATCH",
|
|
76
|
-
});
|
|
77
|
-
return { ...completed.result, agentId: completed.agent.id, agentName: completed.agent.name };
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
spawn as nodeSpawn,
|
|
3
|
-
type ChildProcessWithoutNullStreams,
|
|
4
|
-
type SpawnOptionsWithoutStdio,
|
|
5
|
-
} from "child_process";
|
|
6
|
-
import type { ClaudeDurableAgent, ProcessIdentity } from "../../../durable/DurableAgent.js";
|
|
7
|
-
import { ClaudePrintError } from "../../../durable/DurableAgent.js";
|
|
8
|
-
import { LocalProcessInspector, type ProcessInspector } from "../../../durable/process.js";
|
|
9
|
-
import { waitForChildClose } from "../../../durable/utils.js";
|
|
10
|
-
import { ClaudeStreamParser } from "./ClaudeStreamParser.js";
|
|
11
|
-
|
|
12
|
-
type Spawn = (
|
|
13
|
-
command: string,
|
|
14
|
-
args: readonly string[],
|
|
15
|
-
options: SpawnOptionsWithoutStdio & { stdio: ["pipe", "pipe", "pipe"] },
|
|
16
|
-
) => ChildProcessWithoutNullStreams;
|
|
17
|
-
|
|
18
|
-
export interface ClaudePrintRunRequest {
|
|
19
|
-
agent: ClaudeDurableAgent;
|
|
20
|
-
prompt: string;
|
|
21
|
-
executable?: string;
|
|
22
|
-
firstRun: boolean;
|
|
23
|
-
onSpawn(identity: ProcessIdentity): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface ClaudePrintRunResult {
|
|
27
|
-
sessionId: string;
|
|
28
|
-
result: string;
|
|
29
|
-
exitCode: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ClaudePrintRunnerOptions {
|
|
33
|
-
spawn?: Spawn;
|
|
34
|
-
processInspector?: ProcessInspector;
|
|
35
|
-
maxLineBytes?: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class ClaudePrintRunner {
|
|
39
|
-
private readonly spawn: Spawn;
|
|
40
|
-
private readonly processInspector: ProcessInspector;
|
|
41
|
-
private readonly maxLineBytes: number;
|
|
42
|
-
|
|
43
|
-
constructor(options: ClaudePrintRunnerOptions = {}) {
|
|
44
|
-
this.spawn = options.spawn ?? (nodeSpawn as Spawn);
|
|
45
|
-
this.processInspector = options.processInspector ?? new LocalProcessInspector();
|
|
46
|
-
this.maxLineBytes = options.maxLineBytes ?? 1024 * 1024;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async run(request: ClaudePrintRunRequest): Promise<ClaudePrintRunResult> {
|
|
50
|
-
const sessionArgs = request.firstRun
|
|
51
|
-
? ["--session-id", request.agent.providerSessionId]
|
|
52
|
-
: ["--resume", request.agent.providerSessionId];
|
|
53
|
-
const args = ["-p", ...sessionArgs, "--output-format", "stream-json", "--verbose"];
|
|
54
|
-
const child = this.spawn(request.executable ?? "claude", args, {
|
|
55
|
-
cwd: request.agent.cwd,
|
|
56
|
-
shell: false,
|
|
57
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
58
|
-
});
|
|
59
|
-
if (!child.pid) {
|
|
60
|
-
child.kill();
|
|
61
|
-
throw new ClaudePrintError(
|
|
62
|
-
"Claude process did not provide a PID.",
|
|
63
|
-
"CLAUDE_PROCESS_IDENTITY",
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
const identity = this.processInspector.getIdentity(child.pid);
|
|
67
|
-
if (!identity) {
|
|
68
|
-
child.kill();
|
|
69
|
-
throw new ClaudePrintError(
|
|
70
|
-
"Cannot verify Claude process identity.",
|
|
71
|
-
"CLAUDE_PROCESS_IDENTITY",
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const parser = new ClaudeStreamParser(request.agent.providerSessionId, this.maxLineBytes);
|
|
76
|
-
|
|
77
|
-
child.stdout.on("data", (chunk: Buffer | string) => {
|
|
78
|
-
if (parser.hasFailed()) return;
|
|
79
|
-
try {
|
|
80
|
-
parser.accept(chunk);
|
|
81
|
-
} catch (error) {
|
|
82
|
-
parser.fail(error);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
// Drain provider diagnostics without reflecting potentially sensitive prompt/tool data.
|
|
86
|
-
child.stderr.resume();
|
|
87
|
-
|
|
88
|
-
const closed = waitForChildClose(child);
|
|
89
|
-
|
|
90
|
-
try {
|
|
91
|
-
await request.onSpawn(identity);
|
|
92
|
-
} catch (error) {
|
|
93
|
-
child.kill();
|
|
94
|
-
throw error;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
child.stdin.end(request.prompt);
|
|
98
|
-
const { code, signal } = await closed;
|
|
99
|
-
|
|
100
|
-
return parser.result({ code, signal });
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { ClaudePrintError } from "../../../durable/DurableAgent.js";
|
|
2
|
-
import { LineBuffer, type ChildCloseResult } from "../../../durable/utils.js";
|
|
3
|
-
import type { ClaudePrintRunResult } from "./ClaudePrintRunner.js";
|
|
4
|
-
|
|
5
|
-
export class ClaudeStreamParser {
|
|
6
|
-
private readonly lines: LineBuffer;
|
|
7
|
-
private terminal: ClaudePrintRunResult | null = null;
|
|
8
|
-
private protocolError: ClaudePrintError | null = null;
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
private readonly expectedSessionId: string,
|
|
12
|
-
maxLineBytes: number,
|
|
13
|
-
) {
|
|
14
|
-
this.lines = new LineBuffer(
|
|
15
|
-
maxLineBytes,
|
|
16
|
-
() =>
|
|
17
|
-
new ClaudePrintError(
|
|
18
|
-
"Claude stream line exceeded the safety limit.",
|
|
19
|
-
"CLAUDE_STREAM_OVERSIZED",
|
|
20
|
-
),
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
hasFailed(): boolean {
|
|
25
|
-
return this.protocolError !== null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
accept(chunk: Buffer | string): void {
|
|
29
|
-
for (const line of this.lines.accept(chunk)) {
|
|
30
|
-
this.processLine(line);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
fail(error: unknown): void {
|
|
35
|
-
this.protocolError =
|
|
36
|
-
error instanceof ClaudePrintError
|
|
37
|
-
? error
|
|
38
|
-
: new ClaudePrintError("Claude stream processing failed.", "CLAUDE_STREAM_INVALID");
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
result(close: ChildCloseResult): ClaudePrintRunResult {
|
|
42
|
-
if (this.protocolError) throw this.protocolError;
|
|
43
|
-
this.lines.assertComplete(
|
|
44
|
-
() =>
|
|
45
|
-
new ClaudePrintError("Claude stream ended with incomplete JSON.", "CLAUDE_STREAM_INVALID"),
|
|
46
|
-
);
|
|
47
|
-
if (close.code !== 0) {
|
|
48
|
-
throw new ClaudePrintError(
|
|
49
|
-
`Claude print run failed${close.signal ? ` (${close.signal})` : "."}`,
|
|
50
|
-
"CLAUDE_PROCESS_FAILED",
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
if (!this.terminal)
|
|
54
|
-
throw new ClaudePrintError(
|
|
55
|
-
"Claude stream ended without a terminal result.",
|
|
56
|
-
"CLAUDE_RESULT_MISSING",
|
|
57
|
-
);
|
|
58
|
-
return {
|
|
59
|
-
sessionId: this.terminal.sessionId,
|
|
60
|
-
result: this.terminal.result,
|
|
61
|
-
exitCode: close.code,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
private processLine(line: Buffer): void {
|
|
66
|
-
if (line.length === 0) return;
|
|
67
|
-
|
|
68
|
-
const event = this.parseEvent(line);
|
|
69
|
-
if (typeof event.session_id === "string" && event.session_id !== this.expectedSessionId) {
|
|
70
|
-
throw new ClaudePrintError(
|
|
71
|
-
"Claude returned a different session identity.",
|
|
72
|
-
"CLAUDE_SESSION_MISMATCH",
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
if (event.type === "result") this.recordTerminalResult(event);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private parseEvent(line: Buffer): Record<string, unknown> {
|
|
79
|
-
let value: unknown;
|
|
80
|
-
try {
|
|
81
|
-
value = JSON.parse(line.toString("utf8"));
|
|
82
|
-
} catch {
|
|
83
|
-
throw new ClaudePrintError("Claude emitted malformed stream JSON.", "CLAUDE_STREAM_INVALID");
|
|
84
|
-
}
|
|
85
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
86
|
-
throw new ClaudePrintError(
|
|
87
|
-
"Claude emitted a non-object stream message.",
|
|
88
|
-
"CLAUDE_STREAM_INVALID",
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
return value as Record<string, unknown>;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
private recordTerminalResult(event: Record<string, unknown>): void {
|
|
95
|
-
if (this.terminal)
|
|
96
|
-
throw new ClaudePrintError(
|
|
97
|
-
"Claude emitted more than one terminal result.",
|
|
98
|
-
"CLAUDE_STREAM_INVALID",
|
|
99
|
-
);
|
|
100
|
-
if (typeof event.session_id !== "string" || typeof event.result !== "string") {
|
|
101
|
-
throw new ClaudePrintError(
|
|
102
|
-
"Claude emitted an invalid terminal result.",
|
|
103
|
-
"CLAUDE_STREAM_INVALID",
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
this.terminal = { sessionId: event.session_id, result: event.result, exitCode: 0 };
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
record,
|
|
4
|
-
registrationCheck,
|
|
5
|
-
scriptCheck,
|
|
6
|
-
worstReadinessStatus,
|
|
7
|
-
} from "../readiness/checks.js";
|
|
8
|
-
import type {
|
|
9
|
-
AuthReadinessCheck,
|
|
10
|
-
HarnessReadinessProfile,
|
|
11
|
-
IntegrationReadinessCheck,
|
|
12
|
-
ReadinessRuntime,
|
|
13
|
-
} from "../readiness/types.js";
|
|
14
|
-
|
|
15
|
-
async function authCheck(runtime: ReadinessRuntime): Promise<AuthReadinessCheck> {
|
|
16
|
-
try {
|
|
17
|
-
const result = await runtime.runCommand("claude", ["auth", "status", "--json"]);
|
|
18
|
-
const parsed = record(JSON.parse(result.stdout));
|
|
19
|
-
const authenticated = parsed?.loggedIn === true || parsed?.authenticated === true;
|
|
20
|
-
const unauthenticated = parsed?.loggedIn === false || parsed?.authenticated === false;
|
|
21
|
-
return {
|
|
22
|
-
state: authenticated ? "authenticated" : unauthenticated ? "unauthenticated" : "unknown",
|
|
23
|
-
source: "claude auth status --json",
|
|
24
|
-
provider: null,
|
|
25
|
-
availableProviders: [],
|
|
26
|
-
status: authenticated ? "pass" : unauthenticated ? "fail" : "warn",
|
|
27
|
-
errors: authenticated
|
|
28
|
-
? []
|
|
29
|
-
: [unauthenticated ? "Claude is not authenticated" : "Claude authentication is unknown"],
|
|
30
|
-
};
|
|
31
|
-
} catch {
|
|
32
|
-
return {
|
|
33
|
-
state: "unknown",
|
|
34
|
-
source: "claude auth status --json",
|
|
35
|
-
provider: null,
|
|
36
|
-
availableProviders: [],
|
|
37
|
-
status: "warn",
|
|
38
|
-
errors: ["Claude authentication probe failed"],
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function integrationCheck(runtime: ReadinessRuntime): Promise<IntegrationReadinessCheck> {
|
|
44
|
-
const script = await scriptCheck(
|
|
45
|
-
join(runtime.homeDir, ".claude", "hooks", "claude-prompt-hook.js"),
|
|
46
|
-
join(runtime.assetRoot ?? "", "claude", "claude-prompt-hook.js"),
|
|
47
|
-
runtime,
|
|
48
|
-
);
|
|
49
|
-
const registration = await registrationCheck(
|
|
50
|
-
join(runtime.homeDir, ".claude", "settings.json"),
|
|
51
|
-
"PreToolUse",
|
|
52
|
-
"node ~/.claude/hooks/claude-prompt-hook.js",
|
|
53
|
-
runtime,
|
|
54
|
-
);
|
|
55
|
-
const installed = script.status === "pass" && registration.status === "pass";
|
|
56
|
-
return {
|
|
57
|
-
label: "ai-devkit hook",
|
|
58
|
-
installed,
|
|
59
|
-
status: worstReadinessStatus([script.status, registration.status]),
|
|
60
|
-
errors: [...script.errors, ...registration.errors],
|
|
61
|
-
details: { promptScript: script, registration },
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const claudeReadiness: HarnessReadinessProfile = {
|
|
66
|
-
configDir: ".claude",
|
|
67
|
-
auth: authCheck,
|
|
68
|
-
integration: integrationCheck,
|
|
69
|
-
};
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
import type {
|
|
4
|
-
AgentAdapter,
|
|
5
|
-
AgentInfo,
|
|
6
|
-
ProcessInfo,
|
|
7
|
-
ConversationMessage,
|
|
8
|
-
ConversationOptions,
|
|
9
|
-
SessionSummary,
|
|
10
|
-
ListSessionsOptions,
|
|
11
|
-
AgentDetectionContext,
|
|
12
|
-
} from "../../adapters/AgentAdapter.js";
|
|
13
|
-
import { executablePath } from "../../utils/process.js";
|
|
14
|
-
import { AgentRegistry } from "../../utils/AgentRegistry.js";
|
|
15
|
-
import { CodexAgentMapper } from "./CodexAgentMapper.js";
|
|
16
|
-
import { CodexSessionLocator, type CodexDirectMatch } from "./CodexSessionLocator.js";
|
|
17
|
-
import { CodexSessionMapping } from "./CodexSessionMapping.js";
|
|
18
|
-
import { CodexSessionParser } from "./CodexSessionParser.js";
|
|
19
|
-
import { findHarnessProcesses, homeDir, matchesExecutable } from "../shared.js";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Codex subcommands that never own a local agent session: long-running helpers
|
|
23
|
-
* (app-server, sandbox, MCP/exec servers) and short-lived management commands.
|
|
24
|
-
* Interactive `codex`, `resume`, `fork`, `exec` and `review` remain detected.
|
|
25
|
-
*
|
|
26
|
-
* Classification of `review`, `cloud` and `agents` checked against Codex CLI
|
|
27
|
-
* 0.157.1 (source tag rust-v0.157.1, codex-rs/cli/src/main.rs):
|
|
28
|
-
* - `review` is detected: it runs as `codex exec review`, starting a
|
|
29
|
-
* non-ephemeral thread in-process (source `exec`, originator `codex_exec`), so
|
|
30
|
-
* it writes a `session_meta` rollout under ~/.codex/sessions like `codex exec`.
|
|
31
|
-
* - `cloud` is excluded: it browses and applies Codex Cloud tasks over HTTP and
|
|
32
|
-
* never starts a local thread or rollout.
|
|
33
|
-
* - `agents` is excluded: it opens a dashboard over every session on the shared
|
|
34
|
-
* app-server daemon without starting a thread of its own; the daemon, not
|
|
35
|
-
* this process, owns and writes those sessions' rollouts.
|
|
36
|
-
*/
|
|
37
|
-
const CODEX_HELPER_SUBCOMMANDS = new Set([
|
|
38
|
-
"agents",
|
|
39
|
-
"app",
|
|
40
|
-
"app-server",
|
|
41
|
-
"apply",
|
|
42
|
-
"a",
|
|
43
|
-
"archive",
|
|
44
|
-
"cloud",
|
|
45
|
-
"cloud-tasks",
|
|
46
|
-
"completion",
|
|
47
|
-
"debug",
|
|
48
|
-
"delete",
|
|
49
|
-
"doctor",
|
|
50
|
-
"exec-server",
|
|
51
|
-
"features",
|
|
52
|
-
"help",
|
|
53
|
-
"login",
|
|
54
|
-
"logout",
|
|
55
|
-
"mcp",
|
|
56
|
-
"mcp-server",
|
|
57
|
-
"migrate-rollouts",
|
|
58
|
-
"plugin",
|
|
59
|
-
"queue",
|
|
60
|
-
"remote-control",
|
|
61
|
-
"responses-api-proxy",
|
|
62
|
-
"sandbox",
|
|
63
|
-
"stdio-to-uds",
|
|
64
|
-
"unarchive",
|
|
65
|
-
"update",
|
|
66
|
-
]);
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Known root Codex subcommand names and aliases, including the hidden ones in
|
|
70
|
-
* Codex CLI 0.157.1. A variadic flag's values stop at these, as clap stops there.
|
|
71
|
-
*/
|
|
72
|
-
const CODEX_SUBCOMMANDS = new Set([
|
|
73
|
-
...CODEX_HELPER_SUBCOMMANDS,
|
|
74
|
-
"e",
|
|
75
|
-
"exec",
|
|
76
|
-
"execpolicy",
|
|
77
|
-
"fork",
|
|
78
|
-
"resume",
|
|
79
|
-
"review",
|
|
80
|
-
"tcp-tunnel",
|
|
81
|
-
]);
|
|
82
|
-
|
|
83
|
-
/** Global Codex flags that consume the following argument as their value. */
|
|
84
|
-
const CODEX_VALUE_FLAGS = new Set([
|
|
85
|
-
"-c",
|
|
86
|
-
"--config",
|
|
87
|
-
"-m",
|
|
88
|
-
"--model",
|
|
89
|
-
"-p",
|
|
90
|
-
"--profile",
|
|
91
|
-
"-s",
|
|
92
|
-
"--sandbox",
|
|
93
|
-
"-a",
|
|
94
|
-
"--ask-for-approval",
|
|
95
|
-
"-C",
|
|
96
|
-
"--cd",
|
|
97
|
-
"--add-dir",
|
|
98
|
-
"--enable",
|
|
99
|
-
"--disable",
|
|
100
|
-
"--local-provider",
|
|
101
|
-
"--remote",
|
|
102
|
-
"--remote-auth-token-env",
|
|
103
|
-
]);
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Global Codex flags that take one or more values (clap `num_args = 1..`).
|
|
107
|
-
* `-i, --image <FILE>...` is the only one in Codex CLI 0.157.1.
|
|
108
|
-
*/
|
|
109
|
-
const CODEX_VARIADIC_VALUE_FLAGS = new Set(["-i", "--image"]);
|
|
110
|
-
|
|
111
|
-
const CODEX_APP_SERVER_DAEMON_DIR = "app-server-daemon";
|
|
112
|
-
|
|
113
|
-
function isCodexHelperCommand(command: string): boolean {
|
|
114
|
-
const trimmed = command.trim();
|
|
115
|
-
// Resolve argv[0] first so an install path containing spaces is not read as arguments.
|
|
116
|
-
const executable = executablePath(trimmed);
|
|
117
|
-
const args = trimmed.slice(executable.length).trim().split(/\s+/).filter(Boolean);
|
|
118
|
-
if (executable.replace(/\\/g, "/").split("/").includes(CODEX_APP_SERVER_DAEMON_DIR)) {
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const subcommand = firstPositionalArgument(args);
|
|
123
|
-
return subcommand !== undefined && CODEX_HELPER_SUBCOMMANDS.has(subcommand);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function firstPositionalArgument(args: string[]): string | undefined {
|
|
127
|
-
for (let index = 0; index < args.length; index++) {
|
|
128
|
-
const arg = args[index];
|
|
129
|
-
if (arg === "--") return undefined;
|
|
130
|
-
if (!arg.startsWith("-")) return arg;
|
|
131
|
-
if (arg.includes("=")) continue;
|
|
132
|
-
if (CODEX_VALUE_FLAGS.has(arg)) {
|
|
133
|
-
index++;
|
|
134
|
-
} else if (CODEX_VARIADIC_VALUE_FLAGS.has(arg)) {
|
|
135
|
-
// Like clap, take values until the next flag or subcommand name.
|
|
136
|
-
while (index + 1 < args.length && isVariadicFlagValue(args[index + 1])) index++;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function isVariadicFlagValue(arg: string): boolean {
|
|
143
|
-
return !arg.startsWith("-") && !CODEX_SUBCOMMANDS.has(arg);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
interface MappedAgentResult {
|
|
147
|
-
agents: AgentInfo[];
|
|
148
|
-
fallback: ProcessInfo[];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export class CodexAdapter implements AgentAdapter {
|
|
152
|
-
readonly type = "codex" as const;
|
|
153
|
-
readonly processNames = ["codex"] as const;
|
|
154
|
-
|
|
155
|
-
private readonly registry: AgentRegistry;
|
|
156
|
-
private readonly parser: CodexSessionParser;
|
|
157
|
-
private readonly mapper: CodexAgentMapper;
|
|
158
|
-
private readonly codexSessionsDir: string;
|
|
159
|
-
private readonly sessionMappingPath: string;
|
|
160
|
-
private locator?: CodexSessionLocator;
|
|
161
|
-
|
|
162
|
-
constructor(registry: AgentRegistry = AgentRegistry.default()) {
|
|
163
|
-
this.registry = registry;
|
|
164
|
-
this.parser = new CodexSessionParser();
|
|
165
|
-
this.mapper = new CodexAgentMapper(this.parser);
|
|
166
|
-
this.codexSessionsDir = path.join(homeDir(), ".codex", "sessions");
|
|
167
|
-
this.sessionMappingPath = path.join(homeDir(), ".codex", "ai-devkit", "sessions.json");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
canHandle(processInfo: ProcessInfo): boolean {
|
|
171
|
-
return (
|
|
172
|
-
matchesExecutable(processInfo.command, "codex") && !isCodexHelperCommand(processInfo.command)
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
async detectAgents(context?: AgentDetectionContext): Promise<AgentInfo[]> {
|
|
177
|
-
try {
|
|
178
|
-
return await this.detectRunningAgents(context);
|
|
179
|
-
} finally {
|
|
180
|
-
// Drop cached summaries for sessions that were not part of this refresh
|
|
181
|
-
this.parser.pruneSessionCache();
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
private async detectRunningAgents(context?: AgentDetectionContext): Promise<AgentInfo[]> {
|
|
186
|
-
const processes = await this.getCodexProcesses(context);
|
|
187
|
-
if (processes.length === 0) return [];
|
|
188
|
-
|
|
189
|
-
const mappingResult = this.mapSessionMappingMatches(processes);
|
|
190
|
-
const cacheResult = this.mapRegistryCache(mappingResult.fallback);
|
|
191
|
-
const locatorResult = this.createLocator().matchRunningProcesses(cacheResult.fallback);
|
|
192
|
-
|
|
193
|
-
const directResult = this.mapDirectMatches(locatorResult.direct);
|
|
194
|
-
const legacyResult = this.mapLegacyMatches(locatorResult.legacyMatches);
|
|
195
|
-
const unmatchedProcesses = this.findUnmatchedProcesses(locatorResult.fallback, [
|
|
196
|
-
...directResult.agents,
|
|
197
|
-
...legacyResult.agents,
|
|
198
|
-
]);
|
|
199
|
-
|
|
200
|
-
return [
|
|
201
|
-
...mappingResult.agents,
|
|
202
|
-
...cacheResult.agents,
|
|
203
|
-
...directResult.agents,
|
|
204
|
-
...legacyResult.agents,
|
|
205
|
-
...directResult.fallback.map((processInfo) => this.mapper.mapProcessOnlyAgent(processInfo)),
|
|
206
|
-
...unmatchedProcesses.map((processInfo) => this.mapper.mapProcessOnlyAgent(processInfo)),
|
|
207
|
-
];
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
getConversation(sessionFilePath: string, options?: ConversationOptions): ConversationMessage[] {
|
|
211
|
-
return this.parser.getConversation(sessionFilePath, options);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
async listSessions(opts?: ListSessionsOptions): Promise<SessionSummary[]> {
|
|
215
|
-
const summaries: SessionSummary[] = [];
|
|
216
|
-
|
|
217
|
-
for (const filePath of this.createLocator().discoverHistoricalSessionFiles()) {
|
|
218
|
-
const summary = this.parser.fileToSessionSummary(filePath);
|
|
219
|
-
if (!summary) continue;
|
|
220
|
-
if (opts?.cwd !== undefined && summary.cwd !== opts.cwd) continue;
|
|
221
|
-
summaries.push(summary);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return summaries;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
async findSessionsById(sessionId: string): Promise<SessionSummary[]> {
|
|
228
|
-
const sessionFile = this.createLocator().findSessionFileById(sessionId);
|
|
229
|
-
if (!sessionFile) return [];
|
|
230
|
-
|
|
231
|
-
const summary = this.parser.fileToSessionSummary(sessionFile.filePath);
|
|
232
|
-
return summary?.sessionId === sessionId ? [summary] : [];
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
private async getCodexProcesses(context?: AgentDetectionContext): Promise<ProcessInfo[]> {
|
|
236
|
-
return (await findHarnessProcesses(this, context)).processes;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/** Reused across refreshes so the locator's session_meta and negative caches persist. */
|
|
240
|
-
private createLocator(): CodexSessionLocator {
|
|
241
|
-
this.locator ??= new CodexSessionLocator({ sessionsDir: this.codexSessionsDir }, this.parser);
|
|
242
|
-
return this.locator;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
private createSessionMapping(): CodexSessionMapping {
|
|
246
|
-
return new CodexSessionMapping({
|
|
247
|
-
mappingPath: this.sessionMappingPath,
|
|
248
|
-
sessionsDir: this.codexSessionsDir,
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
private mapSessionMappingMatches(processes: ProcessInfo[]): MappedAgentResult {
|
|
253
|
-
const { matches, fallback } = this.createSessionMapping().match(processes);
|
|
254
|
-
const agents: AgentInfo[] = [];
|
|
255
|
-
|
|
256
|
-
for (const match of matches) {
|
|
257
|
-
const session = this.parser.readSessionIncremental(match.filePath);
|
|
258
|
-
if (session) {
|
|
259
|
-
agents.push(this.mapper.mapSessionToAgent(session, match.process, match.filePath));
|
|
260
|
-
} else {
|
|
261
|
-
fallback.push(match.process);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return { agents, fallback };
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
private mapRegistryCache(processes: ProcessInfo[]): MappedAgentResult {
|
|
269
|
-
const agents: AgentInfo[] = [];
|
|
270
|
-
const fallback: ProcessInfo[] = [];
|
|
271
|
-
const byPid = new Map(this.registry.list().map((entry) => [entry.pid, entry]));
|
|
272
|
-
|
|
273
|
-
for (const processInfo of processes) {
|
|
274
|
-
const entry = byPid.get(processInfo.pid);
|
|
275
|
-
if (
|
|
276
|
-
!entry ||
|
|
277
|
-
entry.type !== this.type ||
|
|
278
|
-
!entry.sessionFilePath ||
|
|
279
|
-
!fs.existsSync(entry.sessionFilePath)
|
|
280
|
-
) {
|
|
281
|
-
fallback.push(processInfo);
|
|
282
|
-
continue;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const session = this.parser.readSessionIncremental(entry.sessionFilePath);
|
|
286
|
-
if (!session) {
|
|
287
|
-
fallback.push(processInfo);
|
|
288
|
-
continue;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
agents.push(this.mapper.mapSessionToAgent(session, processInfo, entry.sessionFilePath));
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return { agents, fallback };
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
private mapDirectMatches(matches: CodexDirectMatch[]): MappedAgentResult {
|
|
298
|
-
const agents: AgentInfo[] = [];
|
|
299
|
-
const fallback: ProcessInfo[] = [];
|
|
300
|
-
|
|
301
|
-
for (const match of matches) {
|
|
302
|
-
const session = this.parser.readSessionIncremental(match.sessionFile.filePath);
|
|
303
|
-
if (session) {
|
|
304
|
-
agents.push(
|
|
305
|
-
this.mapper.mapSessionToAgent(session, match.process, match.sessionFile.filePath),
|
|
306
|
-
);
|
|
307
|
-
} else {
|
|
308
|
-
fallback.push(match.process);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return { agents, fallback };
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
private mapLegacyMatches(
|
|
316
|
-
matches: Array<{ process: ProcessInfo; session: { filePath: string } }>,
|
|
317
|
-
): MappedAgentResult {
|
|
318
|
-
const agents: AgentInfo[] = [];
|
|
319
|
-
const fallback: ProcessInfo[] = [];
|
|
320
|
-
|
|
321
|
-
for (const match of matches) {
|
|
322
|
-
const session = this.parser.readSessionIncremental(match.session.filePath);
|
|
323
|
-
if (session) {
|
|
324
|
-
agents.push(this.mapper.mapSessionToAgent(session, match.process, match.session.filePath));
|
|
325
|
-
} else {
|
|
326
|
-
fallback.push(match.process);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
return { agents, fallback };
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
private findUnmatchedProcesses(processes: ProcessInfo[], agents: AgentInfo[]): ProcessInfo[] {
|
|
334
|
-
const matchedPids = new Set(agents.map((agent) => agent.pid));
|
|
335
|
-
return processes.filter((processInfo) => !matchedPids.has(processInfo.pid));
|
|
336
|
-
}
|
|
337
|
-
}
|