@wrongstack/core 0.66.13 → 0.73.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 (55) hide show
  1. package/dist/{agent-bridge-D-j6OOBT.d.ts → agent-bridge-C0Ze7Ldm.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-DRZ9-NnR.d.ts → agent-subagent-runner-BmITbs1Q.d.ts} +13 -5
  3. package/dist/{config--86aHSln.d.ts → config-Dy0CK_o6.d.ts} +44 -1
  4. package/dist/coordination/index.d.ts +10 -10
  5. package/dist/coordination/index.js +188 -210
  6. package/dist/coordination/index.js.map +1 -1
  7. package/dist/defaults/index.d.ts +15 -15
  8. package/dist/defaults/index.js +121 -118
  9. package/dist/defaults/index.js.map +1 -1
  10. package/dist/{events-CIplI98R.d.ts → events-BBAlxBuw.d.ts} +8 -0
  11. package/dist/execution/index.d.ts +8 -8
  12. package/dist/execution/index.js +69 -99
  13. package/dist/execution/index.js.map +1 -1
  14. package/dist/extension/index.d.ts +5 -5
  15. package/dist/{index-DKUvyTvV.d.ts → index-BN6i2Nfg.d.ts} +4 -4
  16. package/dist/{index-b5uhfTSl.d.ts → index-yQbZ2NQx.d.ts} +6 -6
  17. package/dist/index.d.ts +29 -27
  18. package/dist/index.js +222 -129
  19. package/dist/index.js.map +1 -1
  20. package/dist/infrastructure/index.d.ts +4 -4
  21. package/dist/kernel/index.d.ts +7 -7
  22. package/dist/kernel/index.js.map +1 -1
  23. package/dist/{mcp-servers-DwoNBf6r.d.ts → mcp-servers-T0O6UN_w.d.ts} +1 -1
  24. package/dist/{mode-CV077NjV.d.ts → mode-BO4SEUIv.d.ts} +7 -0
  25. package/dist/models/index.d.ts +1 -1
  26. package/dist/models/index.js +18 -9
  27. package/dist/models/index.js.map +1 -1
  28. package/dist/{multi-agent-coordinator-CWnH-CiX.d.ts → multi-agent-coordinator-BSBbZt0e.d.ts} +1 -1
  29. package/dist/{null-fleet-bus-VApKRxcp.d.ts → null-fleet-bus-BCIRT_nV.d.ts} +37 -33
  30. package/dist/observability/index.d.ts +1 -1
  31. package/dist/{parallel-eternal-engine-0UwotoSx.d.ts → parallel-eternal-engine-CjAYGaCw.d.ts} +3 -3
  32. package/dist/{path-resolver-DVkEcIw8.d.ts → path-resolver-BnqXa9Ze.d.ts} +1 -1
  33. package/dist/{permission-C1A5whY5.d.ts → permission-V5BLOrY6.d.ts} +0 -4
  34. package/dist/{permission-policy-B2dK-T5N.d.ts → permission-policy-CBVx-d-8.d.ts} +1 -5
  35. package/dist/{plan-templates-Bprrzhbu.d.ts → plan-templates-DBgrTGPu.d.ts} +2 -2
  36. package/dist/{provider-runner-mXvXGSIw.d.ts → provider-runner-n3KkHT_w.d.ts} +1 -1
  37. package/dist/sdd/index.d.ts +6 -6
  38. package/dist/sdd/index.js +68 -98
  39. package/dist/sdd/index.js.map +1 -1
  40. package/dist/security/index.d.ts +2 -2
  41. package/dist/security/index.js +0 -8
  42. package/dist/security/index.js.map +1 -1
  43. package/dist/skills/index.js +1 -0
  44. package/dist/skills/index.js.map +1 -1
  45. package/dist/storage/index.d.ts +3 -3
  46. package/dist/storage/index.js +26 -2
  47. package/dist/storage/index.js.map +1 -1
  48. package/dist/{system-prompt-b61lOd49.d.ts → system-prompt-CA11g6Jo.d.ts} +1 -1
  49. package/dist/types/index.d.ts +13 -13
  50. package/dist/types/index.js +19 -10
  51. package/dist/types/index.js.map +1 -1
  52. package/dist/utils/index.d.ts +1 -1
  53. package/dist/utils/index.js +2 -1
  54. package/dist/utils/index.js.map +1 -1
  55. package/package.json +1 -1
