@cadenya/cadenya 0.124.0 → 0.126.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 (278) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +18 -7
  3. package/client.d.mts +17 -11
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +17 -11
  6. package/client.d.ts.map +1 -1
  7. package/client.js +7 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +7 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/request-options.d.mts +1 -1
  12. package/internal/request-options.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/resources/agents/agents.d.mts +115 -28
  15. package/resources/agents/agents.d.mts.map +1 -1
  16. package/resources/agents/agents.d.ts +115 -28
  17. package/resources/agents/agents.d.ts.map +1 -1
  18. package/resources/agents/agents.js +93 -13
  19. package/resources/agents/agents.js.map +1 -1
  20. package/resources/agents/agents.mjs +93 -13
  21. package/resources/agents/agents.mjs.map +1 -1
  22. package/resources/agents/feedback.d.mts +13 -2
  23. package/resources/agents/feedback.d.mts.map +1 -1
  24. package/resources/agents/feedback.d.ts +13 -2
  25. package/resources/agents/feedback.d.ts.map +1 -1
  26. package/resources/agents/feedback.js +13 -2
  27. package/resources/agents/feedback.js.map +1 -1
  28. package/resources/agents/feedback.mjs +13 -2
  29. package/resources/agents/feedback.mjs.map +1 -1
  30. package/resources/agents/index.d.mts +1 -1
  31. package/resources/agents/index.d.mts.map +1 -1
  32. package/resources/agents/index.d.ts +1 -1
  33. package/resources/agents/index.d.ts.map +1 -1
  34. package/resources/agents/index.js.map +1 -1
  35. package/resources/agents/index.mjs.map +1 -1
  36. package/resources/agents/schedules.d.mts +100 -52
  37. package/resources/agents/schedules.d.mts.map +1 -1
  38. package/resources/agents/schedules.d.ts +100 -52
  39. package/resources/agents/schedules.d.ts.map +1 -1
  40. package/resources/agents/schedules.js +99 -21
  41. package/resources/agents/schedules.js.map +1 -1
  42. package/resources/agents/schedules.mjs +99 -21
  43. package/resources/agents/schedules.mjs.map +1 -1
  44. package/resources/agents/variations.d.mts +252 -105
  45. package/resources/agents/variations.d.mts.map +1 -1
  46. package/resources/agents/variations.d.ts +252 -105
  47. package/resources/agents/variations.d.ts.map +1 -1
  48. package/resources/agents/variations.js +138 -27
  49. package/resources/agents/variations.js.map +1 -1
  50. package/resources/agents/variations.mjs +138 -27
  51. package/resources/agents/variations.mjs.map +1 -1
  52. package/resources/agents/webhook-deliveries.d.mts +13 -2
  53. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  54. package/resources/agents/webhook-deliveries.d.ts +13 -2
  55. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  56. package/resources/agents/webhook-deliveries.js +13 -2
  57. package/resources/agents/webhook-deliveries.js.map +1 -1
  58. package/resources/agents/webhook-deliveries.mjs +13 -2
  59. package/resources/agents/webhook-deliveries.mjs.map +1 -1
  60. package/resources/ai-provider-keys.d.mts +125 -110
  61. package/resources/ai-provider-keys.d.mts.map +1 -1
  62. package/resources/ai-provider-keys.d.ts +125 -110
  63. package/resources/ai-provider-keys.d.ts.map +1 -1
  64. package/resources/ai-provider-keys.js +11 -9
  65. package/resources/ai-provider-keys.js.map +1 -1
  66. package/resources/ai-provider-keys.mjs +11 -9
  67. package/resources/ai-provider-keys.mjs.map +1 -1
  68. package/resources/api-keys.d.mts +28 -20
  69. package/resources/api-keys.d.mts.map +1 -1
  70. package/resources/api-keys.d.ts +28 -20
  71. package/resources/api-keys.d.ts.map +1 -1
  72. package/resources/api-keys.js +14 -12
  73. package/resources/api-keys.js.map +1 -1
  74. package/resources/api-keys.mjs +14 -12
  75. package/resources/api-keys.mjs.map +1 -1
  76. package/resources/index.d.mts +4 -4
  77. package/resources/index.d.mts.map +1 -1
  78. package/resources/index.d.ts +4 -4
  79. package/resources/index.d.ts.map +1 -1
  80. package/resources/index.js.map +1 -1
  81. package/resources/index.mjs.map +1 -1
  82. package/resources/memory-layers/entries.d.mts +27 -30
  83. package/resources/memory-layers/entries.d.mts.map +1 -1
  84. package/resources/memory-layers/entries.d.ts +27 -30
  85. package/resources/memory-layers/entries.d.ts.map +1 -1
  86. package/resources/memory-layers/entries.js +12 -12
  87. package/resources/memory-layers/entries.js.map +1 -1
  88. package/resources/memory-layers/entries.mjs +12 -12
  89. package/resources/memory-layers/entries.mjs.map +1 -1
  90. package/resources/memory-layers/index.d.mts +1 -1
  91. package/resources/memory-layers/index.d.mts.map +1 -1
  92. package/resources/memory-layers/index.d.ts +1 -1
  93. package/resources/memory-layers/index.d.ts.map +1 -1
  94. package/resources/memory-layers/index.js.map +1 -1
  95. package/resources/memory-layers/index.mjs.map +1 -1
  96. package/resources/memory-layers/memory-layers.d.mts +34 -22
  97. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  98. package/resources/memory-layers/memory-layers.d.ts +34 -22
  99. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  100. package/resources/memory-layers/memory-layers.js +11 -9
  101. package/resources/memory-layers/memory-layers.js.map +1 -1
  102. package/resources/memory-layers/memory-layers.mjs +11 -9
  103. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  104. package/resources/models.d.mts +32 -24
  105. package/resources/models.d.mts.map +1 -1
  106. package/resources/models.d.ts +32 -24
  107. package/resources/models.d.ts.map +1 -1
  108. package/resources/models.js +10 -8
  109. package/resources/models.js.map +1 -1
  110. package/resources/models.mjs +10 -8
  111. package/resources/models.mjs.map +1 -1
  112. package/resources/objectives/feedback.d.mts +27 -3
  113. package/resources/objectives/feedback.d.mts.map +1 -1
  114. package/resources/objectives/feedback.d.ts +27 -3
  115. package/resources/objectives/feedback.d.ts.map +1 -1
  116. package/resources/objectives/feedback.js +27 -3
  117. package/resources/objectives/feedback.js.map +1 -1
  118. package/resources/objectives/feedback.mjs +27 -3
  119. package/resources/objectives/feedback.mjs.map +1 -1
  120. package/resources/objectives/index.d.mts +2 -2
  121. package/resources/objectives/index.d.mts.map +1 -1
  122. package/resources/objectives/index.d.ts +2 -2
  123. package/resources/objectives/index.d.ts.map +1 -1
  124. package/resources/objectives/index.js.map +1 -1
  125. package/resources/objectives/index.mjs.map +1 -1
  126. package/resources/objectives/objectives.d.mts +273 -102
  127. package/resources/objectives/objectives.d.mts.map +1 -1
  128. package/resources/objectives/objectives.d.ts +273 -102
  129. package/resources/objectives/objectives.d.ts.map +1 -1
  130. package/resources/objectives/objectives.js +112 -17
  131. package/resources/objectives/objectives.js.map +1 -1
  132. package/resources/objectives/objectives.mjs +112 -17
  133. package/resources/objectives/objectives.mjs.map +1 -1
  134. package/resources/objectives/tasks.d.mts +25 -8
  135. package/resources/objectives/tasks.d.mts.map +1 -1
  136. package/resources/objectives/tasks.d.ts +25 -8
  137. package/resources/objectives/tasks.d.ts.map +1 -1
  138. package/resources/objectives/tasks.js +26 -5
  139. package/resources/objectives/tasks.js.map +1 -1
  140. package/resources/objectives/tasks.mjs +26 -5
  141. package/resources/objectives/tasks.mjs.map +1 -1
  142. package/resources/objectives/tool-calls.d.mts +99 -42
  143. package/resources/objectives/tool-calls.d.mts.map +1 -1
  144. package/resources/objectives/tool-calls.d.ts +99 -42
  145. package/resources/objectives/tool-calls.d.ts.map +1 -1
  146. package/resources/objectives/tool-calls.js +73 -14
  147. package/resources/objectives/tool-calls.js.map +1 -1
  148. package/resources/objectives/tool-calls.mjs +73 -14
  149. package/resources/objectives/tool-calls.mjs.map +1 -1
  150. package/resources/objectives/tools.d.mts +13 -2
  151. package/resources/objectives/tools.d.mts.map +1 -1
  152. package/resources/objectives/tools.d.ts +13 -2
  153. package/resources/objectives/tools.d.ts.map +1 -1
  154. package/resources/objectives/tools.js +13 -2
  155. package/resources/objectives/tools.js.map +1 -1
  156. package/resources/objectives/tools.mjs +13 -2
  157. package/resources/objectives/tools.mjs.map +1 -1
  158. package/resources/search.d.mts +11 -2
  159. package/resources/search.d.mts.map +1 -1
  160. package/resources/search.d.ts +11 -2
  161. package/resources/search.d.ts.map +1 -1
  162. package/resources/search.js +3 -2
  163. package/resources/search.js.map +1 -1
  164. package/resources/search.mjs +3 -2
  165. package/resources/search.mjs.map +1 -1
  166. package/resources/tool-sets/index.d.mts +2 -2
  167. package/resources/tool-sets/index.d.mts.map +1 -1
  168. package/resources/tool-sets/index.d.ts +2 -2
  169. package/resources/tool-sets/index.d.ts.map +1 -1
  170. package/resources/tool-sets/index.js.map +1 -1
  171. package/resources/tool-sets/index.mjs.map +1 -1
  172. package/resources/tool-sets/secrets.d.mts +9 -24
  173. package/resources/tool-sets/secrets.d.mts.map +1 -1
  174. package/resources/tool-sets/secrets.d.ts +9 -24
  175. package/resources/tool-sets/secrets.d.ts.map +1 -1
  176. package/resources/tool-sets/secrets.js +12 -12
  177. package/resources/tool-sets/secrets.js.map +1 -1
  178. package/resources/tool-sets/secrets.mjs +12 -12
  179. package/resources/tool-sets/secrets.mjs.map +1 -1
  180. package/resources/tool-sets/tool-sets.d.mts +149 -64
  181. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  182. package/resources/tool-sets/tool-sets.d.ts +149 -64
  183. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  184. package/resources/tool-sets/tool-sets.js +17 -15
  185. package/resources/tool-sets/tool-sets.js.map +1 -1
  186. package/resources/tool-sets/tool-sets.mjs +17 -15
  187. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  188. package/resources/tool-sets/tools.d.mts +33 -43
  189. package/resources/tool-sets/tools.d.mts.map +1 -1
  190. package/resources/tool-sets/tools.d.ts +33 -43
  191. package/resources/tool-sets/tools.d.ts.map +1 -1
  192. package/resources/tool-sets/tools.js +18 -18
  193. package/resources/tool-sets/tools.js.map +1 -1
  194. package/resources/tool-sets/tools.mjs +18 -18
  195. package/resources/tool-sets/tools.mjs.map +1 -1
  196. package/resources/uploads.d.mts +14 -6
  197. package/resources/uploads.d.mts.map +1 -1
  198. package/resources/uploads.d.ts +14 -6
  199. package/resources/uploads.d.ts.map +1 -1
  200. package/resources/uploads.js +5 -4
  201. package/resources/uploads.js.map +1 -1
  202. package/resources/uploads.mjs +5 -4
  203. package/resources/uploads.mjs.map +1 -1
  204. package/resources/workspace-admin/index.d.mts +1 -1
  205. package/resources/workspace-admin/index.d.mts.map +1 -1
  206. package/resources/workspace-admin/index.d.ts +1 -1
  207. package/resources/workspace-admin/index.d.ts.map +1 -1
  208. package/resources/workspace-admin/index.js.map +1 -1
  209. package/resources/workspace-admin/index.mjs.map +1 -1
  210. package/resources/workspace-admin/members.d.mts +41 -6
  211. package/resources/workspace-admin/members.d.mts.map +1 -1
  212. package/resources/workspace-admin/members.d.ts +41 -6
  213. package/resources/workspace-admin/members.d.ts.map +1 -1
  214. package/resources/workspace-admin/members.js +34 -6
  215. package/resources/workspace-admin/members.js.map +1 -1
  216. package/resources/workspace-admin/members.mjs +34 -6
  217. package/resources/workspace-admin/members.mjs.map +1 -1
  218. package/resources/workspace-admin/profiles.d.mts +8 -0
  219. package/resources/workspace-admin/profiles.d.mts.map +1 -1
  220. package/resources/workspace-admin/profiles.d.ts +8 -0
  221. package/resources/workspace-admin/profiles.d.ts.map +1 -1
  222. package/resources/workspace-admin/profiles.js +8 -0
  223. package/resources/workspace-admin/profiles.js.map +1 -1
  224. package/resources/workspace-admin/profiles.mjs +8 -0
  225. package/resources/workspace-admin/profiles.mjs.map +1 -1
  226. package/resources/workspace-admin/workspace-admin.d.mts +65 -9
  227. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -1
  228. package/resources/workspace-admin/workspace-admin.d.ts +65 -9
  229. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -1
  230. package/resources/workspace-admin/workspace-admin.js +46 -6
  231. package/resources/workspace-admin/workspace-admin.js.map +1 -1
  232. package/resources/workspace-admin/workspace-admin.mjs +46 -6
  233. package/resources/workspace-admin/workspace-admin.mjs.map +1 -1
  234. package/resources/workspace-secrets.d.mts +27 -15
  235. package/resources/workspace-secrets.d.mts.map +1 -1
  236. package/resources/workspace-secrets.d.ts +27 -15
  237. package/resources/workspace-secrets.d.ts.map +1 -1
  238. package/resources/workspace-secrets.js +11 -9
  239. package/resources/workspace-secrets.js.map +1 -1
  240. package/resources/workspace-secrets.mjs +11 -9
  241. package/resources/workspace-secrets.mjs.map +1 -1
  242. package/src/client.ts +102 -5
  243. package/src/internal/request-options.ts +1 -1
  244. package/src/resources/agents/agents.ts +147 -37
  245. package/src/resources/agents/feedback.ts +14 -3
  246. package/src/resources/agents/index.ts +6 -0
  247. package/src/resources/agents/schedules.ts +143 -71
  248. package/src/resources/agents/variations.ts +319 -125
  249. package/src/resources/agents/webhook-deliveries.ts +14 -3
  250. package/src/resources/ai-provider-keys.ts +155 -127
  251. package/src/resources/api-keys.ts +48 -29
  252. package/src/resources/index.ts +44 -1
  253. package/src/resources/memory-layers/entries.ts +56 -40
  254. package/src/resources/memory-layers/index.ts +2 -0
  255. package/src/resources/memory-layers/memory-layers.ts +53 -30
  256. package/src/resources/models.ts +46 -31
  257. package/src/resources/objectives/feedback.ts +29 -5
  258. package/src/resources/objectives/index.ts +26 -0
  259. package/src/resources/objectives/objectives.ts +373 -125
  260. package/src/resources/objectives/tasks.ts +33 -12
  261. package/src/resources/objectives/tool-calls.ts +123 -46
  262. package/src/resources/objectives/tools.ts +14 -3
  263. package/src/resources/search.ts +14 -4
  264. package/src/resources/tool-sets/index.ts +23 -3
  265. package/src/resources/tool-sets/secrets.ts +32 -35
  266. package/src/resources/tool-sets/tool-sets.ts +239 -79
  267. package/src/resources/tool-sets/tools.ts +79 -61
  268. package/src/resources/uploads.ts +22 -8
  269. package/src/resources/workspace-admin/index.ts +2 -0
  270. package/src/resources/workspace-admin/members.ts +53 -12
  271. package/src/resources/workspace-admin/profiles.ts +8 -0
  272. package/src/resources/workspace-admin/workspace-admin.ts +80 -11
  273. package/src/resources/workspace-secrets.ts +40 -25
  274. package/src/version.ts +1 -1
  275. package/version.d.mts +1 -1
  276. package/version.d.ts +1 -1
  277. package/version.js +1 -1
  278. package/version.mjs +1 -1
