@wrongstack/core 0.3.4 → 0.3.7

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 (48) hide show
  1. package/dist/{agent-bridge-C3DUGjSb.d.ts → agent-bridge-DaOnnHNW.d.ts} +1 -1
  2. package/dist/{compactor-DpJBI1YH.d.ts → compactor-CFky6JKM.d.ts} +1 -1
  3. package/dist/{config-DgE3JslD.d.ts → config-RlhKLjme.d.ts} +1 -1
  4. package/dist/{context-IovtuTf8.d.ts → context-B1kBj1lY.d.ts} +4 -3
  5. package/dist/coordination/index.d.ts +10 -10
  6. package/dist/coordination/index.js +12 -1
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +16 -16
  9. package/dist/defaults/index.js +119 -6
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/{events-BHIQs4o1.d.ts → events-BBaKeMfb.d.ts} +11 -1
  12. package/dist/execution/index.d.ts +11 -11
  13. package/dist/execution/index.js +9 -0
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/extension/index.d.ts +6 -6
  16. package/dist/{index-DedY4Euf.d.ts → index-meJRuQtc.d.ts} +20 -5
  17. package/dist/index.d.ts +25 -25
  18. package/dist/index.js +211 -27
  19. package/dist/index.js.map +1 -1
  20. package/dist/infrastructure/index.d.ts +6 -6
  21. package/dist/kernel/index.d.ts +9 -9
  22. package/dist/kernel/index.js.map +1 -1
  23. package/dist/{mcp-servers-zGiC1lQc.d.ts → mcp-servers-Cf4-bJnd.d.ts} +3 -3
  24. package/dist/models/index.d.ts +2 -2
  25. package/dist/{multi-agent-B9a6sflH.d.ts → multi-agent-D5m66hzB.d.ts} +1 -1
  26. package/dist/observability/index.d.ts +2 -2
  27. package/dist/{path-resolver--59rCou3.d.ts → path-resolver-Bg4OP5fi.d.ts} +2 -2
  28. package/dist/{provider-runner-B39miKRw.d.ts → provider-runner-CU9gnU2E.d.ts} +3 -3
  29. package/dist/sdd/index.d.ts +3 -3
  30. package/dist/secret-scrubber-DyUAWS09.d.ts +54 -0
  31. package/dist/{secret-scrubber-Cuy5afaQ.d.ts → secret-scrubber-Dyh5LVYL.d.ts} +1 -1
  32. package/dist/security/index.d.ts +58 -5
  33. package/dist/security/index.js +90 -5
  34. package/dist/security/index.js.map +1 -1
  35. package/dist/{selector-wT2fv9Fg.d.ts → selector-DBEiwXBk.d.ts} +1 -1
  36. package/dist/{session-reader-CcPi4BQ8.d.ts → session-reader-D-z0AgHs.d.ts} +1 -1
  37. package/dist/{skill-C_7znCIC.d.ts → skill-DayhFUBb.d.ts} +1 -1
  38. package/dist/storage/index.d.ts +5 -5
  39. package/dist/storage/index.js +12 -0
  40. package/dist/storage/index.js.map +1 -1
  41. package/dist/{system-prompt-Dk1qm8ey.d.ts → system-prompt-DNetCecu.d.ts} +1 -1
  42. package/dist/{tool-executor-DY0iSXYf.d.ts → tool-executor-B5bgmEgE.d.ts} +12 -5
  43. package/dist/types/index.d.ts +15 -15
  44. package/dist/types/index.js +16 -0
  45. package/dist/types/index.js.map +1 -1
  46. package/dist/utils/index.d.ts +1 -1
  47. package/package.json +1 -1
  48. package/dist/secret-scrubber-CgG2tV2B.d.ts +0 -31
@@ -1,4 +1,4 @@
1
- import { B as BridgeTransport, l as BridgeMessage, A as AgentBridge, m as AgentBridgeConfig } from './multi-agent-B9a6sflH.js';
1
+ import { B as BridgeTransport, l as BridgeMessage, A as AgentBridge, m as AgentBridgeConfig } from './multi-agent-D5m66hzB.js';
2
2
 
