@deepseek-ai/dsh-client-ui-settings-models 0.2.1-alpha.2 → 0.2.1-alpha.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.
@@ -0,0 +1,17 @@
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ import type { en } from './locales.ts';
3
+ /** Input attributes and section copy for the current credential draft. */
4
+ interface ApiKeyInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'type' | 'className' | 'autoComplete'> {
5
+ /** Unsaved input; stored credentials are never read into this field. */
6
+ readonly value: string;
7
+ /** Section copy, including the same reveal labels as SecretText. */
8
+ readonly t: (key: keyof typeof en) => string;
9
+ }
10
+ /**
11
+ * Reveal only a nonempty draft; a different value starts masked, as in SecretText.
12
+ * @param props - current draft, input attributes, and translated control labels.
13
+ * @returns a password input with an optional reveal button.
14
+ */
15
+ export declare function ApiKeyInput({ value, t, ...props }: ApiKeyInputProps): ReactNode;
16
+ export {};
17
+ //# sourceMappingURL=ApiKeyInput.d.ts.map
@@ -17,11 +17,12 @@
17
17
  * and at least one model — are required here rather than at load, so the
18
18
  * failure names the field while the user is still looking at it.
19
19
  *
20
- * There is deliberately no reasoning-effort control, here or on the editor
21
- * card: effort is a per-MODEL capability, and the models under one provider
22
- * disagree about it, so a provider-scoped control can only be set to a value
23
- * some of them reject. The composer's model picker offers each model its own
24
- * levels instead.
20
+ * There is deliberately no provider-scoped reasoning-effort control, here or
21
+ * on the editor card: effort is a per-MODEL capability, and the models under
22
+ * one provider disagree about it, so a provider-scoped control can only be set
23
+ * to a value some of them reject. Each model row of a hand-declared route
24
+ * declares its own `reasoningEfforts` instead, and the composer's model picker
25
+ * offers each model those levels.
25
26
  */
26
27
  import type { ReactNode } from 'react';
27
28
  import type { ModelsOperations } from './operations.ts';
