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
@@ -29,6 +29,10 @@ export interface InstructionFileInfo {
29
29
  /** Glob patterns from frontmatter — file only applies when target path matches */
30
30
  globs?: string[];
31
31
  }
32
+ export interface LiteralResponseRequirement {
33
+ marker: string;
34
+ placement: "prefix" | "suffix" | "include";
35
+ }
32
36
  /**
33
37
  * Load all instruction files following CC's discovery order.
34
38
  *
@@ -49,15 +53,17 @@ export declare function loadInstructions(cwd: string, hooks?: HookRegistry): Pro
49
53
  * CC parity: getClaudeMds()
50
54
  */
51
55
  export declare function buildInstructionsPrompt(files: InstructionFileInfo[]): string;
56
+ export declare function extractLiteralResponseRequirements(files: InstructionFileInfo[]): LiteralResponseRequirement[];
57
+ export declare function applyLiteralResponseRequirements(content: string, requirements: readonly LiteralResponseRequirement[]): string;
52
58
  /**
53
59
  * Get conditional rules that match a target file path.
54
60
  * CC parity: getManagedAndUserConditionalRules() + getMemoryFilesForNestedDirectory()
55
61
  */
56
62
  export declare function getConditionalRules(cwd: string, targetPath: string): Promise<InstructionFileInfo[]>;
57
63
  /**
58
- * Load instructions with memoization.
59
- * CC parity: getMemoryFiles() with memoize.
60
- * Returns cached result if cwd hasn't changed.
64
+ * Load instructions for the current turn.
65
+ * This intentionally reloads from disk every call so instruction edits become
66
+ * visible on the next turn without depending on a filesystem watcher.
61
67
  */
62
68
  export declare function getInstructions(cwd: string, hooks?: HookRegistry): Promise<InstructionFileInfo[]>;
