@elizaos/plugin-agent-orchestrator 2.0.0-alpha.9 → 2.0.0-beta.1

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 (265) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +21 -0
  3. package/PROJECT.md +119 -0
  4. package/README.md +160 -0
  5. package/dist/browser/index.browser.js +21051 -0
  6. package/dist/browser/index.browser.js.map +29 -0
  7. package/dist/browser/index.d.ts +2 -0
  8. package/dist/cjs/index.d.ts +2 -0
  9. package/dist/cjs/index.node.cjs +20491 -0
  10. package/dist/cjs/index.node.js.map +72 -0
  11. package/dist/index.d.ts +2 -21
  12. package/dist/node/index.browser.d.ts +3 -0
  13. package/dist/node/index.browser.d.ts.map +1 -0
  14. package/dist/node/index.d.ts +2 -0
  15. package/dist/node/index.d.ts.map +1 -0
  16. package/dist/node/index.node.d.ts +4 -0
  17. package/dist/node/index.node.d.ts.map +1 -0
  18. package/dist/node/index.node.js +20471 -0
  19. package/dist/node/index.node.js.map +72 -0
  20. package/dist/node/src/actions/cancel-task.d.ts +3 -0
  21. package/dist/node/src/actions/cancel-task.d.ts.map +1 -0
  22. package/dist/node/src/actions/coding-task-handlers.d.ts +69 -0
  23. package/dist/node/src/actions/coding-task-handlers.d.ts.map +1 -0
  24. package/dist/node/src/actions/coding-task-helpers.d.ts +35 -0
  25. package/dist/node/src/actions/coding-task-helpers.d.ts.map +1 -0
  26. package/dist/node/src/actions/common.d.ts +56 -0
  27. package/dist/node/src/actions/common.d.ts.map +1 -0
  28. package/dist/node/src/actions/create-task.d.ts +8 -0
  29. package/dist/node/src/actions/create-task.d.ts.map +1 -0
  30. package/dist/node/src/actions/eval-metadata.d.ts +11 -0
  31. package/dist/node/src/actions/eval-metadata.d.ts.map +1 -0
  32. package/dist/node/src/actions/finalize-workspace.d.ts +11 -0
  33. package/dist/node/src/actions/finalize-workspace.d.ts.map +1 -0
  34. package/dist/node/src/actions/list-agents.d.ts +4 -0
  35. package/dist/node/src/actions/list-agents.d.ts.map +1 -0
  36. package/dist/node/src/actions/manage-issues.d.ts +11 -0
  37. package/dist/node/src/actions/manage-issues.d.ts.map +1 -0
  38. package/dist/node/src/actions/provision-workspace.d.ts +11 -0
  39. package/dist/node/src/actions/provision-workspace.d.ts.map +1 -0
  40. package/dist/node/src/actions/sandbox-stub.d.ts +21 -0
  41. package/dist/node/src/actions/sandbox-stub.d.ts.map +1 -0
  42. package/dist/node/src/actions/send-to-agent.d.ts +4 -0
  43. package/dist/node/src/actions/send-to-agent.d.ts.map +1 -0
  44. package/dist/node/src/actions/spawn-agent.d.ts +8 -0
  45. package/dist/node/src/actions/spawn-agent.d.ts.map +1 -0
  46. package/dist/node/src/actions/stop-agent.d.ts +4 -0
  47. package/dist/node/src/actions/stop-agent.d.ts.map +1 -0
  48. package/dist/node/src/actions/task-control.d.ts +3 -0
  49. package/dist/node/src/actions/task-control.d.ts.map +1 -0
  50. package/dist/node/src/actions/task-history.d.ts +3 -0
  51. package/dist/node/src/actions/task-history.d.ts.map +1 -0
  52. package/dist/node/src/actions/task-share.d.ts +3 -0
  53. package/dist/node/src/actions/task-share.d.ts.map +1 -0
  54. package/dist/node/src/actions/task-thread-target.d.ts +11 -0
  55. package/dist/node/src/actions/task-thread-target.d.ts.map +1 -0
  56. package/dist/node/src/actions/tasks.d.ts +88 -0
  57. package/dist/node/src/actions/tasks.d.ts.map +1 -0
  58. package/dist/node/src/api/agent-routes.d.ts +18 -0
  59. package/dist/node/src/api/agent-routes.d.ts.map +1 -0
  60. package/dist/node/src/api/bridge-routes.d.ts +32 -0
  61. package/dist/node/src/api/bridge-routes.d.ts.map +1 -0
  62. package/dist/node/src/api/coordinator-routes.d.ts +22 -0
  63. package/dist/node/src/api/coordinator-routes.d.ts.map +1 -0
  64. package/dist/node/src/api/hook-routes.d.ts +18 -0
  65. package/dist/node/src/api/hook-routes.d.ts.map +1 -0
  66. package/dist/node/src/api/issue-routes.d.ts +17 -0
  67. package/dist/node/src/api/issue-routes.d.ts.map +1 -0
  68. package/dist/node/src/api/parent-context-routes.d.ts +17 -0
  69. package/dist/node/src/api/parent-context-routes.d.ts.map +1 -0
  70. package/dist/node/src/api/route-utils.d.ts +18 -0
  71. package/dist/node/src/api/route-utils.d.ts.map +1 -0
  72. package/dist/node/src/api/routes.d.ts +23 -0
  73. package/dist/node/src/api/routes.d.ts.map +1 -0
  74. package/dist/node/src/api/workspace-routes.d.ts +17 -0
  75. package/dist/node/src/api/workspace-routes.d.ts.map +1 -0
  76. package/dist/node/src/index.d.ts +32 -0
  77. package/dist/node/src/index.d.ts.map +1 -0
  78. package/dist/node/src/providers/action-examples.d.ts +14 -0
  79. package/dist/node/src/providers/action-examples.d.ts.map +1 -0
  80. package/dist/node/src/providers/active-sub-agents.d.ts +15 -0
  81. package/dist/node/src/providers/active-sub-agents.d.ts.map +1 -0
  82. package/dist/node/src/providers/active-workspace-context.d.ts +13 -0
  83. package/dist/node/src/providers/active-workspace-context.d.ts.map +1 -0
  84. package/dist/node/src/providers/available-agents.d.ts +4 -0
  85. package/dist/node/src/providers/available-agents.d.ts.map +1 -0
  86. package/dist/node/src/register-routes.d.ts +11 -0
  87. package/dist/node/src/register-routes.d.ts.map +1 -0
  88. package/dist/node/src/routes/coding-agents-fallback-routes.d.ts +19 -0
  89. package/dist/node/src/routes/coding-agents-fallback-routes.d.ts.map +1 -0
  90. package/dist/node/src/services/acp-service.d.ts +61 -0
  91. package/dist/node/src/services/acp-service.d.ts.map +1 -0
  92. package/dist/node/src/services/acpx-subprocess.d.ts +3 -0
  93. package/dist/node/src/services/acpx-subprocess.d.ts.map +1 -0
  94. package/dist/node/src/services/agent-credentials.d.ts +23 -0
  95. package/dist/node/src/services/agent-credentials.d.ts.map +1 -0
  96. package/dist/node/src/services/agent-metrics.d.ts +30 -0
  97. package/dist/node/src/services/agent-metrics.d.ts.map +1 -0
  98. package/dist/node/src/services/agent-selection.d.ts +53 -0
  99. package/dist/node/src/services/agent-selection.d.ts.map +1 -0
  100. package/dist/node/src/services/ansi-utils.d.ts +64 -0
  101. package/dist/node/src/services/ansi-utils.d.ts.map +1 -0
  102. package/dist/node/src/services/claude-code-skill-installer.d.ts +33 -0
  103. package/dist/node/src/services/claude-code-skill-installer.d.ts.map +1 -0
  104. package/dist/node/src/services/config-env.d.ts +23 -0
  105. package/dist/node/src/services/config-env.d.ts.map +1 -0
  106. package/dist/node/src/services/coordinator-event-normalizer.d.ts +50 -0
  107. package/dist/node/src/services/coordinator-event-normalizer.d.ts.map +1 -0
  108. package/dist/node/src/services/custom-validator-runner.d.ts +66 -0
  109. package/dist/node/src/services/custom-validator-runner.d.ts.map +1 -0
  110. package/dist/node/src/services/debug-capture.d.ts +38 -0
  111. package/dist/node/src/services/debug-capture.d.ts.map +1 -0
  112. package/dist/node/src/services/json-model-output.d.ts +2 -0
  113. package/dist/node/src/services/json-model-output.d.ts.map +1 -0
  114. package/dist/node/src/services/parent-agent-broker.d.ts +21 -0
  115. package/dist/node/src/services/parent-agent-broker.d.ts.map +1 -0
  116. package/dist/node/src/services/pty-auto-response.d.ts +30 -0
  117. package/dist/node/src/services/pty-auto-response.d.ts.map +1 -0
  118. package/dist/node/src/services/pty-init.d.ts +55 -0
  119. package/dist/node/src/services/pty-init.d.ts.map +1 -0
  120. package/dist/node/src/services/pty-service.d.ts +218 -0
  121. package/dist/node/src/services/pty-service.d.ts.map +1 -0
  122. package/dist/node/src/services/pty-session-io.d.ts +49 -0
  123. package/dist/node/src/services/pty-session-io.d.ts.map +1 -0
  124. package/dist/node/src/services/pty-spawn.d.ts +104 -0
  125. package/dist/node/src/services/pty-spawn.d.ts.map +1 -0
  126. package/dist/node/src/services/pty-types.d.ts +94 -0
  127. package/dist/node/src/services/pty-types.d.ts.map +1 -0
  128. package/dist/node/src/services/repo-input.d.ts +16 -0
  129. package/dist/node/src/services/repo-input.d.ts.map +1 -0
  130. package/dist/node/src/services/session-event-queue.d.ts +25 -0
  131. package/dist/node/src/services/session-event-queue.d.ts.map +1 -0
  132. package/dist/node/src/services/session-store.d.ts +107 -0
  133. package/dist/node/src/services/session-store.d.ts.map +1 -0
  134. package/dist/node/src/services/skill-callback-bridge.d.ts +78 -0
  135. package/dist/node/src/services/skill-callback-bridge.d.ts.map +1 -0
  136. package/dist/node/src/services/skill-essentials.d.ts +16 -0
  137. package/dist/node/src/services/skill-essentials.d.ts.map +1 -0
  138. package/dist/node/src/services/skill-lifeops-context-broker.d.ts +20 -0
  139. package/dist/node/src/services/skill-lifeops-context-broker.d.ts.map +1 -0
  140. package/dist/node/src/services/skill-manifest.d.ts +48 -0
  141. package/dist/node/src/services/skill-manifest.d.ts.map +1 -0
  142. package/dist/node/src/services/skill-recommender.d.ts +51 -0
  143. package/dist/node/src/services/skill-recommender.d.ts.map +1 -0
  144. package/dist/node/src/services/spawn-trajectory.d.ts +23 -0
  145. package/dist/node/src/services/spawn-trajectory.d.ts.map +1 -0
  146. package/dist/node/src/services/stall-classifier.d.ts +69 -0
  147. package/dist/node/src/services/stall-classifier.d.ts.map +1 -0
  148. package/dist/node/src/services/structured-proof-bridge.d.ts +99 -0
  149. package/dist/node/src/services/structured-proof-bridge.d.ts.map +1 -0
  150. package/dist/node/src/services/sub-agent-router.d.ts +38 -0
  151. package/dist/node/src/services/sub-agent-router.d.ts.map +1 -0
  152. package/dist/node/src/services/swarm-coordinator-prompts.d.ts +93 -0
  153. package/dist/node/src/services/swarm-coordinator-prompts.d.ts.map +1 -0
  154. package/dist/node/src/services/swarm-coordinator.d.ts +473 -0
  155. package/dist/node/src/services/swarm-coordinator.d.ts.map +1 -0
  156. package/dist/node/src/services/swarm-decision-loop.d.ts +69 -0
  157. package/dist/node/src/services/swarm-decision-loop.d.ts.map +1 -0
  158. package/dist/node/src/services/swarm-event-triage.d.ts +49 -0
  159. package/dist/node/src/services/swarm-event-triage.d.ts.map +1 -0
  160. package/dist/node/src/services/swarm-history.d.ts +27 -0
  161. package/dist/node/src/services/swarm-history.d.ts.map +1 -0
  162. package/dist/node/src/services/swarm-idle-watchdog.d.ts +22 -0
  163. package/dist/node/src/services/swarm-idle-watchdog.d.ts.map +1 -0
  164. package/dist/node/src/services/task-acceptance.d.ts +8 -0
  165. package/dist/node/src/services/task-acceptance.d.ts.map +1 -0
  166. package/dist/node/src/services/task-agent-auth.d.ts +69 -0
  167. package/dist/node/src/services/task-agent-auth.d.ts.map +1 -0
  168. package/dist/node/src/services/task-agent-frameworks.d.ts +90 -0
  169. package/dist/node/src/services/task-agent-frameworks.d.ts.map +1 -0
  170. package/dist/node/src/services/task-kind.d.ts +3 -0
  171. package/dist/node/src/services/task-kind.d.ts.map +1 -0
  172. package/dist/node/src/services/task-policy.d.ts +17 -0
  173. package/dist/node/src/services/task-policy.d.ts.map +1 -0
  174. package/dist/node/src/services/task-registry.d.ts +550 -0
  175. package/dist/node/src/services/task-registry.d.ts.map +1 -0
  176. package/dist/node/src/services/task-share.d.ts +18 -0
  177. package/dist/node/src/services/task-share.d.ts.map +1 -0
  178. package/dist/node/src/services/task-validation.d.ts +69 -0
  179. package/dist/node/src/services/task-validation.d.ts.map +1 -0
  180. package/dist/node/src/services/task-verifier-runner.d.ts +5 -0
  181. package/dist/node/src/services/task-verifier-runner.d.ts.map +1 -0
  182. package/dist/node/src/services/trajectory-context.d.ts +73 -0
  183. package/dist/node/src/services/trajectory-context.d.ts.map +1 -0
  184. package/dist/node/src/services/trajectory-feedback.d.ts +53 -0
  185. package/dist/node/src/services/trajectory-feedback.d.ts.map +1 -0
  186. package/dist/node/src/services/types.d.ts +152 -0
  187. package/dist/node/src/services/types.d.ts.map +1 -0
  188. package/dist/node/src/services/workspace-git-ops.d.ts +28 -0
  189. package/dist/node/src/services/workspace-git-ops.d.ts.map +1 -0
  190. package/dist/node/src/services/workspace-github.d.ts +60 -0
  191. package/dist/node/src/services/workspace-github.d.ts.map +1 -0
  192. package/dist/node/src/services/workspace-lifecycle.d.ts +18 -0
  193. package/dist/node/src/services/workspace-lifecycle.d.ts.map +1 -0
  194. package/dist/node/src/services/workspace-service.d.ts +122 -0
  195. package/dist/node/src/services/workspace-service.d.ts.map +1 -0
  196. package/dist/node/src/services/workspace-types.d.ts +81 -0
  197. package/dist/node/src/services/workspace-types.d.ts.map +1 -0
  198. package/dist/node/src/setup-routes.d.ts +9 -0
  199. package/dist/node/src/setup-routes.d.ts.map +1 -0
  200. package/dist/node/vitest.config.d.ts +3 -0
  201. package/dist/node/vitest.config.d.ts.map +1 -0
  202. package/docs/default-eliza-skills-and-agent-bridge-plan.md +231 -0
  203. package/docs/sub-agent-routing.md +197 -0
  204. package/package.json +113 -37
  205. package/dist/index.d.ts.map +0 -1
  206. package/dist/index.js +0 -21120
  207. package/dist/index.js.map +0 -109
  208. package/dist/src/actions/messaging.d.ts +0 -24
  209. package/dist/src/actions/messaging.d.ts.map +0 -1
  210. package/dist/src/actions/peek-subagent.d.ts +0 -3
  211. package/dist/src/actions/peek-subagent.d.ts.map +0 -1
  212. package/dist/src/actions/subagent-management.d.ts +0 -7
  213. package/dist/src/actions/subagent-management.d.ts.map +0 -1
  214. package/dist/src/actions/task-management.d.ts +0 -9
  215. package/dist/src/actions/task-management.d.ts.map +0 -1
  216. package/dist/src/config.d.ts +0 -4
  217. package/dist/src/config.d.ts.map +0 -1
  218. package/dist/src/providers/orchestrator-config.d.ts +0 -80
  219. package/dist/src/providers/orchestrator-config.d.ts.map +0 -1
  220. package/dist/src/providers/task-context.d.ts +0 -3
  221. package/dist/src/providers/task-context.d.ts.map +0 -1
  222. package/dist/src/services/agent-orchestrator-service.d.ts +0 -59
  223. package/dist/src/services/agent-orchestrator-service.d.ts.map +0 -1
  224. package/dist/src/services/messaging-service.d.ts +0 -111
  225. package/dist/src/services/messaging-service.d.ts.map +0 -1
  226. package/dist/src/services/sandbox-service.d.ts +0 -103
  227. package/dist/src/services/sandbox-service.d.ts.map +0 -1
  228. package/dist/src/services/subagent-service.d.ts +0 -140
  229. package/dist/src/services/subagent-service.d.ts.map +0 -1
  230. package/dist/src/sub-agents/adapter.d.ts +0 -13
  231. package/dist/src/sub-agents/adapter.d.ts.map +0 -1
  232. package/dist/src/sub-agents/claude-agent-sdk-sub-agent.d.ts +0 -18
  233. package/dist/src/sub-agents/claude-agent-sdk-sub-agent.d.ts.map +0 -1
  234. package/dist/src/sub-agents/codex-sdk-sub-agent.d.ts +0 -18
  235. package/dist/src/sub-agents/codex-sdk-sub-agent.d.ts.map +0 -1
  236. package/dist/src/sub-agents/eliza-sub-agent.d.ts +0 -27
  237. package/dist/src/sub-agents/eliza-sub-agent.d.ts.map +0 -1
  238. package/dist/src/sub-agents/elizaos-native-sub-agent.d.ts +0 -61
  239. package/dist/src/sub-agents/elizaos-native-sub-agent.d.ts.map +0 -1
  240. package/dist/src/sub-agents/index.d.ts +0 -10
  241. package/dist/src/sub-agents/index.d.ts.map +0 -1
  242. package/dist/src/sub-agents/opencode-sub-agent.d.ts +0 -44
  243. package/dist/src/sub-agents/opencode-sub-agent.d.ts.map +0 -1
  244. package/dist/src/sub-agents/registry.d.ts +0 -3
  245. package/dist/src/sub-agents/registry.d.ts.map +0 -1
  246. package/dist/src/sub-agents/sweagent-sub-agent.d.ts +0 -19
  247. package/dist/src/sub-agents/sweagent-sub-agent.d.ts.map +0 -1
  248. package/dist/src/sub-agents/tools.d.ts +0 -15
  249. package/dist/src/sub-agents/tools.d.ts.map +0 -1
  250. package/dist/src/sub-agents/types.d.ts +0 -170
  251. package/dist/src/sub-agents/types.d.ts.map +0 -1
  252. package/dist/src/types/index.d.ts +0 -12
  253. package/dist/src/types/index.d.ts.map +0 -1
  254. package/dist/src/types/messaging.d.ts +0 -202
  255. package/dist/src/types/messaging.d.ts.map +0 -1
  256. package/dist/src/types/sandbox.d.ts +0 -228
  257. package/dist/src/types/sandbox.d.ts.map +0 -1
  258. package/dist/src/types/subagent.d.ts +0 -232
  259. package/dist/src/types/subagent.d.ts.map +0 -1
  260. package/dist/src/types.d.ts +0 -138
  261. package/dist/src/types.d.ts.map +0 -1
  262. package/dist/src/utils/index.d.ts +0 -7
  263. package/dist/src/utils/index.d.ts.map +0 -1
  264. package/dist/src/utils/session.d.ts +0 -184
  265. package/dist/src/utils/session.d.ts.map +0 -1
