@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,48 @@
1
+ export declare const ORCHESTRATOR_TOOL_NAMES: readonly ["sh", "git", "rg", "bun", "acpx", "codex", "claude", "opencode"];
2
+ export type OrchestratorToolName = (typeof ORCHESTRATOR_TOOL_NAMES)[number];
3
+ export interface OrchestratorToolCapability {
4
+ name: OrchestratorToolName;
5
+ path?: string;
6
+ available: boolean;
7
+ }
8
+ export interface ResolvedOrchestratorShell {
9
+ command: string;
10
+ args: string[];
11
+ available: boolean;
12
+ source: "env:CODING_TOOLS_SHELL" | "env:SHELL" | "candidate" | "fallback";
13
+ warning?: string;
14
+ }
15
+ export type OrchestratorUnsupportedReason = "store_build" | "vanilla_mobile" | "not_local_yolo" | "missing_shell";
16
+ export interface OrchestratorTerminalSupport {
17
+ supported: boolean;
18
+ reason?: OrchestratorUnsupportedReason;
19
+ message?: string;
20
+ }
21
+ /** Pure, injectable snapshot of the environment fields the support gate reads. */
22
+ export interface TerminalSupportEnv {
23
+ platform?: string;
24
+ buildVariant?: string;
25
+ runtimeMode?: string;
26
+ androidRoot?: string;
27
+ androidData?: string;
28
+ aospBuild?: string;
29
+ }
30
+ export declare function isAndroidRuntime(): boolean;
31
+ /**
32
+ * Pure device-support classifier. Same precedence as
33
+ * detectOrchestratorTerminalSupport (store > ios > android-mode > android-shell)
34
+ * but with no process.env / fs reads — callers inject the env snapshot and, for
35
+ * Android, whether an executable shell is present. Used by the static device
36
+ * support matrix (#9146) and by detectOrchestratorTerminalSupport itself.
37
+ */
38
+ export declare function classifyTerminalSupport(env: TerminalSupportEnv, opts?: {
39
+ androidShellAvailable?: boolean;
40
+ }): OrchestratorTerminalSupport;
41
+ export declare function isAospTerminalRuntime(): boolean;
42
+ export declare function resolveExecutable(nameOrPath: string): string | undefined;
43
+ export declare function resolveOrchestratorShell(): ResolvedOrchestratorShell;
44
+ export declare function detectOrchestratorCapabilities(): OrchestratorToolCapability[];
45
+ export declare function formatOrchestratorCapabilities(capabilities?: OrchestratorToolCapability[]): string;
46
+ export declare function missingToolMessage(tool: OrchestratorToolName): string;
47
+ export declare function detectOrchestratorTerminalSupport(): OrchestratorTerminalSupport;
48
+ //# sourceMappingURL=terminal-capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/services/terminal-capabilities.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,4EAS1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,y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M,CAUrE;AAED,wBAAgB,iCAAiC,IAAI,2BAA2B,CAoB/E"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Trajectory Context — Tag orchestrator LLM calls for trajectory logging.
3
+ *
4
+ * Sets a lightweight context object on the runtime before `useModel()` calls
5
+ * so the trajectory logger can identify orchestrator-specific LLM invocations
6
+ * (skill recommendations, launch-failure summaries, etc.) and tag
7
+ * them with meaningful metadata instead of the generic "action" / "runtime.useModel".
8
+ *
9
+ * The eliza trajectory-persistence layer reads `runtime.__orchestratorTrajectoryCtx`
10
+ * in its `appendLlmCall` patch and writes the context into the trajectory record.
11
+ *
12
+ * @module services/trajectory-context
13
+ */
14
+ /**
15
+ * Any runtime-like object. We accept both `AgentRuntime` and `IAgentRuntime`
16
+ * since different call sites use different types. Using a minimal interface
17
+ * avoids index-signature incompatibilities with ElizaOS types.
18
+ */
19
+ type RuntimeLike = object;
20
+ /**
21
+ * Orchestrator decision types that map to specific LLM call sites.
22
+ */
23
+ export type OrchestratorDecisionType = "skill-context-generation" | "launch-failure-message";
24
+ export interface OrchestratorTrajectoryContext {
25
+ /** Source identifier — always "orchestrator" */
26
+ source: "orchestrator";
27
+ /** Which decision type triggered this LLM call */
28
+ decisionType: OrchestratorDecisionType;
29
+ /** ACP session ID of the agent being evaluated */
30
+ sessionId?: string;
31
+ /** Human-readable task label */
32
+ taskLabel?: string;
33
+ /** Repository URL or identifier (for trajectory feedback filtering) */
34
+ repo?: string;
35
+ /** Workspace directory path */
36
+ workdir?: string;
37
+ /** Original task description assigned to the agent */
38
+ originalTask?: string;
39
+ }
40
+ /**
41
+ * Set orchestrator trajectory context on the runtime.
42
+ * Call this before `runtime.useModel()` and clear it after.
43
+ */
44
+ export declare function setTrajectoryContext(runtime: RuntimeLike, ctx: OrchestratorTrajectoryContext): void;
45
+ /**
46
+ * Clear orchestrator trajectory context from the runtime.
47
+ */
48
+ export declare function clearTrajectoryContext(runtime: RuntimeLike): void;
49
+ /**
50
+ * Read the current orchestrator trajectory context (if any).
51
+ * Used by the trajectory logger on the eliza side.
52
+ */
53
+ export declare function readTrajectoryContext(runtime: unknown): OrchestratorTrajectoryContext | undefined;
54
+ /**
55
+ * Wrap a `useModel()` call with trajectory context tagging.
56
+ * Ensures the context is always cleared, even if the call throws.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const result = await withTrajectoryContext(
61
+ * ctx.runtime,
62
+ * { source: "orchestrator", decisionType: "skill-context-generation", sessionId },
63
+ * () => ctx.runtime.useModel(ModelType.TEXT_SMALL, { prompt }),
64
+ * );
65
+ * ```
66
+ */
67
+ export declare function withTrajectoryContext<T>(runtime: RuntimeLike, ctx: OrchestratorTrajectoryContext, fn: () => Promise<T>): Promise<T>;
68
+ export {};
69
+ //# sourceMappingURL=trajectory-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectory-context.d.ts","sourceRoot":"","sources":["../../../../src/services/trajectory-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,0BAA0B,GAC1B,wBAAwB,CAAC;AAE7B,MAAM,WAAW,6BAA6B;IAC5C,gDAAgD;IAChD,MAAM,EAAE,cAAc,CAAC;IACvB,kDAAkD;IAClD,YAAY,EAAE,wBAAwB,CAAC;IACvC,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,6BAA6B,GACjC,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAEjE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,GACf,6BAA6B,GAAG,SAAS,CAQ3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,6BAA6B,EAClC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAOZ"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Trajectory Feedback — Past Experience Injection
3
+ *
4
+ * Queries the trajectory database for past orchestrator decisions and
5
+ * formats relevant experience as agent memory context. This closes the
6
+ * loop between trajectory *output* (logging decisions) and trajectory
7
+ * *input* (feeding experience back to agents at spawn time).
8
+ *
9
+ * Inspired by "Codified Context" (arXiv:2602.20478) — known failure
10
+ * modes and past decisions are pre-loaded into agent context so they
11
+ * don't repeat mistakes or re-derive solutions.
12
+ *
13
+ * @module services/trajectory-feedback
14
+ */
15
+ import { type IAgentRuntime } from "@elizaos/core";
16
+ /** A distilled experience entry from a past trajectory. */
17
+ interface PastExperience {
18
+ /** When this experience was recorded */
19
+ timestamp: number;
20
+ /** The orchestrator decision type (coordination, turn-complete, etc.) */
21
+ decisionType: string;
22
+ /** Agent label that produced this experience */
23
+ taskLabel: string;
24
+ /** The key insight or decision (extracted from LLM response) */
25
+ insight: string;
26
+ }
27
+ /** Options for querying past experience. */
28
+ export interface TrajectoryFeedbackOptions {
29
+ /** Maximum number of recent trajectories to scan (default: 30) */
30
+ maxTrajectories?: number;
31
+ /** Maximum number of experience entries to return (default: 8) */
32
+ maxEntries?: number;
33
+ /** Only include trajectories from the last N hours (default: 48) */
34
+ lookbackHours?: number;
35
+ /** Task description for relevance filtering */
36
+ taskDescription?: string;
37
+ /** Repository URL — only return experience from the same repo */
38
+ repo?: string;
39
+ }
40
+ /**
41
+ * Query the trajectory database for past orchestrator decisions and
42
+ * return distilled experience entries relevant to the current task.
43
+ */
44
+ export declare function queryPastExperience(runtime: IAgentRuntime, options?: TrajectoryFeedbackOptions): Promise<PastExperience[]>;
45
+ /**
46
+ * Format past experience entries as a markdown section suitable for
47
+ * injection into ACP agent context.
48
+ *
49
+ * Returns empty string if no relevant experience is found.
50
+ */
51
+ export declare function formatPastExperience(experiences: PastExperience[]): string;
52
+ export {};
53
+ //# sourceMappingURL=trajectory-feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectory-feedback.d.ts","sourceRoot":"","sources":["../../../../src/services/trajectory-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAoB1E,2DAA2D;AAC3D,UAAU,cAAc;IACtB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,4CAA4C;AAC5C,MAAM,WAAW,yBAAyB;IACxC,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA0JD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,cAAc,EAAE,CAAC,CA0J3B;AAID;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,MAAM,CAe1E"}
@@ -0,0 +1,188 @@
1
+ export type AgentType = "elizaos" | "pi-agent" | "opencode" | "claude" | "codex" | string;
2
+ export type ApprovalPreset = "readonly" | "standard" | "permissive" | "autonomous";
3
+ export type SessionStatus = "running" | "ready" | "busy" | "blocked" | "authenticating" | "completed" | "stopped" | "errored" | "cancelled" | "tool_running" | string;
4
+ export type SessionEventName = "ready" | "blocked" | "login_required" | "task_complete" | "tool_running" | "stopped" | "error" | "message" | "reasoning" | "plan" | "reconnected" | string;
5
+ /**
6
+ * Set of session statuses that mean "this session is finished and will
7
+ * not emit further activity". Exported here so providers, the progress
8
+ * hook, and the orchestrator service share a single source of truth.
9
+ * Adding a new terminal status only requires updating this set.
10
+ */
11
+ export declare const TERMINAL_SESSION_STATUSES: ReadonlySet<string>;
12
+ export type SessionEventCallback = (sessionId: string, event: SessionEventName, data: unknown) => void;
13
+ export type AcpEventCallback = (event: AcpJsonRpcMessage, sessionId?: string) => void;
14
+ export interface SpawnOptions {
15
+ name?: string;
16
+ agentType?: AgentType;
17
+ workdir?: string;
18
+ /**
19
+ * When true, spawnSession places this session in a per-session subdir of
20
+ * `workdir` (a SHARED scratch root) so concurrent tasks can't collide.
21
+ * Set by the orchestrator only when the workdir resolved to a configured
22
+ * workspace root — never for cwd self-checkout or a route/explicit dir.
23
+ */
24
+ isolateWorkdir?: boolean;
25
+ initialTask?: string;
26
+ env?: Record<string, string>;
27
+ metadata?: Record<string, unknown>;
28
+ credentials?: unknown;
29
+ memoryContent?: string;
30
+ approvalPreset?: ApprovalPreset;
31
+ customCredentials?: Record<string, string>;
32
+ skipAdapterAutoResponse?: boolean;
33
+ timeoutMs?: number;
34
+ model?: string;
35
+ }
36
+ export interface SpawnResult {
37
+ sessionId: string;
38
+ id: string;
39
+ name: string;
40
+ agentType: AgentType;
41
+ workdir: string;
42
+ status: SessionStatus;
43
+ acpxRecordId?: string;
44
+ acpxSessionId?: string;
45
+ agentSessionId?: string;
46
+ pid?: number;
47
+ authReady?: boolean;
48
+ metadata?: Record<string, unknown>;
49
+ }
50
+ export interface SendOptions {
51
+ timeoutMs?: number;
52
+ silent?: boolean;
53
+ env?: Record<string, string>;
54
+ model?: string;
55
+ }
56
+ export interface PromptResult {
57
+ sessionId: string;
58
+ response: string;
59
+ finalText: string;
60
+ stopReason: string;
61
+ durationMs: number;
62
+ exitCode?: number | null;
63
+ signal?: NodeJS.Signals | null;
64
+ error?: string;
65
+ }
66
+ export interface AvailableAgentInfo {
67
+ adapter: AgentType;
68
+ agentType: AgentType;
69
+ installed: boolean;
70
+ installCommand?: string;
71
+ docsUrl?: string;
72
+ auth?: {
73
+ status?: "authenticated" | "unauthenticated" | "unknown" | string;
74
+ detail?: string;
75
+ };
76
+ }
77
+ export interface SessionInfo {
78
+ id: string;
79
+ name?: string;
80
+ agentType: AgentType;
81
+ workdir: string;
82
+ status: SessionStatus;
83
+ acpxRecordId?: string;
84
+ acpxSessionId?: string;
85
+ agentSessionId?: string;
86
+ pid?: number;
87
+ approvalPreset: ApprovalPreset;
88
+ createdAt: Date;
89
+ lastActivityAt: Date;
90
+ lastError?: string;
91
+ metadata?: Record<string, unknown>;
92
+ }
93
+ export interface SessionFilter {
94
+ status?: SessionStatus;
95
+ statuses?: SessionStatus[];
96
+ workdir?: string;
97
+ agentType?: string;
98
+ name?: string;
99
+ acpxRecordId?: string;
100
+ }
101
+ export interface SessionStore {
102
+ create(session: SessionInfo): Promise<void>;
103
+ get(id: string): Promise<SessionInfo | null>;
104
+ getByAcpxRecordId(recordId: string): Promise<SessionInfo | null>;
105
+ findByScope(opts: {
106
+ workdir: string;
107
+ agentType: string;
108
+ name?: string;
109
+ }): Promise<SessionInfo | null>;
110
+ list(filter?: SessionFilter): Promise<SessionInfo[]>;
111
+ update(id: string, patch: Partial<SessionInfo>): Promise<void>;
112
+ updateStatus(id: string, status: SessionStatus, error?: string): Promise<void>;
113
+ delete(id: string): Promise<void>;
114
+ sweepStale(maxAgeMs: number): Promise<string[]>;
115
+ }
116
+ export interface SessionStoreRuntime {
117
+ databaseAdapter?: unknown;
118
+ logger?: {
119
+ warn?: (message: string, ...args: unknown[]) => void;
120
+ error?: (message: string, ...args: unknown[]) => void;
121
+ info?: (message: string, ...args: unknown[]) => void;
122
+ debug?: (message: string, ...args: unknown[]) => void;
123
+ };
124
+ getSetting?: (key: string) => string | undefined;
125
+ }
126
+ export interface AcpJsonRpcBase {
127
+ jsonrpc?: "2.0" | string;
128
+ }
129
+ export interface AcpJsonRpcRequest extends AcpJsonRpcBase {
130
+ id: string | number;
131
+ method: string;
132
+ params?: unknown;
133
+ }
134
+ export interface AcpJsonRpcNotification extends AcpJsonRpcBase {
135
+ method: string;
136
+ params?: unknown;
137
+ }
138
+ export interface AcpJsonRpcResponse extends AcpJsonRpcBase {
139
+ id: string | number;
140
+ result?: unknown;
141
+ error?: {
142
+ code?: number;
143
+ message?: string;
144
+ data?: unknown;
145
+ };
146
+ }
147
+ export interface AcpJsonRpcAnyMessage extends AcpJsonRpcBase {
148
+ id?: string | number;
149
+ method?: string;
150
+ params?: unknown;
151
+ result?: unknown;
152
+ error?: {
153
+ code?: number;
154
+ message?: string;
155
+ data?: unknown;
156
+ };
157
+ [k: string]: unknown;
158
+ }
159
+ export type AcpJsonRpcMessage = AcpJsonRpcAnyMessage;
160
+ export interface AcpToolCall {
161
+ id?: string;
162
+ title?: string;
163
+ status?: "pending" | "running" | "completed" | "failed" | "cancelled" | string;
164
+ output?: string;
165
+ /**
166
+ * ACP `kind` (when present) — typically `read`, `edit`, `execute`,
167
+ * `search`, `fetch`, etc. Lets downstream consumers format the
168
+ * Claude-Code-style display (e.g. `Bash(git status)` for kind=execute).
169
+ */
170
+ kind?: string;
171
+ /**
172
+ * ACP `rawInput` — the actual tool arguments object as the agent
173
+ * emitted it. For Read/Edit/Write the most useful field is usually
174
+ * `file_path`. For Bash/Terminal it's `command`. For Grep it's
175
+ * `pattern` / `path`. Forwarded as-is so consumers can pick what they
176
+ * surface.
177
+ */
178
+ rawInput?: Record<string, unknown>;
179
+ /**
180
+ * ACP `locations` array — file path + line hints attached to the call.
181
+ * For Read/Edit this typically holds the target file.
182
+ */
183
+ locations?: Array<{
184
+ path?: string;
185
+ line?: number;
186
+ }>;
187
+ }
188
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,UAAU,GACV,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,OAAO,GACP,MAAM,GACN,SAAS,GACT,gBAAgB,GAChB,WAAW,GACX,SAAS,GACT,SAAS,GACT,WAAW,GACX,cAAc,GACd,MAAM,CAAC;AAEX,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,SAAS,GACT,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,SAAS,GACT,OAAO,GACP,SAAS,GACT,WAAW,GACX,MAAM,GACN,aAAa,GACb,MAAM,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,CAMxD,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CACjC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE,OAAO,KACV,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAAK,EAAE,iBAAiB,EACxB,SAAS,CAAC,EAAE,MAAM,KACf,IAAI,CAAC;AAEV,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,cA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KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5D,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EACH,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,GACX,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Cloud deployment guidance for elizaOS view/plugin builds.
3
+ *
4
+ * View plugins have a different deploy contract from generic web apps:
5
+ * the view bundle must be published, registered as a Cloud app, and wired
6
+ * back into `Plugin.views`/the published manifest with a concrete viewKind.
7
+ */
8
+ export interface ViewPluginDeployPromptOptions {
9
+ /** Source directory the sub-agent should treat as the plugin root. */
10
+ sourceDir?: string;
11
+ }
12
+ export declare function buildViewPluginDeployPrompt(options?: ViewPluginDeployPromptOptions): string;
13
+ export declare function buildLocalViewPluginPrompt(): string;
14
+ //# sourceMappingURL=view-deploy-guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-deploy-guidance.d.ts","sourceRoot":"","sources":["../../../../src/services/view-deploy-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,6BAA6B;IAC5C,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,6BAAkC,GAC1C,MAAM,CAkBR;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAQnD"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Default per-task workdir for an auto-spawned coding agent:
3
+ * `~/.eliza/workspaces/<taskId>`, created if missing. Always inside the allowed
4
+ * workspace base (see {@link resolveAllowedWorkdir}), so messaging a task can
5
+ * spawn an agent without a caller-supplied workdir — the parity-with-claude/codex
6
+ * "just message it and it works" path relies on this.
7
+ */
8
+ export declare function ensureTaskWorkdir(taskId: string): Promise<string>;
9
+ export declare function resolveAllowedWorkdir(rawWorkdir: string): Promise<string>;
10
+ //# sourceMappingURL=workdir-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workdir-validation.d.ts","sourceRoot":"","sources":["../../../../src/services/workdir-validation.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMvE;AAED,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAuBjB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * What a sub-agent actually changed in its workspace, captured as ground
3
+ * truth from git (plus the agent's own edit/write tool calls) rather than from
4
+ * the model's frequently-confabulated description of its work. Persisted on
5
+ * session metadata at `task_complete` so the parent can answer "what did you
6
+ * change / show me the diff" from the real change set.
7
+ */
8
+ export interface WorkspaceChangeSet {
9
+ changedFiles: string[];
10
+ diffStat: string;
11
+ diff: string;
12
+ truncated: boolean;
13
+ capturedAt: number;
14
+ }
15
+ /**
16
+ * The repo HEAD at spawn time, so the change set at completion is scoped to
17
+ * exactly what this sub-agent did (committed or not). Undefined when the
18
+ * workspace is not a git work tree or has no commits yet.
19
+ */
20
+ export declare function captureBaselineSha(workdir: string): Promise<string | undefined>;
21
+ /**
22
+ * Tracked files already modified in the workspace at spawn time. The completion
23
+ * diff (`git diff <baseline>`) compares the working tree to the baseline
24
+ * COMMIT, so files that were dirty BEFORE the session (a leftover edit, a dirty
25
+ * submodule pointer) show up even though this sub-agent never touched them.
26
+ * Recording them at spawn lets the change set exclude that pre-existing churn.
27
+ */
28
+ export declare function captureBaselineDirty(workdir: string): Promise<string[]>;
29
+ /**
30
+ * What this sub-agent changed in `workdir` since spawn, from the union of two
31
+ * SESSION-SCOPED signals — no filesystem walk, no path denylist, no mtime
32
+ * heuristics, so it works for any workdir/language/deployment:
33
+ * - `git diff --name-status <base>`: tracked edits, deletions, renames since
34
+ * the spawn baseline (covers shell-driven writes to tracked files);
35
+ * - `toolPaths`: files the agent explicitly wrote via edit/write tool calls
36
+ * this session — including gitignored DEPLOY targets (`data/apps/<name>/`)
37
+ * that git won't surface.
38
+ *
39
+ * Deliberately NOT using `git ls-files --others`: it lists EVERY untracked file
40
+ * in the work tree regardless of when it appeared, so in a shared/long-lived
41
+ * workspace it scoops up accumulated clutter from prior sessions (stray .venv,
42
+ * old build output, scratch PDFs) that this task never touched. Both signals
43
+ * above are scoped to this session, so the change set stays accurate.
44
+ *
45
+ * Returns undefined when nothing changed or the workspace isn't a git repo.
46
+ */
47
+ export declare function captureChangeSet(workdir: string, baselineSha?: string, toolPaths?: string[], baselineDirty?: string[]): Promise<WorkspaceChangeSet | undefined>;
48
+ /** One-line, human-facing summary of a change set for a completion banner. */
49
+ export declare function summarizeChangeSet(changeSet: WorkspaceChangeSet): string;
50
+ //# sourceMappingURL=workspace-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-diff.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-diff.ts"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAsDD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAM7E;AAkDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,GAAE,MAAM,EAAO,EACxB,aAAa,GAAE,MAAM,EAAO,GAC3B,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAuDzC;AAqDD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAMxE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Git operations for Coding Workspace Service
3
+ *
4
+ * Extracted from workspace-service.ts — provides git status, commit, push,
5
+ * and PR creation as standalone functions operating on workspace paths.
6
+ *
7
+ * @module services/workspace-git-ops
8
+ */
9
+ import type { PullRequestInfo, WorkspaceService } from "git-workspace-service";
10
+ import type { CommitOptions, PROptions, PushOptions, WorkspaceResult, WorkspaceStatusResult } from "./workspace-types.js";
11
+ /**
12
+ * Get workspace git status (branch, staged/modified/untracked files).
13
+ */
14
+ export declare function getStatus(workspacePath: string): Promise<WorkspaceStatusResult>;
15
+ /**
16
+ * Commit changes in a workspace directory.
17
+ * Returns the commit hash.
18
+ */
19
+ export declare function commit(workspacePath: string, options: CommitOptions, log: (msg: string) => void): Promise<string>;
20
+ /**
21
+ * Push changes to remote for a workspace.
22
+ */
23
+ export declare function push(workspacePath: string, branch: string, options: PushOptions | undefined, log: (msg: string) => void, env?: NodeJS.ProcessEnv): Promise<void>;
24
+ /**
25
+ * Create a pull request for a workspace via the underlying WorkspaceService.
26
+ */
27
+ export declare function createPR(workspaceService: WorkspaceService, workspace: WorkspaceResult, workspaceId: string, options: PROptions, log: (msg: string) => void): Promise<PullRequestInfo>;
28
+ //# sourceMappingURL=workspace-git-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-git-ops.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-git-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,eAAe,EACf,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,wBAAsB,SAAS,CAC7B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAuChC;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC1B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,EAClB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,eAAe,CAAC,CAsB1B"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * GitHub integration for Coding Workspace Service
3
+ *
4
+ * Extracted from workspace-service.ts — provides GitHub API access
5
+ * via PAT or OAuth device flow, plus all issue management operations.
6
+ *
7
+ * @module services/workspace-github
8
+ */
9
+ import type { IAgentRuntime } from "@elizaos/core";
10
+ import type { CreateIssueOptions, GitHubPatClient as GitHubPatClientInstance, IssueComment, IssueInfo, IssueState } from "git-workspace-service";
11
+ /**
12
+ * Callback for surfacing auth prompts to the user.
13
+ * Returns true only when the prompt was delivered through an immediate
14
+ * user-visible channel. Buffered action callbacks are unsafe here because the
15
+ * device flow blocks until the user sees and completes the prompt.
16
+ */
17
+ export type AuthPromptCallback = (prompt: {
18
+ verificationUri: string;
19
+ userCode: string;
20
+ expiresIn: number;
21
+ }) => boolean | Promise<boolean>;
22
+ /**
23
+ * Context object passed by CodingWorkspaceService into every GitHub function.
24
+ * Lets us keep the extracted functions stateless while still mutating shared state.
25
+ */
26
+ export interface GitHubContext {
27
+ runtime: IAgentRuntime;
28
+ githubClient: GitHubPatClientInstance | null;
29
+ setGithubClient: (client: GitHubPatClientInstance) => void;
30
+ githubAuthInProgress: Promise<GitHubPatClientInstance> | null;
31
+ setGithubAuthInProgress: (p: Promise<GitHubPatClientInstance> | null) => void;
32
+ authPromptCallback: AuthPromptCallback | null;
33
+ log: (msg: string) => void;
34
+ }
35
+ export declare function parseOwnerRepo(repo: string): {
36
+ owner: string;
37
+ repo: string;
38
+ };
39
+ export declare function ensureGitHubClient(ctx: GitHubContext): Promise<GitHubPatClientInstance>;
40
+ export declare function performOAuthFlow(ctx: GitHubContext, clientId: string): Promise<GitHubPatClientInstance>;
41
+ export declare function createIssue(ctx: GitHubContext, repo: string, options: CreateIssueOptions): Promise<IssueInfo>;
42
+ export declare function getIssue(ctx: GitHubContext, repo: string, issueNumber: number): Promise<IssueInfo>;
43
+ export declare function listIssues(ctx: GitHubContext, repo: string, options?: {
44
+ state?: IssueState | "all";
45
+ labels?: string[];
46
+ assignee?: string;
47
+ }): Promise<IssueInfo[]>;
48
+ export declare function updateIssue(ctx: GitHubContext, repo: string, issueNumber: number, options: {
49
+ title?: string;
50
+ body?: string;
51
+ state?: IssueState;
52
+ labels?: string[];
53
+ assignees?: string[];
54
+ }): Promise<IssueInfo>;
55
+ export declare function addComment(ctx: GitHubContext, repo: string, issueNumber: number, body: string): Promise<IssueComment>;
56
+ export declare function listComments(ctx: GitHubContext, repo: string, issueNumber: number): Promise<IssueComment[]>;
57
+ export declare function closeIssue(ctx: GitHubContext, repo: string, issueNumber: number): Promise<IssueInfo>;
58
+ export declare function reopenIssue(ctx: GitHubContext, repo: string, issueNumber: number): Promise<IssueInfo>;
59
+ export declare function addLabels(ctx: GitHubContext, repo: string, issueNumber: number, labels: string[]): Promise<void>;
60
+ //# sourceMappingURL=workspace-github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-github.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-github.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,IAAI,uBAAuB,EAC1C,YAAY,EACZ,SAAS,EACT,UAAU,EACX,MAAM,uBAAuB,CAAC;AAM/B;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,aAAa,CAAC;IACvB,YAAY,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC7C,eAAe,EAAE,CAAC,MAAM,E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,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,GACA,OAAO,CAAC,SAAS,CAAC,CAIpB;AAED,wBAAsB,UAAU,CAC9B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAIvB;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,EAAE,CAAC,CAIzB;AAED,wBAAsB,UAAU,CAC9B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAMpB;AAED,wBAAsB,WAAW,CAC/B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAIpB;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -0,0 +1,5 @@
1
+ /** Remove a scratch directory safely — only if under baseDir or one of allowedDirs. */
2
+ export declare function removeScratchDir(dirPath: string, baseDir: string, log: (msg: string) => void, allowedDirs?: string[]): Promise<void>;
3
+ /** Garbage-collect orphaned workspace directories older than workspaceTtlMs. */
4
+ export declare function gcOrphanedWorkspaces(baseDir: string, workspaceTtlMs: number, trackedWorkspaceIds: Set<string>, log: (msg: string) => void): Promise<void>;
5
+ //# sourceMappingURL=workspace-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/services/workspace-lifecycle.ts"],"names":[],"mappings":"AAIA,uFAAuF;AACvF,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC1B,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,gFAAgF;AAChF,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,EAChC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,IAAI,CAAC,CAiDf"}