63
69
  /** Clear the instruction cache. Called after file changes or compaction. */
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Task Type Taxonomy — CC-aligned sub-agent task state system.
3
+ *
4
+ * CC defines 7 task types for sub-agent dispatch. Each type has different:
5
+ * - Execution model (in-process, subprocess, remote)
6
+ * - Isolation level (shared, worktree, container)
7
+ * - Permission handling (interactive, coordinator, worker)
8
+ * - Tool access (full, restricted, read-only)
9
+ *
10
+ * Reference: claude-code src/tasks/types.ts
11
+ */
12
+ /**
13
+ * The 7 task types from CC's sub-agent architecture.
14
+ *
15
+ * - local_bash: Subprocess shell execution (bash/powershell)
16
+ * - local_agent: Background forked Node process with its own tool loop
17
+ * - remote_agent: Cloud environment (polling-based, e.g., CCR sandbox)
18
+ * - in_process_teammate: Same process, AsyncLocalStorage-isolated agent
19
+ * - local_workflow: DAG/pipeline execution (planned)
20
+ * - monitor_mcp: MCP server monitoring agent (planned)
21
+ * - dream: Background memory consolidation agent
22
+ */
23
+ export type TaskType = "local_bash" | "local_agent" | "remote_agent" | "in_process_teammate" | "local_workflow" | "monitor_mcp" | "dream";
24
+ /**
25
+ * How a sub-agent is isolated from the parent execution.
26
+ *
27
+ * - shared: Same working directory, same filesystem (default fork)
28
+ * - worktree: Git worktree checkout — separate branch, merges back
29
+ * - container: Container sandbox (docker/remote)
30
+ */
31
+ export type IsolationMode = "shared" | "worktree" | "container";
32
+ /**
33
+ * Permission context for sub-agent execution.
34
+ * Determines which PermissionChecker variant is used.
35
+ *
36
+ * CC reference: 3 permission handler variants
37
+ * - interactive: User-facing agent, prompts for approval
38
+ * - coordinator: Orchestrator agent, auto-approves most non-destructive ops
39
+ * - worker: Headless worker, classifier-only (no user prompts)
40
+ */
41
+ export type PermissionRole = "interactive" | "coordinator" | "worker";
42
+ /** Common state fields shared by all task types. */
43
+ export interface TaskStateBase {
44
+ /** Unique task ID. */
45
+ taskId: string;
46
+ /** Task type discriminant. */
47
+ type: TaskType;
48
+ /** Human-readable label. */
49
+ label: string;
50
+ /** The permission role for this task's agent. */
51
+ permissionRole: PermissionRole;
52
+ /** Isolation mode. */
53
+ isolation: IsolationMode;
54
+ /** Current lifecycle state. */
55
+ lifecycle: TaskLifecycle;
56
+ /** Parent task ID (for nested sub-agents). */
57
+ parentTaskId?: string;
58
+ /** Execution depth (0 = root). */
59
+ depth: number;
60
+ /** Maximum turns before forced stop. */
61
+ maxTurns: number;
62
+ /** Token budget for this task. */
63
+ tokenBudget: number;
64
+ /** Start timestamp (ms). */
65
+ startedAt: number;
66
+ /** End timestamp (ms), set when completed/failed. */
67
+ endedAt?: number;
68
+ }
69
+ export type TaskLifecycle = "pending" | "running" | "completed" | "failed" | "cancelled" | "timeout";
70
+ /** Local bash task — subprocess shell execution. */
71
+ export interface LocalBashTaskState extends TaskStateBase {
72
+ type: "local_bash";
73
+ command: string;
74
+ cwd: string;
75
+ pid?: number;
76
+ }
77
+ /** Local agent task — forked agent with its own tool loop. */
78
+ export interface LocalAgentTaskState extends TaskStateBase {
79
+ type: "local_agent";
80
+ agentName: string;
81
+ systemPrompt: string;
82
+ /** Restricted tool set (empty = inherit parent). */
83
+ allowedTools: string[];
84
+ /** Worktree branch name (if isolation === "worktree"). */
85
+ worktreeBranch?: string;
86
+ }
87
+ /** Remote agent task — cloud sandbox execution. */
88
+ export interface RemoteAgentTaskState extends TaskStateBase {
89
+ type: "remote_agent";
90
+ /** Remote session/environment ID. */
91
+ remoteSessionId: string;
92
+ /** Polling endpoint for status checks. */
93
+ pollEndpoint?: string;
94
+ }
95
+ /** In-process teammate — AsyncLocalStorage-isolated, same process. */
96
+ export interface InProcessTeammateTaskState extends TaskStateBase {
97
+ type: "in_process_teammate";
98
+ teamName: string;
99
+ agentName: string;
100
+ /** Teammate's independent permission mode. */
101
+ permissionMode: string;
102
+ /** Async mailbox for coordinator ↔ worker communication. */
103
+ mailboxId?: string;
104
+ /** Isolated git worktree path for this teammate (CC team worktree parity). */
105
+ worktreePath?: string;
106
+ /** Worktree branch name (for cleanup). */
107
+ worktreeBranch?: string;
108
+ }
109
+ /** A single dream agent turn — text output + tool use count. */
110
+ export interface DreamTurn {
111
+ text: string;
112
+ toolUseCount: number;
113
+ }
114
+ /** Dream phase lifecycle — CC alignment. */
115
+ export type DreamPhase = "starting" | "updating" | "completed" | "failed";
116
+ /** Dream task — background memory consolidation agent (CC autoDream parity). */
117
+ export interface DreamTaskState extends TaskStateBase {
118
+ type: "dream";
119
+ sessionId: string;
120
+ /** Current dream phase. */
121
+ phase: DreamPhase;
122
+ /** Number of sessions being reviewed. */
123
+ sessionsReviewing: number;
124
+ /** Memory files touched by the dream agent. */
125
+ filesTouched: string[];
126
+ /** Dream agent turn history (capped). */
127
+ turns: DreamTurn[];
128
+ /** Stashed lock mtime for rollback on failure. */
129
+ priorLockMtime: number;
130
+ }
131
+ /** Placeholder for planned task types. */
132
+ export interface PlannedTaskState extends TaskStateBase {
133
+ type: "local_workflow" | "monitor_mcp";
134
+ }
135
+ /** Union of all concrete task states. */
136
+ export type TaskState = LocalBashTaskState | LocalAgentTaskState | RemoteAgentTaskState | InProcessTeammateTaskState | DreamTaskState | PlannedTaskState;
137
+ /**
138
+ * Filter available tools by permission role.
139
+ *
140
+ * @param role - The agent's permission role
141
+ * @param availableTools - Full set of tool names
142
+ * @returns Filtered tool names appropriate for the role
143
+ */
144
+ export declare function filterToolsByRole(role: PermissionRole, availableTools: string[]): string[];
145
+ /** Create a new task state with defaults populated. */
146
+ export declare function createTaskState(overrides: Pick<TaskStateBase, "taskId" | "type" | "label"> & Partial<TaskStateBase>): TaskStateBase;
@@ -95,8 +95,8 @@ export { parseFrontmatter, resolveSkillMetadata, resolveSkillInvocationPolicy, r
95
95
  export { loadSkillEntries, filterSkillEntries, buildSkillSnapshot, } from "./skill-system/skill-loader.js";
96
96
  export { scanSource, scanSkillDirectory, hasCriticalFindings, isScannable, } from "./skill-system/skill-guard.js";
97
97
  export type { SkillGuardDeps } from "./skill-system/skill-guard.js";
98
- export { installSkill, uninstallSkill, createEmptyLockfile, } from "./skill-system/skill-source.js";
99
- export type { TrustLevel, ScanVerdict, SkillSourceDescriptor, SkillFetchResult, SkillFetchDeps, SkillStorageDeps, SkillLockEntry, SkillLockfile, SkillInstallResult, } from "./skill-system/skill-source.js";
98
+ export { trackSkillInvocation, getSkillStats, getAllSkillStats, resetStatsCache, } from "./skill-system/skill-source.js";
99
+ export type { SkillStatsFile, SkillUsageStats, } from "./skill-system/skill-source.js";
100
100
  export { loadLifecycleStore, saveLifecycleStore, ensureRecord, recordInvocation, recordView, recordPatch, removeRecord, pinSkill, unpinSkill, runCurator, executeCuratorCycle, archiveSkillOnDisk, unarchiveSkillOnDisk, getSkillsByState, getLifecycleRecord, } from "./skill-system/skill-lifecycle.js";
101
101
  export type { SkillLifecycleState, SkillLifecycleRecord, SkillLifecycleStore, CuratorResult, } from "./skill-system/skill-lifecycle.js";
102
102
  export { validateSkillContent, generateSkillContent, autoFixFrontmatter, } from "./skill-system/skill-validation.js";
@@ -1,8 +1,10 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
+ import { type McpToolAnnotations } from "./mcp-tool-metadata.js";
2
3
  interface McpToolSchema {
3
4
  name: string;
4
5
  description?: string;
5
6
  inputSchema?: Record<string, unknown>;
7
+ annotations?: McpToolAnnotations;
6
8
  }
7
9
  interface McpToolCallResult {
8
10
  content: Array<{
@@ -23,6 +23,8 @@ export interface McpServerEntry {
23
23
  args?: string[];
24
24
  /** Extra environment variables (stdio only) */
25
25
  env?: Record<string, string>;
26
+ /** Working directory for stdio MCP subprocesses */
27
+ cwd?: string;
26
28
  /** HTTP endpoint URL (http only) */
27
29
  url?: string;
28
30
  /** Extra HTTP headers (http only) */
@@ -38,11 +40,14 @@ export interface McpManagerConfig {
38
40
  info(msg: string): void;
39
41
  warn(msg: string): void;
40
42
  };
43
+ /** Active workspace boundary for local-path arguments passed into MCP tools. */
44
+ workspaceRoot?: string;
41
45
  }
42
46
  export declare class McpManager {
43
47
  private clients;
44
48
  private injected;
45
49
  private log;
50
+ private workspaceRoot?;
46
51
  constructor(config: McpManagerConfig);
47
52
  /**
48
53
  * Connect to all configured MCP servers. Failures are logged but don't block.
@@ -74,10 +79,8 @@ export declare class McpManager {
74
79
  * Read a resource from a specific MCP server by URI.
75
80
  */
76
81
  readResource(serverName: string, uri: string): Promise<McpResourceContent[]>;
82
+ private wrapToolsForWorkspaceBoundary;
77
83
  private reinjectTools;
78
84
  }
79
- /**
80
- * Parse MCP server configs from a JSON structure (mcp.json format).
81
- * Compatible with Claude Code's mcp_servers.json structure.
82
- */
85
+ export declare function validateMcpToolWorkspaceBoundary(toolName: string, args: unknown, workspaceRoot: string | undefined): string | null;
83
86
  export declare function parseMcpConfig(json: unknown): McpServerEntry[];
@@ -1,8 +1,10 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
+ import { type McpToolAnnotations } from "./mcp-tool-metadata.js";
2
3
  interface McpToolSchema {
3
4
  name: string;
4
5
  description?: string;
5
6
  inputSchema?: Record<string, unknown>;
7
+ annotations?: McpToolAnnotations;
6
8
  }
7
9
  interface McpToolCallResult {
8
10
  content: Array<{
@@ -0,0 +1,18 @@
1
+ export interface McpToolAnnotations {
2
+ readOnlyHint?: boolean;
3
+ destructiveHint?: boolean;
4
+ idempotentHint?: boolean;
5
+ openWorldHint?: boolean;
6
+ title?: string;
7
+ }
8
+ export interface McpToolMetadataInput {
9
+ name: string;
10
+ description?: string;
11
+ annotations?: McpToolAnnotations;
12
+ }
13
+ export interface McpPortableToolTraits {
14
+ isReadOnly: boolean;
15
+ isConcurrencySafe: boolean;
16
+ isDestructive: boolean;
17
+ }
18
+ export declare function deriveMcpPortableToolTraits(tool: McpToolMetadataInput): McpPortableToolTraits;
@@ -1,5 +1 @@
1
- /**
2
- * Memory categories for QMemory writes.
3
- * Each has different value thresholds and retention policies.
4
- */
5
- export type QMemoryCategory = "lesson" | "preference" | "pattern" | "fact" | "decision" | "skill-learning";
1
+ export type { QMemoryCategory } from "../../runtime/memory/categories.js";
@@ -1,70 +1 @@
1
- export declare const RELEVANT_MEMORIES_CONFIG: {
2
- /** Max topic files to consider during scan. */
3
- readonly MAX_SCAN_FILES: 100;
4
- /** Max files to surface per turn. */
5
- readonly MAX_SELECTED: 5;
6
- /** Max bytes per surfaced file (CC: 4096). */
7
- readonly MAX_FILE_BYTES: 4096;
8
- /** Max total bytes for all surfaced files combined. */
9
- readonly MAX_TOTAL_BYTES: number;
10
- /** Minimum score to be selected (0.0-1.0). */
11
- readonly MIN_SCORE: 0.2;
12
- /** Lines to read for header/description extraction. */
13
- readonly HEADER_LINES: 10;
14
- /** Recency boost: files modified within this many days get a bonus. */
15
- readonly RECENCY_DAYS: 7;
16
- /** Recency boost amount. */
17
- readonly RECENCY_BOOST: 0.15;
18
- };
19
- /** Scanned memory file header (CC MemoryHeader parity). */
20
- export interface MemoryFileHeader {
21
- /** Filename (e.g. "lesson-docker.md") */
22
- filename: string;
23
- /** Absolute path */
24
- filePath: string;
25
- /** Last modified timestamp (ms since epoch) */
26
- mtimeMs: number;
27
- /** File size in bytes */
28
- sizeBytes: number;
29
- /** Description extracted from first non-heading line */
30
- description: string | null;
31
- /** Category inferred from filename prefix */
32
- category: string | null;
33
- }
34
- /** A selected relevant memory with content loaded. */
35
- export interface RelevantMemory {
36
- /** Filename */
37
- filename: string;
38
- /** Full file path */
39
- filePath: string;
40
- /** Last modified timestamp */
41
- mtimeMs: number;
42
- /** Relevance score (0.0 - 1.0) */
43
- score: number;
44
- /** Content (possibly truncated) */
45
- content: string;
46
- /** Whether content was truncated */
47
- truncated: boolean;
48
- }
49
- /**
50
- * Find memory files relevant to a user query.
51
- *
52
- * CC parity: scans topic files, scores by keyword + filename + recency,
53
- * selects top-N, loads content. No LLM needed (unlike CC's Sonnet call).
54
- *
55
- * @param query - User query text
56
- * @param memoryDir - Root of the MEMDIR directory (~/.qlogicagent/memory/)
57
- * @param alreadySurfaced - Paths already shown in prior turns (for dedup)
58
- * @returns Relevant memories with content, sorted by score
59
- */
60
- export declare function findRelevantMemories(query: string, memoryDir: string, alreadySurfaced?: ReadonlySet<string>): Promise<RelevantMemory[]>;
61
- /**
62
- * Scan memory directory for topic files (excludes INDEX.md).
63
- * Returns headers sorted by modification time (newest first).
64
- */
65
- export declare function scanMemoryHeaders(memoryDir: string): Promise<MemoryFileHeader[]>;
66
- /**
67
- * Format relevant memories as a single block for system prompt injection.
68
- * CC parity: includes freshness header per file.
69
- */
70
- export declare function formatRelevantMemoriesBlock(memories: RelevantMemory[]): string;
1
+ export * from "../../runtime/memory/find-relevant-memories.js";
@@ -1,58 +1 @@
1
- /**
2
- * Implicit Memory Extraction — CC extractMemories lightweight port.
3
- *
4
- * Architecture:
5
- * Layer 1: Zero-cost signal detection (regex) — decides if turn has extractable content
6
- * Layer 2: Lightweight LLM pass (async, non-blocking) — extracts structured facts
7
- *
8
- * This runs AFTER turn.end, so the user already has their response.
9
- * Layer 2 only fires for ~10-20% of turns (those with detectable signals).
10
- *
11
- * Reference: claude-code src/services/extractMemories/extractMemories.ts
12
- */
13
- import type { LocalMemoryProvider } from "./local-memory-provider.js";
14
- export interface ExtractedFact {
15
- text: string;
16
- category: "personal_fact" | "preference" | "event" | "lesson" | "pattern" | "decision";
17
- importance: number;
18
- eventDate?: string;
19
- }
20
- export interface ImplicitExtractionDeps {
21
- /** Local memory provider for writing extracted facts. */
22
- localProvider: LocalMemoryProvider;
23
- /** User ID. */
24
- userId: string;
25
- /** Logger. */
26
- log: {
27
- debug(msg: string): void;
28
- warn(msg: string): void;
29
- };
30
- /**
31
- * LLM invocation function (uses background/cheap model).
32
- * Returns structured JSON string or null if unavailable.
33
- */
34
- llmExtract?: (prompt: string) => Promise<string | null>;
35
- }
36
- export interface TurnPair {
37
- userMessage: string;
38
- assistantMessage: string;
39
- }
40
- /**
41
- * Layer 1: Detect if a user message contains signals worth extracting.
42
- * Zero LLM cost — pure regex scanning.
43
- *
44
- * @returns true if the message likely contains extractable personal facts/events
45
- */
46
- export declare function hasExtractionSignal(userMessage: string): boolean;
47
- /**
48
- * Layer 2: Use a lightweight LLM to extract structured facts from a turn pair.
49
- * Only called when Layer 1 signals are detected.
50
- */
51
- export declare function extractFactsViaLlm(turn: TurnPair, llmExtract: (prompt: string) => Promise<string | null>, today: string): Promise<ExtractedFact[]>;
52
- /**
53
- * Run the full implicit extraction pipeline for a completed turn.
54
- * This is async and non-blocking — call it after turn.end.
55
- *
56
- * @returns Number of facts extracted and stored
57
- */
58
- export declare function runImplicitExtraction(turn: TurnPair, deps: ImplicitExtractionDeps): Promise<number>;
1
+ export * from "../../runtime/memory/implicit-extraction.js";
@@ -11,19 +11,13 @@
11
11
  import type { MemoryProvider, MemorySearchResult, MemorySearchOptions, MemoryIngestMessage, MemoryIngestOptions } from "../../protocol/wire/index.js";
12
12
  import type { MemoryClaimRecord, MemoryConflictRecord, MemoryUpdateInput, SqliteDatabase } from "./local-store.js";
13
13
  import { type LocalEmbeddingConfig } from "./local-embedding.js";
14
- import { type MemoryConsolidationResult } from "./memory-consolidation.js";
15
- /** A pre-extracted memory item ready to be stored (no LLM needed). */
16
- export interface ExtractedMemoryItem {
17
- text: string;
18
- category?: string;
19
- importance?: number;
20
- speaker?: string;
21
- event_date?: string;
22
- tags?: string[];
23
- }
14
+ import { type ExtractedMemoryItem, type MemoryConsolidationResult } from "./memory-consolidation.js";
15
+ export type { ExtractedMemoryItem } from "./memory-consolidation.js";
24
16
  export interface LocalMemoryProviderConfig {
25
17
  /** Not used for L2 vector memory (always global). Kept for interface compat. */
26
18
  projectRoot?: string;
19
+ /** Active owner profile. Determines the physical SQLite database location. */
20
+ ownerUserId?: string;
27
21
  /** Embedding configuration. If omitted, uses FTS-only search. */
28
22
  embedding?: LocalEmbeddingConfig;
29
23
  /** User ID prefix for multi-tenant isolation. */
@@ -5,8 +5,7 @@
5
5
  * Uses better-sqlite3 for synchronous, fast, single-file persistence.
6
6
  *
7
7
  * Storage location:
8
- * <project>/.qlogicagent/memory/memories.db (project-level)
9
- * ~/.qlogicagent/memory/memories.db (user-level fallback)
8
+ * ~/.qlogicagent/profiles/<owner_user_id>/memory/memories.db
10
9
  *
11
10
  * Schema:
12
11
  * - memories: core fact storage with optional embedding blob
@@ -420,6 +419,7 @@ export declare class LocalMemoryStore {
420
419
  }
421
420
  /**
422
421
  * Resolve the database file path for L2 vector memory storage.
423
- * L2 vector memory is GLOBAL (cross-project knowledge), stored at ~/.qlogicagent/memory/.
422
+ * L2 vector memory is cross-project for one owner, but physically isolated by
423
+ * profile at ~/.qlogicagent/profiles/<owner_user_id>/memory/.
424
424
  */
425
- export declare function resolveMemoryDbPath(): string;
425
+ export declare function resolveMemoryDbPath(ownerUserId?: string): string;
@@ -1,5 +1,13 @@
1
1
  import { LocalMemoryStore } from "./local-store.js";
2
- import type { ExtractedMemoryItem } from "./local-memory-provider.js";
2
+ /** A pre-extracted memory item ready to be stored (no LLM needed). */
3
+ export interface ExtractedMemoryItem {
4
+ text: string;
5
+ category?: string;
6
+ importance?: number;
7
+ speaker?: string;
8
+ event_date?: string;
9
+ tags?: string[];
10
+ }
3
11
  export interface MemoryConsolidationOptions {
4
12
  source?: string;
5
13
  sessionId?: string;
@@ -9,6 +9,8 @@ import type { LocalMemoryProvider } from "./local-memory-provider.js";
9
9
  export interface MemoryProviderFactoryConfig {
10
10
  /** Not used for L2 vector DB (always global). Kept for config compat. */
11
11
  projectRoot?: string;
12
+ /** Active owner profile. All local memory files are physically scoped here. */
13
+ ownerUserId: string;
12
14
  /** User ID prefix. */
13
15
  userIdPrefix?: string;
14
16
  /** Embedding config for local provider. */
@@ -1,6 +1,4 @@
1
- import type { MemoryProvider, MemorySearchResult } from "../../protocol/wire/index.js";
2
- import type { LocalMemoryProvider } from "./local-memory-provider.js";
3
- import type { Memdir } from "./memdir.js";
1
+ import type { MemoryProvider, MemorySearchResult, MemoryToolLocalProvider, ProjectMemoryStore } from "../../runtime/ports/index.js";
4
2
  export declare const MEMORY_TOOL_NAME: "memory";
5
3
  export declare const MEMORY_TOOL_LABEL = "Memory";
6
4
  export declare const MEMORY_TOOL_ACTIONS: readonly ["add", "replace", "remove", "create_file", "write_file", "read_file", "delete_file", "list_files", "search", "remember", "temporal", "feedback"];
@@ -78,10 +76,10 @@ export interface MemoryToolResult {
78
76
  results?: MemorySearchResult[];
79
77
  }
80
78
  export interface MemoryToolExecutorDeps {
81
- memdir: Memdir;
79
+ memdir: ProjectMemoryStore;
82
80
  provider?: MemoryProvider;
83
- /** LocalMemoryProvider for temporal/feedback (typed narrow for advanced ops). */
84
- localProvider?: LocalMemoryProvider;
81
+ /** Runtime memory provider for temporal/feedback (typed narrow for advanced ops). */
82
+ localProvider?: MemoryToolLocalProvider;
85
83
  userId: string;
86
84
  }
87
85
  export declare function executeMemoryTool(params: MemoryToolParams, deps: MemoryToolExecutorDeps): Promise<MemoryToolResult>;
@@ -1,54 +1 @@
1
- import type { QMemoryCategory } from "./categories.js";
2
- /** Detected query scenario with preferred categories. */
3
- export interface RecallCategoryHint {
4
- /** Detected scenario label. */
5
- scenario: QueryScenario;
6
- /** Preferred categories for this scenario (ordered by priority). */
7
- preferred: QMemoryCategory[];
8
- /** Categories to deprioritize (still recalled but scored lower). */
9
- deprioritized: QMemoryCategory[];
10
- /** Confidence of scenario detection (0.0-1.0). */
11
- confidence: number;
12
- }
13
- /** Known query scenarios. */
14
- export type QueryScenario = "coding" | "config" | "conversation" | "learning" | "decision" | "general";
15
- /**
16
- * Detect the query scenario and return category preferences.
17
- *
18
- * Uses pattern matching on the user query to infer intent.
19
- * Returns "general" (no filtering) when confidence is below threshold.
20
- *
21
- * @param query - User query text
22
- * @returns Category hint with preferred/deprioritized categories
23
- */
24
- export declare function detectRecallCategories(query: string): RecallCategoryHint;
25
- /**
26
- * Apply category boost/penalty to a recall score.
27
- *
28
- * Used by recall hooks to adjust memory scores based on category alignment.
29
- *
30
- * @param baseScore - Original relevance score (0.0-1.0)
31
- * @param memoryCategory - Category of the memory entry (if known)
32
- * @param hint - Category hint from detectRecallCategories()
33
- * @returns Adjusted score
34
- */
35
- export declare function applyCategoryBoost(baseScore: number, memoryCategory: string | undefined | null, hint: RecallCategoryHint): number;
36
- /**
37
- * Filter and re-rank a list of recalled memories based on category preferences.
38
- *
39
- * @param memories - Raw recalled memories with optional category
40
- * @param hint - Category hint from detectRecallCategories()
41
- * @param minScore - Minimum adjusted score to keep (default: 0)
42
- * @returns Re-ranked memories (highest adjusted score first)
43
- */
44
- export declare function filterByCategory<T extends {
45
- score?: number;
46
- category?: string | null;
47
- }>(memories: T[], hint: RecallCategoryHint, minScore?: number): T[];
48
- /**
49
- * Infer memory category from filename prefix convention.
50
- * E.g. "lesson-docker.md" → "lesson", "fact-ports.md" → "fact"
51
- *
52
- * Exported for use by recall hooks.
53
- */
54
- export declare function inferCategoryFromFilename(filename: string): QMemoryCategory | null;
1
+ export * from "../../runtime/memory/recall-category-filter.js";
@@ -0,0 +1,3 @@
1
+ import type { PermissionRuleEntry } from "./types.js";
2
+ export type CommunitySandboxRuleId = "community-l1-shell" | "community-l1-file-read" | "community-l1-file-write" | "community-l1-network" | "community-l1-mcp" | "community-l1-host-control" | "community-l2-host-side-effect" | "community-l2-data-egress" | "community-l2-provider-prompt-egress" | "community-l2-provider-media-egress";
3
+ export declare function createCommunityL1SandboxRules(): PermissionRuleEntry[];
@@ -0,0 +1,7 @@
1
+ export interface CommunitySandboxRedTeamCliDeps {
2
+ log?: {
3
+ info(message: string): void;
4
+ error(message: string): void;
5
+ };
6
+ }
7
+ export declare function runCommunitySandboxRedTeamCli(argv?: string[], deps?: CommunitySandboxRedTeamCliDeps): Promise<number>;
@@ -0,0 +1,30 @@
1
+ export type CommunitySandboxRedTeamFinding = "community-sandbox:shell-exec" | "community-sandbox:file-read" | "community-sandbox:file-write" | "community-sandbox:network-egress" | "community-sandbox:mcp-call" | "community-sandbox:host-side-effect" | "community-sandbox:data-egress" | "community-sandbox:provider-prompt-egress" | "community-sandbox:provider-media-egress";
2
+ export interface CommunitySandboxRedTeamCase {
3
+ id: string;
4
+ expectedFinding: CommunitySandboxRedTeamFinding;
5
+ toolName: string;
6
+ arguments?: Record<string, unknown>;
7
+ }
8
+ export interface CommunitySandboxRedTeamReport {
9
+ suite: "sandbox";
10
+ generatedAt: string;
11
+ cases: number;
12
+ passed: boolean;
13
+ failures: number;
14
+ telemetryEvents: number;
15
+ approvalRequests: number;
16
+ breakdown: Record<CommunitySandboxRedTeamFinding, {
17
+ cases: number;
18
+ failures: number;
19
+ }>;
20
+ failureDetails: Array<{
21
+ id: string;
22
+ expectedFinding: CommunitySandboxRedTeamFinding;
23
+ action: "continue" | "abort" | "skip" | "prevent";
24
+ reason?: string;
25
+ telemetryRecorded: boolean;
26
+ approvalRecorded: boolean;
27
+ }>;
28
+ }
29
+ export declare function buildCommunitySandboxRedTeamCases(): CommunitySandboxRedTeamCase[];
30
+ export declare function runCommunitySandboxRedTeam(cases?: CommunitySandboxRedTeamCase[]): Promise<CommunitySandboxRedTeamReport>;