@archastro/sdk 0.20.0 → 0.21.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 (152) hide show
  1. package/dist/channels/api_artifact_channel.d.ts +48 -0
  2. package/dist/channels/api_artifact_channel.d.ts.map +1 -0
  3. package/dist/channels/api_artifact_channel.js +85 -0
  4. package/dist/channels/api_artifact_channel.js.map +1 -0
  5. package/dist/client.d.ts +6 -0
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +7 -1
  8. package/dist/client.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/types/ai.d.ts +124 -10
  14. package/dist/types/ai.d.ts.map +1 -1
  15. package/dist/types/ai.js +27 -7
  16. package/dist/types/ai.js.map +1 -1
  17. package/dist/types/artifacts.d.ts +351 -0
  18. package/dist/types/artifacts.d.ts.map +1 -1
  19. package/dist/types/artifacts.js +65 -1
  20. package/dist/types/artifacts.js.map +1 -1
  21. package/dist/types/automations.d.ts +22 -22
  22. package/dist/types/automations.d.ts.map +1 -1
  23. package/dist/types/automations.js +7 -7
  24. package/dist/types/automations.js.map +1 -1
  25. package/dist/types/chat.d.ts +388 -0
  26. package/dist/types/chat.d.ts.map +1 -1
  27. package/dist/types/common.d.ts +1132 -287
  28. package/dist/types/common.d.ts.map +1 -1
  29. package/dist/types/common.js +146 -28
  30. package/dist/types/common.js.map +1 -1
  31. package/dist/types/computers.d.ts +22 -0
  32. package/dist/types/computers.d.ts.map +1 -0
  33. package/dist/types/computers.js +12 -0
  34. package/dist/types/computers.js.map +1 -0
  35. package/dist/types/events.d.ts +34 -16
  36. package/dist/types/events.d.ts.map +1 -1
  37. package/dist/types/events.js +3 -1
  38. package/dist/types/events.js.map +1 -1
  39. package/dist/types/index.d.ts +2 -0
  40. package/dist/types/index.d.ts.map +1 -1
  41. package/dist/types/index.js +3 -1
  42. package/dist/types/index.js.map +1 -1
  43. package/dist/types/relays.d.ts +22 -0
  44. package/dist/types/relays.d.ts.map +1 -0
  45. package/dist/types/relays.js +12 -0
  46. package/dist/types/relays.js.map +1 -0
  47. package/dist/types/tasks.d.ts +598 -14
  48. package/dist/types/tasks.d.ts.map +1 -1
  49. package/dist/types/tasks.js +43 -11
  50. package/dist/types/tasks.js.map +1 -1
  51. package/dist/types/threads.d.ts +64 -0
  52. package/dist/types/threads.d.ts.map +1 -1
  53. package/dist/v1/resources/agent_computers.d.ts +33 -1
  54. package/dist/v1/resources/agent_computers.d.ts.map +1 -1
  55. package/dist/v1/resources/agent_computers.js +17 -1
  56. package/dist/v1/resources/agent_computers.js.map +1 -1
  57. package/dist/v1/resources/agent_requests.d.ts +54 -0
  58. package/dist/v1/resources/agent_requests.d.ts.map +1 -0
  59. package/dist/v1/resources/agent_requests.js +71 -0
  60. package/dist/v1/resources/agent_requests.js.map +1 -0
  61. package/dist/v1/resources/agent_sessions.d.ts +23 -1
  62. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  63. package/dist/v1/resources/agent_sessions.js +26 -1
  64. package/dist/v1/resources/agent_sessions.js.map +1 -1
  65. package/dist/v1/resources/agents.d.ts +31 -1
  66. package/dist/v1/resources/agents.d.ts.map +1 -1
  67. package/dist/v1/resources/agents.js +12 -2
  68. package/dist/v1/resources/agents.js.map +1 -1
  69. package/dist/v1/resources/ai.d.ts +55 -4
  70. package/dist/v1/resources/ai.d.ts.map +1 -1
  71. package/dist/v1/resources/ai.js +44 -4
  72. package/dist/v1/resources/ai.js.map +1 -1
  73. package/dist/v1/resources/artifacts.d.ts +34 -2
  74. package/dist/v1/resources/artifacts.d.ts.map +1 -1
  75. package/dist/v1/resources/artifacts.js +3 -2
  76. package/dist/v1/resources/artifacts.js.map +1 -1
  77. package/dist/v1/resources/custom_objects.d.ts +94 -0
  78. package/dist/v1/resources/custom_objects.d.ts.map +1 -1
  79. package/dist/v1/resources/custom_objects.js +60 -1
  80. package/dist/v1/resources/custom_objects.js.map +1 -1
  81. package/dist/v1/resources/event_subscriptions.d.ts +12 -0
  82. package/dist/v1/resources/event_subscriptions.d.ts.map +1 -1
  83. package/dist/v1/resources/event_subscriptions.js +7 -1
  84. package/dist/v1/resources/event_subscriptions.js.map +1 -1
  85. package/dist/v1/resources/files.d.ts +32 -10
  86. package/dist/v1/resources/files.d.ts.map +1 -1
  87. package/dist/v1/resources/files.js +32 -11
  88. package/dist/v1/resources/files.js.map +1 -1
  89. package/dist/v1/resources/index.d.ts +3 -0
  90. package/dist/v1/resources/index.d.ts.map +1 -1
  91. package/dist/v1/resources/index.js +4 -1
  92. package/dist/v1/resources/index.js.map +1 -1
  93. package/dist/v1/resources/knowledge_sources.d.ts +4 -0
  94. package/dist/v1/resources/knowledge_sources.d.ts.map +1 -1
  95. package/dist/v1/resources/knowledge_sources.js +1 -1
  96. package/dist/v1/resources/kv.d.ts +75 -31
  97. package/dist/v1/resources/kv.d.ts.map +1 -1
  98. package/dist/v1/resources/kv.js +79 -32
  99. package/dist/v1/resources/kv.js.map +1 -1
  100. package/dist/v1/resources/notifications.d.ts +14 -0
  101. package/dist/v1/resources/notifications.d.ts.map +1 -1
  102. package/dist/v1/resources/notifications.js +13 -1
  103. package/dist/v1/resources/notifications.js.map +1 -1
  104. package/dist/v1/resources/oauth.d.ts +2 -0
  105. package/dist/v1/resources/oauth.d.ts.map +1 -1
  106. package/dist/v1/resources/oauth.js +2 -1
  107. package/dist/v1/resources/oauth.js.map +1 -1
  108. package/dist/v1/resources/orgs.d.ts +630 -1
  109. package/dist/v1/resources/orgs.d.ts.map +1 -1
  110. package/dist/v1/resources/orgs.js +351 -2
  111. package/dist/v1/resources/orgs.js.map +1 -1
  112. package/dist/v1/resources/private_service_enrollments.d.ts +7 -0
  113. package/dist/v1/resources/private_service_enrollments.d.ts.map +1 -1
  114. package/dist/v1/resources/private_service_enrollments.js +10 -1
  115. package/dist/v1/resources/private_service_enrollments.js.map +1 -1
  116. package/dist/v1/resources/relays.d.ts +38 -0
  117. package/dist/v1/resources/relays.d.ts.map +1 -0
  118. package/dist/v1/resources/relays.js +44 -0
  119. package/dist/v1/resources/relays.js.map +1 -0
  120. package/dist/v1/resources/scripts.d.ts +20 -9
  121. package/dist/v1/resources/scripts.d.ts.map +1 -1
  122. package/dist/v1/resources/scripts.js +18 -10
  123. package/dist/v1/resources/scripts.js.map +1 -1
  124. package/dist/v1/resources/task_ownership_conversions.d.ts +14 -0
  125. package/dist/v1/resources/task_ownership_conversions.d.ts.map +1 -0
  126. package/dist/v1/resources/task_ownership_conversions.js +19 -0
  127. package/dist/v1/resources/task_ownership_conversions.js.map +1 -0
  128. package/dist/v1/resources/tasks.d.ts +62 -1
  129. package/dist/v1/resources/tasks.d.ts.map +1 -1
  130. package/dist/v1/resources/tasks.js +35 -1
  131. package/dist/v1/resources/tasks.js.map +1 -1
  132. package/dist/v1/resources/teams.d.ts +129 -1
  133. package/dist/v1/resources/teams.d.ts.map +1 -1
  134. package/dist/v1/resources/teams.js +71 -1
  135. package/dist/v1/resources/teams.js.map +1 -1
  136. package/dist/v1/resources/threads.d.ts +76 -0
  137. package/dist/v1/resources/threads.d.ts.map +1 -1
  138. package/dist/v1/resources/threads.js +42 -1
  139. package/dist/v1/resources/threads.js.map +1 -1
  140. package/dist/v1/resources/users.d.ts +129 -3
  141. package/dist/v1/resources/users.d.ts.map +1 -1
  142. package/dist/v1/resources/users.js +73 -3
  143. package/dist/v1/resources/users.js.map +1 -1
  144. package/dist/v1/resources/workflows.d.ts +5 -1
  145. package/dist/v1/resources/workflows.d.ts.map +1 -1
  146. package/dist/v1/resources/workflows.js +6 -2
  147. package/dist/v1/resources/workflows.js.map +1 -1
  148. package/dist/v1.d.ts +6 -0
  149. package/dist/v1.d.ts.map +1 -1
  150. package/dist/v1.js +10 -1
  151. package/dist/v1.js.map +1 -1
  152. package/package.json +1 -1
