@archastro/sdk 0.5.2 → 0.6.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 (230) hide show
  1. package/README.md +86 -0
  2. package/dist/auth.d.ts +143 -0
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +187 -1
  5. package/dist/auth.js.map +1 -1
  6. package/dist/channels/api_chat_channel.d.ts +4 -0
  7. package/dist/channels/api_chat_channel.d.ts.map +1 -1
  8. package/dist/channels/api_chat_channel.js +9 -1
  9. package/dist/channels/api_chat_channel.js.map +1 -1
  10. package/dist/client.d.ts +26 -0
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/client.js +27 -1
  13. package/dist/client.js.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/runtime/http-client.d.ts +17 -0
  19. package/dist/runtime/http-client.d.ts.map +1 -1
  20. package/dist/runtime/http-client.js +116 -0
  21. package/dist/runtime/http-client.js.map +1 -1
  22. package/dist/types/ai.d.ts +421 -14
  23. package/dist/types/ai.d.ts.map +1 -1
  24. package/dist/types/ai.js +121 -41
  25. package/dist/types/ai.js.map +1 -1
  26. package/dist/types/artifacts.d.ts +81 -24
  27. package/dist/types/artifacts.d.ts.map +1 -1
  28. package/dist/types/artifacts.js +39 -21
  29. package/dist/types/artifacts.js.map +1 -1
  30. package/dist/types/automations.d.ts +41 -9
  31. package/dist/types/automations.d.ts.map +1 -1
  32. package/dist/types/automations.js +25 -17
  33. package/dist/types/automations.js.map +1 -1
  34. package/dist/types/chat.d.ts +21560 -0
  35. package/dist/types/chat.d.ts.map +1 -0
  36. package/dist/types/chat.js +70 -0
  37. package/dist/types/chat.js.map +1 -0
  38. package/dist/types/common.d.ts +17031 -2136
  39. package/dist/types/common.d.ts.map +1 -1
  40. package/dist/types/common.js +1701 -332
  41. package/dist/types/common.js.map +1 -1
  42. package/dist/types/config.d.ts +245 -37
  43. package/dist/types/config.d.ts.map +1 -1
  44. package/dist/types/config.js +86 -34
  45. package/dist/types/config.js.map +1 -1
  46. package/dist/types/image.d.ts +27 -4
  47. package/dist/types/image.d.ts.map +1 -1
  48. package/dist/types/image.js +17 -10
  49. package/dist/types/image.js.map +1 -1
  50. package/dist/types/index.d.ts +2 -1
  51. package/dist/types/index.d.ts.map +1 -1
  52. package/dist/types/index.js +3 -2
  53. package/dist/types/index.js.map +1 -1
  54. package/dist/types/invites.d.ts +20 -11
  55. package/dist/types/invites.d.ts.map +1 -1
  56. package/dist/types/invites.js +9 -12
  57. package/dist/types/invites.js.map +1 -1
  58. package/dist/types/notifications.d.ts +163 -0
  59. package/dist/types/notifications.d.ts.map +1 -0
  60. package/dist/types/notifications.js +44 -0
  61. package/dist/types/notifications.js.map +1 -0
  62. package/dist/types/teams.d.ts +1640 -231
  63. package/dist/types/teams.d.ts.map +1 -1
  64. package/dist/types/teams.js +76 -45
  65. package/dist/types/teams.js.map +1 -1
  66. package/dist/types/threads.d.ts +1007 -243
  67. package/dist/types/threads.d.ts.map +1 -1
  68. package/dist/types/threads.js +84 -51
  69. package/dist/types/threads.js.map +1 -1
  70. package/dist/types/users.d.ts +98 -18
  71. package/dist/types/users.d.ts.map +1 -1
  72. package/dist/types/users.js +43 -18
  73. package/dist/types/users.js.map +1 -1
  74. package/dist/v1/resources/activity_feed.d.ts +90 -0
  75. package/dist/v1/resources/activity_feed.d.ts.map +1 -1
  76. package/dist/v1/resources/activity_feed.js +56 -2
  77. package/dist/v1/resources/activity_feed.js.map +1 -1
  78. package/dist/v1/resources/agent_computers.d.ts +48 -2
  79. package/dist/v1/resources/agent_computers.d.ts.map +1 -1
  80. package/dist/v1/resources/agent_computers.js +48 -1
  81. package/dist/v1/resources/agent_computers.js.map +1 -1
  82. package/dist/v1/resources/agent_env_vars.d.ts +50 -0
  83. package/dist/v1/resources/agent_env_vars.d.ts.map +1 -0
  84. package/dist/v1/resources/agent_env_vars.js +56 -0
  85. package/dist/v1/resources/agent_env_vars.js.map +1 -0
  86. package/dist/v1/resources/agent_health_actions.d.ts +43 -0
  87. package/dist/v1/resources/agent_health_actions.d.ts.map +1 -0
  88. package/dist/v1/resources/agent_health_actions.js +50 -0
  89. package/dist/v1/resources/agent_health_actions.js.map +1 -0
  90. package/dist/v1/resources/agent_installations.d.ts +100 -0
  91. package/dist/v1/resources/agent_installations.d.ts.map +1 -1
  92. package/dist/v1/resources/agent_installations.js +106 -2
  93. package/dist/v1/resources/agent_installations.js.map +1 -1
  94. package/dist/v1/resources/agent_routine_runs.d.ts +33 -0
  95. package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -0
  96. package/dist/v1/resources/agent_routine_runs.js +48 -0
  97. package/dist/v1/resources/agent_routine_runs.js.map +1 -0
  98. package/dist/v1/resources/agent_routines.d.ts +148 -2
  99. package/dist/v1/resources/agent_routines.d.ts.map +1 -1
  100. package/dist/v1/resources/agent_routines.js +168 -3
  101. package/dist/v1/resources/agent_routines.js.map +1 -1
  102. package/dist/v1/resources/agent_sessions.d.ts +118 -1
  103. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  104. package/dist/v1/resources/agent_sessions.js +134 -2
  105. package/dist/v1/resources/agent_sessions.js.map +1 -1
  106. package/dist/v1/resources/agent_skills.d.ts +83 -1
  107. package/dist/v1/resources/agent_skills.d.ts.map +1 -1
  108. package/dist/v1/resources/agent_skills.js +87 -2
  109. package/dist/v1/resources/agent_skills.js.map +1 -1
  110. package/dist/v1/resources/agent_tools.d.ts +109 -2
  111. package/dist/v1/resources/agent_tools.d.ts.map +1 -1
  112. package/dist/v1/resources/agent_tools.js +114 -2
  113. package/dist/v1/resources/agent_tools.js.map +1 -1
  114. package/dist/v1/resources/agents.d.ts +519 -9
  115. package/dist/v1/resources/agents.d.ts.map +1 -1
  116. package/dist/v1/resources/agents.js +516 -12
  117. package/dist/v1/resources/agents.js.map +1 -1
  118. package/dist/v1/resources/ai.d.ts +174 -3
  119. package/dist/v1/resources/ai.d.ts.map +1 -1
  120. package/dist/v1/resources/ai.js +114 -3
  121. package/dist/v1/resources/ai.js.map +1 -1
  122. package/dist/v1/resources/artifacts.d.ts +73 -0
  123. package/dist/v1/resources/artifacts.d.ts.map +1 -1
  124. package/dist/v1/resources/artifacts.js +74 -2
  125. package/dist/v1/resources/artifacts.js.map +1 -1
  126. package/dist/v1/resources/automation_runs.d.ts +8 -4
  127. package/dist/v1/resources/automation_runs.d.ts.map +1 -1
  128. package/dist/v1/resources/automation_runs.js +9 -5
  129. package/dist/v1/resources/automation_runs.js.map +1 -1
  130. package/dist/v1/resources/automations.d.ts +20 -0
  131. package/dist/v1/resources/automations.d.ts.map +1 -1
  132. package/dist/v1/resources/automations.js +21 -1
  133. package/dist/v1/resources/automations.js.map +1 -1
  134. package/dist/v1/resources/bug_reports.d.ts +29 -0
  135. package/dist/v1/resources/bug_reports.d.ts.map +1 -0
  136. package/dist/v1/resources/bug_reports.js +29 -0
  137. package/dist/v1/resources/bug_reports.js.map +1 -0
  138. package/dist/v1/resources/config.d.ts +437 -4
  139. package/dist/v1/resources/config.d.ts.map +1 -1
  140. package/dist/v1/resources/config.js +497 -9
  141. package/dist/v1/resources/config.js.map +1 -1
  142. package/dist/v1/resources/custom_objects.d.ts +117 -2
  143. package/dist/v1/resources/custom_objects.d.ts.map +1 -1
  144. package/dist/v1/resources/custom_objects.js +132 -3
  145. package/dist/v1/resources/custom_objects.js.map +1 -1
  146. package/dist/v1/resources/files.d.ts +62 -0
  147. package/dist/v1/resources/files.d.ts.map +1 -0
  148. package/dist/v1/resources/files.js +58 -0
  149. package/dist/v1/resources/files.js.map +1 -0
  150. package/dist/v1/resources/index.d.ts +13 -0
  151. package/dist/v1/resources/index.d.ts.map +1 -1
  152. package/dist/v1/resources/index.js +14 -1
  153. package/dist/v1/resources/index.js.map +1 -1
  154. package/dist/v1/resources/installation_sources.d.ts +12 -0
  155. package/dist/v1/resources/installation_sources.d.ts.map +1 -1
  156. package/dist/v1/resources/installation_sources.js +13 -1
  157. package/dist/v1/resources/installation_sources.js.map +1 -1
  158. package/dist/v1/resources/invites.d.ts +15 -0
  159. package/dist/v1/resources/invites.d.ts.map +1 -1
  160. package/dist/v1/resources/invites.js +16 -1
  161. package/dist/v1/resources/invites.js.map +1 -1
  162. package/dist/v1/resources/knowledge_documents.d.ts +104 -0
  163. package/dist/v1/resources/knowledge_documents.d.ts.map +1 -0
  164. package/dist/v1/resources/knowledge_documents.js +112 -0
  165. package/dist/v1/resources/knowledge_documents.js.map +1 -0
  166. package/dist/v1/resources/knowledge_sources.d.ts +190 -0
  167. package/dist/v1/resources/knowledge_sources.d.ts.map +1 -0
  168. package/dist/v1/resources/knowledge_sources.js +176 -0
  169. package/dist/v1/resources/knowledge_sources.js.map +1 -0
  170. package/dist/v1/resources/kv.d.ts +73 -0
  171. package/dist/v1/resources/kv.d.ts.map +1 -1
  172. package/dist/v1/resources/kv.js +96 -3
  173. package/dist/v1/resources/kv.js.map +1 -1
  174. package/dist/v1/resources/notification_preferences.d.ts +61 -0
  175. package/dist/v1/resources/notification_preferences.d.ts.map +1 -0
  176. package/dist/v1/resources/notification_preferences.js +65 -0
  177. package/dist/v1/resources/notification_preferences.js.map +1 -0
  178. package/dist/v1/resources/notifications.d.ts +133 -0
  179. package/dist/v1/resources/notifications.d.ts.map +1 -0
  180. package/dist/v1/resources/notifications.js +136 -0
  181. package/dist/v1/resources/notifications.js.map +1 -0
  182. package/dist/v1/resources/orgs.d.ts +18 -0
  183. package/dist/v1/resources/orgs.d.ts.map +1 -1
  184. package/dist/v1/resources/orgs.js +30 -2
  185. package/dist/v1/resources/orgs.js.map +1 -1
  186. package/dist/v1/resources/slack_channel_bindings.d.ts +101 -0
  187. package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -0
  188. package/dist/v1/resources/slack_channel_bindings.js +114 -0
  189. package/dist/v1/resources/slack_channel_bindings.js.map +1 -0
  190. package/dist/v1/resources/solution_categories.d.ts +36 -0
  191. package/dist/v1/resources/solution_categories.d.ts.map +1 -0
  192. package/dist/v1/resources/solution_categories.js +55 -0
  193. package/dist/v1/resources/solution_categories.js.map +1 -0
  194. package/dist/v1/resources/solution_tags.d.ts +37 -0
  195. package/dist/v1/resources/solution_tags.d.ts.map +1 -0
  196. package/dist/v1/resources/solution_tags.js +54 -0
  197. package/dist/v1/resources/solution_tags.js.map +1 -0
  198. package/dist/v1/resources/solutions.d.ts +313 -0
  199. package/dist/v1/resources/solutions.d.ts.map +1 -0
  200. package/dist/v1/resources/solutions.js +218 -0
  201. package/dist/v1/resources/solutions.js.map +1 -0
  202. package/dist/v1/resources/team_memberships.d.ts +31 -0
  203. package/dist/v1/resources/team_memberships.d.ts.map +1 -1
  204. package/dist/v1/resources/team_memberships.js +49 -2
  205. package/dist/v1/resources/team_memberships.js.map +1 -1
  206. package/dist/v1/resources/teams.d.ts +461 -49
  207. package/dist/v1/resources/teams.d.ts.map +1 -1
  208. package/dist/v1/resources/teams.js +319 -27
  209. package/dist/v1/resources/teams.js.map +1 -1
  210. package/dist/v1/resources/thread_messages.d.ts +70 -0
  211. package/dist/v1/resources/thread_messages.d.ts.map +1 -1
  212. package/dist/v1/resources/thread_messages.js +85 -2
  213. package/dist/v1/resources/thread_messages.js.map +1 -1
  214. package/dist/v1/resources/threads.d.ts +221 -0
  215. package/dist/v1/resources/threads.d.ts.map +1 -1
  216. package/dist/v1/resources/threads.js +252 -4
  217. package/dist/v1/resources/threads.js.map +1 -1
  218. package/dist/v1/resources/users.d.ts +215 -39
  219. package/dist/v1/resources/users.d.ts.map +1 -1
  220. package/dist/v1/resources/users.js +121 -16
  221. package/dist/v1/resources/users.js.map +1 -1
  222. package/dist/v1.d.ts +26 -0
  223. package/dist/v1.d.ts.map +1 -1
  224. package/dist/v1.js +40 -1
  225. package/dist/v1.js.map +1 -1
  226. package/package.json +4 -2
  227. package/dist/types/agents.d.ts +0 -2084
  228. package/dist/types/agents.d.ts.map +0 -1
  229. package/dist/types/agents.js +0 -203
  230. package/dist/types/agents.js.map +0 -1
