@wrongstack/core 0.310.1 → 0.313.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 (187) hide show
  1. package/dist/chronicle/index.js +84 -6391
  2. package/dist/chronicle/project-server.js +84 -4868
  3. package/dist/chunk-2BUUIMQB.js +225 -0
  4. package/dist/chunk-2FK4WTFF.js +207 -0
  5. package/dist/chunk-2FQL4PDC.js +292 -0
  6. package/dist/chunk-2KKODIQU.js +2256 -0
  7. package/dist/chunk-2YU4WVBW.js +134 -0
  8. package/dist/chunk-3E244UDA.js +356 -0
  9. package/dist/chunk-3XPVB7BA.js +135 -0
  10. package/dist/chunk-4LJJYBAU.js +388 -0
  11. package/dist/chunk-4VWO3ZXL.js +342 -0
  12. package/dist/chunk-4XV6IR37.js +187 -0
  13. package/dist/chunk-4ZHTKJHM.js +183 -0
  14. package/dist/chunk-52RTVH4M.js +361 -0
  15. package/dist/chunk-57GEWK5X.js +26 -0
  16. package/dist/chunk-5DSMEVA4.js +931 -0
  17. package/dist/chunk-5RP3QTRL.js +1223 -0
  18. package/dist/chunk-5S437PRC.js +50 -0
  19. package/dist/chunk-5XDUGTKN.js +511 -0
  20. package/dist/chunk-62V2AFVG.js +422 -0
  21. package/dist/chunk-65RDIOR2.js +2470 -0
  22. package/dist/chunk-6AKOTGLM.js +597 -0
  23. package/dist/chunk-7ZHZE5EO.js +28 -0
  24. package/dist/chunk-A455ATZB.js +140 -0
  25. package/dist/chunk-AD7ZFZCS.js +46 -0
  26. package/dist/chunk-AI4LLQ2U.js +856 -0
  27. package/dist/chunk-ASX6AW36.js +789 -0
  28. package/dist/chunk-AT4V4XGI.js +3522 -0
  29. package/dist/chunk-AWNQ6ED6.js +311 -0
  30. package/dist/chunk-B4AMLZPB.js +9 -0
  31. package/dist/chunk-BAKVJLEV.js +417 -0
  32. package/dist/chunk-BJHVULHO.js +55 -0
  33. package/dist/chunk-CB2HFKTP.js +9 -0
  34. package/dist/chunk-CE4ZOCOI.js +1640 -0
  35. package/dist/chunk-CQQL4ZOQ.js +151 -0
  36. package/dist/chunk-DEIQMBD2.js +65 -0
  37. package/dist/chunk-E6I5RXVK.js +58 -0
  38. package/dist/chunk-EFEHDQGY.js +1589 -0
  39. package/dist/chunk-EODDVJBM.js +82 -0
  40. package/dist/chunk-EPC3GZD4.js +308 -0
  41. package/dist/chunk-FAYRX2AD.js +13 -0
  42. package/dist/chunk-FFSX2QDQ.js +362 -0
  43. package/dist/chunk-FHAMQS7Q.js +5856 -0
  44. package/dist/chunk-FIV4IJL7.js +2263 -0
  45. package/dist/chunk-FNXVT7HF.js +52 -0
  46. package/dist/chunk-FSWCWSTS.js +395 -0
  47. package/dist/chunk-FW5LDDMJ.js +16464 -0
  48. package/dist/chunk-FXQLIX3K.js +211 -0
  49. package/dist/chunk-G5AAKEEZ.js +228 -0
  50. package/dist/chunk-G5S3S5ZN.js +38 -0
  51. package/dist/chunk-GAZEWQEZ.js +231 -0
  52. package/dist/chunk-GFJOMSHG.js +125 -0
  53. package/dist/chunk-GFXZTHNI.js +158 -0
  54. package/dist/chunk-GM54GJBU.js +960 -0
  55. package/dist/chunk-GPQ3NJPR.js +900 -0
  56. package/dist/chunk-GTCU6DZ3.js +1 -0
  57. package/dist/chunk-H5E77KUJ.js +15 -0
  58. package/dist/chunk-H72H4XDU.js +1023 -0
  59. package/dist/chunk-HA4ZYA6T.js +178 -0
  60. package/dist/chunk-I45KAW2N.js +5020 -0
  61. package/dist/chunk-IQ35HMQL.js +1396 -0
  62. package/dist/chunk-IYFBFX34.js +86 -0
  63. package/dist/chunk-JJPMWPB6.js +109 -0
  64. package/dist/chunk-JTHKOYWU.js +663 -0
  65. package/dist/chunk-JVGPR3TS.js +365 -0
  66. package/dist/chunk-JVKB2TBL.js +48 -0
  67. package/dist/chunk-JX7VBZDK.js +31 -0
  68. package/dist/chunk-K3G6JBUC.js +5232 -0
  69. package/dist/chunk-K4YUNKU7.js +589 -0
  70. package/dist/chunk-KBZGE6LN.js +710 -0
  71. package/dist/chunk-KDQJCT2J.js +45 -0
  72. package/dist/chunk-KI4L2DUL.js +560 -0
  73. package/dist/chunk-KJ2ZTQSL.js +47 -0
  74. package/dist/chunk-KSJ5UTP7.js +154 -0
  75. package/dist/chunk-LHOA5DWA.js +28 -0
  76. package/dist/chunk-LX5QWLBL.js +27 -0
  77. package/dist/chunk-LZDDLNCZ.js +279 -0
  78. package/dist/chunk-M2WF6AXG.js +115 -0
  79. package/dist/chunk-M7BS2K6U.js +1 -0
  80. package/dist/chunk-NDBIPFNY.js +102 -0
  81. package/dist/chunk-NEMIWEXC.js +1199 -0
  82. package/dist/chunk-NFAYHPRH.js +323 -0
  83. package/dist/chunk-O37BQ65S.js +21 -0
  84. package/dist/chunk-O74MJHXU.js +187 -0
  85. package/dist/chunk-OJZEX73F.js +112 -0
  86. package/dist/chunk-PAAWLLZX.js +74 -0
  87. package/dist/chunk-PFXFQQRT.js +339 -0
  88. package/dist/chunk-PFZO3C6H.js +14 -0
  89. package/dist/chunk-PHH7LD45.js +113 -0
  90. package/dist/chunk-QRTG4XTI.js +188 -0
  91. package/dist/chunk-QVOVMXJR.js +1351 -0
  92. package/dist/chunk-RCQYT2I4.js +757 -0
  93. package/dist/chunk-RD6DEE36.js +1178 -0
  94. package/dist/chunk-RJIZEJ42.js +30 -0
  95. package/dist/chunk-RPOA7IAE.js +150 -0
  96. package/dist/chunk-SN2DQRL6.js +1172 -0
  97. package/dist/chunk-SQJVFEBV.js +41 -0
  98. package/dist/chunk-SQP64RCS.js +5391 -0
  99. package/dist/chunk-SVT4RNTR.js +49 -0
  100. package/dist/chunk-SWUFN7XM.js +43 -0
  101. package/dist/chunk-SXMVYC5H.js +174 -0
  102. package/dist/chunk-SZ6AYUIZ.js +23 -0
  103. package/dist/chunk-T3KGZBU5.js +3171 -0
  104. package/dist/chunk-TBRL2RCC.js +9 -0
  105. package/dist/chunk-TRT2HRWZ.js +18 -0
  106. package/dist/chunk-TYW2GI5I.js +1077 -0
  107. package/dist/chunk-UIWONWVG.js +4959 -0
  108. package/dist/chunk-VB3H5WWB.js +151 -0
  109. package/dist/chunk-W4A6QA3D.js +258 -0
  110. package/dist/chunk-WBPVKEEE.js +227 -0
  111. package/dist/chunk-WEBMSQP2.js +123 -0
  112. package/dist/chunk-WOEZV3Q4.js +333 -0
  113. package/dist/chunk-WQQON3SV.js +473 -0
  114. package/dist/chunk-WQTOVMGV.js +119 -0
  115. package/dist/chunk-WZO23AWO.js +2779 -0
  116. package/dist/chunk-XBDP4QPW.js +7 -0
  117. package/dist/chunk-XEBHSJLT.js +103 -0
  118. package/dist/chunk-XQ2ECNK3.js +1 -0
  119. package/dist/chunk-XQ2XGIBF.js +2086 -0
  120. package/dist/chunk-Y2GE5TSI.js +355 -0
  121. package/dist/chunk-YBUJCZ57.js +351 -0
  122. package/dist/chunk-YNCVSFGF.js +149 -0
  123. package/dist/chunk-YUPMXOGP.js +282 -0
  124. package/dist/chunk-YY6APYUM.js +49 -0
  125. package/dist/chunk-Z2IJUO45.js +691 -0
  126. package/dist/chunk-ZEHUCJHY.js +129 -0
  127. package/dist/chunk-ZYU2YOJ6.js +1496 -0
  128. package/dist/chunk-ZZ4V3WIZ.js +163 -0
  129. package/dist/coordination/agents/index.js +145 -6260
  130. package/dist/coordination/index.js +365 -34323
  131. package/dist/coordination/mailbox-project-server.js +48 -3220
  132. package/dist/coordination/mailbox-types.d.ts +13 -1
  133. package/dist/coordination/provider-status-tracker.d.ts +4 -0
  134. package/dist/coordination/sqlite-mailbox.d.ts +2 -1
  135. package/dist/core/agent.d.ts +14 -1
  136. package/dist/core/index.js +267 -12479
  137. package/dist/core/model-ref.js +5 -23
  138. package/dist/core/provider-runner.d.ts +36 -1
  139. package/dist/design/index.js +50 -1087
  140. package/dist/execution/index.d.ts +1 -1
  141. package/dist/execution/index.js +1599 -21887
  142. package/dist/execution/prompt-enhancer.js +16 -535
  143. package/dist/execution/retry-policy.d.ts +31 -1
  144. package/dist/extension/index.js +7 -311
  145. package/dist/goal/index.js +33 -3435
  146. package/dist/hooks/index.js +14 -1138
  147. package/dist/hq/index.js +112 -5139
  148. package/dist/hq/protocol.js +21 -668
  149. package/dist/index.js +1410 -92655
  150. package/dist/infrastructure/index.js +64 -4811
  151. package/dist/kernel/events/provider-events.d.ts +15 -0
  152. package/dist/kernel/events/wrongtrace-events.d.ts +26 -0
  153. package/dist/kernel/events.d.ts +16 -7
  154. package/dist/kernel/index.js +14 -992
  155. package/dist/models/index.js +40 -1117
  156. package/dist/notifications/index.js +3 -108
  157. package/dist/observability/index.js +17 -279
  158. package/dist/plugin/index.js +584 -14835
  159. package/dist/prompts/index.js +14 -948
  160. package/dist/registry/index.js +9 -822
  161. package/dist/registry-R23UBE7H.js +14 -0
  162. package/dist/replay/index.js +6 -84
  163. package/dist/review-finding-store-DKAV3AS6.js +21 -0
  164. package/dist/review-report-store-OWY3EC3N.js +19 -0
  165. package/dist/security/index.js +114 -2202
  166. package/dist/session-catalog/index.js +36 -2103
  167. package/dist/session-catalog/project-server.js +42 -1435
  168. package/dist/skills/index.js +35 -1578
  169. package/dist/storage/index.js +182 -15600
  170. package/dist/tasking/index.js +10 -676
  171. package/dist/tools/index.js +52 -9589
  172. package/dist/types/config/autonomy.d.ts +5 -0
  173. package/dist/types/config/tools.d.ts +2 -2
  174. package/dist/types/config/ui.d.ts +1 -1
  175. package/dist/types/errors.d.ts +18 -0
  176. package/dist/types/index.js +121 -1341
  177. package/dist/types/provider-runner.d.ts +8 -0
  178. package/dist/types/session-markers.js +8 -144
  179. package/dist/utils/error.js +3 -4
  180. package/dist/utils/expect-defined.js +3 -9
  181. package/dist/utils/heap-watchdog.js +6 -706
  182. package/dist/utils/index.js +269 -5685
  183. package/dist/utils/sage-output-block.js +5 -42
  184. package/dist/wiring/proxy-rewrite.d.ts +92 -4
  185. package/dist/wiring/proxy-rewrite.js +20 -61
  186. package/dist/worktree/index.js +6 -887
  187. package/package.json +4 -4
