@wrongstack/core 0.277.2 → 0.280.0

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 (83) hide show
  1. package/dist/{agent-bridge-BFJ2ODzI.d.ts → agent-bridge-DXC6QDJ4.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-BimKihiC.d.ts → agent-subagent-runner-PoqNKiR4.d.ts} +563 -471
  3. package/dist/{compactor-D3BGw26y.d.ts → compactor-U3agvUIG.d.ts} +1 -1
  4. package/dist/{config-DAOjriz9.d.ts → config-Cr3312zc.d.ts} +102 -4
  5. package/dist/coordination/index.d.ts +1087 -998
  6. package/dist/coordination/index.js +12235 -12052
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +31 -30
  9. package/dist/defaults/index.js +403 -189
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/{brain-CCfuEOdp.d.ts → events-Bs2fmldo.d.ts} +117 -112
  12. package/dist/execution/index.d.ts +27 -19
  13. package/dist/execution/index.js +216 -63
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/execution/prompt-enhancer.d.ts +1 -1
  16. package/dist/execution/prompt-enhancer.js.map +1 -1
  17. package/dist/extension/index.d.ts +8 -7
  18. package/dist/{global-mailbox-Dr4cTKqL.d.ts → global-mailbox-Ct7IorLJ.d.ts} +84 -6
  19. package/dist/{goal-store-C1uH4srH.d.ts → goal-store-C4F6DjC0.d.ts} +1 -1
  20. package/dist/hq/index.d.ts +504 -7
  21. package/dist/hq/index.js +1069 -20
  22. package/dist/hq/index.js.map +1 -1
  23. package/dist/{index-DJXj-dcr.d.ts → index-kidebiDh.d.ts} +8 -5
  24. package/dist/{index-cMEmzCVN.d.ts → index-nP09-oP2.d.ts} +2 -2
  25. package/dist/index.d.ts +153 -76
  26. package/dist/index.js +5791 -3163
  27. package/dist/index.js.map +1 -1
  28. package/dist/infrastructure/index.d.ts +7 -6
  29. package/dist/kernel/index.d.ts +14 -13
  30. package/dist/kernel/index.js +31 -15
  31. package/dist/kernel/index.js.map +1 -1
  32. package/dist/{mailbox-types-DTl7bRH3.d.ts → mailbox-types-BGZWrYTJ.d.ts} +38 -0
  33. package/dist/{mcp-servers-CFb60-pH.d.ts → mcp-servers-D910X5_r.d.ts} +3 -3
  34. package/dist/models/index.d.ts +5 -5
  35. package/dist/models/index.js.map +1 -1
  36. package/dist/{models-registry-5Ufn7f2m.d.ts → models-registry-CLkoOcHk.d.ts} +1 -1
  37. package/dist/{multi-agent-coordinator-CcrcncvG.d.ts → multi-agent-coordinator-CieyUoEL.d.ts} +1 -1
  38. package/dist/{null-fleet-bus-C9KsYyrI.d.ts → null-fleet-bus-DkdmZJ_W.d.ts} +464 -464
  39. package/dist/observability/index.d.ts +3 -2
  40. package/dist/{path-resolver-CEeX9I7O.d.ts → path-resolver-XfZ9eLxG.d.ts} +3 -3
  41. package/dist/{permission-DbsGOA1C.d.ts → permission-Dx6dIqS2.d.ts} +2 -7
  42. package/dist/{permission-policy-BpEea3r7.d.ts → permission-policy-C8vJcnX5.d.ts} +2 -2
  43. package/dist/{pipeline-CEjBjzVA.d.ts → pipeline-BwAP21_4.d.ts} +9 -4
  44. package/dist/{provider-model-resolve-BpfXp3Jj.d.ts → provider-model-resolve-CwQNZWt_.d.ts} +3 -3
  45. package/dist/{provider-runner-CnOSr5BN.d.ts → provider-runner-CYHFImzV.d.ts} +3 -3
  46. package/dist/{retry-policy-Git9WF6d.d.ts → retry-policy-D4feSLk3.d.ts} +1 -1
  47. package/dist/sdd/index.d.ts +11 -10
  48. package/dist/sdd/index.js +2 -2
  49. package/dist/sdd/index.js.map +1 -1
  50. package/dist/secret-scrubber-3MHDDAtm.d.ts +6 -0
  51. package/dist/{secret-vault-DDSMHqIm.d.ts → secret-vault-CImt2XrR.d.ts} +1 -1
  52. package/dist/security/index.d.ts +6 -5
  53. package/dist/security/index.js.map +1 -1
  54. package/dist/{selector-Cq72C0Oy.d.ts → selector-Dy-MzKp1.d.ts} +1 -1
  55. package/dist/{session-event-bridge-DG94B3Bk.d.ts → session-event-bridge-CqdiGnfU.d.ts} +1 -1
  56. package/dist/{session-reader-BzT-iMQT.d.ts → session-reader-Hk0WbNm9.d.ts} +1 -1
  57. package/dist/{skill-DGIXCtdv.d.ts → skill-DHniprNl.d.ts} +15 -1
  58. package/dist/skills/index.d.ts +472 -26
  59. package/dist/skills/index.js +872 -129
  60. package/dist/skills/index.js.map +1 -1
  61. package/dist/storage/index.d.ts +27 -14
  62. package/dist/storage/index.js +264 -85
  63. package/dist/storage/index.js.map +1 -1
  64. package/dist/{strategy-compactor-Bt_ZH6R0.d.ts → strategy-compactor-CQwhbErd.d.ts} +32 -17
  65. package/dist/{todos-checkpoint-CH1pcua9.d.ts → todos-checkpoint-Bk2uP7Ex.d.ts} +6 -6
  66. package/dist/{context-DPlA6kid.d.ts → tool-BkOgs_KL.d.ts} +306 -286
  67. package/dist/{tool-executor-SVFq7IOR.d.ts → tool-executor-SiE1wlZo.d.ts} +9 -9
  68. package/dist/tools/index.d.ts +2 -2
  69. package/dist/tools/index.js.map +1 -1
  70. package/dist/types/index.d.ts +22 -21
  71. package/dist/types/index.js +7 -9
  72. package/dist/types/index.js.map +1 -1
  73. package/dist/utils/index.d.ts +30 -4
  74. package/dist/utils/index.js +50 -1
  75. package/dist/utils/index.js.map +1 -1
  76. package/dist/{worktree-manager-C4YIf1Fa.d.ts → worktree-manager-BjOFF6bt.d.ts} +1 -1
  77. package/dist/{wstack-paths-_NrRovdr.d.ts → wstack-paths-CMl_cYgq.d.ts} +8 -0
  78. package/package.json +1 -1
  79. package/skills/mailbox-bridge/SKILL.md +1 -0
  80. package/skills/plugin-author/SKILL.md +350 -0
  81. package/skills/sdd/SKILL.md +134 -134
  82. package/skills/skill-creator/SKILL.md +45 -7
  83. package/skills/wrongstack-mailbox/SKILL.md +40 -21
