@klarkxy/dsh-git-commit 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/docs/README.zh-CN.md +10 -7
- package/lib/client.inner.cjs +819 -112
- package/lib/client.inner.cjs.map +1 -1
- package/lib/client.js +819 -112
- package/lib/contracts.d.ts +1801 -5
- package/lib/contracts.js +2 -35
- package/lib/contracts2.d.ts +2 -0
- package/lib/contracts2.js +85 -0
- package/lib/contracts2.js.map +1 -0
- package/lib/index.d.ts +10 -3
- package/lib/index.js +3935 -22
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/lib/contracts.js.map +0 -1
package/lib/contracts.d.ts
CHANGED
|
@@ -1,5 +1,1799 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
2
|
+
import { Context, Service } from "@deepseek-ai/cordis";
|
|
3
|
+
//#region ../dsh-model-route/src/route.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Shared model-route value contract.
|
|
6
|
+
*
|
|
7
|
+
* A feature plugin stores its model override as a ModelRoute on its own
|
|
8
|
+
* settings page. Empty provider/model means "follow the host default model".
|
|
9
|
+
* Pure and browser-safe: no cordis, no React, no schema library.
|
|
10
|
+
*/
|
|
11
|
+
/** A concrete provider model a feature call should use. */
|
|
12
|
+
interface ModelRoute {
|
|
13
|
+
provider: string;
|
|
14
|
+
model: string;
|
|
15
|
+
reasoningEffort?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Empty route: no explicit model, the feature follows the host default. */
|
|
18
|
+
declare function defaultModelRoute(): ModelRoute;
|
|
19
|
+
/**
|
|
20
|
+
* Coerce a stored value into a ModelRoute. Anything malformed collapses to the
|
|
21
|
+
* empty route, matching the per-plugin normalizers this contract replaces.
|
|
22
|
+
*/
|
|
23
|
+
declare function normalizeModelRoute(value: unknown): ModelRoute;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-brand@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-brand/lib/types/index.d.ts
|
|
26
|
+
/**
|
|
27
|
+
* Duplicate-install-safe nominal primitive helpers.
|
|
28
|
+
*
|
|
29
|
+
* A brand makes structurally identical strings or numbers non-interchangeable
|
|
30
|
+
* at the type level: a `SessionId` cannot be passed where a `ToolCallId` is
|
|
31
|
+
* expected, and an event sequence cannot be passed as a log offset. Comparison,
|
|
32
|
+
* logging, and serialization retain the underlying primitive behavior.
|
|
33
|
+
*
|
|
34
|
+
* This package owns no concrete domain value and keeps no runtime identity or mutable
|
|
35
|
+
* state, so independently installed copies produce interchangeable values.
|
|
36
|
+
*
|
|
37
|
+
* @module @deepseek-ai/dsh-brand
|
|
38
|
+
*/
|
|
39
|
+
declare const BRAND: unique symbol;
|
|
40
|
+
/** A string carrying a compile-time-only brand `B`. */
|
|
41
|
+
type Branded<B extends string> = string & {
|
|
42
|
+
readonly [BRAND]: B;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-attachment@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-brand_e7889bcf9ed97f1d4ef6362f396bd073/node_modules/@deepseek-ai/dsh-attachment/lib/types/error.d.ts
|
|
46
|
+
declare const ATTACHMENT_ERROR_CODES: readonly ["TOO_MANY_IMAGES", "IMAGES_TOO_LARGE", "UNSUPPORTED_IMAGE_TYPE", "INVALID_IMAGE_BASE64", "INVALID_IMAGE", "IMAGE_TYPE_MISMATCH", "IMAGE_TOO_LARGE", "IMAGE_TOO_MANY_PIXELS", "IMAGE_DIMENSION_TOO_LARGE", "INVALID_FILE_BASE64", "INVALID_ATTACHMENT_REF", "ATTACHMENT_CORRUPT", "ATTACHMENT_WRITE_FAILED", "ATTACHMENT_NOT_FOUND", "ATTACHMENT_READ_FAILED", "ATTACHMENT_PROJECTION_UNSUPPORTED", "ATTACHMENT_FILES_UNSUPPORTED"];
|
|
47
|
+
/** Stable attachment failure codes used for protocol error routing. */
|
|
48
|
+
type AttachmentErrorCode = typeof ATTACHMENT_ERROR_CODES[number];
|
|
49
|
+
/**
|
|
50
|
+
* Stable failures suitable for host RPC error mapping.
|
|
51
|
+
*
|
|
52
|
+
* Deliberately re-implements the `HarnessError` shape instead of extending it:
|
|
53
|
+
* the base lives in `@deepseek-ai/dsh-llm`, which itself depends on this
|
|
54
|
+
* package (`ImageBlock` references `ImageAttachmentRef`), so sharing the base
|
|
55
|
+
* would create a dependency cycle. Consumers route on `code`, never on the
|
|
56
|
+
* prototype chain, so the shapes stay interchangeable at the wire boundary.
|
|
57
|
+
*/
|
|
58
|
+
declare class AttachmentError extends Error {
|
|
59
|
+
/** Stable machine-routing failure code. */
|
|
60
|
+
readonly code: AttachmentErrorCode;
|
|
61
|
+
/**
|
|
62
|
+
* @param message - human-readable failure description without raw bytes or host paths.
|
|
63
|
+
* @param code - stable machine-routing code.
|
|
64
|
+
* @param options - optional chained cause.
|
|
65
|
+
*/
|
|
66
|
+
constructor(message: string, code: AttachmentErrorCode, options?: ErrorOptions);
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-attachment@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-brand_e7889bcf9ed97f1d4ef6362f396bd073/node_modules/@deepseek-ai/dsh-attachment/lib/types/brand.d.ts
|
|
70
|
+
/** Opaque content-addressed identifier for one immutable attachment object. */
|
|
71
|
+
type AttachmentId = Branded<'AttachmentId'>;
|
|
72
|
+
/**
|
|
73
|
+
* Brand a validated storage identifier.
|
|
74
|
+
* @param value - backend-produced opaque identifier.
|
|
75
|
+
* @returns the branded identifier.
|
|
76
|
+
*/
|
|
77
|
+
declare function AttachmentId(value: string): AttachmentId;
|
|
78
|
+
/** Opaque deterministic identity for one request-image transformation. */
|
|
79
|
+
type ImageVariantId = Branded<'ImageVariantId'>;
|
|
80
|
+
/**
|
|
81
|
+
* Brand a validated request-image transformation identifier.
|
|
82
|
+
* @param value - attachment-provider-produced opaque identifier.
|
|
83
|
+
* @returns the branded identifier.
|
|
84
|
+
*/
|
|
85
|
+
declare function ImageVariantId(value: string): ImageVariantId;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-attachment@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-brand_e7889bcf9ed97f1d4ef6362f396bd073/node_modules/@deepseek-ai/dsh-attachment/lib/types/types.d.ts
|
|
88
|
+
/** Raster image formats accepted by the version-one attachment path. */
|
|
89
|
+
type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
90
|
+
/** Durable, serializable reference to one immutable normalized image. */
|
|
91
|
+
interface ImageAttachmentRef {
|
|
92
|
+
/** Opaque storage identifier; never a filesystem path or bearer URL. */
|
|
93
|
+
attachmentId: AttachmentId;
|
|
94
|
+
/** Media type verified from the stored bytes. */
|
|
95
|
+
mediaType: ImageMediaType;
|
|
96
|
+
/** Exact encoded byte length. */
|
|
97
|
+
bytes: number;
|
|
98
|
+
/** Intrinsic encoded width in pixels. */
|
|
99
|
+
width: number;
|
|
100
|
+
/** Intrinsic encoded height in pixels. */
|
|
101
|
+
height: number;
|
|
102
|
+
/** Optional display name stripped of local path information. */
|
|
103
|
+
name?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Input dimensions after applying EXIF orientation and before normalization
|
|
106
|
+
* scaling. Present only when normalization reduced the image.
|
|
107
|
+
*/
|
|
108
|
+
originalDimensions?: {
|
|
109
|
+
width: number;
|
|
110
|
+
height: number;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Durable, serializable reference to one verbatim stored file. Files are
|
|
115
|
+
* stored byte-for-byte with no normalization; `attachmentId` is the sha256
|
|
116
|
+
* digest of exactly those bytes.
|
|
117
|
+
*/
|
|
118
|
+
interface FileAttachmentRef {
|
|
119
|
+
/** Opaque content-addressed storage identifier; never a filesystem path or bearer URL. */
|
|
120
|
+
attachmentId: AttachmentId;
|
|
121
|
+
/** Sanitized display filename, also the stored object's leaf name. */
|
|
122
|
+
name: string;
|
|
123
|
+
/** Exact byte length. */
|
|
124
|
+
bytes: number;
|
|
125
|
+
}
|
|
126
|
+
/** Base64-encoded file upload accompanying one wire request. */
|
|
127
|
+
interface EncodedFileAttachment {
|
|
128
|
+
/** Canonical base64 encoding of the file bytes. */
|
|
129
|
+
data: string;
|
|
130
|
+
/** Optional display name; it is never interpreted as a path. */
|
|
131
|
+
name?: string;
|
|
132
|
+
}
|
|
133
|
+
/** Request to durably commit one file verbatim. */
|
|
134
|
+
interface SaveFileAttachment {
|
|
135
|
+
data: Uint8Array;
|
|
136
|
+
/** Optional browser/provider display name; it is never interpreted as a path. */
|
|
137
|
+
name?: string;
|
|
138
|
+
}
|
|
139
|
+
/** Request to durably commit one file from bounded byte chunks. */
|
|
140
|
+
interface SaveFileStreamAttachment {
|
|
141
|
+
/** Exact file bytes in order; providers must not retain the complete sequence in memory. */
|
|
142
|
+
data: AsyncIterable<Uint8Array>;
|
|
143
|
+
/** Optional cancellation for source reads and storage writes. */
|
|
144
|
+
signal?: AbortSignal;
|
|
145
|
+
/** Optional browser/provider display name; it is never interpreted as a path. */
|
|
146
|
+
name?: string;
|
|
147
|
+
}
|
|
148
|
+
/** Deployment-resolved limits used by upload admission and request buffering. */
|
|
149
|
+
interface ImageAttachmentLimits {
|
|
150
|
+
maxImageBytes: number;
|
|
151
|
+
maxImagesPerMessage: number;
|
|
152
|
+
maxMessageImageBytes: number;
|
|
153
|
+
maxImagePixels: number;
|
|
154
|
+
/** Maximum intrinsic width and maximum intrinsic height in pixels for one image. */
|
|
155
|
+
maxImageDimension: number;
|
|
156
|
+
mediaTypes: readonly ImageMediaType[];
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Browser-submitted prompt content accepted by Host prompt endpoints; the
|
|
160
|
+
* accepting Host promotes image parts to durable references through
|
|
161
|
+
* `ctx.attachments.admitPromptContent()` before any message is created, so a wire caller can
|
|
162
|
+
* never cite an attachment it did not upload.
|
|
163
|
+
*/
|
|
164
|
+
type PromptContentPart = {
|
|
165
|
+
readonly type: 'text';
|
|
166
|
+
readonly text: string;
|
|
167
|
+
} | {
|
|
168
|
+
readonly type: 'image';
|
|
169
|
+
readonly mediaType: ImageMediaType;
|
|
170
|
+
readonly data: string;
|
|
171
|
+
readonly name?: string;
|
|
172
|
+
};
|
|
173
|
+
/** Host prompt content whose file receipts are resolved and whose image bytes await admission. */
|
|
174
|
+
type AttachmentAdmissionPart = PromptContentPart | {
|
|
175
|
+
readonly type: 'file';
|
|
176
|
+
readonly attachment: FileAttachmentRef;
|
|
177
|
+
};
|
|
178
|
+
/** Host-admitted prompt content with every attachment represented by its durable reference. */
|
|
179
|
+
type AdmittedPromptContentPart = {
|
|
180
|
+
readonly type: 'text';
|
|
181
|
+
readonly text: string;
|
|
182
|
+
} | {
|
|
183
|
+
readonly type: 'image';
|
|
184
|
+
readonly attachment: ImageAttachmentRef;
|
|
185
|
+
} | {
|
|
186
|
+
readonly type: 'file';
|
|
187
|
+
readonly attachment: FileAttachmentRef;
|
|
188
|
+
};
|
|
189
|
+
/** Request to validate and durably commit one image. */
|
|
190
|
+
interface SaveImageAttachment {
|
|
191
|
+
data: Uint8Array;
|
|
192
|
+
/** Caller-declared media type, checked against fully decoded bytes. */
|
|
193
|
+
mediaType: ImageMediaType;
|
|
194
|
+
/** Optional browser/provider display name; it is never interpreted as a path. */
|
|
195
|
+
name?: string;
|
|
196
|
+
}
|
|
197
|
+
/** Stored image bytes returned after reference and digest verification. */
|
|
198
|
+
interface StoredImageAttachment {
|
|
199
|
+
ref: ImageAttachmentRef;
|
|
200
|
+
data: Uint8Array;
|
|
201
|
+
}
|
|
202
|
+
/** Deterministic request-image target selected by one exact model route for one attachment. */
|
|
203
|
+
interface ImageRequestTarget {
|
|
204
|
+
/** Target width in pixels; a target above the source keeps the source width. */
|
|
205
|
+
width: number;
|
|
206
|
+
/** Target height in pixels; a target above the source keeps the source height. */
|
|
207
|
+
height: number;
|
|
208
|
+
/** Encoded-byte target before base64 expansion or Files API upload; the smallest quality-ladder output is kept when no quality fits. */
|
|
209
|
+
maxBytes: number;
|
|
210
|
+
}
|
|
211
|
+
/** Cached request version derived from one provider-independent normalized attachment. */
|
|
212
|
+
interface RequestImageAttachment {
|
|
213
|
+
/** Cache and upload-index key over the attachment id, policy, and fixed encoder parameters. */
|
|
214
|
+
variantId: ImageVariantId;
|
|
215
|
+
/** Durable normalized attachment from which this request version was derived. */
|
|
216
|
+
attachment: ImageAttachmentRef;
|
|
217
|
+
/** Encoded request bytes. */
|
|
218
|
+
data: Uint8Array;
|
|
219
|
+
mediaType: ImageMediaType;
|
|
220
|
+
bytes: number;
|
|
221
|
+
width: number;
|
|
222
|
+
height: number;
|
|
223
|
+
/** Provider-compatible sample depth proven after request encoding. */
|
|
224
|
+
depth: 'uchar';
|
|
225
|
+
/** Provider-compatible color space proven after request encoding. */
|
|
226
|
+
space: 'srgb';
|
|
227
|
+
/** Whether the encoded request version retains an alpha channel. */
|
|
228
|
+
hasAlpha: boolean;
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-attachment@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-brand_e7889bcf9ed97f1d4ef6362f396bd073/node_modules/@deepseek-ai/dsh-attachment/lib/types/index.d.ts
|
|
232
|
+
declare module '@deepseek-ai/cordis' {
|
|
233
|
+
interface Context {
|
|
234
|
+
attachments: AttachmentStore;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/** Immutable binary attachment service. Implementations validate bytes before publishing a reference. */
|
|
238
|
+
declare abstract class AttachmentStore extends Service {
|
|
239
|
+
constructor(ctx: Context);
|
|
240
|
+
/** Deployment-resolved image policy used by authoritative and fast-path validation. */
|
|
241
|
+
abstract readonly imageLimits: ImageAttachmentLimits;
|
|
242
|
+
/**
|
|
243
|
+
* Validate one image without persisting it.
|
|
244
|
+
* Batch callers validate every member before saving any member.
|
|
245
|
+
* @param input - encoded bytes, declared media type, and optional display name.
|
|
246
|
+
* @returns completion after the encoded raster has been fully decoded.
|
|
247
|
+
*/
|
|
248
|
+
abstract validateImage(input: SaveImageAttachment): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Validate one ordered image batch before committing any member.
|
|
251
|
+
* Validation failures start no writes; storage failures return no partial
|
|
252
|
+
* references, although already published content-addressed objects may stay
|
|
253
|
+
* unreachable until a future retention policy collects them.
|
|
254
|
+
* @param inputs - encoded images in their owning message order.
|
|
255
|
+
* @returns durable references in the exact input order.
|
|
256
|
+
*/
|
|
257
|
+
protected validateImageBatch(inputs: readonly SaveImageAttachment[]): void;
|
|
258
|
+
/**
|
|
259
|
+
* Validate and durably commit one ordered image batch.
|
|
260
|
+
* @param inputs - encoded images in owning-message order.
|
|
261
|
+
* @returns durable normalized attachment references in the same order after every member succeeds.
|
|
262
|
+
*/
|
|
263
|
+
saveImages(inputs: readonly SaveImageAttachment[]): Promise<readonly ImageAttachmentRef[]>;
|
|
264
|
+
/**
|
|
265
|
+
* Admit one Host prompt and replace each uploaded image with its durable reference.
|
|
266
|
+
* Text and durable file references pass through unchanged. A prompt without image parts performs no storage operation.
|
|
267
|
+
* @param content - prompt parts in message order after file receipt resolution.
|
|
268
|
+
* @returns admitted prompt parts in the same order as `content`.
|
|
269
|
+
* @throws AttachmentError when the image batch is refused.
|
|
270
|
+
*/
|
|
271
|
+
admitPromptContent(content: readonly AttachmentAdmissionPart[]): Promise<AdmittedPromptContentPart[]>;
|
|
272
|
+
/**
|
|
273
|
+
* Decode and durably commit one canonical base64 file upload.
|
|
274
|
+
* @param input - canonical base64 bytes and optional display name.
|
|
275
|
+
* @returns the durable content-addressed file reference.
|
|
276
|
+
* @throws AttachmentError when the encoding or storage operation is refused.
|
|
277
|
+
*/
|
|
278
|
+
admitEncodedFile(input: EncodedFileAttachment): Promise<FileAttachmentRef>;
|
|
279
|
+
/**
|
|
280
|
+
* Identify a failure emitted by this attachment capability by its stable code.
|
|
281
|
+
* @param error - value caught from an attachment operation.
|
|
282
|
+
* @returns whether the value is an attachment failure.
|
|
283
|
+
*/
|
|
284
|
+
isAttachmentError(error: unknown): error is AttachmentError;
|
|
285
|
+
/**
|
|
286
|
+
* Validate and durably commit one image before its owning session event is appended.
|
|
287
|
+
* The returned reference describes the persisted normalized image. When
|
|
288
|
+
* normalization reduces the raster, its `originalDimensions` records the
|
|
289
|
+
* orientation-applied input dimensions.
|
|
290
|
+
* @param input - encoded bytes, declared media type, and optional display name.
|
|
291
|
+
* @returns the durable content-addressed normalized image reference.
|
|
292
|
+
*/
|
|
293
|
+
abstract saveImage(input: SaveImageAttachment): Promise<ImageAttachmentRef>;
|
|
294
|
+
/**
|
|
295
|
+
* Read one image and verify that bytes still match the recorded reference.
|
|
296
|
+
* @param ref - durable reference from the session log.
|
|
297
|
+
* @param signal - optional cancellation for backend read and verification work.
|
|
298
|
+
* @returns the verified bytes and normalized attachment reference.
|
|
299
|
+
* @throws the signal reason when aborted, or a storage error when verification fails.
|
|
300
|
+
*/
|
|
301
|
+
abstract readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise<StoredImageAttachment>;
|
|
302
|
+
/**
|
|
303
|
+
* Locate the provider-owned normalized object in the harness host filesystem.
|
|
304
|
+
* @param ref - durable normalized attachment reference.
|
|
305
|
+
* @returns an absolute host path, or undefined when this backend is not host-file-backed.
|
|
306
|
+
* @throws an AttachmentError when the durable reference is invalid.
|
|
307
|
+
*/
|
|
308
|
+
imageHostPath(ref: ImageAttachmentRef): string | undefined;
|
|
309
|
+
/**
|
|
310
|
+
* Durably commit one file byte-for-byte before its owning session event is
|
|
311
|
+
* appended. Files carry no admission limits: any byte content and length is
|
|
312
|
+
* accepted, and the stored object is the exact submitted bytes. Backends
|
|
313
|
+
* without verbatim file storage keep this default rejection.
|
|
314
|
+
* @param input - exact bytes and optional display name.
|
|
315
|
+
* @returns the durable content-addressed file reference.
|
|
316
|
+
*/
|
|
317
|
+
saveFile(input: SaveFileAttachment): Promise<FileAttachmentRef>;
|
|
318
|
+
/**
|
|
319
|
+
* Durably commit one file byte-for-byte from bounded chunks. Providers must
|
|
320
|
+
* apply backpressure and must not collect the complete file in memory.
|
|
321
|
+
* Backends without streamed verbatim storage keep this default rejection.
|
|
322
|
+
* @param input - ordered exact bytes, optional cancellation, and display name.
|
|
323
|
+
* @returns the durable content-addressed file reference.
|
|
324
|
+
*/
|
|
325
|
+
saveFileStream(input: SaveFileStreamAttachment): Promise<FileAttachmentRef>;
|
|
326
|
+
/**
|
|
327
|
+
* Read and verify one verbatim stored file as bounded chunks. Providers must
|
|
328
|
+
* not collect the complete file in memory. Backends without verbatim file
|
|
329
|
+
* reads keep this default rejection.
|
|
330
|
+
* @param ref - durable reference from the session log.
|
|
331
|
+
* @param signal - optional cancellation for backend reads and verification work.
|
|
332
|
+
* @returns exact file bytes in order; integrity failures reject the iteration.
|
|
333
|
+
*/
|
|
334
|
+
readFileStream(ref: FileAttachmentRef, signal?: AbortSignal): AsyncIterable<Uint8Array>;
|
|
335
|
+
/**
|
|
336
|
+
* Locate the verbatim stored file object in the harness host filesystem.
|
|
337
|
+
* @param ref - durable file reference.
|
|
338
|
+
* @returns an absolute host path, or undefined when this backend is not host-file-backed.
|
|
339
|
+
* @throws an AttachmentError when the durable reference is invalid.
|
|
340
|
+
*/
|
|
341
|
+
fileHostPath(ref: FileAttachmentRef): string | undefined;
|
|
342
|
+
/**
|
|
343
|
+
* Generate or read one deterministic model-request version from the stored normalized image.
|
|
344
|
+
* @param ref - durable provider-independent normalized attachment reference.
|
|
345
|
+
* @param target - route-chosen dimensions and byte target; an unmet byte target yields the smallest ladder output.
|
|
346
|
+
* @param signal - optional cancellation.
|
|
347
|
+
* @returns request bytes and the cache/upload identity covering every transform input.
|
|
348
|
+
*/
|
|
349
|
+
readImageRequest(ref: ImageAttachmentRef, target: ImageRequestTarget, signal?: AbortSignal): Promise<RequestImageAttachment>;
|
|
350
|
+
}
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-llm/lib/types/brand.d.ts
|
|
353
|
+
/** Stable identity carried by one message across inbox, log, and model-request boundaries. */
|
|
354
|
+
type MessageId = Branded<'MessageId'>;
|
|
355
|
+
/**
|
|
356
|
+
* Brand a message identifier.
|
|
357
|
+
* @param id - the opaque message identifier.
|
|
358
|
+
* @returns the same string with the message-id brand.
|
|
359
|
+
*/
|
|
360
|
+
declare function MessageId(id: string): MessageId;
|
|
361
|
+
/**
|
|
362
|
+
* Correlates a model-issued tool call with its result. Provider-issued for
|
|
363
|
+
* real adapters; synthesized by mocks/assembler fallbacks.
|
|
364
|
+
*/
|
|
365
|
+
type ToolCallId = Branded<'ToolCallId'>;
|
|
366
|
+
/**
|
|
367
|
+
* Brand a string as a {@link ToolCallId}.
|
|
368
|
+
* @param id - the provider-issued or synthesized call id.
|
|
369
|
+
* @returns the same string with the tool-call-id brand.
|
|
370
|
+
*/
|
|
371
|
+
declare function ToolCallId(id: string): ToolCallId;
|
|
372
|
+
/** Provider-issued request identifier retained for diagnostics across package boundaries. */
|
|
373
|
+
type ProviderRequestId = Branded<'ProviderRequestId'>;
|
|
374
|
+
/**
|
|
375
|
+
* Brand a provider-issued request identifier.
|
|
376
|
+
* @param id - the opaque provider-issued string.
|
|
377
|
+
* @returns the same string, branded; no validation is performed.
|
|
378
|
+
*/
|
|
379
|
+
declare function ProviderRequestId(id: string): ProviderRequestId;
|
|
380
|
+
/** Adapter-owned identifier for one model's selectable reasoning effort. */
|
|
381
|
+
type ReasoningEffortId = Branded<'ReasoningEffortId'>;
|
|
382
|
+
/**
|
|
383
|
+
* Brand an adapter-owned reasoning-effort identifier.
|
|
384
|
+
* @param id - the opaque identifier exposed by one model capability.
|
|
385
|
+
* @returns the same string, branded; no validation is performed.
|
|
386
|
+
*/
|
|
387
|
+
declare function ReasoningEffortId(id: string): ReasoningEffortId;
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-llm/lib/types/message.d.ts
|
|
390
|
+
/** Provider/model identity and adapter-private replay data for an assistant message. */
|
|
391
|
+
interface AssistantProviderMetadata {
|
|
392
|
+
/** Provider route that produced the message. */
|
|
393
|
+
provider: string;
|
|
394
|
+
/** Provider model id that produced the message. */
|
|
395
|
+
model: string;
|
|
396
|
+
/**
|
|
397
|
+
* Lossless-JSON adapter state needed to replay the provider response.
|
|
398
|
+
* `LlmRuntime` exposes it to a target adapter only when that adapter instance
|
|
399
|
+
* currently owns both this historical provider and the target provider.
|
|
400
|
+
*/
|
|
401
|
+
replayState?: unknown;
|
|
402
|
+
}
|
|
403
|
+
/** Required source of an assistant message produced by a routed model. */
|
|
404
|
+
interface ModelMessageSource extends AssistantProviderMetadata {
|
|
405
|
+
kind: 'model';
|
|
406
|
+
}
|
|
407
|
+
/** Required source of a tool-role message carrying one tool result. */
|
|
408
|
+
interface ToolMessageSource {
|
|
409
|
+
kind: 'tool';
|
|
410
|
+
callId: ToolCallId;
|
|
411
|
+
}
|
|
412
|
+
/** Required source of a system-role message produced by the system-prompt plugin. */
|
|
413
|
+
interface SystemPromptMessageSource {
|
|
414
|
+
kind: 'system-prompt';
|
|
415
|
+
}
|
|
416
|
+
/** One named contribution to a `snapshot`-form context, in assembly order. */
|
|
417
|
+
interface ContextSnapshotSection {
|
|
418
|
+
/** The contributing subsystem's name. */
|
|
419
|
+
readonly name: string;
|
|
420
|
+
/** That contribution's model-facing text, exactly as assembled. */
|
|
421
|
+
readonly text: string;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Producer-declared {@link ContextForm} and the fields that form requires,
|
|
425
|
+
* mixed into the source types that carry one.
|
|
426
|
+
*
|
|
427
|
+
* Discriminated by `form` so a producer cannot select a form without the
|
|
428
|
+
* fields needed to present it: a `notice` must record its one-line
|
|
429
|
+
* account, a `snapshot` its sections. Omitting `form` stays valid — an
|
|
430
|
+
* undeclared context is the documented default.
|
|
431
|
+
*/
|
|
432
|
+
type ContextFormed = {
|
|
433
|
+
readonly form?: never;
|
|
434
|
+
} | {
|
|
435
|
+
readonly form: 'instructions';
|
|
436
|
+
} | {
|
|
437
|
+
readonly form: 'catalog';
|
|
438
|
+
} | {
|
|
439
|
+
readonly form: 'snapshot';
|
|
440
|
+
/** The named contributions this snapshot assembled, in order. */
|
|
441
|
+
readonly sections: readonly ContextSnapshotSection[];
|
|
442
|
+
} | {
|
|
443
|
+
readonly form: 'notice';
|
|
444
|
+
/** One-line account of what happened, shown without expanding the row. */
|
|
445
|
+
readonly summary: string;
|
|
446
|
+
} | {
|
|
447
|
+
readonly form: 'relay';
|
|
448
|
+
} | {
|
|
449
|
+
readonly form: 'recall';
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Where a message (or injected content) came from, in the harness's own
|
|
453
|
+
* vocabulary. Merge-extensible sum type — each producer declares its own
|
|
454
|
+
* `kind` in its own module; there is no shared catch-all `plugin` kind.
|
|
455
|
+
* Model and tool sources answer their role messages; user messages carry any
|
|
456
|
+
* producer's kind, and consumers fall through unknown kinds.
|
|
457
|
+
*/
|
|
458
|
+
interface MessageSourceMap {
|
|
459
|
+
user: {
|
|
460
|
+
kind: 'user';
|
|
461
|
+
};
|
|
462
|
+
model: ModelMessageSource;
|
|
463
|
+
tool: ToolMessageSource;
|
|
464
|
+
'system-prompt': SystemPromptMessageSource;
|
|
465
|
+
}
|
|
466
|
+
/** Any known message source, derived from {@link MessageSourceMap}; switch on `kind` and fall through unknowns (merge-extensible). */
|
|
467
|
+
type MessageSource = MessageSourceMap[keyof MessageSourceMap];
|
|
468
|
+
/** Shared immutable fields of every conversation message. */
|
|
469
|
+
interface MessageBase {
|
|
470
|
+
/** Stable identity preserved across every representation boundary. */
|
|
471
|
+
readonly id: MessageId;
|
|
472
|
+
/** Exact model-facing blocks. */
|
|
473
|
+
readonly content: readonly ContentBlock[];
|
|
474
|
+
/** Required source fields supplied by the producer.
|
|
475
|
+
* @persistenceSource user developer
|
|
476
|
+
*/
|
|
477
|
+
readonly source: MessageSource;
|
|
478
|
+
}
|
|
479
|
+
/** A rendered system prompt attributed to the system-prompt producer; empty content sends no prompt. */
|
|
480
|
+
interface SystemMessage extends MessageBase {
|
|
481
|
+
readonly role: 'system';
|
|
482
|
+
readonly source: MessageSourceMap['system-prompt'];
|
|
483
|
+
}
|
|
484
|
+
/** Incremental agent session changes in conversation order, currently tool additions and removals. */
|
|
485
|
+
interface DeveloperMessage extends MessageBase {
|
|
486
|
+
readonly role: 'developer';
|
|
487
|
+
}
|
|
488
|
+
/** A user-role specialization of the shared message representation. */
|
|
489
|
+
interface UserMessage extends MessageBase {
|
|
490
|
+
readonly role: 'user';
|
|
491
|
+
}
|
|
492
|
+
/** A model-produced assistant specialization of the shared message representation. */
|
|
493
|
+
interface AssistantMessage extends MessageBase {
|
|
494
|
+
readonly role: 'assistant';
|
|
495
|
+
readonly source: ModelMessageSource;
|
|
496
|
+
}
|
|
497
|
+
/** A first-class tool-role message carrying the result of one tool invocation. */
|
|
498
|
+
interface ToolResultMessage extends MessageBase {
|
|
499
|
+
readonly role: 'tool';
|
|
500
|
+
readonly source: ToolMessageSource;
|
|
501
|
+
/** Provider-issued id of the tool call this message answers. */
|
|
502
|
+
readonly toolCallId: ToolCallId;
|
|
503
|
+
/** Whether the tool invocation failed. */
|
|
504
|
+
readonly isError?: boolean;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* The conversation messages persisted by Session, keyed by role. This map is
|
|
508
|
+
* closed because every model-visible role must have a durable Session event
|
|
509
|
+
* and an adapter projection.
|
|
510
|
+
*/
|
|
511
|
+
interface MessageRoleMap {
|
|
512
|
+
system: SystemMessage;
|
|
513
|
+
developer: DeveloperMessage;
|
|
514
|
+
user: UserMessage;
|
|
515
|
+
assistant: AssistantMessage;
|
|
516
|
+
tool: ToolResultMessage;
|
|
517
|
+
}
|
|
518
|
+
/** Any persisted conversation message, discriminated by its `role`. */
|
|
519
|
+
type Message = MessageRoleMap[keyof MessageRoleMap];
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-llm/lib/types/types.d.ts
|
|
522
|
+
declare module '@deepseek-ai/cordis' {
|
|
523
|
+
interface Events {
|
|
524
|
+
/**
|
|
525
|
+
* The provider topology changed: an adapter registered or unregistered
|
|
526
|
+
* routes, or the configurable-provider directory gained or lost entries.
|
|
527
|
+
* This payload-free registry notification fires at each commit point
|
|
528
|
+
* (including registration disposal); consumers re-read `listProviders()`,
|
|
529
|
+
* `listModels()`, or `listConfigurableProviders()` for the new state.
|
|
530
|
+
* Observer failures are contained and cannot veto the registry mutation.
|
|
531
|
+
* @mode emit
|
|
532
|
+
*/
|
|
533
|
+
'llm/adapters-updated'(): void;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
/** Serializable provider or transport failure facts; policy decides whether they are retryable. */
|
|
537
|
+
interface LlmFailure {
|
|
538
|
+
/** Human-readable provider or transport failure. */
|
|
539
|
+
readonly message: string;
|
|
540
|
+
/** Stable provider-neutral machine-routing code. */
|
|
541
|
+
readonly code: string;
|
|
542
|
+
/** HTTP status returned by the provider, when available. */
|
|
543
|
+
readonly status?: number;
|
|
544
|
+
/** Provider-requested delay in milliseconds, when valid and available. */
|
|
545
|
+
readonly providerRetryAfterMs?: number;
|
|
546
|
+
/** Opaque provider-issued request identifier for diagnostics. */
|
|
547
|
+
readonly requestId?: ProviderRequestId;
|
|
548
|
+
/**
|
|
549
|
+
* With code `IMAGE_OFFLOAD_REQUIRED`: how many more of the oldest retained
|
|
550
|
+
* image occurrences the route needs offloaded before the same request fits
|
|
551
|
+
* its exact byte accounting. `dsh-compaction-image-offload` records the
|
|
552
|
+
* selected occurrences in an `image/offload` event and retries the step.
|
|
553
|
+
*/
|
|
554
|
+
readonly offloadImages?: number;
|
|
555
|
+
}
|
|
556
|
+
/** Plain text visible to the end user. */
|
|
557
|
+
interface TextBlock {
|
|
558
|
+
type: 'text';
|
|
559
|
+
text: string;
|
|
560
|
+
}
|
|
561
|
+
/** Reasoning / thinking content, distinct from visible text. */
|
|
562
|
+
interface ReasoningBlock {
|
|
563
|
+
type: 'reasoning';
|
|
564
|
+
text: string;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* A durable raster image reference, valid in user or assistant content. The
|
|
568
|
+
* block is deliberately role-neutral; assistant-side rendering is forward
|
|
569
|
+
* compatibility — the current production adapters declare text-only output,
|
|
570
|
+
* so only user messages may carry images.
|
|
571
|
+
*/
|
|
572
|
+
interface ImageBlock {
|
|
573
|
+
type: 'image';
|
|
574
|
+
/** Immutable bytes and intrinsic display metadata owned by the attachment service. */
|
|
575
|
+
attachment: ImageAttachmentRef;
|
|
576
|
+
/**
|
|
577
|
+
* Derived from a durable image-offload decision or preserved by a message
|
|
578
|
+
* rewrite. Every route sends placeholder text naming the image and its
|
|
579
|
+
* available read-only path instead of image bytes.
|
|
580
|
+
*/
|
|
581
|
+
offloaded?: true;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* A durable verbatim file reference, valid in user content. Files never reach
|
|
585
|
+
* a provider natively: request assembly projects every occurrence to
|
|
586
|
+
* deterministic handle text (name, byte size, and the read-only saved path),
|
|
587
|
+
* so adapters and providers see text in its place while the durable log keeps
|
|
588
|
+
* the structured reference for presentation and authorization.
|
|
589
|
+
*/
|
|
590
|
+
interface FileBlock {
|
|
591
|
+
type: 'file';
|
|
592
|
+
/** Immutable verbatim bytes and display metadata owned by the attachment service. */
|
|
593
|
+
attachment: FileAttachmentRef;
|
|
594
|
+
}
|
|
595
|
+
/** A tool invocation requested by the model. */
|
|
596
|
+
interface ToolCallBlock {
|
|
597
|
+
type: 'tool-call';
|
|
598
|
+
/** Provider-issued call id; correlates with the matching tool result. */
|
|
599
|
+
id: ToolCallId;
|
|
600
|
+
name: string;
|
|
601
|
+
/** Raw JSON string as produced by the model. */
|
|
602
|
+
arguments: string;
|
|
603
|
+
}
|
|
604
|
+
/** Activates a tool definition from the developer event's referenced request header. */
|
|
605
|
+
interface ToolAdditionBlock {
|
|
606
|
+
type: 'tool-addition';
|
|
607
|
+
/** Name of exactly one tool in the referenced historical header. */
|
|
608
|
+
toolName: string;
|
|
609
|
+
/**
|
|
610
|
+
* Reserved against inline definitions; the historical request header owns the schema.
|
|
611
|
+
* @persistenceReserved
|
|
612
|
+
*/
|
|
613
|
+
tool?: never;
|
|
614
|
+
}
|
|
615
|
+
/** Records the dynamic removal of a tool identified by its session-local name. */
|
|
616
|
+
interface ToolRemovalBlock {
|
|
617
|
+
type: 'tool-removal';
|
|
618
|
+
toolName: string;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Merge-extensible content blocks keyed by `type`. New core blocks must land
|
|
622
|
+
* with adapter, UI, and compaction support. Tool-change blocks belong to
|
|
623
|
+
* developer messages; `projectToolUpdates` selects what each route receives.
|
|
624
|
+
*/
|
|
625
|
+
interface ContentBlockMap {
|
|
626
|
+
'text': TextBlock;
|
|
627
|
+
'reasoning': ReasoningBlock;
|
|
628
|
+
'image': ImageBlock;
|
|
629
|
+
'file': FileBlock;
|
|
630
|
+
'tool-call': ToolCallBlock;
|
|
631
|
+
'tool-addition': ToolAdditionBlock;
|
|
632
|
+
'tool-removal': ToolRemovalBlock;
|
|
633
|
+
}
|
|
634
|
+
/** The block `type` tag vocabulary; widens as plugins add entries to {@link ContentBlockMap}. */
|
|
635
|
+
type ContentBlockType = keyof ContentBlockMap;
|
|
636
|
+
/** Any known content block, derived from {@link ContentBlockMap}; switch on `type` and fall through unknowns (merge-extensible). */
|
|
637
|
+
type ContentBlock = ContentBlockMap[ContentBlockType];
|
|
638
|
+
/**
|
|
639
|
+
* Why a model response stopped.
|
|
640
|
+
* Merge-extensible so adapters can surface provider-specific reasons.
|
|
641
|
+
*/
|
|
642
|
+
interface FinishReasonMap {
|
|
643
|
+
'stop': {
|
|
644
|
+
kind: 'stop';
|
|
645
|
+
};
|
|
646
|
+
'tool-calls': {
|
|
647
|
+
kind: 'tool-calls';
|
|
648
|
+
};
|
|
649
|
+
'max-tokens': {
|
|
650
|
+
kind: 'max-tokens';
|
|
651
|
+
};
|
|
652
|
+
'aborted': {
|
|
653
|
+
kind: 'aborted';
|
|
654
|
+
failure: LlmFailure;
|
|
655
|
+
};
|
|
656
|
+
'error': {
|
|
657
|
+
kind: 'error';
|
|
658
|
+
failure: LlmFailure;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
/** Any known finish reason, derived from {@link FinishReasonMap}; switch on `kind` and fall through unknowns (merge-extensible). */
|
|
662
|
+
type FinishReason = FinishReasonMap[keyof FinishReasonMap];
|
|
663
|
+
/**
|
|
664
|
+
* Token accounting for one model call (cache fields are optional).
|
|
665
|
+
*
|
|
666
|
+
* Counts are DISJOINT: `inputTokens` is uncached input only; cached input is
|
|
667
|
+
* reported separately as `cacheReadTokens`/`cacheWriteTokens` (billed input =
|
|
668
|
+
* sum of the three). Adapters whose providers fold cache hits into a total
|
|
669
|
+
* prompt count (DeepSeek's `prompt_tokens`) subtract them out.
|
|
670
|
+
*/
|
|
671
|
+
interface TokenUsage {
|
|
672
|
+
inputTokens: number;
|
|
673
|
+
outputTokens: number;
|
|
674
|
+
/**
|
|
675
|
+
* Exact full-call total including aggregate prompt and output tokens.
|
|
676
|
+
*
|
|
677
|
+
* Adapters preserve a provider total or derive it from authoritative
|
|
678
|
+
* aggregate prompt/output counters; they omit it when unavailable or
|
|
679
|
+
* inconsistent.
|
|
680
|
+
*/
|
|
681
|
+
totalTokens?: number;
|
|
682
|
+
cacheReadTokens?: number;
|
|
683
|
+
cacheWriteTokens?: number;
|
|
684
|
+
reasoningTokens?: number;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Request price of one ordered image occurrence under one exact model route's
|
|
688
|
+
* request projection. Every occurrence resolves to the pair the wire actually
|
|
689
|
+
* carries: provider visual tokens for a retained image, plus the model-visible
|
|
690
|
+
* text sent with or instead of it (request-preview handle, offload placeholder,
|
|
691
|
+
* or text-only substitution). The caller prices `text` with its own text
|
|
692
|
+
* estimator so provider pricing never fixes a text tokenization.
|
|
693
|
+
*/
|
|
694
|
+
interface LlmImageRequestPrice {
|
|
695
|
+
/** Provider visual tokens for the retained request image; 0 when only text represents this occurrence. */
|
|
696
|
+
visualTokens: number;
|
|
697
|
+
/** Model-visible text sent for this occurrence, to be priced by the caller's text estimator. */
|
|
698
|
+
text: string;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Provider-side request-image pricing for one exact model route. Implemented
|
|
702
|
+
* by adapters whose provider charges visual tokens; consumers (the token
|
|
703
|
+
* meter) resolve it synchronously per measurement, so implementations must not
|
|
704
|
+
* perform I/O.
|
|
705
|
+
*/
|
|
706
|
+
interface LlmImageRequestPricing {
|
|
707
|
+
/**
|
|
708
|
+
* Price every image occurrence of one request projection.
|
|
709
|
+
* @param images - surface image blocks in request order, one entry per occurrence; an `offloaded` block
|
|
710
|
+
* is priced as its placeholder text.
|
|
711
|
+
* @returns one price per occurrence, aligned by index with `images`.
|
|
712
|
+
*/
|
|
713
|
+
priceImages(images: readonly ImageBlock[]): readonly LlmImageRequestPrice[];
|
|
714
|
+
}
|
|
715
|
+
/** Display metadata for one registered provider route. */
|
|
716
|
+
interface LlmProviderInfo {
|
|
717
|
+
/** Provider route key used by {@link GenerateOptions.provider}. */
|
|
718
|
+
id: string;
|
|
719
|
+
/** Human-readable provider name for selectors and diagnostics. */
|
|
720
|
+
name: string;
|
|
721
|
+
}
|
|
722
|
+
/** Merge-extensible provider model modality vocabulary. */
|
|
723
|
+
interface ModelModalityMap {
|
|
724
|
+
text: 'text';
|
|
725
|
+
image: 'image';
|
|
726
|
+
}
|
|
727
|
+
/** Any declared provider model modality. */
|
|
728
|
+
type ModelModality = ModelModalityMap[keyof ModelModalityMap];
|
|
729
|
+
/**
|
|
730
|
+
* One provider route an adapter plugin can activate through configuration,
|
|
731
|
+
* whether or not the route is currently registered. Configuration surfaces
|
|
732
|
+
* merge this directory with `listProviders()` to offer every configurable
|
|
733
|
+
* provider alongside its live/dormant state.
|
|
734
|
+
*/
|
|
735
|
+
interface LlmConfigurableProvider {
|
|
736
|
+
/** Provider route key this entry activates when configured. */
|
|
737
|
+
provider: string;
|
|
738
|
+
/** Human-readable provider name for configuration surfaces. */
|
|
739
|
+
displayName: string;
|
|
740
|
+
/** User-settings namespace whose section configures this provider. */
|
|
741
|
+
settingsNs: string;
|
|
742
|
+
/**
|
|
743
|
+
* Path from that namespace's section root to this provider's profile
|
|
744
|
+
* object; empty when the whole section is the profile.
|
|
745
|
+
*/
|
|
746
|
+
settingsPath: readonly string[];
|
|
747
|
+
/**
|
|
748
|
+
* Whether the owning adapter knows this route only because configuration
|
|
749
|
+
* declared it — a gateway or self-hosted server it ships nothing about.
|
|
750
|
+
* Absent means the adapter draws no such distinction; false means it does
|
|
751
|
+
* and this route is one of its own. Only the adapter can answer: a stored
|
|
752
|
+
* profile is how a user-added route AND a corrected shipped one both look
|
|
753
|
+
* from outside.
|
|
754
|
+
*/
|
|
755
|
+
declared?: boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Route endpoint the adapter uses when the profile sets no `baseURL`; the
|
|
758
|
+
* adapter may still send an individual model to that model's own endpoint.
|
|
759
|
+
* Absent when the route has no fixed endpoint.
|
|
760
|
+
*/
|
|
761
|
+
defaultBaseURL?: string;
|
|
762
|
+
/** Environment variables used to construct a provider endpoint; absent when none are reported. */
|
|
763
|
+
baseURLEnv?: readonly string[];
|
|
764
|
+
/** Authentication the adapter performs when the profile names no credential reference; absent when it reports none. */
|
|
765
|
+
nativeAuth?: LlmNativeAuth;
|
|
766
|
+
/** Configuration diagnostic for repair; unaffected models may remain serviceable. */
|
|
767
|
+
error?: string;
|
|
768
|
+
}
|
|
769
|
+
/** Authentication a provider route performs without a credential reference in its profile. */
|
|
770
|
+
interface LlmNativeAuth {
|
|
771
|
+
/** Environment variables the route's authentication reads, in lookup order; empty when it reads none. */
|
|
772
|
+
env: readonly string[];
|
|
773
|
+
/** Whether a stored OAuth sign-in can authenticate the route. */
|
|
774
|
+
oauth: boolean;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* One interrogation of a provider endpoint that configuration has not stored
|
|
778
|
+
* yet. Configuration surfaces send the draft a user is still editing, so the
|
|
779
|
+
* request carries the endpoint and credential directly instead of naming a
|
|
780
|
+
* route: a provider being added has no route to name.
|
|
781
|
+
*/
|
|
782
|
+
interface LlmModelDiscoveryRequest {
|
|
783
|
+
/**
|
|
784
|
+
* Route the draft is editing, when it edits an existing one. A route whose
|
|
785
|
+
* adapter already knows its models answers from that knowledge instead of
|
|
786
|
+
* asking the endpoint — the adapter's own registry is the better answer, and
|
|
787
|
+
* it costs no network call.
|
|
788
|
+
*/
|
|
789
|
+
provider?: string;
|
|
790
|
+
/**
|
|
791
|
+
* Endpoint to interrogate. Optional because a route the adapter already
|
|
792
|
+
* describes needs none; a route it does not must supply one.
|
|
793
|
+
*/
|
|
794
|
+
baseURL?: string;
|
|
795
|
+
/** Wire protocol the endpoint speaks, when the draft names one. */
|
|
796
|
+
api?: string;
|
|
797
|
+
/** Credential for this interrogation alone; the harness never stores it. */
|
|
798
|
+
apiKey?: string;
|
|
799
|
+
}
|
|
800
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
801
|
+
interface RemoteErrorDetailsMap {
|
|
802
|
+
/** A draft provider interrogation refused or failed. */
|
|
803
|
+
'llm/model-discovery-rejected': {
|
|
804
|
+
readonly settingsNs: string;
|
|
805
|
+
readonly baseURL?: string;
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* One model an endpoint reports about itself. Every field but the id is
|
|
811
|
+
* optional because most provider listings disclose an id and nothing else;
|
|
812
|
+
* a surface adopting one of these still owes the capacities its adapter needs.
|
|
813
|
+
*/
|
|
814
|
+
interface LlmDiscoveredModel {
|
|
815
|
+
/** Model id the endpoint accepts. */
|
|
816
|
+
id: string;
|
|
817
|
+
/** Human-readable name when the endpoint supplies one. */
|
|
818
|
+
name?: string;
|
|
819
|
+
/** Maximum combined request and response context, when disclosed. */
|
|
820
|
+
contextWindow?: number;
|
|
821
|
+
/** Maximum output tokens, when disclosed. */
|
|
822
|
+
maxTokens?: number;
|
|
823
|
+
/** Accepted input types when disclosed by the catalog or endpoint; absent means unknown. */
|
|
824
|
+
inputModalities?: readonly ModelModality[];
|
|
825
|
+
}
|
|
826
|
+
/** One adapter-discovered model; catalog membership is advisory, not request validation. */
|
|
827
|
+
interface LlmModelInfo {
|
|
828
|
+
/** Provider route that owns this model entry. */
|
|
829
|
+
provider: string;
|
|
830
|
+
/** Model id passed to {@link GenerateOptions.model}. */
|
|
831
|
+
id: string;
|
|
832
|
+
/** Human-readable model name for selectors. */
|
|
833
|
+
name: string;
|
|
834
|
+
/** Optional user-facing distinction from otherwise similar models. */
|
|
835
|
+
description?: string;
|
|
836
|
+
/** Accepted request modalities; absent means unknown, while an explicit omission is negative capability. */
|
|
837
|
+
inputModalities?: readonly ModelModality[];
|
|
838
|
+
}
|
|
839
|
+
/** Provider-owned context capacity for one exact provider/model route. */
|
|
840
|
+
interface LlmModelContext {
|
|
841
|
+
/** Maximum combined request and response context in tokens. */
|
|
842
|
+
contextWindow: number;
|
|
843
|
+
}
|
|
844
|
+
/** Display metadata for one adapter-owned reasoning effort. */
|
|
845
|
+
interface LlmReasoningEffortInfo {
|
|
846
|
+
/** Opaque stable value accepted by {@link GenerateOptions.reasoningEffort}. */
|
|
847
|
+
id: ReasoningEffortId;
|
|
848
|
+
/** Human-readable effort name for selectors and diagnostics. */
|
|
849
|
+
name: string;
|
|
850
|
+
/** Optional user-facing distinction from otherwise similar efforts. */
|
|
851
|
+
description?: string;
|
|
852
|
+
}
|
|
853
|
+
/** Selectable reasoning efforts for one exact provider/model route. */
|
|
854
|
+
interface LlmModelReasoningInfo {
|
|
855
|
+
/** Supported efforts from least to greatest selectable reasoning effort, not predicted token use or latency. */
|
|
856
|
+
efforts: readonly LlmReasoningEffortInfo[];
|
|
857
|
+
/**
|
|
858
|
+
* Adapter-configured default materialized into requests when callers omit
|
|
859
|
+
* an effort. Absence preserves the provider's own default.
|
|
860
|
+
*/
|
|
861
|
+
defaultEffort?: ReasoningEffortId;
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* How a model applies a system prompt that changes mid-conversation.
|
|
865
|
+
* `'in-history'`: the model reads the latest `system` message at any position
|
|
866
|
+
* of `messages` as the complete effective system prompt, so a changed prompt
|
|
867
|
+
* can follow the cached history instead of rewriting message 0.
|
|
868
|
+
*/
|
|
869
|
+
type SystemPromptUpdate = 'in-history';
|
|
870
|
+
/**
|
|
871
|
+
* How a model accepts native tool declarations that change mid-conversation.
|
|
872
|
+
* `'addition-only'`: the model reads a `tool-addition` block in a later
|
|
873
|
+
* developer message as activating a tool declared with `deferLoading`, so an
|
|
874
|
+
* added tool follows the cached history instead of rewriting the declaration
|
|
875
|
+
* list. `'in-history'`: the model additionally reads `tool-removal` blocks,
|
|
876
|
+
* so a removed tool keeps its declaration and the removal follows the history.
|
|
877
|
+
* Absent means every request declares the complete current tool list.
|
|
878
|
+
*/
|
|
879
|
+
type ToolUpdate = 'in-history' | 'addition-only';
|
|
880
|
+
/** Exact-route model metadata resolved by its owning adapter. */
|
|
881
|
+
interface LlmResolvedModelInfo extends LlmModelInfo {
|
|
882
|
+
/** Provider-owned context capacity when known. */
|
|
883
|
+
context?: LlmModelContext;
|
|
884
|
+
/** Adapter-configured per-request output cap materialized when callers omit one. */
|
|
885
|
+
defaultMaxTokens?: number;
|
|
886
|
+
/** Adapter-owned selectable reasoning levels when exposed. */
|
|
887
|
+
reasoning?: LlmModelReasoningInfo;
|
|
888
|
+
/** Declared mid-conversation system prompt handling; absent means only a leading system message is read. */
|
|
889
|
+
systemPromptUpdate?: SystemPromptUpdate;
|
|
890
|
+
/** Declared mid-conversation tool declaration handling; absent means every request declares the complete tool list. */
|
|
891
|
+
toolUpdate?: ToolUpdate;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Adapter-private lossless-JSON state for replaying a successful response,
|
|
895
|
+
* carried by a terminal `finish` chunk and stored on the assembled assistant
|
|
896
|
+
* message's model source. Both halves stay opaque to the harness; only the
|
|
897
|
+
* split is shared vocabulary, so assembly can keep stored metadata aligned
|
|
898
|
+
* with stored content without reading either half.
|
|
899
|
+
*/
|
|
900
|
+
interface ReplayEnvelope {
|
|
901
|
+
/** Response-level adapter-private metadata (ids, native stop reason). */
|
|
902
|
+
response: unknown;
|
|
903
|
+
/**
|
|
904
|
+
* Per-block adapter-private metadata, one entry per emitted block in
|
|
905
|
+
* first-seen stream order. When assembly drops a block it drops the entry at
|
|
906
|
+
* the same position; entries whose length does not match the emitted block
|
|
907
|
+
* count discard the whole envelope. An adapter whose metadata is independent
|
|
908
|
+
* of block structure omits this field and the envelope passes through
|
|
909
|
+
* assembly unchanged.
|
|
910
|
+
*/
|
|
911
|
+
blocks?: readonly unknown[];
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Raw streaming protocol emitted by adapters.
|
|
915
|
+
* Block indexes correlate interleaved deltas, and `block-end` carries the
|
|
916
|
+
* assembled block. Adapters emit usage before the terminal finish and nothing
|
|
917
|
+
* afterward; tool arguments remain raw JSON strings. An adapter implementation
|
|
918
|
+
* may throw, but `LlmRuntime.stream()` normalizes that failure to a terminal
|
|
919
|
+
* `error` or `aborted` finish before exposing it to consumers.
|
|
920
|
+
*/
|
|
921
|
+
type StreamChunk = {
|
|
922
|
+
type: 'block-start';
|
|
923
|
+
index: number;
|
|
924
|
+
blockType: ContentBlockType;
|
|
925
|
+
} | {
|
|
926
|
+
type: 'text-delta';
|
|
927
|
+
index: number;
|
|
928
|
+
text: string;
|
|
929
|
+
} | {
|
|
930
|
+
type: 'reasoning-delta';
|
|
931
|
+
index: number;
|
|
932
|
+
text: string;
|
|
933
|
+
} | {
|
|
934
|
+
type: 'tool-call-delta';
|
|
935
|
+
index: number;
|
|
936
|
+
id: ToolCallId;
|
|
937
|
+
name?: string;
|
|
938
|
+
argumentsDelta: string;
|
|
939
|
+
} | {
|
|
940
|
+
type: 'block-end';
|
|
941
|
+
index: number;
|
|
942
|
+
block: ContentBlock;
|
|
943
|
+
} | {
|
|
944
|
+
type: 'usage';
|
|
945
|
+
usage: TokenUsage;
|
|
946
|
+
} | {
|
|
947
|
+
type: 'finish';
|
|
948
|
+
reason: FinishReason;
|
|
949
|
+
/** Replay metadata for a successful response; see {@link ReplayEnvelope}. */
|
|
950
|
+
replayState?: ReplayEnvelope;
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* JSON-schema description of a tool, as sent to the model.
|
|
954
|
+
*
|
|
955
|
+
* Declared here (not in dsh-tools) because it is part of {@link GenerateOptions};
|
|
956
|
+
* dsh-tools' ToolDefinition and dsh-system-prompt's PromptAssembly both import
|
|
957
|
+
* it from this package.
|
|
958
|
+
*/
|
|
959
|
+
interface ToolSchema {
|
|
960
|
+
/**
|
|
961
|
+
* Requests deferred loading of the tool definition into model context,
|
|
962
|
+
* independently of whether a tool-addition block records the tool.
|
|
963
|
+
* Uses Anthropic's defer_loading terminology.
|
|
964
|
+
*/
|
|
965
|
+
deferLoading?: true;
|
|
966
|
+
name: string;
|
|
967
|
+
description: string;
|
|
968
|
+
/** JSON Schema object for the arguments. */
|
|
969
|
+
parameters: Record<string, unknown>;
|
|
970
|
+
}
|
|
971
|
+
/** User input for one LLM request; it has no durable Session identity or source. */
|
|
972
|
+
interface RequestUserInput {
|
|
973
|
+
readonly role: 'user';
|
|
974
|
+
readonly content: UserMessage['content'];
|
|
975
|
+
readonly id?: never;
|
|
976
|
+
readonly source?: never;
|
|
977
|
+
}
|
|
978
|
+
/** A durable conversation message or a user input used only for one request. */
|
|
979
|
+
type RequestMessage = Message | RequestUserInput;
|
|
980
|
+
/** Logged tool declarations and update identities since the last declaration reset. */
|
|
981
|
+
interface ToolHistory {
|
|
982
|
+
/** Complete active declarations at the start of this history. */
|
|
983
|
+
readonly tools: readonly ToolSchema[];
|
|
984
|
+
/** Ordered developer messages, with additions resolved from their historical headers. */
|
|
985
|
+
readonly updates: readonly {
|
|
986
|
+
/** Identity used to locate this update in the derived request history. */
|
|
987
|
+
readonly messageId: MessageId;
|
|
988
|
+
/** Added definitions resolved from the event's referenced request header. */
|
|
989
|
+
readonly additions: readonly ToolSchema[];
|
|
990
|
+
}[];
|
|
991
|
+
}
|
|
992
|
+
/** A single model request, fully assembled. */
|
|
993
|
+
interface GenerateOptions {
|
|
994
|
+
/** Registered provider route selecting the adapter instance. */
|
|
995
|
+
provider: string;
|
|
996
|
+
model: string;
|
|
997
|
+
/** Adapter-owned reasoning effort selected for this exact model. */
|
|
998
|
+
reasoningEffort?: ReasoningEffortId;
|
|
999
|
+
/**
|
|
1000
|
+
* Ordered conversation messages, exactly as the provider sees them. A
|
|
1001
|
+
* loop-built request passes the derived history (dsh-agent-loop), whose
|
|
1002
|
+
* leading system-role message carries the system prompt; a hand-built
|
|
1003
|
+
* one-shot may include identity-free user inputs.
|
|
1004
|
+
*/
|
|
1005
|
+
messages: RequestMessage[];
|
|
1006
|
+
/**
|
|
1007
|
+
* System prompt text for one-shot callers; adapters map it to the provider's
|
|
1008
|
+
* system slot ahead of `messages`. Loop-built requests leave it undefined.
|
|
1009
|
+
*/
|
|
1010
|
+
system?: string;
|
|
1011
|
+
/** Tool schemas (adapters map to the provider's `tools` field). */
|
|
1012
|
+
tools?: ToolSchema[];
|
|
1013
|
+
/** Session-folded tool history used for route projection; omission sends complete declarations without tool updates. */
|
|
1014
|
+
toolHistory?: ToolHistory;
|
|
1015
|
+
temperature?: number;
|
|
1016
|
+
maxTokens?: number;
|
|
1017
|
+
/**
|
|
1018
|
+
* Stop sequences: generation halts as soon as the model produces any one of
|
|
1019
|
+
* these strings (adapters map to the provider's stop field, e.g. OpenAI
|
|
1020
|
+
* `stop`). The stop string itself is not included in the output.
|
|
1021
|
+
*/
|
|
1022
|
+
stop?: string[];
|
|
1023
|
+
signal?: AbortSignal;
|
|
1024
|
+
/**
|
|
1025
|
+
* Session identity stamped by the loop for request routing. Replay uses it
|
|
1026
|
+
* to separate cursors; adapters may map it to model-hidden transport metadata.
|
|
1027
|
+
*/
|
|
1028
|
+
sessionId?: Branded<'SessionId'>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Provider-neutral classification for an auxiliary model call. Adapters may
|
|
1031
|
+
* map the purpose to model-hidden transport metadata. Ordinary conversation
|
|
1032
|
+
* requests leave it unset.
|
|
1033
|
+
*/
|
|
1034
|
+
purpose?: 'compaction' | 'session-title';
|
|
1035
|
+
}
|
|
1036
|
+
//#endregion
|
|
1037
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.6/node_modules/@deepseek-ai/cosmokit/lib/types/types.d.ts
|
|
1038
|
+
declare function isArrayBufferLike(value: any): value is ArrayBufferLike;
|
|
1039
|
+
declare function isArrayBufferSource(value: any): value is Binary.Source;
|
|
1040
|
+
/** Binary source detection and base64/hex conversion helpers. */
|
|
1041
|
+
declare namespace Binary {
|
|
1042
|
+
type Source<T extends ArrayBufferLike = ArrayBufferLike> = T | ArrayBufferView<T>;
|
|
1043
|
+
const is: typeof isArrayBufferLike;
|
|
1044
|
+
const isSource: typeof isArrayBufferSource;
|
|
1045
|
+
function fromSource<T extends ArrayBufferLike>(source: Source<T>): T;
|
|
1046
|
+
function toBase64(source: Source): string;
|
|
1047
|
+
function fromBase64(source: string): ArrayBuffer | Uint8Array<ArrayBuffer>;
|
|
1048
|
+
function toHex(source: Source): string;
|
|
1049
|
+
function fromHex(source: string): ArrayBuffer;
|
|
1050
|
+
}
|
|
1051
|
+
//#endregion
|
|
1052
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.6/node_modules/@deepseek-ai/cosmokit/lib/types/misc.d.ts
|
|
1053
|
+
/** String/symbol keyed dictionary type. */
|
|
1054
|
+
type Dict<T = any, K extends string | symbol = string> = { [key in K]: T; };
|
|
1055
|
+
//#endregion
|
|
1056
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.6/node_modules/@deepseek-ai/cosmokit/lib/types/volatile.d.ts
|
|
1057
|
+
/** Shared config references used by schema validators and plugin runtimes. */
|
|
1058
|
+
/** Recursively readonly data returned by a volatile config reference. */
|
|
1059
|
+
type VolatileSnapshot<T> = T extends object ? { readonly [K in keyof T]: VolatileSnapshot<T[K]>; } : T;
|
|
1060
|
+
/** A stable reference; keep the reference, or capture its value for one operation only. */
|
|
1061
|
+
interface Volatile<T> {
|
|
1062
|
+
/** @returns the current immutable snapshot, including undefined for an absent value. */
|
|
1063
|
+
get(): VolatileSnapshot<T>;
|
|
1064
|
+
}
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
1067
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
1068
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
1069
|
+
/** The Standard properties. */
|
|
1070
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
1071
|
+
}
|
|
1072
|
+
declare namespace StandardTypedV1 {
|
|
1073
|
+
/** The Standard Typed properties interface. */
|
|
1074
|
+
interface Props<Input = unknown, Output = Input> {
|
|
1075
|
+
/** The version number of the standard. */
|
|
1076
|
+
readonly version: 1;
|
|
1077
|
+
/** The vendor name of the schema library. */
|
|
1078
|
+
readonly vendor: string;
|
|
1079
|
+
/** Inferred types associated with the schema. */
|
|
1080
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
1081
|
+
}
|
|
1082
|
+
/** The Standard Typed types interface. */
|
|
1083
|
+
interface Types<Input = unknown, Output = Input> {
|
|
1084
|
+
/** The input type of the schema. */
|
|
1085
|
+
readonly input: Input;
|
|
1086
|
+
/** The output type of the schema. */
|
|
1087
|
+
readonly output: Output;
|
|
1088
|
+
}
|
|
1089
|
+
/** Infers the input type of a Standard Typed. */
|
|
1090
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
1091
|
+
/** Infers the output type of a Standard Typed. */
|
|
1092
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
1093
|
+
}
|
|
1094
|
+
/** The Standard Schema interface. */
|
|
1095
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
1096
|
+
/** The Standard Schema properties. */
|
|
1097
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
1098
|
+
}
|
|
1099
|
+
declare namespace StandardSchemaV1 {
|
|
1100
|
+
/** The Standard Schema properties interface. */
|
|
1101
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
1102
|
+
/** Validates unknown input values. */
|
|
1103
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
1104
|
+
}
|
|
1105
|
+
/** The result interface of the validate function. */
|
|
1106
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
1107
|
+
/** The result interface if validation succeeds. */
|
|
1108
|
+
interface SuccessResult<Output> {
|
|
1109
|
+
/** The typed output value. */
|
|
1110
|
+
readonly value: Output;
|
|
1111
|
+
/** A falsy value for `issues` indicates success. */
|
|
1112
|
+
readonly issues?: undefined;
|
|
1113
|
+
}
|
|
1114
|
+
interface Options {
|
|
1115
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
1116
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
1117
|
+
}
|
|
1118
|
+
/** The result interface if validation fails. */
|
|
1119
|
+
interface FailureResult {
|
|
1120
|
+
/** The issues of failed validation. */
|
|
1121
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
1122
|
+
}
|
|
1123
|
+
/** The issue interface of the failure output. */
|
|
1124
|
+
interface Issue {
|
|
1125
|
+
/** The error message of the issue. */
|
|
1126
|
+
readonly message: string;
|
|
1127
|
+
/** The path of the issue, if any. */
|
|
1128
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
1129
|
+
}
|
|
1130
|
+
/** The path segment interface of the issue. */
|
|
1131
|
+
interface PathSegment {
|
|
1132
|
+
/** The key representing a path segment. */
|
|
1133
|
+
readonly key: PropertyKey;
|
|
1134
|
+
}
|
|
1135
|
+
/** The Standard types interface. */
|
|
1136
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
1137
|
+
/** Infers the input type of a Standard. */
|
|
1138
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1139
|
+
/** Infers the output type of a Standard. */
|
|
1140
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+schemastery@3.18.5/node_modules/@deepseek-ai/schemastery/lib/types/index.d.ts
|
|
1144
|
+
declare const kSchema: unique symbol;
|
|
1145
|
+
declare global {
|
|
1146
|
+
namespace Schemastery {
|
|
1147
|
+
/** Convert primitive constructors, constants, and existing schemas into a schema type. */
|
|
1148
|
+
type From<X> = X extends string | number | boolean ? Schema<X> : X extends Schema<any, any, SchemaMode> ? X : X extends typeof String ? Schema<string> : X extends typeof Number ? Schema<number> : X extends typeof Boolean ? Schema<boolean> : X extends typeof Function ? Schema<Function, (...args: any[]) => any> : X extends Constructor<infer S> ? Schema<S> : never;
|
|
1149
|
+
type TypeS1<X> = X extends Schema<infer S, infer _T, infer _M> ? S : never;
|
|
1150
|
+
type Inverse<X> = X extends Schema<infer _S, infer T, infer M> ? (arg: SchemaOutput<T, M>) => void : never;
|
|
1151
|
+
/** Input type accepted by a schema-like value. */
|
|
1152
|
+
type TypeS<X> = TypeS1<From<X>>;
|
|
1153
|
+
/** Output type returned by a schema-like value after validation. */
|
|
1154
|
+
type TypeT<X> = ReturnType<From<X>>;
|
|
1155
|
+
/** Resolver callback used by custom schema types registered with `Schema.extend()`. */
|
|
1156
|
+
type Resolve = (data: any, schema: Schema, options: Options, strict?: boolean) => [any, any?];
|
|
1157
|
+
/** Input type accepted by one schema in an intersection. */
|
|
1158
|
+
type IntersectS<X> = From<X> extends Schema<infer S, infer _T, infer _M> ? S : never;
|
|
1159
|
+
/** Output type returned by one schema in an intersection. */
|
|
1160
|
+
type IntersectT<X> = Inverse<From<X>> extends ((arg: infer T) => void) ? T : never;
|
|
1161
|
+
type TupleS<X extends readonly any[]> = X extends readonly [infer L, ...infer R] ? [TypeS<L>?, ...TupleS<R>] : any[];
|
|
1162
|
+
type TupleT<X extends readonly any[]> = X extends readonly [infer L, ...infer R] ? [TypeT<L>?, ...TupleT<R>] : any[];
|
|
1163
|
+
type ObjectS<X extends Dict> = { [K in keyof X]?: TypeS<X[K]> | null; } & Dict;
|
|
1164
|
+
type ObjectT<X extends Dict> = { [K in keyof X]: TypeT<X[K]>; } & Dict;
|
|
1165
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
1166
|
+
/** Static constructor and factory methods exposed by the default `Schema` export. */
|
|
1167
|
+
interface Static {
|
|
1168
|
+
<T = any>(options: Partial<Schema<T>>): Schema<T>;
|
|
1169
|
+
new <T = any>(options: Partial<Schema<T>>): Schema<T>;
|
|
1170
|
+
prototype: Schema;
|
|
1171
|
+
/** Validate a value against a schema node and return `[output, adaptedInput?]`. */
|
|
1172
|
+
resolve: Resolve;
|
|
1173
|
+
/** Infer a schema from a primitive value, constructor, or existing schema. */
|
|
1174
|
+
from<X = any>(source?: X): From<X>;
|
|
1175
|
+
/** Register a resolver for a custom schema `type`. */
|
|
1176
|
+
extend(type: string, resolve: Resolve): void;
|
|
1177
|
+
/** Accept any value without validation. */
|
|
1178
|
+
any<T = any>(): Schema<T>;
|
|
1179
|
+
/** Accept only nullable input. */
|
|
1180
|
+
never(): Schema<never>;
|
|
1181
|
+
/** Accept exactly one constant value. */
|
|
1182
|
+
const<const T>(value: T): Schema<T>;
|
|
1183
|
+
/** Accept strings, with optional metadata constraints added by instance methods. */
|
|
1184
|
+
string(): Schema<string>;
|
|
1185
|
+
/** Accept numbers, with optional range and step constraints. */
|
|
1186
|
+
number(): Schema<number>;
|
|
1187
|
+
/** Accept non-negative integer numbers. */
|
|
1188
|
+
natural(): Schema<number>;
|
|
1189
|
+
/** Accept a number between 0 and 1 and mark it as a slider. */
|
|
1190
|
+
percent(): Schema<number>;
|
|
1191
|
+
/** Accept booleans. */
|
|
1192
|
+
boolean(): Schema<boolean>;
|
|
1193
|
+
/** Accept `Date` instances or parse datetime strings into `Date` objects. */
|
|
1194
|
+
date(): Schema<string | Date, Date>;
|
|
1195
|
+
/** Accept `RegExp` instances or parse strings into regular expressions. */
|
|
1196
|
+
regExp(flag?: string): Schema<string | RegExp, RegExp>;
|
|
1197
|
+
/** Accept binary sources and normalize them to `ArrayBufferLike`. */
|
|
1198
|
+
arrayBuffer(): Schema<Binary.Source, ArrayBufferLike>;
|
|
1199
|
+
arrayBuffer(encoding: 'hex' | 'base64'): Schema<Binary.Source | string, ArrayBufferLike>;
|
|
1200
|
+
/** Accept a numeric bitset or string keys and normalize to a number. */
|
|
1201
|
+
bitset<K extends string>(bits: Partial<Record<K, number>>): Schema<number | readonly K[], number>;
|
|
1202
|
+
/** Accept functions. */
|
|
1203
|
+
function(): Schema<Function, (...args: any[]) => any>;
|
|
1204
|
+
/** Accept instances of a constructor or objects whose constructor name matches. */
|
|
1205
|
+
is(constructor: string): Schema;
|
|
1206
|
+
is<T>(constructor: Constructor<T>): Schema<T>;
|
|
1207
|
+
/** Accept arrays whose elements match `inner`. */
|
|
1208
|
+
array<X>(inner: X): Schema<TypeS<X>[], TypeT<X>[]>;
|
|
1209
|
+
/** Accept plain objects with values matching `inner` and optional key schema. */
|
|
1210
|
+
dict<X, Y extends Schema<any, string> = Schema<string>>(inner: X, sKey?: Y): Schema<Dict<TypeS<X>, TypeS<Y>>, Dict<TypeT<X>, TypeT<Y>>>;
|
|
1211
|
+
/** Accept tuple arrays where each index matches the corresponding schema. */
|
|
1212
|
+
tuple<const X extends readonly any[]>(list: X): Schema<TupleS<X>, TupleT<X>>;
|
|
1213
|
+
/** Accept plain objects; infer fields from the dictionary, not the enclosing schema's output type. */
|
|
1214
|
+
object<X extends Dict>(dict: X): Schema<ObjectS<NoInfer<X>>, ObjectT<NoInfer<X>>>;
|
|
1215
|
+
/** Accept values matching at least one schema in `list`. */
|
|
1216
|
+
union<const X>(list: readonly X[]): Schema<TypeS<X>, TypeT<X>>;
|
|
1217
|
+
/** Accept values matching every schema in `list`, merging object outputs. */
|
|
1218
|
+
intersect<const X>(list: readonly X[]): Schema<IntersectS<X>, IntersectT<X>>;
|
|
1219
|
+
/** Validate with `inner`, then convert the result with `callback`. */
|
|
1220
|
+
transform<X, T>(inner: X, callback: (value: TypeS<X>, options: Schemastery.Options) => T, preserve?: boolean): Schema<TypeS<X>, T>;
|
|
1221
|
+
/** Defer construction of a recursive schema until validation or serialization. */
|
|
1222
|
+
lazy<X extends Schema<any, any, SchemaMode>>(callback: () => X): X;
|
|
1223
|
+
ValidationError: typeof ValidationError;
|
|
1224
|
+
}
|
|
1225
|
+
/** Runtime validation options shared by all schema calls. */
|
|
1226
|
+
interface Options {
|
|
1227
|
+
/** Remove invalid object properties instead of throwing when possible. */
|
|
1228
|
+
autofix?: boolean;
|
|
1229
|
+
/** Skip validation for selected values and schema nodes. */
|
|
1230
|
+
ignore?(data: any, schema: Schema): boolean;
|
|
1231
|
+
/** Path used to format nested validation errors. */
|
|
1232
|
+
path?: (keyof any)[];
|
|
1233
|
+
}
|
|
1234
|
+
/** UI and validation metadata attached by schema builder methods. */
|
|
1235
|
+
interface Meta<T = any> {
|
|
1236
|
+
default?: T extends {} ? Partial<T> : T;
|
|
1237
|
+
required?: boolean;
|
|
1238
|
+
/** Parse this node as a stable config reference; its type and UI metadata remain unchanged. */
|
|
1239
|
+
volatile?: boolean;
|
|
1240
|
+
disabled?: boolean;
|
|
1241
|
+
collapse?: boolean;
|
|
1242
|
+
badges?: {
|
|
1243
|
+
text: string;
|
|
1244
|
+
type: string;
|
|
1245
|
+
}[];
|
|
1246
|
+
hidden?: boolean;
|
|
1247
|
+
loose?: boolean;
|
|
1248
|
+
role?: string;
|
|
1249
|
+
extra?: any;
|
|
1250
|
+
link?: string;
|
|
1251
|
+
description?: string | Dict<string>;
|
|
1252
|
+
comment?: string;
|
|
1253
|
+
pattern?: {
|
|
1254
|
+
source: string;
|
|
1255
|
+
flags?: string;
|
|
1256
|
+
};
|
|
1257
|
+
max?: number;
|
|
1258
|
+
min?: number;
|
|
1259
|
+
step?: number;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
/** Callable schema instance that validates input and returns normalized output. */
|
|
1263
|
+
interface Schemastery<S = any, T = S, Mode extends SchemaMode = 'plain'> {
|
|
1264
|
+
(data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>;
|
|
1265
|
+
new (data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>;
|
|
1266
|
+
[kSchema]: true;
|
|
1267
|
+
uid: number;
|
|
1268
|
+
meta: Schemastery.Meta<T>;
|
|
1269
|
+
type: string;
|
|
1270
|
+
sKey?: Schema;
|
|
1271
|
+
inner?: Schema;
|
|
1272
|
+
list?: Schema[];
|
|
1273
|
+
dict?: Dict<Schema>;
|
|
1274
|
+
bits?: Dict<number>;
|
|
1275
|
+
callback?: Function;
|
|
1276
|
+
constructor?: string | Function;
|
|
1277
|
+
builder?: Function;
|
|
1278
|
+
value?: T;
|
|
1279
|
+
refs?: Dict<Schema>;
|
|
1280
|
+
preserve?: boolean;
|
|
1281
|
+
'~standard': StandardSchemaV1.Props;
|
|
1282
|
+
/** Format this schema as a compact TypeScript-like type string. */
|
|
1283
|
+
toString(inline?: boolean): string;
|
|
1284
|
+
/** Serialize this schema, preserving shared and recursive references. */
|
|
1285
|
+
toJSON(): Schema<S, T, Mode>;
|
|
1286
|
+
/** Mark nullable input as invalid unless a default supplies a fallback. */
|
|
1287
|
+
required<R extends boolean = true>(value?: R): Schema<S, T, SetRequired<Mode, R>>;
|
|
1288
|
+
/**
|
|
1289
|
+
* Parse this config field as a stable reference containing immutable data.
|
|
1290
|
+
* @returns a schema whose output supports get(), including when the field is absent.
|
|
1291
|
+
*/
|
|
1292
|
+
volatile(): Schema<NoInfer<S>, NoInfer<T>, Mode extends 'defined' | 'volatile-defined' ? 'volatile-defined' : 'volatile'>;
|
|
1293
|
+
/** Hide this schema node from UI renderers. */
|
|
1294
|
+
hidden(value?: boolean): Schema<S, T, Mode>;
|
|
1295
|
+
/** Return the default value instead of throwing when validation fails. */
|
|
1296
|
+
loose(value?: boolean): Schema<S, T, Mode>;
|
|
1297
|
+
/** Attach a renderer role and optional role-specific metadata. */
|
|
1298
|
+
role(text: string, extra?: any): Schema<S, T, Mode>;
|
|
1299
|
+
/** Attach an external documentation link. */
|
|
1300
|
+
link(link: string): Schema<S, T, Mode>;
|
|
1301
|
+
/** Set the fallback value used for nullable input. */
|
|
1302
|
+
default(value: T | NoInfer<Partial<S>>): Schema<S, T, SetRequired<Mode, true>>;
|
|
1303
|
+
/** Attach an auxiliary comment for documentation or form UIs. */
|
|
1304
|
+
comment(text: string): Schema<S, T, Mode>;
|
|
1305
|
+
/** Attach a localized or plain description for documentation or form UIs. */
|
|
1306
|
+
description(text: string): Schema<S, T, Mode>;
|
|
1307
|
+
/** Mark this schema node as disabled for form UIs. */
|
|
1308
|
+
disabled(value?: boolean): Schema<S, T, Mode>;
|
|
1309
|
+
/** Request collapsed rendering for nested form UIs. */
|
|
1310
|
+
collapse(value?: boolean): Schema<S, T, Mode>;
|
|
1311
|
+
/** Add a deprecated badge to this schema node. */
|
|
1312
|
+
deprecated(): Schema<S, T, Mode>;
|
|
1313
|
+
/** Add an experimental badge to this schema node. */
|
|
1314
|
+
experimental(): Schema<S, T, Mode>;
|
|
1315
|
+
/** Require strings to match a regular expression. */
|
|
1316
|
+
pattern(regexp: RegExp): Schema<S, T, Mode>;
|
|
1317
|
+
/** Set an inclusive maximum for numbers or collection lengths. */
|
|
1318
|
+
max(value: number): Schema<S, T, Mode>;
|
|
1319
|
+
/** Set an inclusive minimum for numbers or collection lengths. */
|
|
1320
|
+
min(value: number): Schema<S, T, Mode>;
|
|
1321
|
+
/** Set the numeric increment constraint. */
|
|
1322
|
+
step(value: number): Schema<S, T, Mode>;
|
|
1323
|
+
/** Add or replace an object property schema. */
|
|
1324
|
+
set(key: string, value: Schema): Schema<S, T, Mode>;
|
|
1325
|
+
/** Append a tuple, union, or intersection member schema. */
|
|
1326
|
+
push(value: Schema): Schema<S, T, Mode>;
|
|
1327
|
+
/** Remove values equal to schema defaults from normalized output. */
|
|
1328
|
+
simplify(value?: any): any;
|
|
1329
|
+
/** Return a schema clone with descriptions merged from locale messages. */
|
|
1330
|
+
i18n(messages: Dict): Schema<S, T, Mode>;
|
|
1331
|
+
/** Attach arbitrary metadata consumed by form renderers and downstream tools. */
|
|
1332
|
+
extra<K extends keyof Schemastery.Meta>(key: K, value: Schemastery.Meta[K]): Schema<S, T, Mode>;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
declare class ValidationError extends TypeError {
|
|
1336
|
+
options: Schemastery.Options;
|
|
1337
|
+
name: string;
|
|
1338
|
+
constructor(message: string, options: Schemastery.Options);
|
|
1339
|
+
static is(error: any): error is ValidationError;
|
|
1340
|
+
}
|
|
1341
|
+
type SchemaMode = 'plain' | 'defined' | 'volatile' | 'volatile-defined';
|
|
1342
|
+
type SchemaOutput<T, M extends SchemaMode> = M extends 'volatile' ? Volatile<T | undefined> : M extends 'volatile-defined' ? Volatile<T> : T;
|
|
1343
|
+
type SetRequired<M extends SchemaMode, R extends boolean> = M extends 'volatile' | 'volatile-defined' ? R extends true ? 'volatile-defined' : 'volatile' : R extends true ? 'defined' : 'plain';
|
|
1344
|
+
type Schema<S = any, T = S, Mode extends SchemaMode = 'plain'> = Schemastery<S, T, Mode>;
|
|
1345
|
+
declare const Schema: Schemastery.Static;
|
|
1346
|
+
//#endregion
|
|
1347
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-llm/lib/types/retry-policy.d.ts
|
|
1348
|
+
/** Fully resolved backoff shared by both retry modes. */
|
|
1349
|
+
interface ResolvedRetryBackoff {
|
|
1350
|
+
readonly initialDelayMs: number;
|
|
1351
|
+
readonly maxDelayMs: number;
|
|
1352
|
+
readonly jitterRatio: number;
|
|
1353
|
+
}
|
|
1354
|
+
/** Fully resolved bounded transient retry policy. */
|
|
1355
|
+
interface ResolvedNormalRetryPolicy extends ResolvedRetryBackoff {
|
|
1356
|
+
readonly mode: 'normal';
|
|
1357
|
+
readonly maxRetries: number;
|
|
1358
|
+
readonly retryableCodes: readonly string[];
|
|
1359
|
+
}
|
|
1360
|
+
/** Fully resolved unbounded retry policy. */
|
|
1361
|
+
interface ResolvedAlwaysRetryPolicy extends ResolvedRetryBackoff {
|
|
1362
|
+
readonly mode: 'always';
|
|
1363
|
+
}
|
|
1364
|
+
/** Immutable provider policy captured when its adapter route is registered. */
|
|
1365
|
+
type ResolvedRetryPolicy = ResolvedNormalRetryPolicy | ResolvedAlwaysRetryPolicy;
|
|
1366
|
+
//#endregion
|
|
1367
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-llm/lib/types/call-config.d.ts
|
|
1368
|
+
/** Concrete generation settings; omitted controls use the selected route's defaults. */
|
|
1369
|
+
interface LlmCallControls {
|
|
1370
|
+
reasoningEffort?: ReasoningEffortId;
|
|
1371
|
+
temperature?: number;
|
|
1372
|
+
maxTokens?: number;
|
|
1373
|
+
stop?: string[];
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Provider, model, reasoning effort, and sampling scalars of one conversation's
|
|
1377
|
+
* requests. Every field maps 1:1 onto the same-named `GenerateOptions` field;
|
|
1378
|
+
* the loop builds requests from the logged header rather than accepting these
|
|
1379
|
+
* per call.
|
|
1380
|
+
*/
|
|
1381
|
+
interface LlmCallConfig extends LlmCallControls {
|
|
1382
|
+
provider: string;
|
|
1383
|
+
model: string;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Synchronous, pure configuration of one call before defaults and validation.
|
|
1387
|
+
* Compose functions in the desired order; later writes replace earlier ones.
|
|
1388
|
+
* The returned controls cannot change the captured route. Errors reject
|
|
1389
|
+
* preparation before dispatch; only the resolved configuration is recordable.
|
|
1390
|
+
* @param controls - detached, deeply frozen proposed controls, without defaults.
|
|
1391
|
+
* @param model - detached, deeply frozen metadata from the captured adapter generation.
|
|
1392
|
+
* @returns concrete controls; omitted fields receive the route's defaults.
|
|
1393
|
+
*/
|
|
1394
|
+
type ConfigureCall = (controls: Readonly<LlmCallControls>, model: Readonly<LlmResolvedModelInfo>) => LlmCallControls;
|
|
1395
|
+
/**
|
|
1396
|
+
* Effective config fields supplied by exact-model adapter resolution rather
|
|
1397
|
+
* than by the caller's request proposal.
|
|
1398
|
+
*/
|
|
1399
|
+
interface LlmCallConfigAdapterDefaults {
|
|
1400
|
+
reasoningEffort?: true;
|
|
1401
|
+
maxTokens?: true;
|
|
1402
|
+
}
|
|
1403
|
+
//#endregion
|
|
1404
|
+
//#region ../../node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-rc.1_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-llm/lib/types/index.d.ts
|
|
1405
|
+
declare module '@deepseek-ai/cordis' {
|
|
1406
|
+
interface Context {
|
|
1407
|
+
llm: LlmRuntime;
|
|
1408
|
+
}
|
|
1409
|
+
interface Events {
|
|
1410
|
+
/**
|
|
1411
|
+
* Waterfall around every streaming model call (retry, replay, routing).
|
|
1412
|
+
* Bound to the {@link LlmRuntime}; call `next()` to reach the resolved
|
|
1413
|
+
* adapter's stream, or yield your own chunks to short-circuit.
|
|
1414
|
+
* @param options - the full request. A LOOP-built request carries the
|
|
1415
|
+
* process-local {@link markAgentLoopRequest} identity and arrives deep-frozen
|
|
1416
|
+
* (mutation throws): its content is a pure function of the session log (the
|
|
1417
|
+
* reconstructability Agent Note), so listeners read it, never rewrite it.
|
|
1418
|
+
* Hand-built calls do not carry that marker; callers own their request
|
|
1419
|
+
* inputs and must keep them unchanged until the stream settles.
|
|
1420
|
+
* @mode waterfall
|
|
1421
|
+
*/
|
|
1422
|
+
'llm/stream'(this: LlmRuntime, options: GenerateOptions, next: () => AsyncIterable<StreamChunk>): AsyncIterable<StreamChunk>;
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
/** One model call whose config and adapter registration were resolved together. */
|
|
1426
|
+
interface PreparedLlmCall {
|
|
1427
|
+
/** Detached, deep-frozen config with any adapter-owned default materialized. */
|
|
1428
|
+
readonly config: LlmCallConfig;
|
|
1429
|
+
/** Immutable retry policy captured with the adapter registration. */
|
|
1430
|
+
readonly retryPolicy: ResolvedRetryPolicy;
|
|
1431
|
+
/** Detached context metadata resolved with the registration-bound call. */
|
|
1432
|
+
readonly context?: LlmModelContext;
|
|
1433
|
+
/** Exact model modalities captured with the adapter dispatch generation. */
|
|
1434
|
+
readonly inputModalities?: readonly ModelModality[];
|
|
1435
|
+
/** Exact model system prompt update mode captured with the adapter dispatch generation. */
|
|
1436
|
+
readonly systemPromptUpdate?: SystemPromptUpdate;
|
|
1437
|
+
/** Exact model tool update mode captured with the adapter dispatch generation. */
|
|
1438
|
+
readonly toolUpdate?: ToolUpdate;
|
|
1439
|
+
/** Config fields materialized by the captured adapter rather than proposed by the caller. */
|
|
1440
|
+
readonly adapterDefaults: LlmCallConfigAdapterDefaults;
|
|
1441
|
+
/**
|
|
1442
|
+
* Dispatch this call once through the registration captured during
|
|
1443
|
+
* preparation. The request's call-config fields must match {@link config};
|
|
1444
|
+
* reuse or mismatch fails with `INVALID_PREPARED_CALL`.
|
|
1445
|
+
* @param options - fully assembled request carrying the prepared config.
|
|
1446
|
+
* @returns the chunk stream, including the `llm/stream` waterfall.
|
|
1447
|
+
*/
|
|
1448
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
1449
|
+
}
|
|
1450
|
+
/** One adapter-owned model-resolution generation bound to its eventual stream call. */
|
|
1451
|
+
interface PreparedAdapterCall {
|
|
1452
|
+
/** Exact model metadata from the same adapter generation as {@link stream}. */
|
|
1453
|
+
readonly model: LlmResolvedModelInfo;
|
|
1454
|
+
/** Dispatch through that generation without re-reading dynamic connection facts. */
|
|
1455
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* Provider-wire adapter for the harness message and stream vocabulary. Register implementations
|
|
1459
|
+
* with `ctx.llm.registerAdapter(providers, adapter)`. Every provider HTTP request must include
|
|
1460
|
+
* `attributionHeaders()`; prove the headers are added in the wire request or library header hook. The direct-fetch
|
|
1461
|
+
* DeepSeek and library-backed pi-ai adapters meet this contract through different internals.
|
|
1462
|
+
*/
|
|
1463
|
+
declare abstract class LlmAdapter {
|
|
1464
|
+
/**
|
|
1465
|
+
* Describe one provider route owned by this adapter.
|
|
1466
|
+
* @param provider - a route passed to `registerAdapter()` for this instance.
|
|
1467
|
+
* @returns detached display metadata whose id must equal `provider`.
|
|
1468
|
+
*/
|
|
1469
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
1470
|
+
/**
|
|
1471
|
+
* Return the provider-owned retry policy captured with this route.
|
|
1472
|
+
* @param _provider - a route passed to `registerAdapter()` for this instance.
|
|
1473
|
+
* @returns a resolved policy, or `undefined` to use the normal defaults.
|
|
1474
|
+
*/
|
|
1475
|
+
providerRetryPolicy(_provider: string): ResolvedRetryPolicy | undefined;
|
|
1476
|
+
/**
|
|
1477
|
+
* Resolve provider-side request-image pricing for one exact model route.
|
|
1478
|
+
* The default declares none, so consumers fall back to their own neutral
|
|
1479
|
+
* estimate. Implementations must answer synchronously without I/O; the
|
|
1480
|
+
* token meter resolves this per measurement.
|
|
1481
|
+
* @param _provider - a route passed to `registerAdapter()` for this instance.
|
|
1482
|
+
* @param _model - exact model id passed to {@link GenerateOptions.model}.
|
|
1483
|
+
* @returns route-owned image pricing, or `undefined` when the route declares none.
|
|
1484
|
+
*/
|
|
1485
|
+
imageRequestPricing(_provider: string, _model: string): LlmImageRequestPricing | undefined;
|
|
1486
|
+
/**
|
|
1487
|
+
* Resolve the image dimensions and byte target this adapter sends to the model.
|
|
1488
|
+
* The default preserves normalized images; adapters that resize must override it.
|
|
1489
|
+
* @param _provider - registered provider route.
|
|
1490
|
+
* @param _model - exact model id.
|
|
1491
|
+
* @param image - normalized image whose request projection is being resolved.
|
|
1492
|
+
* @returns the same target used by request serialization, before provider-internal processing.
|
|
1493
|
+
*/
|
|
1494
|
+
imageRequestTarget(_provider: string, _model: string, image: ImageAttachmentRef): ImageRequestTarget;
|
|
1495
|
+
/**
|
|
1496
|
+
* List models this adapter can currently advertise for one owned provider.
|
|
1497
|
+
* Core routing accepts unlisted model ids; catalog-driven entry points such
|
|
1498
|
+
* as the GUI may require membership. Adapters used there must advertise
|
|
1499
|
+
* their available models; the base empty catalog offers no GUI selection.
|
|
1500
|
+
* @param _provider - one provider route owned by this adapter.
|
|
1501
|
+
* @returns discoverable models in adapter-preferred order.
|
|
1502
|
+
*/
|
|
1503
|
+
listModels(_provider: string): Promise<readonly LlmModelInfo[]>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Resolve all metadata available for one exact model. This query is
|
|
1506
|
+
* independent of the advisory catalog and does not validate request routing.
|
|
1507
|
+
* @param provider - one provider route owned by this adapter.
|
|
1508
|
+
* @param model - exact model id passed to {@link GenerateOptions.model}.
|
|
1509
|
+
* @param _signal - cancellation for this exact-model lookup; asynchronous
|
|
1510
|
+
* implementations must settle promptly after it aborts.
|
|
1511
|
+
* @returns provider/model identity plus any context, call-default, and reasoning metadata.
|
|
1512
|
+
*/
|
|
1513
|
+
resolveModel(provider: string, model: string, _signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
1514
|
+
/**
|
|
1515
|
+
* Bind exact model metadata and the eventual request dispatch to one adapter generation.
|
|
1516
|
+
* Dynamic adapters override this so settings changes between preparation and
|
|
1517
|
+
* dispatch cannot combine one generation's capabilities with another's endpoint.
|
|
1518
|
+
* @param provider - registered provider route.
|
|
1519
|
+
* @param model - exact model id.
|
|
1520
|
+
* @param signal - cancellation for model resolution.
|
|
1521
|
+
* @returns model metadata and a one-generation stream entry point.
|
|
1522
|
+
*/
|
|
1523
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Stream one model call as raw chunks. The only required method.
|
|
1526
|
+
* @param options - the fully-assembled request; implementations must honor `options.signal`.
|
|
1527
|
+
* @returns the chunk stream, obeying the adapter contract documented on `StreamChunk`.
|
|
1528
|
+
*/
|
|
1529
|
+
abstract stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* What {@link LlmRuntime.registerAdapter} returns: the disposer, plus an
|
|
1533
|
+
* atomic route replacement for the same adapter instance.
|
|
1534
|
+
*/
|
|
1535
|
+
interface AdapterRegistrationHandle {
|
|
1536
|
+
/** Release every route this registration currently holds. */
|
|
1537
|
+
(): void;
|
|
1538
|
+
/**
|
|
1539
|
+
* Replace this registration's routes with `providers`, keeping the same
|
|
1540
|
+
* adapter instance. The candidate set is validated in full first — a
|
|
1541
|
+
* conflict with another adapter, an invalid name, or bad provider metadata
|
|
1542
|
+
* throws and leaves the current routes untouched — and the swap itself is
|
|
1543
|
+
* one synchronous section, so no request can observe a gap. An empty array
|
|
1544
|
+
* is legal here (a settings section that emptied holds zero routes while
|
|
1545
|
+
* staying registered), unlike an empty initial registration.
|
|
1546
|
+
*
|
|
1547
|
+
* Throws `LlmError` with code `REGISTRATION_DISPOSED` once the registration
|
|
1548
|
+
* has been released: its routes are gone and its disposer has already run,
|
|
1549
|
+
* so anything registered afterwards would have no owner left to release it.
|
|
1550
|
+
* @param providers - the complete next route set for this registration.
|
|
1551
|
+
*/
|
|
1552
|
+
replace(providers: string[]): void;
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* A live configurable-provider registration, disposable and atomically
|
|
1556
|
+
* replaceable — the directory counterpart of {@link AdapterRegistrationHandle}.
|
|
1557
|
+
*/
|
|
1558
|
+
interface DirectoryRegistrationHandle {
|
|
1559
|
+
/** Withdraw every entry this registration currently holds. */
|
|
1560
|
+
(): void;
|
|
1561
|
+
/**
|
|
1562
|
+
* Replace this registration's entries with `entries`. The candidate set is
|
|
1563
|
+
* validated in full first — an entry another registration already declares,
|
|
1564
|
+
* a duplicate within the set, or invalid metadata throws and leaves the
|
|
1565
|
+
* current entries untouched — and the swap is one synchronous section, so no
|
|
1566
|
+
* reader observes a gap. An empty array is legal here, unlike an empty
|
|
1567
|
+
* initial registration.
|
|
1568
|
+
*
|
|
1569
|
+
* Throws `LlmError` with code `REGISTRATION_DISPOSED` once the registration
|
|
1570
|
+
* has been disposed.
|
|
1571
|
+
*/
|
|
1572
|
+
replace(entries: readonly LlmConfigurableProvider[]): void;
|
|
1573
|
+
}
|
|
1574
|
+
/**
|
|
1575
|
+
* The abstract `llm` service: an adapter registry plus a streaming model-call
|
|
1576
|
+
* API, interceptable via the `llm/stream` waterfall.
|
|
1577
|
+
*/
|
|
1578
|
+
declare class LlmRuntime extends TypertRemoteService {
|
|
1579
|
+
private adapters;
|
|
1580
|
+
private directory;
|
|
1581
|
+
private discoveries;
|
|
1582
|
+
constructor(ctx: Context);
|
|
1583
|
+
/** Notify topology observers without letting one broken listener veto the commit. */
|
|
1584
|
+
private emitAdaptersUpdated;
|
|
1585
|
+
/** Contained-listener diagnostic shared by the sync and async failure paths. */
|
|
1586
|
+
private warnAdaptersListenerFailure;
|
|
1587
|
+
/**
|
|
1588
|
+
* Register an adapter for the given provider routes. Throws `LlmError` with code
|
|
1589
|
+
* `DUPLICATE_ADAPTER` if any provider already has an adapter (all-or-nothing).
|
|
1590
|
+
* Disposed with the fiber.
|
|
1591
|
+
* @param providers - every provider route this adapter should serve.
|
|
1592
|
+
* @param adapter - the adapter that streams calls for those providers.
|
|
1593
|
+
* @returns the disposer, carrying {@link AdapterRegistrationHandle.replace}.
|
|
1594
|
+
*/
|
|
1595
|
+
registerAdapter(providers: string[], adapter: LlmAdapter): AdapterRegistrationHandle;
|
|
1596
|
+
/**
|
|
1597
|
+
* Validate one candidate route set for `adapter`, treating routes this
|
|
1598
|
+
* registration already holds as available. Nothing is mutated: a rejected
|
|
1599
|
+
* candidate leaves the registry exactly as it was.
|
|
1600
|
+
*/
|
|
1601
|
+
private prepareRoutes;
|
|
1602
|
+
/**
|
|
1603
|
+
* Swap this registration's routes for the prepared ones in one synchronous
|
|
1604
|
+
* section, so no observer can see the registry between the release and the
|
|
1605
|
+
* re-registration. The route set's one mutation point is also where
|
|
1606
|
+
* `llm/adapters-updated` is published, so a `replace` announces itself
|
|
1607
|
+
* exactly like a first registration.
|
|
1608
|
+
*/
|
|
1609
|
+
private commitRoutes;
|
|
1610
|
+
/**
|
|
1611
|
+
* Describe provider routes with a registered adapter.
|
|
1612
|
+
* @returns detached provider metadata in registration order.
|
|
1613
|
+
*/
|
|
1614
|
+
listProviders(): LlmProviderInfo[];
|
|
1615
|
+
/**
|
|
1616
|
+
* Declare provider routes an adapter plugin can activate through
|
|
1617
|
+
* configuration. Registration is all-or-nothing: an empty list, invalid
|
|
1618
|
+
* entry, or a provider already declared by any registration throws
|
|
1619
|
+
* `LlmError` without registering the rest. Disposed with the fiber.
|
|
1620
|
+
* @param entries - every configurable provider this plugin owns.
|
|
1621
|
+
* @returns a handle that withdraws all of them, and can atomically replace them.
|
|
1622
|
+
*/
|
|
1623
|
+
registerConfigurableProviders(entries: readonly LlmConfigurableProvider[]): DirectoryRegistrationHandle;
|
|
1624
|
+
/**
|
|
1625
|
+
* List every declared configurable provider, registered or dormant.
|
|
1626
|
+
* @returns detached directory entries in declaration order.
|
|
1627
|
+
*/
|
|
1628
|
+
listConfigurableProviders(): LlmConfigurableProvider[];
|
|
1629
|
+
/**
|
|
1630
|
+
* Offer to interrogate provider endpoints on behalf of the settings
|
|
1631
|
+
* namespace this plugin owns. The namespace is the key because that is what
|
|
1632
|
+
* a configuration surface already holds from the configurable-provider
|
|
1633
|
+
* directory, and because a provider being *added* has no route to name yet.
|
|
1634
|
+
* Disposed with the fiber.
|
|
1635
|
+
* @param settingsNs - the namespace whose profiles this discovery serves.
|
|
1636
|
+
* @param discover - interrogates one endpoint and must honor the supplied signal.
|
|
1637
|
+
* @returns the disposer that withdraws the offer.
|
|
1638
|
+
*/
|
|
1639
|
+
registerModelDiscovery(settingsNs: string, discover: (request: LlmModelDiscoveryRequest, signal?: AbortSignal) => Promise<readonly LlmDiscoveredModel[]>): () => void;
|
|
1640
|
+
/**
|
|
1641
|
+
* Interrogate one provider endpoint for the models it advertises. The
|
|
1642
|
+
* request describes a draft, not a stored route, so nothing here reads or
|
|
1643
|
+
* writes settings or credentials — the caller owns both, and the reply is
|
|
1644
|
+
* candidate metadata a surface may offer for adoption.
|
|
1645
|
+
* @param settingsNs - namespace whose registered discovery serves this draft.
|
|
1646
|
+
* @param request - the endpoint, protocol, and one-shot credential to use.
|
|
1647
|
+
* @param signal - caller cancellation.
|
|
1648
|
+
* @returns the advertised models, deduplicated in endpoint order.
|
|
1649
|
+
*/
|
|
1650
|
+
discoverModels(settingsNs: string, request: LlmModelDiscoveryRequest, signal?: AbortSignal): Promise<LlmDiscoveredModel[]>;
|
|
1651
|
+
/**
|
|
1652
|
+
* Remote adapter for one draft provider interrogation.
|
|
1653
|
+
* @param settingsNs - namespace whose registered discovery serves this draft.
|
|
1654
|
+
* @param request - endpoint, protocol, and one-shot credential to use.
|
|
1655
|
+
* @param signal - caller cancellation supplied by the Remote carrier.
|
|
1656
|
+
* @returns advertised models in endpoint order.
|
|
1657
|
+
* @throws RemoteError with `llm/model-discovery-rejected` when discovery refuses or fails.
|
|
1658
|
+
*/
|
|
1659
|
+
remoteDiscoverModels(settingsNs: string, request: LlmModelDiscoveryRequest, signal: AbortSignal): Promise<LlmDiscoveredModel[]>;
|
|
1660
|
+
/**
|
|
1661
|
+
* Resolve the retry policy captured when one provider route was registered.
|
|
1662
|
+
* @param provider - registered provider route to inspect.
|
|
1663
|
+
* @returns the provider-owned policy, with normal defaults already resolved.
|
|
1664
|
+
*/
|
|
1665
|
+
providerRetryPolicy(provider: string): ResolvedRetryPolicy;
|
|
1666
|
+
/**
|
|
1667
|
+
* Resolve provider-side request-image pricing for one exact route, or
|
|
1668
|
+
* `undefined` when the provider is unregistered or declares none. Unknown
|
|
1669
|
+
* providers degrade to `undefined` rather than throwing because callers
|
|
1670
|
+
* price durable history whose route may no longer be mounted.
|
|
1671
|
+
* @param provider - provider route named by a request header.
|
|
1672
|
+
* @param model - exact model id named by the same header.
|
|
1673
|
+
* @returns the owning adapter's image pricing for the route, when declared.
|
|
1674
|
+
*/
|
|
1675
|
+
imageRequestPricing(provider: string, model: string): LlmImageRequestPricing | undefined;
|
|
1676
|
+
/**
|
|
1677
|
+
* Resolve the image projection for an exact registered model route.
|
|
1678
|
+
* @param provider - registered provider route.
|
|
1679
|
+
* @param model - exact model id.
|
|
1680
|
+
* @param image - normalized image reference.
|
|
1681
|
+
* @returns dimensions and byte target used by the adapter's request serializer.
|
|
1682
|
+
*/
|
|
1683
|
+
imageRequestTarget(provider: string, model: string, image: ImageAttachmentRef): ImageRequestTarget;
|
|
1684
|
+
/**
|
|
1685
|
+
* Resolve the exact text one durable file occurrence contributes to every
|
|
1686
|
+
* provider request in the current execution environment.
|
|
1687
|
+
* @param ref - durable verbatim file reference from model history.
|
|
1688
|
+
* @returns the same deterministic handle text used at adapter dispatch.
|
|
1689
|
+
*/
|
|
1690
|
+
fileRequestText(ref: FileAttachmentRef): string;
|
|
1691
|
+
/** Detach typed adapter-owned modality metadata. */
|
|
1692
|
+
private detachedModalities;
|
|
1693
|
+
/**
|
|
1694
|
+
* Discover models advertised by one registered provider. Catalog membership
|
|
1695
|
+
* does not constrain core routing. Catalog-driven entry points may restrict
|
|
1696
|
+
* selection and submission to the advertised models.
|
|
1697
|
+
* @param provider - registered provider route to inspect.
|
|
1698
|
+
* @returns detached model metadata in adapter-preferred order.
|
|
1699
|
+
*/
|
|
1700
|
+
listModels(provider: string): Promise<LlmModelInfo[]>;
|
|
1701
|
+
/**
|
|
1702
|
+
* Resolve and validate all metadata from the adapter that owns one exact
|
|
1703
|
+
* route. The result is detached from adapter-owned objects; catalog
|
|
1704
|
+
* membership remains advisory and does not control request routing.
|
|
1705
|
+
* @param provider - registered provider route to inspect.
|
|
1706
|
+
* @param model - exact model id passed to the adapter.
|
|
1707
|
+
* @param signal - optional cancellation for adapter-owned asynchronous lookup.
|
|
1708
|
+
* @returns exact model identity plus available context and reasoning metadata.
|
|
1709
|
+
*/
|
|
1710
|
+
resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
1711
|
+
private resolveModelInfoFor;
|
|
1712
|
+
/** Validate and detach one adapter-returned exact model result. */
|
|
1713
|
+
private normalizeModelInfo;
|
|
1714
|
+
/**
|
|
1715
|
+
* Validate a conversation call config against its exact model capability and
|
|
1716
|
+
* materialize adapter-configured defaults. Unsupported explicit efforts
|
|
1717
|
+
* reject before provider I/O; no clamping or aliasing is performed. This
|
|
1718
|
+
* standalone query does not bind a later dispatch; use {@link prepareCall}
|
|
1719
|
+
* when logging and streaming must share one adapter registration.
|
|
1720
|
+
* @param config - provider/model route and optional request controls.
|
|
1721
|
+
* @param signal - optional cancellation for adapter-owned capability lookup.
|
|
1722
|
+
* @returns a detached config only when a default must be materialized.
|
|
1723
|
+
*/
|
|
1724
|
+
resolveCallConfig(config: LlmCallConfig, signal?: AbortSignal): Promise<LlmCallConfig>;
|
|
1725
|
+
private resolveCallFor;
|
|
1726
|
+
/** Validate request controls against one already-bound exact model result. */
|
|
1727
|
+
private resolveCallWithInfo;
|
|
1728
|
+
/**
|
|
1729
|
+
* Resolve one call under its current adapter registration. The returned
|
|
1730
|
+
* one-shot handle keeps that registration across header logging and dispatch,
|
|
1731
|
+
* so HMR cannot combine one adapter's capability result with another adapter.
|
|
1732
|
+
* An optional synchronous callback selects concrete controls using captured
|
|
1733
|
+
* model metadata. Defaults and validation apply to its result. Callback
|
|
1734
|
+
* failures and cancellation reject preparation before dispatch.
|
|
1735
|
+
* @param config - provider/model route and optional concrete request controls.
|
|
1736
|
+
* @param signal - optional cancellation for adapter-owned capability lookup.
|
|
1737
|
+
* @param configure - pure control selection, called once before defaults and validation.
|
|
1738
|
+
* @returns a prepared config and its registration-bound stream entry point.
|
|
1739
|
+
*/
|
|
1740
|
+
prepareCall(config: LlmCallConfig, signal?: AbortSignal, configure?: ConfigureCall): Promise<PreparedLlmCall>;
|
|
1741
|
+
private registration;
|
|
1742
|
+
/** Remove replay state whose historical route is owned by another adapter. */
|
|
1743
|
+
private forAdapter;
|
|
1744
|
+
/**
|
|
1745
|
+
* Resolve the current execution-world read path of one durable file
|
|
1746
|
+
* reference through the mounted attachment and filesystem providers.
|
|
1747
|
+
*/
|
|
1748
|
+
private fileReadPath;
|
|
1749
|
+
/**
|
|
1750
|
+
* Final adapter boundary. Adapter selection, dispatch, iterator construction,
|
|
1751
|
+
* and iteration failures become one terminal failure chunk. Middleware and
|
|
1752
|
+
* downstream consumer failures remain thrown plugin or consumer errors.
|
|
1753
|
+
*/
|
|
1754
|
+
private adapterStream;
|
|
1755
|
+
/**
|
|
1756
|
+
* Stream one model call as raw chunks (token-level deltas). Replay state is
|
|
1757
|
+
* retained only when the same adapter instance owns its historical provider
|
|
1758
|
+
* and the target provider. Final adapter selection remains fixed through
|
|
1759
|
+
* asynchronous exact-model resolution and dispatch. Adapter selection,
|
|
1760
|
+
* dispatch, and iteration failures become terminal `error` or `aborted`
|
|
1761
|
+
* finish chunks; middleware, nested-call, cleanup, and consumer failures
|
|
1762
|
+
* remain thrown.
|
|
1763
|
+
* @param options - the full request; `options.provider` selects the adapter.
|
|
1764
|
+
* @returns the chunk stream, possibly wrapped by `llm/stream` listeners.
|
|
1765
|
+
*/
|
|
1766
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
1767
|
+
private streamWithRegistration;
|
|
1768
|
+
}
|
|
1769
|
+
//#endregion
|
|
1770
|
+
//#region ../dsh-plugin-kit/src/contracts.d.ts
|
|
1771
|
+
/** Public, browser-safe contracts. Host implementations stay in their owning packages. */
|
|
1772
|
+
type ProducerSourceKind = `plugin:${string}`;
|
|
1773
|
+
type ProducerMessageSource = {
|
|
1774
|
+
kind: ProducerSourceKind;
|
|
1775
|
+
plugin: string;
|
|
1776
|
+
} & ContextFormed;
|
|
1777
|
+
/**
|
|
1778
|
+
* V4 sessions persist the producing extension in `kind`; the retired generic
|
|
1779
|
+
* `plugin` wrapper is not admitted. Each feature plugin declares its own kind.
|
|
1780
|
+
*/
|
|
1781
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
1782
|
+
interface MessageSourceMap {
|
|
1783
|
+
[kind: ProducerSourceKind]: ProducerMessageSource;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
type RpcResult$1<T = unknown> = {
|
|
1787
|
+
ok: true;
|
|
1788
|
+
value: T;
|
|
1789
|
+
} | {
|
|
1790
|
+
ok: false;
|
|
1791
|
+
error: {
|
|
1792
|
+
code: string;
|
|
1793
|
+
message: string;
|
|
1794
|
+
};
|
|
1795
|
+
};
|
|
1796
|
+
//#endregion
|
|
3
1797
|
//#region src/contracts.d.ts
|
|
4
1798
|
type RpcResult<T = unknown> = Extract<RpcResult$1<T>, {
|
|
5
1799
|
ok: true;
|
|
@@ -17,6 +1811,8 @@ declare const PURPOSE_ID = "git-commit.plan";
|
|
|
17
1811
|
declare const RPC_CHANNEL = "/dsh-git-commit";
|
|
18
1812
|
declare const GIT_COMMIT_CLIENT_SERVICE = "dshGitCommitClient";
|
|
19
1813
|
declare const PROMPT_VERSION = "git-commit.v1";
|
|
1814
|
+
/** Feature id stamped on the auxiliary-context envelope for this call. */
|
|
1815
|
+
declare const COMMIT_PLAN_FEATURE = "git-commit-plan";
|
|
20
1816
|
declare const SCHEMA_VERSION = "commit-plan-json.v1";
|
|
21
1817
|
declare const CONTRACT_VERSION = 1;
|
|
22
1818
|
declare const DEFAULT_MAX_OUTPUT_TOKENS = 2048;
|
|
@@ -53,8 +1849,8 @@ declare function normalizeFallback(value: unknown): boolean;
|
|
|
53
1849
|
interface CommitModelInfo {
|
|
54
1850
|
readonly provider: string;
|
|
55
1851
|
readonly model: string;
|
|
56
|
-
/** 'page' is the plugin-page selection; 'default' follows the session or host chat model. */
|
|
57
|
-
readonly source: 'page' | 'default';
|
|
1852
|
+
/** 'page' is the plugin-page selection; 'aux' the shared default auxiliary model; 'default' follows the session or host chat model. */
|
|
1853
|
+
readonly source: 'page' | 'aux' | 'default';
|
|
58
1854
|
}
|
|
59
1855
|
interface GitCommitStatus {
|
|
60
1856
|
readonly available: boolean;
|
|
@@ -106,5 +1902,5 @@ interface PartialCommitResult {
|
|
|
106
1902
|
}[];
|
|
107
1903
|
}
|
|
108
1904
|
//#endregion
|
|
109
|
-
export {
|
|
1905
|
+
export { SCHEMA_VERSION as C, LlmRuntime as D, normalizeFallback as E, defaultModelRoute as O, RpcResult as S, defaultSettings as T, PROMPT_VERSION as _, CommitModelRoute as a, RECENT_LOG_COUNT as b, FEATURE_ID as c, GitCommitSettings as d, GitCommitStatus as f, PLUGIN_NAME as g, MAX_UNTRACKED_PREVIEW_CHARS as h, CommitModelInfo as i, normalizeModelRoute as k, GIT_COMMIT_CLIENT_SERVICE as l, MAX_MESSAGE_CHARS as m, CONTRACT_VERSION as n, CommitRunResult as o, MAX_MANIFEST_CHARS as p, CommitGroupResult as r, DEFAULT_MAX_OUTPUT_TOKENS as s, COMMIT_PLAN_FEATURE as t, GIT_TIMEOUT_MS as u, PURPOSE_ID as v, SETTINGS_KEY as w, RPC_CHANNEL as x, PartialCommitResult as y };
|
|
110
1906
|
//# sourceMappingURL=contracts.d.ts.map
|