@wrongstack/core 0.10.0 → 0.10.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 (42) hide show
  1. package/dist/{agent-bridge-DBBGP5O4.d.ts → agent-bridge-D_XcS2HL.d.ts} +3 -1
  2. package/dist/{agent-subagent-runner-KwufTWwn.d.ts → agent-subagent-runner-DuRtZmhl.d.ts} +13 -3
  3. package/dist/coordination/index.d.ts +8 -8
  4. package/dist/coordination/index.js +83 -21
  5. package/dist/coordination/index.js.map +1 -1
  6. package/dist/defaults/index.d.ts +11 -11
  7. package/dist/defaults/index.js +89 -23
  8. package/dist/defaults/index.js.map +1 -1
  9. package/dist/{events-Bw1K5E6K.d.ts → events-BrQiweXN.d.ts} +1 -1
  10. package/dist/execution/index.d.ts +6 -6
  11. package/dist/execution/index.js +32 -10
  12. package/dist/execution/index.js.map +1 -1
  13. package/dist/extension/index.d.ts +2 -2
  14. package/dist/{index-DgQWnZxP.d.ts → index-DAHEM_II.d.ts} +1 -1
  15. package/dist/{index-DIt5TIaF.d.ts → index-DnBHrz2y.d.ts} +2 -2
  16. package/dist/index.d.ts +17 -17
  17. package/dist/index.js +226 -101
  18. package/dist/index.js.map +1 -1
  19. package/dist/infrastructure/index.d.ts +2 -2
  20. package/dist/kernel/index.d.ts +3 -3
  21. package/dist/kernel/index.js.map +1 -1
  22. package/dist/{multi-agent-C1O8EFzb.d.ts → multi-agent-C8Z1i__e.d.ts} +2 -2
  23. package/dist/{multi-agent-coordinator-DoVSBFNx.d.ts → multi-agent-coordinator-CjG-FZKj.d.ts} +8 -3
  24. package/dist/{null-fleet-bus-T-s3JaOt.d.ts → null-fleet-bus-B3WdVY9i.d.ts} +28 -23
  25. package/dist/observability/index.d.ts +1 -1
  26. package/dist/{path-resolver-BfyK-I7w.d.ts → path-resolver-DumKAi0n.d.ts} +1 -1
  27. package/dist/{plan-templates-BWs6Je7j.d.ts → plan-templates-BUP4o-ds.d.ts} +2 -2
  28. package/dist/{provider-runner-BmPe2RuU.d.ts → provider-runner-Dlv8Fvw9.d.ts} +1 -1
  29. package/dist/sdd/index.d.ts +4 -4
  30. package/dist/sdd/index.js +30 -8
  31. package/dist/sdd/index.js.map +1 -1
  32. package/dist/security/index.js +3 -3
  33. package/dist/security/index.js.map +1 -1
  34. package/dist/{session-reader-CCSBfQmd.d.ts → session-reader-bfgsy2a0.d.ts} +7 -3
  35. package/dist/storage/index.d.ts +29 -10
  36. package/dist/storage/index.js +131 -65
  37. package/dist/storage/index.js.map +1 -1
  38. package/dist/{tool-executor-D7RxLtg4.d.ts → tool-executor-D87-_5Of.d.ts} +1 -1
  39. package/dist/types/index.d.ts +8 -8
  40. package/dist/types/index.js +25 -5
  41. package/dist/types/index.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { E as EventBus } from './events-Bw1K5E6K.js';
1
+ import { E as EventBus } from './events-BrQiweXN.js';
2
2
  import { a as Logger } from './logger-DDd5C--Z.js';
3
3
  import { T as Tracer } from './observability-BhnVLBLS.js';
4
4
  import { m as Provider, p as Request, d as Context, q as Response } from './context-7u93AcGD.js';
@@ -1,8 +1,8 @@
1
1
  import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../task-graph-D1YQbpxF.js';
2
- import { E as EventBus } from '../events-Bw1K5E6K.js';
3
- import { D as DoneCondition, u as TaskResult } from '../multi-agent-C1O8EFzb.js';
4
- import { c as Agent } from '../index-DgQWnZxP.js';
5
- import { A as AgentFactory } from '../agent-subagent-runner-KwufTWwn.js';
2
+ import { E as EventBus } from '../events-BrQiweXN.js';
3
+ import { D as DoneCondition, u as TaskResult } from '../multi-agent-C8Z1i__e.js';
4
+ import { c as Agent } from '../index-DAHEM_II.js';
5
+ import { A as AgentFactory } from '../agent-subagent-runner-DuRtZmhl.js';
6
6
  import '../context-7u93AcGD.js';
