@dsh-cc/model-aliases 0.9.3-rc.4 → 0.9.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.i18n.yaml +2 -2
- package/README.md +5 -5
- package/README.zh.md +2 -2
- package/lib/effort.d.ts +8 -21
- package/lib/effort.d.ts.map +1 -1
- package/lib/effort.js +8 -25
- package/lib/effort.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +35 -10
- package/lib/service.js.map +1 -1
- package/package.json +8 -5
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm check:readme --write
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 83372cd6d0fde3d68ad491b2af6a281af5714580
|
|
6
|
+
README.zh.md: 36d353997c9192c43d29668a7ff68b9592e3c1f1
|
package/README.md
CHANGED
|
@@ -99,8 +99,9 @@ non-empty string whose legal spellings belong to the **target model's adapter**
|
|
|
99
99
|
(`max`, `xhigh`, `high`, … — not validated against any adapter catalog here).
|
|
100
100
|
When present, the spawn (the Task tool and the plugin-loader's
|
|
101
101
|
`AgentProvider`) stamps it onto the child's options, and the routes service's
|
|
102
|
-
|
|
103
|
-
overriding any effort restored from a
|
|
102
|
+
`subagent/start` listener selects it durably onto the child's live model
|
|
103
|
+
selection before the first step freezes, overriding any effort restored from a
|
|
104
|
+
forked parent header. String-form
|
|
104
105
|
aliases cannot carry an effort; `inherit` / unconfigured builtins stamp
|
|
105
106
|
nothing. An effort the target model does not support fails the request with
|
|
106
107
|
`UNSUPPORTED_REASONING_EFFORT` — fail-loud, by design.
|
|
@@ -193,9 +194,8 @@ cc-shell (and the routes service), so in CC mode the fix is always active.
|
|
|
193
194
|
`{ modelAliases?: Record<string, AliasTarget> }` (deployment defaults).
|
|
194
195
|
- `ModelRoutes` — the value type of `ctx.get('ccModelRoutes')` (`resolve(model):
|
|
195
196
|
{ provider?, model?, reasoningEffort? } | undefined`).
|
|
196
|
-
- `
|
|
197
|
-
|
|
198
|
-
exported for tests and host embeddings.
|
|
197
|
+
- `stampedEffortOf(options)` — read the effort stamp back from an agent options
|
|
198
|
+
record; exported for tests and host embeddings.
|
|
199
199
|
- `mergeAliasMaps(config, settings)` — entry-shallow merge with `null` deletion
|
|
200
200
|
and case-insensitive key folding; returns an effective `ReadonlyMap` of only
|
|
201
201
|
the configured aliases.
|
package/README.zh.md
CHANGED
|
@@ -64,7 +64,7 @@ alias 的查找顺序:**settings overlay → config 默认 → builtin fallbac
|
|
|
64
64
|
|
|
65
65
|
### 对象形式 alias 的 `reasoningEffort`
|
|
66
66
|
|
|
67
|
-
对象形式 alias 可声明可选的 `reasoningEffort`:一个不透明的非空字符串,其合法拼写属于**目标模型的适配器**(`max`、`xhigh`、`high`、…——此处不对任何适配器目录做校验)。存在时,spawn 侧(Task 工具与 plugin-loader 的 `AgentProvider`)把它 stamp 到 child 的 options 上,routes
|
|
67
|
+
对象形式 alias 可声明可选的 `reasoningEffort`:一个不透明的非空字符串,其合法拼写属于**目标模型的适配器**(`max`、`xhigh`、`high`、…——此处不对任何适配器目录做校验)。存在时,spawn 侧(Task 工具与 plugin-loader 的 `AgentProvider`)把它 stamp 到 child 的 options 上,routes 服务的 `subagent/start` listener 会在第一步冻结选择之前,把它持久地选进 child 的模型选择,覆盖任何从 fork 父 header 恢复的 effort。字符串形式 alias 无法携带 effort;`inherit` / 未配置 builtin 不 stamp 任何东西。目标模型不支持的 effort 会让请求以 `UNSUPPORTED_REASONING_EFFORT` 失败——有意 fail-loud。
|
|
68
68
|
|
|
69
69
|
```jsonc
|
|
70
70
|
// settings 命名空间 "model-aliases"
|
|
@@ -112,7 +112,7 @@ alias 的查找顺序:**settings overlay → config 默认 → builtin fallbac
|
|
|
112
112
|
|
|
113
113
|
- `apply(ctx, config?)` / `name` — **cordis 插件入口**(插件 id `cc-model-routes`,另以 `applyRoutes` / `routesPluginName` 再导出)。挂载服务;config 形状为 `{ modelAliases?: Record<string, AliasTarget> }`(部署默认)。
|
|
114
114
|
- `ModelRoutes` — `ctx.get('ccModelRoutes')` 的值类型(`resolve(model): { provider?, model?, reasoningEffort? } | undefined`)。
|
|
115
|
-
- `
|
|
115
|
+
- `stampedEffortOf(options)` — 从 agent options 记录里读回 effort stamp;为测试与宿主内嵌而导出。
|
|
116
116
|
- `mergeAliasMaps(config, settings)` — 带 `null` 删除与大小写不敏感 key 折叠的 entry-shallow merge;返回只含已配置 alias 的有效 `ReadonlyMap`。
|
|
117
117
|
- `createModelResolver(getAliases, { warn })` — 构建 `resolveModel` 闭包。`getAliases` 是**每次调用**求值的 thunk(liveness)。可选 `warn` 替换默认的 `console.warn`(用于未配置自定义 alias 告警)。
|
|
118
118
|
- `BUILTIN_ALIASES` — CC 家族(`fable`/`opus`/`sonnet`/`haiku`)加上 dsh-cc lane(`sketch`/`draft`/`blueprint`/`masterplan`/`architect`/`gauge`)。
|
package/lib/effort.d.ts
CHANGED
|
@@ -1,31 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Host-side application of an alias-stamped reasoning effort.
|
|
2
|
+
* Host-side application of an alias-stamped reasoning effort (harness-0.2.2
|
|
3
|
+
* D3.6: the stamp is applied DURABLY at child publication — the request-time
|
|
4
|
+
* overlay is gone, step-fatally rejected upstream).
|
|
3
5
|
*
|
|
4
6
|
* Named CC subagents carry `reasoningEffort` on their child options as an
|
|
5
7
|
* undeclared runtime extra key (stamped by the Task tool / plugin-loader when
|
|
6
|
-
* the spawn's alias resolved with one).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* The overlay is a shallow copy: assigning onto the resolved config in place
|
|
13
|
-
* throws on the frozen seed or is invisible. Any absent/blank/non-string
|
|
14
|
-
* stamp is a no-op returning the input unchanged.
|
|
8
|
+
* the spawn's alias resolved with one). A fork-seed child restores an
|
|
9
|
+
* explicit parent `/effort` through the seeded log prefix (S4 probe:
|
|
10
|
+
* `AgentModel.current()` reports the restored effort, not the stamp), so the
|
|
11
|
+
* `subagent/start` listener in the routes service selects the stamp onto the
|
|
12
|
+
* child's live selection — the alias contract wins.
|
|
15
13
|
*
|
|
16
14
|
* @module @dsh-cc/model-aliases/effort
|
|
17
15
|
*/
|
|
18
|
-
/**
|
|
19
|
-
* Overlay an alias-stamped reasoning effort onto one resolved request config.
|
|
20
|
-
* @param resolved - the config produced by the `agent/request` waterfall.
|
|
21
|
-
* @param stamped - the effort read off the child agent's options (any type;
|
|
22
|
-
* only a non-empty string applies).
|
|
23
|
-
* @returns a shallow copy carrying the stamp, or the input unchanged when the
|
|
24
|
-
* stamp is absent/blank/non-string.
|
|
25
|
-
*/
|
|
26
|
-
export declare function overlayStampedEffort<T extends {
|
|
27
|
-
reasoningEffort?: unknown;
|
|
28
|
-
}>(resolved: T, stamped: unknown): T;
|
|
29
16
|
/**
|
|
30
17
|
* Read the effort stamp off a child agent's options. The stamp is an
|
|
31
18
|
* undeclared runtime extra key (`AgentOptions` is merge-extensible and the
|
package/lib/effort.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../src/effort.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../src/effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAIpE"}
|
package/lib/effort.js
CHANGED
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Host-side application of an alias-stamped reasoning effort.
|
|
2
|
+
* Host-side application of an alias-stamped reasoning effort (harness-0.2.2
|
|
3
|
+
* D3.6: the stamp is applied DURABLY at child publication — the request-time
|
|
4
|
+
* overlay is gone, step-fatally rejected upstream).
|
|
3
5
|
*
|
|
4
6
|
* Named CC subagents carry `reasoningEffort` on their child options as an
|
|
5
7
|
* undeclared runtime extra key (stamped by the Task tool / plugin-loader when
|
|
6
|
-
* the spawn's alias resolved with one).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* The overlay is a shallow copy: assigning onto the resolved config in place
|
|
13
|
-
* throws on the frozen seed or is invisible. Any absent/blank/non-string
|
|
14
|
-
* stamp is a no-op returning the input unchanged.
|
|
8
|
+
* the spawn's alias resolved with one). A fork-seed child restores an
|
|
9
|
+
* explicit parent `/effort` through the seeded log prefix (S4 probe:
|
|
10
|
+
* `AgentModel.current()` reports the restored effort, not the stamp), so the
|
|
11
|
+
* `subagent/start` listener in the routes service selects the stamp onto the
|
|
12
|
+
* child's live selection — the alias contract wins.
|
|
15
13
|
*
|
|
16
14
|
* @module @dsh-cc/model-aliases/effort
|
|
17
15
|
*/
|
|
18
|
-
/**
|
|
19
|
-
* Overlay an alias-stamped reasoning effort onto one resolved request config.
|
|
20
|
-
* @param resolved - the config produced by the `agent/request` waterfall.
|
|
21
|
-
* @param stamped - the effort read off the child agent's options (any type;
|
|
22
|
-
* only a non-empty string applies).
|
|
23
|
-
* @returns a shallow copy carrying the stamp, or the input unchanged when the
|
|
24
|
-
* stamp is absent/blank/non-string.
|
|
25
|
-
*/
|
|
26
|
-
export function overlayStampedEffort(resolved, stamped) {
|
|
27
|
-
if (typeof stamped !== 'string' || stamped.length === 0)
|
|
28
|
-
return resolved;
|
|
29
|
-
// Stamp is an opaque adapter spelling; the branded `ReasoningEffortId` on
|
|
30
|
-
// LlmCallConfig is applied at prepareCall, not here.
|
|
31
|
-
return { ...resolved, reasoningEffort: stamped };
|
|
32
|
-
}
|
|
33
16
|
/**
|
|
34
17
|
* Read the effort stamp off a child agent's options. The stamp is an
|
|
35
18
|
* undeclared runtime extra key (`AgentOptions` is merge-extensible and the
|
package/lib/effort.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effort.js","sourceRoot":"","sources":["../src/effort.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"effort.js","sourceRoot":"","sources":["../src/effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACrE,MAAM,MAAM,GAAI,OAAyC,CAAC,eAAe,CAAA;IACzE,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AAC7E,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export { BUILTIN_ALIASES, CC_ALIASES, LANE_ALIASES, LANE_PEERS, mergeAliasMaps, createModelResolver, createModelInspector, splitLevelSuffix, type ModelResolver } from './resolver.ts';
|
|
16
16
|
export { toAgentOptions, toOneShotRoute, resolveSpawnEffort, type OneShotParentRoute } from './agentOptions.ts';
|
|
17
|
-
export {
|
|
17
|
+
export { stampedEffortOf } from './effort.ts';
|
|
18
18
|
export { ConfigAliasSchema, ConfigAliasesSchema, SettingsAliasSchema, SettingsAliasesSchema, type ConfigAliasEntry, type SettingsAliasEntry, } from './schema.ts';
|
|
19
19
|
export type { AliasTarget, DetailedRoute, ResolvedRoute, AliasInspectKind, AliasInspectVia, AliasInspection } from './types.ts';
|
|
20
20
|
export { SystemOneChatModelError, isSystemOneTarget } from './systemone-guard.ts';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AACtL,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AACtL,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC/H,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,IAAI,IAAI,gBAAgB,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5J,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export { BUILTIN_ALIASES, CC_ALIASES, LANE_ALIASES, LANE_PEERS, mergeAliasMaps, createModelResolver, createModelInspector, splitLevelSuffix } from "./resolver.js";
|
|
16
16
|
export { toAgentOptions, toOneShotRoute, resolveSpawnEffort } from "./agentOptions.js";
|
|
17
|
-
export {
|
|
17
|
+
export { stampedEffortOf } from "./effort.js";
|
|
18
18
|
export { ConfigAliasSchema, ConfigAliasesSchema, SettingsAliasSchema, SettingsAliasesSchema, } from "./schema.js";
|
|
19
19
|
export { SystemOneChatModelError, isSystemOneTarget } from "./systemone-guard.js";
|
|
20
20
|
export { apply as applyRoutes, name as routesPluginName, MODEL_ALIASES_NAMESPACE, resolveAlias, resolveDetailedAlias } from "./service.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAA;AACtL,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAA;AACtL,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACjF,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,IAAI,IAAI,gBAAgB,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAoB,MAAM,cAAc,CAAA;AAC5J,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA"}
|
package/lib/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,2BAA2B,CAAA;AAUpF,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE5F,0DAA0D;AAC1D,MAAM,WAAW,MAAM;IACrB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAA;CAC1D;AAED,oEAAoE;AACpE,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAAmD,CAAA;AAEhF,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,EAAsB,iBAAiB,CAAA;AAE3E,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;IAC7D;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAAA;IACzD,iFAAiF;IACjF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,CAAA;CACpD;AAED,wBAAwB;AACxB,eAAO,MAAM,IAAI,oBAAoB,CAAA;AAErC;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAmF7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAY/F;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAY3F"}
|
package/lib/service.js
CHANGED
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* @module @dsh-cc/model-aliases/service
|
|
16
16
|
*/
|
|
17
17
|
import z from '@deepseek-ai/schemastery';
|
|
18
|
+
import { ReasoningEffortId } from '@deepseek-ai/dsh-llm';
|
|
19
|
+
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
18
20
|
import { registerNamespaceSafe } from '@dsh-cc/settings-ns';
|
|
19
21
|
import { ConfigAliasesSchema, SettingsAliasesSchema } from "./schema.js";
|
|
20
22
|
import { createModelInspector, createModelResolver, mergeAliasMaps } from "./resolver.js";
|
|
21
|
-
import {
|
|
23
|
+
import { stampedEffortOf } from "./effort.js";
|
|
22
24
|
import { assertChatModel } from "./systemone-guard.js";
|
|
23
25
|
/** Runtime config schema (config-layer aliases never hold null). */
|
|
24
26
|
export const Config = z.object({ modelAliases: ConfigAliasesSchema });
|
|
@@ -64,16 +66,39 @@ export function apply(ctx, config = {}) {
|
|
|
64
66
|
// captured background spawn throw TypeError at spawn time. `inspect` keeps
|
|
65
67
|
// the upstream provenance form (`/doctor`) available alongside.
|
|
66
68
|
ctx.provide('ccModelRoutes', { resolve: resolver, resolveDetailed, inspect });
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
69
|
+
// Spawn-path stamp application (harness-0.2.2 D3.6 — replaces the
|
|
70
|
+
// request-time stamped-effort overlay, which `agent/request`'s
|
|
71
|
+
// model-identity guard now rejects step-fatally): a child spawned through
|
|
72
|
+
// an alias whose route declared `reasoningEffort` carries it on its options
|
|
73
|
+
// (stamped by the Task tool / plugin-loader). The S4 fork-seed probe proved
|
|
74
|
+
// restoration still occurs: a fork child inherits the parent's explicit
|
|
75
|
+
// header effort through the seeded log prefix, so `AgentModel.current()`
|
|
76
|
+
// reports the RESTORED effort, not the stamp — the alias contract must win,
|
|
77
|
+
// so the stamp is selected DURABLY at child publication (`subagent/start`
|
|
78
|
+
// fires before the first step's freeze). Plain spawns need no event: when
|
|
79
|
+
// the live selection already carries the stamp, `select` is skipped (an
|
|
80
|
+
// options-only fallback must not gain durable noise). Root agents carry no
|
|
73
81
|
// stamp on options, so this is a no-op for them.
|
|
74
|
-
ctx.on('
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
ctx.on('subagent/start', (info, _parent) => {
|
|
83
|
+
try {
|
|
84
|
+
const id = typeof info?.id === 'string' ? info.id : undefined;
|
|
85
|
+
if (id === undefined)
|
|
86
|
+
return;
|
|
87
|
+
const child = ctx
|
|
88
|
+
.agents?.get(SessionId(id));
|
|
89
|
+
if (child?.model === undefined)
|
|
90
|
+
return;
|
|
91
|
+
const stamp = stampedEffortOf(child.options);
|
|
92
|
+
if (stamp === undefined)
|
|
93
|
+
return;
|
|
94
|
+
const live = child.model.current();
|
|
95
|
+
if (live === undefined || live.reasoningEffort === stamp)
|
|
96
|
+
return;
|
|
97
|
+
child.model.select({ provider: live.provider, model: live.model, reasoningEffort: ReasoningEffortId(stamp) });
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// A stamp application failure must never surface into the spawn path.
|
|
101
|
+
}
|
|
77
102
|
});
|
|
78
103
|
// System One chat-path guard (the single boundary): every chat request —
|
|
79
104
|
// root and child agent loops, and hand-built one-shots (side queries,
|
package/lib/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,CAAC,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAK3D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAStD,oEAAoE;AACpE,MAAM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
3
|
"description": "Claude Code-compatible model alias resolution for the DeepSeek Harness",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
"license": "Apache-2.0",
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@deepseek-ai/cordis": ">=0.2.0-rc.2",
|
|
37
|
-
"@deepseek-ai/dsh-agent": ">=0.2.
|
|
37
|
+
"@deepseek-ai/dsh-agent": ">=0.2.2-rc.1",
|
|
38
|
+
"@deepseek-ai/dsh-llm": ">=0.2.2-rc.1",
|
|
39
|
+
"@deepseek-ai/dsh-session": ">=0.2.2-rc.1",
|
|
40
|
+
"@deepseek-ai/dsh-subagent": ">=0.2.2-rc.1",
|
|
38
41
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
@@ -50,14 +53,14 @@
|
|
|
50
53
|
"@deepseek-ai/dsh-subagent-fork-in-process": "link:../../../../deepseek-harness/packages/subagent/subagent-fork-in-process",
|
|
51
54
|
"@deepseek-ai/dsh-subagent-spawn-in-process": "link:../../../../deepseek-harness/packages/subagent/subagent-spawn-in-process",
|
|
52
55
|
"@deepseek-ai/schemastery": "link:../../../../deepseek-harness/vendor/schemastery",
|
|
53
|
-
"@dsh-cc/settings-provider": "^0.9.
|
|
56
|
+
"@dsh-cc/settings-provider": "^0.9.4",
|
|
54
57
|
"@dsh-cc/agent-loop-mock": "^0.1.0",
|
|
55
|
-
"@dsh-cc/settings-ns": "^0.9.
|
|
58
|
+
"@dsh-cc/settings-ns": "^0.9.4"
|
|
56
59
|
},
|
|
57
60
|
"publishConfig": {
|
|
58
61
|
"access": "public"
|
|
59
62
|
},
|
|
60
63
|
"dependencies": {
|
|
61
|
-
"@dsh-cc/settings-ns": "^0.9.
|
|
64
|
+
"@dsh-cc/settings-ns": "^0.9.4"
|
|
62
65
|
}
|
|
63
66
|
}
|