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
@@ -2,25 +2,89 @@
2
2
  * Workflow Chat Builder (M4) — 自动化页"意图先行"的对话搭图/改图(D18/D17)。
3
3
  *
4
4
  * 与 solo-spec-builder.runSpecChatRound 同构:进程内 runForkedAgent + 受限工具,纯推理产出,
5
- * 不直接落库。区别:产出的是 **工作流提案**——新建给完整 WorkflowDef,改已有给 WorkflowPatch[]。
6
- * 应用由调用方(前端经既有 workflow.create/patch RPC,触发 WS 回流画布)完成,故本轮无副作用、
7
- * 也无需访问引擎控制器。
5
+ * 不直接落库。Agent 只提交有界 authoring operations;确定性编译器根据 Host 能力目录生成
6
+ * WorkflowPatch[]、dry-run 并产生流程级验收证据。应用仍由 Runtime Host 原子完成。
8
7
  */
9
8
  import type { ForkedAgentRunnerFactory } from "../runtime/ports/agent-execution-contracts.js";
10
9
  import type { LLMTransport } from "../runtime/ports/index.js";
11
- import type { ToolDefinition, AgentLogger } from "../agent/types.js";
10
+ import type { ChatMessage, ToolDefinition, AgentLogger } from "../agent/types.js";
11
+ import { type WorkflowPatch } from "./workflow/workflow-patch.js";
12
12
  import { type CapabilityEntry } from "./workflow/capability-catalog.js";
13
- /** agent 通过此工具产出工作流提案:新建给 def,改已有给 patch。 */
13
+ import { type WorkflowIntentContract } from "./workflow/workflow-intent-contract.js";
14
+ import type { WorkflowEditContextCapsule } from "./workflow/workflow-edit-context.js";
15
+ import { type WorkflowSemanticAcceptance } from "./workflow/semantic-acceptance.js";
16
+ export interface WorkflowClarification {
17
+ /** Host-roundtrip id for deterministically resolving this open question after an answer. */
18
+ intentQuestionId?: string;
19
+ /** Stable semantic id supplied by the Agent when the question is not tied to one field. */
20
+ id?: string;
21
+ /** Why this choice is useful; transported for telemetry/context, never interpreted as a gate. */
22
+ purpose?: string;
23
+ /** Optional field target for __ASK__ replacement flows. */
24
+ nodeId?: string;
25
+ field?: string;
26
+ header: string;
27
+ question: string;
28
+ options?: Array<{
29
+ label: string;
30
+ description?: string;
31
+ }>;
32
+ multiSelect?: boolean;
33
+ }
34
+ export interface WorkflowChatContextCheckpoint {
35
+ protocolVersion: 1;
36
+ producer: "qlogicagent";
37
+ payload: {
38
+ messages: {
39
+ role: "user" | "assistant";
40
+ content: string;
41
+ }[];
42
+ intentContract?: WorkflowIntentContract;
43
+ };
44
+ }
45
+ export interface WorkflowChatContextInput {
46
+ checkpoint: WorkflowChatContextCheckpoint | null;
47
+ newTurns: Array<{
48
+ sequence: number;
49
+ role: "user" | "assistant";
50
+ content: string;
51
+ }>;
52
+ }
53
+ type WorkflowChatContextMessage = {
54
+ role: "user" | "assistant";
55
+ content: string;
56
+ };
57
+ export declare function buildWorkflowChatPromptContext(input: {
58
+ context?: WorkflowChatContextInput;
59
+ history?: {
60
+ role: "user" | "assistant";
61
+ content: string;
62
+ }[];
63
+ model: string;
64
+ budgetTokens?: number;
65
+ }): {
66
+ promptMessages: ChatMessage[];
67
+ checkpointMessages: WorkflowChatContextMessage[];
68
+ };
69
+ /** Agent emits bounded authoring operations; the deterministic compiler owns graph JSON. */
14
70
  export declare const PROPOSE_WORKFLOW_TOOL_NAME = "propose_workflow";
15
71
  export declare const PROPOSE_WORKFLOW_TOOL_DEF: ToolDefinition;
