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.
Files changed (51) hide show
  1. package/AGENTS.md +52 -23
  2. package/CHANGELOG.md +44 -0
  3. package/{README.es.md → README-es.md} +94 -13
  4. package/{README.hi.md → README-hi.md} +93 -14
  5. package/{README.pt.md → README-pt.md} +96 -16
  6. package/{README.zh.md → README-zh.md} +83 -11
  7. package/README.md +110 -18
  8. package/cordis.patch.yml +2 -2
  9. package/lib/client.js +72 -40
  10. package/lib/client.js.map +1 -1
  11. package/lib/index.js +233 -66
  12. package/lib/typert.host.js +1 -1
  13. package/lib/types/client/TierSettingsCard.d.ts +14 -12
  14. package/lib/types/client/TierSettingsCard.d.ts.map +1 -1
  15. package/lib/types/client/index.d.ts +5 -4
  16. package/lib/types/client/index.d.ts.map +1 -1
  17. package/lib/types/client/remote.d.ts +12 -12
  18. package/lib/types/config.d.ts +20 -9
  19. package/lib/types/config.d.ts.map +1 -1
  20. package/lib/types/index.d.ts +11 -8
  21. package/lib/types/index.d.ts.map +1 -1
  22. package/lib/types/judge.d.ts +17 -0
  23. package/lib/types/judge.d.ts.map +1 -1
  24. package/lib/types/preflight.d.ts +21 -1
  25. package/lib/types/preflight.d.ts.map +1 -1
  26. package/lib/types/routing.d.ts.map +1 -1
  27. package/lib/types/schema.d.ts +44 -2
  28. package/lib/types/schema.d.ts.map +1 -1
  29. package/lib/types/selection.d.ts +36 -10
  30. package/lib/types/selection.d.ts.map +1 -1
  31. package/lib/types/service.d.ts +16 -9
  32. package/lib/types/service.d.ts.map +1 -1
  33. package/lib/types/settings.d.ts +44 -0
  34. package/lib/types/settings.d.ts.map +1 -0
  35. package/lib/types/typert.host.d.ts +12 -12
  36. package/lib/types/wire.d.ts +24 -24
  37. package/lib/types/wire.d.ts.map +1 -1
  38. package/lib/{wire-BpKSOHgo.js → wire-BxsY8BiN.js} +22 -20
  39. package/package.json +62 -56
  40. package/src/client/TierSettingsCard.tsx +25 -12
  41. package/src/client/index.ts +29 -16
  42. package/src/config.ts +70 -12
  43. package/src/index.ts +23 -19
  44. package/src/judge.ts +30 -2
  45. package/src/preflight.ts +68 -1
  46. package/src/routing.ts +11 -0
  47. package/src/schema.ts +48 -9
  48. package/src/selection.ts +54 -20
  49. package/src/service.ts +20 -18
  50. package/src/settings.ts +80 -0
  51. package/src/wire.ts +19 -20
@@ -7,9 +7,9 @@
7
7
  * @module dsh-autotier/config
8
8
  */
9
9
  import { type CostMode, type EffortId, type RoutingMode } from './types.js';
10
- import type { Config, JudgeConfig, ScenarioToggles, VisionConfig } from './schema.js';
10
+ import type { Config, JudgeConfig, ScenarioToggles, VisionConfig, VolatileConfig } from './schema.js';
11
11
  export { Config } from './schema.js';
12
- export type { EscalationConfig, FallbackEntry, GuardConfig, IntentConfig, IntentRule, JudgeConfig, ScenarioToggles, TierConfig, VisionConfig, } from './schema.js';
12
+ export type { EscalationConfig, FallbackEntry, GuardConfig, IntentConfig, IntentRule, JudgeConfig, ScenarioToggles, TierConfig, VisionConfig, VolatileConfig, } from './schema.js';
13
13
  /** One resolved fallback landing. */
