@openagentpack/sdk 0.6.0 → 0.7.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/README.md +17 -0
- package/dist/chunk-56BB46YT.js +1191 -0
- package/dist/chunk-HIK5DY4I.js +2429 -0
- package/dist/chunk-ZBJDMUJT.js +6989 -0
- package/dist/directory-nY2Slsfi.d.ts +98 -0
- package/dist/{session-event-B63Rbjim.d.ts → dto-BT1Q1Ii6.d.ts} +1 -50
- package/dist/errors-BcVE1wZB.d.ts +5 -0
- package/dist/index.d.ts +7 -1128
- package/dist/index.js +249 -9534
- package/dist/project-versions.d.ts +105 -0
- package/dist/project-versions.js +35 -0
- package/dist/project-workspace.d.ts +150 -0
- package/dist/project-workspace.js +1774 -0
- package/dist/resource-runtime-DZDY45_Q.d.ts +1126 -0
- package/dist/session-event-DB_YlDiK.d.ts +52 -0
- package/dist/session-events.d.ts +2 -1
- package/package.json +13 -1
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
import { C as CloudAgent, c as CloudEnvironment, d as CloudVault, f as ResourceAddress, R as ResourceType, P as PlannedAction, D as Diagnostic } from './dto-BT1Q1Ii6.js';
|
|
2
|
+
import { P as ProviderFileInfo } from './file-Cj5-Vx27.js';
|
|
3
|
+
import { b as EventStreamOptions, a as ProviderSessionEvent, E as EventListOptions, P as ProviderSessionEventList } from './session-event-DB_YlDiK.js';
|
|
4
|
+
|
|
5
|
+
type ProviderName = string;
|
|
6
|
+
interface ProjectConfig {
|
|
7
|
+
version: string;
|
|
8
|
+
providers: Record<string, unknown>;
|
|
9
|
+
defaults?: DefaultsConfig;
|
|
10
|
+
environments?: Record<string, EnvironmentDecl>;
|
|
11
|
+
tunnels?: Record<string, TunnelDecl>;
|
|
12
|
+
vaults?: Record<string, VaultDecl>;
|
|
13
|
+
memory_stores?: Record<string, MemoryStoreDecl>;
|
|
14
|
+
skills?: Record<string, SkillDecl>;
|
|
15
|
+
files?: Record<string, FileDecl>;
|
|
16
|
+
identities?: Record<string, IdentityDecl>;
|
|
17
|
+
agents?: Record<string, AgentDecl>;
|
|
18
|
+
channels?: Record<string, ChannelDecl>;
|
|
19
|
+
deployments?: Record<string, DeploymentDecl>;
|
|
20
|
+
}
|
|
21
|
+
interface DefaultsConfig {
|
|
22
|
+
provider?: string;
|
|
23
|
+
/** Logical name of the default declared Identity used by identity-aware resources and runtimes. */
|
|
24
|
+
identity?: string;
|
|
25
|
+
}
|
|
26
|
+
type IdentityDecl = ManagedIdentityDecl | ExternalIdentityDecl;
|
|
27
|
+
interface ManagedIdentityDecl {
|
|
28
|
+
provider?: ProviderName;
|
|
29
|
+
external_id: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
metadata?: Record<string, string>;
|
|
33
|
+
identity_id?: never;
|
|
34
|
+
}
|
|
35
|
+
interface ExternalIdentityDecl {
|
|
36
|
+
provider?: ProviderName;
|
|
37
|
+
/** Pre-existing provider Identity id. External references are never mutated or deleted. */
|
|
38
|
+
identity_id: string;
|
|
39
|
+
external_id?: never;
|
|
40
|
+
name?: never;
|
|
41
|
+
enabled?: never;
|
|
42
|
+
metadata?: never;
|
|
43
|
+
}
|
|
44
|
+
interface EnvironmentDecl {
|
|
45
|
+
name?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
provider?: ProviderName;
|
|
48
|
+
/** Pre-existing provider environment id. When set, OpenCMA treats the environment as an external reference and will not create/update/delete it remotely. */
|
|
49
|
+
environment_id?: string;
|
|
50
|
+
config: EnvironmentConfig;
|
|
51
|
+
metadata?: Record<string, string>;
|
|
52
|
+
}
|
|
53
|
+
interface EnvironmentConfig {
|
|
54
|
+
type: "cloud" | "self_hosted";
|
|
55
|
+
networking?: NetworkingConfig;
|
|
56
|
+
packages?: PackagesConfig;
|
|
57
|
+
/** Shell script executed by supported providers while preparing a sandbox. */
|
|
58
|
+
setup_script?: string;
|
|
59
|
+
}
|
|
60
|
+
interface TunnelDecl {
|
|
61
|
+
name?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
/** Pre-existing Qoder tunnel id (e.g. tnl_00xxxx). Tunnels are allocated by Qoder BYOC admin and referenced, not created. */
|
|
64
|
+
tunnel_id: string;
|
|
65
|
+
metadata?: Record<string, string>;
|
|
66
|
+
}
|
|
67
|
+
interface NetworkingConfig {
|
|
68
|
+
type: "unrestricted" | "limited";
|
|
69
|
+
allow_mcp_servers?: boolean;
|
|
70
|
+
allow_package_managers?: boolean;
|
|
71
|
+
allowed_hosts?: string[];
|
|
72
|
+
}
|
|
73
|
+
interface PackagesConfig {
|
|
74
|
+
apt?: string[];
|
|
75
|
+
pip?: string[];
|
|
76
|
+
npm?: string[];
|
|
77
|
+
cargo?: string[];
|
|
78
|
+
gem?: string[];
|
|
79
|
+
go?: string[];
|
|
80
|
+
}
|
|
81
|
+
interface VaultDecl {
|
|
82
|
+
display_name: string;
|
|
83
|
+
provider?: ProviderName;
|
|
84
|
+
credentials: CredentialDecl[];
|
|
85
|
+
metadata?: Record<string, string>;
|
|
86
|
+
}
|
|
87
|
+
type CredentialType = "static_bearer" | "environment_variable";
|
|
88
|
+
interface CredentialNetworking {
|
|
89
|
+
/** Legacy policy type; Bailian requests use allowed_hosts instead. */
|
|
90
|
+
type?: "unrestricted" | "limited";
|
|
91
|
+
allowed_hosts?: string[];
|
|
92
|
+
}
|
|
93
|
+
interface CredentialInjectionLocation {
|
|
94
|
+
header?: boolean;
|
|
95
|
+
body?: boolean;
|
|
96
|
+
}
|
|
97
|
+
interface CredentialDecl {
|
|
98
|
+
name: string;
|
|
99
|
+
type: CredentialType;
|
|
100
|
+
metadata?: Record<string, string>;
|
|
101
|
+
mcp_server_url?: string;
|
|
102
|
+
access_token?: string;
|
|
103
|
+
protocol?: "sse" | "streamable_http";
|
|
104
|
+
secret_name?: string;
|
|
105
|
+
secret_value?: string;
|
|
106
|
+
networking?: CredentialNetworking;
|
|
107
|
+
injection_location?: CredentialInjectionLocation;
|
|
108
|
+
}
|
|
109
|
+
interface MemoryStoreDecl {
|
|
110
|
+
description: string;
|
|
111
|
+
provider?: ProviderName;
|
|
112
|
+
metadata?: Record<string, string>;
|
|
113
|
+
entries?: MemoryEntryDecl[];
|
|
114
|
+
}
|
|
115
|
+
interface MemoryEntryDecl {
|
|
116
|
+
key: string;
|
|
117
|
+
content: string;
|
|
118
|
+
}
|
|
119
|
+
interface SkillDecl {
|
|
120
|
+
name?: string;
|
|
121
|
+
source: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
version?: string;
|
|
124
|
+
origin?: "custom" | "official";
|
|
125
|
+
provider?: ProviderName;
|
|
126
|
+
}
|
|
127
|
+
interface FileDecl {
|
|
128
|
+
source: string;
|
|
129
|
+
/** Local label only; declarative uploads preserve the source file's basename. */
|
|
130
|
+
name?: string;
|
|
131
|
+
purpose?: string;
|
|
132
|
+
provider?: ProviderName;
|
|
133
|
+
}
|
|
134
|
+
interface ModelWithSpeed {
|
|
135
|
+
id: string;
|
|
136
|
+
speed?: "standard" | "fast";
|
|
137
|
+
}
|
|
138
|
+
type ModelSpec = string | ModelWithSpeed;
|
|
139
|
+
interface AgentDecl {
|
|
140
|
+
name?: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
model: string | Record<ProviderName, ModelSpec>;
|
|
143
|
+
instructions: string;
|
|
144
|
+
environment?: string;
|
|
145
|
+
tunnel?: string;
|
|
146
|
+
provider?: ProviderName;
|
|
147
|
+
tools?: AgentToolsDecl;
|
|
148
|
+
mcp_servers?: McpServerDecl[];
|
|
149
|
+
skills?: AgentSkillDecl[];
|
|
150
|
+
vault?: string;
|
|
151
|
+
memory_stores?: string[];
|
|
152
|
+
/** String refs are inherited by Qoder Forward Templates; object refs mount Files into Sessions. */
|
|
153
|
+
files?: Array<string | AgentFileMountDecl>;
|
|
154
|
+
/** Desired display metadata for Qoder Forward's system-managed writable Store. */
|
|
155
|
+
default_memory_store?: DefaultMemoryStoreDecl;
|
|
156
|
+
/** Resources mounted into every managed session created for this agent. */
|
|
157
|
+
resources?: SessionResourceDecl[];
|
|
158
|
+
multiagent?: MultiagentDecl;
|
|
159
|
+
metadata?: Record<string, string>;
|
|
160
|
+
/** Qoder runtime environment variables. Forward delivery stores these as Template defaults. */
|
|
161
|
+
environment_variables?: Record<string, string>;
|
|
162
|
+
/** Provider-side tools the Agent Harness operates itself. Qoder Forward delivery only. */
|
|
163
|
+
managed_tool_config?: ManagedToolConfigDecl;
|
|
164
|
+
/** Provider-specific remote materialization. Omitted means the existing managed Agent resource. */
|
|
165
|
+
delivery?: Record<ProviderName, AgentDeliveryDecl>;
|
|
166
|
+
}
|
|
167
|
+
interface AgentFileMountDecl {
|
|
168
|
+
/** Logical key under the top-level files section. */
|
|
169
|
+
file: string;
|
|
170
|
+
/** Provider sandbox path. Bailian paths live under /mnt. */
|
|
171
|
+
mount_path: string;
|
|
172
|
+
}
|
|
173
|
+
interface DefaultMemoryStoreDecl {
|
|
174
|
+
name: string;
|
|
175
|
+
description?: string;
|
|
176
|
+
/** Permanently delete the system-managed Store during destroy. Defaults to false. */
|
|
177
|
+
delete_on_destroy?: boolean;
|
|
178
|
+
}
|
|
179
|
+
interface ManagedToolConfigDecl {
|
|
180
|
+
/** Replaces the provider's enabled managed-tool set; an empty array disables all of them. */
|
|
181
|
+
enabled_tools: string[];
|
|
182
|
+
}
|
|
183
|
+
interface AgentDeliveryDecl {
|
|
184
|
+
type: "managed" | "forward";
|
|
185
|
+
}
|
|
186
|
+
interface ChannelDecl {
|
|
187
|
+
provider?: ProviderName;
|
|
188
|
+
/** Logical Agent name. The provider adapter resolves its materialized remote resource. Required for `fixed` mode; ignored for `pairing` mode. */
|
|
189
|
+
agent?: string;
|
|
190
|
+
/** Logical Identity name. Falls back to defaults.identity. Required for `fixed` mode; ignored for `pairing` mode. */
|
|
191
|
+
identity?: string;
|
|
192
|
+
type: string;
|
|
193
|
+
name?: string;
|
|
194
|
+
/** Identity resolution mode. `fixed` binds the channel to one Identity/Template; `pairing` creates a transport-only channel used by Schedules/Sinks. Defaults to `fixed`. */
|
|
195
|
+
mode?: "fixed" | "pairing";
|
|
196
|
+
enabled?: boolean;
|
|
197
|
+
credentials?: Record<string, string>;
|
|
198
|
+
options?: Record<string, unknown>;
|
|
199
|
+
}
|
|
200
|
+
type AgentSkillDecl = string | AgentSkillRefDecl;
|
|
201
|
+
interface AgentSkillRefDecl {
|
|
202
|
+
type: "official" | "custom";
|
|
203
|
+
skill_id: string;
|
|
204
|
+
version?: string;
|
|
205
|
+
}
|
|
206
|
+
interface AgentToolsDecl {
|
|
207
|
+
builtin: string[];
|
|
208
|
+
/** Permission inherited by every enabled builtin without an explicit override. */
|
|
209
|
+
default_permission?: "allow" | "ask";
|
|
210
|
+
mcp?: AgentMcpToolkitDecl[];
|
|
211
|
+
permissions?: Record<string, "allow" | "ask">;
|
|
212
|
+
}
|
|
213
|
+
interface AgentMcpToolkitDecl {
|
|
214
|
+
type: "mcp_toolkit";
|
|
215
|
+
mcp_server_name: string;
|
|
216
|
+
default_config?: {
|
|
217
|
+
enabled: boolean;
|
|
218
|
+
};
|
|
219
|
+
configs: Array<{
|
|
220
|
+
name: string;
|
|
221
|
+
enabled: boolean;
|
|
222
|
+
}>;
|
|
223
|
+
}
|
|
224
|
+
interface McpServerDecl {
|
|
225
|
+
name: string;
|
|
226
|
+
type?: "url" | "http" | "official";
|
|
227
|
+
url?: string;
|
|
228
|
+
}
|
|
229
|
+
interface MultiagentDecl {
|
|
230
|
+
type: "coordinator";
|
|
231
|
+
agents: string[];
|
|
232
|
+
}
|
|
233
|
+
interface DeploymentDecl {
|
|
234
|
+
name?: string;
|
|
235
|
+
agent: string;
|
|
236
|
+
agent_version?: number;
|
|
237
|
+
environment?: string;
|
|
238
|
+
tunnel?: string;
|
|
239
|
+
vaults?: string[];
|
|
240
|
+
memory_stores?: string[];
|
|
241
|
+
resources?: DeploymentResourceDecl[];
|
|
242
|
+
initial_events: InitialEventDecl[];
|
|
243
|
+
schedule?: ScheduleDecl;
|
|
244
|
+
description?: string;
|
|
245
|
+
provider?: ProviderName;
|
|
246
|
+
metadata?: Record<string, string>;
|
|
247
|
+
/** Qoder-only deployment-level variables copied into each created session. */
|
|
248
|
+
environment_variables?: string;
|
|
249
|
+
}
|
|
250
|
+
type DeploymentResourceDecl = DeploymentFileResource | DeploymentMemoryStoreResource | DeploymentGithubRepoResource;
|
|
251
|
+
/** Provider-neutral resources that can be attached directly when a session is created. */
|
|
252
|
+
interface SessionGithubRepoResourceDecl extends Omit<DeploymentGithubRepoResource, "authorization_token"> {
|
|
253
|
+
/** Required for private repositories; interpolate this value from an environment variable. */
|
|
254
|
+
authorization_token: string;
|
|
255
|
+
}
|
|
256
|
+
type SessionResourceDecl = SessionGithubRepoResourceDecl;
|
|
257
|
+
interface DeploymentFileResource {
|
|
258
|
+
type: "file";
|
|
259
|
+
file_id?: string;
|
|
260
|
+
source?: string;
|
|
261
|
+
mount_path?: string;
|
|
262
|
+
}
|
|
263
|
+
interface DeploymentMemoryStoreResource {
|
|
264
|
+
type: "memory_store";
|
|
265
|
+
memory_store: string;
|
|
266
|
+
access?: "read_write" | "read_only";
|
|
267
|
+
instructions?: string;
|
|
268
|
+
}
|
|
269
|
+
interface DeploymentGithubRepoResource {
|
|
270
|
+
type: "github_repository";
|
|
271
|
+
url: string;
|
|
272
|
+
checkout?: {
|
|
273
|
+
branch?: string;
|
|
274
|
+
commit?: string;
|
|
275
|
+
};
|
|
276
|
+
mount_path?: string;
|
|
277
|
+
authorization_token?: string;
|
|
278
|
+
}
|
|
279
|
+
type InitialEventDecl = InitialUserMessage | InitialSystemMessage | InitialDefineOutcome;
|
|
280
|
+
interface InitialUserMessage {
|
|
281
|
+
type: "user.message";
|
|
282
|
+
content: string;
|
|
283
|
+
}
|
|
284
|
+
interface InitialSystemMessage {
|
|
285
|
+
type: "system.message";
|
|
286
|
+
content: string;
|
|
287
|
+
}
|
|
288
|
+
interface InitialDefineOutcome {
|
|
289
|
+
type: "user.define_outcome";
|
|
290
|
+
description?: string;
|
|
291
|
+
rubric?: string;
|
|
292
|
+
rubric_file?: string;
|
|
293
|
+
max_iterations?: number;
|
|
294
|
+
}
|
|
295
|
+
interface ScheduleDecl {
|
|
296
|
+
expression: string;
|
|
297
|
+
timezone: string;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* A ProjectConfig where all file references (instructions, memory entries)
|
|
301
|
+
* have been resolved to their inline content.
|
|
302
|
+
*/
|
|
303
|
+
interface ResolvedProjectConfig extends ProjectConfig {
|
|
304
|
+
_resolved: true;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
interface ProviderSkillInfo {
|
|
308
|
+
id: string;
|
|
309
|
+
name: string;
|
|
310
|
+
description?: string;
|
|
311
|
+
source: "custom" | "official";
|
|
312
|
+
status: "checking" | "active" | "rejected" | "deleted";
|
|
313
|
+
latest_version?: string;
|
|
314
|
+
created_at?: string;
|
|
315
|
+
updated_at?: string;
|
|
316
|
+
attributes?: Record<string, unknown>;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
interface CursorPage<T> {
|
|
320
|
+
data: T[];
|
|
321
|
+
has_more: boolean;
|
|
322
|
+
next_page?: string;
|
|
323
|
+
}
|
|
324
|
+
interface CursorListOptions {
|
|
325
|
+
limit?: number;
|
|
326
|
+
page?: string;
|
|
327
|
+
}
|
|
328
|
+
interface AgentListOptions extends CursorListOptions {
|
|
329
|
+
include_archived?: boolean;
|
|
330
|
+
}
|
|
331
|
+
type AgentVersionListOptions = CursorListOptions;
|
|
332
|
+
type AgentPage = CursorPage<CloudAgent>;
|
|
333
|
+
interface EnvironmentListOptions extends CursorListOptions {
|
|
334
|
+
include_archived?: boolean;
|
|
335
|
+
}
|
|
336
|
+
type EnvironmentPage = CursorPage<CloudEnvironment>;
|
|
337
|
+
interface VaultListOptions extends CursorListOptions {
|
|
338
|
+
include_archived?: boolean;
|
|
339
|
+
}
|
|
340
|
+
type VaultPage = CursorPage<CloudVault>;
|
|
341
|
+
interface VaultCredentialInfo {
|
|
342
|
+
id: string;
|
|
343
|
+
display_name: string;
|
|
344
|
+
auth_type: string;
|
|
345
|
+
secret_name?: string;
|
|
346
|
+
mcp_server_url?: string;
|
|
347
|
+
networking_type?: string;
|
|
348
|
+
networking?: CredentialNetworking;
|
|
349
|
+
injection_location?: CredentialInjectionLocation;
|
|
350
|
+
metadata?: Record<string, string>;
|
|
351
|
+
}
|
|
352
|
+
interface SkillListOptions extends CursorListOptions {
|
|
353
|
+
source?: "custom" | "official";
|
|
354
|
+
}
|
|
355
|
+
interface SkillVersionInfo {
|
|
356
|
+
id?: string;
|
|
357
|
+
skill_id: string;
|
|
358
|
+
type: string;
|
|
359
|
+
name?: string;
|
|
360
|
+
description?: string;
|
|
361
|
+
version: string;
|
|
362
|
+
status?: string;
|
|
363
|
+
created_at?: string;
|
|
364
|
+
updated_at?: string;
|
|
365
|
+
additional_properties?: Record<string, unknown>;
|
|
366
|
+
attributes: Record<string, unknown>;
|
|
367
|
+
}
|
|
368
|
+
type SkillVersionListOptions = CursorListOptions;
|
|
369
|
+
type SkillVersionPage = CursorPage<SkillVersionInfo>;
|
|
370
|
+
interface SkillDownloadInfo {
|
|
371
|
+
skill_id: string;
|
|
372
|
+
version: string;
|
|
373
|
+
file_url: string;
|
|
374
|
+
}
|
|
375
|
+
type SkillPage = CursorPage<ProviderSkillInfo>;
|
|
376
|
+
interface FileListOptions extends CursorListOptions {
|
|
377
|
+
scope_id?: string;
|
|
378
|
+
}
|
|
379
|
+
type FilePage = CursorPage<ProviderFileInfo>;
|
|
380
|
+
interface SessionUpdateInput {
|
|
381
|
+
title?: string;
|
|
382
|
+
metadata?: Record<string, string>;
|
|
383
|
+
}
|
|
384
|
+
/** Raw AgentStudio message/event input. Provider adapters preserve the wire shape. */
|
|
385
|
+
type SessionEventInput = Record<string, unknown>;
|
|
386
|
+
interface SessionEventSendResult {
|
|
387
|
+
event_ids: string[];
|
|
388
|
+
attributes: Record<string, unknown>;
|
|
389
|
+
}
|
|
390
|
+
interface DeploymentRunInfo {
|
|
391
|
+
id: string;
|
|
392
|
+
deployment_id?: string;
|
|
393
|
+
session_id?: string | null;
|
|
394
|
+
status?: string;
|
|
395
|
+
error?: {
|
|
396
|
+
type?: string;
|
|
397
|
+
message?: string;
|
|
398
|
+
};
|
|
399
|
+
created_at?: string;
|
|
400
|
+
updated_at?: string;
|
|
401
|
+
attributes: Record<string, unknown>;
|
|
402
|
+
}
|
|
403
|
+
type DeploymentRunPage = CursorPage<DeploymentRunInfo>;
|
|
404
|
+
type ManagedAgentOperationAuth = "api_key" | "none";
|
|
405
|
+
interface ManagedAgentOperationCapability {
|
|
406
|
+
supported: boolean;
|
|
407
|
+
auth: ManagedAgentOperationAuth | null;
|
|
408
|
+
reason?: string;
|
|
409
|
+
}
|
|
410
|
+
interface ManagedAgentProviderCapabilities {
|
|
411
|
+
provider: string;
|
|
412
|
+
operations: Record<string, ManagedAgentOperationCapability>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
type MemoryMetadata = Record<string, string>;
|
|
416
|
+
interface MemoryStoreInfo {
|
|
417
|
+
id: string;
|
|
418
|
+
type: "memory_store";
|
|
419
|
+
name: string;
|
|
420
|
+
description: string;
|
|
421
|
+
metadata: MemoryMetadata;
|
|
422
|
+
status?: "active" | "archived" | string;
|
|
423
|
+
entry_count?: number;
|
|
424
|
+
total_size?: number;
|
|
425
|
+
session_count?: number;
|
|
426
|
+
created_by?: MemoryActor;
|
|
427
|
+
created_at: string;
|
|
428
|
+
updated_at: string;
|
|
429
|
+
archived_at?: string | null;
|
|
430
|
+
}
|
|
431
|
+
interface MemoryInfo {
|
|
432
|
+
id: string;
|
|
433
|
+
type: "memory";
|
|
434
|
+
memory_store_id: string;
|
|
435
|
+
path: string;
|
|
436
|
+
content?: string | null;
|
|
437
|
+
content_size_bytes: number;
|
|
438
|
+
content_sha256: string;
|
|
439
|
+
version?: number;
|
|
440
|
+
memory_version_id?: string;
|
|
441
|
+
metadata: MemoryMetadata;
|
|
442
|
+
created_by?: MemoryActor;
|
|
443
|
+
created_at: string;
|
|
444
|
+
updated_at: string;
|
|
445
|
+
}
|
|
446
|
+
interface MemoryPrefixInfo {
|
|
447
|
+
type: "memory_prefix";
|
|
448
|
+
path: string;
|
|
449
|
+
}
|
|
450
|
+
type MemoryListItem = MemoryInfo | MemoryPrefixInfo;
|
|
451
|
+
type MemoryVersionOperation = "created" | "updated" | "modified" | "deleted";
|
|
452
|
+
interface MemoryActor {
|
|
453
|
+
type: string;
|
|
454
|
+
api_key_id?: string;
|
|
455
|
+
session_id?: string;
|
|
456
|
+
user_id?: string;
|
|
457
|
+
}
|
|
458
|
+
interface MemoryVersionInfo {
|
|
459
|
+
id: string;
|
|
460
|
+
type: "memory_version";
|
|
461
|
+
memory_store_id: string;
|
|
462
|
+
memory_id: string;
|
|
463
|
+
path?: string | null;
|
|
464
|
+
content?: string | null;
|
|
465
|
+
content_size_bytes?: number | null;
|
|
466
|
+
content_sha256?: string | null;
|
|
467
|
+
operation: MemoryVersionOperation;
|
|
468
|
+
version?: number;
|
|
469
|
+
redacted?: boolean;
|
|
470
|
+
redacted_at?: string | null;
|
|
471
|
+
created_by?: MemoryActor;
|
|
472
|
+
created_at: string;
|
|
473
|
+
}
|
|
474
|
+
interface MemoryPage<T> {
|
|
475
|
+
data: T[];
|
|
476
|
+
has_more: boolean;
|
|
477
|
+
next_cursor?: string;
|
|
478
|
+
}
|
|
479
|
+
interface MemoryProviderCapabilities {
|
|
480
|
+
archive_store: boolean;
|
|
481
|
+
batch_create: boolean;
|
|
482
|
+
versions: boolean;
|
|
483
|
+
optimistic_concurrency: boolean;
|
|
484
|
+
memory_metadata: boolean;
|
|
485
|
+
}
|
|
486
|
+
interface MemoryStoreListOptions {
|
|
487
|
+
limit?: number;
|
|
488
|
+
cursor?: string;
|
|
489
|
+
include_archived?: boolean;
|
|
490
|
+
}
|
|
491
|
+
interface MemoryListOptions {
|
|
492
|
+
limit?: number;
|
|
493
|
+
cursor?: string;
|
|
494
|
+
prefix?: string;
|
|
495
|
+
depth?: number;
|
|
496
|
+
view?: "basic" | "full";
|
|
497
|
+
}
|
|
498
|
+
interface MemoryVersionListOptions {
|
|
499
|
+
limit?: number;
|
|
500
|
+
cursor?: string;
|
|
501
|
+
memory_id?: string;
|
|
502
|
+
view?: "basic" | "full";
|
|
503
|
+
}
|
|
504
|
+
interface CreateMemoryStoreInput {
|
|
505
|
+
name: string;
|
|
506
|
+
description?: string;
|
|
507
|
+
metadata?: MemoryMetadata;
|
|
508
|
+
}
|
|
509
|
+
interface UpdateMemoryStoreInput {
|
|
510
|
+
name?: string;
|
|
511
|
+
description?: string;
|
|
512
|
+
metadata?: MemoryMetadata;
|
|
513
|
+
}
|
|
514
|
+
interface CreateMemoryInput {
|
|
515
|
+
path: string;
|
|
516
|
+
content: string;
|
|
517
|
+
metadata?: MemoryMetadata;
|
|
518
|
+
}
|
|
519
|
+
interface BatchCreateMemoryInput {
|
|
520
|
+
items: CreateMemoryInput[];
|
|
521
|
+
on_conflict?: "overwrite" | "fail";
|
|
522
|
+
}
|
|
523
|
+
interface BatchCreateMemoryResultItem {
|
|
524
|
+
path: string;
|
|
525
|
+
memory?: MemoryInfo;
|
|
526
|
+
error?: {
|
|
527
|
+
type: string;
|
|
528
|
+
message: string;
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
interface BatchCreateMemoryResult {
|
|
532
|
+
results: BatchCreateMemoryResultItem[];
|
|
533
|
+
}
|
|
534
|
+
interface UpdateMemoryInput {
|
|
535
|
+
path?: string;
|
|
536
|
+
content?: string;
|
|
537
|
+
metadata?: MemoryMetadata;
|
|
538
|
+
expected_content_sha256?: string;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
interface SessionFileResource {
|
|
542
|
+
file_id: string;
|
|
543
|
+
mount_path: string;
|
|
544
|
+
}
|
|
545
|
+
interface SessionGithubRepositoryResource {
|
|
546
|
+
type: "github_repository";
|
|
547
|
+
url: string;
|
|
548
|
+
checkout?: {
|
|
549
|
+
branch?: string;
|
|
550
|
+
commit?: string;
|
|
551
|
+
};
|
|
552
|
+
mount_path?: string;
|
|
553
|
+
authorization_token: string;
|
|
554
|
+
}
|
|
555
|
+
type SessionResource = SessionGithubRepositoryResource;
|
|
556
|
+
interface CommonSessionBindings {
|
|
557
|
+
/** Uploaded files to mount in the session sandbox. */
|
|
558
|
+
files?: SessionFileResource[];
|
|
559
|
+
/** Provider-neutral resources to mount when the session is created. */
|
|
560
|
+
resources?: SessionResource[];
|
|
561
|
+
title?: string;
|
|
562
|
+
metadata?: Record<string, string>;
|
|
563
|
+
/** Provider-neutral representation; Qoder maps it to each Session API's wire shape. */
|
|
564
|
+
environment_variables?: Record<string, string>;
|
|
565
|
+
}
|
|
566
|
+
interface ManagedSessionBindings extends CommonSessionBindings {
|
|
567
|
+
/** Omitted for backward compatibility; omitted always means managed. */
|
|
568
|
+
delivery?: "managed";
|
|
569
|
+
agent_id: string;
|
|
570
|
+
agent_version?: number;
|
|
571
|
+
/** Cloud sandbox id. Every provider runs sessions inside an environment. */
|
|
572
|
+
environment_id: string;
|
|
573
|
+
/** Qoder BYOC tunnel id. Required to reach internal MCP servers from the sandbox. */
|
|
574
|
+
tunnel_id?: string;
|
|
575
|
+
vault_ids: string[];
|
|
576
|
+
memory_store_ids: string[];
|
|
577
|
+
}
|
|
578
|
+
interface ForwardSessionBindings extends CommonSessionBindings {
|
|
579
|
+
delivery: "forward";
|
|
580
|
+
/** Qoder Forward Template selected from the applied Agent materialization. */
|
|
581
|
+
template_id: string;
|
|
582
|
+
/** Existing business Identity supplied by the session caller; omitted uses the provider's default Identity. */
|
|
583
|
+
identity_id?: string;
|
|
584
|
+
}
|
|
585
|
+
type SessionBindings = ManagedSessionBindings | ForwardSessionBindings;
|
|
586
|
+
interface ProviderSessionInfo {
|
|
587
|
+
id: string;
|
|
588
|
+
agent_id: string;
|
|
589
|
+
environment_id: string;
|
|
590
|
+
tunnel_id?: string;
|
|
591
|
+
status: string;
|
|
592
|
+
title?: string;
|
|
593
|
+
vault_ids: string[];
|
|
594
|
+
memory_store_ids: string[];
|
|
595
|
+
created_at: string;
|
|
596
|
+
updated_at: string;
|
|
597
|
+
attributes: Record<string, unknown>;
|
|
598
|
+
}
|
|
599
|
+
interface SessionFilter {
|
|
600
|
+
agent_id?: string;
|
|
601
|
+
statuses?: string[];
|
|
602
|
+
created_at_gte?: string;
|
|
603
|
+
created_at_lte?: string;
|
|
604
|
+
limit?: number;
|
|
605
|
+
page?: string;
|
|
606
|
+
}
|
|
607
|
+
interface SessionListResult {
|
|
608
|
+
sessions: ProviderSessionInfo[];
|
|
609
|
+
has_more: boolean;
|
|
610
|
+
next_page?: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
interface SkillFile {
|
|
614
|
+
relativePath: string;
|
|
615
|
+
content: Buffer;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
interface ResourceState {
|
|
619
|
+
address: ResourceAddress;
|
|
620
|
+
remote_id: string | null;
|
|
621
|
+
/**
|
|
622
|
+
* This resource is owned by the provider or another system and is only
|
|
623
|
+
* referenced by this project. It must never be deleted remotely.
|
|
624
|
+
*/
|
|
625
|
+
externally_managed?: boolean;
|
|
626
|
+
/** Provider API domain that owns the remote resource (currently relevant to Qoder). */
|
|
627
|
+
api_mode?: "managed" | "forward" | "auto";
|
|
628
|
+
version?: number;
|
|
629
|
+
/**
|
|
630
|
+
* Backward-compatible alias for desired_hash. Kept while older state files
|
|
631
|
+
* and callers still read/write content_hash directly.
|
|
632
|
+
*/
|
|
633
|
+
content_hash: string;
|
|
634
|
+
desired_hash?: string;
|
|
635
|
+
desired_comparable_hash?: string;
|
|
636
|
+
desired_readiness_baseline?: ResourceReadinessBaseline;
|
|
637
|
+
remote_hash?: string;
|
|
638
|
+
remote_snapshot?: unknown;
|
|
639
|
+
/** Non-reversible declaration fingerprint used to infer safe logical renames. */
|
|
640
|
+
replacement_fingerprint?: string;
|
|
641
|
+
drift_paths?: string[];
|
|
642
|
+
drift_status?: "in_sync" | "drifted" | "missing" | "unchecked";
|
|
643
|
+
}
|
|
644
|
+
interface ResourceReadinessBaseline {
|
|
645
|
+
operational_hash: string;
|
|
646
|
+
description_hash: string;
|
|
647
|
+
metadata_hash: string;
|
|
648
|
+
}
|
|
649
|
+
interface StateFile {
|
|
650
|
+
resources: ResourceState[];
|
|
651
|
+
pending_default_memory_store_cleanups?: PendingDefaultMemoryStoreCleanup[];
|
|
652
|
+
}
|
|
653
|
+
interface PendingDefaultMemoryStoreCleanup {
|
|
654
|
+
agent_name: string;
|
|
655
|
+
provider: string;
|
|
656
|
+
remote_id: string;
|
|
657
|
+
identity_id?: string;
|
|
658
|
+
template_id?: string;
|
|
659
|
+
last_error?: string;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
interface RemoteResource {
|
|
663
|
+
id: string | null;
|
|
664
|
+
type: string;
|
|
665
|
+
version?: number;
|
|
666
|
+
}
|
|
667
|
+
type ProviderResourceMode = "managed" | "forward" | "auto";
|
|
668
|
+
interface ModelInfo {
|
|
669
|
+
id: string;
|
|
670
|
+
display_name: string;
|
|
671
|
+
source: string;
|
|
672
|
+
is_enabled: boolean;
|
|
673
|
+
is_new: boolean;
|
|
674
|
+
price_factor?: number;
|
|
675
|
+
efforts?: string[];
|
|
676
|
+
default_effort?: string;
|
|
677
|
+
}
|
|
678
|
+
type DriftSupport = "full" | "existence" | "unsupported";
|
|
679
|
+
interface ComparableRemoteResource {
|
|
680
|
+
id: string | null;
|
|
681
|
+
type: string;
|
|
682
|
+
version?: number;
|
|
683
|
+
comparable: unknown;
|
|
684
|
+
snapshot?: unknown;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* A remote resource reverse-mapped into a `agents.yaml` declaration, ready to be
|
|
688
|
+
* serialized under the matching top-level group (e.g. `vaults.<name>`).
|
|
689
|
+
* `name` is the yaml key; `decl` matches the corresponding zod schema shape.
|
|
690
|
+
*/
|
|
691
|
+
interface ExportedResource {
|
|
692
|
+
name: string;
|
|
693
|
+
decl: Record<string, unknown>;
|
|
694
|
+
}
|
|
695
|
+
interface ResolvedAgentRefs {
|
|
696
|
+
skill_ids: Array<{
|
|
697
|
+
type: string;
|
|
698
|
+
skill_id: string;
|
|
699
|
+
version?: string;
|
|
700
|
+
}>;
|
|
701
|
+
multiagent_agent_ids?: string[];
|
|
702
|
+
}
|
|
703
|
+
interface ResolvedTemplateRefs extends ResolvedAgentRefs {
|
|
704
|
+
environment_id: string;
|
|
705
|
+
/** Qoder BYOC private-network route used by Forward Templates. */
|
|
706
|
+
tunnel_id?: string;
|
|
707
|
+
vault_ids: string[];
|
|
708
|
+
file_ids?: string[];
|
|
709
|
+
identity_id?: string;
|
|
710
|
+
memory_store_ids?: string[];
|
|
711
|
+
/** Forward Store ids owned by this project and therefore safe to detach during reconciliation. */
|
|
712
|
+
owned_memory_store_ids?: string[];
|
|
713
|
+
}
|
|
714
|
+
interface ResolvedDeploymentRefs {
|
|
715
|
+
agent_id: string;
|
|
716
|
+
agent_version?: number;
|
|
717
|
+
environment_id: string;
|
|
718
|
+
/** Qoder BYOC tunnel id. Passed through only when the deployment targets Qoder BYOC. */
|
|
719
|
+
tunnel_id?: string;
|
|
720
|
+
vault_ids: string[];
|
|
721
|
+
memory_store_ids: Record<string, string>;
|
|
722
|
+
}
|
|
723
|
+
interface ResolvedChannelRefs {
|
|
724
|
+
identity_id?: string;
|
|
725
|
+
agent_id?: string;
|
|
726
|
+
}
|
|
727
|
+
interface DefaultMemoryStoreReconcileResult {
|
|
728
|
+
status: "updated" | "unchanged" | "pending";
|
|
729
|
+
memory_store_id?: string;
|
|
730
|
+
}
|
|
731
|
+
interface DeploymentContext {
|
|
732
|
+
id: string | null;
|
|
733
|
+
name: string;
|
|
734
|
+
decl: DeploymentDecl;
|
|
735
|
+
refs: ResolvedDeploymentRefs;
|
|
736
|
+
basePath: string;
|
|
737
|
+
}
|
|
738
|
+
interface DeploymentRunResult {
|
|
739
|
+
run_id?: string;
|
|
740
|
+
session_id: string | null;
|
|
741
|
+
error?: {
|
|
742
|
+
type: string;
|
|
743
|
+
message: string;
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
interface DeploymentInfo {
|
|
747
|
+
id: string | null;
|
|
748
|
+
status: string;
|
|
749
|
+
paused_reason?: {
|
|
750
|
+
type: string;
|
|
751
|
+
error?: {
|
|
752
|
+
type: string;
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
schedule?: {
|
|
756
|
+
expression: string;
|
|
757
|
+
timezone?: string;
|
|
758
|
+
};
|
|
759
|
+
attributes?: Record<string, unknown>;
|
|
760
|
+
}
|
|
761
|
+
interface DeploymentListFilter {
|
|
762
|
+
agent_id?: string;
|
|
763
|
+
/** Bailian server-side fuzzy match against deployment id or name. */
|
|
764
|
+
keyword?: string;
|
|
765
|
+
status?: "active" | "paused";
|
|
766
|
+
include_archived?: boolean;
|
|
767
|
+
limit?: number;
|
|
768
|
+
page?: string;
|
|
769
|
+
created_at_gte?: string;
|
|
770
|
+
created_at_lte?: string;
|
|
771
|
+
}
|
|
772
|
+
interface DeploymentListResult {
|
|
773
|
+
deployments: DeploymentInfo[];
|
|
774
|
+
has_more: boolean;
|
|
775
|
+
next_page?: string;
|
|
776
|
+
}
|
|
777
|
+
interface ProviderAdapter {
|
|
778
|
+
readonly name: string;
|
|
779
|
+
/**
|
|
780
|
+
* Whether `sendSessionMessage` returns an event-id cursor the stream/poll can
|
|
781
|
+
* resume after. true → send-then-stream with `afterId`; false → connect-before-send.
|
|
782
|
+
*/
|
|
783
|
+
readonly eventResume: boolean;
|
|
784
|
+
readonly memoryCapabilities?: MemoryProviderCapabilities;
|
|
785
|
+
validate(): Promise<void>;
|
|
786
|
+
/**
|
|
787
|
+
* Locate a remote resource. When `id` is provided, the resource is verified
|
|
788
|
+
* precisely via its detail endpoint (`GET /{endpoint}/{id}`), which avoids the
|
|
789
|
+
* ambiguity of name matching when names are not unique. Without `id`, falls
|
|
790
|
+
* back to listing and matching by `name` (used by conflict adoption).
|
|
791
|
+
*/
|
|
792
|
+
findResource(type: ResourceType, name: string, id?: string | null, mode?: ProviderResourceMode): Promise<RemoteResource | null>;
|
|
793
|
+
listAgents?(filter?: {
|
|
794
|
+
prefix?: string;
|
|
795
|
+
limit?: number;
|
|
796
|
+
}): Promise<CloudAgent[]>;
|
|
797
|
+
/** Cursor-preserving API listing used by command surfaces. */
|
|
798
|
+
listAgentResources?(options?: AgentListOptions): Promise<AgentPage>;
|
|
799
|
+
getRemoteAgent?(id: string, version?: number): Promise<CloudAgent>;
|
|
800
|
+
listAgentVersions?(id: string, options?: AgentVersionListOptions): Promise<AgentPage>;
|
|
801
|
+
listEnvironments?(filter?: {
|
|
802
|
+
limit?: number;
|
|
803
|
+
}): Promise<CloudEnvironment[]>;
|
|
804
|
+
listEnvironmentResources?(options?: EnvironmentListOptions): Promise<EnvironmentPage>;
|
|
805
|
+
getRemoteEnvironment?(id: string): Promise<CloudEnvironment>;
|
|
806
|
+
listVaults?(filter?: {
|
|
807
|
+
limit?: number;
|
|
808
|
+
}): Promise<CloudVault[]>;
|
|
809
|
+
listVaultResources?(options?: VaultListOptions): Promise<VaultPage>;
|
|
810
|
+
getRemoteVault?(id: string): Promise<CloudVault>;
|
|
811
|
+
getDriftSupport?(type: ResourceType): DriftSupport;
|
|
812
|
+
readComparableResource?(type: ResourceType, id: string | null, name: string): Promise<ComparableRemoteResource | null>;
|
|
813
|
+
normalizeDesiredResource?(type: ResourceType, name: string, decl: unknown): unknown | null;
|
|
814
|
+
/**
|
|
815
|
+
* Reverse-map remote resources of a given type into `agents.yaml` declarations
|
|
816
|
+
* (used by `agents sync`). Returns an empty array for unsupported types. Secret
|
|
817
|
+
* values that the provider does not return are emitted as `${ENV}` placeholders.
|
|
818
|
+
*/
|
|
819
|
+
exportResources?(type: ResourceType): Promise<ExportedResource[]>;
|
|
820
|
+
createEnvironment(name: string, decl: EnvironmentDecl, mode?: ProviderResourceMode): Promise<RemoteResource>;
|
|
821
|
+
updateEnvironment(id: string, name: string, decl: EnvironmentDecl, mode?: ProviderResourceMode): Promise<RemoteResource>;
|
|
822
|
+
deleteEnvironment(id: string, cascade?: boolean, mode?: ProviderResourceMode): Promise<void>;
|
|
823
|
+
createVault(name: string, decl: VaultDecl, mode?: ProviderResourceMode): Promise<RemoteResource>;
|
|
824
|
+
deleteVault(id: string, mode?: ProviderResourceMode): Promise<void>;
|
|
825
|
+
createCredential?(vaultId: string, credential: CredentialDecl): Promise<RemoteResource>;
|
|
826
|
+
listCredentials?(vaultId: string): Promise<VaultCredentialInfo[]>;
|
|
827
|
+
createSkill(name: string, decl: SkillDecl, files: SkillFile[], mode?: ProviderResourceMode): Promise<RemoteResource>;
|
|
828
|
+
updateSkill(id: string, name: string, decl: SkillDecl, files: SkillFile[], mode?: ProviderResourceMode): Promise<RemoteResource>;
|
|
829
|
+
deleteSkill(id: string, mode?: ProviderResourceMode): Promise<void>;
|
|
830
|
+
createAgent(name: string, decl: AgentDecl, refs: ResolvedAgentRefs): Promise<RemoteResource>;
|
|
831
|
+
updateAgent(id: string, name: string, decl: AgentDecl, refs: ResolvedAgentRefs): Promise<RemoteResource>;
|
|
832
|
+
deleteAgent(id: string): Promise<void>;
|
|
833
|
+
createTemplate?(name: string, decl: AgentDecl, refs: ResolvedTemplateRefs): Promise<RemoteResource>;
|
|
834
|
+
updateTemplate?(id: string, name: string, decl: AgentDecl, refs: ResolvedTemplateRefs): Promise<RemoteResource>;
|
|
835
|
+
/** Remove the template from desired state. Qoder implements this as a soft archive. */
|
|
836
|
+
archiveTemplate?(id: string, ownedMemoryStoreIds?: string[]): Promise<void>;
|
|
837
|
+
reconcileDefaultMemoryStore?(identityId: string, templateId: string, desired: DefaultMemoryStoreDecl): Promise<DefaultMemoryStoreReconcileResult>;
|
|
838
|
+
findDefaultMemoryStoreId?(identityId: string, templateId: string): Promise<string | null>;
|
|
839
|
+
deleteDefaultMemoryStore?(id: string): Promise<void>;
|
|
840
|
+
createIdentity?(name: string, decl: IdentityDecl): Promise<RemoteResource>;
|
|
841
|
+
updateIdentity?(id: string, name: string, decl: IdentityDecl): Promise<RemoteResource>;
|
|
842
|
+
deleteIdentity?(id: string): Promise<void>;
|
|
843
|
+
createChannel?(name: string, decl: ChannelDecl, refs: ResolvedChannelRefs): Promise<RemoteResource>;
|
|
844
|
+
updateChannel?(id: string, name: string, decl: ChannelDecl, refs: ResolvedChannelRefs): Promise<RemoteResource>;
|
|
845
|
+
deleteChannel?(id: string): Promise<void>;
|
|
846
|
+
createMemoryStore?(name: string, decl: MemoryStoreDecl, mode?: ProviderResourceMode): Promise<RemoteResource>;
|
|
847
|
+
deleteMemoryStore?(id: string, mode?: ProviderResourceMode): Promise<void>;
|
|
848
|
+
listMemoryStores?(options?: MemoryStoreListOptions): Promise<MemoryPage<MemoryStoreInfo>>;
|
|
849
|
+
getMemoryStore?(id: string): Promise<MemoryStoreInfo>;
|
|
850
|
+
updateMemoryStore?(id: string, input: UpdateMemoryStoreInput, mode?: ProviderResourceMode): Promise<MemoryStoreInfo>;
|
|
851
|
+
archiveMemoryStore?(id: string): Promise<MemoryStoreInfo>;
|
|
852
|
+
createMemory?(storeId: string, input: CreateMemoryInput, mode?: ProviderResourceMode): Promise<MemoryInfo>;
|
|
853
|
+
batchCreateMemories?(storeId: string, input: BatchCreateMemoryInput): Promise<BatchCreateMemoryResult>;
|
|
854
|
+
listMemories?(storeId: string, options?: MemoryListOptions, mode?: ProviderResourceMode): Promise<MemoryPage<MemoryListItem>>;
|
|
855
|
+
getMemory?(storeId: string, memoryId: string): Promise<MemoryInfo>;
|
|
856
|
+
updateMemory?(storeId: string, memoryId: string, input: UpdateMemoryInput, mode?: ProviderResourceMode): Promise<MemoryInfo>;
|
|
857
|
+
deleteMemory?(storeId: string, memoryId: string, expectedContentSha256?: string): Promise<void>;
|
|
858
|
+
listMemoryVersions?(storeId: string, options?: MemoryVersionListOptions): Promise<MemoryPage<MemoryVersionInfo>>;
|
|
859
|
+
getMemoryVersion?(storeId: string, versionId: string): Promise<MemoryVersionInfo>;
|
|
860
|
+
redactMemoryVersion?(storeId: string, versionId: string): Promise<MemoryVersionInfo>;
|
|
861
|
+
createDeployment(name: string, decl: DeploymentDecl, refs: ResolvedDeploymentRefs, basePath: string): Promise<RemoteResource>;
|
|
862
|
+
updateDeployment(id: string, name: string, decl: DeploymentDecl, refs: ResolvedDeploymentRefs, basePath: string, preparedFiles?: ReadonlyMap<string, string>): Promise<RemoteResource>;
|
|
863
|
+
deleteDeployment(id: string): Promise<void>;
|
|
864
|
+
runDeployment(ctx: DeploymentContext): Promise<DeploymentRunResult>;
|
|
865
|
+
getDeployment(ctx: DeploymentContext): Promise<DeploymentInfo>;
|
|
866
|
+
listDeployments?(filter?: DeploymentListFilter): Promise<DeploymentListResult>;
|
|
867
|
+
getDeploymentById?(id: string): Promise<DeploymentInfo>;
|
|
868
|
+
runDeploymentById?(id: string): Promise<DeploymentRunResult>;
|
|
869
|
+
pauseDeploymentById?(id: string): Promise<DeploymentInfo>;
|
|
870
|
+
unpauseDeploymentById?(id: string): Promise<DeploymentInfo>;
|
|
871
|
+
listDeploymentRuns?(deploymentId: string, options?: CursorListOptions): Promise<DeploymentRunPage>;
|
|
872
|
+
getDeploymentRun?(runId: string): Promise<DeploymentRunInfo>;
|
|
873
|
+
pauseDeployment?(ctx: DeploymentContext): Promise<DeploymentInfo>;
|
|
874
|
+
unpauseDeployment?(ctx: DeploymentContext): Promise<DeploymentInfo>;
|
|
875
|
+
uploadFile(filePath: string, options?: {
|
|
876
|
+
name?: string;
|
|
877
|
+
purpose?: string;
|
|
878
|
+
}, mode?: ProviderResourceMode): Promise<ProviderFileInfo>;
|
|
879
|
+
/** Upload from in-memory content (no filesystem), for server contexts that receive bytes directly (e.g. webui browser uploads). */
|
|
880
|
+
uploadFileContent(content: Uint8Array, filename: string, options?: {
|
|
881
|
+
mimeType?: string;
|
|
882
|
+
purpose?: string;
|
|
883
|
+
}): Promise<ProviderFileInfo>;
|
|
884
|
+
deleteFile(id: string, mode?: ProviderResourceMode): Promise<void>;
|
|
885
|
+
/** Fetch a single file's metadata (incl. scan `status`); used to gate session binding on availability. */
|
|
886
|
+
getFileInfo?(id: string): Promise<ProviderFileInfo>;
|
|
887
|
+
/**
|
|
888
|
+
* Resolve a short-lived presigned download URL for a file (e.g. an agent-delivered artifact).
|
|
889
|
+
* Optional — only providers with a content/download endpoint implement it (qoder GET
|
|
890
|
+
* /files/{id}/content). Callers fetch it on demand so the URL never goes stale in the UI.
|
|
891
|
+
*/
|
|
892
|
+
getFileDownloadUrl?(id: string): Promise<{
|
|
893
|
+
url: string;
|
|
894
|
+
expires_at?: string;
|
|
895
|
+
}>;
|
|
896
|
+
/** List workspace user-uploaded files (newest first). Optional — only providers with a list API implement it. */
|
|
897
|
+
listFiles?(): Promise<ProviderFileInfo[]>;
|
|
898
|
+
listFileResources?(options?: FileListOptions): Promise<FilePage>;
|
|
899
|
+
downloadFileContent?(id: string): Promise<Uint8Array>;
|
|
900
|
+
/**
|
|
901
|
+
* List skills (newest first). `source` selects the catalog: "custom" (workspace-uploaded, the
|
|
902
|
+
* default) or "official" (the provider's built-in catalog). Optional — only providers with a
|
|
903
|
+
* list API implement it.
|
|
904
|
+
*/
|
|
905
|
+
listSkills?(source?: "custom" | "official"): Promise<ProviderSkillInfo[]>;
|
|
906
|
+
listSkillResources?(options?: SkillListOptions): Promise<SkillPage>;
|
|
907
|
+
/** Fetch a single skill's metadata (incl. scan `status`); used to poll create → active. */
|
|
908
|
+
getSkillInfo?(id: string): Promise<ProviderSkillInfo>;
|
|
909
|
+
listSkillVersions?(id: string, options?: SkillVersionListOptions): Promise<SkillVersionPage>;
|
|
910
|
+
getSkillVersion?(id: string, version: string): Promise<SkillVersionInfo>;
|
|
911
|
+
getSkillDownloadInfo?(id: string, version: string): Promise<SkillDownloadInfo>;
|
|
912
|
+
/**
|
|
913
|
+
* Create a skill from an already-uploaded zip's file_id and return immediately with the
|
|
914
|
+
* initial (usually `checking`) status. NON-blocking — unlike `createSkill`, it does NOT wait
|
|
915
|
+
* for the security scan. The webui polls `getSkillInfo` until `active`.
|
|
916
|
+
*/
|
|
917
|
+
createSkillFromFileId?(fileId: string): Promise<ProviderSkillInfo>;
|
|
918
|
+
createSession(bindings: SessionBindings): Promise<ProviderSessionInfo>;
|
|
919
|
+
listSessions(filter?: SessionFilter): Promise<SessionListResult>;
|
|
920
|
+
getSession(id: string): Promise<ProviderSessionInfo>;
|
|
921
|
+
updateSession?(id: string, input: SessionUpdateInput): Promise<ProviderSessionInfo>;
|
|
922
|
+
archiveSession?(id: string): Promise<ProviderSessionInfo>;
|
|
923
|
+
deleteSession(id: string): Promise<void>;
|
|
924
|
+
sendSessionMessage(sessionId: string, message: string): Promise<string | undefined>;
|
|
925
|
+
sendSessionEvents?(sessionId: string, events: SessionEventInput[]): Promise<SessionEventSendResult>;
|
|
926
|
+
streamSessionEvents(sessionId: string, options?: EventStreamOptions): AsyncIterable<ProviderSessionEvent>;
|
|
927
|
+
listSessionEvents(sessionId: string, options?: EventListOptions): Promise<ProviderSessionEventList>;
|
|
928
|
+
listModels?(): Promise<ModelInfo[]>;
|
|
929
|
+
/**
|
|
930
|
+
* Download all remote skills and return their extracted file content.
|
|
931
|
+
* Used by `agents sync` to materialize skill sources locally.
|
|
932
|
+
* Returns a map of skill name → extracted SkillFile[].
|
|
933
|
+
*/
|
|
934
|
+
downloadAllSkillFiles?(): Promise<Map<string, SkillFile[]>>;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
interface IStateManager {
|
|
938
|
+
getResource(address: ResourceAddress): ResourceState | undefined;
|
|
939
|
+
setResource(resource: ResourceState): void;
|
|
940
|
+
removeResource(address: ResourceAddress): void;
|
|
941
|
+
listResources(): ResourceState[];
|
|
942
|
+
findResource(query: {
|
|
943
|
+
type: string;
|
|
944
|
+
name: string;
|
|
945
|
+
provider?: string;
|
|
946
|
+
}): ResourceState | undefined;
|
|
947
|
+
getStateFile(): StateFile;
|
|
948
|
+
save(): Promise<void>;
|
|
949
|
+
}
|
|
950
|
+
declare class StateManager implements IStateManager {
|
|
951
|
+
private state;
|
|
952
|
+
private path;
|
|
953
|
+
private index;
|
|
954
|
+
private constructor();
|
|
955
|
+
private buildIndex;
|
|
956
|
+
static load(path: string): Promise<StateManager>;
|
|
957
|
+
static initialize(path: string): StateManager;
|
|
958
|
+
getResource(address: ResourceAddress): ResourceState | undefined;
|
|
959
|
+
setResource(resource: ResourceState): void;
|
|
960
|
+
removeResource(address: ResourceAddress): void;
|
|
961
|
+
listResources(): ResourceState[];
|
|
962
|
+
findResource(query: {
|
|
963
|
+
type: string;
|
|
964
|
+
name: string;
|
|
965
|
+
provider?: string;
|
|
966
|
+
}): ResourceState | undefined;
|
|
967
|
+
getStateFile(): StateFile;
|
|
968
|
+
save(): Promise<void>;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
interface StateScope {
|
|
972
|
+
projectId: string;
|
|
973
|
+
}
|
|
974
|
+
interface StateBackend {
|
|
975
|
+
read<T>(scope: StateScope, fn: (state: IStateManager) => Promise<T> | T): Promise<T>;
|
|
976
|
+
write<T>(scope: StateScope, fn: (state: IStateManager) => Promise<T> | T): Promise<T>;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
interface ProjectRuntimeContext {
|
|
980
|
+
configPath?: string;
|
|
981
|
+
statePath?: string;
|
|
982
|
+
projectName: string;
|
|
983
|
+
config: ResolvedProjectConfig;
|
|
984
|
+
state: IStateManager;
|
|
985
|
+
providers: Map<string, ProviderAdapter>;
|
|
986
|
+
}
|
|
987
|
+
interface CreateRuntimeInput {
|
|
988
|
+
projectName: string;
|
|
989
|
+
config: ResolvedProjectConfig;
|
|
990
|
+
state: IStateManager;
|
|
991
|
+
configPath?: string;
|
|
992
|
+
providers?: Record<string, unknown>;
|
|
993
|
+
}
|
|
994
|
+
interface BackendRuntimeInput {
|
|
995
|
+
projectName: string;
|
|
996
|
+
config: ResolvedProjectConfig;
|
|
997
|
+
stateBackend: StateBackend;
|
|
998
|
+
stateScope: StateScope;
|
|
999
|
+
configPath?: string;
|
|
1000
|
+
providers?: Record<string, unknown>;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Context-first entry point: create a ProjectRuntimeContext from pre-resolved objects.
|
|
1004
|
+
* No file I/O is performed — the caller is responsible for loading and resolving config.
|
|
1005
|
+
*/
|
|
1006
|
+
declare function createProjectRuntime(input: CreateRuntimeInput): ProjectRuntimeContext;
|
|
1007
|
+
declare function readProjectRuntime<T>(input: BackendRuntimeInput, fn: (ctx: ProjectRuntimeContext) => Promise<T> | T): Promise<T>;
|
|
1008
|
+
declare function writeProjectRuntime<T>(input: BackendRuntimeInput, fn: (ctx: ProjectRuntimeContext) => Promise<T> | T): Promise<T>;
|
|
1009
|
+
|
|
1010
|
+
interface ResolveProjectConfigOptions {
|
|
1011
|
+
/** Override the derived project name (defaults to the config file's parent directory). */
|
|
1012
|
+
projectName?: string;
|
|
1013
|
+
/** Expand `${env:...}` references while loading (defaults to true). */
|
|
1014
|
+
resolveEnv?: boolean;
|
|
1015
|
+
/** Project-local fallback values; the process environment takes precedence. Never mutates process.env. */
|
|
1016
|
+
environment?: Record<string, string>;
|
|
1017
|
+
}
|
|
1018
|
+
interface LoadedProjectConfig {
|
|
1019
|
+
configPath: string;
|
|
1020
|
+
projectName: string;
|
|
1021
|
+
config: ResolvedProjectConfig;
|
|
1022
|
+
/** Root config and local files/directories that influence the resolved project. */
|
|
1023
|
+
sourcePaths: string[];
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Shared config-resolution spine for every host: load the config file, raise
|
|
1027
|
+
* configuration errors as a UserError, then resolve file references. Interfaces
|
|
1028
|
+
* call this instead of re-implementing the load-and-resolve sequence.
|
|
1029
|
+
*/
|
|
1030
|
+
declare function resolveProjectConfig(filePath: string, options?: ResolveProjectConfigOptions): Promise<LoadedProjectConfig>;
|
|
1031
|
+
interface ResolveProjectConfigFromObjectOptions {
|
|
1032
|
+
/** Project name to stamp onto the resolved config. */
|
|
1033
|
+
projectName: string;
|
|
1034
|
+
/** Base path used to resolve any `file:` references (defaults to process.cwd()). */
|
|
1035
|
+
basePath?: string;
|
|
1036
|
+
/** Resolve `${ENV_VAR}` references recursively before schema validation. */
|
|
1037
|
+
resolveEnv?: boolean;
|
|
1038
|
+
/** Project-local fallback values; the process environment takes precedence. */
|
|
1039
|
+
environment?: Record<string, string>;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Object-level twin of {@link resolveProjectConfig}: validate an in-memory config
|
|
1043
|
+
* object through the same zod schema and file-reference resolution instead of
|
|
1044
|
+
* reading from disk. Hosts that assemble config from env + code (rather than a
|
|
1045
|
+
* yaml file) use this so they don't bypass SDK invariants like the `_resolved` marker.
|
|
1046
|
+
*/
|
|
1047
|
+
declare function resolveProjectConfigFromObject(rawConfig: unknown, options: ResolveProjectConfigFromObjectOptions): Promise<LoadedProjectConfig>;
|
|
1048
|
+
|
|
1049
|
+
interface ExecutionPlan {
|
|
1050
|
+
actions: PlannedAction[];
|
|
1051
|
+
diagnostics: Diagnostic[];
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
type RuntimeFeedbackLevel = "info" | "success" | "warning" | "error";
|
|
1055
|
+
type RuntimeFeedbackType = "resource_action_success" | "resource_action_failed" | "resource_already_gone" | "resource_adopted" | "refresh_resource_missing" | "refresh_drift_unchecked" | "refresh_resource_failed" | "provider_wait";
|
|
1056
|
+
interface RuntimeFeedbackEvent {
|
|
1057
|
+
type: RuntimeFeedbackType;
|
|
1058
|
+
level: RuntimeFeedbackLevel;
|
|
1059
|
+
message: string;
|
|
1060
|
+
action?: PlannedAction;
|
|
1061
|
+
resource?: ResourceAddress;
|
|
1062
|
+
}
|
|
1063
|
+
type RuntimeFeedbackSink = (event: RuntimeFeedbackEvent) => void;
|
|
1064
|
+
|
|
1065
|
+
interface ResourceRuntimeOptions extends DestructiveDecisionOptions {
|
|
1066
|
+
provider?: string;
|
|
1067
|
+
scope?: ResourcePlanScope;
|
|
1068
|
+
mode?: ResourceSyncMode;
|
|
1069
|
+
refresh?: boolean;
|
|
1070
|
+
refreshOnly?: boolean;
|
|
1071
|
+
quiet?: boolean;
|
|
1072
|
+
onFeedback?: RuntimeFeedbackSink;
|
|
1073
|
+
concurrency?: number;
|
|
1074
|
+
}
|
|
1075
|
+
type ResourceSyncMode = "reconcile" | "create-only";
|
|
1076
|
+
interface ResourcePlanScope {
|
|
1077
|
+
roots: ResourceAddress[];
|
|
1078
|
+
includeDependencies?: boolean;
|
|
1079
|
+
}
|
|
1080
|
+
interface ResourceRefreshResult {
|
|
1081
|
+
removed: ResourceState[];
|
|
1082
|
+
errors: Array<{
|
|
1083
|
+
resource: ResourceState;
|
|
1084
|
+
error: string;
|
|
1085
|
+
}>;
|
|
1086
|
+
}
|
|
1087
|
+
interface ResourceActionResult {
|
|
1088
|
+
action: PlannedAction;
|
|
1089
|
+
status: "success" | "failed" | "skipped";
|
|
1090
|
+
error?: string;
|
|
1091
|
+
}
|
|
1092
|
+
interface ResourceExecutionResult {
|
|
1093
|
+
results: ResourceActionResult[];
|
|
1094
|
+
partial: boolean;
|
|
1095
|
+
}
|
|
1096
|
+
interface ResourcePlanResult {
|
|
1097
|
+
executionContext: ProjectRuntimeContext;
|
|
1098
|
+
plan: ExecutionPlan;
|
|
1099
|
+
refreshResult?: ResourceRefreshResult;
|
|
1100
|
+
targetProviders?: string[];
|
|
1101
|
+
destructiveActions: PlannedAction[];
|
|
1102
|
+
selectedAddresses?: ResourceAddress[];
|
|
1103
|
+
mode?: ResourceSyncMode;
|
|
1104
|
+
}
|
|
1105
|
+
type DestructivePolicy = "block" | "prompt" | "force";
|
|
1106
|
+
interface DestructiveDecisionOptions {
|
|
1107
|
+
policy?: DestructivePolicy;
|
|
1108
|
+
confirm?: (actions: PlannedAction[]) => boolean | Promise<boolean>;
|
|
1109
|
+
}
|
|
1110
|
+
interface ResourceSyncRun {
|
|
1111
|
+
planned: ResourcePlanResult;
|
|
1112
|
+
execution?: ResourceExecutionResult;
|
|
1113
|
+
}
|
|
1114
|
+
declare function planProjectWithStateBackend(input: BackendRuntimeInput, options?: ResourceRuntimeOptions): Promise<ResourcePlanResult>;
|
|
1115
|
+
declare function syncProjectResourcesWithStateBackend(input: BackendRuntimeInput, options?: ResourceRuntimeOptions): Promise<ResourceSyncRun>;
|
|
1116
|
+
declare function importResource(ctx: ProjectRuntimeContext, address: ResourceAddress, remoteId: string, options?: {
|
|
1117
|
+
resourceVersion?: number;
|
|
1118
|
+
}): Promise<ResourceState>;
|
|
1119
|
+
declare function planProjectContext(ctx: ProjectRuntimeContext, options?: ResourceRuntimeOptions): Promise<ResourcePlanResult>;
|
|
1120
|
+
declare function executePlannedProject(planned: ResourcePlanResult, options?: DestructiveDecisionOptions & {
|
|
1121
|
+
onFeedback?: RuntimeFeedbackSink;
|
|
1122
|
+
concurrency?: number;
|
|
1123
|
+
}): Promise<ResourceExecutionResult>;
|
|
1124
|
+
declare function decideDestructive(destructiveActions: PlannedAction[], options?: DestructiveDecisionOptions): Promise<"proceed" | "blocked" | "cancelled">;
|
|
1125
|
+
|
|
1126
|
+
export { type SkillDecl as $, type AgentVersionListOptions as A, type BackendRuntimeInput as B, type ProviderAdapter as C, type DeploymentContext as D, type EnvironmentListOptions as E, type FileListOptions as F, type MemoryStoreInfo as G, type BatchCreateMemoryInput as H, type BatchCreateMemoryResult as I, type CreateMemoryInput as J, type MemoryInfo as K, type CreateMemoryStoreInput as L, type ManagedAgentProviderCapabilities as M, type MemoryProviderCapabilities as N, type MemoryVersionInfo as O, type ProjectConfig as P, type MemoryListOptions as Q, type ResolvedProjectConfig as R, type SkillFile as S, type MemoryPage as T, type MemoryListItem as U, type VaultListOptions as V, type MemoryStoreListOptions as W, type MemoryVersionListOptions as X, type UpdateMemoryInput as Y, type UpdateMemoryStoreInput as Z, type AgentDecl as _, type ProjectRuntimeContext as a, type ResourcePlanResult as a0, type ResourceSyncMode as a1, type DestructivePolicy as a2, type EnvironmentDecl as a3, type RemoteResource as a4, type VaultDecl as a5, type SessionResourceDecl as a6, type SessionFilter as a7, type SessionBindings as a8, type SessionGithubRepositoryResource as a9, importResource as aA, planProjectContext as aB, planProjectWithStateBackend as aC, readProjectRuntime as aD, resolveProjectConfig as aE, resolveProjectConfigFromObject as aF, syncProjectResourcesWithStateBackend as aG, writeProjectRuntime as aH, type StateBackend as aa, type StateScope as ab, type IStateManager as ac, type CredentialDecl as ad, type CredentialInjectionLocation as ae, type CredentialNetworking as af, type CursorListOptions as ag, type CursorPage as ah, type DeploymentDecl as ai, type LoadedProjectConfig as aj, type ManagedAgentOperationAuth as ak, type ManagedAgentOperationCapability as al, type MemoryPrefixInfo as am, type ResourceActionResult as an, type ResourceExecutionResult as ao, type ResourcePlanScope as ap, type ResourceRefreshResult as aq, type ResourceRuntimeOptions as ar, type ResourceSyncRun as as, type RuntimeFeedbackEvent as at, type SessionListResult as au, StateManager as av, type VaultCredentialInfo as aw, createProjectRuntime as ax, decideDestructive as ay, executePlannedProject as az, type DeploymentRunResult as b, type DeploymentInfo as c, type DeploymentListFilter as d, type DeploymentListResult as e, type ResourceState as f, type ProviderSessionInfo as g, type DeploymentRunInfo as h, type ProviderSkillInfo as i, type SkillDownloadInfo as j, type SkillVersionInfo as k, type AgentPage as l, type AgentListOptions as m, type DeploymentRunPage as n, type EnvironmentPage as o, type FilePage as p, type SkillVersionListOptions as q, type SkillVersionPage as r, type SkillListOptions as s, type SkillPage as t, type VaultPage as u, type SessionEventInput as v, type SessionEventSendResult as w, type SessionUpdateInput as x, type RuntimeFeedbackSink as y, type ModelInfo as z };
|