open-multi-agent-kit 0.90.4 → 0.90.5

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 (89) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +8 -8
  3. package/dist/core/adaptorch-bridge.d.ts +14 -21
  4. package/dist/core/adaptorch-bridge.d.ts.map +1 -1
  5. package/dist/core/adaptorch-bridge.js +11 -18
  6. package/dist/core/adaptorch-bridge.js.map +1 -1
  7. package/dist/core/agent-session.d.ts +6 -39
  8. package/dist/core/agent-session.d.ts.map +1 -1
  9. package/dist/core/agent-session.js +7 -99
  10. package/dist/core/agent-session.js.map +1 -1
  11. package/dist/core/context-budget-v2-planner.d.ts.map +1 -1
  12. package/dist/core/context-budget-v2-planner.js +10 -2
  13. package/dist/core/context-budget-v2-planner.js.map +1 -1
  14. package/dist/core/context-budget-v2-types.d.ts +7 -1
  15. package/dist/core/context-budget-v2-types.d.ts.map +1 -1
  16. package/dist/core/context-budget-v2-types.js.map +1 -1
  17. package/dist/core/reasoning-router-bias.d.ts +11 -23
  18. package/dist/core/reasoning-router-bias.d.ts.map +1 -1
  19. package/dist/core/reasoning-router-bias.js +9 -18
  20. package/dist/core/reasoning-router-bias.js.map +1 -1
  21. package/dist/core/reasoning-router-resolver.d.ts +44 -0
  22. package/dist/core/reasoning-router-resolver.d.ts.map +1 -0
  23. package/dist/core/reasoning-router-resolver.js +79 -0
  24. package/dist/core/reasoning-router-resolver.js.map +1 -0
  25. package/dist/core/reasoning-router-v4-weights.d.ts +28 -72
  26. package/dist/core/reasoning-router-v4-weights.d.ts.map +1 -1
  27. package/dist/core/reasoning-router-v4-weights.js +16 -60
  28. package/dist/core/reasoning-router-v4-weights.js.map +1 -1
  29. package/dist/core/reasoning-router-v4.d.ts +25 -70
  30. package/dist/core/reasoning-router-v4.d.ts.map +1 -1
  31. package/dist/core/reasoning-router-v4.js +46 -144
  32. package/dist/core/reasoning-router-v4.js.map +1 -1
  33. package/dist/core/router-feedback-collector.d.ts +13 -16
  34. package/dist/core/router-feedback-collector.d.ts.map +1 -1
  35. package/dist/core/router-feedback-collector.js +5 -8
  36. package/dist/core/router-feedback-collector.js.map +1 -1
  37. package/dist/core/slash-commands.d.ts.map +1 -1
  38. package/dist/core/slash-commands.js +1 -1
  39. package/dist/core/slash-commands.js.map +1 -1
  40. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  41. package/dist/modes/interactive/interactive-mode.js +16 -98
  42. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  43. package/docs/usage.md +11 -12
  44. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  45. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  46. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  47. package/examples/extensions/gondolin/package-lock.json +2 -2
  48. package/examples/extensions/gondolin/package.json +1 -1
  49. package/examples/extensions/sandbox/package-lock.json +2 -2
  50. package/examples/extensions/sandbox/package.json +1 -1
  51. package/examples/extensions/subagent/agent-capability-router.test.ts +123 -0
  52. package/examples/extensions/subagent/agent-capability-router.ts +274 -0
  53. package/examples/extensions/subagent/agents/planner.md +3 -0
  54. package/examples/extensions/subagent/agents/reviewer.md +3 -0
  55. package/examples/extensions/subagent/agents/scout.md +3 -0
  56. package/examples/extensions/subagent/agents/worker.md +2 -0
  57. package/examples/extensions/subagent/agents.ts +14 -0
  58. package/examples/extensions/subagent/capabilities.ts +368 -0
  59. package/examples/extensions/subagent/domain-profiles.ts +1089 -0
  60. package/examples/extensions/subagent/index.ts +71 -3
  61. package/examples/extensions/with-deps/package-lock.json +2 -2
  62. package/examples/extensions/with-deps/package.json +1 -1
  63. package/examples/sdk/12-full-control.ts +1 -1
  64. package/npm-shrinkwrap.json +12 -12
  65. package/package.json +4 -4
  66. package/dist/core/compactor.d.ts +0 -42
  67. package/dist/core/compactor.d.ts.map +0 -1
  68. package/dist/core/compactor.js +0 -128
  69. package/dist/core/compactor.js.map +0 -1
  70. package/dist/core/reasoning-router-v2.d.ts +0 -94
  71. package/dist/core/reasoning-router-v2.d.ts.map +0 -1
  72. package/dist/core/reasoning-router-v2.js +0 -288
  73. package/dist/core/reasoning-router-v2.js.map +0 -1
  74. package/dist/core/reasoning-router-v3.d.ts +0 -15
  75. package/dist/core/reasoning-router-v3.d.ts.map +0 -1
  76. package/dist/core/reasoning-router-v3.js +0 -193
  77. package/dist/core/reasoning-router-v3.js.map +0 -1
  78. package/dist/core/reasoning-router-weights.d.ts +0 -155
  79. package/dist/core/reasoning-router-weights.d.ts.map +0 -1
  80. package/dist/core/reasoning-router-weights.js +0 -204
  81. package/dist/core/reasoning-router-weights.js.map +0 -1
  82. package/dist/core/reasoning-router.d.ts +0 -44
  83. package/dist/core/reasoning-router.d.ts.map +0 -1
  84. package/dist/core/reasoning-router.js +0 -138
  85. package/dist/core/reasoning-router.js.map +0 -1
  86. package/dist/core/token-optimizer.d.ts +0 -58
  87. package/dist/core/token-optimizer.d.ts.map +0 -1
  88. package/dist/core/token-optimizer.js +0 -179
  89. package/dist/core/token-optimizer.js.map +0 -1