@@ -1,5 +1,564 @@
1
1
  import { HttpClient } from "../../runtime/http-client.js";
2
+ import type { Task, TaskEnsureResult } from "../../types/tasks.js";
2
3
  import type { Thread } from "../../types/threads.js";
4
+ export declare class OrgTaskResource {
5
+ private http;
6
+ constructor(http: HttpClient);
7
+ /**
8
+ * List an organization's tasks
9
+ * Returns org-owned tasks for the specified organization: rows with the org
10
+ * tenant and no narrower user/team/agent scope. Explicitly personal, team, or
11
+ * agent tasks are excluded here; list those via the user/team collections or
12
+ * fetch them directly when authorized.
13
+ * Every organization member may list. App-scoped developer and
14
+ * server-to-server callers supply the org in the route.
15
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
16
+ * @param params - Query parameters.
17
+ * @param params.status - Filter tasks by status. One of `"open"`, `"in_progress"`, `"in_review"`, or `"done"`. Omit to return tasks in all statuses.
18
+ * @param params.ownerUser - Filter tasks assigned to a specific user. Provide the user's public ID (`usr_...`).
19
+ * @param params.ownerAgent - Filter tasks assigned to a specific agent. Provide the agent's public ID (`agi_...`).
20
+ * @param params.priority - Filter tasks by priority, from 0 (highest) to 4 (lowest).
21
+ * @param params.tag - Return only tasks carrying this tag (matched against the canonical lowercase form).
22
+ * @param params.parent - Return only subtasks of the given task (`tsk_...`), or pass `none` to return only top-level tasks.
23
+ * @param params.sourceScope - Return only tasks whose source matches this container. Must be supplied with `source_type` and `source_id`.
24
+ * @param params.sourceType - Return only tasks whose source matches this object kind. Must be supplied with the other source filters.
25
+ * @param params.sourceId - Return only tasks whose source matches this object identity. Must be supplied with the other source filters.
26
+ * @param params.epic - Return only tasks with this exact epic label.
27
+ * @param params.search - Restrict results to tasks whose name or description contains this string.
28
+ * @param params.sort - Sort key. One of `"created"` (default — most recently created first), `"due_date"` (soonest due first; tasks without a due date always sort last), or `"priority"` (most urgent first). Ties break by most recently created.
29
+ * @param params.order - Sort direction, `"asc"` or `"desc"`. Defaults to `"desc"` for `created` and `"asc"` for `due_date` and `priority`.
30
+ * @param params.dueBefore - Return only tasks with a due date strictly before this ISO 8601 datetime (`2026-08-01T00:00:00Z`) or date (`2026-08-01`, meaning midnight UTC). Tasks without a due date are excluded.
31
+ * @param params.dueAfter - Return only tasks with a due date strictly after this ISO 8601 datetime or date. Tasks without a due date are excluded.
32
+ * @param params.overdue - When `true`, return only overdue tasks: a due date before the current UTC day and a status other than `"done"`. A task due today is not overdue.
33
+ * @param params.ready - When true, return only open tasks with no unfinished blockers and no active session lease. This is a projection snapshot; claim a lease before starting work.
34
+ * @param params.attention - When true, return paused, failed, or in-progress tasks with no lease or a past lease expiry.
35
+ * @param params.limit - Maximum number of tasks to return. Capped at 100.
36
+ * @param params.afterCursor - Opaque cursor returned by the previous page.
37
+ * @returns Successful response
38
+ */
39
+ list(org: string, params?: {
40
+ status?: string;
41
+ ownerUser?: string;
42
+ ownerAgent?: string;
43
+ priority?: number;
44
+ tag?: string;
45
+ parent?: string;
46
+ sourceScope?: string;
47
+ sourceType?: string;
48
+ sourceId?: string;
49
+ epic?: string;
50
+ search?: string;
51
+ sort?: string;
52
+ order?: string;
53
+ dueBefore?: string;
54
+ dueAfter?: string;
55
+ overdue?: boolean;
56
+ ready?: boolean;
57
+ attention?: boolean;
58
+ limit?: number;
59
+ afterCursor?: string;
60
+ }): Promise<{
61
+ after_cursor?: string | null | undefined;
62
+ before_cursor?: string | null | undefined;
63
+ data: {
64
+ agent?: string | null | undefined;
65
+ aggregate_version?: number | null | undefined;
66
+ blocked_by_count?: number | undefined;
67
+ closed_at?: string | null | undefined;
68
+ comments_count?: number | undefined;
69
+ created_at?: string | undefined;
70
+ created_by_actor?: {
71
+ alias?: string | null | undefined;
72
+ id?: string | null | undefined;
73
+ name?: string | null | undefined;
74
+ profile_picture?: {
75
+ file?: string | null | undefined;
76
+ height?: number | null | undefined;
77
+ media?: string | null | undefined;
78
+ mime_type?: string | null | undefined;
79
+ refresh_url?: string | null | undefined;
80
+ url?: string | null | undefined;
81
+ width?: number | null | undefined;
82
+ } | null | undefined;
83
+ } | null | undefined;
84
+ created_by_agent?: string | null | undefined;
85
+ created_by_user?: string | null | undefined;
86
+ current_lease?: {
87
+ expires_at: string;
88
+ harness: string;
89
+ session_name: string;
90
+ } | null | undefined;
91
+ description?: string | null | undefined;
92
+ due_date?: string | null | undefined;
93
+ epic?: string | null | undefined;
94
+ id: string;
95
+ is_blocked?: boolean | undefined;
96
+ is_stalled?: boolean | undefined;
97
+ links?: Record<string, unknown> | undefined;
98
+ metadata?: Record<string, unknown> | undefined;
99
+ name: string;
100
+ org?: string | null | undefined;
101
+ owner_actor?: {
102
+ alias?: string | null | undefined;
103
+ id?: string | null | undefined;
104
+ name?: string | null | undefined;
105
+ profile_picture?: {
106
+ file?: string | null | undefined;
107
+ height?: number | null | undefined;
108
+ media?: string | null | undefined;
109
+ mime_type?: string | null | undefined;
110
+ refresh_url?: string | null | undefined;
111
+ url?: string | null | undefined;
112
+ width?: number | null | undefined;
113
+ } | null | undefined;
114
+ } | null | undefined;
115
+ owner_agent?: string | null | undefined;
116
+ owner_user?: string | null | undefined;
117
+ parent?: string | null | undefined;
118
+ priority?: number | undefined;
119
+ project_id?: string | null | undefined;
120
+ sandbox?: string | null | undefined;
121
+ source_id?: string | null | undefined;
122
+ source_scope?: string | null | undefined;
123
+ source_type?: string | null | undefined;
124
+ stalled_since?: string | null | undefined;
125
+ status: string;
126
+ subtasks_count?: number | undefined;
127
+ tags?: string[] | undefined;
128
+ target_binary?: string | null | undefined;
129
+ target_version?: string | null | undefined;
130
+ team?: string | null | undefined;
131
+ thread?: string | null | undefined;
132
+ updated_at?: string | undefined;
133
+ user?: string | null | undefined;
134
+ }[];
135
+ has_more: boolean;
136
+ }>;
137
+ /**
138
+ * Create a task for an organization
139
+ * Creates a new org-owned task (org tenant, no narrower user/team/agent
140
+ * scope) and returns the full task object. User-authenticated calls are
141
+ * attributed to the authenticated user or agent. App-scoped developer and
142
+ * server-to-server callers must provide an explicit `user` or `agent` actor
143
+ * for the organization. Every referenced principal is validated against the
144
+ * app and organization before creation.
145
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
146
+ * @param input - Request body.
147
+ * @param input.agent - Explicit acting agent (`agi_...`) for a developer or server-to-server call. Mutually exclusive with an acting `user`; the agent must belong to the organization.
148
+ * @param input.task - Attributes for the task to create. `name` is required; all other fields are optional.
149
+ * @param input.user - Explicit acting user (`usr_...`) for a developer or server-to-server call. Mutually exclusive with an acting `agent`.
150
+ * @returns The newly created task.
151
+ */
152
+ create(org: string, input: {
153
+ agent?: string | undefined;
154
+ task: {
155
+ description?: string | undefined;
156
+ due_date?: string | undefined;
157
+ epic?: string | undefined;
158
+ id?: string | undefined;
159
+ links?: Record<string, unknown> | undefined;
160
+ metadata?: Record<string, unknown> | undefined;
161
+ name: string;
162
+ owner_agent?: string | undefined;
163
+ owner_user?: string | undefined;
164
+ parent?: string | undefined;
165
+ priority?: number | undefined;
166
+ project_id?: string | undefined;
167
+ source_id?: string | undefined;
168
+ source_scope?: string | undefined;
169
+ source_type?: string | undefined;
170
+ status?: string | undefined;
171
+ tags?: string[] | undefined;
172
+ target_binary?: string | undefined;
173
+ target_version?: string | undefined;
174
+ thread?: string | undefined;
175
+ };
176
+ user?: string | undefined;
177
+ }): Promise<Task>;
178
+ /**
179
+ * List task blocker cycles for an organization
180
+ * Runs an on-demand diagnostic over unfinished org-owned tasks for the
181
+ * specified organization and returns a forward cursor-paginated page of
182
+ * complete cyclic blocker components. Detection is bounded to owners with at
183
+ * most 100 unfinished tasks. This endpoint is read-only: cycles do not prevent
184
+ * task updates, lease acquisition, or completion.
185
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
186
+ * @param params - Query parameters.
187
+ * @param params.limit - Maximum cycle components to return. Defaults to 50; maximum is 100.
188
+ * @param params.afterCursor - Opaque cursor returned by the preceding page.
189
+ * @returns Successful response
190
+ */
191
+ blockerCycles(org: string, params?: {
192
+ limit?: number;
193
+ afterCursor?: string;
194
+ }): Promise<{
195
+ after_cursor?: string | undefined;
196
+ before_cursor?: string | undefined;
197
+ data: {
198
+ tasks: {
199
+ agent?: string | null | undefined;
200
+ aggregate_version?: number | null | undefined;
201
+ blocked_by_count?: number | undefined;
202
+ closed_at?: string | null | undefined;
203
+ comments_count?: number | undefined;
204
+ created_at?: string | undefined;
205
+ created_by_actor?: {
206
+ alias?: string | null | undefined;
207
+ id?: string | null | undefined;
208
+ name?: string | null | undefined;
209
+ profile_picture?: {
210
+ file?: string | null | undefined;
211
+ height?: number | null | undefined;
212
+ media?: string | null | undefined;
213
+ mime_type?: string | null | undefined;
214
+ refresh_url?: string | null | undefined;
215
+ url?: string | null | undefined;
216
+ width?: number | null | undefined;
217
+ } | null | undefined;
218
+ } | null | undefined;
219
+ created_by_agent?: string | null | undefined;
220
+ created_by_user?: string | null | undefined;
221
+ current_lease?: {
222
+ expires_at: string;
223
+ harness: string;
224
+ session_name: string;
225
+ } | null | undefined;
226
+ description?: string | null | undefined;
227
+ due_date?: string | null | undefined;
228
+ epic?: string | null | undefined;
229
+ id: string;
230
+ is_blocked?: boolean | undefined;
231
+ is_stalled?: boolean | undefined;
232
+ links?: Record<string, unknown> | undefined;
233
+ metadata?: Record<string, unknown> | undefined;
234
+ name: string;
235
+ org?: string | null | undefined;
236
+ owner_actor?: {
237
+ alias?: string | null | undefined;
238
+ id?: string | null | undefined;
239
+ name?: string | null | undefined;
240
+ profile_picture?: {
241
+ file?: string | null | undefined;
242
+ height?: number | null | undefined;
243
+ media?: string | null | undefined;
244
+ mime_type?: string | null | undefined;
245
+ refresh_url?: string | null | undefined;
246
+ url?: string | null | undefined;
247
+ width?: number | null | undefined;
248
+ } | null | undefined;
249
+ } | null | undefined;
250
+ owner_agent?: string | null | undefined;
251
+ owner_user?: string | null | undefined;
252
+ parent?: string | null | undefined;
253
+ priority?: number | undefined;
254
+ project_id?: string | null | undefined;
255
+ sandbox?: string | null | undefined;
256
+ source_id?: string | null | undefined;
257
+ source_scope?: string | null | undefined;
258
+ source_type?: string | null | undefined;
259
+ stalled_since?: string | null | undefined;
260
+ status: string;
261
+ subtasks_count?: number | undefined;
262
+ tags?: string[] | undefined;
263
+ target_binary?: string | null | undefined;
264
+ target_version?: string | null | undefined;
265
+ team?: string | null | undefined;
266
+ thread?: string | null | undefined;
267
+ updated_at?: string | undefined;
268
+ user?: string | null | undefined;
269
+ }[];
270
+ }[];
271
+ has_more: boolean;
272
+ }>;
273
+ /**
274
+ * Find or create a task by source
275
+ * Atomically creates one task per owner, tenant and source. Retries return the current task without updating it. Historical tasks created through ordinary create are not adopted.
276
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
277
+ * @param input - Request body.
278
+ * @param input.agent - Explicit acting agent for privileged callers.
279
+ * @param input.description - Initial task description.
280
+ * @param input.epic - Initial epic grouping.
281
+ * @param input.name - Initial task name.
282
+ * @param input.source_id - Source identity, for example owner/repo#123.
283
+ * @param input.source_scope - Source scope, for example github.
284
+ * @param input.source_type - Source type, for example pull_request.
285
+ * @param input.status - Initial task status.
286
+ * @param input.team - Team owner.
287
+ * @param input.user - User owner, or explicit acting user on a team route.
288
+ * @returns The task and whether this request created it.
289
+ */
290
+ bySource(org: string, input: {
291
+ agent?: string | undefined;
292
+ description?: string | undefined;
293
+ epic?: string | undefined;
294
+ name: string;
295
+ source_id: string;
296
+ source_scope: string;
297
+ source_type: string;
298
+ status?: string | undefined;
299
+ team?: string | undefined;
300
+ user?: string | undefined;
301
+ }): Promise<TaskEnsureResult>;
302
+ /**
303
+ * Get task activity metrics for an organization
304
+ * Returns task activity metrics scoped to org-owned tasks (org tenant, no
305
+ * narrower user/team/agent scope). `open` counts currently open or
306
+ * in-progress org tasks, `created` counts tasks inserted in the UTC-day
307
+ * window, and `completed` counts tasks whose `closed_at` falls in that window
308
+ * while still in a closed status. Hard-deleted tasks are absent from the
309
+ * projection and therefore omitted. The daily series is zero-filled across
310
+ * the requested window and includes reconstructed end-of-day `open` stock.
311
+ * Any organization member may read this count-only summary. Requests from
312
+ * callers without org access return 404 so organization existence is not
313
+ * disclosed.
314
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
315
+ * @param params - Query parameters.
316
+ * @param params.days - UTC-day window. One of 7, 30, 90, or 365; defaults to 30.
317
+ * @returns Successful response
318
+ */
319
+ metrics(org: string, params?: {
320
+ days?: number;
321
+ }): Promise<{
322
+ completed: number;
323
+ created: number;
324
+ days: number;
325
+ end_at: string;
326
+ open: number;
327
+ series: Record<string, unknown>[];
328
+ start_at: string;
329
+ }>;
330
+ /**
331
+ * List an organization's ready tasks
332
+ * Returns open org-owned tasks with no unfinished blockers and no active
333
+ * session lease. Readiness is calculated by the server from the current task
334
+ * projection. It is a snapshot, not a reservation; claim a task lease before
335
+ * starting work.
336
+ * Results are ordered by priority (0, the most urgent, first), then oldest
337
+ * first, so the first page is always the most urgent ready work.
338
+ * Pass `explain=true` to include every open task with a stable readiness reason.
339
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
340
+ * @param params - Query parameters.
341
+ * @param params.explain - Include blocked and actively leased open tasks with exclusion reasons.
342
+ * @param params.assignedToMe - Only include tasks assigned to the authenticated user.
343
+ * @param params.sourceScope - Only include tasks whose source matches this container. Must be supplied with `source_type` and `source_id`.
344
+ * @param params.sourceType - Only include tasks whose source matches this object kind.
345
+ * @param params.sourceId - Only include tasks whose source matches this object identity.
346
+ * @param params.epic - Only include tasks with this exact epic label.
347
+ * @param params.limit - Maximum number of readiness entries to return. Capped at 100.
348
+ * @param params.afterCursor - Opaque cursor returned by the previous page.
349
+ * @returns Successful response
350
+ */
351
+ ready(org: string, params?: {
352
+ explain?: boolean;
353
+ assignedToMe?: boolean;
354
+ sourceScope?: string;
355
+ sourceType?: string;
356
+ sourceId?: string;
357
+ epic?: string;
358
+ limit?: number;
359
+ afterCursor?: string;
360
+ }): Promise<{
361
+ after_cursor?: string | undefined;
362
+ authoritative: boolean;
363
+ before_cursor?: string | undefined;
364
+ data: {
365
+ readiness: "ready" | "blocked" | "leased";
366
+ reason?: "open_blockers" | "active_lease" | null | undefined;
367
+ task: {
368
+ agent?: string | null | undefined;
369
+ aggregate_version?: number | null | undefined;
370
+ blocked_by_count?: number | undefined;
371
+ closed_at?: string | null | undefined;
372
+ comments_count?: number | undefined;
373
+ created_at?: string | undefined;
374
+ created_by_actor?: {
375
+ alias?: string | null | undefined;
376
+ id?: string | null | undefined;
377
+ name?: string | null | undefined;
378
+ profile_picture?: {
379
+ file?: string | null | undefined;
380
+ height?: number | null | undefined;
381
+ media?: string | null | undefined;
382
+ mime_type?: string | null | undefined;
383
+ refresh_url?: string | null | undefined;
384
+ url?: string | null | undefined;
385
+ width?: number | null | undefined;
386
+ } | null | undefined;
387
+ } | null | undefined;
388
+ created_by_agent?: string | null | undefined;
389
+ created_by_user?: string | null | undefined;
390
+ current_lease?: {
391
+ expires_at: string;
392
+ harness: string;
393
+ session_name: string;
394
+ } | null | undefined;
395
+ description?: string | null | undefined;
396
+ due_date?: string | null | undefined;
397
+ epic?: string | null | undefined;
398
+ id: string;
399
+ is_blocked?: boolean | undefined;
400
+ is_stalled?: boolean | undefined;
401
+ links?: Record<string, unknown> | undefined;
402
+ metadata?: Record<string, unknown> | undefined;
403
+ name: string;
404
+ org?: string | null | undefined;
405
+ owner_actor?: {
406
+ alias?: string | null | undefined;
407
+ id?: string | null | undefined;
408
+ name?: string | null | undefined;
409
+ profile_picture?: {
410
+ file?: string | null | undefined;
411
+ height?: number | null | undefined;
412
+ media?: string | null | undefined;
413
+ mime_type?: string | null | undefined;
414
+ refresh_url?: string | null | undefined;
415
+ url?: string | null | undefined;
416
+ width?: number | null | undefined;
417
+ } | null | undefined;
418
+ } | null | undefined;
419
+ owner_agent?: string | null | undefined;
420
+ owner_user?: string | null | undefined;
421
+ parent?: string | null | undefined;
422
+ priority?: number | undefined;
423
+ project_id?: string | null | undefined;
424
+ sandbox?: string | null | undefined;
425
+ source_id?: string | null | undefined;
426
+ source_scope?: string | null | undefined;
427
+ source_type?: string | null | undefined;
428
+ stalled_since?: string | null | undefined;
429
+ status: string;
430
+ subtasks_count?: number | undefined;
431
+ tags?: string[] | undefined;
432
+ target_binary?: string | null | undefined;
433
+ target_version?: string | null | undefined;
434
+ team?: string | null | undefined;
435
+ thread?: string | null | undefined;
436
+ updated_at?: string | undefined;
437
+ user?: string | null | undefined;
438
+ };
439
+ }[];
440
+ has_more: boolean;
441
+ }>;
442
+ /**
443
+ * Search an organization's tasks
444
+ * Performs a full-text search over org-owned tasks for the specified
445
+ * organization and returns matching results. Combine `q` with the optional
446
+ * filters to narrow the result set further. When no query is provided, the
447
+ * endpoint behaves like a filtered list.
448
+ * The `query` field in the response echoes the effective search query.
449
+ * Explicitly personal, team, or agent tasks are excluded here.
450
+ * @param org - Organization ID (`org_...`) whose org-owned tasks should be returned.
451
+ * @param params - Query parameters.
452
+ * @param params.q - Full-text search query matched against task names and descriptions. Takes precedence over `query` when both are provided.
453
+ * @param params.query - Alias for `q`. Use `q` when possible; this parameter exists for compatibility.
454
+ * @param params.status - Filter results by status. One of `"open"`, `"in_progress"`, `"in_review"`, or `"done"`. Omit to include all statuses.
455
+ * @param params.ownerUser - Filter tasks assigned to a specific user. Provide the user's public ID (`usr_...`).
456
+ * @param params.ownerAgent - Filter tasks assigned to a specific agent. Provide the agent's public ID (`agi_...`).
457
+ * @param params.priority - Filter tasks by priority, from 0 (highest) to 4 (lowest).
458
+ * @param params.tag - Return only tasks carrying this tag (matched against the canonical lowercase form).
459
+ * @param params.parent - Return only subtasks of the given task (`tsk_...`), or pass `none` to return only top-level tasks.
460
+ * @param params.sourceScope - Return only tasks whose source matches this container. Must be supplied with `source_type` and `source_id`.
461
+ * @param params.sourceType - Return only tasks whose source matches this object kind. Must be supplied with the other source filters.
462
+ * @param params.sourceId - Return only tasks whose source matches this object identity. Must be supplied with the other source filters.
463
+ * @param params.epic - Return only tasks with this exact epic label.
464
+ * @param params.limit - Maximum number of tasks to return. Capped at 100.
465
+ * @param params.afterCursor - Opaque cursor returned by the previous page.
466
+ * @returns Successful response
467
+ */
468
+ search(org: string, params?: {
469
+ q?: string;
470
+ query?: string;
471
+ status?: string;
472
+ ownerUser?: string;
473
+ ownerAgent?: string;
474
+ priority?: number;
475
+ tag?: string;
476
+ parent?: string;
477
+ sourceScope?: string;
478
+ sourceType?: string;
479
+ sourceId?: string;
480
+ epic?: string;
481
+ limit?: number;
482
+ afterCursor?: string;
483
+ }): Promise<{
484
+ after_cursor?: string | undefined;
485
+ before_cursor?: string | undefined;
486
+ data: {
487
+ agent?: string | null | undefined;
488
+ aggregate_version?: number | null | undefined;
489
+ blocked_by_count?: number | undefined;
490
+ closed_at?: string | null | undefined;
491
+ comments_count?: number | undefined;
492
+ created_at?: string | undefined;
493
+ created_by_actor?: {
494
+ alias?: string | null | undefined;
495
+ id?: string | null | undefined;
496
+ name?: string | null | undefined;
497
+ profile_picture?: {
498
+ file?: string | null | undefined;
499
+ height?: number | null | undefined;
500
+ media?: string | null | undefined;
501
+ mime_type?: string | null | undefined;
502
+ refresh_url?: string | null | undefined;
503
+ url?: string | null | undefined;
504
+ width?: number | null | undefined;
505
+ } | null | undefined;
506
+ } | null | undefined;
507
+ created_by_agent?: string | null | undefined;
508
+ created_by_user?: string | null | undefined;
509
+ current_lease?: {
510
+ expires_at: string;
511
+ harness: string;
512
+ session_name: string;
513
+ } | null | undefined;
514
+ description?: string | null | undefined;
515
+ due_date?: string | null | undefined;
516
+ epic?: string | null | undefined;
517
+ id: string;
518
+ is_blocked?: boolean | undefined;
519
+ is_stalled?: boolean | undefined;
520
+ links?: Record<string, unknown> | undefined;
521
+ metadata?: Record<string, unknown> | undefined;
522
+ name: string;
523
+ org?: string | null | undefined;
524
+ owner_actor?: {
525
+ alias?: string | null | undefined;
526
+ id?: string | null | undefined;
527
+ name?: string | null | undefined;
528
+ profile_picture?: {
529
+ file?: string | null | undefined;
530
+ height?: number | null | undefined;
531
+ media?: string | null | undefined;
532
+ mime_type?: string | null | undefined;
533
+ refresh_url?: string | null | undefined;
534
+ url?: string | null | undefined;
535
+ width?: number | null | undefined;
536
+ } | null | undefined;
537
+ } | null | undefined;
538
+ owner_agent?: string | null | undefined;
539
+ owner_user?: string | null | undefined;
540
+ parent?: string | null | undefined;
541
+ priority?: number | undefined;
542
+ project_id?: string | null | undefined;
543
+ sandbox?: string | null | undefined;
544
+ source_id?: string | null | undefined;
545
+ source_scope?: string | null | undefined;
546
+ source_type?: string | null | undefined;
547
+ stalled_since?: string | null | undefined;
548
+ status: string;
549
+ subtasks_count?: number | undefined;
550
+ tags?: string[] | undefined;
551
+ target_binary?: string | null | undefined;
552
+ target_version?: string | null | undefined;
553
+ team?: string | null | undefined;
554
+ thread?: string | null | undefined;
555
+ updated_at?: string | undefined;
556
+ user?: string | null | undefined;
557
+ }[];
558
+ has_more: boolean;
559
+ query: string;
560
+ }>;
561
+ }
3
562
  export declare class OrgThreadResource {
4
563
  private http;
5
564
  constructor(http: HttpClient);
@@ -10,7 +569,7 @@ export declare class OrgThreadResource {
10
569
  * App-scoped developer tokens for the organization's app can list them too.
11
570
  * @param org - Organization ID (`org_...`) whose org-visibility threads should be listed.
12
571
  * @param params - Query parameters.
13
- * @param params.key - Optional exact thread key, for example `archdev-room`.
572
+ * @param params.key - Optional exact thread key, for example `support-room`.
14
573
  * @returns Successful response
15
574
  */
16
575
  list(org: string, params?: {
@@ -113,8 +672,10 @@ export declare class OrgThreadResource {
113
672
  type: string;
114
673
  url?: string | null | undefined;
115
674
  variants?: {
675
+ byte_size?: number | null | undefined;
116
676
  content_type?: string | null | undefined;
117
677
  created_at?: string | undefined;
678
+ duration_ms?: number | null | undefined;
118
679
  file?: string | undefined;
119
680
  filename?: string | null | undefined;
120
681
  height?: number | null | undefined;
@@ -128,8 +689,10 @@ export declare class OrgThreadResource {
128
689
  url?: string | null | undefined;
129
690
  width?: number | null | undefined;
130
691
  } | null | undefined;
692
+ sha256?: string | null | undefined;
131
693
  updated_at?: string | undefined;
132
694
  url?: string | null | undefined;
695
+ url_expires_at?: string | null | undefined;
133
696
  variant_key?: string | undefined;
134
697
  width?: number | null | undefined;
135
698
  }[] | undefined;
@@ -456,6 +1019,7 @@ export declare class OrgThreadResource {
456
1019
  }
457
1020
  export declare class OrgResource {
458
1021
  private http;
1022
+ readonly tasks: OrgTaskResource;
459
1023
  readonly threads: OrgThreadResource;
460
1024
  constructor(http: HttpClient);
461
1025
  /**
@@ -514,6 +1078,22 @@ export declare class OrgResource {
514
1078
  after_cursor?: string | null | undefined;
515
1079
  before_cursor?: string | null | undefined;
516
1080
  data: {
1081
+ acl?: {
1082
+ add?: {
1083
+ actions: string[];
1084
+ principal?: string | undefined;
1085
+ principal_type: string;
1086
+ }[] | undefined;
1087
+ grants?: {
1088
+ actions: string[];
1089
+ principal?: string | undefined;
1090
+ principal_type: string;
1091
+ }[] | undefined;
1092
+ remove?: {
1093
+ principal?: string | undefined;
1094
+ principal_type: string;
1095
+ }[] | undefined;
1096
+ } | null | undefined;
517
1097
  agent?: string | undefined;
518
1098
  content_type?: string | undefined;
519
1099
  created_at?: string | undefined;
@@ -575,5 +1155,54 @@ export declare class OrgResource {
575
1155
  }[];
576
1156
  has_more: boolean;
577
1157
  }>;
1158
+ /**
1159
+ * List an organization's epic summaries
1160
+ * Groups org-owned tasks by their exact epic label, ordered by label. Closed tasks include cancelled tasks, but cancelled prerequisites still block. Source filters select the tasks summarized; blockers outside that selection still affect readiness. Root ranking is capped per epic and root_blockers_partial is true when that graph is truncated. No epic entity is created.
1161
+ * @param org - Organization ID (`org_...`) owning the tasks.
1162
+ * @param params - Query parameters.
1163
+ * @param params.sourceScope - Exact source scope; supply all three source fields.
1164
+ * @param params.sourceType - Exact source type.
1165
+ * @param params.sourceId - Exact source ID.
1166
+ * @param params.topPriority - Exact highest open priority, from 0 to 4.
1167
+ * @param params.includeClosed - Include epics with no non-closed tasks; defaults to false.
1168
+ * @param params.limit - Maximum epics; defaults to 50, capped at 100.
1169
+ * @param params.afterCursor - Opaque forward cursor from the preceding page.
1170
+ * @returns Successful response
1171
+ */
1172
+ taskEpics(org: string, params?: {
1173
+ sourceScope?: string;
1174
+ sourceType?: string;
1175
+ sourceId?: string;
1176
+ topPriority?: number;
1177
+ includeClosed?: boolean;
1178
+ limit?: number;
1179
+ afterCursor?: string;
1180
+ }): Promise<{
1181
+ after_cursor?: string | null | undefined;
1182
+ before_cursor?: string | null | undefined;
1183
+ data: {
1184
+ blocked_count: number;
1185
+ counts: Record<string, unknown>;
1186
+ epic: string;
1187
+ next_ready: {
1188
+ id: string;
1189
+ name: string;
1190
+ priority: number;
1191
+ status: string;
1192
+ }[];
1193
+ root_blockers: {
1194
+ downstream_count: number;
1195
+ id: string;
1196
+ name: string;
1197
+ priority: number;
1198
+ status: string;
1199
+ }[];
1200
+ root_blockers_partial: boolean;
1201
+ top_open_priority?: number | null | undefined;
1202
+ updated_at: string;
1203
+ }[];
1204
+ has_more: boolean;
1205
+ no_epic_open_count: number;
1206
+ }>;
578
1207
  }
579
1208
  //# sourceMappingURL=orgs.d.ts.map