@agents24/node 0.2.0 → 0.3.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.
Files changed (54) hide show
  1. package/README.md +17 -4
  2. package/compatibility.json +10 -10
  3. package/dist/bff.cjs +202 -33
  4. package/dist/bff.cjs.map +1 -1
  5. package/dist/bff.d.cts +3 -2
  6. package/dist/bff.d.ts +3 -2
  7. package/dist/bff.js +202 -33
  8. package/dist/bff.js.map +1 -1
  9. package/dist/{client-6MWalxux.d.cts → client-Rmk3dh_D.d.cts} +437 -71
  10. package/dist/{client-6MWalxux.d.ts → client-Rmk3dh_D.d.ts} +437 -71
  11. package/dist/index.cjs +194 -45
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +3 -3
  14. package/dist/index.d.ts +3 -3
  15. package/dist/index.js +194 -45
  16. package/dist/index.js.map +1 -1
  17. package/dist/server.cjs +52 -6
  18. package/dist/server.cjs.map +1 -1
  19. package/dist/server.d.cts +14 -2
  20. package/dist/server.d.ts +14 -2
  21. package/dist/server.js +50 -7
  22. package/dist/server.js.map +1 -1
  23. package/dist/types/agents.d.ts +5 -4
  24. package/dist/types/agents.d.ts.map +1 -1
  25. package/dist/types/bff.d.ts +2 -1
  26. package/dist/types/bff.d.ts.map +1 -1
  27. package/dist/types/builders.d.ts +2 -0
  28. package/dist/types/builders.d.ts.map +1 -1
  29. package/dist/types/client-runtime-admin.d.ts +1 -1
  30. package/dist/types/client.d.ts +4 -0
  31. package/dist/types/client.d.ts.map +1 -1
  32. package/dist/types/embed.d.ts +6 -3
  33. package/dist/types/embed.d.ts.map +1 -1
  34. package/dist/types/errors.d.ts +10 -2
  35. package/dist/types/errors.d.ts.map +1 -1
  36. package/dist/types/generated/instructions.d.ts +8 -0
  37. package/dist/types/generated/instructions.d.ts.map +1 -0
  38. package/dist/types/generated/manifest.d.ts +1 -1
  39. package/dist/types/generated/manifest.d.ts.map +1 -1
  40. package/dist/types/generated/resourceBundles.d.ts +4 -1
  41. package/dist/types/generated/resourceBundles.d.ts.map +1 -1
  42. package/dist/types/generated/resourcePolicies.d.ts +14 -0
  43. package/dist/types/generated/resourcePolicies.d.ts.map +1 -0
  44. package/dist/types/http.d.ts +0 -2
  45. package/dist/types/http.d.ts.map +1 -1
  46. package/dist/types/index.d.ts +1 -1
  47. package/dist/types/index.d.ts.map +1 -1
  48. package/dist/types/runs.d.ts +4 -2
  49. package/dist/types/runs.d.ts.map +1 -1
  50. package/dist/types/server.d.ts +13 -1
  51. package/dist/types/server.d.ts.map +1 -1
  52. package/dist/types/types.d.ts +389 -60
  53. package/dist/types/types.d.ts.map +1 -1
  54. package/package.json +2 -2
@@ -1,11 +1,9 @@
1
1
  import type { Agents24SDKErrorKind } from "./errors.js";
