@cadenya/cadenya 0.66.0 → 0.67.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 (247) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +18 -18
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +18 -18
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/agents/agents.d.mts +28 -11
  11. package/resources/agents/agents.d.mts.map +1 -1
  12. package/resources/agents/agents.d.ts +28 -11
  13. package/resources/agents/agents.d.ts.map +1 -1
  14. package/resources/agents/agents.js +16 -10
  15. package/resources/agents/agents.js.map +1 -1
  16. package/resources/agents/agents.mjs +16 -10
  17. package/resources/agents/agents.mjs.map +1 -1
  18. package/resources/agents/feedback.d.mts +14 -9
  19. package/resources/agents/feedback.d.mts.map +1 -1
  20. package/resources/agents/feedback.d.ts +14 -9
  21. package/resources/agents/feedback.d.ts.map +1 -1
  22. package/resources/agents/feedback.js +3 -2
  23. package/resources/agents/feedback.js.map +1 -1
  24. package/resources/agents/feedback.mjs +3 -2
  25. package/resources/agents/feedback.mjs.map +1 -1
  26. package/resources/agents/index.d.mts +1 -1
  27. package/resources/agents/index.d.mts.map +1 -1
  28. package/resources/agents/index.d.ts +1 -1
  29. package/resources/agents/index.d.ts.map +1 -1
  30. package/resources/agents/index.js.map +1 -1
  31. package/resources/agents/index.mjs.map +1 -1
  32. package/resources/agents/schedules.d.mts +32 -11
  33. package/resources/agents/schedules.d.mts.map +1 -1
  34. package/resources/agents/schedules.d.ts +32 -11
  35. package/resources/agents/schedules.d.ts.map +1 -1
  36. package/resources/agents/schedules.js +18 -13
  37. package/resources/agents/schedules.js.map +1 -1
  38. package/resources/agents/schedules.mjs +18 -13
  39. package/resources/agents/schedules.mjs.map +1 -1
  40. package/resources/agents/variations.d.mts +51 -9
  41. package/resources/agents/variations.d.mts.map +1 -1
  42. package/resources/agents/variations.d.ts +51 -9
  43. package/resources/agents/variations.d.ts.map +1 -1
  44. package/resources/agents/variations.js +28 -32
  45. package/resources/agents/variations.js.map +1 -1
  46. package/resources/agents/variations.mjs +28 -32
  47. package/resources/agents/variations.mjs.map +1 -1
  48. package/resources/agents/webhook-deliveries.d.mts +7 -3
  49. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  50. package/resources/agents/webhook-deliveries.d.ts +7 -3
  51. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  52. package/resources/agents/webhook-deliveries.js +3 -2
  53. package/resources/agents/webhook-deliveries.js.map +1 -1
  54. package/resources/agents/webhook-deliveries.mjs +3 -2
  55. package/resources/agents/webhook-deliveries.mjs.map +1 -1
  56. package/resources/api-keys.d.mts +35 -12
  57. package/resources/api-keys.d.mts.map +1 -1
  58. package/resources/api-keys.d.ts +35 -12
  59. package/resources/api-keys.d.ts.map +1 -1
  60. package/resources/api-keys.js +19 -12
  61. package/resources/api-keys.js.map +1 -1
  62. package/resources/api-keys.mjs +19 -12
  63. package/resources/api-keys.mjs.map +1 -1
  64. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +10 -4
  65. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -1
  66. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +10 -4
  67. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -1
  68. package/resources/bulk-workspace-resources/bulk-workspace-resources.js +10 -9
  69. package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -1
  70. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs +10 -9
  71. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -1
  72. package/resources/bulk-workspace-resources/index.d.mts +1 -1
  73. package/resources/bulk-workspace-resources/index.d.mts.map +1 -1
  74. package/resources/bulk-workspace-resources/index.d.ts +1 -1
  75. package/resources/bulk-workspace-resources/index.d.ts.map +1 -1
  76. package/resources/bulk-workspace-resources/index.js.map +1 -1
  77. package/resources/bulk-workspace-resources/index.mjs.map +1 -1
  78. package/resources/bulk-workspace-resources/results.d.mts +8 -4
  79. package/resources/bulk-workspace-resources/results.d.mts.map +1 -1
  80. package/resources/bulk-workspace-resources/results.d.ts +8 -4
  81. package/resources/bulk-workspace-resources/results.d.ts.map +1 -1
  82. package/resources/bulk-workspace-resources/results.js +3 -2
  83. package/resources/bulk-workspace-resources/results.js.map +1 -1
  84. package/resources/bulk-workspace-resources/results.mjs +3 -2
  85. package/resources/bulk-workspace-resources/results.mjs.map +1 -1
  86. package/resources/index.d.mts +9 -9
  87. package/resources/index.d.mts.map +1 -1
  88. package/resources/index.d.ts +9 -9
  89. package/resources/index.d.ts.map +1 -1
  90. package/resources/index.js.map +1 -1
  91. package/resources/index.mjs +1 -1
  92. package/resources/index.mjs.map +1 -1
  93. package/resources/memory-layers/entries.d.mts +35 -14
  94. package/resources/memory-layers/entries.d.mts.map +1 -1
  95. package/resources/memory-layers/entries.d.ts +35 -14
  96. package/resources/memory-layers/entries.d.ts.map +1 -1
  97. package/resources/memory-layers/entries.js +15 -13
  98. package/resources/memory-layers/entries.js.map +1 -1
  99. package/resources/memory-layers/entries.mjs +15 -13
  100. package/resources/memory-layers/entries.mjs.map +1 -1
  101. package/resources/memory-layers/index.d.mts +1 -1
  102. package/resources/memory-layers/index.d.mts.map +1 -1
  103. package/resources/memory-layers/index.d.ts +1 -1
  104. package/resources/memory-layers/index.d.ts.map +1 -1
  105. package/resources/memory-layers/index.js.map +1 -1
  106. package/resources/memory-layers/index.mjs.map +1 -1
  107. package/resources/memory-layers/memory-layers.d.mts +32 -9
  108. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  109. package/resources/memory-layers/memory-layers.d.ts +32 -9
  110. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  111. package/resources/memory-layers/memory-layers.js +13 -10
  112. package/resources/memory-layers/memory-layers.js.map +1 -1
  113. package/resources/memory-layers/memory-layers.mjs +13 -10
  114. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  115. package/resources/models.d.mts +15 -5
  116. package/resources/models.d.mts.map +1 -1
  117. package/resources/models.d.ts +15 -5
  118. package/resources/models.d.ts.map +1 -1
  119. package/resources/models.js +11 -6
  120. package/resources/models.js.map +1 -1
  121. package/resources/models.mjs +11 -6
  122. package/resources/models.mjs.map +1 -1
  123. package/resources/objectives/feedback.d.mts +16 -5
  124. package/resources/objectives/feedback.d.mts.map +1 -1
  125. package/resources/objectives/feedback.d.ts +16 -5
  126. package/resources/objectives/feedback.d.ts.map +1 -1
  127. package/resources/objectives/feedback.js +9 -4
  128. package/resources/objectives/feedback.js.map +1 -1
  129. package/resources/objectives/feedback.mjs +9 -4
  130. package/resources/objectives/feedback.mjs.map +1 -1
  131. package/resources/objectives/index.d.mts +1 -1
  132. package/resources/objectives/index.d.mts.map +1 -1
  133. package/resources/objectives/index.d.ts +1 -1
  134. package/resources/objectives/index.d.ts.map +1 -1
  135. package/resources/objectives/index.js.map +1 -1
  136. package/resources/objectives/index.mjs.map +1 -1
  137. package/resources/objectives/objectives.d.mts +49 -21
  138. package/resources/objectives/objectives.d.mts.map +1 -1
  139. package/resources/objectives/objectives.d.ts +49 -21
  140. package/resources/objectives/objectives.d.ts.map +1 -1
  141. package/resources/objectives/objectives.js +31 -16
  142. package/resources/objectives/objectives.js.map +1 -1
  143. package/resources/objectives/objectives.mjs +31 -16
  144. package/resources/objectives/objectives.mjs.map +1 -1
  145. package/resources/objectives/tasks.d.mts +10 -2
  146. package/resources/objectives/tasks.d.mts.map +1 -1
  147. package/resources/objectives/tasks.d.ts +10 -2
  148. package/resources/objectives/tasks.d.ts.map +1 -1
  149. package/resources/objectives/tasks.js +5 -4
  150. package/resources/objectives/tasks.js.map +1 -1
  151. package/resources/objectives/tasks.mjs +5 -4
  152. package/resources/objectives/tasks.mjs.map +1 -1
  153. package/resources/objectives/tool-calls.d.mts +15 -3
  154. package/resources/objectives/tool-calls.d.mts.map +1 -1
  155. package/resources/objectives/tool-calls.d.ts +15 -3
  156. package/resources/objectives/tool-calls.d.ts.map +1 -1
  157. package/resources/objectives/tool-calls.js +7 -12
  158. package/resources/objectives/tool-calls.js.map +1 -1
  159. package/resources/objectives/tool-calls.mjs +7 -12
  160. package/resources/objectives/tool-calls.mjs.map +1 -1
  161. package/resources/objectives/tools.d.mts +5 -1
  162. package/resources/objectives/tools.d.mts.map +1 -1
  163. package/resources/objectives/tools.d.ts +5 -1
  164. package/resources/objectives/tools.d.ts.map +1 -1
  165. package/resources/objectives/tools.js +3 -2
  166. package/resources/objectives/tools.js.map +1 -1
  167. package/resources/objectives/tools.mjs +3 -2
  168. package/resources/objectives/tools.mjs.map +1 -1
  169. package/resources/search.d.mts +1 -1
  170. package/resources/search.d.mts.map +1 -1
  171. package/resources/search.d.ts +1 -1
  172. package/resources/search.d.ts.map +1 -1
  173. package/resources/search.js +6 -2
  174. package/resources/search.js.map +1 -1
  175. package/resources/search.mjs +6 -2
  176. package/resources/search.mjs.map +1 -1
  177. package/resources/tool-sets/index.d.mts +1 -1
  178. package/resources/tool-sets/index.d.mts.map +1 -1
  179. package/resources/tool-sets/index.d.ts +1 -1
  180. package/resources/tool-sets/index.d.ts.map +1 -1
  181. package/resources/tool-sets/index.js.map +1 -1
  182. package/resources/tool-sets/index.mjs.map +1 -1
  183. package/resources/tool-sets/tool-sets.d.mts +39 -12
  184. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  185. package/resources/tool-sets/tool-sets.d.ts +39 -12
  186. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  187. package/resources/tool-sets/tool-sets.js +19 -15
  188. package/resources/tool-sets/tool-sets.js.map +1 -1
  189. package/resources/tool-sets/tool-sets.mjs +19 -15
  190. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  191. package/resources/tool-sets/tools.d.mts +39 -14
  192. package/resources/tool-sets/tools.d.mts.map +1 -1
  193. package/resources/tool-sets/tools.d.ts +39 -14
  194. package/resources/tool-sets/tools.d.ts.map +1 -1
  195. package/resources/tool-sets/tools.js +18 -13
  196. package/resources/tool-sets/tools.js.map +1 -1
  197. package/resources/tool-sets/tools.mjs +18 -13
  198. package/resources/tool-sets/tools.mjs.map +1 -1
  199. package/resources/uploads.d.mts +9 -3
  200. package/resources/uploads.d.mts.map +1 -1
  201. package/resources/uploads.d.ts +9 -3
  202. package/resources/uploads.d.ts.map +1 -1
  203. package/resources/uploads.js +5 -4
  204. package/resources/uploads.js.map +1 -1
  205. package/resources/uploads.mjs +5 -4
  206. package/resources/uploads.mjs.map +1 -1
  207. package/resources/workspace-secrets.d.mts +30 -10
  208. package/resources/workspace-secrets.d.mts.map +1 -1
  209. package/resources/workspace-secrets.d.ts +30 -10
  210. package/resources/workspace-secrets.d.ts.map +1 -1
  211. package/resources/workspace-secrets.js +16 -13
  212. package/resources/workspace-secrets.js.map +1 -1
  213. package/resources/workspace-secrets.mjs +16 -13
  214. package/resources/workspace-secrets.mjs.map +1 -1
  215. package/src/client.ts +30 -0
  216. package/src/resources/agents/agents.ts +43 -14
  217. package/src/resources/agents/feedback.ts +17 -10
  218. package/src/resources/agents/index.ts +2 -0
  219. package/src/resources/agents/schedules.ts +57 -22
  220. package/src/resources/agents/variations.ts +104 -39
  221. package/src/resources/agents/webhook-deliveries.ts +10 -4
  222. package/src/resources/api-keys.ts +54 -16
  223. package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +30 -8
  224. package/src/resources/bulk-workspace-resources/index.ts +1 -0
  225. package/src/resources/bulk-workspace-resources/results.ts +11 -5
  226. package/src/resources/index.ts +22 -1
  227. package/src/resources/memory-layers/entries.ts +62 -25
  228. package/src/resources/memory-layers/index.ts +2 -0
  229. package/src/resources/memory-layers/memory-layers.ts +52 -12
  230. package/src/resources/models.ts +25 -6
  231. package/src/resources/objectives/feedback.ts +26 -8
  232. package/src/resources/objectives/index.ts +1 -0
  233. package/src/resources/objectives/objectives.ts +86 -27
  234. package/src/resources/objectives/tasks.ts +19 -5
  235. package/src/resources/objectives/tool-calls.ts +30 -14
  236. package/src/resources/objectives/tools.ts +9 -3
  237. package/src/resources/search.ts +6 -1
  238. package/src/resources/tool-sets/index.ts +2 -0
  239. package/src/resources/tool-sets/tool-sets.ts +61 -19
  240. package/src/resources/tool-sets/tools.ts +64 -25
  241. package/src/resources/uploads.ts +13 -4
  242. package/src/resources/workspace-secrets.ts +57 -16
  243. package/src/version.ts +1 -1
  244. package/version.d.mts +1 -1
  245. package/version.d.ts +1 -1
  246. package/version.js +1 -1
  247. package/version.mjs +1 -1
