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/index.d.ts
ADDED
|
@@ -0,0 +1,1399 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import { SettingsPathOp } from "@deepseek-ai/dsh-settings";
|
|
3
|
+
import { WebError, WebFetchProvider, WebFetchRequest, WebFetchResult, WebSearchProvider, WebSearchRequest, WebSearchResult } from "@deepseek-ai/dsh-web";
|
|
4
|
+
import { Domain } from "@deepseek-ai/dsh-storage-domain";
|
|
5
|
+
import { z as z$1 } from "zod";
|
|
6
|
+
import { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
7
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
8
|
+
import { LlmRuntime } from "@deepseek-ai/dsh-llm";
|
|
9
|
+
|
|
10
|
+
//#region src/core/config.d.ts
|
|
11
|
+
declare const CURRENT_CONFIG_SCHEMA_VERSION: 1;
|
|
12
|
+
declare const MODELLIX_CREDENTIAL_REF: "MODELLIX_API_KEY";
|
|
13
|
+
type ServiceId = "design" | "llm" | "web";
|
|
14
|
+
type OnboardingStatus = "active" | "completed" | "deferred";
|
|
15
|
+
type RetentionPolicy = "metadata-only";
|
|
16
|
+
interface ServiceToggles {
|
|
17
|
+
readonly design: boolean;
|
|
18
|
+
readonly llm: boolean;
|
|
19
|
+
readonly web: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface DesignConfig {
|
|
22
|
+
readonly enabled: boolean;
|
|
23
|
+
readonly retentionPolicy: RetentionPolicy;
|
|
24
|
+
readonly retentionPolicyRevision: number;
|
|
25
|
+
readonly lastModel: string | null;
|
|
26
|
+
readonly recentModels: readonly string[];
|
|
27
|
+
readonly favoriteModels: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
interface LlmConfig {
|
|
30
|
+
readonly enabled: boolean;
|
|
31
|
+
readonly recentModels: readonly string[];
|
|
32
|
+
readonly favoriteModels: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
interface WebConfig {
|
|
35
|
+
readonly enabled: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface ServicesConfig {
|
|
38
|
+
readonly design: DesignConfig;
|
|
39
|
+
readonly llm: LlmConfig;
|
|
40
|
+
readonly web: WebConfig;
|
|
41
|
+
}
|
|
42
|
+
type OnboardingSavePhase = "credential-write-pending" | "settings-write-pending";
|
|
43
|
+
/**
|
|
44
|
+
* Non-secret write-ahead state for the two-store onboarding save.
|
|
45
|
+
*
|
|
46
|
+
* The Credential store and plugin Settings store cannot be committed in one
|
|
47
|
+
* transaction. Persisting this record before calling the Credential API makes
|
|
48
|
+
* an interrupted save explicit and recoverable without retaining the candidate
|
|
49
|
+
* secret in plugin data.
|
|
50
|
+
*/
|
|
51
|
+
interface OnboardingSaveRecovery {
|
|
52
|
+
readonly operationId: string;
|
|
53
|
+
readonly phase: OnboardingSavePhase;
|
|
54
|
+
readonly startedAt: number;
|
|
55
|
+
readonly intendedServices: ServiceToggles;
|
|
56
|
+
readonly expectedCredentialEpoch: number;
|
|
57
|
+
readonly expectedCredentialRevision: string | null;
|
|
58
|
+
readonly confirmedCredentialRevision: string | null;
|
|
59
|
+
}
|
|
60
|
+
interface OnboardingConfig {
|
|
61
|
+
readonly status: OnboardingStatus;
|
|
62
|
+
readonly saveRecovery: OnboardingSaveRecovery | null;
|
|
63
|
+
}
|
|
64
|
+
type PersistedLlmRouteOwnership = "none" | "created" | "adopted";
|
|
65
|
+
interface LlmRouteOwnershipEntry {
|
|
66
|
+
readonly kind: "field" | "model";
|
|
67
|
+
readonly key: string;
|
|
68
|
+
readonly appliedFingerprint: string;
|
|
69
|
+
}
|
|
70
|
+
interface LlmRouteOwnershipConfig {
|
|
71
|
+
readonly ownership: PersistedLlmRouteOwnership;
|
|
72
|
+
readonly appliedRouteFingerprint: string | null;
|
|
73
|
+
readonly entries: readonly LlmRouteOwnershipEntry[];
|
|
74
|
+
}
|
|
75
|
+
/** Non-secret write-ahead marker for one cross-namespace LLM materialization. */
|
|
76
|
+
interface LlmMaterializationRecovery {
|
|
77
|
+
readonly operationId: string;
|
|
78
|
+
readonly startedAt: number;
|
|
79
|
+
readonly expectedLlmSettingsRevision: number;
|
|
80
|
+
/** Fingerprint of the raw user route before the CAS. Null only for legacy evidence. */
|
|
81
|
+
readonly previousRouteFingerprint: string | null;
|
|
82
|
+
/** Planned ownership, persisted before the route CAS. Null only for legacy evidence. */
|
|
83
|
+
readonly targetRouteOwnership: LlmRouteOwnershipConfig | null;
|
|
84
|
+
}
|
|
85
|
+
interface BeginLlmMaterializationInput {
|
|
86
|
+
readonly operationId: string;
|
|
87
|
+
readonly startedAt: number;
|
|
88
|
+
readonly expectedLlmSettingsRevision: number;
|
|
89
|
+
readonly previousRouteFingerprint: string;
|
|
90
|
+
readonly targetRouteOwnership: LlmRouteOwnershipConfig;
|
|
91
|
+
}
|
|
92
|
+
interface LlmOwnershipConfig {
|
|
93
|
+
readonly route: LlmRouteOwnershipConfig;
|
|
94
|
+
readonly materializationRecovery: LlmMaterializationRecovery | null;
|
|
95
|
+
}
|
|
96
|
+
interface PluginConfig {
|
|
97
|
+
readonly schemaVersion: typeof CURRENT_CONFIG_SCHEMA_VERSION;
|
|
98
|
+
readonly credentialRef: typeof MODELLIX_CREDENTIAL_REF;
|
|
99
|
+
/** Monotonic plugin-owned generation; never derived from Credential bytes. */
|
|
100
|
+
readonly credentialEpoch: number;
|
|
101
|
+
readonly services: ServicesConfig;
|
|
102
|
+
readonly onboarding: OnboardingConfig;
|
|
103
|
+
readonly llmOwnership: LlmOwnershipConfig;
|
|
104
|
+
}
|
|
105
|
+
interface BeginOnboardingSaveInput {
|
|
106
|
+
readonly operationId: string;
|
|
107
|
+
readonly startedAt: number;
|
|
108
|
+
readonly intendedServices: ServiceToggles;
|
|
109
|
+
readonly expectedCredentialRevision: string | null;
|
|
110
|
+
}
|
|
111
|
+
type OnboardingRecoveryAction = "none" | "await-credential-write" | "commit-intended-settings" | "needs-user-reconciliation";
|
|
112
|
+
interface OnboardingRecoveryDecision {
|
|
113
|
+
readonly config: PluginConfig;
|
|
114
|
+
readonly action: OnboardingRecoveryAction;
|
|
115
|
+
}
|
|
116
|
+
declare class UnsupportedConfigVersionError extends Error {
|
|
117
|
+
readonly version: number;
|
|
118
|
+
constructor(version: number);
|
|
119
|
+
}
|
|
120
|
+
declare class OnboardingSaveConflictError extends Error {
|
|
121
|
+
constructor(message: string);
|
|
122
|
+
}
|
|
123
|
+
declare class LlmMaterializationConflictError extends Error {
|
|
124
|
+
constructor(message: string);
|
|
125
|
+
}
|
|
126
|
+
declare function createDefaultConfig(): PluginConfig;
|
|
127
|
+
/**
|
|
128
|
+
* Migrates absent/legacy settings by filling missing fields without turning an
|
|
129
|
+
* explicit false toggle back on. Unknown future schema versions are rejected
|
|
130
|
+
* instead of being silently downgraded.
|
|
131
|
+
*/
|
|
132
|
+
declare function migrateConfig(input: unknown): PluginConfig;
|
|
133
|
+
declare function getServiceToggles(config: PluginConfig): ServiceToggles;
|
|
134
|
+
declare function setServiceToggles(config: PluginConfig, toggles: ServiceToggles): PluginConfig;
|
|
135
|
+
declare function beginLlmMaterialization(config: PluginConfig, input: BeginLlmMaterializationInput): PluginConfig;
|
|
136
|
+
declare function completeLlmMaterialization(config: PluginConfig, operationId: string): PluginConfig;
|
|
137
|
+
declare function abandonLlmMaterialization(config: PluginConfig, operationId: string): PluginConfig;
|
|
138
|
+
declare function beginOnboardingSave(config: PluginConfig, input: BeginOnboardingSaveInput): PluginConfig;
|
|
139
|
+
/** Marks a confirmed Host Credential write without storing any Credential data. */
|
|
140
|
+
declare function markOnboardingCredentialSaved(config: PluginConfig, operationId: string, confirmedCredentialRevision: string): PluginConfig;
|
|
141
|
+
/**
|
|
142
|
+
* Completes the idempotent Settings half of onboarding after Credential write
|
|
143
|
+
* confirmation. Calling it again with no recovery marker is intentionally a
|
|
144
|
+
* no-op so crash recovery can safely replay the Settings commit.
|
|
145
|
+
*/
|
|
146
|
+
declare function completeOnboardingSave(config: PluginConfig, operationId: string): PluginConfig;
|
|
147
|
+
declare function deferOnboarding(config: PluginConfig, intendedServices?: ServiceToggles): PluginConfig;
|
|
148
|
+
/**
|
|
149
|
+
* Determines the safe restart action from descriptor revision only. A missing
|
|
150
|
+
* revision is deliberately ambiguous and requires user reconciliation; it is
|
|
151
|
+
* never treated as proof that a Credential write failed.
|
|
152
|
+
*/
|
|
153
|
+
declare function reconcileOnboardingSave(config: PluginConfig, currentCredentialRevision: string | null): OnboardingRecoveryDecision;
|
|
154
|
+
declare function advanceCredentialEpoch(config: PluginConfig): PluginConfig;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/core/credential-state.d.ts
|
|
157
|
+
type CredentialSource = "local" | "env" | null;
|
|
158
|
+
type CredentialVerification = "unknown" | "unverified" | "valid" | "invalid";
|
|
159
|
+
interface CredentialDescriptor {
|
|
160
|
+
readonly configured: boolean;
|
|
161
|
+
readonly source: CredentialSource;
|
|
162
|
+
readonly writable: boolean;
|
|
163
|
+
/** Opaque Host descriptor revision. It must never be derived from the Key. */
|
|
164
|
+
readonly revision: string | null;
|
|
165
|
+
/** Plugin-owned monotonic generation used to reject stale results. */
|
|
166
|
+
readonly credentialEpoch: number;
|
|
167
|
+
}
|
|
168
|
+
interface InvalidCredentialEpoch {
|
|
169
|
+
readonly credentialEpoch: number;
|
|
170
|
+
readonly openedAt: number;
|
|
171
|
+
}
|
|
172
|
+
interface CredentialState {
|
|
173
|
+
readonly descriptor: CredentialDescriptor;
|
|
174
|
+
readonly verification: CredentialVerification;
|
|
175
|
+
readonly invalidEpoch: InvalidCredentialEpoch | null;
|
|
176
|
+
}
|
|
177
|
+
interface UnauthorizedTransition {
|
|
178
|
+
readonly state: CredentialState;
|
|
179
|
+
readonly stale: boolean;
|
|
180
|
+
readonly shouldOpenModal: boolean;
|
|
181
|
+
}
|
|
182
|
+
interface VerificationTransition {
|
|
183
|
+
readonly state: CredentialState;
|
|
184
|
+
readonly stale: boolean;
|
|
185
|
+
}
|
|
186
|
+
interface CredentialMutationResult<T> {
|
|
187
|
+
readonly value: T;
|
|
188
|
+
readonly previousEpoch: number;
|
|
189
|
+
readonly credentialEpoch: number;
|
|
190
|
+
}
|
|
191
|
+
declare class CredentialEpochConflictError extends Error {
|
|
192
|
+
readonly expectedEpoch: number;
|
|
193
|
+
readonly actualEpoch: number;
|
|
194
|
+
constructor(expectedEpoch: number, actualEpoch: number);
|
|
195
|
+
}
|
|
196
|
+
declare function createCredentialState(descriptor?: CredentialDescriptor): CredentialState;
|
|
197
|
+
declare function missingCredentialDescriptor(credentialEpoch: number, writable?: boolean): CredentialDescriptor;
|
|
198
|
+
declare function normalizeCredentialDescriptor(descriptor: CredentialDescriptor): CredentialDescriptor;
|
|
199
|
+
/**
|
|
200
|
+
* Applies a Host descriptor read. A changed revision or plugin epoch invalidates
|
|
201
|
+
* earlier verification, while a same-revision refresh preserves it.
|
|
202
|
+
*/
|
|
203
|
+
declare function applyCredentialDescriptor(state: CredentialState, descriptor: CredentialDescriptor): CredentialState;
|
|
204
|
+
declare function applyVerificationResult(state: CredentialState, capturedCredentialEpoch: number, verification: "valid" | "invalid"): VerificationTransition;
|
|
205
|
+
/**
|
|
206
|
+
* A transient validation/network failure is intentionally a no-op. It must not
|
|
207
|
+
* downgrade a previously valid Credential to invalid.
|
|
208
|
+
*/
|
|
209
|
+
declare function preserveVerificationAfterTransientFailure(state: CredentialState, capturedCredentialEpoch: number): VerificationTransition;
|
|
210
|
+
/**
|
|
211
|
+
* Applies only an explicit customer-Credential 401. Concurrent responses from
|
|
212
|
+
* the same epoch share one invalid epoch and request one Modal at most.
|
|
213
|
+
*/
|
|
214
|
+
declare function applyRuntimeUnauthorized(state: CredentialState, capturedCredentialEpoch: number, occurredAt: number): UnauthorizedTransition;
|
|
215
|
+
/** Candidate validation never mutates the currently stored Credential state. */
|
|
216
|
+
declare function preserveStoredCredentialAfterCandidateFailure(state: CredentialState): CredentialState;
|
|
217
|
+
/**
|
|
218
|
+
* Serializes Host Credential set/unset calls and performs plugin epoch CAS.
|
|
219
|
+
* The operation closure may temporarily own a candidate Key, but the
|
|
220
|
+
* coordinator never receives, records, stringifies, or exposes that value.
|
|
221
|
+
*/
|
|
222
|
+
declare class CredentialMutationCoordinator {
|
|
223
|
+
#private;
|
|
224
|
+
constructor(initialCredentialEpoch: number);
|
|
225
|
+
get credentialEpoch(): number;
|
|
226
|
+
run<T>(expectedCredentialEpoch: number, operation: () => Promise<T>): Promise<CredentialMutationResult<T>>;
|
|
227
|
+
/** Advances an idle coordinator after persisted crash recovery. */
|
|
228
|
+
synchronizeRecoveredEpoch(credentialEpoch: number): void;
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/core/errors.d.ts
|
|
232
|
+
type ModellixService = "design" | "llm" | "web";
|
|
233
|
+
type ModellixErrorCode = "MODELLIX_CANDIDATE_KEY_INVALID" | "MODELLIX_API_KEY_INVALID" | "MODELLIX_BILLING_BLOCKED" | "MODELLIX_POLICY_BLOCKED" | "MODELLIX_RESOURCE_NOT_FOUND" | "MODELLIX_RATE_LIMITED" | "MODELLIX_CANCELED" | "MODELLIX_OFFLINE" | "MODELLIX_TIMEOUT" | "MODELLIX_SERVER_ERROR" | "MODELLIX_BAD_REQUEST" | "MODELLIX_SUBMIT_UNKNOWN" | "MODELLIX_ASSET_EXPIRED" | "MODELLIX_UNEXPECTED_RESPONSE";
|
|
234
|
+
interface ModellixErrorContext {
|
|
235
|
+
readonly service: ModellixService;
|
|
236
|
+
readonly subsystem: string;
|
|
237
|
+
readonly operation: string;
|
|
238
|
+
readonly credentialEpoch?: number;
|
|
239
|
+
readonly requestId?: string | null;
|
|
240
|
+
readonly taskId?: string | null;
|
|
241
|
+
}
|
|
242
|
+
type ModellixFailure = {
|
|
243
|
+
readonly kind: "http";
|
|
244
|
+
readonly status: number;
|
|
245
|
+
readonly requestId?: string | null;
|
|
246
|
+
readonly retryAfterMs?: number | null;
|
|
247
|
+
} | {
|
|
248
|
+
readonly kind: "network";
|
|
249
|
+
} | {
|
|
250
|
+
readonly kind: "timeout";
|
|
251
|
+
} | {
|
|
252
|
+
readonly kind: "abort";
|
|
253
|
+
} | {
|
|
254
|
+
readonly kind: "candidate-invalid";
|
|
255
|
+
} | {
|
|
256
|
+
readonly kind: "submit-unknown";
|
|
257
|
+
} | {
|
|
258
|
+
readonly kind: "asset-expired";
|
|
259
|
+
} | {
|
|
260
|
+
readonly kind: "unexpected-response";
|
|
261
|
+
};
|
|
262
|
+
interface ModellixErrorContract {
|
|
263
|
+
readonly version: 1;
|
|
264
|
+
readonly service: ModellixService;
|
|
265
|
+
readonly subsystem: string;
|
|
266
|
+
readonly operation: string;
|
|
267
|
+
readonly code: ModellixErrorCode;
|
|
268
|
+
readonly httpStatus: number | null;
|
|
269
|
+
readonly retryable: boolean;
|
|
270
|
+
readonly credentialEpoch: number | null;
|
|
271
|
+
readonly requestId: string | null;
|
|
272
|
+
readonly taskId: string | null;
|
|
273
|
+
readonly retryAfterMs: number | null;
|
|
274
|
+
readonly messageKey: string;
|
|
275
|
+
}
|
|
276
|
+
declare function toModellixError(context: ModellixErrorContext, failure: ModellixFailure): ModellixErrorContract;
|
|
277
|
+
declare function isCredentialInvalidError(error: ModellixErrorContract): boolean;
|
|
278
|
+
declare function isRetryableError(error: ModellixErrorContract): boolean;
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/core/http.d.ts
|
|
281
|
+
declare const MODELLIX_ORIGINS: Readonly<{
|
|
282
|
+
prediction: "https://api.modellix.ai";
|
|
283
|
+
llm: "https://llm.modellix.ai";
|
|
284
|
+
webTools: "https://tool.modellix.ai";
|
|
285
|
+
publicSchema: "https://www.modellix.ai";
|
|
286
|
+
}>;
|
|
287
|
+
type ModellixOriginName = keyof typeof MODELLIX_ORIGINS;
|
|
288
|
+
type HttpMethod = "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
289
|
+
interface HttpRequestPolicyInput {
|
|
290
|
+
readonly url: string | URL;
|
|
291
|
+
readonly method: HttpMethod;
|
|
292
|
+
readonly hasAuthorization: boolean;
|
|
293
|
+
}
|
|
294
|
+
interface ApprovedHttpRequest {
|
|
295
|
+
readonly url: URL;
|
|
296
|
+
readonly originName: ModellixOriginName;
|
|
297
|
+
readonly method: HttpMethod;
|
|
298
|
+
readonly authorizationAllowed: boolean;
|
|
299
|
+
}
|
|
300
|
+
interface RequestDeadline {
|
|
301
|
+
readonly signal: AbortSignal;
|
|
302
|
+
readonly timedOut: () => boolean;
|
|
303
|
+
}
|
|
304
|
+
/** Combines a caller cancellation signal with an operation-owned deadline. */
|
|
305
|
+
declare function requestDeadline(callerSignal: AbortSignal | undefined, timeoutMs: number): RequestDeadline;
|
|
306
|
+
declare class HttpPolicyError extends Error {
|
|
307
|
+
readonly code: "INVALID_URL" | "ORIGIN_NOT_ALLOWED" | "USERINFO_NOT_ALLOWED" | "FRAGMENT_NOT_ALLOWED" | "AUTHORIZATION_NOT_ALLOWED" | "METHOD_NOT_ALLOWED" | "REDIRECT_NOT_ALLOWED";
|
|
308
|
+
constructor(code: HttpPolicyError["code"], message: string);
|
|
309
|
+
}
|
|
310
|
+
declare class HttpResponseBoundaryError extends Error {
|
|
311
|
+
readonly code: "BODY_MISSING" | "BODY_TOO_LARGE" | "INVALID_ENCODING" | "INVALID_JSON";
|
|
312
|
+
constructor(code: HttpResponseBoundaryError["code"], message: string, options?: ErrorOptions);
|
|
313
|
+
}
|
|
314
|
+
/** Reads a response incrementally so a hostile Content-Length cannot allocate an unbounded body. */
|
|
315
|
+
declare function readBoundedResponseText(response: Response, maximumBytes: number, signal?: AbortSignal): Promise<string>;
|
|
316
|
+
declare function readBoundedResponseJson(response: Response, maximumBytes: number, signal?: AbortSignal): Promise<unknown>;
|
|
317
|
+
/**
|
|
318
|
+
* Applies the shared origin boundary. Model-specific endpoint/path validation is
|
|
319
|
+
* intentionally an additional Design-layer policy and must run before submit.
|
|
320
|
+
*/
|
|
321
|
+
declare function approveHttpRequest(input: HttpRequestPolicyInput): ApprovedHttpRequest;
|
|
322
|
+
/**
|
|
323
|
+
* Redirects are manual and same-origin only. This remains true for public
|
|
324
|
+
* no-credential GETs so an upstream response cannot widen the allowlist.
|
|
325
|
+
*/
|
|
326
|
+
declare function approveRedirect(from: string | URL, to: string | URL, request: Pick<HttpRequestPolicyInput, "method" | "hasAuthorization">): ApprovedHttpRequest;
|
|
327
|
+
declare function isAllowedModellixOrigin(value: string | URL): boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Rejects literal private/reserved addresses and local-only DNS suffixes at a
|
|
330
|
+
* trust boundary. Remote fetch services must still repeat this check after DNS
|
|
331
|
+
* resolution and for every redirect to prevent DNS rebinding.
|
|
332
|
+
*/
|
|
333
|
+
declare function isPublicHostname(value: string): boolean;
|
|
334
|
+
interface HttpRetryFailure {
|
|
335
|
+
readonly kind: "network" | "http" | "abort";
|
|
336
|
+
readonly status?: number;
|
|
337
|
+
readonly retryAfterMs?: number | null;
|
|
338
|
+
}
|
|
339
|
+
interface RetryOptions<E> {
|
|
340
|
+
readonly method: HttpMethod;
|
|
341
|
+
readonly maxRetries: number;
|
|
342
|
+
readonly baseDelayMs?: number;
|
|
343
|
+
readonly maxDelayMs?: number;
|
|
344
|
+
readonly jitterRatio?: number;
|
|
345
|
+
readonly shouldRetry: (error: E) => boolean;
|
|
346
|
+
readonly retryAfterMs?: (error: E) => number | null;
|
|
347
|
+
readonly sleep?: (delayMs: number) => Promise<void>;
|
|
348
|
+
readonly random?: () => number;
|
|
349
|
+
}
|
|
350
|
+
interface RetrySuccess<T> {
|
|
351
|
+
readonly value: T;
|
|
352
|
+
readonly attempts: number;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Generic bounded retry executor. Unsafe methods are structurally prevented
|
|
356
|
+
* from receiving retries; callers must perform a new explicit user action.
|
|
357
|
+
*/
|
|
358
|
+
declare function executeWithRetry<T, E = unknown>(operation: (attempt: number) => Promise<T>, options: RetryOptions<E>): Promise<RetrySuccess<T>>;
|
|
359
|
+
declare function isRetryableReadFailure(failure: HttpRetryFailure): boolean;
|
|
360
|
+
declare function retryAfterFromFailure(failure: HttpRetryFailure): number | null;
|
|
361
|
+
interface RetryDelayInput {
|
|
362
|
+
readonly retryIndex: number;
|
|
363
|
+
readonly baseDelayMs: number;
|
|
364
|
+
readonly maxDelayMs: number;
|
|
365
|
+
readonly jitterRatio: number;
|
|
366
|
+
readonly retryAfterMs: number | null;
|
|
367
|
+
/** A deterministic value in [0, 1], injectable for tests. */
|
|
368
|
+
readonly random: number;
|
|
369
|
+
}
|
|
370
|
+
declare function computeRetryDelay(input: RetryDelayInput): number;
|
|
371
|
+
/** Supports Retry-After delta-seconds and IMF-fixdate. */
|
|
372
|
+
declare function parseRetryAfter(value: string | null | undefined, nowMs: number, maximumMs?: number): number | null;
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/core/identity.d.ts
|
|
375
|
+
declare function deriveModellixUserId(harnessAnonymousId: string): string;
|
|
376
|
+
declare function deriveModellixSessionId(harnessSessionId: string): string;
|
|
377
|
+
declare function isValidModellixIdentity(value: string): boolean;
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/core/redaction.d.ts
|
|
380
|
+
declare const REDACTED: "[REDACTED]";
|
|
381
|
+
type HeaderValue = string | readonly string[] | undefined;
|
|
382
|
+
type HeaderRecord = Readonly<Record<string, HeaderValue>>;
|
|
383
|
+
type RedactedValue = null | boolean | number | string | readonly RedactedValue[] | {
|
|
384
|
+
readonly [key: string]: RedactedValue;
|
|
385
|
+
};
|
|
386
|
+
declare function redactHeaders(headers: HeaderRecord): Record<string, string | string[]>;
|
|
387
|
+
/** Removes the complete query and fragment; signed media URLs are never logged. */
|
|
388
|
+
declare function redactUrl(value: string | URL): string;
|
|
389
|
+
/**
|
|
390
|
+
* Produces bounded log metadata. Secret-shaped fields are removed by name,
|
|
391
|
+
* URL queries are stripped, Error messages/stacks are never copied, and cycles
|
|
392
|
+
* are represented without traversing indefinitely.
|
|
393
|
+
*/
|
|
394
|
+
declare function redactForLog(value: unknown, options?: {
|
|
395
|
+
readonly maxDepth?: number;
|
|
396
|
+
readonly maxEntries?: number;
|
|
397
|
+
}): RedactedValue;
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/design/ports.d.ts
|
|
400
|
+
type FetchPort = (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
401
|
+
interface ClockPort {
|
|
402
|
+
now(): number;
|
|
403
|
+
}
|
|
404
|
+
interface SleepPort {
|
|
405
|
+
sleep(delayMs: number): Promise<void>;
|
|
406
|
+
}
|
|
407
|
+
interface CacheEntry<T> {
|
|
408
|
+
readonly value: T;
|
|
409
|
+
readonly expiresAt: number;
|
|
410
|
+
}
|
|
411
|
+
interface CachePort {
|
|
412
|
+
read<T>(key: string): Promise<CacheEntry<T> | null>;
|
|
413
|
+
write<T>(key: string, entry: CacheEntry<T>): Promise<void>;
|
|
414
|
+
}
|
|
415
|
+
interface StoragePort {
|
|
416
|
+
read(key: string): Promise<string | null>;
|
|
417
|
+
write(key: string, value: string): Promise<void>;
|
|
418
|
+
}
|
|
419
|
+
type DesignLogLevel = "info" | "warn";
|
|
420
|
+
/**
|
|
421
|
+
* Design modules only emit bounded identifiers and counters. Request bodies,
|
|
422
|
+
* prompts, API keys, signed resource URLs, and thrown Error objects are never
|
|
423
|
+
* part of this contract.
|
|
424
|
+
*/
|
|
425
|
+
interface DesignLogEvent {
|
|
426
|
+
readonly level: DesignLogLevel;
|
|
427
|
+
readonly event: string;
|
|
428
|
+
readonly operation: string;
|
|
429
|
+
readonly status?: number;
|
|
430
|
+
readonly attempt?: number;
|
|
431
|
+
readonly taskId?: string;
|
|
432
|
+
readonly requestId?: string;
|
|
433
|
+
readonly model?: string;
|
|
434
|
+
}
|
|
435
|
+
interface LoggerPort {
|
|
436
|
+
write(event: DesignLogEvent): void;
|
|
437
|
+
}
|
|
438
|
+
declare const systemClock: ClockPort;
|
|
439
|
+
declare const systemSleep: SleepPort;
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/design/catalog.d.ts
|
|
442
|
+
declare const AUTHENTICATED_CATALOG_URL = "https://api.modellix.ai/api/v1/models";
|
|
443
|
+
declare const PUBLIC_PORTAL_CATALOG_URL = "https://www.modellix.ai/portal/v1/models";
|
|
444
|
+
type DesignMediaCategory = "image" | "video" | "audio";
|
|
445
|
+
interface ModelCatalogQuery {
|
|
446
|
+
readonly category: DesignMediaCategory;
|
|
447
|
+
readonly page?: number;
|
|
448
|
+
readonly pageSize?: number;
|
|
449
|
+
readonly featured?: boolean;
|
|
450
|
+
}
|
|
451
|
+
interface DesignModelSummary {
|
|
452
|
+
readonly provider: string;
|
|
453
|
+
readonly modelId: string;
|
|
454
|
+
readonly slug: string;
|
|
455
|
+
readonly displayName: string;
|
|
456
|
+
readonly categories: readonly DesignMediaCategory[];
|
|
457
|
+
readonly description?: string;
|
|
458
|
+
readonly thumbnailUrl?: string;
|
|
459
|
+
}
|
|
460
|
+
interface ModelCatalogPage {
|
|
461
|
+
readonly items: readonly DesignModelSummary[];
|
|
462
|
+
readonly page: number;
|
|
463
|
+
readonly pageSize: number;
|
|
464
|
+
readonly total: number | null;
|
|
465
|
+
readonly hasMore: boolean;
|
|
466
|
+
readonly source: "authenticated-api" | "public-portal";
|
|
467
|
+
}
|
|
468
|
+
interface ModelCatalogClientOptions {
|
|
469
|
+
readonly fetch: FetchPort;
|
|
470
|
+
/** Resolved for each uncached primary request so credential rotation is seen. */
|
|
471
|
+
readonly getApiKey?: () => string | null | Promise<string | null>;
|
|
472
|
+
/** Public no-credential fallback is disabled unless explicitly enabled. */
|
|
473
|
+
readonly allowPublicPortalFallback?: boolean;
|
|
474
|
+
readonly cache?: CachePort;
|
|
475
|
+
readonly cacheTtlMs?: number;
|
|
476
|
+
readonly clock?: ClockPort;
|
|
477
|
+
readonly requestTimeoutMs?: number;
|
|
478
|
+
}
|
|
479
|
+
declare class ModelCatalogClient {
|
|
480
|
+
#private;
|
|
481
|
+
constructor(options: ModelCatalogClientOptions);
|
|
482
|
+
list(query: ModelCatalogQuery, signal?: AbortSignal): Promise<ModelCatalogPage>;
|
|
483
|
+
}
|
|
484
|
+
declare function parseCatalogPage(payload: unknown, query: Required<Pick<ModelCatalogQuery, "category" | "page" | "pageSize">>, source: ModelCatalogPage["source"]): ModelCatalogPage;
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/design/errors.d.ts
|
|
487
|
+
type DesignErrorCode = "INVALID_ARGUMENT" | "MISSING_API_KEY" | "CATALOG_UNAVAILABLE" | "SCHEMA_UNAVAILABLE" | "SCHEMA_INVALID" | "ENDPOINT_NOT_ALLOWED" | "PARAMETER_INVALID" | "SUBMIT_REJECTED" | "SUBMIT_UNKNOWN" | "TASK_READ_FAILED" | "UNEXPECTED_RESPONSE" | "STORAGE_INVALID" | "PLANNER_UNAUTHORIZED" | "PLANNER_BILLING_BLOCKED" | "PLANNER_FORBIDDEN" | "PLANNER_RATE_LIMITED" | "PLANNER_REJECTED" | "PLANNER_UNAVAILABLE" | "PLANNER_TIMEOUT" | "PLANNER_ABORTED" | "PLANNER_RESPONSE_INVALID";
|
|
488
|
+
declare class DesignError extends Error {
|
|
489
|
+
readonly code: DesignErrorCode;
|
|
490
|
+
readonly status: number | null;
|
|
491
|
+
readonly retryAfterMs: number | null;
|
|
492
|
+
constructor(code: DesignErrorCode, message: string, options?: {
|
|
493
|
+
readonly status?: number;
|
|
494
|
+
readonly retryAfterMs?: number | null;
|
|
495
|
+
readonly cause?: unknown;
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/design/model-schema.d.ts
|
|
500
|
+
interface ModelSchemaDocument {
|
|
501
|
+
readonly provider: string;
|
|
502
|
+
readonly modelId: string;
|
|
503
|
+
readonly source: "public-api-schema" | "portal-detail";
|
|
504
|
+
readonly document: Readonly<Record<string, unknown>>;
|
|
505
|
+
/** Null for portal metadata because it is not authoritative for submission. */
|
|
506
|
+
readonly submitUrl: string | null;
|
|
507
|
+
}
|
|
508
|
+
interface ModelSchemaClientOptions {
|
|
509
|
+
readonly fetch: FetchPort;
|
|
510
|
+
readonly allowPortalDetailFallback?: boolean;
|
|
511
|
+
readonly requestTimeoutMs?: number;
|
|
512
|
+
}
|
|
513
|
+
declare class ModelSchemaClient {
|
|
514
|
+
#private;
|
|
515
|
+
constructor(options: ModelSchemaClientOptions);
|
|
516
|
+
load(provider: string, modelId: string, signal?: AbortSignal): Promise<ModelSchemaDocument>;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Submission is allowed only for the exact endpoint published by api_schema.
|
|
520
|
+
* The path is independently bound to the requested provider/model and aliases
|
|
521
|
+
* such as `/async`, query strings, fragments, userinfo, and redirects fail shut.
|
|
522
|
+
*/
|
|
523
|
+
declare function extractAllowedSubmitUrl(document: Readonly<Record<string, unknown>>, provider: string, modelId: string): string;
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region src/design/schema-ir.d.ts
|
|
526
|
+
type JsonPrimitive = null | boolean | number | string;
|
|
527
|
+
type JsonValue = JsonPrimitive | readonly JsonValue[] | {
|
|
528
|
+
readonly [key: string]: JsonValue;
|
|
529
|
+
};
|
|
530
|
+
type UiFieldKind = "string" | "number" | "integer" | "boolean" | "object" | "array" | "media" | "unknown";
|
|
531
|
+
type UiMediaKind = "image" | "video" | "audio";
|
|
532
|
+
interface UiConstraints {
|
|
533
|
+
readonly minimum: number | null;
|
|
534
|
+
readonly maximum: number | null;
|
|
535
|
+
readonly exclusiveMinimum: number | null;
|
|
536
|
+
readonly exclusiveMaximum: number | null;
|
|
537
|
+
readonly minLength: number | null;
|
|
538
|
+
readonly maxLength: number | null;
|
|
539
|
+
readonly minItems: number | null;
|
|
540
|
+
readonly maxItems: number | null;
|
|
541
|
+
readonly pattern: string | null;
|
|
542
|
+
}
|
|
543
|
+
interface UiVariant {
|
|
544
|
+
readonly combinator: "oneOf" | "anyOf";
|
|
545
|
+
readonly title: string;
|
|
546
|
+
readonly field: UiField;
|
|
547
|
+
}
|
|
548
|
+
interface UiField {
|
|
549
|
+
/** RFC 6901 pointer relative to the JSON request body. */
|
|
550
|
+
readonly path: string;
|
|
551
|
+
readonly key: string;
|
|
552
|
+
readonly title: string;
|
|
553
|
+
readonly description: string | null;
|
|
554
|
+
readonly kind: UiFieldKind;
|
|
555
|
+
readonly required: boolean;
|
|
556
|
+
readonly nullable: boolean;
|
|
557
|
+
readonly hasDefault: boolean;
|
|
558
|
+
readonly defaultValue: JsonValue | undefined;
|
|
559
|
+
readonly enumValues: readonly JsonValue[];
|
|
560
|
+
readonly hasConst: boolean;
|
|
561
|
+
readonly constValue: JsonValue | undefined;
|
|
562
|
+
readonly constraints: UiConstraints;
|
|
563
|
+
readonly mediaKind: UiMediaKind | null;
|
|
564
|
+
readonly properties: readonly UiField[];
|
|
565
|
+
readonly item: UiField | null;
|
|
566
|
+
readonly variants: readonly UiVariant[];
|
|
567
|
+
}
|
|
568
|
+
interface SchemaDiagnostic {
|
|
569
|
+
readonly code: "BODY_NOT_FOUND" | "MULTIPLE_POST_OPERATIONS" | "REF_INVALID" | "REF_NOT_FOUND" | "REF_CYCLE" | "BUDGET_EXCEEDED" | "SCHEMA_CONFLICT" | "UNSUPPORTED_KEYWORD" | "INVALID_KEYWORD";
|
|
570
|
+
readonly path: string;
|
|
571
|
+
readonly keyword: string | null;
|
|
572
|
+
readonly blocking: boolean;
|
|
573
|
+
readonly message: string;
|
|
574
|
+
}
|
|
575
|
+
interface DesignSchemaIR {
|
|
576
|
+
readonly version: 1;
|
|
577
|
+
readonly method: "POST";
|
|
578
|
+
readonly operationPath: string | null;
|
|
579
|
+
readonly fields: readonly UiField[];
|
|
580
|
+
readonly primaryPromptPath: string | null;
|
|
581
|
+
readonly schemaHash: string;
|
|
582
|
+
readonly diagnostics: readonly SchemaDiagnostic[];
|
|
583
|
+
readonly supported: boolean;
|
|
584
|
+
}
|
|
585
|
+
interface SchemaParserLimits {
|
|
586
|
+
readonly maxBytes?: number;
|
|
587
|
+
readonly maxDepth?: number;
|
|
588
|
+
readonly maxNodes?: number;
|
|
589
|
+
readonly maxRefDepth?: number;
|
|
590
|
+
}
|
|
591
|
+
declare function parseDesignSchema(input: unknown, limits?: SchemaParserLimits): DesignSchemaIR;
|
|
592
|
+
//#endregion
|
|
593
|
+
//#region src/design/parameter-planner.d.ts
|
|
594
|
+
interface ExactParameterPatch {
|
|
595
|
+
readonly set?: Readonly<Record<string, unknown>>;
|
|
596
|
+
readonly unset?: readonly string[];
|
|
597
|
+
}
|
|
598
|
+
interface NaturalLanguagePlan {
|
|
599
|
+
readonly parameters: Readonly<Record<string, JsonValue>>;
|
|
600
|
+
readonly appliedPaths: readonly string[];
|
|
601
|
+
readonly ignoredAssignments: readonly string[];
|
|
602
|
+
}
|
|
603
|
+
/** Materializes only schema-declared defaults/const values and required objects. */
|
|
604
|
+
declare function materializeDefaults(schema: DesignSchemaIR): Record<string, JsonValue>;
|
|
605
|
+
/**
|
|
606
|
+
* Applies exact RFC 6901 field paths. Unknown paths and invalid values fail
|
|
607
|
+
* closed; no field names are synthesized from the patch.
|
|
608
|
+
*/
|
|
609
|
+
declare function applyExactPatch(schema: DesignSchemaIR, current: Readonly<Record<string, JsonValue>>, patch: ExactParameterPatch): Record<string, JsonValue>;
|
|
610
|
+
/**
|
|
611
|
+
* Natural language is deliberately conservative: plain text updates only the
|
|
612
|
+
* primary prompt, while other fields require an exact `field=value` or
|
|
613
|
+
* `field: value` assignment separated by a newline or semicolon.
|
|
614
|
+
*/
|
|
615
|
+
declare function applyNaturalLanguage(schema: DesignSchemaIR, current: Readonly<Record<string, JsonValue>>, instruction: string): NaturalLanguagePlan;
|
|
616
|
+
/**
|
|
617
|
+
* Builds the paid-call JSON body from schema defaults plus caller values and
|
|
618
|
+
* verifies every required/nested field immediately before submission.
|
|
619
|
+
*/
|
|
620
|
+
declare function buildInvocationBody(schema: DesignSchemaIR, values?: Readonly<Record<string, unknown>>): Record<string, JsonValue>;
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/design/planner-client.d.ts
|
|
623
|
+
declare const DESIGN_PLANNER_ENDPOINT = "https://llm.modellix.ai/v1/chat/completions";
|
|
624
|
+
declare const DESIGN_PLANNER_MODEL = "openai/gpt-5.6-luna";
|
|
625
|
+
interface DesignPlannerRequest {
|
|
626
|
+
readonly apiKey: string;
|
|
627
|
+
readonly schema: DesignSchemaIR;
|
|
628
|
+
readonly current: Readonly<Record<string, JsonValue>>;
|
|
629
|
+
readonly instruction: string;
|
|
630
|
+
readonly signal?: AbortSignal;
|
|
631
|
+
}
|
|
632
|
+
interface DesignPlannerResult {
|
|
633
|
+
readonly patch: ExactParameterPatch;
|
|
634
|
+
readonly parameters: Readonly<Record<string, JsonValue>>;
|
|
635
|
+
readonly needsClarification: string | null;
|
|
636
|
+
}
|
|
637
|
+
interface DesignPlannerClientOptions {
|
|
638
|
+
readonly fetch?: FetchPort;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Executes one explicitly requested, non-streaming Host-only LLM plan. The
|
|
642
|
+
* response is untrusted until every path and value passes applyExactPatch.
|
|
643
|
+
*/
|
|
644
|
+
declare class DesignPlannerClient {
|
|
645
|
+
#private;
|
|
646
|
+
constructor(options?: DesignPlannerClientOptions);
|
|
647
|
+
plan(request: DesignPlannerRequest): Promise<DesignPlannerResult>;
|
|
648
|
+
}
|
|
649
|
+
//#endregion
|
|
650
|
+
//#region src/design/prediction-client.d.ts
|
|
651
|
+
type PredictionTaskStatus = "queued" | "running" | "succeeded" | "failed" | "canceled" | "unknown";
|
|
652
|
+
interface PredictionResource {
|
|
653
|
+
readonly kind: "image" | "video" | "audio";
|
|
654
|
+
readonly url: string;
|
|
655
|
+
readonly mimeType: string | null;
|
|
656
|
+
readonly expiresAt: number | null;
|
|
657
|
+
}
|
|
658
|
+
interface PredictionTask {
|
|
659
|
+
readonly taskId: string;
|
|
660
|
+
readonly status: PredictionTaskStatus;
|
|
661
|
+
readonly resources: readonly PredictionResource[];
|
|
662
|
+
readonly createdAt: number | null;
|
|
663
|
+
readonly completedAt: number | null;
|
|
664
|
+
readonly expiresAt: number | null;
|
|
665
|
+
}
|
|
666
|
+
interface PredictionClientOptions {
|
|
667
|
+
readonly fetch: FetchPort;
|
|
668
|
+
readonly clock?: ClockPort;
|
|
669
|
+
readonly sleep?: SleepPort;
|
|
670
|
+
readonly logger?: LoggerPort;
|
|
671
|
+
readonly requestTimeoutMs?: number;
|
|
672
|
+
}
|
|
673
|
+
interface SubmitPredictionInput {
|
|
674
|
+
/** Authoritative servers[0].url returned by the public api_schema. */
|
|
675
|
+
readonly endpoint: string;
|
|
676
|
+
/** Used only to bind endpoint path; it is never used to construct the URL. */
|
|
677
|
+
readonly modelSlug: string;
|
|
678
|
+
readonly apiKey: string;
|
|
679
|
+
readonly body: Readonly<Record<string, JsonValue>>;
|
|
680
|
+
readonly requestId?: string;
|
|
681
|
+
readonly signal?: AbortSignal;
|
|
682
|
+
}
|
|
683
|
+
interface ReadPredictionInput {
|
|
684
|
+
readonly taskId: string;
|
|
685
|
+
readonly apiKey: string;
|
|
686
|
+
readonly maxAttempts?: number;
|
|
687
|
+
readonly signal?: AbortSignal;
|
|
688
|
+
}
|
|
689
|
+
declare class PredictionClient {
|
|
690
|
+
#private;
|
|
691
|
+
constructor(options: PredictionClientOptions);
|
|
692
|
+
/** A paid POST is attempted exactly once and never follows redirects. */
|
|
693
|
+
submit(input: SubmitPredictionInput): Promise<PredictionTask>;
|
|
694
|
+
/** GET retries only transient read failures and is capped at five attempts. */
|
|
695
|
+
readTask(input: ReadPredictionInput): Promise<PredictionTask>;
|
|
696
|
+
}
|
|
697
|
+
declare function validateSubmitEndpoint(endpoint: string, modelSlug: string): URL;
|
|
698
|
+
declare function parsePredictionTask(payload: unknown, expectedTaskId?: string): PredictionTask | null;
|
|
699
|
+
declare function parseResources(value: unknown, inheritedExpiresAt?: number | null): PredictionResource[];
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region src/design/task-wal.d.ts
|
|
702
|
+
declare const DEFAULT_RESULT_TTL_MS: number;
|
|
703
|
+
declare const DEFAULT_DESIGN_WAL_KEY = "modellix.design.task-wal.v1";
|
|
704
|
+
type DesignTaskState = "submitting" | "submit-unknown" | PredictionTaskStatus;
|
|
705
|
+
interface DesignTaskRecord {
|
|
706
|
+
readonly requestId: string;
|
|
707
|
+
readonly modelSlug: string;
|
|
708
|
+
/** Credential generation that created the remote task; null only for legacy v1 records. */
|
|
709
|
+
readonly credentialEpoch: number | null;
|
|
710
|
+
readonly taskId: string | null;
|
|
711
|
+
readonly state: DesignTaskState;
|
|
712
|
+
readonly createdAt: number;
|
|
713
|
+
readonly updatedAt: number;
|
|
714
|
+
readonly completedAt: number | null;
|
|
715
|
+
readonly expiresAt: number | null;
|
|
716
|
+
readonly resources: readonly PredictionResource[];
|
|
717
|
+
readonly pollAttempt: number;
|
|
718
|
+
readonly nextPollAt: number;
|
|
719
|
+
readonly pollBlocked: boolean;
|
|
720
|
+
readonly pollDiagnostic: DesignPollDiagnosticCode | null;
|
|
721
|
+
}
|
|
722
|
+
type DesignPollDiagnosticCode = "credential-rejected" | "task-inaccessible" | "rate-limited" | "poll-unavailable" | "response-invalid";
|
|
723
|
+
interface AvailableDesignResult {
|
|
724
|
+
readonly requestId: string;
|
|
725
|
+
readonly taskId: string;
|
|
726
|
+
readonly modelSlug: string;
|
|
727
|
+
readonly kind: PredictionResource["kind"];
|
|
728
|
+
readonly url: string;
|
|
729
|
+
readonly mimeType: string | null;
|
|
730
|
+
readonly createdAt: number;
|
|
731
|
+
readonly expiresAt: number;
|
|
732
|
+
}
|
|
733
|
+
type DesignWalEvent = {
|
|
734
|
+
readonly type: "submit-intent";
|
|
735
|
+
readonly sequence: number;
|
|
736
|
+
readonly timestamp: number;
|
|
737
|
+
readonly requestId: string;
|
|
738
|
+
readonly modelSlug: string; /** Optional only so pre-0.1.0 WAL documents fail safe instead of becoming unreadable. */
|
|
739
|
+
readonly credentialEpoch?: number;
|
|
740
|
+
} | {
|
|
741
|
+
readonly type: "submit-unknown";
|
|
742
|
+
readonly sequence: number;
|
|
743
|
+
readonly timestamp: number;
|
|
744
|
+
readonly requestId: string;
|
|
745
|
+
} | {
|
|
746
|
+
readonly type: "submit-rejected";
|
|
747
|
+
readonly sequence: number;
|
|
748
|
+
readonly timestamp: number;
|
|
749
|
+
readonly requestId: string;
|
|
750
|
+
} | {
|
|
751
|
+
readonly type: "submit-accepted";
|
|
752
|
+
readonly sequence: number;
|
|
753
|
+
readonly timestamp: number;
|
|
754
|
+
readonly requestId: string;
|
|
755
|
+
readonly task: PredictionTask;
|
|
756
|
+
} | {
|
|
757
|
+
readonly type: "task-observed";
|
|
758
|
+
readonly sequence: number;
|
|
759
|
+
readonly timestamp: number;
|
|
760
|
+
readonly task: PredictionTask;
|
|
761
|
+
} | {
|
|
762
|
+
readonly type: "task-poll-failed";
|
|
763
|
+
readonly sequence: number;
|
|
764
|
+
readonly timestamp: number;
|
|
765
|
+
readonly taskId: string;
|
|
766
|
+
readonly attempt: number;
|
|
767
|
+
readonly nextPollAt: number;
|
|
768
|
+
readonly blocked: boolean;
|
|
769
|
+
readonly code: DesignPollDiagnosticCode;
|
|
770
|
+
};
|
|
771
|
+
interface DesignTaskRepositoryOptions {
|
|
772
|
+
readonly storage: StoragePort;
|
|
773
|
+
readonly clock?: ClockPort;
|
|
774
|
+
readonly key?: string;
|
|
775
|
+
readonly maxEvents?: number;
|
|
776
|
+
readonly maxBytes?: number;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Append-only logical WAL. Its closed event types intentionally have no place
|
|
780
|
+
* for API keys or prompts; only replay identifiers, task state, and result URLs
|
|
781
|
+
* can be persisted.
|
|
782
|
+
*/
|
|
783
|
+
declare class DesignTaskRepository {
|
|
784
|
+
#private;
|
|
785
|
+
constructor(options: DesignTaskRepositoryOptions);
|
|
786
|
+
recordSubmitIntent(requestId: string, modelSlug: string, credentialEpoch: number): Promise<void>;
|
|
787
|
+
markSubmitUnknown(requestId: string): Promise<void>;
|
|
788
|
+
markSubmitRejected(requestId: string): Promise<void>;
|
|
789
|
+
recordSubmitAccepted(requestId: string, task: PredictionTask): Promise<void>;
|
|
790
|
+
recordTaskObserved(task: PredictionTask): Promise<void>;
|
|
791
|
+
recordPollFailure(taskId: string, failure: {
|
|
792
|
+
readonly attempt: number;
|
|
793
|
+
readonly nextPollAt: number;
|
|
794
|
+
readonly blocked: boolean;
|
|
795
|
+
readonly code: DesignPollDiagnosticCode;
|
|
796
|
+
}): Promise<void>;
|
|
797
|
+
listTasks(): Promise<readonly DesignTaskRecord[]>;
|
|
798
|
+
listAvailableResults(): Promise<readonly AvailableDesignResult[]>;
|
|
799
|
+
}
|
|
800
|
+
declare function replayDesignWal(events: readonly DesignWalEvent[]): readonly DesignTaskRecord[];
|
|
801
|
+
declare function selectAvailableResults(records: readonly DesignTaskRecord[], nowMs: number): readonly AvailableDesignResult[];
|
|
802
|
+
//#endregion
|
|
803
|
+
//#region src/host/credential-broker.d.ts
|
|
804
|
+
interface HarnessCredentialInfo {
|
|
805
|
+
readonly configured: boolean;
|
|
806
|
+
readonly source?: string;
|
|
807
|
+
readonly writable: boolean;
|
|
808
|
+
}
|
|
809
|
+
interface HarnessCredentialPort {
|
|
810
|
+
resolve(ref: string): Promise<{
|
|
811
|
+
readonly value: string;
|
|
812
|
+
readonly source: string;
|
|
813
|
+
} | undefined>;
|
|
814
|
+
describe(ref: string): Promise<HarnessCredentialInfo>;
|
|
815
|
+
set(ref: string, value: string): Promise<void>;
|
|
816
|
+
unset(ref: string): Promise<void>;
|
|
817
|
+
}
|
|
818
|
+
declare class CredentialValidationError extends Error {
|
|
819
|
+
readonly contract: ModellixErrorContract;
|
|
820
|
+
constructor(contract: ModellixErrorContract);
|
|
821
|
+
}
|
|
822
|
+
interface CredentialBrokerOptions {
|
|
823
|
+
readonly credentials: HarnessCredentialPort;
|
|
824
|
+
readonly initialCredentialEpoch: number;
|
|
825
|
+
readonly fetch?: typeof fetch;
|
|
826
|
+
readonly now?: () => number;
|
|
827
|
+
readonly requestTimeoutMs?: number;
|
|
828
|
+
}
|
|
829
|
+
/** Host-only owner of candidate validation and serialized Credential writes. */
|
|
830
|
+
declare class CredentialBroker {
|
|
831
|
+
#private;
|
|
832
|
+
constructor(options: CredentialBrokerOptions);
|
|
833
|
+
get credentialEpoch(): number;
|
|
834
|
+
describe(): Promise<CredentialDescriptor>;
|
|
835
|
+
resolve(): Promise<{
|
|
836
|
+
readonly value: string;
|
|
837
|
+
readonly credentialEpoch: number;
|
|
838
|
+
} | undefined>;
|
|
839
|
+
validateCandidate(candidate: string, signal?: AbortSignal): Promise<void>;
|
|
840
|
+
set(candidate: string, expectedCredentialEpoch: number): Promise<CredentialMutationResult<void>>;
|
|
841
|
+
unset(expectedCredentialEpoch: number): Promise<CredentialMutationResult<void>>;
|
|
842
|
+
synchronizeRecoveredEpoch(credentialEpoch: number): void;
|
|
843
|
+
}
|
|
844
|
+
//#endregion
|
|
845
|
+
//#region src/shared/design-presentation-codes.d.ts
|
|
846
|
+
declare const DESIGN_NOTICE_CODES: readonly ["schema-unavailable", "schema-invalid", "catalog-stale", "catalog-unavailable", "credential-reloaded"];
|
|
847
|
+
type DesignNoticeCode = (typeof DESIGN_NOTICE_CODES)[number];
|
|
848
|
+
declare const DESIGN_MODEL_UNAVAILABLE_CODES: readonly ["removed-from-catalog"];
|
|
849
|
+
type DesignModelUnavailableCode = (typeof DESIGN_MODEL_UNAVAILABLE_CODES)[number];
|
|
850
|
+
declare const DESIGN_FIELD_DISABLED_CODES: readonly ["unsupported-schema-field"];
|
|
851
|
+
type DesignFieldDisabledCode = (typeof DESIGN_FIELD_DISABLED_CODES)[number];
|
|
852
|
+
declare const DESIGN_DIAGNOSTIC_CODES: readonly ["credential-changed", "submit-unknown", "generation-failed", "result-unavailable", "credential-rejected", "task-inaccessible", "rate-limited", "response-invalid", "poll-unavailable"];
|
|
853
|
+
type DesignDiagnosticCode = (typeof DESIGN_DIAGNOSTIC_CODES)[number];
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region src/host/design-controller.d.ts
|
|
856
|
+
interface CredentialSnapshot {
|
|
857
|
+
readonly value: string;
|
|
858
|
+
readonly credentialEpoch: number;
|
|
859
|
+
}
|
|
860
|
+
interface DesignHostControllerOptions {
|
|
861
|
+
readonly storage: StoragePort;
|
|
862
|
+
readonly resolveCredential: () => Promise<CredentialSnapshot | undefined>;
|
|
863
|
+
readonly isCredentialEpochCurrent: (credentialEpoch: number) => boolean;
|
|
864
|
+
readonly onUnauthorized: (credentialEpoch: number) => void | Promise<void>;
|
|
865
|
+
readonly isEnabled: () => boolean;
|
|
866
|
+
readonly getLastModel: () => string | null;
|
|
867
|
+
readonly rememberModel: (modelId: string) => Promise<void>;
|
|
868
|
+
readonly fetch?: typeof fetch;
|
|
869
|
+
readonly now?: () => number;
|
|
870
|
+
}
|
|
871
|
+
interface DesignModelWire {
|
|
872
|
+
readonly id: string;
|
|
873
|
+
readonly label: string;
|
|
874
|
+
readonly kind: "image" | "video" | "audio" | "unknown";
|
|
875
|
+
readonly featured: boolean;
|
|
876
|
+
readonly available: boolean;
|
|
877
|
+
readonly unavailableReason: DesignModelUnavailableCode | null;
|
|
878
|
+
}
|
|
879
|
+
interface DesignFieldWire {
|
|
880
|
+
readonly path: string;
|
|
881
|
+
readonly label: string;
|
|
882
|
+
readonly description: string | null;
|
|
883
|
+
readonly kind: "string" | "number" | "integer" | "boolean" | "enum" | "array" | "object" | "media";
|
|
884
|
+
readonly widget: "input" | "textarea" | "select" | "switch" | "json" | "media";
|
|
885
|
+
readonly required: boolean;
|
|
886
|
+
readonly options: readonly {
|
|
887
|
+
readonly label: string;
|
|
888
|
+
readonly value: string | number | boolean;
|
|
889
|
+
}[];
|
|
890
|
+
readonly minimum: number | null;
|
|
891
|
+
readonly maximum: number | null;
|
|
892
|
+
readonly step: number | null;
|
|
893
|
+
readonly maxLength: number | null;
|
|
894
|
+
readonly disabledReason: DesignFieldDisabledCode | null;
|
|
895
|
+
}
|
|
896
|
+
interface DesignProposalChangeWire {
|
|
897
|
+
readonly path: string;
|
|
898
|
+
readonly label: string;
|
|
899
|
+
readonly before?: JsonValue;
|
|
900
|
+
readonly after?: JsonValue;
|
|
901
|
+
}
|
|
902
|
+
interface DesignProposalWire {
|
|
903
|
+
readonly proposalId: string;
|
|
904
|
+
readonly baseDraftRevision: number;
|
|
905
|
+
readonly summary: string;
|
|
906
|
+
readonly changes: readonly DesignProposalChangeWire[];
|
|
907
|
+
readonly conflicts: readonly string[];
|
|
908
|
+
}
|
|
909
|
+
interface DesignSnapshotWire {
|
|
910
|
+
readonly version: 1;
|
|
911
|
+
readonly enabled: boolean;
|
|
912
|
+
readonly credentialReady: boolean;
|
|
913
|
+
readonly models: readonly DesignModelWire[];
|
|
914
|
+
readonly selectedModelId: string | null;
|
|
915
|
+
readonly draft: {
|
|
916
|
+
readonly modelId: string;
|
|
917
|
+
readonly draftRevision: number;
|
|
918
|
+
readonly irContractHash: string;
|
|
919
|
+
readonly primaryInputPath: string;
|
|
920
|
+
readonly fields: readonly DesignFieldWire[];
|
|
921
|
+
readonly parameters: Readonly<Record<string, JsonValue>>;
|
|
922
|
+
} | null;
|
|
923
|
+
readonly proposal: DesignProposalWire | null;
|
|
924
|
+
readonly jobs: readonly {
|
|
925
|
+
readonly jobId: string;
|
|
926
|
+
readonly modelId: string;
|
|
927
|
+
readonly status: "running" | "succeeded" | "failed" | "canceled" | "submit-unknown" | "expired";
|
|
928
|
+
readonly createdAt: string;
|
|
929
|
+
readonly updatedAt: string;
|
|
930
|
+
readonly resources: readonly {
|
|
931
|
+
readonly id: string;
|
|
932
|
+
readonly kind: "image" | "video" | "audio";
|
|
933
|
+
readonly url: string;
|
|
934
|
+
readonly downloadUrl: string;
|
|
935
|
+
readonly expiresAt: string | null;
|
|
936
|
+
}[];
|
|
937
|
+
readonly diagnostic: {
|
|
938
|
+
readonly code: DesignDiagnosticCode;
|
|
939
|
+
readonly retryable: boolean;
|
|
940
|
+
} | null;
|
|
941
|
+
}[];
|
|
942
|
+
readonly notice: DesignNoticeCode | null;
|
|
943
|
+
}
|
|
944
|
+
/** Stateful Host facade over pure Design contracts; no Secret crosses its wire. */
|
|
945
|
+
declare class DesignHostController {
|
|
946
|
+
#private;
|
|
947
|
+
constructor(options: DesignHostControllerOptions);
|
|
948
|
+
handle(endpoint: string, payload: unknown, signal?: AbortSignal): Promise<DesignSnapshotWire>;
|
|
949
|
+
pollRunning(signal?: AbortSignal): Promise<boolean>;
|
|
950
|
+
private read;
|
|
951
|
+
private refresh;
|
|
952
|
+
private selectModel;
|
|
953
|
+
private propose;
|
|
954
|
+
private proposeOnce;
|
|
955
|
+
private applyProposal;
|
|
956
|
+
private rejectProposal;
|
|
957
|
+
private submit;
|
|
958
|
+
}
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region src/host/design-storage.d.ts
|
|
961
|
+
/** One atomic singleton keeps the Design WAL independent of Settings. */
|
|
962
|
+
declare const modellixDesignDomainSpec: {
|
|
963
|
+
name: string;
|
|
964
|
+
version: number;
|
|
965
|
+
global: {
|
|
966
|
+
schema: z$1.ZodObject<{
|
|
967
|
+
version: z$1.ZodLiteral<1>;
|
|
968
|
+
values: z$1.ZodRecord<z$1.ZodString, z$1.ZodString>;
|
|
969
|
+
}, z$1.core.$strip>;
|
|
970
|
+
initial: {
|
|
971
|
+
version: 1;
|
|
972
|
+
values: Record<string, string>;
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
tables: {};
|
|
976
|
+
};
|
|
977
|
+
type ModellixDesignDomain = Domain<typeof modellixDesignDomainSpec>;
|
|
978
|
+
declare function openDesignStorage(ctx: Context): Promise<{
|
|
979
|
+
readonly domain: ModellixDesignDomain;
|
|
980
|
+
readonly storage: StoragePort;
|
|
981
|
+
}>;
|
|
982
|
+
//#endregion
|
|
983
|
+
//#region src/host/design-tool.d.ts
|
|
984
|
+
declare const MODELLIX_DESIGN_MODELS_TOOL = "modellix_design_models";
|
|
985
|
+
declare const MODELLIX_DESIGN_PREPARE_TOOL = "modellix_design_prepare";
|
|
986
|
+
declare const MODELLIX_DESIGN_GENERATE_TOOL = "modellix_design_generate";
|
|
987
|
+
declare const MODELLIX_DESIGN_TASK_TOOL = "modellix_design_task";
|
|
988
|
+
/** The deliberately narrow Host seam used by model-facing Design tools. */
|
|
989
|
+
interface DesignToolController {
|
|
990
|
+
handle(endpoint: string, payload: unknown, signal?: AbortSignal): Promise<DesignSnapshotWire>;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Build the four stable, namespaced Modellix Design tools. The caller owns
|
|
994
|
+
* visibility and must only register these definitions while Design is enabled.
|
|
995
|
+
*/
|
|
996
|
+
declare function createModellixDesignToolDefinitions(controller: DesignToolController): readonly ToolDefinition[];
|
|
997
|
+
/**
|
|
998
|
+
* Register Design tools plus explicit LLM-proposal and paid-generate approval gates. The returned
|
|
999
|
+
* disposer removes both definitions and the gate, allowing the runtime to
|
|
1000
|
+
* mirror the live Design toggle without leaving model-visible stale tools.
|
|
1001
|
+
*/
|
|
1002
|
+
declare function registerModellixDesignTools(ctx: Context, controller: DesignToolController): () => void;
|
|
1003
|
+
//#endregion
|
|
1004
|
+
//#region src/host/runtime.d.ts
|
|
1005
|
+
interface ModellixRuntimeState {
|
|
1006
|
+
readonly version: 1;
|
|
1007
|
+
readonly settingsRevision: number;
|
|
1008
|
+
readonly services: ServiceToggles;
|
|
1009
|
+
readonly credential: CredentialDescriptor & {
|
|
1010
|
+
readonly verification: CredentialState["verification"];
|
|
1011
|
+
readonly invalidEpoch: number | null;
|
|
1012
|
+
};
|
|
1013
|
+
readonly onboarding: {
|
|
1014
|
+
readonly status: PluginConfig["onboarding"]["status"];
|
|
1015
|
+
readonly recoveryPending: boolean; /** Non-secret, process-local token for the latest explicit capability recovery request. */
|
|
1016
|
+
readonly recoveryRequestId: string | null;
|
|
1017
|
+
};
|
|
1018
|
+
readonly llm: {
|
|
1019
|
+
readonly health: "unknown" | "ready" | "missing" | "disabled" | "error" | "policy-blocked";
|
|
1020
|
+
readonly modelCount: number;
|
|
1021
|
+
readonly refreshedAt: number | null;
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
/** Host composition root; every Secret-bearing operation terminates here. */
|
|
1025
|
+
declare class ModellixRuntime {
|
|
1026
|
+
#private;
|
|
1027
|
+
static create(ctx: Context): Promise<ModellixRuntime>;
|
|
1028
|
+
private constructor();
|
|
1029
|
+
private initialize;
|
|
1030
|
+
private handleRpc;
|
|
1031
|
+
private state;
|
|
1032
|
+
private saveCredential;
|
|
1033
|
+
private removeCredential;
|
|
1034
|
+
private defer;
|
|
1035
|
+
private updateToggles;
|
|
1036
|
+
private refreshLlmRpc;
|
|
1037
|
+
private reconcileLiveSettings;
|
|
1038
|
+
private refreshLlm;
|
|
1039
|
+
private rollbackLlmMaterialization;
|
|
1040
|
+
private compensateLlmMaterialization;
|
|
1041
|
+
private observeLlmOwnershipCommit;
|
|
1042
|
+
private abandonPendingLlmMaterialization;
|
|
1043
|
+
private reconcileInterruptedLlmMaterialization;
|
|
1044
|
+
private recordLlmRecoveryDiagnostic;
|
|
1045
|
+
private clearLlmProvenanceBestEffort;
|
|
1046
|
+
/**
|
|
1047
|
+
* Finish an interrupted remove or an out-of-process Credential deletion.
|
|
1048
|
+
* An in-process caller supplies the exact confirmed Broker mutation epoch;
|
|
1049
|
+
* otherwise completed onboarding is the non-secret evidence that one
|
|
1050
|
+
* Credential generation disappeared while this process was offline.
|
|
1051
|
+
*/
|
|
1052
|
+
private reconcileMissingCredentialState;
|
|
1053
|
+
private enqueueWrite;
|
|
1054
|
+
private credentialIsUsable;
|
|
1055
|
+
private requestCredentialRecovery;
|
|
1056
|
+
private clearCredentialRecoveryRequest;
|
|
1057
|
+
/** Coalesces concurrent 401s while explicit later capability calls get a fresh token. */
|
|
1058
|
+
private markCredentialRejected;
|
|
1059
|
+
private resolveUsableCredential;
|
|
1060
|
+
private enqueueDesignWrite;
|
|
1061
|
+
private rememberDesignModel;
|
|
1062
|
+
private syncDesignTools;
|
|
1063
|
+
private scheduleDesignPoll;
|
|
1064
|
+
}
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region src/host/settings.d.ts
|
|
1067
|
+
declare const MODELLIX_SETTINGS_NAMESPACE: "modellix";
|
|
1068
|
+
/** Serializable non-secret section. Host reads still pass through migrateConfig. */
|
|
1069
|
+
declare const PluginSettingsSchema: z<PluginConfig>;
|
|
1070
|
+
interface SettingsScopeLike {
|
|
1071
|
+
get(): PluginConfig;
|
|
1072
|
+
watch(callback: (next: PluginConfig, previous: PluginConfig) => void | Promise<void>): () => void;
|
|
1073
|
+
}
|
|
1074
|
+
interface SettingsServiceLike {
|
|
1075
|
+
register<T>(namespace: string, schema: z<T>, options: {
|
|
1076
|
+
readonly base: Partial<T>;
|
|
1077
|
+
readonly applies: "live";
|
|
1078
|
+
}): SettingsScopeLike;
|
|
1079
|
+
describe(options?: {
|
|
1080
|
+
readonly redactSecrets?: boolean;
|
|
1081
|
+
}): readonly {
|
|
1082
|
+
readonly ns: string;
|
|
1083
|
+
readonly revision: number;
|
|
1084
|
+
readonly user?: unknown;
|
|
1085
|
+
}[];
|
|
1086
|
+
mutate(namespace: string, operations: readonly SettingsPathOp[], expectedRevision?: number): Promise<void>;
|
|
1087
|
+
}
|
|
1088
|
+
interface PluginSettingsSnapshot {
|
|
1089
|
+
readonly config: PluginConfig;
|
|
1090
|
+
readonly revision: number;
|
|
1091
|
+
}
|
|
1092
|
+
/** Small CAS facade that always returns migrated, detached plugin settings. */
|
|
1093
|
+
declare class PluginSettingsController {
|
|
1094
|
+
#private;
|
|
1095
|
+
constructor(settings: SettingsServiceLike);
|
|
1096
|
+
read(): PluginSettingsSnapshot;
|
|
1097
|
+
replace(config: PluginConfig, expectedRevision?: number): Promise<void>;
|
|
1098
|
+
watch(callback: (next: PluginConfig, previous: PluginConfig) => void | Promise<void>): () => void;
|
|
1099
|
+
}
|
|
1100
|
+
//#endregion
|
|
1101
|
+
//#region src/llm/catalog.d.ts
|
|
1102
|
+
declare const MODELLIX_LLM_BASE_URL: "https://llm.modellix.ai/v1";
|
|
1103
|
+
declare const MODELLIX_LLM_MODELS_URL: "https://llm.modellix.ai/v1/models";
|
|
1104
|
+
interface LlmCredentialSnapshot {
|
|
1105
|
+
readonly value: string;
|
|
1106
|
+
readonly credentialEpoch: number;
|
|
1107
|
+
}
|
|
1108
|
+
interface ModellixLlmModel {
|
|
1109
|
+
readonly id: string;
|
|
1110
|
+
readonly name?: string;
|
|
1111
|
+
}
|
|
1112
|
+
interface ModellixLlmCatalog {
|
|
1113
|
+
readonly models: readonly ModellixLlmModel[];
|
|
1114
|
+
readonly credentialEpoch: number;
|
|
1115
|
+
readonly fetchedAt: number;
|
|
1116
|
+
}
|
|
1117
|
+
interface LlmCatalogClientOptions {
|
|
1118
|
+
readonly resolveCredential: () => Promise<LlmCredentialSnapshot | undefined>;
|
|
1119
|
+
readonly fetch?: typeof fetch;
|
|
1120
|
+
readonly now?: () => number;
|
|
1121
|
+
readonly maxResponseBytes?: number;
|
|
1122
|
+
readonly requestTimeoutMs?: number;
|
|
1123
|
+
}
|
|
1124
|
+
declare class LlmCatalogRequestError extends Error {
|
|
1125
|
+
readonly contract: ModellixErrorContract;
|
|
1126
|
+
constructor(contract: ModellixErrorContract);
|
|
1127
|
+
}
|
|
1128
|
+
declare class StaleLlmCatalogError extends Error {
|
|
1129
|
+
readonly expectedCredentialEpoch: number;
|
|
1130
|
+
readonly actualCredentialEpoch: number;
|
|
1131
|
+
constructor(expectedCredentialEpoch: number, actualCredentialEpoch: number);
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* Authenticated, read-only Modellix LLM catalog client. The resolved key lives
|
|
1135
|
+
* only in the request closure and is never retained on the instance or result.
|
|
1136
|
+
*/
|
|
1137
|
+
declare class LlmCatalogClient {
|
|
1138
|
+
#private;
|
|
1139
|
+
constructor(options: LlmCatalogClientOptions);
|
|
1140
|
+
fetchModels(signal?: AbortSignal): Promise<ModellixLlmCatalog>;
|
|
1141
|
+
}
|
|
1142
|
+
interface LlmCatalogCacheOptions {
|
|
1143
|
+
readonly ttlMs?: number;
|
|
1144
|
+
readonly now?: () => number;
|
|
1145
|
+
}
|
|
1146
|
+
/** Five-minute epoch-keyed cache with one in-flight read per credential epoch. */
|
|
1147
|
+
declare class LlmCatalogCache {
|
|
1148
|
+
#private;
|
|
1149
|
+
constructor(client: LlmCatalogClient, options?: LlmCatalogCacheOptions);
|
|
1150
|
+
peek(credentialEpoch: number): ModellixLlmCatalog | undefined;
|
|
1151
|
+
get(credentialEpoch: number, options?: {
|
|
1152
|
+
readonly force?: boolean;
|
|
1153
|
+
readonly signal?: AbortSignal;
|
|
1154
|
+
}): Promise<ModellixLlmCatalog>;
|
|
1155
|
+
invalidate(): void;
|
|
1156
|
+
}
|
|
1157
|
+
//#endregion
|
|
1158
|
+
//#region src/llm/materializer.d.ts
|
|
1159
|
+
declare const MODELLIX_LLM_PROVIDER_ID: "modellix";
|
|
1160
|
+
declare const MODELLIX_LLM_PROVENANCE_FIELD: "__dshModellixMaterialization";
|
|
1161
|
+
interface PiAiModelEntry {
|
|
1162
|
+
readonly id: string;
|
|
1163
|
+
readonly name?: string;
|
|
1164
|
+
readonly [key: string]: unknown;
|
|
1165
|
+
}
|
|
1166
|
+
interface ModellixPiAiRoute {
|
|
1167
|
+
readonly apiKeyEnv: typeof MODELLIX_CREDENTIAL_REF;
|
|
1168
|
+
readonly displayName: "Modellix";
|
|
1169
|
+
readonly api: "openai-completions";
|
|
1170
|
+
readonly baseURL: "https://llm.modellix.ai/v1";
|
|
1171
|
+
readonly defaultInput: readonly ["text"];
|
|
1172
|
+
readonly retryPolicy: {
|
|
1173
|
+
readonly mode: "normal";
|
|
1174
|
+
readonly maxRetries: 0;
|
|
1175
|
+
};
|
|
1176
|
+
readonly models: readonly PiAiModelEntry[];
|
|
1177
|
+
readonly [key: string]: unknown;
|
|
1178
|
+
}
|
|
1179
|
+
type LlmRouteOwnership = "none" | "created" | "adopted";
|
|
1180
|
+
interface LlmOwnedEntry {
|
|
1181
|
+
readonly kind: "field" | "model";
|
|
1182
|
+
readonly key: string;
|
|
1183
|
+
readonly appliedFingerprint: string;
|
|
1184
|
+
}
|
|
1185
|
+
interface LlmRouteLedger {
|
|
1186
|
+
readonly ownership: LlmRouteOwnership;
|
|
1187
|
+
readonly appliedRouteFingerprint: string | null;
|
|
1188
|
+
readonly entries: readonly LlmOwnedEntry[];
|
|
1189
|
+
}
|
|
1190
|
+
interface RouteMaterializationPlan {
|
|
1191
|
+
readonly route: ModellixPiAiRoute & Record<string, unknown>;
|
|
1192
|
+
readonly ledger: LlmRouteLedger;
|
|
1193
|
+
readonly changed: boolean;
|
|
1194
|
+
}
|
|
1195
|
+
declare class LlmRouteConflictError extends Error {
|
|
1196
|
+
readonly field: string;
|
|
1197
|
+
constructor(field: string);
|
|
1198
|
+
}
|
|
1199
|
+
declare const EMPTY_LLM_ROUTE_LEDGER: LlmRouteLedger;
|
|
1200
|
+
/**
|
|
1201
|
+
* Merge a live catalog into one llm-pi-ai route without replacing unknown
|
|
1202
|
+
* fields or hand-authored model metadata. Previously plugin-owned models may
|
|
1203
|
+
* be removed only while their exact applied fingerprint still matches.
|
|
1204
|
+
*/
|
|
1205
|
+
declare function planLlmRouteMaterialization(current: unknown, catalog: readonly ModellixLlmModel[], previous?: LlmRouteLedger): RouteMaterializationPlan;
|
|
1206
|
+
interface RouteRemovalPlan {
|
|
1207
|
+
readonly action: "none" | "unset-route" | "set-route" | "conflict";
|
|
1208
|
+
readonly route?: Record<string, unknown>;
|
|
1209
|
+
readonly ledger: LlmRouteLedger;
|
|
1210
|
+
}
|
|
1211
|
+
/** Remove only values still byte-for-byte owned by the plugin. */
|
|
1212
|
+
declare function planLlmRouteRemoval(current: unknown, ledger: LlmRouteLedger): RouteRemovalPlan;
|
|
1213
|
+
/**
|
|
1214
|
+
* Preserve only ownership already proven before an interrupted cross-namespace
|
|
1215
|
+
* commit. Newly materialized values are deliberately left unowned because the
|
|
1216
|
+
* public Settings API cannot prove which process wrote the observed revision.
|
|
1217
|
+
*/
|
|
1218
|
+
declare function reconcileLlmRouteLedgerAfterInterruption(current: unknown, ledger: LlmRouteLedger): LlmRouteLedger;
|
|
1219
|
+
interface SettingsNamespaceDescriptor {
|
|
1220
|
+
readonly revision: number;
|
|
1221
|
+
readonly value: unknown;
|
|
1222
|
+
readonly base?: unknown;
|
|
1223
|
+
readonly user?: unknown;
|
|
1224
|
+
}
|
|
1225
|
+
interface LlmSettingsPort {
|
|
1226
|
+
describe(): Promise<SettingsNamespaceDescriptor | undefined>;
|
|
1227
|
+
mutate(operations: readonly ({
|
|
1228
|
+
readonly op: "set";
|
|
1229
|
+
readonly path: readonly string[];
|
|
1230
|
+
readonly value: unknown;
|
|
1231
|
+
} | {
|
|
1232
|
+
readonly op: "unset";
|
|
1233
|
+
readonly path: readonly string[];
|
|
1234
|
+
})[], expectedRevision: number): Promise<void>;
|
|
1235
|
+
}
|
|
1236
|
+
interface LlmMaterializationReceipt {
|
|
1237
|
+
readonly ledger: LlmRouteLedger;
|
|
1238
|
+
/** Restore the raw Modellix route captured immediately before this write. */
|
|
1239
|
+
rollback(): Promise<void>;
|
|
1240
|
+
}
|
|
1241
|
+
interface LlmPreparedMaterialization extends LlmMaterializationReceipt {
|
|
1242
|
+
readonly changed: boolean;
|
|
1243
|
+
readonly expectedSettingsRevision: number;
|
|
1244
|
+
readonly previousRouteFingerprint: string;
|
|
1245
|
+
readonly targetRouteFingerprint: string;
|
|
1246
|
+
apply(): Promise<void>;
|
|
1247
|
+
}
|
|
1248
|
+
interface LlmInterruptedMaterializationEvidence {
|
|
1249
|
+
readonly previousLedger: LlmRouteLedger;
|
|
1250
|
+
readonly targetLedger: LlmRouteLedger;
|
|
1251
|
+
readonly previousRouteFingerprint: string;
|
|
1252
|
+
readonly provenanceToken: string;
|
|
1253
|
+
}
|
|
1254
|
+
interface LlmInterruptedMaterializationResult {
|
|
1255
|
+
readonly status: "not-applied" | "applied";
|
|
1256
|
+
readonly ledger: LlmRouteLedger;
|
|
1257
|
+
}
|
|
1258
|
+
declare class LlmMaterializationRollbackError extends Error {
|
|
1259
|
+
constructor(reason: "namespace-unavailable" | "route-changed");
|
|
1260
|
+
}
|
|
1261
|
+
/** CAS materializer over the public Settings namespace contract. */
|
|
1262
|
+
declare class LlmSettingsMaterializer {
|
|
1263
|
+
#private;
|
|
1264
|
+
constructor(settings: LlmSettingsPort);
|
|
1265
|
+
materialize(catalog: readonly ModellixLlmModel[], ledger: LlmRouteLedger): Promise<LlmRouteLedger>;
|
|
1266
|
+
materializeWithRollback(catalog: readonly ModellixLlmModel[], ledger: LlmRouteLedger): Promise<LlmMaterializationReceipt>;
|
|
1267
|
+
prepareMaterialization(catalog: readonly ModellixLlmModel[], ledger: LlmRouteLedger, provenanceToken?: string): Promise<LlmPreparedMaterialization>;
|
|
1268
|
+
recoverInterruptedMaterialization(evidence: LlmInterruptedMaterializationEvidence): Promise<LlmInterruptedMaterializationResult>;
|
|
1269
|
+
clearProvenance(provenanceToken: string): Promise<void>;
|
|
1270
|
+
remove(ledger: LlmRouteLedger): Promise<LlmRouteLedger>;
|
|
1271
|
+
}
|
|
1272
|
+
//#endregion
|
|
1273
|
+
//#region src/llm/registry-verifier.d.ts
|
|
1274
|
+
/** Public, non-generating LLM registry surface used for materialization backreads. */
|
|
1275
|
+
type LlmRegistryReader = Pick<LlmRuntime, "listProviders" | "resolveModelInfo">;
|
|
1276
|
+
interface LlmRegistryVerificationOptions {
|
|
1277
|
+
readonly attempts?: number;
|
|
1278
|
+
readonly retryDelayMs?: number;
|
|
1279
|
+
readonly signal?: AbortSignal;
|
|
1280
|
+
}
|
|
1281
|
+
/** The materialized route never became observable through the public LLM registry. */
|
|
1282
|
+
declare class LlmRegistryBackreadError extends Error {
|
|
1283
|
+
readonly attempts: number;
|
|
1284
|
+
constructor(attempts: number, cause: unknown);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Wait until llm-pi-ai has consumed its Settings update, then prove that the
|
|
1288
|
+
* route and every exact catalog model resolve through the public registry.
|
|
1289
|
+
* This reads adapter metadata only; it never resolves a Credential or starts a
|
|
1290
|
+
* generated/streaming request.
|
|
1291
|
+
*/
|
|
1292
|
+
declare function verifyLlmRegistryBackread(registry: LlmRegistryReader, models: readonly ModellixLlmModel[], options?: LlmRegistryVerificationOptions): Promise<void>;
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/web/contracts.d.ts
|
|
1295
|
+
declare const MODELLIX_WEB_SEARCH_ENDPOINT: "https://tool.modellix.ai/v1/web-search";
|
|
1296
|
+
declare const MODELLIX_WEB_FETCH_ENDPOINT: "https://tool.modellix.ai/v1/web-fetch";
|
|
1297
|
+
declare const DEFAULT_WEB_SEARCH_MAX_RESULTS = 5;
|
|
1298
|
+
declare const MAX_WEB_SEARCH_RESULTS = 20;
|
|
1299
|
+
declare const MAX_WEB_QUERY_CHARS = 32000;
|
|
1300
|
+
declare const MAX_WEB_URL_CHARS = 8192;
|
|
1301
|
+
declare const DEFAULT_WEB_RESPONSE_BYTES: number;
|
|
1302
|
+
declare class ModellixWebContractError extends Error {
|
|
1303
|
+
constructor(message: string);
|
|
1304
|
+
}
|
|
1305
|
+
interface ParsedSearchResponse {
|
|
1306
|
+
readonly result: WebSearchResult;
|
|
1307
|
+
readonly requestId: string;
|
|
1308
|
+
}
|
|
1309
|
+
interface ParsedFetchSuccess {
|
|
1310
|
+
readonly kind: "success";
|
|
1311
|
+
readonly result: WebFetchResult;
|
|
1312
|
+
readonly requestId: string;
|
|
1313
|
+
}
|
|
1314
|
+
interface ParsedFetchFailure {
|
|
1315
|
+
readonly kind: "failure";
|
|
1316
|
+
readonly requestId: string;
|
|
1317
|
+
}
|
|
1318
|
+
type ParsedFetchResponse = ParsedFetchSuccess | ParsedFetchFailure;
|
|
1319
|
+
declare function buildSearchRequest(query: string, maxResults: number | undefined): {
|
|
1320
|
+
readonly query: string;
|
|
1321
|
+
readonly depth: "standard";
|
|
1322
|
+
readonly max_results: number;
|
|
1323
|
+
};
|
|
1324
|
+
declare function buildFetchRequest(url: string): {
|
|
1325
|
+
readonly urls: readonly [string];
|
|
1326
|
+
};
|
|
1327
|
+
declare function parseSearchResponse(input: string, maxResults: number): ParsedSearchResponse;
|
|
1328
|
+
declare function parseFetchResponse(input: string): ParsedFetchResponse;
|
|
1329
|
+
declare function validatePublicHttpUrl(value: string, label: string): string;
|
|
1330
|
+
//#endregion
|
|
1331
|
+
//#region src/web/provider.d.ts
|
|
1332
|
+
declare const MODELLIX_WEB_PROVIDER_ID: "modellix";
|
|
1333
|
+
interface ModellixWebCredentialSnapshot {
|
|
1334
|
+
/** Host-only secret. It must be resolved for each operation and never cached. */
|
|
1335
|
+
readonly apiKey: string;
|
|
1336
|
+
readonly credentialEpoch: number;
|
|
1337
|
+
}
|
|
1338
|
+
interface ModellixWebProviderOptions {
|
|
1339
|
+
/** Cheap local switch state. */
|
|
1340
|
+
readonly isEnabled: () => boolean;
|
|
1341
|
+
/** Cheap local descriptor check. This callback must never resolve the Key. */
|
|
1342
|
+
readonly hasCredential: () => boolean;
|
|
1343
|
+
/** Resolves a fresh Host Credential snapshot for every paid request. */
|
|
1344
|
+
readonly resolveCredential: () => Promise<ModellixWebCredentialSnapshot | null>;
|
|
1345
|
+
/** Returns a stable, locally derived Modellix user identifier. */
|
|
1346
|
+
readonly getUserId: () => string;
|
|
1347
|
+
/** Rejects a stale 401 from an earlier Credential generation. */
|
|
1348
|
+
readonly isCredentialEpochCurrent: (credentialEpoch: number) => boolean;
|
|
1349
|
+
readonly onCredentialRejected?: (credentialEpoch: number, error: ModellixErrorContract) => void | Promise<void>;
|
|
1350
|
+
readonly fetchImpl?: typeof globalThis.fetch;
|
|
1351
|
+
readonly maxResponseBytes?: number;
|
|
1352
|
+
readonly requestTimeoutMs?: number;
|
|
1353
|
+
readonly now?: () => number;
|
|
1354
|
+
}
|
|
1355
|
+
interface ModellixWebProviders {
|
|
1356
|
+
readonly search: ModellixWebSearchProvider;
|
|
1357
|
+
readonly fetch: ModellixWebFetchProvider;
|
|
1358
|
+
}
|
|
1359
|
+
interface ModellixWebRegistry {
|
|
1360
|
+
registerSearchProvider(provider: WebSearchProvider): () => void;
|
|
1361
|
+
registerFetchProvider(provider: WebFetchProvider): () => void;
|
|
1362
|
+
}
|
|
1363
|
+
declare class ModellixWebProviderError extends WebError {
|
|
1364
|
+
readonly contract: ModellixErrorContract;
|
|
1365
|
+
readonly diagnostic: RedactedValue;
|
|
1366
|
+
constructor(contract: ModellixErrorContract, diagnostic?: unknown);
|
|
1367
|
+
}
|
|
1368
|
+
declare class ModellixWebFetchFailedError extends WebError {
|
|
1369
|
+
readonly requestId: string;
|
|
1370
|
+
readonly diagnostic: RedactedValue;
|
|
1371
|
+
constructor(requestId: string, url: string);
|
|
1372
|
+
}
|
|
1373
|
+
declare class ModellixWebSearchProvider implements WebSearchProvider {
|
|
1374
|
+
#private;
|
|
1375
|
+
readonly id: "modellix";
|
|
1376
|
+
constructor(options: ModellixWebProviderOptions);
|
|
1377
|
+
available(): boolean;
|
|
1378
|
+
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
1379
|
+
}
|
|
1380
|
+
declare class ModellixWebFetchProvider implements WebFetchProvider {
|
|
1381
|
+
#private;
|
|
1382
|
+
readonly id: "modellix";
|
|
1383
|
+
constructor(options: ModellixWebProviderOptions);
|
|
1384
|
+
available(): boolean;
|
|
1385
|
+
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
|
1386
|
+
}
|
|
1387
|
+
declare function createModellixWebProviders(options: ModellixWebProviderOptions): ModellixWebProviders;
|
|
1388
|
+
/** Registers only providers; the Harness-owned web_search/web_fetch Tools remain untouched. */
|
|
1389
|
+
declare function registerModellixWebProviders(registry: ModellixWebRegistry, options: ModellixWebProviderOptions): () => void;
|
|
1390
|
+
//#endregion
|
|
1391
|
+
//#region src/index.d.ts
|
|
1392
|
+
declare const name = "modellix";
|
|
1393
|
+
declare const inject: string[];
|
|
1394
|
+
interface Config {}
|
|
1395
|
+
declare const Config: z<Config>;
|
|
1396
|
+
declare function apply(ctx: Context): Promise<void>;
|
|
1397
|
+
//#endregion
|
|
1398
|
+
export { AUTHENTICATED_CATALOG_URL, ApprovedHttpRequest, AvailableDesignResult, BeginLlmMaterializationInput, BeginOnboardingSaveInput, CURRENT_CONFIG_SCHEMA_VERSION, CacheEntry, CachePort, ClockPort, Config, CredentialBroker, CredentialBrokerOptions, CredentialDescriptor, CredentialEpochConflictError, CredentialMutationCoordinator, CredentialMutationResult, CredentialSource, CredentialState, CredentialValidationError, CredentialVerification, DEFAULT_DESIGN_WAL_KEY, DEFAULT_RESULT_TTL_MS, DEFAULT_WEB_RESPONSE_BYTES, DEFAULT_WEB_SEARCH_MAX_RESULTS, DESIGN_PLANNER_ENDPOINT, DESIGN_PLANNER_MODEL, DesignConfig, DesignError, DesignErrorCode, DesignHostController, DesignHostControllerOptions, DesignLogEvent, DesignLogLevel, DesignMediaCategory, DesignModelSummary, DesignPlannerClient, DesignPlannerClientOptions, DesignPlannerRequest, DesignPlannerResult, DesignPollDiagnosticCode, DesignSchemaIR, DesignSnapshotWire, DesignTaskRecord, DesignTaskRepository, DesignTaskRepositoryOptions, DesignTaskState, DesignToolController, DesignWalEvent, EMPTY_LLM_ROUTE_LEDGER, ExactParameterPatch, FetchPort, HarnessCredentialInfo, HarnessCredentialPort, HeaderRecord, HeaderValue, HttpMethod, HttpPolicyError, HttpRequestPolicyInput, HttpResponseBoundaryError, HttpRetryFailure, InvalidCredentialEpoch, JsonPrimitive, JsonValue, LlmCatalogCache, LlmCatalogCacheOptions, LlmCatalogClient, LlmCatalogClientOptions, LlmCatalogRequestError, LlmConfig, LlmCredentialSnapshot, LlmInterruptedMaterializationEvidence, LlmInterruptedMaterializationResult, LlmMaterializationConflictError, LlmMaterializationReceipt, LlmMaterializationRecovery, LlmMaterializationRollbackError, LlmOwnedEntry, LlmOwnershipConfig, LlmPreparedMaterialization, LlmRegistryBackreadError, LlmRegistryReader, LlmRegistryVerificationOptions, LlmRouteConflictError, LlmRouteLedger, LlmRouteOwnership, LlmRouteOwnershipConfig, LlmRouteOwnershipEntry, LlmSettingsMaterializer, LlmSettingsPort, LoggerPort, MAX_WEB_QUERY_CHARS, MAX_WEB_SEARCH_RESULTS, MAX_WEB_URL_CHARS, MODELLIX_CREDENTIAL_REF, MODELLIX_DESIGN_GENERATE_TOOL, MODELLIX_DESIGN_MODELS_TOOL, MODELLIX_DESIGN_PREPARE_TOOL, MODELLIX_DESIGN_TASK_TOOL, MODELLIX_LLM_BASE_URL, MODELLIX_LLM_MODELS_URL, MODELLIX_LLM_PROVENANCE_FIELD, MODELLIX_LLM_PROVIDER_ID, MODELLIX_ORIGINS, MODELLIX_SETTINGS_NAMESPACE, MODELLIX_WEB_FETCH_ENDPOINT, MODELLIX_WEB_PROVIDER_ID, MODELLIX_WEB_SEARCH_ENDPOINT, ModelCatalogClient, ModelCatalogClientOptions, ModelCatalogPage, ModelCatalogQuery, ModelSchemaClient, ModelSchemaClientOptions, ModelSchemaDocument, ModellixDesignDomain, ModellixErrorCode, ModellixErrorContext, ModellixErrorContract, ModellixFailure, ModellixLlmCatalog, ModellixLlmModel, ModellixOriginName, ModellixPiAiRoute, ModellixRuntime, ModellixRuntimeState, ModellixService, ModellixWebContractError, ModellixWebCredentialSnapshot, ModellixWebFetchFailedError, ModellixWebFetchProvider, ModellixWebProviderError, ModellixWebProviderOptions, ModellixWebProviders, ModellixWebRegistry, ModellixWebSearchProvider, NaturalLanguagePlan, OnboardingConfig, OnboardingRecoveryAction, OnboardingRecoveryDecision, OnboardingSaveConflictError, OnboardingSavePhase, OnboardingSaveRecovery, OnboardingStatus, PUBLIC_PORTAL_CATALOG_URL, ParsedFetchFailure, ParsedFetchResponse, ParsedFetchSuccess, ParsedSearchResponse, PersistedLlmRouteOwnership, PiAiModelEntry, PluginConfig, PluginSettingsController, PluginSettingsSchema, PluginSettingsSnapshot, PredictionClient, PredictionClientOptions, PredictionResource, PredictionTask, PredictionTaskStatus, REDACTED, ReadPredictionInput, RedactedValue, RequestDeadline, RetentionPolicy, RetryDelayInput, RetryOptions, RetrySuccess, RouteMaterializationPlan, RouteRemovalPlan, SchemaDiagnostic, SchemaParserLimits, ServiceId, ServiceToggles, ServicesConfig, SettingsNamespaceDescriptor, SettingsScopeLike, SettingsServiceLike, SleepPort, StaleLlmCatalogError, StoragePort, SubmitPredictionInput, UiConstraints, UiField, UiFieldKind, UiMediaKind, UiVariant, UnauthorizedTransition, UnsupportedConfigVersionError, VerificationTransition, WebConfig, abandonLlmMaterialization, advanceCredentialEpoch, apply, applyCredentialDescriptor, applyExactPatch, applyNaturalLanguage, applyRuntimeUnauthorized, applyVerificationResult, approveHttpRequest, approveRedirect, beginLlmMaterialization, beginOnboardingSave, buildFetchRequest, buildInvocationBody, buildSearchRequest, completeLlmMaterialization, completeOnboardingSave, computeRetryDelay, createCredentialState, createDefaultConfig, createModellixDesignToolDefinitions, createModellixWebProviders, deferOnboarding, deriveModellixSessionId, deriveModellixUserId, executeWithRetry, extractAllowedSubmitUrl, getServiceToggles, inject, isAllowedModellixOrigin, isCredentialInvalidError, isPublicHostname, isRetryableError, isRetryableReadFailure, isValidModellixIdentity, markOnboardingCredentialSaved, materializeDefaults, migrateConfig, missingCredentialDescriptor, modellixDesignDomainSpec, name, normalizeCredentialDescriptor, openDesignStorage, parseCatalogPage, parseDesignSchema, parseFetchResponse, parsePredictionTask, parseResources, parseRetryAfter, parseSearchResponse, planLlmRouteMaterialization, planLlmRouteRemoval, preserveStoredCredentialAfterCandidateFailure, preserveVerificationAfterTransientFailure, readBoundedResponseJson, readBoundedResponseText, reconcileLlmRouteLedgerAfterInterruption, reconcileOnboardingSave, redactForLog, redactHeaders, redactUrl, registerModellixDesignTools, registerModellixWebProviders, replayDesignWal, requestDeadline, retryAfterFromFailure, selectAvailableResults, setServiceToggles, systemClock, systemSleep, toModellixError, validatePublicHttpUrl, validateSubmitEndpoint, verifyLlmRegistryBackread };
|
|
1399
|
+
//# sourceMappingURL=index.d.ts.map
|