@@ -32,10 +32,7 @@ import { ExtensionRunner, wrapRegisteredTools, } from "./extensions/index.js";
32
32
  import { emitSessionShutdownEvent } from "./extensions/runner.js";
33
33
  import { assertLoadoutAccess, decideLoadoutAccess } from "./loadout-access-policy.js";
34
34
  import { expandPromptTemplate } from "./prompt-templates.js";
35
- import { classifyTask, resolveThinkingLevel } from "./reasoning-router.js";
36
35
  import { getBiasStepsForCell, getDefaultRouterBiasSnapshotPath, parseRouterBiasSnapshot, } from "./reasoning-router-bias.js";
37
- import { classifyTaskV2, DEFAULT_WEIGHTS, resolveThinkingLevelV2ForAuto, } from "./reasoning-router-v2.js";
38
- import { classifyTaskV3, resolveThinkingLevelV3ForAuto } from "./reasoning-router-v3.js";
39
36
  import { classifyTaskV4, resolveThinkingLevelV4WithUncertainty } from "./reasoning-router-v4.js";
40
37
  import { appendRouterFeedbackRecord, } from "./router-feedback-collector.js";
41
38
  import { detectSandboxBackend } from "./sandbox/backend.js";
@@ -109,18 +106,9 @@ export class AgentSession {
109
106
  * auto-resolved levels are never written to the user's persisted settings.
110
107
  */
111
108
  _thinkingMode = "manual";
112
- /**
113
- * Reasoning router version used by auto thinking mode. "v1" (default) keeps
114
- * the frozen v1 classifyTask/resolveThinkingLevel; "v2" uses the Goal 004
115
- * weighted router; "v3" uses the Goal 007 calibrated classifier; "v4" uses
116
- * the Goal 009 confidence-bearing classifier (classifyTaskV4 +
117
- * resolveThinkingLevelV4WithUncertainty). Default "v1" so behavior is
118
- * unchanged until explicitly opted in.
119
- */
120
- _thinkingRouterVersion = "v1";
121
109
  /**
122
110
  * N=8 ring buffer of recent auto-turn task classes (newest first), feeding
123
- * the v2/v3 classifiers' multi-turn prior feature. Never persisted to settings.
111
+ * v4's multi-turn prior feature. Never persisted to settings.
124
112
  */
125
113
  _taskClassHistory = [];
126
114
  /**
@@ -1431,18 +1419,6 @@ export class AgentSession {
1431
1419
  setThinkingMode(mode) {
1432
1420
  this._thinkingMode = mode;
1433
1421
  }
1434
- /**
1435
- * Reasoning router version selection for auto thinking mode.
1436
- * Default "v1". Switching to "v2", "v3", or "v4" activates the
1437
- * corresponding opt-in router; the multi-turn history buffer is only
1438
- * consulted there.
1439
- */
1440
- get thinkingRouterVersion() {
1441
- return this._thinkingRouterVersion;
1442
- }
1443
- setThinkingRouterVersion(version) {
1444
- this._thinkingRouterVersion = version;
1445
- }
1446
1422
  /**
1447
1423
  * In auto thinking mode, resolve and apply this turn's thinking level from the
1448
1424
  * prompt content. Updates agent state, records the change in the session, and
@@ -1455,79 +1431,12 @@ export class AgentSession {
1455
1431
  return;
1456
1432
  if (!this.supportsThinking())
1457
1433
  return;
1458
- if (this._thinkingRouterVersion === "v4") {
1459
- this._applyAutoThinkingLevelV4(promptText);
1460
- return;
1461
- }
1462
- if (this._thinkingRouterVersion === "v3") {
1463
- this._applyAutoThinkingLevelV3(promptText);
1464
- return;
1465
- }
1466
- if (this._thinkingRouterVersion === "v2") {
1467
- this._applyAutoThinkingLevelV2(promptText);
1468
- return;
1469
- }
1470
- const taskClass = classifyTask({ prompt: promptText });
1471
- const resolved = resolveThinkingLevel(taskClass, this.getAvailableThinkingLevels());
1472
- const previousLevel = this.agent.state.thinkingLevel;
1473
- if (resolved === previousLevel)
1474
- return;
1475
- this.agent.state.thinkingLevel = resolved;
1476
- this.sessionManager.appendThinkingLevelChange(resolved);
1477
- this._emit({ type: "thinking_level_changed", level: resolved });
1478
- }
1479
- /**
1480
- * v2 auto-mode resolver (Goal 004). Builds the caller-side features the pure
1481
- * classifier cannot reach on its own (multi-turn ring buffer, context-pressure
1482
- * bucket), then applies classifyTaskV2 + resolveThinkingLevelV2ForAuto. The
1483
- * resolved class is pushed to the N=8 history for the NEXT turn's prior.
1484
- */
1485
- _applyAutoThinkingLevelV2(promptText) {
1486
- const availableLevels = this.getAvailableThinkingLevels();
1487
- const taskClass = classifyTaskV2({
1488
- prompt: promptText,
1489
- history: this._taskClassHistory,
1490
- pressureBucket: this._computePressureBucket(),
1491
- }, DEFAULT_WEIGHTS);
1492
- this._taskClassHistory.unshift(taskClass);
1493
- if (this._taskClassHistory.length > 8)
1494
- this._taskClassHistory.length = 8;
1495
- const resolved = resolveThinkingLevelV2ForAuto(taskClass, availableLevels, undefined);
1496
- const previousLevel = this.agent.state.thinkingLevel;
1497
- if (resolved === previousLevel)
1498
- return;
1499
- this.agent.state.thinkingLevel = resolved;
1500
- this.sessionManager.appendThinkingLevelChange(resolved);
1501
- this._emit({ type: "thinking_level_changed", level: resolved });
1502
- }
1503
- /**
1504
- * v3 auto-mode resolver (Goal 007). Reuses the same N=8 recent-class history
1505
- * and context-pressure bucket as v2, but routes through the v3 classifier and
1506
- * resolver pair.
1507
- */
1508
- _applyAutoThinkingLevelV3(promptText) {
1509
- const availableLevels = this.getAvailableThinkingLevels();
1510
- const taskClass = classifyTaskV3({
1511
- prompt: promptText,
1512
- history: this._taskClassHistory,
1513
- pressureBucket: this._computePressureBucket(),
1514
- });
1515
- this._taskClassHistory.unshift(taskClass);
1516
- if (this._taskClassHistory.length > 8)
1517
- this._taskClassHistory.length = 8;
1518
- const resolved = resolveThinkingLevelV3ForAuto(taskClass, availableLevels, undefined);
1519
- const previousLevel = this.agent.state.thinkingLevel;
1520
- if (resolved === previousLevel)
1521
- return;
1522
- this.agent.state.thinkingLevel = resolved;
1523
- this.sessionManager.appendThinkingLevelChange(resolved);
1524
- this._emit({ type: "thinking_level_changed", level: resolved });
1434
+ this._applyAutoThinkingLevelV4(promptText);
1525
1435
  }
1526
1436
  /**
1527
- * v4 auto-mode resolver (Goal 009 Wave 3 Lane V1; wired to the opt-in
1528
- * learning bias by Goal 010 Lane I). Reuses the same N=8 recent-class
1529
- * history and context-pressure bucket as v2/v3, routed through the
1530
- * confidence-bearing v4 classifier and its uncertainty-aware resolver. No
1437
+ * Auto-mode resolver. Reuses the N=8 recent-class history and
1438
+ * context-pressure bucket, routed through the confidence-bearing v4 classifier
1439
+ * and its uncertainty-aware resolver. No
1531
1440
  * `laneType` applies to the main session (always "none"/`undefined`);
1532
1441
  * `hint` is permanently `null` -- the Adaptorch advisory bridge has no
1533
1442
  * transport wired into the session (out of this lane's scope; see
@@ -1626,9 +1535,8 @@ export class AgentSession {
1626
1535
  * Locally derives the same three bounded, privacy-safe feedback-ledger
1627
1536
  * features (`lenBucket`, `hadFence`, `hadDiff`) the v4 classifier computes
1628
1537
  * internally (reasoning-router-v4.ts keeps those helpers file-private, so
1629
- * they cannot be imported here). Mirrors reasoning-router-v2.ts's
1630
- * `clampLenBucket` and reasoning-router-v4.ts's `hasCodeFence`/
1631
- * `hasDiffMarkers` byte-for-byte. Operates on the same trimmed prompt text
1538
+ * they cannot be imported here). Mirrors reasoning-router-v4.ts's
1539
+ * length-bucket, `hasCodeFence`, and `hasDiffMarkers` helpers. Operates on the same trimmed prompt text
1632
1540
  * the classifier scores; never returns raw prompt content or its exact
1633
1541
  * length, only the clamped [0,7] bucket and two booleans.
1634
1542
  */