@deepseek-ai/dsh-client-ui-settings-models 0.1.6-alpha.2 → 0.1.7-alpha.2

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/lib/index.js CHANGED
@@ -1,6 +1,26 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ //#region lib/types/onboarding-config.js
3
+ /** Public page-bootstrap options shared by the Host and Client halves. */
4
+ /** Validate Host configuration and its public page-bootstrap payload. */
5
+ const Config = z.object({ credentialOnboarding: z.boolean().default(true) });
6
+ /** Page-global key carrying only the public onboarding options. */
7
+ const ONBOARDING_CONFIG_GLOBAL = "__DSH_MODELS_ONBOARDING__";
8
+ //#endregion
1
9
  //#region lib/types/index.js
2
- /** Host loader entry for the browser implementation exported from `./client`. */
3
- /** Host plugin body — no host-side behavior for the models settings plugin. */
4
- function apply() {}
10
+ /** Host configuration and page bootstrap for Models credential onboarding. */
11
+ /**
12
+ * Publish the credential-onboarding choice before browser plugins activate.
13
+ * @param ctx - Host context collecting the page's initialization data.
14
+ * @param config - plugin options with schema defaults applied by the Loader.
15
+ */
16
+ function apply(ctx, config) {
17
+ ctx.on("webserver/index-inject", (table) => {
18
+ table.push({
19
+ kind: "global",
20
+ name: ONBOARDING_CONFIG_GLOBAL,
21
+ value: { credentialOnboarding: config.credentialOnboarding }
22
+ });
23
+ });
24
+ }
5
25
  //#endregion
6
- export { apply };
26
+ export { Config, apply };
@@ -3,12 +3,15 @@
3
3
  * gateway, a self-hosted server, or a provider newer than the installed
4
4
  * catalog.
5
5
  *
6
- * This is a create, not an edit, which is why it is its own card rather than
6
+ * This is a create, not an edit, which is why it is its own form rather than
7
7
  * the provider editor with extra fields: the route id is being *chosen* here,
8
- * and the settings address does not exist until it is. One `settings.mutate`
9
- * sets the whole profile at `providers.<route>`; the key travels separately
10
- * through `credentials/set` under the reference the profile records, exactly as
11
- * an existing provider's key does.
8
+ * and the settings address does not exist until it is. It renders as the
9
+ * custom-API panel of the section's add card; the card's mode switch names it
10
+ * when both modes are offered, and with the custom mode alone the card shows
11
+ * this form directly. One `settings.mutate` sets the whole profile at
12
+ * `providers.<route>`; the key travels separately through `credentials/set`
13
+ * under the reference the profile records, exactly as an existing provider's
14
+ * key does.
12
15
  *
13
16
  * The three fields a hand-declared route cannot default — endpoint, protocol,
14
17
  * and at least one model — are required here rather than at load, so the
@@ -43,6 +46,11 @@ export interface CustomProviderCardProps {
43
46
  readOnly: boolean;
44
47
  /** Close the card; `changed` reports whether a provider was created. */
45
48
  onClose: (changed: boolean) => void;
49
+ /**
50
+ * Called once per change with whether the create or the list's endpoint
51
+ * interrogation is in flight, so the owner can hold its surface still.
52
+ */
53
+ onBusyChange?: (busy: boolean) => void;
46
54
  }
47
55
  /**
48
56
  * Render the custom-provider creation card.
@@ -7,13 +7,15 @@
7
7
  */
8
8
  import type { ReactNode } from 'react';