@@ -52,33 +52,47 @@ export class Objectives extends APIResource {
52
52
  /**
53
53
  * Creates a new objective in the workspace
54
54
  */
55
- create(body: ObjectiveCreateParams, options?: RequestOptions): APIPromise<Objective> {
56
- return this._client.post('/v1/objectives', { body, ...options });
55
+ create(workspaceID: string, body: ObjectiveCreateParams, options?: RequestOptions): APIPromise<Objective> {
56
+ return this._client.post(path`/v1/workspaces/${workspaceID}/objectives`, { body, ...options });
57
57
  }
58
58
 
59
59
  /**
60
60
  * Retrieves an objective by ID from the workspace
61
61
  */
62
- retrieve(id: string, options?: RequestOptions): APIPromise<Objective> {
63
- return this._client.get(path`/v1/objectives/${id}`, options);
62
+ retrieve(id: string, params: ObjectiveRetrieveParams, options?: RequestOptions): APIPromise<Objective> {
63
+ const { workspaceId } = params;
64
+ return this._client.get(path`/v1/workspaces/${workspaceId}/objectives/${id}`, options);
64
65
  }
65
66
 
66
67
  /**
67
68
  * Lists all objectives in the workspace
68
69
  */
69
70
  list(
71
+ workspaceID: string,
70
72
  query: ObjectiveListParams | null | undefined = {},
71
73
  options?: RequestOptions,
72
74
  ): PagePromise<ObjectivesCursorPagination, Objective> {
73
- return this._client.getAPIList('/v1/objectives', CursorPagination<Objective>, { query, ...options });
75
+ return this._client.getAPIList(
76
+ path`/v1/workspaces/${workspaceID}/objectives`,
77
+ CursorPagination<Objective>,
78
+ { query, ...options },
79
+ );
74
80
  }
75
81
 
76
82
  /**
77
83
  * Cancels a running or pending objective. The objective's state will be set to
78
84
  * STATE_CANCELLED.
79
85
  */
80
- cancel(objectiveID: string, body: ObjectiveCancelParams, options?: RequestOptions): APIPromise<Objective> {
81
- return this._client.post(path`/v1/objectives/${objectiveID}/cancel`, { body, ...options });
86
+ cancel(
87
+ objectiveID: string,
88
+ params: ObjectiveCancelParams,
89
+ options?: RequestOptions,
90
+ ): APIPromise<Objective> {
91
+ const { workspaceId, ...body } = params;
92
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/cancel`, {
93
+ body,
94
+ ...options,
95
+ });
82
96
  }
83
97
 
84
98
  /**
@@ -87,10 +101,14 @@ export class Objectives extends APIResource {
87
101
  */
88
102
  compact(
89
103
  objectiveID: string,
90
- body: ObjectiveCompactParams,
104
+ params: ObjectiveCompactParams,
91
105
  options?: RequestOptions,
92
106
  ): APIPromise<ObjectiveCompactResponse> {
93
- return this._client.post(path`/v1/objectives/${objectiveID}/compact`, { body, ...options });
107
+ const { workspaceId, ...body } = params;
108
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/compact`, {
109
+ body,
110
+ ...options,
111
+ });
94
112
  }
95
113
 
96
114
  /**
@@ -98,10 +116,14 @@ export class Objectives extends APIResource {
98
116
  */
99
117
  continue(
100
118
  objectiveID: string,
101
- body: ObjectiveContinueParams,
119
+ params: ObjectiveContinueParams,
102
120
  options?: RequestOptions,
103
121
  ): APIPromise<ObjectiveContinueResponse> {
104
- return this._client.post(path`/v1/objectives/${objectiveID}/continue`, { body, ...options });
122
+ const { workspaceId, ...body } = params;
123
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/continue`, {
124
+ body,
125
+ ...options,
126
+ });
105
127
  }
106
128
 
107
129
  /**
@@ -110,11 +132,12 @@ export class Objectives extends APIResource {
110
132
  */
111
133
  listContextWindows(
112
134
  objectiveID: string,
113
- query: ObjectiveListContextWindowsParams | null | undefined = {},
135
+ params: ObjectiveListContextWindowsParams,
114
136
  options?: RequestOptions,
115
137
  ): PagePromise<ObjectiveContextWindowsCursorPagination, ObjectiveContextWindow> {
138
+ const { workspaceId, ...query } = params;
116
139
  return this._client.getAPIList(
117
- path`/v1/objectives/${objectiveID}/context_windows`,
140
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/context_windows`,
118
141
  CursorPagination<ObjectiveContextWindow>,
119
142
  { query, ...options },
120
143
  );
@@ -125,11 +148,12 @@ export class Objectives extends APIResource {
125
148
  */
126
149
  listEvents(
127
150
  objectiveID: string,
128
- query: ObjectiveListEventsParams | null | undefined = {},
151
+ params: ObjectiveListEventsParams,
129
152
  options?: RequestOptions,
130
153
  ): PagePromise<ObjectiveListEventsResponsesCursorPagination, ObjectiveListEventsResponse> {
154
+ const { workspaceId, ...query } = params;
131
155
  return this._client.getAPIList(
132
- path`/v1/objectives/${objectiveID}/events`,
156
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/events`,
133
157
  CursorPagination<ObjectiveListEventsResponse>,
134
158
  { query, ...options },
135
159
  );
@@ -752,6 +776,13 @@ export interface ObjectiveCreateParams {
752
776
  variationId?: string;
753
777
  }
754
778
 
779
+ export interface ObjectiveRetrieveParams {
780
+ /**
781
+ * Workspace ID (from path).
782
+ */
783
+ workspaceId: string;
784
+ }
785
+
755
786
  export interface ObjectiveListParams extends CursorPaginationParams {
756
787
  /**
757
788
  * Agent ID for filtering
@@ -796,34 +827,51 @@ export interface ObjectiveListParams extends CursorPaginationParams {
796
827
 
797
828
  export interface ObjectiveCancelParams {
798
829
  /**
799
- * Optional reason for cancellation
830
+ * Path param: Workspace ID (from path).
831
+ */
832
+ workspaceId: string;
833
+
834
+ /**
835
+ * Body param: Optional reason for cancellation
800
836
  */
801
837
  reason?: string;
802
838
  }
803
839
 
804
840
  export interface ObjectiveCompactParams {
805
841
  /**
806
- * CompactionConfig defines how context window compaction behaves for objectives
807
- * using this variation.
842
+ * Path param: Workspace ID (from path).
843
+ */
844
+ workspaceId: string;
845
+
846
+ /**
847
+ * Body param: CompactionConfig defines how context window compaction behaves for
848
+ * objectives using this variation.
808
849
  */
809
850
  compactionConfig?: VariationsAPI.AgentVariationSpecCompactionConfig;
810
851
  }
811
852
 
812
853
  export interface ObjectiveContinueParams {
813
854
  /**
814
- * When set to true, the message will be enqueued for when the agent loop is
815
- * available to process it.
855
+ * Path param: Workspace ID (from path).
856
+ */
857
+ workspaceId: string;
858
+
859
+ /**
860
+ * Body param: When set to true, the message will be enqueued for when the agent
861
+ * loop is available to process it.
816
862
  */
817
863
  enqueue?: boolean;
818
864
 
819
865
  /**
820
- * The message to continue an objective that has completed (or you are enqueing)
866
+ * Body param: The message to continue an objective that has completed (or you are
867
+ * enqueing)
821
868
  */
822
869
  message?: string;
823
870
 
824
871
  /**
825
- * Secrets that should be included with the message. Helpful for when you need to
826
- * update secrets on the objective (IE: A secret expires and needs to be refreshed)
872
+ * Body param: Secrets that should be included with the message. Helpful for when
873
+ * you need to update secrets on the objective (IE: A secret expires and needs to
874
+ * be refreshed)
827
875
  */
828
876
  secrets?: Array<ObjectiveContinueParams.Secret>;
829
877
  }
@@ -838,24 +886,34 @@ export namespace ObjectiveContinueParams {
838
886
 
839
887
  export interface ObjectiveListContextWindowsParams extends CursorPaginationParams {
840
888
  /**
841
- * When set to true you may use more of your alloted API rate-limit
889
+ * Path param: Workspace ID (from path).
890
+ */
891
+ workspaceId: string;
892
+
893
+ /**
894
+ * Query param: When set to true you may use more of your alloted API rate-limit
842
895
  */
843
896
  includeInfo?: boolean;
844
897
  }
845
898
 
846
899
  export interface ObjectiveListEventsParams extends CursorPaginationParams {
847
900
  /**
848
- * When set to true you may use more of your alloted API rate-limit
901
+ * Path param: Workspace ID (from path).
902
+ */
903
+ workspaceId: string;
904
+
905
+ /**
906
+ * Query param: When set to true you may use more of your alloted API rate-limit
849
907
  */
850
908
  includeInfo?: boolean;
851
909
 
852
910
  /**
853
- * Sort order for results (asc or desc by creation time)
911
+ * Query param: Sort order for results (asc or desc by creation time)
854
912
  */
855
913
  sortOrder?: string;
856
914
 
857
915
  /**
858
- * Optional context window ID to filter events by
916
+ * Query param: Optional context window ID to filter events by
859
917
  */
860
918
  windowId?: string;
861
919
  }
@@ -899,6 +957,7 @@ export declare namespace Objectives {
899
957
  type ObjectiveContextWindowsCursorPagination as ObjectiveContextWindowsCursorPagination,
900
958
  type ObjectiveListEventsResponsesCursorPagination as ObjectiveListEventsResponsesCursorPagination,
901
959
  type ObjectiveCreateParams as ObjectiveCreateParams,
960
+ type ObjectiveRetrieveParams as ObjectiveRetrieveParams,
902
961
  type ObjectiveListParams as ObjectiveListParams,
903
962
  type ObjectiveCancelParams as ObjectiveCancelParams,
904
963
  type ObjectiveCompactParams as ObjectiveCompactParams,
@@ -12,8 +12,11 @@ export class Tasks extends APIResource {
12
12
  * Retrieves a task by ID from an objective
13
13
  */
14
14
  retrieve(id: string, params: TaskRetrieveParams, options?: RequestOptions): APIPromise<ObjectiveTask> {
15
- const { objectiveId } = params;
16
- return this._client.get(path`/v1/objectives/${objectiveId}/tasks/${id}`, options);
15
+ const { workspaceId, objectiveId } = params;
16
+ return this._client.get(
17
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tasks/${id}`,
18
+ options,
19
+ );
17
20
  }
18
21
 
19
22
  /**
@@ -21,11 +24,12 @@ export class Tasks extends APIResource {
21
24
  */
22
25
  list(
23
26
  objectiveID: string,
24
- query: TaskListParams | null | undefined = {},
27
+ params: TaskListParams,
25
28
  options?: RequestOptions,
26
29
  ): PagePromise<ObjectiveTasksCursorPagination, ObjectiveTask> {
30
+ const { workspaceId, ...query } = params;
27
31
  return this._client.getAPIList(
28
- path`/v1/objectives/${objectiveID}/tasks`,
32
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tasks`,
29
33
  CursorPagination<ObjectiveTask>,
30
34
  { query, ...options },
31
35
  );
@@ -75,6 +79,11 @@ export interface ObjectiveTaskData {
75
79
  }
76
80
 
77
81
  export interface TaskRetrieveParams {
82
+ /**
83
+ * Workspace ID (from path).
84
+ */
85
+ workspaceId: string;
86
+
78
87
  /**
79
88
  * The ID of the objective. Supports "external_id:" prefix for external IDs.
80
89
  */
@@ -83,7 +92,12 @@ export interface TaskRetrieveParams {
83
92
 
84
93
  export interface TaskListParams extends CursorPaginationParams {
85
94
  /**
86
- * Sort order for results
95
+ * Path param: Workspace ID (from path).
96
+ */
97
+ workspaceId: string;
98
+
99
+ /**
100
+ * Query param: Sort order for results
87
101
  */
88
102
  sortOrder?: string;
89
103
  }
@@ -15,11 +15,12 @@ export class ToolCalls extends APIResource {
15
15
  */
16
16
  list(
17
17
  objectiveID: string,
18
- query: ToolCallListParams | null | undefined = {},
18
+ params: ToolCallListParams,
19
19
  options?: RequestOptions,
20
20
  ): PagePromise<ObjectiveToolCallsCursorPagination, ObjectiveToolCall> {
21
+ const { workspaceId, ...query } = params;
21
22
  return this._client.getAPIList(
22
- path`/v1/objectives/${objectiveID}/tool_calls`,
23
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls`,
23
24
  CursorPagination<ObjectiveToolCall>,
24
25
  { query, ...options },
25
26
  );
@@ -34,11 +35,11 @@ export class ToolCalls extends APIResource {
34
35
  params: ToolCallApproveParams,
35
36
  options?: RequestOptions,
36
37
  ): APIPromise<ObjectiveToolCall> {
37
- const { objectiveId, ...body } = params;
38
- return this._client.put(path`/v1/objectives/${objectiveId}/tool_calls/${toolCallID}/approve`, {
39
- body,
40
- ...options,
41
- });
38
+ const { workspaceId, objectiveId, ...body } = params;
39
+ return this._client.put(
40
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/approve`,
41
+ { body, ...options },
42
+ );
42
43
  }
43
44
 
44
45
  /**
@@ -51,11 +52,11 @@ export class ToolCalls extends APIResource {
51
52
  params: ToolCallDenyParams,
52
53
  options?: RequestOptions,
53
54
  ): APIPromise<ObjectiveToolCall> {
54
- const { objectiveId, ...body } = params;
55
- return this._client.put(path`/v1/objectives/${objectiveId}/tool_calls/${toolCallID}/deny`, {
56
- body,
57
- ...options,
58
- });
55
+ const { workspaceId, objectiveId, ...body } = params;
56
+ return this._client.put(
57
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/deny`,
58
+ { body, ...options },
59
+ );
59
60
  }
60
61
  }
61
62
 
@@ -144,12 +145,17 @@ export interface ObjectiveToolCallInfo {
144
145
 
145
146
  export interface ToolCallListParams extends CursorPaginationParams {
146
147
  /**
147
- * When set to true you may use more of your alloted API rate-limit
148
+ * Path param: Workspace ID (from path).
149
+ */
150
+ workspaceId: string;
151
+
152
+ /**
153
+ * Query param: When set to true you may use more of your alloted API rate-limit
148
154
  */
149
155
  includeInfo?: boolean;
150
156
 
151
157
  /**
152
- * Filter by tool call status
158
+ * Query param: Filter by tool call status
153
159
  */
154
160
  status?:
155
161
  | 'TOOL_CALL_STATUS_UNSPECIFIED'
@@ -160,6 +166,11 @@ export interface ToolCallListParams extends CursorPaginationParams {
160
166
  }
161
167
 
162
168
  export interface ToolCallApproveParams {
169
+ /**
170
+ * Workspace ID (from path).
171
+ */
172
+ workspaceId: string;
173
+
163
174
  /**
164
175
  * The ID of the objective. Supports "external_id:" prefix for external IDs.
165
176
  */
@@ -167,6 +178,11 @@ export interface ToolCallApproveParams {
167
178
  }
168
179
 
169
180
  export interface ToolCallDenyParams {
181
+ /**
182
+ * Path param: Workspace ID (from path).
183
+ */
184
+ workspaceId: string;
185
+
170
186
  /**
171
187
  * Path param: The ID of the objective. Supports "external_id:" prefix for external
172
188
  * IDs.
@@ -13,11 +13,12 @@ export class Tools extends APIResource {
13
13
  */
14
14
  list(
15
15
  objectiveID: string,
16
- query: ToolListParams | null | undefined = {},
16
+ params: ToolListParams,
17
17
  options?: RequestOptions,
18
18
  ): PagePromise<ObjectiveToolsCursorPagination, ObjectiveTool> {
19
+ const { workspaceId, ...query } = params;
19
20
  return this._client.getAPIList(
20
- path`/v1/objectives/${objectiveID}/tools`,
21
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tools`,
21
22
  CursorPagination<ObjectiveTool>,
22
23
  { query, ...options },
23
24
  );
@@ -48,7 +49,12 @@ export interface ObjectiveTool {
48
49
  snapshot?: ToolSetsToolsAPI.Tool;
49
50
  }
50
51
 
51
- export interface ToolListParams extends CursorPaginationParams {}
52
+ export interface ToolListParams extends CursorPaginationParams {
53
+ /**
54
+ * Path param: Workspace ID (from path).
55
+ */
56
+ workspaceId: string;
57
+ }
52
58
 
53
59
  export declare namespace Tools {
54
60
  export {
@@ -6,16 +6,21 @@ import * as ToolSetsAPI from './tool-sets/tool-sets';
6
6
  import * as ToolsAPI from './tool-sets/tools';
7
7
  import { APIPromise } from '../core/api-promise';
8
8
  import { RequestOptions } from '../internal/request-options';
9
+ import { path } from '../internal/utils/path';
9
10
 
10
11
  export class Search extends APIResource {
11
12
  /**
12
13
  * Searches for tools or tool sets in the workspace
13
14
  */
14
15
  searchToolsOrToolSets(
16
+ workspaceID: string,
15
17
  query: SearchSearchToolsOrToolSetsParams | null | undefined = {},
16
18
  options?: RequestOptions,
17
19
  ): APIPromise<SearchSearchToolsOrToolSetsResponse> {
18
- return this._client.get('/v1/search/tools_or_tool_sets', { query, ...options });
20
+ return this._client.get(path`/v1/workspaces/${workspaceID}/search/tools_or_tool_sets`, {
21
+ query,
22
+ ...options,
23
+ });
19
24
  }
20
25
  }
21
26
 
@@ -15,8 +15,10 @@ export {
15
15
  type ToolSetInfo,
16
16
  type ToolSetSpec,
17
17
  type ToolSetCreateParams,
18
+ type ToolSetRetrieveParams,
18
19
  type ToolSetUpdateParams,
19
20
  type ToolSetListParams,
21
+ type ToolSetDeleteParams,
20
22
  type ToolSetListEventsParams,
21
23
  type ToolSetsCursorPagination,
22
24
  type ToolSetEventsCursorPagination,
@@ -43,39 +43,46 @@ export class ToolSets extends APIResource {
43
43
  /**
44
44
  * Creates a new tool set in the workspace
45
45
  */
46
- create(body: ToolSetCreateParams, options?: RequestOptions): APIPromise<ToolSet> {
47
- return this._client.post('/v1/tool_sets', { body, ...options });
46
+ create(workspaceID: string, body: ToolSetCreateParams, options?: RequestOptions): APIPromise<ToolSet> {
47
+ return this._client.post(path`/v1/workspaces/${workspaceID}/tool_sets`, { body, ...options });
48
48
  }
49
49
 
50
50
  /**
51
51
  * Retrieves a tool set by ID from the workspace
52
52
  */
53
- retrieve(id: string, options?: RequestOptions): APIPromise<ToolSet> {
54
- return this._client.get(path`/v1/tool_sets/${id}`, options);
53
+ retrieve(id: string, params: ToolSetRetrieveParams, options?: RequestOptions): APIPromise<ToolSet> {
54
+ const { workspaceId } = params;
55
+ return this._client.get(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, options);
55
56
  }
56
57
 
57
58
  /**
58
59
  * Updates a tool set in the workspace
59
60
  */
60
- update(id: string, body: ToolSetUpdateParams, options?: RequestOptions): APIPromise<ToolSet> {
61
- return this._client.put(path`/v1/tool_sets/${id}`, { body, ...options });
61
+ update(id: string, params: ToolSetUpdateParams, options?: RequestOptions): APIPromise<ToolSet> {
62
+ const { workspaceId, ...body } = params;
63
+ return this._client.put(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, { body, ...options });
62
64
  }
63
65
 
64
66
  /**
65
67
  * Lists all tool sets in the workspace
66
68
  */
67
69
  list(
70
+ workspaceID: string,
68
71
  query: ToolSetListParams | null | undefined = {},
69
72
  options?: RequestOptions,
70
73
  ): PagePromise<ToolSetsCursorPagination, ToolSet> {
71
- return this._client.getAPIList('/v1/tool_sets', CursorPagination<ToolSet>, { query, ...options });
74
+ return this._client.getAPIList(path`/v1/workspaces/${workspaceID}/tool_sets`, CursorPagination<ToolSet>, {
75
+ query,
76
+ ...options,
77
+ });
72
78
  }
73
79
 
74
80
  /**
75
81
  * Deletes a tool set in the workspace
76
82
  */
77
- delete(id: string, options?: RequestOptions): APIPromise<void> {
78
- return this._client.delete(path`/v1/tool_sets/${id}`, {
83
+ delete(id: string, params: ToolSetDeleteParams, options?: RequestOptions): APIPromise<void> {
84
+ const { workspaceId } = params;
85
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, {
79
86
  ...options,
80
87
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
81
88
  });
@@ -86,13 +93,15 @@ export class ToolSets extends APIResource {
86
93
  */
87
94
  listEvents(
88
95
  toolSetID: string,
89
- query: ToolSetListEventsParams | null | undefined = {},
96
+ params: ToolSetListEventsParams,
90
97
  options?: RequestOptions,
91
98
  ): PagePromise<ToolSetEventsCursorPagination, ToolSetEvent> {
92
- return this._client.getAPIList(path`/v1/tool_sets/${toolSetID}/events`, CursorPagination<ToolSetEvent>, {
93
- query,
94
- ...options,
95
- });
99
+ const { workspaceId, ...query } = params;
100
+ return this._client.getAPIList(
101
+ path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/events`,
102
+ CursorPagination<ToolSetEvent>,
103
+ { query, ...options },
104
+ );
96
105
  }
97
106
  }
98
107
 
@@ -346,16 +355,35 @@ export interface ToolSetCreateParams {
346
355
  spec: ToolSetSpec;
347
356
  }
348
357
 
358
+ export interface ToolSetRetrieveParams {
359
+ /**
360
+ * Workspace ID (from path).
361
+ */
362
+ workspaceId: string;
363
+ }
364
+
349
365
  export interface ToolSetUpdateParams {
350
366
  /**
351
- * UpdateResourceMetadata contains the user-provided fields for updating a
352
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
353
- * profile_id, created_at) are excluded since they are set by the server.
367
+ * Path param: Workspace ID (from path).
368
+ */
369
+ workspaceId: string;
370
+
371
+ /**
372
+ * Body param: UpdateResourceMetadata contains the user-provided fields for
373
+ * updating a workspace-scoped resource. Read-only fields (id, account_id,
374
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
375
+ * server.
354
376
  */
355
377
  metadata?: Shared.UpdateResourceMetadata;
356
378
 
379
+ /**
380
+ * Body param
381
+ */
357
382
  spec?: ToolSetSpec;
358
383
 
384
+ /**
385
+ * Body param
386
+ */
359
387
  updateMask?: string;
360
388
  }
361
389
 
@@ -386,14 +414,26 @@ export interface ToolSetListParams extends CursorPaginationParams {
386
414
  sortOrder?: string;
387
415
  }
388
416
 
417
+ export interface ToolSetDeleteParams {
418
+ /**
419
+ * Workspace ID (from path).
420
+ */
421
+ workspaceId: string;
422
+ }
423
+
389
424
  export interface ToolSetListEventsParams extends CursorPaginationParams {
390
425
  /**
391
- * When set to true you may use more of your alloted API rate-limit
426
+ * Path param: Workspace ID (from path).
427
+ */
428
+ workspaceId: string;
429
+
430
+ /**
431
+ * Query param: When set to true you may use more of your alloted API rate-limit
392
432
  */
393
433
  includeInfo?: boolean;
394
434
 
395
435
  /**
396
- * Sort order for results (asc or desc by creation time)
436
+ * Query param: Sort order for results (asc or desc by creation time)
397
437
  */
398
438
  sortOrder?: string;
399
439
  }
@@ -417,8 +457,10 @@ export declare namespace ToolSets {
417
457
  type ToolSetsCursorPagination as ToolSetsCursorPagination,
418
458
  type ToolSetEventsCursorPagination as ToolSetEventsCursorPagination,
419
459
  type ToolSetCreateParams as ToolSetCreateParams,
460
+ type ToolSetRetrieveParams as ToolSetRetrieveParams,
420
461
  type ToolSetUpdateParams as ToolSetUpdateParams,
421
462
  type ToolSetListParams as ToolSetListParams,
463
+ type ToolSetDeleteParams as ToolSetDeleteParams,
422
464
  type ToolSetListEventsParams as ToolSetListEventsParams,
423
465
  };
424
466