package/dist/types/ai.js CHANGED
@@ -1,50 +1,130 @@
1
1
  // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: 553c5e455ac7
3
+ // Content hash: a9120b7e4fcc
4
4
  import { z } from "zod";
5
- /** Tool call from assistant message. */
5
+ /** Runtime validator for {@link AIChatStreamDone}. */
6
+ export const aIChatStreamDoneSchema = z.object({
7
+ /** The overall finish reason for the completion. */
8
+ finish_reason: z.string().optional().describe("The overall finish reason for the completion."),
9
+ /** Number of model runs executed, including continuations triggered by tool calls. */
10
+ run_count: z.number().int().optional().describe("Number of model runs executed, including continuations triggered by tool calls."),
11
+ /** Aggregate token usage across every run in the completion (including tool-call continuations), keyed by model ID. */
12
+ total_usage: z.record(z.unknown()).optional().describe("Aggregate token usage across every run in the completion (including tool-call continuations), keyed by model ID."),
13
+ /** Token usage for the final run, keyed by model ID. */
14
+ usage: z.record(z.unknown()).optional().describe("Token usage for the final run, keyed by model ID."),
15
+ }).describe("Terminal event marking the end of a streaming chat completion (SSE `done` event).");
16
+ /** Runtime validator for {@link AIChatStreamError}. */
17
+ export const aIChatStreamErrorSchema = z.object({
18
+ /** Human-readable description of the error that terminated the stream. */
19
+ message: z.string().describe("Human-readable description of the error that terminated the stream."),
20
+ }).describe("Terminal error event for a streaming chat completion (SSE `error` event).");
21
+ /** Runtime validator for {@link AIToolCall}. */
6
22
  export const aIToolCallSchema = z.object({
7
- arguments: z.record(z.unknown()), // Tool arguments
8
- id: z.string(), // Tool call ID
9
- name: z.string(), // Tool/function name
10
- thought_signature: z.string().optional(), // Optional thought signature
11
- });
12
- /** Tool result from tool execution. */
23
+ /** Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing. */
24
+ arguments: z.record(z.unknown()).describe("Arguments the model wants to pass to the tool, as a key-value map. Deserialize and validate these against the tool's input schema before executing."),
25
+ /** Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result. */
26
+ id: z.string().describe("Unique identifier for this tool call, assigned by the model. Use this value as `id` when submitting the corresponding tool result."),
27
+ /** Name of the tool or function the model wants to invoke, e.g. `"web_search"` or `"run_code"`. */
28
+ name: z.string().describe("Name of the tool or function the model wants to invoke, e.g. `\"web_search\"` or `\"run_code\"`."),
29
+ /** Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data. */
30
+ thought_signature: z.string().optional().describe("Opaque signature representing the model's internal reasoning that led to this tool call. `null` when the provider does not expose chain-of-thought data."),
31
+ }).describe("A tool (function) call emitted by the assistant within an AI message. Mirrors the OpenAI tool-call object format.");
32
+ /** Runtime validator for {@link AIToolResult}. */
13
33
  export const aIToolResultSchema = z.object({
14
- content: z.string().optional(), // Tool result content
15
- id: z.string(), // Tool call ID this result responds to
16
- name: z.string(), // Tool/function name
17
- resolution: z.unknown().optional(), // Structured tool resolution
18
- });
19
- /** AI chat message (OpenAI-compatible format). */
34
+ /** Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`. */
35
+ content: z.string().optional().describe("Plain-text output produced by the tool execution. `null` when the result is expressed entirely through `resolution`."),
36
+ /** ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`. */
37
+ id: z.string().describe("ID of the tool call this result satisfies. Must match the `id` from the corresponding `AIToolCall`."),
38
+ /** Name of the tool or function that was executed, e.g. `"web_search"`. Must match the `name` from the corresponding `AIToolCall`. */
39
+ name: z.string().describe("Name of the tool or function that was executed, e.g. `\"web_search\"`. Must match the `name` from the corresponding `AIToolCall`."),
40
+ /** Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`. */
41
+ resolution: z.unknown().optional().describe("Structured result data from the tool execution. Shape varies by tool. `null` when the result is expressed as plain text in `content`."),
42
+ }).describe("The result of executing a tool call, submitted back to the model as a tool-role message. Mirrors the OpenAI tool-result object format.");
43
+ /** Runtime validator for {@link AIMessage}. */
20
44
  export const aIMessageSchema = z.object({
21
- content: z.string().optional(), // Message text content
22
- content_parts: z.array(z.record(z.unknown())).optional(), // Multimodal content parts
23
- resume_token: z.string().optional(), // Resume token for continuing conversations
24
- role: z.string(), // Message role (system, user, assistant, tool)
25
- structured_output: z.unknown().optional(), // Structured output data
26
- tool_calls: z.array(aIToolCallSchema).optional(), // Tool calls from assistant
27
- tool_results: z.array(aIToolResultSchema).optional(), // Tool results from tool execution
28
- });
29
- /** Schema for AI chat completion results. */
45
+ /** Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`. */
46
+ content: z.string().optional().describe("Plain-text content of the message. Present for `system`, `user`, and `assistant` messages. `null` when the message body is expressed through `content_parts` or `tool_calls`."),
47
+ /** Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`"text"`, `"image_url"`, or `"image_data"`). `null` when `content` is set. */
48
+ content_parts: z.array(z.record(z.unknown())).optional().describe("Multimodal content parts for the message, used when the body includes images or mixed media. Each part is a map with a `type` key (`\"text\"`, `\"image_url\"`, or `\"image_data\"`). `null` when `content` is set."),
49
+ /** Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption. */
50
+ resume_token: z.string().optional().describe("Opaque token that can be passed on a subsequent request to resume this conversation from the current state. `null` when the provider does not support conversation resumption."),
51
+ /** The speaker role for this message. One of `"system"`, `"user"`, `"assistant"`, or `"tool"`. */
52
+ role: z.string().describe("The speaker role for this message. One of `\"system\"`, `\"user\"`, `\"assistant\"`, or `\"tool\"`."),
53
+ /** Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested. */
54
+ structured_output: z.unknown().optional().describe("Parsed structured data returned by the model when a JSON schema or structured-output mode was requested. Shape varies by the schema supplied at call time. `null` when structured output was not requested."),
55
+ /** Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles. */
56
+ tool_calls: z.array(aIToolCallSchema).optional().describe("Tool calls requested by the model in an `assistant` message. Present only on assistant messages that invoke one or more tools. `null` on all other message roles."),
57
+ /** Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles. */
58
+ tool_results: z.array(aIToolResultSchema).optional().describe("Tool execution results provided in a `tool` message. Each entry corresponds to a prior tool call by its `id`. `null` on all other message roles."),
59
+ }).describe("A single message in an AI conversation, following the OpenAI-compatible chat format. Used in both request inputs and completion responses.");
60
+ /** Runtime validator for {@link AIChatStreamMessageComplete}. */
61
+ export const aIChatStreamMessageCompleteSchema = z.object({
62
+ /** Why the model stopped generating this message, e.g. `"stop"`, `"length"`, or `"tool_calls"`. */
63
+ finish_reason: z.string().optional().describe("Why the model stopped generating this message, e.g. `\"stop\"`, `\"length\"`, or `\"tool_calls\"`."),
64
+ /** The complete assistant message for this run, assembled from the preceding deltas. */
65
+ message: aIMessageSchema.describe("The complete assistant message for this run, assembled from the preceding deltas."),
66
+ /** Token consumption for this run, keyed by model ID. `null` when usage data is unavailable. */
67
+ usage: z.record(z.unknown()).optional().describe("Token consumption for this run, keyed by model ID. `null` when usage data is unavailable."),
68
+ }).describe("The fully assembled assistant message for one run of a streaming chat completion (SSE `message_complete` event).");
69
+ /** Runtime validator for {@link AIChatStreamMessageDelta}. */
70
+ export const aIChatStreamMessageDeltaSchema = z.object({
71
+ /** The chunk of assistant text produced since the previous `message_delta` event. Concatenate deltas in order to reconstruct the message. */
72
+ delta: z.string().describe("The chunk of assistant text produced since the previous `message_delta` event. Concatenate deltas in order to reconstruct the message."),
73
+ }).describe("Incremental assistant text emitted during a streaming chat completion (SSE `message_delta` event).");
74
+ /** Runtime validator for {@link AIChatStreamToolCallDelta}. */
75
+ export const aIChatStreamToolCallDeltaSchema = z.object({
76
+ /** A chunk of the tool call's serialized arguments. Concatenate deltas to reconstruct the arguments JSON. */
77
+ delta: z.string().optional().describe("A chunk of the tool call's serialized arguments. Concatenate deltas to reconstruct the arguments JSON."),
78
+ /** Identifier of the tool call this delta belongs to, once the model has assigned one. */
79
+ id: z.string().optional().describe("Identifier of the tool call this delta belongs to, once the model has assigned one."),
80
+ /** Name of the tool being called, once known. */
81
+ name: z.string().optional().describe("Name of the tool being called, once known."),
82
+ }).describe("Incremental tool-call data emitted as the model assembles a tool invocation (SSE `tool_call_delta` event).");
83
+ /** Runtime validator for {@link AIChatStreamToolResult}. */
84
+ export const aIChatStreamToolResultSchema = z.object({
85
+ /** The tool's output, serialized as a string. */
86
+ content: z.string().optional().describe("The tool's output, serialized as a string."),
87
+ /** ID of the tool call this result satisfies. */
88
+ id: z.string().optional().describe("ID of the tool call this result satisfies."),
89
+ /** Name of the tool that produced this result. */
90
+ name: z.string().optional().describe("Name of the tool that produced this result."),
91
+ /** How the tool call resolved, e.g. `"ok"` or `"error"`. */
92
+ resolution: z.string().optional().describe("How the tool call resolved, e.g. `\"ok\"` or `\"error\"`."),
93
+ }).describe("The result of a server-executed tool, streamed back into the run (SSE `tool_result` event).");
94
+ /** Runtime validator for {@link AICompletionResult}. */
30
95
  export const aICompletionResultSchema = z.object({
31
- finish_reason: z.string(), // Completion stop reason
32
- message: aIMessageSchema, // Final assistant message
33
- messages: z.array(aIMessageSchema), // Full message history
34
- token_usage: z.record(z.unknown()).optional(), // Token usage keyed by model
35
- });
36
- /** Schema for an AI image generation result. */
96
+ /** The reason the model stopped generating. Common values include `"stop"` (natural end), `"length"` (token limit reached), and `"tool_calls"` (the model invoked a tool). */
97
+ finish_reason: z.string().describe("The reason the model stopped generating. Common values include `\"stop\"` (natural end), `\"length\"` (token limit reached), and `\"tool_calls\"` (the model invoked a tool)."),
98
+ /** The final assistant message produced by the completion. */
99
+ message: aIMessageSchema.describe("The final assistant message produced by the completion."),
100
+ /** The complete message history for the conversation, including all user, assistant, and tool messages in order. */
101
+ messages: z.array(aIMessageSchema).describe("The complete message history for the conversation, including all user, assistant, and tool messages in order."),
102
+ /** Token consumption breakdown keyed by model ID. Each value is a map with `"input_tokens"` and `"output_tokens"` counts. `null` when usage data is unavailable. */
103
+ token_usage: z.record(z.unknown()).optional().describe("Token consumption breakdown keyed by model ID. Each value is a map with `\"input_tokens\"` and `\"output_tokens\"` counts. `null` when usage data is unavailable."),
104
+ }).describe("The result of an AI chat completion request. Returned by chat completion endpoints after the model finishes generating.");
105
+ /** Runtime validator for {@link AIImageResult}. */
37
106
  export const aIImageResultSchema = z.object({
38
- aspect_ratio: z.string().optional(), // Aspect ratio (e.g. 16:9)
39
- height: z.number().int().optional(), // Image height in pixels
40
- image_data: z.string().optional(), // Base64-encoded image data
41
- image_size: z.string().optional(), // Image size tier (e.g. 1K, 2K)
42
- image_type: z.string().optional(), // MIME type (e.g. image/png)
43
- image_url: z.string().optional(), // URL to the generated image
44
- model: z.string(), // Model used for generation
45
- revised_prompt: z.string().optional(), // Provider-revised prompt
46
- size: z.string().optional(), // Size string (e.g. 1024x1024)
47
- usage: z.record(z.unknown()).optional(), // Token/usage information
48
- width: z.number().int().optional(), // Image width in pixels
49
- });
107
+ /** Aspect ratio of the generated image, e.g. `"16:9"` or `"1:1"`. `null` when not reported by the provider. */
108
+ aspect_ratio: z.string().optional().describe("Aspect ratio of the generated image, e.g. `\"16:9\"` or `\"1:1\"`. `null` when not reported by the provider."),
109
+ /** Height of the generated image in pixels. `null` when the provider does not report dimensions. */
110
+ height: z.number().int().optional().describe("Height of the generated image in pixels. `null` when the provider does not report dimensions."),
111
+ /** The generated image encoded as a base64 string. Present when the provider returns inline image data. `null` when `image_url` is set instead. */
112
+ image_data: z.string().optional().describe("The generated image encoded as a base64 string. Present when the provider returns inline image data. `null` when `image_url` is set instead."),
113
+ /** Resolution tier label for the image, e.g. `"1K"` or `"2K"`. `null` when the provider does not include a tier label. */
114
+ image_size: z.string().optional().describe("Resolution tier label for the image, e.g. `\"1K\"` or `\"2K\"`. `null` when the provider does not include a tier label."),
115
+ /** MIME type of the generated image, e.g. `"image/png"` or `"image/jpeg"`. `null` when the provider does not report a content type. */
116
+ image_type: z.string().optional().describe("MIME type of the generated image, e.g. `\"image/png\"` or `\"image/jpeg\"`. `null` when the provider does not report a content type."),
117
+ /** Temporary URL pointing to the generated image hosted by the provider. Present when the provider returns a URL rather than inline data. `null` when `image_data` is set instead. */
118
+ image_url: z.string().optional().describe("Temporary URL pointing to the generated image hosted by the provider. Present when the provider returns a URL rather than inline data. `null` when `image_data` is set instead."),
119
+ /** Identifier of the model that produced the image, e.g. `"dall-e-3"` or `"imagen-3"`. */
120
+ model: z.string().describe("Identifier of the model that produced the image, e.g. `\"dall-e-3\"` or `\"imagen-3\"`."),
121
+ /** The prompt as rewritten by the provider before generation. Some providers (e.g. DALL-E 3) automatically expand or safety-check the original prompt. `null` when the provider does not revise prompts. */
122
+ revised_prompt: z.string().optional().describe("The prompt as rewritten by the provider before generation. Some providers (e.g. DALL-E 3) automatically expand or safety-check the original prompt. `null` when the provider does not revise prompts."),
123
+ /** Canonical size string as returned by the provider, e.g. `"1024x1024"`. `null` when not reported. */
124
+ size: z.string().optional().describe("Canonical size string as returned by the provider, e.g. `\"1024x1024\"`. `null` when not reported."),
125
+ /** Provider-reported token and compute usage for the request. Structure varies by provider. `null` when usage data is unavailable. */
126
+ usage: z.record(z.unknown()).optional().describe("Provider-reported token and compute usage for the request. Structure varies by provider. `null` when usage data is unavailable."),
127
+ /** Width of the generated image in pixels. `null` when the provider does not report dimensions. */
128
+ width: z.number().int().optional().describe("Width of the generated image in pixels. `null` when the provider does not report dimensions."),
129
+ }).describe("The result returned by an AI image generation or editing operation. Contains the generated image (as inline data or a URL) along with dimension, size, and usage metadata.");
50
130
  //# sourceMappingURL=ai.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/types/ai.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wEAAwE;AACxE,6BAA6B;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wCAAwC;AACxC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AAQ,EAAE,CAAC,QAAQ,CAAC,yHAAyH,CAAC;IACrK,uIAAuI;IACvI,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sIAAsI,CAAC;IAClL,sLAAsL;IACtL,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iLAAiL,CAAC;IAC5N,0FAA0F;IAC1F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yFAAyF,CAAC;IACrH,4MAA4M;IAC5M,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uMAAuM,CAAC;IACvP,uGAAuG;IACvG,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oGAAoG,CAAC;IAC1I,sIAAsI;IACtI,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iIAAiI,CAAC;IACnL,mGAAmG;IACnG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8FAA8F,CAAC;CAC5I,CAAC,CAAC,QAAQ,CAAC,4KAA4K,CAAoC,CAAC"}