@@ -1,9 +1,10 @@
1
1
  export { D as DefaultLogger, a as DefaultLoggerOptions, L as LogFormat } from '../logger-D3lV0cUZ.js';
2
- export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-CEeX9I7O.js';
3
- export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, p as playwrightServer, s as sentinelServer, q as slackServer, r as sshManagerServer, z as zaiVisionServer } from '../mcp-servers-CFb60-pH.js';
2
+ export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-XfZ9eLxG.js';
3
+ export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, p as playwrightServer, s as sentinelServer, q as slackServer, r as sshManagerServer, z as zaiVisionServer } from '../mcp-servers-D910X5_r.js';
4
4
  import '../logger-B63L5bTg.js';
5
- import '../brain-CCfuEOdp.js';
6
- import '../context-DPlA6kid.js';
7
- import '../config-DAOjriz9.js';
5
+ import '../events-Bs2fmldo.js';
6
+ import '../tool-BkOgs_KL.js';
7
+ import '../permission-Dx6dIqS2.js';
8
+ import '../config-Cr3312zc.js';
8
9
  import '../path-resolver-CPRj4bFY.js';
9
- import '../compactor-D3BGw26y.js';
10
+ import '../compactor-U3agvUIG.js';
@@ -1,21 +1,22 @@
1
- import { T as Token, a as Renderer, S as SystemPromptBuilder, H as HookRegistry } from '../pipeline-CEjBjzVA.js';
2
- export { d as BindOptions, C as Container, D as Decorator, F as Factory, b as Middleware, M as MiddlewareHandler, N as NextFn, P as Pipeline, e as PipelineOptions } from '../pipeline-CEjBjzVA.js';
3
- import { c as MemoryStore, B as BrainArbiter } from '../brain-CCfuEOdp.js';
4
- export { E as EventBus, m as EventLogger, n as EventMap, a as EventName, L as Listener, v as ScopedEventBus } from '../brain-CCfuEOdp.js';
5
- import { C as Compactor } from '../compactor-D3BGw26y.js';
6
- import { j as ConfigLoader, l as ConfigStore, M as ModelsRegistry } from '../config-DAOjriz9.js';
7
- import { E as ErrorHandler, R as RetryPolicy } from '../retry-policy-Git9WF6d.js';
1
+ import { T as Token, a as Renderer, S as SystemPromptBuilder, H as HookRegistry } from '../pipeline-BwAP21_4.js';
2
+ export { d as BindOptions, C as Container, D as Decorator, F as Factory, b as Middleware, M as MiddlewareHandler, N as NextFn, P as Pipeline, e as PipelineOptions } from '../pipeline-BwAP21_4.js';
3
+ import { c as MemoryStore, B as BrainArbiter } from '../events-Bs2fmldo.js';
4
+ export { E as EventBus, m as EventLogger, n as EventMap, a as EventName, L as Listener, v as ScopedEventBus } from '../events-Bs2fmldo.js';
5
+ import { C as Compactor } from '../compactor-U3agvUIG.js';
6
+ import { k as ConfigLoader, m as ConfigStore, M as ModelsRegistry } from '../config-Cr3312zc.js';
7
+ import { E as ErrorHandler, R as RetryPolicy } from '../retry-policy-D4feSLk3.js';
8
8
  import { I as InputReader } from '../input-reader-E-ffP2ee.js';
