qlogicagent 2.10.22 → 2.10.23

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 (262) hide show
  1. package/README.md +29 -4
  2. package/dist/agent.js +11 -11
  3. package/dist/cli.js +701 -604
  4. package/dist/index.js +700 -603
  5. package/dist/permissions.js +1 -0
  6. package/dist/protocol.js +1 -1
  7. package/dist/types/agent/tool-access.d.ts +1 -30
  8. package/dist/types/agent/tunable-defaults.d.ts +1 -249
  9. package/dist/types/agent/types.d.ts +7 -0
  10. package/dist/types/cli/acp-extended-handlers.d.ts +41 -0
  11. package/dist/types/cli/acp-extended-host-adapter.d.ts +28 -0
  12. package/dist/types/cli/acp-extended-host-adapter.test.d.ts +1 -0
  13. package/dist/types/cli/acp-session-handlers.d.ts +39 -0
  14. package/dist/types/cli/acp-session-handlers.test.d.ts +1 -0
  15. package/dist/types/cli/agent-config-coordinator.d.ts +13 -0
  16. package/dist/types/cli/agent-config-runtime.d.ts +11 -0
  17. package/dist/types/cli/agent-runner-factory.d.ts +2 -0
  18. package/dist/types/cli/agent-runtime-bootstrap.d.ts +64 -0
  19. package/dist/types/cli/agent-status-notifier.d.ts +11 -0
  20. package/dist/types/cli/agent-status-notifier.test.d.ts +1 -0
  21. package/dist/types/cli/base-tool-bootstrap.d.ts +7 -0
  22. package/dist/types/cli/cli-acp-request-handler.d.ts +9 -0
  23. package/dist/types/cli/cli-acp-request-handler.test.d.ts +1 -0
  24. package/dist/types/cli/cli-agent-builder.d.ts +35 -0
  25. package/dist/types/cli/community-skill-installer.d.ts +12 -0
  26. package/dist/types/cli/community-skill-installer.test.d.ts +1 -0
  27. package/dist/types/cli/core-tool-coordinator.d.ts +30 -0
  28. package/dist/types/cli/core-tools/agent-tool-bootstrap.d.ts +10 -0
  29. package/dist/types/cli/core-tools/agent-tool-service.d.ts +18 -0
  30. package/dist/types/cli/core-tools/checkpoint-tool-bootstrap.d.ts +7 -0
  31. package/dist/types/cli/core-tools/checkpoint-tool-service.d.ts +7 -0
  32. package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +7 -0
  33. package/dist/types/cli/core-tools/config-tool-service.d.ts +7 -0
  34. package/dist/types/cli/core-tools/cron-tool-bootstrap.d.ts +7 -0
  35. package/dist/types/cli/core-tools/cron-tool-service.d.ts +22 -0
  36. package/dist/types/cli/core-tools/cron-tool-service.test.d.ts +1 -0
  37. package/dist/types/cli/core-tools/monitor-tool-bootstrap.d.ts +5 -0
  38. package/dist/types/cli/core-tools/monitor-tool-service.d.ts +6 -0
  39. package/dist/types/cli/core-tools/registry.d.ts +9 -0
  40. package/dist/types/cli/core-tools/team-tool-bootstrap.d.ts +7 -0
  41. package/dist/types/cli/core-tools/team-tool-service.d.ts +21 -0
  42. package/dist/types/cli/core-tools/utility-tool-bootstrap.d.ts +8 -0
  43. package/dist/types/cli/default-project-bootstrap.d.ts +8 -0
  44. package/dist/types/cli/dev-tool-bootstrap.d.ts +4 -0
  45. package/dist/types/cli/dev-tools/lsp-tool-service.d.ts +5 -0
  46. package/dist/types/cli/dev-tools/repl-lsp-tool-services.test.d.ts +1 -0
  47. package/dist/types/cli/dev-tools/repl-tool-service.d.ts +5 -0
  48. package/dist/types/cli/dream-host-adapter.d.ts +19 -0
  49. package/dist/types/cli/handlers/agents-handler.d.ts +28 -14
  50. package/dist/types/cli/handlers/community-handler.d.ts +25 -0
  51. package/dist/types/cli/handlers/community-handler.test.d.ts +1 -0
  52. package/dist/types/cli/handlers/config-handler.d.ts +15 -9
  53. package/dist/types/cli/handlers/config-handler.test.d.ts +1 -0
  54. package/dist/types/cli/handlers/control-handler.d.ts +23 -0
  55. package/dist/types/cli/handlers/dream-handler.d.ts +21 -1
  56. package/dist/types/cli/handlers/files-handler.d.ts +15 -9
  57. package/dist/types/cli/handlers/files-handler.instructions.test.d.ts +1 -0
  58. package/dist/types/cli/handlers/media-handler.d.ts +10 -4
  59. package/dist/types/cli/handlers/media-handler.test.d.ts +1 -0
  60. package/dist/types/cli/handlers/memory-handler.d.ts +39 -12
  61. package/dist/types/cli/handlers/pet-confirm-handler.d.ts +7 -0
  62. package/dist/types/cli/handlers/pet-handler.d.ts +29 -4
  63. package/dist/types/cli/handlers/pet-handler.test.d.ts +1 -0
  64. package/dist/types/cli/handlers/product-handler.d.ts +40 -14
  65. package/dist/types/cli/handlers/project-handler.d.ts +23 -14
  66. package/dist/types/cli/handlers/session-handler.d.ts +36 -17
  67. package/dist/types/cli/handlers/session-handler.resume.test.d.ts +1 -0
  68. package/dist/types/cli/handlers/settings-handler.d.ts +16 -12
  69. package/dist/types/cli/handlers/skills-handler.d.ts +19 -10
  70. package/dist/types/cli/handlers/skills-handler.profile.test.d.ts +1 -0
  71. package/dist/types/cli/handlers/solo-handler.d.ts +31 -9
  72. package/dist/types/cli/handlers/turn-handler.approval.test.d.ts +1 -0
  73. package/dist/types/cli/handlers/turn-handler.d.ts +17 -11
  74. package/dist/types/cli/idle-dream-coordinator.d.ts +46 -0
  75. package/dist/types/cli/idle-dream-coordinator.test.d.ts +1 -0
  76. package/dist/types/cli/mcp-plugin-bootstrap.d.ts +27 -0
  77. package/dist/types/cli/mcp-plugin-bootstrap.test.d.ts +1 -0
  78. package/dist/types/cli/mcp-tool-proxy.d.ts +7 -0
  79. package/dist/types/cli/media-file-api-service.d.ts +73 -0
  80. package/dist/types/cli/media-file-api-service.test.d.ts +1 -0
  81. package/dist/types/cli/media-file-tool-service.d.ts +13 -0
  82. package/dist/types/cli/memory-coordinator.d.ts +36 -0
  83. package/dist/types/cli/model-client-resolver.d.ts +22 -0
  84. package/dist/types/cli/multi-agent-handler-host.d.ts +27 -0
  85. package/dist/types/cli/multi-agent-handler-host.test.d.ts +1 -0
  86. package/dist/types/cli/multi-agent-state-coordinator.d.ts +11 -0
  87. package/dist/types/cli/permission-bootstrap.d.ts +33 -0
  88. package/dist/types/cli/permission-bootstrap.test.d.ts +1 -0
  89. package/dist/types/cli/permission-settings-store.d.ts +2 -0
  90. package/dist/types/cli/permission-settings-store.test.d.ts +1 -0
  91. package/dist/types/cli/pet-confirm-coordinator.d.ts +20 -0
  92. package/dist/types/cli/pet-confirm-coordinator.test.d.ts +1 -0
  93. package/dist/types/cli/pet-runtime.d.ts +34 -0
  94. package/dist/types/cli/pet-runtime.test.d.ts +1 -0
  95. package/dist/types/cli/project-context.d.ts +1 -0
  96. package/dist/types/cli/project-memory-store-factory.d.ts +2 -0
  97. package/dist/types/cli/project-template-seeder.d.ts +5 -0
  98. package/dist/types/cli/provider-core-facade.d.ts +27 -0
  99. package/dist/types/cli/rpc-registry.community.test.d.ts +1 -0
  100. package/dist/types/cli/rpc-registry.d.ts +8 -0
  101. package/dist/types/cli/runtime-hook-bootstrap.d.ts +34 -0
  102. package/dist/types/cli/runtime-watcher-bootstrap.d.ts +15 -0
  103. package/dist/types/cli/session-coordinator.d.ts +10 -0
  104. package/dist/types/cli/session-coordinator.test.d.ts +1 -0
  105. package/dist/types/cli/session-history-coordinator.d.ts +11 -0
  106. package/dist/types/cli/session-history-coordinator.test.d.ts +1 -0
  107. package/dist/types/cli/skill-meta-tool-bootstrap.d.ts +25 -0
  108. package/dist/types/cli/skill-meta-tool-bootstrap.test.d.ts +1 -0
  109. package/dist/types/cli/stdio-server.d.ts +17 -134
  110. package/dist/types/cli/tool-bootstrap.d.ts +1 -4
  111. package/dist/types/cli/tool-bootstrap.instructions.test.d.ts +1 -0
  112. package/dist/types/cli/tool-bootstrap.media-provider-alias.test.d.ts +1 -0
  113. package/dist/types/cli/tool-catalog.d.ts +2 -0
  114. package/dist/types/cli/tool-invoker-factory.d.ts +10 -0
  115. package/dist/types/cli/tool-result-processor.d.ts +14 -0
  116. package/dist/types/cli/transport.d.ts +2 -12
  117. package/dist/types/cli/turn-ask-user-setup.d.ts +9 -0
  118. package/dist/types/cli/turn-event-forwarder.d.ts +10 -0
  119. package/dist/types/cli/turn-lifecycle.d.ts +19 -0
  120. package/dist/types/cli/turn-lifecycle.test.d.ts +1 -0
  121. package/dist/types/cli/turn-media-setup.d.ts +16 -0
  122. package/dist/types/cli/turn-permission-sync.d.ts +7 -0
  123. package/dist/types/cli/turn-permission-sync.test.d.ts +1 -0
  124. package/dist/types/cli/turn-project-router.d.ts +22 -0
  125. package/dist/types/cli/turn-project-router.test.d.ts +1 -0
  126. package/dist/types/cli/turn-skill-autopersist.d.ts +47 -0
  127. package/dist/types/cli/turn-skill-autopersist.test.d.ts +1 -0
  128. package/dist/types/cli/turn-suggestion-generator.d.ts +15 -0
  129. package/dist/types/orchestration/agent-instance.d.ts +1 -1
  130. package/dist/types/orchestration/dag-scheduler.d.ts +135 -86
  131. package/dist/types/orchestration/index.d.ts +2 -2
  132. package/dist/types/orchestration/product-budget.d.ts +1 -1
  133. package/dist/types/orchestration/product-persistence.d.ts +3 -12
  134. package/dist/types/orchestration/product-planner.d.ts +1 -1
  135. package/dist/types/orchestration/skill-improvement.d.ts +1 -1
  136. package/dist/types/orchestration/solo-evaluator.d.ts +1 -1
  137. package/dist/types/orchestration/solo-persistence.d.ts +1 -1
  138. package/dist/types/orchestration/subagent/fork-subagent.d.ts +1 -1
  139. package/dist/types/orchestration/subagent/task-types.d.ts +1 -146
  140. package/dist/types/orchestration/tool-cascade.d.ts +2 -2
  141. package/dist/types/orchestration/workflow/budget-permission-gate.d.ts +85 -0
  142. package/dist/types/orchestration/workflow/builtin-executors.d.ts +12 -0
  143. package/dist/types/orchestration/workflow/cron-schedule.d.ts +37 -0
  144. package/dist/types/orchestration/workflow/data-item.d.ts +39 -0
  145. package/dist/types/orchestration/workflow/expression.d.ts +52 -0
  146. package/dist/types/orchestration/workflow/host-executors.d.ts +15 -0
  147. package/dist/types/orchestration/workflow/n8n-import.d.ts +35 -0
  148. package/dist/types/orchestration/workflow/node-registry.d.ts +19 -0
  149. package/dist/types/orchestration/workflow/node-schema.d.ts +119 -0
  150. package/dist/types/orchestration/workflow/run-checkpoint-store.d.ts +53 -0
  151. package/dist/types/orchestration/workflow/trigger-validation.d.ts +22 -0
  152. package/dist/types/orchestration/workflow/workflow-controller.d.ts +143 -0
  153. package/dist/types/orchestration/workflow/workflow-patch.d.ts +101 -0
  154. package/dist/types/orchestration/workflow/workflow-render.d.ts +41 -0
  155. package/dist/types/orchestration/workflow/workflow-runtime.d.ts +127 -0
  156. package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +83 -0
  157. package/dist/types/orchestration/workflow/workflow-store.d.ts +40 -0
  158. package/dist/types/orchestration/workflow/workflow-trigger.d.ts +14 -0
  159. package/dist/types/permissions.d.ts +2 -0
  160. package/dist/types/permissions.public-api.test.d.ts +1 -0
  161. package/dist/types/protocol/methods.d.ts +262 -11
  162. package/dist/types/{runtime/infra/acp-types.d.ts → protocol/wire/acp-agent-management.d.ts} +3 -3
  163. package/dist/types/protocol/wire/agent-methods.d.ts +15 -11
  164. package/dist/types/protocol/wire/agent-rpc.d.ts +11 -0
  165. package/dist/types/protocol/wire/chat-types.d.ts +9 -0
  166. package/dist/types/protocol/wire/gateway-rpc.d.ts +13 -0
  167. package/dist/types/protocol/wire/index.d.ts +2 -1
  168. package/dist/types/protocol/wire/notification-payloads.d.ts +18 -3
  169. package/dist/types/runtime/community/community-consent-client.d.ts +117 -0
  170. package/dist/types/runtime/community/community-consent-client.test.d.ts +1 -0
  171. package/dist/types/runtime/community/community-desensitization-red-team-cli.d.ts +7 -0
  172. package/dist/types/runtime/community/community-desensitization-red-team-cli.test.d.ts +1 -0
  173. package/dist/types/runtime/community/community-desensitization.d.ts +29 -0
  174. package/dist/types/runtime/community/community-desensitization.test.d.ts +1 -0
  175. package/dist/types/runtime/community/community-telemetry-recorder.d.ts +6 -0
  176. package/dist/types/runtime/config/tunable-defaults.d.ts +249 -0
  177. package/dist/types/runtime/execution/dream-agent.d.ts +4 -2
  178. package/dist/types/runtime/execution/dream-category-context.d.ts +1 -1
  179. package/dist/types/runtime/execution/forked-agent.d.ts +3 -1
  180. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +4 -2
  181. package/dist/types/runtime/execution/tool-eligibility.d.ts +1 -1
  182. package/dist/types/runtime/hooks/context-compression.d.ts +2 -2
  183. package/dist/types/runtime/hooks/memory-hooks.d.ts +6 -6
  184. package/dist/types/runtime/infra/acp-detector.d.ts +2 -2
  185. package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +1 -1
  186. package/dist/types/runtime/infra/acp-usage-tracker.d.ts +1 -1
  187. package/dist/types/runtime/infra/agent-config-store.d.ts +2 -2
  188. package/dist/types/runtime/infra/agent-paths.d.ts +14 -10
  189. package/dist/types/runtime/infra/agent-paths.test.d.ts +1 -0
  190. package/dist/types/runtime/infra/agent-process.d.ts +2 -2
  191. package/dist/types/runtime/infra/checkpoint-backend.d.ts +2 -2
  192. package/dist/types/runtime/infra/index.d.ts +1 -1
  193. package/dist/types/runtime/infra/llmrouter-catalog.d.ts +10 -0
  194. package/dist/types/runtime/infra/mcp-bridge.d.ts +1 -1
  195. package/dist/types/runtime/infra/model-registry.d.ts +2 -1
  196. package/dist/types/runtime/infra/profile-storage.test.d.ts +1 -0
  197. package/dist/types/runtime/infra/skill-injector.d.ts +3 -2
  198. package/dist/types/runtime/infra/skill-injector.test.d.ts +1 -0
  199. package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
  200. package/dist/types/runtime/infra/worktree-backend.d.ts +2 -2
  201. package/dist/types/runtime/memory/categories.d.ts +5 -0
  202. package/dist/types/runtime/memory/find-relevant-memories.d.ts +70 -0
  203. package/dist/types/runtime/memory/implicit-extraction.d.ts +58 -0
  204. package/dist/types/runtime/memory/recall-category-filter.d.ts +54 -0
  205. package/dist/types/runtime/pet/index.d.ts +1 -1
  206. package/dist/types/runtime/pet/pet-growth-engine.d.ts +10 -9
  207. package/dist/types/runtime/pet/pet-growth-engine.test.d.ts +1 -0
  208. package/dist/types/runtime/pet/pet-soul-service.d.ts +1 -2
  209. package/dist/types/runtime/pet/pet-soul-service.test.d.ts +1 -0
  210. package/dist/types/runtime/ports/agent-execution-contracts.d.ts +182 -0
  211. package/dist/types/runtime/ports/checkpoint-contracts.d.ts +19 -0
  212. package/dist/types/runtime/ports/index.d.ts +13 -0
  213. package/dist/types/runtime/ports/memory-provider.d.ts +146 -0
  214. package/dist/types/runtime/ports/memory-recall-source.d.ts +3 -0
  215. package/dist/types/runtime/ports/memory-writer.d.ts +21 -0
  216. package/dist/types/runtime/ports/path-service.d.ts +5 -0
  217. package/dist/types/runtime/ports/permission-contracts.d.ts +107 -0
  218. package/dist/types/runtime/ports/project-memory-store.d.ts +44 -0
  219. package/dist/types/runtime/ports/tool-call-contracts.d.ts +16 -0
  220. package/dist/types/runtime/ports/tool-contracts.d.ts +23 -0
  221. package/dist/types/runtime/ports/web-search-contracts.d.ts +17 -0
  222. package/dist/types/runtime/ports/worktree-contracts.d.ts +22 -0
  223. package/dist/types/runtime/prompt/environment-context.test.d.ts +1 -0
  224. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +19 -0
  225. package/dist/types/runtime/prompt/fresh-workspace-evidence.test.d.ts +1 -0
  226. package/dist/types/runtime/prompt/instruction-loader.d.ts +9 -3
  227. package/dist/types/runtime/prompt/instruction-loader.test.d.ts +1 -0
  228. package/dist/types/runtime/session/session-persistence.test.d.ts +1 -0
  229. package/dist/types/runtime/tasks/task-types.d.ts +146 -0
  230. package/dist/types/skills/index.d.ts +2 -2
  231. package/dist/types/skills/mcp/mcp-http-client.d.ts +2 -0
  232. package/dist/types/skills/mcp/mcp-manager.d.ts +7 -4
  233. package/dist/types/skills/mcp/mcp-stdio-client.d.ts +2 -0
  234. package/dist/types/skills/mcp/mcp-tool-metadata.d.ts +18 -0
  235. package/dist/types/skills/memory/categories.d.ts +1 -5
  236. package/dist/types/skills/memory/find-relevant-memories.d.ts +1 -70
  237. package/dist/types/skills/memory/implicit-extraction.d.ts +1 -58
  238. package/dist/types/skills/memory/local-memory-provider.d.ts +4 -10
  239. package/dist/types/skills/memory/local-store.d.ts +4 -4
  240. package/dist/types/skills/memory/memory-consolidation.d.ts +9 -1
  241. package/dist/types/skills/memory/memory-provider-factory.d.ts +2 -0
  242. package/dist/types/skills/memory/memory-tool.d.ts +4 -6
  243. package/dist/types/skills/memory/recall-category-filter.d.ts +1 -54
  244. package/dist/types/skills/permissions/community-sandbox-policy.d.ts +3 -0
  245. package/dist/types/skills/permissions/community-sandbox-red-team-cli.d.ts +7 -0
  246. package/dist/types/skills/permissions/community-sandbox-red-team.d.ts +30 -0
  247. package/dist/types/skills/permissions/hook-runner.d.ts +15 -2
  248. package/dist/types/skills/permissions/settings-watcher.d.ts +2 -0
  249. package/dist/types/skills/permissions/types.d.ts +2 -113
  250. package/dist/types/skills/portable-tool.d.ts +22 -0
  251. package/dist/types/skills/skill-system/skill-lifecycle.d.ts +5 -0
  252. package/dist/types/skills/skill-system/skill-source.d.ts +2 -148
  253. package/dist/types/skills/tool-access.d.ts +30 -0
  254. package/dist/types/skills/tools/skill-tool.d.ts +2 -10
  255. package/dist/types/skills/tools/web-search-tool.d.ts +3 -20
  256. package/dist/types/skills/tools.d.ts +1 -1
  257. package/dist/types/transport/acp-server.d.ts +1 -1
  258. package/dist/types/transport/index.d.ts +1 -0
  259. package/dist/types/transport/io-transport.d.ts +19 -0
  260. package/package.json +93 -80
  261. package/dist/types/llm/index.d.ts +0 -1
  262. /package/dist/types/{orchestration/context/context-compression.d.ts → runtime/context/context-compression-strategies.d.ts} +0 -0
