@x1a0f3n9/dsh-client-ui-settings-models 0.1.5-rc.3

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.
@@ -0,0 +1,125 @@
1
+ /** Copy dictionaries for the Models settings section. */
2
+ /** English strings (the key-set source of truth for this pair). */
3
+ export declare const en: {
4
+ nav: string;
5
+ title: string;
6
+ intro: string;
7
+ edit: string;
8
+ editProvider: string;
9
+ remove: string;
10
+ removeProvider: string;
11
+ deleteTitle: string;
12
+ deleteDescription: string;
13
+ deleteDescriptionWithCredential: string;
14
+ deleteConfirm: string;
15
+ deleting: string;
16
+ add: string;
17
+ provider: string;
18
+ close: string;
19
+ cancel: string;
20
+ apply: string;
21
+ applying: string;
22
+ savedProvider: string;
23
+ credentialConfigured: string;
24
+ credentialMissing: string;
25
+ readOnly: string;
26
+ loadFailed: string;
27
+ conflict: string;
28
+ retry: string;
29
+ keyInput: string;
30
+ keyPlaceholder: string;
31
+ keyPlaceholderNative: string;
32
+ keyStored: string;
33
+ keyEnvLocked: string;
34
+ customized: string;
35
+ baseUrl: string;
36
+ baseUrlDefault: string;
37
+ models: string;
38
+ modelsInherited: string;
39
+ modelsCustomized: string;
40
+ resetModels: string;
41
+ model: string;
42
+ modelId: string;
43
+ modelName: string;
44
+ modelNamePlaceholder: string;
45
+ contextWindow: string;
46
+ contextWindowPlaceholder: string;
47
+ maxTokens: string;
48
+ maxTokensPlaceholder: string;
49
+ modelAdvanced: string;
50
+ modelSupportsImages: string;
51
+ addModel: string;
52
+ removeModel: string;
53
+ modelsEmpty: string;
54
+ keyBlank: string;
55
+ keyBlankNew: string;
56
+ keyIllegalCharacters: string;
57
+ modelIdRequired: string;
58
+ modelIdDuplicate: string;
59
+ modelNameInvalid: string;
60
+ modelContextInvalid: string;
61
+ modelMaxTokensInvalid: string;
62
+ reasoningEffort: string;
63
+ reasoningEffortNone: string;
64
+ reasoningEffortCustom: string;
65
+ reasoningEffortWire: string;
66
+ retryPolicy: string;
67
+ retryPolicyNone: string;
68
+ retryPolicyCustom: string;
69
+ retryMaxRetries: string;
70
+ retryInitialDelay: string;
71
+ retryCountInvalid: string;
72
+ retryDelayInvalid: string;
73
+ modelReasoningEmpty: string;
74
+ modelReasoningWireRequired: string;
75
+ advancedHint: string;
76
+ modelCapacityInvalid: string;
77
+ modelDuplicate: string;
78
+ modelContextWindow: string;
79
+ modelMaxTokens: string;
80
+ fetchModels: string;
81
+ fetching: string;
82
+ fetchNeedsBaseUrl: string;
83
+ fetchEmpty: string;
84
+ fetchTitle: string;
85
+ fetchDescription: string;
86
+ fetchSearch: string;
87
+ fetchNoMatches: string;
88
+ fetchSelectAll: string;
89
+ fetchDeselectAll: string;
90
+ fetchAdopt: string;
91
+ customAdd: string;
92
+ customTitle: string;
93
+ customTag: string;
94
+ customRoute: string;
95
+ customRouteHint: string;
96
+ customRouteInvalid: string;
97
+ customRouteTaken: string;
98
+ customDisplayName: string;
99
+ customApi: string;
100
+ customApiUnset: string;
101
+ customNeedsBaseUrl: string;
102
+ customBaseUrlInvalid: string;
103
+ customNeedsModels: string;
104
+ customBaseUrlPlaceholder: string;
105
+ settingsPathUnresolvable: string;
106
+ create: string;
107
+ creating: string;
108
+ welcomeTitle: string;
109
+ welcomeBody: string;
110
+ welcomeContinue: string;
111
+ welcomeError: string;
112
+ onboardingTitle: string;
113
+ onboardingDescription: string;
114
+ onboardingLater: string;
115
+ onboardingSave: string;
116
+ onboardingSaving: string;
117
+ keyRequired: string;
118
+ };
119
+ /** The settings.models namespace key union. */
120
+ export type ModelsKey = keyof typeof en;
121
+ /** Chinese strings (same keys as {@link en}). */
122
+ export declare const zh: {
123
+ [Key in keyof typeof en]: string;
124
+ };
125
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The Host reads and writes the Models cards perform, as callbacks built in the
3
+ * plugin body. Cards receive these instead of a context: the outcomes name what
4
+ * a card renders — a stored view, a stale revision, a refusal message — so the
5
+ * failure codes and Remote namespaces stay in the apply world.
6
+ */
7
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
8
+ import type { CredentialInfo, LlmDiscoveredModel, LlmModelDiscoveryRequest, SettingsNamespaceView, SettingsPathOpView } from '@x1a0f3n9/dsh-api-remotes/client';
9
+ /** What one namespace write answered. */
10
+ export type SettingsWriteOutcome =
11
+ /** Committed; the view carries the stored user subtree and the new revision. */
12
+ {
13
+ readonly kind: 'written';
14
+ readonly view: SettingsNamespaceView;
15
+ }
16
+ /**
17
+ * The stored revision moved after the card read it, so the draft is stale.
18
+ * The message stays for callers that report the Host diagnostic as it is.
19
+ */
20
+ | {
21
+ readonly kind: 'conflict';
22
+ readonly message: string;
23
+ }
24
+ /** Any other refusal, with the Host's own diagnostic. */
25
+ | {
26
+ readonly kind: 'refused';
27
+ readonly message: string;
28
+ };
29
+ /** What one endpoint interrogation answered. */
30
+ export type ModelDiscoveryOutcome =
31
+ /** The candidates the provider disclosed, in its own order. */
32
+ {
33
+ readonly kind: 'found';
34
+ readonly models: readonly LlmDiscoveredModel[];
35
+ }
36
+ /** The interrogation was refused, with the Host's own diagnostic. */
37
+ | {
38
+ readonly kind: 'refused';
39
+ readonly message: string;
40
+ };
41
+ /** The Host operations the Models page and its cards invoke. */
42
+ export interface ModelsOperations {
43
+ /**
44
+ * Read one credential reference's state.
45
+ * @param ref - credential reference name.
46
+ * @returns the state, or undefined when the reference is unknown or the read was refused.
47
+ */
48
+ describeCredential(ref: string): Promise<CredentialInfo | undefined>;
49
+ /**
50
+ * Store one credential literal under its reference.
51
+ * @param ref - credential reference name.
52
+ * @param value - the literal to store.
53
+ * @returns the refusal message, or undefined once stored.
54
+ */
55
+ storeCredential(ref: string, value: string): Promise<string | undefined>;
56
+ /**
57
+ * Remove one credential reference (idempotent).
58
+ * @param ref - credential reference name.
59
+ * @returns the refusal message, or undefined once removed.
60
+ */
61
+ removeCredential(ref: string): Promise<string | undefined>;
62
+ /**
63
+ * Apply path operations to one settings namespace.
64
+ * @param ns - settings namespace identity.
65
+ * @param ops - ordered path operations against the stored section, as the
66
+ * wire takes them (the Remote signature owns the array).
67
+ * @param expectedRevision - revision the draft was opened at, or undefined to write unfenced.
68
+ * @returns the write outcome the card renders from.
69
+ */
70
+ writeSettings(ns: string, ops: SettingsPathOpView[], expectedRevision: number | undefined): Promise<SettingsWriteOutcome>;
71
+ /**
72
+ * Ask a provider endpoint what models it serves.
73
+ * @param settingsNs - namespace whose adapter family answers.
74
+ * @param request - endpoint facts as the form currently shows them.
75
+ * @returns the candidates, or the refusal.
76
+ */
77
+ discoverModels(settingsNs: string, request: LlmModelDiscoveryRequest): Promise<ModelDiscoveryOutcome>;
78
+ }
79
+ /**
80
+ * Bind the page's Host operations to the plugin's own Remote namespaces.
81
+ * @param ctx - the page plugin's context, which declares `remote.credentials`,
82
+ * `remote.llm`, and `remote.settings` in its own `inject`.
83
+ * @returns the callbacks the section and its cards are injected with.
84
+ */
85
+ export declare function createModelsOperations(ctx: ClientContext): ModelsOperations;
86
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Per-model reasoning-effort maps edited on the custom-provider Models card.
3
+ *
4
+ * Level names match `llm-pi-ai`'s thinking-level vocabulary. The client package
5
+ * does not import that adapter: a host-side catalog change still has to name
6
+ * the same keys here before the card can offer them.
7
+ */
8
+ /** Every thinking level the Models card can declare, in escalation order. */
9
+ export declare const REASONING_EFFORT_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
10
+ /** One thinking level the Models card can declare. */
11
+ export type ReasoningEffortLevel = (typeof REASONING_EFFORT_LEVELS)[number];
12
+ /** Declared levels and the spellings dispatch sends on the wire. */
13
+ export type ReasoningEffortsMap = Partial<Record<ReasoningEffortLevel, string | null>>;
14
+ /**
15
+ * Read a stored `reasoningEfforts` object, or `undefined` when the model uses
16
+ * the default of no selectable levels.
17
+ * @param value - a model draft's `reasoningEfforts` field.
18
+ * @returns the declared map, or `undefined` for absent / disabled / empty.
19
+ */
20
+ export declare function reasoningEffortsMap(value: unknown): ReasoningEffortsMap | undefined;
21
+ /**
22
+ * Whether a stored field is a custom declaration the radio should select.
23
+ * @param value - a model draft's `reasoningEfforts` field.
24
+ * @returns true when the field carries at least one known level.
25
+ */
26
+ export declare function hasCustomReasoningEfforts(value: unknown): boolean;
27
+ /**
28
+ * Adapter refusals for a custom `reasoningEfforts` map that schema cannot name
29
+ * by row. Absent and `false` are the default of no levels.
30
+ * @param value - a model draft's `reasoningEfforts` field.
31
+ * @returns the failure key, or `undefined` when the adapter will accept it.
32
+ */
33
+ export declare function validateReasoningEfforts(value: unknown): 'modelReasoningEmpty' | 'modelReasoningWireRequired' | undefined;
34
+ //# sourceMappingURL=reasoning-efforts.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Default / Custom retry count and delay on a Models provider card.
3
+ *
4
+ * Retry is a provider-route policy, unlike reasoning effort which is per model.
5
+ * Default omits `retryPolicy`; Custom writes normal mode with a count and delay.
6
+ */
7
+ import type { ReactNode } from 'react';
8
+ import type { en } from './locales.ts';
9
+ /** Props of {@link RetryPolicyFields}. */
10
+ export interface RetryPolicyFieldsProps {
11
+ /** Stored `retryPolicy`, or `undefined` for adapter defaults. */
12
+ value: unknown;
13
+ /** Write a custom draft, or `undefined` to restore adapter defaults. */
14
+ onChange: (next: unknown) => void;
15
+ /** Section copy. */
16
+ t: (key: keyof typeof en) => string;
17
+ /** Disable the radios and fields. */
18
+ disabled: boolean;
19
+ /** Radio `name` unique to this provider card. */
20
+ name: string;
21
+ }
22
+ /**
23
+ * Render the provider-level retry radios and, when Custom is selected, the
24
+ * count and delay fields.
25
+ * @param props - stored policy, writer, copy, and disabled state.
26
+ * @returns the fieldset.
27
+ */
28
+ export declare function RetryPolicyFields(props: RetryPolicyFieldsProps): ReactNode;
29
+ //# sourceMappingURL=retry-policy-fields.d.ts.map
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Provider-owned request-retry drafts edited on the Models settings cards.
3
+ *
4
+ * Omission uses the adapter defaults (twenty retries, 500 ms to 10 s). A stored
5
+ * object is a custom normal-mode policy with a retry count and delay.
6
+ */
7
+ /** Adapter default for eligible retries after the first request. */
8
+ export declare const DEFAULT_RETRY_MAX_RETRIES = 20;
9
+ /** Adapter default for the first local backoff delay, in milliseconds. */
10
+ export declare const DEFAULT_RETRY_INITIAL_DELAY_MS = 500;
11
+ /** Adapter default for the longest local or accepted provider delay, in milliseconds. */
12
+ export declare const DEFAULT_RETRY_MAX_DELAY_MS = 10000;
13
+ /** Custom normal-mode policy the Models cards write. */
14
+ export type RetryPolicyDraft = {
15
+ readonly mode: 'normal';
16
+ readonly maxRetries: number;
17
+ readonly backoff: {
18
+ readonly initialDelayMs: number;
19
+ readonly maxDelayMs: number;
20
+ };
21
+ };
22
+ /** Locale keys `validateRetryPolicy` can return. */
23
+ export type RetryPolicyFailure = 'retryCountInvalid' | 'retryDelayInvalid';
24
+ /**
25
+ * The adapter-default policy the Custom radio materializes so Apply is valid.
26
+ * @returns a normal-mode draft matching omitted `retryPolicy`.
27
+ */
28
+ export declare function defaultRetryPolicy(): RetryPolicyDraft;
29
+ /**
30
+ * Whether a stored field is a custom policy the radio should select.
31
+ * @param value - a provider draft's `retryPolicy` field.
32
+ * @returns true when the field is a non-array object.
33
+ */
34
+ export declare function hasCustomRetryPolicy(value: unknown): boolean;
35
+ /**
36
+ * Read a stored `retryPolicy` object into the card's normal-mode draft.
37
+ * @param value - a provider draft's `retryPolicy` field.
38
+ * @returns the draft, or `undefined` when the field is absent / not an object.
39
+ */
40
+ export declare function retryPolicyDraft(value: unknown): RetryPolicyDraft | undefined;
41
+ /**
42
+ * Build the object the cards store for one pair of count and delay fields.
43
+ * @param maxRetries - parsed retry count, or `undefined` when the field is blank / illegal.
44
+ * @param initialDelayMs - parsed initial delay, or `undefined` when the field is blank / illegal.
45
+ * @returns a complete draft, or a marker object the validator refuses.
46
+ */
47
+ export declare function retryPolicyFromFields(maxRetries: number | undefined, initialDelayMs: number | undefined): unknown;
48
+ /**
49
+ * Parse one retry-count field.
50
+ * @param value - the input's current text or stored number.
51
+ * @returns the count, or `undefined` when it is not a non-negative safe integer.
52
+ */
53
+ export declare function parseRetryCount(value: unknown): number | undefined;
54
+ /**
55
+ * Parse one retry-delay field.
56
+ * @param value - the input's current text or stored number.
57
+ * @returns milliseconds, or `undefined` when it is not a positive finite delay.
58
+ */
59
+ export declare function parseRetryDelay(value: unknown): number | undefined;
60
+ /**
61
+ * Adapter refusals for a custom `retryPolicy` the cards are about to write.
62
+ * Absent is the default of adapter policy. A custom object must name a count
63
+ * and a positive delay.
64
+ * @param value - a provider draft's `retryPolicy` field.
65
+ * @returns the failure key, or `undefined` when the adapter will accept it.
66
+ */
67
+ export declare function validateRetryPolicy(value: unknown): RetryPolicyFailure | undefined;
68
+ //# sourceMappingURL=retry-policy.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { SettingsSchemaService } from '@x1a0f3n9/dsh-client-ui-settings/client';
2
+ /** Plain schema callbacks exposed to Models stores and presentation components. */
3
+ export type SettingsSchemaOperations = Pick<SettingsSchemaService, 'rehydrate' | 'validate' | 'nodeAtPath' | 'getPath' | 'hasPath' | 'setPath' | 'deletePath'>;
4
+ /**
5
+ * Hide the Cordis service identity behind bound schema callbacks.
6
+ * @param service - settings-owned schema service available in the apply context.
7
+ * @returns callbacks that cannot expose the service context to React components.
8
+ */
9
+ export declare function createSettingsSchemaOperations(service: SettingsSchemaService): SettingsSchemaOperations;
10
+ //# sourceMappingURL=schema-operations.d.ts.map
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Models-page extension slots — the two seats through which a plugin
3
+ * distributed outside this repository adds UI to the Models settings section
4
+ * without editing it.
5
+ *
6
+ * `settings.models.provider-card` is keyed by the row's owning settings
7
+ * namespace (`ProviderDirectoryEntry.settingsNs`): an adapter family's
8
+ * companion plugin registers one entry under the family's namespace and
9
+ * receives every card of that family — shipped, added, and hand-declared rows
10
+ * alike — while the section never learns what the namespace means. Keying on
11
+ * the namespace follows `settings.plugin.item`, and the key domain stays the
12
+ * open string space because hand-declared route ids are user-chosen at
13
+ * runtime.
14
+ *
15
+ * TYPE HOME RATIONALE: the Models section declares these slots at runtime,
16
+ * and a plugin registering an extension already depends on this package for
17
+ * the declaration. The types therefore live with their declarer.
18
+ */
19
+ import type { ProviderDirectoryEntry } from './store.ts';
20
+ declare module '@x1a0f3n9/dsh-client-ui-slots' {
21
+ interface SlotMap {
22
+ /**
23
+ * One provider card's adapter extension area, dispatched with
24
+ * `entryKey = settingsNs` on every card that renders a directory row: a
25
+ * saved row's card (its first-run setup posture included) and the
26
+ * add-provider draft card. The hand-declared draft card has no directory
27
+ * row yet, so it dispatches nothing until saved. Without a registrant the
28
+ * area renders nothing.
29
+ */
30
+ 'settings.models.provider-card': {
31
+ kind: 'keyed';
32
+ scope: 'root';
33
+ owner: ProviderCardExtrasOwnerProps;
34
+ };
35
+ /**
36
+ * Ordered extension area after the provider rows and the add controls.
37
+ * Without a registrant the area renders nothing.
38
+ */
39
+ 'settings.models.footer': {
40
+ kind: 'list';
41
+ scope: 'root';
42
+ owner: ModelsFooterOwnerProps;
43
+ };
44
+ }
45
+ }
46
+ /** Owner share of one provider-card extension occurrence. */
47
+ export interface ProviderCardExtrasOwnerProps {
48
+ /** The card's directory row (route id, display name, settings address, live state). */
49
+ provider: ProviderDirectoryEntry;
50
+ /** Whether any layer configures this provider (its profile resolves); `false` while the add-provider draft edits a dormant row. */
51
+ configured: boolean;
52
+ /** Whether the row's referenced api-key credential is confirmed configured (the page's credential join). */
53
+ keyConfigured: boolean;
54
+ }
55
+ /** Owner share of the footer area (the section supplies nothing). */
56
+ export interface ModelsFooterOwnerProps {
57
+ /** Marker field: footer owner props are intentionally empty. */
58
+ children?: never;
59
+ }
60
+ //# sourceMappingURL=slot-contract.d.ts.map
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Models settings page store: one snapshot joining the configurable-provider
3
+ * directory (`llm/listProviders` joined with `llm/listConfigurableProviders`),
4
+ * the settings namespaces (shared settings mirror),
5
+ * and the referenced credentials (`credentials/describe`). The host stays the
6
+ * single fact source — every mutation writes through the wire and the page
7
+ * re-renders from the next describe, pushed or refetched.
8
+ */
9
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
10
+ import type { CredentialInfo, LlmConfigurableProvider, LlmProviderInfo, SettingsNamespaceView } from '@x1a0f3n9/dsh-api-remotes/client';
11
+ import type { SnapshotStore } from '@x1a0f3n9/dsh-client-store';
12
+ import type { SettingsDescribeFace } from '@x1a0f3n9/dsh-client-ui-settings/client';
13
+ import type { SettingsSchemaOperations } from './schema-operations.ts';
14
+ /** One provider row after joining the configurable directory with live routes. */
15
+ export interface ProviderDirectoryEntry {
16
+ readonly provider: string;
17
+ readonly displayName: string;
18
+ readonly settingsNs: string;
19
+ readonly settingsPath: readonly string[];
20
+ readonly active: boolean;
21
+ readonly declared?: boolean;
22
+ readonly error?: string;
23
+ }
24
+ /**
25
+ * Join declared configurable providers with the currently registered routes.
26
+ * @param registered - live provider routes in registration order.
27
+ * @param directory - declared configurable providers in declaration order.
28
+ * @returns declared rows followed by live routes with no declaration.
29
+ */
30
+ export declare function joinProviderDirectory(registered: readonly LlmProviderInfo[], directory: readonly LlmConfigurableProvider[]): ProviderDirectoryEntry[];
31
+ /** One provider row the page renders. */
32
+ export interface ProviderRow {
33
+ /** The directory entry (route id, display name, settings address, live state). */
34
+ entry: ProviderDirectoryEntry;
35
+ /** Whether any layer configures this provider (its profile resolves). */
36
+ configured: boolean;
37
+ /** Whether the user layer alone carries the profile (removal restores the base). */
38
+ removable: boolean;
39
+ /** The credential reference the resolved profile names, when one does. */
40
+ apiKeyEnv: string | undefined;
41
+ /** Credential state for {@link apiKeyEnv}, once described. */
42
+ credential: CredentialInfo | undefined;
43
+ /**
44
+ * Credential state for the page's derived `<ROUTE>_API_KEY`, described only
45
+ * while the profile names no reference — the provider-card seat's
46
+ * `keyConfigured` fact for dormant and keyless rows, matching the editor's
47
+ * own derivation rule.
48
+ */
49
+ derivedCredential?: CredentialInfo;
50
+ }
51
+ /** Page snapshot. */
52
+ export interface ModelsSettingsState {
53
+ status: 'idle' | 'loading' | 'ready' | 'error';
54
+ /** Whole-load failure text; row-level write failures stay in the editor. */
55
+ error: string | null;
56
+ /** Credential enrichment failure; provider/settings rows remain usable. */
57
+ credentialError: string | null;
58
+ /** Whether the settings provider accepts writes. */
59
+ writable: boolean;
60
+ /** Every configurable provider joined with its configured/credential state. */
61
+ rows: readonly ProviderRow[];
62
+ /** Namespace views by ns, for the editor's schema/layers/secrets. */
63
+ namespaces: ReadonlyMap<string, SettingsNamespaceView>;
64
+ }
65
+ /**
66
+ * Derive the conventional credential reference for a provider route: the v1
67
+ * page never asks for an environment-variable name, so a typed key stores
68
+ * under this derived reference and the profile records it as `apiKeyEnv`.
69
+ * @param provider - provider route id (e.g. `anthropic`, `minimax-cn`).
70
+ * @returns the derived reference name (e.g. `MINIMAX_CN_API_KEY`).
71
+ */
72
+ export declare function deriveKeyRef(provider: string): string;
73
+ /**
74
+ * The wire protocols a hand-declared route may name, read out of the owning
75
+ * namespace's own schema. This stays a schema read rather than a wire field so
76
+ * the choices the page offers cannot drift from the ones the adapter accepts:
77
+ * both come from the same `Config`.
78
+ * @param namespace - the namespace view whose schema declares the profile shape.
79
+ * @param schema - settings schema operations.
80
+ * @returns the protocol identifiers, or an empty list when the schema has none.
81
+ */
82
+ export declare function protocolChoices(namespace: SettingsNamespaceView | undefined, schema: SettingsSchemaOperations): string[];
83
+ /** The models settings page controller (one per settings surface). */
84
+ export declare class ModelsSettingsStore {
85
+ private readonly ctx;
86
+ private readonly schema;
87
+ private readonly describeFace;
88
+ /** The snapshot the section renders from (uSES-safe store). */
89
+ readonly store: SnapshotStore<ModelsSettingsState>;
90
+ /** Latest load wins; an older response never overwrites a newer one. */
91
+ private generation;
92
+ /**
93
+ * @param ctx - the page plugin's context, whose `remote.llm` and
94
+ * `remote.credentials` namespaces carry the directory and credential reads.
95
+ * @param schema - settings-owned schema and immutable path operations.
96
+ * @param describeFace - the shared mirror's describe face (namespace views and writability).
97
+ */
98
+ constructor(ctx: ClientContext, schema: SettingsSchemaOperations, describeFace: SettingsDescribeFace);
99
+ /**
100
+ * Refresh the whole page snapshot: the provider directory and the mirror's
101
+ * settings answer in parallel, then one batched credential describe over
102
+ * every referenced ref. Provider failure or absence of an initial settings
103
+ * answer keeps the last good rows and surfaces an error; a failed settings
104
+ * refresh reuses the mirror's held view.
105
+ * @returns nothing; the snapshot carries the outcome.
106
+ */
107
+ load(): Promise<void>;
108
+ /** Publish one load's failure text, unless a newer load already took over. */
109
+ private failLoad;
110
+ }
111
+ /**
112
+ * Whether a joined row can serve model requests as it stands: the route is
113
+ * registered with the adapter registry, and whatever credential its resolved
114
+ * profile names is stored. A profile naming no reference authenticates through
115
+ * the provider's own path (the Bedrock chain, Vertex ADC, a gateway that needs
116
+ * nothing), as does a live route with no settings address at all, so neither
117
+ * owes this page a key.
118
+ * @param row - one joined provider row.
119
+ * @returns whether the user already has this provider to talk to.
120
+ */
121
+ export declare function providerUsable(row: ProviderRow): boolean;
122
+ /** First-run onboarding readiness derived only from the shared Models join. */
123
+ export type OnboardingReadiness = {
124
+ kind: 'loading';
125
+ } | {
126
+ kind: 'adapter-absent';
127
+ } | {
128
+ kind: 'provider-ready';
129
+ } | {
130
+ kind: 'credential-missing';
131
+ } | {
132
+ kind: 'unavailable';
133
+ reason: 'load-failed' | 'provider-inactive' | 'credentials-unavailable' | 'settings-read-only' | 'credential-read-only';
134
+ };
135
+ /**
136
+ * Project first-run readiness from the provider/settings/credential join used
137
+ * by the Models page. The step exists to leave the user with a model to talk
138
+ * to, so ANY usable provider ends it; only when none exists does the official
139
+ * DeepSeek route — the one route the prompt can offer a key field for — decide
140
+ * whether prompting can help. A missing official configurable-provider
141
+ * declaration means the adapter is not repairable by navigating to Models.
142
+ * @param state - current shared Models join snapshot.
143
+ * @returns the onboarding state without reading a parallel fact source.
144
+ */
145
+ export declare function onboardingReadiness(state: ModelsSettingsState): OnboardingReadiness;
146
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Welcome-notice state derived from the welcome settings scope. The scope is
3
+ * the transport: a loopback browser follows the durable Host section, while a
4
+ * remote browser's memory-mode scope never answers and the acknowledgement
5
+ * stays process-local here.
6
+ */
7
+ import { type SnapshotStore } from '@x1a0f3n9/dsh-client-store';
8
+ import type { SettingsScope } from '@x1a0f3n9/dsh-client-ui-settings/client';
9
+ /** State rendered by the welcome step. */
10
+ export interface WelcomeNoticeState {
11
+ status: 'idle' | 'loading' | 'ready' | 'saving' | 'error';
12
+ acknowledged: boolean;
13
+ error: string | null;
14
+ }
15
+ /** The welcome section as the notice reads it. */
16
+ export type WelcomeSection = Record<string, unknown>;
17
+ /**
18
+ * Accept any object section verbatim; a malformed durable value reads as an
19
+ * empty section, so the notice treats it as unacknowledged instead of leaving
20
+ * the scope stuck on its previous value.
21
+ * @param section - the wire section value.
22
+ * @returns the section object, or an empty one for non-object values.
23
+ */
24
+ export declare function decodeWelcomeSection(section: unknown): WelcomeSection;
25
+ /** Coordinates durable Host acknowledgement or a process-local remote fallback. */
26
+ export declare class WelcomeNoticeStore {
27
+ private readonly scope;
28
+ /** uSES-safe state source shared by the registered welcome step. */
29
+ readonly store: SnapshotStore<WelcomeNoticeState>;
30
+ private localAcknowledged;
31
+ private saving;
32
+ private following;
33
+ /**
34
+ * @param scope - the welcome settings namespace scope; its memory mode is
35
+ * what keeps a remote browser process-local.
36
+ */
37
+ constructor(scope: SettingsScope<WelcomeSection>);
38
+ /**
39
+ * Begin following the bound scope (idempotent) and publish its current answer.
40
+ * @returns settlement after the current answer is published.
41
+ */
42
+ load(): Promise<void>;
43
+ /**
44
+ * Persist this copy version, or advance only this process for a remote
45
+ * browser. Success is judged against the state the write left behind, so a
46
+ * refused or failed write reports false after its recovery read settles.
47
+ * @returns true when the selected persistence mode holds the acknowledgement.
48
+ */
49
+ acknowledge(): Promise<boolean>;
50
+ /** Stop following the scope. */
51
+ dispose(): void;
52
+ private derive;
53
+ }
54
+ //# sourceMappingURL=welcome-store.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** Host loader entry for the browser implementation exported from `./client`. */
2
+ /** Host plugin body — no host-side behavior for the models settings plugin. */
3
+ export declare function apply(): void;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** Durable settings namespace for product-wide GUI onboarding facts. */
2
+ export declare const WELCOME_NOTICE_SETTINGS_NAMESPACE = "ui-onboarding";
3
+ /** Field storing the last welcome notice version the user acknowledged. */
4
+ export declare const WELCOME_NOTICE_ACK_FIELD = "welcomeNoticeVersion";
5
+ /**
6
+ * Bump only when the notice changes materially and every user should see it
7
+ * again. The acknowledgement is compared for exact equality.
8
+ */
9
+ export declare const WELCOME_NOTICE_VERSION = "2026-08-13.1";
10
+ //# sourceMappingURL=onboarding-copy.d.ts.map