@wrongstack/core 0.5.6 → 0.5.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 (42) hide show
  1. package/dist/{agent-bridge-B07AYFBk.d.ts → agent-bridge-BKNiE1VH.d.ts} +1 -1
  2. package/dist/{compactor-BWhJXxsW.d.ts → compactor-RIPuTtWK.d.ts} +1 -1
  3. package/dist/{config-BgM0BIpz.d.ts → config-BGGuP_Ar.d.ts} +1 -1
  4. package/dist/{context-CLZXPPYk.d.ts → context-CDRyrkKQ.d.ts} +7 -0
  5. package/dist/coordination/index.d.ts +9 -9
  6. package/dist/coordination/index.js +301 -58
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +18 -18
  9. package/dist/defaults/index.js +124 -61
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/{events-qnDZbrtb.d.ts → events-DPQKFX7W.d.ts} +1 -1
  12. package/dist/execution/index.d.ts +18 -11
  13. package/dist/execution/index.js +19 -3
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/extension/index.d.ts +6 -6
  16. package/dist/{index-BDnUCRvL.d.ts → index-Bf9Bpkdc.d.ts} +351 -15
  17. package/dist/{index-DPLJw_ZI.d.ts → index-j2WyAyML.d.ts} +20 -5
  18. package/dist/index.d.ts +107 -27
  19. package/dist/index.js +417 -84
  20. package/dist/index.js.map +1 -1
  21. package/dist/infrastructure/index.d.ts +6 -6
  22. package/dist/kernel/index.d.ts +9 -9
  23. package/dist/{mcp-servers-CSMfaBuL.d.ts → mcp-servers-DBdh3cee.d.ts} +3 -3
  24. package/dist/models/index.d.ts +2 -2
  25. package/dist/{multi-agent-Cv8wk47i.d.ts → multi-agent-Cpp7FXUl.d.ts} +11 -3
  26. package/dist/observability/index.d.ts +2 -2
  27. package/dist/{path-resolver-DiCUvEg6.d.ts → path-resolver--g_hKJ7V.d.ts} +2 -2
  28. package/dist/{plan-templates-DaxTCPfk.d.ts → plan-templates-Bveo2W8n.d.ts} +4 -4
  29. package/dist/{provider-runner-3SHqk9zB.d.ts → provider-runner-hl4Il3xS.d.ts} +3 -3
  30. package/dist/{retry-policy-LLUxJmYY.d.ts → retry-policy-LKS8MHsB.d.ts} +1 -1
  31. package/dist/sdd/index.d.ts +3 -3
  32. package/dist/{secret-scrubber-Z_VXuXQT.d.ts → secret-scrubber-BzQR5BiL.d.ts} +1 -1
  33. package/dist/{secret-scrubber-BhJTNr9v.d.ts → secret-scrubber-CfMdAJ_l.d.ts} +1 -1
  34. package/dist/security/index.d.ts +3 -3
  35. package/dist/{selector-DB2-byKH.d.ts → selector-C7HqnZJU.d.ts} +1 -1
  36. package/dist/{session-reader-4jxsYLZ8.d.ts → session-reader-CzfRA6Vk.d.ts} +1 -1
  37. package/dist/storage/index.d.ts +5 -5
  38. package/dist/{system-prompt-DI4Dtc1I.d.ts → system-prompt-Dl2QY1_B.d.ts} +1 -1
  39. package/dist/{tool-executor-DSvmOBe6.d.ts → tool-executor-DbAFkHdP.d.ts} +4 -4
  40. package/dist/types/index.d.ts +15 -15
  41. package/dist/utils/index.d.ts +1 -1
  42. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { U as Usage, a2 as Context, z as ToolProgressEvent, v as Tool } from './context-CLZXPPYk.js';
1
+ import { U as Usage, a2 as Context, z as ToolProgressEvent, v as Tool } from './context-CDRyrkKQ.js';
2
2
 