@@ -0,0 +1,311 @@
1
+ // src/types/runtime-capability-manifest.ts
2
+ var PLAYWRIGHT_ALIASES = {
3
+ playwright_navigate: "browser_navigate",
4
+ playwright_screenshot: "browser_screenshot",
5
+ playwright_click: "browser_click",
6
+ playwright_type: "browser_type",
7
+ playwright_evaluate: "browser_evaluate",
8
+ playwright_select_option: "browser_select",
9
+ playwright_hover: "browser_hover",
10
+ playwright_fill_form: "browser_type",
11
+ playwright_wait_for: "browser_wait",
12
+ playwright_press_key: "browser_press",
13
+ playwright_drag: "browser_drag"
14
+ };
15
+ var RUNTIME_CAPABILITY_MANIFEST = [
16
+ {
17
+ id: "filesystem.read",
18
+ pack: "core",
19
+ exposure: "direct",
20
+ tools: ["read", "grep", "glob", "tree"]
21
+ },
22
+ {
23
+ id: "code.inspect",
24
+ pack: "core",
25
+ exposure: "direct",
26
+ tools: [
27
+ "codebase-stats",
28
+ "codebase-search",
29
+ "codebase-incoming-calls",
30
+ "codebase-outgoing-calls",
31
+ "codebase-index",
32
+ "codebase-skeleton",
33
+ "codebase-repo-map",
34
+ "codebase-impact-analysis",
35
+ "codebase-invariant-check",
36
+ "dead-code-scan",
37
+ "diff",
38
+ "json",
39
+ "logs"
40
+ ]
41
+ },
42
+ {
43
+ id: "filesystem.write",
44
+ pack: "development",
45
+ exposure: "direct",
46
+ tools: ["write", "edit", "replace", "patch", "codebase-ast-replace"]
47
+ },
48
+ {
49
+ id: "execution.shell",
50
+ pack: "development",
51
+ exposure: "direct",
52
+ tools: ["bash", "exec", "pwsh", "language", "language_info", "language_package"]
53
+ },
54
+ {
55
+ id: "verification.run",
56
+ pack: "development",
57
+ exposure: "direct",
58
+ tools: ["lint", "format", "typecheck", "test", "e2e_plan", "codebase-targeted-test"]
59
+ },
60
+ {
61
+ id: "version-control.manage",
62
+ pack: "development",
63
+ exposure: "direct",
64
+ tools: ["git"]
65
+ },
66
+ {
67
+ id: "dependencies.manage",
68
+ pack: "development",
69
+ exposure: "on-demand",
70
+ tools: ["install", "outdated", "audit"]
71
+ },
72
+ {
73
+ id: "documentation.author",
74
+ pack: "development",
75
+ exposure: "on-demand",
76
+ tools: ["document", "design", "scaffold"]
77
+ },
78
+ {
79
+ id: "web.research",
80
+ pack: "core",
81
+ exposure: "direct",
82
+ tools: ["search", "fetch"]
83
+ },
84
+ {
85
+ id: "work.plan",
86
+ pack: "core",
87
+ exposure: "direct",
88
+ tools: ["todo", "plan", "task", "kanban", "nextsteps"]
89
+ },
90
+ {
91
+ id: "coordination.mailbox",
92
+ pack: "fleet",
93
+ exposure: "direct",
94
+ tools: ["mailbox", "mail_send", "mail_inbox", "fleet_status"]
95
+ },
96
+ {
97
+ id: "fleet.delegate",
98
+ pack: "fleet",
99
+ exposure: "on-demand",
100
+ tools: [
101
+ "delegate",
102
+ "spawn_subagent",
103
+ "assign_task",
104
+ "kanban_queue",
105
+ "await_tasks",
106
+ "ask_subagent",
107
+ "ask_result",
108
+ "roll_up",
109
+ "quality_gate",
110
+ "terminate_subagent",
111
+ "terminate_all",
112
+ "work_complete",
113
+ "collab_debug",
114
+ "fleet_emit",
115
+ "fleet"
116
+ ]
117
+ },
118
+ {
119
+ id: "reasoning.oneshot",
120
+ pack: "core",
121
+ exposure: "on-demand",
122
+ tools: ["llm", "council"]
123
+ },
124
+ {
125
+ id: "memory.manage",
126
+ pack: "memory",
127
+ exposure: "on-demand",
128
+ tools: ["remember", "search_memory", "find_related_memories", "forget"]
129
+ },
130
+ {
131
+ id: "memory.curate",
132
+ pack: "memory",
133
+ exposure: "on-demand",
134
+ tools: [
135
+ "memory_candidates",
136
+ "memory_update",
137
+ "memory_delete",
138
+ "memory_recover",
139
+ "memory_backfill_recoverable",
140
+ "memory_for_file",
141
+ "memory_for_path",
142
+ "memory_search",
143
+ "memory_graph",
144
+ "memory_gather_batch",
145
+ "memory_verify",
146
+ "memory_hygiene"
147
+ ]
148
+ },
149
+ {
150
+ id: "browser.interact",
151
+ pack: "browser",
152
+ exposure: "on-demand",
153
+ tools: [
154
+ "browser_open",
155
+ "browser_status",
156
+ "browser_list",
157
+ "browser_navigate",
158
+ "browser_snapshot",
159
+ "browser_screenshot",
160
+ "browser_click",
161
+ "browser_type",
162
+ "browser_select",
163
+ "browser_press",
164
+ "browser_hover",
165
+ "browser_drag",
166
+ "browser_wait",
167
+ "browser_evaluate",
168
+ "browser_upload",
169
+ "browser_close"
170
+ ],
171
+ aliases: PLAYWRIGHT_ALIASES
172
+ },
173
+ {
174
+ id: "mcp.dynamic",
175
+ pack: "mcp",
176
+ exposure: "on-demand",
177
+ tools: ["mcp_use"]
178
+ },
179
+ {
180
+ id: "automation.manage",
181
+ pack: "admin",
182
+ exposure: "on-demand",
183
+ tools: ["cron_schedule", "cron_list", "cron_cancel", "watch_start", "watch_list", "watch_stop"]
184
+ },
185
+ {
186
+ id: "context.pin",
187
+ pack: "admin",
188
+ exposure: "on-demand",
189
+ tools: ["pin_add", "pin_list", "pin_remove"]
190
+ },
191
+ {
192
+ id: "quality.analyze",
193
+ pack: "development",
194
+ exposure: "on-demand",
195
+ tools: [
196
+ "dead_code_scan",
197
+ "detect_duplicate_code",
198
+ "secret_scanner_test",
199
+ "error_lens_history",
200
+ "security-ast-scan"
201
+ ]
202
+ },
203
+ {
204
+ id: "release.manage",
205
+ pack: "development",
206
+ exposure: "on-demand",
207
+ tools: ["git_autocommit", "semver_current", "semver_bump", "semver_changelog"]
208
+ },
209
+ {
210
+ id: "messaging.telegram",
211
+ pack: "fleet",
212
+ exposure: "on-demand",
213
+ tools: ["telegram_send", "telegram_read", "telegram_approve"]
214
+ },
215
+ {
216
+ id: "tools.discover",
217
+ pack: "admin",
218
+ exposure: "direct",
219
+ tools: ["tool_search", "tool_use", "tool_help", "batch_tool_use", "clarify"]
220
+ },
221
+ {
222
+ id: "runtime.admin",
223
+ pack: "admin",
224
+ exposure: "internal",
225
+ tools: ["set_working_dir", "context_manager", "mode", "skill", "mcp_control"]
226
+ }
227
+ ];
228
+ var CAPABILITY_BY_ID = new Map(
229
+ RUNTIME_CAPABILITY_MANIFEST.map((definition) => [definition.id, definition])
230
+ );
231
+ var CAPABILITY_BY_TOOL = /* @__PURE__ */ new Map();
232
+ var TOOL_ALIASES = /* @__PURE__ */ new Map();
233
+ for (const definition of RUNTIME_CAPABILITY_MANIFEST) {
234
+ for (const tool of definition.tools) {
235
+ CAPABILITY_BY_TOOL.set(tool, definition.id);
236
+ }
237
+ for (const [alias, tool] of Object.entries(definition.aliases ?? {})) {
238
+ TOOL_ALIASES.set(alias, tool);
239
+ }
240
+ }
241
+ function toolsForRuntimeCapabilities(capabilityIds) {
242
+ return [
243
+ ...new Set(
244
+ capabilityIds.flatMap((id) => {
245
+ const definition = CAPABILITY_BY_ID.get(id);
246
+ if (!definition) throw new Error(`Unknown runtime capability: "${id}"`);
247
+ return definition.tools;
248
+ })
249
+ )
250
+ ];
251
+ }
252
+ function normalizeRuntimeToolName(name) {
253
+ return TOOL_ALIASES.get(name) ?? name;
254
+ }
255
+ function runtimeCapabilityForTool(name) {
256
+ return CAPABILITY_BY_TOOL.get(normalizeRuntimeToolName(name));
257
+ }
258
+ function isKnownRuntimeCapability(id) {
259
+ return CAPABILITY_BY_ID.has(id);
260
+ }
261
+ function inferRuntimeCapabilities(toolNames) {
262
+ const ids = /* @__PURE__ */ new Set();
263
+ for (const rawName of toolNames) {
264
+ const id = runtimeCapabilityForTool(rawName);
265
+ if (id) ids.add(id);
266
+ }
267
+ return [...ids];
268
+ }
269
+ function missingRuntimeCapabilities(required, toolNames) {
270
+ if (!required || required.length === 0) return [];
271
+ const available = new Set(inferRuntimeCapabilities(toolNames));
272
+ return required.filter((id) => !CAPABILITY_BY_ID.has(id) || !available.has(id));
273
+ }
274
+ function missingRequiredRuntimeTools(required, toolNames) {
275
+ if (!required || required.length === 0) return [];
276
+ const available = new Set(toolNames.map(normalizeRuntimeToolName));
277
+ return required.map(normalizeRuntimeToolName).filter((name) => !CAPABILITY_BY_TOOL.has(name) || !available.has(name));
278
+ }
279
+ function runtimeToolReferencesFromText(text) {
280
+ const references = /* @__PURE__ */ new Set();
281
+ for (const match of text.matchAll(/`([a-z][a-z0-9_-]+)`/gi)) {
282
+ const name = normalizeRuntimeToolName(match[1] ?? "");
283
+ if (CAPABILITY_BY_TOOL.has(name)) references.add(name);
284
+ }
285
+ for (const pattern of [
286
+ /\b(?:call|use|invoke|run)\s+`([a-z][a-z0-9_-]+)`/gi,
287
+ /`([a-z][a-z0-9_-]+)`\s+tool\b/gi
288
+ ]) {
289
+ for (const match of text.matchAll(pattern)) {
290
+ references.add(normalizeRuntimeToolName(match[1] ?? ""));
291
+ }
292
+ }
293
+ return [...references];
294
+ }
295
+ function isDeprecatedRuntimeToolAlias(name) {
296
+ return TOOL_ALIASES.has(name) || name.startsWith("mcp__");
297
+ }
298
+
299
+ export {
300
+ RUNTIME_CAPABILITY_MANIFEST,
301
+ toolsForRuntimeCapabilities,
302
+ normalizeRuntimeToolName,
303
+ runtimeCapabilityForTool,
304
+ isKnownRuntimeCapability,
305
+ inferRuntimeCapabilities,
306
+ missingRuntimeCapabilities,
307
+ missingRequiredRuntimeTools,
308
+ runtimeToolReferencesFromText,
309
+ isDeprecatedRuntimeToolAlias
310
+ };
311
+ //# sourceMappingURL=chunk-AWNQ6ED6.js.map
@@ -0,0 +1,9 @@
1
+ // src/utils/string.ts
2
+ function truncate(s, max) {
3
+ return s.length <= max ? s : `${s.slice(0, max - 1)}\u2026`;
4
+ }
5
+
6
+ export {
7
+ truncate
8
+ };
9
+ //# sourceMappingURL=chunk-B4AMLZPB.js.map