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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -2
  3. package/README.zh-CN.md +170 -0
  4. package/bundle/cordis.patch.yml +19 -0
  5. package/dist/authorized-route.d.ts +68 -0
  6. package/dist/automatch.d.ts +98 -0
  7. package/dist/chains.d.ts +186 -0
  8. package/dist/client/ConversationFallbackSwitch.d.ts +91 -0
  9. package/dist/client/FallbacksCard.d.ts +36 -0
  10. package/dist/client/GeneralFallbacksRow.d.ts +19 -0
  11. package/dist/client/ModelsPanel.d.ts +64 -0
  12. package/dist/client/SubagentRoleBadge.d.ts +53 -0
  13. package/dist/client/fallbacks-store.d.ts +631 -0
  14. package/dist/client/index.d.ts +64 -0
  15. package/dist/client/index.js +3420 -0
  16. package/dist/client/locales.d.ts +454 -0
  17. package/dist/client/switch-guard.d.ts +17 -0
  18. package/dist/client/use-snapshot.d.ts +11 -0
  19. package/dist/commands.d.ts +380 -0
  20. package/dist/config.d.ts +239 -0
  21. package/dist/cooldown.d.ts +57 -0
  22. package/dist/events.d.ts +52 -0
  23. package/dist/gateway.d.ts +359 -0
  24. package/dist/index.d.ts +195 -0
  25. package/dist/index.js +4587 -0
  26. package/dist/models.d.ts +306 -0
  27. package/dist/override.d.ts +39 -0
  28. package/dist/presets.d.ts +20 -0
  29. package/dist/recovery.d.ts +92 -0
  30. package/dist/role-notice.d.ts +184 -0
  31. package/dist/role-persona.d.ts +71 -0
  32. package/dist/role-projection-key.d.ts +41 -0
  33. package/dist/role-projection.d.ts +152 -0
  34. package/dist/role-resolution.d.ts +105 -0
  35. package/dist/roles.d.ts +90 -0
  36. package/dist/route-allowlist.d.ts +43 -0
  37. package/dist/schema.d.ts +46 -0
  38. package/dist/seeds.d.ts +237 -0
  39. package/dist/selectors.d.ts +38 -0
  40. package/dist/state.d.ts +205 -0
  41. package/dist/subagent-policy.d.ts +123 -0
  42. package/dist/subagents-seam.d.ts +305 -0
  43. package/dist/time-slots.d.ts +147 -0
  44. package/dist/tui-settings.d.ts +145 -0
  45. package/dist/tui.d.ts +63 -0
  46. package/dist/virtual-adapter.d.ts +259 -0
  47. package/icon.svg +16 -0
  48. package/locale/en.json +6 -0
  49. package/locale/zh.json +6 -0
  50. 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;