qlogicagent 2.20.2 → 2.20.4

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 (197) hide show
  1. package/dist/agent-contract.js +1 -1
  2. package/dist/agent.js +39 -35
  3. package/dist/cli.js +1 -1
  4. package/dist/host-contract.js +1 -1
  5. package/dist/host-session-collection-contract.js +1 -1
  6. package/dist/index.js +624 -549
  7. package/dist/memory-category-contract.js +1 -0
  8. package/dist/orchestration.js +1 -1
  9. package/dist/project-memory-host.js +21 -21
  10. package/dist/protocol.js +1 -1
  11. package/dist/skill-category-contract.js +1 -0
  12. package/dist/skills/builtin/web-research/SKILL.md +37 -0
  13. package/dist/skills/mcp/astraclaw-native-mcp-server.js +1 -1
  14. package/dist/tunables.js +1 -1
  15. package/dist/types/agent/memory-recall-context.d.ts +6 -9
  16. package/dist/types/agent/memory-recall-injection.d.ts +1 -6
  17. package/dist/types/agent/tool-loop/agent-argument-normalizer.d.ts +12 -0
  18. package/dist/types/agent/tool-loop/artifact-final-contract.d.ts +8 -0
  19. package/dist/types/agent/tool-loop.d.ts +5 -0
  20. package/dist/types/agent/types.d.ts +5 -0
  21. package/dist/types/cli/acp-extended-handlers.d.ts +11 -9
  22. package/dist/types/cli/acp-session-handlers.d.ts +1 -1
  23. package/dist/types/cli/acp-session-host.d.ts +8 -0
  24. package/dist/types/cli/agent-runtime-bootstrap.d.ts +7 -1
  25. package/dist/types/cli/agent-runtime-session-state.d.ts +23 -6
  26. package/dist/types/cli/atomic-text-file.d.ts +31 -0
  27. package/dist/types/cli/background-context-capsule.d.ts +12 -0
  28. package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
  29. package/dist/types/cli/cli-acp-request-handler.d.ts +3 -1
  30. package/dist/types/cli/community-workflow-installer.d.ts +1 -1
  31. package/dist/types/cli/core-tool-coordinator.d.ts +1 -0
  32. package/dist/types/cli/core-tools/agent-tool-service.d.ts +17 -1
  33. package/dist/types/cli/dev-tool-bootstrap.d.ts +3 -2
  34. package/dist/types/cli/dev-tools/dev-tool-bootstrap-service.d.ts +1 -0
  35. package/dist/types/cli/dev-tools/dev-tool-registry.d.ts +3 -1
  36. package/dist/types/cli/dev-tools/incremental-repo-map.d.ts +81 -0
  37. package/dist/types/cli/dev-tools/lsp-supervisor.d.ts +59 -0
  38. package/dist/types/cli/dev-tools/lsp-tool-service.d.ts +2 -0
  39. package/dist/types/cli/handlers/community-handler.d.ts +2 -0
  40. package/dist/types/cli/handlers/dream-handler.d.ts +1 -1
  41. package/dist/types/cli/handlers/memory-handler.d.ts +2 -14
  42. package/dist/types/cli/handlers/product-handler.d.ts +6 -24
  43. package/dist/types/cli/handlers/turn-handler.d.ts +1 -0
  44. package/dist/types/cli/idle-dream-coordinator.d.ts +9 -5
  45. package/dist/types/cli/memory-background-coordinator.d.ts +26 -0
  46. package/dist/types/cli/memory-candidate-service.d.ts +2 -3
  47. package/dist/types/cli/memory-coordinator.d.ts +12 -8
  48. package/dist/types/cli/permission-bootstrap.d.ts +10 -1
  49. package/dist/types/cli/product-acp-params.d.ts +29 -0
  50. package/dist/types/cli/resolved-agent-cache.d.ts +18 -7
  51. package/dist/types/cli/rpc-registry.d.ts +2 -1
  52. package/dist/types/cli/runtime-hook-bootstrap.d.ts +2 -0
  53. package/dist/types/cli/stdio-acp-request-host.d.ts +7 -4
  54. package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +8 -2
  55. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +4 -2
  56. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +1 -0
  57. package/dist/types/cli/stdio-server.d.ts +53 -16
  58. package/dist/types/cli/stdio-session-runtime-coordinator.d.ts +0 -2
  59. package/dist/types/cli/task-distillation-coordinator.d.ts +42 -14
  60. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +14 -4
  61. package/dist/types/cli/tool-bootstrap.d.ts +2 -1
  62. package/dist/types/cli/turn-core.d.ts +4 -0
  63. package/dist/types/cli/turn-lifecycle.d.ts +1 -0
  64. package/dist/types/contracts/hooks.d.ts +3 -2
  65. package/dist/types/contracts/turn-event.d.ts +7 -0
  66. package/dist/types/host-contract/index.d.ts +144 -14
  67. package/dist/types/host-contract/memory-category.d.ts +8 -0
  68. package/dist/types/host-contract/skill-category.d.ts +5 -0
  69. package/dist/types/host-session-collection-contract.d.ts +1 -0
  70. package/dist/types/orchestration/agent-instance.d.ts +15 -0
  71. package/dist/types/orchestration/dag-scheduler.d.ts +18 -0
  72. package/dist/types/orchestration/delegate-approval-policy.d.ts +8 -0
  73. package/dist/types/orchestration/goal-acceptance.d.ts +2 -5
  74. package/dist/types/orchestration/goal-loop-coordinator.d.ts +4 -2
  75. package/dist/types/orchestration/goal-mode-adapters.d.ts +16 -0
  76. package/dist/types/orchestration/goal-run-types.d.ts +6 -1
  77. package/dist/types/orchestration/product-budget.d.ts +35 -16
  78. package/dist/types/orchestration/product-persistence.d.ts +5 -14
  79. package/dist/types/orchestration/product-planner.d.ts +38 -0
  80. package/dist/types/orchestration/product-worktree.d.ts +4 -2
  81. package/dist/types/orchestration/solo-evaluator.d.ts +42 -2
  82. package/dist/types/orchestration/solo-spec-builder.d.ts +3 -0
  83. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +6 -0
  84. package/dist/types/orchestration/testing/run-state-client-double.d.ts +13 -0
  85. package/dist/types/orchestration/workflow/builtin-capabilities.d.ts +3 -0
  86. package/dist/types/orchestration/workflow/capability-catalog.d.ts +31 -0
  87. package/dist/types/orchestration/workflow/cron-schedule.d.ts +3 -4
  88. package/dist/types/orchestration/workflow/expression.d.ts +2 -1
  89. package/dist/types/orchestration/workflow/n8n-import.d.ts +3 -0
  90. package/dist/types/orchestration/workflow/node-registry.d.ts +2 -2
  91. package/dist/types/orchestration/workflow/node-schema.d.ts +20 -4
  92. package/dist/types/orchestration/workflow/params-schema.d.ts +7 -6
  93. package/dist/types/orchestration/workflow/qla-executor-host.d.ts +4 -1
  94. package/dist/types/orchestration/workflow/run-history-store.d.ts +33 -3
  95. package/dist/types/orchestration/workflow/semantic-acceptance.d.ts +65 -0
  96. package/dist/types/orchestration/workflow/workflow-authoring.d.ts +74 -0
  97. package/dist/types/orchestration/workflow/workflow-bundle.d.ts +4 -0
  98. package/dist/types/orchestration/workflow/workflow-controller.d.ts +16 -4
  99. package/dist/types/orchestration/workflow/workflow-edit-context.d.ts +46 -0
  100. package/dist/types/orchestration/workflow/workflow-intent-contract.d.ts +56 -0
  101. package/dist/types/orchestration/workflow/workflow-patch.d.ts +7 -0
  102. package/dist/types/orchestration/workflow/workflow-runtime.d.ts +5 -0
  103. package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +11 -0
  104. package/dist/types/orchestration/workflow/workflow-store.d.ts +5 -0
  105. package/dist/types/orchestration/workflow/workflow-template-setup.d.ts +65 -0
  106. package/dist/types/orchestration/workflow/workflow-trigger.d.ts +4 -0
  107. package/dist/types/orchestration/workflow-chat-builder.d.ts +105 -20
  108. package/dist/types/orchestration/worktree-task-prompt.d.ts +1 -0
  109. package/dist/types/protocol/agent-contract.d.ts +49 -8
  110. package/dist/types/protocol/notifications.d.ts +1 -1
  111. package/dist/types/protocol/wire/acp-agent-management.d.ts +97 -9
  112. package/dist/types/protocol/wire/acp-protocol.d.ts +7 -1
  113. package/dist/types/protocol/wire/agent-methods.d.ts +15 -1
  114. package/dist/types/protocol/wire/index.d.ts +2 -4
  115. package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +1 -39
  116. package/dist/types/protocol/wire/notification-payloads.d.ts +96 -1
  117. package/dist/types/protocol/wire/web-capability.d.ts +2 -2
  118. package/dist/types/runtime/community/community-consent-client.d.ts +3 -0
  119. package/dist/types/runtime/config/tunable-defaults.d.ts +0 -6
  120. package/dist/types/runtime/execution/bounded-output-tail.d.ts +7 -0
  121. package/dist/types/runtime/execution/dream-agent.d.ts +8 -5
  122. package/dist/types/runtime/execution/dream-category-context.d.ts +3 -3
  123. package/dist/types/runtime/execution/structured-tool-progress.d.ts +21 -0
  124. package/dist/types/runtime/hooks/memory-hooks.d.ts +20 -8
  125. package/dist/types/runtime/infra/background-tasks.d.ts +5 -1
  126. package/dist/types/runtime/infra/cloud-auth-host-authority.d.ts +4 -0
  127. package/dist/types/runtime/infra/llmrouter-access-token.d.ts +0 -1
  128. package/dist/types/runtime/infra/subagent-turn-snapshot.d.ts +32 -0
  129. package/dist/types/runtime/infra/turn-telemetry-store.d.ts +22 -0
  130. package/dist/types/runtime/memory/implicit-extraction.d.ts +23 -7
  131. package/dist/types/runtime/ports/agent-runtime-ports.d.ts +0 -5
  132. package/dist/types/runtime/ports/index.d.ts +2 -3
  133. package/dist/types/runtime/ports/memory-provider.d.ts +31 -16
  134. package/dist/types/runtime/ports/memory-writer.d.ts +55 -6
  135. package/dist/types/runtime/ports/permission-contracts.d.ts +2 -0
  136. package/dist/types/runtime/ports/tool-contracts.d.ts +3 -1
  137. package/dist/types/runtime/prompt/identity-section.d.ts +2 -0
  138. package/dist/types/runtime/session/session-permission-store.d.ts +6 -0
  139. package/dist/types/runtime/tasks/task-types.d.ts +2 -0
  140. package/dist/types/skills/memory/host-memory-provider.d.ts +59 -9
  141. package/dist/types/skills/memory/memory-tool.d.ts +3 -1
  142. package/dist/types/skills/memory/task-distillation.d.ts +22 -3
  143. package/dist/types/skills/permissions/hook-runner.d.ts +8 -0
  144. package/dist/types/skills/permissions/operation-classifier.d.ts +7 -0
  145. package/dist/types/skills/skill-system/skill-category.d.ts +10 -0
  146. package/dist/types/skills/tools/agent-tool.d.ts +13 -21
  147. package/dist/types/skills/tools/edit-tool.d.ts +10 -2
  148. package/dist/types/skills/tools/exec-tool.d.ts +2 -2
  149. package/dist/types/skills/tools/file-text-snapshot.d.ts +24 -0
  150. package/dist/types/skills/tools/lsp-tool.d.ts +1 -1
  151. package/dist/types/skills/tools/patch-tool.d.ts +10 -3
  152. package/dist/types/skills/tools/read-tool.d.ts +23 -1
  153. package/dist/types/skills/tools/repo-map-tool.d.ts +52 -0
  154. package/dist/types/skills/tools/search-tool.d.ts +10 -1
  155. package/dist/types/skills/tools/shell/index.d.ts +1 -2
  156. package/dist/types/skills/tools/shell/shell-command.d.ts +1 -1
  157. package/dist/types/skills/tools/shell/shell-exec.d.ts +2 -2
  158. package/dist/types/skills/tools/shell/task-output.d.ts +12 -3
  159. package/dist/types/skills/tools/subagent-decision-tool.d.ts +15 -0
  160. package/dist/types/skills/tools/task-tool.d.ts +16 -2
  161. package/dist/types/skills/tools/write-tool.d.ts +2 -1
  162. package/dist/types/transport/acp-server.d.ts +1 -0
  163. package/dist/types/transport/host-cloud-auth-client.d.ts +10 -0
  164. package/dist/types/transport/host-community-client.d.ts +8 -0
  165. package/dist/types/transport/host-run-state-client.d.ts +6 -0
  166. package/dist/types/workflow-host.d.ts +8 -1
  167. package/dist/workflow-host.js +9 -9
  168. package/package.json +25 -6
  169. package/dist/types/cli/tool-bootstrap-web-registration.d.ts +0 -14
  170. package/dist/types/orchestration/tool-cascade.d.ts +0 -49
  171. package/dist/types/protocol/wire/channel-ingress.d.ts +0 -29
  172. package/dist/types/protocol/wire/channel.d.ts +0 -89
  173. package/dist/types/runtime/infra/native-mcp-config-sync.d.ts +0 -16
  174. package/dist/types/runtime/memory/categories.d.ts +0 -5
  175. package/dist/types/runtime/memory/recall-category-filter.d.ts +0 -42
  176. package/dist/types/runtime/ports/source-provider.d.ts +0 -39
  177. package/dist/types/runtime/ports/web-search-contracts.d.ts +0 -21
  178. package/dist/types/server/search-svc.d.ts +0 -1
  179. package/dist/types/skills/memory/local-embedding.d.ts +0 -80
  180. package/dist/types/skills/memory/memory-config-resolver.d.ts +0 -4
  181. package/dist/types/skills/memory/memory-embedding-config.d.ts +0 -31
  182. package/dist/types/skills/tools/web-answer-tool.d.ts +0 -27
  183. package/dist/types/skills/tools/web-fetch-tool.d.ts +0 -80
  184. package/dist/types/skills/tools/web-research-tool.d.ts +0 -48
  185. package/dist/types/skills/tools/web-search-tool.d.ts +0 -46
  186. package/dist/types/skills/web-search/brave-source.d.ts +0 -3
  187. package/dist/types/skills/web-search/crawl4ai-extractor.d.ts +0 -16
  188. package/dist/types/skills/web-search/embedding-rerank.d.ts +0 -13
  189. package/dist/types/skills/web-search/exa-source.d.ts +0 -3
  190. package/dist/types/skills/web-search/multi-source-backend.d.ts +0 -23
  191. package/dist/types/skills/web-search/redis-source-cache.d.ts +0 -6
  192. package/dist/types/skills/web-search/search-svc-source.d.ts +0 -5
  193. package/dist/types/skills/web-search/searxng-source.d.ts +0 -4
  194. package/dist/types/skills/web-search/serper-source.d.ts +0 -3
  195. package/dist/types/skills/web-search/source-factory.d.ts +0 -6
  196. package/dist/types/skills/web-search/stability.d.ts +0 -26
  197. package/dist/types/skills/web-search/web-tunable-resolver.d.ts +0 -16
