dsh-llm-fallbacks 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/client/ConversationFallbackSwitch.d.ts +1 -1
- package/dist/client/FallbacksCard.d.ts +27 -20
- package/dist/client/fallbacks-store.d.ts +5 -5
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +375 -266
- package/dist/client/locales.d.ts +4 -0
- package/dist/gateway.d.ts +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/role-notice.d.ts +4 -4
- package/dist/role-projection.d.ts +2 -2
- package/dist/schema.d.ts +5 -5
- package/dist/state.d.ts +2 -2
- package/dist/subagent-policy.d.ts +1 -1
- package/dist/subagents-seam.d.ts +2 -2
- package/dist/time-slots.d.ts +5 -6
- package/dist/virtual-adapter.d.ts +1 -1
- package/package.json +23 -23
package/dist/client/locales.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare const zh: {
|
|
|
26
26
|
'alwaysModeRetryCap.hint': string;
|
|
27
27
|
'alwaysModeRetryCap.tooltip': string;
|
|
28
28
|
'advanced.label': string;
|
|
29
|
+
'advanced.expand': string;
|
|
30
|
+
'advanced.collapse': string;
|
|
29
31
|
'roleAutoMatch.label': string;
|
|
30
32
|
'roleAutoMatch.hint': string;
|
|
31
33
|
'roleAutoMatch.tooltip': string;
|
|
@@ -213,6 +215,8 @@ export declare const en: {
|
|
|
213
215
|
'alwaysModeRetryCap.hint': string;
|
|
214
216
|
'alwaysModeRetryCap.tooltip': string;
|
|
215
217
|
'advanced.label': string;
|
|
218
|
+
'advanced.expand': string;
|
|
219
|
+
'advanced.collapse': string;
|
|
216
220
|
'roleAutoMatch.label': string;
|
|
217
221
|
'roleAutoMatch.hint': string;
|
|
218
222
|
'roleAutoMatch.tooltip': string;
|
package/dist/gateway.d.ts
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* rejection unchanged — the settings service itself is non-strict and would
|
|
39
39
|
* merge the unknown key through), then writes the plugin's profile-entry
|
|
40
40
|
* section in-process via `ctx.settings.update` (the `SettingsForms` form
|
|
41
|
-
* service;
|
|
41
|
+
* service; the host replaced the namespace registry — the write lands in
|
|
42
42
|
* the active profile's patch under {@link FALLBACKS_PROFILE_ENTRY} and the
|
|
43
43
|
* Loader commits it into the plugin's live config reference), and returns
|
|
44
44
|
* the new composed value. `reset` (fallbacks-specific third method —
|
|
@@ -74,14 +74,14 @@ import type { FallbacksSeedManager, SeedRevertOutcome, SeedsWireStatus } from '.
|
|
|
74
74
|
/**
|
|
75
75
|
* The `fallbacks` service/typert namespace identity (`fallbacks`): the cordis
|
|
76
76
|
* service key, the typert namespace under `/api/fallbacks/*`, and the settings
|
|
77
|
-
* identity under the
|
|
77
|
+
* identity under the legacy dsh API. Current settings writes target the
|
|
78
78
|
* PROFILE ENTRY id instead (see {@link FALLBACKS_PROFILE_ENTRY}); the branded
|
|
79
79
|
* `SettingsNamespace` type the old service APIs constrained on survives as the
|
|
80
80
|
* type this constant carries.
|
|
81
81
|
*/
|
|
82
82
|
export declare const FALLBACKS_SETTINGS_NAMESPACE: SettingsNamespace;
|
|
83
83
|
/**
|
|
84
|
-
* The plugin's profile ENTRY id — the settings-write target on dsh
|
|
84
|
+
* The plugin's profile ENTRY id — the settings-write target on the current dsh host:
|
|
85
85
|
* `SettingsForms` keys every form and write by the Loader entry id
|
|
86
86
|
* (`entry.options.id`), and this plugin's bundle row ships `id: llm-fallbacks`
|
|
87
87
|
* (`bundle/cordis.patch.yml`), so `settings.update('llm-fallbacks', …)` edits
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `llm-fallbacks` (see `bundle/cordis.patch.yml`), composed AFTER llm-retry.
|
|
7
7
|
*
|
|
8
8
|
* Wiring:
|
|
9
|
-
* - `fallbacks` settings via the Loader entry Config (
|
|
9
|
+
* - `fallbacks` settings via the Loader entry Config (the current host contract: the
|
|
10
10
|
* volatile `Config` schema in `src/schema.ts` IS the settings section;
|
|
11
11
|
* `apply` reads the Loader's live config reference, and the
|
|
12
12
|
* `settings/document-updated` listener re-derives the runtime caches —
|
|
@@ -142,7 +142,7 @@ export declare function chainHeads(ctx: Context): ReadonlyMap<string, EffectiveC
|
|
|
142
142
|
*/
|
|
143
143
|
export declare function countRetryEvents(session: Session, turn: number, step: number, provider: string): number;
|
|
144
144
|
/**
|
|
145
|
-
* The live config reference the
|
|
145
|
+
* The live config reference the Loader hands `apply` for a
|
|
146
146
|
* volatile Config schema: an identity-stable `{ get }` view (cosmokit's
|
|
147
147
|
* `Volatile` protocol) whose snapshot the Loader re-commits on every form
|
|
148
148
|
* save, so reading `.get()` per call is the authoritative live composed
|
package/dist/role-notice.d.ts
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* Session-write contract (plan Global Constraints, hard): the row is a
|
|
30
30
|
* `user/message` built with `createUserMessage` and the producer-declared
|
|
31
31
|
* source `{ kind: 'llm-fallbacks-role-notice', form: 'notice', summary: … }`.
|
|
32
|
-
*
|
|
32
|
+
* The host removed the shared `plugin` kind: `MessageSourceMap` is
|
|
33
33
|
* producer-declared now ("each producer declares its own `kind` in its own
|
|
34
34
|
* module; there is no shared catch-all `plugin` kind" — dsh-llm message.d.ts),
|
|
35
35
|
* so this module merges its own kind and stamps `form: 'notice'` + the bound
|
|
@@ -81,7 +81,7 @@ declare module '@deepseek-ai/dsh-llm' {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* The provenance label this plugin's notice rows carried under the
|
|
84
|
+
* The provenance label this plugin's notice rows carried under the legacy
|
|
85
85
|
* `kind: 'plugin'` source API. The durable rows survive as data: the V3→V4
|
|
86
86
|
* session-format edge rewrites every unlisted V3 plugin source to
|
|
87
87
|
* `kind: 'plugin:<plugin>'`, so pre-upgrade child sessions carry
|
|
@@ -91,7 +91,7 @@ declare module '@deepseek-ai/dsh-llm' {
|
|
|
91
91
|
*/
|
|
92
92
|
export declare const ROLE_NOTICE_PLUGIN = "dsh-llm-fallbacks";
|
|
93
93
|
/**
|
|
94
|
-
* The message source KIND the notice rides.
|
|
94
|
+
* The message source KIND the notice rides. The host removed the shared
|
|
95
95
|
* `plugin` kind (`MessageSourceMap` is producer-declared now — each producer
|
|
96
96
|
* declares its own `kind` in its own module, the upstream `model-selection`
|
|
97
97
|
* precedent), so this module declares `llm-fallbacks-role-notice` above and
|
|
@@ -102,7 +102,7 @@ export declare const ROLE_NOTICE_PLUGIN = "dsh-llm-fallbacks";
|
|
|
102
102
|
export declare const ROLE_NOTICE_SOURCE_KIND = "llm-fallbacks-role-notice";
|
|
103
103
|
/**
|
|
104
104
|
* The source kinds the role projection must ALSO accept besides
|
|
105
|
-
* {@link ROLE_NOTICE_SOURCE_KIND}: the V4-migrated form of the
|
|
105
|
+
* {@link ROLE_NOTICE_SOURCE_KIND}: the V4-migrated form of the legacy
|
|
106
106
|
* `kind: 'plugin', plugin: 'dsh-llm-fallbacks'` rows (see
|
|
107
107
|
* {@link ROLE_NOTICE_PLUGIN}).
|
|
108
108
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Data source = Task 3's notice row, the plugin's single write primitive: the
|
|
7
7
|
* fold reads the child's committed `user/message` events, keeps the one whose
|
|
8
8
|
* provenance is ours (`source.kind` is the producer-declared
|
|
9
|
-
* ROLE_NOTICE_SOURCE_KIND, or the V3→V4-migrated form of a
|
|
9
|
+
* ROLE_NOTICE_SOURCE_KIND, or the V3→V4-migrated form of a legacy row —
|
|
10
10
|
* `ROLE_NOTICE_LEGACY_SOURCE_KINDS`), and parses the role out of its
|
|
11
11
|
* **content text** (`[role: <id>]`). No second write path, no new event type,
|
|
12
12
|
* no plugin-owned store: the projection is a pure READ of the log, and the
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* The runtime shape relied on — `register({ key, stateSchema, init, apply,
|
|
34
34
|
* wire: { viewSchema, view }, stateVersion })` → unregister disposer — is the
|
|
35
35
|
* documented `ProjectionDefinition` contract of
|
|
36
|
-
* `@deepseek-ai/dsh-session-projection
|
|
36
|
+
* `@deepseek-ai/dsh-session-projection`
|
|
37
37
|
* (`lib/types/index.d.ts:38-80,150-152`); only `.parse` is ever called on the
|
|
38
38
|
* schemas (`lib/index.js:255,305,422`).
|
|
39
39
|
*
|
package/dist/schema.d.ts
CHANGED
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
* `roles.default`) on the composed object at startup (warn + gateway
|
|
20
20
|
* `legacyKeys`, see `src/index.ts` apply()).
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
* Current host contract: the whole schema is marked `volatile` (the host
|
|
23
23
|
* retired `installSection` — the Loader entry Config IS the settings
|
|
24
24
|
* section now, and `SettingsForms.update` only accepts volatile paths, so
|
|
25
25
|
* the marker is what keeps the gateway/card write path legal). One marker
|
|
26
26
|
* on the ROOT object makes every field live-editable and hands `apply` a
|
|
27
27
|
* single identity-stable config reference the Loader commits saves into
|
|
28
28
|
* (no remount per save). The marker rides the generic `.extra()` writer —
|
|
29
|
-
* the exact bytes `.volatile()`
|
|
29
|
+
* the exact bytes `.volatile()` writes in newer schemastery — because the
|
|
30
30
|
* dev-time schemastery resolved from the lockfile can predate that sugar;
|
|
31
|
-
* the `Meta` augmentation below declares the field the
|
|
32
|
-
*
|
|
31
|
+
* the `Meta` augmentation below declares the field the peer range admits
|
|
32
|
+
* at its upper end.
|
|
33
33
|
*
|
|
34
34
|
* @module dsh-llm-fallbacks/schema
|
|
35
35
|
*/
|
|
@@ -38,7 +38,7 @@ import type { FallbacksConfig } from './config.ts';
|
|
|
38
38
|
declare module '@deepseek-ai/schemastery' {
|
|
39
39
|
namespace Schemastery {
|
|
40
40
|
interface Meta {
|
|
41
|
-
/** Live-editable marker read by the Loader / `SettingsForms
|
|
41
|
+
/** Live-editable marker read by the Loader / `SettingsForms`. */
|
|
42
42
|
volatile?: boolean;
|
|
43
43
|
}
|
|
44
44
|
}
|
package/dist/state.d.ts
CHANGED
|
@@ -67,14 +67,14 @@ export interface PendingSwitch {
|
|
|
67
67
|
/**
|
|
68
68
|
* One plugin-originated subagent switch the host allowlist blocked (plan
|
|
69
69
|
* dsh-012-subagent-routing T3; spec D1). The intersection of the resolved
|
|
70
|
-
* candidates with the effective allowlist was empty while the
|
|
70
|
+
* candidates with the effective allowlist was empty while the unconstrained walk
|
|
71
71
|
* would have switched — the attempt is recorded in-memory only (issue #52:
|
|
72
72
|
* no durable session write) for the Subagents card warning (spec D4/T5).
|
|
73
73
|
*/
|
|
74
74
|
export interface BlockedSwitchAttempt {
|
|
75
75
|
/** Epoch ms when the switch was blocked. */
|
|
76
76
|
at: number;
|
|
77
|
-
/** The route the
|
|
77
|
+
/** The route the unconstrained walk would have switched to (exact provider+model). */
|
|
78
78
|
route: {
|
|
79
79
|
provider: string;
|
|
80
80
|
model: string;
|
|
@@ -46,7 +46,7 @@ export type PolicyRoute = {
|
|
|
46
46
|
* Effective subagent routing policy for one session.
|
|
47
47
|
*
|
|
48
48
|
* - `disabled`: host policy off or absent — selection matches pre-policy
|
|
49
|
-
*
|
|
49
|
+
* behavior.
|
|
50
50
|
* - `enabled`: an allowlist is proven; plugin-originated routes must stay
|
|
51
51
|
* inside it.
|
|
52
52
|
* - `unprovable`: the policy is on but unreadable (malformed event payload,
|
package/dist/subagents-seam.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* role-based-subagent-adoption Task 1).
|
|
4
4
|
*
|
|
5
5
|
* The seam is the documented cordis service-read waterfall
|
|
6
|
-
* (`Events['internal/get']`, `@deepseek-ai/cordis`
|
|
6
|
+
* (`Events['internal/get']`, `@deepseek-ai/cordis`
|
|
7
7
|
* `lib/types/events.d.ts`): a listener wraps the `subagents` service VALUE on
|
|
8
8
|
* read and returns a prototype-delegating wrapper whose `start` /
|
|
9
9
|
* `startContinuable` resolve the dispatch role from the incoming request
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* `chain: []` role gets its persona exactly like a chained one (no routing
|
|
47
47
|
* state is read). Both native start surfaces are covered, with the gate each
|
|
48
48
|
* one's fail-loud contract needs (measured on the installed
|
|
49
|
-
* `@deepseek-ai/dsh-subagent`
|
|
49
|
+
* `@deepseek-ai/dsh-subagent`): the one-shot `start` REJECTS a
|
|
50
50
|
* request carrying `persona` for a provider whose
|
|
51
51
|
* `getProvider(name).capabilities.persona` is not `true` (`lib/index.js:3284,3340-3363`,
|
|
52
52
|
* `assertCapabilities`), so the merge pre-checks that flag; the continuable
|
package/dist/time-slots.d.ts
CHANGED
|
@@ -10,16 +10,15 @@
|
|
|
10
10
|
* throw: they warn ONCE per row instance (through `console.warn` — the
|
|
11
11
|
* resolver's 3-argument contract has no logger parameter) and are
|
|
12
12
|
* skipped; a legacy non-empty non-conforming `rootChain` keeps the
|
|
13
|
-
*
|
|
13
|
+
* legacy failure walk verbatim (P6).
|
|
14
14
|
*
|
|
15
15
|
* @module dsh-llm-fallbacks/time-slots
|
|
16
16
|
*/
|
|
17
17
|
import type { FallbacksConfig } from './config.ts';
|
|
18
18
|
/** Official all-day selectors — the ONLY legal tails (length 1, XOR):
|
|
19
19
|
* Flash (the current official default) and Pro, both selectable. The Pro
|
|
20
|
-
* tail id is the catalog id verbatim:
|
|
21
|
-
* still serves `deepseek-v4-pro` alongside `deepseek-flash`
|
|
22
|
-
* at rc.2 (rc.1 re-introduced it), so the card's Pro radio is selectable. `deepseek-v4-flash` stays retired (dropped
|
|
20
|
+
* tail id is the catalog id verbatim: the official default catalog
|
|
21
|
+
* still serves `deepseek-v4-pro` alongside `deepseek-flash`, so the card's Pro radio is selectable. `deepseek-v4-flash` stays retired (dropped
|
|
23
22
|
* from the catalog); a hand-written legacy `deepseek-official/deepseek-pro`
|
|
24
23
|
* tail — never catalog-served nor selectable — is just a non-legal tail
|
|
25
24
|
* that degrades through the existing nonconforming walk. */
|
|
@@ -83,7 +82,7 @@ export declare const PRESETS: Record<PresetId, PresetDefinition>;
|
|
|
83
82
|
* `deepseek-v4-flash` and the never-served legacy
|
|
84
83
|
* `deepseek-official/deepseek-pro` included) keeps slot rows inert and
|
|
85
84
|
* refuses the virtual-row
|
|
86
|
-
* delegate; the
|
|
85
|
+
* delegate; the legacy failure walk over the raw chain stays
|
|
87
86
|
* verbatim.
|
|
88
87
|
*/
|
|
89
88
|
export declare function isAllDayConforming(chain: readonly string[]): boolean;
|
|
@@ -111,7 +110,7 @@ export declare function resolveEffectiveChain(config: FallbacksConfig, now: Date
|
|
|
111
110
|
* (`isAllDayConforming(config.rootChain)`) the winner is ALWAYS `'all-day'`
|
|
112
111
|
* — a legacy multi-model (or empty) chain earns no slot rows, so every
|
|
113
112
|
* surface fed by this resolver reports the inert state and routing stays on
|
|
114
|
-
* the raw `rootChain` (the
|
|
113
|
+
* the raw `rootChain` (the legacy walk verbatim).
|
|
115
114
|
*/
|
|
116
115
|
export declare function resolveSlotState(config: FallbacksConfig, now: Date, tz: string): {
|
|
117
116
|
winner: SlotRowConfig | 'all-day';
|
|
@@ -146,7 +146,7 @@ export declare class FallbacksChainAdapter extends LlmAdapter {
|
|
|
146
146
|
*/
|
|
147
147
|
providerRetryPolicy(_provider: string): ResolvedRetryPolicy | undefined;
|
|
148
148
|
/**
|
|
149
|
-
* Route-accurate image pricing
|
|
149
|
+
* Route-accurate image pricing: the virtual row has no
|
|
150
150
|
* pricing of its own — the virtual `provider`/`model` arguments are
|
|
151
151
|
* intentionally ignored. Resolves the SAME effective head `stream()`
|
|
152
152
|
* dispatches and delegates through the runtime lookup, so the token
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dsh",
|
|
6
6
|
"dsh-plugin"
|
|
7
7
|
],
|
|
8
|
-
"version": "0.6.
|
|
8
|
+
"version": "0.6.4",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
@@ -65,28 +65,28 @@
|
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
68
|
-
"@deepseek-ai/dsh-agent": "^0.
|
|
69
|
-
"@deepseek-ai/dsh-api-gateway": "^0.
|
|
70
|
-
"@deepseek-ai/dsh-api-remotes": "^0.
|
|
71
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.
|
|
72
|
-
"@deepseek-ai/dsh-client-connection": "^0.
|
|
73
|
-
"@deepseek-ai/dsh-client-locale": "^0.
|
|
74
|
-
"@deepseek-ai/dsh-client-store": "^0.
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-chat": "^0.
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.
|
|
81
|
-
"@deepseek-ai/dsh-commands": "^0.
|
|
82
|
-
"@deepseek-ai/dsh-llm": "^0.
|
|
83
|
-
"@deepseek-ai/dsh-llm-retry": "^0.
|
|
84
|
-
"@deepseek-ai/dsh-session": "^0.
|
|
85
|
-
"@deepseek-ai/dsh-session-projection": "^0.
|
|
86
|
-
"@deepseek-ai/dsh-settings": "^0.
|
|
87
|
-
"@deepseek-ai/dsh-tool-subagent": "^0.
|
|
88
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.
|
|
89
|
-
"@deepseek-ai/dsh-typert-registry": "^0.
|
|
68
|
+
"@deepseek-ai/dsh-agent": "^0.2.0-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-api-gateway": "^0.2.0-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-api-remotes": "^0.2.0-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.2.0-rc.1",
|
|
72
|
+
"@deepseek-ai/dsh-client-connection": "^0.2.0-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.0-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-client-store": "^0.2.0-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-chat": "^0.2.0-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.2.0-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.0-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.1",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-commands": "^0.2.0-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-llm": "^0.2.0-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-llm-retry": "^0.2.0-rc.1",
|
|
84
|
+
"@deepseek-ai/dsh-session": "^0.2.0-rc.1",
|
|
85
|
+
"@deepseek-ai/dsh-session-projection": "^0.2.0-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-settings": "^0.2.0-rc.1",
|
|
87
|
+
"@deepseek-ai/dsh-tool-subagent": "^0.2.0-rc.1",
|
|
88
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.2.0-rc.1",
|
|
89
|
+
"@deepseek-ai/dsh-typert-registry": "^0.2.0-rc.1",
|
|
90
90
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
91
91
|
"react": "^18.2.0"
|
|
92
92
|
},
|