3
3
  /**
4
4
  * EventBus — observe-only typed event bus.
@@ -1,19 +1,19 @@
1
- export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-DSvmOBe6.js';
2
- import { g as Provider, a2 as Context } from '../context-CLZXPPYk.js';
3
- import { a as Compactor, C as CompactReport } from '../compactor-BWhJXxsW.js';
4
- import { M as MessageSelector } from '../selector-DB2-byKH.js';
5
- import { E as EventBus } from '../events-qnDZbrtb.js';
6
- import { c as MiddlewareHandler } from '../system-prompt-DI4Dtc1I.js';
7
- import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-BgM0BIpz.js';
8
- import { r as Agent, R as RunResult } from '../index-DPLJw_ZI.js';
9
- import { D as DoneCondition } from '../multi-agent-Cv8wk47i.js';
1
+ export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, T as ToolExecutor } from '../tool-executor-DbAFkHdP.js';
2
+ import { g as Provider, a2 as Context } from '../context-CDRyrkKQ.js';
3
+ import { a as Compactor, C as CompactReport } from '../compactor-RIPuTtWK.js';
4
+ import { M as MessageSelector } from '../selector-C7HqnZJU.js';
5
+ import { E as EventBus } from '../events-DPQKFX7W.js';
6
+ import { c as MiddlewareHandler } from '../system-prompt-Dl2QY1_B.js';
7
+ import { e as ContextWindowAggressiveOn, i as ContextWindowPolicy } from '../config-BGGuP_Ar.js';
8
+ import { r as Agent, R as RunResult } from '../index-j2WyAyML.js';
9
+ import { D as DoneCondition } from '../multi-agent-Cpp7FXUl.js';
10
10
  import { a as SkillLoader, b as SkillManifest, S as SkillEntry } from '../skill-CxuWrsKK.js';
11
11
  import { W as WstackPaths } from '../wstack-paths-86YPFktR.js';
12
- import '../retry-policy-LLUxJmYY.js';
12
+ import '../retry-policy-LKS8MHsB.js';
13
13
  import '../models-registry-Y2xbog0E.js';
14
14
  import '../logger-BMQgxvdy.js';
15
15
  import '../observability-BhnVLBLS.js';
16
- import '../secret-scrubber-BhJTNr9v.js';
16
+ import '../secret-scrubber-CfMdAJ_l.js';
17
17
 
18
18
  interface SkillLoaderOptions {
19
19
  paths: WstackPaths;
@@ -252,6 +252,13 @@ interface AutonomousRunnerOptions {
252
252
  toolCalls: number;
253
253
  }) => void;
254
254
  onDone?: (result: AutonomousResult) => void;
255
+ /**
256
+ * When true and `doneCondition.type === 'directive'`, the runner
257
+ * runs the agent with `autonomousContinue: true` so the agent loop
258
+ * handles its own [continue]/[done] markers internally (no outer
259
+ * re-invocation needed). The runner still provides iteration/timeouts.
260
+ */
261
+ enableAutonomousContinue?: boolean;
255
262
  }
256
263
  declare class AutonomousRunner {
257
264
  private readonly opts;
@@ -1414,6 +1414,14 @@ var DoneConditionChecker = class {
1414
1414
  };
1415
1415
  }
1416
1416
  break;
1417
+ case "directive":
1418
+ if (this.condition.maxIterations && state.iterations >= this.condition.maxIterations) {
1419
+ return { done: true, reason: `max iterations (${this.condition.maxIterations}) reached`, ...state };
1420
+ }
1421
+ if (this.condition.maxToolCalls && state.toolCalls >= this.condition.maxToolCalls) {
1422
+ return { done: true, reason: `max tool calls (${this.condition.maxToolCalls}) reached`, ...state };
1423
+ }
1424
+ break;
1417
1425
  }
1418
1426
  return { done: false, iterations: state.iterations, toolCalls: state.toolCalls };
1419
1427
  }
@@ -1433,10 +1441,16 @@ var AutonomousRunner = class {
1433
1441
  const offToolExecuted = this.opts.agent.events?.on?.("tool.executed", () => {
1434
1442
  this.toolCalls++;
1435
1443
  });
1444
+ const offIterationCompleted = this.opts.agent.events?.on?.("iteration.completed", () => {
1445
+ if (this.opts.enableAutonomousContinue && this.opts.doneCondition.type === "directive") {
1446
+ this.iterations++;
1447
+ }
1448
+ });
1436
1449
  try {
1437
1450
  return await this.runLoop();
1438
1451
  } finally {
1439
1452
  offToolExecuted?.();
1453
+ offIterationCompleted?.();
1440
1454
  }
1441
1455
  }
1442
1456
  async runLoop() {
@@ -1460,12 +1474,14 @@ var AutonomousRunner = class {
1460
1474
  const ctrl = new AbortController();
1461
1475
  const timeout = setTimeout(() => ctrl.abort(), this.opts.iterationTimeoutMs ?? 3e4);
1462
1476
  try {
1477
+ const isDirectiveMode = this.opts.doneCondition.type === "directive" && this.opts.enableAutonomousContinue;
1463
1478
  const result = await this.opts.agent.run("", {
1464
1479
  signal: ctrl.signal,
1465
- maxIterations: 1,
1466
- executionStrategy: "sequential"
1480
+ maxIterations: isDirectiveMode ? this.opts.doneCondition.maxIterations ?? 100 : 1,
1481
+ executionStrategy: "sequential",
1482
+ autonomousContinue: isDirectiveMode ? true : void 0
1467
1483
  });
1468
- this.iterations++;
1484
+ if (!isDirectiveMode) this.iterations++;
1469
1485
  if (result.status === "done") {
1470
1486
  this.lastOutput = result.finalText;
1471
1487
  }