@wrongstack/core 0.313.1 → 0.316.2

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 (290) hide show
  1. package/dist/chronicle/index.js +31 -31
  2. package/dist/chronicle/legacy-journal-import.d.ts +0 -6
  3. package/dist/chronicle/metrics-ingest.d.ts +14 -0
  4. package/dist/chronicle/metrics-schema.d.ts +10 -1
  5. package/dist/chronicle/metrics-store.d.ts +20 -2
  6. package/dist/chronicle/project-server.js +39 -31
  7. package/dist/chronicle/sink.d.ts +13 -0
  8. package/dist/chronicle/sqlite-journal.d.ts +20 -2
  9. package/dist/{chunk-WOEZV3Q4.js → chunk-25LSLC3G.js} +2 -1
  10. package/dist/{chunk-AI4LLQ2U.js → chunk-27QIURLN.js} +229 -12
  11. package/dist/{chunk-I45KAW2N.js → chunk-3AGWVSS7.js} +38 -450
  12. package/dist/chunk-3BDV7RL3.js +211 -0
  13. package/dist/{chunk-NFAYHPRH.js → chunk-3ECENVHL.js} +10 -8
  14. package/dist/{chunk-FW5LDDMJ.js → chunk-45WI72ZB.js} +1576 -1156
  15. package/dist/{chunk-AT4V4XGI.js → chunk-4BMVPOHO.js} +539 -313
  16. package/dist/{chunk-YBUJCZ57.js → chunk-4I7HGVVA.js} +17 -5
  17. package/dist/{chunk-JVGPR3TS.js → chunk-4LCZVJVF.js} +7 -55
  18. package/dist/{chunk-4ZHTKJHM.js → chunk-4SJNS7OB.js} +36 -2
  19. package/dist/{chunk-AD7ZFZCS.js → chunk-5BMIE7QG.js} +3 -3
  20. package/dist/{chunk-IQ35HMQL.js → chunk-5YPSXQXM.js} +71 -24
  21. package/dist/chunk-6FHWXLPT.js +10 -0
  22. package/dist/{chunk-FIV4IJL7.js → chunk-6H5GEOET.js} +163 -20
  23. package/dist/{chunk-VB3H5WWB.js → chunk-6NWEVFEL.js} +2 -2
  24. package/dist/{chunk-E6I5RXVK.js → chunk-AYW5YINX.js} +2 -2
  25. package/dist/{chunk-DEIQMBD2.js → chunk-B7F4WVP4.js} +2 -2
  26. package/dist/{chunk-XQ2XGIBF.js → chunk-BPBKKBUK.js} +6 -7
  27. package/dist/{chunk-K4YUNKU7.js → chunk-BYD345OX.js} +2 -2
  28. package/dist/{chunk-LZDDLNCZ.js → chunk-C27KDLOX.js} +4 -4
  29. package/dist/{chunk-6AKOTGLM.js → chunk-CU546ESW.js} +7 -7
  30. package/dist/{chunk-ZZ4V3WIZ.js → chunk-DLHHXUAM.js} +10 -1
  31. package/dist/{chunk-BAKVJLEV.js → chunk-DOTHQSJ2.js} +28 -16
  32. package/dist/{chunk-KBZGE6LN.js → chunk-DYLPMV4Q.js} +4 -3
  33. package/dist/{chunk-52RTVH4M.js → chunk-F3JWNST7.js} +2 -2
  34. package/dist/{chunk-WEBMSQP2.js → chunk-FC2ZGRF3.js} +21 -4
  35. package/dist/{chunk-FHAMQS7Q.js → chunk-FCBTO76Z.js} +76 -146
  36. package/dist/{chunk-4LJJYBAU.js → chunk-FHZVFYSL.js} +9 -1
  37. package/dist/{chunk-W4A6QA3D.js → chunk-FWNLEZYG.js} +4 -3
  38. package/dist/{chunk-OJZEX73F.js → chunk-GDQ7CZRQ.js} +5 -1
  39. package/dist/{chunk-QVOVMXJR.js → chunk-GJJGJB2R.js} +32 -9
  40. package/dist/{chunk-4XV6IR37.js → chunk-HI3JGZR2.js} +7 -6
  41. package/dist/{chunk-FSWCWSTS.js → chunk-HMLIGAU7.js} +26 -26
  42. package/dist/{chunk-PFXFQQRT.js → chunk-HXKZ7OBQ.js} +7 -43
  43. package/dist/{chunk-2FQL4PDC.js → chunk-I7DALG7J.js} +5 -5
  44. package/dist/{chunk-GM54GJBU.js → chunk-IRUTEHCE.js} +3 -3
  45. package/dist/{chunk-TYW2GI5I.js → chunk-J2WRWR37.js} +40 -13
  46. package/dist/{chunk-ZEHUCJHY.js → chunk-JFPJ6LLQ.js} +2 -2
  47. package/dist/chunk-JMULFFLN.js +9 -0
  48. package/dist/{chunk-RD6DEE36.js → chunk-JO4MGB6Z.js} +94 -8
  49. package/dist/{chunk-5DSMEVA4.js → chunk-K6BXGITA.js} +7 -7
  50. package/dist/{chunk-O74MJHXU.js → chunk-KZMSZV32.js} +2 -2
  51. package/dist/{chunk-GFJOMSHG.js → chunk-LA7CLDRW.js} +6 -2
  52. package/dist/{chunk-M2WF6AXG.js → chunk-LSMMOS2Z.js} +7 -3
  53. package/dist/{chunk-ASX6AW36.js → chunk-LXWCMQNJ.js} +3 -3
  54. package/dist/{chunk-WZO23AWO.js → chunk-M27LIEKV.js} +72 -22
  55. package/dist/{chunk-JTHKOYWU.js → chunk-MJPHJRAL.js} +15 -15
  56. package/dist/{chunk-G5AAKEEZ.js → chunk-MTL4O5YR.js} +5 -5
  57. package/dist/chunk-NHJ75HXY.js +1 -0
  58. package/dist/{chunk-ZYU2YOJ6.js → chunk-NIOAGFPB.js} +29 -15
  59. package/dist/{chunk-Y2GE5TSI.js → chunk-NS52ISWS.js} +2 -2
  60. package/dist/{chunk-UIWONWVG.js → chunk-NSOFPKGT.js} +541 -148
  61. package/dist/{chunk-RCQYT2I4.js → chunk-NVIZG63R.js} +2 -2
  62. package/dist/{chunk-EPC3GZD4.js → chunk-OOYZPOXM.js} +2 -2
  63. package/dist/{chunk-7ZHZE5EO.js → chunk-OSGLYW5J.js} +2 -2
  64. package/dist/{chunk-CE4ZOCOI.js → chunk-PFCMSSUF.js} +9 -9
  65. package/dist/{chunk-GFXZTHNI.js → chunk-PGRVXIMY.js} +5 -5
  66. package/dist/{chunk-JJPMWPB6.js → chunk-PISBFBJN.js} +6 -6
  67. package/dist/chunk-POOOIWE5.js +9 -0
  68. package/dist/{chunk-5RP3QTRL.js → chunk-PQNS3U7Z.js} +20 -3
  69. package/dist/{chunk-3E244UDA.js → chunk-QSTSJOCK.js} +52 -6
  70. package/dist/{chunk-YUPMXOGP.js → chunk-RFQMOKWK.js} +3 -3
  71. package/dist/chunk-RTOTNK3P.js +484 -0
  72. package/dist/{chunk-SN2DQRL6.js → chunk-RXKSDUAU.js} +7 -7
  73. package/dist/{chunk-T3KGZBU5.js → chunk-S45JPKQN.js} +189 -43
  74. package/dist/{chunk-YNCVSFGF.js → chunk-SAFHACFA.js} +4 -1
  75. package/dist/{chunk-KI4L2DUL.js → chunk-TCCHINEF.js} +114 -19
  76. package/dist/{chunk-AWNQ6ED6.js → chunk-THEGTRAG.js} +7 -2
  77. package/dist/{chunk-2KKODIQU.js → chunk-TR4LQE7L.js} +15 -15
  78. package/dist/{chunk-GPQ3NJPR.js → chunk-TWJMGXCI.js} +3 -3
  79. package/dist/{chunk-H72H4XDU.js → chunk-U45AXT5D.js} +9 -9
  80. package/dist/{chunk-62V2AFVG.js → chunk-U4FWBSO3.js} +160 -73
  81. package/dist/{chunk-A455ATZB.js → chunk-UBGDX6FI.js} +8 -1
  82. package/dist/chunk-UJILKYES.js +75 -0
  83. package/dist/{chunk-KSJ5UTP7.js → chunk-ULMAQV3T.js} +84 -4
  84. package/dist/{chunk-CB2HFKTP.js → chunk-VVBP6KGT.js} +1 -1
  85. package/dist/{chunk-RPOA7IAE.js → chunk-W5VITDM2.js} +43 -25
  86. package/dist/{chunk-QRTG4XTI.js → chunk-WAHQVNWT.js} +7 -1
  87. package/dist/{chunk-SQP64RCS.js → chunk-WGGYRBXH.js} +3019 -2976
  88. package/dist/{chunk-K3G6JBUC.js → chunk-WLYKU45P.js} +679 -141
  89. package/dist/chunk-WP7BVANJ.js +53 -0
  90. package/dist/{chunk-GAZEWQEZ.js → chunk-XF4VUMKW.js} +2 -2
  91. package/dist/{chunk-PAAWLLZX.js → chunk-Y5YXDM7D.js} +2 -2
  92. package/dist/{chunk-65RDIOR2.js → chunk-YOPAUVU4.js} +162 -44
  93. package/dist/{chunk-FFSX2QDQ.js → chunk-YPT4A46F.js} +3 -3
  94. package/dist/chunk-YWXT3JNM.js +425 -0
  95. package/dist/{chunk-EFEHDQGY.js → chunk-ZHZ2Y2DH.js} +64 -10
  96. package/dist/{chunk-CQQL4ZOQ.js → chunk-ZT7JNIGX.js} +4 -3
  97. package/dist/coordination/agent-monitor.d.ts +9 -1
  98. package/dist/coordination/agent-subagent-runner.d.ts +1 -1
  99. package/dist/coordination/agents/agent-prompts.d.ts +8 -0
  100. package/dist/coordination/agents/index.d.ts +33 -1
  101. package/dist/coordination/agents/index.js +52 -22
  102. package/dist/coordination/agents/phase3-wave1-platform.d.ts +1 -3
  103. package/dist/coordination/agents/phase3-wave2-meta.d.ts +1 -3
  104. package/dist/coordination/agents/phase8-wave3-products.d.ts +1 -3
  105. package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts +1 -3
  106. package/dist/coordination/agents/project-agent-identity.d.ts +11 -11
  107. package/dist/coordination/agents/types.d.ts +13 -2
  108. package/dist/coordination/brain-monitor.d.ts +30 -7
  109. package/dist/coordination/collab-debug.d.ts +1 -1
  110. package/dist/coordination/collab-pause.d.ts +1 -1
  111. package/dist/coordination/delegate-tool.d.ts +7 -5
  112. package/dist/coordination/director-kanban-queue-helpers.d.ts +1 -0
  113. package/dist/coordination/director-options.d.ts +7 -0
  114. package/dist/coordination/director-spawn-model.d.ts +17 -0
  115. package/dist/coordination/director-tools.d.ts +2 -2
  116. package/dist/coordination/director.d.ts +12 -0
  117. package/dist/coordination/dispatcher.d.ts +8 -0
  118. package/dist/coordination/fleet-bus.d.ts +35 -4
  119. package/dist/coordination/fleet-supervisor.d.ts +10 -2
  120. package/dist/coordination/fleet.d.ts +16 -7
  121. package/dist/coordination/index.d.ts +4 -0
  122. package/dist/coordination/index.js +86 -49
  123. package/dist/coordination/kanban-dispatch-port.d.ts +2 -2
  124. package/dist/coordination/mailbox-http-router.d.ts +4 -3
  125. package/dist/coordination/mailbox-http-validation.d.ts +1 -1
  126. package/dist/coordination/mailbox-project-server.js +15 -15
  127. package/dist/coordination/mailbox-types.d.ts +24 -6
  128. package/dist/coordination/model-tier-leader.d.ts +122 -0
  129. package/dist/coordination/model-tier.d.ts +122 -0
  130. package/dist/coordination/multi-agent-coordinator.d.ts +24 -0
  131. package/dist/coordination/origin-session.d.ts +16 -0
  132. package/dist/coordination/provider-status-tracker.d.ts +37 -5
  133. package/dist/coordination/session-note-hub.d.ts +44 -0
  134. package/dist/coordination/session-note-tool.d.ts +10 -0
  135. package/dist/core/agent.d.ts +1 -1
  136. package/dist/core/context.d.ts +22 -3
  137. package/dist/core/index.d.ts +2 -0
  138. package/dist/core/index.js +130 -38
  139. package/dist/core/request-conversation-binding.d.ts +37 -0
  140. package/dist/core/session-notes.d.ts +25 -0
  141. package/dist/core/system-prompt-builder.d.ts +11 -2
  142. package/dist/core/system-prompt-variants.d.ts +78 -0
  143. package/dist/design/index.js +3 -3
  144. package/dist/execution/auto-compaction-middleware.d.ts +11 -0
  145. package/dist/execution/autonomy-brain.d.ts +2 -1
  146. package/dist/execution/autonomy-prompt-contributor.d.ts +7 -2
  147. package/dist/execution/compaction-core.d.ts +4 -4
  148. package/dist/execution/eternal-autonomy.d.ts +1 -1
  149. package/dist/execution/index.js +138 -129
  150. package/dist/execution/model-runtime.d.ts +0 -7
  151. package/dist/execution/parallel-eternal-engine.d.ts +7 -7
  152. package/dist/extension/index.js +3 -3
  153. package/dist/goal/index.js +6 -6
  154. package/dist/hooks/index.js +3 -3
  155. package/dist/hq/index.js +14 -12
  156. package/dist/hq/persistence/event-log.d.ts +0 -1
  157. package/dist/hq/persistence.d.ts +4 -4
  158. package/dist/hq/publisher.d.ts +2 -0
  159. package/dist/index.d.ts +14 -11
  160. package/dist/index.js +728 -635
  161. package/dist/infrastructure/index.d.ts +4 -4
  162. package/dist/infrastructure/index.js +281 -260
  163. package/dist/infrastructure/token-counter.d.ts +9 -0
  164. package/dist/kernel/events/agent-events.d.ts +77 -3
  165. package/dist/kernel/events/brain-events.d.ts +12 -0
  166. package/dist/kernel/events/provider-events.d.ts +7 -1
  167. package/dist/kernel/events/session-events.d.ts +14 -0
  168. package/dist/kernel/events/tool-events.d.ts +13 -0
  169. package/dist/kernel/index.js +4 -4
  170. package/dist/mailbox-attach.d.ts +1 -1
  171. package/dist/models/index.js +10 -9
  172. package/dist/observability/event-bridge.d.ts +25 -5
  173. package/dist/observability/index.d.ts +9 -8
  174. package/dist/observability/index.js +459 -351
  175. package/dist/observability/tool-usage-source.d.ts +65 -0
  176. package/dist/plugin/index.d.ts +5 -0
  177. package/dist/plugin/index.js +66 -50
  178. package/dist/plugins/auto-review-plugin.d.ts +3 -2
  179. package/dist/plugins/review-finding-commands.d.ts +0 -8
  180. package/dist/{review-finding-store-DKAV3AS6.js → plugins/review-finding-store.js} +7 -6
  181. package/dist/plugins/review-finding-types.js +19 -0
  182. package/dist/plugins/review-report-integration.js +21 -0
  183. package/dist/{review-report-store-OWY3EC3N.js → plugins/review-report-store.js} +7 -6
  184. package/dist/plugins/review-report-types.js +13 -0
  185. package/dist/prompts/index.js +5 -5
  186. package/dist/registry/index.js +3 -3
  187. package/dist/registry/tool-registry.d.ts +59 -9
  188. package/dist/{registry-R23UBE7H.js → registry-7N4O3E7W.js} +5 -5
  189. package/dist/security/capabilities.d.ts +6 -0
  190. package/dist/security/file-permissions.d.ts +1 -1
  191. package/dist/security/index.js +47 -33
  192. package/dist/security/permission-policy.d.ts +12 -1
  193. package/dist/security/secret-scrubber.d.ts +15 -0
  194. package/dist/session-catalog/index.d.ts +1 -0
  195. package/dist/session-catalog/index.js +19 -14
  196. package/dist/session-catalog/project-server.js +30 -13
  197. package/dist/session-catalog/protocol.d.ts +32 -1
  198. package/dist/session-catalog/registry.d.ts +17 -1
  199. package/dist/session-catalog/session-agents.d.ts +56 -0
  200. package/dist/session-catalog/store-rebuild.d.ts +14 -0
  201. package/dist/session-catalog/store-schema.d.ts +26 -0
  202. package/dist/session-catalog/store.d.ts +27 -1
  203. package/dist/session-note-attach.d.ts +9 -0
  204. package/dist/skills/index.js +5 -5
  205. package/dist/statusline/index.d.ts +43 -0
  206. package/dist/statusline/index.js +102 -0
  207. package/dist/storage/board-store-port.d.ts +2 -2
  208. package/dist/storage/config-loader/in-project-policy.d.ts +29 -0
  209. package/dist/storage/config-loader.d.ts +3 -2
  210. package/dist/storage/file-session-writer.d.ts +4 -2
  211. package/dist/storage/goal-coordination.d.ts +6 -1
  212. package/dist/storage/goal-kanban.d.ts +4 -1
  213. package/dist/storage/index.d.ts +12 -4
  214. package/dist/storage/index.js +76 -61
  215. package/dist/storage/input-history-store.d.ts +2 -4
  216. package/dist/storage/memory-curator.d.ts +133 -0
  217. package/dist/storage/session-agent-attribution.d.ts +39 -0
  218. package/dist/storage/session-doctor.d.ts +109 -0
  219. package/dist/storage/session-event-bridge.d.ts +5 -7
  220. package/dist/storage/session-outcome.d.ts +42 -0
  221. package/dist/storage/session-recovery.d.ts +55 -0
  222. package/dist/storage/session-store/load-session-data.d.ts +11 -0
  223. package/dist/storage/session-store/prune-helpers.d.ts +1 -1
  224. package/dist/storage/session-store/resume-session.d.ts +0 -2
  225. package/dist/storage/session-store/types.d.ts +8 -0
  226. package/dist/storage/session-store.d.ts +3 -3
  227. package/dist/storage/session-summary-tracker.d.ts +8 -1
  228. package/dist/storage/session-write-buffer.d.ts +18 -0
  229. package/dist/storage/session-writer-truncate.d.ts +2 -0
  230. package/dist/tasking/index.js +2 -2
  231. package/dist/tools/fallback-manage-tools.d.ts +6 -4
  232. package/dist/tools/index.js +21 -21
  233. package/dist/tools/model-tier-set-tool.d.ts +66 -0
  234. package/dist/types/agent-bridge.d.ts +2 -1
  235. package/dist/types/config/mcp-features.d.ts +7 -0
  236. package/dist/types/config/model-tiers.d.ts +148 -0
  237. package/dist/types/config/root.d.ts +9 -0
  238. package/dist/types/config/tools.d.ts +73 -0
  239. package/dist/types/config.d.ts +1 -0
  240. package/dist/types/context.d.ts +2 -0
  241. package/dist/types/default-config.d.ts +6 -0
  242. package/dist/types/errors.d.ts +2 -1
  243. package/dist/types/index.d.ts +11 -9
  244. package/dist/types/index.js +25 -15
  245. package/dist/types/multi-agent.d.ts +43 -0
  246. package/dist/types/plugin.d.ts +1 -1
  247. package/dist/types/provider.d.ts +15 -0
  248. package/dist/types/runtime-capability-manifest.d.ts +1 -1
  249. package/dist/types/secret-scrubber.d.ts +15 -0
  250. package/dist/types/session-markers.d.ts +37 -10
  251. package/dist/types/session-markers.js +1 -1
  252. package/dist/types/session-timeline.d.ts +197 -0
  253. package/dist/types/session-timeline.js +12 -0
  254. package/dist/types/session.d.ts +172 -11
  255. package/dist/types/system-prompt.d.ts +27 -0
  256. package/dist/utils/config-backup.d.ts +9 -1
  257. package/dist/utils/heap-watchdog.js +2 -2
  258. package/dist/utils/index.js +50 -48
  259. package/dist/utils/message-invariants.d.ts +4 -1
  260. package/dist/utils/regex-guard.d.ts +1 -1
  261. package/dist/utils/socket-path.d.ts +1 -1
  262. package/dist/utils/token-estimate.d.ts +6 -2
  263. package/dist/utils/wstack-paths.d.ts +2 -0
  264. package/dist/wiring/proxy-rewrite.d.ts +28 -0
  265. package/dist/wiring/proxy-rewrite.js +7 -1
  266. package/dist/worktree/index.js +2 -2
  267. package/instructions/agents/explore-companion.md +45 -18
  268. package/instructions/agents/memory-curator.md +34 -22
  269. package/instructions/coordination/director-preamble.md +12 -7
  270. package/instructions/coordination/subagent-baseline.md +26 -5
  271. package/instructions/leader-after-task.md +4 -1
  272. package/instructions/llm/chimera-review.md +30 -9
  273. package/instructions/llm/memory-curator.md +31 -0
  274. package/instructions/sections/tool/delegation-compact.md +2 -0
  275. package/instructions/sections/tool/delegation-full.md +5 -1
  276. package/instructions/sections/tool/mailbox-compact.md +5 -1
  277. package/instructions/sections/tool/mailbox-full.md +3 -0
  278. package/instructions/sections/tool/session-note-compact.md +3 -0
  279. package/instructions/sections/tool/session-note-full.md +15 -0
  280. package/instructions/system-lite.md +9 -4
  281. package/instructions/system-pro.md +66 -143
  282. package/instructions/system.md +73 -175
  283. package/package.json +33 -5
  284. package/dist/chunk-2BUUIMQB.js +0 -225
  285. package/dist/chunk-FAYRX2AD.js +0 -13
  286. package/dist/chunk-H5E77KUJ.js +0 -15
  287. package/dist/chunk-M7BS2K6U.js +0 -1
  288. package/dist/coordination/agents.d.ts +0 -8
  289. package/dist/coordination/transport.d.ts +0 -2
  290. package/dist/storage/session-writer/session-writer-summary-tracker.d.ts +0 -28
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  clampSubagentCapabilities
3
- } from "./chunk-A455ATZB.js";
3
+ } from "./chunk-UBGDX6FI.js";
4
4
  import {
5
5
  inferRuntimeCapabilities,
6
6
  toolsForRuntimeCapabilities
7
- } from "./chunk-AWNQ6ED6.js";
7
+ } from "./chunk-THEGTRAG.js";
8
8
  import {
9
9
  resolveWstackPaths
10
- } from "./chunk-YNCVSFGF.js";
10
+ } from "./chunk-SAFHACFA.js";
11
11
  import {
12
12
  isTextBlock
13
13
  } from "./chunk-O37BQ65S.js";