9
9
  import { L as Logger } from '../logger-B63L5bTg.js';
10
10
  import { M as ModeStore } from '../mode-CZlO9iU1.js';
11
11
  import { P as PathResolver } from '../path-resolver-CPRj4bFY.js';
12
- import { P as PermissionPolicy, S as SecretScrubber } from '../permission-DbsGOA1C.js';
13
- import { P as ProviderRunner } from '../provider-runner-CnOSr5BN.js';
14
- import { e as TokenCounter, k as SessionStore } from '../context-DPlA6kid.js';
12
+ import { P as PermissionPolicy } from '../permission-Dx6dIqS2.js';
13
+ import { P as ProviderRunner } from '../provider-runner-CYHFImzV.js';
14
+ import { S as SecretScrubber } from '../secret-scrubber-3MHDDAtm.js';
15
+ import { f as TokenCounter, k as SessionStore } from '../tool-BkOgs_KL.js';
15
16
  import { P as PromptLoader } from '../prompt-DLd35n4Q.js';
16
- import { S as SkillLoader } from '../skill-DGIXCtdv.js';
17
- import { W as WorktreeManager } from '../worktree-manager-C4YIf1Fa.js';
18
- import '../mailbox-types-DTl7bRH3.js';
17
+ import { S as SkillLoader } from '../skill-DHniprNl.js';
18
+ import { W as WorktreeManager } from '../worktree-manager-BjOFF6bt.js';
19
+ import '../mailbox-types-BGZWrYTJ.js';
19
20
  import '../observability-D-HZN_mF.js';
20
21
 