@@ -27,6 +27,12 @@ export interface ArtifactContractState {
27
27
  artifactRoot: boolean;
28
28
  };
29
29
  }
30
+ export type UiAcceptanceEvidenceSource = "browser_automation" | "frontend_test" | "user_confirmation" | "external_benchmark" | "fork_verify";
31
+ export interface UiAcceptanceEvidence {
32
+ source: UiAcceptanceEvidenceSource;
33
+ status: "passed" | "failed";
34
+ summary: string;
35
+ }
30
36
  export interface ArtifactContractEventPayload {
31
37
  artifactRoot?: string;
32
38
  writePaths: string[];
@@ -113,7 +119,9 @@ export declare function updateArtifactContractFromToolResult(params: {
113
119
  rawArguments: string;
114
120
  ok: boolean;
115
121
  content: string;
122
+ details?: Record<string, unknown>;
116
123
  }): void;
124
+ export declare function recordUiAcceptanceEvidence(state: ArtifactContractState, evidence: UiAcceptanceEvidence): void;
117
125
  export declare function artifactContractPayload(state: ArtifactContractState, inputMessages: readonly ChatMessage[]): ArtifactContractEventPayload;
118
126
  export declare function recoverArtifactContractState(inputMessages: readonly ChatMessage[]): ArtifactContractState;
119
127
  export declare function updateArtifactContractFromFinalContent(state: ArtifactContractState, content: string): void;
@@ -78,6 +78,11 @@ export interface ToolLoopParams {
78
78
  * the next LLM call, steering the run without waiting for the turn to finish.
79
79
  */
80
80
  drainPendingGuidance?: () => string[];
81
+ /**
82
+ * Drain session-scoped, bounded background-task results. Each update becomes
83
+ * system context between rounds; the model never needs to busy-poll.
84
+ */
85
+ drainPendingTaskNotifications?: () => string[];
81
86
  /**
82
87
  * Sanitize a tool-result message's media the MAIN model can't consume (e.g. the `read` tool
83
88
  * returning an image for a text-only model → provider closes the stream, -32603): route it to
@@ -93,6 +93,11 @@ export interface TurnRequest {
93
93
  * tool-loop round; returned strings become user messages before the next LLM call.
94
94
  */
95
95
  drainPendingGuidance?: () => string[];
96
+ /**
97
+ * Drain bounded background-task results for this session. Consulted between
98
+ * rounds so completed sub-agents can rejoin the parent without model polling.
99
+ */
100
+ drainPendingTaskNotifications?: () => string[];
96
101
  /**
97
102
  * Route media a tool returns that the MAIN model can't consume (e.g. `read` returning an image
98
103
  * for a text-only model) to the understanding model; folds the description into the message text
@@ -25,6 +25,11 @@ export interface AcpExtendedHost extends DreamHandlerHost, SoloHandlerHost, Prod
25
25
  resolve: (answers: Record<string, string> | null) => void;
26
26
  }>;
27
27
  }
28
+ interface GatewayProjectContext {
29
+ projectId: string;
30
+ canonicalSessionId: string;
31
+ cwd: string;
32
+ }
28
33
  export declare function handleAcpDream(host: AcpExtendedHost, params: {
29
34
  sessionId: string;
30
35
  config?: Record<string, unknown>;
@@ -41,6 +46,7 @@ export declare function handleAcpDream(host: AcpExtendedHost, params: {
41
46
  export declare function handleAcpSoloStart(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
42
47
  export declare function handleAcpSoloSelect(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
43
48
  export declare function handleAcpSoloCancel(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
49
+ export declare function handleAcpSoloDelete(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
44
50
  export declare function handleAcpSoloSubscribe(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
45
51
  export declare function handleAcpSoloMessage(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
46
52
  export declare function handleAcpSoloEvaluate(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
@@ -56,9 +62,8 @@ export declare function handleAcpSoloSpecChat(host: AcpExtendedHost, params: Rec
56
62
  */
57
63
  export declare function handleAcpSoloSpecJudge(host: AcpExtendedHost, params: Record<string, unknown>): Promise<SoloSpecJudgeResult>;
58
64
  /**
59
- * M4 自动化页对话式搭图/改图(x/workflow.chat):forked agent + propose_workflow 工具,产出工作流提案
60
- * (新建 def / 改已有 patch),propose-only 无副作用。澄清走 Cut6 ask 往返。失败降级 { error } 不抛。
61
- * 应用由前端经 Gateway Host workflow.create/patch 完成(触发 WS 回流画布),故本轮无持久化副作用。
65
+ * 自动化页对话式搭图/改图:Agent 只提交有界 operations,确定性编译器产出唯一 proposal。
66
+ * 本计算面无持久化副作用;Runtime Host proposal 的唯一校验和应用者。
62
67
  */
63
68
  export declare function handleAcpWorkflowChat(host: AcpExtendedHost, params: Record<string, unknown>): Promise<WorkflowChatResult>;
64
69
  /**
@@ -79,20 +84,17 @@ export declare function handleAcpProductRollback(host: AcpExtendedHost, params:
79
84
  export declare function handleAcpProductReplay(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
80
85
  /** Test-only reset. */
81
86
  export declare function __resetGoalHandler(): void;
87
+ export declare function goalLeaderMemberOwner(context: GatewayProjectContext): string;
82
88
  export declare function handleAcpGoalStart(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
83
89
  export declare function handleAcpGoalPause(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
84
90
  export declare function handleAcpGoalResume(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
85
91
  export declare function handleAcpGoalUpdateGoal(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
86
92
  export declare function handleAcpGoalStop(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
87
93
  export declare function handleAcpGoalMessage(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
88
- /** Test-only reset. */
89
- export declare function __resetSubscribers(): void;
90
- /** I6: drop a session from every stream's subscriber set on disconnect (called from session/close),
91
- * pruning sets that become empty so the registry doesn't leak entries for dead sessions. */
92
- export declare function removeSessionSubscriptions(sessionId: string): void;
93
- export declare function emitGoalNotification(_streamId: string, method: string, payload: Record<string, unknown>, hosts: {
94
+ export declare function emitGoalNotification(method: string, payload: Record<string, unknown>, hosts: {
94
95
  currentSessionId?: string;
95
96
  sendNotification: (m: string, p: Record<string, unknown>) => void;
96
97
  }[]): void;
97
98
  export declare function handleAcpGoalSubscribe(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
98
99
  export declare function handleAcpProductSubscribe(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
100
+ export {};
@@ -45,4 +45,4 @@ export declare function handleAcpSessionSetModel(host: AcpSessionHost, _sessionI
45
45
  * Returns the applied modeId; the server emits current_mode_update. An unknown mode throws a coded
46
46
  * error which the acp-server dispatch translates into a JSON-RPC error.
47
47
  */
48
- export declare function handleAcpSessionSetMode(host: AcpSessionHost, _sessionId: string, modeId: string): Promise<string>;
48
+ export declare function handleAcpSessionSetMode(host: AcpSessionHost, sessionId: string, modeId: string): Promise<string>;
@@ -46,10 +46,18 @@ export interface AcpSessionHost {
46
46
  sessionState: SessionState | null;
47
47
  cancelIdleDreamTimer(): void;
48
48
  disposeSessionRuntime?(): void;
49
+ /** Retire only the named session's in-memory permission checker/rules/hooks. */
50
+ disposeSessionPermissions?(sessionId: string): void;
49
51
  /** Dispose only the named canonical session's MCP manager and tool overlay. */
50
52
  disposeSessionMcp?(sessionId: string): Promise<void>;
51
53
  /** Bind async turn work to a canonical session without consulting a mutable process-global pointer. */
52
54
  runInSessionScope?<T>(sessionId: string, action: () => Promise<T>): Promise<T>;
55
+ /** Enter only an already-known session; cancellation must not recreate closed state. */
56
+ runInExistingSessionScope?<T>(sessionId: string, action: () => Promise<T>): Promise<T | undefined>;
57
+ /** Reserve foreground priority before asynchronous project/model preparation starts. */
58
+ beginForegroundTurn?(): void;
59
+ /** Release a foreground-priority reservation on every terminal path. */
60
+ endForegroundTurn?(): void;
53
61
  enableIdleDream(): void;
54
62
  ensureDefaultProject(): void | Promise<void>;
55
63
  initializeHostProjectAuthority?(): Promise<void>;
@@ -10,6 +10,8 @@ import type { McpManager } from "../skills/mcp/mcp-manager.js";
10
10
  import type { PluginLoader } from "../skills/plugins/plugin-loader.js";
11
11
  import type { CliAgentClient } from "./cli-agent-builder.js";
12
12
  import { type CliCoreToolHostDeps } from "./core-tool-coordinator.js";
13
+ import { type PermissionBootstrapDeps } from "./permission-bootstrap.js";
14
+ import type { RuntimePermissionRuleEngine } from "./permission-runtime-service.js";
13
15
  import type { LLMTransport } from "./provider-core-facade.js";
14
16
  import { type FileWatcher } from "./runtime-watcher-bootstrap.js";
15
17
  export type { FileWatcher };
@@ -22,6 +24,7 @@ export interface AgentRuntimeBootstrapDeps {
22
24
  getTurnId(): string;
23
25
  projectRoot: string;
24
26
  pathService: PathService;
27
+ getActiveWorkdir?: () => string;
25
28
  memdir: ProjectMemoryStore;
26
29
  getMemdir?: () => ProjectMemoryStore | null;
27
30
  currentUserId: string;
@@ -33,6 +36,7 @@ export interface AgentRuntimeBootstrapDeps {
33
36
  apiKey: string;
34
37
  model: string;
35
38
  } | null;
39
+ scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
36
40
  agentClient: CliAgentClient;
37
41
  toolCatalog: ToolCatalog;
38
42
  currentMcpManager: McpManager | null;
@@ -50,7 +54,8 @@ export interface AgentRuntimeBootstrapDeps {
50
54
  }>;
51
55
  } | undefined;
52
56
  sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
53
- currentPermissionUnregister?: (() => void) | null;
57
+ existingPermissionRuleEngine?: RuntimePermissionRuleEngine;
58
+ resolveSandboxPermissionSnapshot?: PermissionBootstrapDeps["resolveSandboxPermissionSnapshot"];
54
59
  coreToolHost: CliCoreToolHostDeps;
55
60
  toolInvoker: ToolInvoker;
56
61
  currentFileWatcher: FileWatcher | null;
@@ -64,5 +69,6 @@ export interface AgentRuntimeBootstrapResult {
64
69
  permissionChecker: PermissionMetadataResolver;
65
70
  permissionUnregister: () => void;
66
71
  ruleEngine: PermissionRuleEnginePort;
72
+ groupSecurityActive?: boolean;
67
73
  }
68
74
  export declare function configureAgentRuntimeBootstrap(deps: AgentRuntimeBootstrapDeps): AgentRuntimeBootstrapResult;
@@ -1,20 +1,35 @@
1
1
  import type { HookRegistry } from "../contracts/hooks.js";
2
- import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMetadataResolver, ToolCatalog } from "../runtime/ports/index.js";
2
+ import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMetadataResolver, PermissionRuleEnginePort, ToolCatalog } from "../runtime/ports/index.js";
3
3
  import type { McpManager } from "../skills/mcp/mcp-manager.js";
4
4
  import type { PluginLoader } from "../skills/plugins/plugin-loader.js";
5
5
  import type { AgentRuntimeBootstrapResult, FileWatcher } from "./agent-runtime-bootstrap.js";
6
+ export interface PermissionState {
7
+ permissionChecker: PermissionMetadataResolver;
8
+ permissionUnregister: () => void;
9
+ ruleEngine: PermissionRuleEnginePort;
10
+ groupSecurityActive: boolean;
11
+ }
12
+ export interface SessionRuntimeState {
13
+ hooks: HookRegistry;
14
+ permission: PermissionState;
15
+ }
6
16
  export declare class AgentRuntimeSessionState {
7
- currentHooks: HookRegistry | null;
17
+ private readonly runtimeBySession;
18
+ private readonly permissionLeaseCountBySession;
19
+ private readonly retiredPermissionUnregisterBySession;
8
20
  private readonly mcpBySession;
9
21
  pluginLoader: PluginLoader | null;
10
- permissionChecker: PermissionMetadataResolver | null;
11
- permissionUnregister: (() => void) | null;
12
22
  fileWatcher: FileWatcher | null;
13
23
  memoryProvider: MemoryHandlerProvider | null;
14
24
  memoryDreamProvider: MemoryDreamRuntimeProvider | null;
15
25
  memoryUserId: string;
16
26
  getPluginSkills(): ReturnType<PluginLoader["getPluginSkills"]>;
17
- applyBootstrap(result: AgentRuntimeBootstrapResult): void;
27
+ applyBootstrap(sessionId: string, result: AgentRuntimeBootstrapResult): void;
28
+ withPermissionLease<T>(sessionId: string, action: () => Promise<T>): Promise<T>;
29
+ getHooks(sessionId: string): HookRegistry | null;
30
+ getPermissionState(sessionId: string): PermissionState | undefined;
31
+ getRuntimeState(sessionId: string): SessionRuntimeState | undefined;
32
+ getPermissionUnregister(sessionId: string): (() => void) | null;
18
33
  resetAfterSessionDispose(): void;
19
34
  stopFileWatcher(): void;
20
35
  getMcpToolCatalog(sessionId: string, baseCatalog: ToolCatalog): ToolCatalog;
@@ -26,7 +41,9 @@ export declare class AgentRuntimeSessionState {
26
41
  setMcpConfigKey(sessionId: string, baseCatalog: ToolCatalog, configKey: string): void;
27
42
  disconnectMcp(sessionId: string): Promise<void>;
28
43
  disconnectAllMcp(): Promise<void>;
29
- unregisterPermissions(): void;
44
+ unregisterPermissions(sessionId?: string): void;
30
45
  resetMemoryProviders(): void;
31
46
  private ensureMcpSession;
47
+ private retirePermissionUnregister;
48
+ private flushRetiredPermissionUnregisters;
32
49
  }
@@ -0,0 +1,31 @@
1
+ import type { TextFileFormat, TextFileSnapshot, TextFileWriteOptions } from "../skills/tools/file-text-snapshot.js";
2
+ export interface StreamedTextWindow {
3
+ type: "text_window";
4
+ text: string;
5
+ totalLines?: number;
6
+ startLine: number;
7
+ endLine: number;
8
+ hasMore: boolean;
9
+ fileSizeBytes: number;
10
+ scannedBytes: number;
11
+ contentHash?: string;
12
+ metadataComplete: boolean;
13
+ truncatedByBytes: boolean;
14
+ }
15
+ export declare class ConcurrentFileModificationError extends Error {
16
+ readonly code = "ECONCURRENT";
17
+ constructor(filePath: string);
18
+ }
19
+ export declare function hashFileBytes(filePath: string): Promise<string>;
20
+ export declare function hashFileBytesSync(filePath: string): string;
21
+ export declare function readTextSnapshot(filePath: string): Promise<TextFileSnapshot>;
22
+ export declare function atomicWriteText(filePath: string, content: string, options?: TextFileWriteOptions): Promise<{
23
+ contentHash: string;
24
+ format: TextFileFormat;
25
+ }>;
26
+ export declare function readTextWindow(filePath: string, options: {
27
+ offset: number;
28
+ limit: number;
29
+ maxBytes: number;
30
+ scanToEnd?: boolean;
31
+ }): Promise<StreamedTextWindow>;
@@ -0,0 +1,12 @@
1
+ import type { ChatMessage } from "../agent/types.js";
2
+ export interface BackgroundContextCapsuleOptions {
3
+ activeProjectRoot: string;
4
+ redactSensitive: boolean;
5
+ maxChars?: number;
6
+ }
7
+ /**
8
+ * Build a bounded parent-state handoff for a background fork. This deliberately
9
+ * excludes full assistant prose and hidden reasoning while preserving the state
10
+ * a worker commonly needs to avoid rediscovery.
11
+ */
12
+ export declare function buildBackgroundContextCapsule(history: readonly ChatMessage[] | null | undefined, options: BackgroundContextCapsuleOptions): string;
@@ -18,6 +18,7 @@ export interface BaseToolBootstrapDeps {
18
18
  } | null;
19
19
  getTaskScopeKey?(): string | undefined;
20
20
  getCurrentTurnId?(): string | undefined;
21
+ isGroupSecurityMode?(): boolean;
21
22
  loadTunableOverrides?(): Promise<Record<string, unknown>>;
22
23
  }
23
24
  export declare function configureBaseToolBootstrap(deps: BaseToolBootstrapDeps): void;
@@ -4,11 +4,13 @@ import * as acpExtended from "./acp-extended-handlers.js";
4
4
  import * as acpSession from "./acp-session-handlers.js";
5
5
  export interface CliAcpRequestHandlerHost extends acpSession.AcpSessionHost {
6
6
  activeTurn: AbortController | null;
7
+ turnDone?: Promise<void>;
7
8
  /** Id of the turn currently running; used to key cancel requests. */
8
9
  currentTurnId?: string;
9
10
  permissionChecker?: PermissionApprovalResolver | null;
10
11
  /** LH-10: propagate an explicit cancel to the background tasks the given (or
11
12
  * current) session launched. No-op if the host has no task registry. */
12
- cancelBackgroundTasksForSession?(sessionId?: string): void;
13
+ cancelBackgroundTasksForSession?(sessionId?: string, parentTurnId?: string): void;
14
+ scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
13
15
  }
14
16
  export declare function createCliAcpRequestHandler(host: CliAcpRequestHandlerHost, packageVersion: string, extendedHost?: acpExtended.AcpExtendedHost): AcpRequestHandler;
@@ -19,7 +19,7 @@ export interface CommunityWorkflowBundlePayload {
19
19
  version: string;
20
20
  sourceTier: string;
21
21
  riskTier: string;
22
- /** The sanitized WorkflowBundle JSON (schemaVersion 2) — feed to workflow.import. */
22
+ /** The sanitized WorkflowBundle JSON (current schemaVersion) — feed to workflow.import. */
23
23
  bundle: Record<string, unknown>;
24
24
  manifest: unknown;
25
25
  }
@@ -13,6 +13,7 @@ export interface CliCoreToolHostDeps {
13
13
  getCurrentModel(): string;
14
14
  getCurrentBaseUrl(): string;
15
15
  getCurrentSessionId(): string;
16
+ getCurrentTurnId?(): string | undefined;
16
17
  getActiveProjectRoot(): string;
17
18
  getVerbose(): boolean;
18
19
  getBackgroundTasks(): BackgroundTaskManager | null;
@@ -1,9 +1,10 @@
1
1
  import type { AgentLogger, ToolInvoker } from "../../agent/types.js";
2
2
  import type { HookRegistry } from "../../contracts/hooks.js";
3
3
  import type { ChatMessage } from "../../agent/types.js";
4
+ import { type ForkedAgentResult } from "../../runtime/execution/forked-agent.js";
4
5
  import type { BackgroundTaskManager } from "../../runtime/infra/background-tasks.js";
5
6
  import type { ToolCatalog } from "../../runtime/ports/index.js";
6
- import type { AgentToolDeps } from "../../skills/tools/agent-tool.js";
7
+ import type { AgentResult, AgentToolDeps } from "../../skills/tools/agent-tool.js";
7
8
  import type { LLMTransport } from "../provider-core-facade.js";
8
9
  export interface AgentToolServiceHost {
9
10
  readonly agent: unknown | null;
@@ -37,4 +38,19 @@ export interface AgentToolServiceOptions {
37
38
  toolCatalog: ToolCatalog;
38
39
  toolInvoker: ToolInvoker;
39
40
  }
41
+ export declare function extractForkLifecycleSummary(result: ForkedAgentResult): {
42
+ resultSummary?: string;
43
+ evidence: Array<{
44
+ source: "tool" | "artifact" | "verification";
45
+ label: string;
46
+ status: "passed" | "failed" | "observed";
47
+ }>;
48
+ toolsUsed: string[];
49
+ tokenUsage: {
50
+ inputTokens: number;
51
+ outputTokens: number;
52
+ totalTokens: number;
53
+ };
54
+ };
55
+ export declare function extractForkUiAcceptanceEvidence(result: ForkedAgentResult): NonNullable<AgentResult["uiAcceptanceEvidence"]>;
40
56
  export declare function createAgentToolService({ host, hooks, log, toolCatalog, toolInvoker }: AgentToolServiceOptions): AgentToolDeps;
@@ -1,7 +1,8 @@
1
- import type { PathService, ToolCatalog } from "../runtime/ports/index.js";
1
+ import type { ToolCatalog } from "../runtime/ports/index.js";
2
2
  export interface DevToolBootstrapDeps {
3
3
  config: Record<string, unknown>;
4
- pathService?: PathService;
4
+ /** Immutable project root resolved for the canonical session/turn. */
5
+ workdir: string;
5
6
  toolCatalog: ToolCatalog;
6
7
  }
7
8
  export declare const devToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<DevToolBootstrapDeps>;
@@ -1,6 +1,7 @@
1
1
  import type { ToolCatalog } from "../../runtime/ports/index.js";
2
2
  export interface DevToolBootstrapServiceDeps {
3
3
  workdir: string;
4
+ config?: Record<string, unknown>;
4
5
  toolCatalog: ToolCatalog;
5
6
  }
6
7
  export declare function registerDevTools(deps: DevToolBootstrapServiceDeps): void;
@@ -1,6 +1,8 @@
1
1
  import { createLspTool } from "../../skills/tools/lsp-tool.js";
2
+ import { createRepoMapTool } from "../../skills/tools/repo-map-tool.js";
2
3
  export interface DevToolRegistryOptions {
3
4
  workdir: string;
5
+ config?: Record<string, unknown>;
4
6
  }
5
- export type DevTool = ReturnType<typeof createLspTool>;
7
+ export type DevTool = ReturnType<typeof createRepoMapTool> | ReturnType<typeof createLspTool>;
6
8
  export declare function buildDevTools(options: DevToolRegistryOptions): DevTool[];
@@ -0,0 +1,81 @@
1
+ import type { RepoMapQuery, RepoMapResult } from "../../skills/tools/repo-map-tool.js";
2
+ export type RepoMapChangeType = "created" | "modified" | "deleted";
3
+ export interface RepoMapWatcher {
4
+ on(event: "error", listener: (error: Error) => void): RepoMapWatcher;
5
+ close(): void;
6
+ }
7
+ export type RepoMapWatchFactory = (root: string, options: {
8
+ recursive: true;
9
+ persistent: false;
10
+ }, listener: (eventType: "rename" | "change", filename: string | Buffer | null) => void) => RepoMapWatcher;
11
+ export interface IncrementalRepoMapOptions {
12
+ workspaceRoot: string;
13
+ maxFileBytes?: number;
14
+ maxIndexedFiles?: number;
15
+ maxTotalBytes?: number;
16
+ maxScanMs?: number;
17
+ maxDepth?: number;
18
+ idleTimeoutMs?: number;
19
+ now?: () => number;
20
+ watch?: boolean;
21
+ watchFactory?: RepoMapWatchFactory;
22
+ }
23
+ export declare class IncrementalRepoMap {
24
+ private readonly workspaceRoot;
25
+ private readonly maxFileBytes;
26
+ private readonly maxIndexedFiles;
27
+ private readonly maxTotalBytes;
28
+ private readonly maxScanMs;
29
+ private readonly maxDepth;
30
+ private readonly idleTimeoutMs;
31
+ private readonly now;
32
+ private readonly watchEnabled;
33
+ private readonly watchFactory;
34
+ private readonly abortController;
35
+ private workspaceRealPathPromise?;
36
+ private readonly pending;
37
+ private files;
38
+ private watcher?;
39
+ private watcherReliable;
40
+ private watcherWarning?;
41
+ private nextWatchRetryAt;
42
+ private forceFullRequested;
43
+ private initialized;
44
+ private generation;
45
+ private indexPartial;
46
+ private indexWarning?;
47
+ private disposed;
48
+ private refreshPromise?;
49
+ private activeQueries;
50
+ private idleTimer?;
51
+ constructor(options: IncrementalRepoMapOptions);
52
+ markChanged(filePath: string, changeType?: RepoMapChangeType): void;
53
+ getMap(query?: RepoMapQuery): Promise<RepoMapResult>;
54
+ releaseIdleResources(): void;
55
+ dispose(): void;
56
+ private beginQuery;
57
+ private finishQuery;
58
+ private scheduleIdleRelease;
59
+ private clearIdleTimer;
60
+ private tryStartWatcher;
61
+ private invalidateWatcher;
62
+ private maybeRebuildWatcher;
63
+ private refresh;
64
+ private runRefresh;
65
+ private applyIncrementalWithFallback;
66
+ private applyIncremental;
67
+ private buildFullIndex;
68
+ private scanDirectory;
69
+ private loadPath;
70
+ private createScanBudget;
71
+ private checkScanTime;
72
+ private reserveIndexedFile;
73
+ private stopScan;
74
+ private commitFullIndex;
75
+ private canonicalPathInsideWorkspace;
76
+ private getWorkspaceRealPath;
77
+ private throwIfAborted;
78
+ private takePending;
79
+ private restorePending;
80
+ private toRelativePath;
81
+ }
@@ -0,0 +1,59 @@
1
+ import { type ChildProcessWithoutNullStreams } from "node:child_process";
2
+ import type { LspOperation, LspResult } from "../../skills/tools/lsp-tool.js";
3
+ export interface LspServerDefinition {
4
+ id: string;
5
+ command: string;
6
+ args?: readonly string[];
7
+ extensions: readonly string[];
8
+ languageId: string | ((filePath: string) => string);
9
+ env?: NodeJS.ProcessEnv;
10
+ }
11
+ export interface LspSpawnOptions {
12
+ cwd: string;
13
+ env: NodeJS.ProcessEnv;
14
+ stdio: ["pipe", "pipe", "pipe"];
15
+ shell: false;
16
+ windowsHide: true;
17
+ }
18
+ export type LspSpawnFactory = (command: string, args: readonly string[], options: LspSpawnOptions) => ChildProcessWithoutNullStreams;
19
+ export interface LspSupervisorOptions {
20
+ serverDefinitions: readonly LspServerDefinition[];
21
+ spawn?: LspSpawnFactory;
22
+ requestTimeoutMs?: number;
23
+ shutdownTimeoutMs?: number;
24
+ idleTimeoutMs?: number;
25
+ stderrTailBytes?: number;
26
+ diagnosticSettleMs?: number;
27
+ }
28
+ export interface LspSupervisorOperationParams {
29
+ workspaceRoot: string;
30
+ operation: LspOperation;
31
+ filePath: string;
32
+ line?: number;
33
+ character?: number;
34
+ newName?: string;
35
+ includeContext?: boolean;
36
+ }
37
+ export interface LspSupervisor {
38
+ executeOperation(params: LspSupervisorOperationParams, signal?: AbortSignal): Promise<LspResult>;
39
+ supportedLanguages(): string[];
40
+ dispose(): Promise<void>;
41
+ }
42
+ export type LspSupervisorErrorCode = "LSP_SERVER_NOT_CONFIGURED" | "LSP_PATH_OUTSIDE_WORKSPACE" | "LSP_DIAGNOSTICS_UNAVAILABLE" | "LSP_FILE_TOO_LARGE" | "LSP_SUPERVISOR_DISPOSED" | "LSP_PROCESS_ERROR" | "LSP_PROCESS_EXIT" | "LSP_PROTOCOL_ERROR" | "LSP_REQUEST_ABORTED" | "LSP_REQUEST_TIMEOUT" | "LSP_RESPONSE_ERROR";
43
+ export interface LspErrorDiagnostics {
44
+ serverId?: string;
45
+ command?: string;
46
+ pid?: number;
47
+ exitCode?: number | null;
48
+ signal?: NodeJS.Signals | null;
49
+ stderrTail?: string;
50
+ method?: string;
51
+ data?: unknown;
52
+ }
53
+ export declare class LspSupervisorError extends Error {
54
+ readonly code: LspSupervisorErrorCode;
55
+ readonly diagnostics: LspErrorDiagnostics;
56
+ constructor(code: LspSupervisorErrorCode, message: string, diagnostics?: LspErrorDiagnostics);
57
+ }
58
+ export declare function buildDefaultLspServerDefinitions(): LspServerDefinition[];
59
+ export declare function createLspSupervisor(options: LspSupervisorOptions): LspSupervisor;
@@ -1,5 +1,7 @@
1
1
  import type { LspToolDeps } from "../../skills/tools/lsp-tool.js";
2
+ import type { LspSupervisor } from "./lsp-supervisor.js";
2
3
  export interface LspToolServiceOptions {
3
4
  workdir: string;
5
+ supervisor?: LspSupervisor;
4
6
  }
5
7
  export declare function createLspToolDeps(options: LspToolServiceOptions): LspToolDeps;
@@ -1,10 +1,12 @@
1
1
  import { type CommunityConsentClient } from "../../runtime/community/community-consent-client.js";
2
2
  import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
3
3
  import type { HostCapabilityClient } from "../../transport/host-capability-client.js";
4
+ import type { HostCommunityClient } from "../../transport/host-community-client.js";
4
5
  export type { CommunityConsentClient, CommunityInstallRiskTier, CommunityInstallResolution, } from "../../runtime/community/community-consent-client.js";
5
6
  export interface CommunityHandlerHost {
6
7
  resolveCommunityConsentClient?: () => CommunityConsentClient | null;
7
8
  getHostCapabilityClient?(): HostCapabilityClient | undefined;
9
+ getHostCommunityClient?(): HostCommunityClient | undefined;
8
10
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
9
11
  }
10
12
  export declare function handleCommunityResolveInstall(this: CommunityHandlerHost, msg: AgentRpcRequest): Promise<void>;
@@ -31,7 +31,7 @@ export interface DreamHandlerHost {
31
31
  sendNotification(method: string, params: Record<string, unknown>): void;
32
32
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
33
33
  }
34
- export declare function handleDream(this: DreamHandlerHost, msg: AgentRpcRequest): Promise<void>;
34
+ export declare function handleDream(this: DreamHandlerHost, msg: AgentRpcRequest, parentSignal?: AbortSignal): Promise<void>;
35
35
  /**
36
36
  * [B15] dream 后置维护三链:importance decay → 冲突消解/待定 claim 晋升 → 提案消费。
37
37
  * 每次 dream 尝试后运行(不看 dream 成败;调用点见 handleDream),三链彼此错误隔离 ——
@@ -1,11 +1,6 @@
1
- /**
2
- * Agent-resident memory brain-compute handlers. Handles: memory.propose (LLM candidate
3
- * extraction) and memory.search (hybrid retrieval with a memdir fallback). The store/library
4
- * and memdir file-face methods are Runtime Host-native (gateway MemoryProfileService + memdir
5
- * file face) and were removed here — see rpc-registry.memory-cut.test.ts.
6
- */
1
+ /** Agent-resident proposal extraction and the canonical Host-backed long-term search adapter. */
7
2
  import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
8
- import type { MemoryHandlerProvider, ProjectMemoryStore, ProjectMemoryStoreFactory } from "../../runtime/ports/index.js";
3
+ import type { MemoryHandlerProvider } from "../../runtime/ports/index.js";
9
4
  import { type MemoryModelPurpose } from "../memory-candidate-service.js";
10
5
  interface MemoryLlmClient {
11
6
  model: string;
@@ -18,17 +13,10 @@ interface MemoryLlmClient {
18
13
  };
19
14
  }
20
15
  export interface MemoryHandlerHost {
21
- memdir: ProjectMemoryStore | null;
22
16
  memoryProvider?: MemoryHandlerProvider | null;
23
17
  memoryUserId?: string;
24
- projectMemoryStoreFactory: ProjectMemoryStoreFactory;
25
- projectLocator?: {
26
- resolveProjectRoot(projectId: string): string | undefined;
27
- };
28
18
  ensureMemoryProvider?(): void;
29
- getActiveProjectRoot(): string;
30
19
  resolveClientForPurpose?(purpose: MemoryModelPurpose): MemoryLlmClient | null;
31
- sendNotification(method: string, params: Record<string, unknown>): void;
32
20
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
33
21
  }
34
22
  export declare function handleMemoryPropose(this: MemoryHandlerHost, msg: AgentRpcRequest): Promise<void>;
@@ -1,9 +1,12 @@
1
1
  /**
2
- * Product mode handlers.
3
- * Handles: product.plan/confirm/message/create/resume/pause/checkpoint/list/delete/cancel/rollback/replay.
2
+ * Product mode glue.
3
+ *
4
+ * The ACP surface (`x/product.*`) lives in `acp-extended-handlers.ts` and is the only Product entry
5
+ * point the Gateway routes to. This module keeps the pieces that surface shares: the coordinator
6
+ * accessors, the host type, and the phase-agnostic cancel.
4
7
  */
5
8
  import type { ProductPlanningOwner } from "../../orchestration/product-planner.js";
6
- import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
9
+ import type { AgentRpcError } from "../../protocol/wire/index.js";
7
10
  import { type ProductCoordinatorHost } from "../product-coordinator.js";
8
11
  export type { ProductCoordinatorHost } from "../product-coordinator.js";
9
12
  export interface ProductHandlerHost extends ProductCoordinatorHost {
@@ -13,21 +16,6 @@ export interface ProductHandlerHost extends ProductCoordinatorHost {
13
16
  export { writeProductProjectPlanStatus } from "../product-coordinator.js";
14
17
  export declare function ensureProductOrchestrator(this: ProductCoordinatorHost): import("../../orchestration/agent-instance.js").ProductOrchestrator;
15
18
  export declare function ensureProductPlanner(this: ProductCoordinatorHost): import("../../orchestration/product-planner.js").ProductPlanner;
16
- /** `product.plan` - Start interactive planning with leader agent. */
17
- export declare function handleProductPlan(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
18
- /** `product.confirm` - User confirms the plan, transition to execution. */
19
- export declare function handleProductConfirm(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
20
- /** `product.message` - User sends message to leader (multi-turn planning or execution intervention). */
21
- export declare function handleProductMessage(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
22
- /** `product.create` - Create a new Product Mode session. */
23
- export declare function handleProductCreate(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
24
- /** `product.resume` - Resume a paused product. */
25
- export declare function handleProductResume(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
26
- /** `product.pause` - Pause a running product. */
27
- export declare function handleProductPause(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
28
- /** `product.checkpoint` - Manual checkpoint. */
29
- export declare function handleProductCheckpoint(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
30
- export declare function handleProductDelete(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
31
19
  /**
32
20
  * Cancel a product no matter which lifecycle phase it is in. The orchestrator only knows
33
21
  * POST-confirm (executing) sessions; while the leader is still PLANNING, the product lives in
@@ -45,9 +33,3 @@ export declare function cancelProductAnyPhase(orchestrator: {
45
33
  }, planner: {
46
34
  cancel(productId: string, owner: ProductPlanningOwner): Promise<void>;
47
35
  }, productId: string, owner: ProductPlanningOwner): Promise<void>;
48
- /** `product.cancel` - Cancel a running product (handles both executing and planning phases). */
49
- export declare function handleProductCancel(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
50
- /** `product.rollback` - Rollback a product to a checkpoint. */
51
- export declare function handleProductRollback(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;
52
- /** `product.replay` - Re-run from an arbitrary completed/failed task forward, reusing upstream outputs. */
53
- export declare function handleProductReplay(this: ProductHandlerHost, msg: AgentRpcRequest): Promise<void>;