2
- import type { ActiveThreadRun, Attachment, AttachmentUploadResult, ContextCompression, ContextWindow, ContextWindowConfidence, ContextWindowSource, ContextWindowStage, ContextWindowTracker, PublicResponseBlock, RunCancelResult, RunContext, RunResumeResult, RuntimeEvent, ThreadDeleteResult, ThreadDetail, ThreadSummary, ThreadSummaryEvent, ThreadTurn, ThreadsResponse, ToolInputOverrides } from "@agents24/client/protocol";
3
- export type { ActiveThreadRun, Attachment, AttachmentUploadResult, ContextCompression, ContextWindow, ContextWindowConfidence, ContextWindowSource, ContextWindowStage, ContextWindowTracker, PublicResponseBlock as ResponseBlock, RunCancelResult, RunContext, RunResumeResult, RuntimeEvent, ThreadDeleteResult, ThreadDetail, ThreadSummary, ThreadSummaryEvent, ThreadTurn, ThreadsResponse, ToolInputOverrides, };
2
+ import type { ActiveThreadRun, Attachment, AttachmentContentAccess, AttachmentUploadResult, ContextCompression, ContextWindow, ContextWindowConfidence, ContextWindowSource, ContextWindowStage, ContextWindowTracker, PublicResponseBlock, RunCancelResult, RunContext, RunResumeResult, RuntimeEvent, ThreadDeleteResult, ThreadDetail, ThreadSummary, ThreadSummaryEvent, ThreadTurn, ThreadsResponse, ToolInputOverrides } from "@agents24/client/protocol";
3
+ export type { ActiveThreadRun, Attachment, AttachmentContentAccess, AttachmentUploadResult, ContextCompression, ContextWindow, ContextWindowConfidence, ContextWindowSource, ContextWindowStage, ContextWindowTracker, PublicResponseBlock as ResponseBlock, RunCancelResult, RunContext, RunResumeResult, RuntimeEvent, ThreadDeleteResult, ThreadDetail, ThreadSummary, ThreadSummaryEvent, ThreadTurn, ThreadsResponse, ToolInputOverrides, };
4
4
  export type Agents24NodeOptions = {
5
5
  baseUrl: string;
6
6
  apiKey: string;
7
- organizationId: string;
8
- projectId: string;
9
7
  fetchImpl?: typeof fetch;
10
8
  };
11
9
  /** @deprecated Use Agents24NodeOptions. */