16
- /** 单轮入参。history 含到本轮为止的完整对话(末条为用户最新消息)。currentWorkflow 为已有图的渲染文本(改图上下文)。
17
- * v1 不带 ask_user(不反问;直接用默认搭,用户再说一句改),故澄清往返的网关路由也无需接。 */
72
+ /** Structured clarification transport only. It does not decide whether asking is required. */
73
+ export declare const REQUEST_WORKFLOW_INPUT_TOOL_NAME = "request_workflow_input";
74
+ export declare const REQUEST_WORKFLOW_INPUT_TOOL_DEF: ToolDefinition;
75
+ /** 单轮入参。Runtime Host 传 checkpoint + 新消息;history 只服务不写主对话的 ephemeral 局部编辑。
76
+ * currentWorkflow 为已有图的渲染文本(改图上下文)。 */
18
77
  export interface WorkflowChatDeps {
19
- history: {
78
+ context?: WorkflowChatContextInput;
79
+ /** Answered clarification ids from the transport; resolves evidence only and never ends the task. */
80
+ resolvedClarificationIds?: string[];
81
+ history?: {
20
82
  role: "user" | "assistant";
21
83
  content: string;
22
84
  }[];
23
85
  currentWorkflow?: string;
86
+ /** Host-built bounded prompt context. The full graph remains private compiler input. */
87
+ editContext?: WorkflowEditContextCapsule;
24
88
  /** D19 框选局部修改:用户框选的节点 id;非空时指示 agent 只产出 scoped patch(引擎按同 scope 强制)。 */
25
89
  scope?: string[];
26
90
  /**
@@ -29,18 +93,32 @@ export interface WorkflowChatDeps {
29
93
  * 校验回环拒绝引用目录外能力(反幻觉)。缺省(无目录)时退回静态 kind 说明、不做 ref 校验。
30
94
  */
31
95
  catalog?: CapabilityEntry[];
96
+ /** Automation-only Host tools. Omitted entirely outside workflow configuration. */
97
+ connectorTools?: ToolDefinition[];
98
+ invokeConnectorTool?: (name: string, args: Record<string, unknown>) => Promise<unknown>;
32
99
  transport: LLMTransport;
33
100
  apiKey: string;
34
101
  model: string;
35
102
  createAgentRunner: ForkedAgentRunnerFactory;
36
103
  log: AgentLogger;
37
104
  parentSignal?: AbortSignal;
105
+ /** Test seam for deterministic forced compaction. Production uses the model-derived budget. */
106
+ contextBudgetTokens?: number;
38
107
  }
39
108
  export interface WorkflowChatResult {
40
109
  reply: string;
41
- def?: Record<string, unknown>;
42
- patch?: unknown[];
43
- trigger?: Record<string, unknown>;
110
+ proposal?: {
111
+ patch: WorkflowPatch[];
112
+ };
113
+ /**
114
+ * A valid partial proposal can coexist with a later rejected refinement. The Host still applies
115
+ * the validated patch, while the UI receives the actual rejected diagnostics instead of an
116
+ * assistant success claim that describes nodes which never reached the candidate graph.
117
+ */
118
+ proposalWarnings?: {
119
+ attempts: number;
120
+ errors: string[];
121
+ };
44
122
  /**
45
123
  * Fail-loud(§3/EX-A):本轮 agent 调过 propose_workflow 但**没有任何一次通过校验**时带上
46
124
  * (attempts=被拒次数,errors=最后一次的校验错误)。reply 此时只是 agent 的口头方案,
@@ -51,17 +129,24 @@ export interface WorkflowChatResult {
51
129
  errors: string[];
52
130
  };
53
131
  /**
54
- * AI-2: per-field {{ __ASK__ }} placeholders the agent left for genuinely-unknown REQUIRED values.
55
- * The def IS applied (so the user sees the shape) but these nodes show a 待补 badge and the
56
- * workflow cannot be activated until resolved. Absent/empty = nothing pending.
132
+ * Per-field __ASK__ placeholders for genuinely unknown required values. They remain revisable
133
+ * conversation state and never prevent already reliable parts of the proposal being applied.
57
134
  */
58
- clarify?: {
59
- nodeId: string;
60
- field: string;
61
- question: string;
62
- }[];
135
+ clarify?: WorkflowClarification[];
136
+ /** Flow-level evidence for the accepted candidate. It informs the user; it is not a hard gate. */
137
+ semanticAcceptance?: WorkflowSemanticAcceptance;
138
+ /** Revisable conversational evidence only; never a save/finish gate. */
139
+ intentContract: WorkflowIntentContract;
140
+ /** IDs included in the initial compact working set; full catalog remains searchable. */
141
+ capabilitySelection?: string[];
142
+ /** Structured secure-input request returned by connector_request_connection. */
143
+ pendingConnectorInput?: Record<string, unknown>;
144
+ /** Most recent connector_validate evidence, surfaced without turning it into a finish gate. */
145
+ connectorValidation?: Record<string, unknown>;
146
+ contextCheckpoint: WorkflowChatContextCheckpoint;
63
147
  }
64
148
  /** agent 按需检索能力长尾(系统提示只放每类前 N 条)。 */
65
149
  export declare const LIST_CAPABILITIES_TOOL_NAME = "list_capabilities";
66
- /** 跑一轮对话式搭图/改图,返回自然语言 reply + 工作流提案(def 新建 / patch 改已有)。失败抛,由调用方降级。 */
150
+ /** 跑一轮对话式搭图/改图,返回自然语言 reply + 编译后的工作流 patch。失败抛,由调用方降级。 */
67
151
  export declare function runWorkflowChatRound(deps: WorkflowChatDeps): Promise<WorkflowChatResult>;
152
+ export {};
@@ -0,0 +1 @@
1
+ export declare function buildWorktreeTaskPrompt(worktreePath: string, prompt: string): string;
@@ -1,17 +1,22 @@
1
1
  import type { NotificationMethodMap } from "./wire/notification-payloads.js";
2
- export declare const AGENT_CONTRACT_VERSION: 6;
2
+ export declare const AGENT_CONTRACT_VERSION: 9;
3
3
  export declare const AGENT_EVENT_SCHEMA_VERSION: 1;
4
4
  export declare const AGENT_TERMINAL_STATES: readonly ["completed", "failed", "cancelled"];
5
5
  export type TerminalState = (typeof AGENT_TERMINAL_STATES)[number];
6
- export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_ended", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut"];
7
- export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
8
- export declare const AGENT_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_ended", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
9
- export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_ended", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
6
+ export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_activity", "turn.subagent_ended", "turn.subagent_completed", "turn.subagent_decision", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut"];
7
+ export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "solo.agentDiff", "solo.state", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.budgetExceeded", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
8
+ export declare const AGENT_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_activity", "turn.subagent_ended", "turn.subagent_completed", "turn.subagent_decision", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "solo.agentDiff", "solo.state", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.budgetExceeded", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
9
+ export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_activity", "turn.subagent_ended", "turn.subagent_completed", "turn.subagent_decision", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "solo.agentDiff", "solo.state", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.budgetExceeded", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
10
10
  /** Runtime-required keys whose shape is not encoded by TypeScript after serialization. */
