@ai-devkit/agent-manager 0.37.0 → 0.38.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 +0 -4
- package/dist/AgentManager.d.ts.map +1 -1
- package/dist/AgentManager.js +2 -2
- package/dist/AgentManager.js.map +1 -1
- package/dist/__tests__/capacity/anthropic.test.js +115 -0
- package/dist/__tests__/capacity/anthropic.test.js.map +1 -0
- package/dist/__tests__/capacity/boundaries.test.js +45 -0
- package/dist/__tests__/capacity/boundaries.test.js.map +1 -0
- package/dist/__tests__/capacity/claude.test.js +3 -3
- package/dist/__tests__/capacity/claude.test.js.map +1 -1
- package/dist/__tests__/capacity/codex.test.js +3 -1
- package/dist/__tests__/capacity/codex.test.js.map +1 -1
- package/dist/__tests__/capacity/openai.test.js +21 -12
- package/dist/__tests__/capacity/openai.test.js.map +1 -1
- package/dist/__tests__/capacity/wham.test.js +1 -1
- package/dist/__tests__/capacity/wham.test.js.map +1 -1
- package/dist/__tests__/capacity/zai.test.js +7 -8
- package/dist/__tests__/capacity/zai.test.js.map +1 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js +2 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js.map +1 -1
- package/dist/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.js.map +1 -1
- package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js +7 -15
- package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js.map +1 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js +3 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js.map +1 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js +11 -26
- package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js.map +1 -1
- package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js +3 -7
- package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js.map +1 -1
- package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js +5 -11
- package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js.map +1 -1
- package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js +9 -19
- package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js.map +1 -1
- package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js +3 -7
- package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js.map +1 -1
- package/dist/__tests__/{readiness → harnesses/readiness}/AgentReadiness.test.js +31 -10
- package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js.map +1 -0
- package/dist/__tests__/harnesses/runtimeProfiles.test.js +89 -0
- package/dist/__tests__/harnesses/runtimeProfiles.test.js.map +1 -0
- package/dist/__tests__/print/DurableAgent.test.js +4 -6
- package/dist/__tests__/print/DurableAgent.test.js.map +1 -1
- package/dist/__tests__/print/DurableAgentRepository.test.js +1 -12
- package/dist/__tests__/print/DurableAgentRepository.test.js.map +1 -1
- package/dist/__tests__/runtime/ManagedAgentRuntime.test.js.map +1 -1
- package/dist/__tests__/terminal/TmuxManager.test.js +1 -1
- package/dist/__tests__/terminal/TmuxManager.test.js.map +1 -1
- package/dist/capacity/index.d.ts +9 -19
- package/dist/capacity/index.d.ts.map +1 -1
- package/dist/capacity/index.js +11 -4
- package/dist/capacity/index.js.map +1 -1
- package/dist/capacity/providers/anthropic.d.ts +9 -0
- package/dist/capacity/providers/anthropic.d.ts.map +1 -0
- package/dist/capacity/{claude.js → providers/anthropic.js} +10 -128
- package/dist/capacity/providers/anthropic.js.map +1 -0
- package/dist/capacity/providers/openai-platform.d.ts +14 -0
- package/dist/capacity/providers/openai-platform.d.ts.map +1 -0
- package/dist/capacity/providers/openai-platform.js +120 -0
- package/dist/capacity/providers/openai-platform.js.map +1 -0
- package/dist/capacity/providers/openai-subscription.d.ts +20 -0
- package/dist/capacity/providers/openai-subscription.d.ts.map +1 -0
- package/dist/capacity/providers/openai-subscription.js +129 -0
- package/dist/capacity/providers/openai-subscription.js.map +1 -0
- package/dist/capacity/providers/zai.d.ts +8 -0
- package/dist/capacity/providers/zai.d.ts.map +1 -0
- package/dist/capacity/{zai.js → providers/zai.js} +17 -62
- package/dist/capacity/providers/zai.js.map +1 -0
- package/dist/capacity/sources/claude.d.ts +9 -0
- package/dist/capacity/sources/claude.d.ts.map +1 -0
- package/dist/capacity/sources/claude.js +17 -0
- package/dist/capacity/sources/claude.js.map +1 -0
- package/dist/capacity/{codex.d.ts → sources/codex.d.ts} +5 -9
- package/dist/capacity/sources/codex.d.ts.map +1 -0
- package/dist/capacity/{codex.js → sources/codex.js} +31 -84
- package/dist/capacity/sources/codex.js.map +1 -0
- package/dist/capacity/sources/pi.d.ts +30 -0
- package/dist/capacity/sources/pi.d.ts.map +1 -0
- package/dist/capacity/sources/pi.js +81 -0
- package/dist/capacity/sources/pi.js.map +1 -0
- package/dist/capacity/types.d.ts +2 -0
- package/dist/capacity/types.d.ts.map +1 -1
- package/dist/capacity/types.js +1 -1
- package/dist/capacity/types.js.map +1 -1
- package/dist/harnesses/claude/credentials.d.ts +10 -0
- package/dist/harnesses/claude/credentials.d.ts.map +1 -0
- package/dist/harnesses/claude/credentials.js +112 -0
- package/dist/harnesses/claude/credentials.js.map +1 -0
- package/dist/harnesses/claude/readiness.d.ts +3 -0
- package/dist/harnesses/claude/readiness.d.ts.map +1 -0
- package/dist/harnesses/claude/readiness.js +63 -0
- package/dist/harnesses/claude/readiness.js.map +1 -0
- package/dist/harnesses/codex/credentials.d.ts +15 -0
- package/dist/harnesses/codex/credentials.d.ts.map +1 -0
- package/dist/harnesses/codex/credentials.js +58 -0
- package/dist/harnesses/codex/credentials.js.map +1 -0
- package/dist/harnesses/codex/readiness.d.ts +3 -0
- package/dist/harnesses/codex/readiness.d.ts.map +1 -0
- package/dist/harnesses/codex/readiness.js +60 -0
- package/dist/harnesses/codex/readiness.js.map +1 -0
- package/dist/harnesses/copilot/readiness.d.ts +3 -0
- package/dist/harnesses/copilot/readiness.d.ts.map +1 -0
- package/dist/harnesses/copilot/readiness.js +39 -0
- package/dist/harnesses/copilot/readiness.js.map +1 -0
- package/dist/harnesses/opencode/readiness.d.ts +3 -0
- package/dist/harnesses/opencode/readiness.d.ts.map +1 -0
- package/dist/harnesses/opencode/readiness.js +50 -0
- package/dist/harnesses/opencode/readiness.js.map +1 -0
- package/dist/harnesses/pi/credentials.d.ts +22 -0
- package/dist/harnesses/pi/credentials.d.ts.map +1 -0
- package/dist/harnesses/pi/credentials.js +98 -0
- package/dist/harnesses/pi/credentials.js.map +1 -0
- package/dist/harnesses/pi/readiness.d.ts +3 -0
- package/dist/harnesses/pi/readiness.d.ts.map +1 -0
- package/dist/harnesses/pi/readiness.js +96 -0
- package/dist/harnesses/pi/readiness.js.map +1 -0
- package/dist/harnesses/readiness/AgentReadiness.d.ts +6 -0
- package/dist/harnesses/readiness/AgentReadiness.d.ts.map +1 -0
- package/dist/harnesses/readiness/AgentReadiness.js +68 -0
- package/dist/harnesses/readiness/AgentReadiness.js.map +1 -0
- package/dist/harnesses/readiness/checks.d.ts +31 -0
- package/dist/harnesses/readiness/checks.d.ts.map +1 -0
- package/dist/harnesses/readiness/checks.js +270 -0
- package/dist/harnesses/readiness/checks.js.map +1 -0
- package/dist/{readiness/AgentReadiness.d.ts → harnesses/readiness/types.d.ts} +19 -10
- package/dist/harnesses/readiness/types.d.ts.map +1 -0
- package/dist/harnesses/readiness/types.js +4 -0
- package/dist/harnesses/readiness/types.js.map +1 -0
- package/dist/harnesses/runtimeProfiles.d.ts +11 -0
- package/dist/harnesses/runtimeProfiles.d.ts.map +1 -0
- package/dist/harnesses/runtimeProfiles.js +99 -0
- package/dist/harnesses/runtimeProfiles.js.map +1 -0
- package/dist/index.d.ts +16 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -23
- package/dist/index.js.map +1 -1
- package/dist/runtime/ManagedAgentRuntime.d.ts +3 -3
- package/dist/runtime/ManagedAgentRuntime.d.ts.map +1 -1
- package/dist/runtime/ManagedAgentRuntime.js +6 -20
- package/dist/runtime/ManagedAgentRuntime.js.map +1 -1
- package/dist/runtime/herdr/HerdrAgentDiscovery.d.ts.map +1 -1
- package/dist/runtime/herdr/HerdrAgentDiscovery.js +2 -43
- package/dist/runtime/herdr/HerdrAgentDiscovery.js.map +1 -1
- package/dist/runtime/tmux/PidPolling.d.ts +1 -1
- package/dist/runtime/tmux/PidPolling.d.ts.map +1 -1
- package/dist/runtime/tmux/PidPolling.js.map +1 -1
- package/dist/runtime/tmux/TmuxAgentRuntime.d.ts +1 -1
- package/dist/runtime/tmux/TmuxAgentRuntime.d.ts.map +1 -1
- package/dist/runtime/tmux/TmuxAgentRuntime.js +1 -1
- package/dist/runtime/tmux/TmuxAgentRuntime.js.map +1 -1
- package/dist/runtime/tmux/TmuxManager.d.ts +12 -0
- package/dist/runtime/tmux/TmuxManager.d.ts.map +1 -0
- package/dist/{terminal → runtime/tmux}/TmuxManager.js +9 -28
- package/dist/runtime/tmux/TmuxManager.js.map +1 -0
- package/dist/runtime/types.d.ts +1 -1
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js.map +1 -1
- package/dist/terminal/TerminalFocusManager.d.ts +4 -32
- package/dist/terminal/TerminalFocusManager.d.ts.map +1 -1
- package/dist/terminal/TerminalFocusManager.js +17 -267
- package/dist/terminal/TerminalFocusManager.js.map +1 -1
- package/dist/terminal/TtyWriter.d.ts +1 -44
- package/dist/terminal/TtyWriter.d.ts.map +1 -1
- package/dist/terminal/TtyWriter.js +11 -347
- package/dist/terminal/TtyWriter.js.map +1 -1
- package/dist/terminal/backends/index.d.ts +5 -0
- package/dist/terminal/backends/index.d.ts.map +1 -0
- package/dist/terminal/backends/index.js +19 -0
- package/dist/terminal/backends/index.js.map +1 -0
- package/dist/terminal/backends/iterm2.d.ts +3 -0
- package/dist/terminal/backends/iterm2.d.ts.map +1 -0
- package/dist/terminal/backends/iterm2.js +135 -0
- package/dist/terminal/backends/iterm2.js.map +1 -0
- package/dist/terminal/backends/shared.d.ts +7 -0
- package/dist/terminal/backends/shared.d.ts.map +1 -0
- package/dist/terminal/backends/shared.js +35 -0
- package/dist/terminal/backends/shared.js.map +1 -0
- package/dist/terminal/backends/terminal-app.d.ts +3 -0
- package/dist/terminal/backends/terminal-app.d.ts.map +1 -0
- package/dist/terminal/backends/terminal-app.js +129 -0
- package/dist/terminal/backends/terminal-app.js.map +1 -0
- package/dist/terminal/backends/tmux.d.ts +3 -0
- package/dist/terminal/backends/tmux.d.ts.map +1 -0
- package/dist/terminal/backends/tmux.js +76 -0
- package/dist/terminal/backends/tmux.js.map +1 -0
- package/dist/terminal/backends/wezterm.d.ts +3 -0
- package/dist/terminal/backends/wezterm.d.ts.map +1 -0
- package/dist/terminal/backends/wezterm.js +71 -0
- package/dist/terminal/backends/wezterm.js.map +1 -0
- package/dist/terminal/types.d.ts +21 -0
- package/dist/terminal/types.d.ts.map +1 -0
- package/dist/terminal/types.js +10 -0
- package/dist/terminal/types.js.map +1 -0
- package/package.json +1 -1
- package/src/AgentManager.ts +1 -1
- package/src/__tests__/capacity/anthropic.test.ts +105 -0
- package/src/__tests__/capacity/boundaries.test.ts +36 -0
- package/src/__tests__/capacity/claude.test.ts +3 -8
- package/src/__tests__/capacity/codex.test.ts +12 -35
- package/src/__tests__/capacity/fixtures/openai-codex-auth.json +1 -1
- package/src/__tests__/capacity/openai.test.ts +15 -15
- package/src/__tests__/capacity/wham.test.ts +1 -1
- package/src/__tests__/capacity/zai.test.ts +27 -62
- package/src/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.ts +2 -2
- package/src/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.ts +1 -1
- package/src/__tests__/harnesses/codex/durable/CodexCliProbe.test.ts +14 -19
- package/src/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.ts +3 -3
- package/src/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.ts +24 -30
- package/src/__tests__/harnesses/codex/durable/CodexPrintRunner.test.ts +4 -8
- package/src/__tests__/harnesses/pi/durable/PiCliProbe.test.ts +7 -11
- package/src/__tests__/harnesses/pi/durable/PiPrintAgentService.test.ts +19 -22
- package/src/__tests__/harnesses/pi/durable/PiPrintRunner.test.ts +7 -8
- package/src/__tests__/{readiness → harnesses/readiness}/AgentReadiness.test.ts +36 -9
- package/src/__tests__/harnesses/runtimeProfiles.test.ts +110 -0
- package/src/__tests__/print/DurableAgent.test.ts +4 -13
- package/src/__tests__/print/DurableAgentRepository.test.ts +1 -13
- package/src/__tests__/runtime/ManagedAgentRuntime.test.ts +1 -1
- package/src/__tests__/terminal/TmuxManager.test.ts +1 -1
- package/src/capacity/index.ts +29 -23
- package/src/capacity/{claude.ts → providers/anthropic.ts} +16 -131
- package/src/capacity/providers/openai-platform.ts +150 -0
- package/src/capacity/{wham.ts → providers/openai-subscription.ts} +86 -8
- package/src/capacity/{zai.ts → providers/zai.ts} +29 -111
- package/src/capacity/sources/claude.ts +30 -0
- package/src/capacity/{codex.ts → sources/codex.ts} +54 -124
- package/src/capacity/sources/pi.ts +131 -0
- package/src/capacity/types.ts +3 -0
- package/src/harnesses/claude/credentials.ts +122 -0
- package/src/harnesses/claude/readiness.ts +69 -0
- package/src/harnesses/codex/credentials.ts +81 -0
- package/src/harnesses/codex/readiness.ts +72 -0
- package/src/harnesses/copilot/readiness.ts +33 -0
- package/src/harnesses/opencode/readiness.ts +48 -0
- package/src/harnesses/pi/credentials.ts +129 -0
- package/src/harnesses/pi/readiness.ts +104 -0
- package/src/harnesses/readiness/AgentReadiness.ts +87 -0
- package/src/harnesses/readiness/checks.ts +336 -0
- package/src/harnesses/readiness/types.ts +90 -0
- package/src/{utils/agents.ts → harnesses/runtimeProfiles.ts} +34 -38
- package/src/index.ts +15 -128
- package/src/runtime/ManagedAgentRuntime.ts +7 -22
- package/src/runtime/herdr/HerdrAgentDiscovery.ts +3 -19
- package/src/runtime/tmux/PidPolling.ts +1 -1
- package/src/runtime/tmux/TmuxAgentRuntime.ts +1 -1
- package/src/{terminal → runtime/tmux}/TmuxManager.ts +9 -30
- package/src/runtime/types.ts +1 -1
- package/src/terminal/TerminalFocusManager.ts +19 -292
- package/src/terminal/TtyWriter.ts +16 -336
- package/src/terminal/backends/index.ts +21 -0
- package/src/terminal/backends/iterm2.ts +126 -0
- package/src/terminal/backends/shared.ts +42 -0
- package/src/terminal/backends/terminal-app.ts +122 -0
- package/src/terminal/backends/tmux.ts +62 -0
- package/src/terminal/backends/wezterm.ts +65 -0
- package/src/terminal/types.ts +22 -0
- package/dist/__tests__/readiness/AgentReadiness.test.js.map +0 -1
- package/dist/__tests__/utils/agents.test.js +0 -93
- package/dist/__tests__/utils/agents.test.js.map +0 -1
- package/dist/capacity/claude.d.ts +0 -17
- package/dist/capacity/claude.d.ts.map +0 -1
- package/dist/capacity/claude.js.map +0 -1
- package/dist/capacity/codex.d.ts.map +0 -1
- package/dist/capacity/codex.js.map +0 -1
- package/dist/capacity/openai.d.ts +0 -47
- package/dist/capacity/openai.d.ts.map +0 -1
- package/dist/capacity/openai.js +0 -307
- package/dist/capacity/openai.js.map +0 -1
- package/dist/capacity/wham.d.ts +0 -16
- package/dist/capacity/wham.d.ts.map +0 -1
- package/dist/capacity/wham.js +0 -66
- package/dist/capacity/wham.js.map +0 -1
- package/dist/capacity/zai.d.ts +0 -14
- package/dist/capacity/zai.d.ts.map +0 -1
- package/dist/capacity/zai.js.map +0 -1
- package/dist/readiness/AgentReadiness.d.ts.map +0 -1
- package/dist/readiness/AgentReadiness.js +0 -614
- package/dist/readiness/AgentReadiness.js.map +0 -1
- package/dist/terminal/TmuxManager.d.ts +0 -28
- package/dist/terminal/TmuxManager.d.ts.map +0 -1
- package/dist/terminal/TmuxManager.js.map +0 -1
- package/dist/terminal/index.d.ts +0 -5
- package/dist/terminal/index.d.ts.map +0 -1
- package/dist/terminal/index.js +0 -5
- package/dist/terminal/index.js.map +0 -1
- package/dist/utils/agents.d.ts +0 -16
- package/dist/utils/agents.d.ts.map +0 -1
- package/dist/utils/agents.js +0 -117
- package/dist/utils/agents.js.map +0 -1
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -6
- package/dist/utils/index.js.map +0 -1
- package/src/__tests__/utils/agents.test.ts +0 -105
- package/src/capacity/openai.ts +0 -355
- package/src/readiness/AgentReadiness.ts +0 -730
- package/src/terminal/index.ts +0 -4
- package/src/utils/index.ts +0 -14
package/src/index.ts
CHANGED
|
@@ -1,73 +1,41 @@
|
|
|
1
|
-
export { AgentManager
|
|
1
|
+
export { AgentManager } from "./AgentManager.js";
|
|
2
2
|
export {
|
|
3
|
+
getAnthropicCapacityReport,
|
|
3
4
|
getClaudeCapacityReport,
|
|
4
5
|
getCodexCapacityReport,
|
|
5
6
|
getOpenAiCapacityReport,
|
|
6
7
|
getZaiCapacityReport,
|
|
7
8
|
} from "./capacity/index.js";
|
|
8
|
-
export type {
|
|
9
|
-
|
|
10
|
-
CapacityProbeOptions,
|
|
11
|
-
CapacityReport,
|
|
12
|
-
CapacityWindow,
|
|
13
|
-
OpenAiCapacityOptions,
|
|
14
|
-
ZaiCapacityOptions,
|
|
15
|
-
} from "./capacity/index.js";
|
|
9
|
+
export type { CapacityReport, CapacityWindow } from "./capacity/index.js";
|
|
10
|
+
|
|
16
11
|
export {
|
|
17
|
-
getAgentReadinessReport,
|
|
18
12
|
getAgentReadinessReports,
|
|
19
13
|
worstReadinessStatus,
|
|
20
|
-
} from "./readiness/AgentReadiness.js";
|
|
14
|
+
} from "./harnesses/readiness/AgentReadiness.js";
|
|
21
15
|
export type {
|
|
22
16
|
AgentReadinessOptions,
|
|
23
17
|
AgentReadinessReport,
|
|
24
|
-
AuthReadinessCheck,
|
|
25
|
-
BuiltInSkillsReadinessCheck,
|
|
26
|
-
DirectoryReadinessCheck,
|
|
27
|
-
ExecutableReadinessCheck,
|
|
28
|
-
IntegrationReadinessCheck,
|
|
29
18
|
ReadinessAgentType,
|
|
30
|
-
ReadinessAuthState,
|
|
31
|
-
ReadinessCheck,
|
|
32
19
|
ReadinessStatus,
|
|
33
|
-
} from "./readiness/AgentReadiness.js";
|
|
20
|
+
} from "./harnesses/readiness/AgentReadiness.js";
|
|
34
21
|
|
|
35
|
-
export { ClaudeCodeAdapter } from "./harnesses/claude/ClaudeCodeAdapter.js";
|
|
36
|
-
export { CodexAdapter } from "./harnesses/codex/CodexAdapter.js";
|
|
37
|
-
export { CopilotAdapter } from "./harnesses/copilot/CopilotAdapter.js";
|
|
38
|
-
export { GeminiCliAdapter } from "./harnesses/gemini/GeminiCliAdapter.js";
|
|
39
|
-
export { GrokCliAdapter } from "./harnesses/grok/GrokCliAdapter.js";
|
|
40
|
-
export { AntigravityCliAdapter } from "./harnesses/antigravity/AntigravityCliAdapter.js";
|
|
41
|
-
export { KiroAdapter } from "./harnesses/kiro/KiroAdapter.js";
|
|
42
|
-
export { OpenCodeAdapter } from "./harnesses/opencode/OpenCodeAdapter.js";
|
|
43
|
-
export { PiAdapter } from "./harnesses/pi/PiAdapter.js";
|
|
44
22
|
export { createBuiltinAdapters } from "./harnesses/index.js";
|
|
23
|
+
export { HARNESS_RUNTIME_PROFILES, type StartableAgentType } from "./harnesses/runtimeProfiles.js";
|
|
45
24
|
export { AGENT_TYPES, AgentStatus } from "./adapters/AgentAdapter.js";
|
|
46
25
|
export type {
|
|
47
26
|
AgentAdapter,
|
|
48
27
|
AgentType,
|
|
49
28
|
AgentInfo,
|
|
50
|
-
ProcessInfo,
|
|
51
29
|
ConversationMessage,
|
|
52
|
-
ConversationOptions,
|
|
53
30
|
SessionSummary,
|
|
54
31
|
ListSessionsOptions,
|
|
55
|
-
AgentDetectionContext,
|
|
56
32
|
} from "./adapters/AgentAdapter.js";
|
|
57
33
|
|
|
58
|
-
export { TerminalFocusManager
|
|
59
|
-
export
|
|
34
|
+
export { TerminalFocusManager } from "./terminal/TerminalFocusManager.js";
|
|
35
|
+
export { TerminalType } from "./terminal/types.js";
|
|
36
|
+
export type { TerminalLocation } from "./terminal/types.js";
|
|
60
37
|
export { TtyWriter } from "./terminal/TtyWriter.js";
|
|
61
38
|
|
|
62
|
-
export type { AgentManagerOptions, ListAgentsOptions } from "./AgentManager.js";
|
|
63
|
-
export {
|
|
64
|
-
extractHerdrAgentPanes,
|
|
65
|
-
fetchHerdrAgentPanes,
|
|
66
|
-
findMatchingHerdrPane,
|
|
67
|
-
herdrPaneToRuntimeRef,
|
|
68
|
-
} from "./runtime/herdr/HerdrAgentDiscovery.js";
|
|
69
|
-
export type { HerdrAgentPane } from "./runtime/herdr/HerdrAgentDiscovery.js";
|
|
70
|
-
|
|
71
39
|
export {
|
|
72
40
|
AgentRegistry,
|
|
73
41
|
RenameNotFoundError,
|
|
@@ -75,14 +43,8 @@ export {
|
|
|
75
43
|
AGENT_RUNTIME_PROVIDERS,
|
|
76
44
|
parseTmuxRuntimeRef,
|
|
77
45
|
} from "./utils/AgentRegistry.js";
|
|
78
|
-
export type {
|
|
79
|
-
|
|
80
|
-
RegistryEntry,
|
|
81
|
-
AgentRuntimeProvider,
|
|
82
|
-
TmuxRuntimeRef,
|
|
83
|
-
} from "./utils/AgentRegistry.js";
|
|
84
|
-
export { TmuxManager } from "./terminal/TmuxManager.js";
|
|
85
|
-
export type { AgentRuntimeAvailability, InteractiveAgentRuntime } from "./runtime/types.js";
|
|
46
|
+
export type { AgentRuntimeProvider } from "./utils/AgentRegistry.js";
|
|
47
|
+
export type { InteractiveAgentRuntime } from "./runtime/types.js";
|
|
86
48
|
export {
|
|
87
49
|
startAgent,
|
|
88
50
|
stopAgent,
|
|
@@ -93,90 +55,15 @@ export {
|
|
|
93
55
|
AgentPidPollTimeoutError,
|
|
94
56
|
AgentRuntimeUnavailableError,
|
|
95
57
|
AgentTerminalNotFoundError,
|
|
96
|
-
DEFAULT_PID_POLL_INTERVAL_MS,
|
|
97
58
|
DEFAULT_PID_POLL_TIMEOUT_MS,
|
|
98
59
|
} from "./runtime/ManagedAgentRuntime.js";
|
|
99
|
-
export type {
|
|
100
|
-
FocusAgentDeps,
|
|
101
|
-
StartAgentDeps,
|
|
102
|
-
StartAgentOptions,
|
|
103
|
-
StopAgentDeps,
|
|
104
|
-
StopAgentResult,
|
|
105
|
-
FocusAgentResult,
|
|
106
|
-
SendAgentPromptDeps,
|
|
107
|
-
} from "./runtime/ManagedAgentRuntime.js";
|
|
108
|
-
export { AGENTS } from "./utils/agents.js";
|
|
109
|
-
export type { AgentConfig, StartableAgentType } from "./utils/agents.js";
|
|
110
60
|
|
|
111
61
|
export type { AgentRequest } from "./utils/agent-requests.js";
|
|
112
|
-
export {
|
|
113
|
-
getAgentRequestPath,
|
|
114
|
-
readLatestAgentRequest,
|
|
115
|
-
writeAgentRequest,
|
|
116
|
-
} from "./utils/agent-requests.js";
|
|
62
|
+
export { readLatestAgentRequest, writeAgentRequest } from "./utils/agent-requests.js";
|
|
117
63
|
|
|
118
|
-
export {
|
|
119
|
-
|
|
120
|
-
DurableAgentError,
|
|
121
|
-
DurableAgentBusyError,
|
|
122
|
-
DurableAgentNotFoundError,
|
|
123
|
-
DurableAgentRepositoryError,
|
|
124
|
-
DurableAgentNameConflictError,
|
|
125
|
-
ClaudePrintError,
|
|
126
|
-
CodexPrintError,
|
|
127
|
-
PiPrintError,
|
|
128
|
-
} from "./durable/DurableAgent.js";
|
|
129
|
-
export type {
|
|
130
|
-
DurableAgent,
|
|
131
|
-
DurableAgentBase,
|
|
132
|
-
ClaudeDurableAgent,
|
|
133
|
-
CodexDurableAgent,
|
|
134
|
-
PiDurableAgent,
|
|
135
|
-
DurableProvider,
|
|
136
|
-
CodexPrintErrorCode,
|
|
137
|
-
DurableAgentState,
|
|
138
|
-
DurableSessionHealth,
|
|
139
|
-
DurableRunStatus,
|
|
140
|
-
DurableActiveRun,
|
|
141
|
-
DurableLastResult,
|
|
142
|
-
PiPrintErrorCode,
|
|
143
|
-
ProcessIdentity,
|
|
144
|
-
} from "./durable/DurableAgent.js";
|
|
64
|
+
export { AGENT_MODES } from "./durable/DurableAgent.js";
|
|
65
|
+
export type { DurableProvider } from "./durable/DurableAgent.js";
|
|
145
66
|
export { DurableAgentRepository } from "./durable/DurableAgentRepository.js";
|
|
146
|
-
export type {
|
|
147
|
-
CreateDurableAgentInput,
|
|
148
|
-
DurableAgentRepositoryOptions,
|
|
149
|
-
ProcessInspector,
|
|
150
|
-
DurableRunCompletion,
|
|
151
|
-
} from "./durable/DurableAgentRepository.js";
|
|
152
67
|
export { ClaudePrintAgentService } from "./harnesses/claude/durable/ClaudePrintAgentService.js";
|
|
153
|
-
export type {
|
|
154
|
-
ClaudePrintAgentServiceOptions,
|
|
155
|
-
ClaudePrintSendResult,
|
|
156
|
-
} from "./harnesses/claude/durable/ClaudePrintAgentService.js";
|
|
157
|
-
export { CodexCliProbe } from "./harnesses/codex/durable/CodexCliProbe.js";
|
|
158
|
-
export type { CodexCliProbeOptions } from "./harnesses/codex/durable/CodexCliProbe.js";
|
|
159
|
-
export { CodexPrintRunner } from "./harnesses/codex/durable/CodexPrintRunner.js";
|
|
160
|
-
export type {
|
|
161
|
-
CodexPrintRunnerOptions,
|
|
162
|
-
CodexPrintRunRequest,
|
|
163
|
-
CodexPrintRunResult,
|
|
164
|
-
} from "./harnesses/codex/durable/CodexPrintRunner.js";
|
|
165
68
|
export { CodexPrintAgentService } from "./harnesses/codex/durable/CodexPrintAgentService.js";
|
|
166
|
-
export type {
|
|
167
|
-
CodexPrintAgentServiceOptions,
|
|
168
|
-
CodexPrintSendResult,
|
|
169
|
-
} from "./harnesses/codex/durable/CodexPrintAgentService.js";
|
|
170
|
-
export { PiCliProbe } from "./harnesses/pi/durable/PiCliProbe.js";
|
|
171
|
-
export type { PiCliProbeOptions } from "./harnesses/pi/durable/PiCliProbe.js";
|
|
172
|
-
export { PiPrintRunner } from "./harnesses/pi/durable/PiPrintRunner.js";
|
|
173
|
-
export type {
|
|
174
|
-
PiPrintRunnerOptions,
|
|
175
|
-
PiPrintRunRequest,
|
|
176
|
-
PiPrintRunResult,
|
|
177
|
-
} from "./harnesses/pi/durable/PiPrintRunner.js";
|
|
178
69
|
export { PiPrintAgentService } from "./harnesses/pi/durable/PiPrintAgentService.js";
|
|
179
|
-
export type {
|
|
180
|
-
PiPrintAgentServiceOptions,
|
|
181
|
-
PiPrintSendResult,
|
|
182
|
-
} from "./harnesses/pi/durable/PiPrintAgentService.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AgentInfo } from "../adapters/AgentAdapter.js";
|
|
2
|
-
import type { TerminalLocation } from "../terminal/
|
|
3
|
-
import { TmuxManager } from "
|
|
2
|
+
import type { TerminalLocation } from "../terminal/types.js";
|
|
3
|
+
import { TmuxManager } from "./tmux/TmuxManager.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentRegistry,
|
|
6
6
|
type AgentRuntimeProvider,
|
|
7
7
|
type RegistryEntry,
|
|
8
8
|
} from "../utils/AgentRegistry.js";
|
|
9
|
-
import {
|
|
9
|
+
import { HARNESS_RUNTIME_PROFILES, type StartableAgentType } from "../harnesses/runtimeProfiles.js";
|
|
10
10
|
import { createInteractiveRuntime } from "./RuntimeFactory.js";
|
|
11
11
|
import { DEFAULT_PID_POLL_INTERVAL_MS, DEFAULT_PID_POLL_TIMEOUT_MS } from "./tmux/PidPolling.js";
|
|
12
12
|
import { TmuxAgentRuntime } from "./tmux/TmuxAgentRuntime.js";
|
|
@@ -91,7 +91,7 @@ export async function startAgent(
|
|
|
91
91
|
deps: StartAgentDeps = {},
|
|
92
92
|
): Promise<RegistryEntry> {
|
|
93
93
|
const registry = deps.registry ?? AgentRegistry.default();
|
|
94
|
-
const
|
|
94
|
+
const profile = HARNESS_RUNTIME_PROFILES[opts.type];
|
|
95
95
|
const intervalMs = opts.pollIntervalMs ?? DEFAULT_PID_POLL_INTERVAL_MS;
|
|
96
96
|
const timeoutMs = opts.pollTimeoutMs ?? DEFAULT_PID_POLL_TIMEOUT_MS;
|
|
97
97
|
const provider = opts.runtimeProvider ?? deps.runtime?.provider ?? "tmux";
|
|
@@ -119,13 +119,13 @@ export async function startAgent(
|
|
|
119
119
|
const result = await runtime.startAgent({
|
|
120
120
|
name: opts.name,
|
|
121
121
|
cwd: opts.cwd,
|
|
122
|
-
kind:
|
|
122
|
+
kind: profile.runtimeKind,
|
|
123
123
|
args: [],
|
|
124
124
|
timeoutMs,
|
|
125
125
|
...(provider === "tmux"
|
|
126
126
|
? {
|
|
127
|
-
command:
|
|
128
|
-
matches:
|
|
127
|
+
command: profile.command,
|
|
128
|
+
matches: profile.matches,
|
|
129
129
|
pollIntervalMs: intervalMs,
|
|
130
130
|
}
|
|
131
131
|
: {}),
|
|
@@ -251,18 +251,3 @@ function isHerdrRegistryEntry(
|
|
|
251
251
|
"runtimeRef" in entry
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
|
|
255
|
-
function agentRuntimeKind(type: StartableAgentType, provider: AgentRuntimeProvider): string {
|
|
256
|
-
if (provider === "tmux") return type;
|
|
257
|
-
return {
|
|
258
|
-
claude: "claude",
|
|
259
|
-
codex: "codex",
|
|
260
|
-
copilot: "copilot",
|
|
261
|
-
gemini_cli: "gemini",
|
|
262
|
-
grok_cli: "grok",
|
|
263
|
-
antigravity_cli: "agy",
|
|
264
|
-
opencode: "opencode",
|
|
265
|
-
pi: "pi",
|
|
266
|
-
kiro: "kiro",
|
|
267
|
-
}[type];
|
|
268
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AgentInfo
|
|
1
|
+
import type { AgentInfo } from "../../adapters/AgentAdapter.js";
|
|
2
|
+
import { runtimeAgentMatchesHarness } from "../../harnesses/runtimeProfiles.js";
|
|
2
3
|
import { HerdrCliClient, type HerdrCommandRunner } from "./HerdrCliClient.js";
|
|
3
4
|
import type { HerdrRuntimeRef } from "./HerdrRuntimeRef.js";
|
|
4
5
|
|
|
@@ -70,7 +71,7 @@ export function findMatchingHerdrPane(
|
|
|
70
71
|
if (shellPidMatches.length > 1) return null;
|
|
71
72
|
|
|
72
73
|
const cwdMatches = panes.filter(
|
|
73
|
-
(pane) => pane.cwd === agent.projectPath &&
|
|
74
|
+
(pane) => pane.cwd === agent.projectPath && runtimeAgentMatchesHarness(pane.agent, agent.type),
|
|
74
75
|
);
|
|
75
76
|
return cwdMatches.length === 1 ? cwdMatches[0]! : null;
|
|
76
77
|
}
|
|
@@ -85,23 +86,6 @@ export function herdrPaneToRuntimeRef(pane: HerdrAgentPane, agentName: string):
|
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
function herdrAgentMatchesType(herdrAgent: string, agentType: AgentType): boolean {
|
|
89
|
-
const normalized = herdrAgent.toLowerCase();
|
|
90
|
-
const candidates: Record<AgentType, readonly string[]> = {
|
|
91
|
-
claude: ["claude"],
|
|
92
|
-
codex: ["codex"],
|
|
93
|
-
copilot: ["copilot"],
|
|
94
|
-
gemini_cli: ["gemini", "gemini_cli"],
|
|
95
|
-
grok_cli: ["grok", "grok_cli"],
|
|
96
|
-
antigravity_cli: ["agy", "antigravity", "antigravity_cli"],
|
|
97
|
-
kiro: ["kiro", "kiro_cli", "kiro-cli"],
|
|
98
|
-
opencode: ["opencode"],
|
|
99
|
-
pi: ["pi"],
|
|
100
|
-
other: ["other"],
|
|
101
|
-
};
|
|
102
|
-
return candidates[agentType]?.includes(normalized) ?? false;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
89
|
async function enrichHerdrAgentPanes(
|
|
106
90
|
client: HerdrCliClient,
|
|
107
91
|
panes: HerdrAgentPane[],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TmuxManager } from "
|
|
1
|
+
import { TmuxManager } from "./TmuxManager.js";
|
|
2
2
|
import { TtyWriter } from "../../terminal/TtyWriter.js";
|
|
3
3
|
import { AgentPidPollTimeoutError, AgentTerminalNotFoundError } from "../errors.js";
|
|
4
4
|
import { pollForPid } from "./PidPolling.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { execFile } from "child_process";
|
|
2
|
-
import { promisify } from "util";
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
3
|
|
|
4
4
|
const execFileAsync = promisify(execFile);
|
|
5
5
|
|
|
@@ -38,22 +38,6 @@ export class TmuxManager {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* Find the actual agent process PID inside a tmux pane.
|
|
43
|
-
*
|
|
44
|
-
* Strategy: BFS the process tree, return the deepest process whose
|
|
45
|
-
* `ps` command line is accepted by `matches`. The caller supplies the
|
|
46
|
-
* matcher so this method has no agent-type knowledge.
|
|
47
|
-
*
|
|
48
|
-
* This handles two real-world process shapes:
|
|
49
|
-
* - Wrapper case: shell → claude-wrapper (matches) → claude (matches, deeper)
|
|
50
|
-
* → returns the deeper one
|
|
51
|
-
* - Subprocess case: shell → claude (matches) → MCP server child (doesn't match)
|
|
52
|
-
* → returns claude, not the subprocess
|
|
53
|
-
*
|
|
54
|
-
* Returns null when no process matches yet (agent still starting); the
|
|
55
|
-
* caller's poll loop retries.
|
|
56
|
-
*/
|
|
57
41
|
async findAgentPid(
|
|
58
42
|
session: string,
|
|
59
43
|
matches: (psCommand: string) => boolean,
|
|
@@ -71,12 +55,8 @@ export class TmuxManager {
|
|
|
71
55
|
visited.add(pid);
|
|
72
56
|
|
|
73
57
|
const command = await this.getProcessCommand(pid);
|
|
74
|
-
if (command && matches(command))
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const children = await this.pgrepChildren(pid);
|
|
79
|
-
queue.push(...children);
|
|
58
|
+
if (command && matches(command)) deepestMatch = pid;
|
|
59
|
+
queue.push(...(await this.pgrepChildren(pid)));
|
|
80
60
|
}
|
|
81
61
|
|
|
82
62
|
return deepestMatch;
|
|
@@ -91,8 +71,8 @@ export class TmuxManager {
|
|
|
91
71
|
"-F",
|
|
92
72
|
"#{pane_pid}",
|
|
93
73
|
]);
|
|
94
|
-
const panePid = parseInt(stdout.trim().split("\n")[0], 10);
|
|
95
|
-
return isNaN(panePid) ? null : panePid;
|
|
74
|
+
const panePid = Number.parseInt(stdout.trim().split("\n")[0], 10);
|
|
75
|
+
return Number.isNaN(panePid) ? null : panePid;
|
|
96
76
|
} catch {
|
|
97
77
|
return null;
|
|
98
78
|
}
|
|
@@ -104,8 +84,8 @@ export class TmuxManager {
|
|
|
104
84
|
return stdout
|
|
105
85
|
.trim()
|
|
106
86
|
.split("\n")
|
|
107
|
-
.map((
|
|
108
|
-
.filter((
|
|
87
|
+
.map((value) => Number.parseInt(value, 10))
|
|
88
|
+
.filter((value) => !Number.isNaN(value));
|
|
109
89
|
} catch {
|
|
110
90
|
return [];
|
|
111
91
|
}
|
|
@@ -114,8 +94,7 @@ export class TmuxManager {
|
|
|
114
94
|
private async getProcessCommand(pid: number): Promise<string | null> {
|
|
115
95
|
try {
|
|
116
96
|
const { stdout } = await execFileAsync("ps", ["-p", String(pid), "-o", "command="]);
|
|
117
|
-
|
|
118
|
-
return trimmed || null;
|
|
97
|
+
return stdout.trim() || null;
|
|
119
98
|
} catch {
|
|
120
99
|
return null;
|
|
121
100
|
}
|
package/src/runtime/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentInfo } from "../adapters/AgentAdapter.js";
|
|
2
|
-
import type { TerminalLocation } from "../terminal/
|
|
2
|
+
import type { TerminalLocation } from "../terminal/types.js";
|
|
3
3
|
import type { AgentRuntimeProvider } from "../utils/AgentRegistry.js";
|
|
4
4
|
|
|
5
5
|
export type AgentRuntimeAvailability =
|