@@ -8,9 +8,10 @@
8
8
  * import type { AgentRpcMethodMap } from "qlogicagent/protocol";
9
9
  * async function call<M extends keyof AgentRpcMethodMap>(method: M, params: AgentRpcMethodMap[M]["params"]): Promise<AgentRpcMethodMap[M]["result"]> { ... }
10
10
  */
11
- import type { ChatMessage, ToolDefinition } from "./chat-types.js";
11
+ import type { ChatMessage, LocalizedToolText, ToolCapabilityCategory, ToolDefinition } from "./chat-types.js";
12
12
  import type { GatewayRpcMethodMap } from "./gateway-rpc.js";
13
13
  import type { WireTokenUsage } from "./notification-payloads.js";
14
+ import type { ToolApprovalResponseParams } from "./agent-rpc.js";
14
15
  export type AgentCategory = "sub-agent" | "teammate";
15
16
  export type AgentProtocol = "internal" | "acp";
16
17
  export type AgentStatus = "available" | "unavailable" | "handshake_failed" | "not_installed";
@@ -80,7 +81,7 @@ export interface SoloStatus {
80
81
  };
81
82
  }
82
83
  export type ProductPhase = "active" | "paused" | "completed" | "failed";
83
- export type ProductTaskStatus = "pending" | "running" | "completed" | "failed" | "paused";
84
+ export type ProductTaskStatus = "pending" | "running" | "completed" | "failed" | "paused" | "skipped";
84
85
  export interface ProductInstanceDef {
85
86
  name: string;
86
87
  role: string;
@@ -339,17 +340,24 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
339
340
  };