11
11
  export declare const AGENT_EVENT_REQUIRED_KEYS: {
12
+ readonly "turn.subagent_started": readonly ["turnId", "parentTurnId", "subagentId", "agentType", "displayName", "delegatedTask", "mode", "startedAt"];
13
+ readonly "turn.subagent_activity": readonly ["turnId", "parentTurnId", "subagentId", "agentType", "displayName", "conciseStatus", "status", "observedAt"];
14
+ readonly "turn.subagent_completed": readonly ["turnId", "parentTurnId", "subagentId", "agentType", "displayName", "status", "evidence", "toolsUsed", "durationMs", "tokenUsage", "finishedAt"];
15
+ readonly "turn.subagent_decision": readonly ["turnId", "parentTurnId", "subagentId", "decision", "decidedAt"];
12
16
  readonly "product.taskStarted": readonly ["productId", "taskId", "assignee", "attempt"];
13
17
  readonly "product.taskCompleted": readonly ["productId", "taskId", "result", "attempt"];
14
18
  readonly "product.taskFailed": readonly ["productId", "taskId", "error", "attempt", "terminalState"];
19
+ readonly "product.budgetExceeded": readonly ["productId", "usedTokens", "reason"];
15
20
  readonly "mention.delegate_started": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
16
21
  readonly "mention.delegate_activity": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
17
22
  readonly "mention.delegate_settled": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision", "status"];
@@ -28,21 +33,57 @@ export interface AgentEventEnvelope<K extends AgentEventName = AgentEventName> {
28
33
  type: K;
29
34
  payload: AgentEventPayloadMap[K];
30
35
  }
36
+ export interface ProductPlanInstanceShape {
37
+ name: string;
38
+ agentId: string;
39
+ }
40
+ export interface ProductPlanTaskShape {
41
+ taskId: string;
42
+ assignee: string;
43
+ prompt: string;
44
+ dependsOn?: string[];
45
+ }
46
+ export interface ProductPlanIssue {
47
+ /** Empty when the issue is about the plan as a whole rather than one task. */
48
+ taskId: string;
49
+ reason: string;
50
+ }
51
+ /**
52
+ * Everything the DAG will reject at confirm time, checked up front.
53
+ * Returns one issue per problem; an empty array means the plan is structurally runnable.
54
+ */
55
+ export interface ProductPlanIssueOptions {
56
+ /**
57
+ * Flag an assignee that matches no instance (by name or agentId).
58
+ *
59
+ * True for the planner, which validates AFTER normalizeAssigneesToInstanceName — there an unmatched
60
+ * assignee is a real dead end. False for the draft screen, which repairs the same case at confirm by
61
+ * appending the missing instance; flagging it there would block a draft that is about to be fixed.
62
+ * Default true: an unmatched assignee is a defect unless the caller says it repairs it.
63
+ */
64
+ requireKnownAssignee?: boolean;
65
+ }
66
+ export declare function collectProductPlanIssues(instances: readonly ProductPlanInstanceShape[], tasks: readonly ProductPlanTaskShape[], options?: ProductPlanIssueOptions): ProductPlanIssue[];
31
67
  export declare const AGENT_CONTRACT_DESCRIPTOR: {
32
- readonly version: 6;
68
+ readonly version: 9;
33
69
  readonly eventSchemaVersion: 1;
34
- readonly eventNames: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_ended", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
70
+ readonly eventNames: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_activity", "turn.subagent_ended", "turn.subagent_completed", "turn.subagent_decision", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "workflow.approvalTimedOut", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "solo.agentDiff", "solo.state", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.budgetExceeded", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
35
71
  readonly eventRequiredKeys: {
72
+ readonly "turn.subagent_started": readonly ["turnId", "parentTurnId", "subagentId", "agentType", "displayName", "delegatedTask", "mode", "startedAt"];
73
+ readonly "turn.subagent_activity": readonly ["turnId", "parentTurnId", "subagentId", "agentType", "displayName", "conciseStatus", "status", "observedAt"];
74
+ readonly "turn.subagent_completed": readonly ["turnId", "parentTurnId", "subagentId", "agentType", "displayName", "status", "evidence", "toolsUsed", "durationMs", "tokenUsage", "finishedAt"];
75
+ readonly "turn.subagent_decision": readonly ["turnId", "parentTurnId", "subagentId", "decision", "decidedAt"];
36
76
  readonly "product.taskStarted": readonly ["productId", "taskId", "assignee", "attempt"];
37
77
  readonly "product.taskCompleted": readonly ["productId", "taskId", "result", "attempt"];
38
78
  readonly "product.taskFailed": readonly ["productId", "taskId", "error", "attempt", "terminalState"];
79
+ readonly "product.budgetExceeded": readonly ["productId", "usedTokens", "reason"];
39
80
  readonly "mention.delegate_started": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
40
81
  readonly "mention.delegate_activity": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
41
82
  readonly "mention.delegate_settled": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision", "status"];
42
83
  };
43
84
  readonly terminalStates: readonly ["completed", "failed", "cancelled"];
44
85
  };
45
- export declare const AGENT_CONTRACT_HASH: "9f6f4e0389933c9949ccd55de37131d17a7ca93e9525ee796f96a349b82ca271";
86
+ export declare const AGENT_CONTRACT_HASH: "1a1a3a59c6601cab382ac31e58198f8f61b182ed452061cd50f68faddeebc5cc";
46
87
  export interface AgentContractIdentity {
47
88
  version: typeof AGENT_CONTRACT_VERSION;
48
89
  hash: typeof AGENT_CONTRACT_HASH;
@@ -6,4 +6,4 @@
6
6
  * This file re-exports the wire types.
7
7
  * Internal consumers import from this file — zero churn.
8
8
  */
9
- export type { AgentSource, ArtifactType, MediaResultType, MemoryDecayCompletedNotification, MemoryUpdatedNotification, NotificationMethod, NotificationMethodMap, NotificationThreadItem, PermissionRuleUpdatedNotification, PlanInterruptedNotification, PongNotification, ProductAgentActivityNotification, ProductBudgetUpdateNotification, ProductBudgetWarningNotification, ProductCheckpointedNotification, ProductCompletedNotification, ProductDagTopologyNotification, ProductMembersNotification, ProductPlanFailedNotification, ProductPlanningDeltaNotification, ProductPlanReadyNotification, ProductLeaderMessageNotification, ProductPlanningAskNotification, ProductTaskCompletedNotification, ProductTaskFailedNotification, ProductTaskOutputDeltaNotification, ProductTaskStartedNotification, ProjectArchivedNotification, ProjectCreatedNotification, ProjectDeletedNotification, ProjectRenamedNotification, ProjectSwitchedNotification, ProjectUnarchivedNotification, SessionInfoNotification, SessionRecoveryPendingNotification, SoloAgentDeltaNotification, SoloAgentUsageNotification, SoloEvaluationNotification, SoloProgressNotification, TeamMemberNotification, ToolApprovalRequestNotification, TurnAnnotationsNotification, TurnArtifactNotification, TurnAskUserNotification, TurnDeltaNotification, TurnEndNotification, TurnErrorNotification, TurnExecProgressNotification, TurnHeartbeatNotification, TurnMediaPersistedNotification, TurnMediaProgressNotification, TurnMediaResultNotification, TurnPlanUpdateNotification, TurnProgressNotification, TurnReasoningDeltaNotification, TurnRecoveryNotification, TurnSidechainCompletedNotification, TurnSidechainStartedNotification, TurnStartNotification, TurnSubagentDeltaNotification, TurnSuggestionsNotification, TurnTaskUpdatedNotification, TurnTodosUpdatedNotification, TurnToolBlockedNotification, TurnToolCallNotification, TurnToolResultNotification, TurnToolUseSummaryNotification, TurnUsageUpdateNotification, WireTokenUsage, GoalRoundMessageNotification, MentionDelegateStartedNotification, MentionDelegateActivityNotification, MentionDelegateSettledNotification, } from "./wire/index.js";
9
+ export type { AgentSource, ArtifactType, MediaResultType, MemoryDecayCompletedNotification, MemoryUpdatedNotification, NotificationMethod, NotificationMethodMap, NotificationThreadItem, PermissionRuleUpdatedNotification, PlanInterruptedNotification, PongNotification, ProductAgentActivityNotification, ProductBudgetUpdateNotification, ProductBudgetWarningNotification, ProductCheckpointedNotification, ProductCompletedNotification, ProductDagTopologyNotification, ProductMembersNotification, ProductPlanFailedNotification, ProductPlanningDeltaNotification, ProductPlanReadyNotification, ProductLeaderMessageNotification, ProductPlanningAskNotification, ProductTaskCompletedNotification, ProductTaskFailedNotification, ProductTaskOutputDeltaNotification, ProductTaskStartedNotification, ProjectArchivedNotification, ProjectCreatedNotification, ProjectDeletedNotification, ProjectRenamedNotification, ProjectSwitchedNotification, ProjectUnarchivedNotification, SessionInfoNotification, SessionRecoveryPendingNotification, SoloAgentDeltaNotification, SoloAgentUsageNotification, SoloEvaluationNotification, SoloProgressNotification, TeamMemberNotification, ToolApprovalRequestNotification, TurnAnnotationsNotification, TurnArtifactNotification, TurnAskUserNotification, TurnDeltaNotification, TurnEndNotification, TurnErrorNotification, TurnExecProgressNotification, TurnHeartbeatNotification, TurnMediaPersistedNotification, TurnMediaProgressNotification, TurnMediaResultNotification, TurnPlanUpdateNotification, TurnProgressNotification, TurnReasoningDeltaNotification, TurnRecoveryNotification, TurnSidechainCompletedNotification, TurnSidechainStartedNotification, TurnStartNotification, TurnSubagentActivityNotification, TurnSubagentActivityStatus, TurnSubagentCompletedNotification, TurnSubagentDecisionNotification, TurnSubagentDeltaNotification, TurnSubagentEvidenceItem, TurnSubagentStartedNotification, TurnSubagentTokenUsage, TurnSuggestionsNotification, TurnTaskUpdatedNotification, TurnTodosUpdatedNotification, TurnToolBlockedNotification, TurnToolCallNotification, TurnToolResultNotification, TurnToolUseSummaryNotification, TurnUsageUpdateNotification, WireTokenUsage, GoalRoundMessageNotification, MentionDelegateStartedNotification, MentionDelegateActivityNotification, MentionDelegateSettledNotification, } from "./wire/index.js";
@@ -81,6 +81,17 @@ export interface McpServerConfig {
81
81
  export interface SoloEvaluation {
82
82
  winnerId: string;
83
83
  reasoning: string;
84
+ /** True once the user adopted the winner's worktree changes into the workspace (solo.select).
85
+ * Absent on the auto-judge recommendation — the UI keeps the adopt action visible until then. */
86
+ adopted?: boolean;
87
+ /** displayId of the agent that acted as judge — a competitor judging its own race is a
88
+ * trust caveat the user must see, not a hidden implementation detail. */
89
+ judgedBy?: string;
90
+ /** True when the judge did NOT compete (preferred): an independent ready agent scored the race. */
91
+ judgeExternal?: boolean;
92
+ /** True when the verdict is a fallback (judge turn failed / unparseable response) rather than a
93
+ * real comparison — the UI must flag it for manual review instead of presenting it as a ruling. */
94
+ degraded?: boolean;
84
95
  }
85
96
  /** Lightweight Spec (design D3): goal + constraints + acceptance, fits one screen. */
86
97
  export interface SoloSpec {
@@ -104,6 +115,8 @@ export interface SoloSpecChatParams {
104
115
  content: string;
105
116
  }[];
106
117
  projectId?: string;
118
+ /** 上一轮形成的规格草稿——回传给主持人做增量更新,防止第二轮起整份重写。 */
119
+ draft?: SoloSpec;
107
120
  }
108
121
  /** x/solo.specChat RPC result. */
109
122
  export interface SoloSpecChatResult {
@@ -122,15 +135,63 @@ export interface SoloSpecJudgeResult {
122
135
  * soft-gate pass, not a real "spec reviewed OK". Fail-open stays, but honestly labeled. */
123
136
  judgeSkipped?: boolean;
124
137
  }
125
- /** x/workflow.chat RPC params(M4 自动化页对话式搭图/改图)。history 含到本轮的完整对话;
126
- * currentWorkflow 为已有图的渲染文本(改图上下文,前端从 store 提供)。 */
138
+ export interface WorkflowChatContextCheckpoint {
139
+ protocolVersion: 1;
140
+ producer: "qlogicagent";
141
+ payload: {
142
+ messages: {
143
+ role: "user" | "assistant";
144
+ content: string;
145
+ }[];
146
+ /** Revisable conversation evidence. Deliberately has no ready/complete/pass gate. */
147
+ intentContract?: WorkflowIntentContract;
148
+ };
149
+ }
150
+ export interface WorkflowIntentContract {
151
+ revision: number;
152
+ observations: Array<{
153
+ id: string;
154
+ sequence: number;
155
+ text: string;
156
+ }>;
157
+ facts: Array<{
158
+ id: string;
159
+ statement: string;
160
+ confidence: "explicit" | "inferred";
161
+ sourceObservationIds: string[];
162
+ status: "active" | "superseded";
163
+ }>;
164
+ openQuestions: Array<{
165
+ id: string;
166
+ question: string;
167
+ sourceObservationIds: string[];
168
+ status: "open" | "resolved";
169
+ }>;
170
+ diagnostics: string[];
171
+ }
172
+ export interface WorkflowChatContextTurn {
173
+ sequence: number;
174
+ role: "user" | "assistant";
175
+ content: string;
176
+ }
177
+ /** x/workflow.chat RPC params(M4 自动化页对话式搭图/改图)。
178
+ * Runtime Host 传入 durable checkpoint + checkpoint 之后的新消息。`history` 仅保留给显式
179
+ * ephemeral 局部编辑,不再是持久化会话权威。 */
127
180
  export interface WorkflowChatParams {
128
- history: {
181
+ context?: {
182
+ checkpoint: WorkflowChatContextCheckpoint | null;
183
+ newTurns: WorkflowChatContextTurn[];
184
+ };
185
+ /** Answered UI clarification ids. Resolves revisable evidence only; never marks the workflow complete. */
186
+ resolvedClarificationIds?: string[];
187
+ history?: {
129
188
  role: "user" | "assistant";
130
189
  content: string;
131
190
  }[];
132
191
  /** Registered project whose capability catalog and workflow draft are being edited. */
133
192
  projectId: string;
193
+ /** Workflow currently edited. The Host injects this into connector tools. */
194
+ workflowId?: string;
134
195
  /** Exact Runtime Host capability snapshot for this proposal round. */
135
196
  capabilities: Array<{
136
197
  category: string;
@@ -140,22 +201,49 @@ export interface WorkflowChatParams {
140
201
  [key: string]: unknown;
141
202
  }>;
142
203
  currentWorkflow?: string;
143
- /** D19 框选局部修改:框选的节点 id;非空 agent scoped patch(前端再交给 Gateway Host 应用)。 */
204
+ /** Host-built bounded prompt context; full currentWorkflow stays compiler-only. */
205
+ editContext?: Record<string, unknown>;
206
+ /** D19 框选局部修改:框选的节点 id;非空 → agent 产 scoped proposal,由 Gateway Host 应用。 */
144
207
  scope?: string[];
145
208
  }
146
- /** x/workflow.chat RPC result:propose-only —— 新建给 def,改已有给 patch(均为松类型,前端转发给
147
- * Gateway Host workflow.create/patch 落库并强校验)。 */
209
+ /** x/workflow.chat RPC result:one deterministic proposal compiled from bounded Agent operations.
210
+ * Runtime Host is the only mutation owner; UI never receives or reapplies raw graph patches. */
148
211
  export interface WorkflowChatResult {
149
212
  reply?: string;
150
- def?: Record<string, unknown>;
151
- patch?: unknown[];
152
- trigger?: Record<string, unknown>;
213
+ proposal?: {
214
+ patch: unknown[];
215
+ };
153
216
  error?: string;
154
217
  /** propose 全被校验拒(无任何提案落地)时的显式失败:前端展示真实错误 + 重试出路,不许当正常回复。 */
155
218
  rejected?: {
156
219
  attempts: number;
157
220
  errors: string[];
158
221
  };
222
+ /** Agent-authored structured interaction. Transport only: not a save, finish, or proposal gate. */
223
+ clarify?: Array<{
224
+ intentQuestionId?: string;
225
+ id?: string;
226
+ purpose?: string;
227
+ nodeId?: string;
228
+ field?: string;
229
+ header: string;
230
+ question: string;
231
+ options?: Array<{
232
+ label: string;
233
+ description?: string;
234
+ }>;
235
+ multiSelect?: boolean;
236
+ }>;
237
+ /** qlogicagent-owned compact model context. Runtime stores this opaque payload separately from
238
+ * the complete visible transcript and assigns the durable transcript boundary on commit. */
239
+ contextCheckpoint?: WorkflowChatContextCheckpoint;
240
+ semanticAcceptance?: Record<string, unknown>;
241
+ intentContract?: WorkflowIntentContract;
242
+ capabilitySelection?: string[];
243
+ /** Host-owned secure input request produced by a connector tool. */
244
+ pendingConnectorInput?: Record<string, unknown>;
245
+ /** Layered connector validation evidence; informative and never a uniform completion gate. */
246
+ connectorValidation?: Record<string, unknown>;
159
247
  }
160
248
  /** solo.start RPC params. */
161
249
  export interface SoloStartParams {
@@ -23,6 +23,7 @@ export declare const ACP_EXTENDED_METHODS: {
23
23
  readonly SOLO_START: "x/solo.start";
24
24
  readonly SOLO_SELECT: "x/solo.select";
25
25
  readonly SOLO_CANCEL: "x/solo.cancel";
26
+ readonly SOLO_DELETE: "x/solo.delete";
26
27
  readonly PRODUCT_CREATE: "x/product.create";
27
28
  readonly PRODUCT_PLAN: "x/product.plan";
28
29
  readonly PRODUCT_CONFIRM: "x/product.confirm";
@@ -127,6 +128,11 @@ export interface AcpInitializeResult {
127
128
  }
128
129
  export interface AcpSessionMeta {
129
130
  projectId?: string;
131
+ /**
132
+ * Agent-internal materialization of the standard session/new|load `cwd`.
133
+ * Hosts MUST use the standard top-level field; prompt `_meta` cannot change it.
134
+ */
135
+ workdir?: string;
130
136
  sessionType?: string;
131
137
  groupKey?: string;
132
138
  groupName?: string;
@@ -165,7 +171,7 @@ export interface AcpSessionNewParams {
165
171
  resumeSessionId?: string;
166
172
  forkSession?: boolean;
167
173
  /** Per-session context supplement (no standard ACP home). Inherited by every session/prompt. */
168
- _meta?: Omit<AcpSessionMeta, "mcpServers">;
174
+ _meta?: Omit<AcpSessionMeta, "mcpServers" | "workdir">;
169
175
  }
170
176
  export interface AcpSessionLoadParams {
171
177
  sessionId: string;
@@ -34,7 +34,21 @@ export interface SoloStatus {
34
34
  evaluation?: {
35
35
  winnerId: string;
36
36
  reasoning: string;
37
- };
37
+ adopted?: boolean;
38
+ judgedBy?: string;
39
+ degraded?: boolean;
40
+ };
41
+ /** Original task text — history reopen must show what the race was about. */
42
+ task?: string;
43
+ /** Clarified Spec (goal/constraints/acceptance) when the race was started from one. */
44
+ spec?: {
45
+ goal: string;
46
+ constraints: string[];
47
+ acceptance: string[];
48
+ rawTask?: string;
49
+ };
50
+ /** Epoch ms the race started. */
51
+ createdAt?: number;
38
52
  }
39
53
  export type ProductPhase = "active" | "paused" | "completed" | "failed";
40
54
  export type ProductTaskStatus = "pending" | "running" | "completed" | "failed" | "paused" | "skipped";
@@ -5,20 +5,18 @@ export { type ChatMessage, type ChatMessageRole, type LocalizedToolText, type Th
5
5
  export { type AgentRpcMethodMap, type ProductInstanceDef, type ProductPhase, type ProductStatus, type ProductSummary, type ProductTaskDef, type ProductTaskStatus, type SoloAgentResult, type SoloAgentState, type SoloState, type SoloStatus, } from "./agent-methods.js";
6
6
  export type * from "./acp-agent-management.js";
7
7
  export { AGENT_TEAM_WS_EVENT_NAMES, AGENT_WS_EVENT_NAMES, ALL_AGENT_WS_EVENT_NAMES, type AgentTeamWsEventName, type AgentWsEventName, type AllAgentWsEventName, } from "./agent-events.js";
8
- export { type AgentSource, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductMembersNotification, type ProductAgentActivityNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectDetachedNotification, type ProjectAttachedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SessionRecoveryPendingNotification, type SoloAgentDeltaNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactContractNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaPersistedNotification, type TurnMediaProgressNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnProgressNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnStartNotification, type TurnSubagentDeltaNotification, type TurnSubagentEndedNotification, type TurnSubagentStartedNotification, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type ProductLeaderMessageNotification, type ProductPlanningAskNotification, type GoalRoundMessageNotification, type MentionDelegateStartedNotification, type MentionDelegateActivityNotification, type MentionDelegateSettledNotification, type WorkflowDeletedNotification, type WorkflowRecordNotification, type WorkflowRunCompletedNotification, type WorkflowRunFailedNotification, type WorkflowRunStartedNotification, } from "./notification-payloads.js";
8
+ export { type AgentSource, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductMembersNotification, type ProductAgentActivityNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectDetachedNotification, type ProjectAttachedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SessionRecoveryPendingNotification, type SoloAgentDeltaNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactContractNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaPersistedNotification, type TurnMediaProgressNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnProgressNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnStartNotification, type TurnSubagentActivityNotification, type TurnSubagentActivityStatus, type TurnSubagentCompletedNotification, type TurnSubagentDecisionNotification, type TurnSubagentDeltaNotification, type TurnSubagentEndedNotification, type TurnSubagentEvidenceItem, type TurnSubagentStartedNotification, type TurnSubagentTokenUsage, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type ProductLeaderMessageNotification, type ProductPlanningAskNotification, type GoalRoundMessageNotification, type MentionDelegateStartedNotification, type MentionDelegateActivityNotification, type MentionDelegateSettledNotification, type WorkflowDeletedNotification, type WorkflowRecordNotification, type WorkflowRunCompletedNotification, type WorkflowRunFailedNotification, type WorkflowRunStartedNotification, } from "./notification-payloads.js";
9
9
  export { ACP_EXTENDED_METHODS, ACP_EXTENDED_SESSION_UPDATE_TYPES, ACP_METHODS, ACP_PROTOCOL_VERSION, ACP_SESSION_UPDATE_TYPES, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, isExtendedSessionUpdateType, isStandardSessionUpdateType, parseAcpMessage, type AcpAgentCapabilities, type AcpAgentMessageChunkPayload, type AcpAgentThoughtChunkPayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpEndTurnPayload, type AcpExtendedMethod, type AcpExtendedSessionUpdateType, type AcpFsReadTextFileParams, type AcpFsReadTextFileResult, type AcpFsWriteTextFileParams, type AcpFsWriteTextFileResult, type AcpHostCapabilities, type AcpInitializeParams, type AcpInitializeResult, type AcpJsonRpcError, type AcpJsonRpcMessage, type AcpJsonRpcNotification, type AcpJsonRpcRequest, type AcpJsonRpcResponse, type AcpMode, type AcpPermissionOption, type AcpPermissionRequestParams, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, type AcpSessionSetConfigParams, type AcpSessionUpdateNotification, type AcpSessionUpdateType, type AcpStandardMethod, type AcpStandardSessionUpdateType, type AcpStopReason, type AcpToolCallPayload, type AcpToolCallUpdatePayload, type AcpUsage, type AcpUsageUpdatePayload, type AcpXSessionInfoPayload, type AcpXSkillInstructionPayload, } from "./acp-protocol.js";
10
10
  export { type ApprovalRequiredToolContract, type ModelSelectionReason, type PendingPromptContract, type RuntimeCapabilitySummaryContract, type RuntimeSessionContract, type SessionIdentityContract, } from "./session.js";
11
- export { type GatewayChannelExecutionEgressContract, type GatewayChannelExecutionEgressKind, type GatewayChannelExecutionIngressBindingContract, type GatewayChannelExecutionIngressSource, } from "./channel-ingress.js";
12
11
  export { CAPABILITY_MANIFEST_DIFF_SECTIONS, cloneCapabilityManifestSnapshot, createCapabilityManifestDiffPayload, deriveCapabilityToolNamespaces, deriveCapabilityWorkspaceIds, mergeCapabilityManifestSnapshot, type CapabilityManifestApprovalMode, type CapabilityManifestApprovalPolicyContract, type CapabilityManifestDiffSection, type CapabilityMcpManifestContract, type CapabilityManifestSnapshotContract, type HostCapabilitySnapshotContract, type CapabilityPluginManifestContract, type RuntimeCapabilityViewContract, type RuntimeToolEligibilityContract, type CapabilitySkillManifestContract, type CapabilityToolManifestContract, type CapabilityWorkspaceSummaryContract, type ToolEligibilityResolvedSource, type ToolEligibilityReasonCode, type ToolEligibilityStatus, } from "./capability-manifest.js";
13
12
  export { WEB_ACTION_SCOPE_VALUES, WEB_APPROVAL_DEFAULT_VALUES, WEB_CAPABILITY_FAMILY_VALUES, WEB_CAPABILITY_ID_VALUES, WEB_DEGRADATION_TARGET_VALUES, WEB_ESCALATION_REASON_VALUES, WEB_EXECUTION_MODE_VALUES, WEB_POLICY_RISK_CLASS_VALUES, WEB_RETRY_POLICY_VALUES, WEB_STATEFULNESS_VALUES, WEB_TASK_MODE_VALUES, type WebActionScope, type WebApprovalDefault, type WebCapabilityDescriptorContract, type WebCapabilityFamily, type WebCapabilityId, type WebDegradationTarget, type WebEscalationReason, type WebExecutionMode, type WebPolicyRiskClass, type WebRetryPolicy, type WebStatefulness, type WebTaskMode, type ToolRiskLevel, } from "./web-capability.js";
14
- export { MEMORY_OBSERVATION_HOOK_VALUES, MEMORY_OBSERVATION_SOURCE_VALUES, MEMORY_WRITE_ACCESS_VALUES, type MemoryContextBlock, type MemoryIngestOptions, type MemoryLlmConfig, type MemoryObservedPayload, type MemoryObservationEnvelope, type MemoryObservationHook, type MemoryObservationSource, type MemoryProvider, type MemorySearchOptions, type MemorySearchResult, type MemoryWriteAccess, } from "./memory-provider-lifecycle.js";
13
+ export { MEMORY_OBSERVATION_HOOK_VALUES, MEMORY_OBSERVATION_SOURCE_VALUES, MEMORY_WRITE_ACCESS_VALUES, type MemoryContextBlock, type MemoryObservedPayload, type MemoryObservationEnvelope, type MemoryObservationHook, type MemoryObservationSource, type MemoryWriteAccess, } from "./memory-provider-lifecycle.js";
15
14
  export { RESOURCE_MANIFEST_SCHEMA_VERSION, RUNTIME_ASSET_IDS, RUNTIME_PROFILE_IDS, createDefaultRuntimeResourceProfiles, getManifestShortcutEntry, getRuntimeResourceAsset, getRuntimeResourceProfile, getRuntimeResourceProfileAssets, normalizeRuntimeResourceManifest, upsertRuntimeResourceAsset, type RuntimeManifestShortcutEntry, type RuntimeResourceArtifact, type RuntimeResourceAsset, type RuntimeResourceAssetDelivery, type RuntimeResourceAssetKind, type RuntimeResourceAssetMap, type RuntimeResourceManifest, type RuntimeResourcePlatform, type RuntimeResourceProfile, type RuntimeResourceProfileMap, } from "./resource-manifest.js";
16
15
  export { MUTATION_CHECKPOINT_ENTRY_KIND_VALUES, MUTATION_CHECKPOINT_BACKEND_VALUES, MUTATION_CHECKPOINT_PHASE_VALUES, type MutationCheckpointBackend, type MutationCheckpointContract, type MutationCheckpointEntryKind, type MutationCheckpointPhase, type MutationCheckpointRestoreAckContract, type MutationCheckpointRollbackResultContract, type MutationCheckpointRestoreContract, type MutationCheckpointSnapshotEntryContract, } from "./checkpoint.js";
17
16
  export { type MutationCheckpointRuntimeManager, type MutationCheckpointRuntimeManagerDeps, } from "./checkpoint-runtime.js";
18
17
  export { PROVIDER_RUNTIME_AUTH_MODE_VALUES, PROVIDER_RUNTIME_COMPAT_FLAG_VALUES, PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES, readProviderRuntimeCompatFlag, type ProviderRuntimeAdapterContract, type ProviderRuntimeAuthMode, type ProviderRuntimeCompatFlag, type ProviderRuntimeCompatModelContract, type ProviderRuntimeProfileRecordContract, type ProviderRuntimeProfileStoreContract, type ProviderRuntimeResolvedAuthContract, type ProviderRuntimeVaultErrorType, } from "./provider-runtime-contract.js";
19
18
  export { PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID, PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES, isAnthropicProviderRuntimeFamily, isOpenAiProviderRuntimeFamily, listProviderRuntimeEnvApiKeyNames, normalizeProviderRuntimeId, normalizeProviderRuntimeIdForAuth, preservesProviderRuntimeAnthropicThinkingSignatures, requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime, resolveProviderRuntimeCapabilities, resolveProviderRuntimeEnvApiKey, resolveProviderRuntimeKeyFamily, resolveProviderRuntimeTranscriptToolCallIdMode, shouldDropThinkingBlocksForProviderRuntimeModel, shouldSanitizeProviderRuntimeThoughtSignaturesForModel, supportsOpenAiCompatTurnValidationForProviderRuntime, usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime, usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime, type ProviderRuntimeAuthCoreDeps, type ProviderRuntimeAuthProfileDeps, type ProviderRuntimeCapabilities, type ProviderRuntimeCredentialMap, type ProviderRuntimeCredentialRecord, type ProviderRuntimeEnvApiKeyResult, type ProviderRuntimePlatformKey, type ProviderRuntimeResolvedAuth, type ProviderRuntimeResolvedAuthMode, } from "./provider-runtime-core.js";
20
19
  export * from "./transport.js";
21
- export * from "./channel.js";
22
20
  export * from "./capability-transport.js";
23
21
  export * from "./execution.js";
24
22
  export * from "./turn.js";
@@ -6,7 +6,7 @@ export type MemoryObservationSource = (typeof MEMORY_OBSERVATION_SOURCE_VALUES)[
6
6
  export declare const MEMORY_WRITE_ACCESS_VALUES: readonly ["observe-only", "parent-write", "deny"];
7
7
  export type MemoryWriteAccess = (typeof MEMORY_WRITE_ACCESS_VALUES)[number];
8
8
  export interface MemoryContextBlock {
9
- blockId?: string;
9
+ id?: string;
10
10
  providerId: string;
11
11
  kind: "informational-background";
12
12
  title?: string;
@@ -29,41 +29,3 @@ export interface MemoryObservedPayload extends MemoryObservationEnvelope {
29
29
  blocks?: MemoryContextBlock[];
30
30
  error?: string;
31
31
  }
32
- export interface MemoryLlmConfig {
33
- provider: string;
34
- baseUrl: string;
35
- apiKey: string;
36
- model: string;
37
- }
38
- export interface MemorySearchResult {
39
- blockId: string;
40
- text: string;
41
- score: number;
42
- source?: string;
43
- metadata?: Record<string, unknown>;
44
- }
45
- export interface MemorySearchOptions {
46
- limit?: number;
47
- minScore?: number;
48
- llmConfig?: MemoryLlmConfig;
49
- /** Categories to boost during reranking (e.g. ["lesson", "preference"]). */
50
- preferredCategories?: string[];
51
- /** Drop hits whose tags contain ALL strings of any group (resident-layer exclusion:
52
- * entries already injected verbatim via the global INDEX must not be recalled again). */
53
- excludeTagGroups?: string[][];
54
- }
55
- export interface MemoryIngestOptions {
56
- llmConfig?: MemoryLlmConfig;
57
- source?: string;
58
- sessionId?: string;
59
- }
60
- export interface MemoryProvider {
61
- readonly providerId: string;
62
- search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
63
- /** Store a plain text memory entry (no LLM extraction — agent decides content). */
64
- addText?(text: string, userId: string, options?: MemoryIngestOptions): Promise<{
65
- memoriesAdded: number;
66
- }>;
67
- /** Remove a memory entry by ID. */
68
- remove?(memoryId: string): Promise<boolean>;
69
- }