qlogicagent 2.10.22 → 2.10.24

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 (263) 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/qla-executor-host.d.ts +42 -0
  151. package/dist/types/orchestration/workflow/run-checkpoint-store.d.ts +53 -0
  152. package/dist/types/orchestration/workflow/trigger-validation.d.ts +22 -0
  153. package/dist/types/orchestration/workflow/workflow-controller.d.ts +143 -0
  154. package/dist/types/orchestration/workflow/workflow-patch.d.ts +101 -0
  155. package/dist/types/orchestration/workflow/workflow-render.d.ts +41 -0
  156. package/dist/types/orchestration/workflow/workflow-runtime.d.ts +127 -0
  157. package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +83 -0
  158. package/dist/types/orchestration/workflow/workflow-store.d.ts +40 -0
  159. package/dist/types/orchestration/workflow/workflow-trigger.d.ts +14 -0
  160. package/dist/types/permissions.d.ts +2 -0
  161. package/dist/types/permissions.public-api.test.d.ts +1 -0
  162. package/dist/types/protocol/methods.d.ts +262 -11
  163. package/dist/types/{runtime/infra/acp-types.d.ts → protocol/wire/acp-agent-management.d.ts} +3 -3
  164. package/dist/types/protocol/wire/agent-methods.d.ts +15 -11
  165. package/dist/types/protocol/wire/agent-rpc.d.ts +11 -0
  166. package/dist/types/protocol/wire/chat-types.d.ts +9 -0
  167. package/dist/types/protocol/wire/gateway-rpc.d.ts +13 -0
  168. package/dist/types/protocol/wire/index.d.ts +2 -1
  169. package/dist/types/protocol/wire/notification-payloads.d.ts +18 -3
  170. package/dist/types/runtime/community/community-consent-client.d.ts +117 -0
  171. package/dist/types/runtime/community/community-consent-client.test.d.ts +1 -0
  172. package/dist/types/runtime/community/community-desensitization-red-team-cli.d.ts +7 -0
  173. package/dist/types/runtime/community/community-desensitization-red-team-cli.test.d.ts +1 -0
  174. package/dist/types/runtime/community/community-desensitization.d.ts +29 -0
  175. package/dist/types/runtime/community/community-desensitization.test.d.ts +1 -0
  176. package/dist/types/runtime/community/community-telemetry-recorder.d.ts +6 -0
  177. package/dist/types/runtime/config/tunable-defaults.d.ts +249 -0
  178. package/dist/types/runtime/execution/dream-agent.d.ts +4 -2
  179. package/dist/types/runtime/execution/dream-category-context.d.ts +1 -1
  180. package/dist/types/runtime/execution/forked-agent.d.ts +3 -1
  181. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +4 -2
  182. package/dist/types/runtime/execution/tool-eligibility.d.ts +1 -1
  183. package/dist/types/runtime/hooks/context-compression.d.ts +2 -2
  184. package/dist/types/runtime/hooks/memory-hooks.d.ts +6 -6
  185. package/dist/types/runtime/infra/acp-detector.d.ts +2 -2
  186. package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +1 -1
  187. package/dist/types/runtime/infra/acp-usage-tracker.d.ts +1 -1
  188. package/dist/types/runtime/infra/agent-config-store.d.ts +2 -2
  189. package/dist/types/runtime/infra/agent-paths.d.ts +18 -10
  190. package/dist/types/runtime/infra/agent-paths.test.d.ts +1 -0
  191. package/dist/types/runtime/infra/agent-process.d.ts +2 -2
  192. package/dist/types/runtime/infra/checkpoint-backend.d.ts +2 -2
  193. package/dist/types/runtime/infra/index.d.ts +1 -1
  194. package/dist/types/runtime/infra/llmrouter-catalog.d.ts +10 -0
  195. package/dist/types/runtime/infra/mcp-bridge.d.ts +1 -1
  196. package/dist/types/runtime/infra/model-registry.d.ts +2 -1
  197. package/dist/types/runtime/infra/profile-storage.test.d.ts +1 -0
  198. package/dist/types/runtime/infra/skill-injector.d.ts +3 -2
  199. package/dist/types/runtime/infra/skill-injector.test.d.ts +1 -0
  200. package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
  201. package/dist/types/runtime/infra/worktree-backend.d.ts +2 -2
  202. package/dist/types/runtime/memory/categories.d.ts +5 -0
  203. package/dist/types/runtime/memory/find-relevant-memories.d.ts +70 -0
  204. package/dist/types/runtime/memory/implicit-extraction.d.ts +58 -0
  205. package/dist/types/runtime/memory/recall-category-filter.d.ts +54 -0
  206. package/dist/types/runtime/pet/index.d.ts +1 -1
  207. package/dist/types/runtime/pet/pet-growth-engine.d.ts +10 -9
  208. package/dist/types/runtime/pet/pet-growth-engine.test.d.ts +1 -0
  209. package/dist/types/runtime/pet/pet-soul-service.d.ts +1 -2
  210. package/dist/types/runtime/pet/pet-soul-service.test.d.ts +1 -0
  211. package/dist/types/runtime/ports/agent-execution-contracts.d.ts +182 -0
  212. package/dist/types/runtime/ports/checkpoint-contracts.d.ts +19 -0
  213. package/dist/types/runtime/ports/index.d.ts +13 -0
  214. package/dist/types/runtime/ports/memory-provider.d.ts +146 -0
  215. package/dist/types/runtime/ports/memory-recall-source.d.ts +3 -0
  216. package/dist/types/runtime/ports/memory-writer.d.ts +21 -0
  217. package/dist/types/runtime/ports/path-service.d.ts +5 -0
  218. package/dist/types/runtime/ports/permission-contracts.d.ts +107 -0
  219. package/dist/types/runtime/ports/project-memory-store.d.ts +44 -0
  220. package/dist/types/runtime/ports/tool-call-contracts.d.ts +16 -0
  221. package/dist/types/runtime/ports/tool-contracts.d.ts +23 -0
  222. package/dist/types/runtime/ports/web-search-contracts.d.ts +17 -0
  223. package/dist/types/runtime/ports/worktree-contracts.d.ts +22 -0
  224. package/dist/types/runtime/prompt/environment-context.test.d.ts +1 -0
  225. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +19 -0
  226. package/dist/types/runtime/prompt/fresh-workspace-evidence.test.d.ts +1 -0
  227. package/dist/types/runtime/prompt/instruction-loader.d.ts +9 -3
  228. package/dist/types/runtime/prompt/instruction-loader.test.d.ts +1 -0
  229. package/dist/types/runtime/session/session-persistence.test.d.ts +1 -0
  230. package/dist/types/runtime/tasks/task-types.d.ts +146 -0
  231. package/dist/types/skills/index.d.ts +2 -2
  232. package/dist/types/skills/mcp/mcp-http-client.d.ts +2 -0
  233. package/dist/types/skills/mcp/mcp-manager.d.ts +7 -4
  234. package/dist/types/skills/mcp/mcp-stdio-client.d.ts +2 -0
  235. package/dist/types/skills/mcp/mcp-tool-metadata.d.ts +18 -0
  236. package/dist/types/skills/memory/categories.d.ts +1 -5
  237. package/dist/types/skills/memory/find-relevant-memories.d.ts +1 -70
  238. package/dist/types/skills/memory/implicit-extraction.d.ts +1 -58
  239. package/dist/types/skills/memory/local-memory-provider.d.ts +6 -10
  240. package/dist/types/skills/memory/local-store.d.ts +4 -4
  241. package/dist/types/skills/memory/memory-consolidation.d.ts +9 -1
  242. package/dist/types/skills/memory/memory-provider-factory.d.ts +2 -0
  243. package/dist/types/skills/memory/memory-tool.d.ts +4 -6
  244. package/dist/types/skills/memory/recall-category-filter.d.ts +1 -54
  245. package/dist/types/skills/permissions/community-sandbox-policy.d.ts +3 -0
  246. package/dist/types/skills/permissions/community-sandbox-red-team-cli.d.ts +7 -0
  247. package/dist/types/skills/permissions/community-sandbox-red-team.d.ts +30 -0
  248. package/dist/types/skills/permissions/hook-runner.d.ts +15 -2
  249. package/dist/types/skills/permissions/settings-watcher.d.ts +2 -0
  250. package/dist/types/skills/permissions/types.d.ts +2 -113
  251. package/dist/types/skills/portable-tool.d.ts +22 -0
  252. package/dist/types/skills/skill-system/skill-lifecycle.d.ts +5 -0
  253. package/dist/types/skills/skill-system/skill-source.d.ts +2 -148
  254. package/dist/types/skills/tool-access.d.ts +30 -0
  255. package/dist/types/skills/tools/skill-tool.d.ts +2 -10
  256. package/dist/types/skills/tools/web-search-tool.d.ts +3 -20
  257. package/dist/types/skills/tools.d.ts +1 -1
  258. package/dist/types/transport/acp-server.d.ts +1 -1
  259. package/dist/types/transport/index.d.ts +1 -0
  260. package/dist/types/transport/io-transport.d.ts +19 -0
  261. package/package.json +93 -80
  262. package/dist/types/llm/index.d.ts +0 -1
  263. /package/dist/types/{orchestration/context/context-compression.d.ts → runtime/context/context-compression-strategies.d.ts} +0 -0