@@ -3076,9 +3076,10 @@ function agentPrompt(id) {
3076
3076
  const policyOn = process.env["WRONGSTACK_AGENT_POLICY"] === "on";
3077
3077
  const cacheBypass = globalThis.__WS_DISABLE_PROMPT_CACHE__ === true;
3078
3078
  const promptProjectRoot = process.env["WRONGSTACK_PROJECT_ROOT"] || process.cwd();
3079
- const cacheKey = `${envDir}\0${policyOn ? 1 : 0}\0${promptProjectRoot}\0${agentOverlayFingerprint(id, promptProjectRoot)}\0${id}`;
3079
+ const cacheKey = `${envDir}\0${policyOn ? 1 : 0}\0${promptProjectRoot}\0${id}`;
3080
+ const overlayFingerprint = agentOverlayFingerprint(id, promptProjectRoot);
3080
3081
  const cached = cacheBypass ? void 0 : promptCache.get(cacheKey);
3081
- if (cached !== void 0) return cached;
3082
+ if (cached !== void 0 && cached.fingerprint === overlayFingerprint) return cached.prompt;
3082
3083
  const fileName = `${id}.md`;
3083
3084
  let resolved = "";
3084
3085
  for (const dir of agentPromptDirCandidates(envDir, promptProjectRoot)) {
@@ -3101,7 +3102,8 @@ ${policy}`;
3101
3102
  }
3102
3103
  }
3103
3104
  resolved = buildProjectContextualizedPrompt(resolved, id, promptProjectRoot);
3104
- if (!cacheBypass) promptCache.set(cacheKey, resolved);
3105
+ if (!cacheBypass)
3106
+ promptCache.set(cacheKey, { fingerprint: overlayFingerprint, prompt: resolved });
3105
3107
  return resolved;
3106
3108
  }
3107
3109
  function agentPromptDirCandidates(envDir, projectRoot) {
@@ -3749,6 +3751,7 @@ var WAVE1_AGENTS = [
3749
3751
  capability: {
3750
3752
  phase: "domain",
3751
3753
  summary: "Android platform specialist: Kotlin, Jetpack Compose, Android SDK, lifecycle and Play Store delivery.",
3754
+ rationale: ANDROID_META,
3752
3755
  keywords: [...ANDROID_META.signals, "android", "kotlin", "compose", "gradle", "playstore"]
3753
3756
  }
3754
3757
  },
@@ -3764,6 +3767,7 @@ var WAVE1_AGENTS = [
3764
3767
  capability: {
3765
3768
  phase: "domain",
3766
3769
  summary: "Desktop application specialist: Electron or Tauri, native packaging, IPC and OS integration.",
3770
+ rationale: DESKTOP_META,
3767
3771
  keywords: [...DESKTOP_META.signals, "desktop", "electron", "tauri", "ipc", "tray"]
3768
3772
  }
3769
3773
  },
@@ -3779,6 +3783,7 @@ var WAVE1_AGENTS = [
3779
3783
  capability: {
3780
3784
  phase: "verify",
3781
3785
  summary: "Realtime transport specialist: WebSocket, SSE, presence, heartbeat, reconnect and backpressure.",
3786
+ rationale: REALTIME_META,
3782
3787
  keywords: [
3783
3788
  ...REALTIME_META.signals,
3784
3789
  "realtime",
@@ -3802,6 +3807,7 @@ var WAVE1_AGENTS = [
3802
3807
  capability: {
3803
3808
  phase: "domain",
3804
3809
  summary: "Distributed-systems engineer: consistency, partitioning, idempotency, saga and coordination at the implementation level.",
3810
+ rationale: DISTRIBUTED_SYSTEMS_META,
3805
3811
  keywords: [
3806
3812
  ...DISTRIBUTED_SYSTEMS_META.signals,
3807
3813
  "distributed-systems",
@@ -3825,6 +3831,7 @@ var WAVE1_AGENTS = [
3825
3831
  capability: {
3826
3832
  phase: "build",
3827
3833
  summary: "Concurrency engineer: race conditions, locks, worker pools, async lifecycle and shared-state safety.",
3834
+ rationale: CONCURRENCY_META,
3828
3835
  keywords: [
3829
3836
  ...CONCURRENCY_META.signals,
3830
3837
  "concurrency",
@@ -3847,6 +3854,7 @@ var WAVE1_AGENTS = [
3847
3854
  capability: {
3848
3855
  phase: "delivery",
3849
3856
  summary: "Platform engineer: monorepo, build graph, internal tooling and developer experience.",
3857
+ rationale: PLATFORM_ENGINEER_META,
3850
3858
  keywords: [
3851
3859
  ...PLATFORM_ENGINEER_META.signals,
3852
3860
  "platform",
@@ -3859,15 +3867,6 @@ var WAVE1_AGENTS = [
3859
3867
  }
3860
3868
  }
3861
3869
  ];
3862
- var WAVE1_ROLE_METAS = {
3863
- android: ANDROID_META,
3864
- desktop: DESKTOP_META,
3865
- realtime: REALTIME_META,
3866
- "distributed-systems": DISTRIBUTED_SYSTEMS_META,
3867
- concurrency: CONCURRENCY_META,
3868
- "platform-engineer": PLATFORM_ENGINEER_META
3869
- };
3870
- var WAVE1_ROLES = new Set(Object.keys(WAVE1_ROLE_METAS));
3871
3870
 
3872
3871
  // src/coordination/agents/phase3-wave2-meta.ts
3873
3872
  var THREAT_MODELER_META = {
@@ -3953,84 +3952,6 @@ var PRIVACY_ENGINEER_META = {
3953
3952
  ],
3954
3953
  differentiatesFrom: "compliance audits controls; privacy-engineer implements privacy-by-design in code and pipelines."
3955
3954
  };
3956
- var PLUGIN_AUTHOR_META = {
3957
- rationale: "Builds, packages and ships runnable WrongStack plugins; plugin-author is the production counterpart to skill-manage.",
3958
- signals: [
3959
- "plugin",
3960
- "plugin api",
3961
- "lifecycle",
3962
- "health",
3963
- "teardown",
3964
- "packaging",
3965
- "distribution"
3966
- ],
3967
- differentiatesFrom: "skill-manage authors skills; plugin-author authors full lifecycle plugins with health and teardown."
3968
- };
3969
- var TOOL_AUTHOR_META = {
3970
- rationale: "Designs tool schemas, capability declarations and error contracts; tool-author is the narrow, security-focused counterpart to plugin-author.",
3971
- signals: [
3972
- "tool",
3973
- "tool schema",
3974
- "capability",
3975
- "permission",
3976
- "tool contract",
3977
- "tool error",
3978
- "tool lifecycle"
3979
- ],
3980
- differentiatesFrom: "plugin-author writes full plugin lifecycle; tool-author focuses on a single tool contract and capability set."
3981
- };
3982
- var PROMPT_EVALUATOR_META = {
3983
- rationale: "Builds rubrics and runs adversarial / regression tests on prompts; prompt-evaluator is the independent measurement counterpart to prompt.",
3984
- signals: [
3985
- "prompt eval",
3986
- "prompt regression",
3987
- "rubric",
3988
- "adversarial prompt",
3989
- "prompt benchmark",
3990
- "judge prompt",
3991
- "eval suite"
3992
- ],
3993
- differentiatesFrom: "prompt authors prompts; prompt-evaluator independently measures them with rubrics and adversarial inputs."
3994
- };
3995
- var BENCHMARK_ENGINEER_META = {
3996
- rationale: "Designs reproducible benchmarks and methodology for comparing models and agent setups; benchmark-engineer is the measurement-infrastructure counterpart to performance.",
3997
- signals: [
3998
- "benchmark",
3999
- "reproducible",
4000
- "evaluation harness",
4001
- "regression suite",
4002
- "metric methodology",
4003
- "baseline",
4004
- "deterministic run"
4005
- ],
4006
- differentiatesFrom: "performance optimizes product code; benchmark-engineer builds the measurement infrastructure that supports comparison."
4007
- };
4008
- var MEMORY_CURATOR_META = {
4009
- rationale: "Validates, merges and de-duplicates long-term memory entries with audience scope; memory-curator is the quality counterpart to context.",
4010
- signals: [
4011
- "memory",
4012
- "curate",
4013
- "memory audit",
4014
- "memory merge",
4015
- "memory expiry",
4016
- "audience scope",
4017
- "memory recall quality"
4018
- ],
4019
- differentiatesFrom: "context manages the active context window; memory-curator curates the long-term memory store for accuracy."
4020
- };
4021
- var FLEET_COORDINATOR_META = {
4022
- rationale: "Owns job partitioning, capacity and result synthesis across many workers; fleet-coordinator is the multi-agent execution counterpart to planner.",
4023
- signals: [
4024
- "fleet",
4025
- "fan out",
4026
- "parallel agents",
4027
- "synthesis",
4028
- "subagent capacity",
4029
- "coordinator",
4030
- "result aggregation"
4031
- ],
4032
- differentiatesFrom: "planner designs ordered steps for one worker; fleet-coordinator runs many workers in parallel and merges their results."
4033
- };
4034
3955
  var WAVE2_AGENTS = [
4035
3956
  {
4036
3957
  config: {
@@ -4044,6 +3965,7 @@ var WAVE2_AGENTS = [
4044
3965
  capability: {
4045
3966
  phase: "review",
4046
3967
  summary: "Models trust boundaries, abuse cases and data flow before code is written; produces a threat model with attack trees.",
3968
+ rationale: THREAT_MODELER_META,
4047
3969
  keywords: [
4048
3970
  ...THREAT_MODELER_META.signals,
4049
3971
  "threat-modeler",
@@ -4069,6 +3991,7 @@ var WAVE2_AGENTS = [
4069
3991
  capability: {
4070
3992
  phase: "review",
4071
3993
  summary: "Teaches secure patterns, produces safe defaults and walks engineers through prescriptive fixes.",
3994
+ rationale: SECURE_CODING_COACH_META,
4072
3995
  keywords: [
4073
3996
  ...SECURE_CODING_COACH_META.signals,
4074
3997
  "secure-coding",
@@ -4091,6 +4014,7 @@ var WAVE2_AGENTS = [
4091
4014
  capability: {
4092
4015
  phase: "verify",
4093
4016
  summary: "Designs retry, timeout, circuit breaker, bulkhead and graceful-degradation patterns ahead of time.",
4017
+ rationale: RESILIENCE_ENGINEER_META,
4094
4018
  keywords: [
4095
4019
  ...RESILIENCE_ENGINEER_META.signals,
4096
4020
  "resilience",
@@ -4114,6 +4038,7 @@ var WAVE2_AGENTS = [
4114
4038
  capability: {
4115
4039
  phase: "verify",
4116
4040
  summary: "Builds and runs controlled fault-injection experiments with a defined blast radius, steady state and hypothesis.",
4041
+ rationale: CHAOS_ENGINEER_META,
4117
4042
  keywords: [
4118
4043
  ...CHAOS_ENGINEER_META.signals,
4119
4044
  "chaos-engineer",
@@ -4135,6 +4060,7 @@ var WAVE2_AGENTS = [
4135
4060
  capability: {
4136
4061
  phase: "review",
4137
4062
  summary: "Produces auditable control evidence, traceability and evidence maps for SOC2, ISO and similar frameworks.",
4063
+ rationale: COMPLIANCE_AUDITOR_META,
4138
4064
  keywords: [
4139
4065
  ...COMPLIANCE_AUDITOR_META.signals,
4140
4066
  "compliance-auditor",
@@ -4158,6 +4084,7 @@ var WAVE2_AGENTS = [
4158
4084
  capability: {
4159
4085
  phase: "review",
4160
4086
  summary: "Implements data minimization, consent, retention and deletion; privacy-by-design across the stack.",
4087
+ rationale: PRIVACY_ENGINEER_META,
4161
4088
  keywords: [
4162
4089
  ...PRIVACY_ENGINEER_META.signals,
4163
4090
  "privacy-engineer",
@@ -4171,21 +4098,6 @@ var WAVE2_AGENTS = [
4171
4098
  }
4172
4099
  }
4173
4100
  ];
4174
- var WAVE2_ROLE_METAS = {
4175
- "threat-modeler": THREAT_MODELER_META,
4176
- "secure-coding-coach": SECURE_CODING_COACH_META,
4177
- "resilience-engineer": RESILIENCE_ENGINEER_META,
4178
- "chaos-engineer": CHAOS_ENGINEER_META,
4179
- "compliance-auditor": COMPLIANCE_AUDITOR_META,
4180
- "privacy-engineer": PRIVACY_ENGINEER_META,
4181
- "plugin-author": PLUGIN_AUTHOR_META,
4182
- "tool-author": TOOL_AUTHOR_META,
4183
- "prompt-evaluator": PROMPT_EVALUATOR_META,
4184
- "benchmark-engineer": BENCHMARK_ENGINEER_META,
4185
- "memory-curator": MEMORY_CURATOR_META,
4186
- "fleet-coordinator": FLEET_COORDINATOR_META
4187
- };
4188
- var WAVE2_ROLES = new Set(Object.keys(WAVE2_ROLE_METAS));
4189
4101
 
4190
4102
  // src/coordination/agents/phase4-verify.ts
4191
4103
  var VERIFY_AGENTS = [
@@ -5169,6 +5081,7 @@ var WAVE3_AGENTS = [
5169
5081
  capability: {
5170
5082
  phase: "domain",
5171
5083
  summary: "Payments specialist: ledger, refund, webhook, idempotency and reconciliation with financial-correctness invariants.",
5084
+ rationale: PAYMENTS_META,
5172
5085
  keywords: [
5173
5086
  ...PAYMENTS_META.signals,
5174
5087
  "payments",
@@ -5192,6 +5105,7 @@ var WAVE3_AGENTS = [
5192
5105
  capability: {
5193
5106
  phase: "domain",
5194
5107
  summary: "Messaging infrastructure specialist: queue, pub/sub, delivery semantics and DLQ with broker failure modes.",
5108
+ rationale: MESSAGING_META,
5195
5109
  keywords: [
5196
5110
  ...MESSAGING_META.signals,
5197
5111
  "messaging",
@@ -5215,6 +5129,7 @@ var WAVE3_AGENTS = [
5215
5129
  capability: {
5216
5130
  phase: "domain",
5217
5131
  summary: "Search relevance specialist: indexing, ranking, retrieval and offline/online evaluation of search quality.",
5132
+ rationale: SEARCH_RELEVANCE_META,
5218
5133
  keywords: [
5219
5134
  ...SEARCH_RELEVANCE_META.signals,
5220
5135
  "search",
@@ -5238,6 +5153,7 @@ var WAVE3_AGENTS = [
5238
5153
  capability: {
5239
5154
  phase: "domain",
5240
5155
  summary: "Object-storage specialist: upload, checksum, lifecycle, CDN and replication for unstructured blob data.",
5156
+ rationale: STORAGE_META,
5241
5157
  keywords: [
5242
5158
  ...STORAGE_META.signals,
5243
5159
  "object-storage",
@@ -5261,6 +5177,7 @@ var WAVE3_AGENTS = [
5261
5177
  capability: {
5262
5178
  phase: "domain",
5263
5179
  summary: "ML engineer: model integration, inference, evaluation and guardrail wiring.",
5180
+ rationale: ML_ENGINEER_META,
5264
5181
  keywords: [
5265
5182
  ...ML_ENGINEER_META.signals,
5266
5183
  "ml",
@@ -5283,6 +5200,7 @@ var WAVE3_AGENTS = [
5283
5200
  capability: {
5284
5201
  phase: "domain",
5285
5202
  summary: "Data governance specialist: lineage, classification, ownership and data contracts with quality-of-record.",
5203
+ rationale: DATA_GOVERNANCE_META,
5286
5204
  keywords: [
5287
5205
  ...DATA_GOVERNANCE_META.signals,
5288
5206
  "data-governance",
@@ -5294,15 +5212,6 @@ var WAVE3_AGENTS = [
5294
5212
  }
5295
5213
  }
5296
5214
  ];
5297
- var WAVE3_ROLE_METAS = {
5298
- payments: PAYMENTS_META,
5299
- messaging: MESSAGING_META,
5300
- "search-relevance": SEARCH_RELEVANCE_META,
5301
- storage: STORAGE_META,
5302
- "ml-engineer": ML_ENGINEER_META,
5303
- "data-governance": DATA_GOVERNANCE_META
5304
- };
5305
- var WAVE3_ROLES = new Set(Object.keys(WAVE3_ROLE_METAS));
5306
5215
 
5307
5216
  // src/coordination/agents/phase9-meta.ts
5308
5217
  var META_AGENTS = [
@@ -5465,7 +5374,7 @@ var PROMPT_evaluator_META = {
5465
5374
  ],
5466
5375
  differentiatesFrom: "prompt authors prompts; prompt-evaluator independently measures them with rubrics and adversarial inputs."
5467
5376
  };
5468
- var BENCHMARK_ENGINEER_META2 = {
5377
+ var BENCHMARK_ENGINEER_META = {
5469
5378
  rationale: "Benchmark engineer: reproducible benchmark design and methodology. The measurement-infrastructure counterpart to `performance`.",
5470
5379
  signals: [
5471
5380
  "benchmark",
@@ -5478,7 +5387,7 @@ var BENCHMARK_ENGINEER_META2 = {
5478
5387
  ],
5479
5388
  differentiatesFrom: "performance optimizes product code; benchmark-engineer builds the measurement infrastructure that supports comparison."
5480
5389
  };
5481
- var MEMORY_CURATOR_META2 = {
5390
+ var MEMORY_CURATOR_META = {
5482
5391
  rationale: "Memory curator: validates, merges and de-duplicates long-term memory with audience scope. Quality counterpart to `context`.",
5483
5392
  signals: [
5484
5393
  "memory",
@@ -5491,7 +5400,7 @@ var MEMORY_CURATOR_META2 = {
5491
5400
  ],
5492
5401
  differentiatesFrom: "context manages the active context window; memory-curator curates the long-term memory store for accuracy."
5493
5402
  };
5494
- var FLEET_COORDINATOR_META2 = {
5403
+ var FLEET_COORDINATOR_META = {
5495
5404
  rationale: "Fleet coordinator: multi-agent job partitioning, capacity planning and result synthesis. Operational counterpart to `planner`.",
5496
5405
  signals: [
5497
5406
  "fleet",
@@ -5504,7 +5413,7 @@ var FLEET_COORDINATOR_META2 = {
5504
5413
  ],
5505
5414
  differentiatesFrom: "planner designs ordered steps for one worker; fleet-coordinator runs many workers in parallel and merges their results."
5506
5415
  };
5507
- var PLUGIN_AUTHOR_META2 = {
5416
+ var PLUGIN_AUTHOR_META = {
5508
5417
  rationale: "Plugin author: build, package and ship runnable WrongStack plugins. The production counterpart to `skill-manage`.",
5509
5418
  signals: [
5510
5419
  "plugin",
@@ -5517,7 +5426,7 @@ var PLUGIN_AUTHOR_META2 = {
5517
5426
  ],
5518
5427
  differentiatesFrom: "skill-manage authors skills; plugin-author authors full lifecycle plugins with health and teardown."
5519
5428
  };
5520
- var TOOL_AUTHOR_META2 = {
5429
+ var TOOL_AUTHOR_META = {
5521
5430
  rationale: "Tool author: tool schema, capability declaration, permission and error contract. The narrow, security-focused counterpart to `plugin-author`.",
5522
5431
  signals: [
5523
5432
  "tool",
@@ -5543,8 +5452,9 @@ var WAVE4_AGENTS = [
5543
5452
  capability: {
5544
5453
  phase: "meta",
5545
5454
  summary: "Plugin author: build, package and ship runnable WrongStack plugins with full lifecycle, health and teardown.",
5455
+ rationale: PLUGIN_AUTHOR_META,
5546
5456
  keywords: [
5547
- ...PLUGIN_AUTHOR_META2.signals,
5457
+ ...PLUGIN_AUTHOR_META.signals,
5548
5458
  "plugin",
5549
5459
  "plugin-author",
5550
5460
  "lifecycle",
@@ -5566,8 +5476,9 @@ var WAVE4_AGENTS = [
5566
5476
  capability: {
5567
5477
  phase: "meta",
5568
5478
  summary: "Tool author: design tool schemas, capability declarations, permissions and error contracts with security as the first concern.",
5479
+ rationale: TOOL_AUTHOR_META,
5569
5480
  keywords: [
5570
- ...TOOL_AUTHOR_META2.signals,
5481
+ ...TOOL_AUTHOR_META.signals,
5571
5482
  "tool",
5572
5483
  "tool-author",
5573
5484
  "capability",
@@ -5589,6 +5500,7 @@ var WAVE4_AGENTS = [
5589
5500
  capability: {
5590
5501
  phase: "meta",
5591
5502
  summary: "Prompt evaluator: build rubrics, adversarial prompt tests and regression suites for independent measurement.",
5503
+ rationale: PROMPT_evaluator_META,
5592
5504
  keywords: [
5593
5505
  ...PROMPT_evaluator_META.signals,
5594
5506
  "prompt-evaluator",
@@ -5611,8 +5523,9 @@ var WAVE4_AGENTS = [
5611
5523
  capability: {
5612
5524
  phase: "meta",
5613
5525
  summary: "Benchmark engineer: design reproducible benchmarks and methodology with deterministic baselines.",
5526
+ rationale: BENCHMARK_ENGINEER_META,
5614
5527
  keywords: [
5615
- ...BENCHMARK_ENGINEER_META2.signals,
5528
+ ...BENCHMARK_ENGINEER_META.signals,
5616
5529
  "benchmark-engineer",
5617
5530
  "benchmark",
5618
5531
  "baseline",
@@ -5633,8 +5546,9 @@ var WAVE4_AGENTS = [
5633
5546
  capability: {
5634
5547
  phase: "meta",
5635
5548
  summary: "Memory curator: validate, merge and de-duplicate long-term memory entries with audience scoping.",
5549
+ rationale: MEMORY_CURATOR_META,
5636
5550
  keywords: [
5637
- ...MEMORY_CURATOR_META2.signals,
5551
+ ...MEMORY_CURATOR_META.signals,
5638
5552
  "memory-curator",
5639
5553
  "curate",
5640
5554
  "memory-audit",
@@ -5655,8 +5569,9 @@ var WAVE4_AGENTS = [
5655
5569
  capability: {
5656
5570
  phase: "meta",
5657
5571
  summary: "Fleet coordinator: own multi-agent job partitioning, capacity planning and result synthesis across many parallel workers.",
5572
+ rationale: FLEET_COORDINATOR_META,
5658
5573
  keywords: [
5659
- ...FLEET_COORDINATOR_META2.signals,
5574
+ ...FLEET_COORDINATOR_META.signals,
5660
5575
  "fleet-coordinator",
5661
5576
  "fan-out",
5662
5577
  "parallel",
@@ -5666,15 +5581,6 @@ var WAVE4_AGENTS = [
5666
5581
  }
5667
5582
  }
5668
5583
  ];
5669
- var WAVE4_ROLE_METAS = {
5670
- "plugin-author": PLUGIN_AUTHOR_META2,
5671
- "tool-author": TOOL_AUTHOR_META2,
5672
- "prompt-evaluator": PROMPT_evaluator_META,
5673
- "benchmark-engineer": BENCHMARK_ENGINEER_META2,
5674
- "memory-curator": MEMORY_CURATOR_META2,
5675
- "fleet-coordinator": FLEET_COORDINATOR_META2
5676
- };
5677
- var WAVE4_ROLES = new Set(Object.keys(WAVE4_ROLE_METAS));
5678
5584
 
5679
5585
  // src/coordination/agents/index.ts
5680
5586
  var ALL_AGENT_DEFINITIONS = assignSkillsToAgents([
@@ -5721,11 +5627,22 @@ var AGENT_CATALOG = (() => {
5721
5627
  function getAgentDefinition(role) {
5722
5628
  return AGENT_CATALOG[role];
5723
5629
  }
5630
+ var ROLE_DISPATCH_RATIONALE = (() => {
5631
+ const map = {};
5632
+ for (const def of ALL_AGENT_DEFINITIONS) {
5633
+ const role = def.config.role;
5634
+ const rationale = def.capability.rationale;
5635
+ if (role && rationale) map[role] = rationale;
5636
+ }
5637
+ return map;
5638
+ })();
5724
5639
 
5725
5640
  export {
5726
5641
  CAPTURE_COOLDOWN_MS,
5727
5642
  CAPTURE_MAX_PER_SESSION,
5728
5643
  CAPTURE_SESSION_WINDOW_MS,
5644
+ captureWindowState,
5645
+ recordCaptureAttempt,
5729
5646
  resetCaptureWindows,
5730
5647
  resetCaptureWindow,
5731
5648
  tokenOverlap,
@@ -5733,8 +5650,10 @@ export {
5733
5650
  LEARNED_SOFT_LIMIT,
5734
5651
  LEARNED_HARD_LIMIT,
5735
5652
  LEARNED_ENTRY_MAX_CHARS,
5653
+ MIN_INSTRUCTIVE_LENGTH,
5736
5654
  normalizeLearnedEntry,
5737
5655
  classifyLearnedEntry,
5656
+ normalizeForComparison,
5738
5657
  directiveTrials,
5739
5658
  directiveUtility,
5740
5659
  DIRECTIVE_PROVEN_MIN_APPLIED,
@@ -5747,9 +5666,18 @@ export {
5747
5666
  renderLearnedInstructions,
5748
5667
  enforceLearnedBudget,
5749
5668
  assertProjectAgentRole,
5669
+ isProjectAgentRoleName,
5670
+ agentsDir,
5671
+ roleDir,
5672
+ writeTextAtomically,
5673
+ learningPolicyPath,
5674
+ projectAgentProfilePath,
5675
+ QUARANTINE_MAX_BYTES,
5750
5676
  quarantinePath,
5677
+ appendQuarantine,
5751
5678
  readQuarantinedDirectives,
5752
5679
  scrubRetiredLines,
5680
+ hasDirectiveContent,
5753
5681
  retiredDirectivesToWarnAbout,
5754
5682
  readRawLearnedEntries,
5755
5683
  consolidatedDocumentPath,
@@ -5759,6 +5687,7 @@ export {
5759
5687
  saveProjectAgentConsolidated,
5760
5688
  clearProjectAgentConsolidated,
5761
5689
  buildConsolidationInstruction,
5690
+ BUILT_IN_KNOWLEDGE_MANIFESTS,
5762
5691
  loadProjectAgentLearningPolicy,
5763
5692
  updateProjectAgentLearningPolicy,
5764
5693
  recordProjectAgentOptimizePass,
@@ -5774,6 +5703,11 @@ export {
5774
5703
  assignSkillsToAgents,
5775
5704
  SKILL_AUGMENTATION_MAX_BYTES,
5776
5705
  DEFAULT_EAGER_SKILL_LIMIT,
5706
+ isProjectSkillName,
5707
+ assertProjectSkillName,
5708
+ projectSkillsDir,
5709
+ projectSkillAugmentationPath,
5710
+ projectSkillAffinityPath,
5777
5711
  loadProjectSkillAugmentation,
5778
5712
  saveProjectSkillAugmentation,
5779
5713
  clearProjectSkillAugmentation,
@@ -5783,11 +5717,13 @@ export {
5783
5717
  loadSkillAffinity,
5784
5718
  recordSkillLoad,
5785
5719
  recordSkillOutcome,
5720
+ recordSkillLearned,
5786
5721
  setSkillPinned,
5787
5722
  SKILL_EVIDENCE_HALF_LIFE_DAYS,
5788
5723
  scoreSkillAffinity,
5789
5724
  rankRoleSkills,
5790
5725
  resolveRoleSkillCandidates,
5726
+ LEARNED_SKILL_TAG,
5791
5727
  routeDirectiveToSkill,
5792
5728
  unwrapWholeDocumentFence,
5793
5729
  optimizeProjectAgentLearning,
@@ -5811,6 +5747,7 @@ export {
5811
5747
  loadProjectAgentLearned,
5812
5748
  listProjectAgentLearnedEntries,
5813
5749
  parseStructuredLearnedEntries,
5750
+ resolveCaptureKey,
5814
5751
  canCaptureNewLearned,
5815
5752
  getProjectAgentLearnStats,
5816
5753
  detectLearnedConflicts,
@@ -5831,26 +5768,19 @@ export {
5831
5768
  PLANNING_AGENTS,
5832
5769
  BUILD_AGENTS,
5833
5770
  WAVE1_AGENTS,
5834
- WAVE1_ROLE_METAS,
5835
- WAVE1_ROLES,
5836
5771
  WAVE2_AGENTS,
5837
- WAVE2_ROLE_METAS,
5838
- WAVE2_ROLES,
5839
5772
  VERIFY_AGENTS,
5840
5773
  REVIEW_AGENTS,
5841
5774
  DOMAIN_AGENTS,
5842
5775
  KNOWLEDGE_AGENTS,
5843
5776
  DELIVERY_AGENTS,
5844
5777
  WAVE3_AGENTS,
5845
- WAVE3_ROLE_METAS,
5846
- WAVE3_ROLES,
5847
5778
  META_AGENTS,
5848
5779
  WAVE4_AGENTS,
5849
- WAVE4_ROLE_METAS,
5850
- WAVE4_ROLES,
5851
5780
  ALL_AGENT_DEFINITIONS,
5852
5781
  AGENTS_BY_PHASE,
5853
5782
  AGENT_CATALOG,
5854
- getAgentDefinition
5783
+ getAgentDefinition,
5784
+ ROLE_DISPATCH_RATIONALE
5855
5785
  };
5856
- //# sourceMappingURL=chunk-FHAMQS7Q.js.map
5786
+ //# sourceMappingURL=chunk-FCBTO76Z.js.map
@@ -378,6 +378,14 @@ function makePatternMatcher(pattern) {
378
378
  const prefix = pattern.slice(0, -2);
379
379
  return (e) => e.startsWith(`${prefix}.`);
380
380
  }
381
+ if (pattern.endsWith(":*")) {
382
+ const prefix = pattern.slice(0, -2);
383
+ return (e) => e.startsWith(`${prefix}:`);
384
+ }
385
+ if (pattern.endsWith("*")) {
386
+ const prefix = pattern.slice(0, -1);
387
+ return (e) => e.startsWith(prefix);
388
+ }
381
389
  return (e) => e === pattern;
382
390
  }
383
391
 
@@ -385,4 +393,4 @@ export {
385
393
  EventBus,
386
394
  ScopedEventBus
387
395
  };
388
- //# sourceMappingURL=chunk-4LJJYBAU.js.map
396
+ //# sourceMappingURL=chunk-FHZVFYSL.js.map
@@ -106,6 +106,7 @@ var MAILBOX_TYPE_PROPERTIES = {
106
106
 
107
107
  // src/coordination/mailbox-predicates.ts
108
108
  function mailboxIdentityBase(agentId) {
109
+ if (typeof agentId !== "string") return "";
109
110
  return agentId.split(/[@#]/, 1)[0].trim().toLowerCase();
110
111
  }
111
112
  function isMailboxLeader(agentId, role) {
@@ -138,7 +139,7 @@ function validateSendType(type, to) {
138
139
  }
139
140
  var SESSION_RECIPIENT_PREFIX = "@session:";
140
141
  function sessionRecipient(sessionId) {
141
- const normalizedSessionId = sessionId.trim();
142
+ const normalizedSessionId = sessionId.trim().replace(/\\/g, "/");
142
143
  if (!normalizedSessionId) {
143
144
  throw new TypeError('sessionId is required for the "@session" recipient');
144
145
  }
@@ -241,8 +242,8 @@ async function acceptMailboxMessageForSession(message, currentSessionId, ctx) {
241
242
  }
242
243
 
243
244
  export {
244
- MAILBOX_TYPE_PROPERTIES,
245
245
  hasMailboxCapability,
246
+ MAILBOX_TYPE_PROPERTIES,
246
247
  mailboxIdentityBase,
247
248
  isMailboxLeader,
248
249
  isMailboxSenderInFamily,
@@ -255,4 +256,4 @@ export {
255
256
  isActionRequiredForActor,
256
257
  acceptMailboxMessageForSession
257
258
  };
258
- //# sourceMappingURL=chunk-W4A6QA3D.js.map
259
+ //# sourceMappingURL=chunk-FWNLEZYG.js.map
@@ -8,6 +8,9 @@ function resolveFleetChatVerbosity(autonomy) {
8
8
  return "off";
9
9
  }
10
10
 
11
+ // src/types/config/model-tiers.ts
12
+ var BUILTIN_MODEL_TIER_IDS = ["budget", "standard", "premium"];
13
+
11
14
  // src/types/config/ui.ts
12
15
  var THEME_PRESET_IDS = [
13
16
  "catppuccin",
@@ -104,9 +107,10 @@ var MALFORMED_ARG_MARKERS = ["__raw", "__raw_arguments", "_raw"];
104
107
  export {
105
108
  FLEET_CHAT_VERBOSITY_VALUES,
106
109
  resolveFleetChatVerbosity,
110
+ BUILTIN_MODEL_TIER_IDS,
107
111
  THEME_PRESET_IDS,
108
112
  DEFAULT_SPEC_TEMPLATE,
109
113
  ToolErrorCategory,
110
114
  MALFORMED_ARG_MARKERS
111
115
  };
112
- //# sourceMappingURL=chunk-OJZEX73F.js.map
116
+ //# sourceMappingURL=chunk-GDQ7CZRQ.js.map