@@ -32,6 +33,8 @@ export interface CustomProviderCardProps {
32
33
  taken: readonly string[];
33
34
  /** Wire protocols the adapter can serve, in the order it reports them. */
34
35
  protocols: readonly string[];
36
+ /** Reasoning levels the adapter's schema accepts, in escalation order; empty shows no reasoning control. */
37
+ reasoningLevels: readonly string[];
35
38
  /**
36
39
  * Revision of the `llm-pi-ai` user section this card opened at, sent with
37
40
  * the create so a route another tab declared meanwhile is a refusal rather
@@ -45,6 +45,12 @@ export interface ModelListEditorProps {
45
45
  models: readonly ModelDraft[];
46
46
  /** Installed provider whose catalog supplies defaults without endpoint I/O. */
47
47
  catalogProvider?: string | undefined;
48
+ /**
49
+ * Reasoning levels a hand-declared route's rows may declare in
50
+ * `reasoningEfforts`, in escalation order; absent or empty shows no
51
+ * reasoning control, leaving a catalog model's levels to the catalog.
52
+ */
53
+ reasoningLevels?: readonly string[] | undefined;
48
54
  /** Route input types for models absent from the installed catalog. */
49
55
  defaultInput?: readonly string[] | undefined;
50
56
  /** Whether the user layer currently owns the whole array; absent on a create. */
@@ -0,0 +1,43 @@
1
+ /** Reasoning-level declarations for a model on a hand-declared pi-ai route. */
2
+ import type { ReactNode } from 'react';
3
+ import type { DeepSeekModelDraft } from './DeepSeekModelsEditor.tsx';
4
+ import type { ModelsKey } from './locales.ts';
5
+ /** A reasoning-level failure the Models cards name by row. */
6
+ export interface ReasoningEffortsFailure {
7
+ /** Zero-based model position. */
8
+ index: number;
9
+ /** Message key owned by the Models settings section. */
10
+ key: 'modelReasoningValueRequired' | 'modelReasoningNeedsLevel';
11
+ }
12
+ /**
13
+ * Mirror the pi-ai refusals of a hand-declared `reasoningEfforts`, so a card
14
+ * names the row instead of failing at the write.
15
+ * @param value - drafted `models` value, or `undefined` while inherited.
16
+ * @returns the first refused row, or `undefined` when the adapter will accept every row.
17
+ */
18
+ export declare function validateReasoningEfforts(value: unknown): ReasoningEffortsFailure | undefined;
19
+ /** Props of {@link ModelReasoningEfforts}. */
20
+ interface ModelReasoningEffortsProps {
21
+ /** Effective model row, including fields outside the curated editor. */
22
+ model: DeepSeekModelDraft;
23
+ /** Levels the adapter's schema accepts as `reasoningEfforts` keys, in escalation order. */
24
+ levels: readonly string[];
25
+ /** One-based row position for accessible names. */
26
+ position: number;
27
+ /** Prevent changes while read-only or saving. */
28
+ disabled: boolean;
29
+ /** Section copy. */
30
+ t: (key: ModelsKey) => string;
31
+ /** Replace this row, preserving unrelated configuration. */
32
+ onChange: (model: DeepSeekModelDraft) => void;
33
+ }
34
+ /**
35
+ * Edit the `reasoningEfforts` a hand-declared pi-ai model offers: a switch,
36
+ * then one row per level pairing the level with the value sent for it. Every
37
+ * row is read from the model, so a reused instance shows its new model.
38
+ * @param props - model declaration and row replacement action.
39
+ * @returns the reasoning-level group.
40
+ */
41
+ export declare function ModelReasoningEfforts({ model, levels, position, disabled, t, onChange }: ModelReasoningEffortsProps): ReactNode;
42
+ export {};
43
+ //# sourceMappingURL=ModelReasoningEfforts.d.ts.map
@@ -16,6 +16,8 @@ interface ModelRowProps {
16
16
  inputField: 'inputModalities' | 'input';
17
17
  inputFallback?: readonly string[] | undefined;
18
18
  inputLoading?: boolean;
19
+ /** Levels the row's `reasoningEfforts` may declare; absent or empty shows no reasoning control. */
20
+ reasoningLevels?: readonly string[] | undefined;
19
21
  expanded: boolean;
20
22
  disabled: boolean;
21
23
  t: (key: ModelsKey) => string;
@@ -21,7 +21,7 @@
21
21
  * see instead of rebuilding the whole subtree from a partial descriptor.
22
22
  */
23
23
  import type { ReactNode } from 'react';
24
- import type { SettingsNamespaceView, SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client';
24
+ import type { CredentialInfo, LlmNativeAuth, SettingsNamespaceView, SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client';
25
25
  import type { ModelsOperations } from './operations.ts';
26
26
  import type { SettingsSchemaOperations } from './schema-operations.ts';
27
27
  import type { en } from './locales.ts';
@@ -49,6 +49,16 @@ export interface ProviderEditorProps {
49
49
  settingsPath: readonly string[];
50
50
  /** The Host operations this card writes and interrogates through. */
51
51
  operations: ModelsOperations;
52
+ /** Endpoint the route uses when its profile sets no `baseURL`; absent when the adapter reports none. */
53
+ defaultBaseURL?: string;
54
+ /** Environment variables used by the provider to construct its endpoint. */
55
+ baseURLEnv?: readonly string[];
56
+ /** Authentication the route performs when its profile names no credential reference; absent when the adapter reports none. */
57
+ nativeAuth?: LlmNativeAuth;
58
+ /** Redacted state of the profile's named credential reference, from the page snapshot. */
59
+ credential?: CredentialInfo;
60
+ /** Redacted checks for the profile's named reference or the provider's native variables. */
61
+ credentialChecks?: Readonly<Record<string, CredentialInfo>>;
52
62
  /** Section copy. */
53
63
  t: (key: keyof typeof en) => string;
54
64
  /** Disable writes (read-only settings provider). */
@@ -7,7 +7,7 @@ import type { en } from './locales.ts';
7
7
  /** Registration-side dependencies of {@link WelcomeNotice}. */
8
8
  export interface WelcomeNoticeInjected {
9
9
  hooks: {
10
- /** Durable or process-local acknowledgement state. */
10
+ /** Durable acknowledgement state. */
11
11
  welcome: SnapshotStore<WelcomeNoticeState>;
12
12
  };
13
13
  /** Welcome acknowledgement controller. */
@@ -30,18 +30,29 @@ export declare const en: {
30
30
  savedProvider: string;
31
31
  credentialConfigured: string;
32
32
  credentialMissing: string;
33
+ accountSignedIn: string;
33
34
  readOnly: string;
34
35
  loadFailed: string;
35
36
  conflict: string;
36
37
  retry: string;
37
38
  keyInput: string;
39
+ keyReveal: string;
40
+ keyHide: string;
38
41
  keyPlaceholder: string;
39
- keyPlaceholderNative: string;
40
- keyStored: string;
41
- keyEnvLocked: string;
42
+ keyPlaceholderFallback: string;
43
+ keyPlaceholderSaved: string;
44
+ keyFallbackMissing: string;
45
+ keyFallbackDetected: string;
46
+ keyFallbackDetectedHidden: string;
47
+ keyFallbackUnchecked: string;
48
+ keyHelp: string;
49
+ authHelp: string;
42
50
  customized: string;
43
51
  baseUrl: string;
44
52
  baseUrlDefault: string;
53
+ baseUrlEnvironment: string;
54
+ baseUrlConfigured: string;
55
+ baseUrlPlaceholder: string;
45
56
  deepSeekBaseUrl: string;
46
57
  deepSeekEndpointHint: string;
47
58
  models: string;
@@ -60,6 +71,16 @@ export declare const en: {
60
71
  modelInputTypes: string;
61
72
  modelInputText: string;
62
73
  modelInputImage: string;
74
+ modelReasoning: string;
75
+ modelReasoningLevel: string;
76
+ modelReasoningValue: string;
77
+ modelReasoningHelp: string;
78
+ modelReasoningHelpText: string;
79
+ modelReasoningNeedsLevel: string;
80
+ modelReasoningValueRequired: string;
81
+ modelReasoningAdd: string;
82
+ modelReasoningRemove: string;
83
+ modelReasoningOffValuePlaceholder: string;
63
84
  addModel: string;
64
85
  removeModel: string;
65
86
  modelsEmpty: string;
@@ -5,7 +5,7 @@
5
5
  * failure codes and Remote namespaces stay in the apply world.
6
6
  */
7
7
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
8
- import type { CredentialInfo, LlmDiscoveredModel, LlmModelDiscoveryRequest, SettingsNamespaceView, SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client';
8
+ import type { LlmDiscoveredModel, LlmModelDiscoveryRequest, SettingsNamespaceView, SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client';
9
9
  /** What one namespace write answered. */
10
10
  export type SettingsWriteOutcome =
11
11
  /** Committed; the view carries the stored user subtree and the new revision. */
@@ -40,12 +40,6 @@ export type ModelDiscoveryOutcome =
40
40
  };
41
41
  /** The Host operations the Models page and its cards invoke. */
42
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
43
  /**
50
44
  * Store one credential literal under its reference.
51
45
  * @param ref - credential reference name.
@@ -7,7 +7,7 @@
7
7
  * re-renders from the next describe, pushed or refetched.
8
8
  */
9
9
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
10
- import type { CredentialInfo, LlmConfigurableProvider, LlmProviderInfo, SettingsNamespaceView } from '@deepseek-ai/dsh-api-remotes/client';
10
+ import type { CredentialInfo, LlmConfigurableProvider, LlmNativeAuth, LlmProviderInfo, SettingsNamespaceView } from '@deepseek-ai/dsh-api-remotes/client';
11
11
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
12
12
  import type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client';
13
13
  import type { SettingsSchemaOperations } from './schema-operations.ts';
@@ -19,6 +19,9 @@ export interface ProviderDirectoryEntry {
19
19
  readonly settingsPath: readonly string[];
20
20
  readonly active: boolean;
21
21
  readonly declared?: boolean;
22
+ readonly defaultBaseURL?: string;
23
+ readonly baseURLEnv?: readonly string[];
24
+ readonly nativeAuth?: LlmNativeAuth;
22
25
  readonly error?: string;
23
26
  }
24
27
  /**
@@ -49,6 +52,8 @@ export interface ProviderRow {
49
52
  * own derivation rule.
50
53
  */
51
54
  derivedCredential?: CredentialInfo;
55
+ /** Redacted checks for named or native references; absent when their read failed. */
56
+ credentialChecks?: Readonly<Record<string, CredentialInfo>>;
52
57
  }
53
58
  /** Page snapshot. */
54
59
  export interface ModelsSettingsState {
@@ -82,6 +87,16 @@ export declare function deriveKeyRef(provider: string): string;
82
87
  * @returns the protocol identifiers, or an empty list when the schema has none.
83
88
  */
84
89
  export declare function protocolChoices(namespace: SettingsNamespaceView | undefined, schema: SettingsSchemaOperations): string[];
90
+ /**
91
+ * The reasoning levels a hand-declared route's models may declare, read out of
92
+ * the owning namespace's own schema for the same reason as
93
+ * {@link protocolChoices}: the levels the page offers and the keys the
94
+ * adapter accepts in `reasoningEfforts` come from the same `Config`.
95
+ * @param namespace - the namespace view whose schema declares the profile shape.
96
+ * @param schema - settings schema operations.
97
+ * @returns the levels in the schema's escalation order, or an empty list when the schema has none.
98
+ */
99
+ export declare function reasoningLevelChoices(namespace: SettingsNamespaceView | undefined, schema: SettingsSchemaOperations): string[];
85
100
  /** The models settings page controller (one per settings surface). */
86
101
  export declare class ModelsSettingsStore {
87
102
  private readonly ctx;
@@ -1,8 +1,6 @@
1
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.
2
+ * Welcome-notice state derived from the welcome settings scope: the notice
3
+ * follows the Host section and records its acknowledgement through it.
6
4
  */
7
5
  import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
8
6
  import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
@@ -22,18 +20,13 @@ export type WelcomeSection = Record<string, unknown>;
22
20
  * @returns the section object, or an empty one for non-object values.
23
21
  */
24
22
  export declare function decodeWelcomeSection(section: unknown): WelcomeSection;
25
- /** Coordinates durable Host acknowledgement or a process-local remote fallback. */
23
+ /** Coordinates the durable Host acknowledgement. */
26
24
  export declare class WelcomeNoticeStore {
27
25
  private readonly scope;
28
26
  /** uSES-safe state source shared by the registered welcome step. */
29
27
  readonly store: SnapshotStore<WelcomeNoticeState>;
30
- private localAcknowledged;
31
28
  private saving;
32
29
  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
30
  constructor(scope: ConfigForm<WelcomeSection>);
38
31
  /**
39
32
  * Begin following the bound scope (idempotent) and publish its current answer.
@@ -41,10 +34,10 @@ export declare class WelcomeNoticeStore {
41
34
  */
42
35
  load(): Promise<void>;
43
36
  /**
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.
37
+ * Persist this copy version through the scope. Success is judged against the
38
+ * state the write left behind, so a refused or failed write reports false
39
+ * after its recovery read settles.
40
+ * @returns true when the Host holds the acknowledgement.
48
41
  */
49
42
  acknowledge(): Promise<boolean>;
50
43
  /** Stop following the scope. */
package/locale/en.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "meta": {
3
+ "title": "ui-settings-models"
4
+ }
5
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "模型设置界面",
4
+ "description": "管理模型服务及其接入配置,并提供相关引导。"
5
+ }
6
+ }
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.2.1-alpha.2",
4
+ "version": "0.2.1-alpha.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -23,7 +23,8 @@
23
23
  "default": "./lib/client.js"
24
24
  },
25
25
  "./src/*": "./src/*",
26
- "./package.json": "./package.json"
26
+ "./package.json": "./package.json",
27
+ "./locale/*.json": "./locale/*.json"
27
28
  },
28
29
  "dsh": {
29
30
  "client": {
@@ -37,29 +38,29 @@
37
38
  },
38
39
  "license": "MIT",
39
40
  "peerDependencies": {
40
- "@deepseek-ai/cordis": "~4.0.5-alpha.1"
41
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2"
41
42
  },
42
43
  "devDependencies": {
43
- "@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.2",
44
- "@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.2",
45
- "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.2",
46
- "@deepseek-ai/dsh-client-store": "0.2.1-alpha.2",
47
- "@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.2",
48
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.2",
49
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.2",
50
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.2",
51
- "@types/react": "~18.3.1",
52
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
44
+ "@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.4",
45
+ "@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.4",
46
+ "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.4",
47
+ "@deepseek-ai/dsh-client-store": "0.2.1-alpha.4",
48
+ "@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.4",
49
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.4",
50
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.4",
51
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.4",
52
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
53
53
  "react": "^18.2.0",
54
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.2",
55
- "@deepseek-ai/dsh-util-values": "0.2.1-alpha.2",
56
- "@deepseek-ai/dsh-remote-mock": "0.2.1-alpha.2",
57
- "@deepseek-ai/dsh-client-product-analytics": "0.2.1-alpha.2"
54
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.4",
55
+ "@deepseek-ai/dsh-util-values": "0.2.1-alpha.4",
56
+ "@deepseek-ai/dsh-remote-mock": "0.2.1-alpha.4",
57
+ "@deepseek-ai/dsh-client-product-analytics": "0.2.1-alpha.4"
58
58
  },
59
59
  "dependencies": {
60
- "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
60
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.2"
61
61
  },
62
62
  "files": [
63
+ "locale/*.json",
63
64
  "lib/index.js",
64
65
  "lib/client.js",
65
66
  "lib/types/**/*.d.ts"