@@ -611,6 +611,14 @@ interface EventMap {
611
611
  assigned: boolean;
612
612
  }[];
613
613
  };
614
+ /**
615
+ * The coordinator's max-concurrent subagent ceiling was changed at runtime
616
+ * (e.g. via `/fleet concurrency <n>`). `n` is the new ceiling. Lets the
617
+ * TUI/WebUI reflect the updated limit without polling the host.
618
+ */
619
+ 'concurrency.changed': {
620
+ n: number;
621
+ };
614
622
  /**
615
623
  * Git-worktree lifecycle, emitted by WorktreeManager. AutoPhase allocates one
616
624
  * worktree per phase so parallelizable phases run isolated, then merges them
@@ -1,23 +1,23 @@
1
- export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-0UwotoSx.js';
1
+ export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-CjAYGaCw.js';
2
2
  import { m as Provider, d as Context } from '../context-y87Jc5ei.js';
3
3
  import { a as Compactor, C as CompactReport } from '../compactor-D_ExJajC.js';
4
4
  import { M as MessageSelector } from '../selector-RvBR_YRW.js';
5
- import { E as EventBus } from '../events-CIplI98R.js';
6
- import { b as MiddlewareHandler } from '../system-prompt-b61lOd49.js';
5
+ import { E as EventBus } from '../events-BBAlxBuw.js';
6
+ import { b as MiddlewareHandler } from '../system-prompt-CA11g6Jo.js';
7
7
  import { a as SessionEventBridge } from '../session-event-bridge-CDHxcmQU.js';
8
- import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config--86aHSln.js';
9
- import { A as Agent, D as DoneCondition } from '../agent-subagent-runner-DRZ9-NnR.js';
10
- import { R as RunResult, S as SystemPromptContributor } from '../index-DKUvyTvV.js';
8
+ import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-Dy0CK_o6.js';
9
+ import { A as Agent, D as DoneCondition } from '../agent-subagent-runner-BmITbs1Q.js';
10
+ import { R as RunResult, S as SystemPromptContributor } from '../index-BN6i2Nfg.js';
11
11
  import { a as SkillLoader, b as SkillManifest, S as SkillEntry } from '../skill-CxuWrsKK.js';
12
12
  import { a as WstackPaths } from '../wstack-paths-eMXnY1_X.js';
13
13
  import '../retry-policy-CG3qvH_e.js';
14
14
  import '../models-registry-BcYJDKLm.js';
15
15
  import '../goal-store-C7jcumEh.js';
16
- import '../multi-agent-coordinator-CWnH-CiX.js';
16
+ import '../multi-agent-coordinator-BSBbZt0e.js';
17
17
  import 'node:events';
18
18
  import '../logger-DDd5C--Z.js';
19
19
  import '../observability-BhnVLBLS.js';
20
- import '../permission-C1A5whY5.js';
20
+ import '../permission-V5BLOrY6.js';
21
21
  import '../secret-scrubber-3MHDDAtm.js';
22
22
 
23
23
  interface SkillLoaderOptions {
@@ -1530,7 +1530,7 @@ ${errorDetails}`,
1530
1530
  const decision = await this.opts.permissionPolicy.evaluate(tool, use.input, ctx);
1531
1531
  let effectivePermission = decision.permission;
1532
1532
  const policy = this.opts.permissionPolicy;
1533
- const yolo = policy.getYolo?.() === true || policy.getYoloDestructive?.() === true || policy.getForceAllYolo?.() === true;
1533
+ const yolo = policy.getYolo?.() === true || policy.getYoloDestructive?.() === true;
1534
1534
  if (toolDangerousCaps.length > 0 && effectivePermission === "auto" && !yolo) {
1535
1535
  effectivePermission = "confirm";
1536
1536
  }
@@ -5560,6 +5560,71 @@ function providerStatusToCode(status, type) {
5560
5560
  if (status >= 500) return ERROR_CODES.PROVIDER_SERVER_ERROR;
5561
5561
  return ERROR_CODES.PROVIDER_INVALID_REQUEST;
5562
5562
  }
5563
+
5564
+ // src/coordination/coordinator/error-classifier.ts
5565
+ function classifySubagentError(err, hints = {}) {
5566
+ const cause = err instanceof Error ? { name: err.name, message: err.message, stack: err.stack } : void 0;
5567
+ if (err instanceof ProviderError) {
5568
+ const baseMessage2 = err.describe();
5569
+ return providerErrorToSubagentError(err, baseMessage2, cause);
5570
+ }
5571
+ const baseMessage = err instanceof Error ? err.message : String(err);
5572
+ if (err instanceof BudgetExceededError) {
5573
+ const map = {
5574
+ iterations: "budget_iterations",
5575
+ tool_calls: "budget_tool_calls",
5576
+ tokens: "budget_tokens",
5577
+ cost: "budget_cost",
5578
+ timeout: "budget_timeout",
5579
+ idle_timeout: "budget_timeout"
5580
+ };
5581
+ return {
5582
+ kind: map[err.kind],
5583
+ message: baseMessage,
5584
+ retryable: false,
5585
+ cause
5586
+ };
5587
+ }
5588
+ if (hints.parentAborted) {
5589
+ return { kind: "aborted_by_parent", message: baseMessage, retryable: false, cause };
5590
+ }
5591
+ const lower = baseMessage.toLowerCase();
5592
+ if (/agent aborted$/i.test(baseMessage)) {
5593
+ return { kind: "aborted_by_parent", message: baseMessage, retryable: false, cause };
5594
+ }
5595
+ if (/agent exhausted iteration limit$/i.test(baseMessage)) {
5596
+ return { kind: "budget_iterations", message: baseMessage, retryable: false, cause };
5597
+ }
5598
+ if (/empty response$/i.test(baseMessage)) {
5599
+ return { kind: "empty_response", message: baseMessage, retryable: false, cause };
5600
+ }
5601
+ if (/^tool failed: /i.test(baseMessage)) {
5602
+ return { kind: "tool_failed", message: baseMessage, retryable: false, cause };
5603
+ }
5604
+ if (lower.includes("bridge transport") || /bridge.*(closed|disconnect)/i.test(baseMessage)) {
5605
+ return { kind: "bridge_failed", message: baseMessage, retryable: false, cause };
5606
+ }
5607
+ if (/context length|max.*tokens?.*exceeded|prompt is too long/i.test(baseMessage)) {
5608
+ return { kind: "context_overflow", message: baseMessage, retryable: false, cause };
5609
+ }
5610
+ return { kind: "unknown", message: baseMessage, retryable: false, cause };
5611
+ }
5612
+ function providerErrorToSubagentError(err, message, cause) {
5613
+ const status = err.status;
5614
+ if (status === 429 || err.body?.type === "rate_limit_error") {
5615
+ return { kind: "provider_rate_limit", message, retryable: true, backoffMs: 5e3, cause };
5616
+ }
5617
+ if (status === 401 || status === 403 || err.body?.type === "authentication_error") {
5618
+ return { kind: "provider_auth", message, retryable: false, cause };
5619
+ }
5620
+ if (status === 408 || status === 0) {
5621
+ return { kind: "provider_timeout", message, retryable: true, cause };
5622
+ }
5623
+ if (status >= 500 && status < 600) {
5624
+ return { kind: "provider_5xx", message, retryable: true, backoffMs: 3e3, cause };
5625
+ }
5626
+ return { kind: "unknown", message, retryable: err.retryable, cause };
5627
+ }
5563
5628
  ({
5564
5629
  ...Object.fromEntries(
5565
5630
  ALL_AGENT_DEFINITIONS.map((d) => [d.config.role, d.config])
@@ -5856,7 +5921,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
5856
5921
  }
5857
5922
  async spawn(subagent) {
5858
5923
  const id = subagent.id || randomUUID();
5859
- subagent = this.withNickname(subagent, id);
5924
+ const cfg = this.withNickname(subagent, id);
5860
5925
  if (this.subagents.has(id)) {
5861
5926
  throw new Error(`Subagent id "${id}" already exists \u2014 refusing to overwrite`);
5862
5927
  }
@@ -5871,12 +5936,12 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
5871
5936
  maxConcurrent: this.config.maxConcurrent ?? 16
5872
5937
  };
5873
5938
  this.subagents.set(id, {
5874
- config: { ...subagent, id },
5939
+ config: { ...cfg, id },
5875
5940
  context,
5876
5941
  status: "idle",
5877
5942
  abortController: new AbortController()
5878
5943
  });
5879
- this.emit("subagent.started", { subagent: { ...subagent, id } });
5944
+ this.emit("subagent.started", { subagent: { ...cfg, id } });
5880
5945
  this.fleetBus?.emit({
5881
5946
  subagentId: id,
5882
5947
  ts: Date.now(),
@@ -6413,101 +6478,6 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
6413
6478
  return false;
6414
6479
  }
6415
6480
  };
6416
- function classifySubagentError(err, hints = {}) {
6417
- const cause = err instanceof Error ? { name: err.name, message: err.message, stack: err.stack } : void 0;
6418
- if (err instanceof ProviderError) {
6419
- const baseMessage2 = err.describe();
6420
- return providerErrorToSubagentError(err, baseMessage2, cause);
6421
- }
6422
- const baseMessage = err instanceof Error ? err.message : String(err);
6423
- if (err instanceof BudgetExceededError) {
6424
- const map = {
6425
- iterations: "budget_iterations",
6426
- tool_calls: "budget_tool_calls",
6427
- tokens: "budget_tokens",
6428
- cost: "budget_cost",
6429
- timeout: "budget_timeout",
6430
- idle_timeout: "budget_timeout"
6431
- };
6432
- return {
6433
- kind: map[err.kind],
6434
- message: baseMessage,
6435
- // Budgets are user-configured ceilings, not transient failures —
6436
- // retrying with the same budget will hit the same ceiling. The
6437
- // orchestrator must raise the budget or narrow the task first.
6438
- retryable: false,
6439
- cause
6440
- };
6441
- }
6442
- if (hints.parentAborted) {
6443
- return {
6444
- kind: "aborted_by_parent",
6445
- message: baseMessage,
6446
- retryable: false,
6447
- cause
6448
- };
6449
- }
6450
- const lower = baseMessage.toLowerCase();
6451
- if (/agent aborted$/i.test(baseMessage)) {
6452
- return {
6453
- kind: "aborted_by_parent",
6454
- message: baseMessage,
6455
- retryable: false,
6456
- cause
6457
- };
6458
- }
6459
- if (/agent exhausted iteration limit$/i.test(baseMessage)) {
6460
- return { kind: "budget_iterations", message: baseMessage, retryable: false, cause };
6461
- }
6462
- if (/empty response$/i.test(baseMessage)) {
6463
- return { kind: "empty_response", message: baseMessage, retryable: false, cause };
6464
- }
6465
- if (/^tool failed: /i.test(baseMessage)) {
6466
- return { kind: "tool_failed", message: baseMessage, retryable: false, cause };
6467
- }
6468
- if (lower.includes("bridge transport") || /bridge.*(closed|disconnect)/i.test(baseMessage)) {
6469
- return { kind: "bridge_failed", message: baseMessage, retryable: false, cause };
6470
- }
6471
- if (/context length|max.*tokens?.*exceeded|prompt is too long/i.test(baseMessage)) {
6472
- return { kind: "context_overflow", message: baseMessage, retryable: false, cause };
6473
- }
6474
- return {
6475
- kind: "unknown",
6476
- message: baseMessage,
6477
- retryable: false,
6478
- cause
6479
- };
6480
- }
6481
- function providerErrorToSubagentError(err, message, cause) {
6482
- const status = err.status;
6483
- if (status === 429 || err.body?.type === "rate_limit_error") {
6484
- return {
6485
- kind: "provider_rate_limit",
6486
- message,
6487
- retryable: true,
6488
- // Conservative default: 5s. Provider-specific code can override
6489
- // by emitting an error whose body carries an explicit hint.
6490
- backoffMs: 5e3,
6491
- cause
6492
- };
6493
- }
6494
- if (status === 401 || status === 403 || err.body?.type === "authentication_error") {
6495
- return { kind: "provider_auth", message, retryable: false, cause };
6496
- }
6497
- if (status === 408 || status === 0) {
6498
- return { kind: "provider_timeout", message, retryable: true, cause };
6499
- }
6500
- if (status >= 500 && status < 600) {
6501
- return {
6502
- kind: "provider_5xx",
6503
- message,
6504
- retryable: true,
6505
- backoffMs: 3e3,
6506
- cause
6507
- };
6508
- }
6509
- return { kind: "unknown", message, retryable: err.retryable, cause };
6510
- }
6511
6481
 
6512
6482
  // src/execution/parallel-eternal-engine.ts
6513
6483
  function sleep2(ms) {