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