7
7
  import '../logger-DDd5C--Z.js';
8
8
  import '../system-prompt-CM6zOhd2.js';
package/dist/sdd/index.js CHANGED
@@ -2732,8 +2732,9 @@ var SubagentBudget = class _SubagentBudget {
2732
2732
  if (elapsedMs !== void 0) {
2733
2733
  const idle = this.idleMs();
2734
2734
  if (this.limits.idleTimeoutMs !== void 0 && idle > this.limits.idleTimeoutMs) {
2735
- exceeded.push({ kind: "timeout", used: idle, limit: this.limits.idleTimeoutMs });
2736
- } else if (this.limits.timeoutMs !== void 0 && elapsedMs > this.limits.timeoutMs) {
2735
+ exceeded.push({ kind: "idle_timeout", used: idle, limit: this.limits.idleTimeoutMs });
2736
+ }
2737
+ if (this.limits.timeoutMs !== void 0 && elapsedMs > this.limits.timeoutMs) {
2737
2738
  exceeded.push({ kind: "timeout", used: elapsedMs, limit: this.limits.timeoutMs });
2738
2739
  }
2739
2740
  }
@@ -5712,10 +5713,6 @@ var DefaultMultiAgentCoordinator = class extends EventEmitter {
5712
5713
  this.drainPendingAsAborted("Coordinator stopAll() drained the pending queue");
5713
5714
  await Promise.allSettled([...this.subagents.keys()].map((id) => this.stop(id)));
5714
5715
  }
5715
- async remove(subagentId) {
5716
- await this.stop(subagentId);
5717
- this.subagents.delete(subagentId);
5718
- }
5719
5716
  /**
5720
5717
  * Get current coordinator stats for monitoring/debugging.
5721
5718
  */
@@ -5981,7 +5978,7 @@ var DefaultMultiAgentCoordinator = class extends EventEmitter {
5981
5978
  durationMs: Date.now() - startTime
5982
5979
  };
5983
5980
  } catch (err) {
5984
- const status = err instanceof BudgetExceededError && err.kind === "timeout" ? "timeout" : subagent.abortController.signal.aborted ? "stopped" : "failed";
5981
+ const status = err instanceof BudgetExceededError && (err.kind === "timeout" || err.kind === "idle_timeout") ? "timeout" : subagent.abortController.signal.aborted ? "stopped" : "failed";
5985
5982
  const usage = budget.usage();
5986
5983
  result = {
5987
5984
  subagentId,
@@ -6135,6 +6132,30 @@ var DefaultMultiAgentCoordinator = class extends EventEmitter {
6135
6132
  });
6136
6133
  }
6137
6134
  }
6135
+ /**
6136
+ * Stop a subagent and remove it from the coordinator. Releases all
6137
+ * associated resources (AbortController, context, budget state).
6138
+ * The subagent entry is deleted so the id can be reused in a future spawn.
6139
+ */
6140
+ async remove(subagentId) {
6141
+ const subagent = this.subagents.get(subagentId);
6142
+ if (!subagent) return;
6143
+ if (subagent.status === "running" || subagent.status === "idle") {
6144
+ this.terminating.add(subagentId);
6145
+ subagent.abortController.abort();
6146
+ subagent.status = "stopped";
6147
+ }
6148
+ this.subagents.delete(subagentId);
6149
+ this.terminating.delete(subagentId);
6150
+ this.pendingTasks = this.pendingTasks.filter((t) => t.subagentId !== subagentId);
6151
+ this.fleetBus?.emit({
6152
+ subagentId,
6153
+ ts: Date.now(),
6154
+ type: "subagent.removed",
6155
+ payload: { subagentId }
6156
+ });
6157
+ this.emitCoordinatorStats();
6158
+ }
6138
6159
  isDone() {
6139
6160
  if (this.config.doneCondition.type === "all_tasks_done") {
6140
6161
  return this.pendingTasks.length === 0 && this.inFlight === 0;
@@ -6158,7 +6179,8 @@ function classifySubagentError(err, hints = {}) {
6158
6179
  tool_calls: "budget_tool_calls",
6159
6180
  tokens: "budget_tokens",
6160
6181
  cost: "budget_cost",
6161
- timeout: "budget_timeout"
6182
+ timeout: "budget_timeout",
6183
+ idle_timeout: "budget_timeout"
6162
6184
  };
6163
6185
  return {
6164
6186
  kind: map[err.kind],