@wrongstack/core 0.283.1 → 0.284.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 (78) hide show
  1. package/dist/{compactor-BxddyCFu.d.ts → compactor-DQLL4HTo.d.ts} +1 -1
  2. package/dist/{config-DkCbA3Bw.d.ts → config-MRqn1V-u.d.ts} +130 -22
  3. package/dist/coordination/index.d.ts +43 -20
  4. package/dist/coordination/index.js +1744 -912
  5. package/dist/coordination/index.js.map +1 -1
  6. package/dist/{default-config-Buho8yge.d.ts → default-config-B79_gJYv.d.ts} +7 -0
  7. package/dist/defaults/index.d.ts +25 -29
  8. package/dist/defaults/index.js +2546 -7396
  9. package/dist/defaults/index.js.map +1 -1
  10. package/dist/{director-state-B_GPa78Q.d.ts → director-state-CMS_bMs4.d.ts} +2 -0
  11. package/dist/{events-KmxSmvho.d.ts → events-Bgnh43r9.d.ts} +27 -10
  12. package/dist/execution/index.d.ts +15 -16
  13. package/dist/execution/index.js +534 -140
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/execution/prompt-enhancer.d.ts +1 -1
  16. package/dist/extension/index.d.ts +6 -6
  17. package/dist/{global-mailbox-rWVt8YlO.d.ts → global-mailbox-sZwyI6CS.d.ts} +13 -2
  18. package/dist/{goal-store-8owBXJT2.d.ts → goal-store-Datpp-ar.d.ts} +1 -1
  19. package/dist/hq/index.d.ts +6 -6
  20. package/dist/hq/index.js +58 -7
  21. package/dist/hq/index.js.map +1 -1
  22. package/dist/{index-BhCteHAF.d.ts → index--Gm41aBJ.d.ts} +26 -11
  23. package/dist/{index-BEFWNZYs.d.ts → index-CbyuOE5y.d.ts} +5 -1
  24. package/dist/index.d.ts +50 -1015
  25. package/dist/index.js +21028 -27775
  26. package/dist/index.js.map +1 -1
  27. package/dist/infrastructure/index.d.ts +9 -7
  28. package/dist/infrastructure/index.js +7 -2
  29. package/dist/infrastructure/index.js.map +1 -1
  30. package/dist/kernel/index.d.ts +11 -11
  31. package/dist/kernel/index.js.map +1 -1
  32. package/dist/{mcp-servers-BUx9A_AQ.d.ts → mcp-servers-DEV4s6Ks.d.ts} +3 -3
  33. package/dist/models/index.d.ts +4 -4
  34. package/dist/models/index.js +18 -3
  35. package/dist/models/index.js.map +1 -1
  36. package/dist/{agent-subagent-runner-BsuWhB28.d.ts → multi-agent-coordinator-4RCRZKjN.d.ts} +417 -9
  37. package/dist/{null-fleet-bus-D4e9R7Qc.d.ts → null-fleet-bus-CFoNVQEK.d.ts} +53 -12
  38. package/dist/observability/index.d.ts +3 -3
  39. package/dist/{parallel-eternal-engine-iY2uxocj.d.ts → parallel-eternal-engine-HUrtePLd.d.ts} +4 -5
  40. package/dist/{permission-B6YAtNFz.d.ts → permission-ByDKXEcG.d.ts} +1 -1
  41. package/dist/{pipeline-ixSFe5jg.d.ts → pipeline-DGDyIohT.d.ts} +28 -7
  42. package/dist/{provider-model-resolve-DIxKL_T-.d.ts → provider-model-resolve-o2hHLs79.d.ts} +3 -3
  43. package/dist/{provider-runner-oQhDaZmH.d.ts → provider-runner-ChL-kVg6.d.ts} +3 -3
  44. package/dist/{retry-policy-V67lBOJz.d.ts → retry-policy-CQ7KwXJa.d.ts} +2 -2
  45. package/dist/{secret-vault-D7jeyXUQ.d.ts → secret-vault-DxohkUBc.d.ts} +3 -2
  46. package/dist/security/index.d.ts +4 -4
  47. package/dist/security/index.js +232 -2
  48. package/dist/security/index.js.map +1 -1
  49. package/dist/{selector-Bx2HgUkU.d.ts → selector-D8O6B_Rm.d.ts} +1 -1
  50. package/dist/{session-event-bridge-Bkp7ORfc.d.ts → session-event-bridge-D_z_mBwk.d.ts} +3 -3
  51. package/dist/{session-reader-B-Fi9L6I.d.ts → session-reader-7Esxrkpw.d.ts} +1 -1
  52. package/dist/storage/index.d.ts +77 -39
  53. package/dist/storage/index.js +1223 -288
  54. package/dist/storage/index.js.map +1 -1
  55. package/dist/tasking/index.d.ts +124 -0
  56. package/dist/tasking/index.js +492 -0
  57. package/dist/tasking/index.js.map +1 -0
  58. package/dist/{todos-checkpoint-BwCrj4Cb.d.ts → todos-checkpoint-FY7PjmMx.d.ts} +13 -4
  59. package/dist/{tool-LVSLiE1s.d.ts → tool-BNlnIJvo.d.ts} +216 -17
  60. package/dist/{tool-executor-kElSEgO0.d.ts → tool-executor-CckSCM5E.d.ts} +12 -15
  61. package/dist/tools/index.d.ts +2 -2
  62. package/dist/tools/index.js.map +1 -1
  63. package/dist/types/index.d.ts +94 -19
  64. package/dist/types/index.js +76 -12
  65. package/dist/types/index.js.map +1 -1
  66. package/dist/utils/index.d.ts +44 -10
  67. package/dist/utils/index.js +106 -17
  68. package/dist/utils/index.js.map +1 -1
  69. package/dist/{worktree-manager-BjyAW30D.d.ts → worktree-manager-DzwxKE35.d.ts} +1 -1
  70. package/instructions/coordination/subagent-baseline.md +5 -0
  71. package/instructions/llm/autonomy-brain.md +3 -2
  72. package/instructions/system.md +4 -0
  73. package/package.json +10 -3
  74. package/dist/multi-agent-coordinator-CrjeTB9i.d.ts +0 -357
  75. package/dist/sdd/index.d.ts +0 -1993
  76. package/dist/sdd/index.js +0 -9500
  77. package/dist/sdd/index.js.map +0 -1
  78. package/dist/spec-TBi3Jr6T.d.ts +0 -78
