@camerontaylor/paseo-plugin 0.8.0-fork.1
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/dist/attachments.d.ts +26 -0
- package/dist/attachments.js +17 -0
- package/dist/client/buttons.d.ts +64 -0
- package/dist/client/buttons.js +2 -0
- package/dist/client/client-state.d.ts +15 -0
- package/dist/client/client-state.js +32 -0
- package/dist/client/contracts.d.ts +201 -0
- package/dist/client/contracts.js +2 -0
- package/dist/client/host.d.ts +19 -0
- package/dist/client/host.js +12 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.js +4 -0
- package/dist/client/paseo-context.d.ts +9 -0
- package/dist/client/paseo-context.js +16 -0
- package/dist/client/react-native.d.ts +46 -0
- package/dist/client/react-native.js +2 -0
- package/dist/client/rpc-context.d.ts +13 -0
- package/dist/client/rpc-context.js +18 -0
- package/dist/client/runtime-context-bridge.d.ts +5 -0
- package/dist/client/runtime-context-bridge.js +19 -0
- package/dist/client/shallow.d.ts +2 -0
- package/dist/client/shallow.js +45 -0
- package/dist/client/ui.d.ts +60 -0
- package/dist/client/ui.js +2 -0
- package/dist/contracts.d.ts +90 -0
- package/dist/contracts.js +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/rpc.d.ts +17 -0
- package/dist/rpc.js +13 -0
- package/dist/server/acp-internal/connection.d.ts +4 -0
- package/dist/server/acp-internal/connection.js +1187 -0
- package/dist/server/acp.d.ts +112 -0
- package/dist/server/acp.js +21 -0
- package/dist/server/contracts.d.ts +16 -0
- package/dist/server/contracts.js +2 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +2 -0
- package/dist/server/lifecycle.d.ts +92 -0
- package/dist/server/lifecycle.js +2 -0
- package/dist/server/provider.d.ts +610 -0
- package/dist/server/provider.js +811 -0
- package/dist/settings.d.ts +70 -0
- package/dist/settings.js +40 -0
- package/package.json +90 -0
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
import type { JsonValue } from "@camerontaylor/paseo-protocol/agent-types";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const PROVIDER_PROTOCOL_VERSION: 1;
|
|
4
|
+
export declare const PROVIDER_CAPABILITIES: readonly ["prompt.message", "prompt.command", "prompt.image", "prompt.output_schema", "prompt.steer", "session.archive", "session.configure", "session.list", "session.persistence", "session.revert.both", "session.revert.conversation", "session.revert.files", "session.subsession", "session.unarchive", "permission", "permission.tool_policy", "timeline.plugin"];
|
|
5
|
+
export type ProviderCapability = (typeof PROVIDER_CAPABILITIES)[number];
|
|
6
|
+
export interface ProviderRegistration {
|
|
7
|
+
/** Equal keys share discovery within this provider. Include effective configuration and execution environment. */
|
|
8
|
+
getCatalogCacheKey?(options: ProviderCatalogOptions): Promise<string | undefined>;
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Plugin-directory-relative path to a self-contained SVG file. */
|
|
13
|
+
icon?: string;
|
|
14
|
+
connect(request: ProviderConnectRequest): Promise<ProviderConnection>;
|
|
15
|
+
}
|
|
16
|
+
export type ProviderCatalogOptions = {
|
|
17
|
+
scope: "global";
|
|
18
|
+
force?: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
scope: "workspace";
|
|
21
|
+
cwd: string;
|
|
22
|
+
force?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export interface ProviderConnectRequest {
|
|
25
|
+
versions: readonly number[];
|
|
26
|
+
capabilities: readonly string[];
|
|
27
|
+
}
|
|
28
|
+
export interface ProviderConnection {
|
|
29
|
+
readonly version: number;
|
|
30
|
+
readonly capabilities: readonly string[];
|
|
31
|
+
send(input: ProviderInput): Promise<void>;
|
|
32
|
+
onEvent(listener: (event: ProviderEvent) => void): () => void;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export interface ProviderPersistence {
|
|
36
|
+
version: number;
|
|
37
|
+
data: JsonValue;
|
|
38
|
+
}
|
|
39
|
+
export type ProviderMcpServerConfig = {
|
|
40
|
+
type: "stdio";
|
|
41
|
+
command: string;
|
|
42
|
+
args?: string[];
|
|
43
|
+
env?: Record<string, string>;
|
|
44
|
+
alwaysLoad?: boolean;
|
|
45
|
+
} | {
|
|
46
|
+
type: "http" | "sse";
|
|
47
|
+
url: string;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
alwaysLoad?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export interface ProviderToolPolicy {
|
|
52
|
+
preapproved: Array<{
|
|
53
|
+
kind: "mcp";
|
|
54
|
+
server: string;
|
|
55
|
+
tool: string;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export interface ProviderSessionConfig {
|
|
59
|
+
cwd: string;
|
|
60
|
+
env: Readonly<Record<string, string>>;
|
|
61
|
+
systemPrompt?: string;
|
|
62
|
+
mcpServers: Readonly<Record<string, ProviderMcpServerConfig>>;
|
|
63
|
+
toolPolicy?: ProviderToolPolicy;
|
|
64
|
+
model?: string;
|
|
65
|
+
mode?: string;
|
|
66
|
+
thinkingOption?: string;
|
|
67
|
+
settings: Readonly<Record<string, JsonValue>>;
|
|
68
|
+
providerOptions?: Readonly<Record<string, JsonValue>>;
|
|
69
|
+
title?: string;
|
|
70
|
+
persist: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface ProviderConfigChanges {
|
|
73
|
+
model?: string | null;
|
|
74
|
+
mode?: string | null;
|
|
75
|
+
thinkingOption?: string | null;
|
|
76
|
+
settings?: Readonly<Record<string, JsonValue>>;
|
|
77
|
+
}
|
|
78
|
+
export interface ProviderPrompt {
|
|
79
|
+
clientMessageId: string;
|
|
80
|
+
delivery: "auto" | "steer";
|
|
81
|
+
input: {
|
|
82
|
+
type: "message";
|
|
83
|
+
content: ProviderContent[];
|
|
84
|
+
} | {
|
|
85
|
+
type: "command";
|
|
86
|
+
name: string;
|
|
87
|
+
arguments: string;
|
|
88
|
+
};
|
|
89
|
+
outputSchema?: JsonValue;
|
|
90
|
+
clearPendingPermissions?: boolean;
|
|
91
|
+
}
|
|
92
|
+
interface ProviderForgeChangeRequestAttachment {
|
|
93
|
+
type: "forge_change_request";
|
|
94
|
+
mimeType: "application/paseo-forge-change-request";
|
|
95
|
+
forge?: string;
|
|
96
|
+
number: number;
|
|
97
|
+
title: string;
|
|
98
|
+
url: string;
|
|
99
|
+
body?: string | null;
|
|
100
|
+
projectPath?: string;
|
|
101
|
+
baseRefName?: string | null;
|
|
102
|
+
headRefName?: string | null;
|
|
103
|
+
}
|
|
104
|
+
interface ProviderForgeIssueAttachment {
|
|
105
|
+
type: "forge_issue";
|
|
106
|
+
mimeType: "application/paseo-forge-issue";
|
|
107
|
+
forge?: string;
|
|
108
|
+
number: number;
|
|
109
|
+
title: string;
|
|
110
|
+
url: string;
|
|
111
|
+
body?: string | null;
|
|
112
|
+
projectPath?: string;
|
|
113
|
+
}
|
|
114
|
+
interface ProviderGitHubPrAttachment {
|
|
115
|
+
type: "github_pr";
|
|
116
|
+
mimeType: "application/github-pr";
|
|
117
|
+
number: number;
|
|
118
|
+
title: string;
|
|
119
|
+
url: string;
|
|
120
|
+
body?: string | null;
|
|
121
|
+
baseRefName?: string | null;
|
|
122
|
+
headRefName?: string | null;
|
|
123
|
+
}
|
|
124
|
+
interface ProviderGitHubIssueAttachment {
|
|
125
|
+
type: "github_issue";
|
|
126
|
+
mimeType: "application/github-issue";
|
|
127
|
+
number: number;
|
|
128
|
+
title: string;
|
|
129
|
+
url: string;
|
|
130
|
+
body?: string | null;
|
|
131
|
+
}
|
|
132
|
+
interface ProviderTextAttachment {
|
|
133
|
+
type: "text";
|
|
134
|
+
mimeType: "text/plain";
|
|
135
|
+
contextKind?: string;
|
|
136
|
+
title?: string | null;
|
|
137
|
+
text: string;
|
|
138
|
+
externalResource?: {
|
|
139
|
+
provider: string;
|
|
140
|
+
providerLabel: string;
|
|
141
|
+
resourceType: string;
|
|
142
|
+
id: string;
|
|
143
|
+
identifier: string;
|
|
144
|
+
title: string;
|
|
145
|
+
url: string;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
interface ProviderReviewAttachment {
|
|
149
|
+
type: "review";
|
|
150
|
+
mimeType: "application/paseo-review";
|
|
151
|
+
cwd: string;
|
|
152
|
+
mode: "uncommitted" | "base";
|
|
153
|
+
baseRef?: string | null;
|
|
154
|
+
comments: Array<{
|
|
155
|
+
filePath: string;
|
|
156
|
+
side: "old" | "new";
|
|
157
|
+
lineNumber: number;
|
|
158
|
+
body: string;
|
|
159
|
+
context: {
|
|
160
|
+
hunkHeader: string;
|
|
161
|
+
targetLine: ProviderReviewContextLine;
|
|
162
|
+
lines: ProviderReviewContextLine[];
|
|
163
|
+
};
|
|
164
|
+
}>;
|
|
165
|
+
}
|
|
166
|
+
interface ProviderReviewContextLine {
|
|
167
|
+
oldLineNumber: number | null;
|
|
168
|
+
newLineNumber: number | null;
|
|
169
|
+
type: "add" | "remove" | "context";
|
|
170
|
+
content: string;
|
|
171
|
+
}
|
|
172
|
+
export type ProviderContent = {
|
|
173
|
+
type: "text";
|
|
174
|
+
text: string;
|
|
175
|
+
} | {
|
|
176
|
+
type: "image";
|
|
177
|
+
data: string;
|
|
178
|
+
mimeType: string;
|
|
179
|
+
} | ProviderForgeChangeRequestAttachment | ProviderForgeIssueAttachment | ProviderGitHubPrAttachment | ProviderGitHubIssueAttachment | ProviderTextAttachment | ProviderReviewAttachment | {
|
|
180
|
+
type: "uploaded_file";
|
|
181
|
+
id: string;
|
|
182
|
+
fileName: string;
|
|
183
|
+
mimeType: string;
|
|
184
|
+
size: number;
|
|
185
|
+
path: string;
|
|
186
|
+
};
|
|
187
|
+
export type ProviderInput = {
|
|
188
|
+
type: "catalog";
|
|
189
|
+
requestId: string;
|
|
190
|
+
cwd?: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: "sessions";
|
|
193
|
+
requestId: string;
|
|
194
|
+
query?: string;
|
|
195
|
+
cwd?: string;
|
|
196
|
+
limit?: number;
|
|
197
|
+
} | {
|
|
198
|
+
type: "session.open";
|
|
199
|
+
requestId: string;
|
|
200
|
+
sessionId: string;
|
|
201
|
+
config: ProviderSessionConfig;
|
|
202
|
+
persistence?: ProviderPersistence;
|
|
203
|
+
history: "replay" | "skip";
|
|
204
|
+
} | {
|
|
205
|
+
type: "session.prompt";
|
|
206
|
+
sessionId: string;
|
|
207
|
+
prompt: ProviderPrompt;
|
|
208
|
+
} | {
|
|
209
|
+
type: "session.interrupt";
|
|
210
|
+
requestId: string;
|
|
211
|
+
sessionId: string;
|
|
212
|
+
} | {
|
|
213
|
+
type: "session.permission";
|
|
214
|
+
sessionId: string;
|
|
215
|
+
permissionId: string;
|
|
216
|
+
response: ProviderPermissionResponse;
|
|
217
|
+
} | {
|
|
218
|
+
type: "session.configure";
|
|
219
|
+
requestId: string;
|
|
220
|
+
sessionId: string;
|
|
221
|
+
changes: ProviderConfigChanges;
|
|
222
|
+
} | {
|
|
223
|
+
type: "session.revert";
|
|
224
|
+
requestId: string;
|
|
225
|
+
sessionId: string;
|
|
226
|
+
token: JsonValue;
|
|
227
|
+
scope: "conversation" | "files" | "both";
|
|
228
|
+
} | {
|
|
229
|
+
type: "session.archive";
|
|
230
|
+
requestId: string;
|
|
231
|
+
persistence: ProviderPersistence;
|
|
232
|
+
} | {
|
|
233
|
+
type: "session.unarchive";
|
|
234
|
+
requestId: string;
|
|
235
|
+
persistence: ProviderPersistence;
|
|
236
|
+
} | {
|
|
237
|
+
type: "session.close";
|
|
238
|
+
requestId: string;
|
|
239
|
+
sessionId: string;
|
|
240
|
+
};
|
|
241
|
+
export interface ProviderThinkingOption {
|
|
242
|
+
id: string;
|
|
243
|
+
label: string;
|
|
244
|
+
description?: string;
|
|
245
|
+
isDefault?: boolean;
|
|
246
|
+
metadata?: Readonly<Record<string, JsonValue>>;
|
|
247
|
+
}
|
|
248
|
+
export interface ProviderModel {
|
|
249
|
+
id: string;
|
|
250
|
+
aliases?: string[];
|
|
251
|
+
isSelectable?: boolean;
|
|
252
|
+
label: string;
|
|
253
|
+
description?: string;
|
|
254
|
+
isDefault?: boolean;
|
|
255
|
+
metadata?: Readonly<Record<string, JsonValue>>;
|
|
256
|
+
contextWindowMaxTokens?: number;
|
|
257
|
+
thinkingOptions?: ProviderThinkingOption[];
|
|
258
|
+
defaultThinkingOptionId?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface ProviderMode {
|
|
261
|
+
id: string;
|
|
262
|
+
label: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
icon?: string;
|
|
265
|
+
colorTier?: string;
|
|
266
|
+
isUnattended?: boolean;
|
|
267
|
+
}
|
|
268
|
+
export type ProviderSetting = {
|
|
269
|
+
type: "toggle";
|
|
270
|
+
id: string;
|
|
271
|
+
label: string;
|
|
272
|
+
description?: string;
|
|
273
|
+
value: boolean;
|
|
274
|
+
} | {
|
|
275
|
+
type: "select";
|
|
276
|
+
id: string;
|
|
277
|
+
label: string;
|
|
278
|
+
description?: string;
|
|
279
|
+
value: string | null;
|
|
280
|
+
options: ReadonlyArray<{
|
|
281
|
+
label: string;
|
|
282
|
+
value: string;
|
|
283
|
+
}>;
|
|
284
|
+
};
|
|
285
|
+
export interface ProviderConfigState {
|
|
286
|
+
model?: string;
|
|
287
|
+
mode?: string;
|
|
288
|
+
thinkingOption?: string;
|
|
289
|
+
models: readonly ProviderModel[];
|
|
290
|
+
modes: readonly ProviderMode[];
|
|
291
|
+
thinkingOptions: readonly ProviderThinkingOption[];
|
|
292
|
+
settings: readonly ProviderSetting[];
|
|
293
|
+
}
|
|
294
|
+
export interface ProviderCatalog {
|
|
295
|
+
models: readonly ProviderModel[];
|
|
296
|
+
modes: readonly ProviderMode[];
|
|
297
|
+
thinkingOptions?: readonly ProviderThinkingOption[];
|
|
298
|
+
defaultModel?: string;
|
|
299
|
+
defaultMode?: string;
|
|
300
|
+
defaultThinkingOption?: string;
|
|
301
|
+
}
|
|
302
|
+
export interface ProviderSessionSummary {
|
|
303
|
+
persistence: ProviderPersistence;
|
|
304
|
+
cwd: string;
|
|
305
|
+
title?: string;
|
|
306
|
+
description?: string;
|
|
307
|
+
updatedAt?: string;
|
|
308
|
+
}
|
|
309
|
+
export interface ProviderCommand {
|
|
310
|
+
name: string;
|
|
311
|
+
description: string;
|
|
312
|
+
argumentHint?: string;
|
|
313
|
+
}
|
|
314
|
+
export interface ProviderError {
|
|
315
|
+
message: string;
|
|
316
|
+
code?: string;
|
|
317
|
+
diagnostic?: string;
|
|
318
|
+
}
|
|
319
|
+
export interface ProviderNotice {
|
|
320
|
+
id: string;
|
|
321
|
+
severity: "info" | "warning" | "error";
|
|
322
|
+
title: string;
|
|
323
|
+
description?: string;
|
|
324
|
+
dismissed?: boolean;
|
|
325
|
+
}
|
|
326
|
+
export interface ProviderPermissionAction {
|
|
327
|
+
id: string;
|
|
328
|
+
label: string;
|
|
329
|
+
behavior: "allow" | "deny";
|
|
330
|
+
variant?: "primary" | "secondary" | "danger";
|
|
331
|
+
intent?: "implement" | "implement_resume" | "dismiss";
|
|
332
|
+
}
|
|
333
|
+
export interface ProviderPermissionRequest {
|
|
334
|
+
id: string;
|
|
335
|
+
name: string;
|
|
336
|
+
kind: "tool" | "plan" | "question" | "mode" | "other";
|
|
337
|
+
title?: string;
|
|
338
|
+
description?: string;
|
|
339
|
+
input?: Readonly<Record<string, JsonValue>>;
|
|
340
|
+
detail?: ProviderToolCallDetail;
|
|
341
|
+
suggestions?: Array<Record<string, JsonValue>>;
|
|
342
|
+
actions?: ProviderPermissionAction[];
|
|
343
|
+
metadata?: Readonly<Record<string, JsonValue>>;
|
|
344
|
+
}
|
|
345
|
+
export type ProviderPermissionResponse = {
|
|
346
|
+
behavior: "allow";
|
|
347
|
+
selectedActionId?: string;
|
|
348
|
+
updatedInput?: Record<string, JsonValue>;
|
|
349
|
+
updatedPermissions?: Array<Record<string, JsonValue>>;
|
|
350
|
+
} | {
|
|
351
|
+
behavior: "deny";
|
|
352
|
+
selectedActionId?: string;
|
|
353
|
+
message?: string;
|
|
354
|
+
interrupt?: boolean;
|
|
355
|
+
};
|
|
356
|
+
export interface ProviderUsage {
|
|
357
|
+
inputTokens?: number;
|
|
358
|
+
cachedInputTokens?: number;
|
|
359
|
+
outputTokens?: number;
|
|
360
|
+
totalCostUsd?: number;
|
|
361
|
+
contextWindowMaxTokens?: number;
|
|
362
|
+
contextWindowUsedTokens?: number;
|
|
363
|
+
}
|
|
364
|
+
interface ProviderTimelineIdentity {
|
|
365
|
+
id: string;
|
|
366
|
+
revertToken?: JsonValue;
|
|
367
|
+
}
|
|
368
|
+
export type ProviderToolCallDetail = {
|
|
369
|
+
type: "shell";
|
|
370
|
+
command: string;
|
|
371
|
+
cwd?: string;
|
|
372
|
+
output?: string;
|
|
373
|
+
exitCode?: number | null;
|
|
374
|
+
} | {
|
|
375
|
+
type: "read";
|
|
376
|
+
filePath: string;
|
|
377
|
+
content?: string;
|
|
378
|
+
offset?: number;
|
|
379
|
+
limit?: number;
|
|
380
|
+
} | {
|
|
381
|
+
type: "edit";
|
|
382
|
+
filePath: string;
|
|
383
|
+
oldString?: string;
|
|
384
|
+
newString?: string;
|
|
385
|
+
unifiedDiff?: string;
|
|
386
|
+
} | {
|
|
387
|
+
type: "write";
|
|
388
|
+
filePath: string;
|
|
389
|
+
content?: string;
|
|
390
|
+
} | {
|
|
391
|
+
type: "search";
|
|
392
|
+
query: string;
|
|
393
|
+
toolName?: "search" | "grep" | "glob" | "web_search";
|
|
394
|
+
content?: string;
|
|
395
|
+
filePaths?: string[];
|
|
396
|
+
webResults?: Array<{
|
|
397
|
+
title: string;
|
|
398
|
+
url: string;
|
|
399
|
+
}>;
|
|
400
|
+
annotations?: string[];
|
|
401
|
+
numFiles?: number;
|
|
402
|
+
numMatches?: number;
|
|
403
|
+
durationMs?: number;
|
|
404
|
+
durationSeconds?: number;
|
|
405
|
+
truncated?: boolean;
|
|
406
|
+
mode?: "content" | "files_with_matches" | "count";
|
|
407
|
+
} | {
|
|
408
|
+
type: "fetch";
|
|
409
|
+
url: string;
|
|
410
|
+
prompt?: string;
|
|
411
|
+
result?: string;
|
|
412
|
+
code?: number;
|
|
413
|
+
codeText?: string;
|
|
414
|
+
bytes?: number;
|
|
415
|
+
durationMs?: number;
|
|
416
|
+
} | {
|
|
417
|
+
type: "worktree_setup";
|
|
418
|
+
worktreePath: string;
|
|
419
|
+
branchName: string;
|
|
420
|
+
log: string;
|
|
421
|
+
commands: Array<{
|
|
422
|
+
index: number;
|
|
423
|
+
command: string;
|
|
424
|
+
cwd: string;
|
|
425
|
+
log: string;
|
|
426
|
+
status: "running" | "completed" | "failed";
|
|
427
|
+
exitCode: number | null;
|
|
428
|
+
durationMs?: number;
|
|
429
|
+
}>;
|
|
430
|
+
truncated?: boolean;
|
|
431
|
+
} | {
|
|
432
|
+
type: "sub_agent";
|
|
433
|
+
subAgentType?: string;
|
|
434
|
+
description?: string;
|
|
435
|
+
childSessionId?: string;
|
|
436
|
+
log: string;
|
|
437
|
+
actions?: Array<{
|
|
438
|
+
index: number;
|
|
439
|
+
toolName: string;
|
|
440
|
+
summary?: string;
|
|
441
|
+
}>;
|
|
442
|
+
} | {
|
|
443
|
+
type: "plain_text";
|
|
444
|
+
label?: string;
|
|
445
|
+
text?: string;
|
|
446
|
+
icon?: "wrench" | "square_terminal" | "eye" | "pencil" | "search" | "bot" | "sparkles" | "brain" | "mic_vocal";
|
|
447
|
+
} | {
|
|
448
|
+
type: "plan";
|
|
449
|
+
text: string;
|
|
450
|
+
} | {
|
|
451
|
+
type: "unknown";
|
|
452
|
+
input: JsonValue;
|
|
453
|
+
output: JsonValue;
|
|
454
|
+
};
|
|
455
|
+
type ProviderToolCallItem = ProviderTimelineIdentity & {
|
|
456
|
+
type: "tool_call";
|
|
457
|
+
callId: string;
|
|
458
|
+
name: string;
|
|
459
|
+
detail: ProviderToolCallDetail;
|
|
460
|
+
metadata?: Readonly<Record<string, JsonValue>>;
|
|
461
|
+
} & ({
|
|
462
|
+
status: "running" | "completed" | "canceled";
|
|
463
|
+
error: null;
|
|
464
|
+
} | {
|
|
465
|
+
status: "failed";
|
|
466
|
+
error: JsonValue;
|
|
467
|
+
});
|
|
468
|
+
export type ProviderTimelineItem = (ProviderTimelineIdentity & {
|
|
469
|
+
type: "user_message";
|
|
470
|
+
text: string;
|
|
471
|
+
messageId?: string;
|
|
472
|
+
clientMessageId?: string;
|
|
473
|
+
}) | (ProviderTimelineIdentity & {
|
|
474
|
+
type: "assistant_message";
|
|
475
|
+
text: string;
|
|
476
|
+
messageId?: string;
|
|
477
|
+
}) | (ProviderTimelineIdentity & {
|
|
478
|
+
type: "reasoning";
|
|
479
|
+
text: string;
|
|
480
|
+
}) | ProviderToolCallItem | (ProviderTimelineIdentity & {
|
|
481
|
+
type: "todo";
|
|
482
|
+
items: Array<{
|
|
483
|
+
text: string;
|
|
484
|
+
completed: boolean;
|
|
485
|
+
id?: string;
|
|
486
|
+
status?: "pending" | "in_progress" | "completed";
|
|
487
|
+
activeForm?: string;
|
|
488
|
+
}>;
|
|
489
|
+
}) | (ProviderTimelineIdentity & {
|
|
490
|
+
type: "error";
|
|
491
|
+
message: string;
|
|
492
|
+
}) | (ProviderTimelineIdentity & {
|
|
493
|
+
type: "notification";
|
|
494
|
+
level: "info" | "warning" | "error";
|
|
495
|
+
message: string;
|
|
496
|
+
}) | (ProviderTimelineIdentity & {
|
|
497
|
+
type: "compaction";
|
|
498
|
+
status: "loading" | "completed";
|
|
499
|
+
trigger?: "auto" | "manual";
|
|
500
|
+
preTokens?: number;
|
|
501
|
+
}) | (ProviderTimelineIdentity & {
|
|
502
|
+
type: "plugin";
|
|
503
|
+
pluginId: string;
|
|
504
|
+
kind: string;
|
|
505
|
+
version: number;
|
|
506
|
+
data: JsonValue;
|
|
507
|
+
});
|
|
508
|
+
export type ProviderEvent = {
|
|
509
|
+
type: "catalog";
|
|
510
|
+
requestId: string;
|
|
511
|
+
catalog: ProviderCatalog;
|
|
512
|
+
} | {
|
|
513
|
+
type: "sessions";
|
|
514
|
+
requestId: string;
|
|
515
|
+
sessions: ProviderSessionSummary[];
|
|
516
|
+
} | {
|
|
517
|
+
type: "request.completed";
|
|
518
|
+
requestId: string;
|
|
519
|
+
} | {
|
|
520
|
+
type: "request.failed";
|
|
521
|
+
requestId: string;
|
|
522
|
+
error: ProviderError;
|
|
523
|
+
} | {
|
|
524
|
+
type: "session.opened";
|
|
525
|
+
requestId?: string;
|
|
526
|
+
sessionId: string;
|
|
527
|
+
parentSessionId?: string;
|
|
528
|
+
capabilities: readonly string[];
|
|
529
|
+
restoration: "core" | "parent";
|
|
530
|
+
persistence?: ProviderPersistence;
|
|
531
|
+
title?: string;
|
|
532
|
+
description?: string;
|
|
533
|
+
cwd: string;
|
|
534
|
+
} | {
|
|
535
|
+
type: "session.ready";
|
|
536
|
+
requestId?: string;
|
|
537
|
+
sessionId: string;
|
|
538
|
+
} | {
|
|
539
|
+
type: "session.closed";
|
|
540
|
+
sessionId: string;
|
|
541
|
+
error?: ProviderError;
|
|
542
|
+
} | {
|
|
543
|
+
type: "session.runtime_failed";
|
|
544
|
+
sessionId: string;
|
|
545
|
+
error: ProviderError;
|
|
546
|
+
} | {
|
|
547
|
+
type: "session.persistence";
|
|
548
|
+
sessionId: string;
|
|
549
|
+
persistence: ProviderPersistence;
|
|
550
|
+
} | {
|
|
551
|
+
type: "session.prompt_result";
|
|
552
|
+
sessionId: string;
|
|
553
|
+
clientMessageId: string;
|
|
554
|
+
result: {
|
|
555
|
+
type: "turn";
|
|
556
|
+
turnId: string;
|
|
557
|
+
} | {
|
|
558
|
+
type: "steer";
|
|
559
|
+
turnId: string;
|
|
560
|
+
} | {
|
|
561
|
+
type: "completed";
|
|
562
|
+
} | {
|
|
563
|
+
type: "failed";
|
|
564
|
+
error: ProviderError;
|
|
565
|
+
};
|
|
566
|
+
} | {
|
|
567
|
+
type: "session.turn";
|
|
568
|
+
sessionId: string;
|
|
569
|
+
turnId: string;
|
|
570
|
+
state: "started" | "completed" | "failed" | "canceled";
|
|
571
|
+
error?: ProviderError;
|
|
572
|
+
} | {
|
|
573
|
+
type: "session.usage";
|
|
574
|
+
sessionId: string;
|
|
575
|
+
turnId?: string;
|
|
576
|
+
usage: ProviderUsage;
|
|
577
|
+
} | {
|
|
578
|
+
type: "session.config";
|
|
579
|
+
sessionId: string;
|
|
580
|
+
config: ProviderConfigState;
|
|
581
|
+
} | {
|
|
582
|
+
type: "session.commands";
|
|
583
|
+
sessionId: string;
|
|
584
|
+
commands: ProviderCommand[];
|
|
585
|
+
} | {
|
|
586
|
+
type: "session.permission";
|
|
587
|
+
sessionId: string;
|
|
588
|
+
request: ProviderPermissionRequest;
|
|
589
|
+
} | {
|
|
590
|
+
type: "session.permission_resolved";
|
|
591
|
+
sessionId: string;
|
|
592
|
+
permissionId: string;
|
|
593
|
+
} | {
|
|
594
|
+
type: "session.notice";
|
|
595
|
+
sessionId: string;
|
|
596
|
+
notice: ProviderNotice;
|
|
597
|
+
} | {
|
|
598
|
+
type: "timeline.item";
|
|
599
|
+
sessionId: string;
|
|
600
|
+
item: ProviderTimelineItem;
|
|
601
|
+
timestamp?: string;
|
|
602
|
+
};
|
|
603
|
+
export declare function negotiateProviderCapabilities(offered: readonly string[], supported: readonly string[]): readonly ProviderCapability[];
|
|
604
|
+
export declare function isProviderCapability(capability: string): capability is ProviderCapability;
|
|
605
|
+
export declare function requiredProviderCapabilities(input: ProviderInput): readonly ProviderCapability[];
|
|
606
|
+
export declare function requireProviderCapabilities(capabilities: readonly string[], input: ProviderInput): void;
|
|
607
|
+
export declare const ProviderInputSchema: z.ZodType<ProviderInput>;
|
|
608
|
+
export declare const ProviderEventSchema: z.ZodType<ProviderEvent>;
|
|
609
|
+
export {};
|
|
610
|
+
//# sourceMappingURL=provider.d.ts.map
|