340
341
  "tools.list": {
341
342
  params: {
342
- category?: string;
343
- includeDisabled?: boolean;
343
+ category?: ToolCapabilityCategory;
344
+ includeDeferred?: boolean;
344
345
  };
345
346
  result: {
346
347
  tools: Array<{
348
+ id: string;
347
349
  name: string;
350
+ category: ToolCapabilityCategory;
351
+ displayName: LocalizedToolText;
352
+ displayDescription: LocalizedToolText;
353
+ fallbackName: string;
354
+ fallbackDescription: string;
348
355
  description: string;
349
- category: string;
350
- enabled: boolean;
356
+ source: "builtin";
357
+ deferred: boolean;
351
358
  parameters?: Record<string, unknown>;
352
359
  }>;
360
+ total: number;
353
361
  };
354
362
  };
355
363
  "media.listModels": {
@@ -438,11 +446,7 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
438
446
  };
439
447
  };
440
448
  "tool.approval.response": {
441
- params: {
442
- approvalId: string;
443
- approved: boolean;
444
- message?: string;
445
- };
449
+ params: ToolApprovalResponseParams;
446
450
  result: {
447
451
  received: boolean;
448
452
  };
@@ -99,6 +99,17 @@ export interface ToolApprovalResponseParams {
99
99
  approvalId: string;
100
100
  /** User's decision. */
101
101
  decision: "allow-once" | "allow-session" | "allow-always" | "deny";
102
+ /** Optional tool name, used to create a persistent rule for allow-always. */
103
+ toolName?: string;
104
+ /** Optional corrected tool input after user review. */
105
+ updatedInput?: Record<string, unknown>;
106
+ /** Optional persistent rule update to save after approval. */
107
+ permissionUpdate?: {
108
+ pattern: string;
109
+ behavior: "allow" | "ask" | "deny";
110
+ scope?: "session" | "persistent";
111
+ description?: string;
112
+ };
102
113
  }
103
114
  /** Well-known method names for the approval protocol. */
104
115
  export declare const AGENT_RPC_APPROVAL_METHODS: {
@@ -60,6 +60,12 @@ export interface ChatMessage {
60
60
  size?: number;
61
61
  }>;
62
62
  }
63
+ export type ToolCapabilityCategory = "orchestration" | "filesystem" | "web" | "search" | "memory" | "media" | "developer" | "mcp" | "automation" | "system" | "other";
64
+ export interface LocalizedToolText {
65
+ key: string;
66
+ fallback: string;
67
+ values?: Partial<Record<string, string>>;
68
+ }
63
69
  /**
64
70
  * Tool definition — wire format as sent over JSON-RPC.
65
71
  *
@@ -75,6 +81,9 @@ export interface ToolDefinition {
75
81
  };
76
82
  /** Tool scheduling metadata from host manifest (optional). */
77
83
  meta?: {
84
+ category?: ToolCapabilityCategory;
85
+ displayName?: LocalizedToolText;
86
+ displayDescription?: LocalizedToolText;
78
87
  serialOnly?: boolean;
79
88
  parallelSafe?: boolean;
80
89
  /** If true, host should request user approval before execution. */
@@ -12,6 +12,12 @@
12
12
  */
13
13
  export type ProjectType = "default" | "personal" | "group" | "solo" | "product";
14
14
  export type ProjectStatus = "active" | "archived";
15
+ export interface LocalizedTextWire {
16
+ key: string;
17
+ fallback: string;
18
+ values?: Record<string, string>;
19
+ }
20
+ export type CapabilityCategoryWire = "orchestration" | "filesystem" | "web" | "search" | "memory" | "media" | "developer" | "mcp" | "automation" | "system" | "other";
15
21
  export interface ProjectInfo {
16
22
  id: string;
17
23
  name: string;
@@ -433,10 +439,17 @@ export interface GatewayRpcMethodMap {
433
439
  };
434
440
  result: {
435
441
  skills: Array<{
442
+ id: string;
436
443
  name: string;
437
444
  path: string;
438
445
  active: boolean;
439
446
  scope: "project" | "global";
447
+ category: CapabilityCategoryWire;
448
+ displayName: LocalizedTextWire;
449
+ displayDescription: LocalizedTextWire;
450
+ fallbackName: string;
451
+ fallbackDescription: string;
452
+ systemGenerated: boolean;
440
453
  version?: string;
441
454
  description?: string;
442
455
  }>;
@@ -1,8 +1,9 @@
1
1
  export { AGENT_RPC_APPROVAL_METHODS, AGENT_RPC_ERROR_CODES, AGENT_RPC_PROTOCOL_VERSION, isAgentRpcNotification, isAgentRpcRequest, isAgentRpcResponse, parseAgentRpcMessage, type AgentHelloParams, type AgentHelloResult, type AgentRpcError, type AgentRpcErrorCode, type AgentRpcMeta, type AgentRpcChannel, type AgentRpcMessage, type AgentRpcNotification, type AgentRpcRequest, type AgentRpcResponse, type ToolApprovalRequestParams, type ToolApprovalResponseParams, } from "./agent-rpc.js";
2
2
  export { GatewayRpcContract, buildAgentRpcMeta, classifyGatewayRpcMethod, requireGatewayRpcMeta, requiresIdempotencyKey, type GatewayRpcClassification, type GatewayRpcMetrics, type GatewayRpcMutability, } from "./gateway-contract.js";
3
3
  export { GATEWAY_RPC_METHODS, type AgentCall, type AgentCallOptions, type GatewayRpcMethodMap, type ProjectInfo as RpcProjectInfo, type ProjectStatus as RpcProjectStatus, type ProjectType as RpcProjectType, } from "./gateway-rpc.js";
4
- export { type ChatMessage, type ChatMessageRole, type ThinkingBlock, type ToolCallMessage, type ToolDefinition, } from "./chat-types.js";
4
+ export { type ChatMessage, type ChatMessageRole, type LocalizedToolText, type ThinkingBlock, type ToolCapabilityCategory, type ToolCallMessage, type ToolDefinition, } from "./chat-types.js";
5
5
  export { type AgentCapabilities, type AgentCategory, type AgentConfig, type AgentDescriptor, type AgentProtocol, type AgentRpcMethodMap, type AgentStatus, type CustomAgentDef, 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
+ export type * from "./acp-agent-management.js";
6
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";
7
8
  export { type AgentSource, type AgentsErrorNotification, type AgentsStatusNotification, 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 ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SoloAgentDeltaNotification, type SoloAgentDiffNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaPersistedNotification, type TurnMediaProgressNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnSkillInstructionNotification, type TurnStartNotification, type TurnSubagentDeltaNotification, 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 PetSoulReadyNotification, type PetReactionNotification, type PetGrowthNotification, type PetStateNotification, type PetConfirmNotification, } from "./notification-payloads.js";
8
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 AcpAvailableCommandsUpdatePayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpContextItem, 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 AcpPermissionOption, type AcpPermissionRequestParams, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionEndParams, 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 AcpXAskUserPayload, type AcpXMediaProgressPayload, type AcpXMediaResultPayload, type AcpXMemoryUpdatedPayload, type AcpXProductCheckpointPayload, type AcpXProductTaskCompletedPayload, type AcpXProductTaskStartedPayload, type AcpXRecoveryPayload, type AcpXSessionInfoPayload, type AcpXSidechainCompletedPayload, type AcpXSidechainStartedPayload, type AcpXSkillInstructionPayload, type AcpXSoloAgentFinishedPayload, type AcpXSoloSelectedPayload, type AcpXSoloStartedPayload, type AcpXSubagentDeltaPayload, type AcpXSubagentEndedPayload, type AcpXSubagentStartedPayload, type AcpXSuggestionsPayload, type AcpXTeamMemberUpdatePayload, } from "./acp-protocol.js";
@@ -86,6 +86,7 @@ export interface TurnToolCallNotification {
86
86
  callId: string;
87
87
  name: string;
88
88
  arguments?: string;
89
+ inputSummary?: string;
89
90
  item?: NotificationThreadItem;
90
91
  agentSource?: AgentSource;
91
92
  }
@@ -97,6 +98,11 @@ export interface TurnToolResultNotification {
97
98
  ok: boolean;
98
99
  error?: string;
99
100
  outputPreview?: string;
101
+ durationMs?: number;
102
+ exitCode?: number;
103
+ stdout?: string;
104
+ stderr?: string;
105
+ details?: Record<string, unknown>;
100
106
  item?: NotificationThreadItem;
101
107
  }
102
108
  /** Tool execution blocked by permission system. */
@@ -315,6 +321,7 @@ export interface SessionInfoNotification {
315
321
  export interface PermissionRuleUpdatedNotification {
316
322
  pattern: string;
317
323
  behavior: string;
324
+ scope?: "session" | "persistent";
318
325
  }
319
326
  /** Forwarded notification from a team member child process. */
320
327
  export interface TeamMemberNotification {
@@ -599,11 +606,19 @@ export interface PetGrowthNotification {
599
606
  level: number;
600
607
  experience: number;
601
608
  xpNeeded?: number;
602
- newAbility?: string;
603
- abilities?: string[];
604
- nextAbility?: {
609
+ displayTraits?: Array<{
610
+ id: string;
605
611
  name: string;
612
+ description: string;
613
+ level: number;
614
+ surface: "presentation";
615
+ }>;
616
+ nextDisplayTrait?: {
617
+ id: string;
618
+ name: string;
619
+ description: string;
606
620
  level: number;
621
+ surface: "presentation";
607
622
  };
608
623
  }
609
624
  /** Emitted to override pet state from agent side. */
@@ -0,0 +1,117 @@
1
+ export interface CommunityConsentView {
2
+ enabled: boolean;
3
+ methodSharingEnabled: boolean;
4
+ signalsEnabled: boolean;
5
+ encounterEnabled: boolean;
6
+ remoteSynced: boolean;
7
+ }
8
+ export interface SetCommunityConsentInput {
9
+ enabled: boolean;
10
+ methodSharingEnabled?: boolean;
11
+ signalsEnabled?: boolean;
12
+ encounterEnabled?: boolean;
13
+ }
14
+ export interface CommunityConsentClient {
15
+ getConsent(): Promise<CommunityConsentView>;
16
+ setConsent(input: SetCommunityConsentInput): Promise<CommunityConsentView>;
17
+ publishSkill(input: CommunityPublishSkillInput): Promise<CommunityPublishSkillResult>;
18
+ recordSignal(input: CommunityRecordSignalInput): Promise<CommunityRecordSignalResult>;
19
+ recordTelemetry(input: CommunityRecordTelemetryInput): Promise<CommunityRecordTelemetryResult>;
20
+ resolveInstall(resourceId: string, version?: string): Promise<CommunityInstallResolution>;
21
+ listSharedResources(): Promise<CommunitySharedResource[]>;
22
+ withdrawSharedResource(resourceId: string, reason?: string): Promise<CommunitySharedResource>;
23
+ withdrawSharedResources(reason?: string): Promise<CommunitySharedResource[]>;
24
+ listNotices(input?: CommunityListNoticesInput): Promise<CommunityNotice[]>;
25
+ markNoticeRead(noticeId: number): Promise<CommunityNotice>;
26
+ }
27
+ export interface CommunitySharedResource {
28
+ id: string;
29
+ type: string;
30
+ title: string;
31
+ summary: string;
32
+ visibility: string;
33
+ latestVersion: string | null;
34
+ withdrawn: boolean;
35
+ withdrawnAt: string | null;
36
+ }
37
+ export interface CommunityPublishedVersion {
38
+ version: string;
39
+ checksum: string;
40
+ sizeBytes: number;
41
+ }
42
+ export interface CommunityPublishSkillInput {
43
+ id: string;
44
+ title: string;
45
+ summary: string;
46
+ visibility?: "public" | "private";
47
+ tags?: string[];
48
+ manifest: Record<string, unknown>;
49
+ version?: string;
50
+ packageGzipBase64?: string;
51
+ }
52
+ export interface CommunityPublishSkillResult {
53
+ resource: CommunitySharedResource;
54
+ version?: CommunityPublishedVersion;
55
+ }
56
+ export type CommunitySignalEvent = "installed" | "success" | "fail" | "neutral" | "kept" | "uninstalled" | "endorse" | "error";
57
+ export interface CommunityRecordSignalInput {
58
+ resourceId: string;
59
+ event: CommunitySignalEvent;
60
+ attribution?: string;
61
+ metadata?: Record<string, unknown>;
62
+ }
63
+ export interface CommunityRecordSignalResult {
64
+ accepted: true;
65
+ }
66
+ export type CommunityTelemetryEvent = "community.journey.view" | "community.share.generated" | "community.sandbox.violation" | "community.desensitization.hit";
67
+ export interface CommunityRecordTelemetryInput {
68
+ event: CommunityTelemetryEvent;
69
+ metadata?: Record<string, unknown>;
70
+ }
71
+ export interface CommunityRecordTelemetryResult {
72
+ accepted: true;
73
+ }
74
+ export interface CommunityNotice {
75
+ id: number;
76
+ resourceId: string;
77
+ resourceType: string;
78
+ title: string;
79
+ event: "withdrawn";
80
+ version: string | null;
81
+ reason: string | null;
82
+ read: boolean;
83
+ createdAt: string;
84
+ readAt: string | null;
85
+ }
86
+ export interface CommunityListNoticesInput {
87
+ includeRead?: boolean;
88
+ }
89
+ export type CommunityInstallRiskTier = "R0" | "R1" | "R2" | "R3";
90
+ export type CommunityInstallSourceTier = "official" | "community";
91
+ export type CommunityInstallTrustStage = "quarantine" | "trial" | "trusted";
92
+ export type CommunityInstallReviewStatus = "pending" | "approved" | "rejected";
93
+ export interface CommunityInstallResolution {
94
+ id: string;
95
+ type: string;
96
+ kind: string;
97
+ sourceTier: CommunityInstallSourceTier;
98
+ trustStage: CommunityInstallTrustStage;
99
+ reviewStatus: CommunityInstallReviewStatus;
100
+ resourceRiskTier: CommunityInstallRiskTier;
101
+ effectiveRiskTier: CommunityInstallRiskTier;
102
+ requires: string[];
103
+ dependencies: CommunityInstallResolution[];
104
+ version: string;
105
+ checksum: string;
106
+ sizeBytes: number;
107
+ downloadUrl: string;
108
+ manifest: unknown;
109
+ }
110
+ export interface CommunityConsentClientOptions {
111
+ baseUrl: string;
112
+ token: string;
113
+ fetchFn?: typeof fetch;
114
+ }
115
+ export declare function createCommunityConsentClient(options: CommunityConsentClientOptions): CommunityConsentClient;
116
+ export declare function createDefaultCommunityConsentClient(): CommunityConsentClient | null;
117
+ export declare function normalizeCommunityConsent(value: unknown, remoteSynced: boolean): CommunityConsentView;
@@ -0,0 +1,7 @@
1
+ export interface CommunityDesensitizationRedTeamCliDeps {
2
+ log?: {
3
+ info(message: string): void;
4
+ error(message: string): void;
5
+ };
6
+ }
7
+ export declare function runCommunityDesensitizationRedTeamCli(argv?: string[], deps?: CommunityDesensitizationRedTeamCliDeps): Promise<number>;
@@ -0,0 +1,29 @@
1
+ export type CommunityDesensitizationRuleId = "sensitive-email" | "sensitive-secret" | "sensitive-path" | "sensitive-phone";
2
+ export interface CommunityDesensitizationHit {
3
+ reason: string;
4
+ ruleId: CommunityDesensitizationRuleId;
5
+ }
6
+ export interface CommunityDesensitizationRedTeamCase {
7
+ id: string;
8
+ content: string;
9
+ expectedRuleId: CommunityDesensitizationRuleId;
10
+ }
11
+ export interface CommunityDesensitizationRedTeamReport {
12
+ suite: "desensitization";
13
+ generatedAt: string;
14
+ cases: number;
15
+ passed: boolean;
16
+ failures: number;
17
+ breakdown: Record<CommunityDesensitizationRuleId, {
18
+ cases: number;
19
+ failures: number;
20
+ }>;
21
+ failureDetails: Array<{
22
+ id: string;
23
+ expectedRuleId: CommunityDesensitizationRuleId;
24
+ actualRuleId: CommunityDesensitizationRuleId | null;
25
+ }>;
26
+ }
27
+ export declare function detectCommunityPublishSensitiveContent(content: string): CommunityDesensitizationHit | null;
28
+ export declare function buildCommunityDesensitizationRedTeamCases(): CommunityDesensitizationRedTeamCase[];
29
+ export declare function runCommunityDesensitizationRedTeam(cases?: CommunityDesensitizationRedTeamCase[]): CommunityDesensitizationRedTeamReport;
@@ -0,0 +1,6 @@
1
+ import { type CommunityRecordTelemetryInput } from "./community-consent-client.js";
2
+ export interface CommunityTelemetryRecorder {
3
+ recordTelemetry(input: CommunityRecordTelemetryInput): Promise<void>;
4
+ }
5
+ export declare function createDefaultCommunityTelemetryRecorder(): CommunityTelemetryRecorder | null;
6
+ export declare function recordCommunityTelemetryBestEffort(recorder: CommunityTelemetryRecorder | null | undefined, input: CommunityRecordTelemetryInput): void;
@@ -0,0 +1,249 @@
1
+ /**
2
+ * Centralized tunable defaults — single source of truth.
3
+ *
4
+ * ALL configurable constants that external apps (Electron UI, CLI config)
5
+ * may want to read or override are defined here. This enables:
6
+ *
7
+ * 1. A future `config.tunables` RPC endpoint for visual editing
8
+ * 2. Serialization to JSON for persistence (settings.json)
9
+ * 3. Environment variable overrides via QLOGICAGENT_* prefix
10
+ *
11
+ * Consumers import individual constants from this module.
12
+ * The full shape is exported as `TunableDefaults` interface for RPC typing.
13
+ *
14
+ * Grouping follows subsystem boundaries.
15
+ */
16
+ /** Absolute max rounds any agent can run (hard cap). */
17
+ export declare const MAX_ROUNDS_LIMIT = 100;
18
+ /** Default rounds for a top-level agent turn. */
19
+ export declare const DEFAULT_MAX_ROUNDS = 25;
20
+ /** Default temperature for LLM calls (0 = deterministic). */
21
+ export declare const DEFAULT_TEMPERATURE = 0;
22
+ /** Hard cap on tool calls per round (prevents runaway). */
23
+ export declare const MAX_TOOL_BUDGET_CAP = 100;
24
+ /** Default tool budget per round. Overridable via TOOL_LOOP_DEFAULT_BUDGET env. */
25
+ export declare const DEFAULT_TOOL_BUDGET: number;
26
+ /** Max consecutive tool call failures before early exit. */
27
+ export declare const MAX_CONSECUTIVE_FAILURES = 3;
28
+ /** Max times the exact same (tool_name, arguments) pair can repeat. */
29
+ export declare const MAX_IDENTICAL_CALL_REPEATS = 2;
30
+ /** Max times the same tool can fail with different args before blocking (variant-loop detection).
31
+ * Includes both hard failures (ok=false) and soft empty results (e.g. "No matches found").
32
+ * Note: blocked calls still emit tool_call events, so effective max attempts visible to
33
+ * client = MAX + 1 (the blocked attempt) + possible 1 alternative tool = MAX + 2. */
34
+ export declare const MAX_TOOL_VARIANT_FAILURES = 2;
35
+ /** Default context window size (tokens). */
36
+ export declare const DEFAULT_CONTEXT_WINDOW_TOKENS = 128000;
37
+ /** Reserved tokens for model response output. */
38
+ export declare const RESPONSE_BUFFER_TOKENS = 13000;
39
+ /** Default max output tokens per LLM API call. */
40
+ export declare const DEFAULT_MAX_OUTPUT_TOKENS = 16384;
41
+ /** Model's absolute max output tokens (escalation ceiling). */
42
+ export declare const DEFAULT_MODEL_MAX_OUTPUT_TOKENS = 65536;
43
+ /** Max max_output_tokens recovery attempts (CC: 3). */
44
+ export declare const MAX_OUTPUT_TOKENS_RECOVERY_LIMIT = 3;
45
+ /** Escalated max output tokens during recovery (CC: 64k). */
46
+ export declare const ESCALATED_MAX_OUTPUT_TOKENS = 65536;
47
+ /** Delta threshold for "diminishing returns" detection (CC: 500). */
48
+ export declare const DIMINISHING_RETURNS_THRESHOLD = 500;
49
+ /** Min consecutive continuations before diminishing returns kicks in. */
50
+ export declare const DIMINISHING_RETURNS_MIN_CONTINUATIONS = 3;
51
+ /** Per-tool result size threshold (chars) for disk persistence. */
52
+ export declare const DEFAULT_MAX_RESULT_SIZE_CHARS = 50000;
53
+ /** Per-message aggregate tool result budget (chars). */
54
+ export declare const MAX_TOOL_RESULTS_PER_MESSAGE_CHARS = 200000;
55
+ /** Preview size for persisted tool result references (bytes). */
56
+ export declare const TOOL_RESULT_PREVIEW_BYTES = 2000;
57
+ /** Heartbeat interval during persistent retry waits (ms). */
58
+ export declare const HEARTBEAT_INTERVAL_MS = 30000;
59
+ /** Max 529 errors before fallback model switch. */
60
+ export declare const MAX_529_RETRIES = 3;
61
+ /** Max consecutive API error retries before aborting. */
62
+ export declare const MAX_API_RETRIES = 2;
63
+ /** Max backoff interval for persistent retry (ms). */
64
+ export declare const PERSISTENT_RETRY_MAX_BACKOFF_MS = 300000;
65
+ /** Total retry time cap for persistent retry (ms). */
66
+ export declare const PERSISTENT_RETRY_RESET_CAP_MS = 21600000;
67
+ /** Target usage ratio after compression (0-1). */
68
+ export declare const COMPRESSION_TARGET_USAGE_RATIO = 0.75;
69
+ /** Min token budget floor after compression. */
70
+ export declare const COMPRESSION_MIN_BUDGET = 16000;
71
+ /** Max token budget ceiling. */
72
+ export declare const COMPRESSION_MAX_BUDGET = 120000;
73
+ /** Max consecutive reactive compaction failures. */
74
+ export declare const REACTIVE_COMPACT_MAX_FAILURES = 3;
75
+ /** Min messages to keep after reactive compaction. */
76
+ export declare const REACTIVE_COMPACT_MIN_MESSAGES = 4;
77
+ /** Target usage percentage for reactive compaction. */
78
+ export declare const REACTIVE_COMPACT_TARGET_PERCENT = 50;
79
+ /** Max auto-learned skills per project. */
80
+ export declare const MAX_SKILLS_PER_PROJECT = 20;
81
+ /** Max global (user-level) skills. */
82
+ export declare const MAX_SKILLS_GLOBAL = 50;
83
+ /** Min tool calls to consider a turn "complex enough" for skill creation. */
84
+ export declare const MIN_TOOL_CALLS_FOR_SKILL = 3;
85
+ /** Min distinct tools to suggest a new skill. */
86
+ export declare const MIN_DISTINCT_TOOLS_FOR_SKILL = 2;
87
+ /** Cooldown between skill creation suggestions (ms). */
88
+ export declare const SKILL_CREATION_COOLDOWN_MS: number;
89
+ /**
90
+ * Project-level pattern repetition threshold.
91
+ * The same workflow signature must appear this many times across turns/sessions
92
+ * before a skill creation is triggered. Prevents one-off complex turns from
93
+ * immediately producing skills.
94
+ */
95
+ export declare const SKILL_PATTERN_REPETITION_THRESHOLD = 3;
96
+ /**
97
+ * Max age (ms) for pattern entries. Patterns older than this are pruned.
98
+ * Default: 30 days.
99
+ */
100
+ export declare const SKILL_PATTERN_MAX_AGE_MS: number;
101
+ /** Max chars of skill content injected into system prompt. */
102
+ export declare const SKILL_INJECTION_MAX_CHARS = 4000;
103
+ /** Max skills injected into a single prompt. */
104
+ export declare const SKILL_INJECTION_MAX_COUNT = 5;
105
+ /** Max skills recalled from other projects per turn. */
106
+ export declare const SKILL_RECALL_MAX_SKILLS = 3;
107
+ /** Max chars per recalled skill content. */
108
+ export declare const SKILL_RECALL_MAX_CONTENT_CHARS = 800;
109
+ /** Skill recall index cache TTL (ms). */
110
+ export declare const SKILL_RECALL_CACHE_TTL_MS: number;
111
+ /** Max nested fork depth for sub-agents. */
112
+ export declare const MAX_FORK_DEPTH = 4;
113
+ /** Team aggregate budget (total tokens across all forked sub-agents). 0 = unlimited. */
114
+ export declare const TEAM_BUDGET_TOKENS = 0;
115
+ /** Max historical sessions retained on disk. */
116
+ export declare const MAX_SESSIONS = 50;
117
+ /** Turn count threshold for triggering task summary. */
118
+ export declare const TASK_SUMMARY_TURN_THRESHOLD = 50;
119
+ /** Interval (turns) between summary regeneration. */
120
+ export declare const TASK_SUMMARY_REGEN_INTERVAL = 30;
121
+ /** Idle duration (ms) before a group session is auto-split into a new session. Default: 1 hour. */
122
+ export declare const GROUP_SESSION_IDLE_THRESHOLD_MS: number;
123
+ /** Hard limit: max turns in a single group session before soft-split. Default: 200 turns. */
124
+ export declare const GROUP_SESSION_MAX_TURNS = 200;
125
+ /** Max include nesting depth in instruction files. */
126
+ export declare const MAX_INCLUDE_DEPTH = 5;
127
+ /** Max total chars loaded from instruction files. */
128
+ export declare const MAX_INSTRUCTION_CHARS = 40000;
129
+ /** Max single instruction file size (bytes). */
130
+ export declare const INSTRUCTIONS_MAX_FILE_SIZE: number;
131
+ /** Max total instruction directory size (bytes). */
132
+ export declare const INSTRUCTIONS_MAX_DIR_SIZE: number;
133
+ /** Max single media file download size (bytes, 500 MB). */
134
+ export declare const MEDIA_MAX_DOWNLOAD_SIZE: number;
135
+ /** Max file size for direct LLM upload (bytes, 50 MB).
136
+ * Files larger than this should be chunked or summarized before sending to LLM. */
137
+ export declare const MEDIA_MAX_UPLOAD_SIZE: number;
138
+ /** Media download timeout (ms). */
139
+ export declare const MEDIA_DOWNLOAD_TIMEOUT_MS = 300000;
140
+ /** Max retries when spawning an ACP agent process. */
141
+ export declare const ACP_MAX_SPAWN_RETRIES = 2;
142
+ /** Backoff base for agent spawn retries (ms). */
143
+ export declare const ACP_RETRY_BACKOFF_BASE = 3000;
144
+ /** Max automatic restarts after agent process crash. */
145
+ export declare const ACP_RUNTIME_RESTART_MAX = 3;
146
+ /** Backoff base for crash restarts (ms). */
147
+ export declare const ACP_RUNTIME_RESTART_BACKOFF_BASE = 5000;
148
+ /** Running task poll interval (ms). */
149
+ export declare const TASK_POLL_INTERVAL_MS = 1000;
150
+ /** How long to display stopped tasks before removal (ms). */
151
+ export declare const TASK_STOPPED_DISPLAY_MS = 3000;
152
+ /** Terminal task cleanup grace period (ms). */
153
+ export declare const TASK_PANEL_GRACE_MS = 30000;
154
+ /** Max bytes injected for session memory prefetch. */
155
+ export declare const MEMORY_PREFETCH_MAX_SESSION_BYTES: number;
156
+ /** Max results per memory recall query. */
157
+ export declare const MEMORY_PREFETCH_LIMIT_PER_RECALL = 10;
158
+ /** LRU dedup set size for surfaced memory entries. */
159
+ export declare const MEMORY_MAX_SURFACED_ENTRIES = 100;
160
+ /** Min hours between dream consolidation runs. */
161
+ export declare const DREAM_MIN_INTERVAL_HOURS = 24;
162
+ /** Min sessions before dream triggers. */
163
+ export declare const DREAM_MIN_SESSIONS = 5;
164
+ /** Dream scan throttle interval (ms). */
165
+ export declare const DREAM_SCAN_INTERVAL_MS = 600000;
166
+ /** Idle dream timer (minutes). */
167
+ export declare const IDLE_DREAM_MINUTES = 30;
168
+ /** Dream cooldown between runs (ms, 4 hours). */
169
+ export declare const DREAM_COOLDOWN_MS = 14400000;
170
+ /** Max dream run duration (ms). */
171
+ export declare const DREAM_MAX_DURATION_MS = 300000;
172
+ /**
173
+ * Full typed shape of all tunable defaults.
174
+ * Used by `config.tunables` RPC for external app visualization.
175
+ */
176
+ export interface TunableDefaults {
177
+ maxRoundsLimit: number;
178
+ defaultMaxRounds: number;
179
+ defaultTemperature: number;
180
+ maxToolBudgetCap: number;
181
+ defaultToolBudget: number;
182
+ maxConsecutiveFailures: number;
183
+ maxIdenticalCallRepeats: number;
184
+ defaultContextWindowTokens: number;
185
+ responseBufferTokens: number;
186
+ defaultMaxOutputTokens: number;
187
+ defaultModelMaxOutputTokens: number;
188
+ maxOutputTokensRecoveryLimit: number;
189
+ escalatedMaxOutputTokens: number;
190
+ diminishingReturnsThreshold: number;
191
+ diminishingReturnsMinContinuations: number;
192
+ defaultMaxResultSizeChars: number;
193
+ maxToolResultsPerMessageChars: number;
194
+ toolResultPreviewBytes: number;
195
+ heartbeatIntervalMs: number;
196
+ max529Retries: number;
197
+ maxApiRetries: number;
198
+ persistentRetryMaxBackoffMs: number;
199
+ persistentRetryResetCapMs: number;
200
+ compressionTargetUsageRatio: number;
201
+ compressionMinBudget: number;
202
+ compressionMaxBudget: number;
203
+ reactiveCompactMaxFailures: number;
204
+ reactiveCompactMinMessages: number;
205
+ reactiveCompactTargetPercent: number;
206
+ maxSkillsPerProject: number;
207
+ maxSkillsGlobal: number;
208
+ minToolCallsForSkill: number;
209
+ minDistinctToolsForSkill: number;
210
+ skillCreationCooldownMs: number;
211
+ skillInjectionMaxChars: number;
212
+ skillInjectionMaxCount: number;
213
+ skillRecallMaxSkills: number;
214
+ skillRecallMaxContentChars: number;
215
+ skillRecallCacheTtlMs: number;
216
+ maxForkDepth: number;
217
+ maxSessions: number;
218
+ taskSummaryTurnThreshold: number;
219
+ taskSummaryRegenInterval: number;
220
+ maxIncludeDepth: number;
221
+ maxInstructionChars: number;
222
+ instructionsMaxFileSize: number;
223
+ instructionsMaxDirSize: number;
224
+ mediaMaxDownloadSize: number;
225
+ mediaMaxUploadSize: number;
226
+ mediaDownloadTimeoutMs: number;
227
+ acpMaxSpawnRetries: number;
228
+ acpRetryBackoffBase: number;
229
+ acpRuntimeRestartMax: number;
230
+ acpRuntimeRestartBackoffBase: number;
231
+ taskPollIntervalMs: number;
232
+ taskStoppedDisplayMs: number;
233
+ taskPanelGraceMs: number;
234
+ memoryPrefetchMaxSessionBytes: number;
235
+ memoryPrefetchLimitPerRecall: number;
236
+ memoryMaxSurfacedEntries: number;
237
+ dreamMinIntervalHours: number;
238
+ dreamMinSessions: number;
239
+ dreamScanIntervalMs: number;
240
+ idleDreamMinutes: number;
241
+ dreamCooldownMs: number;
242
+ dreamMaxDurationMs: number;
243
+ teamBudgetTokens: number;
244
+ }
245
+ /**
246
+ * Snapshot of all current tunable values.
247
+ * Use this for RPC serialization and external app display.
248
+ */
249
+ export declare function getTunableDefaults(): TunableDefaults;
@@ -10,8 +10,8 @@
10
10
  *
11
11
  * Reference: claude-code src/services/autoDream/
12
12
  */
13
- import type { DreamTaskState, DreamTurn } from "../../orchestration/subagent/task-types.js";
14
- import type { ToolDefinition, ToolInvoker, AgentLogger, HookRegistry } from "../../agent/types.js";
13
+ import type { DreamTaskState, DreamTurn } from "../tasks/task-types.js";
14
+ import type { ToolDefinition, ToolInvoker, AgentLogger, HookRegistry, ForkedAgentRunnerFactory } from "../ports/agent-execution-contracts.js";
15
15
  import type { LLMTransport } from "@xiaozhiclaw/provider-core";
16
16
  export interface DreamTriggerConfig {
17
17
  /** Minimum hours since last consolidation. Default: 24. */
@@ -153,6 +153,8 @@ export interface DreamRunDeps {
153
153
  transport: LLMTransport;
154
154
  /** Tool invoker */
155
155
  toolInvoker: ToolInvoker;
156
+ /** Concrete agent runner factory injected by CLI/app layer. */
157
+ createAgentRunner: ForkedAgentRunnerFactory;
156
158
  /** Available tools (will be filtered by canUseDreamTool) */
157
159
  tools: ToolDefinition[];
158
160
  /** API key */
@@ -1,4 +1,4 @@
1
- import type { QMemoryCategory } from "../../skills/memory/categories.js";
1
+ import type { QMemoryCategory } from "../memory/categories.js";
2
2
  /** A memory file with its inferred category and metadata. */
3
3
  export interface CategorizedMemoryFile {
4
4
  filename: string;