@cadenya/cadenya 0.81.0 → 0.84.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 (103) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +8 -17
  3. package/client.d.mts +9 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +9 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/account.d.mts +3 -1
  13. package/resources/account.d.mts.map +1 -1
  14. package/resources/account.d.ts +3 -1
  15. package/resources/account.d.ts.map +1 -1
  16. package/resources/account.js.map +1 -1
  17. package/resources/account.mjs.map +1 -1
  18. package/resources/ai-provider-keys.d.mts +142 -0
  19. package/resources/ai-provider-keys.d.mts.map +1 -0
  20. package/resources/ai-provider-keys.d.ts +142 -0
  21. package/resources/ai-provider-keys.d.ts.map +1 -0
  22. package/resources/ai-provider-keys.js +51 -0
  23. package/resources/ai-provider-keys.js.map +1 -0
  24. package/resources/ai-provider-keys.mjs +47 -0
  25. package/resources/ai-provider-keys.mjs.map +1 -0
  26. package/resources/index.d.mts +5 -4
  27. package/resources/index.d.mts.map +1 -1
  28. package/resources/index.d.ts +5 -4
  29. package/resources/index.d.ts.map +1 -1
  30. package/resources/index.js +3 -1
  31. package/resources/index.js.map +1 -1
  32. package/resources/index.mjs +1 -0
  33. package/resources/index.mjs.map +1 -1
  34. package/resources/models.d.mts +63 -1
  35. package/resources/models.d.mts.map +1 -1
  36. package/resources/models.d.ts +63 -1
  37. package/resources/models.d.ts.map +1 -1
  38. package/resources/models.js +10 -0
  39. package/resources/models.js.map +1 -1
  40. package/resources/models.mjs +10 -0
  41. package/resources/models.mjs.map +1 -1
  42. package/resources/objectives/index.d.mts +1 -1
  43. package/resources/objectives/index.d.mts.map +1 -1
  44. package/resources/objectives/index.d.ts +1 -1
  45. package/resources/objectives/index.d.ts.map +1 -1
  46. package/resources/objectives/index.js.map +1 -1
  47. package/resources/objectives/index.mjs.map +1 -1
  48. package/resources/objectives/objectives.d.mts +149 -98
  49. package/resources/objectives/objectives.d.mts.map +1 -1
  50. package/resources/objectives/objectives.d.ts +149 -98
  51. package/resources/objectives/objectives.d.ts.map +1 -1
  52. package/resources/objectives/objectives.js +3 -3
  53. package/resources/objectives/objectives.js.map +1 -1
  54. package/resources/objectives/objectives.mjs +3 -3
  55. package/resources/objectives/objectives.mjs.map +1 -1
  56. package/resources/objectives/tool-calls.d.mts +1 -1
  57. package/resources/objectives/tool-calls.d.mts.map +1 -1
  58. package/resources/objectives/tool-calls.d.ts +1 -1
  59. package/resources/objectives/tool-calls.d.ts.map +1 -1
  60. package/resources/objectives/tool-calls.js +2 -2
  61. package/resources/objectives/tool-calls.js.map +1 -1
  62. package/resources/objectives/tool-calls.mjs +2 -2
  63. package/resources/objectives/tool-calls.mjs.map +1 -1
  64. package/resources/workspace-admin/index.d.mts +2 -1
  65. package/resources/workspace-admin/index.d.mts.map +1 -1
  66. package/resources/workspace-admin/index.d.ts +2 -1
  67. package/resources/workspace-admin/index.d.ts.map +1 -1
  68. package/resources/workspace-admin/index.js +3 -1
  69. package/resources/workspace-admin/index.js.map +1 -1
  70. package/resources/workspace-admin/index.mjs +1 -0
  71. package/resources/workspace-admin/index.mjs.map +1 -1
  72. package/resources/workspace-admin/profiles.d.mts +32 -0
  73. package/resources/workspace-admin/profiles.d.mts.map +1 -0
  74. package/resources/workspace-admin/profiles.d.ts +32 -0
  75. package/resources/workspace-admin/profiles.d.ts.map +1 -0
  76. package/resources/workspace-admin/profiles.js +28 -0
  77. package/resources/workspace-admin/profiles.js.map +1 -0
  78. package/resources/workspace-admin/profiles.mjs +24 -0
  79. package/resources/workspace-admin/profiles.mjs.map +1 -0
  80. package/resources/workspace-admin/workspace-admin.d.mts +47 -1
  81. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -1
  82. package/resources/workspace-admin/workspace-admin.d.ts +47 -1
  83. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -1
  84. package/resources/workspace-admin/workspace-admin.js +10 -0
  85. package/resources/workspace-admin/workspace-admin.js.map +1 -1
  86. package/resources/workspace-admin/workspace-admin.mjs +10 -0
  87. package/resources/workspace-admin/workspace-admin.mjs.map +1 -1
  88. package/src/client.ts +35 -6
  89. package/src/resources/account.ts +4 -1
  90. package/src/resources/ai-provider-keys.ts +216 -0
  91. package/src/resources/index.ts +17 -3
  92. package/src/resources/models.ts +80 -0
  93. package/src/resources/objectives/index.ts +2 -3
  94. package/src/resources/objectives/objectives.ts +171 -120
  95. package/src/resources/objectives/tool-calls.ts +11 -11
  96. package/src/resources/workspace-admin/index.ts +2 -0
  97. package/src/resources/workspace-admin/profiles.ts +45 -0
  98. package/src/resources/workspace-admin/workspace-admin.ts +60 -0
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -5,6 +5,7 @@ import * as ObjectivesAPI from './objectives';
5
5
  import * as AccountAPI from '../account';