14
14
  export interface ResolvedFallbackEntry {
15
15
  provider: string;
@@ -76,19 +76,30 @@ export interface ResolvedConfig {
76
76
  * Resolve raw config to the frozen runtime policy, re-judging every default,
77
77
  * bound and cross-field requirement.
78
78
  *
79
- * @param raw - raw loader config; `undefined` for a bare row.
79
+ * The cross-field judgement is the whole reason this module exists, and it is
80
+ * NOT expressed in the Schemastery schema: the host validates a form write
81
+ * against the schema alone, so a violation this function catches (a strong and
82
+ * a cheap tier landing on the same route, `hysteresis.toCheap >= toStrong`, a
83
+ * rule with neither a pattern nor a tool) would otherwise persist and only fail
84
+ * later. Every actor that can change the configuration therefore routes through
85
+ * here — the Loader at mount, and `settings.ts` on each `loader/volatile-update`
86
+ * — and refuses the change instead of storing something unroutable.
87
+ *
88
+ * @param raw - raw loader config; `undefined` for a bare row. Accepts both the
89
+ * Loader's `VolatileConfig` face and the plain-data `Config` face.
80
90
  * @returns the frozen resolved config.
81
91
  * @throws {Error} when a value is out of bounds or a cross-field requirement fails.
82
92
  */
83
- export declare function resolveConfig(raw: Config | undefined): ResolvedConfig;
93
+ export declare function resolveConfig(raw: Config | VolatileConfig | undefined): ResolvedConfig;
84
94
  /**
85
- * Judge a configuration without keeping the resolved value. This is the
86
- * save-time hook the `autotier` settings namespace registers, so a user write
87
- * that violates a cross-field requirement is refused at the write instead of
88
- * silently disabling the plugin.
95
+ * Judge a configuration without keeping the resolved value.
89
96
  *
90
97
  * @param value - the configuration to judge.
91
98
  * @throws {Error} when the configuration is invalid.
99
+ * @deprecated The host no longer offers a `settings.register` validate hook, so
100
+ * this is no longer wired as a save-time gate. {@link resolveConfig} is the
101
+ * single judge and is called directly at mount and on every live update; this
102
+ * alias remains exported because it is part of the plugin's published surface.
92
103
  */
93
- export declare function validateConfig(value: Config): void;
104
+ export declare function validateConfig(value: Config | VolatileConfig): void;
94
105
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAKL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EACV,MAAM,EAIN,WAAW,EACX,eAAe,EAEf,YAAY,EACb,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,YAAY,GACb,MAAM,aAAa,CAAA;AAEpB,qCAAqC;AACrC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,0EAA0E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,MAAM,CAAA;QACrB,SAAS,EAAE,OAAO,CAAA;KACnB,CAAA;IACD,WAAW,EAAE,WAAW,CAAA;CACzB;AAuND;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,CAyBtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAEnE"}
@@ -15,9 +15,9 @@
15
15
  * @module dsh-autotier
16
16
  */
17
17
  import type { Context } from '@deepseek-ai/cordis';
18
- import { type Config as AutotierConfig } from './config.js';
18
+ import { type Config as AutotierConfig, type VolatileConfig } from './config.js';
19
19
  export { Config, resolveConfig, validateConfig } from './config.js';
20
- export type { Config as AutotierConfig, ResolvedConfig } from './config.js';
20
+ export type { Config as AutotierConfig, ResolvedConfig, VolatileConfig } from './config.js';
21
21
  export type { AutotierStatus, CostMode, EffortId, RouteDecision, RouteSource, RoutingMode, Scenario, TierId, TierRoute, } from './types.js';
22
22
  export { EFFORT_IDS, ROUTING_MODES, SCENARIOS, TIER_IDS } from './types.js';
23
23
  export { AutotierService } from './service.js';
@@ -52,13 +52,16 @@ export declare const name = "dsh-autotier";
52
52
  */
53
53
  export declare const inject: string[];
54
54
  /**
55
- * Mount the plugin: judge the configuration, register the `autotier` settings
56
- * namespace, publish the `ctx.autotier` service, and wire the routing listeners,
57
- * the `/tier` command and the two read-only tools.
55
+ * Mount the plugin: judge the configuration, claim the settings page policy,
56
+ * publish the `ctx.autotier` service, and wire the routing listeners, the
57
+ * `/tier` command and the two read-only tools.
58
58
  *
59
59
  * @param ctx - the plugin context.
60
- * @param config - the raw row configuration; every field is optional.
61
- * @throws {Error} when the configuration fails the cross-field judgement.
60
+ * @param config - the Loader's volatile row configuration. Also accepts the
61
+ * plain-data `AutotierConfig` face, so a programmatic mount or a test can
62
+ * pass literal values.
63
+ * @throws {Error} when the configuration fails the cross-field judgement, or
64
+ * when a default tier model id is absent from a new-generation host catalogue.
62
65
  */
63
- export declare function apply(ctx: Context, config?: AutotierConfig): void;
66
+ export declare function apply(ctx: Context, config?: AutotierConfig | VolatileConfig): Promise<void>;
64
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAyC,KAAK,MAAM,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AAQlG,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACnE,YAAY,EAAE,MAAM,IAAI,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3E,YAAY,EACV,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,c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gB,EAChB,YAAY,EACZ,SAAS,GACV,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE7D,4DAA4D;AAC5D,eAAO,MAAM,IAAI,iBAAiB,CAAA;AAElC;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAuD,CAAA;AAE1E;;;;;;;;;;;GAWG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,cAAc,GAAG,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDrG"}
@@ -7,8 +7,25 @@
7
7
  * @module dsh-autotier/judge
8
8
  */
9
9
  import type { Context } from '@deepseek-ai/cordis';
10
+ import { type ContextFormed } from '@deepseek-ai/dsh-llm';
10
11
  import type { ResolvedConfig } from './config.js';
11
12
  import type { Scenario, TierId } from './types.js';
13
+ /**
14
+ * This plugin's own message-source kind.
15
+ *
16
+ * The harness has no shared catch-all `plugin` kind: `MessageSourceMap` is a
17
+ * merge-extensible sum type, each producer declares its own `kind` in its own
18
+ * module, and the session format's physical-row admission rejects the retired
19
+ * `kind === 'plugin'` wrapper outright (`session-format-v3-to-v4`
20
+ * `assertV4SourceRowAdmission`, which nothing at runtime can bypass).
21
+ */
22
+ declare module '@deepseek-ai/dsh-llm' {
23
+ interface MessageSourceMap {
24
+ 'dsh-autotier': {
25
+ kind: 'dsh-autotier';
26
+ } & ContextFormed;
27
+ }
28
+ }
12
29
  /** The label vocabulary the judge is asked to choose from. */
13
30
  export declare const JUDGE_LABELS: readonly {
14
31
  readonly label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../src/judge.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,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@ -13,7 +13,7 @@
13
13
  * @module dsh-autotier/preflight
14
14
  */
15
15
  import type { Context } from '@deepseek-ai/cordis';
16
- import type { ResolvedTierConfig } from './config.js';
16
+ import type { ResolvedConfig, ResolvedTierConfig } from './config.js';
17
17
  import type { TierRoute } from './types.js';
18
18
  /** Options for {@link RoutePreflight}. */
19
19
  export interface RoutePreflightOptions {
@@ -45,4 +45,24 @@ export declare class RoutePreflight {
45
45
  */
46
46
  sanitize(route: TierRoute, tier: ResolvedTierConfig): Promise<TierRoute>;
47
47
  }
48
+ /**
49
+ * Mount-time default-model catalogue membership check.
50
+ *
51
+ * The 0.1.6 line removed the deepseek v4-flash* catalogue ids and introduced
52
+ * `deepseek-flash` (image-capable). On that catalogue generation a default
53
+ * tier id that is not in the host catalogue must fail the mount loudly —
54
+ * silently degrading to a text-only passthrough is exactly the N7 regression
55
+ * this check guards against.
56
+ *
57
+ * Generation gate: hosts whose catalogue predates the new vocabulary (e.g.
58
+ * `0.1.2-rc.1`, where none of the default ids exist) keep the accepted M2
59
+ * degradation (unlisted id ⇒ text-only) and skip the check with one
60
+ * documented log line, so mounting on the old compat rows is preserved.
61
+ *
62
+ * @param ctx - the plugin context.
63
+ * @param tiers - the resolved tier landings to verify.
64
+ * @throws {Error} when the catalogue is the new generation and a default
65
+ * model id is not present in it.
66
+ */
67
+ export declare function assertTierDefaultsInCatalog(ctx: Context, tiers: ResolvedConfig['tiers']): Promise<void>;
48
68
  //# sourceMappingURL=preflight.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAK3C,0CAA0C;AAC1C,MAAM,W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import { type CostMode, type EffortId, type RoutingMode, type Scenario } from './types.js';
12
13
  /** One fallback landing in a tier's chain (provider/model only; effort follows the target tier). */
@@ -98,6 +99,11 @@ export interface EscalationConfig {
98
99
  * Raw (possibly partial) plugin configuration. Every field is optional because
99
100
  * the resolver supplies the defaults; {@link resolveConfig} turns it into the
100
101
  * fully-resolved {@link ResolvedConfig}.
102
+ *
103
+ * This is the plain-data face of the row: a caller that builds a config in
104
+ * process (a test, a programmatic mount) passes this shape. The Loader hands
105
+ * `apply` the {@link VolatileConfig} face below, because every top-level field
106
+ * of {@link Config} is declared `.volatile()`.
101
107
  */
102
108
  export interface Config {
103
109
  tiers?: {
@@ -110,6 +116,34 @@ export interface Config {
110
116
  escalation?: EscalationConfig;
111
117
  routingMode?: RoutingMode;
112
118
  }
119
+ /**
120
+ * What `apply` actually receives from the Loader. Each top-level field is a
121
+ * `Volatile` reference rather than a value, because the host's settings forms
122
+ * write through `loader/volatile-update` and a consumer must re-read with
123
+ * `.get()`.
124
+ *
125
+ * `.volatile()` is only legal on a fixed object path, so it sits on each
126
+ * top-level field — never inside `intent.rules` or `tiers.*.fallback`. Marking
127
+ * the whole section keeps every nested key live while staying inside that rule:
128
+ * a form edit of `intent.judge.maxTokens` replaces the `intent` snapshot, and
129
+ * the routing policy re-resolves from the new one.
130
+ *
131
+ * `routingMode` is deliberately NOT volatile: it is the composition default,
132
+ * and the live per-session switch is `RouteState.override` (written by `/tier`
133
+ * and the Remote `setMode`). Keeping it plain leaves that surface authoritative
134
+ * instead of introducing a second, document-backed way to change the mode.
135
+ */
136
+ export interface VolatileConfig {
137
+ tiers: Volatile<{
138
+ strong?: TierConfig;
139
+ cheap?: TierConfig;
140
+ vision?: VisionConfig;
141
+ } | undefined>;
142
+ intent: Volatile<IntentConfig | undefined>;
143
+ guard: Volatile<GuardConfig | undefined>;
144
+ escalation: Volatile<EscalationConfig | undefined>;
145
+ routingMode: RoutingMode;
146
+ }
113
147
  /** The default strong tier: the catalog's quality-critical model at high effort. */
114
148
  export declare const DEFAULT_STRONG: {
115
149
  provider: string;
@@ -129,6 +163,14 @@ export declare const DEFAULT_VISION: {
129
163
  provider: string;
130
164
  model: string;
131
165
  };
132
- /** Schemastery schema: the loader validates and fills defaults before `apply`. */
133
- export declare const Config: z<Config>;
166
+ /**
167
+ * Schemastery schema: the loader validates and fills defaults before `apply`.
168
+ *
169
+ * Each top-level section is `.volatile()` so a host settings-form write reaches
170
+ * a running plugin through `loader/volatile-update`. A section that owns no
171
+ * live-switchable field (`routingMode`) stays plain: `.volatile()` is an opt-in
172
+ * that adds a form-editable surface, and inventing one for a field the plugin
173
+ * already switches per session would give the same behaviour two owners.
174
+ */
175
+ export declare const Config: z<Config, VolatileConfig>;
134
176
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,YAAY,CAAA;AAEnB,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,QAAQ,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;CAC3B;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,gEAAgE;AAChE,MAAM,WAAW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AAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,CAAA;IAC1E,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,CAAC;QAAE,MAAM,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,GAAG,SAAS,CAAC,CAAA;IAC/F,MAAM,EAAE,QAAQ,CAAC,YAAY,GAAG,SAAS,CAAC,CAAA;IAC1C,KAAK,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACxC,UAAU,EAAE,QAAQ,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAA;IAClD,WAAW,EAAE,WAAW,CAAA;CACzB;AAGD,oFAAoF;AACpF,eAAO,MAAM,cAAc;;;;;CAK1B,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,aAAa;;;;;CAKzB,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,cAAc;;;CAG1B,CAAA;AAgCD;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,CA2H3C,CAAA"}
@@ -1,16 +1,29 @@
1
1
  /**
2
- * Session-selection synchronisation and multi-router detection.
2
+ * Session-selection synchronisation.
3
3
  *
4
4
  * Two harness facts drive this module:
5
5
  *
6
6
  * 1. The GUI's model picker reads and writes the `agent-default-model`
7
- * settings document, so a router that changes the tier must mirror the
8
- * change there — otherwise the picker shows a model nobody is using. The
9
- * mirror is best-effort: without `agentDefaultModel` it degrades to a
10
- * no-op.
11
- * 2. A user's explicit choice must win. When the document changes to a value
12
- * this module did not write, every live session switches to `delegated`
13
- * (routing stops) until `/tier auto`.
7
+ * configuration, so a router that changes the tier must mirror the change
8
+ * there — otherwise the picker shows a model nobody is using. The mirror is
9
+ * best-effort: without `agentDefaultModel` it degrades to a no-op.
10
+ * 2. A user's explicit choice must win. When the documented selection changes
11
+ * to a value this module did not write, every live session switches to
12
+ * `delegated` (routing stops) until `/tier auto`.
13
+ *
14
+ * Fact 2 used to ride the settings service's `settings/updated` commit event.
15
+ * That event no longer exists: the `0.1.6`-generation host replaced the
16
+ * settings *provider* with `SettingsForms` (a schema→form projector), so a
17
+ * plugin can no longer observe another plugin's document. What survives is the
18
+ * `agentDefaultModel` service itself, which now answers `currentSelection()` by
19
+ * reading its own live `Volatile` fields.
20
+ *
21
+ * Detection is therefore a comparison rather than a subscription: {@link
22
+ * SelectionSync.observeExternalSelection} freshly reads the documented selection
23
+ * and delegates when it differs from the value this module last wrote. It runs
24
+ * on the path that would otherwise overwrite the user — immediately before a
25
+ * tier is mirrored — so a user's pick can never be silently replaced by a
26
+ * routing decision, which is the property the old subscription protected.
14
27
  *
15
28
  * @module dsh-autotier/selection
16
29
  */
@@ -36,8 +49,21 @@ export declare class SelectionSync {
36
49
  /** The optional default-model service. */
37
50
  private get defaultModel();
38
51
  /**
39
- * Mirror one applied landing into the default-model document. Repeated
40
- * landings with the same value are skipped, so a long cheap run writes once.
52
+ * Read the documented selection and delegate every live session when it is
53
+ * no longer the value this module wrote.
54
+ *
55
+ * Before this module's first write nothing is delegated, whatever the
56
+ * document holds: at that point "not ours" describes the composition default
57
+ * and any selection the user made before the plugin ever routed, and neither
58
+ * is an override of a routing decision. Once this module owns a write, any
59
+ * divergence is by construction somebody else's edit.
60
+ */
61
+ observeExternalSelection(): void;
62
+ /**
63
+ * Mirror one applied landing into the default-model document. An external
64
+ * change to that document is honoured first, so routing never overwrites the
65
+ * model the user picked. Repeated landings with the same value are skipped,
66
+ * so a long cheap run writes once.
41
67
  * @param route - the landing actually applied.
42
68
  */
43
69
  noteRoute(route: TierRoute): void;
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAsB3C,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CACjC;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,kFAAkF;IAClF,OAAO,CAAC,SAAS,CAAoB;IAErC,yEAAyE;gBAC7D,OAAO,EAAE,oBAAoB;IAczC,0CAA0C;IAC1C,OAAO,KAAK,YAAY,GAEvB;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAiBjC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAkB7B"}
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAwB3C,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CACjC;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,kFAAkF;IAClF,OAAO,CAAC,SAAS,CAAoB;IAErC,yEAAyE;gBAC7D,OAAO,EAAE,oBAAoB;IAKzC,0CAA0C;IAC1C,OAAO,KAAK,YAAY,GAEvB;IAED;;;;;;;;;OASG;IACH,wBAAwB,IAAI,IAAI;IAgBhC;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAkBjC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAkB7B"}
@@ -8,8 +8,7 @@
8
8
  * @module dsh-autotier/service
9
9
  */
10
10
  import { Service, type Context } from '@deepseek-ai/cordis';
11
- import type { SettingsScope } from '@deepseek-ai/dsh-settings';
12
- import { type Config, type ResolvedConfig } from './config.js';
11
+ import type { ResolvedConfig } from './config.js';
13
12
  import { PosteriorTable, type CompiledRule } from './intent.js';
14
13
  import type { AutotierStatus } from './types.js';
15
14
  declare module '@deepseek-ai/cordis' {
@@ -20,9 +19,7 @@ declare module '@deepseek-ai/cordis' {
20
19
  }
21
20
  /** Dependencies the service needs from the plugin's `apply`. */
22
21
  export interface AutotierServiceOptions {
23
- /** The live settings scope; its value is re-resolved on every committed change. */
24
- scope: SettingsScope<Config>;
25
- /** The configuration resolved at mount time (the composition base layer). */
22
+ /** The configuration resolved at mount time (the composition layer). */
26
23
  config: ResolvedConfig;
27
24
  }
28
25
  /**
@@ -30,17 +27,27 @@ export interface AutotierServiceOptions {
30
27
  * plugin unloading removes the service with every listener it owns.
31
28
  */
32
29
  export declare class AutotierService extends Service {
33
- private readonly scope;
34
30
  private readonly posteriorTable;
35
31
  private resolved;
36
32
  private compiled;
37
33
  /**
38
- * Register the service as `ctx.autotier` and start following the settings
39
- * namespace.
34
+ * Register the service as `ctx.autotier`.
40
35
  * @param ctx - the owning plugin context.
41
- * @param options - the live settings scope and the mount-time configuration.
36
+ * @param options - the mount-time configuration.
42
37
  */
43
38
  constructor(ctx: Context, options: AutotierServiceOptions);
39
+ /**
40
+ * Adopt a configuration a live settings write produced. The caller has
41
+ * already judged it through {@link resolveConfig}, so this only swaps the
42
+ * policy and recompiles the rule table.
43
+ *
44
+ * The whole policy is replaced, never merged: a settings form submits the
45
+ * complete Config, so a field the user cleared must fall back to its schema
46
+ * default rather than keep the previous live value.
47
+ *
48
+ * @param config - the newly resolved configuration.
49
+ */
50
+ reconfigure(config: ResolvedConfig): void;
44
51
  /** The live resolved configuration. */
45
52
  config(): ResolvedConfig;
46
53
  /** The compiled declarative rule table, ordered by descending priority. */
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAiB,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAC7E,OAAO,EAAgB,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,YAAY,CAAA;AAErE,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,6EAA6E;QAC7E,QAAQ,EAAE,eAAe,CAAA;KAC1B;CACF;AAED,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC5B,6EAA6E;IAC7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,EAAE,cAAc,CAAA;CACvB;AAQD;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,QAAQ,CAAgB;IAEhC;;;;OAIG;gBACS,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,sBAAsB;IAMzD;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAKzC,uCAAuC;IACvC,MAAM,IAAI,cAAc;IAIxB,2EAA2E;IAC3E,KAAK,IAAI,SAAS,YAAY,EAAE;IAIhC,+CAA+C;IAC/C,UAAU,IAAI,cAAc;IAI5B;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;SAAE,EAAE,CAAA;KAAE,EAAE,CAAC;IAqB5H,iCAAiC;IACjC,MAAM,IAAI,cAAc;CAmBzB"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The host settings seam for dsh-autotier.
3
+ *
4
+ * The `0.1.7` host owns forms, not providers: `ctx.settings` is a
5
+ * `SettingsForms` service that projects each plugin's `Config` schema into a
6
+ * Plugins-page form, and a live edit is committed through the Loader's
7
+ * `loader/volatile-update` event. The pre-`0.1.6` `settings.register(ns, schema,
8
+ * { base })` call this plugin used to make — and the `settings/updated` event it
9
+ * listened to — no longer exist on any published line that ships the new
10
+ * service, so the configuration is read from the row's own `Volatile` fields.
11
+ *
12
+ * Two duties live here:
13
+ *
14
+ * 1. Claim this instance's page policy (`configure({ auto: false })`) so the
15
+ * plugin appears in the Plugins page rather than only in a generated form.
16
+ * 2. Re-resolve the routing policy whenever a live edit lands, by re-reading
17
+ * the `Volatile` references and running them through the same cross-field
18
+ * judge the mount path uses.
19
+ *
20
+ * @module dsh-autotier/settings
21
+ */
22
+ import type { Context } from '@deepseek-ai/cordis';
23
+ import { type VolatileConfig } from './config.js';
24
+ import type { AutotierService } from './service.js';
25
+ /** Options for {@link bindSettings}. */
26
+ export interface BindSettingsOptions {
27
+ readonly ctx: Context;
28
+ /** The row configuration the Loader handed `apply`; every section is volatile. */
29
+ readonly config: VolatileConfig;
30
+ /** The live service whose policy is swapped on each committed edit. */
31
+ readonly service: AutotierService;
32
+ }
33
+ /**
34
+ * Claim the settings page policy and follow live configuration edits.
35
+ *
36
+ * The page-policy claim is best-effort: `settings` is a hard inject, but a host
37
+ * line that composes the plugin without the settings service must still route,
38
+ * so a missing or differently-shaped service degrades to "no page" instead of
39
+ * failing the mount.
40
+ *
41
+ * @param options - the plugin context, the volatile row config and the service.
42
+ */
43
+ export declare function bindSettings(options: BindSettingsOptions): void;
44
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAMlD,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAOnD,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAwB/D"}
@@ -27,15 +27,15 @@ export declare const TYPERT: Readonly<{
27
27
  source: "json";
28
28
  codec: Readonly<{
29
29
  mode: "strict";
30
- typeSymbol: "dsh-autotier/wire#TierAgentId";
31
- schema: import("zod").ZodOptional<import("zod").ZodString>;
30
+ typeSymbol: string;
31
+ create: () => import("zod").ZodOptional<import("zod").ZodString>;
32
32
  }>;
33
33
  acceptsUndefined: true;
34
34
  }>[];
35
35
  readonly result: Readonly<{
36
36
  mode: "strict";
37
37
  typeSymbol: string;
38
- schema: import("zod").ZodObject<{
38
+ create: () => import("zod").ZodObject<{
39
39
  mode: import("zod").ZodEnum<{
40
40
  strong: "strong";
41
41
  cheap: "cheap";
@@ -140,10 +140,10 @@ export declare const TYPERT: Readonly<{
140
140
  kind: "direct";
141
141
  }>;
142
142
  readonly parameters: readonly never[];
143
- readonly result: Readonly<{
143
+ readonly result: Readonly<Readonly<{
144
144
  mode: "strict";
145
- typeSymbol: "dsh-autotier/wire#TierCatalog";
146
- schema: import("zod").ZodArray<import("zod").ZodObject<{
145
+ typeSymbol: string;
146
+ create: () => import("zod").ZodArray<import("zod").ZodObject<{
147
147
  provider: import("zod").ZodString;
148
148
  models: import("zod").ZodArray<import("zod").ZodObject<{
149
149
  id: import("zod").ZodString;
@@ -151,7 +151,7 @@ export declare const TYPERT: Readonly<{
151
151
  inputModalities: import("zod").ZodArray<import("zod").ZodString>;
152
152
  }, import("zod/v4/core").$strip>>;
153
153
  }, import("zod/v4/core").$strip>>;
154
- }>;
154
+ }>>;
155
155
  readonly sourceLocation: Readonly<{
156
156
  file: "src/wire.ts";
157
157
  line: 1;
@@ -171,8 +171,8 @@ export declare const TYPERT: Readonly<{
171
171
  source: "json";
172
172
  codec: Readonly<{
173
173
  mode: "strict";
174
- typeSymbol: "dsh-autotier/wire#TierAgentId";
175
- schema: import("zod").ZodOptional<import("zod").ZodString>;
174
+ typeSymbol: string;
175
+ create: () => import("zod").ZodOptional<import("zod").ZodString>;
176
176
  }>;
177
177
  acceptsUndefined: true;
178
178
  }> | Readonly<{
@@ -181,8 +181,8 @@ export declare const TYPERT: Readonly<{
181
181
  source: "json";
182
182
  codec: Readonly<{
183
183
  mode: "strict";
184
- typeSymbol: "dsh-autotier/types#RoutingMode";
185
- schema: import("zod").ZodEnum<{
184
+ typeSymbol: string;
185
+ create: () => import("zod").ZodEnum<{
186
186
  strong: "strong";
187
187
  cheap: "cheap";
188
188
  off: "off";
@@ -194,7 +194,7 @@ export declare const TYPERT: Readonly<{
194
194
  readonly result: Readonly<{
195
195
  mode: "strict";
196
196
  typeSymbol: string;
197
- schema: import("zod").ZodObject<{
197
+ create: () => import("zod").ZodObject<{
198
198
  mode: import("zod").ZodEnum<{
199
199
  strong: "strong";
200
200
  cheap: "cheap";