dsh-modellix 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.
- package/CHANGELOG.md +52 -0
- package/LICENSE +201 -0
- package/README.md +266 -0
- package/README.zh-CN.md +266 -0
- package/cordis.patch.yml +16 -0
- package/docs/assets/credential-recovery.webp +0 -0
- package/docs/assets/design-desktop.webp +0 -0
- package/docs/assets/design-mobile-en.webp +0 -0
- package/docs/assets/design-proposal.webp +0 -0
- package/docs/assets/design-results-media.webp +0 -0
- package/docs/assets/llm-model-selector.webp +0 -0
- package/docs/assets/onboarding-defaults.webp +0 -0
- package/docs/assets/settings-ready.webp +0 -0
- package/docs/assets/web-tools.webp +0 -0
- package/docs/en-US/LOCAL_USAGE.md +169 -0
- package/docs/en-US/USER_GUIDE.md +546 -0
- package/docs/zh-CN/LOCAL_USAGE.md +169 -0
- package/docs/zh-CN/USER_GUIDE.md +546 -0
- package/lib/client.d.ts +214 -0
- package/lib/client.js +3653 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +1399 -0
- package/lib/index.js +8080 -0
- package/lib/index.js.map +1 -0
- package/package.json +167 -0
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
|
|
2
|
+
import { ClientContext } from "@deepseek-ai/dsh-client-runtime/client";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/design-presentation-codes.d.ts
|
|
5
|
+
declare const DESIGN_NOTICE_CODES: readonly ["schema-unavailable", "schema-invalid", "catalog-stale", "catalog-unavailable", "credential-reloaded"];
|
|
6
|
+
type DesignNoticeCode = (typeof DESIGN_NOTICE_CODES)[number];
|
|
7
|
+
declare const DESIGN_MODEL_UNAVAILABLE_CODES: readonly ["removed-from-catalog"];
|
|
8
|
+
type DesignModelUnavailableCode = (typeof DESIGN_MODEL_UNAVAILABLE_CODES)[number];
|
|
9
|
+
declare const DESIGN_FIELD_DISABLED_CODES: readonly ["unsupported-schema-field"];
|
|
10
|
+
type DesignFieldDisabledCode = (typeof DESIGN_FIELD_DISABLED_CODES)[number];
|
|
11
|
+
declare const DESIGN_DIAGNOSTIC_CODES: readonly ["credential-changed", "submit-unknown", "generation-failed", "result-unavailable", "credential-rejected", "task-inaccessible", "rate-limited", "response-invalid", "poll-unavailable"];
|
|
12
|
+
type DesignDiagnosticCode = (typeof DESIGN_DIAGNOSTIC_CODES)[number];
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/client/contracts.d.ts
|
|
15
|
+
declare const MODELLIX_CLIENT_WIRE_VERSION: 1;
|
|
16
|
+
declare const MODELLIX_RPC_CHANNEL: "/modellix";
|
|
17
|
+
declare const MODELLIX_RPC_ENDPOINTS: Readonly<{
|
|
18
|
+
stateGet: "state/get";
|
|
19
|
+
credentialSave: "credential/save";
|
|
20
|
+
onboardingDefer: "onboarding/defer";
|
|
21
|
+
settingsToggles: "settings/toggles";
|
|
22
|
+
credentialRemove: "credential/remove";
|
|
23
|
+
llmRefresh: "llm/refresh";
|
|
24
|
+
designRead: "design/read";
|
|
25
|
+
designRefresh: "design/refresh";
|
|
26
|
+
designSelectModel: "design/select-model";
|
|
27
|
+
designPropose: "design/propose";
|
|
28
|
+
designProposalApply: "design/proposal/apply";
|
|
29
|
+
designProposalReject: "design/proposal/reject";
|
|
30
|
+
designSubmit: "design/submit";
|
|
31
|
+
}>;
|
|
32
|
+
type ModellixRpcEndpoint = (typeof MODELLIX_RPC_ENDPOINTS)[keyof typeof MODELLIX_RPC_ENDPOINTS];
|
|
33
|
+
interface ServiceTogglesWire {
|
|
34
|
+
readonly design: boolean;
|
|
35
|
+
readonly llm: boolean;
|
|
36
|
+
readonly web: boolean;
|
|
37
|
+
}
|
|
38
|
+
type CredentialVerificationWire = "unknown" | "unverified" | "valid" | "invalid";
|
|
39
|
+
interface CredentialDescriptorWire {
|
|
40
|
+
readonly configured: boolean;
|
|
41
|
+
readonly source: "local" | "env" | null;
|
|
42
|
+
readonly writable: boolean;
|
|
43
|
+
/** Opaque Host descriptor token. The Client may echo it for CAS but never renders it. */
|
|
44
|
+
readonly revision: string | null;
|
|
45
|
+
readonly credentialEpoch: number;
|
|
46
|
+
readonly verification: CredentialVerificationWire;
|
|
47
|
+
readonly invalidEpoch: number | null;
|
|
48
|
+
}
|
|
49
|
+
interface SettingsSnapshotWire {
|
|
50
|
+
readonly version: 1;
|
|
51
|
+
readonly settingsRevision: number;
|
|
52
|
+
readonly services: ServiceTogglesWire;
|
|
53
|
+
readonly credential: CredentialDescriptorWire;
|
|
54
|
+
readonly onboarding: {
|
|
55
|
+
readonly status: "active" | "completed" | "deferred";
|
|
56
|
+
readonly recoveryPending: boolean;
|
|
57
|
+
readonly recoveryRequestId: string | null;
|
|
58
|
+
};
|
|
59
|
+
readonly llm: {
|
|
60
|
+
readonly health: "unknown" | "missing" | "disabled" | "ready" | "error" | "policy-blocked";
|
|
61
|
+
readonly modelCount: number;
|
|
62
|
+
readonly refreshedAt: number | null;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
type ClientJsonValue = null | boolean | number | string | readonly ClientJsonValue[] | {
|
|
66
|
+
readonly [key: string]: ClientJsonValue;
|
|
67
|
+
};
|
|
68
|
+
interface DesignModelWire {
|
|
69
|
+
readonly id: string;
|
|
70
|
+
readonly label: string;
|
|
71
|
+
readonly kind: "image" | "video" | "audio" | "unknown";
|
|
72
|
+
readonly featured: boolean;
|
|
73
|
+
readonly available: boolean;
|
|
74
|
+
readonly unavailableReason: DesignModelUnavailableCode | null;
|
|
75
|
+
}
|
|
76
|
+
interface DesignEnumOptionWire {
|
|
77
|
+
readonly label: string;
|
|
78
|
+
readonly value: string | number | boolean;
|
|
79
|
+
}
|
|
80
|
+
interface DesignFieldWire {
|
|
81
|
+
readonly path: string;
|
|
82
|
+
readonly label: string;
|
|
83
|
+
readonly description: string | null;
|
|
84
|
+
readonly kind: "string" | "number" | "integer" | "boolean" | "enum" | "array" | "object" | "media";
|
|
85
|
+
readonly widget: "input" | "textarea" | "select" | "switch" | "json" | "media";
|
|
86
|
+
readonly required: boolean;
|
|
87
|
+
readonly options: readonly DesignEnumOptionWire[];
|
|
88
|
+
readonly minimum: number | null;
|
|
89
|
+
readonly maximum: number | null;
|
|
90
|
+
readonly step: number | null;
|
|
91
|
+
readonly maxLength: number | null;
|
|
92
|
+
readonly disabledReason: DesignFieldDisabledCode | null;
|
|
93
|
+
}
|
|
94
|
+
interface DesignDraftWire {
|
|
95
|
+
readonly modelId: string;
|
|
96
|
+
readonly draftRevision: number;
|
|
97
|
+
readonly irContractHash: string;
|
|
98
|
+
readonly primaryInputPath: string;
|
|
99
|
+
readonly fields: readonly DesignFieldWire[];
|
|
100
|
+
/** Flattened IR field path -> JSON value. The Host revalidates before submit. */
|
|
101
|
+
readonly parameters: Readonly<Record<string, ClientJsonValue>>;
|
|
102
|
+
}
|
|
103
|
+
interface DesignProposalChangeWire {
|
|
104
|
+
readonly path: string;
|
|
105
|
+
readonly label: string;
|
|
106
|
+
readonly before: ClientJsonValue | undefined;
|
|
107
|
+
readonly after: ClientJsonValue | undefined;
|
|
108
|
+
}
|
|
109
|
+
interface DesignProposalWire {
|
|
110
|
+
readonly proposalId: string;
|
|
111
|
+
readonly baseDraftRevision: number;
|
|
112
|
+
readonly summary: string;
|
|
113
|
+
readonly changes: readonly DesignProposalChangeWire[];
|
|
114
|
+
readonly conflicts: readonly string[];
|
|
115
|
+
}
|
|
116
|
+
interface DesignResourceWire {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
readonly kind: "image" | "video" | "audio";
|
|
119
|
+
readonly url: string;
|
|
120
|
+
readonly downloadUrl: string;
|
|
121
|
+
readonly expiresAt: string | null;
|
|
122
|
+
}
|
|
123
|
+
interface DesignDiagnosticWire {
|
|
124
|
+
readonly code: DesignDiagnosticCode;
|
|
125
|
+
readonly retryable: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface DesignJobWire {
|
|
128
|
+
readonly jobId: string;
|
|
129
|
+
readonly modelId: string;
|
|
130
|
+
readonly status: "running" | "succeeded" | "failed" | "canceled" | "submit-unknown" | "expired";
|
|
131
|
+
readonly createdAt: string;
|
|
132
|
+
readonly updatedAt: string;
|
|
133
|
+
readonly resources: readonly DesignResourceWire[];
|
|
134
|
+
readonly diagnostic: DesignDiagnosticWire | null;
|
|
135
|
+
}
|
|
136
|
+
interface DesignSnapshotWire {
|
|
137
|
+
readonly version: 1;
|
|
138
|
+
readonly enabled: boolean;
|
|
139
|
+
readonly credentialReady: boolean;
|
|
140
|
+
readonly models: readonly DesignModelWire[];
|
|
141
|
+
readonly selectedModelId: string | null;
|
|
142
|
+
readonly draft: DesignDraftWire | null;
|
|
143
|
+
readonly proposal: DesignProposalWire | null;
|
|
144
|
+
readonly jobs: readonly DesignJobWire[];
|
|
145
|
+
readonly notice: DesignNoticeCode | null;
|
|
146
|
+
}
|
|
147
|
+
type DesignMutationWire = {
|
|
148
|
+
readonly version: 1;
|
|
149
|
+
readonly accepted: true;
|
|
150
|
+
readonly state: DesignSnapshotWire;
|
|
151
|
+
} | {
|
|
152
|
+
readonly version: 1;
|
|
153
|
+
readonly accepted: false;
|
|
154
|
+
readonly code: string;
|
|
155
|
+
};
|
|
156
|
+
interface AckWire {
|
|
157
|
+
readonly version: 1;
|
|
158
|
+
readonly accepted: true;
|
|
159
|
+
}
|
|
160
|
+
type SettingsMutationWire = {
|
|
161
|
+
readonly version: 1;
|
|
162
|
+
readonly accepted: true;
|
|
163
|
+
readonly state: SettingsSnapshotWire;
|
|
164
|
+
} | {
|
|
165
|
+
readonly version: 1;
|
|
166
|
+
readonly accepted: false;
|
|
167
|
+
readonly code: "credential-changed" | "settings-changed";
|
|
168
|
+
readonly messageKey: null;
|
|
169
|
+
readonly state: SettingsSnapshotWire;
|
|
170
|
+
} | {
|
|
171
|
+
readonly version: 1;
|
|
172
|
+
readonly accepted: false;
|
|
173
|
+
readonly code: string;
|
|
174
|
+
readonly messageKey: string;
|
|
175
|
+
readonly state: null;
|
|
176
|
+
};
|
|
177
|
+
declare class ModellixClientContractError extends Error {
|
|
178
|
+
constructor(message: string);
|
|
179
|
+
}
|
|
180
|
+
declare function parseSettingsSnapshot(input: unknown): SettingsSnapshotWire;
|
|
181
|
+
declare function parseDesignSnapshot(input: unknown): DesignSnapshotWire;
|
|
182
|
+
declare function parseDesignMutation(input: unknown): DesignMutationWire;
|
|
183
|
+
declare function parseAck(input: unknown): AckWire;
|
|
184
|
+
declare function parseSettingsMutation(input: unknown): SettingsMutationWire;
|
|
185
|
+
declare function sanitizeParameters(input: Readonly<Record<string, ClientJsonValue>>): Readonly<Record<string, ClientJsonValue>>;
|
|
186
|
+
declare function safeResourceHref(value: string): string;
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/client/registration.d.ts
|
|
189
|
+
declare const MODELLIX_CLIENT_SLOTS: readonly [{
|
|
190
|
+
readonly name: "shell.overlay";
|
|
191
|
+
readonly id: "modellix.credential-recovery";
|
|
192
|
+
readonly order: 10;
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "settings.onboarding";
|
|
195
|
+
readonly id: "modellix.onboarding";
|
|
196
|
+
readonly order: 10;
|
|
197
|
+
}, {
|
|
198
|
+
readonly name: "settings.section";
|
|
199
|
+
readonly id: "modellix";
|
|
200
|
+
readonly order: 30;
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "conversation.view";
|
|
203
|
+
readonly id: "modellix.design";
|
|
204
|
+
readonly order: 20;
|
|
205
|
+
}];
|
|
206
|
+
type ModellixClientSlotDefinition = (typeof MODELLIX_CLIENT_SLOTS)[number];
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/client/index.d.ts
|
|
209
|
+
declare const inject: string[];
|
|
210
|
+
declare function apply(ctx: ClientContext): void;
|
|
211
|
+
//#endregion
|
|
212
|
+
export { AckWire, ClientJsonValue, CredentialDescriptorWire, CredentialVerificationWire, DesignDiagnosticWire, DesignDraftWire, DesignEnumOptionWire, DesignFieldWire, DesignJobWire, DesignModelWire, DesignMutationWire, DesignProposalChangeWire, DesignProposalWire, DesignResourceWire, DesignSnapshotWire, MODELLIX_CLIENT_SLOTS, MODELLIX_CLIENT_WIRE_VERSION, MODELLIX_RPC_CHANNEL, MODELLIX_RPC_ENDPOINTS, ModellixClientContractError, ModellixClientSlotDefinition, ModellixRpcEndpoint, ServiceTogglesWire, SettingsMutationWire, SettingsSnapshotWire, apply, inject, parseAck, parseDesignMutation, parseDesignSnapshot, parseSettingsMutation, parseSettingsSnapshot, safeResourceHref, sanitizeParameters };
|
|
213
|
+
|
|
214
|
+
//# sourceMappingURL=client.d.ts.map
|