@@ -0,0 +1,104 @@
1
+ /**
2
+ * PTY session spawning logic — extracted from PTYService for maintainability.
3
+ *
4
+ * Contains the deferred task delivery, retry logic, per-agent settle delays,
5
+ * and session buffer setup that runs during spawnSession().
6
+ *
7
+ * @module services/pty-spawn
8
+ */
9
+ import type { AdapterType, BaseCodingAdapter } from "coding-agent-adapters";
10
+ import type { BunCompatiblePTYManager, PTYManager, SessionHandle, SpawnConfig, WorkerSessionHandle } from "pty-manager";
11
+ import type { PTYServiceConfig, SessionInfo, SpawnSessionOptions } from "./pty-types.js";
12
+ /**
13
+ * Inspect a chunk of session output for auth-related failure signatures.
14
+ * Returns the kind of failure detected (or null) so the caller can mark
15
+ * the supplied `accountId` via the pool. Pattern matching is best-effort
16
+ * and intentionally narrow: we only flag accounts when we're confident
17
+ * the subprocess saw a real auth error.
18
+ */
19
+ export declare function detectAuthFailureKind(data: string): "rate-limited" | "invalid" | "needs-reauth" | null;
20
+ /**
21
+ * Build a sanitized base environment from process.env, keeping only
22
+ * safe system variables. Agent-specific credentials are injected
23
+ * separately by the adapter's getEnv().
24
+ *
25
+ * On Windows, the sanitized env may have lost the per-package-manager bin
26
+ * directories that hold `claude.cmd` / `codex.cmd` (npm global, Codex
27
+ * managed install, scoop shims, chocolatey bin). Route through
28
+ * `appendWindowsPathFallbacks` to add those back after the allowlist copy.
29
+ */
30
+ export declare function buildSanitizedBaseEnv(): Record<string, string>;
31
+ /**
32
+ * Directories that Windows package managers drop `claude.cmd` / `codex.cmd`
33
+ * / `codex.exe` into. We append these to the sanitized PATH so `cmd.exe`
34
+ * (via the `shell: true` flag on execFile/spawn for win32) can resolve the
35
+ * CLI binaries even when the user's PATH has been stripped down by the
36
+ * ENV_ALLOWLIST-then-systemd-unit chain or otherwise missing the install
37
+ * location. Each entry is a no-op on non-Windows and a no-op when the
38
+ * parent env var the path depends on is unset.
39
+ *
40
+ * Coverage, in order of popularity for claude/codex installs:
41
+ * - npm global (%APPDATA%\npm) — the official CLAUDE_CODE install path
42
+ * - Codex managed install (%LOCALAPPDATA%\OpenAI\Codex\bin)
43
+ * - Scoop (%USERPROFILE%\scoop\shims)
44
+ * - Chocolatey (%ProgramData%\chocolatey\bin)
45
+ * - Bun global (%USERPROFILE%\.bun\bin)
46
+ */
47
+ export declare function getWindowsPathFallbacks(): string[];
48
+ /**
49
+ * Append each fallback path to `currentPath` if it isn't already present.
50
+ * Windows PATH matching is case-insensitive, so dedupe on the lowercased
51
+ * form but preserve the original casing in the output. Returns `undefined`
52
+ * when the resulting PATH would be empty (neither argument had content), so
53
+ * callers can skip assigning an empty string.
54
+ */
55
+ export declare function appendWindowsPathFallbacks(currentPath: string | undefined): string | undefined;
56
+ /**
57
+ * Pure PATH-merge helper: dedupe existing + extras, preserve insertion
58
+ * order and casing. Exported for unit tests so we can exercise the merge
59
+ * logic without stubbing `process.platform`.
60
+ */
61
+ export declare function mergePathEntries(currentPath: string | undefined, extras: readonly string[], opts: {
62
+ delimiter: string;
63
+ caseInsensitive: boolean;
64
+ }): string | undefined;
65
+ export interface SpawnContext {
66
+ manager: PTYManager | BunCompatiblePTYManager;
67
+ usingBunWorker: boolean;
68
+ serviceConfig: PTYServiceConfig;
69
+ sessionMetadata: Map<string, Record<string, unknown>>;
70
+ sessionWorkdirs: Map<string, string>;
71
+ sessionOutputBuffers: Map<string, string[]>;
72
+ outputUnsubscribers: Map<string, () => void>;
73
+ taskResponseMarkers: Map<string, number>;
74
+ getAdapter: (agentType: AdapterType) => BaseCodingAdapter;
75
+ sendToSession: (sessionId: string, input: string) => Promise<unknown>;
76
+ sendKeysToSession: (sessionId: string, keys: string | string[]) => Promise<void>;
77
+ writeRawToSession: (sessionId: string, data: string) => Promise<void>;
78
+ pushDefaultRules: (sessionId: string, agentType: string) => Promise<void>;
79
+ toSessionInfo: (session: SessionHandle | WorkerSessionHandle, workdir?: string) => SessionInfo;
80
+ log: (msg: string) => void;
81
+ /** Mark a session's task as delivered in the coordinator. */
82
+ markTaskDelivered: (sessionId: string) => void;
83
+ }
84
+ export declare function shouldUseCodexExecMode(options: {
85
+ agentType: string;
86
+ initialTask?: string;
87
+ }): boolean;
88
+ /**
89
+ * Set up session output buffering for Bun worker path.
90
+ */
91
+ export declare function setupOutputBuffer(ctx: SpawnContext, sessionId: string): void;
92
+ /**
93
+ * Set up deferred task delivery with retry logic.
94
+ * IMPORTANT: Must be called BEFORE pushDefaultRules (which has a 1500ms sleep),
95
+ * otherwise session_ready fires during pushDefaultRules and the listener misses it.
96
+ */
97
+ export declare function setupDeferredTaskDelivery(ctx: SpawnContext, session: SessionHandle | WorkerSessionHandle, task: string, agentType: string): void;
98
+ /**
99
+ * Build the SpawnConfig and env vars from SpawnSessionOptions.
100
+ */
101
+ export declare function buildSpawnConfig(sessionId: string, options: SpawnSessionOptions, workdir: string): SpawnConfig & {
102
+ id: string;
103
+ };
104
+ //# sourceMappingURL=pty-spawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty-spawn.d.ts","sourceRoot":"","sources":["../../../../src/services/pty-spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,WAAW,EACX,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AA4CxB;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GACX,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,CAQpD;AAmDD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,IAAI,MAAM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,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,aAAa,EAAE,CACb,OAAO,EAAE,aAAa,GAAG,mBAAmB,EAC5C,OAAO,CAAC,EAAE,MAAM,KACb,WAAW,CAAC;IACjB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B,6DAA6D;IAC7D,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAEV;AAuBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAe5E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,aAAa,GAAG,mBAAmB,EAC5C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,IAAI,CAyJN;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,MAAM,GACd,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAoE9B"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Shared types and helpers for the PTY service layer.
3
+ *
4
+ * Extracted from pty-service.ts to keep that module lean and allow
5
+ * other modules (pty-spawn, pty-init, actions) to import lightweight
6
+ * type-only dependencies without pulling in the full PTYService class.
7
+ *
8
+ * @module services/pty-types
9
+ */
10
+ import type { AdapterType, AgentCredentials, ApprovalPreset } from "coding-agent-adapters";
11
+ import type { SessionHandle } from "pty-manager";
12
+ export interface PTYServiceConfig {
13
+ /** Maximum output lines to keep per session (default: 1000) */
14
+ maxLogLines?: number;
15
+ /** Enable debug logging */
16
+ debug?: boolean;
17
+ /** Auto-register task-agent adapters (default: true) */
18
+ registerCodingAdapters?: boolean;
19
+ /** Maximum concurrent PTY sessions (default: 8) */
20
+ maxConcurrentSessions?: number;
21
+ /**
22
+ * Default approval preset for task agents when not specified per-spawn.
23
+ * Controls what tools the agent can use without asking for permission.
24
+ * - "readonly" — Read-only tools only
25
+ * - "standard" — Read + write, asks for shell/network
26
+ * - "permissive" — Most tools auto-approved, asks for destructive ops
27
+ * - "autonomous" — All tools auto-approved (yolo mode)
28
+ * Default: "autonomous"
29
+ */
30
+ defaultApprovalPreset?: ApprovalPreset;
31
+ }
32
+ /** Available task-agent types */
33
+ export type CodingAgentType = "shell" | "pi" | "opencode" | AdapterType;
34
+ /** True when the user requested the Pi coding agent. */
35
+ export declare const isPiAgentType: (input: string | undefined | null) => boolean;
36
+ /** True when the user requested the OpenCode agent. */
37
+ export declare const isOpencodeAgentType: (input: string | undefined | null) => boolean;
38
+ /** Normalize user-provided agent type string to a valid CodingAgentType */
39
+ export declare const normalizeAgentType: (input: string) => CodingAgentType;
40
+ /** Build the initial shell command for Pi agent sessions. */
41
+ export declare const toPiCommand: (task: string | undefined) => string;
42
+ /**
43
+ * Build the initial shell command for OpenCode agent sessions.
44
+ *
45
+ * `--dangerously-skip-permissions` is a flag of the `run` subcommand
46
+ * (NOT the top-level opencode command), so it must come AFTER `run` —
47
+ * verified live with opencode 1.14.33 + an OpenAI-compatible Eliza-1 endpoint.
48
+ *
49
+ * Model + provider selection comes from the OPENCODE_CONFIG_CONTENT env
50
+ * var that the spawn pipeline injects — see buildOpencodeSpawnConfig in
51
+ * `agent-credentials.ts`.
52
+ */
53
+ export declare const toOpencodeCommand: (task: string | undefined) => string;
54
+ export interface SpawnSessionOptions {
55
+ /** Human-readable session name */
56
+ name: string;
57
+ /** Adapter type: "shell" | "pi" | "opencode" | "claude" | "gemini" | "codex" | "aider" */
58
+ agentType: CodingAgentType;
59
+ /** Working directory for the session */
60
+ workdir?: string;
61
+ /** Initial command/task to send */
62
+ initialTask?: string;
63
+ /** Environment variables */
64
+ env?: Record<string, string>;
65
+ /** Session metadata for tracking */
66
+ metadata?: Record<string, unknown>;
67
+ /** Credentials for coding agents (API keys, tokens) */
68
+ credentials?: AgentCredentials;
69
+ /** Memory/instructions content to write to the agent's memory file before spawning */
70
+ memoryContent?: string;
71
+ /** Approval preset controlling tool permissions (readonly, standard, permissive, autonomous) */
72
+ approvalPreset?: ApprovalPreset;
73
+ /** Custom credentials for MCP servers or other integrations */
74
+ customCredentials?: Record<string, string>;
75
+ /** When true, adapter-level blocking prompts (tool permissions, file access)
76
+ * are emitted with autoResponded=false instead of being auto-handled.
77
+ * Used by the swarm coordinator to route decisions through its LLM loop. */
78
+ skipAdapterAutoResponse?: boolean;
79
+ }
80
+ export interface SessionInfo {
81
+ id: string;
82
+ name: string;
83
+ agentType: string;
84
+ workdir: string;
85
+ status: SessionHandle["status"];
86
+ createdAt: Date;
87
+ lastActivityAt: Date;
88
+ metadata?: Record<string, unknown>;
89
+ }
90
+ /** Known event names emitted by the PTY layer. */
91
+ export type SessionEventName = "ready" | "blocked" | "login_required" | "task_complete" | "tool_running" | "stopped" | "error" | "message";
92
+ type SessionEventCallback = (sessionId: string, event: string, data: unknown) => void;
93
+ export type { SessionEventCallback };
94
+ //# sourceMappingURL=pty-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty-types.d.ts","sourceRoot":"","sources":["../../../../src/services/pty-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CA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,OAAO,CAAC,CAAC;IACnC,uDAAuD;IACvD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gGAAgG;IAChG,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C;;iFAE6E;IAC7E,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,SAAS,GACT,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,KAAK,oBAAoB,GAAG,CAC1B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,KACV,IAAI,CAAC;AAEV,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Repository input normalization for coding task workspaces.
3
+ *
4
+ * Accepts canonical clone URLs plus common shorthand forms such as:
5
+ * - owner/repo
6
+ * - github.com/owner/repo
7
+ * - https://github.com/owner/repo
8
+ *
9
+ * Bare owner/repo inputs default to GitHub because the coding workspace
10
+ * flows in this plugin are GitHub-centric.
11
+ *
12
+ * @module services/repo-input
13
+ */
14
+ export declare function normalizeRepositoryInput(repo: string): string;
15
+ export declare function diagnoseWorkspaceBootstrapFailure(repo: string, errorMessage: string): string;
16
+ //# sourceMappingURL=repo-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-input.d.ts","sourceRoot":"","sources":["../../../../src/services/repo-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoBH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqD7D;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,GACnB,MAAM,CAmDR"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Per-session async serialization queue.
3
+ * Ensures only one event is processed at a time per session.
4
+ */
5
+ export interface QueuedEvent {
6
+ sessionId: string;
7
+ type: "blocked" | "turn_complete";
8
+ data: unknown;
9
+ enqueuedAt: number;
10
+ }
11
+ export declare class SessionEventQueue {
12
+ private queues;
13
+ private processing;
14
+ private handler;
15
+ private logger;
16
+ constructor(handler: (event: QueuedEvent) => Promise<void>, logger?: {
17
+ warn: (msg: string) => void;
18
+ });
19
+ enqueue(event: QueuedEvent): void;
20
+ isProcessing(sessionId: string): boolean;
21
+ clear(sessionId?: string): void;
22
+ pendingCount(sessionId: string): number;
23
+ private processLoop;
24
+ }
25
+ //# sourceMappingURL=session-event-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-event-queue.d.ts","sourceRoot":"","sources":["../../../../src/services/session-event-queue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,SAAS,GAAG,eAAe,CAAC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAyC;IACvD,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,MAAM,CAAkC;gBAG9C,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC9C,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE;IAM1C,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAajC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIxC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ/B,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;YAIzB,WAAW;CA8B1B"}
@@ -0,0 +1,107 @@
1
+ import type { SessionFilter, SessionInfo, SessionStatus, SessionStore, SessionStoreRuntime } from "./types.js";
2
+ export type SessionStoreBackend = "runtime-db" | "file" | "memory";
3
+ type Logger = NonNullable<SessionStoreRuntime["logger"]>;
4
+ type SqlDatabaseAdapter = {
5
+ query?: (sql: string, params?: unknown[]) => Promise<unknown> | unknown;
6
+ execute?: (sql: string, params?: unknown[]) => Promise<unknown> | unknown;
7
+ run?: (sql: string, params?: unknown[]) => Promise<unknown> | unknown;
8
+ all?: (sql: string, params?: unknown[]) => Promise<unknown[]> | unknown[];
9
+ get?: (sql: string, params?: unknown[]) => Promise<unknown> | unknown;
10
+ select?: (sql: string, params?: unknown[]) => Promise<unknown[]> | unknown[];
11
+ };
12
+ declare class WriteQueue {
13
+ private tail;
14
+ enqueue<T>(operation: () => Promise<T>): Promise<T>;
15
+ }
16
+ export declare class InMemorySessionStore implements SessionStore {
17
+ protected readonly sessions: Map<string, SessionInfo>;
18
+ protected readonly writes: WriteQueue;
19
+ create(session: SessionInfo): Promise<void>;
20
+ get(id: string): Promise<SessionInfo | null>;
21
+ getSync(id: string): SessionInfo | null;
22
+ getByAcpxRecordId(recordId: string): Promise<SessionInfo | null>;
23
+ findByScope(opts: {
24
+ workdir: string;
25
+ agentType: string;
26
+ name?: string;
27
+ }): Promise<SessionInfo | null>;
28
+ list(filter?: SessionFilter): Promise<SessionInfo[]>;
29
+ listSync(filter?: SessionFilter): SessionInfo[];
30
+ update(id: string, patch: Partial<SessionInfo>): Promise<void>;
31
+ updateStatus(id: string, status: SessionStatus, error?: string): Promise<void>;
32
+ delete(id: string): Promise<void>;
33
+ sweepStale(maxAgeMs: number): Promise<string[]>;
34
+ protected afterWrite(): Promise<void>;
35
+ }
36
+ export declare class FileSessionStore extends InMemorySessionStore {
37
+ private readonly filePath;
38
+ private readonly logger?;
39
+ private readonly lockFile;
40
+ private loaded;
41
+ constructor(filePath?: string, logger?: Logger | undefined);
42
+ create(session: SessionInfo): Promise<void>;
43
+ get(id: string): Promise<SessionInfo | null>;
44
+ getByAcpxRecordId(recordId: string): Promise<SessionInfo | null>;
45
+ findByScope(opts: {
46
+ workdir: string;
47
+ agentType: string;
48
+ name?: string;
49
+ }): Promise<SessionInfo | null>;
50
+ list(filter?: SessionFilter): Promise<SessionInfo[]>;
51
+ update(id: string, patch: Partial<SessionInfo>): Promise<void>;
52
+ delete(id: string): Promise<void>;
53
+ sweepStale(maxAgeMs: number): Promise<string[]>;
54
+ protected afterWrite(): Promise<void>;
55
+ private load;
56
+ private withLock;
57
+ }
58
+ export declare class RuntimeDbSessionStore implements SessionStore {
59
+ private readonly adapter;
60
+ private readonly logger?;
61
+ private readonly writes;
62
+ private initPromise;
63
+ constructor(adapter: SqlDatabaseAdapter, logger?: Logger | undefined);
64
+ create(session: SessionInfo): Promise<void>;
65
+ get(id: string): Promise<SessionInfo | null>;
66
+ getByAcpxRecordId(recordId: string): Promise<SessionInfo | null>;
67
+ findByScope(opts: {
68
+ workdir: string;
69
+ agentType: string;
70
+ name?: string;
71
+ }): Promise<SessionInfo | null>;
72
+ list(filter?: SessionFilter): Promise<SessionInfo[]>;
73
+ update(id: string, patch: Partial<SessionInfo>): Promise<void>;
74
+ updateStatus(id: string, status: SessionStatus, error?: string): Promise<void>;
75
+ delete(id: string): Promise<void>;
76
+ sweepStale(maxAgeMs: number): Promise<string[]>;
77
+ private ensureInitialized;
78
+ private upsert;
79
+ private execute;
80
+ private getMany;
81
+ private getOne;
82
+ }
83
+ export interface AcpSessionStoreOptions {
84
+ runtime?: SessionStoreRuntime;
85
+ stateFile?: string;
86
+ backend?: SessionStoreBackend;
87
+ }
88
+ export declare class AcpSessionStore implements SessionStore {
89
+ readonly backend: SessionStoreBackend;
90
+ private readonly delegate;
91
+ constructor(options?: AcpSessionStoreOptions);
92
+ create(session: SessionInfo): Promise<void>;
93
+ get(id: string): Promise<SessionInfo | null>;
94
+ getByAcpxRecordId(recordId: string): Promise<SessionInfo | null>;
95
+ findByScope(opts: {
96
+ workdir: string;
97
+ agentType: string;
98
+ name?: string;
99
+ }): Promise<SessionInfo | null>;
100
+ list(filter?: SessionFilter): Promise<SessionInfo[]>;
101
+ update(id: string, patch: Partial<SessionInfo>): Promise<void>;
102
+ updateStatus(id: string, status: SessionStatus, error?: string): Promise<void>;
103
+ delete(id: string): Promise<void>;
104
+ sweepStale(maxAgeMs: number): Promise<string[]>;
105
+ }
106
+ export type { SessionFilter, SessionInfo, SessionStatus, SessionStore, } from "./types.js";
107
+ //# sourceMappingURL=session-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../../src/services/session-store.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnE,KAAK,MAAM,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEzD,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,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CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAI/B,IAAI,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAIpD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,YAAY,CACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,aAAa,EACrB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAIhB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAGhD;AAED,YAAY,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Skill callback bridge — child→parent USE_SKILL routing.
3
+ *
4
+ * Spawned task agents (Claude Code, Codex, Gemini CLI, etc.) cannot directly
5
+ * invoke parent skills. The bridge listens to PTY session output and, when
6
+ * the child emits a directive of the form
7
+ *
8
+ * USE_SKILL <slug> <json_args>
9
+ *
10
+ * dispatches to the parent's USE_SKILL action and pipes the result back into
11
+ * the same session via `ptyService.sendToSession`.
12
+ *
13
+ * Default-on per the Hermes-style project direction. Disable by setting
14
+ * `ELIZA_ENABLE_CHILD_SKILL_CALLBACK=0`.
15
+ *
16
+ * @module services/skill-callback-bridge
17
+ */
18
+ import type { IAgentRuntime } from "@elizaos/core";
19
+ import type { PTYService } from "./pty-service.js";
20
+ interface SkillCallbackInvocation {
21
+ slug: string;
22
+ args: unknown;
23
+ }
24
+ /**
25
+ * Parse the first USE_SKILL directive in a chunk of agent output, if any.
26
+ * The directive must be on its own line (after optional whitespace).
27
+ */
28
+ export declare function parseUseSkillDirective(text: string): SkillCallbackInvocation | null;
29
+ interface BridgeDeps {
30
+ runtime: IAgentRuntime;
31
+ ptyService: PTYService;
32
+ /**
33
+ * Optional: per-session allow-list of skill slugs. The bridge consults the
34
+ * registry below when dispatching a child USE_SKILL directive. A directive
35
+ * whose slug is not on the session's allow-list is rejected back into the
36
+ * child with an error message listing the slugs that were rendered into that
37
+ * session's SKILLS.md.
38
+ *
39
+ * If omitted (or no entry is registered for the session), the bridge falls
40
+ * back to permissive behavior — any enabled skill may be invoked. This
41
+ * preserves backwards-compatible behavior for callers that do not yet wire
42
+ * per-spawn manifests.
43
+ */
44
+ sessionAllowList?: SkillSessionAllowList;
45
+ }
46
+ /**
47
+ * Session-scoped allow-list registry. Callers register a session's allow-list
48
+ * at spawn time from the generated SKILLS.md manifest. The bridge reads the
49
+ * entry when a USE_SKILL directive arrives.
50
+ *
51
+ * Using a plain Map instead of a WeakMap — the key is the PTY sessionId
52
+ * string assigned at spawn time, which we must explicitly clear on session
53
+ * teardown to avoid leaks.
54
+ */
55
+ export interface SkillSessionAllowList {
56
+ register: (sessionId: string, slugs: readonly string[]) => void;
57
+ clear: (sessionId: string) => void;
58
+ get: (sessionId: string) => readonly string[] | undefined;
59
+ }
60
+ export declare function createSkillSessionAllowList(): SkillSessionAllowList;
61
+ /**
62
+ * Ensure the bridge is installed exactly once for this runtime+PTY pair.
63
+ * Safe to call from every task spawn — subsequent calls are no-ops. The
64
+ * session allow-list registry, when supplied, is attached on the first
65
+ * install and reused thereafter; callers can look up the registry they
66
+ * passed in to register per-session slugs.
67
+ */
68
+ export declare function ensureSkillCallbackBridge(deps: BridgeDeps): void;
69
+ /**
70
+ * Install the child→parent USE_SKILL bridge for the given PTY service. Safe
71
+ * to call multiple times — duplicate listeners are idempotent because the
72
+ * unsubscribe handle is returned to the caller.
73
+ *
74
+ * Returns a teardown function. Call it on shutdown to remove the listener.
75
+ */
76
+ export declare function installSkillCallbackBridge(deps: BridgeDeps): () => void;
77
+ export {};
78
+ //# sourceMappingURL=skill-callback-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-callback-bridge.d.ts","sourceRoot":"","sources":["../../../../src/services/skill-callback-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAU,aAAa,EAAU,MAAM,eAAe,CAAC;AAKnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAqBnD,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACf;AAsBD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,GACX,uBAAuB,GAAG,IAAI,CAmBhC;AAkCD,UAAU,UAAU;IAClB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAChE,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3D;AAED,wBAAgB,2BAA2B,IAAI,qBAAqB,CAWnE;AASD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAKhE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,IAAI,CA+KvE"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Auto-injected subset of `assets/claude-code-skills/eliza-runtime/SKILL.md`
3
+ * that ships verbatim in the workspace-lock brief for claude sub-agents.
4
+ *
5
+ * Why a separate constant (and not just a Read of SKILL.md at runtime):
6
+ * sub-agents on the Claude.ai consumer-tier OAuth do not have the `Skill`
7
+ * tool, so the skill auto-load mechanism is unavailable to them. Inlining
8
+ * the must-have sections into the spawn brief gives them the operating
9
+ * manual upfront with zero file I/O.
10
+ *
11
+ * Keep this in sync with SKILL.md: when you edit one, edit both. SKILL.md
12
+ * remains the canonical / extended manual (spawn-variants table, helper
13
+ * scripts, references). This constant is the always-injected minimum.
14
+ */
15
+ export declare const CLAUDE_SKILL_ESSENTIALS = "Tool availability varies by Claude Code build and account tier \u2014 enumerate your actual tools (read `.claude/settings.json`'s `permissions.allow`, or use `ToolSearch` if present) before deciding you can't do a thing.\n\n# DECISION protocol\n\nThe orchestrator greps your stdout for lines starting with `DECISION:`. Use them when you make an architectural choice not covered by the brief, or when reporting a hard limitation. Examples:\n\n```\nDECISION: chose /api/v1/messages/ over /messages/ to match existing eliza-cloud route prefix.\nDECISION: cannot run shell commands \u2014 this session has Read/Grep/Glob but no Bash, Monitor, or run_shell_command. Reported what I could find statically.\n```\n\nALWAYS-on, no shell tool required \u2014 just print the line.\n\n# What you should NEVER do\n\n- Refuse a task as \"no shell available\" without first enumerating your actual tool list (settings.json + ToolSearch). Different tiers ship different shell tools \u2014 `Bash`, `Monitor`, `run_shell_command` \u2014 at least one is usually present.\n- Say \"use the `!` prefix\" or \"run this in your terminal\" \u2014 there is no terminal in your face.\n- Ask the human to clarify or provide input \u2014 there is no human in your session.\n- Push to remotes, write outside workdir, print env tokens.\n- Treat partial information as a blocker \u2014 produce the best output you can with what you have.\n\n# Bridge endpoints (parent state, read-only)\n\nWhen HTTP hooks are wired (variants `swarm` and `repo`), GET these to query parent state:\n- `http://localhost:${ELIZA_HOOK_PORT:-2138}/api/coding-agents/$PARALLAX_SESSION_ID/parent-context` \u2014 agent character, originating room, original task\n- `.../memory?q=<query>&limit=<N>` \u2014 recent messages from the originating room\n- `.../active-workspaces` \u2014 sibling sub-agents (swarm only)\n\nAuth is the path-embedded session id. Loopback-only, GET-only, read-only.\n\n# Constraints\n\n- Sealed env: only an allowlist of vars is forwarded (PATH, HOME, USER, SHELL, ANTHROPIC_MODEL, GITHUB_TOKEN, PARALLAX_SESSION_ID, ELIZA_HOOK_PORT, etc.).\n- Workspace-only writes: write only inside your workdir.\n- Don't push to git remotes \u2014 Eliza handles git push, PR creation, cross-repo coordination.\n- Don't print secrets \u2014 PTY output is captured. Reference secrets by env-var name.\n\nFor deeper context (spawn-variants table, helper scripts, references) see `~/.claude/skills/eliza-runtime/SKILL.md`.";
16
+ //# sourceMappingURL=skill-essentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-essentials.d.ts","sourceRoot":"","sources":["../../../../src/services/skill-essentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,46EAqCmF,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { ActionResult, IAgentRuntime } from "@elizaos/core";
2
+ import type { SessionInfo } from "./pty-types.js";
3
+ import type { RecommendedSkill } from "./skill-recommender.js";
4
+ export declare const LIFEOPS_CONTEXT_BROKER_SLUG = "lifeops-context";
5
+ export declare const LIFEOPS_CONTEXT_BROKER_MANIFEST_ENTRY: {
6
+ readonly slug: "lifeops-context";
7
+ readonly name: "LifeOps Context Broker";
8
+ readonly description: "Task-scoped parent broker for owner LifeOps context. Supports email, calendar, inbox/priority, contacts, documents, and generic cross-channel search/context.";
9
+ readonly guidance: "Use only when task-relevant personal context is needed. Example: `USE_SKILL lifeops-context {\"category\":\"email\",\"query\":\"contract from Alex\",\"limit\":5}`. Categories: email, calendar, inbox, priority, contacts, documents, search, context.";
10
+ };
11
+ export interface LifeOpsContextBrokerRequest {
12
+ runtime: IAgentRuntime;
13
+ sessionId: string;
14
+ session?: SessionInfo;
15
+ args: unknown;
16
+ }
17
+ export declare function runLifeOpsContextBroker(request: LifeOpsContextBrokerRequest): Promise<ActionResult>;
18
+ export declare function shouldRecommendLifeOpsContextBroker(taskText: string): boolean;
19
+ export declare function withLifeOpsContextBrokerRecommendation(taskText: string, recommendations: readonly RecommendedSkill[]): RecommendedSkill[];
20
+ //# sourceMappingURL=skill-lifeops-context-broker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-lifeops-context-broker.d.ts","sourceRoot":"","sources":["../../../../src/services/skill-lifeops-context-broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,YAAY,EAGZ,aAAa,EAId,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAE7D,eAAO,MAAM,qCAAqC;;;;;CAOxC,CAAC;AAuBX,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf;AA8WD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,YAAY,CAAC,CAyHvB;AAWD,wBAAgB,mCAAmC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAc7E;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,SAAS,gBAAgB,EAAE,GAC3C,gBAAgB,EAAE,CAmBpB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Skill manifest builder.
3
+ *
4
+ * Renders a Markdown SKILLS.md document for spawned task agents so they have
5
+ * full visibility into the skills installed in the parent runtime. The parent
6
+ * agent owns skill execution; spawned agents request skill invocation by
7
+ * calling back to the parent (see skill callback bridge in send-to-agent.ts
8
+ * when ELIZA_ENABLE_CHILD_SKILL_CALLBACK is enabled).
9
+ *
10
+ * Source of truth is the AGENT_SKILLS_SERVICE (`@elizaos/plugin-agent-skills`).
11
+ *
12
+ * @module services/skill-manifest
13
+ */
14
+ import type { IAgentRuntime } from "@elizaos/core";
15
+ export interface ManifestSkillEntry {
16
+ slug: string;
17
+ name: string;
18
+ description: string;
19
+ /** Task-scoped invocation guidance for virtual broker skills. */
20
+ guidance?: string;
21
+ }
22
+ export interface BuildSkillsManifestOptions {
23
+ /** Restrict the "All available skills" section to eligible-and-enabled skills. */
24
+ onlyEligible?: boolean;
25
+ /**
26
+ * Slugs to highlight in a dedicated "Recommended for this task" section.
27
+ * Slugs not present in the eligible/enabled set are silently dropped — the
28
+ * recommender does not guarantee installed status.
29
+ */
30
+ recommendedSlugs?: string[];
31
+ /** Additional task-scoped skills handled by the orchestrator bridge. */
32
+ virtualSkills?: ManifestSkillEntry[];
33
+ }
34
+ export interface SkillsManifestResult {
35
+ /** Markdown document suitable for writing to SKILLS.md inside a workspace. */
36
+ markdown: string;
37
+ /** Slugs that the spawned agent can actually request via USE_SKILL. */
38
+ slugs: string[];
39
+ }
40
+ /**
41
+ * Build a SKILLS.md markdown document plus the canonical slug list.
42
+ *
43
+ * The slug list is the deduplicated union of recommended + available slugs,
44
+ * so callers can persist it for trajectory annotation or programmatic checks
45
+ * without re-resolving against the service.
46
+ */
47
+ export declare function buildSkillsManifest(runtime: IAgentRuntime, opts?: BuildSkillsManifestOptions): Promise<SkillsManifestResult>;
48
+ //# sourceMappingURL=skill-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../src/services/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,eAAe,CAAC;AAKpE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAcD,MAAM,WAAW,0BAA0B;IACzC,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,wEAAwE;IACxE,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAuED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,EACtB,IAAI,GAAE,0BAA+B,GACpC,OAAO,CAAC,oBAAoB,CAAC,CAsE/B"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Skill recommender — suggests relevant skills for a task description.
3
+ *
4
+ * Two-pass strategy:
5
+ * 1. Cheap keyword/category match against installed skill metadata. Returns
6
+ * up to 10 candidate slugs sorted by overlap score.
7
+ * 2. Optional LLM scoring pass over the surviving candidates that returns a
8
+ * small JSON scores array. Skipped when any keyword
9
+ * match already scores ≥ 0.9 (no need to spend a model call) or when the
10
+ * runtime model is unavailable.
11
+ *
12
+ * The output is task-aware ranking: the orchestrator can then write the top
13
+ * N into SKILLS.md and reference them in the spawned agent's initial prompt.
14
+ *
15
+ * @module services/skill-recommender
16
+ */
17
+ import { type IAgentRuntime } from "@elizaos/core";
18
+ export interface RecommendedSkill {
19
+ slug: string;
20
+ name: string;
21
+ /** Score in [0, 1]. 0 = irrelevant, 1 = perfect fit. */
22
+ score: number;
23
+ /** Short, human-readable justification (≤ 1 line). */
24
+ reason: string;
25
+ }
26
+ export interface RecommendSkillsOptions {
27
+ /** Optional task kind classification (coding | research | planning | ops | mixed). */
28
+ taskKind?: string;
29
+ /** Free-form task description provided by the user or planner. */
30
+ taskText: string;
31
+ /** Optional repo/language context — used to bias toward language-specific skills. */
32
+ repoContext?: {
33
+ language?: string;
34
+ framework?: string;
35
+ };
36
+ /** Maximum number of recommendations to return. Defaults to 5. */
37
+ max?: number;
38
+ /**
39
+ * Force-disable the LLM scoring pass. Defaults to false; when omitted the
40
+ * recommender runs the LLM pass unless a keyword match already scores ≥ 0.9.
41
+ */
42
+ disableLlmPass?: boolean;
43
+ }
44
+ /**
45
+ * Recommend skills relevant to a task.
46
+ *
47
+ * Always returns the top `max` (default 5) candidates ranked by score.
48
+ * Returns an empty array if no skills are eligible/enabled.
49
+ */
50
+ export declare function recommendSkillsForTask(runtime: IAgentRuntime, opts: RecommendSkillsOptions): Promise<RecommendedSkill[]>;
51
+ //# sourceMappingURL=skill-recommender.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-recommender.d.ts","sourceRoot":"","sources":["../../../../src/services/skill-recommender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,eAAe,CAAC;AAwDvB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA6RD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAyK7B"}