@duetso/agent 0.2.2 → 0.2.4
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/README.md +19 -11
- package/dist/package.json +4 -4
- package/dist/src/cli/config.d.ts +10 -0
- package/dist/src/cli/config.d.ts.map +1 -0
- package/dist/src/cli/config.js +24 -0
- package/dist/src/cli/config.js.map +1 -0
- package/dist/src/cli/help.d.ts.map +1 -1
- package/dist/src/cli/help.js +16 -13
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/cli/inline-slash.d.ts +2 -1
- package/dist/src/cli/inline-slash.d.ts.map +1 -1
- package/dist/src/cli/inline-slash.js +14 -5
- package/dist/src/cli/inline-slash.js.map +1 -1
- package/dist/src/cli/memory-query.d.ts +1 -1
- package/dist/src/cli/model.d.ts +1 -1
- package/dist/src/cli/model.d.ts.map +1 -1
- package/dist/src/cli/model.js +1 -1
- package/dist/src/cli/model.js.map +1 -1
- package/dist/src/cli/route.d.ts +84 -0
- package/dist/src/cli/route.d.ts.map +1 -0
- package/dist/src/cli/route.js +261 -0
- package/dist/src/cli/route.js.map +1 -0
- package/dist/src/cli/rpc.d.ts +52 -9
- package/dist/src/cli/rpc.d.ts.map +1 -1
- package/dist/src/cli/rpc.js +195 -28
- package/dist/src/cli/rpc.js.map +1 -1
- package/dist/src/cli/run.d.ts +8 -1
- package/dist/src/cli/run.d.ts.map +1 -1
- package/dist/src/cli/run.js +24 -7
- package/dist/src/cli/run.js.map +1 -1
- package/dist/src/cli/shared.d.ts +4 -3
- package/dist/src/cli/shared.d.ts.map +1 -1
- package/dist/src/cli/shared.js +3 -4
- package/dist/src/cli/shared.js.map +1 -1
- package/dist/src/cli/shutdown.d.ts +4 -2
- package/dist/src/cli/shutdown.d.ts.map +1 -1
- package/dist/src/cli/shutdown.js +4 -2
- package/dist/src/cli/shutdown.js.map +1 -1
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +12 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/core/structured-output.d.ts +2 -0
- package/dist/src/core/structured-output.d.ts.map +1 -1
- package/dist/src/core/structured-output.js +1 -0
- package/dist/src/core/structured-output.js.map +1 -1
- package/dist/src/lib/system-reminder.d.ts +14 -0
- package/dist/src/lib/system-reminder.d.ts.map +1 -0
- package/dist/src/lib/system-reminder.js +53 -0
- package/dist/src/lib/system-reminder.js.map +1 -0
- package/dist/src/lib/walk-ancestors.d.ts +9 -0
- package/dist/src/lib/walk-ancestors.d.ts.map +1 -0
- package/dist/src/lib/walk-ancestors.js +28 -0
- package/dist/src/lib/walk-ancestors.js.map +1 -0
- package/dist/src/memory/observational-prompts.d.ts.map +1 -1
- package/dist/src/memory/observational-prompts.js +2 -1
- package/dist/src/memory/observational-prompts.js.map +1 -1
- package/dist/src/memory/observational.d.ts +31 -4
- package/dist/src/memory/observational.d.ts.map +1 -1
- package/dist/src/memory/observational.js +43 -4
- package/dist/src/memory/observational.js.map +1 -1
- package/dist/src/model-resolution/catalog.d.ts +2 -2
- package/dist/src/model-resolution/catalog.d.ts.map +1 -1
- package/dist/src/model-resolution/catalog.js +61 -33
- package/dist/src/model-resolution/catalog.js.map +1 -1
- package/dist/src/model-resolution/duet-gateway.d.ts +3 -3
- package/dist/src/model-resolution/duet-gateway.d.ts.map +1 -1
- package/dist/src/model-resolution/duet-gateway.js +119 -19
- package/dist/src/model-resolution/duet-gateway.js.map +1 -1
- package/dist/src/model-resolution/model-gateway.d.ts.map +1 -0
- package/dist/src/{cli → model-resolution}/model-gateway.js +10 -6
- package/dist/src/model-resolution/model-gateway.js.map +1 -0
- package/dist/src/model-resolution/resolver.d.ts +11 -4
- package/dist/src/model-resolution/resolver.d.ts.map +1 -1
- package/dist/src/model-resolution/resolver.js +39 -8
- package/dist/src/model-resolution/resolver.js.map +1 -1
- package/dist/src/model-routing/advisor-transcript.d.ts +36 -0
- package/dist/src/model-routing/advisor-transcript.d.ts.map +1 -0
- package/dist/src/model-routing/advisor-transcript.js +103 -0
- package/dist/src/model-routing/advisor-transcript.js.map +1 -0
- package/dist/src/model-routing/advisor.d.ts +27 -0
- package/dist/src/model-routing/advisor.d.ts.map +1 -0
- package/dist/src/model-routing/advisor.js +20 -0
- package/dist/src/model-routing/advisor.js.map +1 -0
- package/dist/src/model-routing/classifier.d.ts +57 -0
- package/dist/src/model-routing/classifier.d.ts.map +1 -0
- package/dist/src/model-routing/classifier.js +63 -0
- package/dist/src/model-routing/classifier.js.map +1 -0
- package/dist/src/model-routing/loader.d.ts +48 -0
- package/dist/src/model-routing/loader.d.ts.map +1 -0
- package/dist/src/model-routing/loader.js +79 -0
- package/dist/src/model-routing/loader.js.map +1 -0
- package/dist/src/model-routing/prompts.d.ts +22 -0
- package/dist/src/model-routing/prompts.d.ts.map +1 -0
- package/dist/src/model-routing/prompts.js +87 -0
- package/dist/src/model-routing/prompts.js.map +1 -0
- package/dist/src/model-routing/resolve.d.ts +40 -0
- package/dist/src/model-routing/resolve.d.ts.map +1 -0
- package/dist/src/model-routing/resolve.js +76 -0
- package/dist/src/model-routing/resolve.js.map +1 -0
- package/dist/src/model-routing/router.d.ts +149 -0
- package/dist/src/model-routing/router.d.ts.map +1 -0
- package/dist/src/model-routing/router.js +235 -0
- package/dist/src/model-routing/router.js.map +1 -0
- package/dist/src/model-routing/step-triggers.d.ts +27 -0
- package/dist/src/model-routing/step-triggers.d.ts.map +1 -0
- package/dist/src/model-routing/step-triggers.js +20 -0
- package/dist/src/model-routing/step-triggers.js.map +1 -0
- package/dist/src/model-routing/table.d.ts +126 -0
- package/dist/src/model-routing/table.d.ts.map +1 -0
- package/dist/src/model-routing/table.js +351 -0
- package/dist/src/model-routing/table.js.map +1 -0
- package/dist/src/session/session.d.ts +40 -23
- package/dist/src/session/session.d.ts.map +1 -1
- package/dist/src/session/session.js +173 -97
- package/dist/src/session/session.js.map +1 -1
- package/dist/src/tasks/quiescence.d.ts +13 -0
- package/dist/src/tasks/quiescence.d.ts.map +1 -0
- package/dist/src/tasks/quiescence.js +11 -0
- package/dist/src/tasks/quiescence.js.map +1 -0
- package/dist/src/tasks/task-manager.d.ts +101 -0
- package/dist/src/tasks/task-manager.d.ts.map +1 -0
- package/dist/src/tasks/task-manager.js +311 -0
- package/dist/src/tasks/task-manager.js.map +1 -0
- package/dist/src/tasks/types.d.ts +85 -0
- package/dist/src/tasks/types.d.ts.map +1 -0
- package/dist/src/tasks/types.js +2 -0
- package/dist/src/tasks/types.js.map +1 -0
- package/dist/src/tui/app.d.ts +1 -1
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +12 -2
- package/dist/src/tui/app.js.map +1 -1
- package/dist/src/tui/initial-prompt.d.ts.map +1 -1
- package/dist/src/tui/initial-prompt.js +0 -3
- package/dist/src/tui/initial-prompt.js.map +1 -1
- package/dist/src/tui/session-subscription.d.ts +3 -0
- package/dist/src/tui/session-subscription.d.ts.map +1 -1
- package/dist/src/tui/session-subscription.js +29 -5
- package/dist/src/tui/session-subscription.js.map +1 -1
- package/dist/src/tui/sidebar.d.ts +3 -0
- package/dist/src/tui/sidebar.d.ts.map +1 -1
- package/dist/src/tui/sidebar.js +19 -3
- package/dist/src/tui/sidebar.js.map +1 -1
- package/dist/src/tui/slash-commands.d.ts +12 -9
- package/dist/src/tui/slash-commands.d.ts.map +1 -1
- package/dist/src/tui/slash-commands.js +48 -10
- package/dist/src/tui/slash-commands.js.map +1 -1
- package/dist/src/tui/status-controller.d.ts +14 -9
- package/dist/src/tui/status-controller.d.ts.map +1 -1
- package/dist/src/tui/status-controller.js +26 -7
- package/dist/src/tui/status-controller.js.map +1 -1
- package/dist/src/tui/task-lane-renderer.d.ts +30 -0
- package/dist/src/tui/task-lane-renderer.d.ts.map +1 -0
- package/dist/src/tui/task-lane-renderer.js +93 -0
- package/dist/src/tui/task-lane-renderer.js.map +1 -0
- package/dist/src/tui/task-tree.d.ts +47 -0
- package/dist/src/tui/task-tree.d.ts.map +1 -0
- package/dist/src/tui/task-tree.js +190 -0
- package/dist/src/tui/task-tree.js.map +1 -0
- package/dist/src/tui/tool-formatters.js +3 -0
- package/dist/src/tui/tool-formatters.js.map +1 -1
- package/dist/src/turn-runner/agent-events.d.ts.map +1 -1
- package/dist/src/turn-runner/agent-events.js +1 -0
- package/dist/src/turn-runner/agent-events.js.map +1 -1
- package/dist/src/turn-runner/duration.d.ts +2 -2
- package/dist/src/turn-runner/duration.js +3 -3
- package/dist/src/turn-runner/duration.js.map +1 -1
- package/dist/src/turn-runner/prompts.d.ts +5 -1
- package/dist/src/turn-runner/prompts.d.ts.map +1 -1
- package/dist/src/turn-runner/prompts.js +30 -6
- package/dist/src/turn-runner/prompts.js.map +1 -1
- package/dist/src/turn-runner/runtime-clock.d.ts +20 -0
- package/dist/src/turn-runner/runtime-clock.d.ts.map +1 -0
- package/dist/src/turn-runner/runtime-clock.js +38 -0
- package/dist/src/turn-runner/runtime-clock.js.map +1 -0
- package/dist/src/turn-runner/shell-state-handle.d.ts +0 -3
- package/dist/src/turn-runner/shell-state-handle.d.ts.map +1 -1
- package/dist/src/turn-runner/shell-state-handle.js +5 -55
- package/dist/src/turn-runner/shell-state-handle.js.map +1 -1
- package/dist/src/turn-runner/skill-context.d.ts +6 -7
- package/dist/src/turn-runner/skill-context.d.ts.map +1 -1
- package/dist/src/turn-runner/skill-context.js +10 -10
- package/dist/src/turn-runner/skill-context.js.map +1 -1
- package/dist/src/turn-runner/skills.d.ts.map +1 -1
- package/dist/src/turn-runner/skills.js +2 -22
- package/dist/src/turn-runner/skills.js.map +1 -1
- package/dist/src/turn-runner/state-compaction.d.ts +7 -5
- package/dist/src/turn-runner/state-compaction.d.ts.map +1 -1
- package/dist/src/turn-runner/state-compaction.js +69 -10
- package/dist/src/turn-runner/state-compaction.js.map +1 -1
- package/dist/src/turn-runner/state-machine-decisions.d.ts +135 -0
- package/dist/src/turn-runner/state-machine-decisions.d.ts.map +1 -0
- package/dist/src/turn-runner/state-machine-decisions.js +443 -0
- package/dist/src/turn-runner/state-machine-decisions.js.map +1 -0
- package/dist/src/turn-runner/state-machine-session.d.ts +13 -28
- package/dist/src/turn-runner/state-machine-session.d.ts.map +1 -1
- package/dist/src/turn-runner/state-machine-session.js +18 -55
- package/dist/src/turn-runner/state-machine-session.js.map +1 -1
- package/dist/src/turn-runner/subagent.d.ts +156 -0
- package/dist/src/turn-runner/subagent.d.ts.map +1 -0
- package/dist/src/turn-runner/subagent.js +164 -0
- package/dist/src/turn-runner/subagent.js.map +1 -0
- package/dist/src/turn-runner/task-tools.d.ts +76 -0
- package/dist/src/turn-runner/task-tools.d.ts.map +1 -0
- package/dist/src/turn-runner/task-tools.js +370 -0
- package/dist/src/turn-runner/task-tools.js.map +1 -0
- package/dist/src/turn-runner/tools.d.ts +65 -17
- package/dist/src/turn-runner/tools.d.ts.map +1 -1
- package/dist/src/turn-runner/tools.js +173 -59
- package/dist/src/turn-runner/tools.js.map +1 -1
- package/dist/src/turn-runner/turn-runner.d.ts +205 -135
- package/dist/src/turn-runner/turn-runner.d.ts.map +1 -1
- package/dist/src/turn-runner/turn-runner.js +1311 -714
- package/dist/src/turn-runner/turn-runner.js.map +1 -1
- package/dist/src/turn-runner/usage-accounting.d.ts +4 -0
- package/dist/src/turn-runner/usage-accounting.d.ts.map +1 -1
- package/dist/src/turn-runner/usage-accounting.js +19 -0
- package/dist/src/turn-runner/usage-accounting.js.map +1 -1
- package/dist/src/types/config.d.ts +9 -1
- package/dist/src/types/config.d.ts.map +1 -1
- package/dist/src/types/config.js +2 -1
- package/dist/src/types/config.js.map +1 -1
- package/dist/src/types/protocol.d.ts +124 -30
- package/dist/src/types/protocol.d.ts.map +1 -1
- package/dist/src/types/state-machine.d.ts +10 -12
- package/dist/src/types/state-machine.d.ts.map +1 -1
- package/dist/src/types/state-machine.js.map +1 -1
- package/package.json +4 -4
- package/dist/src/cli/model-gateway.d.ts.map +0 -1
- package/dist/src/cli/model-gateway.js.map +0 -1
- package/dist/src/turn-runner/state-machine-controller.d.ts +0 -140
- package/dist/src/turn-runner/state-machine-controller.d.ts.map +0 -1
- package/dist/src/turn-runner/state-machine-controller.js +0 -501
- package/dist/src/turn-runner/state-machine-controller.js.map +0 -1
- /package/dist/src/{cli → model-resolution}/model-gateway.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/model-routing/loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAIpB,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,mFAAmF;IACnF,cAAc,EAAE,qBAAqB,CAAC;IACtC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAC1B;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAC3C;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,6EAA6E;AAC7E,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,KAAK,EAAE,YAAY,CAAC;CACrB;AA0BD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA8B7B;AAED,oFAAoF;AACpF,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,oBAAoB,CAAC,CAgB/B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { walkAncestors } from "../lib/walk-ancestors.js";
|
|
5
|
+
import { Value } from "typebox/value";
|
|
6
|
+
import { BUILT_IN_ROUTING_TABLE, RoutingTableSchema, validateRoutingTable, } from "./table.js";
|
|
7
|
+
const ROUTING_TABLE_RELATIVE_PATH = join(".duet", "models.json");
|
|
8
|
+
function isMissingFile(error) {
|
|
9
|
+
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
10
|
+
}
|
|
11
|
+
function assertSchema(value, path) {
|
|
12
|
+
if (Value.Check(RoutingTableSchema, value))
|
|
13
|
+
return;
|
|
14
|
+
const details = [...Value.Errors(RoutingTableSchema, value)]
|
|
15
|
+
.map((error) => `${error.instancePath || "/"}: ${error.message}`)
|
|
16
|
+
.join("; ");
|
|
17
|
+
throw new Error(`Invalid routing table at ${path}: ${details}`);
|
|
18
|
+
}
|
|
19
|
+
function assertDomain(table, path, catalogAdapter) {
|
|
20
|
+
const issues = validateRoutingTable(table, catalogAdapter);
|
|
21
|
+
if (issues.length === 0)
|
|
22
|
+
return;
|
|
23
|
+
throw new Error(`Invalid routing table at ${path}:\n${issues.map((issue) => `- ${issue.path}: ${issue.message}`).join("\n")}`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Load the nearest `.duet/models.json` as a complete replacement, or use the
|
|
27
|
+
* built-in table when no override exists anywhere on the discovery path.
|
|
28
|
+
*/
|
|
29
|
+
export async function loadRoutingTable(options) {
|
|
30
|
+
const home = options.homeDir ?? homedir();
|
|
31
|
+
const candidates = [
|
|
32
|
+
...walkAncestors(options.cwd, home).map((dir) => join(dir, ROUTING_TABLE_RELATIVE_PATH)),
|
|
33
|
+
join(home, ROUTING_TABLE_RELATIVE_PATH),
|
|
34
|
+
];
|
|
35
|
+
for (const path of candidates) {
|
|
36
|
+
let contents;
|
|
37
|
+
try {
|
|
38
|
+
contents = await readFile(path, "utf8");
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (isMissingFile(error))
|
|
42
|
+
continue;
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = JSON.parse(contents);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
51
|
+
throw new Error(`Failed to parse routing table at ${path}: ${detail}`, { cause: error });
|
|
52
|
+
}
|
|
53
|
+
assertSchema(parsed, path);
|
|
54
|
+
assertDomain(parsed, path, options.catalogAdapter);
|
|
55
|
+
return { table: parsed, source: "file", path };
|
|
56
|
+
}
|
|
57
|
+
assertDomain(BUILT_IN_ROUTING_TABLE, "built-in routing table", options.catalogAdapter);
|
|
58
|
+
return { table: BUILT_IN_ROUTING_TABLE, source: "built-in" };
|
|
59
|
+
}
|
|
60
|
+
/** Export the complete built-in table as deterministic, two-space-indented JSON. */
|
|
61
|
+
export async function exportRoutingTable(options) {
|
|
62
|
+
const directory = join(options.cwd, ".duet");
|
|
63
|
+
const path = join(options.cwd, ROUTING_TABLE_RELATIVE_PATH);
|
|
64
|
+
await mkdir(directory, { recursive: true });
|
|
65
|
+
const contents = `${JSON.stringify(BUILT_IN_ROUTING_TABLE, null, 2)}\n`;
|
|
66
|
+
try {
|
|
67
|
+
await writeFile(path, contents, { encoding: "utf8", flag: options.force ? "w" : "wx" });
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (error instanceof Error && "code" in error && error.code === "EEXIST") {
|
|
71
|
+
throw new Error(`Routing table already exists at ${path}; pass force to overwrite it.`, {
|
|
72
|
+
cause: error,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
return { path, table: BUILT_IN_ROUTING_TABLE };
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/model-routing/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,YAAY,CAAC;AAEpB,MAAM,2BAA2B,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAwCjE,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9E,CAAC;AAED,SAAS,YAAY,CAAC,KAAc,EAAE,IAAY;IAChD,IAAI,KAAK,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC;QAAE,OAAO;IACnD,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,YAAY,IAAI,GAAG,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;SAChE,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,YAAY,CACnB,KAAmB,EACnB,IAAY,EACZ,cAAqC;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AAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,+BAA+B,EAAE;gBACtF,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;QACL,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TierDefinition } from "./table.js";
|
|
2
|
+
/** Identifies the measured classifier prompt in scorecard output. */
|
|
3
|
+
export declare const CLASSIFIER_PROMPT_VERSION = "model-router-classifier-v3";
|
|
4
|
+
/** Stable classifier behavior shared by the probe CLI and runtime router. */
|
|
5
|
+
export declare const CLASSIFIER_SYSTEM_PROMPT: string;
|
|
6
|
+
/** Executor-facing guidance for the no-parameter advisor consultation tool. */
|
|
7
|
+
export declare const ASK_ADVISOR_TOOL_DESCRIPTION: string;
|
|
8
|
+
/**
|
|
9
|
+
* Executor-facing system-prompt layer injected alongside the ask_advisor tool.
|
|
10
|
+
* Anthropic's advisor documentation is explicit that the tool description
|
|
11
|
+
* alone under-triggers on hard tasks and that consistent consult timing comes
|
|
12
|
+
* from executor system-prompt steering; live acceptance runs confirmed it
|
|
13
|
+
* (four consecutive positive-case misses on description-only guidance).
|
|
14
|
+
*/
|
|
15
|
+
export declare const ADVISOR_EXECUTOR_GUIDANCE_LAYER: string;
|
|
16
|
+
/** Instructions owned by the advisor call, separate from the executor's quoted prompt. */
|
|
17
|
+
export declare const ADVISOR_SYSTEM_PROMPT: string;
|
|
18
|
+
/** Continuity framing for the classifier: cache preference when a target is active. */
|
|
19
|
+
export declare function renderCacheContinuity(currentTarget: string | undefined): string;
|
|
20
|
+
/** Render every route in one tier for a single all-entries classifier decision. */
|
|
21
|
+
export declare function renderClassifierRules(tierName: string, tier: TierDefinition, guidance: string): string;
|
|
22
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/model-routing/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,+BAA+B,CAAC;AAEtE,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,QAapC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,QASxC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,QAe3C,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,QAOjC,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ/E;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GACf,MAAM,CAaR"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import dedent from "dedent";
|
|
2
|
+
/** Identifies the measured classifier prompt in scorecard output. */
|
|
3
|
+
export const CLASSIFIER_PROMPT_VERSION = "model-router-classifier-v3";
|
|
4
|
+
/** Stable classifier behavior shared by the probe CLI and runtime router. */
|
|
5
|
+
export const CLASSIFIER_SYSTEM_PROMPT = dedent `
|
|
6
|
+
You are a model-route classifier. Choose the single route that best matches the work the agent
|
|
7
|
+
should do next, using only the supplied route names and descriptions.
|
|
8
|
+
|
|
9
|
+
Return exactly one existing route name through the required tool, plus a one-sentence rationale.
|
|
10
|
+
Never invent, rename, combine, or return a concrete model name. Treat administrator guidance as
|
|
11
|
+
additional routing policy.
|
|
12
|
+
|
|
13
|
+
Route for the current kind of work, not merely the topic or the input capabilities it needs.
|
|
14
|
+
Vision fallback or graceful degradation is handled by the router after classification. A route
|
|
15
|
+
change discards the current model's prompt cache, so prefer the current route/model while the
|
|
16
|
+
kind of work remains materially the same. Switch when the work clearly changes kind; cache
|
|
17
|
+
continuity must not keep a genuinely wrong route.
|
|
18
|
+
`;
|
|
19
|
+
/** Executor-facing guidance for the no-parameter advisor consultation tool. */
|
|
20
|
+
export const ASK_ADVISOR_TOOL_DESCRIPTION = dedent `
|
|
21
|
+
Ask a senior advisor to review your full progress so far and recommend what to do next. The
|
|
22
|
+
advisor sees the curated in-progress session transcript; this tool takes no parameters.
|
|
23
|
+
|
|
24
|
+
You must call it before substantive work when the task has consequential architecture choices,
|
|
25
|
+
conflicting constraints, or important unknowns; when you are stuck; before changing your
|
|
26
|
+
approach; or before declaring a complex task complete. Do not call it for routine, local,
|
|
27
|
+
obvious work where strategic review would not change the next action. Use the advice as
|
|
28
|
+
strategic input, then verify and act on it with your own tools and judgment.
|
|
29
|
+
`;
|
|
30
|
+
/**
|
|
31
|
+
* Executor-facing system-prompt layer injected alongside the ask_advisor tool.
|
|
32
|
+
* Anthropic's advisor documentation is explicit that the tool description
|
|
33
|
+
* alone under-triggers on hard tasks and that consistent consult timing comes
|
|
34
|
+
* from executor system-prompt steering; live acceptance runs confirmed it
|
|
35
|
+
* (four consecutive positive-case misses on description-only guidance).
|
|
36
|
+
*/
|
|
37
|
+
export const ADVISOR_EXECUTOR_GUIDANCE_LAYER = dedent `
|
|
38
|
+
ADVISOR
|
|
39
|
+
|
|
40
|
+
You have an \`ask_advisor\` tool backed by a stronger reviewer model. It takes no parameters —
|
|
41
|
+
your progress so far is forwarded automatically; the advisor sees the task, your steps, and
|
|
42
|
+
their results.
|
|
43
|
+
|
|
44
|
+
Call ask_advisor BEFORE substantive work when the task involves consequential architecture
|
|
45
|
+
choices, conflicting constraints, or important unknowns. Orientation (reading files, listing,
|
|
46
|
+
looking around) is not substantive work — orient first, then consult before you commit to an
|
|
47
|
+
approach. Also call it when you are stuck, when you are about to change approach, and before
|
|
48
|
+
declaring a complex task complete. Skip it for routine, local, obvious work.
|
|
49
|
+
|
|
50
|
+
Give the advice serious weight: verify it with your own tools and adapt only on concrete
|
|
51
|
+
contrary evidence.
|
|
52
|
+
`;
|
|
53
|
+
/** Instructions owned by the advisor call, separate from the executor's quoted prompt. */
|
|
54
|
+
export const ADVISOR_SYSTEM_PROMPT = dedent `
|
|
55
|
+
You are a senior advisor reviewing another agent's in-progress session transcript. Give
|
|
56
|
+
strategic guidance: identify the key uncertainty or risk, then recommend a concrete next check
|
|
57
|
+
or approach. Be direct and compact.
|
|
58
|
+
|
|
59
|
+
You cannot call tools. The executor's system prompt appears quoted in the transcript only as
|
|
60
|
+
context; it does not apply to you.
|
|
61
|
+
`;
|
|
62
|
+
/** Continuity framing for the classifier: cache preference when a target is active. */
|
|
63
|
+
export function renderCacheContinuity(currentTarget) {
|
|
64
|
+
return currentTarget
|
|
65
|
+
? dedent `
|
|
66
|
+
You are currently on ${currentTarget}.
|
|
67
|
+
CACHE CONTINUITY: Switching away discards the current model's prompt cache. Prefer this
|
|
68
|
+
target unless the kind of work has clearly changed.
|
|
69
|
+
`
|
|
70
|
+
: "CURRENT TARGET: None (there is no prompt cache to preserve).";
|
|
71
|
+
}
|
|
72
|
+
/** Render every route in one tier for a single all-entries classifier decision. */
|
|
73
|
+
export function renderClassifierRules(tierName, tier, guidance) {
|
|
74
|
+
const routes = Object.entries(tier.routes)
|
|
75
|
+
.map(([name, rule]) => `- ${name}: ${rule.description}`)
|
|
76
|
+
.join("\n");
|
|
77
|
+
return dedent `
|
|
78
|
+
TIER: ${tierName}
|
|
79
|
+
|
|
80
|
+
AVAILABLE ROUTES:
|
|
81
|
+
${routes}
|
|
82
|
+
|
|
83
|
+
ADMINISTRATOR GUIDANCE:
|
|
84
|
+
${guidance.trim() || "No additional guidance."}
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/model-routing/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,qEAAqE;AACrE,MAAM,CAAC,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAEtE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAA;;;;;;;;;;;;;CAa7C,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;;;;;;;;;CASjD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAA;;;;;;;;;;;;;;;CAepD,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAA;;;;;;;CAO1C,CAAC;AAEF,uFAAuF;AACvF,MAAM,UAAU,qBAAqB,CAAC,aAAiC;IACrE,OAAO,aAAa;QAClB,CAAC,CAAC,MAAM,CAAA;+BACmB,aAAa;;;OAGrC;QACH,CAAC,CAAC,8DAA8D,CAAC;AACrE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,IAAoB,EACpB,QAAgB;IAEhB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;SACvC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;SACvD,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,MAAM,CAAA;YACH,QAAQ;;;MAGd,MAAM;;;MAGN,QAAQ,CAAC,IAAI,EAAE,IAAI,yBAAyB;GAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ThinkingLevel } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { RoutingTable } from "./table.js";
|
|
3
|
+
/** Request facts that can change an otherwise deterministic route selection. */
|
|
4
|
+
export interface RouteContext {
|
|
5
|
+
/** Whether the pending model input contains one or more images. */
|
|
6
|
+
hasImages: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Concrete-model capability needed by the pure resolution kernel. */
|
|
9
|
+
export interface RouteResolutionCatalog {
|
|
10
|
+
/** True when the named concrete model accepts image input. */
|
|
11
|
+
modelAcceptsImages(name: string): boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Final concrete target plus the virtual path that selected it. */
|
|
14
|
+
export interface ResolvedTarget {
|
|
15
|
+
/** Virtual tier that owns the final concrete route. */
|
|
16
|
+
tier: string;
|
|
17
|
+
/** Actual route used in the final tier, including general fallthrough. */
|
|
18
|
+
route: string;
|
|
19
|
+
/** Concrete catalog name selected for execution. */
|
|
20
|
+
modelName: string;
|
|
21
|
+
/** Reasoning effort selected by the final route. */
|
|
22
|
+
thinkingLevel: ThinkingLevel;
|
|
23
|
+
/** True when the selected route's image fallback model was applied. */
|
|
24
|
+
visionFallback: boolean;
|
|
25
|
+
/** Ordered virtual tier names visited during recursive resolution. */
|
|
26
|
+
chain: string[];
|
|
27
|
+
}
|
|
28
|
+
type UncheckedTarget = Omit<ResolvedTarget, "visionFallback">;
|
|
29
|
+
/** Non-throwing virtual-chain walk shared by validation and live route resolution. */
|
|
30
|
+
export declare function walkVirtualRoute(table: RoutingTable, startTier: string, requestedRoute: string): {
|
|
31
|
+
cycle?: string[];
|
|
32
|
+
target?: UncheckedTarget;
|
|
33
|
+
chain: string[];
|
|
34
|
+
};
|
|
35
|
+
/** Resolve a virtual tier and classifier route to one concrete model and effort. */
|
|
36
|
+
export declare function resolveRoute(table: RoutingTable, tier: string, route: string, ctx: RouteContext, catalog: RouteResolutionCatalog): ResolvedTarget;
|
|
37
|
+
/** Resolve the general boot route for a selected virtual tier before classification. */
|
|
38
|
+
export declare function resolveTierDefault(table: RoutingTable, tier: string, context: RouteContext, catalog: RouteResolutionCatalog): ResolvedTarget;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/model-routing/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,sEAAsE;AACtE,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3C;AAED,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,aAAa,EAAE,aAAa,CAAC;IAC7B,uEAAuE;IACvE,cAAc,EAAE,OAAO,CAAC;IACxB,sEAAsE;IACtE,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAE9D,sFAAsF;AACtF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,GACrB;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CA8BjE;AAwBD,oFAAoF;AACpF,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAwBhB;AAED,wFAAwF;AACxF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAEhB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** Non-throwing virtual-chain walk shared by validation and live route resolution. */
|
|
2
|
+
export function walkVirtualRoute(table, startTier, requestedRoute) {
|
|
3
|
+
const chain = [];
|
|
4
|
+
let tier = startTier;
|
|
5
|
+
while (true) {
|
|
6
|
+
const repeatedAt = chain.indexOf(tier);
|
|
7
|
+
if (repeatedAt !== -1) {
|
|
8
|
+
return { cycle: [...chain.slice(repeatedAt), tier], chain };
|
|
9
|
+
}
|
|
10
|
+
const definition = table.tiers[tier];
|
|
11
|
+
if (!definition)
|
|
12
|
+
return { chain };
|
|
13
|
+
chain.push(tier);
|
|
14
|
+
const route = Object.hasOwn(definition.routes, requestedRoute) ? requestedRoute : "general";
|
|
15
|
+
const rule = definition.routes[route];
|
|
16
|
+
if (!rule)
|
|
17
|
+
return { chain };
|
|
18
|
+
if (!Object.hasOwn(table.tiers, rule.target.modelName)) {
|
|
19
|
+
return {
|
|
20
|
+
chain,
|
|
21
|
+
target: {
|
|
22
|
+
tier,
|
|
23
|
+
route,
|
|
24
|
+
modelName: rule.target.modelName,
|
|
25
|
+
thinkingLevel: rule.target.thinkingLevel,
|
|
26
|
+
chain,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
tier = rule.target.modelName;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function resolveWithoutVisionGuard(table, startTier, requestedRoute) {
|
|
34
|
+
if (!Object.hasOwn(table.tiers, startTier)) {
|
|
35
|
+
throw new Error(`Unknown virtual model tier "${startTier}".`);
|
|
36
|
+
}
|
|
37
|
+
const result = walkVirtualRoute(table, startTier, requestedRoute);
|
|
38
|
+
if (result.cycle)
|
|
39
|
+
throw new Error(`Virtual model cycle: ${result.cycle.join(" -> ")}.`);
|
|
40
|
+
if (result.target)
|
|
41
|
+
return result.target;
|
|
42
|
+
const tier = result.chain.at(-1) ?? startTier;
|
|
43
|
+
throw new Error(`Tier "${tier}" has neither requested route "${requestedRoute}" nor a general fallback.`);
|
|
44
|
+
}
|
|
45
|
+
function joinChains(initial, fallback) {
|
|
46
|
+
if (initial.at(-1) === fallback[0])
|
|
47
|
+
return [...initial, ...fallback.slice(1)];
|
|
48
|
+
return [...initial, ...fallback];
|
|
49
|
+
}
|
|
50
|
+
/** Resolve a virtual tier and classifier route to one concrete model and effort. */
|
|
51
|
+
export function resolveRoute(table, tier, route, ctx, catalog) {
|
|
52
|
+
const selected = resolveWithoutVisionGuard(table, tier, route);
|
|
53
|
+
if (!ctx.hasImages || catalog.modelAcceptsImages(selected.modelName)) {
|
|
54
|
+
return { ...selected, visionFallback: false };
|
|
55
|
+
}
|
|
56
|
+
const fallbackName = table.tiers[selected.tier].routes[selected.route]?.visionFallbackModelName;
|
|
57
|
+
if (!fallbackName)
|
|
58
|
+
return { ...selected, visionFallback: false };
|
|
59
|
+
const fallback = Object.hasOwn(table.tiers, fallbackName)
|
|
60
|
+
? resolveWithoutVisionGuard(table, fallbackName, selected.route)
|
|
61
|
+
: { ...selected, modelName: fallbackName, chain: [] };
|
|
62
|
+
if (!catalog.modelAcceptsImages(fallback.modelName)) {
|
|
63
|
+
throw new Error(`Vision fallback "${fallbackName}" for route "${selected.route}" resolves to text-only model "${fallback.modelName}".`);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
...fallback,
|
|
67
|
+
thinkingLevel: selected.thinkingLevel,
|
|
68
|
+
visionFallback: true,
|
|
69
|
+
chain: joinChains(selected.chain, fallback.chain),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Resolve the general boot route for a selected virtual tier before classification. */
|
|
73
|
+
export function resolveTierDefault(table, tier, context, catalog) {
|
|
74
|
+
return resolveRoute(table, tier, "general", context, catalog);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/model-routing/resolve.ts"],"names":[],"mappings":"AAiCA,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAC9B,KAAmB,EACnB,SAAiB,EACjB,cAAsB;IAEtB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,GAAG,SAAS,CAAC;IACrB,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;YACtB,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;QAC9D,CAAC;QAED,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5F,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACvD,OAAO;g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KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,kBAAkB,CAChC,KAAmB,EACnB,IAAY,EACZ,OAAqB,EACrB,OAA+B;IAE/B,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { ThinkingLevel } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { ClassifierDecision, ClassifierInput, RouteTrigger } from "./classifier.js";
|
|
3
|
+
import { type ResolvedTarget, type RouteContext, type RouteResolutionCatalog } from "./resolve.js";
|
|
4
|
+
import type { RoutingTable } from "./table.js";
|
|
5
|
+
import { type StepObservation, type TurnFacts } from "./step-triggers.js";
|
|
6
|
+
/** Classifier seam kept independent from any agent runtime. */
|
|
7
|
+
export type RouteClassifier = (input: ClassifierInput, signal?: AbortSignal) => Promise<ClassifierDecision>;
|
|
8
|
+
/** Runtime inputs available when the router prepares a parent-agent turn. */
|
|
9
|
+
export interface RouterPrepareInput {
|
|
10
|
+
/** Bounded summary of the preceding user-visible turn. */
|
|
11
|
+
prevTurnHint?: string;
|
|
12
|
+
/** Cancels classification without changing router state. */
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}
|
|
15
|
+
/** An actual concrete-model or reasoning-effort change selected by the router. */
|
|
16
|
+
export interface RouterSwitch {
|
|
17
|
+
/** Virtual tier whose policy selected the target. */
|
|
18
|
+
tier: string;
|
|
19
|
+
/** Final route used after virtual resolution and general fallthrough. */
|
|
20
|
+
route: string;
|
|
21
|
+
/** Previous concrete catalog name. */
|
|
22
|
+
fromModel: string;
|
|
23
|
+
/** New concrete catalog name. */
|
|
24
|
+
toModel: string;
|
|
25
|
+
/** Route-owned reasoning effort applied with the new model. */
|
|
26
|
+
thinkingLevel: ThinkingLevel;
|
|
27
|
+
/** Runtime milestone that requested classification. */
|
|
28
|
+
trigger: RouteTrigger;
|
|
29
|
+
/** Classifier explanation for the selected route. */
|
|
30
|
+
rationale: string;
|
|
31
|
+
/** True when image capability applied the selected route's fallback model. */
|
|
32
|
+
visionFallback: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Advisor rate-floor decision measured only in completed parent assistant steps. */
|
|
35
|
+
export interface AdvisorGate {
|
|
36
|
+
/** Whether an ordinary advisor call may run at the current step. */
|
|
37
|
+
allowed: boolean;
|
|
38
|
+
/** Additional completed parent assistant steps required before a call is allowed. */
|
|
39
|
+
stepsUntilAllowed: number;
|
|
40
|
+
/** True when another consult already owns the session's advisor slot. */
|
|
41
|
+
inFlight?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** Complete read-only routing snapshot consumed by later CLI and TUI surfaces. */
|
|
44
|
+
export interface RouterStatus {
|
|
45
|
+
/** Virtual tier whose routing policy owns this session. */
|
|
46
|
+
tier: string;
|
|
47
|
+
/** Current concrete route, absent only before `initialTarget` is called. */
|
|
48
|
+
route?: string;
|
|
49
|
+
/** Current concrete catalog name, absent only before boot resolution. */
|
|
50
|
+
modelName?: string;
|
|
51
|
+
/** Current route-owned effort, absent only before boot resolution. */
|
|
52
|
+
thinkingLevel?: ThinkingLevel;
|
|
53
|
+
/** Most recent successful classifier explanation. */
|
|
54
|
+
lastRationale?: string;
|
|
55
|
+
/** Number of completed parent assistant messages observed by the router. */
|
|
56
|
+
assistantSteps: number;
|
|
57
|
+
/** Steps remaining before cadence classification; zero means classification is due. */
|
|
58
|
+
stepsUntilClassification: number;
|
|
59
|
+
/** True when virtual routing is suspended by a concrete model pin. */
|
|
60
|
+
pinned: boolean;
|
|
61
|
+
/** Whether this tier exposes the advisor tool. */
|
|
62
|
+
advisorEnabled: boolean;
|
|
63
|
+
/** Current step-based advisor floor. */
|
|
64
|
+
advisorGate: AdvisorGate;
|
|
65
|
+
/** Sticky facts learned from the current user turn's prompt and step outputs. */
|
|
66
|
+
facts: TurnFacts;
|
|
67
|
+
}
|
|
68
|
+
export interface ModelRouterOptions {
|
|
69
|
+
/** Complete routing table loaded for this project. */
|
|
70
|
+
table: RoutingTable;
|
|
71
|
+
/** Virtual tier selected for this session. */
|
|
72
|
+
tier: string;
|
|
73
|
+
/** Injected route classifier; production binds it to the table classifier target. */
|
|
74
|
+
classify: RouteClassifier;
|
|
75
|
+
/** Injected concrete-model capability lookup used by route resolution. */
|
|
76
|
+
resolveCatalog: RouteResolutionCatalog;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Session-local routing state machine. It owns all cadence and interlock policy;
|
|
80
|
+
* callers only report runtime facts and apply returned switches.
|
|
81
|
+
*/
|
|
82
|
+
export declare class ModelRouter {
|
|
83
|
+
private readonly table;
|
|
84
|
+
private readonly tier;
|
|
85
|
+
private readonly classify;
|
|
86
|
+
private readonly resolveCatalog;
|
|
87
|
+
private current?;
|
|
88
|
+
private assistantSteps;
|
|
89
|
+
private lastClassificationStep;
|
|
90
|
+
private firstClassificationPending;
|
|
91
|
+
private advisorClassificationPending;
|
|
92
|
+
private stepTriggerClassificationPending;
|
|
93
|
+
private compactionClassificationPending;
|
|
94
|
+
private lastAdvisorStep?;
|
|
95
|
+
private lastStepDelta?;
|
|
96
|
+
private currentTurnHint?;
|
|
97
|
+
private lastRationale?;
|
|
98
|
+
private pinned;
|
|
99
|
+
private advisorConsultInFlight;
|
|
100
|
+
private facts;
|
|
101
|
+
/** Precomputed: the tier has exactly one possible destination, so classification is skipped. */
|
|
102
|
+
private readonly singleDestination;
|
|
103
|
+
constructor(options: ModelRouterOptions);
|
|
104
|
+
/**
|
|
105
|
+
* True when every route in the tier resolves to one identical
|
|
106
|
+
* `{model, effort}` pair, so classification cannot change anything —
|
|
107
|
+
* every classifier call (turn start, cadence, step trigger, advisor
|
|
108
|
+
* milestone) is skipped for the session. Applied per-route vision fallbacks
|
|
109
|
+
* participate because they can add a distinct model/effort destination.
|
|
110
|
+
*/
|
|
111
|
+
private computeSingleDestination;
|
|
112
|
+
/** Resolve and retain the tier's general boot target before the first classifier call. */
|
|
113
|
+
initialTarget(context: RouteContext): ResolvedTarget;
|
|
114
|
+
/**
|
|
115
|
+
* Reset sticky routing facts from the new parent prompt at each user-turn
|
|
116
|
+
* boundary. A pending step-trigger arm deliberately survives: a trigger
|
|
117
|
+
* raised by the FINAL step of a turn has no intra-turn boundary left to
|
|
118
|
+
* consume it, so it rides into this turn's first classification instead of
|
|
119
|
+
* being silently dropped. Completed classifications clear every arm.
|
|
120
|
+
*/
|
|
121
|
+
noteTurnStart(input: {
|
|
122
|
+
promptHasImages: boolean;
|
|
123
|
+
}): void;
|
|
124
|
+
/** Record one completed parent assistant step and evaluate its runtime-neutral output summary. */
|
|
125
|
+
noteAssistantStep(observation?: StepObservation): void;
|
|
126
|
+
/** Arm one cap-exempt classification after an independent wire-prefix compaction. */
|
|
127
|
+
noteCompaction(): void;
|
|
128
|
+
/** Suspend virtual routing while a concrete model is pinned. */
|
|
129
|
+
pin(): void;
|
|
130
|
+
/** Resume virtual routing without discarding milestones accumulated while pinned. */
|
|
131
|
+
unpin(): void;
|
|
132
|
+
/** True when a one-shot milestone or completed-step cadence requests classification. */
|
|
133
|
+
shouldClassify(): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Classify and resolve a due route. Provider failure, abort, or invalid
|
|
136
|
+
* resolution is deliberately a no-op so the active model and milestones stay intact.
|
|
137
|
+
*/
|
|
138
|
+
prepareTurn(input: RouterPrepareInput): Promise<RouterSwitch | undefined>;
|
|
139
|
+
/** Current advisor floor; the first successful consult is always allowed. */
|
|
140
|
+
advisorGate(): AdvisorGate;
|
|
141
|
+
/** Atomically authorize one advisor attempt and reserve the session's consult slot. */
|
|
142
|
+
beginAdvisorConsult(): AdvisorGate;
|
|
143
|
+
/** Release the consult slot; only success stamps the floor and requests reclassification. */
|
|
144
|
+
endAdvisorConsult(success: boolean): void;
|
|
145
|
+
/** Return a detached snapshot; callers never infer routing policy from runner state. */
|
|
146
|
+
status(): RouterStatus;
|
|
147
|
+
private classificationTrigger;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/model-routing/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAwB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhG,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG,CAC5B,KAAK,EAAE,eAAe,EACtB,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,aAAa,EAAE,aAAa,CAAC;IAC7B,uDAAuD;IACvD,OAAO,EAAE,YAAY,CAAC;IACtB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,cAAc,EAAE,O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