@peer-agent/protocol 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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/chat.d.ts +222 -0
- package/dist/chat.js +29 -0
- package/dist/execution.d.ts +257 -0
- package/dist/execution.js +1 -0
- package/dist/goal.d.ts +378 -0
- package/dist/goal.js +1 -0
- package/dist/index.d.ts +609 -0
- package/dist/index.js +6 -0
- package/dist/memory.d.ts +104 -0
- package/dist/memory.js +1 -0
- package/dist/system-context.d.ts +180 -0
- package/dist/system-context.js +1 -0
- package/dist/updater.d.ts +72 -0
- package/dist/updater.js +1 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
export type LocalAccessLevel = 'ask_before_local' | 'session_local' | 'restricted_local' | 'full_local';
|
|
2
|
+
export type CapabilityRiskLevel = 'L0_inert' | 'L1_local_read' | 'L2_local_write' | 'L3_external_write' | 'L4_privileged' | 'L5_destructive';
|
|
3
|
+
export type DataLevel = 'D0_public' | 'D1_internal' | 'D2_sensitive' | 'D3_private' | 'D4_regulated';
|
|
4
|
+
export type CapabilitySource = 'native' | 'shell' | 'plugin' | 'mcp' | 'page_bridge' | 'private' | 'web';
|
|
5
|
+
export type CapabilityHealth = 'available' | 'needs_permission' | 'policy_disabled' | 'local_disabled' | 'unhealthy';
|
|
6
|
+
export type LocaleCode = 'zh-CN' | 'en-US';
|
|
7
|
+
export type LocalizedText = Partial<Record<LocaleCode, string>>;
|
|
8
|
+
export interface JsonSchemaLike {
|
|
9
|
+
readonly type?: string;
|
|
10
|
+
readonly properties?: Record<string, JsonSchemaLike>;
|
|
11
|
+
readonly required?: readonly string[];
|
|
12
|
+
readonly items?: JsonSchemaLike;
|
|
13
|
+
readonly enum?: readonly string[];
|
|
14
|
+
readonly description?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface EvidencePolicy {
|
|
17
|
+
readonly returnMode: 'none' | 'summary' | 'diff' | 'redacted_output' | 'artifact_ref';
|
|
18
|
+
readonly maxChars?: number;
|
|
19
|
+
readonly redactSensitive: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CapabilityManifest {
|
|
22
|
+
readonly capabilityId: string;
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly description: string;
|
|
25
|
+
readonly localizedName?: LocalizedText;
|
|
26
|
+
readonly localizedDescription?: LocalizedText;
|
|
27
|
+
readonly source: CapabilitySource;
|
|
28
|
+
readonly riskLevel: CapabilityRiskLevel;
|
|
29
|
+
readonly dataLevel: DataLevel;
|
|
30
|
+
readonly health: CapabilityHealth;
|
|
31
|
+
readonly inputSchema: JsonSchemaLike;
|
|
32
|
+
readonly evidencePolicy: EvidencePolicy;
|
|
33
|
+
/**
|
|
34
|
+
* Optional human-readable label. For MCP tools this is `${serverName}: ${toolName}`,
|
|
35
|
+
* used by the header capabilities popover to render tool rows.
|
|
36
|
+
*/
|
|
37
|
+
readonly displayName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Optional provider grouping key. For MCP capabilities this is the MCP server id,
|
|
40
|
+
* letting the UI aggregate every tool of one server under a single collapsible node.
|
|
41
|
+
*/
|
|
42
|
+
readonly providerId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional provider display label (e.g. the MCP server's display name), shown as the
|
|
45
|
+
* service node title when capabilities are grouped by provider.
|
|
46
|
+
*/
|
|
47
|
+
readonly providerLabel?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface SkillSummary {
|
|
50
|
+
readonly skillId: string;
|
|
51
|
+
readonly name: string;
|
|
52
|
+
readonly description: string;
|
|
53
|
+
readonly version: string;
|
|
54
|
+
readonly dataLevel: DataLevel;
|
|
55
|
+
readonly enabled: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 可从外部「借用来源」(如 a1 公共 skill 仓 ~/.agents/skills)借用的技能条目。
|
|
59
|
+
* linked=true 表示已在本地 userData/skills 下建立软链。
|
|
60
|
+
*/
|
|
61
|
+
export interface AvailableSkillSummary {
|
|
62
|
+
readonly skillId: string;
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly description: string;
|
|
65
|
+
readonly version: string;
|
|
66
|
+
readonly dataLevel: DataLevel;
|
|
67
|
+
readonly sourceRoot: string;
|
|
68
|
+
readonly sourceDir: string;
|
|
69
|
+
readonly linked: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** linkSkill / unlinkSkill 的返回结果。 */
|
|
72
|
+
export interface SkillLinkResult {
|
|
73
|
+
readonly ok: boolean;
|
|
74
|
+
readonly error?: string;
|
|
75
|
+
readonly detail?: string;
|
|
76
|
+
readonly alreadyLinked?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface RuntimeProjection {
|
|
79
|
+
readonly projectionId: string;
|
|
80
|
+
readonly sessionId: string;
|
|
81
|
+
readonly accessLevel: LocalAccessLevel;
|
|
82
|
+
readonly capabilities: readonly CapabilityManifest[];
|
|
83
|
+
readonly skills?: readonly SkillSummary[];
|
|
84
|
+
readonly createdAt: string;
|
|
85
|
+
}
|
|
86
|
+
export type McpTransportKind = 'streamable_http' | 'sse' | 'stdio';
|
|
87
|
+
export type McpHealthStatus = 'unknown' | 'ok' | 'failed';
|
|
88
|
+
export type McpAuthMode = 'none' | 'http_bearer' | 'http_header' | 'stdio_env' | 'oauth2';
|
|
89
|
+
export type McpCredentialKind = Exclude<McpAuthMode, 'none'>;
|
|
90
|
+
export interface McpOAuthConfigView {
|
|
91
|
+
readonly authorizationServerUrl?: string;
|
|
92
|
+
readonly clientId?: string;
|
|
93
|
+
readonly clientSecretConfigured?: boolean;
|
|
94
|
+
readonly scopes?: readonly string[];
|
|
95
|
+
readonly redirectUrl?: string;
|
|
96
|
+
readonly tokenStatus?: 'missing' | 'available';
|
|
97
|
+
readonly expiresAt?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface McpAuthBindingView {
|
|
100
|
+
readonly mode: McpAuthMode;
|
|
101
|
+
readonly credentialRef?: string;
|
|
102
|
+
readonly headerName?: string;
|
|
103
|
+
readonly envName?: string;
|
|
104
|
+
readonly oauth?: McpOAuthConfigView;
|
|
105
|
+
}
|
|
106
|
+
export interface McpCredentialMetadataView {
|
|
107
|
+
readonly id: string;
|
|
108
|
+
readonly credentialRef: string;
|
|
109
|
+
readonly label: string;
|
|
110
|
+
readonly kind: McpCredentialKind;
|
|
111
|
+
readonly target: 'header' | 'env' | 'oauth';
|
|
112
|
+
readonly headerName?: string;
|
|
113
|
+
readonly envName?: string;
|
|
114
|
+
readonly oauth?: McpOAuthConfigView;
|
|
115
|
+
readonly createdAt: string;
|
|
116
|
+
readonly updatedAt: string;
|
|
117
|
+
readonly lastFour?: string;
|
|
118
|
+
readonly storage?: 'safeStorage' | 'file-fallback';
|
|
119
|
+
}
|
|
120
|
+
export interface McpCredentialPutRequest {
|
|
121
|
+
readonly credentialRef?: string;
|
|
122
|
+
readonly label?: string;
|
|
123
|
+
readonly kind: McpCredentialKind;
|
|
124
|
+
readonly secret?: string;
|
|
125
|
+
readonly headerName?: string;
|
|
126
|
+
readonly envName?: string;
|
|
127
|
+
readonly oauth?: {
|
|
128
|
+
readonly authorizationServerUrl?: string;
|
|
129
|
+
readonly clientId?: string;
|
|
130
|
+
readonly clientSecret?: string;
|
|
131
|
+
readonly scopes?: readonly string[];
|
|
132
|
+
readonly redirectUrl?: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export interface McpOAuthLoginRequest {
|
|
136
|
+
readonly serverId: string;
|
|
137
|
+
}
|
|
138
|
+
export interface McpOAuthLoginResult {
|
|
139
|
+
readonly ok: boolean;
|
|
140
|
+
readonly credential?: McpCredentialMetadataView;
|
|
141
|
+
readonly error?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface McpHealthView {
|
|
144
|
+
readonly status: McpHealthStatus;
|
|
145
|
+
readonly checkedAt?: string | null;
|
|
146
|
+
readonly message?: string;
|
|
147
|
+
}
|
|
148
|
+
export interface McpToolSummary {
|
|
149
|
+
readonly name: string;
|
|
150
|
+
readonly description?: string;
|
|
151
|
+
readonly visible?: boolean;
|
|
152
|
+
readonly inputSchema?: JsonSchemaLike;
|
|
153
|
+
}
|
|
154
|
+
export interface McpResourceSummary {
|
|
155
|
+
readonly uri: string;
|
|
156
|
+
readonly name?: string;
|
|
157
|
+
readonly description?: string;
|
|
158
|
+
readonly mimeType?: string;
|
|
159
|
+
}
|
|
160
|
+
export interface McpPromptSummary {
|
|
161
|
+
readonly name: string;
|
|
162
|
+
readonly description?: string;
|
|
163
|
+
readonly arguments?: readonly Record<string, unknown>[];
|
|
164
|
+
}
|
|
165
|
+
export interface LocalMcpServerView {
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly mcpId: string;
|
|
168
|
+
readonly displayName: string;
|
|
169
|
+
readonly name: string;
|
|
170
|
+
/** Name the MCP server reports during the initialize handshake. */
|
|
171
|
+
readonly reportedName?: string | null;
|
|
172
|
+
/** Version the MCP server reports during the initialize handshake. */
|
|
173
|
+
readonly reportedVersion?: string | null;
|
|
174
|
+
readonly description?: string;
|
|
175
|
+
readonly enabled: boolean;
|
|
176
|
+
readonly transport: McpTransportKind;
|
|
177
|
+
readonly commandPreview?: string;
|
|
178
|
+
readonly urlPreview?: string;
|
|
179
|
+
readonly serverUrl?: string;
|
|
180
|
+
readonly auth?: McpAuthBindingView;
|
|
181
|
+
readonly toolsCount: number;
|
|
182
|
+
readonly visibleToolsCount: number;
|
|
183
|
+
readonly resourcesCount: number;
|
|
184
|
+
readonly promptsCount: number;
|
|
185
|
+
readonly tools: readonly McpToolSummary[];
|
|
186
|
+
readonly resources: readonly McpResourceSummary[];
|
|
187
|
+
readonly prompts: readonly McpPromptSummary[];
|
|
188
|
+
readonly health: McpHealthView;
|
|
189
|
+
readonly manifestUpdatedAt?: string | null;
|
|
190
|
+
readonly lastError?: string | null;
|
|
191
|
+
readonly createdAt?: string;
|
|
192
|
+
readonly updatedAt?: string;
|
|
193
|
+
}
|
|
194
|
+
export interface LocalMcpServerUpsertRequest {
|
|
195
|
+
readonly id?: string;
|
|
196
|
+
readonly mcpId?: string;
|
|
197
|
+
readonly displayName?: string;
|
|
198
|
+
readonly name?: string;
|
|
199
|
+
readonly description?: string;
|
|
200
|
+
readonly enabled?: boolean;
|
|
201
|
+
readonly transport: McpTransportKind;
|
|
202
|
+
readonly command?: string;
|
|
203
|
+
readonly args?: readonly string[];
|
|
204
|
+
readonly cwd?: string | null;
|
|
205
|
+
readonly env?: Record<string, string>;
|
|
206
|
+
readonly url?: string;
|
|
207
|
+
readonly serverUrl?: string;
|
|
208
|
+
readonly headers?: Record<string, string>;
|
|
209
|
+
readonly auth?: McpAuthBindingView;
|
|
210
|
+
}
|
|
211
|
+
export interface McpConnectionTestResult {
|
|
212
|
+
readonly ok: boolean;
|
|
213
|
+
readonly health: McpHealthView;
|
|
214
|
+
readonly toolsCount: number;
|
|
215
|
+
readonly resourcesCount: number;
|
|
216
|
+
readonly promptsCount: number;
|
|
217
|
+
readonly errors?: readonly {
|
|
218
|
+
readonly kind: string;
|
|
219
|
+
readonly message: string;
|
|
220
|
+
}[];
|
|
221
|
+
}
|
|
222
|
+
export type McpConnectionProbeState = 'connected' | 'needs_auth' | 'failed';
|
|
223
|
+
export interface McpConnectionProbeAuthAction {
|
|
224
|
+
readonly type: 'oauth' | 'unknown';
|
|
225
|
+
readonly authorizationUrl?: string;
|
|
226
|
+
readonly message?: string;
|
|
227
|
+
}
|
|
228
|
+
export interface McpConnectionProbeResult {
|
|
229
|
+
readonly state: McpConnectionProbeState;
|
|
230
|
+
readonly ok: boolean;
|
|
231
|
+
readonly view?: LocalMcpServerView;
|
|
232
|
+
readonly manifest?: McpManifestRefreshResult['manifest'];
|
|
233
|
+
readonly health: McpHealthView;
|
|
234
|
+
readonly toolsCount: number;
|
|
235
|
+
readonly resourcesCount: number;
|
|
236
|
+
readonly promptsCount: number;
|
|
237
|
+
readonly auth?: McpConnectionProbeAuthAction;
|
|
238
|
+
readonly message?: string;
|
|
239
|
+
readonly errors?: readonly {
|
|
240
|
+
readonly kind: string;
|
|
241
|
+
readonly message: string;
|
|
242
|
+
}[];
|
|
243
|
+
}
|
|
244
|
+
export interface McpManifestRefreshResult {
|
|
245
|
+
readonly view: LocalMcpServerView;
|
|
246
|
+
readonly manifest: {
|
|
247
|
+
readonly discoveredAt: string;
|
|
248
|
+
readonly serverInfo?: {
|
|
249
|
+
readonly name?: string;
|
|
250
|
+
readonly version?: string;
|
|
251
|
+
};
|
|
252
|
+
readonly tools: readonly McpToolSummary[];
|
|
253
|
+
readonly resources: readonly McpResourceSummary[];
|
|
254
|
+
readonly prompts: readonly McpPromptSummary[];
|
|
255
|
+
readonly errors?: readonly {
|
|
256
|
+
readonly kind: string;
|
|
257
|
+
readonly message: string;
|
|
258
|
+
}[];
|
|
259
|
+
readonly health: McpHealthView;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export interface ClientSessionState {
|
|
263
|
+
readonly sessionId: string;
|
|
264
|
+
readonly status: 'local_ready' | 'hybrid_ready' | 'permission_required' | 'degraded' | 'offline';
|
|
265
|
+
readonly accessLevel: LocalAccessLevel;
|
|
266
|
+
readonly capabilityCount: number;
|
|
267
|
+
readonly pendingReviewCount: number;
|
|
268
|
+
readonly locale: LocaleCode;
|
|
269
|
+
readonly workspaceLabel?: string;
|
|
270
|
+
}
|
|
271
|
+
export interface GitProjectState {
|
|
272
|
+
readonly branch?: string;
|
|
273
|
+
readonly remote?: string;
|
|
274
|
+
readonly modifiedCount: number;
|
|
275
|
+
readonly untrackedCount: number;
|
|
276
|
+
readonly stagedCount: number;
|
|
277
|
+
readonly ahead: number;
|
|
278
|
+
readonly behind: number;
|
|
279
|
+
readonly isDirty: boolean;
|
|
280
|
+
}
|
|
281
|
+
export interface WorkspaceProject {
|
|
282
|
+
readonly projectId: string;
|
|
283
|
+
readonly name: string;
|
|
284
|
+
readonly absolutePath: string;
|
|
285
|
+
readonly relativePath: string;
|
|
286
|
+
readonly kind: 'workspace_root' | 'workspace_package' | 'directory';
|
|
287
|
+
readonly packageName?: string;
|
|
288
|
+
readonly git?: GitProjectState;
|
|
289
|
+
readonly updatedAt: string;
|
|
290
|
+
}
|
|
291
|
+
export type LlmProviderType = 'openai' | 'anthropic';
|
|
292
|
+
export type LlmWireProtocol = 'openai-chat' | 'openai-responses' | 'anthropic-messages' | 'gemini' | 'qoder-private';
|
|
293
|
+
export type LlmChannelId = string;
|
|
294
|
+
export type LlmReasoningParamStyle = 'openai-effort' | 'anthropic-enabled-budget' | 'anthropic-adaptive-effort' | 'anthropic-output-effort' | 'qwen-enable' | 'none';
|
|
295
|
+
export type LlmReasoningEffortMap = Readonly<Record<string, string | number>>;
|
|
296
|
+
export interface LlmChannelDescriptor {
|
|
297
|
+
readonly id: LlmChannelId;
|
|
298
|
+
readonly label: string;
|
|
299
|
+
readonly legacyProvider: LlmProviderType;
|
|
300
|
+
readonly defaultWire: LlmWireProtocol;
|
|
301
|
+
readonly allowedWires: readonly LlmWireProtocol[];
|
|
302
|
+
readonly defaults: {
|
|
303
|
+
readonly baseUrl: string;
|
|
304
|
+
readonly model: string;
|
|
305
|
+
};
|
|
306
|
+
readonly capabilities?: {
|
|
307
|
+
readonly reasoning?: {
|
|
308
|
+
readonly supported: boolean;
|
|
309
|
+
readonly paramStyle: LlmReasoningParamStyle;
|
|
310
|
+
readonly effortLevels?: readonly string[];
|
|
311
|
+
readonly defaultEffort?: string;
|
|
312
|
+
readonly effortMap?: LlmReasoningEffortMap;
|
|
313
|
+
};
|
|
314
|
+
readonly promptCache?: boolean;
|
|
315
|
+
readonly vision?: boolean;
|
|
316
|
+
readonly toolUse?: boolean;
|
|
317
|
+
readonly temperature?: boolean;
|
|
318
|
+
};
|
|
319
|
+
readonly authMethods?: Partial<Readonly<Record<LlmAuthMethod, {
|
|
320
|
+
readonly wire: LlmWireProtocol;
|
|
321
|
+
}>>>;
|
|
322
|
+
}
|
|
323
|
+
export type LlmAuthMethod = 'api_key' | 'oauth_chatgpt' | 'oauth_google' | 'qoder_local_auth' | 'local_cli';
|
|
324
|
+
export type LlmOAuthConnectionStatus = 'connected' | 'expired' | 'disconnected';
|
|
325
|
+
export interface LlmOAuthStatus {
|
|
326
|
+
readonly status: LlmOAuthConnectionStatus;
|
|
327
|
+
readonly accountId?: string;
|
|
328
|
+
readonly expiresAt?: string;
|
|
329
|
+
}
|
|
330
|
+
export interface LlmProviderConfig {
|
|
331
|
+
readonly id: string;
|
|
332
|
+
readonly groupId?: string;
|
|
333
|
+
readonly provider: LlmProviderType;
|
|
334
|
+
readonly channelId?: LlmChannelId;
|
|
335
|
+
readonly resolvedWire?: LlmWireProtocol;
|
|
336
|
+
readonly wireOverride?: LlmWireProtocol;
|
|
337
|
+
readonly authMethod: LlmAuthMethod;
|
|
338
|
+
readonly name: string;
|
|
339
|
+
readonly baseUrl: string;
|
|
340
|
+
readonly model: string;
|
|
341
|
+
readonly modelLabel?: string;
|
|
342
|
+
readonly enabled: boolean;
|
|
343
|
+
readonly isDefault: boolean;
|
|
344
|
+
readonly createdAt: string;
|
|
345
|
+
readonly contextWindow?: number;
|
|
346
|
+
readonly maxOutputTokens?: number;
|
|
347
|
+
readonly inputPrice?: number;
|
|
348
|
+
readonly outputPrice?: number;
|
|
349
|
+
readonly cacheWritePrice?: number;
|
|
350
|
+
readonly cacheReadPrice?: number;
|
|
351
|
+
readonly longContextInputThreshold?: number;
|
|
352
|
+
readonly longContextInputPrice?: number;
|
|
353
|
+
readonly longContextCacheReadPrice?: number;
|
|
354
|
+
readonly longContextOutputPrice?: number;
|
|
355
|
+
readonly supportsVision?: boolean;
|
|
356
|
+
readonly supportsReasoning?: boolean;
|
|
357
|
+
readonly supportsPromptCaching?: boolean;
|
|
358
|
+
readonly reasoningParamStyle?: LlmReasoningParamStyle;
|
|
359
|
+
readonly reasoningEffortMap?: LlmReasoningEffortMap;
|
|
360
|
+
readonly reasoningEffortLevels?: readonly string[];
|
|
361
|
+
readonly oauthClientId?: string;
|
|
362
|
+
readonly oauthProjectId?: string;
|
|
363
|
+
readonly customHeaders?: Readonly<Record<string, string>>;
|
|
364
|
+
readonly customHeadersInvalid?: boolean;
|
|
365
|
+
}
|
|
366
|
+
export interface LlmProviderConfigView extends LlmProviderConfig {
|
|
367
|
+
readonly apiKeyMasked: string;
|
|
368
|
+
readonly apiKeyConfigured: boolean;
|
|
369
|
+
readonly oauthStatus?: LlmOAuthStatus;
|
|
370
|
+
readonly credentialId?: string;
|
|
371
|
+
}
|
|
372
|
+
export interface LlmModelConfig {
|
|
373
|
+
readonly id: string;
|
|
374
|
+
readonly model: string;
|
|
375
|
+
readonly label?: string;
|
|
376
|
+
readonly enabled: boolean;
|
|
377
|
+
readonly createdAt: string;
|
|
378
|
+
readonly resolvedWire?: LlmWireProtocol;
|
|
379
|
+
readonly wireOverride?: LlmWireProtocol;
|
|
380
|
+
readonly contextWindow?: number;
|
|
381
|
+
readonly maxOutputTokens?: number;
|
|
382
|
+
readonly inputPrice?: number;
|
|
383
|
+
readonly outputPrice?: number;
|
|
384
|
+
readonly cacheWritePrice?: number;
|
|
385
|
+
readonly cacheReadPrice?: number;
|
|
386
|
+
readonly longContextInputThreshold?: number;
|
|
387
|
+
readonly longContextInputPrice?: number;
|
|
388
|
+
readonly longContextCacheReadPrice?: number;
|
|
389
|
+
readonly longContextOutputPrice?: number;
|
|
390
|
+
readonly supportsVision?: boolean;
|
|
391
|
+
readonly supportsReasoning?: boolean;
|
|
392
|
+
readonly supportsPromptCaching?: boolean;
|
|
393
|
+
readonly reasoningParamStyle?: LlmReasoningParamStyle;
|
|
394
|
+
readonly reasoningEffortMap?: LlmReasoningEffortMap;
|
|
395
|
+
readonly reasoningEffortLevels?: readonly string[];
|
|
396
|
+
readonly customHeaders?: Readonly<Record<string, string>>;
|
|
397
|
+
readonly customHeadersInvalid?: boolean;
|
|
398
|
+
}
|
|
399
|
+
export interface LlmProviderGroupConfig {
|
|
400
|
+
readonly id: string;
|
|
401
|
+
readonly provider: LlmProviderType;
|
|
402
|
+
readonly channelId?: LlmChannelId;
|
|
403
|
+
readonly authMethod: LlmAuthMethod;
|
|
404
|
+
readonly name: string;
|
|
405
|
+
readonly baseUrl: string;
|
|
406
|
+
readonly createdAt: string;
|
|
407
|
+
readonly oauthClientId?: string;
|
|
408
|
+
readonly oauthProjectId?: string;
|
|
409
|
+
readonly models: readonly LlmModelConfig[];
|
|
410
|
+
}
|
|
411
|
+
export interface LlmProviderGroupConfigView extends LlmProviderGroupConfig {
|
|
412
|
+
readonly apiKeyMasked: string;
|
|
413
|
+
readonly apiKeyConfigured: boolean;
|
|
414
|
+
readonly oauthStatus?: LlmOAuthStatus;
|
|
415
|
+
readonly defaultComboId?: string;
|
|
416
|
+
}
|
|
417
|
+
export interface LlmModelInfo {
|
|
418
|
+
readonly id: string;
|
|
419
|
+
readonly label: string;
|
|
420
|
+
readonly created?: number;
|
|
421
|
+
readonly contextWindow?: number;
|
|
422
|
+
readonly maxOutputTokens?: number;
|
|
423
|
+
readonly supportsVision?: boolean;
|
|
424
|
+
readonly supportsReasoning?: boolean;
|
|
425
|
+
readonly inputPrice?: number;
|
|
426
|
+
readonly outputPrice?: number;
|
|
427
|
+
readonly cacheReadPrice?: number;
|
|
428
|
+
readonly longContextInputThreshold?: number;
|
|
429
|
+
readonly longContextInputPrice?: number;
|
|
430
|
+
readonly longContextCacheReadPrice?: number;
|
|
431
|
+
readonly longContextOutputPrice?: number;
|
|
432
|
+
}
|
|
433
|
+
export interface LlmModelListResult {
|
|
434
|
+
readonly success: boolean;
|
|
435
|
+
readonly models: readonly LlmModelInfo[];
|
|
436
|
+
readonly source?: 'builtin' | 'remote' | 'fallback' | 'local';
|
|
437
|
+
readonly error?: string;
|
|
438
|
+
}
|
|
439
|
+
export interface LlmProviderTestResult {
|
|
440
|
+
readonly success: boolean;
|
|
441
|
+
readonly model?: string;
|
|
442
|
+
readonly latencyMs?: number;
|
|
443
|
+
readonly error?: string;
|
|
444
|
+
}
|
|
445
|
+
export interface ClientBootstrap {
|
|
446
|
+
readonly session: ClientSessionState;
|
|
447
|
+
readonly capabilities: readonly CapabilityManifest[];
|
|
448
|
+
readonly projects: readonly WorkspaceProject[];
|
|
449
|
+
readonly activeProjectId: string;
|
|
450
|
+
readonly availableLocales: readonly LocaleCode[];
|
|
451
|
+
readonly llmProviders: readonly LlmProviderConfigView[];
|
|
452
|
+
}
|
|
453
|
+
export interface CapabilitySelection {
|
|
454
|
+
readonly capabilityId: string;
|
|
455
|
+
readonly reason: string;
|
|
456
|
+
readonly argumentsPreview: Record<string, unknown>;
|
|
457
|
+
}
|
|
458
|
+
export interface ClientToolConfirmation {
|
|
459
|
+
readonly kind: string;
|
|
460
|
+
readonly detail?: string;
|
|
461
|
+
readonly reason?: string;
|
|
462
|
+
readonly riskLevel?: CapabilityRiskLevel;
|
|
463
|
+
readonly [key: string]: unknown;
|
|
464
|
+
}
|
|
465
|
+
export interface RuntimeToolCall {
|
|
466
|
+
readonly toolCallId: string;
|
|
467
|
+
readonly capabilityId: string;
|
|
468
|
+
readonly arguments?: unknown;
|
|
469
|
+
readonly argumentsPreview?: unknown;
|
|
470
|
+
readonly [key: string]: unknown;
|
|
471
|
+
}
|
|
472
|
+
export interface RuntimeToolResult {
|
|
473
|
+
readonly toolCallId?: string;
|
|
474
|
+
readonly status?: string;
|
|
475
|
+
readonly evidence?: unknown;
|
|
476
|
+
readonly [key: string]: unknown;
|
|
477
|
+
}
|
|
478
|
+
export interface RuntimeExecuteRequest {
|
|
479
|
+
readonly sessionId?: string;
|
|
480
|
+
readonly projectionId?: string;
|
|
481
|
+
readonly conversationId?: string;
|
|
482
|
+
readonly call: RuntimeToolCall;
|
|
483
|
+
readonly [key: string]: unknown;
|
|
484
|
+
}
|
|
485
|
+
export interface RuntimeExecutionContext {
|
|
486
|
+
readonly workspaceRoot?: string;
|
|
487
|
+
readonly [key: string]: unknown;
|
|
488
|
+
}
|
|
489
|
+
export interface ClientToolCall extends RuntimeToolCall {
|
|
490
|
+
readonly displayName: string;
|
|
491
|
+
readonly reason: string;
|
|
492
|
+
readonly arguments?: Record<string, unknown>;
|
|
493
|
+
readonly argumentsPreview: Record<string, unknown>;
|
|
494
|
+
readonly confirmation?: ClientToolConfirmation;
|
|
495
|
+
readonly riskLevel: CapabilityRiskLevel;
|
|
496
|
+
readonly dataLevel: DataLevel;
|
|
497
|
+
readonly requestedAt: string;
|
|
498
|
+
}
|
|
499
|
+
export interface ClientToolCallPollRequest {
|
|
500
|
+
readonly sessionId: string;
|
|
501
|
+
readonly projectionId?: string;
|
|
502
|
+
readonly conversationId?: number;
|
|
503
|
+
readonly cursor?: string;
|
|
504
|
+
readonly limit?: number;
|
|
505
|
+
readonly polledAt: string;
|
|
506
|
+
}
|
|
507
|
+
export interface ClientToolCallPollResult {
|
|
508
|
+
readonly calls: readonly ClientToolCall[];
|
|
509
|
+
readonly cursor?: string;
|
|
510
|
+
readonly idleUntil?: string;
|
|
511
|
+
}
|
|
512
|
+
export type PermissionDuration = 'once' | 'task' | 'session' | 'scope' | 'persistent' | 'denied';
|
|
513
|
+
export interface PermissionGrant {
|
|
514
|
+
readonly grantId: string;
|
|
515
|
+
readonly toolCallId: string;
|
|
516
|
+
readonly granted: boolean;
|
|
517
|
+
readonly duration: PermissionDuration;
|
|
518
|
+
readonly scope?: string;
|
|
519
|
+
readonly decidedAt: string;
|
|
520
|
+
}
|
|
521
|
+
export interface LocalShellExecInput {
|
|
522
|
+
readonly command: string;
|
|
523
|
+
readonly cwd?: string;
|
|
524
|
+
readonly timeoutMs?: number;
|
|
525
|
+
readonly description?: string;
|
|
526
|
+
readonly runInBackground?: boolean;
|
|
527
|
+
}
|
|
528
|
+
export interface LocalShellStopInput {
|
|
529
|
+
readonly taskId?: string;
|
|
530
|
+
readonly toolCallId?: string;
|
|
531
|
+
}
|
|
532
|
+
export interface LocalShellExecResult {
|
|
533
|
+
readonly status: 'success' | 'failed' | 'cancelled' | 'running';
|
|
534
|
+
readonly exitCode: number | null;
|
|
535
|
+
readonly stdoutPreview: string | null;
|
|
536
|
+
readonly stderrPreview: string | null;
|
|
537
|
+
readonly interrupted: boolean;
|
|
538
|
+
readonly timedOut: boolean;
|
|
539
|
+
readonly promptDetected: boolean;
|
|
540
|
+
readonly outputArtifactRef?: string | null;
|
|
541
|
+
readonly backgroundTaskId?: string | null;
|
|
542
|
+
}
|
|
543
|
+
export type ShellPermissionBehavior = 'allow' | 'ask' | 'deny';
|
|
544
|
+
export interface ShellPermissionRule {
|
|
545
|
+
readonly id?: string;
|
|
546
|
+
readonly behavior: ShellPermissionBehavior;
|
|
547
|
+
readonly match: {
|
|
548
|
+
readonly type: 'exact';
|
|
549
|
+
readonly command: string;
|
|
550
|
+
} | {
|
|
551
|
+
readonly type: 'prefix';
|
|
552
|
+
readonly prefix: string;
|
|
553
|
+
} | {
|
|
554
|
+
readonly type: 'wildcard';
|
|
555
|
+
readonly pattern: string;
|
|
556
|
+
};
|
|
557
|
+
readonly scope: {
|
|
558
|
+
readonly cwd?: string;
|
|
559
|
+
readonly maxRiskLevel?: CapabilityRiskLevel;
|
|
560
|
+
};
|
|
561
|
+
readonly expiresAt?: string;
|
|
562
|
+
}
|
|
563
|
+
export interface LocalShellProjectionPolicy {
|
|
564
|
+
readonly capabilityId: 'local.shell.exec';
|
|
565
|
+
readonly cwdScope: 'workspace' | 'selected_directories';
|
|
566
|
+
readonly defaultBehavior: 'ask' | 'deny';
|
|
567
|
+
readonly readOnlyAutoAllow: boolean;
|
|
568
|
+
readonly backgroundTasks: boolean;
|
|
569
|
+
readonly sandboxAvailable: boolean;
|
|
570
|
+
}
|
|
571
|
+
export interface Evidence {
|
|
572
|
+
readonly evidenceId: string;
|
|
573
|
+
readonly toolCallId: string;
|
|
574
|
+
readonly summary: string;
|
|
575
|
+
readonly locale: LocaleCode;
|
|
576
|
+
readonly returnedToCloud: boolean;
|
|
577
|
+
readonly dataLevel: DataLevel;
|
|
578
|
+
readonly redactions: readonly string[];
|
|
579
|
+
readonly artifactRefs: readonly string[];
|
|
580
|
+
}
|
|
581
|
+
export interface ClientToolResult {
|
|
582
|
+
readonly toolCallId: string;
|
|
583
|
+
readonly status: 'success' | 'denied' | 'failed' | 'cancelled';
|
|
584
|
+
readonly outputPreview: Record<string, unknown>;
|
|
585
|
+
readonly evidence: Evidence;
|
|
586
|
+
readonly completedAt: string;
|
|
587
|
+
}
|
|
588
|
+
export interface ClientToolResultReport {
|
|
589
|
+
readonly conversationId?: number;
|
|
590
|
+
readonly streamId?: string;
|
|
591
|
+
readonly call: ClientToolCall;
|
|
592
|
+
readonly grant: PermissionGrant;
|
|
593
|
+
readonly result: ClientToolResult;
|
|
594
|
+
readonly reportedAt: string;
|
|
595
|
+
}
|
|
596
|
+
export interface AuditEvent {
|
|
597
|
+
readonly auditId: string;
|
|
598
|
+
readonly sessionId: string;
|
|
599
|
+
readonly eventType: 'session_started' | 'manifest_published' | 'permission_reviewed' | 'tool_started' | 'tool_completed' | 'tool_failed';
|
|
600
|
+
readonly message: string;
|
|
601
|
+
readonly createdAt: string;
|
|
602
|
+
readonly metadata?: Record<string, unknown>;
|
|
603
|
+
}
|
|
604
|
+
export * from './execution.ts';
|
|
605
|
+
export * from './chat.ts';
|
|
606
|
+
export * from './memory.ts';
|
|
607
|
+
export * from './system-context.ts';
|
|
608
|
+
export * from './goal.ts';
|
|
609
|
+
export * from './updater.ts';
|