6
6
  import * as Shared from '../shared';
7
7
  import * as AgentsAPI from '../agents/agents';
8
+ import * as SchedulesAPI from '../agents/schedules';
8
9
  import * as VariationsAPI from '../agents/variations';
9
10
  import * as FeedbackAPI from './feedback';
10
11
  import {
@@ -89,7 +90,7 @@ export class Objectives extends APIResource {
89
90
  options?: RequestOptions,
90
91
  ): APIPromise<Objective> {
91
92
  const { workspaceId, ...body } = params;
92
- return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/cancel`, {
93
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}:cancel`, {
93
94
  body,
94
95
  ...options,
95
96
  });
@@ -105,7 +106,7 @@ export class Objectives extends APIResource {
105
106
  options?: RequestOptions,
106
107
  ): APIPromise<ObjectiveCompactResponse> {
107
108
  const { workspaceId, ...body } = params;
108
- return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/compact`, {
109
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}:compact`, {
109
110
  body,
110
111
  ...options,
111
112
  });
@@ -120,7 +121,7 @@ export class Objectives extends APIResource {
120
121
  options?: RequestOptions,
121
122
  ): APIPromise<ObjectiveContinueResponse> {
122
123
  const { workspaceId, ...body } = params;
123
- return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/continue`, {
124
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}:continue`, {
124
125
  body,
125
126
  ...options,
126
127
  });
@@ -276,8 +277,23 @@ export interface MemoryReference {
276
277
  memoryLayerId?: string;
277
278
  }
278
279
 
280
+ /**
281
+ * Objective is the data for an objective. It contains the snapshotted fields for
282
+ * the selected agent and variation. Secrets are returned only with their names,
283
+ * and the output definition is copied from the agent's configuration.
284
+ */
279
285
  export interface Objective {
280
- data: ObjectiveData;
286
+ /**
287
+ * ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
288
+ * and (when applicable) schedule that an objective was started with.
289
+ */
290
+ configSnapshot: ObjectiveConfigSnapshot;
291
+
292
+ /**
293
+ * The initial message sent to the agent. This becomes the first user message in
294
+ * the LLM chat history.
295
+ */
296
+ initialMessage: string;
281
297
 
282
298
  /**
283
299
  * Metadata for ephemeral operations and activities (e.g., objectives, executions,
@@ -285,7 +301,27 @@ export interface Objective {
285
301
  */
286
302
  metadata: Shared.OperationMetadata;
287
303
 
288
- status: ObjectiveStatus;
304
+ /**
305
+ * The current lifecycle state of the objective.
306
+ */
307
+ state:
308
+ | 'STATE_UNSPECIFIED'
309
+ | 'STATE_PENDING'
310
+ | 'STATE_RUNNING'
311
+ | 'STATE_WAITING'
312
+ | 'STATE_FAILED'
313
+ | 'STATE_CANCELLED'
314
+ | 'STATE_FINALIZED';
315
+
316
+ /**
317
+ * system_prompt is read-only, derived from the selected variation's prompt
318
+ */
319
+ systemPrompt: string;
320
+
321
+ /**
322
+ * Arbitrary data for the objective
323
+ */
324
+ data?: { [key: string]: unknown };
289
325
 
290
326
  /**
291
327
  * ObjectiveInfo provides read-only aggregated statistics about an objective's
@@ -294,11 +330,69 @@ export interface Objective {
294
330
  info?: ObjectiveInfo;
295
331
 
296
332
  /**
297
- * Read-only list of the last five windows of execution for this objective, ordered
298
- * by most recent first. Is only included in singular RPC calls (GetObjective, for
299
- * example).
333
+ * Memory layers/entries to push onto this objective's memory stack on top of the
334
+ * baseline stack inherited from the selected variation.
335
+ *
336
+ * Array order is push order: the first element sits lower in the objective's
337
+ * contribution to the stack; the LAST element ends up on top of the effective
338
+ * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
339
+ * position.
340
+ *
341
+ * System-managed layers (e.g., episodic) cannot be referenced here; they attach
342
+ * themselves automatically based on episodic_key.
343
+ *
344
+ * Stack size cap: the TOTAL effective stack (variation's memory layers
345
+ *
346
+ * - this field) must not exceed 10 entries. A request that would produce an
347
+ * effective stack larger than 10 is rejected with InvalidArgument.
348
+ */
349
+ memoryStack?: Array<MemoryReference>;
350
+
351
+ /**
352
+ * The output of the objective, populated when the objective completes. Will match
353
+ * the schema of output_json_schema or output_json_inferred. This will only be set
354
+ * if the state of the objective is set to STATE_FINALIZED
355
+ */
356
+ output?: { [key: string]: unknown };
357
+
358
+ /**
359
+ * A parent objective means the objective was spawned off using a separate agent to
360
+ * complete an objective
361
+ */
362
+ parentObjectiveId?: string;
363
+
364
+ /**
365
+ * Secrets that can be used in the headers for tool calls using the secret
366
+ * interpolation format.
367
+ */
368
+ secrets?: Array<ObjectiveSecret>;
369
+
370
+ /**
371
+ * Optional human-readable detail about the current state (e.g. a failure reason).
372
+ */
373
+ stateMessage?: string;
374
+ }
375
+
376
+ /**
377
+ * ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
378
+ * and (when applicable) schedule that an objective was started with.
379
+ */
380
+ export interface ObjectiveConfigSnapshot {
381
+ /**
382
+ * Agent resource
383
+ */
384
+ agent?: AgentsAPI.Agent;
385
+
386
+ /**
387
+ * AgentSchedule resource — a recurring trigger attached to an agent that creates
388
+ * objectives on its cadence.
389
+ */
390
+ agentSchedule?: SchedulesAPI.AgentSchedule;
391
+
392
+ /**
393
+ * AgentVariation resource
300
394
  */
301
- lastFiveWindows?: Array<ObjectiveContextWindow>;
395
+ agentVariation?: VariationsAPI.AgentVariation;
302
396
  }
303
397
 
304
398
  /**
@@ -367,91 +461,6 @@ export interface ObjectiveContextWindowData {
367
461
  sequence?: number;
368
462
  }
369
463
 
370
- export interface ObjectiveData {
371
- /**
372
- * Agent resource
373
- */
374
- agent?: AgentsAPI.Agent;
375
-
376
- /**
377
- * Represents a dynamically typed value which can be either null, a number, a
378
- * string, a boolean, a recursive struct value, or a list of values.
379
- */
380
- data?: unknown;
381
-
382
- /**
383
- * The initial message sent to the agent. This becomes the first user message in
384
- * the LLM chat history.
385
- */
386
- initialMessage?: string;
387
-
388
- /**
389
- * Memory layers/entries to push onto this objective's memory stack on top of the
390
- * baseline stack inherited from the selected variation.
391
- *
392
- * Array order is push order: the first element sits lower in the objective's
393
- * contribution to the stack; the LAST element ends up on top of the effective
394
- * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
395
- * position.
396
- *
397
- * System-managed layers (e.g., episodic) cannot be referenced here; they attach
398
- * themselves automatically based on episodic_key.
399
- *
400
- * Stack size cap: the TOTAL effective stack (variation's memory layers
401
- *
402
- * - this field) must not exceed 10 entries. A request that would produce an
403
- * effective stack larger than 10 is rejected with InvalidArgument.
404
- */
405
- memoryStack?: Array<MemoryReference>;
406
-
407
- /**
408
- * The output of the objective, populated when the objective completes. Will match
409
- * the schema of output_json_schema or output_json_inferred.
410
- */
411
- output?: { [key: string]: unknown };
412
-
413
- /**
414
- * Snapshot of the agent spec's output_definition at objective creation time. When
415
- * present, the objective will run an extraction step after the LLM finishes.
416
- */
417
- outputDefinition?: { [key: string]: unknown };
418
-
419
- /**
420
- * A parent objective means the objective was spawned off using a separate agent to
421
- * complete an objective
422
- */
423
- parentObjectiveId?: string;
424
-
425
- /**
426
- * Secrets that can be used in the headers for tool calls using the secret
427
- * interpolation format.
428
- */
429
- secrets?: Array<ObjectiveDataSecret>;
430
-
431
- /**
432
- * ID of the AgentSchedule that produced this objective, when applicable. Populated
433
- * when the objective is created from a schedule fire; empty when the objective was
434
- * created via CreateObjective directly.
435
- */
436
- sourceScheduleId?: string;
437
-
438
- /**
439
- * system_prompt is read-only, derived from the selected variation's prompt
440
- */
441
- systemPrompt?: string;
442
-
443
- /**
444
- * AgentVariation resource
445
- */
446
- variation?: VariationsAPI.AgentVariation;
447
- }
448
-
449
- export interface ObjectiveDataSecret {
450
- name?: string;
451
-
452
- value?: string;
453
- }
454
-
455
464
  export interface ObjectiveError {
456
465
  message?: string;
457
466
 
@@ -622,67 +631,66 @@ export interface ObjectiveInfo {
622
631
  /**
623
632
  * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
624
633
  */
625
- agent?: Shared.ResourceMetadata;
634
+ agent: Shared.ResourceMetadata;
626
635
 
627
636
  /**
628
637
  * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
629
638
  */
630
- agentVariation?: Shared.ResourceMetadata;
639
+ agentVariation: Shared.ResourceMetadata;
631
640
 
632
641
  /**
633
642
  * A profile identifies a user or non-human principal (such as an API key) at the
634
643
  * account level. Profiles are account-scoped and can be granted access to multiple
635
644
  * workspaces.
636
645
  */
637
- createdBy?: AccountAPI.Profile;
646
+ createdBy: AccountAPI.Profile;
647
+
648
+ /**
649
+ * ID of the objective's current (most recent) context window. Hydrated on demand;
650
+ * empty when the objective has not yet produced a context window.
651
+ */
652
+ currentContextWindowId: string;
638
653
 
639
654
  /**
640
655
  * The effective memory stack at objective creation time, flattened from the
641
- * variation's baseline plus ObjectiveData.memory_stack. Order is push order (last
642
- * = top). Returned on reads so clients can see exactly what stack the objective is
656
+ * variation's baseline plus Objective.memory_stack. Order is push order (last =
657
+ * top). Returned on reads so clients can see exactly what stack the objective is
643
658
  * using without having to re-join variation state.
644
659
  */
645
- effectiveMemoryStack?: Array<MemoryReference>;
660
+ effectiveMemoryStack: Array<MemoryReference>;
646
661
 
647
662
  /**
648
663
  * Total number of context windows that this objective has generated
649
664
  */
650
- totalContextWindows?: number;
665
+ totalContextWindows: number;
651
666
 
652
667
  /**
653
668
  * Total number of events generated during this objective's execution
654
669
  */
655
- totalEvents?: number;
670
+ totalEvents: number;
656
671
 
657
672
  /**
658
673
  * Total input tokens consumed across all LLM completions across all context
659
674
  * windows
660
675
  */
661
- totalInputTokens?: number;
676
+ totalInputTokens: number;
677
+
678
+ totalIterations: number;
662
679
 
663
680
  /**
664
681
  * Total output tokens generated across all LLM completions across all context
665
682
  * windows
666
683
  */
667
- totalOutputTokens?: number;
684
+ totalOutputTokens: number;
668
685
 
669
686
  /**
670
687
  * Total number of tool calls made during execution
671
688
  */
672
- totalToolCalls?: number;
689
+ totalToolCalls: number;
673
690
  }
674
691
 
675
- export interface ObjectiveStatus {
676
- state:
677
- | 'STATE_UNSPECIFIED'
678
- | 'STATE_PENDING'
679
- | 'STATE_RUNNING'
680
- | 'STATE_WAITING'
681
- | 'STATE_FAILED'
682
- | 'STATE_CANCELLED'
683
- | 'STATE_FINALIZED';
684
-
685
- message?: string;
692
+ export interface ObjectiveSecret {
693
+ name?: string;
686
694
  }
687
695
 
688
696
  export interface SubAgentSpawned {
@@ -830,7 +838,37 @@ export interface ObjectiveListEventsResponse {
830
838
  export interface ObjectiveCreateParams {
831
839
  agentId: string;
832
840
 
833
- data: ObjectiveData;
841
+ /**
842
+ * Arbitrary data for the objective. May be used in liquid templates for prompts
843
+ * configured on the agent variation
844
+ */
845
+ data: { [key: string]: unknown };
846
+
847
+ /**
848
+ * Optional override for initial message sent to the agent. This becomes the first
849
+ * user message in the LLM chat history. The agent variation is used to set this if
850
+ * not present.
851
+ */
852
+ initialMessage?: string;
853
+
854
+ /**
855
+ * Memory layers/entries to push onto this objective's memory stack on top of the
856
+ * baseline stack inherited from the selected variation.
857
+ *
858
+ * Array order is push order: the first element sits lower in the objective's
859
+ * contribution to the stack; the LAST element ends up on top of the effective
860
+ * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
861
+ * position.
862
+ *
863
+ * System-managed layers (e.g., episodic) cannot be referenced here; they attach
864
+ * themselves automatically based on episodic_key.
865
+ *
866
+ * Stack size cap: the TOTAL effective stack (variation's memory layers
867
+ *
868
+ * - this field) must not exceed 10 entries. A request that would produce an
869
+ * effective stack larger than 10 is rejected with InvalidArgument.
870
+ */
871
+ memoryStack?: Array<MemoryReference>;
834
872
 
835
873
  /**
836
874
  * CreateOperationMetadata contains the user-provided fields for creating an
@@ -839,6 +877,12 @@ export interface ObjectiveCreateParams {
839
877
  */
840
878
  metadata?: Shared.CreateOperationMetadata;
841
879
 
880
+ /**
881
+ * Secrets that can be used in the headers for tool calls using the secret
882
+ * interpolation format.
883
+ */
884
+ secrets?: Array<ObjectiveCreateParams.Secret>;
885
+
842
886
  /**
843
887
  * Optional explicit variation selection. Overrides the agent's
844
888
  * variation_selection_mode.
@@ -846,6 +890,14 @@ export interface ObjectiveCreateParams {
846
890
  variationId?: string;
847
891
  }
848
892
 
893
+ export namespace ObjectiveCreateParams {
894
+ export interface Secret {
895
+ name?: string;
896
+
897
+ value?: string;
898
+ }
899
+ }
900
+
849
901
  export interface ObjectiveRetrieveParams {
850
902
  workspaceId: string;
851
903
  }
@@ -1004,16 +1056,15 @@ export declare namespace Objectives {
1004
1056
  type MemoryRead as MemoryRead,
1005
1057
  type MemoryReference as MemoryReference,
1006
1058
  type Objective as Objective,
1059
+ type ObjectiveConfigSnapshot as ObjectiveConfigSnapshot,
1007
1060
  type ObjectiveContextWindow as ObjectiveContextWindow,
1008
1061
  type ObjectiveContextWindowData as ObjectiveContextWindowData,
1009
- type ObjectiveData as ObjectiveData,
1010
- type ObjectiveDataSecret as ObjectiveDataSecret,
1011
1062
  type ObjectiveError as ObjectiveError,
1012
1063
  type ObjectiveEventData as ObjectiveEventData,
1013
1064
  type ObjectiveEventInfo as ObjectiveEventInfo,
1014
1065
  type ObjectiveEventWebhookData as ObjectiveEventWebhookData,
1015
1066
  type ObjectiveInfo as ObjectiveInfo,
1016
- type ObjectiveStatus as ObjectiveStatus,
1067
+ type ObjectiveSecret as ObjectiveSecret,
1017
1068
  type SubAgentSpawned as SubAgentSpawned,
1018
1069
  type SubAgentUpdated as SubAgentUpdated,
1019
1070
  type ToolApprovalRequested as ToolApprovalRequested,
@@ -36,8 +36,8 @@ export class ToolCalls extends APIResource {
36
36
  options?: RequestOptions,
37
37
  ): APIPromise<ObjectiveToolCall> {
38
38
  const { workspaceId, objectiveId, ...body } = params;
39
- return this._client.put(
40
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/approve`,
39
+ return this._client.post(
40
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:approve`,
41
41
  { body, ...options },
42
42
  );
43
43
  }
@@ -53,8 +53,8 @@ export class ToolCalls extends APIResource {
53
53
  options?: RequestOptions,
54
54
  ): APIPromise<ObjectiveToolCall> {
55
55
  const { workspaceId, objectiveId, ...body } = params;
56
- return this._client.put(
57
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/deny`,
56
+ return this._client.post(
57
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:deny`,
58
58
  { body, ...options },
59
59
  );
60
60
  }
@@ -70,6 +70,13 @@ export type ObjectiveToolCallsCursorPagination = CursorPagination<ObjectiveToolC
70
70
  export interface ObjectiveToolCall {
71
71
  data: ObjectiveToolCallData;
72
72
 
73
+ executionStatus:
74
+ | 'TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED'
75
+ | 'TOOL_CALL_EXECUTION_STATUS_PENDING'
76
+ | 'TOOL_CALL_EXECUTION_STATUS_RUNNING'
77
+ | 'TOOL_CALL_EXECUTION_STATUS_COMPLETED'
78
+ | 'TOOL_CALL_EXECUTION_STATUS_ERRORED';
79
+
73
80
  /**
74
81
  * Metadata for ephemeral operations and activities (e.g., objectives, executions,
75
82
  * runs)
@@ -86,13 +93,6 @@ export interface ObjectiveToolCall {
86
93
  | 'TOOL_CALL_STATUS_APPROVED'
87
94
  | 'TOOL_CALL_STATUS_DENIED';
88
95
 
89
- executionStatus?:
90
- | 'TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED'
91
- | 'TOOL_CALL_EXECUTION_STATUS_PENDING'
92
- | 'TOOL_CALL_EXECUTION_STATUS_RUNNING'
93
- | 'TOOL_CALL_EXECUTION_STATUS_COMPLETED'
94
- | 'TOOL_CALL_EXECUTION_STATUS_ERRORED';
95
-
96
96
  info?: ObjectiveToolCallInfo;
97
97
  }
98
98
 
@@ -1,10 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export { Members, type MemberListParams, type MemberAddParams, type MemberRemoveParams } from './members';
4
+ export { Profiles, type ProfileListParams } from './profiles';
4
5
  export {
5
6
  WorkspaceAdmin,
6
7
  type WorkspaceMember,
7
8
  type WorkspaceAdminCreateParams,
9
+ type WorkspaceAdminUpdateParams,
8
10
  type WorkspaceAdminListParams,
9
11
  type WorkspaceMembersCursorPagination,
10
12
  } from './workspace-admin';
@@ -0,0 +1,45 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as AccountAPI from '../account';
5
+ import { ProfilesCursorPagination } from '../account';
6
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+
9
+ /**
10
+ * Administer workspaces across the account: create and archive workspaces and
11
+ * manage their membership. These operations are account-scoped and require the
12
+ * admin role (a token whose profile holds the WorkOS admin role); they live
13
+ * under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
14
+ * tree so an admin can manage any workspace in the account, including ones they
15
+ * are not themselves a member of.
16
+ */
17
+ export class Profiles extends APIResource {
18
+ /**
19
+ * Searches the account's profiles for a member picker, with free-form name/email
20
+ * search and an optional type filter. Account-scoped; admin only.
21
+ */
22
+ list(
23
+ query: ProfileListParams | null | undefined = {},
24
+ options?: RequestOptions,
25
+ ): PagePromise<ProfilesCursorPagination, AccountAPI.Profile> {
26
+ return this._client.getAPIList('/v1/account/profiles', CursorPagination<AccountAPI.Profile>, {
27
+ query,
28
+ ...options,
29
+ });
30
+ }
31
+ }
32
+
33
+ export interface ProfileListParams extends CursorPaginationParams {
34
+ /**
35
+ * Free-form search over profile name and email. Case-insensitive substring match;
36
+ * empty returns all profiles.
37
+ */
38
+ query?: string;
39
+ }
40
+
41
+ export declare namespace Profiles {
42
+ export { type ProfileListParams as ProfileListParams };
43
+ }
44
+
45
+ export { type ProfilesCursorPagination };
@@ -5,6 +5,8 @@ import * as WorkspacesAPI from '../workspaces';
5
5
  import { WorkspacesCursorPagination } from '../workspaces';
6
6
  import * as MembersAPI from './members';
7
7
  import { MemberAddParams, MemberListParams, MemberRemoveParams, Members } from './members';
8
+ import * as ProfilesAPI from './profiles';
9
+ import { ProfileListParams, Profiles } from './profiles';
8
10
  import { APIPromise } from '../../core/api-promise';
9
11
  import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
10
12
  import { buildHeaders } from '../../internal/headers';
@@ -21,6 +23,7 @@ import { path } from '../../internal/utils/path';
21
23
  */
22
24
  export class WorkspaceAdmin extends APIResource {
23
25
  members: MembersAPI.Members = new MembersAPI.Members(this._client);
26
+ profiles: ProfilesAPI.Profiles = new ProfilesAPI.Profiles(this._client);
24
27
 
25
28
  /**
26
29
  * Creates a new workspace in the account. Admin only.
@@ -36,6 +39,17 @@ export class WorkspaceAdmin extends APIResource {
36
39
  return this._client.get(path`/v1/account/workspaces/${workspaceID}`, options);
37
40
  }
38
41
 
42
+ /**
43
+ * Updates a workspace's metadata (e.g. name) and spec. Admin only.
44
+ */
45
+ update(
46
+ workspaceID: string,
47
+ body: WorkspaceAdminUpdateParams,
48
+ options?: RequestOptions,
49
+ ): APIPromise<WorkspacesAPI.Workspace> {
50
+ return this._client.patch(path`/v1/account/workspaces/${workspaceID}`, { body, ...options });
51
+ }
52
+
39
53
  /**
40
54
  * Lists every workspace in the account, optionally including archived ones. Admin
41
55
  * only.
@@ -134,6 +148,48 @@ export namespace WorkspaceAdminCreateParams {
134
148
  }
135
149
  }
136
150
 
151
+ export interface WorkspaceAdminUpdateParams {
152
+ /**
153
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
154
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
155
+ * excluded since they are set by the server.
156
+ */
157
+ metadata?: WorkspaceAdminUpdateParams.Metadata;
158
+
159
+ spec?: WorkspacesAPI.WorkspaceSpec;
160
+
161
+ /**
162
+ * Fields to update.
163
+ */
164
+ updateMask?: string;
165
+ }
166
+
167
+ export namespace WorkspaceAdminUpdateParams {
168
+ /**
169
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
170
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
171
+ * excluded since they are set by the server.
172
+ */
173
+ export interface Metadata {
174
+ /**
175
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
176
+ * Workspace")
177
+ */
178
+ name: string;
179
+
180
+ /**
181
+ * External ID for the resource (e.g., a workflow ID from an external system)
182
+ */
183
+ externalId?: string;
184
+
185
+ /**
186
+ * Arbitrary key-value pairs for categorization and filtering Examples:
187
+ * {"environment": "production", "team": "platform", "version": "v2"}
188
+ */
189
+ labels?: { [key: string]: string };
190
+ }
191
+ }
192
+
137
193
  export interface WorkspaceAdminListParams extends CursorPaginationParams {
138
194
  /**
139
195
  * When true, archived workspaces are included in the results. Defaults to false
@@ -143,11 +199,13 @@ export interface WorkspaceAdminListParams extends CursorPaginationParams {
143
199
  }
144
200
 
145
201
  WorkspaceAdmin.Members = Members;
202
+ WorkspaceAdmin.Profiles = Profiles;
146
203
 
147
204
  export declare namespace WorkspaceAdmin {
148
205
  export {
149
206
  type WorkspaceMember as WorkspaceMember,
150
207
  type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams,
208
+ type WorkspaceAdminUpdateParams as WorkspaceAdminUpdateParams,
151
209
  type WorkspaceAdminListParams as WorkspaceAdminListParams,
152
210
  };
153
211
 
@@ -157,6 +215,8 @@ export declare namespace WorkspaceAdmin {
157
215
  type MemberAddParams as MemberAddParams,
158
216
  type MemberRemoveParams as MemberRemoveParams,
159
217
  };
218
+
219
+ export { Profiles as Profiles, type ProfileListParams as ProfileListParams };
160
220
  }
161
221
 
162
222
  export { type WorkspacesCursorPagination };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.81.0'; // x-release-please-version
1
+ export const VERSION = '0.84.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.81.0";
1
+ export declare const VERSION = "0.84.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.81.0";
1
+ export declare const VERSION = "0.84.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.81.0'; // x-release-please-version
4
+ exports.VERSION = '0.84.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.81.0'; // x-release-please-version
1
+ export const VERSION = '0.84.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map