3
3
  /**
4
4
  * In-memory pub/sub transport for agent-to-agent messaging.
@@ -1,4 +1,4 @@
1
- import { a0 as Context } from './context-IovtuTf8.js';
1
+ import { a0 as Context } from './context-B1kBj1lY.js';
2
2
 
3
3
  interface CompactRepairReport {
4
4
  removedToolUses: string[];
@@ -1,5 +1,5 @@
1
1
  import { W as WireFamily } from './models-registry-Y2xbog0E.js';
2
- import { P as Permission } from './context-IovtuTf8.js';
2
+ import { P as Permission } from './context-B1kBj1lY.js';
3
3
 
4
4
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
5
5
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -859,9 +859,10 @@ declare class Context implements RunEnv {
859
859
  get state(): ConversationState;
860
860
  /**
861
861
  * Register a teardown hook tied to the current run's abort signal. The
862
- * hook fires when the run aborts OR ends normally — Agent.run wires
863
- * this through a RunController. When no run is active the hook fires
864
- * immediately so callers don't leak resources.
862
+ * hook fires when the run aborts or ends normally — Agent.run wires this
863
+ * through a RunController. Hooks registered before a run starts are stored
864
+ * and fired when the next run ends; there is no "immediate fire" when no
865
+ * run is active.
865
866
  *
866
867
  * **Scope:** these hooks fire on the **whole agent run's** abort, not on
867
868
  * an individual tool call. For per-tool teardown of resources owned by
@@ -1,16 +1,16 @@
1
- import { M as MultiAgentConfig, i as SubagentRunner, c as SubagentConfig, k as TaskSpec, j as TaskResult, a as CoordinatorStatus, b as MultiAgentCoordinator, S as SpawnResult, l as BridgeMessage, A as AgentBridge } from '../multi-agent-B9a6sflH.js';
2
- export { n as BudgetExceededError, o as BudgetKind, p as BudgetLimits, q as BudgetUsage, r as SubagentBudget } from '../multi-agent-B9a6sflH.js';
3
- import { q as SessionWriter, u as Tool, o as SessionStore } from '../context-IovtuTf8.js';
4
- import { I as InMemoryAgentBridge } from '../agent-bridge-C3DUGjSb.js';
5
- export { a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-C3DUGjSb.js';
6
- import { E as EventBus } from '../events-BHIQs4o1.js';
1
+ import { M as MultiAgentConfig, i as SubagentRunner, c as SubagentConfig, k as TaskSpec, j as TaskResult, a as CoordinatorStatus, b as MultiAgentCoordinator, S as SpawnResult, l as BridgeMessage, A as AgentBridge } from '../multi-agent-D5m66hzB.js';
2
+ export { n as BudgetExceededError, o as BudgetKind, p as BudgetLimits, q as BudgetUsage, r as SubagentBudget } from '../multi-agent-D5m66hzB.js';
3
+ import { q as SessionWriter, u as Tool, o as SessionStore } from '../context-B1kBj1lY.js';
4
+ import { I as InMemoryAgentBridge } from '../agent-bridge-DaOnnHNW.js';
5
+ export { a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DaOnnHNW.js';
6
+ import { E as EventBus } from '../events-BBaKeMfb.js';
7
7
  import { EventEmitter } from 'node:events';
8
- import { r as Agent, u as AgentInput } from '../index-DedY4Euf.js';
8
+ import { r as Agent, u as AgentInput } from '../index-meJRuQtc.js';
9
9
  import '../logger-BMQgxvdy.js';
10
- import '../system-prompt-Dk1qm8ey.js';
10
+ import '../system-prompt-DNetCecu.js';
11
11
  import '../observability-BhnVLBLS.js';
12
- import '../secret-scrubber-CgG2tV2B.js';
13
- import '../config-DgE3JslD.js';
12
+ import '../secret-scrubber-DyUAWS09.js';
13
+ import '../config-RlhKLjme.js';
14
14
  import '../models-registry-Y2xbog0E.js';
15
15
 
16
16
  /**
@@ -135,6 +135,10 @@ var DirectorStateCheckpoint = class {
135
135
  this.timer = null;
136
136
  }
137
137
  await this.persist();
138
+ if (this.rewriteRequested) {
139
+ this.rewriteRequested = false;
140
+ await this.persist();
141
+ }
138
142
  }
139
143
  bumpUpdatedAt() {
140
144
  this.snapshot = { ...this.snapshot, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
@@ -272,6 +276,13 @@ var InMemoryAgentBridge = class {
272
276
  this.pendingRequests.delete(correlationId);
273
277
  reject(new Error(`Request ${correlationId} timed out after ${timeout}ms`));
274
278
  }, timeout);
279
+ if (this.stopped) {
280
+ clearTimeout(timer);
281
+ this.inflightGuards.delete(correlationId);
282
+ this.pendingRequests.delete(correlationId);
283
+ reject(new Error("Bridge stopped"));
284
+ return;
285
+ }
275
286
  this.pendingRequests.set(correlationId, {
276
287
  resolve,
277
288
  reject,
@@ -1590,8 +1601,8 @@ var Director = class {
1590
1601
  if (this.spawnCount >= this.maxSpawns) {
1591
1602
  throw new DirectorBudgetError("max_spawns", this.maxSpawns, this.spawnCount + 1);
1592
1603
  }
1593
- this.spawnCount += 1;
1594
1604
  const result = await this.coordinator.spawn(config);
1605
+ this.spawnCount += 1;
1595
1606
  this.subagentMeta.set(result.subagentId, {
1596
1607
  provider: config.provider,
1597
1608
  model: config.model