@@ -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,25 +11,21 @@
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. */
30
24
  userIdPrefix?: string;
31
25
  /** Factory function to create the SQLite database instance. */
32
26
  createDatabase?: (dbPath: string) => SqliteDatabase;
27
+ /** Import legacy pre-profile memory DB into the owner profile on startup. */
28
+ migrateLegacyMemory?: boolean;
33
29
  }
34
30
  export declare class LocalMemoryProvider implements MemoryProvider {
35
31
  readonly providerId = "qmemory-local";
@@ -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>;
@@ -1,10 +1,11 @@
1
1
  import type { HookRegistry } from "../../contracts/hooks.js";
2
+ import type { ChatMessage } from "../../protocol/wire/index.js";
2
3
  import type { ToolDefinition } from "../../protocol/wire/index.js";
3
4
  import { PermissionRuleEngine } from "./rule-engine.js";
4
5
  import type { PermissionUpdate, ApprovalRequest, ApprovalResponse } from "./types.js";
5
6
  import { type ClassifierLLMCall } from "./permission-classifier.js";
6
- import type { PermissionRole } from "../../orchestration/subagent/task-types.js";
7
7
  import { DenialAuditLogger } from "./denial-audit-log.js";
8
+ export type PermissionRole = "interactive" | "coordinator" | "worker";
8
9
  export interface PermissionCheckerDeps {
9
10
  ruleEngine: PermissionRuleEngine;
10
11
  hookRegistry: HookRegistry;
@@ -27,7 +28,7 @@ export interface PermissionCheckerDeps {
27
28
  * Recent conversation messages for classifier context.
28
29
  * Called lazily when the classifier needs to run.
29
30
  */
30
- getRecentMessages?: () => import("../../agent/types.js").ChatMessage[];
31
+ getRecentMessages?: () => ChatMessage[];
31
32
  /**
32
33
  * Permission role context (CC: interactive/coordinator/worker).
33
34
  * Determines how the checker behaves:
@@ -42,6 +43,13 @@ export interface PermissionCheckerDeps {
42
43
  sessionId?: string;
43
44
  /** Getter for current turn ID (changes per turn). */
44
45
  getTurnId?: () => string;
46
+ /** Best-effort community telemetry sink for consent-gated sandbox metrics. */
47
+ communityTelemetryRecorder?: {
48
+ recordTelemetry(input: {
49
+ event: "community.sandbox.violation";
50
+ metadata?: Record<string, unknown>;
51
+ }): Promise<unknown>;
52
+ };
45
53
  }
46
54
  export declare class PermissionChecker {
47
55
  private readonly ruleEngine;
@@ -56,6 +64,9 @@ export declare class PermissionChecker {
56
64
  private readonly auditLogger;
57
65
  private readonly sessionId;
58
66
  private readonly getTurnId;
67
+ private readonly communityTelemetryRecorder;
68
+ private readonly communitySandboxTurnIds;
69
+ private readonly communitySandboxRuleEngine;
59
70
  private unregisterHook;
60
71
  /** Tool meta cache — populated from ToolDefinition[] at agent creation */
61
72
  private toolMetaCache;
@@ -78,9 +89,11 @@ export declare class PermissionChecker {
78
89
  */
79
90
  setToolMeta(tools: ToolDefinition[]): void;
80
91
  get ruleEngineRef(): PermissionRuleEngine;
92
+ private checkCommunitySandboxThenBase;
81
93
  /** Fire permission.denied hook + onDenied callback + audit log */
82
94
  private fireDenied;
83
95
  private handleResult;
96
+ private handleInteractiveApproval;
84
97
  /**
85
98
  * Worker/coordinator "ask" handler: classifier-only, no approval dialog.
86
99
  * CC pattern: headless workers never prompt users.
@@ -8,6 +8,7 @@
8
8
  * Settings file location: `.qlogicagent/settings.json` in the project root
9
9
  *
10
10
  * Watched fields:
11
+ * - permissions: PermissionConfig
11
12
  * - permissionMode: PermissionMode
12
13
  * - permissionRules: PermissionRuleEntry[]
13
14
  * - defaultBehavior: PermissionBehavior
@@ -19,6 +20,7 @@ import type { PermissionRuleEntry, PermissionMode, PermissionBehavior } from "./
19
20
  import { PermissionRuleEngine } from "./rule-engine.js";
20
21
  /** On-disk settings file schema */
21
22
  export interface SettingsFile {
23
+ permissions?: unknown;
22
24
  permissionMode?: PermissionMode;
23
25
  permissionRules?: PermissionRuleEntry[];
24
26
  defaultBehavior?: PermissionBehavior;
@@ -1,113 +1,2 @@
1
- /**
2
- * User-configurable permission modes.
3
- *
4
- * cc reference:
5
- * 'default' → normal prompting
6
- * 'bypassPermissions' → auto-accept all
7
- * 'acceptEdits' → auto-accept edits only
8
- * 'dontAsk' → auto-deny all
9
- * 'plan' → planning mode (pause execution)
10
- *
11
- * We keep the cc names for compatibility.
12
- */
13
- export type PermissionMode = "default" | "bypassPermissions" | "acceptEdits" | "dontAsk" | "plan" | "auto";
14
- export declare const PERMISSION_MODES: readonly PermissionMode[];
15
- export type PermissionBehavior = "allow" | "deny" | "ask";
16
- export type PermissionDecisionReason = {
17
- type: "rule";
18
- rule: PermissionRuleEntry;
19
- } | {
20
- type: "mode";
21
- mode: PermissionMode;
22
- } | {
23
- type: "hook";
24
- hookName: string;
25
- reason: string;
26
- } | {
27
- type: "classifier";
28
- classifier: string;
29
- reason: string;
30
- } | {
31
- type: "tool_check";
32
- reason: string;
33
- } | {
34
- type: "eligibility";
35
- reasonCodes: string[];
36
- } | {
37
- type: "sandbox";
38
- reason: string;
39
- } | {
40
- type: "other";
41
- reason: string;
42
- };
43
- export interface PermissionAllowResult {
44
- behavior: "allow";
45
- updatedInput?: Record<string, unknown>;
46
- decisionReason?: PermissionDecisionReason;
47
- }
48
- export interface PermissionAskResult {
49
- behavior: "ask";
50
- message: string;
51
- toolName: string;
52
- input?: Record<string, unknown>;
53
- suggestions?: PermissionUpdate[];
54
- decisionReason?: PermissionDecisionReason;
55
- }
56
- export interface PermissionDenyResult {
57
- behavior: "deny";
58
- message: string;
59
- decisionReason: PermissionDecisionReason;
60
- }
61
- export type PermissionResult = PermissionAllowResult | PermissionAskResult | PermissionDenyResult;
62
- export interface PermissionUpdate {
63
- /** Tool name or glob pattern */
64
- pattern: string;
65
- /** New rule to apply */
66
- behavior: PermissionBehavior;
67
- /** Human-readable description */
68
- description?: string;
69
- }
70
- export interface PermissionRuleEntry {
71
- /** Exact tool name or glob pattern */
72
- pattern: string;
73
- /** Action for matching tools */
74
- behavior: PermissionBehavior;
75
- /** Optional reason for logging/display */
76
- reason?: string;
77
- /** Source of this rule (config/user/plugin) */
78
- source?: string;
79
- }
80
- export interface PermissionConfig {
81
- /** Active permission mode */
82
- mode: PermissionMode;
83
- /** Rules evaluated in order; first match wins */
84
- rules: PermissionRuleEntry[];
85
- /** Default behavior when no rule matches */
86
- defaultBehavior: PermissionBehavior;
87
- }
88
- export interface ToolPermissionCheckInput {
89
- toolName: string;
90
- arguments?: Record<string, unknown>;
91
- /** Tool metadata from ToolDefinition.meta */
92
- meta?: {
93
- isReadOnly?: boolean;
94
- isDangerous?: boolean;
95
- requiresApproval?: boolean;
96
- parallelSafe?: boolean;
97
- };
98
- }
99
- export interface ApprovalRequest {
100
- approvalId: string;
101
- callId: string;
102
- toolName: string;
103
- arguments?: Record<string, unknown>;
104
- message: string;
105
- suggestions?: PermissionUpdate[];
106
- }
107
- export interface ApprovalResponse {
108
- approvalId: string;
109
- decision: "approved" | "denied";
110
- updatedInput?: Record<string, unknown>;
111
- /** Persistent rule to save */
112
- permissionUpdate?: PermissionUpdate;
113
- }
1
+ export { PERMISSION_MODES, } from "../../runtime/ports/permission-contracts.js";
2
+ export type { ApprovalRequest, ApprovalResponse, PermissionAllowResult, PermissionAskResult, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionDenyResult, PermissionMode, PermissionResult, PermissionRuleEntry, PermissionUpdate, ToolPermissionCheckInput, } from "../../runtime/ports/permission-contracts.js";
@@ -14,6 +14,19 @@ export interface ToolContentBlock {
14
14
  data?: string;
15
15
  mimeType?: string;
16
16
  }
17
+ export type LocaleCode = "zh-CN" | "en-US" | (string & {});
18
+ export interface LocalizedText {
19
+ /**
20
+ * Stable translation key. UI clients decide the final language.
21
+ * Backends must not localize this string.
22
+ */
23
+ key: string;
24
+ /** Safe fallback for clients that do not have the key yet. */
25
+ fallback: string;
26
+ /** Optional bundled values for offline clients. */
27
+ values?: Partial<Record<LocaleCode, string>>;
28
+ }
29
+ export type CapabilityCategory = "orchestration" | "filesystem" | "web" | "search" | "memory" | "media" | "developer" | "mcp" | "automation" | "system" | "other";
17
30
  /**
18
31
  * Result of executing a portable tool.
19
32
  */
@@ -38,6 +51,15 @@ export interface PortableTool<TParams = Record<string, unknown>> {
38
51
  name: string;
39
52
  /** Human-readable label. */
40
53
  label: string;
54
+ /**
55
+ * UI category declared by the tool registration.
56
+ * Clients must not infer this from name/description.
57
+ */
58
+ category?: CapabilityCategory;
59
+ /** UI-facing localized name. */
60
+ displayName?: LocalizedText;
61
+ /** UI-facing localized summary. The LLM-only description stays separate. */
62
+ displayDescription?: LocalizedText;
41
63
  /** Tool description shown to the LLM. */
42
64
  description: string;
43
65
  /** JSON Schema object describing the tool's parameters. */
@@ -11,6 +11,11 @@ export interface SkillLifecycleRecord {
11
11
  pinned: boolean;
12
12
  useCount: number;
13
13
  source: "learned" | "created" | "installed" | "promoted";
14
+ registryResourceId?: string;
15
+ registryVersion?: string;
16
+ registrySourceTier?: "official" | "community";
17
+ registryRiskTier?: "R0" | "R1" | "R2" | "R3";
18
+ registryEffectiveRiskTier?: "R0" | "R1" | "R2" | "R3";
14
19
  }
15
20
  export interface SkillLifecycleStore {
16
21
  version: 1;
@@ -1,77 +1,6 @@
1
- import type { SkillScanSummary } from "./skill-types.js";
2
1
  /**
3
- * Trust level for a skill based on its origin.
4
- * Higher trust = fewer restrictions.
5
- */
6
- export type TrustLevel = "builtin" | "verified" | "community" | "unknown";
7
- /**
8
- * Result of a skill security scan decision.
9
- */
10
- export type ScanVerdict = "pass" | "quarantine" | "reject";
11
- /**
12
- * A resolved skill source descriptor.
13
- */
14
- export interface SkillSourceDescriptor {
15
- /** Source type. */
16
- kind: "bundled" | "github" | "npm" | "local" | "tap";
17
- /** Human-readable identifier, e.g. "github:user/repo" or "npm:@scope/pkg". */
18
- identifier: string;
19
- /** Trust level derived from source type + verification status. */
20
- trust: TrustLevel;
21
- /** Version constraint (semver or tag). */
22
- version?: string;
23
- }
24
- /**
25
- * Result of fetching a skill from a remote source.
26
- */
27
- export interface SkillFetchResult {
28
- /** Local directory where fetched content was placed. */
29
- quarantineDir: string;
30
- /** Manifest metadata if found. */
31
- name?: string;
32
- version?: string;
33
- }
34
- /**
35
- * Dependencies for the skill fetch step.
36
- * Consumers inject actual HTTP/git/npm implementations.
37
- */
38
- export interface SkillFetchDeps {
39
- /**
40
- * Download / clone / extract a skill from its source into a quarantine dir.
41
- * Must NOT place content in the final install location.
42
- */
43
- fetch(source: SkillSourceDescriptor, quarantineDir: string): Promise<SkillFetchResult>;
44
- }
45
- /**
46
- * Dependencies for the skill storage step.
47
- * Manages the local skill directory and registry.
48
- */
49
- export interface SkillStorageDeps {
50
- /** Root directory for installed skills (e.g. ~/.xiaozhiclaw/skills/). */
51
- skillsDir: string;
52
- /** Registry subdirectory (e.g. ~/.xiaozhiclaw/skills/.registry/). */
53
- registryDir: string;
54
- /** Move content from quarantine to final location. */
55
- moveToInstallDir(quarantineDir: string, skillName: string): Promise<string>;
56
- /** Remove an installed skill directory. */
57
- removeSkill(skillName: string): Promise<void>;
58
- /** Read the registry lock file. */
59
- readLockfile(): Promise<SkillLockfile>;
60
- /** Write the registry lock file. */
61
- writeLockfile(lockfile: SkillLockfile): Promise<void>;
62
- }
63
- /**
64
- * A single version history entry for a skill.
65
- */
66
- export interface SkillVersionEntry {
67
- version: string;
68
- updatedAt: string;
69
- changelog?: string;
70
- /** Integrity hash of the SKILL.md content at this version (sha256). */
71
- integrity?: string;
72
- }
73
- /**
74
- * Usage statistics for a skill.
2
+ * Lightweight per-skill stats stored in `~/.qlogicagent/skill-stats.json`.
3
+ * Covers learned, promoted, and registry-installed skills.
75
4
  */
76
5
  export interface SkillUsageStats {
77
6
  /** Total number of times this skill has been invoked/applied. */
@@ -87,43 +16,6 @@ export interface SkillUsageStats {
87
16
  /** Derived success rate = (invokeCount - negativeCount) / invokeCount */
88
17
  successRate?: number;
89
18
  }
90
- /**
91
- * Single entry in the skill lockfile.
92
- */
93
- export interface SkillLockEntry {
94
- name: string;
95
- source: SkillSourceDescriptor;
96
- installedAt: string;
97
- scanVerdict: ScanVerdict;
98
- scanSummary?: SkillScanSummary;
99
- /** Integrity hash of the SKILL.md content (sha256). */
100
- integrity?: string;
101
- /** Current version (from frontmatter or auto-incremented). */
102
- currentVersion?: string;
103
- /** Version history — newest first. */
104
- versionHistory?: SkillVersionEntry[];
105
- /** Usage statistics. */
106
- usage?: SkillUsageStats;
107
- }
108
- /**
109
- * Complete lockfile for all installed skills.
110
- */
111
- export interface SkillLockfile {
112
- version: 1;
113
- entries: Record<string, SkillLockEntry>;
114
- }
115
- /**
116
- * Record a skill usage event. Mutates the lockfile entry in-place.
117
- */
118
- export declare function recordSkillUsage(lockfile: SkillLockfile, skillName: string, feedback?: "positive" | "negative" | null): void;
119
- /**
120
- * Record a skill version update. Pushes current version to history.
121
- */
122
- export declare function recordSkillVersionUpdate(lockfile: SkillLockfile, skillName: string, newVersion: string, changelog?: string, integrity?: string): void;
123
- /**
124
- * Lightweight per-skill stats stored in `~/.qlogicagent/skill-stats.json`.
125
- * This is independent of the lockfile — covers learned, promoted, and installed skills.
126
- */
127
19
  export interface SkillStatsFile {
128
20
  [skillName: string]: SkillUsageStats;
129
21
  }
@@ -144,41 +36,3 @@ export declare function getSkillStats(agentHome: string, skillName: string): Ski
144
36
  export declare function getAllSkillStats(agentHome: string): SkillStatsFile;
145
37
  /** Reset cache (for testing). */
146
38
  export declare function resetStatsCache(): void;
147
- /**
148
- * Result of a skill install operation.
149
- */
150
- export interface SkillInstallResult {
151
- success: boolean;
152
- name: string;
153
- installDir?: string;
154
- verdict: ScanVerdict;
155
- scanSummary?: SkillScanSummary;
156
- error?: string;
157
- }
158
- /**
159
- * Orchestrate the full install pipeline:
160
- * Fetch → Quarantine → Scan → Validate → Move → Lock
161
- *
162
- * This function is pure orchestration — actual I/O is delegated to deps.
163
- */
164
- export declare function installSkill(params: {
165
- source: SkillSourceDescriptor;
166
- fetchDeps: SkillFetchDeps;
167
- storageDeps: SkillStorageDeps;
168
- scanSkillDir: (dir: string) => Promise<SkillScanSummary>;
169
- quarantineDir: string;
170
- }): Promise<SkillInstallResult>;
171
- /**
172
- * Uninstall a skill: remove from disk + update lockfile.
173
- */
174
- export declare function uninstallSkill(params: {
175
- skillName: string;
176
- storageDeps: SkillStorageDeps;
177
- }): Promise<{
178
- success: boolean;
179
- error?: string;
180
- }>;
181
- /**
182
- * Create an empty lockfile.
183
- */
184
- export declare function createEmptyLockfile(): SkillLockfile;