@khorsheed/dsh-file-preview 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.en.md +88 -0
- package/README.i18n.yaml +6 -0
- package/README.md +88 -0
- package/cordis.patch.yml +7 -0
- package/lib/index.js +1338 -0
- package/lib/invariant.js +25 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +549 -0
- package/lib/typert.remote-client.d.ts +35 -0
- package/lib/typert.remote-client.d.ts.map +1 -0
- package/lib/typert.remote-client.js +210 -0
- package/lib/types/bash-writes.d.ts +83 -0
- package/lib/types/bash-writes.d.ts.map +1 -0
- package/lib/types/bash-writes.js +367 -0
- package/lib/types/fold.d.ts +77 -0
- package/lib/types/fold.d.ts.map +1 -0
- package/lib/types/fold.js +309 -0
- package/lib/types/index.d.ts +105 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +517 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +23 -0
- package/lib/types/reveal.d.ts +36 -0
- package/lib/types/reveal.d.ts.map +1 -0
- package/lib/types/reveal.js +77 -0
- package/lib/types/types.d.ts +124 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/types.js +2 -0
- package/package.json +81 -0
- package/skills/3d-artifact/SKILL.md +52 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _khorsheed_dsh_file_preview_filePreview_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
5
|
+
const _khorsheed_dsh_file_preview_filePreview_list_result$schema = z.object({
|
|
6
|
+
'entries': z.array(z.object({
|
|
7
|
+
'path': z.string().readonly(),
|
|
8
|
+
'op': z.union([z.literal("read"), z.literal("write"), z.literal("edit")]).readonly(),
|
|
9
|
+
'seq': z.number().readonly(),
|
|
10
|
+
'turn': z.number().readonly(),
|
|
11
|
+
'step': z.number().readonly(),
|
|
12
|
+
'diffs': z.array(z.object({
|
|
13
|
+
'seq': z.number().readonly(),
|
|
14
|
+
'turn': z.number().readonly(),
|
|
15
|
+
'step': z.number().readonly(),
|
|
16
|
+
'oldText': z.union([z.literal(null), z.string()]).readonly(),
|
|
17
|
+
'newText': z.string().readonly(),
|
|
18
|
+
})).readonly(),
|
|
19
|
+
'lastDiff': z.union([z.undefined(), z.object({
|
|
20
|
+
'oldText': z.union([z.literal(null), z.string()]).readonly(),
|
|
21
|
+
'newText': z.string().readonly(),
|
|
22
|
+
})]).readonly().optional(),
|
|
23
|
+
})).readonly(),
|
|
24
|
+
'asOfSeq': z.number().readonly(),
|
|
25
|
+
'truncated': z.boolean().readonly(),
|
|
26
|
+
})
|
|
27
|
+
const _khorsheed_dsh_file_preview_filePreview_read_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
28
|
+
const _khorsheed_dsh_file_preview_filePreview_read_parameter_1$schema = z.string()
|
|
29
|
+
const _khorsheed_dsh_file_preview_filePreview_read_result$schema = z.object({
|
|
30
|
+
'path': z.string().readonly(),
|
|
31
|
+
'kind': z.union([z.literal("text"), z.literal("image"), z.literal("binary"), z.literal("missing"), z.literal("too-large"), z.literal("error")]).readonly(),
|
|
32
|
+
'content': z.string().readonly().optional(),
|
|
33
|
+
'url': z.string().readonly().optional(),
|
|
34
|
+
'truncated': z.boolean().readonly().optional(),
|
|
35
|
+
'htmlScripted': z.boolean().readonly().optional(),
|
|
36
|
+
'size': z.number().readonly().optional(),
|
|
37
|
+
'message': z.string().readonly().optional(),
|
|
38
|
+
})
|
|
39
|
+
const _khorsheed_dsh_file_preview_filePreview_reveal_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
40
|
+
const _khorsheed_dsh_file_preview_filePreview_reveal_parameter_1$schema = z.string()
|
|
41
|
+
const _khorsheed_dsh_file_preview_filePreview_reveal_result$schema = z.union([z.object({
|
|
42
|
+
'revealed': z.literal(true).readonly(),
|
|
43
|
+
}), z.object({
|
|
44
|
+
'revealed': z.literal(false).readonly(),
|
|
45
|
+
'reason': z.union([z.literal("missing"), z.literal("select-failed")]).readonly(),
|
|
46
|
+
})])
|
|
47
|
+
const _khorsheed_dsh_file_preview_filePreview_turnFiles_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
48
|
+
const _khorsheed_dsh_file_preview_filePreview_turnFiles_result$schema = z.object({
|
|
49
|
+
'turns': z.array(z.object({
|
|
50
|
+
'turn': z.number().readonly(),
|
|
51
|
+
'files': z.array(z.object({
|
|
52
|
+
'path': z.string().readonly(),
|
|
53
|
+
'seq': z.number().readonly(),
|
|
54
|
+
'step': z.number().readonly(),
|
|
55
|
+
'added': z.number().readonly().optional(),
|
|
56
|
+
'removed': z.number().readonly().optional(),
|
|
57
|
+
})).readonly(),
|
|
58
|
+
})).readonly(),
|
|
59
|
+
'asOfSeq': z.number().readonly(),
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
export const TYPERT = {
|
|
63
|
+
package: '@khorsheed/dsh-file-preview',
|
|
64
|
+
face: 'host',
|
|
65
|
+
schemas: [
|
|
66
|
+
],
|
|
67
|
+
invocations: [
|
|
68
|
+
{
|
|
69
|
+
id: '@khorsheed/dsh-file-preview#filePreview/list',
|
|
70
|
+
service: 'filePreview',
|
|
71
|
+
namespace: 'filePreview',
|
|
72
|
+
method: 'list',
|
|
73
|
+
invocation: { kind: 'direct' },
|
|
74
|
+
scope: {
|
|
75
|
+
context: 'agent',
|
|
76
|
+
wire: 'agentId',
|
|
77
|
+
},
|
|
78
|
+
parameters: [
|
|
79
|
+
{
|
|
80
|
+
name: 'agent',
|
|
81
|
+
wire: 'agentId',
|
|
82
|
+
source: 'lookup',
|
|
83
|
+
lookup: 'agent',
|
|
84
|
+
codec: {
|
|
85
|
+
mode: 'strict',
|
|
86
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
87
|
+
schema: _khorsheed_dsh_file_preview_filePreview_list_parameter_0$schema,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
result: {
|
|
92
|
+
mode: 'strict',
|
|
93
|
+
typeSymbol: '@khorsheed/dsh-file-preview/types#FilePreviewList',
|
|
94
|
+
schema: _khorsheed_dsh_file_preview_filePreview_list_result$schema,
|
|
95
|
+
},
|
|
96
|
+
sourceLocation: {"file":"packages/file-preview/src/index.ts","line":316,"column":3},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: '@khorsheed/dsh-file-preview#filePreview/read',
|
|
100
|
+
service: 'filePreview',
|
|
101
|
+
namespace: 'filePreview',
|
|
102
|
+
method: 'read',
|
|
103
|
+
invocation: { kind: 'direct' },
|
|
104
|
+
scope: {
|
|
105
|
+
context: 'agent',
|
|
106
|
+
wire: 'agentId',
|
|
107
|
+
},
|
|
108
|
+
parameters: [
|
|
109
|
+
{
|
|
110
|
+
name: 'agent',
|
|
111
|
+
wire: 'agentId',
|
|
112
|
+
source: 'lookup',
|
|
113
|
+
lookup: 'agent',
|
|
114
|
+
codec: {
|
|
115
|
+
mode: 'strict',
|
|
116
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
117
|
+
schema: _khorsheed_dsh_file_preview_filePreview_read_parameter_0$schema,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'path',
|
|
122
|
+
wire: 'path',
|
|
123
|
+
source: 'json',
|
|
124
|
+
codec: {
|
|
125
|
+
mode: 'strict',
|
|
126
|
+
typeSymbol: '@khorsheed/dsh-file-preview#filePreview/read:path',
|
|
127
|
+
schema: _khorsheed_dsh_file_preview_filePreview_read_parameter_1$schema,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
cancellation: { parameter: 'signal' },
|
|
132
|
+
result: {
|
|
133
|
+
mode: 'strict',
|
|
134
|
+
typeSymbol: '@khorsheed/dsh-file-preview/types#FilePreviewRead',
|
|
135
|
+
schema: _khorsheed_dsh_file_preview_filePreview_read_result$schema,
|
|
136
|
+
},
|
|
137
|
+
sourceLocation: {"file":"packages/file-preview/src/index.ts","line":392,"column":9},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: '@khorsheed/dsh-file-preview#filePreview/reveal',
|
|
141
|
+
service: 'filePreview',
|
|
142
|
+
namespace: 'filePreview',
|
|
143
|
+
method: 'reveal',
|
|
144
|
+
invocation: { kind: 'direct' },
|
|
145
|
+
scope: {
|
|
146
|
+
context: 'agent',
|
|
147
|
+
wire: 'agentId',
|
|
148
|
+
},
|
|
149
|
+
parameters: [
|
|
150
|
+
{
|
|
151
|
+
name: 'agent',
|
|
152
|
+
wire: 'agentId',
|
|
153
|
+
source: 'lookup',
|
|
154
|
+
lookup: 'agent',
|
|
155
|
+
codec: {
|
|
156
|
+
mode: 'strict',
|
|
157
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
158
|
+
schema: _khorsheed_dsh_file_preview_filePreview_reveal_parameter_0$schema,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'path',
|
|
163
|
+
wire: 'path',
|
|
164
|
+
source: 'json',
|
|
165
|
+
codec: {
|
|
166
|
+
mode: 'strict',
|
|
167
|
+
typeSymbol: '@khorsheed/dsh-file-preview#filePreview/reveal:path',
|
|
168
|
+
schema: _khorsheed_dsh_file_preview_filePreview_reveal_parameter_1$schema,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
cancellation: { parameter: 'signal' },
|
|
173
|
+
result: {
|
|
174
|
+
mode: 'strict',
|
|
175
|
+
typeSymbol: '@khorsheed/dsh-file-preview/types#FilePreviewReveal',
|
|
176
|
+
schema: _khorsheed_dsh_file_preview_filePreview_reveal_result$schema,
|
|
177
|
+
},
|
|
178
|
+
sourceLocation: {"file":"packages/file-preview/src/index.ts","line":469,"column":9},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: '@khorsheed/dsh-file-preview#filePreview/turnFiles',
|
|
182
|
+
service: 'filePreview',
|
|
183
|
+
namespace: 'filePreview',
|
|
184
|
+
method: 'turnFiles',
|
|
185
|
+
invocation: { kind: 'direct' },
|
|
186
|
+
scope: {
|
|
187
|
+
context: 'agent',
|
|
188
|
+
wire: 'agentId',
|
|
189
|
+
},
|
|
190
|
+
parameters: [
|
|
191
|
+
{
|
|
192
|
+
name: 'agent',
|
|
193
|
+
wire: 'agentId',
|
|
194
|
+
source: 'lookup',
|
|
195
|
+
lookup: 'agent',
|
|
196
|
+
codec: {
|
|
197
|
+
mode: 'strict',
|
|
198
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
199
|
+
schema: _khorsheed_dsh_file_preview_filePreview_turnFiles_parameter_0$schema,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
result: {
|
|
204
|
+
mode: 'strict',
|
|
205
|
+
typeSymbol: '@khorsheed/dsh-file-preview/types#FilePreviewTurnMap',
|
|
206
|
+
schema: _khorsheed_dsh_file_preview_filePreview_turnFiles_result$schema,
|
|
207
|
+
},
|
|
208
|
+
sourceLocation: {"file":"packages/file-preview/src/index.ts","line":347,"column":3},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
model: {
|
|
212
|
+
"services": [
|
|
213
|
+
{
|
|
214
|
+
"description": "The `filePreview` Remote service: session-scoped read-only file inspection for web surfaces. `list` is a pure fold over the session log (no filesystem access); `read` resolves the path against the session cwd and serves current text content through `ctx.fs` (or a browser URL for images), capped by config. Image bytes ride a dedicated host route so the browser loads them natively without bloating the RPC channel.",
|
|
215
|
+
"summary": "The `filePreview` Remote service: session-scoped read-only file inspection for web surfaces.",
|
|
216
|
+
"tags": [],
|
|
217
|
+
"jsDoc": "/**\n * The `filePreview` Remote service: session-scoped read-only file inspection\n * for web surfaces. `list` is a pure fold over the session log (no filesystem\n * access); `read` resolves the path against the session cwd and serves current\n * text content through `ctx.fs` (or a browser URL for images), capped by\n * config. Image bytes ride a dedicated host route so the browser loads them\n * natively without bloating the RPC channel.\n */",
|
|
218
|
+
"key": "filePreview",
|
|
219
|
+
"exportName": "FilePreviewService",
|
|
220
|
+
"members": [
|
|
221
|
+
{
|
|
222
|
+
"kind": "method",
|
|
223
|
+
"name": "list",
|
|
224
|
+
"signature": "@Remote('list') list(agent: Agent): FilePreviewList",
|
|
225
|
+
"summary": "List the files one session wrote or edited: the log fold plus any bash-written files the collector verified (the S2 seam), merged so a captured path the fold already knows keeps its log-derived entry.",
|
|
226
|
+
"jsDoc": "/**\n * List the files one session wrote or edited: the log fold plus any\n * bash-written files the collector verified (the S2 seam), merged so a\n * captured path the fold already knows keeps its log-derived entry.\n * @param agent - owning live agent; its session log is the data source.\n * @returns first-seen files capped by `maxFiles`, with the log watermark.\n */"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"kind": "method",
|
|
230
|
+
"name": "turnFiles",
|
|
231
|
+
"signature": "@Remote('turnFiles') turnFiles(agent: Agent): FilePreviewTurnMap",
|
|
232
|
+
"summary": "Every turn's file mutations for the turn-tail card — the single source of truth the card renders (the client's old write/edit-only fold retired).",
|
|
233
|
+
"jsDoc": "/**\n * Every turn's file mutations for the turn-tail card — the single source of\n * truth the card renders (the client's old write/edit-only fold retired).\n * Built by folding the session log per turn (write/edit calls, Code Mode\n * dispatches borrowing the root call's turn, and render-intent paths from\n * result diff meta) and merging the collector's bash-written captures by\n * their own turn. The fold is cached per session and invalidated by the log\n * watermark, so repeated card fetches do not refold. A path touched in two\n * turns appears in BOTH turn groups — per-turn attribution is exact.\n * @param agent - owning live agent; its session log is the data source.\n * @returns per-turn file groups plus the scanned watermark.\n */"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"kind": "method",
|
|
237
|
+
"name": "read",
|
|
238
|
+
"signature": "@Remote('read') async read(agent: Agent, path: string, signal: AbortSignal): Promise<FilePreviewRead>",
|
|
239
|
+
"summary": "Read the current content of one recorded file, resolved against the session cwd and capped by `maxReadBytes`.",
|
|
240
|
+
"jsDoc": "/**\n * Read the current content of one recorded file, resolved against the\n * session cwd and capped by `maxReadBytes`.\n * @param agent - owning live agent; its session cwd anchors relative paths.\n * @param path - the display path recorded by the write/edit tool call.\n * @param signal - cooperative cancellation from the calling UI request.\n * @returns the classified read; `text` carries content, `image` carries a\n * browser URL, other kinds carry the size or a human-readable reason.\n */"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"kind": "method",
|
|
244
|
+
"name": "reveal",
|
|
245
|
+
"signature": "@Remote('reveal') async reveal(agent: Agent, path: string, signal: AbortSignal): Promise<FilePreviewReveal>",
|
|
246
|
+
"summary": "Reveal one recorded file in the host file manager — open its folder and select the file (macOS Finder, Windows Explorer, or a select-capable desktop file manager).",
|
|
247
|
+
"jsDoc": "/**\n * Reveal one recorded file in the host file manager — open its folder and\n * select the file (macOS Finder, Windows Explorer, or a select-capable\n * desktop file manager). The display path resolves against the session cwd;\n * the native reveal runs on the host. A path that does not resolve to an\n * existing target, or a platform that cannot select, answers `revealed:\n * false` and the caller opens the parent folder instead (the pre-reveal\n * \"show in folder\" behavior), so the gesture always lands somewhere visible.\n * @param agent - owning live agent; its session cwd anchors relative paths.\n * @param path - the display path recorded by the read/write/edit tool call.\n * @param signal - cooperative cancellation from the calling UI request.\n * @returns whether the file manager selected the file, or why not.\n */"
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"types": [
|
|
251
|
+
{
|
|
252
|
+
"name": "Agent",
|
|
253
|
+
"declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "AgentCancelCause",
|
|
257
|
+
"declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "AgentOptions",
|
|
261
|
+
"declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n maxTokens?: number;\n}"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "AgentStatus",
|
|
265
|
+
"declaration": "export type AgentStatus = 'idle' | 'running';"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "AssistantMessage",
|
|
269
|
+
"declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "AssistantProvenance",
|
|
273
|
+
"declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "AttachmentId",
|
|
277
|
+
"declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "Branded",
|
|
281
|
+
"declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "CallId",
|
|
285
|
+
"declaration": "export type CallId = Branded<'CallId'>;"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "CancelOptions",
|
|
289
|
+
"declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "CodeDispatchEventData",
|
|
293
|
+
"declaration": "export interface CodeDispatchEventData extends CodeDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "CodeDispatchStartEventData",
|
|
297
|
+
"declaration": "export interface CodeDispatchStartEventData {\n rootCallId: CallId;\n parentCallId: CallId;\n subCallId: CallId;\n name: string;\n arguments: unknown;\n}"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "ContentBlock",
|
|
301
|
+
"declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"name": "ContentBlockMap",
|
|
305
|
+
"declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "ContentBlockType",
|
|
309
|
+
"declaration": "export type ContentBlockType = keyof ContentBlockMap;"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "ContextFormed",
|
|
313
|
+
"declaration": "export type ContextFormed = { readonly form?: never; } | { readonly form: 'instructions'; } | { readonly form: 'catalog'; } | { readonly form: 'snapshot'; readonly sections: readonly ContextSnapshotSection[]; } | { readonly form: 'notice'; readonly summary: string; } | { readonly form: 'relay'; } | { readonly form: 'recall'; };"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "ContextSnapshotSection",
|
|
317
|
+
"declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "EpochHeader",
|
|
321
|
+
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "FilePreviewDiff",
|
|
325
|
+
"declaration": "export interface FilePreviewDiff {\n readonly seq: number;\n readonly turn: number;\n readonly step: number;\n readonly oldText: string | null;\n readonly newText: string;\n}"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "FilePreviewEntry",
|
|
329
|
+
"declaration": "export interface FilePreviewEntry {\n readonly path: string;\n readonly op: FilePreviewOp;\n readonly seq: number;\n readonly turn: number;\n readonly step: number;\n readonly diffs: readonly FilePreviewDiff[];\n readonly lastDiff?: { readonly oldText: string | null; readonly newText: string; } | undefined;\n}"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "FilePreviewList",
|
|
333
|
+
"declaration": "export interface FilePreviewList {\n readonly entries: readonly FilePreviewEntry[];\n readonly asOfSeq: number;\n readonly truncated: boolean;\n}"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "FilePreviewOp",
|
|
337
|
+
"declaration": "export type FilePreviewOp = 'read' | 'write' | 'edit';"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "FilePreviewRead",
|
|
341
|
+
"declaration": "export interface FilePreviewRead {\n readonly path: string;\n readonly kind: FilePreviewReadKind;\n readonly content?: string;\n readonly url?: string;\n readonly truncated?: boolean;\n readonly htmlScripted?: boolean;\n readonly size?: number;\n readonly message?: string;\n}"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"name": "FilePreviewReadKind",
|
|
345
|
+
"declaration": "export type FilePreviewReadKind = 'text' | 'image' | 'binary' | 'missing' | 'too-large' | 'error';"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "FilePreviewReveal",
|
|
349
|
+
"declaration": "export type FilePreviewReveal = { readonly revealed: true; } | { readonly revealed: false; readonly reason: 'missing' | 'select-failed'; };"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "FilePreviewTurnFile",
|
|
353
|
+
"declaration": "export interface FilePreviewTurnFile {\n readonly path: string;\n readonly seq: number;\n readonly step: number;\n readonly added?: number;\n readonly removed?: number;\n}"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"name": "FilePreviewTurnGroup",
|
|
357
|
+
"declaration": "export interface FilePreviewTurnGroup {\n readonly turn: number;\n readonly files: readonly FilePreviewTurnFile[];\n}"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "FilePreviewTurnMap",
|
|
361
|
+
"declaration": "export interface FilePreviewTurnMap {\n readonly turns: readonly FilePreviewTurnGroup[];\n readonly asOfSeq: number;\n}"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "FinishReason",
|
|
365
|
+
"declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "FinishReasonMap",
|
|
369
|
+
"declaration": "export interface FinishReasonMap {\n stop: { kind: 'stop'; };\n 'tool-calls': { kind: 'tool-calls'; };\n 'max-tokens': { kind: 'max-tokens'; };\n aborted: { kind: 'aborted'; failure: LlmFailure; };\n error: { kind: 'error'; failure: LlmFailure; };\n}"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "ImageAttachmentRef",
|
|
373
|
+
"declaration": "export interface ImageAttachmentRef {\n attachmentId: AttachmentId;\n mediaType: ImageMediaType;\n bytes: number;\n width: number;\n height: number;\n name?: string;\n originalDimensions?: { width: number; height: number; };\n}"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "ImageBlock",
|
|
377
|
+
"declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "ImageMediaType",
|
|
381
|
+
"declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "Inbox",
|
|
385
|
+
"declaration": "export class Inbox {\n get nextTurn(): readonly UserMessage[];\n get nextStep(): readonly UserMessage[];\n get hasPending(): boolean;\n clear(): void;\n claim(target: InboxTarget, turn: number): UserMessage[];\n append(target: InboxTarget, message: UserMessage): void;\n prepend(target: InboxTarget, message: UserMessage): void;\n replace(messageId: MessageId, newMessage: UserMessage): boolean;\n remove(messageId: MessageId): boolean;\n splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];\n}"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "InboxTarget",
|
|
389
|
+
"declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"name": "JsonValue",
|
|
393
|
+
"declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "LlmCallConfig",
|
|
397
|
+
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "LlmCallConfigAdapterDefaults",
|
|
401
|
+
"declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"name": "LlmFailure",
|
|
405
|
+
"declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n}"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "Message",
|
|
409
|
+
"declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "MessageId",
|
|
413
|
+
"declaration": "export type MessageId = Branded<'MessageId'>;"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "MessageSource",
|
|
417
|
+
"declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "MessageSourceMap",
|
|
421
|
+
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n}"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "ModelMessageSource",
|
|
425
|
+
"declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"name": "ProviderRequestId",
|
|
429
|
+
"declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "ReasoningBlock",
|
|
433
|
+
"declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "ReasoningEffortId",
|
|
437
|
+
"declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "ReplayEnvelope",
|
|
441
|
+
"declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"name": "RequestContext",
|
|
445
|
+
"declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n}"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"name": "RequestHeaderReason",
|
|
449
|
+
"declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change';"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "Session",
|
|
453
|
+
"declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n get id(): SessionId;\n readonly firstLiveSeq: number;\n get events(): readonly SessionEvent[];\n get seq(): number;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"name": "SessionEvent",
|
|
457
|
+
"declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: number; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? { sourceEventSeqs?: number[]; surfaceOp?: SurfaceOp; } : object) }[T];"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"name": "SessionEventMap",
|
|
461
|
+
"declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true; };\n 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'todo/write': { todos: TodoItem[]; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'tool/code-dispatch-start': CodeDispatchStartEventData;\n 'tool/code-dispatch': CodeDispatchEventData;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n}"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "SessionEventType",
|
|
465
|
+
"declaration": "export type SessionEventType = keyof SessionEventMap;"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "SessionHeader",
|
|
469
|
+
"declaration": "export interface SessionHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly seedLength?: number;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "SessionId",
|
|
473
|
+
"declaration": "export type SessionId = Branded<'SessionId'>;"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"name": "SessionSurface",
|
|
477
|
+
"declaration": "export interface SessionSurface {\n readonly nodes: readonly number[];\n readonly replaceGeneration: number;\n}"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "StreamChunk",
|
|
481
|
+
"declaration": "export type StreamChunk = { type: 'block-start'; index: number; blockType: ContentBlockType; } | { type: 'text-delta'; index: number; text: string; } | { type: 'reasoning-delta'; index: number; text: string; } | { type: 'tool-call-delta'; index: number; id: CallId; name?: string; argumentsDelta: string; } | { type: 'block-end'; index: number; block: ContentBlock; } | { type: 'usage'; usage: TokenUsage; } | { type: 'finish'; reason: FinishReason; replayState?: ReplayEnvelope; };"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"name": "SurfaceEventType",
|
|
485
|
+
"declaration": "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"name": "SurfaceIntent",
|
|
489
|
+
"declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: number[];\n}"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"name": "SurfaceOp",
|
|
493
|
+
"declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "TextBlock",
|
|
497
|
+
"declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "TodoItem",
|
|
501
|
+
"declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"name": "TokenUsage",
|
|
505
|
+
"declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"name": "ToolCallBlock",
|
|
509
|
+
"declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: CallId;\n name: string;\n arguments: string;\n}"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"name": "ToolMessageSource",
|
|
513
|
+
"declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: CallId;\n}"
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"name": "ToolResultBlock",
|
|
517
|
+
"declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: CallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"name": "ToolResultMessage",
|
|
521
|
+
"declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "ToolSchema",
|
|
525
|
+
"declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"name": "TurnEndCancelCause",
|
|
529
|
+
"declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "TurnEndReason",
|
|
533
|
+
"declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "TurnEndReasonMap",
|
|
537
|
+
"declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n}"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"name": "UserMessage",
|
|
541
|
+
"declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
|
|
542
|
+
}
|
|
543
|
+
]
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"events": [],
|
|
547
|
+
"objects": []
|
|
548
|
+
},
|
|
549
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import type {
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteContribution,
|
|
5
|
+
} from '@deepseek-ai/dsh-typert-protocol'
|
|
6
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
|
7
|
+
import type { FilePreviewList, FilePreviewRead, FilePreviewReveal, FilePreviewTurnMap } from '@khorsheed/dsh-file-preview/types'
|
|
8
|
+
|
|
9
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
10
|
+
interface TypertRemoteNamespace$66696c6550726576696577 {
|
|
11
|
+
list: (agentId: SessionId) => Promise<RemoteResult<FilePreviewList>>
|
|
12
|
+
read: (agentId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<FilePreviewRead>>
|
|
13
|
+
reveal: (agentId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<FilePreviewReveal>>
|
|
14
|
+
turnFiles: (agentId: SessionId) => Promise<RemoteResult<FilePreviewTurnMap>>
|
|
15
|
+
}
|
|
16
|
+
interface TypertRemoteMap {
|
|
17
|
+
'filePreview/list': (agentId: SessionId) => Promise<RemoteResult<FilePreviewList>>
|
|
18
|
+
'filePreview/read': (agentId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<FilePreviewRead>>
|
|
19
|
+
'filePreview/reveal': (agentId: SessionId, path: string, signal?: AbortSignal) => Promise<RemoteResult<FilePreviewReveal>>
|
|
20
|
+
'filePreview/turnFiles': (agentId: SessionId) => Promise<RemoteResult<FilePreviewTurnMap>>
|
|
21
|
+
}
|
|
22
|
+
interface TypertRemoteNamespaceMap {
|
|
23
|
+
'filePreview': TypertRemoteNamespace$66696c6550726576696577
|
|
24
|
+
}
|
|
25
|
+
interface TypertRemoteScopeMap {
|
|
26
|
+
'agent:filePreview/list': () => Promise<RemoteResult<FilePreviewList>>
|
|
27
|
+
'agent:filePreview/read': (path: string, signal?: AbortSignal) => Promise<RemoteResult<FilePreviewRead>>
|
|
28
|
+
'agent:filePreview/reveal': (path: string, signal?: AbortSignal) => Promise<RemoteResult<FilePreviewReveal>>
|
|
29
|
+
'agent:filePreview/turnFiles': () => Promise<RemoteResult<FilePreviewTurnMap>>
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
34
|
+
export default TYPERT_REMOTE
|
|
35
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typert.remote-client.d.ts","names":["list","read","reveal","turnFiles"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;IA2TEA,I;IA4EMC,I;IA6EAC,M;IA1HNC,S;;;IA/BAH,kB;IA4EMC,kB;IA6EAC,oB;IA1HNC,uB;;;;;;IA/BAH,wB;IA4EMC,wB;IA6EAC,0B;IA1HNC,6B","ignoreList":[]}
|