@elizaos/plugin-agent-orchestrator 2.0.0-alpha.5 → 2.0.0-alpha.537

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.
Files changed (190) hide show
  1. package/README.md +233 -0
  2. package/assets/claude-code-skills/eliza-runtime/SKILL.md +123 -0
  3. package/assets/claude-code-skills/eliza-runtime/references/hooks.md +82 -0
  4. package/assets/claude-code-skills/eliza-runtime/references/orchestration.md +68 -0
  5. package/assets/claude-code-skills/eliza-runtime/references/synthesis.md +84 -0
  6. package/assets/claude-code-skills/eliza-runtime/scripts/eliza-context.sh +103 -0
  7. package/assets/claude-code-skills/eliza-runtime/scripts/eliza-decision.sh +48 -0
  8. package/assets/claude-code-skills/eliza-runtime/scripts/eliza-parent.sh +143 -0
  9. package/dist/actions/coding-task-handlers.d.ts +64 -0
  10. package/dist/actions/coding-task-handlers.d.ts.map +1 -0
  11. package/dist/actions/coding-task-helpers.d.ts +35 -0
  12. package/dist/actions/coding-task-helpers.d.ts.map +1 -0
  13. package/dist/actions/eval-metadata.d.ts +11 -0
  14. package/dist/actions/eval-metadata.d.ts.map +1 -0
  15. package/dist/actions/finalize-workspace.d.ts +11 -0
  16. package/dist/actions/finalize-workspace.d.ts.map +1 -0
  17. package/dist/actions/list-agents.d.ts +13 -0
  18. package/dist/actions/list-agents.d.ts.map +1 -0
  19. package/dist/actions/manage-issues.d.ts +11 -0
  20. package/dist/actions/manage-issues.d.ts.map +1 -0
  21. package/dist/actions/provision-workspace.d.ts +11 -0
  22. package/dist/actions/provision-workspace.d.ts.map +1 -0
  23. package/dist/actions/send-to-agent.d.ts +12 -0
  24. package/dist/actions/send-to-agent.d.ts.map +1 -0
  25. package/dist/actions/spawn-agent.d.ts +12 -0
  26. package/dist/actions/spawn-agent.d.ts.map +1 -0
  27. package/dist/actions/start-coding-task.d.ts +69 -0
  28. package/dist/actions/start-coding-task.d.ts.map +1 -0
  29. package/dist/actions/stop-agent.d.ts +12 -0
  30. package/dist/actions/stop-agent.d.ts.map +1 -0
  31. package/dist/actions/task-control.d.ts +3 -0
  32. package/dist/actions/task-control.d.ts.map +1 -0
  33. package/dist/actions/task-history.d.ts +3 -0
  34. package/dist/actions/task-history.d.ts.map +1 -0
  35. package/dist/actions/task-share.d.ts +3 -0
  36. package/dist/actions/task-share.d.ts.map +1 -0
  37. package/dist/actions/task-thread-target.d.ts +11 -0
  38. package/dist/actions/task-thread-target.d.ts.map +1 -0
  39. package/dist/api/agent-routes.d.ts +18 -0
  40. package/dist/api/agent-routes.d.ts.map +1 -0
  41. package/dist/api/bridge-routes.d.ts +32 -0
  42. package/dist/api/bridge-routes.d.ts.map +1 -0
  43. package/dist/api/coordinator-routes.d.ts +22 -0
  44. package/dist/api/coordinator-routes.d.ts.map +1 -0
  45. package/dist/api/hook-routes.d.ts +18 -0
  46. package/dist/api/hook-routes.d.ts.map +1 -0
  47. package/dist/api/issue-routes.d.ts +17 -0
  48. package/dist/api/issue-routes.d.ts.map +1 -0
  49. package/dist/api/parent-context-routes.d.ts +17 -0
  50. package/dist/api/parent-context-routes.d.ts.map +1 -0
  51. package/dist/api/routes.d.ts +37 -0
  52. package/dist/api/routes.d.ts.map +1 -0
  53. package/dist/api/workspace-routes.d.ts +17 -0
  54. package/dist/api/workspace-routes.d.ts.map +1 -0
  55. package/dist/index.d.ts +36 -15
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +19823 -3387
  58. package/dist/index.js.map +72 -22
  59. package/dist/providers/action-examples.d.ts +14 -0
  60. package/dist/providers/action-examples.d.ts.map +1 -0
  61. package/dist/providers/active-workspace-context.d.ts +13 -0
  62. package/dist/providers/active-workspace-context.d.ts.map +1 -0
  63. package/dist/services/agent-credentials.d.ts +23 -0
  64. package/dist/services/agent-credentials.d.ts.map +1 -0
  65. package/dist/services/agent-metrics.d.ts +30 -0
  66. package/dist/services/agent-metrics.d.ts.map +1 -0
  67. package/dist/services/agent-selection.d.ts +53 -0
  68. package/dist/services/agent-selection.d.ts.map +1 -0
  69. package/dist/services/ansi-utils.d.ts +61 -0
  70. package/dist/services/ansi-utils.d.ts.map +1 -0
  71. package/dist/services/claude-code-skill-installer.d.ts +33 -0
  72. package/dist/services/claude-code-skill-installer.d.ts.map +1 -0
  73. package/dist/services/config-env.d.ts +23 -0
  74. package/dist/services/config-env.d.ts.map +1 -0
  75. package/dist/services/coordinator-event-normalizer.d.ts +50 -0
  76. package/dist/services/coordinator-event-normalizer.d.ts.map +1 -0
  77. package/dist/services/custom-validator-runner.d.ts +66 -0
  78. package/dist/services/custom-validator-runner.d.ts.map +1 -0
  79. package/dist/services/debug-capture.d.ts +38 -0
  80. package/dist/services/debug-capture.d.ts.map +1 -0
  81. package/dist/services/pty-auto-response.d.ts +30 -0
  82. package/dist/services/pty-auto-response.d.ts.map +1 -0
  83. package/dist/services/pty-init.d.ts +54 -0
  84. package/dist/services/pty-init.d.ts.map +1 -0
  85. package/dist/services/pty-service.d.ts +206 -0
  86. package/dist/services/pty-service.d.ts.map +1 -0
  87. package/dist/services/pty-session-io.d.ts +49 -0
  88. package/dist/services/pty-session-io.d.ts.map +1 -0
  89. package/dist/services/pty-spawn.d.ts +113 -0
  90. package/dist/services/pty-spawn.d.ts.map +1 -0
  91. package/dist/services/pty-types.d.ts +94 -0
  92. package/dist/services/pty-types.d.ts.map +1 -0
  93. package/dist/services/repo-input.d.ts +16 -0
  94. package/dist/services/repo-input.d.ts.map +1 -0
  95. package/dist/services/session-event-queue.d.ts +25 -0
  96. package/dist/services/session-event-queue.d.ts.map +1 -0
  97. package/dist/services/skill-callback-bridge.d.ts +78 -0
  98. package/dist/services/skill-callback-bridge.d.ts.map +1 -0
  99. package/dist/services/skill-essentials.d.ts +16 -0
  100. package/dist/services/skill-essentials.d.ts.map +1 -0
  101. package/dist/services/skill-lifeops-context-broker.d.ts +20 -0
  102. package/dist/services/skill-lifeops-context-broker.d.ts.map +1 -0
  103. package/dist/services/skill-manifest.d.ts +48 -0
  104. package/dist/services/skill-manifest.d.ts.map +1 -0
  105. package/dist/services/skill-recommender.d.ts +51 -0
  106. package/dist/services/skill-recommender.d.ts.map +1 -0
  107. package/dist/services/stall-classifier.d.ts +69 -0
  108. package/dist/services/stall-classifier.d.ts.map +1 -0
  109. package/dist/services/structured-proof-bridge.d.ts +99 -0
  110. package/dist/services/structured-proof-bridge.d.ts.map +1 -0
  111. package/dist/services/swarm-coordinator-prompts.d.ts +97 -0
  112. package/dist/services/swarm-coordinator-prompts.d.ts.map +1 -0
  113. package/dist/services/swarm-coordinator.d.ts +471 -0
  114. package/dist/services/swarm-coordinator.d.ts.map +1 -0
  115. package/dist/services/swarm-decision-loop.d.ts +52 -0
  116. package/dist/services/swarm-decision-loop.d.ts.map +1 -0
  117. package/dist/services/swarm-event-triage.d.ts +49 -0
  118. package/dist/services/swarm-event-triage.d.ts.map +1 -0
  119. package/dist/services/swarm-history.d.ts +27 -0
  120. package/dist/services/swarm-history.d.ts.map +1 -0
  121. package/dist/services/swarm-idle-watchdog.d.ts +22 -0
  122. package/dist/services/swarm-idle-watchdog.d.ts.map +1 -0
  123. package/dist/services/task-acceptance.d.ts +8 -0
  124. package/dist/services/task-acceptance.d.ts.map +1 -0
  125. package/dist/services/task-agent-auth.d.ts +69 -0
  126. package/dist/services/task-agent-auth.d.ts.map +1 -0
  127. package/dist/services/task-agent-frameworks.d.ts +90 -0
  128. package/dist/services/task-agent-frameworks.d.ts.map +1 -0
  129. package/dist/services/task-kind.d.ts +3 -0
  130. package/dist/services/task-kind.d.ts.map +1 -0
  131. package/dist/services/task-policy.d.ts +17 -0
  132. package/dist/services/task-policy.d.ts.map +1 -0
  133. package/dist/services/task-registry.d.ts +550 -0
  134. package/dist/services/task-registry.d.ts.map +1 -0
  135. package/dist/services/task-share.d.ts +18 -0
  136. package/dist/services/task-share.d.ts.map +1 -0
  137. package/dist/services/task-validation.d.ts +69 -0
  138. package/dist/services/task-validation.d.ts.map +1 -0
  139. package/dist/services/task-verifier-runner.d.ts +5 -0
  140. package/dist/services/task-verifier-runner.d.ts.map +1 -0
  141. package/dist/services/trajectory-context.d.ts +73 -0
  142. package/dist/services/trajectory-context.d.ts.map +1 -0
  143. package/dist/services/trajectory-feedback.d.ts +53 -0
  144. package/dist/services/trajectory-feedback.d.ts.map +1 -0
  145. package/dist/services/workspace-git-ops.d.ts +28 -0
  146. package/dist/services/workspace-git-ops.d.ts.map +1 -0
  147. package/dist/services/workspace-github.d.ts +60 -0
  148. package/dist/services/workspace-github.d.ts.map +1 -0
  149. package/dist/services/workspace-lifecycle.d.ts +18 -0
  150. package/dist/services/workspace-lifecycle.d.ts.map +1 -0
  151. package/dist/services/workspace-service.d.ts +121 -0
  152. package/dist/services/workspace-service.d.ts.map +1 -0
  153. package/dist/services/workspace-types.d.ts +81 -0
  154. package/dist/services/workspace-types.d.ts.map +1 -0
  155. package/package.json +28 -43
  156. package/scripts/ensure-node-pty.mjs +100 -0
  157. package/dist/src/actions/messaging.d.ts +0 -24
  158. package/dist/src/actions/messaging.d.ts.map +0 -1
  159. package/dist/src/actions/subagent-management.d.ts +0 -7
  160. package/dist/src/actions/subagent-management.d.ts.map +0 -1
  161. package/dist/src/actions/task-management.d.ts +0 -9
  162. package/dist/src/actions/task-management.d.ts.map +0 -1
  163. package/dist/src/config.d.ts +0 -4
  164. package/dist/src/config.d.ts.map +0 -1
  165. package/dist/src/providers/orchestrator-config.d.ts +0 -80
  166. package/dist/src/providers/orchestrator-config.d.ts.map +0 -1
  167. package/dist/src/providers/task-context.d.ts +0 -3
  168. package/dist/src/providers/task-context.d.ts.map +0 -1
  169. package/dist/src/services/agent-orchestrator-service.d.ts +0 -59
  170. package/dist/src/services/agent-orchestrator-service.d.ts.map +0 -1
  171. package/dist/src/services/messaging-service.d.ts +0 -111
  172. package/dist/src/services/messaging-service.d.ts.map +0 -1
  173. package/dist/src/services/sandbox-service.d.ts +0 -103
  174. package/dist/src/services/sandbox-service.d.ts.map +0 -1
  175. package/dist/src/services/subagent-service.d.ts +0 -110
  176. package/dist/src/services/subagent-service.d.ts.map +0 -1
  177. package/dist/src/types/index.d.ts +0 -12
  178. package/dist/src/types/index.d.ts.map +0 -1
  179. package/dist/src/types/messaging.d.ts +0 -202
  180. package/dist/src/types/messaging.d.ts.map +0 -1
  181. package/dist/src/types/sandbox.d.ts +0 -228
  182. package/dist/src/types/sandbox.d.ts.map +0 -1
  183. package/dist/src/types/subagent.d.ts +0 -224
  184. package/dist/src/types/subagent.d.ts.map +0 -1
  185. package/dist/src/types.d.ts +0 -113
  186. package/dist/src/types.d.ts.map +0 -1
  187. package/dist/src/utils/index.d.ts +0 -7
  188. package/dist/src/utils/index.d.ts.map +0 -1
  189. package/dist/src/utils/session.d.ts +0 -106
  190. package/dist/src/utils/session.d.ts.map +0 -1
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Provider that injects structured task-agent action examples into the prompt context.
3
+ *
4
+ * ElizaOS core only shows exampleCalls from its static action-docs registry,
5
+ * which doesn't include custom plugin actions. This provider bridges the gap
6
+ * by formatting our task-agent action examples in the same structured format
7
+ * the model sees for core actions.
8
+ *
9
+ * @module providers/action-examples
10
+ */
11
+ import type { Provider } from "@elizaos/core";
12
+ export declare const codingAgentExamplesProvider: Provider;
13
+ export declare const taskAgentExamplesProvider: Provider;
14
+ //# sourceMappingURL=action-examples.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-examples.d.ts","sourceRoot":"","sources":["../../src/providers/action-examples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAyB,QAAQ,EAAS,MAAM,eAAe,CAAC;AAS5E,eAAO,MAAM,2BAA2B,EAAE,QA0JzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAA8B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Provider that injects active workspace and task-agent context into every prompt.
3
+ *
4
+ * Eliza needs to know what workspaces exist, which agents are running, and
5
+ * their current status without having to call LIST_AGENTS every message. This
6
+ * provider reads from the workspace service, PTY service, and coordinator to
7
+ * build a live context summary that's always available in the prompt.
8
+ *
9
+ * @module providers/active-workspace-context
10
+ */
11
+ import type { Provider } from "@elizaos/core";
12
+ export declare const activeWorkspaceContextProvider: Provider;
13
+ //# sourceMappingURL=active-workspace-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-workspace-context.d.ts","sourceRoot":"","sources":["../../src/providers/active-workspace-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAyB,QAAQ,EAAS,MAAM,eAAe,CAAC;AAgD5E,eAAO,MAAM,8BAA8B,EAAE,QA6L5C,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { IAgentRuntime } from "@elizaos/core";
2
+ import type { AgentCredentials } from "coding-agent-adapters";
3
+ export declare function isAnthropicOAuthToken(value: string | undefined): value is string;
4
+ export declare function sanitizeCustomCredentials(customCredentials: Record<string, string> | undefined, blockedValues?: string[]): Record<string, string> | undefined;
5
+ export declare function buildAgentCredentials(runtime: IAgentRuntime): AgentCredentials;
6
+ export interface OpencodeSpawnConfig {
7
+ configContent: string;
8
+ providerLabel: string;
9
+ providerId: string;
10
+ model: string;
11
+ smallModel?: string;
12
+ }
13
+ /**
14
+ * Build the per-spawn OpenCode config (fed via OPENCODE_CONFIG_CONTENT).
15
+ * Three modes — verified live against ollama serving qwen2.5-coder:0.5b:
16
+ * 1. Cloud: PARALLAX_LLM_PROVIDER=cloud + paired Eliza Cloud key.
17
+ * 2. Local: PARALLAX_OPENCODE_LOCAL=1 (and/or PARALLAX_OPENCODE_BASE_URL).
18
+ * 3. User-config: PARALLAX_OPENCODE_MODEL_POWERFUL alone — defers to
19
+ * whatever providers the user has in ~/.config/opencode/opencode.json.
20
+ * Returns null when no mode can produce a usable config.
21
+ */
22
+ export declare function buildOpencodeSpawnConfig(runtime: IAgentRuntime): OpencodeSpawnConfig | null;
23
+ //# sourceMappingURL=agent-credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-credentials.d.ts","sourceRoot":"","sources":["../../src/services/agent-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA4D9D,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,KAAK,IAAI,MAAM,CAEjB;AAED,wBAAgB,yBAAyB,CACvC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACrD,aAAa,GAAE,MAAM,EAAO,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAUpC;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,aAAa,GACrB,gBAAgB,CAgDlB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,aAAa,GACrB,mBAAmB,GAAG,IAAI,CAiG5B"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Lightweight per-agent-type metrics for observability.
3
+ *
4
+ * Self-contained tracker — no dependencies on PTYService state.
5
+ *
6
+ * @module services/agent-metrics
7
+ */
8
+ export interface AgentMetrics {
9
+ spawned: number;
10
+ completed: number;
11
+ completedViaFastPath: number;
12
+ completedViaClassifier: number;
13
+ completedViaOutputReconcile: number;
14
+ stallCount: number;
15
+ avgCompletionMs: number;
16
+ totalCompletionMs: number;
17
+ }
18
+ export type CompletionMethod = "fast-path" | "classifier" | "output-reconcile";
19
+ export declare class AgentMetricsTracker {
20
+ private metrics;
21
+ /** Get (or lazily initialize) metrics for a given agent type. */
22
+ get(agentType: string): AgentMetrics;
23
+ /** Record a task completion and update rolling average duration. */
24
+ recordCompletion(agentType: string, method: CompletionMethod, durationMs: number): void;
25
+ /** Increment the stall counter for an agent type. */
26
+ incrementStalls(agentType: string): void;
27
+ /** Return a serializable copy of all metrics (for API endpoints). */
28
+ getAll(): Record<string, Omit<AgentMetrics, "totalCompletionMs">>;
29
+ }
30
+ //# sourceMappingURL=agent-metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-metrics.d.ts","sourceRoot":"","sources":["../../src/services/agent-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2BAA2B,EAAE,MAAM,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,YAAY,GAAG,kBAAkB,CAAC;AAE/E,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAwC;IAEvD,iEAAiE;IACjE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAkBpC,oEAAoE;IACpE,gBAAgB,CACd,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,MAAM,GACjB,IAAI;IAUP,qDAAqD;IACrD,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIxC,qEAAqE;IACrE,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;CAQlE"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Dynamic agent selection strategy.
3
+ *
4
+ * Chooses which coding-agent CLI to spawn when the caller does not
5
+ * specify an explicit `agentType`.
6
+ *
7
+ * - **fixed** — always returns `config.fixedAgentType`
8
+ * - **ranked** — scores each installed agent on success rate,
9
+ * stall frequency, and completion speed, then
10
+ * returns the highest-scoring one
11
+ *
12
+ * @module services/agent-selection
13
+ */
14
+ import type { AdapterType, PreflightResult } from "coding-agent-adapters";
15
+ export type AgentSelectionStrategy = "fixed" | "ranked";
16
+ /** Subset of AgentMetrics fields used for scoring. */
17
+ export interface AgentScoreInput {
18
+ spawned: number;
19
+ completed: number;
20
+ stallCount: number;
21
+ avgCompletionMs: number;
22
+ }
23
+ export interface AgentSelectionConfig {
24
+ strategy: AgentSelectionStrategy;
25
+ fixedAgentType: AdapterType;
26
+ }
27
+ export interface AgentSelectionContext {
28
+ config: AgentSelectionConfig;
29
+ /** Per-agent-type metrics snapshot (may be empty). */
30
+ metrics: Record<string, AgentScoreInput>;
31
+ /** Preflight results — only the `installed` ones are candidates. */
32
+ installedAgents: PreflightResult[];
33
+ }
34
+ /**
35
+ * Compute a 0–1 score for a single agent based on its metrics.
36
+ *
37
+ * - `successRate` = completed / spawned (0.5 neutral prior when no data)
38
+ * - `volumeWeight` = min(1, spawned / 5) — blends toward neutral at low N
39
+ * - `stallPenalty` = (stallCount / spawned) * 0.3
40
+ * - `speedPenalty` = min(avgCompletionMs / 300_000, 1) * 0.1 — weak tiebreaker
41
+ *
42
+ * Cold-start (no spawns): returns 0.5 so all agents are equal.
43
+ */
44
+ export declare function computeAgentScore(metrics: AgentScoreInput | undefined): number;
45
+ /**
46
+ * Select the best agent type given the current strategy, metrics, and
47
+ * installed agents.
48
+ *
49
+ * Explicit user choice (`params.agentType`) should be resolved by the
50
+ * caller *before* reaching this function.
51
+ */
52
+ export declare function selectAgentType(ctx: AgentSelectionContext): AdapterType;
53
+ //# sourceMappingURL=agent-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-selection.d.ts","sourceRoot":"","sources":["../../src/services/agent-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG1E,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,cAAc,EAAE,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,oEAAoE;IACpE,eAAe,EAAE,eAAe,EAAE,CAAC;CACpC;AAID;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,eAAe,GAAG,SAAS,GACnC,MAAM,CAaR;AAOD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,qBAAqB,GAAG,WAAW,CA8BvE"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * ANSI/terminal utility functions for processing PTY output.
3
+ *
4
+ * Pure functions — no state, no dependencies beyond the standard library.
5
+ *
6
+ * @module services/ansi-utils
7
+ */
8
+ /**
9
+ * Strip ANSI escape sequences from raw terminal output for readable text.
10
+ * Replaces cursor-forward codes with spaces (TUI uses these instead of actual spaces).
11
+ */
12
+ export declare function stripAnsi(raw: string): string;
13
+ /**
14
+ * Clean terminal output for display in chat messages.
15
+ *
16
+ * Goes beyond {@link stripAnsi} by also removing:
17
+ * - Unicode spinner/box-drawing/decorative characters from CLI TUIs
18
+ * - Lines that are only loading/thinking status text
19
+ * - Spinner status bar metadata (token counts, timing)
20
+ * - Consecutive blank lines (collapsed to one)
21
+ */
22
+ export declare function cleanForChat(raw: string): string;
23
+ /**
24
+ * Failover prompts need stricter transcript sanitization than chat messages.
25
+ * The replacement agent already gets the workspace path and failure reason
26
+ * separately, so Claude/Codex trust screens, onboarding banners, and echoed
27
+ * workspace selectors should be dropped here instead of being forwarded.
28
+ */
29
+ export declare function cleanForFailoverContext(raw: string, workdir?: string): string;
30
+ /**
31
+ * Extract meaningful artifacts (PR URLs, commit hashes, key results) from raw
32
+ * terminal output. Returns a compact summary suitable for chat messages,
33
+ * without dumping raw TUI output.
34
+ */
35
+ export declare function extractCompletionSummary(raw: string): string;
36
+ /**
37
+ * Extract a dev server URL from recent terminal output, if present.
38
+ *
39
+ * Looks for common patterns like:
40
+ * - http://localhost:3000
41
+ * - http://127.0.0.1:8080
42
+ * - http://0.0.0.0:5173
43
+ * - https://localhost:4200
44
+ *
45
+ * Returns the first match, or null if no dev server URL is found.
46
+ */
47
+ export declare function extractDevServerUrl(raw: string): string | null;
48
+ /**
49
+ * Capture the agent's output since the last task was sent, cleaned for chat display.
50
+ * Returns readable text with TUI noise removed, or empty string if no marker exists.
51
+ *
52
+ * Mutates `markers` by deleting the entry for `sessionId` after capture.
53
+ */
54
+ export declare function captureTaskResponse(sessionId: string, buffers: Map<string, string[]>, markers: Map<string, number>): string;
55
+ /**
56
+ * Peek at the current task response without consuming the marker.
57
+ * Useful for state reconciliation paths that need to inspect a response
58
+ * before deciding whether to emit a synthetic completion event.
59
+ */
60
+ export declare function peekTaskResponse(sessionId: string, buffers: Map<string, string[]>, markers: Map<string, number>): string;
61
+ //# sourceMappingURL=ansi-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ansi-utils.d.ts","sourceRoot":"","sources":["../../src/services/ansi-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwCH;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAsDD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAyBhD;AAgCD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7E;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAmC5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CASR;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CAKR"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Install bundled Claude Code skills into the host's `~/.claude/skills/` so
3
+ * sub-agents Eliza spawns automatically have access to them.
4
+ *
5
+ * The orchestrator ships skill content under `assets/claude-code-skills/`
6
+ * inside this package. On PTY service init, the installer copies any
7
+ * directory tree under that path into the host's `~/.claude/skills/<id>/`
8
+ * if the destination does not already exist. Subsequent runs are no-ops
9
+ * unless the destination has been removed.
10
+ *
11
+ * Why "skip if exists" rather than "always overwrite":
12
+ * - Skills are user-modifiable. If a user customized eliza-runtime locally
13
+ * (added their own scripts, edited a reference), the orchestrator should
14
+ * not silently stomp their edits on every restart.
15
+ * - The cost of a stale skill is that new orchestrator features the skill
16
+ * should advertise won't be available until the user refreshes manually.
17
+ * That's the right trade-off for v1; future versions can use a version
18
+ * marker file to detect "I have an older copy, please update."
19
+ *
20
+ * The installer is best-effort — failures (missing source dir, can't write
21
+ * to home, etc.) log a warning and return; they never block PTY start.
22
+ */
23
+ import type { Logger } from "@elizaos/core";
24
+ /**
25
+ * Copy each top-level directory under `assets/claude-code-skills/` into
26
+ * `~/.claude/skills/<dirname>/`, skipping any destination that already
27
+ * exists. Returns the list of skill ids that were freshly installed (empty
28
+ * array means everything was already present or the source was missing).
29
+ */
30
+ export declare function ensureBundledClaudeCodeSkills(logger: Pick<Logger, "info" | "warn">, options?: {
31
+ home?: () => string;
32
+ }): string[];
33
+ //# sourceMappingURL=claude-code-skill-installer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-code-skill-installer.d.ts","sourceRoot":"","sources":["../../src/services/claude-code-skill-installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAqC5C;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACrC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,MAAM,CAAA;CAAO,GACpC,MAAM,EAAE,CAmDV"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Read settings from the eliza/eliza config file's env section.
3
+ *
4
+ * runtime.getSetting() checks character.settings but NOT the config's env
5
+ * section which is where the UI writes settings. This reads the config
6
+ * file directly so settings take effect without restart.
7
+ *
8
+ * @module services/config-env
9
+ */
10
+ export declare function readConfigEnvKey(key: string): string | undefined;
11
+ /** Read a key from the cloud section of the config (e.g. "apiKey"). */
12
+ export declare function readConfigCloudKey(key: string): string | undefined;
13
+ /**
14
+ * Read the `agents.defaults.orchestrator.codexSubscriptionRestrictedToCodexFramework`
15
+ * flag from Eliza's config. Returns false when the flag is unset or the
16
+ * config file is missing/malformed.
17
+ *
18
+ * When true, Codex (ChatGPT Plus/Pro) subscription tokens are only usable when
19
+ * the orchestrator targets the `codex` framework — other frameworks
20
+ * (claude/gemini/aider) must fall back to API keys instead.
21
+ */
22
+ export declare function readConfigCodexSubscriptionRestrictedToCodexFramework(): boolean;
23
+ //# sourceMappingURL=config-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-env.d.ts","sourceRoot":"","sources":["../../src/services/config-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuBH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIhE;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qDAAqD,IAAI,OAAO,CAmB/E"}
@@ -0,0 +1,50 @@
1
+ import type { SessionEventName } from "./pty-types.js";
2
+ export type CoordinatorEventSource = "pty_manager" | "adapter_fast_path" | "session_ready_forward" | "hook" | "unknown";
3
+ export interface CoordinatorSessionSnapshot {
4
+ id: string;
5
+ type?: string;
6
+ status?: string;
7
+ }
8
+ interface CoordinatorEventBase<TName extends SessionEventName> {
9
+ sessionId: string;
10
+ name: TName;
11
+ source: CoordinatorEventSource;
12
+ timestamp: number;
13
+ rawData: unknown;
14
+ session?: CoordinatorSessionSnapshot;
15
+ }
16
+ export interface CoordinatorReadyEvent extends CoordinatorEventBase<"ready"> {
17
+ }
18
+ export interface CoordinatorBlockedEvent extends CoordinatorEventBase<"blocked"> {
19
+ promptText: string;
20
+ promptType?: string;
21
+ promptInfo?: Record<string, unknown>;
22
+ autoResponded: boolean;
23
+ }
24
+ export interface CoordinatorLoginRequiredEvent extends CoordinatorEventBase<"login_required"> {
25
+ instructions?: string;
26
+ url?: string;
27
+ deviceCode?: string;
28
+ method?: string;
29
+ promptSnippet?: string;
30
+ }
31
+ export interface CoordinatorTaskCompleteEvent extends CoordinatorEventBase<"task_complete"> {
32
+ response: string;
33
+ }
34
+ export interface CoordinatorToolRunningEvent extends CoordinatorEventBase<"tool_running"> {
35
+ toolName?: string;
36
+ description?: string;
37
+ }
38
+ export interface CoordinatorStoppedEvent extends CoordinatorEventBase<"stopped"> {
39
+ reason?: string;
40
+ }
41
+ export interface CoordinatorErrorEvent extends CoordinatorEventBase<"error"> {
42
+ message: string;
43
+ }
44
+ export interface CoordinatorMessageEvent extends CoordinatorEventBase<"message"> {
45
+ content?: string;
46
+ }
47
+ export type CoordinatorNormalizedEvent = CoordinatorReadyEvent | CoordinatorBlockedEvent | CoordinatorLoginRequiredEvent | CoordinatorTaskCompleteEvent | CoordinatorToolRunningEvent | CoordinatorStoppedEvent | CoordinatorErrorEvent | CoordinatorMessageEvent;
48
+ export declare function normalizeCoordinatorEvent(sessionId: string, event: string, data: unknown): CoordinatorNormalizedEvent | null;
49
+ export {};
50
+ //# sourceMappingURL=coordinator-event-normalizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-event-normalizer.d.ts","sourceRoot":"","sources":["../../src/services/coordinator-event-normalizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAC9B,aAAa,GACb,mBAAmB,GACnB,uBAAuB,GACvB,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,oBAAoB,CAAC,KAAK,SAAS,gBAAgB;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,sBAAsB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EA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CAAC;AAmC5B,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,0BAA0B,GAAG,IAAI,CAiKnC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Custom validator runner — sibling to `task-validation.ts`.
3
+ *
4
+ * The default validator (`validateTaskCompletion`) runs an LLM-based pass
5
+ * over the agent's turn output and workspace evidence. That works for the
6
+ * generic case, but specialized task types (APP.create, PLUGIN.create, etc.)
7
+ * own their own verification surface — disk layout, manifest shape, lint
8
+ * results, test exit codes — and the orchestrator should defer to that
9
+ * verification rather than reasoning over it through an LLM.
10
+ *
11
+ * `runCustomValidator` resolves a runtime service by name, calls the named
12
+ * method with the supplied params (plus the structured-proof claim, if any),
13
+ * and returns a normalized `{ verdict, retryablePromptForChild }` result the
14
+ * decision loop can act on. Every failure path returns `verdict: "fail"`
15
+ * with a concrete `retryablePromptForChild` so the loop never crashes on a
16
+ * misconfigured spec.
17
+ *
18
+ * @module services/custom-validator-runner
19
+ */
20
+ import type { IAgentRuntime } from "@elizaos/core";
21
+ export interface CustomValidatorSpec {
22
+ /** Runtime service name passed to `runtime.getService(...)`. */
23
+ service: string;
24
+ /** Method name to invoke on the resolved service. */
25
+ method: string;
26
+ /**
27
+ * Free-form params object the orchestrator passes through to the
28
+ * validator. Validators are responsible for typing this on their side.
29
+ */
30
+ params: Record<string, unknown>;
31
+ }
32
+ export type CustomValidatorVerdict = "pass" | "fail";
33
+ export interface CustomValidatorResult {
34
+ verdict: CustomValidatorVerdict;
35
+ /**
36
+ * Concrete next-turn prompt the orchestrator will send back to the child
37
+ * when the verdict is "fail". When the verdict is "pass" this field is
38
+ * still populated for trace/log purposes but the orchestrator ignores it.
39
+ */
40
+ retryablePromptForChild: string;
41
+ /**
42
+ * Pass-through structured details from the validator service. Persisted
43
+ * on the validation report and surfaced on escalation events.
44
+ */
45
+ details?: unknown;
46
+ }
47
+ /**
48
+ * Resolve `ELIZA_APP_VERIFICATION_MAX_RETRIES`. Per-task `maxRetries`
49
+ * override wins; otherwise the env var; otherwise the documented default
50
+ * of 3. A negative value falls through to the next source.
51
+ */
52
+ export declare function getMaxRetries(taskOverride?: number): number;
53
+ /**
54
+ * Invoke a custom validator service+method and normalize the result. Never
55
+ * throws — every failure path collapses into `verdict: "fail"` with a
56
+ * descriptive `retryablePromptForChild` so the decision loop can stay on
57
+ * the happy path.
58
+ *
59
+ * @param runtime Eliza runtime for `getService`.
60
+ * @param spec `{ service, method, params }` from the task metadata.
61
+ * @param structuredProof Optional claim recorded by the structured-proof
62
+ * bridge. Validators that want to cross-check claims
63
+ * against disk receive this under `params.structuredProof`.
64
+ */
65
+ export declare function runCustomValidator(runtime: IAgentRuntime, spec: CustomValidatorSpec, structuredProof?: unknown): Promise<CustomValidatorResult>;
66
+ //# sourceMappingURL=custom-validator-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-validator-runner.d.ts","sourceRoot":"","sources":["../../src/services/custom-validator-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,sBAAsB,CAAC;IAChC;;;;OAIG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAM3D;AA0CD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,mBAAmB,EACzB,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAAC,qBAAqB,CAAC,CA4DhC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Debug PTY Capture — optional session recording for offline analysis.
3
+ *
4
+ * Activated by setting `PARALLAX_DEBUG_CAPTURE=1`. When enabled, all PTY
5
+ * output and stdin are recorded per-session using `pty-state-capture`.
6
+ * Capture files persist in `.parallax/pty-captures/<sessionId>/` after
7
+ * the agent session is killed, enabling post-mortem analysis of state
8
+ * transitions, stall classifications, and coordinator timing.
9
+ *
10
+ * The `pty-state-capture` package is dynamically imported — if not
11
+ * installed, capture is silently disabled. This means it can stay out
12
+ * of production dependencies entirely.
13
+ *
14
+ * @module services/debug-capture
15
+ */
16
+ /**
17
+ * Returns true if debug capture is enabled via environment variable.
18
+ */
19
+ export declare function isDebugCaptureEnabled(): boolean;
20
+ /**
21
+ * Open a capture session for a PTY session. Call this when spawning.
22
+ */
23
+ export declare function captureSessionOpen(sessionId: string, agentType: string): Promise<void>;
24
+ /**
25
+ * Feed PTY output data to the capture. Call this on every data chunk.
26
+ */
27
+ export declare function captureFeed(sessionId: string, chunk: string, direction?: "stdout" | "stderr" | "stdin"): Promise<void>;
28
+ /**
29
+ * Record a lifecycle event (session_ready, session_stopped, etc.).
30
+ */
31
+ export declare function captureLifecycle(sessionId: string, event: "session_started" | "session_ready" | "session_stopped" | "session_error", detail?: string): Promise<void>;
32
+ /**
33
+ * Get a snapshot of a capture session's current state.
34
+ */
35
+ export declare function captureSnapshot(sessionId: string): unknown | null;
36
+ /** @internal Reset module state for testing only. */
37
+ export declare function _resetForTesting(): void;
38
+ //# sourceMappingURL=debug-capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-capture.d.ts","sourceRoot":"","sources":["../../src/services/debug-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAmCD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,QAAQ,GAAG,QAAQ,GAAG,OAAkB,GAClD,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,KAAK,EACD,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,eAAe,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAQjE;AAED,qDAAqD;AACrD,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Auto-response rule management for PTY sessions (bypass-fix).
3
+ *
4
+ * Contains logic for pushing default auto-response rules per agent type
5
+ * and handling Gemini authentication flow.
6
+ *
7
+ * @module services/pty-auto-response
8
+ */
9
+ import type { IAgentRuntime } from "@elizaos/core";
10
+ import type { BunCompatiblePTYManager, PTYManager } from "pty-manager";
11
+ export interface AutoResponseContext {
12
+ manager: PTYManager | BunCompatiblePTYManager;
13
+ usingBunWorker: boolean;
14
+ runtime: IAgentRuntime;
15
+ log: (msg: string) => void;
16
+ }
17
+ /**
18
+ * Push session-specific auto-response rules that depend on runtime config.
19
+ * Trust prompts, update notices, and other static rules are handled by
20
+ * adapter built-in rules (coding-agent-adapters). This only pushes rules
21
+ * that need runtime values (e.g. API keys).
22
+ */
23
+ export declare function pushDefaultRules(ctx: AutoResponseContext, sessionId: string, agentType: string): Promise<void>;
24
+ /**
25
+ * Handle Gemini authentication when login_required fires.
26
+ * Sends /auth to start the auth flow; auto-response rules
27
+ * then handle menu selection and API key input.
28
+ */
29
+ export declare function handleGeminiAuth(ctx: AutoResponseContext, sessionId: string, sendKeysToSession: (sessionId: string, keys: string | string[]) => Promise<void>): Promise<void>;
30
+ //# sourceMappingURL=pty-auto-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty-auto-response.d.ts","sourceRoot":"","sources":["../../src/services/pty-auto-response.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAEV,uBAAuB,EACvB,UAAU,EACX,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,UAAU,GAAG,uBAAuB,CAAC;IAC9C,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B;AAOD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAyKf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,CACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,KACpB,OAAO,CAAC,IAAI,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAwBf"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * PTY manager initialization — extracted from PTYService.initialize().
3
+ *
4
+ * Creates either a BunCompatiblePTYManager (for Bun runtime) or PTYManager
5
+ * (for Node), wires up event handlers, and returns the configured manager.
6
+ *
7
+ * @module services/pty-init
8
+ */
9
+ import type { BunCompatiblePTYManager as BunCompatiblePTYManagerType, PTYManager as PTYManagerType, StallClassification } from "pty-manager";
10
+ import type { CompletionMethod } from "./agent-metrics.js";
11
+ import type { PTYServiceConfig } from "./pty-types.js";
12
+ /**
13
+ * All callbacks and state that the initialization logic needs
14
+ * from the surrounding PTYService instance.
15
+ */
16
+ export interface InitContext {
17
+ serviceConfig: PTYServiceConfig;
18
+ classifyStall: (sessionId: string, recentOutput: string) => Promise<StallClassification | null>;
19
+ emitEvent: (sessionId: string, event: string, data: unknown) => void;
20
+ handleGeminiAuth: (sessionId: string) => void;
21
+ sessionOutputBuffers: Map<string, string[]>;
22
+ taskResponseMarkers: Map<string, number>;
23
+ metricsTracker: {
24
+ recordCompletion(type: string, method: CompletionMethod, durationMs: number): void;
25
+ };
26
+ traceEntries: Array<string | Record<string, unknown>>;
27
+ maxTraceEntries: number;
28
+ log: (msg: string) => void;
29
+ handleWorkerExit?: (info: {
30
+ code: number | null;
31
+ signal: string | null;
32
+ }) => void;
33
+ /** Check if a session has an active task in the coordinator. */
34
+ hasActiveTask?: (sessionId: string) => boolean;
35
+ /** Check if a session's task has started work (task delivered or decisions made). */
36
+ hasTaskActivity?: (sessionId: string) => boolean;
37
+ /** Mark a session's task as delivered (initial ready event processed). */
38
+ markTaskDelivered?: (sessionId: string) => void;
39
+ }
40
+ /** Value returned by {@link initializePTYManager}. */
41
+ export interface InitResult {
42
+ manager: PTYManagerType | BunCompatiblePTYManagerType;
43
+ usingBunWorker: boolean;
44
+ }
45
+ /**
46
+ * Create and configure a PTY manager for the current runtime.
47
+ *
48
+ * - **Bun**: instantiates a {@link BunCompatiblePTYManager} that spawns a
49
+ * Node worker process and communicates via JSON-RPC over stdio.
50
+ * - **Node**: instantiates a {@link PTYManager} directly and registers
51
+ * all built-in adapters in-process.
52
+ */
53
+ export declare function initializePTYManager(ctx: InitContext): Promise<InitResult>;
54
+ //# source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