dsh-autotier 0.2.2 → 0.2.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/AGENTS.md +52 -23
- package/CHANGELOG.md +44 -0
- package/{README.es.md → README-es.md} +94 -13
- package/{README.hi.md → README-hi.md} +93 -14
- package/{README.pt.md → README-pt.md} +96 -16
- package/{README.zh.md → README-zh.md} +83 -11
- package/README.md +110 -18
- package/cordis.patch.yml +2 -2
- package/lib/client.js +72 -40
- package/lib/client.js.map +1 -1
- package/lib/index.js +233 -66
- package/lib/typert.host.js +1 -1
- package/lib/types/client/TierSettingsCard.d.ts +14 -12
- package/lib/types/client/TierSettingsCard.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +5 -4
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/remote.d.ts +12 -12
- package/lib/types/config.d.ts +20 -9
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/index.d.ts +11 -8
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/judge.d.ts +17 -0
- package/lib/types/judge.d.ts.map +1 -1
- package/lib/types/preflight.d.ts +21 -1
- package/lib/types/preflight.d.ts.map +1 -1
- package/lib/types/routing.d.ts.map +1 -1
- package/lib/types/schema.d.ts +44 -2
- package/lib/types/schema.d.ts.map +1 -1
- package/lib/types/selection.d.ts +36 -10
- package/lib/types/selection.d.ts.map +1 -1
- package/lib/types/service.d.ts +16 -9
- package/lib/types/service.d.ts.map +1 -1
- package/lib/types/settings.d.ts +44 -0
- package/lib/types/settings.d.ts.map +1 -0
- package/lib/types/typert.host.d.ts +12 -12
- package/lib/types/wire.d.ts +24 -24
- package/lib/types/wire.d.ts.map +1 -1
- package/lib/{wire-BpKSOHgo.js → wire-BxsY8BiN.js} +22 -20
- package/package.json +62 -56
- package/src/client/TierSettingsCard.tsx +25 -12
- package/src/client/index.ts +29 -16
- package/src/config.ts +70 -12
- package/src/index.ts +23 -19
- package/src/judge.ts +30 -2
- package/src/preflight.ts +68 -1
- package/src/routing.ts +11 -0
- package/src/schema.ts +48 -9
- package/src/selection.ts +54 -20
- package/src/service.ts +20 -18
- package/src/settings.ts +80 -0
- package/src/wire.ts +19 -20
package/lib/types/wire.d.ts
CHANGED
|
@@ -243,15 +243,15 @@ export declare const TIER_STATUS_DESCRIPTOR: Readonly<{
|
|
|
243
243
|
source: "json";
|
|
244
244
|
codec: Readonly<{
|
|
245
245
|
mode: "strict";
|
|
246
|
-
typeSymbol:
|
|
247
|
-
|
|
246
|
+
typeSymbol: string;
|
|
247
|
+
create: () => z.ZodOptional<z.ZodString>;
|
|
248
248
|
}>;
|
|
249
249
|
acceptsUndefined: true;
|
|
250
250
|
}>[];
|
|
251
251
|
readonly result: Readonly<{
|
|
252
252
|
mode: "strict";
|
|
253
253
|
typeSymbol: string;
|
|
254
|
-
|
|
254
|
+
create: () => z.ZodObject<{
|
|
255
255
|
mode: z.ZodEnum<{
|
|
256
256
|
strong: "strong";
|
|
257
257
|
cheap: "cheap";
|
|
@@ -361,10 +361,10 @@ export declare const TIER_CATALOG_DESCRIPTOR: Readonly<{
|
|
|
361
361
|
kind: "direct";
|
|
362
362
|
}>;
|
|
363
363
|
readonly parameters: readonly never[];
|
|
364
|
-
readonly result: Readonly<{
|
|
364
|
+
readonly result: Readonly<Readonly<{
|
|
365
365
|
mode: "strict";
|
|
366
|
-
typeSymbol:
|
|
367
|
-
|
|
366
|
+
typeSymbol: string;
|
|
367
|
+
create: () => z.ZodArray<z.ZodObject<{
|
|
368
368
|
provider: z.ZodString;
|
|
369
369
|
models: z.ZodArray<z.ZodObject<{
|
|
370
370
|
id: z.ZodString;
|
|
@@ -372,7 +372,7 @@ export declare const TIER_CATALOG_DESCRIPTOR: Readonly<{
|
|
|
372
372
|
inputModalities: z.ZodArray<z.ZodString>;
|
|
373
373
|
}, z.core.$strip>>;
|
|
374
374
|
}, z.core.$strip>>;
|
|
375
|
-
}
|
|
375
|
+
}>>;
|
|
376
376
|
readonly sourceLocation: Readonly<{
|
|
377
377
|
file: "src/wire.ts";
|
|
378
378
|
line: 1;
|
|
@@ -398,8 +398,8 @@ export declare const TIER_SET_MODE_DESCRIPTOR: Readonly<{
|
|
|
398
398
|
source: "json";
|
|
399
399
|
codec: Readonly<{
|
|
400
400
|
mode: "strict";
|
|
401
|
-
typeSymbol:
|
|
402
|
-
|
|
401
|
+
typeSymbol: string;
|
|
402
|
+
create: () => z.ZodOptional<z.ZodString>;
|
|
403
403
|
}>;
|
|
404
404
|
acceptsUndefined: true;
|
|
405
405
|
}> | Readonly<{
|
|
@@ -408,8 +408,8 @@ export declare const TIER_SET_MODE_DESCRIPTOR: Readonly<{
|
|
|
408
408
|
source: "json";
|
|
409
409
|
codec: Readonly<{
|
|
410
410
|
mode: "strict";
|
|
411
|
-
typeSymbol:
|
|
412
|
-
|
|
411
|
+
typeSymbol: string;
|
|
412
|
+
create: () => z.ZodEnum<{
|
|
413
413
|
strong: "strong";
|
|
414
414
|
cheap: "cheap";
|
|
415
415
|
off: "off";
|
|
@@ -421,7 +421,7 @@ export declare const TIER_SET_MODE_DESCRIPTOR: Readonly<{
|
|
|
421
421
|
readonly result: Readonly<{
|
|
422
422
|
mode: "strict";
|
|
423
423
|
typeSymbol: string;
|
|
424
|
-
|
|
424
|
+
create: () => z.ZodObject<{
|
|
425
425
|
mode: z.ZodEnum<{
|
|
426
426
|
strong: "strong";
|
|
427
427
|
cheap: "cheap";
|
|
@@ -537,15 +537,15 @@ export declare const TIER_INVOCATIONS: readonly (Readonly<{
|
|
|
537
537
|
source: "json";
|
|
538
538
|
codec: Readonly<{
|
|
539
539
|
mode: "strict";
|
|
540
|
-
typeSymbol:
|
|
541
|
-
|
|
540
|
+
typeSymbol: string;
|
|
541
|
+
create: () => z.ZodOptional<z.ZodString>;
|
|
542
542
|
}>;
|
|
543
543
|
acceptsUndefined: true;
|
|
544
544
|
}>[];
|
|
545
545
|
readonly result: Readonly<{
|
|
546
546
|
mode: "strict";
|
|
547
547
|
typeSymbol: string;
|
|
548
|
-
|
|
548
|
+
create: () => z.ZodObject<{
|
|
549
549
|
mode: z.ZodEnum<{
|
|
550
550
|
strong: "strong";
|
|
551
551
|
cheap: "cheap";
|
|
@@ -650,10 +650,10 @@ export declare const TIER_INVOCATIONS: readonly (Readonly<{
|
|
|
650
650
|
kind: "direct";
|
|
651
651
|
}>;
|
|
652
652
|
readonly parameters: readonly never[];
|
|
653
|
-
readonly result: Readonly<{
|
|
653
|
+
readonly result: Readonly<Readonly<{
|
|
654
654
|
mode: "strict";
|
|
655
|
-
typeSymbol:
|
|
656
|
-
|
|
655
|
+
typeSymbol: string;
|
|
656
|
+
create: () => z.ZodArray<z.ZodObject<{
|
|
657
657
|
provider: z.ZodString;
|
|
658
658
|
models: z.ZodArray<z.ZodObject<{
|
|
659
659
|
id: z.ZodString;
|
|
@@ -661,7 +661,7 @@ export declare const TIER_INVOCATIONS: readonly (Readonly<{
|
|
|
661
661
|
inputModalities: z.ZodArray<z.ZodString>;
|
|
662
662
|
}, z.core.$strip>>;
|
|
663
663
|
}, z.core.$strip>>;
|
|
664
|
-
}
|
|
664
|
+
}>>;
|
|
665
665
|
readonly sourceLocation: Readonly<{
|
|
666
666
|
file: "src/wire.ts";
|
|
667
667
|
line: 1;
|
|
@@ -681,8 +681,8 @@ export declare const TIER_INVOCATIONS: readonly (Readonly<{
|
|
|
681
681
|
source: "json";
|
|
682
682
|
codec: Readonly<{
|
|
683
683
|
mode: "strict";
|
|
684
|
-
typeSymbol:
|
|
685
|
-
|
|
684
|
+
typeSymbol: string;
|
|
685
|
+
create: () => z.ZodOptional<z.ZodString>;
|
|
686
686
|
}>;
|
|
687
687
|
acceptsUndefined: true;
|
|
688
688
|
}> | Readonly<{
|
|
@@ -691,8 +691,8 @@ export declare const TIER_INVOCATIONS: readonly (Readonly<{
|
|
|
691
691
|
source: "json";
|
|
692
692
|
codec: Readonly<{
|
|
693
693
|
mode: "strict";
|
|
694
|
-
typeSymbol:
|
|
695
|
-
|
|
694
|
+
typeSymbol: string;
|
|
695
|
+
create: () => z.ZodEnum<{
|
|
696
696
|
strong: "strong";
|
|
697
697
|
cheap: "cheap";
|
|
698
698
|
off: "off";
|
|
@@ -704,7 +704,7 @@ export declare const TIER_INVOCATIONS: readonly (Readonly<{
|
|
|
704
704
|
readonly result: Readonly<{
|
|
705
705
|
mode: "strict";
|
|
706
706
|
typeSymbol: string;
|
|
707
|
-
|
|
707
|
+
create: () => z.ZodObject<{
|
|
708
708
|
mode: z.ZodEnum<{
|
|
709
709
|
strong: "strong";
|
|
710
710
|
cheap: "cheap";
|
package/lib/types/wire.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,YAAY,CAAA;AAEnB,8EAA8E;AAC9E,eAAO,MAAM,cAAc,SAAS,CAAA;AAEpC;;;;GAIG;AACH,eAAO,MAAM,aAAa,8GAUiB,CAAA;AAE3C,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5C;AAED,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAC1C;AAED,gEAAgE;AAChE,MAAM,MAAM,WAAW,GAAG,SAAS,mB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;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAI3B,CAAA"}
|
|
@@ -5097,24 +5097,34 @@ const TIER_CATALOG_SCHEMA = array(object({
|
|
|
5097
5097
|
const TIER_AGENT_ID_SCHEMA = string().optional();
|
|
5098
5098
|
/** Strict wire schema for the routing mode parameter. */
|
|
5099
5099
|
const TIER_MODE_SCHEMA = _enum(ROUTING_MODES);
|
|
5100
|
+
/**
|
|
5101
|
+
* Strict codec, single-face.
|
|
5102
|
+
*
|
|
5103
|
+
* `TypertCodec`'s strict arm declares exactly one schema entry point,
|
|
5104
|
+
* `create(): TypertSchema`, and the typert-loader enforces it at registration
|
|
5105
|
+
* (`has no create() factory`). The `schema` property this used to carry as a
|
|
5106
|
+
* second face is gone from the protocol, so carrying it was dead weight — the
|
|
5107
|
+
* loader ignores it, and no published line reads it — while still looking like
|
|
5108
|
+
* a supported surface. The zod instance carries `.parse` natively, so the
|
|
5109
|
+
* factory hands the same object back on every call.
|
|
5110
|
+
*/
|
|
5111
|
+
function strictCodec(typeSymbol, schema) {
|
|
5112
|
+
return Object.freeze({
|
|
5113
|
+
mode: "strict",
|
|
5114
|
+
typeSymbol,
|
|
5115
|
+
create: () => schema
|
|
5116
|
+
});
|
|
5117
|
+
}
|
|
5100
5118
|
/** The optional trailing agent-id parameter both agent-addressed methods share. */
|
|
5101
5119
|
const AGENT_ID_PARAMETER = Object.freeze({
|
|
5102
5120
|
name: "agentId",
|
|
5103
5121
|
wire: "agentId",
|
|
5104
5122
|
source: "json",
|
|
5105
|
-
codec:
|
|
5106
|
-
mode: "strict",
|
|
5107
|
-
typeSymbol: "dsh-autotier/wire#TierAgentId",
|
|
5108
|
-
schema: TIER_AGENT_ID_SCHEMA
|
|
5109
|
-
}),
|
|
5123
|
+
codec: strictCodec("dsh-autotier/wire#TierAgentId", TIER_AGENT_ID_SCHEMA),
|
|
5110
5124
|
acceptsUndefined: true
|
|
5111
5125
|
});
|
|
5112
5126
|
/** The strict result codec every `tier` method returns. */
|
|
5113
|
-
const TIER_STATUS_RESULT =
|
|
5114
|
-
mode: "strict",
|
|
5115
|
-
typeSymbol: "dsh-autotier/wire#TierStatus",
|
|
5116
|
-
schema: TIER_STATUS_SCHEMA
|
|
5117
|
-
});
|
|
5127
|
+
const TIER_STATUS_RESULT = strictCodec("dsh-autotier/wire#TierStatus", TIER_STATUS_SCHEMA);
|
|
5118
5128
|
/** Diagnostics location shared by the hand-written descriptors below. */
|
|
5119
5129
|
const WIRE_LOCATION = Object.freeze({
|
|
5120
5130
|
file: "src/wire.ts",
|
|
@@ -5148,11 +5158,7 @@ const TIER_CATALOG_DESCRIPTOR = Object.freeze({
|
|
|
5148
5158
|
method: "catalog",
|
|
5149
5159
|
invocation: Object.freeze({ kind: "direct" }),
|
|
5150
5160
|
parameters: Object.freeze([]),
|
|
5151
|
-
result: Object.freeze(
|
|
5152
|
-
mode: "strict",
|
|
5153
|
-
typeSymbol: "dsh-autotier/wire#TierCatalog",
|
|
5154
|
-
schema: TIER_CATALOG_SCHEMA
|
|
5155
|
-
}),
|
|
5161
|
+
result: Object.freeze(strictCodec("dsh-autotier/wire#TierCatalog", TIER_CATALOG_SCHEMA)),
|
|
5156
5162
|
sourceLocation: WIRE_LOCATION
|
|
5157
5163
|
});
|
|
5158
5164
|
/**
|
|
@@ -5170,11 +5176,7 @@ const TIER_SET_MODE_DESCRIPTOR = Object.freeze({
|
|
|
5170
5176
|
name: "mode",
|
|
5171
5177
|
wire: "mode",
|
|
5172
5178
|
source: "json",
|
|
5173
|
-
codec:
|
|
5174
|
-
mode: "strict",
|
|
5175
|
-
typeSymbol: "dsh-autotier/types#RoutingMode",
|
|
5176
|
-
schema: TIER_MODE_SCHEMA
|
|
5177
|
-
})
|
|
5179
|
+
codec: strictCodec("dsh-autotier/types#RoutingMode", TIER_MODE_SCHEMA)
|
|
5178
5180
|
}), AGENT_ID_PARAMETER]),
|
|
5179
5181
|
result: TIER_STATUS_RESULT,
|
|
5180
5182
|
sourceLocation: WIRE_LOCATION
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-autotier",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Automatic strong/cheap model-tier routing for DeepSeek Harness: intent-gated tier landing on the agent/request waterfall, plan-mode handoff (strong plans, cheap implements), deterministic high-risk guards on tools/pre-execute, failure escalation with TTL fallback, a /tier command, and tier status tools",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,14 +39,15 @@
|
|
|
39
39
|
"SECURITY.md",
|
|
40
40
|
"AGENTS.md",
|
|
41
41
|
"README.md",
|
|
42
|
-
"README
|
|
43
|
-
"README
|
|
44
|
-
"README
|
|
45
|
-
"README
|
|
42
|
+
"README-zh.md",
|
|
43
|
+
"README-es.md",
|
|
44
|
+
"README-pt.md",
|
|
45
|
+
"README-hi.md",
|
|
46
46
|
"LICENSE",
|
|
47
47
|
"docs"
|
|
48
48
|
],
|
|
49
49
|
"dsh": {
|
|
50
|
+
"manifestVersion": 1,
|
|
50
51
|
"bundle": {
|
|
51
52
|
"patch": "./cordis.patch.yml"
|
|
52
53
|
},
|
|
@@ -61,8 +62,10 @@
|
|
|
61
62
|
},
|
|
62
63
|
"compatibility": {
|
|
63
64
|
"dshReleases": {
|
|
64
|
-
"0.1.2-rc.1": "
|
|
65
|
-
"0.1.5-rc.
|
|
65
|
+
"0.1.2-rc.1": "unsupported",
|
|
66
|
+
"0.1.5-rc.2": "unsupported",
|
|
67
|
+
"0.1.6-alpha.2": "unsupported",
|
|
68
|
+
"0.1.7-alpha.1": "compatible"
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
},
|
|
@@ -89,8 +92,7 @@
|
|
|
89
92
|
],
|
|
90
93
|
"compatibility": {
|
|
91
94
|
"dshVersions": [
|
|
92
|
-
"0.1.
|
|
93
|
-
"0.1.5-rc.1"
|
|
95
|
+
"0.1.7-alpha.1"
|
|
94
96
|
]
|
|
95
97
|
},
|
|
96
98
|
"capability": {
|
|
@@ -118,27 +120,29 @@
|
|
|
118
120
|
"auto"
|
|
119
121
|
],
|
|
120
122
|
"engines": {
|
|
121
|
-
"node": "^22.19.0 || >=24.0.0"
|
|
123
|
+
"node": "^22.19.0 || >=24.0.0",
|
|
124
|
+
"dsh": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0"
|
|
122
125
|
},
|
|
123
126
|
"packageManager": "pnpm@11.7.0",
|
|
124
127
|
"peerDependencies": {
|
|
125
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
126
|
-
"@deepseek-ai/
|
|
127
|
-
"@deepseek-ai/dsh-
|
|
128
|
-
"@deepseek-ai/dsh-
|
|
129
|
-
"@deepseek-ai/dsh-client-
|
|
130
|
-
"@deepseek-ai/dsh-client-
|
|
131
|
-
"@deepseek-ai/dsh-client-ui-
|
|
132
|
-
"@deepseek-ai/dsh-client-ui-
|
|
133
|
-
"@deepseek-ai/dsh-
|
|
134
|
-
"@deepseek-ai/dsh-
|
|
135
|
-
"@deepseek-ai/dsh-
|
|
136
|
-
"@deepseek-ai/dsh-
|
|
137
|
-
"@deepseek-ai/dsh-session
|
|
138
|
-
"@deepseek-ai/dsh-
|
|
139
|
-
"@deepseek-ai/dsh-
|
|
140
|
-
"@deepseek-ai/dsh-
|
|
141
|
-
"@deepseek-ai/
|
|
128
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
129
|
+
"@deepseek-ai/cosmokit": "^1.8.4",
|
|
130
|
+
"@deepseek-ai/dsh-agent": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
131
|
+
"@deepseek-ai/dsh-api-remotes": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
132
|
+
"@deepseek-ai/dsh-client-connection": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
133
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
134
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
135
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
136
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
137
|
+
"@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
138
|
+
"@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
139
|
+
"@deepseek-ai/dsh-plan-mode": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
140
|
+
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
141
|
+
"@deepseek-ai/dsh-session-projection": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
142
|
+
"@deepseek-ai/dsh-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
143
|
+
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
144
|
+
"@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0",
|
|
145
|
+
"@deepseek-ai/schemastery": "^3.18.3"
|
|
142
146
|
},
|
|
143
147
|
"peerDependenciesMeta": {
|
|
144
148
|
"@deepseek-ai/dsh-api-remotes": {
|
|
@@ -172,36 +176,37 @@
|
|
|
172
176
|
"zod": "^4.5.4"
|
|
173
177
|
},
|
|
174
178
|
"devDependencies": {
|
|
175
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
179
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
176
180
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
177
|
-
"@deepseek-ai/cordis-plugin-loader": "^1.0.
|
|
178
|
-
"@deepseek-ai/
|
|
179
|
-
"@deepseek-ai/dsh-agent
|
|
180
|
-
"@deepseek-ai/dsh-agent-
|
|
181
|
-
"@deepseek-ai/dsh-agent-loop
|
|
182
|
-
"@deepseek-ai/dsh-
|
|
183
|
-
"@deepseek-ai/dsh-
|
|
184
|
-
"@deepseek-ai/dsh-
|
|
185
|
-
"@deepseek-ai/dsh-
|
|
186
|
-
"@deepseek-ai/dsh-client-
|
|
187
|
-
"@deepseek-ai/dsh-client-
|
|
188
|
-
"@deepseek-ai/dsh-client-ui-
|
|
189
|
-
"@deepseek-ai/dsh-client-ui-
|
|
190
|
-
"@deepseek-ai/dsh-
|
|
191
|
-
"@deepseek-ai/dsh-
|
|
192
|
-
"@deepseek-ai/dsh-
|
|
193
|
-
"@deepseek-ai/dsh-
|
|
194
|
-
"@deepseek-ai/dsh-
|
|
195
|
-
"@deepseek-ai/dsh-
|
|
196
|
-
"@deepseek-ai/dsh-
|
|
197
|
-
"@deepseek-ai/dsh-session
|
|
198
|
-
"@deepseek-ai/dsh-
|
|
199
|
-
"@deepseek-ai/dsh-
|
|
200
|
-
"@deepseek-ai/dsh-
|
|
201
|
-
"@deepseek-ai/dsh-
|
|
202
|
-
"@deepseek-ai/dsh-
|
|
203
|
-
"@deepseek-ai/dsh-
|
|
204
|
-
"@deepseek-ai/
|
|
181
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.4",
|
|
182
|
+
"@deepseek-ai/cosmokit": "^1.8.4",
|
|
183
|
+
"@deepseek-ai/dsh-agent": "0.1.7-alpha.1",
|
|
184
|
+
"@deepseek-ai/dsh-agent-default-model": "0.1.7-alpha.1",
|
|
185
|
+
"@deepseek-ai/dsh-agent-loop": "0.1.7-alpha.1",
|
|
186
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-alpha.1",
|
|
187
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.7-alpha.1",
|
|
188
|
+
"@deepseek-ai/dsh-atomic-write": "0.1.7-alpha.1",
|
|
189
|
+
"@deepseek-ai/dsh-attachment": "0.1.7-alpha.1",
|
|
190
|
+
"@deepseek-ai/dsh-client-connection": "0.1.7-alpha.1",
|
|
191
|
+
"@deepseek-ai/dsh-client-locale": "0.1.7-alpha.1",
|
|
192
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.7-alpha.1",
|
|
193
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "0.1.7-alpha.1",
|
|
194
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.7-alpha.1",
|
|
195
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.7-alpha.1",
|
|
196
|
+
"@deepseek-ai/dsh-commands": "0.1.7-alpha.1",
|
|
197
|
+
"@deepseek-ai/dsh-home-paths": "0.1.7-alpha.1",
|
|
198
|
+
"@deepseek-ai/dsh-llm": "0.1.7-alpha.1",
|
|
199
|
+
"@deepseek-ai/dsh-plan-mode": "0.1.7-alpha.1",
|
|
200
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.1.7-alpha.1",
|
|
201
|
+
"@deepseek-ai/dsh-session": "0.1.7-alpha.1",
|
|
202
|
+
"@deepseek-ai/dsh-session-persistence": "0.1.7-alpha.1",
|
|
203
|
+
"@deepseek-ai/dsh-session-projection": "0.1.7-alpha.1",
|
|
204
|
+
"@deepseek-ai/dsh-settings": "0.1.7-alpha.1",
|
|
205
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.7-alpha.1",
|
|
206
|
+
"@deepseek-ai/dsh-tools": "0.1.7-alpha.1",
|
|
207
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.7-alpha.1",
|
|
208
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-alpha.1",
|
|
209
|
+
"@deepseek-ai/schemastery": "^3.18.3",
|
|
205
210
|
"@types/node": "^22.19.0",
|
|
206
211
|
"@types/react": "18.3.31",
|
|
207
212
|
"@vitest/coverage-v8": "3.2.7",
|
|
@@ -214,6 +219,7 @@
|
|
|
214
219
|
"build": "node scripts/prepare.mjs",
|
|
215
220
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
216
221
|
"typecheck:ci": "tsc -p tsconfig.ci.json --noEmit",
|
|
222
|
+
"check:ruler-live": "node scripts/assert-ruler-live.mjs",
|
|
217
223
|
"test": "vitest run",
|
|
218
224
|
"test:watch": "vitest",
|
|
219
225
|
"test:coverage": "vitest run --coverage",
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The autotier
|
|
3
|
-
* selector, the read-only tier landings, the live session
|
|
4
|
-
* catalog dropdown fed by `tier/catalog`.
|
|
2
|
+
* The autotier card on the Plugins page (`plugins.item`, id `autotier`): the
|
|
3
|
+
* session routing-mode selector, the read-only tier landings, the live session
|
|
4
|
+
* state, and the model catalog dropdown fed by `tier/catalog`.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* The Plugins page renders it in two views: `summary` (the one-liner under the
|
|
7
|
+
* card title) and `page` (the full panel). The selector writes the *session*
|
|
8
|
+
* override for the session currently open in the shell (resolved by the client
|
|
9
|
+
* entry through the sessions store face), so it stays non-persistent exactly
|
|
10
|
+
* like the pill and `/tier`. When no session is open the host answers with an
|
|
11
|
+
* empty session view and the selector is disabled with an explanation instead
|
|
12
|
+
* of failing silently.
|
|
11
13
|
*
|
|
12
14
|
* @module dsh-autotier/client/TierSettingsCard
|
|
13
15
|
*/
|
|
@@ -28,9 +30,9 @@ export interface TierSettingsInjected {
|
|
|
28
30
|
setMode: (mode: RoutingMode) => Promise<TierStatus>
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
/** Full component props assembled by the Plugins-
|
|
33
|
+
/** Full component props assembled by the Plugins-page renderer. */
|
|
32
34
|
export type TierSettingsCardProps =
|
|
33
|
-
PropsRuntime<'
|
|
35
|
+
PropsRuntime<'plugins.item'>
|
|
34
36
|
& PropsLocale<'settings.autotier'>
|
|
35
37
|
& InjectFace<TierSettingsInjected>
|
|
36
38
|
|
|
@@ -39,8 +41,8 @@ type ViewState =
|
|
|
39
41
|
| { readonly status: 'error'; readonly message: string }
|
|
40
42
|
| { readonly status: 'ready'; readonly snapshot: TierStatus; readonly catalog: TierCatalog }
|
|
41
43
|
|
|
42
|
-
/** The
|
|
43
|
-
export function TierSettingsCard({ status, catalog, setMode, t }: TierSettingsCardProps): ReactNode {
|
|
44
|
+
/** The Plugins-page card body. */
|
|
45
|
+
export function TierSettingsCard({ status, catalog, setMode, t, view }: TierSettingsCardProps): ReactNode {
|
|
44
46
|
const [state, setState] = useState<ViewState>({ status: 'loading' })
|
|
45
47
|
const [selected, setSelected] = useState('')
|
|
46
48
|
const [busy, setBusy] = useState(false)
|
|
@@ -72,6 +74,17 @@ export function TierSettingsCard({ status, catalog, setMode, t }: TierSettingsCa
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
if (view === 'summary') {
|
|
78
|
+
if (state.status === 'loading') return <span className="datr-meta" data-dsh-autotier>{t('loading')}</span>
|
|
79
|
+
if (state.status === 'error') {
|
|
80
|
+
return <span className="datr-meta" data-dsh-autotier>{t('error')} {state.message}</span>
|
|
81
|
+
}
|
|
82
|
+
const summary = landings(state.snapshot)
|
|
83
|
+
.map(entry => `${entry.tier === 'vision' ? t('tierVision') : t(tierKey(entry.tier))}: ${landingText(entry.route)}`)
|
|
84
|
+
.join(' · ')
|
|
85
|
+
return <span className="datr-meta" data-dsh-autotier>{`${t(modeKey(state.snapshot.session.mode))} · ${summary}`}</span>
|
|
86
|
+
}
|
|
87
|
+
|
|
75
88
|
if (state.status === 'loading') return <p className="datr-status" data-dsh-autotier>{t('loading')}</p>
|
|
76
89
|
if (state.status === 'error') {
|
|
77
90
|
return (
|
package/src/client/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `dsh-autotier`, browser half: mounts the `tier` Remote contribution, then
|
|
3
3
|
* registers the composer tier pill into `conversation.input.left` and the
|
|
4
|
-
* autotier card
|
|
5
|
-
* `
|
|
6
|
-
* binds the session id the slot factory
|
|
7
|
-
* session currently open in the shell through
|
|
4
|
+
* autotier card on the Plugins page (`plugins.item`, id `autotier`; two views:
|
|
5
|
+
* a `summary` one-liner and the `page` form). All data arrives through the
|
|
6
|
+
* `remote.tier` namespace — the pill binds the session id the slot factory
|
|
7
|
+
* hands it, the card resolves the session currently open in the shell through
|
|
8
|
+
* the sessions store face.
|
|
8
9
|
*
|
|
9
10
|
* @module dsh-autotier/client
|
|
10
11
|
*/
|
|
@@ -13,8 +14,8 @@ import type { Context as ClientContext } from '@deepseek-ai/cordis'
|
|
|
13
14
|
// Type-only: declares the client `remote` service (with `$mount`) on the cordis Context.
|
|
14
15
|
import type {} from '@deepseek-ai/dsh-api-remotes/client'
|
|
15
16
|
import type {} from '@deepseek-ai/dsh-client-locale/client'
|
|
16
|
-
// Type-only: pulls the '
|
|
17
|
-
import type {} from '@deepseek-ai/dsh-client-ui-
|
|
17
|
+
// Type-only: pulls the 'plugins.item' SlotMap declaration into this program.
|
|
18
|
+
import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
|
|
18
19
|
// Type-only: pulls the 'conversation.input.left' SlotMap declaration into this program.
|
|
19
20
|
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
20
21
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
|
|
@@ -111,11 +112,11 @@ export async function apply(ctx: ClientContext): Promise<void> {
|
|
|
111
112
|
}),
|
|
112
113
|
}, TierPill))
|
|
113
114
|
|
|
114
|
-
slots.inject('
|
|
115
|
-
name: '
|
|
115
|
+
slots.inject('plugins.item', () => slots.register({
|
|
116
|
+
name: 'plugins.item',
|
|
116
117
|
id: 'autotier',
|
|
117
118
|
order: 45,
|
|
118
|
-
label: () =>
|
|
119
|
+
label: () => 'AutoTier',
|
|
119
120
|
locale: NS,
|
|
120
121
|
inject: (): TierSettingsInjected => ({
|
|
121
122
|
status: async () => statusFor(currentId()),
|
|
@@ -129,17 +130,29 @@ export async function apply(ctx: ClientContext): Promise<void> {
|
|
|
129
130
|
/**
|
|
130
131
|
* Read the session currently open in the shell from the sessions store face.
|
|
131
132
|
* Structural on purpose: the store shape differs across harness lines, so only
|
|
132
|
-
* the
|
|
133
|
-
* shows the read-only view and disables the
|
|
133
|
+
* the leaves are read, and an unknown shape degrades to `undefined` (the card
|
|
134
|
+
* then shows the read-only view with the no-session notice and disables the
|
|
135
|
+
* selector).
|
|
136
|
+
*
|
|
137
|
+
* The 0.1.6 line removed `SessionListState.current`; the main-view session is
|
|
138
|
+
* derived the way upstream does it (ui-session main-binding watch): the list
|
|
139
|
+
* snapshot's `byId` entries carry `retainedBy.mainView`, and the entry the
|
|
140
|
+
* shell retains in its main view is the current session.
|
|
134
141
|
*/
|
|
135
142
|
function currentSessionId(sessions: unknown): string | undefined {
|
|
136
143
|
try {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
const face = sessions as {
|
|
145
|
+
list?: { getSnapshot?: () => { byId?: unknown } } | null
|
|
146
|
+
} | null | undefined
|
|
147
|
+
const getSnapshot = face?.list?.getSnapshot
|
|
140
148
|
if (typeof getSnapshot !== 'function') return undefined
|
|
141
|
-
const
|
|
142
|
-
|
|
149
|
+
const byId = getSnapshot().byId
|
|
150
|
+
if (typeof byId !== 'object' || byId === null) return undefined
|
|
151
|
+
const entry = Object.values(byId).find(candidate =>
|
|
152
|
+
((candidate as { retainedBy?: { mainView?: number } | null } | null | undefined)?.retainedBy?.mainView ?? 0) > 0,
|
|
153
|
+
)
|
|
154
|
+
const id = (entry as { id?: unknown } | undefined)?.id
|
|
155
|
+
return typeof id === 'string' ? id : undefined
|
|
143
156
|
} catch {
|
|
144
157
|
return undefined
|
|
145
158
|
}
|