@wrongstack/core 0.7.0 → 0.7.3

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 (56) hide show
  1. package/dist/{agent-bridge-CrQpYjM7.d.ts → agent-bridge-hXRN-GO_.d.ts} +1 -1
  2. package/dist/{compactor-CWV1u-IU.d.ts → compactor-Mw7-rNyb.d.ts} +1 -1
  3. package/dist/{config-C34JRwl4.d.ts → config-Bi4Q0fnz.d.ts} +2 -2
  4. package/dist/{context-bmR0YgBm.d.ts → context-z2x5gv_V.d.ts} +5 -1
  5. package/dist/coordination/index.d.ts +42 -12
  6. package/dist/coordination/index.js +2522 -33
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +24 -24
  9. package/dist/defaults/index.js +2783 -228
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/{events-CEKFTmIY.d.ts → events-D4pGukpI.d.ts} +26 -2
  12. package/dist/execution/index.d.ts +38 -15
  13. package/dist/execution/index.js +2406 -21
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/extension/index.d.ts +8 -8
  16. package/dist/{index-BJIFLGII.d.ts → index-BUHs7xJ9.d.ts} +8 -8
  17. package/dist/index.d.ts +40 -32
  18. package/dist/index.js +2813 -215
  19. package/dist/index.js.map +1 -1
  20. package/dist/infrastructure/index.d.ts +9 -9
  21. package/dist/infrastructure/index.js +12 -0
  22. package/dist/infrastructure/index.js.map +1 -1
  23. package/dist/kernel/index.d.ts +11 -11
  24. package/dist/kernel/index.js +12 -0
  25. package/dist/kernel/index.js.map +1 -1
  26. package/dist/{logger-BMQgxvdy.d.ts → logger-DDd5C--Z.d.ts} +1 -1
  27. package/dist/{logger-BH6AE0W9.d.ts → logger-bOzkF5LL.d.ts} +1 -1
  28. package/dist/{mcp-servers-BRJicm5o.d.ts → mcp-servers-n2L9ohMX.d.ts} +3 -3
  29. package/dist/models/index.d.ts +4 -4
  30. package/dist/{models-registry-Y2xbog0E.d.ts → models-registry-BcYJDKLm.d.ts} +1 -1
  31. package/dist/{models-registry-DqzwpBQy.d.ts → models-registry-OG_30xqZ.d.ts} +1 -1
  32. package/dist/{multi-agent-Cm1wYSrw.d.ts → multi-agent-7OK4pEKW.d.ts} +6 -3
  33. package/dist/{multi-agent-coordinator-CCupVFqv.d.ts → multi-agent-coordinator-D8PLzfz6.d.ts} +165 -4
  34. package/dist/{index-CZR0HjxM.d.ts → null-fleet-bus-Bkk3gafb.d.ts} +97 -6
  35. package/dist/observability/index.d.ts +2 -2
  36. package/dist/{path-resolver-CfT7e_HT.d.ts → path-resolver-DPUjF10O.d.ts} +3 -3
  37. package/dist/{plan-templates-Q78an-GJ.d.ts → plan-templates-DWbEIJvV.d.ts} +5 -5
  38. package/dist/{provider-runner-WDj28o7J.d.ts → provider-runner-iST8U3ni.d.ts} +4 -4
  39. package/dist/{retry-policy-Dpxp4SET.d.ts → retry-policy-OwtKNxo8.d.ts} +2 -2
  40. package/dist/sdd/index.d.ts +3 -3
  41. package/dist/{secret-scrubber-CowtdEF8.d.ts → secret-scrubber-DXkhwuka.d.ts} +1 -1
  42. package/dist/{secret-scrubber-C2YCYtkn.d.ts → secret-scrubber-nI8qjaqW.d.ts} +1 -1
  43. package/dist/security/index.d.ts +3 -3
  44. package/dist/{selector-CP39HhCe.d.ts → selector-DkvgYVS4.d.ts} +1 -1
  45. package/dist/{session-reader-Dwjn4WZR.d.ts → session-reader-DsadjyF9.d.ts} +1 -1
  46. package/dist/storage/index.d.ts +7 -7
  47. package/dist/storage/index.js +8 -4
  48. package/dist/storage/index.js.map +1 -1
  49. package/dist/{system-prompt-CfgXqyv2.d.ts → system-prompt-CWA6ml-d.d.ts} +2 -2
  50. package/dist/{tool-executor-D5NFi_LV.d.ts → tool-executor-Tutu4ePV.d.ts} +6 -5
  51. package/dist/types/index.d.ts +19 -19
  52. package/dist/types/index.js +29 -0
  53. package/dist/types/index.js.map +1 -1
  54. package/dist/utils/index.d.ts +2 -2
  55. package/dist/{wstack-paths-86YPFktR.d.ts → wstack-paths-BGu2INTm.d.ts} +1 -1
  56. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { U as Usage, a5 as Context, D as ToolProgressEvent, x as Tool } from './context-bmR0YgBm.js';