@@ -1,15 +1,65 @@
1
1
  import { z } from "zod";
2
- /** API schema for an artifact. */
2
+ import type { ImageSource } from "./image.js";
3
+ /** A versioned artifact produced or managed by an agent, such as a generated file, report, or code output. */
4
+ export interface Artifact {
5
+ /** ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced. */
6
+ agent?: string | undefined;
7
+ /** MIME type of the current version's file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached. */
8
+ content_type?: string | undefined;
9
+ /** When the artifact was first created (ISO 8601). */
10
+ created_at?: string | undefined;
11
+ /** ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published. */
12
+ current_version?: string | undefined;
13
+ /** Optional longer description of the artifact's contents or purpose. `null` if not set. */
14
+ description?: string | undefined;
15
+ /** Storage file ID for the current version (`fil_...`). `null` if no file is attached. */
16
+ file?: string | undefined;
17
+ /** Original filename of the current version's file, e.g. `"output.csv"`. `null` if no file is attached. */
18
+ file_name?: string | undefined;
19
+ /** Short-lived signed URL for downloading the current version's file. `null` if no file is attached. */
20
+ file_url?: string | undefined;
21
+ /** Artifact ID (`art_...`). */
22
+ id: string;
23
+ /** Image source metadata for rendering the current version's file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise. */
24
+ image_source?: ImageSource | undefined;
25
+ /** Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set. */
26
+ name?: string | undefined;
27
+ /** ID of the organization this artifact belongs to (`org_...`). */
28
+ org?: string | undefined;
29
+ /** Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped. */
30
+ sandbox?: string | undefined;
31
+ /** ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped. */
32
+ team?: string | undefined;
33
+ /** ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped. */
34
+ thread?: string | undefined;
35
+ /** When the artifact record was last modified (ISO 8601). */
36
+ updated_at?: string | undefined;
37
+ /** ID of the user who created this artifact (`usr_...`). `null` if not user-scoped. */
38
+ user?: string | undefined;
39
+ /** Current version number of the artifact. Increments each time a new version is published. */
40
+ version?: number | undefined;
41
+ }
42
+ /** Runtime validator for {@link Artifact}. */
3
43
  export declare const artifactSchema: z.ZodObject<{
44
+ /** ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced. */
4
45
  agent: z.ZodOptional<z.ZodString>;
46
+ /** MIME type of the current version's file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached. */
5
47
  content_type: z.ZodOptional<z.ZodString>;
48
+ /** When the artifact was first created (ISO 8601). */
6
49
  created_at: z.ZodOptional<z.ZodString>;
50
+ /** ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published. */
7
51
  current_version: z.ZodOptional<z.ZodString>;
52
+ /** Optional longer description of the artifact's contents or purpose. `null` if not set. */
8
53
  description: z.ZodOptional<z.ZodString>;
54
+ /** Storage file ID for the current version (`fil_...`). `null` if no file is attached. */
9
55
  file: z.ZodOptional<z.ZodString>;
56
+ /** Original filename of the current version's file, e.g. `"output.csv"`. `null` if no file is attached. */
10
57
  file_name: z.ZodOptional<z.ZodString>;
58
+ /** Short-lived signed URL for downloading the current version's file. `null` if no file is attached. */
11
59
  file_url: z.ZodOptional<z.ZodString>;
60
+ /** Artifact ID (`art_...`). */
12
61
  id: z.ZodString;
62
+ /** Image source metadata for rendering the current version's file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise. */
13
63
  image_source: z.ZodOptional<z.ZodObject<{
14
64
  file: z.ZodOptional<z.ZodString>;
15
65
  height: z.ZodOptional<z.ZodNumber>;
@@ -19,84 +69,91 @@ export declare const artifactSchema: z.ZodObject<{
19
69
  url: z.ZodOptional<z.ZodString>;
20
70
  width: z.ZodOptional<z.ZodNumber>;
21
71
  }, "strip", z.ZodTypeAny, {
72
+ mime_type?: string | undefined;
22
73
  file?: string | undefined;
23
74
  height?: number | undefined;
24
75
  media?: string | undefined;
25
- mime_type?: string | undefined;
26
76
  refresh_url?: string | undefined;
27
77
  url?: string | undefined;
28
78
  width?: number | undefined;
29
79
  }, {
80
+ mime_type?: string | undefined;
30
81
  file?: string | undefined;
31
82
  height?: number | undefined;
32
83
  media?: string | undefined;
33
- mime_type?: string | undefined;
34
84
  refresh_url?: string | undefined;
35
85
  url?: string | undefined;
36
86
  width?: number | undefined;
37
87
  }>>;
88
+ /** Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set. */
38
89
  name: z.ZodOptional<z.ZodString>;
90
+ /** ID of the organization this artifact belongs to (`org_...`). */
39
91
  org: z.ZodOptional<z.ZodString>;
92
+ /** Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped. */
40
93
  sandbox: z.ZodOptional<z.ZodString>;
94
+ /** ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped. */
41
95
  team: z.ZodOptional<z.ZodString>;
96
+ /** ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped. */
42
97
  thread: z.ZodOptional<z.ZodString>;
98
+ /** When the artifact record was last modified (ISO 8601). */
43
99
  updated_at: z.ZodOptional<z.ZodString>;
100
+ /** ID of the user who created this artifact (`usr_...`). `null` if not user-scoped. */
44
101
  user: z.ZodOptional<z.ZodString>;
102
+ /** Current version number of the artifact. Increments each time a new version is published. */
45
103
  version: z.ZodOptional<z.ZodNumber>;
46
104
  }, "strip", z.ZodTypeAny, {
47
105
  id: string;
48
- file?: string | undefined;
49
- name?: string | undefined;
106
+ agent?: string | undefined;
107
+ thread?: string | undefined;
108
+ team?: string | undefined;
50
109
  org?: string | undefined;
51
- sandbox?: string | undefined;
52
110
  created_at?: string | undefined;
53
- thread?: string | undefined;
111
+ sandbox?: string | undefined;
112
+ current_version?: string | undefined;
113
+ updated_at?: string | undefined;
54
114
  user?: string | undefined;
115
+ file?: string | undefined;
116
+ name?: string | undefined;
117
+ description?: string | undefined;
55
118
  content_type?: string | undefined;
56
119
  image_source?: {
120
+ mime_type?: string | undefined;
57
121
  file?: string | undefined;
58
122
  height?: number | undefined;
59
123
  media?: string | undefined;
60
- mime_type?: string | undefined;
61
124
  refresh_url?: string | undefined;
62
125
  url?: string | undefined;
63
126
  width?: number | undefined;
64
127
  } | undefined;
65
- updated_at?: string | undefined;
66
- description?: string | undefined;
67
128
  version?: number | undefined;
68
- team?: string | undefined;
69
- agent?: string | undefined;
70
- current_version?: string | undefined;
71
129
  file_name?: string | undefined;
72
130
  file_url?: string | undefined;
73
131
  }, {
74
132
  id: string;
75
- file?: string | undefined;
76
- name?: string | undefined;
133
+ agent?: string | undefined;
134
+ thread?: string | undefined;
135
+ team?: string | undefined;
77
136
  org?: string | undefined;
78
- sandbox?: string | undefined;
79
137
  created_at?: string | undefined;
80
- thread?: string | undefined;
138
+ sandbox?: string | undefined;
139
+ current_version?: string | undefined;
140
+ updated_at?: string | undefined;
81
141
  user?: string | undefined;
142
+ file?: string | undefined;
143
+ name?: string | undefined;
144
+ description?: string | undefined;
82
145
  content_type?: string | undefined;
83
146
  image_source?: {
147
+ mime_type?: string | undefined;
84
148
  file?: string | undefined;
85
149
  height?: number | undefined;
86
150
  media?: string | undefined;
87
- mime_type?: string | undefined;
88
151
  refresh_url?: string | undefined;
89
152
  url?: string | undefined;
90
153
  width?: number | undefined;
91
154
  } | undefined;
92
- updated_at?: string | undefined;
93
- description?: string | undefined;
94
155
  version?: number | undefined;
95
- team?: string | undefined;
96
- agent?: string | undefined;
97
- current_version?: string | undefined;
98
156
  file_name?: string | undefined;
99
157
  file_url?: string | undefined;
100
158
  }>;
101
- export type Artifact = z.infer<typeof artifactSchema>;
102
159
  //# sourceMappingURL=artifacts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/types/artifacts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,kCAAkC;AAClC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/types/artifacts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,8GAA8G;AAC9G,MAAM,WAAW,QAAQ;IACvB,6FAA6F;IAC7F,K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;;IAE5F,0FAA0F;;IAE1F,2GAA2G;;IAE3G,wGAAwG;;IAExG,+BAA+B;;IAE/B,wJAAwJ;;;;;;;;;;;;;;;;;;;;;;;;;;IAExJ,mFAAmF;;IAEnF,mEAAmE;;IAEnE,yGAAyG;;IAEzG,qFAAqF;;IAErF,oGAAoG;;IAEpG,6DAA6D;;IAE7D,uFAAuF;;IAEvF,+FAA+F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEmD,CAAC"}
@@ -1,27 +1,45 @@
1
1
  // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: 6821b85d633c
3
+ // Content hash: bcb128cc379a
4
4
  import { z } from "zod";
5
5
  import { imageSourceSchema } from "./image.js";
6
- /** API schema for an artifact. */
6
+ /** Runtime validator for {@link Artifact}. */
7
7
  export const artifactSchema = z.object({
8
- agent: z.string().optional(), // Agent
9
- content_type: z.string().optional(), // MIME content type
10
- created_at: z.string().optional(), // Creation timestamp
11
- current_version: z.string().optional(), // Current version ID
12
- description: z.string().optional(), // Artifact description
13
- file: z.string().optional(), // Storage file
14
- file_name: z.string().optional(), // Original filename
15
- file_url: z.string().optional(), // Signed file URL
16
- id: z.string(), // Artifact ID
17
- image_source: imageSourceSchema.optional(), // Image source metadata
18
- name: z.string().optional(), // Artifact name
19
- org: z.string().optional(), // Organization
20
- sandbox: z.string().optional(), // Sandbox identifier
21
- team: z.string().optional(), // Team
22
- thread: z.string().optional(), // Thread
23
- updated_at: z.string().optional(), // Last update timestamp
24
- user: z.string().optional(), // User
25
- version: z.number().int().optional(), // Current version number
26
- });
8
+ /** ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced. */
9
+ agent: z.string().optional().describe("ID of the agent that produced this artifact (`agt_...`). `null` if not agent-produced."),
10
+ /** MIME type of the current version's file, e.g. `"text/csv"` or `"image/png"`. `null` if no file is attached. */
11
+ content_type: z.string().optional().describe("MIME type of the current version's file, e.g. `\"text/csv\"` or `\"image/png\"`. `null` if no file is attached."),
12
+ /** When the artifact was first created (ISO 8601). */
13
+ created_at: z.string().optional().describe("When the artifact was first created (ISO 8601)."),
14
+ /** ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published. */
15
+ current_version: z.string().optional().describe("ID of the current (latest published) artifact version (`artv_...`). `null` if no version has been published."),
16
+ /** Optional longer description of the artifact's contents or purpose. `null` if not set. */
17
+ description: z.string().optional().describe("Optional longer description of the artifact's contents or purpose. `null` if not set."),
18
+ /** Storage file ID for the current version (`fil_...`). `null` if no file is attached. */
19
+ file: z.string().optional().describe("Storage file ID for the current version (`fil_...`). `null` if no file is attached."),
20
+ /** Original filename of the current version's file, e.g. `"output.csv"`. `null` if no file is attached. */
21
+ file_name: z.string().optional().describe("Original filename of the current version's file, e.g. `\"output.csv\"`. `null` if no file is attached."),
22
+ /** Short-lived signed URL for downloading the current version's file. `null` if no file is attached. */
23
+ file_url: z.string().optional().describe("Short-lived signed URL for downloading the current version's file. `null` if no file is attached."),
24
+ /** Artifact ID (`art_...`). */
25
+ id: z.string().describe("Artifact ID (`art_...`)."),
26
+ /** Image source metadata for rendering the current version's file inline. Present only when `content_type` starts with `"image/"`. `null` otherwise. */
27
+ image_source: imageSourceSchema.optional().describe("Image source metadata for rendering the current version's file inline. Present only when `content_type` starts with `\"image/\"`. `null` otherwise."),
28
+ /** Human-readable name for the artifact, e.g. `"Q2 Report"`. `null` if not set. */
29
+ name: z.string().optional().describe("Human-readable name for the artifact, e.g. `\"Q2 Report\"`. `null` if not set."),
30
+ /** ID of the organization this artifact belongs to (`org_...`). */
31
+ org: z.string().optional().describe("ID of the organization this artifact belongs to (`org_...`)."),
32
+ /** Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped. */
33
+ sandbox: z.string().optional().describe("Identifier of the sandbox environment associated with this artifact. `null` if not sandbox-scoped."),
34
+ /** ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped. */
35
+ team: z.string().optional().describe("ID of the team that owns this artifact (`tea_...`). `null` if not team-scoped."),
36
+ /** ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped. */
37
+ thread: z.string().optional().describe("ID of the thread in which this artifact was created (`thr_...`). `null` if not thread-scoped."),
38
+ /** When the artifact record was last modified (ISO 8601). */
39
+ updated_at: z.string().optional().describe("When the artifact record was last modified (ISO 8601)."),
40
+ /** ID of the user who created this artifact (`usr_...`). `null` if not user-scoped. */
41
+ user: z.string().optional().describe("ID of the user who created this artifact (`usr_...`). `null` if not user-scoped."),
42
+ /** Current version number of the artifact. Increments each time a new version is published. */
43
+ version: z.number().int().optional().describe("Current version number of the artifact. Increments each time a new version is published."),
44
+ }).describe("A versioned artifact produced or managed by an agent, such as a generated file, report, or code output.");
27
45
  //# sourceMappingURL=artifacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/types/artifacts.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wEAAwE;AACxE,6BAA6B;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,kCAAkC;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ;IACtC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,oBAAoB;IACzD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,qBAAqB;IACxD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,qBAAqB;IAC7D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,uBAAuB;IAC3D,IAAI,EA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;IACnE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;IACnG,yGAAyG;IACzG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oGAAoG,CAAC;IAC7I,qFAAqF;IACrF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gFAAgF,CAAC;IACtH,oGAAoG;IACpG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+FAA+F,CAAC;IACvI,6DAA6D;IAC7D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IACpG,uFAAuF;IACvF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kFAAkF,CAAC;IACxH,+FAA+F;IAC/F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0FAA0F,CAAC;CAC1I,CAAC,CAAC,QAAQ,CAAC,yGAAyG,CAA+B,CAAC"}
