@elizaos/plugin-agent-orchestrator 2.0.3-beta.2 → 2.0.3-beta.3

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 (176) hide show
  1. package/dist/cjs/index.d.ts +2 -0
  2. package/dist/cjs/index.node.cjs +20962 -0
  3. package/dist/cjs/index.node.js.map +82 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/node/index.d.ts +2 -0
  6. package/dist/node/index.d.ts.map +1 -0
  7. package/dist/node/index.node.d.ts +4 -0
  8. package/dist/node/index.node.d.ts.map +1 -0
  9. package/dist/node/index.node.js +20946 -0
  10. package/dist/node/index.node.js.map +82 -0
  11. package/dist/node/src/actions/common.d.ts +114 -0
  12. package/dist/node/src/actions/common.d.ts.map +1 -0
  13. package/dist/node/src/actions/elizaos-capability.d.ts +3 -0
  14. package/dist/node/src/actions/elizaos-capability.d.ts.map +1 -0
  15. package/dist/node/src/actions/sandbox-stub.d.ts +25 -0
  16. package/dist/node/src/actions/sandbox-stub.d.ts.map +1 -0
  17. package/dist/node/src/actions/tasks.d.ts +108 -0
  18. package/dist/node/src/actions/tasks.d.ts.map +1 -0
  19. package/dist/node/src/api/agent-routes.d.ts +18 -0
  20. package/dist/node/src/api/agent-routes.d.ts.map +1 -0
  21. package/dist/node/src/api/bridge-routes.d.ts +70 -0
  22. package/dist/node/src/api/bridge-routes.d.ts.map +1 -0
  23. package/dist/node/src/api/credential-prompt.d.ts +38 -0
  24. package/dist/node/src/api/credential-prompt.d.ts.map +1 -0
  25. package/dist/node/src/api/issue-routes.d.ts +17 -0
  26. package/dist/node/src/api/issue-routes.d.ts.map +1 -0
  27. package/dist/node/src/api/orchestrator-routes.d.ts +25 -0
  28. package/dist/node/src/api/orchestrator-routes.d.ts.map +1 -0
  29. package/dist/node/src/api/parent-context-routes.d.ts +17 -0
  30. package/dist/node/src/api/parent-context-routes.d.ts.map +1 -0
  31. package/dist/node/src/api/route-utils.d.ts +34 -0
  32. package/dist/node/src/api/route-utils.d.ts.map +1 -0
  33. package/dist/node/src/api/routes.d.ts +22 -0
  34. package/dist/node/src/api/routes.d.ts.map +1 -0
  35. package/dist/node/src/api/workspace-routes.d.ts +17 -0
  36. package/dist/node/src/api/workspace-routes.d.ts.map +1 -0
  37. package/dist/node/src/evaluators/sub-agent-completion.d.ts +3 -0
  38. package/dist/node/src/evaluators/sub-agent-completion.d.ts.map +1 -0
  39. package/dist/node/src/index.d.ts +57 -0
  40. package/dist/node/src/index.d.ts.map +1 -0
  41. package/dist/node/src/providers/action-examples.d.ts +14 -0
  42. package/dist/node/src/providers/action-examples.d.ts.map +1 -0
  43. package/dist/node/src/providers/active-sub-agents.d.ts +15 -0
  44. package/dist/node/src/providers/active-sub-agents.d.ts.map +1 -0
  45. package/dist/node/src/providers/active-workspace-context.d.ts +13 -0
  46. package/dist/node/src/providers/active-workspace-context.d.ts.map +1 -0
  47. package/dist/node/src/providers/available-agents.d.ts +4 -0
  48. package/dist/node/src/providers/available-agents.d.ts.map +1 -0
  49. package/dist/node/src/providers/coding-session-changes.d.ts +17 -0
  50. package/dist/node/src/providers/coding-session-changes.d.ts.map +1 -0
  51. package/dist/node/src/register-routes.d.ts +31 -0
  52. package/dist/node/src/register-routes.d.ts.map +1 -0
  53. package/dist/node/src/services/acceptance-criteria.d.ts +84 -0
  54. package/dist/node/src/services/acceptance-criteria.d.ts.map +1 -0
  55. package/dist/node/src/services/acp-native-transport.d.ts +111 -0
  56. package/dist/node/src/services/acp-native-transport.d.ts.map +1 -0
  57. package/dist/node/src/services/acp-service.d.ts +226 -0
  58. package/dist/node/src/services/acp-service.d.ts.map +1 -0
  59. package/dist/node/src/services/active-session-forward.d.ts +31 -0
  60. package/dist/node/src/services/active-session-forward.d.ts.map +1 -0
  61. package/dist/node/src/services/agent-name-assignment.d.ts +50 -0
  62. package/dist/node/src/services/agent-name-assignment.d.ts.map +1 -0
  63. package/dist/node/src/services/ansi-utils.d.ts +64 -0
  64. package/dist/node/src/services/ansi-utils.d.ts.map +1 -0
  65. package/dist/node/src/services/app-deploy-guidance.d.ts +52 -0
  66. package/dist/node/src/services/app-deploy-guidance.d.ts.map +1 -0
  67. package/dist/node/src/services/audit.d.ts +18 -0
  68. package/dist/node/src/services/audit.d.ts.map +1 -0
  69. package/dist/node/src/services/coding-account-selection.d.ts +79 -0
  70. package/dist/node/src/services/coding-account-selection.d.ts.map +1 -0
  71. package/dist/node/src/services/completion-envelope.d.ts +63 -0
  72. package/dist/node/src/services/completion-envelope.d.ts.map +1 -0
  73. package/dist/node/src/services/completion-evidence.d.ts +144 -0
  74. package/dist/node/src/services/completion-evidence.d.ts.map +1 -0
  75. package/dist/node/src/services/config-env.d.ts +27 -0
  76. package/dist/node/src/services/config-env.d.ts.map +1 -0
  77. package/dist/node/src/services/goal-contract.d.ts +25 -0
  78. package/dist/node/src/services/goal-contract.d.ts.map +1 -0
  79. package/dist/node/src/services/goal-llm-verifier.d.ts +157 -0
  80. package/dist/node/src/services/goal-llm-verifier.d.ts.map +1 -0
  81. package/dist/node/src/services/goal-prompt.d.ts +82 -0
  82. package/dist/node/src/services/goal-prompt.d.ts.map +1 -0
  83. package/dist/node/src/services/independent-verifier.d.ts +58 -0
  84. package/dist/node/src/services/independent-verifier.d.ts.map +1 -0
  85. package/dist/node/src/services/interruption-decider.d.ts +43 -0
  86. package/dist/node/src/services/interruption-decider.d.ts.map +1 -0
  87. package/dist/node/src/services/json-model-output.d.ts +2 -0
  88. package/dist/node/src/services/json-model-output.d.ts.map +1 -0
  89. package/dist/node/src/services/opencode-config.d.ts +21 -0
  90. package/dist/node/src/services/opencode-config.d.ts.map +1 -0
  91. package/dist/node/src/services/orchestrator-device-support-matrix.d.ts +46 -0
  92. package/dist/node/src/services/orchestrator-device-support-matrix.d.ts.map +1 -0
  93. package/dist/node/src/services/orchestrator-task-mapper.d.ts +192 -0
  94. package/dist/node/src/services/orchestrator-task-mapper.d.ts.map +1 -0
  95. package/dist/node/src/services/orchestrator-task-service.d.ts +370 -0
  96. package/dist/node/src/services/orchestrator-task-service.d.ts.map +1 -0
  97. package/dist/node/src/services/orchestrator-task-store.d.ts +156 -0
  98. package/dist/node/src/services/orchestrator-task-store.d.ts.map +1 -0
  99. package/dist/node/src/services/orchestrator-task-types.d.ts +334 -0
  100. package/dist/node/src/services/orchestrator-task-types.d.ts.map +1 -0
  101. package/dist/node/src/services/parent-agent-broker.d.ts +23 -0
  102. package/dist/node/src/services/parent-agent-broker.d.ts.map +1 -0
  103. package/dist/node/src/services/parent-agent-dispatch.d.ts +62 -0
  104. package/dist/node/src/services/parent-agent-dispatch.d.ts.map +1 -0
  105. package/dist/node/src/services/repo-input.d.ts +16 -0
  106. package/dist/node/src/services/repo-input.d.ts.map +1 -0
  107. package/dist/node/src/services/screenshot-delivery.d.ts +38 -0
  108. package/dist/node/src/services/screenshot-delivery.d.ts.map +1 -0
  109. package/dist/node/src/services/session-event-queue.d.ts +18 -0
  110. package/dist/node/src/services/session-event-queue.d.ts.map +1 -0
  111. package/dist/node/src/services/session-store.d.ts +108 -0
  112. package/dist/node/src/services/session-store.d.ts.map +1 -0
  113. package/dist/node/src/services/skill-lifeops-context-broker.d.ts +20 -0
  114. package/dist/node/src/services/skill-lifeops-context-broker.d.ts.map +1 -0
  115. package/dist/node/src/services/skill-manifest.d.ts +48 -0
  116. package/dist/node/src/services/skill-manifest.d.ts.map +1 -0
  117. package/dist/node/src/services/skill-recommender.d.ts +53 -0
  118. package/dist/node/src/services/skill-recommender.d.ts.map +1 -0
  119. package/dist/node/src/services/smithers-task-executor.d.ts +73 -0
  120. package/dist/node/src/services/smithers-task-executor.d.ts.map +1 -0
  121. package/dist/node/src/services/smithers-task-integration.d.ts +52 -0
  122. package/dist/node/src/services/smithers-task-integration.d.ts.map +1 -0
  123. package/dist/node/src/services/smithers-task-runner.d.ts +27 -0
  124. package/dist/node/src/services/smithers-task-runner.d.ts.map +1 -0
  125. package/dist/node/src/services/smithers-task-types.d.ts +96 -0
  126. package/dist/node/src/services/smithers-task-types.d.ts.map +1 -0
  127. package/dist/node/src/services/spawn-trajectory.d.ts +23 -0
  128. package/dist/node/src/services/spawn-trajectory.d.ts.map +1 -0
  129. package/dist/node/src/services/spend-allowance.d.ts +143 -0
  130. package/dist/node/src/services/spend-allowance.d.ts.map +1 -0
  131. package/dist/node/src/services/ssrf-guard.d.ts +66 -0
  132. package/dist/node/src/services/ssrf-guard.d.ts.map +1 -0
  133. package/dist/node/src/services/sub-agent-identity.d.ts +27 -0
  134. package/dist/node/src/services/sub-agent-identity.d.ts.map +1 -0
  135. package/dist/node/src/services/sub-agent-inbox.d.ts +26 -0
  136. package/dist/node/src/services/sub-agent-inbox.d.ts.map +1 -0
  137. package/dist/node/src/services/sub-agent-router.d.ts +178 -0
  138. package/dist/node/src/services/sub-agent-router.d.ts.map +1 -0
  139. package/dist/node/src/services/task-agent-frameworks.d.ts +103 -0
  140. package/dist/node/src/services/task-agent-frameworks.d.ts.map +1 -0
  141. package/dist/node/src/services/task-agent-routing.d.ts +33 -0
  142. package/dist/node/src/services/task-agent-routing.d.ts.map +1 -0
  143. package/dist/node/src/services/task-policy.d.ts +17 -0
  144. package/dist/node/src/services/task-policy.d.ts.map +1 -0
  145. package/dist/node/src/services/task-supervisor-service.d.ts +65 -0
  146. package/dist/node/src/services/task-supervisor-service.d.ts.map +1 -0
  147. package/dist/node/src/services/task-watchdog-service.d.ts +50 -0
  148. package/dist/node/src/services/task-watchdog-service.d.ts.map +1 -0
  149. package/dist/node/src/services/terminal-capabilities.d.ts +48 -0
  150. package/dist/node/src/services/terminal-capabilities.d.ts.map +1 -0
  151. package/dist/node/src/services/trajectory-context.d.ts +69 -0
  152. package/dist/node/src/services/trajectory-context.d.ts.map +1 -0
  153. package/dist/node/src/services/trajectory-feedback.d.ts +53 -0
  154. package/dist/node/src/services/trajectory-feedback.d.ts.map +1 -0
  155. package/dist/node/src/services/types.d.ts +188 -0
  156. package/dist/node/src/services/types.d.ts.map +1 -0
  157. package/dist/node/src/services/view-deploy-guidance.d.ts +14 -0
  158. package/dist/node/src/services/view-deploy-guidance.d.ts.map +1 -0
  159. package/dist/node/src/services/workdir-validation.d.ts +10 -0
  160. package/dist/node/src/services/workdir-validation.d.ts.map +1 -0
  161. package/dist/node/src/services/workspace-diff.d.ts +50 -0
  162. package/dist/node/src/services/workspace-diff.d.ts.map +1 -0
  163. package/dist/node/src/services/workspace-git-ops.d.ts +28 -0
  164. package/dist/node/src/services/workspace-git-ops.d.ts.map +1 -0
  165. package/dist/node/src/services/workspace-github.d.ts +60 -0
  166. package/dist/node/src/services/workspace-github.d.ts.map +1 -0
  167. package/dist/node/src/services/workspace-lifecycle.d.ts +5 -0
  168. package/dist/node/src/services/workspace-lifecycle.d.ts.map +1 -0
  169. package/dist/node/src/services/workspace-service.d.ts +126 -0
  170. package/dist/node/src/services/workspace-service.d.ts.map +1 -0
  171. package/dist/node/src/services/workspace-types.d.ts +81 -0
  172. package/dist/node/src/services/workspace-types.d.ts.map +1 -0
  173. package/dist/node/src/setup-routes.d.ts +9 -0
  174. package/dist/node/src/setup-routes.d.ts.map +1 -0
  175. package/docs/multi-account-orchestration.md +1 -1
  176. package/package.json +7 -4
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Mid-task message forwarding for live sub-agents.
3
+ *
4
+ * When a user posts into a room that has a live sub-agent session bound to it,
5
+ * this handler decides — via {@link decideInterruption} — whether to deliver the
6
+ * message now, queue it until the current turn ends, interrupt the turn, or
7
+ * ignore it (ambient chatter). Extracted from the plugin `init` closure so the
8
+ * decision→action wiring is unit-testable in isolation (see
9
+ * `active-session-forward.test.ts`).
10
+ */
11
+ import type { IAgentRuntime, Memory } from "@elizaos/core";
12
+ import type { SubAgentInbox } from "./sub-agent-inbox.js";
13
+ export declare const INTERNAL_FORWARD_SKIP_SOURCES: Set<string>;
14
+ /**
15
+ * A session is "busy" (not safe to prompt now) whenever it is neither a
16
+ * terminal status nor `ready`. This covers `busy`, `tool_running` (the dominant
17
+ * mid-turn state on the native transport), `running`, `blocked`, and
18
+ * `authenticating` — for all of these `acp.sendPrompt` would throw or be
19
+ * inappropriate, so the message must queue and flush when the session returns
20
+ * to `ready`. Only `ready` is promptable.
21
+ */
22
+ export declare function isSessionBusy(status: string): boolean;
23
+ /**
24
+ * Build the MESSAGE_RECEIVED handler that forwards mid-task user messages to the
25
+ * live sub-agent bound to the message's room. Bind is on (source, roomId) — no
26
+ * Discord-thread dependency, so plain SMS/WhatsApp follow-ups work too.
27
+ */
28
+ export declare function createActiveSessionForwardHandler(runtime: IAgentRuntime, subAgentInbox: SubAgentInbox): (payload: {
29
+ message: Memory;
30
+ }) => Promise<void>;
31
+ //# sourceMappingURL=active-session-forward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-session-forward.d.ts","sourceRoot":"","sources":["../../../../src/services/active-session-forward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAO1D,eAAO,MAAM,6BAA6B,aAIxC,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAID;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,aAAa,EACtB,aAAa,EAAE,aAAa,GAC3B,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAoJjD"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Sub-agent name assignment.
3
+ *
4
+ * Every spawned sub-agent is given a real, distinct person-name — the way the
5
+ * main agent is named — so an operator can tell workers apart and the agent
6
+ * knows its own identity (the name is woven into the goal prompt by
7
+ * {@link buildGoalPrompt}). This is the single place that decides that name, so
8
+ * the orchestrator-task spawn path and the direct `/api/coding-agents/spawn`
9
+ * route stay consistent.
10
+ *
11
+ * The pool mirrors `AGENT_NAME_POOL` in `@elizaos/agent`'s first-run flow, but
12
+ * is owned locally: this plugin depends only on `@elizaos/core`, and
13
+ * `@elizaos/agent` already depends on this plugin, so importing the agent
14
+ * package here would close a dependency cycle and tie sub-agent naming to the
15
+ * agent package's build artifact. The pool is pure, dependency-free data, so a
16
+ * local copy is the correct seam.
17
+ *
18
+ * Precedence:
19
+ * 1. An explicit, human-provided label always wins — never overwrite a user's
20
+ * deliberate choice.
21
+ * 2. Otherwise assign a pooled person-name, unique among the names already in
22
+ * use by live sibling sessions and distinct from the running agent's own
23
+ * name, so a sub-agent is never confused with the orchestrator.
24
+ *
25
+ * @module services/agent-name-assignment
26
+ */
27
+ /**
28
+ * Pick a pooled name not present in `exclude` (case-insensitive). When every
29
+ * pooled name is taken the pool is exhausted, so a numeric suffix is appended to
30
+ * the first pooled name — an explicit, intended fallback that guarantees a
31
+ * non-empty, distinct result rather than crashing or returning "".
32
+ */
33
+ export declare function pickSubAgentName(exclude?: readonly string[]): string;
34
+ export interface AssignAgentNameInput {
35
+ /** A human-provided label (e.g. the "Add agent" form field). When present and
36
+ * non-empty it is kept verbatim. */
37
+ explicitLabel?: string;
38
+ /** Names already taken by live sibling sessions on the same task. */
39
+ activeNames: readonly string[];
40
+ /** The running (parent) agent's name, excluded so a worker is never confused
41
+ * with the orchestrator. */
42
+ mainAgentName?: string;
43
+ }
44
+ /**
45
+ * Resolve the final name for a sub-agent at spawn time. Used both as the
46
+ * session `label` and as the `agentName` passed into the goal prompt, so the
47
+ * displayed name and the identity the agent is told are always the same.
48
+ */
49
+ export declare function assignAgentName(input: AssignAgentNameInput): string;
50
+ //# sourceMappingURL=agent-name-assignment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-name-assignment.d.ts","sourceRoot":"","sources":["../../../../src/services/agent-name-assignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA8DH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAiBxE;AAED,MAAM,WAAW,oBAAoB;IACnC;wCACoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;gCAC4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAYnE"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * ANSI/terminal utility functions for processing ACP CLI 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
+ export declare function formatMarkdownTablesForChat(text: string): string;
14
+ export declare function closeUnbalancedMarkdownFences(text: string): string;
15
+ /**
16
+ * Clean terminal output for display in chat messages.
17
+ *
18
+ * Goes beyond {@link stripAnsi} by also removing:
19
+ * - Unicode spinner/box-drawing/decorative characters from CLI TUIs
20
+ * - Lines that are only loading/thinking status text
21
+ * - Spinner status bar metadata (token counts, timing)
22
+ * - Consecutive blank lines (collapsed to one)
23
+ */
24
+ export declare function cleanForChat(raw: string): string;
25
+ /**
26
+ * Failover prompts need stricter transcript sanitization than chat messages.
27
+ * The replacement agent already gets the workspace path and failure reason
28
+ * separately, so Claude/Codex trust screens, onboarding banners, and echoed
29
+ * workspace selectors should be dropped here instead of being forwarded.
30
+ */
31
+ export declare function cleanForFailoverContext(raw: string, workdir?: string): string;
32
+ /**
33
+ * Extract meaningful artifacts (PR URLs, commit hashes, key results) from raw
34
+ * terminal output. Returns a compact summary suitable for chat messages,
35
+ * without dumping raw TUI output.
36
+ */
37
+ export declare function extractCompletionSummary(raw: string): string;
38
+ export declare function summarizeUserFacingTurnOutput(raw: string): string;
39
+ /**
40
+ * Extract a dev server URL from recent terminal output, if present.
41
+ *
42
+ * Looks for common patterns like:
43
+ * - http://localhost:3000
44
+ * - http://127.0.0.1:8080
45
+ * - http://0.0.0.0:5173
46
+ * - https://localhost:4200
47
+ *
48
+ * Returns the first match, or null if no dev server URL is found.
49
+ */
50
+ export declare function extractDevServerUrl(raw: string): string | null;
51
+ /**
52
+ * Capture the agent's output since the last task was sent, cleaned for chat display.
53
+ * Returns readable text with TUI noise removed, or empty string if no marker exists.
54
+ *
55
+ * Mutates `markers` by deleting the entry for `sessionId` after capture.
56
+ */
57
+ export declare function captureTaskResponse(sessionId: string, buffers: Map<string, string[]>, markers: Map<string, number>): string;
58
+ /**
59
+ * Peek at the current task response without consuming the marker.
60
+ * Useful for state reconciliation paths that need to inspect a response
61
+ * before deciding whether to emit a synthetic completion event.
62
+ */
63
+ export declare function peekTaskResponse(sessionId: string, buffers: Map<string, string[]>, markers: Map<string, number>): string;
64
+ //# 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;AAkOD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+BhE;AAoPD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA8DlE;AAqDD;;;;;;;;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,CA6D5D;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0CjE;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,52 @@
1
+ /**
2
+ * App-deployment guidance for spawned coding sub-agents.
3
+ *
4
+ * When a sub-agent is asked to build an app / website, the planner-level
5
+ * app-build contract (in the parent agent's system prompt) does not survive the
6
+ * terse spawn task. Without it the sub-agent just writes local files that are
7
+ * never served, so the user gets "no live URL". This module re-injects a
8
+ * deployment contract into the sub-agent's initial task at the spawn chokepoint
9
+ * so the result is actually hosted and a verified URL is reported.
10
+ *
11
+ * Default target is **Eliza Cloud** (the productized path for every user).
12
+ * Operators can opt into a personal **agent-home** static host via env — that
13
+ * is gated so other users never see it.
14
+ *
15
+ * @module services/app-deploy-guidance
16
+ */
17
+ import { type ViewPluginDeployPromptOptions } from "./view-deploy-guidance.js";
18
+ /**
19
+ * Whether a task builds a HOSTED web surface that should get the deploy
20
+ * contract. Uses the narrow APP_DEPLOY_TASK_RE — a CLI tool / library / doc
21
+ * page must NOT be told to deploy and report a live URL.
22
+ */
23
+ export declare function isAppBuildTask(taskText: string | undefined | null): boolean;
24
+ export declare function isViewPluginTask(taskText: string | undefined | null): boolean;
25
+ export type AppDeployTarget = "eliza-cloud" | "cloud" | "agent-home";
26
+ export interface AppDeployConfig {
27
+ target: AppDeployTarget;
28
+ /** agent-home: absolute dir whose `<slug>/` subdirs are served as apps. */
29
+ agentHomeAppsDir?: string;
30
+ /** agent-home: public base URL; apps resolve at `<baseUrl>/apps/<slug>/`. */
31
+ agentHomeBaseUrl?: string;
32
+ }
33
+ /**
34
+ * Resolve the deploy target from env. agent-home requires BOTH an apps dir and
35
+ * a base URL to be configured; otherwise we fall back to Eliza Cloud so a
36
+ * half-configured operator override can never strand a normal user.
37
+ */
38
+ export declare function resolveAppDeployConfig(): AppDeployConfig;
39
+ /**
40
+ * Cloud-vs-local-sandbox contract for a view/plugin task (#8918). A view-plugin
41
+ * follows the configured target: Eliza Cloud gets the full publish/register
42
+ * contract, while non-cloud targets stay local-sandbox only.
43
+ */
44
+ export declare function viewPluginGuidance(config?: AppDeployConfig, options?: ViewPluginDeployPromptOptions): string;
45
+ /** Build the deploy-guidance block for the configured target. */
46
+ export declare function buildAppDeployGuidance(config?: AppDeployConfig): string;
47
+ /**
48
+ * Append the deploy contract to an app-build task; pass non-app tasks through
49
+ * unchanged. Idempotent — skips if the block is already present.
50
+ */
51
+ export declare function augmentTaskWithDeployGuidance(task: string, config?: AppDeployConfig): string;
52
+ //# sourceMappingURL=app-deploy-guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-deploy-guidance.d.ts","sourceRoot":"","sources":["../../../../src/services/app-deploy-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAK3E;AAUD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAK7E;AAED,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,OAAO,GAAG,YAAY,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CAkBxD;AA2BD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,6BAA6B,GACtC,MAAM,CAKR;AAED,iEAAiE;AACjE,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,CAKvE;AAcD;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,eAAe,GACvB,MAAM,CAuBR"}
@@ -0,0 +1,18 @@
1
+ import type { IAgentRuntime } from "@elizaos/core";
2
+ export declare const TASK_AUDIT_EVENT = "TASK_AUDIT";
3
+ export type TaskAuditAction = "spawn_agent" | "send_agent" | "stop_agent" | "cancel_agent";
4
+ export interface TaskAuditPayload {
5
+ action: TaskAuditAction;
6
+ outcome: "allowed" | "forbidden" | "error";
7
+ entityId?: string;
8
+ sessionId?: string;
9
+ agentType?: string;
10
+ workdir?: string;
11
+ source?: string;
12
+ reason?: string;
13
+ ts: string;
14
+ }
15
+ export declare function emitTaskAudit(runtime: IAgentRuntime, payload: Omit<TaskAuditPayload, "ts">): Promise<void>;
16
+ export declare function defaultAuditLogPath(): string;
17
+ export declare function appendAuditLine(path: string, payload: TaskAuditPayload): Promise<void>;
18
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../../src/services/audit.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AASnD,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,cAAc,CAAC;AAEnB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Orchestrator-side reader for the coding-agent account-selector bridge.
3
+ *
4
+ * The bridge itself lives in `@elizaos/app-core` (it owns the `AccountPool` and
5
+ * the credential store). This plugin depends only on `@elizaos/core`, so — like
6
+ * the parent-context bridge — it reads the contract off a `globalThis` symbol
7
+ * rather than importing app-core. When no pool/accounts are configured the
8
+ * bridge is absent and every helper here no-ops, leaving the single-account
9
+ * behavior untouched.
10
+ */
11
+ export type CodingAccountStrategy = "priority" | "round-robin" | "least-used" | "quota-aware";
12
+ export interface CodingAccountUsage {
13
+ sessionPct?: number;
14
+ weeklyPct?: number;
15
+ resetsAt?: number;
16
+ refreshedAt: number;
17
+ }
18
+ /** A selected account plus the env vars the coding subprocess needs. */
19
+ export interface CodingAccountSelection {
20
+ providerId: string;
21
+ accountId: string;
22
+ label: string;
23
+ source: "oauth" | "api-key";
24
+ strategy: string;
25
+ usage?: CodingAccountUsage;
26
+ /** Secrets — injected into the spawn env, never persisted to the task store. */
27
+ envPatch: Record<string, string>;
28
+ }
29
+ export interface CodingProviderAvailability {
30
+ providerId: string;
31
+ total: number;
32
+ enabled: number;
33
+ healthy: number;
34
+ }
35
+ interface CodingAgentSelectorBridge {
36
+ describe(): Record<string, CodingProviderAvailability[]>;
37
+ select(agentType: string, opts?: {
38
+ sessionKey?: string;
39
+ strategy?: CodingAccountStrategy;
40
+ exclude?: string[];
41
+ }): Promise<CodingAccountSelection | null>;
42
+ markRateLimited(providerId: string, accountId: string, untilMs: number, detail?: string): Promise<void>;
43
+ markNeedsReauth(providerId: string, accountId: string, detail?: string): Promise<void>;
44
+ recordUsage(providerId: string, accountId: string, result: {
45
+ tokens?: number;
46
+ ok: boolean;
47
+ model?: string;
48
+ latencyMs?: number;
49
+ }): Promise<void>;
50
+ }
51
+ /** Non-secret account descriptor stamped onto the session record. */
52
+ export interface CodingAccountMeta {
53
+ providerId: string;
54
+ accountId: string;
55
+ label: string;
56
+ source: string;
57
+ strategy: string;
58
+ }
59
+ export interface ResolvedCodingAccount {
60
+ selection: CodingAccountSelection;
61
+ meta: CodingAccountMeta;
62
+ }
63
+ export declare function isMultiAccountAgentType(agentType: string): boolean;
64
+ export declare function getCodingAccountBridge(): CodingAgentSelectorBridge | null;
65
+ export declare function resolveCodingAccountStrategy(raw: string | undefined): CodingAccountStrategy | undefined;
66
+ /**
67
+ * Pick an account for a coding sub-agent. Returns null (single-account
68
+ * fallback) when the bridge is absent, the agent type is not multi-account, or
69
+ * no eligible account exists. Never throws.
70
+ */
71
+ export declare function selectCodingAccount(agentType: string, opts?: {
72
+ sessionKey?: string;
73
+ strategy?: CodingAccountStrategy;
74
+ exclude?: string[];
75
+ }): Promise<ResolvedCodingAccount | null>;
76
+ /** Read the account descriptor previously stamped onto a session's metadata. */
77
+ export declare function accountMetaFromSessionMetadata(metadata: Record<string, unknown> | undefined): CodingAccountMeta | null;
78
+ export {};
79
+ //# sourceMappingURL=coding-account-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coding-account-selection.d.ts","sourceRoot":"","sources":["../../../../src/services/coding-account-selection.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * CompletionEnvelope — a structured, machine-checkable contract a sub-agent
3
+ * returns when it claims a task is done (#8895, EPIC #8884).
4
+ *
5
+ * Today sub-agents claim completion in free-form prose, so grilling is
6
+ * prompt-based, not contract-based. This module defines the envelope schema,
7
+ * the instruction injected into the spawn prompt, and a pure parser/validator.
8
+ * The completion path runs structural validation BEFORE the LLM judge: a present
9
+ * but malformed envelope is auto-blocked with a targeted re-prompt, while an
10
+ * ABSENT envelope falls back to the existing heuristic path (back-compat).
11
+ */
12
+ /** One command the sub-agent ran to verify its work. */
13
+ export interface EnvelopeTestResult {
14
+ command: string;
15
+ exitCode: number;
16
+ summary: string;
17
+ }
18
+ /** Per-criterion self-assessment with the evidence backing it. */
19
+ export interface EnvelopeCriterionStatus {
20
+ criterion: string;
21
+ met: boolean;
22
+ evidence: string;
23
+ }
24
+ /** The structured final report a sub-agent returns on completion. */
25
+ export interface CompletionEnvelope {
26
+ diffSummary: string;
27
+ filesChanged: string[];
28
+ testResults: EnvelopeTestResult[];
29
+ screenshotPaths: string[];
30
+ trajectoryPath?: string;
31
+ acceptanceCriteriaStatus: EnvelopeCriterionStatus[];
32
+ residualRisks: string[];
33
+ }
34
+ /**
35
+ * The instruction appended to the spawn prompt. Asks the agent to END its final
36
+ * message with a fenced ```json block matching the schema, in ADDITION to its
37
+ * prose — so weak adapters that ignore it still produce a usable prose
38
+ * completion (the parser treats a missing block as "fall back to heuristic").
39
+ */
40
+ export declare const COMPLETION_ENVELOPE_INSTRUCTION: string;
41
+ /** Result of attempting to read an envelope out of a completion message. */
42
+ export type CompletionEnvelopeParse = {
43
+ present: false;
44
+ } | {
45
+ present: true;
46
+ ok: true;
47
+ envelope: CompletionEnvelope;
48
+ } | {
49
+ present: true;
50
+ ok: false;
51
+ errors: string[];
52
+ };
53
+ /**
54
+ * Pure: detect + validate a CompletionEnvelope in a sub-agent's final message.
55
+ * Absent → `{present:false}` (caller uses the heuristic path). Present but
56
+ * invalid → `{present:true, ok:false, errors}` (caller re-prompts/blocks).
57
+ */
58
+ export declare function parseCompletionEnvelope(text: string): CompletionEnvelopeParse;
59
+ /** Compact human summary of a validated envelope, for the verifier/log. */
60
+ export declare function summarizeEnvelope(env: CompletionEnvelope): string;
61
+ /** A targeted re-prompt for a present-but-malformed envelope. */
62
+ export declare function envelopeCorrection(errors: string[]): string;
63
+ //# sourceMappingURL=completion-envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion-envelope.d.ts","sourceRoot":"","sources":["../../../../src/services/completion-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kEAAkE;AAClE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB,EAAE,uBAAuB,EAAE,CAAC;IACpD,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,QA0BhC,CAAC;AAEb,4EAA4E;AAC5E,MAAM,MAAM,uBAAuB,GAC/B;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,GAClB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAA;CAAE,GACzD;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAyBnD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAmG7E;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAmBjE;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAM3D"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Completion-evidence assembly for the auto goal-verifier.
3
+ *
4
+ * The auto goal-verifier ("grill until truly done") historically judged a
5
+ * completed sub-agent task against its acceptance criteria using only the thin
6
+ * `task_complete` event-summary string. That makes it trivially foolable: a
7
+ * sub-agent that *claims* success but pasted no proof reads identically to one
8
+ * that actually shipped.
9
+ *
10
+ * This module turns the rich signals the orchestrator ALREADY has into a single
11
+ * clearly-SECTIONED evidence string the verifier can grill against:
12
+ *
13
+ * - **CHANGESET** — the real git diffstat + changed files + a capped diff,
14
+ * captured from git at `task_complete` (same {@link WorkspaceChangeSet} the
15
+ * CODING_SESSION_CHANGES provider renders), so "I changed X" is checkable.
16
+ * - **DELIVERABLE** — the sub-agent's captured deliverable (printed/tool
17
+ * output the router extracted) and its final reply text.
18
+ * - **VERIFIED URLS** — URLs the router probed at completion, flagged
19
+ * loopback-vs-public so the verifier can reject localhost-only "deploys".
20
+ * - **TEST / BUILD / TYPECHECK OUTPUT** — lines mined from the session's
21
+ * recorded events/messages that look like build/test/typecheck output, so a
22
+ * real green run is distinguishable from a bare claim.
23
+ * - **ARTIFACTS** — references to screenshot/trajectory artifacts found on the
24
+ * task/session, so UI and agent-behavior criteria have something to cite.
25
+ *
26
+ * Pure (no IO): the caller gathers the inputs (durable store + live ACP session
27
+ * metadata) and hands them in. The whole assembly is null-safe and size-capped
28
+ * so it can be fed straight into the verifier without blowing the prompt
29
+ * budget.
30
+ *
31
+ * @module services/completion-evidence
32
+ */
33
+ import type { WorkspaceChangeSet } from "./workspace-diff.js";
34
+ /** One recorded signal (a durable event or sub-agent message) the assembler
35
+ * mines for test/build/typecheck output. Kept minimal so the service can map
36
+ * its store rows in without coupling this module to the full record types. */
37
+ export interface EvidenceSignal {
38
+ /** Free-text body to scan (event summary, message content, …). */
39
+ text: string;
40
+ /** Optional label for the section header (e.g. the event type). */
41
+ source?: string;
42
+ }
43
+ export interface CompletionEvidenceInput {
44
+ /** The `task_complete` response summary — the original thin evidence; kept as
45
+ * the fallback and as the sub-agent's final reply when nothing richer. */
46
+ fallbackSummary: string;
47
+ /** Real git change set captured at completion, if any. */
48
+ changeSet?: WorkspaceChangeSet;
49
+ /** Captured deliverable (router-extracted printed/tool output), if any. */
50
+ deliverable?: string;
51
+ /** The sub-agent's final reply text, if distinct from the summary. */
52
+ finalReply?: string;
53
+ /** URLs the router probed/verified at completion. */
54
+ verifiedUrls?: readonly string[];
55
+ /** Recorded events/messages to mine for build/test/typecheck output. */
56
+ signals?: readonly EvidenceSignal[];
57
+ /** Artifact references (screenshots, trajectories) found on task/session. */
58
+ artifacts?: readonly EvidenceArtifactRef[];
59
+ }
60
+ export interface EvidenceArtifactRef {
61
+ artifactType: string;
62
+ title: string;
63
+ /** A path or uri — whichever locates the artifact for the verifier. */
64
+ ref?: string;
65
+ }
66
+ /**
67
+ * Captured stdout from the sub-agent's tool runs, split by tool class. Each
68
+ * field is the raw (already-bounded) output of a `vitest`/`tsc`/`biome`-style
69
+ * run mined from the recorded ACP tool events, so the verifier can read the
70
+ * actual run result rather than the agent's narration of it. `raw` is a
71
+ * catch-all for tool output that matched a build/test marker but couldn't be
72
+ * confidently classed as test/build/lint.
73
+ */
74
+ export interface ToolOutputEvidence {
75
+ test?: string;
76
+ build?: string;
77
+ lint?: string;
78
+ raw?: string;
79
+ }
80
+ /**
81
+ * The TYPED completion-evidence bundle (issue #8894). This is the formalized,
82
+ * collect-once shape the orchestrator assembles BEFORE verification: every
83
+ * evidence source resolves to a named field instead of being threaded through
84
+ * the prompt as loose strings. {@link buildCompletionEvidenceString} serializes
85
+ * it into the same clearly-sectioned string the verifier already grills
86
+ * against, emitting exactly one section per POPULATED field and omitting empty
87
+ * ones.
88
+ *
89
+ * `verifiedUrls` and `screenshots` are required (default to `[]`); everything
90
+ * else is optional and contributes a section only when present.
91
+ */
92
+ export interface CompletionEvidenceBundle {
93
+ /** The sub-agent's reported result — the fallback/final-reply text. */
94
+ summary: string;
95
+ /** Human-readable git diff summary (diffstat + changed files + capped diff)
96
+ * captured at completion, if any. */
97
+ diffSummary?: string;
98
+ /** Captured tool stdout split by class (test/build/lint) plus a raw bucket. */
99
+ toolOutput?: ToolOutputEvidence;
100
+ /** URLs the router probed/verified at completion (loopback-flagged on render). */
101
+ verifiedUrls: string[];
102
+ /** Screenshot artifact paths found on the task/session. */
103
+ screenshots: string[];
104
+ /** Path to the persisted trajectory JSONL artifact for this completion. */
105
+ trajectoryPath?: string;
106
+ }
107
+ /**
108
+ * Classify the build/test/typecheck/lint output mined from recorded tool
109
+ * signals into a {@link ToolOutputEvidence} bucket per tool class, so the
110
+ * verifier can read the actual test/build stdout under named headers. A signal
111
+ * is routed by the markers in its body (and source label): test markers →
112
+ * `test`, build/typecheck → `build`, lint → `lint`; build-test-looking lines
113
+ * that match none fall into `raw`. Returns undefined when nothing matched.
114
+ */
115
+ export declare function classifyToolOutput(signals: readonly EvidenceSignal[]): ToolOutputEvidence | undefined;
116
+ /**
117
+ * Render the human-readable body of a {@link WorkspaceChangeSet} (diffstat +
118
+ * changed files + a capped diff) WITHOUT the section header. Used as the
119
+ * `diffSummary` field of a {@link CompletionEvidenceBundle}, so the bundle and
120
+ * the legacy assembler produce byte-identical changeset text.
121
+ */
122
+ export declare function renderChangeSetBody(changeSet: WorkspaceChangeSet): string;
123
+ /**
124
+ * Serialize the TYPED {@link CompletionEvidenceBundle} into the clearly-
125
+ * sectioned evidence string the verifier grills against — one section per
126
+ * POPULATED field, empty fields omitted. When nothing richer than the bare
127
+ * summary is present, returns the bare summary (prior thin-completion
128
+ * behavior). This is the issue #8894 entry point; the legacy signal-mining
129
+ * assembler lives in {@link buildEvidenceStringFromInput} and remains exported.
130
+ */
131
+ export declare function buildCompletionEvidenceString(bundle: CompletionEvidenceBundle): string;
132
+ /**
133
+ * Assemble the sectioned completion-evidence string from the loose signals the
134
+ * orchestrator already has. Always returns a non-empty string: when nothing
135
+ * richer than the fallback summary is available it still returns the summary,
136
+ * so the verifier behaves exactly as before for thin completions.
137
+ *
138
+ * Retained for backward compatibility and as the signal-mining helper the
139
+ * bundle collector reuses to extract build/test lines; new callers should
140
+ * assemble a {@link CompletionEvidenceBundle} and use
141
+ * {@link buildCompletionEvidenceString}.
142
+ */
143
+ export declare function buildEvidenceStringFromInput(input: CompletionEvidenceInput): string;
144
+ //# sourceMappingURL=completion-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion-evidence.d.ts","sourceRoot":"","sources":["../../../../src/services/completion-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;+EAE+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC;+EAC2E;IAC3E,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,wEAAwE;IACxE,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IACpC,6EAA6E;IAC7E,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB;0CACsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,kFAAkF;IAClF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAiED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,cAAc,EAAE,GACjC,kBAAkB,GAAG,SAAS,CAyBhC;AAsBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAezE;AA8DD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,wBAAwB,GAC/B,MAAM,CAyDR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,uBAAuB,GAC7B,MAAM,CAmER"}
@@ -0,0 +1,27 @@
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
+ import type { AcpMcpServerConfig } from "./acp-native-transport.js";
11
+ export declare function readConfigEnvKey(key: string): string | undefined;
12
+ /** Read a key from the cloud section of the config (e.g. "apiKey"). */
13
+ export declare function readConfigCloudKey(key: string): string | undefined;
14
+ /**
15
+ * Read the runtime's configured MCP servers from the config's `mcp.servers`
16
+ * object — the same map the dashboard `/api/config` route validates and
17
+ * persists — and convert it to the ACP `session/new.mcpServers` array shape, so
18
+ * spawned sub-agents automatically inherit the parent's MCP tools (Codex /
19
+ * Claude-Code parity) without the operator duplicating them in
20
+ * `ELIZA_ACP_MCP_SERVERS`.
21
+ *
22
+ * Returns undefined when nothing is configured (so the env-var fallback in the
23
+ * transport still applies) and silently drops malformed entries — it must never
24
+ * throw, since it runs on the sub-agent spawn path.
25
+ */
26
+ export declare function readConfigMcpServers(): AcpMcpServerConfig[] | undefined;
27
+ //# 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;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAoBpE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAahE;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIlE;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,EAAE,GAAG,SAAS,CAoCvE"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Default acceptance-criteria generation (#8896).
3
+ *
4
+ * When a task is created with no acceptance criteria, automatic verification
5
+ * never fires (`autoVerifyCompletion` returns early on an empty list), so a
6
+ * sub-agent's "done" is taken on faith. This module supplies sensible,
7
+ * task-kind-specific default criteria so verification always has something
8
+ * concrete to check.
9
+ *
10
+ * Deterministic + template-based on purpose: defaults must be stable, instant,
11
+ * and dependency-free (no model call on the task-creation hot path).
12
+ */
13
+ /**
14
+ * Whether to auto-fill default acceptance criteria for criteria-less tasks.
15
+ * On by default; set `ELIZA_REQUIRE_GOAL_CONTRACT=0` to opt out.
16
+ */
17
+ export declare function shouldRequireGoalContract(): boolean;
18
+ /**
19
+ * Build default acceptance criteria for a task that was created without any.
20
+ * Returns the base coding criteria plus any kind-specific extras. The `goal`
21
+ * is currently unused by the templates but kept in the signature so a future
22
+ * model-assisted variant can specialize without a call-site change.
23
+ */
24
+ export declare function buildDefaultAcceptanceCriteria(_goal: string, kind?: string): string[];
25
+ //# sourceMappingURL=goal-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal-contract.d.ts","sourceRoot":"","sources":["../../../../src/services/goal-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD;AAoBD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,EAAE,CAGV"}