@@ -16,9 +16,21 @@ import { path } from '../../internal/utils/path';
16
16
  export class Schedules extends APIResource {
17
17
  /**
18
18
  * Creates a new schedule for an agent
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const agentSchedule = await client.agents.schedules.create(
23
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
24
+ * {
25
+ * workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
26
+ * metadata: { name: 'name' },
27
+ * spec: { schedule: {} },
28
+ * },
29
+ * );
30
+ * ```
19
31
  */
20
32
  create(agentID: string, params: ScheduleCreateParams, options?: RequestOptions): APIPromise<AgentSchedule> {
21
- const { workspaceId, ...body } = params;
33
+ const { workspaceId = this._client.workspaceID, ...body } = params;
22
34
  return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules`, {
23
35
  body,
24
36
  ...options,
@@ -27,18 +39,47 @@ export class Schedules extends APIResource {
27
39
 
28
40
  /**
29
41
  * Retrieves a schedule by ID from an agent
30
- */
31
- retrieve(id: string, params: ScheduleRetrieveParams, options?: RequestOptions): APIPromise<AgentSchedule> {
32
- const { workspaceId, agentId } = params;
33
- return this._client.get(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}`, options);
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const agentSchedule =
46
+ * await client.agents.schedules.retrieve(
47
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
48
+ * 'as_01HXKD2E5NQM3T9AYWCFMZZZBD',
49
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
50
+ * );
51
+ * ```
52
+ */
53
+ retrieve(
54
+ agentID: string,
55
+ id: string,
56
+ params: ScheduleRetrieveParams | null | undefined = {},
57
+ options?: RequestOptions,
58
+ ): APIPromise<AgentSchedule> {
59
+ const { workspaceId = this._client.workspaceID } = params ?? {};
60
+ return this._client.get(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules/${id}`, options);
34
61
  }