@@ -50,6 +50,7 @@ interface DirectorStateSnapshot {
50
50
  maxSpawnDepth: number;
51
51
  directorBudget?: {
52
52
  maxCostUsd?: number | undefined;
53
+ maxTokens?: number | undefined;
53
54
  } | undefined;
54
55
  subagents: DirectorSubagentState[];
55
56
  tasks: DirectorTaskState[];
@@ -83,6 +84,7 @@ declare class DirectorStateCheckpoint {
83
84
  maxSpawnDepth: number;
84
85
  directorBudget?: {
85
86
  maxCostUsd?: number | undefined;
87
+ maxTokens?: number | undefined;
86
88
  } | undefined;
87
89
  }, debounceMs?: number);
88
90
  /**
@@ -1,5 +1,5 @@
1
- import { U as Usage, d as Context, i as ContentBlock, l as ToolErrorCategory, m as ToolProgressEvent, g as Tool, n as RiskTier, o as ToolOutputMetadata } from './tool-LVSLiE1s.js';
2
- import { a as PermissionDecision } from './permission-B6YAtNFz.js';
1
+ import { U as Usage, d as Context, i as ContentBlock, l as ToolErrorCategory, m as ToolProgressEvent, g as Tool, n as RiskTier, o as ToolOutputMetadata } from './tool-BNlnIJvo.js';
2
+ import { a as PermissionDecision } from './permission-ByDKXEcG.js';
3
3
 
4
4
  /**
5
5
  * Brain coordination primitives.
@@ -513,12 +513,15 @@ interface EventMap {
513
513
  decision: 'always' | 'deny';
514
514
  };
515
515
  /**
516
- * Fired when the agent loop detects that the model is repeating the same
517
- * response shape over and over — a tight loop that would otherwise burn
518
- * iterations indefinitely. The loop breaks with status `max_iterations`
519
- * after `repeatCount` consecutive identical iterations.
516
+ * Fired when the agent loop detects that the model is repeating itself
517
+ * a tight loop that would otherwise burn iterations indefinitely. In the
518
+ * default `steer-then-cut` mode the first detection injects a corrective
519
+ * note into the conversation (`action: 'steer'`) and lets the run
520
+ * continue; persistent repetition cuts the turn with status
521
+ * `max_iterations` (`action: 'cut'`). Legacy `cut` mode hard-stops on
522
+ * first detection.
520
523
  *
521
- * Two flavours caught by the same safety valve:
524
+ * Flavours caught by the same safety valve:
522
525
  * - `kind: 'tool'` — the same tool(s) called with effectively the same
523
526
  * inputs (catches k2p7's tendency to retry identical tool calls when
524
527
  * a tool returns an unexpected empty result).
@@ -530,15 +533,15 @@ interface EventMap {
530
533
  * - `kind: 'mixed'` — both: the response contains tool calls AND text,
531
534
  * and the combined fingerprint (tool names + text) repeats.
532
535
  *
533
- * UIs can render a warning chip. The `kind` field is additive — older
534
- * subscribers that only read `tools` continue to work.
536
+ * UIs can render a warning chip. The `kind`, `action`, and `scope` fields
537
+ * are additive — older subscribers that only read `tools` continue to work.
535
538
  */
