@archastro/sdk 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/auth.d.ts +5 -3
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/auth.js +7 -5
  4. package/dist/auth.js.map +1 -1
  5. package/dist/channels/api_activity_feed_channel.js +2 -2
  6. package/dist/channels/api_activity_feed_channel.js.map +1 -1
  7. package/dist/channels/api_chat_channel.js +2 -2
  8. package/dist/channels/api_chat_channel.js.map +1 -1
  9. package/dist/channels/api_object_channel.d.ts +13 -2
  10. package/dist/channels/api_object_channel.d.ts.map +1 -1
  11. package/dist/channels/api_object_channel.js +21 -6
  12. package/dist/channels/api_object_channel.js.map +1 -1
  13. package/dist/channels/api_tasks_channel.d.ts +30 -0
  14. package/dist/channels/api_tasks_channel.d.ts.map +1 -0
  15. package/dist/channels/api_tasks_channel.js +45 -0
  16. package/dist/channels/api_tasks_channel.js.map +1 -0
  17. package/dist/client.d.ts +10 -0
  18. package/dist/client.d.ts.map +1 -1
  19. package/dist/client.js +12 -2
  20. package/dist/client.js.map +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +3 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/types/ai.d.ts +66 -52
  26. package/dist/types/ai.d.ts.map +1 -1
  27. package/dist/types/ai.js +7 -2
  28. package/dist/types/ai.js.map +1 -1
  29. package/dist/types/artifacts.d.ts +8 -8
  30. package/dist/types/artifacts.js +2 -2
  31. package/dist/types/artifacts.js.map +1 -1
  32. package/dist/types/automations.d.ts +68 -10
  33. package/dist/types/automations.d.ts.map +1 -1
  34. package/dist/types/automations.js +22 -2
  35. package/dist/types/automations.js.map +1 -1
  36. package/dist/types/chat.d.ts +18446 -3559
  37. package/dist/types/chat.d.ts.map +1 -1
  38. package/dist/types/chat.js +2 -2
  39. package/dist/types/chat.js.map +1 -1
  40. package/dist/types/common.d.ts +12646 -2316
  41. package/dist/types/common.d.ts.map +1 -1
  42. package/dist/types/common.js +372 -80
  43. package/dist/types/common.js.map +1 -1
  44. package/dist/types/config.d.ts +22 -10
  45. package/dist/types/config.d.ts.map +1 -1
  46. package/dist/types/config.js +4 -2
  47. package/dist/types/config.js.map +1 -1
  48. package/dist/types/device.d.ts +60 -0
  49. package/dist/types/device.d.ts.map +1 -0
  50. package/dist/types/device.js +25 -0
  51. package/dist/types/device.js.map +1 -0
  52. package/dist/types/extractions.d.ts +452 -0
  53. package/dist/types/extractions.d.ts.map +1 -0
  54. package/dist/types/extractions.js +52 -0
  55. package/dist/types/extractions.js.map +1 -0
  56. package/dist/types/image.js +2 -2
  57. package/dist/types/image.js.map +1 -1
  58. package/dist/types/index.d.ts +3 -0
  59. package/dist/types/index.d.ts.map +1 -1
  60. package/dist/types/index.js +5 -2
  61. package/dist/types/index.js.map +1 -1
  62. package/dist/types/invites.js +2 -2
  63. package/dist/types/invites.js.map +1 -1
  64. package/dist/types/notifications.d.ts +2 -2
  65. package/dist/types/notifications.js +2 -2
  66. package/dist/types/notifications.js.map +1 -1
  67. package/dist/types/oauth.d.ts +117 -0
  68. package/dist/types/oauth.d.ts.map +1 -0
  69. package/dist/types/oauth.js +21 -0
  70. package/dist/types/oauth.js.map +1 -0
  71. package/dist/types/teams.d.ts +2402 -242
  72. package/dist/types/teams.d.ts.map +1 -1
  73. package/dist/types/teams.js +2 -2
  74. package/dist/types/teams.js.map +1 -1
  75. package/dist/types/threads.d.ts +1419 -328
  76. package/dist/types/threads.d.ts.map +1 -1
  77. package/dist/types/threads.js +18 -17
  78. package/dist/types/threads.js.map +1 -1
  79. package/dist/types/users.d.ts +2 -2
  80. package/dist/types/users.js +2 -2
  81. package/dist/types/users.js.map +1 -1
  82. package/dist/v1/resources/activity_feed.d.ts +84 -0
  83. package/dist/v1/resources/activity_feed.d.ts.map +1 -1
  84. package/dist/v1/resources/activity_feed.js +2 -2
  85. package/dist/v1/resources/activity_feed.js.map +1 -1
  86. package/dist/v1/resources/agent_computers.js +2 -2
  87. package/dist/v1/resources/agent_computers.js.map +1 -1
  88. package/dist/v1/resources/agent_env_vars.js +2 -2
  89. package/dist/v1/resources/agent_env_vars.js.map +1 -1
  90. package/dist/v1/resources/agent_health_actions.js +2 -2
  91. package/dist/v1/resources/agent_health_actions.js.map +1 -1
  92. package/dist/v1/resources/agent_installations.d.ts +2 -2
  93. package/dist/v1/resources/agent_installations.d.ts.map +1 -1
  94. package/dist/v1/resources/agent_installations.js +3 -3
  95. package/dist/v1/resources/agent_installations.js.map +1 -1
  96. package/dist/v1/resources/agent_routine_runs.d.ts +16 -1
  97. package/dist/v1/resources/agent_routine_runs.d.ts.map +1 -1
  98. package/dist/v1/resources/agent_routine_runs.js +16 -2
  99. package/dist/v1/resources/agent_routine_runs.js.map +1 -1
  100. package/dist/v1/resources/agent_routines.d.ts +47 -3
  101. package/dist/v1/resources/agent_routines.d.ts.map +1 -1
  102. package/dist/v1/resources/agent_routines.js +42 -3
  103. package/dist/v1/resources/agent_routines.js.map +1 -1
  104. package/dist/v1/resources/agent_sessions.d.ts +14 -2
  105. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  106. package/dist/v1/resources/agent_sessions.js +14 -3
  107. package/dist/v1/resources/agent_sessions.js.map +1 -1
  108. package/dist/v1/resources/agent_skills.js +2 -2
  109. package/dist/v1/resources/agent_skills.js.map +1 -1
  110. package/dist/v1/resources/agent_tools.d.ts +2 -2
  111. package/dist/v1/resources/agent_tools.d.ts.map +1 -1
  112. package/dist/v1/resources/agent_tools.js +3 -3
  113. package/dist/v1/resources/agent_tools.js.map +1 -1
  114. package/dist/v1/resources/agents.d.ts +152 -35
  115. package/dist/v1/resources/agents.d.ts.map +1 -1
  116. package/dist/v1/resources/agents.js +148 -42
  117. package/dist/v1/resources/agents.js.map +1 -1
  118. package/dist/v1/resources/ai.d.ts +81 -40
  119. package/dist/v1/resources/ai.d.ts.map +1 -1
  120. package/dist/v1/resources/ai.js +52 -17
  121. package/dist/v1/resources/ai.js.map +1 -1
  122. package/dist/v1/resources/artifacts.js +2 -2
  123. package/dist/v1/resources/artifacts.js.map +1 -1
  124. package/dist/v1/resources/automation_runs.d.ts +41 -6
  125. package/dist/v1/resources/automation_runs.d.ts.map +1 -1
  126. package/dist/v1/resources/automation_runs.js +47 -8
  127. package/dist/v1/resources/automation_runs.js.map +1 -1
  128. package/dist/v1/resources/automations.d.ts +14 -1
  129. package/dist/v1/resources/automations.d.ts.map +1 -1
  130. package/dist/v1/resources/automations.js +15 -3
  131. package/dist/v1/resources/automations.js.map +1 -1
  132. package/dist/v1/resources/bug_reports.js +2 -2
  133. package/dist/v1/resources/bug_reports.js.map +1 -1
  134. package/dist/v1/resources/config.d.ts +3 -0
  135. package/dist/v1/resources/config.d.ts.map +1 -1
  136. package/dist/v1/resources/config.js +2 -2
  137. package/dist/v1/resources/config.js.map +1 -1
  138. package/dist/v1/resources/custom_objects.js +2 -2
  139. package/dist/v1/resources/custom_objects.js.map +1 -1
  140. package/dist/v1/resources/extractions.d.ts +50 -0
  141. package/dist/v1/resources/extractions.d.ts.map +1 -0
  142. package/dist/v1/resources/extractions.js +48 -0
  143. package/dist/v1/resources/extractions.js.map +1 -0
  144. package/dist/v1/resources/files.d.ts +88 -1
  145. package/dist/v1/resources/files.d.ts.map +1 -1
  146. package/dist/v1/resources/files.js +86 -3
  147. package/dist/v1/resources/files.js.map +1 -1
  148. package/dist/v1/resources/index.d.ts +5 -0
  149. package/dist/v1/resources/index.d.ts.map +1 -1
  150. package/dist/v1/resources/index.js +7 -2
  151. package/dist/v1/resources/index.js.map +1 -1
  152. package/dist/v1/resources/installation_sources.js +2 -2
  153. package/dist/v1/resources/installation_sources.js.map +1 -1
  154. package/dist/v1/resources/invites.js +2 -2
  155. package/dist/v1/resources/invites.js.map +1 -1
  156. package/dist/v1/resources/knowledge_documents.d.ts +33 -1
  157. package/dist/v1/resources/knowledge_documents.d.ts.map +1 -1
  158. package/dist/v1/resources/knowledge_documents.js +25 -2
  159. package/dist/v1/resources/knowledge_documents.js.map +1 -1
  160. package/dist/v1/resources/knowledge_ingestions.d.ts +16 -0
  161. package/dist/v1/resources/knowledge_ingestions.d.ts.map +1 -0
  162. package/dist/v1/resources/knowledge_ingestions.js +21 -0
  163. package/dist/v1/resources/knowledge_ingestions.js.map +1 -0
  164. package/dist/v1/resources/knowledge_sources.d.ts +2 -0
  165. package/dist/v1/resources/knowledge_sources.d.ts.map +1 -1
  166. package/dist/v1/resources/knowledge_sources.js +3 -2
  167. package/dist/v1/resources/knowledge_sources.js.map +1 -1
  168. package/dist/v1/resources/kv.js +2 -2
  169. package/dist/v1/resources/kv.js.map +1 -1
  170. package/dist/v1/resources/notification_preferences.js +2 -2
  171. package/dist/v1/resources/notification_preferences.js.map +1 -1
  172. package/dist/v1/resources/notifications.js +2 -2
  173. package/dist/v1/resources/notifications.js.map +1 -1
  174. package/dist/v1/resources/oauth.d.ts +115 -0
  175. package/dist/v1/resources/oauth.d.ts.map +1 -0
  176. package/dist/v1/resources/oauth.js +112 -0
  177. package/dist/v1/resources/oauth.js.map +1 -0
  178. package/dist/v1/resources/orgs.js +2 -2
  179. package/dist/v1/resources/orgs.js.map +1 -1
  180. package/dist/v1/resources/slack_channel_bindings.d.ts +25 -0
  181. package/dist/v1/resources/slack_channel_bindings.d.ts.map +1 -1
  182. package/dist/v1/resources/slack_channel_bindings.js +24 -2
  183. package/dist/v1/resources/slack_channel_bindings.js.map +1 -1
  184. package/dist/v1/resources/solution_categories.js +2 -2
  185. package/dist/v1/resources/solution_categories.js.map +1 -1
  186. package/dist/v1/resources/solution_instances.d.ts +26 -0
  187. package/dist/v1/resources/solution_instances.d.ts.map +1 -0
  188. package/dist/v1/resources/solution_instances.js +35 -0
  189. package/dist/v1/resources/solution_instances.js.map +1 -0
  190. package/dist/v1/resources/solution_tags.js +2 -2
  191. package/dist/v1/resources/solution_tags.js.map +1 -1
  192. package/dist/v1/resources/solutions.d.ts +85 -1
  193. package/dist/v1/resources/solutions.d.ts.map +1 -1
  194. package/dist/v1/resources/solutions.js +67 -3
  195. package/dist/v1/resources/solutions.js.map +1 -1
  196. package/dist/v1/resources/team_memberships.js +2 -2
  197. package/dist/v1/resources/team_memberships.js.map +1 -1
  198. package/dist/v1/resources/teams.d.ts +210 -4
  199. package/dist/v1/resources/teams.d.ts.map +1 -1
  200. package/dist/v1/resources/teams.js +16 -6
  201. package/dist/v1/resources/teams.js.map +1 -1
  202. package/dist/v1/resources/thread_messages.d.ts +24 -4
  203. package/dist/v1/resources/thread_messages.d.ts.map +1 -1
  204. package/dist/v1/resources/thread_messages.js +9 -6
  205. package/dist/v1/resources/thread_messages.js.map +1 -1
  206. package/dist/v1/resources/threads.d.ts +158 -42
  207. package/dist/v1/resources/threads.d.ts.map +1 -1
  208. package/dist/v1/resources/threads.js +121 -32
  209. package/dist/v1/resources/threads.js.map +1 -1
  210. package/dist/v1/resources/users.d.ts +132 -1
  211. package/dist/v1/resources/users.d.ts.map +1 -1
  212. package/dist/v1/resources/users.js +4 -2
  213. package/dist/v1/resources/users.js.map +1 -1
  214. package/dist/v1/resources/work_items.d.ts +78 -0
  215. package/dist/v1/resources/work_items.d.ts.map +1 -0
  216. package/dist/v1/resources/work_items.js +86 -0
  217. package/dist/v1/resources/work_items.js.map +1 -0
  218. package/dist/v1.d.ts +10 -0
  219. package/dist/v1.d.ts.map +1 -1
  220. package/dist/v1.js +17 -2
  221. package/dist/v1.js.map +1 -1
  222. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
- // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
1
+ // Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: b4afbeb2488f
3
+ // Content hash: 616a0f880281
4
4
  import { z } from "zod";
5
+ import { automationParticipantSlotSchema, automationPrefillsSchema } from "./automations.js";
5
6
  import { configSchema } from "./config.js";
6
7
  import { imageSourceSchema } from "./image.js";
7
8
  import { userSchema } from "./users.js";
@@ -33,7 +34,7 @@ export const aclSchema = z.object({
33
34
  /** Runtime validator for {@link ActivityFeedEntry}. */
34
35
  export const activityFeedEntrySchema = z.object({
35
36
  /** The agent that produced this event. Returns an agent ID (`agi_...`) by default, or an expanded agent object when the association is loaded. `null` if no agent is associated. */
36
- agent: z.union([z.string(), z.object({ acl: z.object({ add: z.array(z.object({ actions: z.array(z.string()), principal: z.string().optional(), principal_type: z.string() })).optional(), grants: z.array(z.object({ actions: z.array(z.string()), principal: z.string().optional(), principal_type: z.string() })).optional(), remove: z.array(z.object({ principal: z.string().optional(), principal_type: z.string() })).optional() }).optional(), app: z.string().optional(), created_at: z.string().optional(), default_model: z.string().optional(), email: z.string().optional(), id: z.string(), identity: z.string().optional(), last_applied_template_config: z.string().optional(), lookup_key: z.string().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), org_name: z.string().optional(), originator: z.string().optional(), phone_number: z.string().optional(), sandbox: z.string().optional(), source_solution: z.object({ solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().optional(), id: z.string(), kind: z.string(), latest_solution: z.string().optional(), latest_version: z.string().optional(), lookup_key: z.string().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), org_logo: z.object({ file: z.string().optional(), height: z.number().int().optional(), media: z.string().optional(), mime_type: z.string().optional(), refresh_url: z.string().optional(), url: z.string().optional(), width: z.number().int().optional() }).optional(), org_name: z.string().optional(), org_slug: z.string().optional(), owners: z.array(z.string()), readme_url: z.string().optional(), solution_id: z.string().optional(), solution_version: z.string().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().optional(), templates: z.array(z.object({ description: z.string().optional(), display_name: z.string().optional(), id: z.string().optional(), kind: z.string(), lookup_key: z.string().optional(), name: z.string().optional(), readme_url: z.string().optional(), virtual_path: z.string().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().optional() }), template: z.object({ created_at: z.string().optional(), description: z.string().optional(), display_name: z.string().optional(), id: z.string(), kind: z.string(), lookup_key: z.string().optional(), name: z.string().optional(), updated_at: z.string().optional(), virtual_path: z.string().optional() }) }).optional(), team: z.string().optional(), template_upgrade_available: z.boolean().optional(), updated_at: z.string().optional(), user: z.string().optional() })]).optional().describe("The agent that produced this event. Returns an agent ID (`agi_...`) by default, or an expanded agent object when the association is loaded. `null` if no agent is associated."),
37
+ agent: z.union([z.string(), z.object({ acl: z.object({ add: z.array(z.object({ actions: z.array(z.string()), principal: z.string().optional(), principal_type: z.string() })).optional(), grants: z.array(z.object({ actions: z.array(z.string()), principal: z.string().optional(), principal_type: z.string() })).optional(), remove: z.array(z.object({ principal: z.string().optional(), principal_type: z.string() })).optional() }).optional(), app: z.string().optional(), created_at: z.string().optional(), default_model: z.string().optional(), description: z.string().optional(), email: z.string().optional(), id: z.string(), identity: z.string().optional(), last_applied_template_config: z.string().optional(), lookup_key: z.string().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), org_name: z.string().optional(), originator: z.string().optional(), phone_number: z.string().optional(), sandbox: z.string().optional(), source_solution: z.object({ current_solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().optional(), events: z.record(z.unknown()).optional(), id: z.string(), image_url: z.string().optional(), kind: z.string(), latest_solution: z.string().optional(), latest_version: z.string().optional(), lookup_key: z.string().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), org_logo: z.object({ file: z.string().optional(), height: z.number().int().optional(), media: z.string().optional(), mime_type: z.string().optional(), refresh_url: z.string().optional(), url: z.string().optional(), width: z.number().int().optional() }).optional(), org_name: z.string().optional(), org_slug: z.string().optional(), owners: z.array(z.string()), readme_url: z.string().optional(), screenshot_urls: z.array(z.string()).optional(), solution_id: z.string().optional(), solution_version: z.string().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().optional(), templates: z.array(z.object({ description: z.string().optional(), details: z.object({ automation_type: z.string().optional(), invoke_contract: z.object({ input_schema: z.record(z.unknown()).optional(), participants: z.array(z.object({ description: z.string().optional(), name: z.string(), required: z.boolean(), type: z.string() })).optional(), prefills: z.object({ participants: z.record(z.unknown()).optional(), payload: z.record(z.unknown()).optional() }) }).optional(), type: z.literal("automation") }).optional(), display_name: z.string().optional(), id: z.string().optional(), kind: z.string(), lookup_key: z.string().optional(), name: z.string().optional(), readme_url: z.string().optional(), virtual_path: z.string().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().optional() }).optional(), solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().optional(), events: z.record(z.unknown()).optional(), id: z.string(), image_url: z.string().optional(), kind: z.string(), latest_solution: z.string().optional(), latest_version: z.string().optional(), lookup_key: z.string().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), org_logo: z.object({ file: z.string().optional(), height: z.number().int().optional(), media: z.string().optional(), mime_type: z.string().optional(), refresh_url: z.string().optional(), url: z.string().optional(), width: z.number().int().optional() }).optional(), org_name: z.string().optional(), org_slug: z.string().optional(), owners: z.array(z.string()), readme_url: z.string().optional(), screenshot_urls: z.array(z.string()).optional(), solution_id: z.string().optional(), solution_version: z.string().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().optional(), templates: z.array(z.object({ description: z.string().optional(), details: z.object({ automation_type: z.string().optional(), invoke_contract: z.object({ input_schema: z.record(z.unknown()).optional(), participants: z.array(z.object({ description: z.string().optional(), name: z.string(), required: z.boolean(), type: z.string() })).optional(), prefills: z.object({ participants: z.record(z.unknown()).optional(), payload: z.record(z.unknown()).optional() }) }).optional(), type: z.literal("automation") }).optional(), display_name: z.string().optional(), id: z.string().optional(), kind: z.string(), lookup_key: z.string().optional(), name: z.string().optional(), readme_url: z.string().optional(), virtual_path: z.string().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().optional() }), template: z.object({ created_at: z.string().optional(), description: z.string().optional(), display_name: z.string().optional(), id: z.string(), kind: z.string(), lookup_key: z.string().optional(), name: z.string().optional(), updated_at: z.string().optional(), virtual_path: z.string().optional() }) }).optional(), team: z.string().optional(), template_upgrade_available: z.boolean().optional(), updated_at: z.string().optional(), user: z.string().optional() })]).optional().describe("The agent that produced this event. Returns an agent ID (`agi_...`) by default, or an expanded agent object when the association is loaded. `null` if no agent is associated."),
37
38
  /** ID of the application that produced this entry (`dap_...`). `null` if not scoped to an app. */
38
39
  app: z.string().optional().describe("ID of the application that produced this entry (`dap_...`). `null` if not scoped to an app."),
39
40
  /** Array of attachment objects associated with this entry. Each attachment has a `type` field (e.g. `"file"`, `"task"`, `"artifact"`) and type-specific additional fields. Empty array when there are no attachments. */
@@ -127,10 +128,17 @@ export const installedConfigEntrySchema = z.object({
127
128
  /** Stored `lookup_key` for this config after any suffix has been applied. `null` for `File` children inside a skill bundle, which are keyed by `(parent_id, relative_path)` rather than by `lookup_key`. */
128
129
  lookup_key: z.string().optional().describe("Stored `lookup_key` for this config after any suffix has been applied. `null` for `File` children inside a skill bundle, which are keyed by `(parent_id, relative_path)` rather than by `lookup_key`."),
129
130
  }).describe("A slim summary of a single config record created during an agent install transaction. Returned as an entry in `AgentCreateResponse.installed_configs`.");
131
+ /** Runtime validator for {@link MessagePolicy}. */
132
+ export const messagePolicySchema = z.object({
133
+ /** Required and non-empty for private visibility. Sources are additive. Routine owner includes the agent owner and optional user co-owner. */
134
+ recipients: z.array(z.string()).optional().describe("Required and non-empty for private visibility. Sources are additive. Routine owner includes the agent owner and optional user co-owner."),
135
+ /** Message visibility. One of `default` or `private`. */
136
+ visibility: z.string().optional().describe("Message visibility. One of `default` or `private`."),
137
+ }).describe("Controls visibility and canonical recipient selection for routine-emitted messages.");
130
138
  /** Runtime validator for {@link LLMConfig}. */
131
139
  export const lLMConfigSchema = z.object({
132
- /** Model identifier to use for this routine or step, e.g. `"claude-sonnet-4-5"`. When omitted, the agent's default model is used. */
133
- model: z.string().optional().describe("Model identifier to use for this routine or step, e.g. `\"claude-sonnet-4-5\"`. When omitted, the agent's default model is used."),
140
+ /** Provider-prefixed model identifier for this routine or step, e.g. `"openrouter/anthropic/claude-sonnet-latest"`. When omitted, the agent's default model is used. */
141
+ model: z.string().optional().describe("Provider-prefixed model identifier for this routine or step, e.g. `\"openrouter/anthropic/claude-sonnet-latest\"`. When omitted, the agent's default model is used."),
134
142
  }).describe("LLM invocation settings for a routine or chain step. When present, overrides the agent-level model selection.");
135
143
  /** Runtime validator for {@link PresetConfig}. */
136
144
  export const presetConfigSchema = z.object({
@@ -203,12 +211,12 @@ export const attachmentSchema = z.object({
203
211
  media_type: z.string().optional().describe("The media category, e.g. `\"video\"` or `\"audio\"`. Present on `media` type only. `null` otherwise."),
204
212
  /** Display name of the media item. Present on `media` type only. `null` otherwise. */
205
213
  name: z.string().optional().describe("Display name of the media item. Present on `media` type only. `null` otherwise."),
206
- /** The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. `null` on other types. */
207
- object: z.record(z.unknown()).optional().describe("The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. `null` on other types."),
214
+ /** The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. `null` on other types. */
215
+ object: z.record(z.unknown()).optional().describe("The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. `null` on other types."),
208
216
  /** Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types. */
209
217
  title: z.string().optional().describe("Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types."),
210
- /** The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, or `"action"`. Determines which additional fields are present. */
211
- type: z.string().describe("The attachment type. One of `\"file\"`, `\"scraped_link\"`, `\"artifact\"`, `\"task\"`, `\"media\"`, or `\"action\"`. Determines which additional fields are present."),
218
+ /** The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, or `"chart"`. Determines which additional fields are present. */
219
+ type: z.string().describe("The attachment type. One of `\"file\"`, `\"scraped_link\"`, `\"artifact\"`, `\"task\"`, `\"media\"`, `\"action\"`, or `\"chart\"`. Determines which additional fields are present."),
212
220
  /** URL to access the resource. A signed download URL for `file` and `artifact` types; the original URL for `scraped_link`; a media playback URL for `media`. `null` on `task` and `action` types. */
213
221
  url: z.string().optional().describe("URL to access the resource. A signed download URL for `file` and `artifact` types; the original URL for `scraped_link`; a media playback URL for `media`. `null` on `task` and `action` types."),
214
222
  /** Array of available encoding variants for the media item (e.g. different resolutions). Present on `media` type only. `null` otherwise. */
@@ -301,6 +309,8 @@ export const messageReactionSchema = z.object({
301
309
  }).describe("A compact reaction record embedded in a message's `reactions` array, representing a single user's reaction to a message.");
302
310
  /** Runtime validator for {@link Message}. */
303
311
  export const messageSchema = z.object({
312
+ /** Access control list for private messages (grants with `read` action). Only returned to resource owners (and privileged/org-admin viewers) via server-side `field_redactions: [acl: :owner]`; `null` for everyone else. */
313
+ acl: aclSchema.optional().describe("Access control list for private messages (grants with `read` action). Only returned to resource owners (and privileged/org-admin viewers) via server-side `field_redactions: [acl: :owner]`; `null` for everyone else."),
304
314
  /** Resolved actor descriptors for the message sender, combining identity and display metadata. Always contains exactly one entry. */
305
315
  actors: z.array(actorSchema).optional().describe("Resolved actor descriptors for the message sender, combining identity and display metadata. Always contains exactly one entry."),
306
316
  /** ID of the agent user that sent this message (`agi_...`). `null` for messages sent by human users. */
@@ -321,6 +331,8 @@ export const messageSchema = z.object({
321
331
  id: z.string().describe("Message ID (`msg_...`)."),
322
332
  /** Client-supplied idempotency key used to deduplicate message sends. `null` if the sender did not provide one. */
323
333
  idempotency_key: z.string().optional().describe("Client-supplied idempotency key used to deduplicate message sends. `null` if the sender did not provide one."),
334
+ /** Whether this message is a deletion tombstone. `true` only on the `message_updated` broadcast emitted when a message is deleted: the original content is replaced with a placeholder and the message no longer exists on the server. Always `false` for live messages. */
335
+ is_deleted: z.boolean().optional().describe("Whether this message is a deletion tombstone. `true` only on the `message_updated` broadcast emitted when a message is deleted: the original content is replaced with a placeholder and the message no longer exists on the server. Always `false` for live messages."),
324
336
  /** Identifier of the legacy chat agent that sent this message, if applicable. `null` for messages sent by users or modern agent users. */
325
337
  legacy_agent: z.string().optional().describe("Identifier of the legacy chat agent that sent this message, if applicable. `null` for messages sent by users or modern agent users."),
326
338
  /** Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set. */
@@ -347,8 +359,12 @@ export const messageSchema = z.object({
347
359
  team: z.string().optional().describe("ID of the team this message is scoped to (`tem_...`). `null` if the message is not team-scoped."),
348
360
  /** ID of the thread this message belongs to (`thr_...`). `null` for messages not yet associated with a thread. */
349
361
  thread: z.string().optional().describe("ID of the thread this message belongs to (`thr_...`). `null` for messages not yet associated with a thread."),
362
+ /** Optional client-defined classification for the message (for example `note` or `status`). Free-form string up to 64 characters. The value `system` is reserved for platform-authored messages and cannot be set by clients. `null` when unset. */
363
+ type: z.string().optional().describe("Optional client-defined classification for the message (for example `note` or `status`). Free-form string up to 64 characters. The value `system` is reserved for platform-authored messages and cannot be set by clients. `null` when unset."),
350
364
  /** The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents. */
351
365
  user: z.string().optional().describe("The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents."),
366
+ /** Message-level visibility. `default` is visible to anyone who can see the parent thread. `private` is restricted to the sender and explicit ACL `read` grantees. */
367
+ visibility: z.enum(["default", "private"]).optional().describe("Message-level visibility. `default` is visible to anyone who can see the parent thread. `private` is restricted to the sender and explicit ACL `read` grantees."),
352
368
  }).describe("A chat message posted in a thread, including its content, author, attachments, reactions, and optional reply metadata.");
353
369
  /** Runtime validator for {@link ComputerExecResult}. */
354
370
  export const computerExecResultSchema = z.object({
@@ -361,6 +377,8 @@ export const computerExecResultSchema = z.object({
361
377
  export const contextDocumentSchema = z.object({
362
378
  /** ID of the agent that owns this document (`agi_...`). `null` if owned by a user or team. */
363
379
  agent: z.string().optional().describe("ID of the agent that owns this document (`agi_...`). `null` if owned by a user or team."),
380
+ /** Lowercase-hex sha256 of the document's full text, covering content only — not `title` or `metadata`. Compare it against a hash of your local copy to decide whether the document needs re-ingesting, without fetching `/content`. `null` for documents ingested before this field existed; it is not backfilled. */
381
+ content_hash: z.string().optional().describe("Lowercase-hex sha256 of the document's full text, covering content only — not `title` or `metadata`. Compare it against a hash of your local copy to decide whether the document needs re-ingesting, without fetching `/content`. `null` for documents ingested before this field existed; it is not backfilled."),
364
382
  /** When the document was created (ISO 8601). */
365
383
  created_at: z.string().optional().describe("When the document was created (ISO 8601)."),
366
384
  /** ID of the backing storage file (`fil_...`) when the document is file-backed. `null` for inline documents. */
@@ -465,6 +483,19 @@ export const customObjectSchema = z.object({
465
483
  /** Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes. */
466
484
  version: z.number().int().optional().describe("Optimistic concurrency version of the object. Increments with each successful update; pass this value in write operations to detect conflicting changes."),
467
485
  }).describe("A custom object belonging to an organization. Custom objects store arbitrary structured data defined by a schema type and are scoped to an org, team, or user.");
486
+ /** Runtime validator for {@link CustomObjectJoinResponse}. */
487
+ export const customObjectJoinResponseSchema = z.object({
488
+ /** Collision-free identifier for this browser connection. */
489
+ connection_id: z.string().describe("Collision-free identifier for this browser connection."),
490
+ /** Current materialized fields, or `null` while waiting for object creation. */
491
+ fields: z.record(z.unknown()).nullable().describe("Current materialized fields, or `null` while waiting for object creation."),
492
+ /** Custom-object ID, or `null` while a row-key subscription waits for creation. */
493
+ id: z.string().nullable().describe("Custom-object ID, or `null` while a row-key subscription waits for creation."),
494
+ /** Current ephemeral collaborator presence. */
495
+ presence: z.array(z.record(z.unknown())).describe("Current ephemeral collaborator presence."),
496
+ /** Whether the current connection may only read the object. */
497
+ readonly: z.boolean().describe("Whether the current connection may only read the object."),
498
+ }).describe("Initial authoritative snapshot returned by a custom-object channel join.");
468
499
  /** Runtime validator for {@link CustomObjectListResponse}. */
469
500
  export const customObjectListResponseSchema = z.object({
470
501
  /** Array of custom objects for the current page. */
@@ -482,33 +513,50 @@ export const customObjectListResponseSchema = z.object({
482
513
  /** Total number of pages available for the current query. */
483
514
  total_pages: z.number().int().describe("Total number of pages available for the current query."),
484
515
  }).describe("A paginated page of custom objects returned by a list operation. Use the pagination fields to navigate through result sets.");
516
+ /** Runtime validator for {@link CustomObjectPresenceAck}. */
517
+ export const customObjectPresenceAckSchema = z.object({
518
+ /** Collision-free connection identifier assigned to this browser connection. */
519
+ connection_id: z.string().describe("Collision-free connection identifier assigned to this browser connection."),
520
+ }).describe("Acknowledges an ephemeral custom-object presence update.");
521
+ /** Runtime validator for {@link CustomObjectSaveResponse}. */
522
+ export const customObjectSaveResponseSchema = z.object({
523
+ /** Durable optimistic-concurrency version after the save. */
524
+ version: z.number().int().describe("Durable optimistic-concurrency version after the save."),
525
+ }).describe("Acknowledges that the current custom-object document reached durable storage.");
485
526
  /** Runtime validator for {@link CustomObjectUpdateFieldsResponse}. */
486
527
  export const customObjectUpdateFieldsResponseSchema = z.object({
487
- /** Map of field names to their new values as applied during the update. Only the fields that were included in the update request are present. */
488
- fields: z.record(z.unknown()).describe("Map of field names to their new values as applied during the update. Only the fields that were included in the update request are present."),
528
+ /** The materialized object fields after the update. */
529
+ fields: z.record(z.unknown()).describe("The materialized object fields after the update."),
489
530
  /** ID of the custom object that was updated (`cobj_...`). */
490
531
  id: z.string().describe("ID of the custom object that was updated (`cobj_...`)."),
532
+ /** Idempotency key acknowledged for this update. */
533
+ operation_id: z.string().describe("Idempotency key acknowledged for this update."),
491
534
  }).describe("Response returned after updating one or more fields on a custom object. Confirms the object that was modified and the field values that were applied.");
492
- /** Runtime validator for {@link DeviceAuthorizationResponse}. */
493
- export const deviceAuthorizationResponseSchema = z.object({
494
- /** Opaque code identifying this device authorization session. Pass this value when polling the token endpoint; do not display it to the user. */
495
- device_code: z.string().describe("Opaque code identifying this device authorization session. Pass this value when polling the token endpoint; do not display it to the user."),
496
- /** Number of seconds until the `device_code` and `user_code` expire. After expiry the user must restart the authorization flow. */
497
- expires_in: z.number().int().describe("Number of seconds until the `device_code` and `user_code` expire. After expiry the user must restart the authorization flow."),
498
- /** Minimum number of seconds to wait between polling attempts on the token endpoint. Polling more frequently will result in a `slow_down` error. */
499
- interval: z.number().int().describe("Minimum number of seconds to wait between polling attempts on the token endpoint. Polling more frequently will result in a `slow_down` error."),
500
- /** Short alphanumeric code the user must enter at `verification_uri` to authorize the device. */
501
- user_code: z.string().describe("Short alphanumeric code the user must enter at `verification_uri` to authorize the device."),
502
- /** URL the user visits to enter the `user_code` and approve the authorization request. */
503
- verification_uri: z.string().describe("URL the user visits to enter the `user_code` and approve the authorization request."),
504
- /** Full verification URL with the `user_code` pre-filled as a query parameter. Display this as a QR code or deep link to reduce manual entry. */
505
- verification_uri_complete: z.string().describe("Full verification URL with the `user_code` pre-filled as a query parameter. Display this as a QR code or deep link to reduce manual entry."),
506
- }).describe("The initial response from an OAuth 2.0 Device Authorization Grant request, containing the codes and URIs needed to complete device authentication.");
507
- /** Runtime validator for {@link DeviceAuthorizationStatusResponse}. */
508
- export const deviceAuthorizationStatusResponseSchema = z.object({
509
- /** Outcome of the device authorization request. One of `"approved"` (the user granted access) or `"denied"` (the user rejected or cancelled the request). */
510
- status: z.string().describe("Outcome of the device authorization request. One of `\"approved\"` (the user granted access) or `\"denied\"` (the user rejected or cancelled the request)."),
511
- }).describe("The result of a completed OAuth 2.0 Device Authorization flow, indicating whether the user approved or denied the device's access request.");
535
+ /** Runtime validator for {@link StorageFile}. */
536
+ export const storageFileSchema = z.object({
537
+ /** MIME type of the file, e.g. `"image/png"` or `"application/pdf"`. */
538
+ content_type: z.string().optional().describe("MIME type of the file, e.g. `\"image/png\"` or `\"application/pdf\"`."),
539
+ /** When the file was uploaded (ISO 8601). */
540
+ created_at: z.string().optional().describe("When the file was uploaded (ISO 8601)."),
541
+ /** Original filename as provided at upload time. */
542
+ filename: z.string().optional().describe("Original filename as provided at upload time."),
543
+ /** File ID (`fil_...`). */
544
+ id: z.string().describe("File ID (`fil_...`)."),
545
+ /** Image display metadata. Present only when `content_type` is an image type; `null` otherwise. */
546
+ image_source: imageSourceSchema.optional().describe("Image display metadata. Present only when `content_type` is an image type; `null` otherwise."),
547
+ /** ID of the organization that owns this file (`org_...`). */
548
+ org: z.string().optional().describe("ID of the organization that owns this file (`org_...`)."),
549
+ /** ID of the sandbox this file is scoped to (`sbx_...`). `null` for files not associated with a sandbox. */
550
+ sandbox: z.string().optional().describe("ID of the sandbox this file is scoped to (`sbx_...`). `null` for files not associated with a sandbox."),
551
+ /** Stable public URL for the file, fetchable without authentication. Present only when the file was shared (`share: true`); does not expire until sharing is disabled. Disabling and re-enabling sharing reactivates the same URL. `null` otherwise. */
552
+ share_url: z.string().optional().describe("Stable public URL for the file, fetchable without authentication. Present only when the file was shared (`share: true`); does not expire until sharing is disabled. Disabling and re-enabling sharing reactivates the same URL. `null` otherwise."),
553
+ /** Size of the file in bytes. */
554
+ size: z.number().int().optional().describe("Size of the file in bytes."),
555
+ /** When the file record was last modified (ISO 8601). */
556
+ updated_at: z.string().optional().describe("When the file record was last modified (ISO 8601)."),
557
+ /** Short-lived signed URL for downloading the file. `null` if a URL could not be generated. */
558
+ url: z.string().optional().describe("Short-lived signed URL for downloading the file. `null` if a URL could not be generated."),
559
+ }).describe("A file stored in the platform's object storage, with metadata and a signed URL for downloading its contents.");
512
560
  /** Runtime validator for {@link AgentHealthAction}. */
513
561
  export const agentHealthActionSchema = z.object({
514
562
  /** ID of the agent this action is scoped to (`agt_...`). `null` for org-level actions. */
@@ -599,7 +647,7 @@ export const installationKindSchema = z.object({
599
647
  export const installationKindListResponseSchema = z.object({
600
648
  /** Array of installation kind objects describing the available integration types and their configuration requirements. */
601
649
  data: z.array(installationKindSchema).describe("Array of installation kind objects describing the available integration types and their configuration requirements."),
602
- }).describe("List response containing all available installation kinds that can be used when configuring an agent installation.");
650
+ }).describe("List response containing the publicly available installation kinds that can be used when configuring an agent installation.");
603
651
  /** Runtime validator for {@link InstallationListResponse}. */
604
652
  export const installationListResponseSchema = z.object({
605
653
  /** Array of installation objects returned for the current page. */
@@ -733,21 +781,6 @@ export const knowledgeSourceKindListResponseSchema = z.object({
733
781
  /** Array of knowledge source kind objects describing each creatable source type. */
734
782
  data: z.array(knowledgeSourceKindSchema).describe("Array of knowledge source kind objects describing each creatable source type."),
735
783
  }).describe("List response containing the knowledge source kinds available for creation via the API.");
736
- /** Runtime validator for {@link OAuthTokenResponse}. */
737
- export const oAuthTokenResponseSchema = z.object({
738
- /** Bearer token used to authenticate API requests. Include this value in the `Authorization: Bearer <token>` header. */
739
- access_token: z.string().describe("Bearer token used to authenticate API requests. Include this value in the `Authorization: Bearer <token>` header."),
740
- /** Number of seconds until the access token expires. */
741
- expires_in: z.number().int().describe("Number of seconds until the access token expires."),
742
- /** Token that can be exchanged for a new access token once the current one expires. `null` if the grant type does not issue refresh tokens. */
743
- refresh_token: z.string().optional().describe("Token that can be exchanged for a new access token once the current one expires. `null` if the grant type does not issue refresh tokens."),
744
- /** Space-separated list of scopes granted to the access token. `null` if scope was not included in the grant request. */
745
- scope: z.string().optional().describe("Space-separated list of scopes granted to the access token. `null` if scope was not included in the grant request."),
746
- /** Token type. Always `"Bearer"`. */
747
- token_type: z.string().describe("Token type. Always `\"Bearer\"`."),
748
- /** The authenticated user associated with this token. `null` when the token is not tied to a specific user (e.g. client-credentials grants). */
749
- user: userSchema.optional().describe("The authenticated user associated with this token. `null` when the token is not tied to a specific user (e.g. client-credentials grants)."),
750
- }).describe("A successful OAuth 2.0 token response. Issued by the token endpoint after a completed authorization or device-flow grant.");
751
784
  /** Runtime validator for {@link PaginatedReplies}. */
752
785
  export const paginatedRepliesSchema = z.object({
753
786
  /** Opaque cursor to pass as the pagination cursor to retrieve the page of replies that follow this one. `null` when no further pages exist. */
@@ -773,25 +806,90 @@ export const routinePresetSchema = z.object({
773
806
  label: z.string().describe("Human-readable display name for the preset, suitable for use in UIs."),
774
807
  /** Stable machine identifier for the preset, e.g. `"do_task"`. Used when assigning a preset to a routine. */
775
808
  name: z.string().describe("Stable machine identifier for the preset, e.g. `\"do_task\"`. Used when assigning a preset to a routine."),
776
- /** Whether routines using this preset maintain a persistent conversation session across invocations. Sessionable presets do not expose instruction or session-mode configuration on individual routines. */
777
- sessionable: z.boolean().describe("Whether routines using this preset maintain a persistent conversation session across invocations. Sessionable presets do not expose instruction or session-mode configuration on individual routines."),
809
+ /** Whether the preset runs inside the thread conversation-session lifecycle. This is distinct from preset_config.session_mode, which controls durable session reuse for do_task and send_message. */
810
+ sessionable: z.boolean().describe("Whether the preset runs inside the thread conversation-session lifecycle. This is distinct from preset_config.session_mode, which controls durable session reuse for do_task and send_message."),
778
811
  /** Whether at most one routine with this preset may exist per agent. Attempting to create a second routine with a unique preset on the same agent will be rejected. */
779
812
  unique: z.boolean().describe("Whether at most one routine with this preset may exist per agent. Attempting to create a second routine with a unique preset on the same agent will be rejected."),
780
813
  }).describe("A named preset that defines the execution model and constraints for a routine. Presets are shared definitions; individual routines reference a preset by name.");
814
+ /** Runtime validator for {@link WorkflowJournalEntry}. */
815
+ export const workflowJournalEntrySchema = z.object({
816
+ /** Durable command identifier associated with the record, when present. */
817
+ command_id: z.string().optional().describe("Durable command identifier associated with the record, when present."),
818
+ /** When this entry was durably committed. */
819
+ created_at: z.string().optional().describe("When this entry was durably committed."),
820
+ /** Journal entry ID (`wdr_...`). */
821
+ id: z.string().describe("Journal entry ID (`wdr_...`)."),
822
+ /** Workflow node associated with the record. `null` for execution-level records. */
823
+ node_id: z.string().optional().describe("Workflow node associated with the record. `null` for execution-level records."),
824
+ /** Replayable workflow record body, including payload, context, environment, metadata, and timestamp. */
825
+ record: z.record(z.unknown()).describe("Replayable workflow record body, including payload, context, environment, metadata, and timestamp."),
826
+ /** Monotonically increasing sequence within the journal. */
827
+ sequence: z.number().int().describe("Monotonically increasing sequence within the journal."),
828
+ /** Durable timer identifier associated with the record, when present. */
829
+ timer_id: z.string().optional().describe("Durable timer identifier associated with the record, when present."),
830
+ /** Workflow record type, such as `node_started`, `node_completed`, or `node_failed`. */
831
+ type: z.string().describe("Workflow record type, such as `node_started`, `node_completed`, or `node_failed`."),
832
+ }).describe("One ordered, replayable record from a durable workflow journal.");
833
+ /** Runtime validator for {@link WorkflowJournal}. */
834
+ export const workflowJournalSchema = z.object({
835
+ /** When durable workflow execution reached a terminal state. `null` while it is active. */
836
+ completed_at: z.string().optional().describe("When durable workflow execution reached a terminal state. `null` while it is active."),
837
+ /** When the journal was created. */
838
+ created_at: z.string().optional().describe("When the journal was created."),
839
+ /** Highest workflow record sequence durably committed to this journal. */
840
+ current_sequence: z.number().int().describe("Highest workflow record sequence durably committed to this journal."),
841
+ /** Journal execution ID (`wde_...`). */
842
+ id: z.string().describe("Journal execution ID (`wde_...`)."),
843
+ /** When durable workflow execution started. */
844
+ started_at: z.string().optional().describe("When durable workflow execution started."),
845
+ /** Current durable execution status: `pending`, `running`, `waiting`, `completed`, `failed`, or `cancelled`. */
846
+ status: z.string().describe("Current durable execution status: `pending`, `running`, `waiting`, `completed`, `failed`, or `cancelled`."),
847
+ /** When the journal was last updated. */
848
+ updated_at: z.string().optional().describe("When the journal was last updated."),
849
+ }).describe("Summary of the durable workflow execution journal associated with a run.");
850
+ /** Runtime validator for {@link RunJournalPage}. */
851
+ export const runJournalPageSchema = z.object({
852
+ /** Opaque cursor for the next entry page. `null` when this is the final page. */
853
+ after_cursor: z.string().optional().describe("Opaque cursor for the next entry page. `null` when this is the final page."),
854
+ /** Always `null`; journal pagination is forward-only. */
855
+ before_cursor: z.string().optional().describe("Always `null`; journal pagination is forward-only."),
856
+ /** Journal entries ordered by ascending sequence. Empty when the run has no journal. */
857
+ data: z.array(workflowJournalEntrySchema).describe("Journal entries ordered by ascending sequence. Empty when the run has no journal."),
858
+ /** Whether additional entries exist after this page. */
859
+ has_more: z.boolean().describe("Whether additional entries exist after this page."),
860
+ /** Durable execution summary. `null` when this run has no journal, which is valid for script-backed, preview, or legacy runs. */
861
+ journal: workflowJournalSchema.optional().describe("Durable execution summary. `null` when this run has no journal, which is valid for script-backed, preview, or legacy runs."),
862
+ }).describe("A forward-paginated journal entry page for an automation or routine run.");
781
863
  /** Runtime validator for {@link SlackChannelBinding}. */
782
864
  export const slackChannelBindingSchema = z.object({
783
- /** IDs of the agents attached to this binding. Empty array when no agents are assigned. */
784
- agents: z.array(z.string()).optional().describe("IDs of the agents attached to this binding. Empty array when no agents are assigned."),
865
+ /** IDs of every agent attached to this binding, including legacy concierge attachments. Use `resident_agent` and `route_kind` for the effective runtime route. */
866
+ agents: z.array(z.string()).optional().describe("IDs of every agent attached to this binding, including legacy concierge attachments. Use `resident_agent` and `route_kind` for the effective runtime route."),
867
+ /** Whether this channel opts into sustained bot-to-bot conversation, exempting it from the reply loop brake. Defaults to `false`. */
868
+ allow_bot_conversations: z.boolean().describe("Whether this channel opts into sustained bot-to-bot conversation, exempting it from the reply loop brake. Defaults to `false`."),
785
869
  /** Slack channel ID (e.g. `C01234ABCDE`) that this binding targets. */
786
870
  channel: z.string().optional().describe("Slack channel ID (e.g. `C01234ABCDE`) that this binding targets."),
787
871
  /** Human-readable label identifying the customer, derived from the binding's embedded config. `null` when not set. */
788
872
  customer_label: z.string().optional().describe("Human-readable label identifying the customer, derived from the binding's embedded config. `null` when not set."),
873
+ /** Staging thread the deposit pipe copies this channel's mirror content into (`thr_…` public ID). `null` when the pipe is off for this binding. */
874
+ deposit_thread: z.string().optional().describe("Staging thread the deposit pipe copies this channel's mirror content into (`thr_…` public ID). `null` when the pipe is off for this binding."),
789
875
  /** Unique identifier for this Slack channel binding. */
790
876
  id: z.string().describe("Unique identifier for this Slack channel binding."),
791
877
  /** ID of the Slack integration that owns this binding. */
792
878
  integration: z.string().optional().describe("ID of the Slack integration that owns this binding."),
793
879
  /** Cached value of Slack's `is_ext_shared` flag for this channel. May be stale relative to Slack's current state. */
794
880
  is_ext_shared_cached: z.boolean().optional().describe("Cached value of Slack's `is_ext_shared` flag for this channel. May be stale relative to Slack's current state."),
881
+ /** Cached value of Slack's `is_private` flag for this channel. May be stale relative to Slack's current state. Private channels are member-managed: mutating the binding requires in-channel evidence. */
882
+ is_private_cached: z.boolean().optional().describe("Cached value of Slack's `is_private` flag for this channel. May be stale relative to Slack's current state. Private channels are member-managed: mutating the binding requires in-channel evidence."),
883
+ /** Whether the resident agent is currently muted. A muted resident keeps mirroring the channel (reading) but stops replying. A timed mute expires automatically at `muted_until`; this reflects the effective state as of now. Defaults to `false`. */
884
+ muted: z.boolean().describe("Whether the resident agent is currently muted. A muted resident keeps mirroring the channel (reading) but stops replying. A timed mute expires automatically at `muted_until`; this reflects the effective state as of now. Defaults to `false`."),
885
+ /** ISO 8601 timestamp when a timed mute expires and replies resume. `null` for an indefinite mute (until an explicit unmute) or when not muted. */
886
+ muted_until: z.string().optional().describe("ISO 8601 timestamp when a timed mute expires and replies resume. `null` for an indefinite mute (until an explicit unmute) or when not muted."),
887
+ /** How the resident agent's replies post to Slack: `thread` (default) threads a reply under the message that triggered it; `top_level` posts it flat in the channel. */
888
+ reply_style: z.string().describe("How the resident agent's replies post to Slack: `thread` (default) threads a reply under the message that triggered it; `top_level` posts it flat in the channel."),
889
+ /** ID of the non-concierge agent selected by Slack ingress. `null` when ingress falls back to the concierge. */
890
+ resident_agent: z.string().optional().describe("ID of the non-concierge agent selected by Slack ingress. `null` when ingress falls back to the concierge."),
891
+ /** Effective Slack ingress route: `fda` for a team-bound resident, `resident` for an unbound resident, or `concierge` when no non-concierge agent is attached. */
892
+ route_kind: z.enum(["fda", "resident", "concierge"]).describe("Effective Slack ingress route: `fda` for a team-bound resident, `resident` for an unbound resident, or `concierge` when no non-concierge agent is attached."),
795
893
  /** ID of the ArchAstro team this channel is bound to. */
796
894
  team: z.string().optional().describe("ID of the ArchAstro team this channel is bound to."),
797
895
  }).describe("A binding that connects a Slack channel to an ArchAstro team and one or more agents, enabling those agents to receive and respond to messages in that channel.");
@@ -808,29 +906,67 @@ export const slackChannelBindingListResponseSchema = z.object({
808
906
  /** Total number of pages available at the current `per_page` size. */
809
907
  total_pages: z.number().int().describe("Total number of pages available at the current `per_page` size."),
810
908
  }).describe("Paginated list of Slack channel bindings for the requested integration or team. Use the `page` and `per_page` fields to navigate pages of results.");
811
- /** Runtime validator for {@link StorageFile}. */
812
- export const storageFileSchema = z.object({
813
- /** MIME type of the file, e.g. `"image/png"` or `"application/pdf"`. */
814
- content_type: z.string().optional().describe("MIME type of the file, e.g. `\"image/png\"` or `\"application/pdf\"`."),
815
- /** When the file was uploaded (ISO 8601). */
816
- created_at: z.string().optional().describe("When the file was uploaded (ISO 8601)."),
817
- /** Original filename as provided at upload time. */
818
- filename: z.string().optional().describe("Original filename as provided at upload time."),
819
- /** File ID (`fil_...`). */
820
- id: z.string().describe("File ID (`fil_...`)."),
821
- /** Image display metadata. Present only when `content_type` is an image type; `null` otherwise. */
822
- image_source: imageSourceSchema.optional().describe("Image display metadata. Present only when `content_type` is an image type; `null` otherwise."),
823
- /** ID of the organization that owns this file (`org_...`). */
824
- org: z.string().optional().describe("ID of the organization that owns this file (`org_...`)."),
825
- /** ID of the sandbox this file is scoped to (`sbx_...`). `null` for files not associated with a sandbox. */
826
- sandbox: z.string().optional().describe("ID of the sandbox this file is scoped to (`sbx_...`). `null` for files not associated with a sandbox."),
827
- /** Size of the file in bytes. */
828
- size: z.number().int().optional().describe("Size of the file in bytes."),
829
- /** When the file record was last modified (ISO 8601). */
830
- updated_at: z.string().optional().describe("When the file record was last modified (ISO 8601)."),
831
- /** Short-lived signed URL for downloading the file. `null` if a URL could not be generated. */
832
- url: z.string().optional().describe("Short-lived signed URL for downloading the file. `null` if a URL could not be generated."),
833
- }).describe("A file stored in the platform's object storage, with metadata and a signed URL for downloading its contents.");
909
+ /** Runtime validator for {@link Task}. */
910
+ export const taskSchema = z.object({
911
+ /** ID of the agent that owns this task (`agi_...`). `null` if the task is scoped to a team or user. */
912
+ agent: z.string().optional().describe("ID of the agent that owns this task (`agi_...`). `null` if the task is scoped to a team or user."),
913
+ /** Number of tasks marked as blocking this task, whether or not they are done (see `GET /tasks/{task}/blockers`). Computed on list/show reads; create/update responses may lag one read behind. */
914
+ blocked_by_count: z.number().int().optional().describe("Number of tasks marked as blocking this task, whether or not they are done (see `GET /tasks/{task}/blockers`). Computed on list/show reads; create/update responses may lag one read behind."),
915
+ /** When the task was marked as done or otherwise closed (ISO 8601). `null` if the task is still open. */
916
+ closed_at: z.string().optional().describe("When the task was marked as done or otherwise closed (ISO 8601). `null` if the task is still open."),
917
+ /** Total number of comments posted on this task. */
918
+ comments_count: z.number().int().optional().describe("Total number of comments posted on this task."),
919
+ /** When the task was created (ISO 8601). */
920
+ created_at: z.string().optional().describe("When the task was created (ISO 8601)."),
921
+ /** Resolved creator details including `id`, `name`, `alias`, and `profile_picture`. `null` if no creator is set or the creator cannot be resolved (e.g. creating agent was deleted). */
922
+ created_by_actor: actorSchema.optional().describe("Resolved creator details including `id`, `name`, `alias`, and `profile_picture`. `null` if no creator is set or the creator cannot be resolved (e.g. creating agent was deleted)."),
923
+ /** ID of the agent that created this task (`agi_...`). `null` if the task was created by a human user, or if the creating agent was later deleted. */
924
+ created_by_agent: z.string().optional().describe("ID of the agent that created this task (`agi_...`). `null` if the task was created by a human user, or if the creating agent was later deleted."),
925
+ /** ID of the user who created this task (`usr_...`). `null` if the task was created by an agent, or if creator provenance was cleared after the creator was deleted. */
926
+ created_by_user: z.string().optional().describe("ID of the user who created this task (`usr_...`). `null` if the task was created by an agent, or if creator provenance was cleared after the creator was deleted."),
927
+ /** Long-form description or notes for the task. `null` if no description has been provided. */
928
+ description: z.string().optional().describe("Long-form description or notes for the task. `null` if no description has been provided."),
929
+ /** Date and time by which the task should be completed (ISO 8601). `null` if no due date is set. */
930
+ due_date: z.string().optional().describe("Date and time by which the task should be completed (ISO 8601). `null` if no due date is set."),
931
+ /** Task ID (`tsk_...`). */
932
+ id: z.string().describe("Task ID (`tsk_...`)."),
933
+ /** `true` while at least one blocking task is not yet done. Informational only — a blocked task can still change status — and derived at read time, so the task un-blocks automatically when its last open blocker completes. Computed on list/show reads; create/update responses report `false` until the next read. */
934
+ is_blocked: z.boolean().optional().describe("`true` while at least one blocking task is not yet done. Informational only — a blocked task can still change status — and derived at read time, so the task un-blocks automatically when its last open blocker completes. Computed on list/show reads; create/update responses report `false` until the next read."),
935
+ /** Key-value map of named URLs or references associated with the task. Returns an empty object when no links have been set. */
936
+ links: z.record(z.unknown()).optional().describe("Key-value map of named URLs or references associated with the task. Returns an empty object when no links have been set."),
937
+ /** Arbitrary key-value map of application-specific data stored alongside the task. Returns an empty object when no metadata has been set. */
938
+ metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value map of application-specific data stored alongside the task. Returns an empty object when no metadata has been set."),
939
+ /** Human-readable title of the task. */
940
+ name: z.string().describe("Human-readable title of the task."),
941
+ /** ID of the organization this task belongs to (`org_...`). `null` for tasks outside an org context. */
942
+ org: z.string().optional().describe("ID of the organization this task belongs to (`org_...`). `null` for tasks outside an org context."),
943
+ /** Resolved owner details including `id`, `name`, `alias`, and `profile_picture`. `null` if the task is unassigned or the owner cannot be resolved (e.g. assigned agent was deleted). */
944
+ owner_actor: actorSchema.optional().describe("Resolved owner details including `id`, `name`, `alias`, and `profile_picture`. `null` if the task is unassigned or the owner cannot be resolved (e.g. assigned agent was deleted)."),
945
+ /** ID of the agent assigned as owner (`agi_...`). `null` if the owner is a human user, the task is unassigned, or the assigned agent was deleted. */
946
+ owner_agent: z.string().optional().describe("ID of the agent assigned as owner (`agi_...`). `null` if the owner is a human user, the task is unassigned, or the assigned agent was deleted."),
947
+ /** ID of the user assigned as owner (`usr_...`). `null` if the owner is an agent, the task is unassigned, or the assigned agent was deleted. */
948
+ owner_user: z.string().optional().describe("ID of the user assigned as owner (`usr_...`). `null` if the owner is an agent, the task is unassigned, or the assigned agent was deleted."),
949
+ /** ID of the parent task when this task is a subtask (`tsk_...`). `null` for top-level tasks. Subtasks nest exactly one level. */
950
+ parent: z.string().optional().describe("ID of the parent task when this task is a subtask (`tsk_...`). `null` for top-level tasks. Subtasks nest exactly one level."),
951
+ /** Priority level of the task from `0` (highest) to `4` (lowest). Defaults to `2` (medium) when not explicitly set. */
952
+ priority: z.number().int().optional().describe("Priority level of the task from `0` (highest) to `4` (lowest). Defaults to `2` (medium) when not explicitly set."),
953
+ /** ID of the developer sandbox this task is scoped to (`dsb_...`). `null` for tasks outside a sandbox environment. */
954
+ sandbox: z.string().optional().describe("ID of the developer sandbox this task is scoped to (`dsb_...`). `null` for tasks outside a sandbox environment."),
955
+ /** Current status of the task. One of `"open"`, `"in_progress"`, or `"done"`. */
956
+ status: z.string().describe("Current status of the task. One of `\"open\"`, `\"in_progress\"`, or `\"done\"`."),
957
+ /** Number of subtasks under this task. Computed on list/show reads; create/update responses may report 0 until the next read. Always 0 for subtasks. */
958
+ subtasks_count: z.number().int().optional().describe("Number of subtasks under this task. Computed on list/show reads; create/update responses may report 0 until the next read. Always 0 for subtasks."),
959
+ /** Labels for grouping and filtering, stored lowercase and de-duplicated. Empty array when untagged. */
960
+ tags: z.array(z.string()).optional().describe("Labels for grouping and filtering, stored lowercase and de-duplicated. Empty array when untagged."),
961
+ /** ID of the team that owns this task (`tem_...`). `null` if the task is not scoped to a team. */
962
+ team: z.string().optional().describe("ID of the team that owns this task (`tem_...`). `null` if the task is not scoped to a team."),
963
+ /** ID of the thread this task is bound to (`thr_...`) — the conversation it was filed from, or the thread passed at creation. `null` for tasks not tied to a thread. */
964
+ thread: z.string().optional().describe("ID of the thread this task is bound to (`thr_...`) — the conversation it was filed from, or the thread passed at creation. `null` for tasks not tied to a thread."),
965
+ /** When the task was last modified (ISO 8601). */
966
+ updated_at: z.string().optional().describe("When the task was last modified (ISO 8601)."),
967
+ /** ID of the user that owns this task (`usr_...`). `null` if the task is scoped to a team. */
968
+ user: z.string().optional().describe("ID of the user that owns this task (`usr_...`). `null` if the task is scoped to a team."),
969
+ }).describe("A task representing a unit of work, optionally assignable to a user or agent.");
834
970
  /** Runtime validator for {@link ValidationResult}. */
835
971
  export const validationResultSchema = z.object({
836
972
  /** List of human-readable error messages describing why validation failed. Empty or absent when `valid` is `true`. */
@@ -840,6 +976,56 @@ export const validationResultSchema = z.object({
840
976
  /** List of human-readable warning messages emitted during validation. Warnings do not cause `valid` to be `false` but indicate potentially problematic configuration. */
841
977
  warnings: z.array(z.string()).optional().describe("List of human-readable warning messages emitted during validation. Warnings do not cause `valid` to be `false` but indicate potentially problematic configuration."),
842
978
  }).describe("The result of a configuration validation check, indicating whether the config is valid and listing any errors or warnings.");
979
+ /** Runtime validator for {@link WorkflowWorkItem}. */
980
+ export const workflowWorkItemSchema = z.object({
981
+ /** Agent assigned to execute this work. */
982
+ agent: z.string().describe("Agent assigned to execute this work."),
983
+ /** Number of times this work has been freshly claimed or reclaimed. */
984
+ attempt_count: z.number().int().describe("Number of times this work has been freshly claimed or reclaimed."),
985
+ /** Opaque journal command identity used to resume the workflow exactly once. */
986
+ command_id: z.string().describe("Opaque journal command identity used to resume the workflow exactly once."),
987
+ created_at: z.string(),
988
+ /** Durable workflow execution that owns this work. */
989
+ execution: z.string().describe("Durable workflow execution that owns this work."),
990
+ /** Work item ID (`wdi_...`). */
991
+ id: z.string().describe("Work item ID (`wdi_...`)."),
992
+ /** When the current claim expires. Null for queued or terminal work. */
993
+ lease_expires_at: z.string().optional().describe("When the current claim expires. Null for queued or terminal work."),
994
+ /** Workflow graph node that yielded the work. */
995
+ node_id: z.string().describe("Workflow graph node that yielded the work."),
996
+ /** Instructions and participant bindings needed to execute the work. */
997
+ payload: z.record(z.unknown()).describe("Instructions and participant bindings needed to execute the work."),
998
+ /** Routine run that owns the execution, when this work came from a routine. */
999
+ routine_run: z.string().optional().describe("Routine run that owns the execution, when this work came from a routine."),
1000
+ /** Current queue lifecycle status. */
1001
+ status: z.string().describe("Current queue lifecycle status."),
1002
+ /** Stable resource discriminator. Always `workflow_work_item`. */
1003
+ type: z.string().describe("Stable resource discriminator. Always `workflow_work_item`."),
1004
+ updated_at: z.string(),
1005
+ }).describe("Externally executable work yielded by a durable workflow.");
1006
+ /** Runtime validator for {@link WorkflowWorkItemLease}. */
1007
+ export const workflowWorkItemLeaseSchema = z.object({
1008
+ /** Opaque lease token that must be persisted and presented for later transitions. */
1009
+ lease_owner: z.string().describe("Opaque lease token that must be persisted and presented for later transitions."),
1010
+ /** The claimed, resumed, started, or heartbeated work item. */
1011
+ work_item: workflowWorkItemSchema.describe("The claimed, resumed, started, or heartbeated work item."),
1012
+ }).describe("A claimed workflow work item and its caller-held lease token.");
1013
+ /** Runtime validator for {@link WorkflowWorkItemClaim}. */
1014
+ export const workflowWorkItemClaimSchema = z.object({
1015
+ /** Claimed or resumed work and its lease; null when no eligible item exists. */
1016
+ data: workflowWorkItemLeaseSchema.optional().describe("Claimed or resumed work and its lease; null when no eligible item exists."),
1017
+ }).describe("Result of polling an agent's durable workflow work queue.");
1018
+ /** Runtime validator for {@link WorkflowWorkItemList}. */
1019
+ export const workflowWorkItemListSchema = z.object({
1020
+ /** Opaque cursor for the next page, or null at the end. */
1021
+ after_cursor: z.string().optional().describe("Opaque cursor for the next page, or null at the end."),
1022
+ /** Always null because queue pagination is forward-only. */
1023
+ before_cursor: z.string().optional().describe("Always null because queue pagination is forward-only."),
1024
+ /** Active work items. Lease tokens are intentionally never included in list responses. */
1025
+ data: z.array(workflowWorkItemSchema).describe("Active work items. Lease tokens are intentionally never included in list responses."),
1026
+ /** Whether another page of work exists. */
1027
+ has_more: z.boolean().describe("Whether another page of work exists."),
1028
+ }).describe("Active durable workflow work available to the viewer.");
843
1029
  /** Runtime validator for {@link WorkingMemoryEntry}. */
844
1030
  export const workingMemoryEntrySchema = z.object({
845
1031
  /** ID of the agent that owns this memory entry (`agt_...`). */
@@ -874,10 +1060,32 @@ export const workingMemoryEntryListResponseSchema = z.object({
874
1060
  /** Total number of pages given the current `page_size`. */
875
1061
  total_pages: z.number().int().optional().describe("Total number of pages given the current `page_size`."),
876
1062
  }).describe("Paginated list of working memory entries stored for an agent. Includes page metadata to support sequential page traversal.");
1063
+ /** Runtime validator for {@link SolutionAutomationInvokeContract}. */
1064
+ export const solutionAutomationInvokeContractSchema = z.object({
1065
+ /** JSON Schema validated against the whole invoke payload, from the automation's `input_schema_config`. `null` when none is configured. */
1066
+ input_schema: z.record(z.unknown()).optional().describe("JSON Schema validated against the whole invoke payload, from the automation's `input_schema_config`. `null` when none is configured."),
1067
+ /** Named participant slots declared by the workflow, sorted by name. `null` when the workflow declares none. Values supplied under the top-level `participants` field are agent IDs. */
1068
+ participants: z.array(automationParticipantSlotSchema).optional().describe("Named participant slots declared by the workflow, sorted by name. `null` when the workflow declares none. Values supplied under the top-level `participants` field are agent IDs."),
1069
+ /** Owner-controlled payload and participant values the platform applies to every invocation. Supplying a conflicting value is rejected. */
1070
+ prefills: automationPrefillsSchema.describe("Owner-controlled payload and participant values the platform applies to every invocation. Supplying a conflicting value is rejected."),
1071
+ }).describe("The schema-driven values an installer may lock when provisioning an invoked automation template.");
1072
+ /** Runtime validator for {@link SolutionAutomationTemplateDetails}. */
1073
+ export const solutionAutomationTemplateDetailsSchema = z.object({
1074
+ /** Automation execution type (`invoked`, `scheduled`, or `trigger`). */
1075
+ automation_type: z.string().optional().describe("Automation execution type (`invoked`, `scheduled`, or `trigger`)."),
1076
+ /** Schema-driven payload and participant inputs for an invoked automation. Used by installation clients to collect locked prefills before provisioning. */
1077
+ invoke_contract: solutionAutomationInvokeContractSchema.optional().describe("Schema-driven payload and participant inputs for an invoked automation. Used by installation clients to collect locked prefills before provisioning."),
1078
+ /** Template-details discriminator. Always `automation` for this variant. */
1079
+ type: z.literal("automation").describe("Template-details discriminator. Always `automation` for this variant."),
1080
+ }).describe("AutomationTemplate-specific details exposed by a Solution template summary.");
1081
+ /** Template-kind-specific Solution summary details, discriminated by `type`. */
1082
+ export const solutionTemplateDetailsSchema = z.discriminatedUnion("type", [solutionAutomationTemplateDetailsSchema]);
877
1083
  /** Runtime validator for {@link SolutionTemplateSummary}. */
878
1084
  export const solutionTemplateSummarySchema = z.object({
879
1085
  /** Short prose blurb from the template body's `description:` field. `null` when the body doesn't set one. Used as the card subhead in the Library carousel. */
880
1086
  description: z.string().optional().describe("Short prose blurb from the template body's `description:` field. `null` when the body doesn't set one. Used as the card subhead in the Library carousel."),
1087
+ /** Template-kind-specific details selected by the `type` discriminator. `null` when this template kind has no additional details. */
1088
+ details: solutionTemplateDetailsSchema.optional().describe("Template-kind-specific details selected by the `type` discriminator. `null` when this template kind has no additional details."),
881
1089
  /** Human-facing label from the template body's `display_name:` field. `null` when the body doesn't set one. Library carousels use this for the card title, falling back to a humanized `name`. */
882
1090
  display_name: z.string().optional().describe("Human-facing label from the template body's `display_name:` field. `null` when the body doesn't set one. Library carousels use this for the card title, falling back to a humanized `name`."),
883
1091
  /** Template config ID (`cfg_...`). `null` for inline-only templates. */
@@ -901,8 +1109,12 @@ export const solutionSummarySchema = z.object({
901
1109
  created_at: z.string().optional().describe("When the Solution config was first imported (ISO 8601)."),
902
1110
  /** Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. `null` when the Solution body does not set one. */
903
1111
  description: z.string().optional().describe("Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. `null` when the Solution body does not set one."),
1112
+ /** Custom analytics events declared in the Solution body's `events:` manifest — a map of event key (snake_case) to its definition (`label`, optional `description`, optional typed `fields`). Dashboards use the `label` as the event's display name. Present as an empty object when the body declares none. */
1113
+ events: z.record(z.unknown()).optional().describe("Custom analytics events declared in the Solution body's `events:` manifest — a map of event key (snake_case) to its definition (`label`, optional `description`, optional typed `fields`). Dashboards use the `label` as the event's display name. Present as an empty object when the body declares none."),
904
1114
  /** Solution config ID (`cfg_...`). */
905
1115
  id: z.string().describe("Solution config ID (`cfg_...`)."),
1116
+ /** Absolute URL of the Solution's cover image — the bundled asset the body's `image:` field names. A stable, non-expiring capability URL (like `org_logo.url`), safe to hold in caches and OpenGraph tags; it 404s if the Solution stops declaring a cover. `null` when the Solution has no cover image, and always `null` for org-scoped rows — the permanent URL is minted for system-scope (catalog) Solutions only. */
1117
+ image_url: z.string().optional().describe("Absolute URL of the Solution's cover image — the bundled asset the body's `image:` field names. A stable, non-expiring capability URL (like `org_logo.url`), safe to hold in caches and OpenGraph tags; it 404s if the Solution stops declaring a cover. `null` when the Solution has no cover image, and always `null` for org-scoped rows — the permanent URL is minted for system-scope (catalog) Solutions only."),
906
1118
  /** Resource type. Always `"Solution"`. */
907
1119
  kind: z.string().describe("Resource type. Always `\"Solution\"`."),
908
1120
  /** When `upgrade_available` is `true`, the system-scope Solution config ID (`cfg_...`) that should be used as the upgrade source. `null` otherwise. */
@@ -917,8 +1129,8 @@ export const solutionSummarySchema = z.object({
917
1129
  name: z.string().optional().describe("Human-facing display name declared in the Solution body. `null` when the Solution body does not set one."),
918
1130
  /** Organization ID (`org_...`) that owns this Solution config, when the Solution is scoped to a specific org. `null` for system-scope (app-level) Solutions. */
919
1131
  org: z.string().optional().describe("Organization ID (`org_...`) that owns this Solution config, when the Solution is scoped to a specific org. `null` for system-scope (app-level) Solutions."),
920
- /** Canonical image-source object for the resolved `org`'s logo, used as the principal category section glyph. Carries the signed `url` plus a `refresh_url`. `null` when `org_slug` is `null` or the org has no logo. */
921
- org_logo: imageSourceSchema.optional().describe("Canonical image-source object for the resolved `org`'s logo, used as the principal category section glyph. Carries the signed `url` plus a `refresh_url`. `null` when `org_slug` is `null` or the org has no logo."),
1132
+ /** Canonical image-source object for the resolved `org`'s logo, used as the principal category section glyph. The `url` is a stable, non-expiring capability URL (`refresh_url` is `null` — there is nothing to refresh). `null` when `org_slug` is `null` or the org has no logo. */
1133
+ org_logo: imageSourceSchema.optional().describe("Canonical image-source object for the resolved `org`'s logo, used as the principal category section glyph. The `url` is a stable, non-expiring capability URL (`refresh_url` is `null` — there is nothing to refresh). `null` when `org_slug` is `null` or the org has no logo."),
922
1134
  /** Display name of the resolved `org`. Pairs with `org_slug` as the principal catalog category's label. `null` when `org_slug` is `null`. */
923
1135
  org_name: z.string().optional().describe("Display name of the resolved `org`. Pairs with `org_slug` as the principal catalog category's label. `null` when `org_slug` is `null`."),
924
1136
  /** Resolved slug of the Solution body's `org` (the publishing organization), when set and it resolves to a real org visible to the viewer. When present this is the Solution's principal catalog category key — clients group the Solution under this org ahead of `category_keys`. `null` when the body has no `org` or it doesn't resolve. */
@@ -927,6 +1139,8 @@ export const solutionSummarySchema = z.object({
927
1139
  owners: z.array(z.string()).describe("Owner scopes this Solution appears under. Members: `\"system\"` (app-level system scope) and/or `\"org\"` (viewer's org scope)."),
928
1140
  /** Relative path to the public README endpoint with a signed token already embedded. `null` when the Solution has no README. Token expires in 1 hour — refresh via `GET /api/v1/solutions/:solution`. */
929
1141
  readme_url: z.string().optional().describe("Relative path to the public README endpoint with a signed token already embedded. `null` when the Solution has no README. Token expires in 1 hour — refresh via `GET /api/v1/solutions/:solution`."),
1142
+ /** Absolute URLs of the Solution's gallery screenshots — the bundled assets the body's `screenshots:` field names, in declared order. Each is a stable, non-expiring capability URL with the same cacheability contract as `image_url` (one shared token, a `v` cache key, and a `file` param selecting the screenshot); a URL 404s if the Solution stops declaring its screenshot. An empty array when the Solution declares none, and always empty for org-scoped rows — the permanent URLs are minted for system-scope (catalog) Solutions only. */
1143
+ screenshot_urls: z.array(z.string()).optional().describe("Absolute URLs of the Solution's gallery screenshots — the bundled assets the body's `screenshots:` field names, in declared order. Each is a stable, non-expiring capability URL with the same cacheability contract as `image_url` (one shared token, a `v` cache key, and a `file` param selecting the screenshot); a URL 404s if the Solution stops declaring its screenshot. An empty array when the Solution declares none, and always empty for org-scoped rows — the permanent URLs are minted for system-scope (catalog) Solutions only."),
930
1144
  /** Stable UUID declared in the Solution body, used to identify the same logical Solution across multiple installed copies and owner scopes. `null` when the body omits it. */
931
1145
  solution_id: z.string().optional().describe("Stable UUID declared in the Solution body, used to identify the same logical Solution across multiple installed copies and owner scopes. `null` when the body omits it."),
932
1146
  /** Semver string declared in the Solution body (e.g. `"1.2.0"`). `null` when the body does not declare a version. */
@@ -946,6 +1160,8 @@ export const solutionSummarySchema = z.object({
946
1160
  }).describe("A catalog entry for an imported Solution, including its display metadata, bundled templates, owner scopes, and any available upgrade information.");
947
1161
  /** Runtime validator for {@link AgentSourceSolution}. */
948
1162
  export const agentSourceSolutionSchema = z.object({
1163
+ /** Summary of the current parent Solution config row. `solution` is the pinned Solution version the agent points at; `current_solution` is the source Solution config row as it exists now. */
1164
+ current_solution: solutionSummarySchema.optional().describe("Summary of the current parent Solution config row. `solution` is the pinned Solution version the agent points at; `current_solution` is the source Solution config row as it exists now."),
949
1165
  /** Summary of the parent Solution, including `upgrade_available`, `latest_version`, and `latest_solution` when a newer system-scoped version is available for the agent's org-scoped Solution. */
950
1166
  solution: solutionSummarySchema.describe("Summary of the parent Solution, including `upgrade_available`, `latest_version`, and `latest_solution` when a newer system-scoped version is available for the agent's org-scoped Solution."),
951
1167
  /** Summary of the AgentTemplate config (`cfg_...`) the agent was last provisioned or updated from. */
@@ -961,6 +1177,8 @@ export const agentSchema = z.object({
961
1177
  created_at: z.string().optional().describe("When the agent was created (ISO 8601)."),
962
1178
  /** Default LLM model identifier used by this agent when no model is specified at runtime (e.g. `"claude-3-7-sonnet-latest"`). */
963
1179
  default_model: z.string().optional().describe("Default LLM model identifier used by this agent when no model is specified at runtime (e.g. `\"claude-3-7-sonnet-latest\"`)."),
1180
+ /** Human-readable description of what the agent does. `null` if not set. */
1181
+ description: z.string().optional().describe("Human-readable description of what the agent does. `null` if not set."),
964
1182
  /** Email address provisioned for this agent. `null` if email delivery is not configured. */
965
1183
  email: z.string().optional().describe("Email address provisioned for this agent. `null` if email delivery is not configured."),
966
1184
  /** Agent ID (`agi_...`). */
@@ -989,8 +1207,8 @@ export const agentSchema = z.object({
989
1207
  source_solution: agentSourceSolutionSchema.optional().describe("Source Solution and AgentTemplate summary for agents provisioned from a Solution. Includes `upgrade_available`, `latest_version`, and `latest_solution` so you can render an upgrade badge without a separate dry-run call. `null` for hand-built agents and agents whose tracked template or parent Solution has been deleted. Populated only on single-agent GET responses, never on list endpoints."),
990
1208
  /** ID of the team that owns this agent (`tem_...`). `null` if the agent is not team-scoped. */
991
1209
  team: z.string().optional().describe("ID of the team that owns this agent (`tem_...`). `null` if the agent is not team-scoped."),
992
- /** True when the agent's last-applied template version is behind the current version of its AgentTemplate config — i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed only on list endpoints; `null` on single-agent GET. */
993
- template_upgrade_available: z.boolean().optional().describe("True when the agent's last-applied template version is behind the current version of its AgentTemplate config — i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed only on list endpoints; `null` on single-agent GET."),
1210
+ /** True when the agent's last-applied template version is behind the current version of its AgentTemplate config — i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed on both the list endpoints and single-agent GET. Distinct from `source_solution.upgrade_available`, which compares Solution *versions*: an agent can lag its template (`template_upgrade_available: true`) while the org already holds the latest Solution version (`upgrade_available: false`). */
1211
+ template_upgrade_available: z.boolean().optional().describe("True when the agent's last-applied template version is behind the current version of its AgentTemplate config — i.e. reapplying the template (a per-agent upgrade) would bring it newer Solution content. Self-clears once the agent is reapplied. Computed on both the list endpoints and single-agent GET. Distinct from `source_solution.upgrade_available`, which compares Solution *versions*: an agent can lag its template (`template_upgrade_available: true`) while the org already holds the latest Solution version (`upgrade_available: false`)."),
994
1212
  /** When the agent was last modified (ISO 8601). */
995
1213
  updated_at: z.string().optional().describe("When the agent was last modified (ISO 8601)."),
996
1214
  /** ID of the user that owns this agent (`usr_...`). `null` if the agent is not user-scoped. */
@@ -1142,8 +1360,8 @@ export const agentListResponseSchema = z.object({
1142
1360
  }).describe("Paginated list of agent objects. Use the pagination fields to traverse multiple pages of results.");
1143
1361
  /** Runtime validator for {@link AgentRoutine}. */
1144
1362
  export const agentRoutineSchema = z.object({
1145
- /** Access control list for the routine. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions`. `null` when no ACL restrictions are applied and the routine is accessible to all members of its scope. */
1146
- acl: aclSchema.optional().describe("Access control list for the routine. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions`. `null` when no ACL restrictions are applied and the routine is accessible to all members of its scope."),
1363
+ /** Access control list for the routine. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions` (`"read"`, `"invoke"`, or `"assign"` — an `"assign"` grant names the agents or orgs that may be handed this routine's embedded work items). `null` when no ACL restrictions are applied and the routine is accessible to all members of its scope. */
1364
+ acl: aclSchema.optional().describe("Access control list for the routine. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions` (`\"read\"`, `\"invoke\"`, or `\"assign\"` — an `\"assign\"` grant names the agents or orgs that may be handed this routine's embedded work items). `null` when no ACL restrictions are applied and the routine is accessible to all members of its scope."),
1147
1365
  /** ID of the agent that owns this routine (`agi_...`). */
1148
1366
  agent: z.string().optional().describe("ID of the agent that owns this routine (`agi_...`)."),
1149
1367
  /** Application that scopes this routine (`dap_...`). */
@@ -1166,6 +1384,8 @@ export const agentRoutineSchema = z.object({
1166
1384
  last_applied_template_config: z.string().optional().describe("ID of the AgentRoutineTemplate Config this routine was last provisioned or updated from (`cfg_...`). `null` for hand-built routines."),
1167
1385
  /** Unique human-readable key used to look up this routine without knowing its ID. `null` when not set. */
1168
1386
  lookup_key: z.string().optional().describe("Unique human-readable key used to look up this routine without knowing its ID. `null` when not set."),
1387
+ /** Visibility and explicit recipient selection for messages emitted by this routine. */
1388
+ message_policy: messagePolicySchema.optional().describe("Visibility and explicit recipient selection for messages emitted by this routine."),
1169
1389
  /** Arbitrary key-value metadata attached to this routine. `null` when not set. */
1170
1390
  metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this routine. `null` when not set."),
1171
1391
  /** Human-readable name for the routine. */
@@ -1186,12 +1406,31 @@ export const agentRoutineSchema = z.object({
1186
1406
  trigger_context: z.string().optional().describe("Execution context in which runs are created. One of `\"event\"` (background job) or `\"chat_session\"` (interactive session). Defaults to `\"event\"`."),
1187
1407
  /** When this routine was last updated (ISO 8601). */
1188
1408
  updated_at: z.string().optional().describe("When this routine was last updated (ISO 8601)."),
1409
+ /** Optional co-owner user (`usr_...`). When set, that user shares view/modify/delete authority on this routine without administering the parent agent. `null` when not set. Never inferred from the caller — only present when explicitly provided on create/update. */
1410
+ user: z.string().optional().describe("Optional co-owner user (`usr_...`). When set, that user shares view/modify/delete authority on this routine without administering the parent agent. `null` when not set. Never inferred from the caller — only present when explicitly provided on create/update."),
1189
1411
  }).describe("An agent routine defines a reusable handler — script, preset, or chain — that runs in response to events or on a schedule.");
1190
1412
  /** Runtime validator for {@link AgentRoutineListResponse}. */
1191
1413
  export const agentRoutineListResponseSchema = z.object({
1192
1414
  /** Array of agent routine objects. */
1193
1415
  data: z.array(agentRoutineSchema).describe("Array of agent routine objects."),
1194
1416
  }).describe("List of agent routine objects belonging to a given agent.");
1417
+ /** Runtime validator for {@link AgentRoutineRunDelivery}. */
1418
+ export const agentRoutineRunDeliverySchema = z.object({
1419
+ /** When delivery completed successfully (ISO 8601). */
1420
+ delivered_at: z.string().optional().describe("When delivery completed successfully (ISO 8601)."),
1421
+ /** ID of the message created by a successful delivery (`msg_...`). */
1422
+ delivered_message: z.string().optional().describe("ID of the message created by a successful delivery (`msg_...`)."),
1423
+ /** Stable public error code for the most recent failed delivery attempt. */
1424
+ last_error: z.string().optional().describe("Stable public error code for the most recent failed delivery attempt."),
1425
+ /** Source message ID (`msg_...`) when the delivery is a reply. */
1426
+ message: z.string().optional().describe("Source message ID (`msg_...`) when the delivery is a reply."),
1427
+ /** Current delivery lifecycle status. */
1428
+ status: z.enum(["not_requested", "pending", "delivered", "failed"]).describe("Current delivery lifecycle status."),
1429
+ /** Destination thread ID (`thr_...`) when delivery was requested. */
1430
+ thread: z.string().optional().describe("Destination thread ID (`thr_...`) when delivery was requested."),
1431
+ /** Normalized delivery mode. */
1432
+ type: z.enum(["none", "thread", "reply"]).describe("Normalized delivery mode."),
1433
+ }).describe("Normalized destination and status for an agent routine run's final-result delivery.");
1195
1434
  /** Runtime validator for {@link AgentRoutineRun}. */
1196
1435
  export const agentRoutineRunSchema = z.object({
1197
1436
  /** Access control list for the run. Contains a `grants` array where each entry specifies `principal_type`, `principal`, and `actions`. `null` when no ACL restrictions are applied and the run is accessible to all members of its scope. */
@@ -1202,6 +1441,8 @@ export const agentRoutineRunSchema = z.object({
1202
1441
  app: z.string().optional().describe("Application that scopes this run (`dap_...`)."),
1203
1442
  /** When this run was created (ISO 8601). */
1204
1443
  created_at: z.string().optional().describe("When this run was created (ISO 8601)."),
1444
+ /** Normalized final-result delivery destination and its current delivery status. */
1445
+ delivery: agentRoutineRunDeliverySchema.optional().describe("Normalized final-result delivery destination and its current delivery status."),
1205
1446
  /** Total wall-clock time the run took to execute, in milliseconds. `null` while the run is still in progress. */
1206
1447
  duration_ms: z.number().int().optional().describe("Total wall-clock time the run took to execute, in milliseconds. `null` while the run is still in progress."),
1207
1448
  /** Identifier of the platform event that triggered this run. `null` for manually invoked runs. */
@@ -1210,6 +1451,8 @@ export const agentRoutineRunSchema = z.object({
1210
1451
  id: z.string().describe("Routine run ID (`arr_...`)."),
1211
1452
  /** Arbitrary key-value metadata attached to this run. Empty object when no metadata was set. */
1212
1453
  metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this run. Empty object when no metadata was set."),
1454
+ /** Invoke-time map of symbolic participant references to agent IDs. `null` when no participants were supplied. */
1455
+ participants: z.record(z.unknown()).optional().describe("Invoke-time map of symbolic participant references to agent IDs. `null` when no participants were supplied."),
1213
1456
  /** Input payload delivered to the routine when this run was triggered. Empty object when no payload was provided. */
1214
1457
  payload: z.record(z.unknown()).optional().describe("Input payload delivered to the routine when this run was triggered. Empty object when no payload was provided."),
1215
1458
  /** Output produced by the routine after execution. `null` while the run has not yet completed. */
@@ -1579,6 +1822,15 @@ export const solutionDiffSummarySchema = z.object({
1579
1822
  /** Number of config entries that exist and will be updated with new content. */
1580
1823
  updates: z.number().int().describe("Number of config entries that exist and will be updated with new content."),
1581
1824
  }).describe("Aggregate counts of each action type across all entries in a solution upgrade diff.");
1825
+ /** Runtime validator for {@link SolutionImportWarning}. */
1826
+ export const solutionImportWarningSchema = z.object({
1827
+ /** Machine-readable warning code. `"setup_requirements_dropped"`: a template or config body declares catalog-DSL `setup_requirements` that direct import does not convert — installs read only `setup_actions`, so those setup steps would never surface. */
1828
+ code: z.string().describe("Machine-readable warning code. `\"setup_requirements_dropped\"`: a template or config body declares catalog-DSL `setup_requirements` that direct import does not convert — installs read only `setup_actions`, so those setup steps would never surface."),
1829
+ /** Human-readable explanation of the warning and how to resolve it. */
1830
+ message: z.string().describe("Human-readable explanation of the warning and how to resolve it."),
1831
+ /** Which bundle entry the warning is about, as `<slot>[<index>] (<relative_path>)`. */
1832
+ path: z.string().describe("Which bundle entry the warning is about, as `<slot>[<index>] (<relative_path>)`."),
1833
+ }).describe("A non-fatal finding surfaced by a Solution import. The import proceeds despite warnings; validation callers (dry-run) can choose to treat them as failures.");
1582
1834
  /** Runtime validator for {@link SolutionImportResult}. */
1583
1835
  export const solutionImportResultSchema = z.object({
1584
1836
  /** Machine-readable conflict code present when `status` is `"conflict"`, identifying the specific conflict reason. `null` when `status` is `"ready"`. */
@@ -1595,6 +1847,8 @@ export const solutionImportResultSchema = z.object({
1595
1847
  status: z.string().describe("Outcome of the import check. `\"ready\"` means the import can proceed as a normal create or update. `\"conflict\"` means a version conflict was detected and the upgrade flow must be used instead."),
1596
1848
  /** Whether the caller must invoke the dedicated upgrade flow to complete the import. Mirrors `status == "conflict"` as a convenience boolean. */
1597
1849
  upgrade_required: z.boolean().describe("Whether the caller must invoke the dedicated upgrade flow to complete the import. Mirrors `status == \"conflict\"` as a convenience boolean."),
1850
+ /** Non-fatal findings the import proceeded despite (present on real imports and dry-runs alike; defaults to an empty array). Dry-run validation callers should surface these — or treat them as failures — before applying the real import. */
1851
+ warnings: z.array(solutionImportWarningSchema).optional().describe("Non-fatal findings the import proceeded despite (present on real imports and dry-runs alike; defaults to an empty array). Dry-run validation callers should surface these — or treat them as failures — before applying the real import."),
1598
1852
  }).describe("The machine-readable outcome of a Solution import attempt, indicating whether the import succeeded or requires an upgrade flow to resolve a version conflict.");
1599
1853
  /** Runtime validator for {@link SolutionImportResponse}. */
1600
1854
  export const solutionImportResponseSchema = z.object({
@@ -1628,6 +1882,44 @@ export const solutionInstallResponseSchema = z.object({
1628
1882
  /** Solution config ID (`cfg_...`) that was used as the source for this install. */
1629
1883
  solution: z.string().describe("Solution config ID (`cfg_...`) that was used as the source for this install."),
1630
1884
  }).describe("The runtime resource provisioned by installing a Solution, along with a reference back to the source Solution config.");
1885
+ /** Runtime validator for {@link SolutionInstance}. */
1886
+ export const solutionInstanceSchema = z.object({
1887
+ /** Materialized agent for this customer (`agi_...`). `null` for a row without an agent. */
1888
+ agent: z.string().optional().describe("Materialized agent for this customer (`agi_...`). `null` for a row without an agent."),
1889
+ /** Opaque tagged reference to the deployment target. Consumers interpret its kind. */
1890
+ attachment_ref: z.record(z.unknown()).optional().describe("Opaque tagged reference to the deployment target. Consumers interpret its kind."),
1891
+ /** When this instance was stamped. */
1892
+ created_at: z.string().describe("When this instance was stamped."),
1893
+ /** Stable vendor-defined key for the customer. */
1894
+ customer_key: z.string().describe("Stable vendor-defined key for the customer."),
1895
+ /** Human-readable customer label. `null` when the vendor did not provide one. */
1896
+ customer_label: z.string().optional().describe("Human-readable customer label. `null` when the vendor did not provide one."),
1897
+ /** Solution instance ID (`sli_...`). */
1898
+ id: z.string().describe("Solution instance ID (`sli_...`)."),
1899
+ /** Count of local agent edits relative to the pinned template. `null` when unavailable. */
1900
+ local_edit_count: z.number().int().optional().describe("Count of local agent edits relative to the pinned template. `null` when unavailable."),
1901
+ /** Pinned template version record (`cfv_...`). `null` when no version is pinned. */
1902
+ pinned_template_version: z.string().optional().describe("Pinned template version record (`cfv_...`). `null` when no version is pinned."),
1903
+ /** Human-readable version number of the pinned template. `null` when unavailable. */
1904
+ pinned_version_number: z.number().int().optional().describe("Human-readable version number of the pinned template. `null` when unavailable."),
1905
+ /** Installed solution template config that stamped this instance (`cfg_...`). */
1906
+ solution_template_config: z.string().describe("Installed solution template config that stamped this instance (`cfg_...`)."),
1907
+ /** Lifecycle status of this stamped instance. */
1908
+ status: z.enum(["active", "archived"]).describe("Lifecycle status of this stamped instance."),
1909
+ /** When this instance was last updated. */
1910
+ updated_at: z.string().describe("When this instance was last updated."),
1911
+ }).describe("A customer-keyed instance stamped from an installed solution template.");
1912
+ /** Runtime validator for {@link SolutionInstanceListResponse}. */
1913
+ export const solutionInstanceListResponseSchema = z.object({
1914
+ /** Opaque cursor for the next page. `null` when this is the final page. */
1915
+ after_cursor: z.string().optional().describe("Opaque cursor for the next page. `null` when this is the final page."),
1916
+ /** Always `null`; this endpoint supports forward pagination only. */
1917
+ before_cursor: z.string().optional().describe("Always `null`; this endpoint supports forward pagination only."),
1918
+ /** Customer solution instances in stable customer-key order. */
1919
+ data: z.array(solutionInstanceSchema).describe("Customer solution instances in stable customer-key order."),
1920
+ /** Whether another page exists after this one. */
1921
+ has_more: z.boolean().describe("Whether another page exists after this one."),
1922
+ }).describe("A forward cursor-paginated page of customer solution instances.");
1631
1923
  /** Runtime validator for {@link SolutionListResponse}. */
1632
1924
  export const solutionListResponseSchema = z.object({
1633
1925
  /** Array of Solution summary objects for the current page, in the order returned by the query. */