@cadenya/cadenya 0.67.0 → 0.69.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 (222) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +28 -67
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +28 -67
  5. package/client.d.ts.map +1 -1
  6. package/client.js +25 -64
  7. package/client.js.map +1 -1
  8. package/client.mjs +25 -64
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/account.d.mts +34 -33
  12. package/resources/account.d.mts.map +1 -1
  13. package/resources/account.d.ts +34 -33
  14. package/resources/account.d.ts.map +1 -1
  15. package/resources/account.js +2 -6
  16. package/resources/account.js.map +1 -1
  17. package/resources/account.mjs +2 -6
  18. package/resources/account.mjs.map +1 -1
  19. package/resources/agents/agents.d.mts +9 -13
  20. package/resources/agents/agents.d.mts.map +1 -1
  21. package/resources/agents/agents.d.ts +9 -13
  22. package/resources/agents/agents.d.ts.map +1 -1
  23. package/resources/agents/agents.js +1 -6
  24. package/resources/agents/agents.js.map +1 -1
  25. package/resources/agents/agents.mjs +1 -6
  26. package/resources/agents/agents.mjs.map +1 -1
  27. package/resources/agents/feedback.d.mts +2 -7
  28. package/resources/agents/feedback.d.mts.map +1 -1
  29. package/resources/agents/feedback.d.ts +2 -7
  30. package/resources/agents/feedback.d.ts.map +1 -1
  31. package/resources/agents/feedback.js +1 -6
  32. package/resources/agents/feedback.js.map +1 -1
  33. package/resources/agents/feedback.mjs +1 -6
  34. package/resources/agents/feedback.mjs.map +1 -1
  35. package/resources/agents/schedules.d.mts +18 -21
  36. package/resources/agents/schedules.d.mts.map +1 -1
  37. package/resources/agents/schedules.d.ts +18 -21
  38. package/resources/agents/schedules.d.ts.map +1 -1
  39. package/resources/agents/schedules.js +2 -6
  40. package/resources/agents/schedules.js.map +1 -1
  41. package/resources/agents/schedules.mjs +2 -6
  42. package/resources/agents/schedules.mjs.map +1 -1
  43. package/resources/agents/variations.d.mts +48 -45
  44. package/resources/agents/variations.d.mts.map +1 -1
  45. package/resources/agents/variations.d.ts +48 -45
  46. package/resources/agents/variations.d.ts.map +1 -1
  47. package/resources/agents/variations.js +3 -0
  48. package/resources/agents/variations.js.map +1 -1
  49. package/resources/agents/variations.mjs +3 -0
  50. package/resources/agents/variations.mjs.map +1 -1
  51. package/resources/agents/webhook-deliveries.d.mts +4 -9
  52. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  53. package/resources/agents/webhook-deliveries.d.ts +4 -9
  54. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  55. package/resources/agents/webhook-deliveries.js +1 -6
  56. package/resources/agents/webhook-deliveries.js.map +1 -1
  57. package/resources/agents/webhook-deliveries.mjs +1 -6
  58. package/resources/agents/webhook-deliveries.mjs.map +1 -1
  59. package/resources/api-keys/access.d.mts +47 -0
  60. package/resources/api-keys/access.d.mts.map +1 -0
  61. package/resources/api-keys/access.d.ts +47 -0
  62. package/resources/api-keys/access.d.ts.map +1 -0
  63. package/resources/api-keys/access.js +41 -0
  64. package/resources/api-keys/access.js.map +1 -0
  65. package/resources/api-keys/access.mjs +37 -0
  66. package/resources/api-keys/access.mjs.map +1 -0
  67. package/resources/api-keys/api-keys.d.mts +213 -0
  68. package/resources/api-keys/api-keys.d.mts.map +1 -0
  69. package/resources/api-keys/api-keys.d.ts +213 -0
  70. package/resources/api-keys/api-keys.d.ts.map +1 -0
  71. package/resources/api-keys/api-keys.js +65 -0
  72. package/resources/api-keys/api-keys.js.map +1 -0
  73. package/resources/api-keys/api-keys.mjs +60 -0
  74. package/resources/api-keys/api-keys.mjs.map +1 -0
  75. package/resources/api-keys/index.d.mts +3 -0
  76. package/resources/api-keys/index.d.mts.map +1 -0
  77. package/resources/api-keys/index.d.ts +3 -0
  78. package/resources/api-keys/index.d.ts.map +1 -0
  79. package/resources/api-keys/index.js +9 -0
  80. package/resources/api-keys/index.js.map +1 -0
  81. package/resources/api-keys/index.mjs +4 -0
  82. package/resources/api-keys/index.mjs.map +1 -0
  83. package/resources/api-keys.d.mts +1 -154
  84. package/resources/api-keys.d.mts.map +1 -1
  85. package/resources/api-keys.d.ts +1 -154
  86. package/resources/api-keys.d.ts.map +1 -1
  87. package/resources/api-keys.js +2 -62
  88. package/resources/api-keys.js.map +1 -1
  89. package/resources/api-keys.mjs +1 -60
  90. package/resources/api-keys.mjs.map +1 -1
  91. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +11 -18
  92. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -1
  93. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +11 -18
  94. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -1
  95. package/resources/bulk-workspace-resources/bulk-workspace-resources.js +3 -8
  96. package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -1
  97. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs +3 -8
  98. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -1
  99. package/resources/bulk-workspace-resources/results.d.mts +23 -32
  100. package/resources/bulk-workspace-resources/results.d.mts.map +1 -1
  101. package/resources/bulk-workspace-resources/results.d.ts +23 -32
  102. package/resources/bulk-workspace-resources/results.d.ts.map +1 -1
  103. package/resources/bulk-workspace-resources/results.js +3 -8
  104. package/resources/bulk-workspace-resources/results.js.map +1 -1
  105. package/resources/bulk-workspace-resources/results.mjs +3 -8
  106. package/resources/bulk-workspace-resources/results.mjs.map +1 -1
  107. package/resources/index.d.mts +2 -2
  108. package/resources/index.d.mts.map +1 -1
  109. package/resources/index.d.ts +2 -2
  110. package/resources/index.d.ts.map +1 -1
  111. package/resources/index.js +1 -1
  112. package/resources/index.js.map +1 -1
  113. package/resources/index.mjs +1 -1
  114. package/resources/index.mjs.map +1 -1
  115. package/resources/memory-layers/entries.d.mts +14 -28
  116. package/resources/memory-layers/entries.d.mts.map +1 -1
  117. package/resources/memory-layers/entries.d.ts +14 -28
  118. package/resources/memory-layers/entries.d.ts.map +1 -1
  119. package/resources/memory-layers/entries.js +4 -10
  120. package/resources/memory-layers/entries.js.map +1 -1
  121. package/resources/memory-layers/entries.mjs +4 -10
  122. package/resources/memory-layers/entries.mjs.map +1 -1
  123. package/resources/memory-layers/memory-layers.d.mts +8 -20
  124. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  125. package/resources/memory-layers/memory-layers.d.ts +8 -20
  126. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  127. package/resources/memory-layers/memory-layers.js +4 -10
  128. package/resources/memory-layers/memory-layers.js.map +1 -1
  129. package/resources/memory-layers/memory-layers.mjs +4 -10
  130. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  131. package/resources/models.d.mts +5 -9
  132. package/resources/models.d.mts.map +1 -1
  133. package/resources/models.d.ts +5 -9
  134. package/resources/models.d.ts.map +1 -1
  135. package/resources/models.js +3 -7
  136. package/resources/models.js.map +1 -1
  137. package/resources/models.mjs +3 -7
  138. package/resources/models.mjs.map +1 -1
  139. package/resources/objectives/feedback.d.mts +5 -5
  140. package/resources/objectives/feedback.d.ts +5 -5
  141. package/resources/objectives/objectives.d.mts +22 -31
  142. package/resources/objectives/objectives.d.mts.map +1 -1
  143. package/resources/objectives/objectives.d.ts +22 -31
  144. package/resources/objectives/objectives.d.ts.map +1 -1
  145. package/resources/objectives/objectives.js.map +1 -1
  146. package/resources/objectives/objectives.mjs.map +1 -1
  147. package/resources/objectives/tasks.d.mts +1 -4
  148. package/resources/objectives/tasks.d.mts.map +1 -1
  149. package/resources/objectives/tasks.d.ts +1 -4
  150. package/resources/objectives/tasks.d.ts.map +1 -1
  151. package/resources/objectives/tool-calls.d.mts +8 -11
  152. package/resources/objectives/tool-calls.d.mts.map +1 -1
  153. package/resources/objectives/tool-calls.d.ts +8 -11
  154. package/resources/objectives/tool-calls.d.ts.map +1 -1
  155. package/resources/objectives/tools.d.mts +1 -1
  156. package/resources/objectives/tools.d.ts +1 -1
  157. package/resources/tool-sets/tool-sets.d.mts +31 -35
  158. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  159. package/resources/tool-sets/tool-sets.d.ts +31 -35
  160. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  161. package/resources/tool-sets/tool-sets.js +4 -8
  162. package/resources/tool-sets/tool-sets.js.map +1 -1
  163. package/resources/tool-sets/tool-sets.mjs +4 -8
  164. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  165. package/resources/tool-sets/tools.d.mts +16 -22
  166. package/resources/tool-sets/tools.d.mts.map +1 -1
  167. package/resources/tool-sets/tools.d.ts +16 -22
  168. package/resources/tool-sets/tools.d.ts.map +1 -1
  169. package/resources/tool-sets/tools.js +4 -8
  170. package/resources/tool-sets/tools.js.map +1 -1
  171. package/resources/tool-sets/tools.mjs +4 -8
  172. package/resources/tool-sets/tools.mjs.map +1 -1
  173. package/resources/uploads.d.mts +13 -17
  174. package/resources/uploads.d.mts.map +1 -1
  175. package/resources/uploads.d.ts +13 -17
  176. package/resources/uploads.d.ts.map +1 -1
  177. package/resources/uploads.js +3 -7
  178. package/resources/uploads.js.map +1 -1
  179. package/resources/uploads.mjs +3 -7
  180. package/resources/uploads.mjs.map +1 -1
  181. package/resources/workspace-secrets.d.mts +7 -7
  182. package/resources/workspace-secrets.d.ts +7 -7
  183. package/resources/workspaces.d.mts +2 -6
  184. package/resources/workspaces.d.mts.map +1 -1
  185. package/resources/workspaces.d.ts +2 -6
  186. package/resources/workspaces.d.ts.map +1 -1
  187. package/resources/workspaces.js +2 -6
  188. package/resources/workspaces.js.map +1 -1
  189. package/resources/workspaces.mjs +2 -6
  190. package/resources/workspaces.mjs.map +1 -1
  191. package/src/client.ts +36 -79
  192. package/src/resources/account.ts +35 -32
  193. package/src/resources/agents/agents.ts +9 -13
  194. package/src/resources/agents/feedback.ts +2 -7
  195. package/src/resources/agents/schedules.ts +18 -21
  196. package/src/resources/agents/variations.ts +48 -45
  197. package/src/resources/agents/webhook-deliveries.ts +4 -9
  198. package/src/resources/api-keys/access.ts +79 -0
  199. package/src/resources/api-keys/api-keys.ts +282 -0
  200. package/src/resources/api-keys/index.ts +13 -0
  201. package/src/resources/api-keys.ts +1 -221
  202. package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +11 -18
  203. package/src/resources/bulk-workspace-resources/results.ts +23 -32
  204. package/src/resources/index.ts +2 -4
  205. package/src/resources/memory-layers/entries.ts +14 -28
  206. package/src/resources/memory-layers/memory-layers.ts +8 -20
  207. package/src/resources/models.ts +5 -9
  208. package/src/resources/objectives/feedback.ts +5 -5
  209. package/src/resources/objectives/objectives.ts +22 -31
  210. package/src/resources/objectives/tasks.ts +1 -4
  211. package/src/resources/objectives/tool-calls.ts +8 -11
  212. package/src/resources/objectives/tools.ts +1 -1
  213. package/src/resources/tool-sets/tool-sets.ts +31 -35
  214. package/src/resources/tool-sets/tools.ts +16 -22
  215. package/src/resources/uploads.ts +13 -17
  216. package/src/resources/workspace-secrets.ts +7 -7
  217. package/src/resources/workspaces.ts +2 -6
  218. package/src/version.ts +1 -1
  219. package/version.d.mts +1 -1
  220. package/version.d.ts +1 -1
  221. package/version.js +1 -1
  222. package/version.mjs +1 -1
