@qilin-agent/client-ui-settings-models 3.1.4 → 3.1.6
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/README.i18n.yaml +4 -4
- package/README.md +8 -2
- package/README.zh.md +8 -2
- package/lib/client.js +498 -72
- package/lib/types/client/ApiKeyInput.d.ts +17 -0
- package/lib/types/client/CustomProviderCard.d.ts +8 -5
- package/lib/types/client/ModelListEditor.d.ts +6 -0
- package/lib/types/client/ModelReasoningEfforts.d.ts +43 -0
- package/lib/types/client/ModelRow.d.ts +2 -0
- package/lib/types/client/ProviderEditor.d.ts +13 -6
- package/lib/types/client/locales.d.ts +19 -0
- package/lib/types/client/store.d.ts +27 -4
- package/package.json +13 -13
|
@@ -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
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
* and at least one model — are required here rather than at load, so the
|
|
15
15
|
* failure names the field while the user is still looking at it.
|
|
16
16
|
*
|
|
17
|
-
* There is deliberately no reasoning-effort control, here or
|
|
18
|
-
* card: effort is a per-MODEL capability, and the models under
|
|
19
|
-
* disagree about it, so a provider-scoped control can only be set
|
|
20
|
-
* some of them reject.
|
|
21
|
-
*
|
|
17
|
+
* There is deliberately no provider-scoped reasoning-effort control, here or
|
|
18
|
+
* on the editor card: effort is a per-MODEL capability, and the models under
|
|
19
|
+
* one provider disagree about it, so a provider-scoped control can only be set
|
|
20
|
+
* to a value some of them reject. Each model row of a hand-declared route
|
|
21
|
+
* declares its own `reasoningEfforts` instead, and the composer's model picker
|
|
22
|
+
* offers each model those levels.
|
|
22
23
|
*/
|
|
23
24
|
import type { ReactNode } from 'react';
|
|
24
25
|
import type { ModelsOperations } from './operations.ts';
|
|
@@ -29,6 +30,8 @@ export interface CustomProviderCardProps {
|
|
|
29
30
|
taken: readonly string[];
|
|
30
31
|
/** Wire protocols the adapter can serve, in the order it reports them. */
|
|
31
32
|
protocols: readonly string[];
|
|
33
|
+
/** Reasoning levels the adapter's schema accepts, in escalation order; empty shows no reasoning control. */
|
|
34
|
+
reasoningLevels: readonly string[];
|
|
32
35
|
/**
|
|
33
36
|
* Revision of the `llm-pi-ai` user section this card opened at, sent with
|
|
34
37
|
* 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;
|
|
@@ -11,17 +11,18 @@
|
|
|
11
11
|
* display name and wire protocol of a pi-ai route the adapter does not ship —
|
|
12
12
|
* the two fields the create card asked that route for, editable here for the
|
|
13
13
|
* same reason).
|
|
14
|
-
*
|
|
15
|
-
* the
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* There is deliberately no provider-scoped reasoning-effort control, here or
|
|
15
|
+
* on the editor card: effort is a per-MODEL capability, and the models under
|
|
16
|
+
* one provider disagree about it, so a provider-scoped control can only be set
|
|
17
|
+
* to a value some of them reject. Each model row of a hand-declared route
|
|
18
|
+
* declares its own `reasoningEfforts` instead, and the composer's model picker
|
|
19
|
+
* offers each model those levels. Everything else stays
|
|
19
20
|
* owned by `settings.yaml`. Profile edits land as minimal `settings.mutate`
|
|
20
21
|
* path ops against the stored section — the card names only the fields it can
|
|
21
22
|
* see instead of rebuilding the whole subtree from a partial descriptor.
|
|
22
23
|
*/
|
|
23
24
|
import type { ReactNode } from 'react';
|
|
24
|
-
import type { SettingsNamespaceView, SettingsPathOpView } from '@qilin-agent/api-remotes/client';
|
|
25
|
+
import type { CredentialInfo, LlmNativeAuth, SettingsNamespaceView, SettingsPathOpView } from '@qilin-agent/api-remotes/client';
|
|
25
26
|
import type { ModelsOperations } from './operations.ts';
|
|
26
27
|
import type { SettingsSchemaOperations } from './schema-operations.ts';
|
|
27
28
|
import type { en } from './locales.ts';
|
|
@@ -45,6 +46,12 @@ export interface ProviderEditorProps {
|
|
|
45
46
|
namespace: SettingsNamespaceView;
|
|
46
47
|
/** Settings-owned synchronous schema and immutable path operations. */
|
|
47
48
|
schema: SettingsSchemaOperations;
|
|
49
|
+
/** Environment variables used by the provider to construct its endpoint. */
|
|
50
|
+
baseURLEnv?: readonly string[];
|
|
51
|
+
/** Authentication the route performs when its profile names no credential reference; absent when the adapter reports none. */
|
|
52
|
+
nativeAuth?: LlmNativeAuth;
|
|
53
|
+
/** Redacted checks for the profile's named reference or the provider's native variables. */
|
|
54
|
+
credentialChecks?: Readonly<Record<string, CredentialInfo>>;
|
|
48
55
|
/** Path from the section root to this provider's profile. */
|
|
49
56
|
settingsPath: readonly string[];
|
|
50
57
|
/** The Host operations this card writes and interrogates through. */
|
|
@@ -27,13 +27,22 @@ export declare const en: {
|
|
|
27
27
|
conflict: string;
|
|
28
28
|
retry: string;
|
|
29
29
|
keyInput: string;
|
|
30
|
+
keyReveal: string;
|
|
31
|
+
keyHide: string;
|
|
30
32
|
keyPlaceholder: string;
|
|
31
33
|
keyPlaceholderNative: string;
|
|
32
34
|
keyStored: string;
|
|
33
35
|
keyEnvLocked: string;
|
|
36
|
+
keyPlaceholderSaved: string;
|
|
37
|
+
keyFallbackMissing: string;
|
|
38
|
+
keyFallbackDetected: string;
|
|
39
|
+
keyFallbackDetectedHidden: string;
|
|
40
|
+
keyFallbackUnchecked: string;
|
|
34
41
|
customized: string;
|
|
35
42
|
baseUrl: string;
|
|
36
43
|
baseUrlDefault: string;
|
|
44
|
+
baseUrlEnvironment: string;
|
|
45
|
+
baseUrlConfigured: string;
|
|
37
46
|
deepSeekBaseUrl: string;
|
|
38
47
|
deepSeekEndpointHint: string;
|
|
39
48
|
models: string;
|
|
@@ -52,6 +61,16 @@ export declare const en: {
|
|
|
52
61
|
modelInputTypes: string;
|
|
53
62
|
modelInputText: string;
|
|
54
63
|
modelInputImage: string;
|
|
64
|
+
modelReasoning: string;
|
|
65
|
+
modelReasoningLevel: string;
|
|
66
|
+
modelReasoningValue: string;
|
|
67
|
+
modelReasoningHelp: string;
|
|
68
|
+
modelReasoningHelpText: string;
|
|
69
|
+
modelReasoningNeedsLevel: string;
|
|
70
|
+
modelReasoningValueRequired: string;
|
|
71
|
+
modelReasoningAdd: string;
|
|
72
|
+
modelReasoningRemove: string;
|
|
73
|
+
modelReasoningOffValuePlaceholder: string;
|
|
55
74
|
addModel: string;
|
|
56
75
|
removeModel: string;
|
|
57
76
|
modelsEmpty: string;
|
|
@@ -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 '@qilin-agent/kylin';
|
|
10
|
-
import type { CredentialInfo, LlmConfigurableProvider, LlmProviderInfo, SettingsNamespaceView } from '@qilin-agent/api-remotes/client';
|
|
10
|
+
import type { CredentialInfo, LlmConfigurableProvider, LlmNativeAuth, LlmProviderInfo, SettingsNamespaceView } from '@qilin-agent/api-remotes/client';
|
|
11
11
|
import type { SnapshotStore } from '@qilin-agent/client-store';
|
|
12
12
|
import type { SettingsDescribeFace } from '@qilin-agent/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
|
/**
|
|
@@ -47,6 +50,8 @@ export interface ProviderRow {
|
|
|
47
50
|
* own derivation rule.
|
|
48
51
|
*/
|
|
49
52
|
derivedCredential?: CredentialInfo;
|
|
53
|
+
/** Redacted checks for named or native references; absent when their read failed. */
|
|
54
|
+
credentialChecks?: Readonly<Record<string, CredentialInfo>>;
|
|
50
55
|
}
|
|
51
56
|
/** Page snapshot. */
|
|
52
57
|
export interface ModelsSettingsState {
|
|
@@ -80,6 +85,16 @@ export declare function deriveKeyRef(provider: string): string;
|
|
|
80
85
|
* @returns the protocol identifiers, or an empty list when the schema has none.
|
|
81
86
|
*/
|
|
82
87
|
export declare function protocolChoices(namespace: SettingsNamespaceView | undefined, schema: SettingsSchemaOperations): string[];
|
|
88
|
+
/**
|
|
89
|
+
* The reasoning levels a hand-declared route's models may declare, read out of
|
|
90
|
+
* the owning namespace's own schema for the same reason as
|
|
91
|
+
* {@link protocolChoices}: the levels the page offers and the keys the
|
|
92
|
+
* adapter accepts in `reasoningEfforts` come from the same `Config`.
|
|
93
|
+
* @param namespace - the namespace view whose schema declares the profile shape.
|
|
94
|
+
* @param schema - settings schema operations.
|
|
95
|
+
* @returns the levels in the schema's escalation order, or an empty list when the schema has none.
|
|
96
|
+
*/
|
|
97
|
+
export declare function reasoningLevelChoices(namespace: SettingsNamespaceView | undefined, schema: SettingsSchemaOperations): string[];
|
|
83
98
|
/** The models settings page controller (one per settings surface). */
|
|
84
99
|
export declare class ModelsSettingsStore {
|
|
85
100
|
private readonly ctx;
|
|
@@ -89,6 +104,8 @@ export declare class ModelsSettingsStore {
|
|
|
89
104
|
readonly store: SnapshotStore<ModelsSettingsState>;
|
|
90
105
|
/** Latest load wins; an older response never overwrites a newer one. */
|
|
91
106
|
private generation;
|
|
107
|
+
/** Callers follow the current refresh's outcome, including callers whose read was superseded. */
|
|
108
|
+
private readonly pendingLoads;
|
|
92
109
|
/**
|
|
93
110
|
* @param ctx - the page plugin's context, whose `remote.llm` and
|
|
94
111
|
* `remote.credentials` namespaces carry the directory and credential reads.
|
|
@@ -101,11 +118,17 @@ export declare class ModelsSettingsStore {
|
|
|
101
118
|
* settings answer in parallel, then one batched credential describe over
|
|
102
119
|
* every referenced ref. Provider failure or absence of an initial settings
|
|
103
120
|
* answer keeps the last good rows and surfaces an error; a failed settings
|
|
104
|
-
* refresh reuses the mirror's held view.
|
|
105
|
-
*
|
|
121
|
+
* refresh reuses the mirror's held view. Concurrent callers resolve only
|
|
122
|
+
* after the current refresh publishes its ready or error snapshot.
|
|
123
|
+
* @returns resolution after the current snapshot is published.
|
|
124
|
+
* @throws the current read's unexpected rejection; superseded rejections are ignored.
|
|
106
125
|
*/
|
|
107
126
|
load(): Promise<void>;
|
|
108
|
-
/** Publish one
|
|
127
|
+
/** Publish one joined answer; stale answers leave the current refresh in charge. */
|
|
128
|
+
private read;
|
|
129
|
+
/** Settle callers only while this read still owns the current refresh. */
|
|
130
|
+
private settleLoads;
|
|
131
|
+
/** Publish one load's failure text; the caller checked the current generation. */
|
|
109
132
|
private failLoad;
|
|
110
133
|
}
|
|
111
134
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/client-ui-settings-models",
|
|
3
3
|
"description": "Models settings and shared product-onboarding dialogs over existing settings and credential joins",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.6",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@qilin-agent/kylin": "~4.0.
|
|
43
|
+
"@qilin-agent/kylin": "~4.0.5"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/react": "~18.3.1",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
|
-
"@qilin-agent/remote-mock": "3.1.
|
|
49
|
-
"@qilin-agent/api-remotes": "3.1.
|
|
50
|
-
"@qilin-agent/client-locale": "3.1.
|
|
51
|
-
"@qilin-agent/client-test-runtime": "3.1.
|
|
52
|
-
"@qilin-agent/client-store": "3.1.
|
|
53
|
-
"@qilin-agent/client-ui-primitives": "3.1.
|
|
54
|
-
"@qilin-agent/client-ui-settings": "3.1.
|
|
55
|
-
"@qilin-agent/
|
|
56
|
-
"@qilin-agent/client-ui-
|
|
57
|
-
"@qilin-agent/
|
|
58
|
-
"@qilin-agent/
|
|
48
|
+
"@qilin-agent/remote-mock": "3.1.6",
|
|
49
|
+
"@qilin-agent/api-remotes": "3.1.6",
|
|
50
|
+
"@qilin-agent/client-locale": "3.1.6",
|
|
51
|
+
"@qilin-agent/client-test-runtime": "3.1.6",
|
|
52
|
+
"@qilin-agent/client-store": "3.1.6",
|
|
53
|
+
"@qilin-agent/client-ui-primitives": "3.1.6",
|
|
54
|
+
"@qilin-agent/client-ui-settings": "3.1.6",
|
|
55
|
+
"@qilin-agent/kylin": "~4.0.5",
|
|
56
|
+
"@qilin-agent/client-ui-slots": "3.1.6",
|
|
57
|
+
"@qilin-agent/util-values": "3.1.6",
|
|
58
|
+
"@qilin-agent/client-ui-renderer": "3.1.6"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
61
61
|
"lib/index.js",
|