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.
- package/CHANGELOG.md +22 -0
- package/README.md +8 -8
- package/dist/core/adaptorch-bridge.d.ts +14 -21
- package/dist/core/adaptorch-bridge.d.ts.map +1 -1
- package/dist/core/adaptorch-bridge.js +11 -18
- package/dist/core/adaptorch-bridge.js.map +1 -1
- package/dist/core/agent-session.d.ts +6 -39
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -99
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/context-budget-v2-planner.d.ts.map +1 -1
- package/dist/core/context-budget-v2-planner.js +10 -2
- package/dist/core/context-budget-v2-planner.js.map +1 -1
- package/dist/core/context-budget-v2-types.d.ts +7 -1
- package/dist/core/context-budget-v2-types.d.ts.map +1 -1
- package/dist/core/context-budget-v2-types.js.map +1 -1
- package/dist/core/reasoning-router-bias.d.ts +11 -23
- package/dist/core/reasoning-router-bias.d.ts.map +1 -1
- package/dist/core/reasoning-router-bias.js +9 -18
- package/dist/core/reasoning-router-bias.js.map +1 -1
- package/dist/core/reasoning-router-resolver.d.ts +44 -0
- package/dist/core/reasoning-router-resolver.d.ts.map +1 -0
- package/dist/core/reasoning-router-resolver.js +79 -0
- package/dist/core/reasoning-router-resolver.js.map +1 -0
- package/dist/core/reasoning-router-v4-weights.d.ts +28 -72
- package/dist/core/reasoning-router-v4-weights.d.ts.map +1 -1
- package/dist/core/reasoning-router-v4-weights.js +16 -60
- package/dist/core/reasoning-router-v4-weights.js.map +1 -1
- package/dist/core/reasoning-router-v4.d.ts +25 -70
- package/dist/core/reasoning-router-v4.d.ts.map +1 -1
- package/dist/core/reasoning-router-v4.js +46 -144
- package/dist/core/reasoning-router-v4.js.map +1 -1
- package/dist/core/router-feedback-collector.d.ts +13 -16
- package/dist/core/router-feedback-collector.d.ts.map +1 -1
- package/dist/core/router-feedback-collector.js +5 -8
- package/dist/core/router-feedback-collector.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +16 -98
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/usage.md +11 -12
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/agent-capability-router.test.ts +123 -0
- package/examples/extensions/subagent/agent-capability-router.ts +274 -0
- package/examples/extensions/subagent/agents/planner.md +3 -0
- package/examples/extensions/subagent/agents/reviewer.md +3 -0
- package/examples/extensions/subagent/agents/scout.md +3 -0
- package/examples/extensions/subagent/agents/worker.md +2 -0
- package/examples/extensions/subagent/agents.ts +14 -0
- package/examples/extensions/subagent/capabilities.ts +368 -0
- package/examples/extensions/subagent/domain-profiles.ts +1089 -0
- package/examples/extensions/subagent/index.ts +71 -3
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
- package/dist/core/compactor.d.ts +0 -42
- package/dist/core/compactor.d.ts.map +0 -1
- package/dist/core/compactor.js +0 -128
- package/dist/core/compactor.js.map +0 -1
- package/dist/core/reasoning-router-v2.d.ts +0 -94
- package/dist/core/reasoning-router-v2.d.ts.map +0 -1
- package/dist/core/reasoning-router-v2.js +0 -288
- package/dist/core/reasoning-router-v2.js.map +0 -1
- package/dist/core/reasoning-router-v3.d.ts +0 -15
- package/dist/core/reasoning-router-v3.d.ts.map +0 -1
- package/dist/core/reasoning-router-v3.js +0 -193
- package/dist/core/reasoning-router-v3.js.map +0 -1
- package/dist/core/reasoning-router-weights.d.ts +0 -155
- package/dist/core/reasoning-router-weights.d.ts.map +0 -1
- package/dist/core/reasoning-router-weights.js +0 -204
- package/dist/core/reasoning-router-weights.js.map +0 -1
- package/dist/core/reasoning-router.d.ts +0 -44
- package/dist/core/reasoning-router.d.ts.map +0 -1
- package/dist/core/reasoning-router.js +0 -138
- package/dist/core/reasoning-router.js.map +0 -1
- package/dist/core/token-optimizer.d.ts +0 -58
- package/dist/core/token-optimizer.d.ts.map +0 -1
- package/dist/core/token-optimizer.js +0 -179
- package/dist/core/token-optimizer.js.map +0 -1
|
@@ -12,7 +12,7 @@ import { spawn, spawnSync } from "child_process";
|
|
|
12
12
|
import { getProviders, } from "omk-ai";
|
|
13
13
|
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "omk-tui";
|
|
14
14
|
import { APP_NAME, APP_TITLE, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, getShareViewerUrl, VERSION, } from "../../config.js";
|
|
15
|
-
import { parseSkillBlock
|
|
15
|
+
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
16
16
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
17
17
|
import { parseBangInvocation } from "../../core/bang-skill-invocation.js";
|
|
18
18
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
@@ -98,17 +98,12 @@ class ExpandableText extends Text {
|
|
|
98
98
|
}
|
|
99
99
|
const DEAD_TERMINAL_ERROR_CODES = new Set(["EIO", "EPIPE", "ENOTCONN"]);
|
|
100
100
|
/**
|
|
101
|
-
* Pseudo-
|
|
102
|
-
* "auto"
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* the session level API.
|
|
101
|
+
* Pseudo-entry for the thinking selector/autocomplete representing auto mode.
|
|
102
|
+
* "auto" is a thinking MODE (per-task routing), not a ThinkingLevel value; the
|
|
103
|
+
* selector renders plain strings, so it is injected as a pseudo-level entry and
|
|
104
|
+
* intercepted before reaching the session level API.
|
|
106
105
|
*/
|
|
107
106
|
const AUTO_THINKING_ENTRY = "auto";
|
|
108
|
-
const AUTO_V1_THINKING_ENTRY = "auto-v1";
|
|
109
|
-
const AUTO_V2_THINKING_ENTRY = "auto-v2";
|
|
110
|
-
const AUTO_V3_THINKING_ENTRY = "auto-v3";
|
|
111
|
-
const AUTO_V4_THINKING_ENTRY = "auto-v4";
|
|
112
107
|
function isDeadTerminalError(error) {
|
|
113
108
|
if (!error || typeof error !== "object" || !("code" in error)) {
|
|
114
109
|
return false;
|
|
@@ -350,34 +345,14 @@ export class InteractiveMode {
|
|
|
350
345
|
if (thinkCommand) {
|
|
351
346
|
thinkCommand.getArgumentCompletions = (prefix) => {
|
|
352
347
|
const isAutoMode = this.session.thinkingMode === "auto";
|
|
353
|
-
const
|
|
354
|
-
const choices = [
|
|
355
|
-
AUTO_THINKING_ENTRY,
|
|
356
|
-
AUTO_V1_THINKING_ENTRY,
|
|
357
|
-
AUTO_V2_THINKING_ENTRY,
|
|
358
|
-
AUTO_V3_THINKING_ENTRY,
|
|
359
|
-
AUTO_V4_THINKING_ENTRY,
|
|
360
|
-
...this.session.getAvailableThinkingLevels(),
|
|
361
|
-
];
|
|
348
|
+
const choices = [AUTO_THINKING_ENTRY, ...this.session.getAvailableThinkingLevels()];
|
|
362
349
|
const filtered = fuzzyFilter(choices, prefix, (choice) => choice);
|
|
363
350
|
if (filtered.length === 0)
|
|
364
351
|
return null;
|
|
365
352
|
return filtered.map((choice) => {
|
|
366
353
|
let description;
|
|
367
354
|
if (choice === AUTO_THINKING_ENTRY) {
|
|
368
|
-
description = `route level per task${isAutoMode ?
|
|
369
|
-
}
|
|
370
|
-
else if (choice === AUTO_V1_THINKING_ENTRY) {
|
|
371
|
-
description = `route level per task with v1 router${isAutoMode && currentAutoVersion === "v1" ? " (current)" : ""}`;
|
|
372
|
-
}
|
|
373
|
-
else if (choice === AUTO_V2_THINKING_ENTRY) {
|
|
374
|
-
description = `route level per task with v2 router${isAutoMode && currentAutoVersion === "v2" ? " (current)" : ""}`;
|
|
375
|
-
}
|
|
376
|
-
else if (choice === AUTO_V3_THINKING_ENTRY) {
|
|
377
|
-
description = `route level per task with v3 router${isAutoMode && currentAutoVersion === "v3" ? " (current)" : ""}`;
|
|
378
|
-
}
|
|
379
|
-
else if (choice === AUTO_V4_THINKING_ENTRY) {
|
|
380
|
-
description = `route level per task with v4 router${isAutoMode && currentAutoVersion === "v4" ? " (current)" : ""}`;
|
|
355
|
+
description = `route level per task with v4${isAutoMode ? " (current)" : ""}`;
|
|
381
356
|
}
|
|
382
357
|
else if (!isAutoMode && choice === this.session.thinkingLevel) {
|
|
383
358
|
description = "current";
|
|
@@ -3579,68 +3554,29 @@ export class InteractiveMode {
|
|
|
3579
3554
|
return;
|
|
3580
3555
|
}
|
|
3581
3556
|
const normalizedLevel = level.replace(/\s+/g, " ");
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
case AUTO_V1_THINKING_ENTRY:
|
|
3586
|
-
case "auto:v1":
|
|
3587
|
-
this.enableAutoThinkingMode("v1");
|
|
3588
|
-
return;
|
|
3589
|
-
case "auto v2":
|
|
3590
|
-
case AUTO_V2_THINKING_ENTRY:
|
|
3591
|
-
case "auto:v2":
|
|
3592
|
-
this.enableAutoThinkingMode("v2");
|
|
3593
|
-
return;
|
|
3594
|
-
case "auto v3":
|
|
3595
|
-
case AUTO_V3_THINKING_ENTRY:
|
|
3596
|
-
case "auto:v3":
|
|
3597
|
-
this.enableAutoThinkingMode("v3");
|
|
3598
|
-
return;
|
|
3599
|
-
case "auto v4":
|
|
3600
|
-
case AUTO_V4_THINKING_ENTRY:
|
|
3601
|
-
case "auto:v4":
|
|
3602
|
-
this.enableAutoThinkingMode("v4");
|
|
3603
|
-
return;
|
|
3557
|
+
if (normalizedLevel === AUTO_THINKING_ENTRY) {
|
|
3558
|
+
this.enableAutoThinkingMode();
|
|
3559
|
+
return;
|
|
3604
3560
|
}
|
|
3605
3561
|
const availableLevels = this.session.getAvailableThinkingLevels();
|
|
3606
3562
|
if (!availableLevels.includes(normalizedLevel)) {
|
|
3607
|
-
this.showError(`Thinking level "${level}" is not available. Available: auto,
|
|
3563
|
+
this.showError(`Thinking level "${level}" is not available. Available: auto, ${availableLevels.join(", ")}`);
|
|
3608
3564
|
return;
|
|
3609
3565
|
}
|
|
3610
3566
|
this.applyThinkingLevel(normalizedLevel);
|
|
3611
3567
|
}
|
|
3612
3568
|
applyThinkingSelection(level) {
|
|
3613
3569
|
if (level === AUTO_THINKING_ENTRY) {
|
|
3614
|
-
this.enableAutoThinkingMode(
|
|
3615
|
-
return;
|
|
3616
|
-
}
|
|
3617
|
-
if (level === AUTO_V2_THINKING_ENTRY) {
|
|
3618
|
-
this.enableAutoThinkingMode("v2");
|
|
3619
|
-
return;
|
|
3620
|
-
}
|
|
3621
|
-
if (level === AUTO_V3_THINKING_ENTRY) {
|
|
3622
|
-
this.enableAutoThinkingMode("v3");
|
|
3623
|
-
return;
|
|
3624
|
-
}
|
|
3625
|
-
if (level === AUTO_V4_THINKING_ENTRY) {
|
|
3626
|
-
this.enableAutoThinkingMode("v4");
|
|
3570
|
+
this.enableAutoThinkingMode();
|
|
3627
3571
|
return;
|
|
3628
3572
|
}
|
|
3629
3573
|
this.applyThinkingLevel(level);
|
|
3630
3574
|
}
|
|
3631
|
-
enableAutoThinkingMode(
|
|
3632
|
-
this.session.setThinkingRouterVersion(version);
|
|
3575
|
+
enableAutoThinkingMode() {
|
|
3633
3576
|
this.session.setThinkingMode("auto");
|
|
3634
3577
|
this.footer.invalidate();
|
|
3635
3578
|
this.updateEditorBorderColor();
|
|
3636
|
-
|
|
3637
|
-
? AUTO_THINKING_ENTRY
|
|
3638
|
-
: version === "v2"
|
|
3639
|
-
? AUTO_V2_THINKING_ENTRY
|
|
3640
|
-
: version === "v3"
|
|
3641
|
-
? AUTO_V3_THINKING_ENTRY
|
|
3642
|
-
: AUTO_V4_THINKING_ENTRY;
|
|
3643
|
-
this.showStatus(`Thinking: ${label} (${version} router, level routed per task)`);
|
|
3579
|
+
this.showStatus("Thinking: auto (v4 router, level routed per task)");
|
|
3644
3580
|
}
|
|
3645
3581
|
applyThinkingLevel(level) {
|
|
3646
3582
|
// A concrete level is an explicit user override: always return to manual mode.
|
|
@@ -3651,28 +3587,10 @@ export class InteractiveMode {
|
|
|
3651
3587
|
this.showStatus(`Thinking: ${this.session.thinkingLevel}`);
|
|
3652
3588
|
}
|
|
3653
3589
|
getThinkingSelectorValue() {
|
|
3654
|
-
|
|
3655
|
-
return this.session.thinkingLevel;
|
|
3656
|
-
}
|
|
3657
|
-
if (this.session.thinkingRouterVersion === "v2") {
|
|
3658
|
-
return AUTO_V2_THINKING_ENTRY;
|
|
3659
|
-
}
|
|
3660
|
-
if (this.session.thinkingRouterVersion === "v3") {
|
|
3661
|
-
return AUTO_V3_THINKING_ENTRY;
|
|
3662
|
-
}
|
|
3663
|
-
if (this.session.thinkingRouterVersion === "v4") {
|
|
3664
|
-
return AUTO_V4_THINKING_ENTRY;
|
|
3665
|
-
}
|
|
3666
|
-
return AUTO_THINKING_ENTRY;
|
|
3590
|
+
return this.session.thinkingMode === "auto" ? AUTO_THINKING_ENTRY : this.session.thinkingLevel;
|
|
3667
3591
|
}
|
|
3668
3592
|
getThinkingSelectorLevels() {
|
|
3669
|
-
return [
|
|
3670
|
-
AUTO_THINKING_ENTRY,
|
|
3671
|
-
AUTO_V2_THINKING_ENTRY,
|
|
3672
|
-
AUTO_V3_THINKING_ENTRY,
|
|
3673
|
-
AUTO_V4_THINKING_ENTRY,
|
|
3674
|
-
...this.session.getAvailableThinkingLevels(),
|
|
3675
|
-
];
|
|
3593
|
+
return [AUTO_THINKING_ENTRY, ...this.session.getAvailableThinkingLevels()];
|
|
3676
3594
|
}
|
|
3677
3595
|
async handleModelCommand(searchTerm) {
|
|
3678
3596
|
if (!searchTerm) {
|