@@ -9,6 +9,9 @@ import { buildHeaders } from '../../internal/headers';
9
9
  import { RequestOptions } from '../../internal/request-options';
10
10
  import { path } from '../../internal/utils/path';
11
11
 
12
+ /**
13
+ * Manage variations of an agent and their tool, sub-agent, and memory layer assignments.
14
+ */
12
15
  export class Variations extends APIResource {
13
16
  /**
14
17
  * Creates a new variation for an agent
@@ -189,9 +192,9 @@ export interface AgentVariationInfo {
189
192
  assignments?: Array<VariationAssignment>;
190
193
 
191
194
  /**
192
- * Profile represents a human user at the account level. Profiles are
193
- * account-scoped resources that can be associated with multiple workspaces through
194
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
195
+ * A profile identifies a user or non-human principal (such as an API key) at the
196
+ * account level. Profiles are account-scoped and can be granted access to multiple
197
+ * workspaces.
195
198
  */
196
199
  createdBy?: AccountAPI.Profile;
197
200
 
@@ -402,15 +405,14 @@ export interface CompactionConfigToolResultClearingStrategy {
402
405
  }
403
406
 
404
407
  /**
405
- * VariationAssignment is a read-only reference to a single tool, tool set, or
406
- * sub-agent attached to a variation. Clients read the full set of assignments via
408
+ * A read-only reference to a single tool, tool set, or sub-agent attached to a
409
+ * variation. Read the full set of assignments via
407
410
  * `AgentVariationInfo.assignments`; mutations go through the dedicated add/remove
408
- * assignment endpoints under
409
- * /v1/agents/{agent_id}/variations/{variation_id}/assignments.
411
+ * assignment endpoints.
410
412
  *
411
- * The `id` identifies the assignment row itself (not the referenced resource) and
412
- * is the handle used to remove the assignment. It is returned by the add endpoint
413
- * and present on every entry in AgentVariationInfo.assignments.
413
+ * The `id` identifies the assignment itself (not the referenced resource) and is
414
+ * the handle used to remove the assignment. It is returned by the add endpoint and
415
+ * present on every entry in `AgentVariationInfo.assignments`.
414
416
  */
415
417
  export interface VariationAssignment {
416
418
  id?: string;
@@ -483,7 +485,7 @@ export interface VariationMemoryLayerAssignment {
483
485
 
484
486
  export interface VariationCreateParams {
485
487
  /**
486
- * Path param: Workspace ID (from path).
488
+ * Path param: Workspace ID.
487
489
  */
488
490
  workspaceId: string;
489
491
 
@@ -504,26 +506,26 @@ export interface VariationCreateParams {
504
506
 
505
507
  export interface VariationRetrieveParams {
506
508
  /**
507
- * Workspace ID (from path).
509
+ * Workspace ID.
508
510
  */
509
511
  workspaceId: string;
510
512
 
511
513
  /**
512
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
513
- * form (see common.proto "Path-parameter ID resolution").
514
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
515
+ * form.
514
516
  */
515
517
  agentId: string;
516
518
  }
517
519
 
518
520
  export interface VariationUpdateParams {
519
521
  /**
520
- * Path param: Workspace ID (from path).
522
+ * Path param: Workspace ID.
521
523
  */
522
524
  workspaceId: string;
523
525
 
524
526
  /**
525
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
526
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
527
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
528
+ * `external_id:<value>` form.
527
529
  */
528
530
  agentId: string;
529
531
 
@@ -549,7 +551,7 @@ export interface VariationUpdateParams {
549
551
 
550
552
  export interface VariationListParams extends CursorPaginationParams {
551
553
  /**
552
- * Path param: Workspace ID (from path).
554
+ * Path param: Workspace ID.
553
555
  */
554
556
  workspaceId: string;
555
557
 
@@ -559,7 +561,8 @@ export interface VariationListParams extends CursorPaginationParams {
559
561
  bundleKey?: string;
560
562
 
561
563
  /**
562
- * Query param: When set to true you may use more of your alloted API rate-limit
564
+ * Query param: When true, the `info` field on each returned variation is
565
+ * populated. Requests with this flag count more against your rate limit.
563
566
  */
564
567
  includeInfo?: boolean;
565
568
 
@@ -571,26 +574,26 @@ export interface VariationListParams extends CursorPaginationParams {
571
574
 
572
575
  export interface VariationDeleteParams {
573
576
  /**
574
- * Workspace ID (from path).
577
+ * Workspace ID.
575
578
  */
576
579
  workspaceId: string;
577
580
 
578
581
  /**
579
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
580
- * form (see common.proto "Path-parameter ID resolution").
582
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
583
+ * form.
581
584
  */
582
585
  agentId: string;
583
586
  }
584
587
 
585
588
  export interface VariationAddAssignmentParams {
586
589
  /**
587
- * Path param: Workspace ID (from path).
590
+ * Path param: Workspace ID.
588
591
  */
589
592
  workspaceId: string;
590
593
 
591
594
  /**
592
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
593
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
595
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
596
+ * `external_id:<value>` form.
594
597
  */
595
598
  agentId: string;
596
599
 
@@ -612,19 +615,19 @@ export interface VariationAddAssignmentParams {
612
615
 
613
616
  export interface VariationAddMemoryLayerParams {
614
617
  /**
615
- * Path param: Workspace ID (from path).
618
+ * Path param: Workspace ID.
616
619
  */
617
620
  workspaceId: string;
618
621
 
619
622
  /**
620
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
621
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
623
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
624
+ * `external_id:<value>` form.
622
625
  */
623
626
  agentId: string;
624
627
 
625
628
  /**
626
- * Body param: Layer to attach. Accepts canonical memlyr\_… form or
627
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
629
+ * Body param: Layer to attach. Accepts the canonical `memlyr_…` form or the
630
+ * `external_id:<value>` form.
628
631
  */
629
632
  memoryLayerId?: string;
630
633
 
@@ -637,57 +640,57 @@ export interface VariationAddMemoryLayerParams {
637
640
 
638
641
  export interface VariationRemoveAssignmentParams {
639
642
  /**
640
- * Workspace ID (from path).
643
+ * Workspace ID.
641
644
  */
642
645
  workspaceId: string;
643
646
 
644
647
  /**
645
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
646
- * form (see common.proto "Path-parameter ID resolution").
648
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
649
+ * form.
647
650
  */
648
651
  agentId: string;
649
652
 
650
653
  /**
651
- * Variation ID (from path). Accepts canonical av\_… form or external_id:<value>
652
- * form (see common.proto "Path-parameter ID resolution").
654
+ * Variation ID. Accepts the canonical `av_…` form or the `external_id:<value>`
655
+ * form.
653
656
  */
654
657
  variationId: string;
655
658
  }
656
659
 
657
660
  export interface VariationRemoveMemoryLayerParams {
658
661
  /**
659
- * Workspace ID (from path).
662
+ * Workspace ID.
660
663
  */
661
664
  workspaceId: string;
662
665
 
663
666
  /**
664
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
665
- * form (see common.proto "Path-parameter ID resolution").
667
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
668
+ * form.
666
669
  */
667
670
  agentId: string;
668
671
 
669
672
  /**
670
- * Variation ID (from path). Accepts canonical av\_… form or external_id:<value>
671
- * form (see common.proto "Path-parameter ID resolution").
673
+ * Variation ID. Accepts the canonical `av_…` form or the `external_id:<value>`
674
+ * form.
672
675
  */
673
676
  variationId: string;
674
677
  }
675
678
 
676
679
  export interface VariationUpdateMemoryLayerParams {
677
680
  /**
678
- * Path param: Workspace ID (from path).
681
+ * Path param: Workspace ID.
679
682
  */
680
683
  workspaceId: string;
681
684
 
682
685
  /**
683
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
684
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
686
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
687
+ * `external_id:<value>` form.
685
688
  */
686
689
  agentId: string;
687
690
 
688
691
  /**
689
- * Path param: Variation ID (from path). Accepts canonical av\_… form or
690
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
692
+ * Path param: Variation ID. Accepts the canonical `av_…` form or the
693
+ * `external_id:<value>` form.
691
694
  */
692
695
  variationId: string;
693
696
 
@@ -7,12 +7,7 @@ import { RequestOptions } from '../../internal/request-options';
7
7
  import { path } from '../../internal/utils/path';
8
8
 
9
9
  /**
10
- * AgentService manages AI agents at the WORKSPACE level.
11
- * Agents are workspace-scoped resources that define AI behavior and tool access.
12
- * All operations are implicitly scoped to the workspace determined by the JWT token.
13
- *
14
- * Authentication: Bearer token (JWT)
15
- * Scope: Workspace-level operations
10
+ * Manage AI agents within a workspace. Agents define AI behavior and tool access.
16
11
  */
17
12
  export class WebhookDeliveries extends APIResource {
18
13
  /**
@@ -36,7 +31,7 @@ export type WebhookDeliveriesCursorPagination = CursorPagination<WebhookDelivery
36
31
 
37
32
  export interface WebhookDelivery {
38
33
  /**
39
- * Webhook delivery data
34
+ * Webhook delivery details.
40
35
  */
41
36
  data: WebhookDeliveryData;
42
37
 
@@ -75,7 +70,7 @@ export interface WebhookDeliveryData {
75
70
  | 'OBJECTIVE_EVENT_TYPE_CANCELLED';
76
71
 
77
72
  /**
78
- * Response details (no response_body to avoid storing large payloads)
73
+ * Response details. The response body is not retained.
79
74
  */
80
75
  httpStatusCode: number;
81
76
 
@@ -116,7 +111,7 @@ export interface WebhookDeliveryData {
116
111
 
117
112
  export interface WebhookDeliveryListParams extends CursorPaginationParams {
118
113
  /**
119
- * Path param: Workspace ID (from path).
114
+ * Path param: Workspace ID.
120
115
  */
121
116
  workspaceId: string;
122
117
 
@@ -0,0 +1,79 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as WorkspacesAPI from '../workspaces';
5
+ import { WorkspacesCursorPagination } from '../workspaces';
6
+ import * as APIKeysAPI from './api-keys';
7
+ import { APIPromise } from '../../core/api-promise';
8
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
9
+ import { buildHeaders } from '../../internal/headers';
10
+ import { RequestOptions } from '../../internal/request-options';
11
+ import { path } from '../../internal/utils/path';
12
+
13
+ /**
14
+ * Issue, rotate, and revoke API keys for the account, and grant or revoke
15
+ * each key's access to individual workspaces.
16
+ */
17
+ export class Access extends APIResource {
18
+ /**
19
+ * Lists the workspaces this API key has access to. Cursor-paginated.
20
+ */
21
+ list(
22
+ id: string,
23
+ query: AccessListParams | null | undefined = {},
24
+ options?: RequestOptions,
25
+ ): PagePromise<WorkspacesCursorPagination, WorkspacesAPI.Workspace> {
26
+ return this._client.getAPIList(
27
+ path`/v1/account/api_keys/${id}/workspaces`,
28
+ CursorPagination<WorkspacesAPI.Workspace>,
29
+ { query, ...options },
30
+ );
31
+ }
32
+
33
+ /**
34
+ * Grants this API key access to the specified workspace. Idempotent — adding an
35
+ * already-associated workspace is a no-op. Returns the updated API key with
36
+ * refreshed workspace preview and total.
37
+ */
38
+ add(id: string, body: AccessAddParams, options?: RequestOptions): APIPromise<APIKeysAPI.APIKey> {
39
+ return this._client.post(path`/v1/account/api_keys/${id}/workspaces`, { body, ...options });
40
+ }
41
+
42
+ /**
43
+ * Revokes this API key's access to the specified workspace. Idempotent. A key may
44
+ * have zero workspaces and remains valid.
45
+ */
46
+ remove(workspaceID: string, params: AccessRemoveParams, options?: RequestOptions): APIPromise<void> {
47
+ const { id } = params;
48
+ return this._client.delete(path`/v1/account/api_keys/${id}/workspaces/${workspaceID}`, {
49
+ ...options,
50
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
51
+ });
52
+ }
53
+ }
54
+
55
+ export interface AccessListParams extends CursorPaginationParams {}
56
+
57
+ export interface AccessAddParams {
58
+ /**
59
+ * The workspace to grant access to.
60
+ */
61
+ workspaceId?: string;
62
+ }
63
+
64
+ export interface AccessRemoveParams {
65
+ /**
66
+ * The API key losing workspace access (path).
67
+ */
68
+ id: string;
69
+ }
70
+
71
+ export declare namespace Access {
72
+ export {
73
+ type AccessListParams as AccessListParams,
74
+ type AccessAddParams as AccessAddParams,
75
+ type AccessRemoveParams as AccessRemoveParams,
76
+ };
77
+ }
78
+
79
+ export { type WorkspacesCursorPagination };
@@ -0,0 +1,282 @@
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 * as Shared from '../shared';
6
+ import * as AccessAPI from './access';
7
+ import { Access, AccessAddParams, AccessListParams, AccessRemoveParams } from './access';
8
+ import { APIPromise } from '../../core/api-promise';
9
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
10
+ import { buildHeaders } from '../../internal/headers';
11
+ import { RequestOptions } from '../../internal/request-options';
12
+ import { path } from '../../internal/utils/path';
13
+
14
+ /**
15
+ * Issue, rotate, and revoke API keys for the account, and grant or revoke
16
+ * each key's access to individual workspaces.
17
+ */
18
+ export class APIKeys extends APIResource {
19
+ access: AccessAPI.Access = new AccessAPI.Access(this._client);
20
+
21
+ /**
22
+ * Creates a new API key on the account. Optionally grants the key access to one or
23
+ * more workspaces via initial_workspace_ids.
24
+ */
25
+ create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
26
+ return this._client.post('/v1/account/api_keys', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Retrieves an API key by ID.
31
+ */
32
+ retrieve(id: string, options?: RequestOptions): APIPromise<APIKey> {
33
+ return this._client.get(path`/v1/account/api_keys/${id}`, options);
34
+ }
35
+
36
+ /**
37
+ * Updates an API key.
38
+ */
39
+ update(id: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
40
+ return this._client.patch(path`/v1/account/api_keys/${id}`, { body, ...options });
41
+ }
42
+
43
+ /**
44
+ * Lists all API keys on the account.
45
+ */
46
+ list(
47
+ query: APIKeyListParams | null | undefined = {},
48
+ options?: RequestOptions,
49
+ ): PagePromise<APIKeysCursorPagination, APIKey> {
50
+ return this._client.getAPIList('/v1/account/api_keys', CursorPagination<APIKey>, { query, ...options });
51
+ }
52
+
53
+ /**
54
+ * Deletes an API key.
55
+ */
56
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
57
+ return this._client.delete(path`/v1/account/api_keys/${id}`, {
58
+ ...options,
59
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Rotates an API key and returns a new token. All previous tokens for this key are
65
+ * invalidated.
66
+ */
67
+ rotate(id: string, options?: RequestOptions): APIPromise<APIKey> {
68
+ return this._client.put(path`/v1/account/api_keys/${id}/rotate`, options);
69
+ }
70
+ }
71
+
72
+ export type APIKeysCursorPagination = CursorPagination<APIKey>;
73
+
74
+ /**
75
+ * An API key for the account. Use workspace-association RPCs to grant the key
76
+ * access to specific workspaces; a key with zero workspaces is valid but cannot
77
+ * access workspace-scoped resources.
78
+ */
79
+ export interface APIKey {
80
+ /**
81
+ * AccountResourceMetadata is used to represent a resource that is associated to an
82
+ * account but not to a workspace.
83
+ */
84
+ metadata: Shared.AccountResourceMetadata;
85
+
86
+ /**
87
+ * Configuration for an API key.
88
+ */
89
+ spec: APIKeySpec;
90
+
91
+ info?: APIKeyInfo;
92
+ }
93
+
94
+ export interface APIKeyInfo {
95
+ /**
96
+ * A profile identifies a user or non-human principal (such as an API key) at the
97
+ * account level. Profiles are account-scoped and can be granted access to multiple
98
+ * workspaces.
99
+ */
100
+ createdBy?: AccountAPI.Profile;
101
+
102
+ /**
103
+ * Up to a small number of workspaces this key has access to, intended for display
104
+ * ("Workspace 1, Workspace 2, and 4 more"). Use ListAPIKeyWorkspaces for the full
105
+ * paginated list.
106
+ */
107
+ workspacesPreview?: Array<Shared.BareMetadata>;
108
+
109
+ /**
110
+ * Total number of workspaces this key has access to.
111
+ */
112
+ workspacesTotal?: number;
113
+ }
114
+
115
+ /**
116
+ * Configuration for an API key.
117
+ */
118
+ export interface APIKeySpec {
119
+ /**
120
+ * The bearer token used to authenticate as this API key. Returned only on creation
121
+ * and rotation; subsequent reads omit this field.
122
+ */
123
+ token?: string;
124
+
125
+ /**
126
+ * Free-form description of what this API key is used for.
127
+ */
128
+ description?: string;
129
+
130
+ /**
131
+ * Permissions granted to this key. Each entry is a colon-separated verb:resource
132
+ * string (e.g. "manage:agents"). Currently has no enforced effect; reserved for
133
+ * future fine-grained authorization.
134
+ */
135
+ permissions?: Array<string>;
136
+
137
+ /**
138
+ * True when this key is managed by the system (e.g. the auto-provisioned global
139
+ * account key). System keys cannot be deleted but can be rotated.
140
+ */
141
+ system?: boolean;
142
+ }
143
+
144
+ export interface APIKeyCreateParams {
145
+ /**
146
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
147
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
148
+ * excluded since they are set by the server.
149
+ */
150
+ metadata: APIKeyCreateParams.Metadata;
151
+
152
+ /**
153
+ * Configuration for an API key.
154
+ */
155
+ spec: APIKeySpec;
156
+
157
+ /**
158
+ * Workspaces this API key will have access to on creation. Optional — a key can be
159
+ * created with no workspace access and granted later via AddAPIKeyWorkspace.
160
+ */
161
+ initialWorkspaceIds?: Array<string>;
162
+ }
163
+
164
+ export namespace APIKeyCreateParams {
165
+ /**
166
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
167
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
168
+ * excluded since they are set by the server.
169
+ */
170
+ export interface Metadata {
171
+ /**
172
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
173
+ * Workspace")
174
+ */
175
+ name: string;
176
+
177
+ /**
178
+ * External ID for the resource (e.g., a workflow ID from an external system)
179
+ */
180
+ externalId?: string;
181
+
182
+ /**
183
+ * Arbitrary key-value pairs for categorization and filtering Examples:
184
+ * {"environment": "production", "team": "platform", "version": "v2"}
185
+ */
186
+ labels?: { [key: string]: string };
187
+ }
188
+ }
189
+
190
+ export interface APIKeyUpdateParams {
191
+ /**
192
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
193
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
194
+ * excluded since they are set by the server.
195
+ */
196
+ metadata?: APIKeyUpdateParams.Metadata;
197
+
198
+ /**
199
+ * Configuration for an API key.
200
+ */
201
+ spec?: APIKeySpec;
202
+
203
+ /**
204
+ * Fields to update.
205
+ */
206
+ updateMask?: string;
207
+ }
208
+
209
+ export namespace APIKeyUpdateParams {
210
+ /**
211
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
212
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
213
+ * excluded since they are set by the server.
214
+ */
215
+ export interface Metadata {
216
+ /**
217
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
218
+ * Workspace")
219
+ */
220
+ name: string;
221
+
222
+ /**
223
+ * External ID for the resource (e.g., a workflow ID from an external system)
224
+ */
225
+ externalId?: string;
226
+
227
+ /**
228
+ * Arbitrary key-value pairs for categorization and filtering Examples:
229
+ * {"environment": "production", "team": "platform", "version": "v2"}
230
+ */
231
+ labels?: { [key: string]: string };
232
+ }
233
+ }
234
+
235
+ export interface APIKeyListParams extends CursorPaginationParams {
236
+ /**
237
+ * Filter by bundle_key — return only resources owned by this bundle.
238
+ */
239
+ bundleKey?: string;
240
+
241
+ /**
242
+ * When true, included info fields are populated. Requests with this flag count
243
+ * more against your rate limit.
244
+ */
245
+ includeInfo?: boolean;
246
+
247
+ /**
248
+ * Filter by ID prefix.
249
+ */
250
+ prefix?: string;
251
+
252
+ /**
253
+ * Free-form search query.
254
+ */
255
+ query?: string;
256
+
257
+ /**
258
+ * Sort order for results (asc or desc by creation time).
259
+ */
260
+ sortOrder?: string;
261
+ }
262
+
263
+ APIKeys.Access = Access;
264
+
265
+ export declare namespace APIKeys {
266
+ export {
267
+ type APIKey as APIKey,
268
+ type APIKeyInfo as APIKeyInfo,
269
+ type APIKeySpec as APIKeySpec,
270
+ type APIKeysCursorPagination as APIKeysCursorPagination,
271
+ type APIKeyCreateParams as APIKeyCreateParams,
272
+ type APIKeyUpdateParams as APIKeyUpdateParams,
273
+ type APIKeyListParams as APIKeyListParams,
274
+ };
275
+
276
+ export {
277
+ Access as Access,
278
+ type AccessListParams as AccessListParams,
279
+ type AccessAddParams as AccessAddParams,
280
+ type AccessRemoveParams as AccessRemoveParams,
281
+ };
282
+ }
@@ -0,0 +1,13 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ APIKeys,
5
+ type APIKey,
6
+ type APIKeyInfo,
7
+ type APIKeySpec,
8
+ type APIKeyCreateParams,
9
+ type APIKeyUpdateParams,
10
+ type APIKeyListParams,
11
+ type APIKeysCursorPagination,
12
+ } from './api-keys';
13
+ export { Access, type AccessListParams, type AccessAddParams, type AccessRemoveParams } from './access';