@@ -1,29 +1,62 @@
1
1
  import { z } from "zod";
2
- /** Schema for an automation run.
3
-
4
- Maps to serialized automation run output from developer portal API.
5
- */
2
+ /** A single execution of an automation triggered by a platform event or direct invocation. Captures the run's status, input payload, and final result. */
3
+ export interface AutomationRun {
4
+ /** ID of the app that owns this automation run (`dap_...`). */
5
+ app: string;
6
+ /** ID of the automation that was executed (`aut_...`). */
7
+ automation: string;
8
+ /** When the automation run was created (ISO 8601). */
9
+ created_at?: string | undefined;
10
+ /** ID of the platform event that triggered this run. `null` for directly invoked automations. */
11
+ event_id?: string | undefined;
12
+ /** Automation run ID (`atr_...`). */
13
+ id: string;
14
+ /** The input event payload that triggered this run. Structure varies by automation type. Defaults to an empty object if no payload was provided. */
15
+ payload?: Record<string, unknown> | undefined;
16
+ /** The output produced after the automation finished executing. Contains workflow-defined keys alongside any returned output. `null` if the run has not yet completed. */
17
+ result?: Record<string, unknown> | undefined;
18
+ /** Current execution status of the run. One of `"pending"` (queued, not yet started), `"running"` (actively executing), `"completed"` (finished successfully), `"failed"` (finished with an error), or `"cancelled"` (stopped before completion). */
19
+ status: string;
20
+ /** ID of the team that owns this run (`tea_...`). `null` if the run is owned by a user rather than a team. */
21
+ team?: string | undefined;
22
+ /** When the automation run record was last updated (ISO 8601). */
23
+ updated_at?: string | undefined;
24
+ /** ID of the user that owns this run (`usr_...`). `null` if the run is owned by a team rather than a user. */
25
+ user?: string | undefined;
26
+ }
27
+ /** Runtime validator for {@link AutomationRun}. */
6
28
  export declare const automationRunSchema: z.ZodObject<{
29
+ /** ID of the app that owns this automation run (`dap_...`). */
7
30
  app: z.ZodString;
31
+ /** ID of the automation that was executed (`aut_...`). */
8
32
  automation: z.ZodString;
33
+ /** When the automation run was created (ISO 8601). */
9
34
  created_at: z.ZodOptional<z.ZodString>;
35
+ /** ID of the platform event that triggered this run. `null` for directly invoked automations. */
10
36
  event_id: z.ZodOptional<z.ZodString>;
37
+ /** Automation run ID (`atr_...`). */
11
38
  id: z.ZodString;
39
+ /** The input event payload that triggered this run. Structure varies by automation type. Defaults to an empty object if no payload was provided. */
12
40
  payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
41
+ /** The output produced after the automation finished executing. Contains workflow-defined keys alongside any returned output. `null` if the run has not yet completed. */
13
42
  result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
43
+ /** Current execution status of the run. One of `"pending"` (queued, not yet started), `"running"` (actively executing), `"completed"` (finished successfully), `"failed"` (finished with an error), or `"cancelled"` (stopped before completion). */
14
44
  status: z.ZodString;
45
+ /** ID of the team that owns this run (`tea_...`). `null` if the run is owned by a user rather than a team. */
15
46
  team: z.ZodOptional<z.ZodString>;
47
+ /** When the automation run record was last updated (ISO 8601). */
16
48
  updated_at: z.ZodOptional<z.ZodString>;
49
+ /** ID of the user that owns this run (`usr_...`). `null` if the run is owned by a team rather than a user. */
17
50
  user: z.ZodOptional<z.ZodString>;
18
51
  }, "strip", z.ZodTypeAny, {
19
52
  status: string;
20
53
  id: string;
21
54
  app: string;
22
55
  automation: string;
56
+ team?: string | undefined;
23
57
  created_at?: string | undefined;
24
- user?: string | undefined;
25
58
  updated_at?: string | undefined;
26
- team?: string | undefined;
59
+ user?: string | undefined;
27
60
  payload?: Record<string, unknown> | undefined;
28
61
  event_id?: string | undefined;
29
62
  result?: Record<string, unknown> | undefined;
@@ -32,13 +65,12 @@ export declare const automationRunSchema: z.ZodObject<{
32
65
  id: string;
33
66
  app: string;
34
67
  automation: string;
68
+ team?: string | undefined;
35
69
  created_at?: string | undefined;
36
- user?: string | undefined;
37
70
  updated_at?: string | undefined;
38
- team?: string | undefined;
71
+ user?: string | undefined;
39
72
  payload?: Record<string, unknown> | undefined;
40
73
  event_id?: string | undefined;
41
74
  result?: Record<string, unknown> | undefined;
42
75
  }>;
43
- export type AutomationRun = z.infer<typeof automationRunSchema>;
44
76
  //# sourceMappingURL=automations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/types/automations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/types/automations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0JAA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