35
62
 
36
63
  /**
37
64
  * Updates a schedule for an agent
38
- */
39
- update(id: string, params: ScheduleUpdateParams, options?: RequestOptions): APIPromise<AgentSchedule> {
40
- const { workspaceId, agentId, ...body } = params;
41
- return this._client.patch(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}`, {
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const agentSchedule = await client.agents.schedules.update(
69
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
70
+ * 'as_01HXKD2E5NQM3T9AYWCFMZZZBD',
71
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
72
+ * );
73
+ * ```
74
+ */
75
+ update(
76
+ agentID: string,
77
+ id: string,
78
+ params: ScheduleUpdateParams,
79
+ options?: RequestOptions,
80
+ ): APIPromise<AgentSchedule> {
81
+ const { workspaceId = this._client.workspaceID, ...body } = params;
82
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules/${id}`, {
42
83
  body,
43
84
  ...options,
44
85
  });
@@ -46,13 +87,24 @@ export class Schedules extends APIResource {
46
87
 
47
88
  /**
48
89
  * Lists all schedules for an agent
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * // Automatically fetches more pages as needed.
94
+ * for await (const agentSchedule of client.agents.schedules.list(
95
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
96
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
97
+ * )) {
98
+ * // ...
99
+ * }
100
+ * ```
49
101
  */
50
102
  list(
51
103
  agentID: string,
52
- params: ScheduleListParams,
104
+ params: ScheduleListParams | null | undefined = {},
53
105
  options?: RequestOptions,
54
106
  ): PagePromise<AgentSchedulesCursorPagination, AgentSchedule> {
55
- const { workspaceId, ...query } = params;
107
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
56
108
  return this._client.getAPIList(
57
109
  path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules`,
58
110
  CursorPagination<AgentSchedule>,
@@ -62,10 +114,24 @@ export class Schedules extends APIResource {
62
114
 
63
115
  /**
64
116
  * Deletes a schedule from an agent
65
- */
66
- delete(id: string, params: ScheduleDeleteParams, options?: RequestOptions): APIPromise<void> {
67
- const { workspaceId, agentId } = params;
68
- return this._client.delete(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}`, {
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * await client.agents.schedules.delete(
121
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
122
+ * 'as_01HXKD2E5NQM3T9AYWCFMZZZBD',
123
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
124
+ * );
125
+ * ```
126
+ */
127
+ delete(
128
+ agentID: string,
129
+ id: string,
130
+ params: ScheduleDeleteParams | null | undefined = {},
131
+ options?: RequestOptions,
132
+ ): APIPromise<void> {
133
+ const { workspaceId = this._client.workspaceID } = params ?? {};
134
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules/${id}`, {
69
135
  ...options,
70
136
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
71
137
  });
@@ -75,10 +141,24 @@ export class Schedules extends APIResource {
75
141
  * Transitions a schedule to STATE_ARCHIVED and removes its underlying timer.
76
142
  * Archiving is terminal: archived schedules never fire and cannot be reactivated;
77
143
  * create a new schedule instead.
78
- */
79
- archive(id: string, params: ScheduleArchiveParams, options?: RequestOptions): APIPromise<AgentSchedule> {
80
- const { workspaceId, agentId, ...body } = params;
81
- return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}:archive`, {
144
+ *
145
+ * @example
146
+ * ```ts
147
+ * const agentSchedule = await client.agents.schedules.archive(
148
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
149
+ * 'as_01HXKD2E5NQM3T9AYWCFMZZZBD',
150
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
151
+ * );
152
+ * ```
153
+ */
154
+ archive(
155
+ agentID: string,
156
+ id: string,
157
+ params: ScheduleArchiveParams,
158
+ options?: RequestOptions,
159
+ ): APIPromise<AgentSchedule> {
160
+ const { workspaceId = this._client.workspaceID, ...body } = params;
161
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules/${id}:archive`, {
82
162
  body,
83
163
  ...options,
84
164
  });
@@ -87,10 +167,24 @@ export class Schedules extends APIResource {
87
167
  /**
88
168
  * Transitions a schedule to STATE_PAUSED. Paused schedules retain history but do
89
169
  * not fire.
90
- */
91
- pause(id: string, params: SchedulePauseParams, options?: RequestOptions): APIPromise<AgentSchedule> {
92
- const { workspaceId, agentId, ...body } = params;
93
- return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}:pause`, {
170
+ *
171
+ * @example
172
+ * ```ts
173
+ * const agentSchedule = await client.agents.schedules.pause(
174
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
175
+ * 'as_01HXKD2E5NQM3T9AYWCFMZZZBD',
176
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
177
+ * );
178
+ * ```
179
+ */
180
+ pause(
181
+ agentID: string,
182
+ id: string,
183
+ params: SchedulePauseParams,
184
+ options?: RequestOptions,
185
+ ): APIPromise<AgentSchedule> {
186
+ const { workspaceId = this._client.workspaceID, ...body } = params;
187
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules/${id}:pause`, {
94
188
  body,
95
189
  ...options,
96
190
  });
@@ -99,10 +193,24 @@ export class Schedules extends APIResource {
99
193
  /**
100
194
  * Transitions a paused schedule back to STATE_ACTIVE so it fires on its cadence
101
195
  * again. Archived schedules cannot be resumed.
102
- */
103
- resume(id: string, params: ScheduleResumeParams, options?: RequestOptions): APIPromise<AgentSchedule> {
104
- const { workspaceId, agentId, ...body } = params;
105
- return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}:resume`, {
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * const agentSchedule = await client.agents.schedules.resume(
200
+ * 'agent_01HXKD2E5NQM3T9AYWCFMGWT9Y',
201
+ * 'as_01HXKD2E5NQM3T9AYWCFMZZZBD',
202
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
203
+ * );
204
+ * ```
205
+ */
206
+ resume(
207
+ agentID: string,
208
+ id: string,
209
+ params: ScheduleResumeParams,
210
+ options?: RequestOptions,
211
+ ): APIPromise<AgentSchedule> {
212
+ const { workspaceId = this._client.workspaceID, ...body } = params;
213
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentID}/schedules/${id}:resume`, {
106
214
  body,
107
215
  ...options,
108
216
  });
@@ -302,7 +410,7 @@ export interface ScheduleCreateParams {
302
410
  /**
303
411
  * Path param: Workspace ID.
304
412
  */
305
- workspaceId: string;
413
+ workspaceId?: string;
306
414
 
307
415
  /**
308
416
  * Body param: CreateResourceMetadata contains the user-provided fields for
@@ -322,26 +430,14 @@ export interface ScheduleRetrieveParams {
322
430
  /**
323
431
  * Workspace ID.
324
432
  */
325
- workspaceId: string;
326
-
327
- /**
328
- * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
329
- * form.
330
- */
331
- agentId: string;
433
+ workspaceId?: string;
332
434
  }
333
435
 
334
436
  export interface ScheduleUpdateParams {
335
437
  /**
336
438
  * Path param: Workspace ID.
337
439
  */
338
- workspaceId: string;
339
-
340
- /**
341
- * Path param: Agent ID. Accepts the canonical `agent_…` form or the
342
- * `external_id:<value>` form.
343
- */
344
- agentId: string;
440
+ workspaceId?: string;
345
441
 
346
442
  /**
347
443
  * Body param: UpdateResourceMetadata contains the user-provided fields for
@@ -366,7 +462,7 @@ export interface ScheduleListParams extends CursorPaginationParams {
366
462
  /**
367
463
  * Path param: Workspace ID.
368
464
  */
369
- workspaceId: string;
465
+ workspaceId?: string;
370
466
 
371
467
  /**
372
468
  * Query param: When true, the `info` field on each returned schedule is populated.
@@ -401,52 +497,28 @@ export interface ScheduleDeleteParams {
401
497
  /**
402
498
  * Workspace ID.
403
499
  */
404
- workspaceId: string;
405
-
406
- /**
407
- * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
408
- * form.
409
- */
410
- agentId: string;
500
+ workspaceId?: string;
411
501
  }
412
502
 
413
503
  export interface ScheduleArchiveParams {
414
504
  /**
415
505
  * Workspace ID.
416
506
  */
417
- workspaceId: string;
418
-
419
- /**
420
- * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
421
- * form.
422
- */
423
- agentId: string;
507
+ workspaceId?: string;
424
508
  }
425
509
 
426
510
  export interface SchedulePauseParams {
427
511
  /**
428
512
  * Workspace ID.
429
513
  */
430
- workspaceId: string;
431
-
432
- /**
433
- * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
434
- * form.
435
- */
436
- agentId: string;
514
+ workspaceId?: string;
437
515
  }
438
516
 
439
517
  export interface ScheduleResumeParams {
440
518
  /**
441
519
  * Workspace ID.
442
520
  */
443
- workspaceId: string;
444
-
445
- /**
446
- * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
447
- * form.
448
- */
449
- agentId: string;
521
+ workspaceId?: string;
450
522
  }
451
523
 
452
524
  export declare namespace Schedules {