9
9
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
10
- import type { InjectFace, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
10
+ import type { InjectFace, PropsRuntime, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
11
11
  import type { ModelsSettingsState, ModelsSettingsStore } from './store.ts';
12
12
  import type { ModelsOperations } from './operations.ts';
13
13
  import type { SettingsSchemaOperations } from './schema-operations.ts';
14
14
  import type { en } from './locales.ts';
15
15
  /** Registration-side dependencies of {@link DeepSeekOnboardingDialog}. */
16
16
  export interface DeepSeekOnboardingInjected {
17
+ /** Whether first-run setup should show automatically. Explicit requests remain available. */
18
+ automatic: boolean;
17
19
  hooks: {
18
20
  /** Shared Models-page join state, bound by the slot renderer. */
19
21
  models: SnapshotStore<ModelsSettingsState>;
@@ -28,7 +30,7 @@ export interface DeepSeekOnboardingInjected {
28
30
  t: (key: keyof typeof en) => string;
29
31
  }
30
32
  /** Slot owner props plus the feature's injected dependencies. */
31
- export type DeepSeekOnboardingDialogProps = PropsRuntime<'settings.onboarding'> & InjectFace<DeepSeekOnboardingInjected>;
33
+ export type DeepSeekOnboardingDialogProps = PropsRuntime<'settings.onboarding'> & PropsRenderSlots<'settings.models.sign-in'> & InjectFace<DeepSeekOnboardingInjected>;
32
34
  /**
33
35
  * Prompt a first-run user for the official DeepSeek credential while no
34
36
  * provider can serve requests and that credential is writable.
@@ -68,6 +68,13 @@ export interface ModelListEditorProps {
68
68
  t: (key: keyof typeof en) => string;
69
69
  /** Disable every control (read-only deployment or a pending write). */
70
70
  disabled: boolean;
71
+ /**
72
+ * Called once per change with whether an endpoint interrogation is in
73
+ * flight. The owning card folds it into its own busy state so the surface
74
+ * around the card — a mode switch, say — can refuse to move while the
75
+ * answer, and the picker it opens, is still bound for this list.
76
+ */
77
+ onBusyChange: (busy: boolean) => void;
71
78
  }
72
79
  /**
73
80
  * Render the model list with its fetch action.
@@ -5,11 +5,19 @@
5
5
  * solid configured or missing dots. A whole-section provider without a
6
6
  * configured key renders as its open setup card instead of a row, but only in
7
7
  * the first-run posture — no provider on the page can serve requests yet — and
8
- * only until the user closes that card; the add flow is a card carrying the
9
- * dormant-provider select. Each card kind owns its own open state, so closing
10
- * one never discards a draft in another. Every mutation writes through the
11
- * wire, while a provider removal first requires confirmation; the page
12
- * re-renders from pushed invalidations or the post-apply reload.
8
+ * only until the user closes that card. The add flow is one card behind one
9
+ * button: a mode switch chooses between adopting a dormant directory provider
10
+ * (the catalog select over the provider editor) and declaring a custom model
11
+ * API (the create form). A panel mounts the first time its mode is shown and
12
+ * stays mounted, hidden, while the card is open and its mode stays offered,
13
+ * so switching modes discards neither draft and an unvisited mode costs
14
+ * nothing; the switch holds still while either panel has a write or an
15
+ * endpoint interrogation in flight, since a switch underneath one would
16
+ * orphan the answer. Each card kind owns its own open state, so closing one
17
+ * never discards a draft in another. Every
18
+ * mutation writes through the wire, while a provider removal first requires
19
+ * confirmation; the page re-renders from pushed invalidations or the
20
+ * post-apply reload.
13
21
  */
14
22
  import type { ReactNode } from 'react';
15
23
  import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
@@ -14,9 +14,9 @@
14
14
  * Reasoning effort is deliberately absent: it is a per-MODEL capability, and
15
15
  * the models under one provider disagree about it, so a provider-scoped
16
16
  * control can only be set to a value some of them reject. The composer's
17
- * model picker offers each model its own levels; `settings.yaml` keeps the
17
+ * model picker offers each model its own levels; `cordis.patch.yml` keeps the
18
18
  * profile field for a deployment that knows its route. Everything else stays
19
- * owned by `settings.yaml`. Profile edits land as minimal `settings.mutate`
19
+ * owned by `cordis.patch.yml`. Profile edits land as minimal `settings.mutate`
20
20
  * path ops against the stored section — the card names only the fields it can
21
21
  * see instead of rebuilding the whole subtree from a partial descriptor.
22
22
  */
@@ -67,6 +67,12 @@ export interface ProviderEditorProps {
67
67
  submitBusyLabelKey?: keyof typeof en;
68
68
  /** Close the editor; `changed` reports whether an Apply committed. */
69
69
  onClose: (changed: boolean) => void;
70
+ /**
71
+ * Called once per change with whether the apply or the model list's
72
+ * endpoint interrogation is in flight, so the owner can hold its surface
73
+ * still.
74
+ */
75
+ onBusyChange?: (busy: boolean) => void;
70
76
  }
71
77
  /**
72
78
  * The minimal path ops carrying `after` over `before`, both as the card sees
@@ -14,6 +14,13 @@ export declare const en: {
14
14
  deleteConfirm: string;
15
15
  deleting: string;
16
16
  add: string;
17
+ addMode: string;
18
+ addCatalog: string;
19
+ addCustom: string;
20
+ addCatalogHint: string;
21
+ addCustomHint: string;
22
+ addCatalogExhausted: string;
23
+ addCustomUnavailable: string;
17
24
  provider: string;
18
25
  close: string;
19
26
  cancel: string;
@@ -34,8 +41,7 @@ export declare const en: {
34
41
  customized: string;
35
42
  baseUrl: string;
36
43
  baseUrlDefault: string;
37
- deepSeekChatBaseUrl: string;
38
- deepSeekMessagesBaseUrl: string;
44
+ deepSeekBaseUrl: string;
39
45
  deepSeekEndpointHint: string;
40
46
  models: string;
41
47
  modelsInherited: string;
@@ -78,8 +84,6 @@ export declare const en: {
78
84
  fetchSelectAll: string;
79
85
  fetchDeselectAll: string;
80
86
  fetchAdopt: string;
81
- customAdd: string;
82
- customTitle: string;
83
87
  customTag: string;
84
88
  customRoute: string;
85
89
  customRouteHint: string;
@@ -88,10 +92,14 @@ export declare const en: {
88
92
  customDisplayName: string;
89
93
  customApi: string;
90
94
  customApiUnset: string;
95
+ protocolOpenAiCompletions: string;
96
+ protocolOpenAiResponses: string;
97
+ protocolAnthropicMessages: string;
91
98
  customNeedsBaseUrl: string;
92
99
  customBaseUrlInvalid: string;
93
100
  customNeedsModels: string;
94
101
  customBaseUrlPlaceholder: string;
102
+ customAnthropicBaseUrlPlaceholder: string;
95
103
  settingsPathUnresolvable: string;
96
104
  create: string;
97
105
  creating: string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Product names for the wire protocols a pi-ai route may speak. The pickers
3
+ * show these instead of the schema identifiers (`openai-completions`), which
4
+ * are what `settings.yaml` carries and what the option values stay.
5
+ */
6
+ import type { ModelsKey } from './locales.ts';
7
+ /**
8
+ * The picker text for one protocol identifier.
9
+ * @param t - section copy.
10
+ * @param protocol - the schema identifier of the protocol.
11
+ * @returns the product name this page knows the protocol by; a protocol the
12
+ * adapter adds before this page names it shows its identifier, the spelling
13
+ * `settings.yaml` needs anyway.
14
+ */
15
+ export declare function protocolLabel(t: (key: ModelsKey) => string, protocol: string): string;
16
+ //# sourceMappingURL=protocol-label.d.ts.map
@@ -32,6 +32,15 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
32
32
  scope: 'root';
33
33
  owner: ProviderCardExtrasOwnerProps;
34
34
  };
35
+ /** Optional account login choice before the credential editor. */
36
+ 'settings.models.sign-in': {
37
+ kind: 'single';
38
+ scope: 'root';
39
+ owner: {
40
+ complete: () => void;
41
+ useApiKey: () => void;
42
+ };
43
+ };
35
44
  /**
36
45
  * Ordered extension area after the provider rows and the add controls.
37
46
  * Without a registrant the area renders nothing.
@@ -5,7 +5,7 @@
5
5
  * stays process-local here.
6
6
  */
7
7
  import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
8
- import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
8
+ import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
9
9
  /** State rendered by the welcome step. */
10
10
  export interface WelcomeNoticeState {
11
11
  status: 'idle' | 'loading' | 'ready' | 'saving' | 'error';
@@ -34,7 +34,7 @@ export declare class WelcomeNoticeStore {
34
34
  * @param scope - the welcome settings namespace scope; its memory mode is
35
35
  * what keeps a remote browser process-local.
36
36
  */
37
- constructor(scope: SettingsScope<WelcomeSection>);
37
+ constructor(scope: ConfigForm<WelcomeSection>);
38
38
  /**
39
39
  * Begin following the bound scope (idempotent) and publish its current answer.
40
40
  * @returns settlement after the current answer is published.
@@ -1,4 +1,11 @@
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;
1
+ /** Host configuration and page bootstrap for Models credential onboarding. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import { type Config } from './onboarding-config.ts';
4
+ export { Config } from './onboarding-config.ts';
5
+ /**
6
+ * Publish the credential-onboarding choice before browser plugins activate.
7
+ * @param ctx - Host context collecting the page's initialization data.
8
+ * @param config - plugin options with schema defaults applied by the Loader.
9
+ */
10
+ export declare function apply(ctx: Context, config: Config): void;
4
11
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ /** Public page-bootstrap options shared by the Host and Client halves. */
2
+ import z from '@deepseek-ai/schemastery';
3
+ /** Onboarding options after schema defaults are applied. */
4
+ export interface Config {
5
+ /** Offer the browser API-key step when no native shell owns credential onboarding. */
6
+ credentialOnboarding: boolean;
7
+ }
8
+ /** Validate Host configuration and its public page-bootstrap payload. */
9
+ export declare const Config: z<Partial<Config>, Config>;
10
+ /** Page-global key carrying only the public onboarding options. */
11
+ export declare const ONBOARDING_CONFIG_GLOBAL = "__DSH_MODELS_ONBOARDING__";
12
+ //# sourceMappingURL=onboarding-config.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /** Durable settings namespace for product-wide GUI onboarding facts. */
2
- export declare const WELCOME_NOTICE_SETTINGS_NAMESPACE = "ui-onboarding";
2
+ export declare const WELCOME_NOTICE_SETTINGS_NAMESPACE = "ui-settings-general";
3
3
  /** Field storing the last welcome notice version the user acknowledged. */
4
4
  export declare const WELCOME_NOTICE_ACK_FIELD = "welcomeNoticeVersion";
5
5
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-settings-models",
3
3
  "description": "Models settings and shared product-onboarding dialogs over existing settings and credential joins",
4
- "version": "0.1.6-alpha.2",
4
+ "version": "0.1.7-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,22 +37,26 @@
37
37
  },
38
38
  "license": "MIT",
39
39
  "peerDependencies": {
40
- "@deepseek-ai/cordis": "^4.0.2"
40
+ "@deepseek-ai/cordis": "~4.0.4"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/react": "~18.3.1",
44
44
  "react": "^18.2.0",
45
- "@deepseek-ai/dsh-remote-mock": "^0.1.6-alpha.2",
46
- "@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.2",
47
- "@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.2",
48
- "@deepseek-ai/dsh-client-store": "^0.1.6-alpha.2",
49
- "@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.2",
50
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.2",
51
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.6-alpha.2",
52
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2",
53
- "@deepseek-ai/cordis": "^4.0.2",
54
- "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2",
55
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2"
45
+ "@deepseek-ai/dsh-host-webserver": "0.1.7-alpha.2",
46
+ "@deepseek-ai/dsh-api-remotes": "0.1.7-alpha.2",
47
+ "@deepseek-ai/dsh-client-locale": "0.1.7-alpha.2",
48
+ "@deepseek-ai/dsh-client-store": "0.1.7-alpha.2",
49
+ "@deepseek-ai/dsh-client-test-runtime": "0.1.7-alpha.2",
50
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-alpha.2",
51
+ "@deepseek-ai/cordis": "~4.0.4",
52
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.7-alpha.2",
53
+ "@deepseek-ai/dsh-util-values": "0.1.7-alpha.2",
54
+ "@deepseek-ai/dsh-remote-mock": "0.1.7-alpha.2",
55
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.7-alpha.2",
56
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-alpha.2"
57
+ },
58
+ "dependencies": {
59
+ "@deepseek-ai/schemastery": "~3.18.4"
56
60
  },
57
61
  "files": [
58
62
  "lib/index.js",