@miller-tech/uap 1.117.0 → 1.118.1
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/config/model-profiles/claude-fable-5.json +78 -0
- package/config/model-profiles/claude-haiku-4.5.json +69 -0
- package/config/model-profiles/claude-opus-4.8.json +72 -0
- package/config/model-profiles/claude-sonnet-5.json +58 -20
- package/config/model-profiles/qwen36.json +102 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/guided-setup.d.ts.map +1 -1
- package/dist/cli/guided-setup.js +20 -12
- package/dist/cli/guided-setup.js.map +1 -1
- package/dist/cli/tool-calls.d.ts +3 -1
- package/dist/cli/tool-calls.d.ts.map +1 -1
- package/dist/cli/tool-calls.js +48 -128
- package/dist/cli/tool-calls.js.map +1 -1
- package/dist/cli/wizard-config.d.ts +0 -6
- package/dist/cli/wizard-config.d.ts.map +1 -1
- package/dist/cli/wizard-config.js +0 -23
- package/dist/cli/wizard-config.js.map +1 -1
- package/dist/models/profile-map.d.ts +48 -0
- package/dist/models/profile-map.d.ts.map +1 -0
- package/dist/models/profile-map.js +104 -0
- package/dist/models/profile-map.js.map +1 -0
- package/package.json +1 -1
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model → tool-call profile mapping.
|
|
3
|
+
*
|
|
4
|
+
* Maps a routed model (a ModelPresets id or a raw model name) to the
|
|
5
|
+
* `config/model-profiles/<name>.json` profile that carries that model's optimal
|
|
6
|
+
* tool-call + sampling/reasoning settings. Consumed by `uap-tool-calls`
|
|
7
|
+
* (`detectModelProfile`) and the guided setup so the active profile
|
|
8
|
+
* AUTO-SWITCHES to match whichever model the routing layer selects — there is
|
|
9
|
+
* no manual "Model profile" pick in setup anymore.
|
|
10
|
+
*
|
|
11
|
+
* This is a PURE module (no zod, no fs) so the `uap-tool-calls` bin can import
|
|
12
|
+
* it cheaply and it stays trivially unit-testable.
|
|
13
|
+
*/
|
|
14
|
+
export declare const GENERIC_PROFILE = "generic";
|
|
15
|
+
/**
|
|
16
|
+
* Explicit `ModelPresets` id → profile filename (without the `.json`).
|
|
17
|
+
* Every current Anthropic + OpenAI model (and the local Qwen executors) has a
|
|
18
|
+
* matching `config/model-profiles/*.json`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MODEL_PRESET_PROFILE: Record<string, string>;
|
|
21
|
+
/**
|
|
22
|
+
* Provider → default profile used when no specific model/routing is known
|
|
23
|
+
* (single-model setups that never picked a routing option).
|
|
24
|
+
*/
|
|
25
|
+
export declare const PROVIDER_DEFAULT_PROFILE: Record<string, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve a routed model id/name to a profile filename. Falls back to fuzzy
|
|
28
|
+
* matching on the raw string (so a bare `apiModel` like `claude-opus-4-8` or an
|
|
29
|
+
* unknown alias still lands on the right family), then `generic`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function profileForModelId(modelId: string | null | undefined): string;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve the active profile from a `.uap.json` `multiModel` block (routing).
|
|
34
|
+
* Uses the executor role — the model that actually generates code and emits the
|
|
35
|
+
* tool calls the profile tunes. Returns null when routing is absent or disabled
|
|
36
|
+
* so callers can fall back to a provider/legacy default.
|
|
37
|
+
*/
|
|
38
|
+
export declare function profileForRouting(multiModel: {
|
|
39
|
+
enabled?: boolean;
|
|
40
|
+
roles?: {
|
|
41
|
+
executor?: string;
|
|
42
|
+
};
|
|
43
|
+
} | null | undefined): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a provider default profile (single-model setup, no routing).
|
|
46
|
+
*/
|
|
47
|
+
export declare function profileForProvider(provider: string | null | undefined): string;
|
|
48
|
+
//# sourceMappingURL=profile-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-map.d.ts","sourceRoot":"","sources":["../../src/models/profile-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAYvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM3D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAmB5E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAClF,MAAM,GAAG,IAAI,CAKf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAG9E"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model → tool-call profile mapping.
|
|
3
|
+
*
|
|
4
|
+
* Maps a routed model (a ModelPresets id or a raw model name) to the
|
|
5
|
+
* `config/model-profiles/<name>.json` profile that carries that model's optimal
|
|
6
|
+
* tool-call + sampling/reasoning settings. Consumed by `uap-tool-calls`
|
|
7
|
+
* (`detectModelProfile`) and the guided setup so the active profile
|
|
8
|
+
* AUTO-SWITCHES to match whichever model the routing layer selects — there is
|
|
9
|
+
* no manual "Model profile" pick in setup anymore.
|
|
10
|
+
*
|
|
11
|
+
* This is a PURE module (no zod, no fs) so the `uap-tool-calls` bin can import
|
|
12
|
+
* it cheaply and it stays trivially unit-testable.
|
|
13
|
+
*/
|
|
14
|
+
export const GENERIC_PROFILE = 'generic';
|
|
15
|
+
/**
|
|
16
|
+
* Explicit `ModelPresets` id → profile filename (without the `.json`).
|
|
17
|
+
* Every current Anthropic + OpenAI model (and the local Qwen executors) has a
|
|
18
|
+
* matching `config/model-profiles/*.json`.
|
|
19
|
+
*/
|
|
20
|
+
export const MODEL_PRESET_PROFILE = {
|
|
21
|
+
'opus-4.8': 'claude-opus-4.8',
|
|
22
|
+
'opus-4.6': 'claude-opus-4.6',
|
|
23
|
+
'sonnet-5': 'claude-sonnet-5',
|
|
24
|
+
'sonnet-4.6': 'claude-sonnet-4.6',
|
|
25
|
+
'haiku-4.5': 'claude-haiku-4.5',
|
|
26
|
+
haiku: 'claude-haiku-3.5',
|
|
27
|
+
'fable-5': 'claude-fable-5',
|
|
28
|
+
'gpt-5.4': 'gpt-5.4',
|
|
29
|
+
'gpt-5.3-codex': 'gpt-5.3-codex',
|
|
30
|
+
'qwen35-a3b': 'qwen35',
|
|
31
|
+
'qwen36-a3b': 'qwen36',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Provider → default profile used when no specific model/routing is known
|
|
35
|
+
* (single-model setups that never picked a routing option).
|
|
36
|
+
*/
|
|
37
|
+
export const PROVIDER_DEFAULT_PROFILE = {
|
|
38
|
+
anthropic: 'claude-sonnet-5',
|
|
39
|
+
openai: 'gpt-5.4',
|
|
40
|
+
local: 'qwen36',
|
|
41
|
+
ollama: 'qwen36',
|
|
42
|
+
custom: GENERIC_PROFILE,
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a routed model id/name to a profile filename. Falls back to fuzzy
|
|
46
|
+
* matching on the raw string (so a bare `apiModel` like `claude-opus-4-8` or an
|
|
47
|
+
* unknown alias still lands on the right family), then `generic`.
|
|
48
|
+
*/
|
|
49
|
+
export function profileForModelId(modelId) {
|
|
50
|
+
if (!modelId)
|
|
51
|
+
return GENERIC_PROFILE;
|
|
52
|
+
const id = modelId.trim();
|
|
53
|
+
if (MODEL_PRESET_PROFILE[id])
|
|
54
|
+
return MODEL_PRESET_PROFILE[id];
|
|
55
|
+
const lower = id.toLowerCase();
|
|
56
|
+
if (/fable/.test(lower))
|
|
57
|
+
return 'claude-fable-5';
|
|
58
|
+
if (/opus.*4[.\-_]?8/.test(lower))
|
|
59
|
+
return 'claude-opus-4.8';
|
|
60
|
+
if (/opus.*4[.\-_]?6/.test(lower))
|
|
61
|
+
return 'claude-opus-4.6';
|
|
62
|
+
if (/opus/.test(lower))
|
|
63
|
+
return 'claude-opus-4.8';
|
|
64
|
+
if (/sonnet[-_. ]*5/.test(lower))
|
|
65
|
+
return 'claude-sonnet-5';
|
|
66
|
+
if (/sonnet/.test(lower))
|
|
67
|
+
return 'claude-sonnet-4.6';
|
|
68
|
+
if (/haiku.*4[.\-_]?5/.test(lower))
|
|
69
|
+
return 'claude-haiku-4.5';
|
|
70
|
+
if (/haiku/.test(lower))
|
|
71
|
+
return 'claude-haiku-3.5';
|
|
72
|
+
if (/gpt.*codex/.test(lower))
|
|
73
|
+
return 'gpt-5.3-codex';
|
|
74
|
+
if (/gpt/.test(lower))
|
|
75
|
+
return 'gpt-5.4';
|
|
76
|
+
if (/qwen.*(3[.\-_]?6|36)/.test(lower))
|
|
77
|
+
return 'qwen36';
|
|
78
|
+
if (/qwen/.test(lower))
|
|
79
|
+
return 'qwen35';
|
|
80
|
+
return GENERIC_PROFILE;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Resolve the active profile from a `.uap.json` `multiModel` block (routing).
|
|
84
|
+
* Uses the executor role — the model that actually generates code and emits the
|
|
85
|
+
* tool calls the profile tunes. Returns null when routing is absent or disabled
|
|
86
|
+
* so callers can fall back to a provider/legacy default.
|
|
87
|
+
*/
|
|
88
|
+
export function profileForRouting(multiModel) {
|
|
89
|
+
if (!multiModel || multiModel.enabled === false)
|
|
90
|
+
return null;
|
|
91
|
+
const executor = multiModel.roles?.executor;
|
|
92
|
+
if (!executor)
|
|
93
|
+
return null;
|
|
94
|
+
return profileForModelId(executor);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Resolve a provider default profile (single-model setup, no routing).
|
|
98
|
+
*/
|
|
99
|
+
export function profileForProvider(provider) {
|
|
100
|
+
if (!provider)
|
|
101
|
+
return GENERIC_PROFILE;
|
|
102
|
+
return PROVIDER_DEFAULT_PROFILE[provider] ?? GENERIC_PROFILE;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=profile-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-map.js","sourceRoot":"","sources":["../../src/models/profile-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,iBAAiB;IAC7B,YAAY,EAAE,mBAAmB;IACjC,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,gBAAgB;IAC3B,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,eAAe;IAChC,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA2B;IAC9D,SAAS,EAAE,iBAAiB;IAC5B,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAkC;IAClE,IAAI,CAAC,OAAO;QAAE,OAAO,eAAe,CAAC;IACrC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,oBAAoB,CAAC,EAAE,CAAC;QAAE,OAAO,oBAAoB,CAA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