536
539
  'tool.loop_detected': {
537
540
  sessionId?: string | undefined;
538
541
  ctx: Context;
539
542
  /** Comma-separated tool names involved in the loop, or empty string for pure message loops. */
540
543
  tools: string;
541
- /** Number of consecutive identical iterations detected. */
544
+ /** Number of repeats detected (consecutive iterations, or identical calls within the window for `scope: 'call'`). */
542
545
  repeatCount: number;
543
546
  /** 0-based iteration index where the loop was detected. */
544
547
  iteration: number;
@@ -549,6 +552,20 @@ interface EventMap {
549
552
  * pre-date the field.
550
553
  */
551
554
  kind?: 'tool' | 'message' | 'mixed' | undefined;
555
+ /**
556
+ * What the detector did. `steer` = a corrective note was folded into the
557
+ * conversation and the run continues; `cut` = the turn was ended with
558
+ * status `max_iterations`. Defaults to `cut` for subscribers that
559
+ * pre-date the field.
560
+ */
561
+ action?: 'steer' | 'cut' | undefined;
562
+ /**
563
+ * Which detector fired. `iteration` = consecutive effectively-identical
564
+ * iterations; `call` = the same (tool name + canonicalized args) call
565
+ * repeated within the sliding window, possibly interleaved with other
566
+ * calls (e.g. re-reading the same file for the 4th time).
567
+ */
568
+ scope?: 'iteration' | 'call' | undefined;
552
569
  };
553
570
  /**
554
571
  * `output` is a truncated preview of the tool's serialized result text
@@ -1,26 +1,25 @@
1
- export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorOptions, d as CompactorStrategy, Z as ContextWindowBudgetSnapshot, $ as DEFAULT_RECOVERY_STRATEGIES, D as DefaultDesignKitLoader, e as DefaultErrorHandler, f as DefaultPromptLoader, g as DefaultRetryPolicy, h as DefaultSkillLoader, i as DesignKitLoaderOptions, k as DoneCheckResult, l as DoneConditionChecker, H as HybridCompactor, I as IntelligentCompactor, m as IntelligentCompactorOptions, P as PersistedActiveKit, n as PromptLoaderOptions, a0 as RecoveryStrategy, S as SelectiveCompactor, o as SelectiveCompactorOptions, p as SkillLoaderOptions, q as StrategyCompactorOptions, T as ToolExecutor, _ as _resetDesignKitLoaderMemo, r as _resetDesignRulesCache, s as activateDesign, u as buildGoalPreamble, a1 as buildRecoveryStrategies, v as clearActiveKit, w as clearPersistedActiveKit, x as createStrategyCompactor, y as designProjectDir, z as detectFrontendFile, B as detectFrontendIntent, E as getDesignKitLoader, F as getDesignState, G as installDesignStudioMiddleware, J as loadActiveKit, K as loadProjectDesignRules, L as makeAutonomyPromptContributor, M as makeDesignDetectToolCallMiddleware, N as makeDesignDetectUserInputMiddleware, O as makeDesignStudioRequestMiddleware, R as recordKitChoice, V as renderPrompt, W as resolveBundledDesignKitsDir, X as setActiveKit } from '../tool-executor-kElSEgO0.js';
2
- import { P as Provider, a as ReasoningConfig, r as Capabilities, c as Request } from '../tool-LVSLiE1s.js';
3
- import { e as BrainDecision, h as BrainDecisionRequest, B as BrainArbiter } from '../events-KmxSmvho.js';
4
- export { E as EternalAutonomyEngine, h as EternalAutonomyOptions, i as EternalEngineState, I as IterationStage, P as ParallelEngineState, j as ParallelEternalEngine, k as ParallelEternalOptions, l as ParallelIterationStage } from '../parallel-eternal-engine-iY2uxocj.js';
5
- import { h as ModelRuntimeConfig } from '../config-DkCbA3Bw.js';
6
- import '../pipeline-ixSFe5jg.js';
1
+ export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorOptions, d as CompactorStrategy, Z as ContextWindowBudgetSnapshot, $ as DEFAULT_RECOVERY_STRATEGIES, D as DefaultDesignKitLoader, e as DefaultErrorHandler, f as DefaultPromptLoader, g as DefaultRetryPolicy, h as DefaultSkillLoader, i as DesignKitLoaderOptions, k as DoneCheckResult, l as DoneConditionChecker, H as HybridCompactor, I as IntelligentCompactor, m as IntelligentCompactorOptions, P as PersistedActiveKit, n as PromptLoaderOptions, a0 as RecoveryStrategy, S as SelectiveCompactor, o as SelectiveCompactorOptions, p as SkillLoaderOptions, q as StrategyCompactorOptions, T as ToolExecutor, _ as _resetDesignKitLoaderMemo, r as _resetDesignRulesCache, s as activateDesign, u as buildGoalPreamble, a1 as buildRecoveryStrategies, v as clearActiveKit, w as clearPersistedActiveKit, x as createStrategyCompactor, y as designProjectDir, z as detectFrontendFile, B as detectFrontendIntent, E as getDesignKitLoader, F as getDesignState, G as installDesignStudioMiddleware, J as loadActiveKit, K as loadProjectDesignRules, L as makeAutonomyPromptContributor, M as makeDesignDetectToolCallMiddleware, N as makeDesignDetectUserInputMiddleware, O as makeDesignStudioRequestMiddleware, R as recordKitChoice, V as renderPrompt, W as resolveBundledDesignKitsDir, X as setActiveKit } from '../tool-executor-CckSCM5E.js';
2
+ import { P as Provider, a as ReasoningConfig, r as Capabilities, c as Request } from '../tool-BNlnIJvo.js';
3
+ import { e as BrainDecision, h as BrainDecisionRequest, B as BrainArbiter } from '../events-Bgnh43r9.js';
4
+ export { E as EternalAutonomyEngine, h as EternalAutonomyOptions, i as EternalEngineState, I as IterationStage, P as ParallelEngineState, j as ParallelEternalEngine, k as ParallelEternalOptions, l as ParallelIterationStage } from '../parallel-eternal-engine-HUrtePLd.js';
5
+ import { k as ModelRuntimeConfig } from '../config-MRqn1V-u.js';
6
+ import '../pipeline-DGDyIohT.js';
7
7
  import '../mailbox-types-BGZWrYTJ.js';
8
- import '../session-event-bridge-Bkp7ORfc.js';
9
- import '../compactor-BxddyCFu.js';
10
- import '../agent-subagent-runner-BsuWhB28.js';
11
- import '../index-BhCteHAF.js';
8
+ import '../session-event-bridge-D_z_mBwk.js';
9
+ import '../compactor-DQLL4HTo.js';
10
+ import '../multi-agent-coordinator-4RCRZKjN.js';
11
+ import '../index--Gm41aBJ.js';
12
12
  import '../logger-B63L5bTg.js';
13
- import '../permission-B6YAtNFz.js';
13
+ import '../permission-ByDKXEcG.js';
14
14
  import '../observability-D-HZN_mF.js';
15
15
  import '../secret-scrubber-3MHDDAtm.js';
16
- import '../retry-policy-V67lBOJz.js';
17
- import '../selector-Bx2HgUkU.js';
16
+ import '../retry-policy-CQ7KwXJa.js';
17
+ import 'node:events';
18
+ import '../selector-D8O6B_Rm.js';
18
19
  import '../skill-DHniprNl.js';
19
20
  import '../wstack-paths-C3K40Qst.js';
20
21
  import '../prompt-DLd35n4Q.js';
21
- import '../goal-store-8owBXJT2.js';
22
- import '../multi-agent-coordinator-CrjeTB9i.js';
23
- import 'node:events';
22
+ import '../goal-store-Datpp-ar.js';
24
23
 
25
24
  /**
26
25
  * AutonomyBrain — a self-driving decision layer for autonomous workflows.