dsh-fallback-router 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +162 -2
- package/README.zh-CN.md +170 -0
- package/bundle/cordis.patch.yml +19 -0
- package/dist/authorized-route.d.ts +68 -0
- package/dist/automatch.d.ts +98 -0
- package/dist/chains.d.ts +186 -0
- package/dist/client/ConversationFallbackSwitch.d.ts +91 -0
- package/dist/client/FallbacksCard.d.ts +36 -0
- package/dist/client/GeneralFallbacksRow.d.ts +19 -0
- package/dist/client/ModelsPanel.d.ts +64 -0
- package/dist/client/SubagentRoleBadge.d.ts +53 -0
- package/dist/client/fallbacks-store.d.ts +631 -0
- package/dist/client/index.d.ts +64 -0
- package/dist/client/index.js +3420 -0
- package/dist/client/locales.d.ts +454 -0
- package/dist/client/switch-guard.d.ts +17 -0
- package/dist/client/use-snapshot.d.ts +11 -0
- package/dist/commands.d.ts +380 -0
- package/dist/config.d.ts +239 -0
- package/dist/cooldown.d.ts +57 -0
- package/dist/events.d.ts +52 -0
- package/dist/gateway.d.ts +359 -0
- package/dist/index.d.ts +195 -0
- package/dist/index.js +4587 -0
- package/dist/models.d.ts +306 -0
- package/dist/override.d.ts +39 -0
- package/dist/presets.d.ts +20 -0
- package/dist/recovery.d.ts +92 -0
- package/dist/role-notice.d.ts +184 -0
- package/dist/role-persona.d.ts +71 -0
- package/dist/role-projection-key.d.ts +41 -0
- package/dist/role-projection.d.ts +152 -0
- package/dist/role-resolution.d.ts +105 -0
- package/dist/roles.d.ts +90 -0
- package/dist/route-allowlist.d.ts +43 -0
- package/dist/schema.d.ts +46 -0
- package/dist/seeds.d.ts +237 -0
- package/dist/selectors.d.ts +38 -0
- package/dist/state.d.ts +205 -0
- package/dist/subagent-policy.d.ts +123 -0
- package/dist/subagents-seam.d.ts +305 -0
- package/dist/time-slots.d.ts +147 -0
- package/dist/tui-settings.d.ts +145 -0
- package/dist/tui.d.ts +63 -0
- package/dist/virtual-adapter.d.ts +259 -0
- package/icon.svg +16 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +138 -6
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-fallback-router client half: registers the Fallbacks card into the
|
|
3
|
+
* Plugins page `plugins.bundle.config` keyed slot (key = bundle package name
|
|
4
|
+
* `dsh-fallback-router`).
|
|
5
|
+
*
|
|
6
|
+
* Wiring (mirrors dsh-advisor):
|
|
7
|
+
* - Registers the `fallbacks` locale dictionaries (zh/en).
|
|
8
|
+
* - Constructs the card's own store over the connection: the fallbacks
|
|
9
|
+
* config rides the plugin's gateway channel (`connection.rpc` →
|
|
10
|
+
* `/api/fallbacks/get|set|reset`), while `settings/describe` (writable +
|
|
11
|
+
* namespace directory), the provider/model catalog, and the switch-history
|
|
12
|
+
* tail page ride the typed `ctx.remote` namespaces (`ConnectionHandle`
|
|
13
|
+
* dropped `api`; see `fallbacks-store.ts`).
|
|
14
|
+
* - Registers the `plugins.bundle.config` card `key: 'dsh-fallback-router'`
|
|
15
|
+
* (bundle package name) with a business-only inject face
|
|
16
|
+
* ({@link FallbacksSettingsController} + hooks.snapshot); the old
|
|
17
|
+
* Settings-nav section registration stays removed.
|
|
18
|
+
* - Refreshes the store on pushed invalidations — the forwarded remote
|
|
19
|
+
* events `settings/document-updated` (ns-filtered to the fallbacks
|
|
20
|
+
* namespace; refetches the descriptor + recent-switch summary) and
|
|
21
|
+
* `llm/adapters-updated` (refetches only the provider/model catalog), plus
|
|
22
|
+
* the client `connection/reset` (refetches all three) — and follows the
|
|
23
|
+
* current session (`sessions.list`) so the status block's recent-switch
|
|
24
|
+
* summary tracks the session being viewed (spec §2.5 D-5). `sessions` is
|
|
25
|
+
* an optional reflection read (S-g): a host without the session service
|
|
26
|
+
* leaves the switches face in its empty ready state.
|
|
27
|
+
*
|
|
28
|
+
* @module dsh-fallback-router/client
|
|
29
|
+
*/
|
|
30
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
31
|
+
export type { FallbacksCardInjected, FallbacksCardProps } from './FallbacksCard.tsx';
|
|
32
|
+
export type { GeneralFallbacksRowInjected, GeneralFallbacksRowProps } from './GeneralFallbacksRow.tsx';
|
|
33
|
+
export type { ConversationFallbackSwitchProps, FallbacksSwitchChatData, } from './ConversationFallbackSwitch.tsx';
|
|
34
|
+
export type { SubagentRoleBadgeProps } from './SubagentRoleBadge.tsx';
|
|
35
|
+
export type { FallbacksSettingsState } from './fallbacks-store.ts';
|
|
36
|
+
export { FallbacksSettingsController, FALLBACKS_SETTINGS_NS } from './fallbacks-store.ts';
|
|
37
|
+
/**
|
|
38
|
+
* Required services (cordis fiber inject); registrations wait on the slot
|
|
39
|
+
* declaration. `uiConversation` is declared because the D1 Definition
|
|
40
|
+
* registration reads the service directly (`ctx.uiConversation.events.register`
|
|
41
|
+
* at the bottom of `apply` — explicit fiber-ordering parity with the
|
|
42
|
+
* ui-workflow-run precedent, whose inject list includes it for the same
|
|
43
|
+
* direct read). Cordis would still provide the service synchronously on
|
|
44
|
+
* apply, but the declaration makes the dependency honest. `sessions` is
|
|
45
|
+
* deliberately NOT injected (S-g): a non-web host without the dsh-session
|
|
46
|
+
* client service must not hang the fiber waiting for it — the wiring reads
|
|
47
|
+
* it reflectively and degrades to the switches empty state when absent
|
|
48
|
+
* (`setCurrentSession` never called, `loadSwitches` ready with an empty
|
|
49
|
+
* array, which the store already supports).
|
|
50
|
+
*
|
|
51
|
+
* The host's dotted-namespace contract: each client Remote namespace is a
|
|
52
|
+
* child-fiber service named `remote.<ns>` (upstream `remoteServiceKey`), and
|
|
53
|
+
* the traceable proxy forwards `ctx.remote.llm` / `.settings` / `.session`
|
|
54
|
+
* to those context properties — consumers MUST declare the dotted names
|
|
55
|
+
* here or the fiber walk throws `cannot get property "remote.llm" without
|
|
56
|
+
* inject`. `remote` stays for the `$on` invalidation face.
|
|
57
|
+
*/
|
|
58
|
+
export declare const inject: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Register the `fallbacks` dictionaries and the plugin-config card once the
|
|
61
|
+
* `plugins.bundle.config` declaration is on the ledger.
|
|
62
|
+
* @param ctx - client root context.
|
|
63
|
+
*/
|
|
64
|
+
export declare function apply(ctx: ClientContext): void;
|