21
22
  declare const TOKENS: {
@@ -151,7 +151,10 @@ var Container = class {
151
151
  */
152
152
  describeCycle(reentry) {
153
153
  const descs = [];
154
+ const seen = /* @__PURE__ */ new Set();
154
155
  for (const t2 of this.resolving) {
156
+ if (seen.has(t2)) continue;
157
+ seen.add(t2);
155
158
  descs.push(t2.description ?? "unknown");
156
159
  }
157
160
  descs.push(reentry.description ?? "unknown");
@@ -162,10 +165,16 @@ var Container = class {
162
165
  }
163
166
  /**
164
167
  * Resolve a token if it is bound, otherwise return undefined.
165
- * Unlike resolve(), this does not throw if the token is unbound.
168
+ * Unlike `resolve()`, this does not throw if the token is unbound.
169
+ *
170
+ * Single map lookup — `has()` + `resolve()` would walk the entries
171
+ * map twice. The bound check is folded into the resolve path so a
172
+ * non-existent token can never enter the `resolving` cycle-detection
173
+ * set.
166
174
  */
167
175
  safeResolve(token) {
168
- return this.has(token) ? this.resolve(token) : void 0;
176
+ if (!this.entries.has(token)) return void 0;
177
+ return this.resolve(token);
169
178
  }
170
179
  ownerOf(token) {
171
180
  return this.entries.get(token)?.owner;
@@ -313,17 +322,18 @@ var Pipeline = class {
313
322
  /** Return a read-only view suitable for passing to plugins. */
314
323
  asReadonly() {
315
324
  const self = this;
316
- return Object.freeze({
325
+ const view = Object.freeze({
317
326
  get size() {
318
- return self.size();
327
+ return self.chain.length;
319
328
  },
320
329
  list() {
321
- return Object.freeze(self.list());
330
+ return Object.freeze(self.chain.map((m) => m.name));
322
331
  },
323
332
  run(input) {
324
333
  return self.run(input);
325
334
  }
326
335
  });
336
+ return view;
327
337
  }
328
338
  async run(input) {
329
339
  let index = -1;
@@ -331,11 +341,12 @@ var Pipeline = class {
331
341
  const errorHandler = this.errorHandler;
332
342
  const dispatch = async (i, value) => {
333
343
  if (i <= index) {
344
+ const offender = chain[index]?.name;
334
345
  throw new WrongStackError({
335
- message: `Pipeline: next() called multiple times in "${chain[index]?.name}"`,
346
+ message: `Pipeline: next() called multiple times in "${offender}"`,
336
347
  code: ERROR_CODES.VALIDATION_ERROR,
337
348
  subsystem: "container",
338
- context: { middleware: chain[index]?.name }
349
+ context: { middleware: offender }
339
350
  });
340
351
  }
341
352
  index = i;
@@ -654,8 +665,9 @@ var ScopedEventBus = class extends EventBus {
654
665
  return this.registrations.size;
655
666
  }
656
667
  };
668
+ var MATCH_ALL = () => true;
657
669
  function makePatternMatcher(pattern) {
658
- if (pattern === "*") return () => true;
670
+ if (pattern === "*") return MATCH_ALL;
659
671
  if (pattern.endsWith(".*")) {
660
672
  const prefix = pattern.slice(0, -2);
661
673
  return (e) => e.startsWith(`${prefix}.`);
@@ -716,6 +728,9 @@ var RunController = class {
716
728
  const parent = opts.parentSignal;
717
729
  if (parent.aborted) {
718
730
  this.ctrl.abort(parent.reason);
731
+ queueMicrotask(() => {
732
+ void this.runHooks();
733
+ });
719
734
  } else {
720
735
  const onParentAbort = () => this.ctrl.abort(parent.reason);
721
736
  parent.addEventListener("abort", onParentAbort, { once: true });
@@ -785,13 +800,14 @@ var RunController = class {
785
800
  if (this.hooksDrained) return;
786
801
  this.hooksDrained = true;
787
802
  const snapshot = this.hooks.splice(0, this.hooks.length).reverse();
788
- for (const hook of snapshot) {
789
- try {
790
- await hook();
791
- } catch (err) {
792
- this.errorSink(err, "RunController.dispose");
793
- }
794
- }
803
+ if (snapshot.length === 0) return;
804
+ await Promise.allSettled(
805
+ snapshot.map(
806
+ (hook) => Promise.resolve().then(() => hook()).catch((err) => {
807
+ this.errorSink(err, "RunController.dispose");
808
+ })
809
+ )
810
+ );
795
811
  }
796
812
  };
797
813