1
+ import { $ as Usage, d as Context, X as ToolProgressEvent, Q as Tool } from './context-z2x5gv_V.js';
2
2
 
3
3
  /**
4
4
  * EventBus — observe-only typed event bus.
@@ -281,6 +281,21 @@ interface EventMap {
281
281
  used: number;
282
282
  limit: number;
283
283
  };
284
+ /**
285
+ * Emitted when the coordinator/director actually GRANTS a budget
286
+ * extension to a subagent (the resolution of a `budget.threshold_reached`
287
+ * negotiation). Distinct from `subagent.budget_warning`, which fires when
288
+ * a limit is merely *hit*. UIs use this to render a persistent "⚡ extended
289
+ * ×N" badge so users can see how often an agent self-extended to stay
290
+ * alive. `totalExtensions` is the cumulative count for this subagent across
291
+ * all kinds; `newLimit` is the patched value for `kind`.
292
+ */
293
+ 'subagent.budget_extended': {
294
+ subagentId: string;
295
+ kind: string;
296
+ newLimit: number;
297
+ totalExtensions: number;
298
+ };
284
299
  /**
285
300
  * Per-tool-call event re-emitted from a subagent's own EventBus
286
301
  * onto the host EventBus, so the TUI / non-director surfaces can
@@ -433,6 +448,15 @@ declare class EventBus {
433
448
  * Number of wildcard listeners currently registered.
434
449
  */
435
450
  wildcardCount(): number;
451
+ /**
452
+ * True if anything would receive an emit for `event` — a named listener
453
+ * OR a wildcard/regex pattern that matches the event name. Unlike
454
+ * `listenerCount`, this DOES account for wildcards, so callers that gate
455
+ * behavior on "is anyone listening?" (e.g. SubagentBudget deciding whether
456
+ * to negotiate a soft limit vs hard-stop) don't misfire when the only
457
+ * subscriber is a pattern listener like the FleetBus's `onPattern('*')`.
458
+ */
459
+ hasListenerFor(event: string): boolean;
436
460
  }