@@ -54,6 +52,7 @@ export type EmbedStreamRequest = {
54
52
  requested_model_id?: string;
55
53
  requested_model_node_id?: string;
56
54
  external_user_id: string;
55
+ external_user_issuer?: string;
57
56
  external_session_id?: string;
58
57
  metadata?: Record<string, unknown>;
59
58
  client?: Record<string, unknown>;
@@ -63,13 +62,40 @@ export type AttachRunRequest = {
63
62
  external_session_id?: string;
64
63
  metadata?: Record<string, unknown>;
65
64
  client?: Record<string, unknown>;
65
+ cursor?: number;
66
+ };
67
+ export type FeedbackRating = "like" | "dislike";
68
+ export type FeedbackReason = "incorrect" | "irrelevant" | "incomplete" | "unsafe" | "citation_issue" | "other";
69
+ export type ResponseFeedback = {
70
+ rating: FeedbackRating;
71
+ reason: FeedbackReason | null;
72
+ comment: string | null;
73
+ created_at: string;
74
+ updated_at: string;
75
+ };
76
+ export type ResponseFeedbackResult = {
77
+ run_id: string;
78
+ feedback: ResponseFeedback | null;
79
+ };
80
+ export type EmbeddedResponseFeedbackInput = {
81
+ external_user_id: string;
82
+ external_session_id?: string;
83
+ rating: FeedbackRating | null;
84
+ reason?: FeedbackReason | null;
85
+ comment?: string | null;
86
+ };
87
+ export type HitlAction = "approve" | "reject" | "connect" | "skip" | "respond";
88
+ export type HitlAnswer = {
89
+ question_id: string;
90
+ selected_option_ids: string[];
91
+ custom_text?: string;
66
92
  };
67
- export type HitlAction = "approve" | "reject" | "connect" | "skip";
68
93
  export type ResumeRunRequest = AttachRunRequest & {
69
94
  schema_version: "agents24.hitl.resume.v2";
70
95
  interrupt_id: string;
71
96
  action: HitlAction;
72
97
  comment?: string;
98
+ answers?: HitlAnswer[];
73
99
  };
74
100
  export type McpAuthStartRequest = AttachRunRequest & {
75
101
  interrupt_id: string;
@@ -85,7 +111,7 @@ export type EmbedRuntimeBootstrap = {
85
111
  agent_name?: string;
86
112
  agent_version_id?: string;
87
113
  agent_version_number?: number;
88
- model_selector?: Record<string, unknown> | null;
114
+ features: Record<string, unknown>;
89
115
  thread_events_path?: string | null;
90
116
  thread_events_url?: string | null;
91
117
  };
@@ -107,7 +133,6 @@ export type ThreadDetailOptions = {
107
133
  externalSessionId?: string;
108
134
  beforeTurnIndex?: number;
109
135
  limit?: number;
110
- includeRunEvents?: boolean;
111
136
  includeSubthreads?: boolean;
112
137
  subthreadDepth?: number;
113
138
  subthreadTurnLimit?: number;
@@ -141,13 +166,46 @@ export type MultiAgentThreadSummaryEventOptions = ThreadSummaryEventOptions & {
141
166
  };
142
167
  export type ServerAttachmentUploadOptions = {
143
168
  threadId?: string;
169
+ agentVersionId?: string;
144
170
  files: File[];
145
171
  idempotencyKey?: string;
146
172
  };
173
+ export type AttachmentContentAccessRequest = {
174
+ disposition: "inline" | "attachment";
175
+ };
176
+ export type EmbedAttachmentContentAccessRequest = AttachmentContentAccessRequest & {
177
+ external_user_id: string;
178
+ external_session_id?: string | null;
179
+ };
147
180
  export type ServerEmbedAttachmentUploadOptions = ServerAttachmentUploadOptions & {
148
181
  externalUserId: string;
149
182
  externalSessionId?: string;
150
183
  };
184
+ export type GraphValueRef = {
185
+ namespace: "workflow_input" | "state" | "node_output";
186
+ key: string;
187
+ node_id?: string;
188
+ expected_type?: "string" | "number" | "boolean" | "object" | "list" | "unknown";
189
+ label?: string;
190
+ };
191
+ export type WorkflowInputDefinition = {
192
+ key: string;
193
+ type: "string" | "number" | "boolean" | "object" | "list";
194
+ required?: boolean;
195
+ enabled?: boolean;
196
+ label?: string;
197
+ description?: string;
198
+ semantic_type?: string;
199
+ readonly?: boolean;
200
+ derived?: boolean;
201
+ };
202
+ export type StateVariableDefinition = {
203
+ key: string;
204
+ type: "string" | "number" | "boolean" | "object" | "list";
205
+ description?: string;
206
+ schema?: Record<string, unknown>;
207
+ default_value?: unknown;
208
+ };
151
209
  export type GraphNode = {
152
210
  id: string;
153
211
  type: string;
@@ -158,71 +216,164 @@ export type GraphNode = {
158
216
  config: Record<string, unknown>;
159
217
  label?: string;
160
218
  data?: Record<string, unknown>;
161
- input_mappings?: Record<string, unknown>;
219
+ input_mappings?: Record<string, string>;
162
220
  };
163
221
  export type GraphEdge = {
164
222
  id: string;
165
223
  source: string;
166
224
  target: string;
167
- type?: string;
225
+ type?: "control" | "data";
168
226
  source_handle?: string;
169
227
  target_handle?: string;
170
228
  label?: string;
171
- condition?: Record<string, unknown>;
229
+ condition?: string;
172
230
  };
173
231
  export type GraphDefinition = {
174
- spec_version?: string;
175
- graph_type?: "agent";
176
- workflow_contract?: Record<string, unknown>;
177
- state_contract?: Record<string, unknown>;
232
+ spec_version: "4.0";
233
+ graph_type: "agent";
234
+ workflow_contract: {
235
+ inputs: WorkflowInputDefinition[];
236
+ };
237
+ state_contract: {
238
+ variables: StateVariableDefinition[];
239
+ };
240
+ prompt_version_policies?: Record<string, unknown>;
178
241
  nodes: GraphNode[];
179
242
  edges: GraphEdge[];
243
+ metadata?: Record<string, unknown>;
244
+ };
245
+ export type NodeCatalogItem = {
246
+ type: string;
247
+ title: string;
248
+ description?: string | null;
249
+ category: string;
250
+ input_type: string;
251
+ output_type: string;
252
+ required_config_fields: string[];
253
+ icon?: string | null;
254
+ color?: string | null;
255
+ editor?: string | null;
256
+ };
257
+ export type BranchingHint = {
258
+ kind: string;
259
+ field?: string | null;
260
+ id_key?: string | null;
261
+ label_key?: string | null;
262
+ static_handles: string[];
263
+ default_handles: string[];
264
+ };
265
+ export type GraphHints = {
266
+ editor: string;
267
+ branching?: BranchingHint | null;
268
+ };
269
+ export type NodeAuthoringSpec = {
270
+ type: string;
271
+ title: string;
272
+ description?: string | null;
273
+ category: string;
274
+ input_type: string;
275
+ output_type: string;
276
+ config_schema: Record<string, unknown>;
277
+ input_schema?: Record<string, unknown> | null;
278
+ output_schema?: Record<string, unknown> | null;
279
+ field_contracts?: Record<string, unknown> | null;
280
+ graph_hints?: GraphHints | null;
281
+ node_template?: GraphNode | null;
282
+ normalization_defaults: Record<string, unknown>;
283
+ };
284
+ export type NodeCatalogResponse = {
285
+ nodes: NodeCatalogItem[];
286
+ };
287
+ export type NodeSchemaResponse = {
288
+ specs: Record<string, NodeAuthoringSpec>;
289
+ unknown: string[];
290
+ instance_contract: Record<string, unknown>;
291
+ };
292
+ export type AgentValidationIssue = {
293
+ code: string;
294
+ message: string;
295
+ severity: "error" | "warning";
296
+ node_id?: string | null;
297
+ edge_id?: string | null;
298
+ path?: string | null;
299
+ expected?: unknown;
300
+ actual?: unknown;
301
+ repair_hint?: string | null;
302
+ };
303
+ export type AgentValidationResult = {
304
+ valid: boolean;
305
+ errors: AgentValidationIssue[];
306
+ warnings: AgentValidationIssue[];
180
307
  };
181
308
  export type AgentCreateRequest = {
182
309
  name: string;
183
310
  description?: string | null;
311
+ tags?: string[];
184
312
  graph_definition: GraphDefinition;
185
313
  memory_config?: Record<string, unknown>;
186
314
  execution_constraints?: Record<string, unknown>;
187
315
  };
188
- export type AgentUpdateRequest = Partial<AgentCreateRequest> & {
189
- status?: string;
190
- is_active?: boolean;
191
- };
192
- export type AgentResponse = {
316
+ export type AgentUpdateRequest = Partial<AgentCreateRequest>;
317
+ export type AgentSummary = {
193
318
  id: string;
194
319
  organization_id: string;
195
- project_id?: string | null;
196
320
  name: string;
197
321
  description?: string | null;
198
- graph_definition: GraphDefinition;
199
- memory_config: Record<string, unknown>;
200
- execution_constraints: Record<string, unknown>;
201
- status: string;
202
- version: number;
203
- is_active: boolean;
322
+ tags: string[];
323
+ lifecycle_status: "active" | "deprecated" | "archived" | "disabled";
324
+ publication_state: "never_published" | "published";
325
+ draft_revision_number: number;
204
326
  is_public: boolean;
205
327
  show_in_playground: boolean;
206
- default_embed_policy_set_id?: string | null;
328
+ share_enabled: boolean;
329
+ share_handle?: string | null;
330
+ share_url?: string | null;
331
+ share_theme: "soft" | "sharp";
332
+ share_client_deployment_id?: string | null;
333
+ resource_policy_set_id?: string | null;
334
+ tool_binding_status?: string | null;
335
+ is_tool_enabled: boolean;
207
336
  created_at: string;
208
337
  updated_at: string;
209
338
  published_at?: string | null;
210
339
  latest_published_version_id?: string | null;
211
340
  has_unpublished_changes: boolean;
212
341
  };
342
+ export type AgentResponse = AgentSummary & {
343
+ graph_definition: GraphDefinition;
344
+ memory_config: Record<string, unknown>;
345
+ execution_constraints: Record<string, unknown>;
346
+ attached_tools: Array<Record<string, unknown>>;
347
+ };
213
348
  export type AgentListResponse = {
214
- items: AgentResponse[];
349
+ items: Array<AgentSummary | AgentResponse>;
215
350
  total: number;
351
+ has_more: boolean;
352
+ skip: number;
353
+ limit: number;
354
+ view: "summary" | "full";
216
355
  };
217
356
  export type StartRunResult = {
218
357
  run_id: string;
219
358
  thread_id?: string | null;
220
359
  };
360
+ export type FailureCategory = "validation" | "authentication" | "authorization" | "not_found" | "policy" | "conflict" | "billing" | "quota" | "rate_limit" | "capacity" | "dependency" | "protocol" | "timeout" | "internal";
361
+ export type FailureView = {
362
+ schema_version: "agents24.failure.v1";
363
+ failure_id: string;
364
+ code: string;
365
+ category: FailureCategory;
366
+ message: string;
367
+ retryable: boolean;
368
+ request_id: string | null;
369
+ retry_after_ms: number | null;
370
+ details: Record<string, unknown>;
371
+ };
221
372
  export type RunStatus = {
222
373
  id: string;
223
374
  status: string;
224
375
  result?: unknown;
225
- error?: string | null;
376
+ failure?: FailureView | null;
226
377
  checkpoint?: Record<string, unknown> | null;
227
378
  run_usage?: Record<string, unknown>;
228
379
  context_window?: ContextWindow | null;
@@ -234,12 +385,51 @@ export type ControlPlaneRunEventsResponse = {
234
385
  events: RuntimeEvent[];
235
386
  [key: string]: unknown;
236
387
  };
237
- export type RunTrace = {
238
- run: RunStatus;
239
- tree: Record<string, unknown>;
240
- events: ControlPlaneRunEventsResponse;
241
- context: RunContext;
388
+ export type TraceSpanKind = "run" | "workflow_node" | "agent" | "model" | "tool";
389
+ export type TraceSpanStatus = "running" | "waiting" | "succeeded" | "failed" | "cancelled" | "skipped";
390
+ export type TraceContent = {
391
+ type: "messages" | "message" | "text" | "json";
392
+ value: unknown;
393
+ redacted: boolean;
394
+ truncated: boolean;
242
395
  };
396
+ export type TraceError = FailureView;
397
+ export type TraceSpan = {
398
+ id: string;
399
+ span_id: string;
400
+ parent_id?: string | null;
401
+ run_id: string;
402
+ node_id?: string | null;
403
+ model_invocation_id?: string | null;
404
+ name: string;
405
+ kind: TraceSpanKind;
406
+ status: TraceSpanStatus;
407
+ sequence: number;
408
+ input?: TraceContent | null;
409
+ output?: TraceContent | null;
410
+ attributes: Record<string, unknown>;
411
+ diagnostics?: Record<string, unknown> | null;
412
+ failure?: TraceError | null;
413
+ started_at: string;
414
+ ended_at?: string | null;
415
+ duration_ms?: number | null;
416
+ };
417
+ export type TraceView = {
418
+ schema_version?: string | null;
419
+ trace_id: string;
420
+ root_run_id: string;
421
+ focus_run_id: string;
422
+ status: string;
423
+ legacy: boolean;
424
+ raw_events_available: boolean;
425
+ spans: TraceSpan[];
426
+ content_protection: {
427
+ redacted_fields: number;
428
+ truncated_fields: number;
429
+ diagnostics_included: boolean;
430
+ };
431
+ };
432
+ export type RunTrace = TraceView;
243
433
  export type AgentRef = string | {
244
434
  id: string;
245
435
  };
@@ -293,27 +483,16 @@ export type ClientRuntimeOidcConfig = {
293
483
  };
294
484
  export type ClientRuntimePolicyInput = {
295
485
  capabilities?: string[];
296
- model?: {
297
- allow_selection?: boolean;
298
- allowed_model_ids?: string[];
299
- default_model_id?: string | null;
300
- };
301
- tools?: {
302
- allowed_tool_ids?: string[];
303
- allow_input_overrides?: boolean;
304
- allow_side_effecting_anonymous?: boolean;
305
- };
486
+ model_selection?: "auto" | "enabled" | "disabled" | null;
306
487
  attachments?: {
307
488
  enabled?: boolean;
308
- max_files_per_request?: number;
489
+ max_attachments_per_turn?: number;
309
490
  max_file_bytes?: number;
310
491
  max_total_bytes?: number;
311
492
  allowed_mime_types?: string[];
312
493
  max_image_pixels?: number;
313
494
  max_pdf_pages?: number;
314
495
  max_extracted_characters?: number;
315
- retention_seconds?: number;
316
- malware_scan_required?: boolean;
317
496
  };
318
497
  hitl?: {
319
498
  enabled?: boolean;
@@ -321,7 +500,7 @@ export type ClientRuntimePolicyInput = {
321
500
  };
322
501
  mcp?: {
323
502
  enabled?: boolean;
324
- allowed_server_ids?: string[];
503
+ allow_anonymous?: boolean;
325
504
  };
326
505
  quotas?: {
327
506
  session_mints_per_minute?: number;
@@ -338,6 +517,7 @@ export type ClientRuntimePolicyInput = {
338
517
  };
339
518
  export type CreateClientDeploymentRequest = {
340
519
  agent_id: string;
520
+ resource_policy_set_id: string;
341
521
  version_policy?: {
342
522
  mode: "latest_published";
343
523
  } | {
@@ -352,12 +532,13 @@ export type CreateClientDeploymentRequest = {
352
532
  oidc?: ClientRuntimeOidcConfig | null;
353
533
  policy?: ClientRuntimePolicyInput;
354
534
  };
355
- export type UpdateClientDeploymentRequest = Partial<Omit<CreateClientDeploymentRequest, "agent_id">> & {
356
- enabled?: boolean;
535
+ export type UpdateClientDeploymentRequest = Partial<Omit<CreateClientDeploymentRequest, "agent_id" | "resource_policy_set_id">> & {
536
+ resource_policy_set_id?: string | null;
537
+ lifecycle_status?: "active" | "inactive";
357
538
  };
358
539
  export type ClientDeploymentListQuery = {
359
540
  agentId: string;
360
- status?: "active" | "revoked";
541
+ lifecycleStatus?: "active" | "inactive";
361
542
  cursor?: string;
362
543
  limit?: number;
363
544
  };
@@ -379,8 +560,8 @@ export type ClientDeployment = {
379
560
  id: string;
380
561
  client_id: string;
381
562
  organization_id: string;
382
- project_id: string;
383
563
  agent_id: string;
564
+ resource_policy_set_id: string | null;
384
565
  purpose: "client_integration" | "hosted_share";
385
566
  version_policy: {
386
567
  mode: "latest_published";
@@ -394,8 +575,7 @@ export type ClientDeployment = {
394
575
  };
395
576
  name: string;
396
577
  description: string | null;
397
- enabled: boolean;
398
- status: "active" | "revoked";
578
+ lifecycle_status: "active" | "inactive" | "deleted";
399
579
  policy_epoch: number;
400
580
  revocation_epoch: number;
401
581
  auth_modes: ClientAuthMode[];
@@ -407,7 +587,7 @@ export type ClientDeployment = {
407
587
  native_profiles: ClientNativeProfile[];
408
588
  created_at: string;
409
589
  updated_at: string;
410
- revoked_at: string | null;
590
+ deleted_at: string | null;
411
591
  };
412
592
  export type ClientDeploymentListResponse = {
413
593
  items: ClientDeployment[];
@@ -431,7 +611,7 @@ export type ClientSessionCredentials = {
431
611
  refresh_expires_at: string | null;
432
612
  dpop_nonce: string | null;
433
613
  };
434
- export type PortableResourceKind = "agent" | "rag_pipeline" | "instruction";
614
+ export type PortableResourceKind = "agent" | "rag_pipeline" | "instruction" | "knowledge_store";
435
615
  export type ResourceSelector = {
436
616
  kind: PortableResourceKind;
437
617
  id: string;
@@ -439,7 +619,7 @@ export type ResourceSelector = {
439
619
  version_id?: string;
440
620
  };
441
621
  export type ResourcePackageExportRequest = {
442
- root: ResourceSelector;
622
+ selectors: ResourceSelector[];
443
623
  };
444
624
  export type ResourcePackageArchive = {
445
625
  data: Uint8Array;
@@ -460,19 +640,168 @@ export type ResourcePackageCompileResult = {
460
640
  format: "agents24.resource_package";
461
641
  schema_version: "1.0";
462
642
  package: Record<string, unknown>;
463
- entrypoint: string;
464
643
  resources: Array<Record<string, unknown>>;
465
644
  requirements: string[];
466
645
  tool_exports: Array<Record<string, unknown>>;
467
646
  callable_bindings: Array<Record<string, unknown>>;
468
647
  diagnostics: ResourcePackageDiagnostic[];
469
- bundle?: Record<string, unknown> | null;
648
+ bundle?: ResourceBundle | null;
470
649
  };
471
650
  export type ResourceBundleImportRequest = {
472
- bundle: Record<string, unknown>;
651
+ bundle: ResourceBundle;
473
652
  selected_resource_keys?: string[];
474
653
  mappings?: Record<string, string>;
475
654
  };
655
+ export type ResourceBundleOrigin = {
656
+ source_id: string;
657
+ target: "draft" | "version";
658
+ version_id?: string | null;
659
+ label: string;
660
+ };
661
+ export type ResourceBundleResource = {
662
+ resource_key: string;
663
+ kind: PortableResourceKind;
664
+ name: string;
665
+ document: Record<string, unknown>;
666
+ origin?: ResourceBundleOrigin;
667
+ };
668
+ export type ResourceBundleDependency = {
669
+ id: string;
670
+ from_resource_key: string;
671
+ to_resource_key?: string | null;
672
+ kind: string;
673
+ source_id: string;
674
+ source_name?: string | null;
675
+ document_path: string;
676
+ reference_type: string;
677
+ required: boolean;
678
+ bundled: boolean;
679
+ included?: boolean;
680
+ required_capability?: "chat" | "embedding";
681
+ };
682
+ export type ResourceBundle = {
683
+ format: "agents24.resource_bundle";
684
+ schema_version: "1.0";
685
+ exported_at?: string;
686
+ resources: ResourceBundleResource[];
687
+ dependencies: ResourceBundleDependency[];
688
+ warnings: string[];
689
+ tool_exports?: Array<Record<string, unknown>>;
690
+ callable_bindings?: Array<Record<string, unknown>>;
691
+ };
692
+ export type ResourceBundlePlan = Omit<ResourceBundle, "resources"> & {
693
+ resources: Array<Omit<ResourceBundleResource, "document">>;
694
+ blockers: Array<{
695
+ code: string;
696
+ message: string;
697
+ }>;
698
+ can_export: boolean;
699
+ external_references: ResourceBundleDependency[];
700
+ };
701
+ export type ResourceBundleExportRequest = {
702
+ selectors: ResourceSelector[];
703
+ included_resource_keys?: string[];
704
+ };
705
+ export type ResourceBundleCandidateList = {
706
+ items: Array<{
707
+ id: string;
708
+ name: string;
709
+ }>;
710
+ total: number;
711
+ };
712
+ export type ResourceBundleCandidateOptions = {
713
+ kind: string;
714
+ query?: string;
715
+ limit?: number;
716
+ offset?: number;
717
+ requiredCapability?: "chat" | "embedding";
718
+ };
719
+ export type ResourcePolicySummary = {
720
+ id: string;
721
+ name: string;
722
+ is_active: boolean;
723
+ [key: string]: unknown;
724
+ };
725
+ export type ResourcePolicyList = ResourcePolicySummary[];
726
+ export type CustomerIdentityRequest = {
727
+ issuer: string;
728
+ subject: string;
729
+ };
730
+ export type SetCustomerResourcePolicyAssignmentRequest = CustomerIdentityRequest & {
731
+ policy_set_id: string;
732
+ };
733
+ export type EffectiveCustomerResourcePolicyRequest = CustomerIdentityRequest & {
734
+ deployment_id: string;
735
+ };
736
+ export type EmbedResourcePolicyRequest = {
737
+ external_user_id: string;
738
+ external_user_issuer?: string;
739
+ agent_version_id?: string;
740
+ };
741
+ export type ResourcePolicySubjectRef = {
742
+ kind: "agent" | "client_deployment" | "organization_user" | "customer_principal";
743
+ id: string;
744
+ };
745
+ export type ResourcePolicyQuotaSchedule = {
746
+ reset_anchor_at: string | null;
747
+ period_start: string;
748
+ next_reset_at: string;
749
+ };
750
+ export type CustomerResourcePolicyAssignment = {
751
+ customer_principal_ref: string;
752
+ subject_ref: ResourcePolicySubjectRef;
753
+ assignment: {
754
+ id: string;
755
+ policy_set: {
756
+ id: string;
757
+ name: string;
758
+ };
759
+ } | null;
760
+ quota_schedule: ResourcePolicyQuotaSchedule | null;
761
+ };
762
+ export type ClearCustomerResourcePolicyAssignmentResult = {
763
+ customer_principal_ref: string | null;
764
+ cleared: boolean;
765
+ };
766
+ export type EffectiveResourcePolicy = {
767
+ customer_principal_ref: string | null;
768
+ model_selection: {
769
+ selectable: boolean;
770
+ node_id: string | null;
771
+ default_id: string | null;
772
+ options: Array<{
773
+ id: string;
774
+ label: string;
775
+ }>;
776
+ };
777
+ quota_constraints: Array<{
778
+ model: {
779
+ id: string;
780
+ name: string;
781
+ };
782
+ boundary_kind: ResourcePolicySubjectRef["kind"];
783
+ boundary_ref: string;
784
+ used: number;
785
+ reserved: number;
786
+ limit: number;
787
+ remaining: number;
788
+ period_start: string;
789
+ reset_at: string;
790
+ blocked: boolean;
791
+ }>;
792
+ customer_assignment?: CustomerResourcePolicyAssignment;
793
+ };
794
+ export type SetResourcePolicyQuotaScheduleRequest = {
795
+ subject_ref: ResourcePolicySubjectRef;
796
+ reset_anchor_at: string | null;
797
+ };
798
+ export type ResetResourcePolicyQuotaRequest = {
799
+ subject_ref: ResourcePolicySubjectRef;
800
+ };
801
+ export type ResourcePolicyQuotaScheduleResult = {
802
+ subject_ref: ResourcePolicySubjectRef;
803
+ quota_schedule: ResourcePolicyQuotaSchedule;
804
+ };
476
805
  export type ResourceBundleImportPreview = {
477
806
  resources: Array<Record<string, unknown>>;
478
807
  dependencies: Array<Record<string, unknown>>;