437
461
  /**
438
462
  * A decorator over `EventBus` that records every listener registration
@@ -500,4 +524,4 @@ declare class ScopedEventBus extends EventBus {
500
524
  get scopedListenerCount(): number;
501
525
  }
502
526
 
503
- export { EventBus as E, type Listener as L, ScopedEventBus as S, type EventName as a, type EventLogger as b, type EventMap as c };
527
+ export { EventBus as E, type Listener as L, ScopedEventBus as S, type EventLogger as a, type EventMap as b, type EventName as c };
@@ -1,21 +1,21 @@
1
- export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-D5NFi_LV.js';
2
- import { i as Provider, a5 as Context } from '../context-bmR0YgBm.js';
3
- import { a as Compactor, C as CompactReport } from '../compactor-CWV1u-IU.js';
4
- import { M as MessageSelector } from '../selector-CP39HhCe.js';
5
- import { E as EventBus } from '../events-CEKFTmIY.js';
6
- import { c as MiddlewareHandler } from '../system-prompt-CfgXqyv2.js';
7
- import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-C34JRwl4.js';
8
- import { A as Agent, R as RunResult, j as SystemPromptContributor } from '../index-BJIFLGII.js';
9
- import { D as DoneCondition } from '../multi-agent-Cm1wYSrw.js';
1
+ export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-Tutu4ePV.js';
2
+ import { m as Provider, d as Context } from '../context-z2x5gv_V.js';
3
+ import { a as Compactor, C as CompactReport } from '../compactor-Mw7-rNyb.js';
4
+ import { M as MessageSelector } from '../selector-DkvgYVS4.js';
5
+ import { E as EventBus } from '../events-D4pGukpI.js';
6
+ import { b as MiddlewareHandler } from '../system-prompt-CWA6ml-d.js';
7
+ import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-Bi4Q0fnz.js';
8
+ import { c as Agent, R as RunResult, w as SystemPromptContributor } from '../index-BUHs7xJ9.js';
9
+ import { D as DoneCondition } from '../multi-agent-7OK4pEKW.js';
10
10
  import { J as JournalEntry } from '../goal-store-HHgaq5ue.js';
11
- import { A as AgentFactory, D as DefaultMultiAgentCoordinator } from '../multi-agent-coordinator-CCupVFqv.js';
11
+ import { c as AgentFactory, i as DispatchClassifier, g as DefaultMultiAgentCoordinator } from '../multi-agent-coordinator-D8PLzfz6.js';
12
12
  import { a as SkillLoader, b as SkillManifest, S as SkillEntry } from '../skill-CxuWrsKK.js';
13
- import { W as WstackPaths } from '../wstack-paths-86YPFktR.js';
14
- import '../retry-policy-Dpxp4SET.js';
15
- import '../models-registry-Y2xbog0E.js';
16
- import '../logger-BMQgxvdy.js';
13
+ import { a as WstackPaths } from '../wstack-paths-BGu2INTm.js';
14
+ import '../retry-policy-OwtKNxo8.js';
15
+ import '../models-registry-BcYJDKLm.js';
16
+ import '../logger-DDd5C--Z.js';
17
17
  import '../observability-BhnVLBLS.js';
18
- import '../secret-scrubber-C2YCYtkn.js';
18
+ import '../secret-scrubber-nI8qjaqW.js';
19
19
  import 'node:events';
20
20
 
21
21
  interface SkillLoaderOptions {
@@ -202,6 +202,13 @@ declare class AutoCompactionMiddleware {
202
202
  private readonly events?;
203
203
  private readonly failureMode;
204
204
  private readonly policyProvider?;
205
+ /**
206
+ * Overhead factor applied to the rough message-token estimate to produce a
207
+ * figure comparable to the real API request size (system prompt + tool defs).
208
+ * Without this factor, raw message tokens undercount real load by 15-50% in
209
+ * short conversations, causing premature compaction triggers.
210
+ */
211
+ private static readonly OVERHEAD_FACTOR;
205
212
  /**
206
213
  * @param compactor Compactor to use for compaction.
207
214
  * @param maxContext Provider's max context window in tokens.
@@ -548,6 +555,20 @@ interface ParallelEternalOptions {
548
555
  maxContextTokens?: number;
549
556
  /** Override the default agent factory (uses main agent if not provided). */
550
557
  subagentFactory?: AgentFactory;
558
+ /**
559
+ * Route each decomposed slot task to the best-fit catalog agent via the
560
+ * smart dispatcher (heuristic keyword scoring). When enabled (default), each
561
+ * slot spawns in-role — the role's budget tier applies and a persona line is
562
+ * injected into the task — instead of as a faceless generic worker. Set
563
+ * false to keep the legacy generic spawn.
564
+ */
565
+ dispatch?: boolean;
566
+ /**
567
+ * Optional LLM fallback for ambiguous tasks. Passed straight to
568
+ * `dispatchAgent`; when omitted, routing is pure heuristic (instant, no
569
+ * provider call — preferred for a continuously-ticking autonomous loop).
570
+ */
571
+ dispatchClassifier?: DispatchClassifier;
551
572
  }
552
573
  /**
553
574
  * Sense → Decide → Fan-out (4–8 parallel agents) → Aggregate → Loop.
@@ -573,6 +594,8 @@ declare class ParallelEternalEngine {
573
594
  private readonly timeoutMs;
574
595
  private coordinator;
575
596
  private agentFactory;
597
+ private readonly dispatchEnabled;
598
+ private readonly dispatchClassifier?;
576
599
  constructor(opts: ParallelEternalOptions);
577
600
  get currentState(): ParallelEngineState;
578
601
  /**