@archastro/sdk 0.2.0 → 0.5.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 (267) hide show
  1. package/dist/auth.d.ts +1 -1
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/auth.js +8 -8
  4. package/dist/auth.js.map +1 -1
  5. package/dist/channels/api_activity_feed_channel.d.ts +11 -3
  6. package/dist/channels/api_activity_feed_channel.d.ts.map +1 -1
  7. package/dist/channels/api_activity_feed_channel.js +24 -4
  8. package/dist/channels/api_activity_feed_channel.js.map +1 -1
  9. package/dist/channels/api_chat_channel.d.ts +53 -7
  10. package/dist/channels/api_chat_channel.d.ts.map +1 -1
  11. package/dist/channels/api_chat_channel.js +56 -8
  12. package/dist/channels/api_chat_channel.js.map +1 -1
  13. package/dist/channels/api_object_channel.d.ts +9 -3
  14. package/dist/channels/api_object_channel.d.ts.map +1 -1
  15. package/dist/channels/api_object_channel.js +22 -4
  16. package/dist/channels/api_object_channel.js.map +1 -1
  17. package/dist/client.d.ts +19 -13
  18. package/dist/client.d.ts.map +1 -1
  19. package/dist/client.js +33 -27
  20. package/dist/client.js.map +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/phx_channel/channel.d.ts +10 -1
  26. package/dist/phx_channel/channel.d.ts.map +1 -1
  27. package/dist/phx_channel/channel.js +5 -5
  28. package/dist/phx_channel/channel.js.map +1 -1
  29. package/dist/phx_channel/socket.d.ts +0 -1
  30. package/dist/phx_channel/socket.d.ts.map +1 -1
  31. package/dist/phx_channel/socket.js +15 -12
  32. package/dist/phx_channel/socket.js.map +1 -1
  33. package/dist/runtime/http-client.d.ts +7 -0
  34. package/dist/runtime/http-client.d.ts.map +1 -1
  35. package/dist/runtime/http-client.js +55 -0
  36. package/dist/runtime/http-client.js.map +1 -1
  37. package/dist/types/agents.d.ts +988 -1305
  38. package/dist/types/agents.d.ts.map +1 -1
  39. package/dist/types/agents.js +108 -153
  40. package/dist/types/agents.js.map +1 -1
  41. package/dist/types/ai.d.ts +8 -76
  42. package/dist/types/ai.d.ts.map +1 -1
  43. package/dist/types/ai.js +1 -21
  44. package/dist/types/ai.js.map +1 -1
  45. package/dist/types/artifacts.d.ts +14 -93
  46. package/dist/types/artifacts.d.ts.map +1 -1
  47. package/dist/types/artifacts.js +1 -15
  48. package/dist/types/artifacts.js.map +1 -1
  49. package/dist/types/automations.d.ts +2 -68
  50. package/dist/types/automations.d.ts.map +1 -1
  51. package/dist/types/automations.js +1 -26
  52. package/dist/types/automations.js.map +1 -1
  53. package/dist/types/chat.d.ts +24 -24
  54. package/dist/types/common.d.ts +1362 -5459
  55. package/dist/types/common.d.ts.map +1 -1
  56. package/dist/types/common.js +204 -1088
  57. package/dist/types/common.js.map +1 -1
  58. package/dist/types/config.d.ts +20 -72
  59. package/dist/types/config.d.ts.map +1 -1
  60. package/dist/types/config.js +3 -25
  61. package/dist/types/config.js.map +1 -1
  62. package/dist/types/index.d.ts +1 -9
  63. package/dist/types/index.d.ts.map +1 -1
  64. package/dist/types/index.js +2 -10
  65. package/dist/types/index.js.map +1 -1
  66. package/dist/types/invites.d.ts +63 -0
  67. package/dist/types/invites.d.ts.map +1 -0
  68. package/dist/types/invites.js +18 -0
  69. package/dist/types/invites.js.map +1 -0
  70. package/dist/types/members.d.ts +30 -30
  71. package/dist/types/members.d.ts.map +1 -1
  72. package/dist/types/members.js +14 -14
  73. package/dist/types/members.js.map +1 -1
  74. package/dist/types/orgs.d.ts +60 -60
  75. package/dist/types/orgs.d.ts.map +1 -1
  76. package/dist/types/orgs.js +25 -25
  77. package/dist/types/orgs.js.map +1 -1
  78. package/dist/types/schedules.d.ts +4 -4
  79. package/dist/types/system.d.ts +2 -2
  80. package/dist/types/teams.d.ts +127 -419
  81. package/dist/types/teams.d.ts.map +1 -1
  82. package/dist/types/teams.js +5 -37
  83. package/dist/types/teams.js.map +1 -1
  84. package/dist/types/threads.d.ts +150 -780
  85. package/dist/types/threads.d.ts.map +1 -1
  86. package/dist/types/threads.js +7 -114
  87. package/dist/types/threads.js.map +1 -1
  88. package/dist/types/users.d.ts +65 -65
  89. package/dist/types/users.d.ts.map +1 -1
  90. package/dist/types/users.js +3 -15
  91. package/dist/types/users.js.map +1 -1
  92. package/dist/v1/resources/activity_feed.d.ts +83 -0
  93. package/dist/v1/resources/activity_feed.d.ts.map +1 -0
  94. package/dist/v1/resources/activity_feed.js +13 -0
  95. package/dist/v1/resources/activity_feed.js.map +1 -0
  96. package/dist/v1/resources/agent_computers.d.ts +5 -2
  97. package/dist/v1/resources/agent_computers.d.ts.map +1 -1
  98. package/dist/v1/resources/agent_computers.js +4 -4
  99. package/dist/v1/resources/agent_computers.js.map +1 -1
  100. package/dist/v1/resources/agent_installations.d.ts +13 -8
  101. package/dist/v1/resources/agent_installations.d.ts.map +1 -1
  102. package/dist/v1/resources/agent_installations.js +9 -9
  103. package/dist/v1/resources/agent_installations.js.map +1 -1
  104. package/dist/v1/resources/agent_routines.d.ts +77 -19
  105. package/dist/v1/resources/agent_routines.d.ts.map +1 -1
  106. package/dist/v1/resources/agent_routines.js +19 -27
  107. package/dist/v1/resources/agent_routines.js.map +1 -1
  108. package/dist/v1/resources/agent_sessions.d.ts +24 -6
  109. package/dist/v1/resources/agent_sessions.d.ts.map +1 -1
  110. package/dist/v1/resources/agent_sessions.js +8 -8
  111. package/dist/v1/resources/agent_sessions.js.map +1 -1
  112. package/dist/v1/resources/agent_skills.d.ts +14 -6
  113. package/dist/v1/resources/agent_skills.d.ts.map +1 -1
  114. package/dist/v1/resources/agent_skills.js +10 -10
  115. package/dist/v1/resources/agent_skills.js.map +1 -1
  116. package/dist/v1/resources/agent_tools.d.ts +17 -11
  117. package/dist/v1/resources/agent_tools.d.ts.map +1 -1
  118. package/dist/v1/resources/agent_tools.js +10 -18
  119. package/dist/v1/resources/agent_tools.js.map +1 -1
  120. package/dist/v1/resources/agents.d.ts +200 -46
  121. package/dist/v1/resources/agents.d.ts.map +1 -1
  122. package/dist/v1/resources/agents.js +34 -58
  123. package/dist/v1/resources/agents.js.map +1 -1
  124. package/dist/v1/resources/ai.d.ts +71 -17
  125. package/dist/v1/resources/ai.d.ts.map +1 -1
  126. package/dist/v1/resources/ai.js +6 -22
  127. package/dist/v1/resources/ai.js.map +1 -1
  128. package/dist/v1/resources/artifacts.d.ts +15 -10
  129. package/dist/v1/resources/artifacts.d.ts.map +1 -1
  130. package/dist/v1/resources/artifacts.js +6 -14
  131. package/dist/v1/resources/artifacts.js.map +1 -1
  132. package/dist/v1/resources/automations.d.ts +4 -1
  133. package/dist/v1/resources/automations.d.ts.map +1 -1
  134. package/dist/v1/resources/automations.js +1 -1
  135. package/dist/v1/resources/automations.js.map +1 -1
  136. package/dist/v1/resources/config.d.ts +99 -63
  137. package/dist/v1/resources/config.d.ts.map +1 -1
  138. package/dist/v1/resources/config.js +30 -54
  139. package/dist/v1/resources/config.js.map +1 -1
  140. package/dist/v1/resources/custom_objects.d.ts +5 -1
  141. package/dist/v1/resources/custom_objects.d.ts.map +1 -1
  142. package/dist/v1/resources/custom_objects.js +1 -1
  143. package/dist/v1/resources/custom_objects.js.map +1 -1
  144. package/dist/v1/resources/index.d.ts +16 -13
  145. package/dist/v1/resources/index.d.ts.map +1 -1
  146. package/dist/v1/resources/index.js +17 -14
  147. package/dist/v1/resources/index.js.map +1 -1
  148. package/dist/v1/resources/invites.d.ts +10 -0
  149. package/dist/v1/resources/invites.d.ts.map +1 -0
  150. package/dist/v1/resources/invites.js +13 -0
  151. package/dist/v1/resources/invites.js.map +1 -0
  152. package/dist/v1/resources/kv.d.ts +27 -0
  153. package/dist/v1/resources/kv.d.ts.map +1 -0
  154. package/dist/v1/resources/kv.js +25 -0
  155. package/dist/v1/resources/kv.js.map +1 -0
  156. package/dist/v1/resources/orgs.js +1 -1
  157. package/dist/v1/resources/orgs.js.map +1 -1
  158. package/dist/v1/resources/team_memberships.d.ts +1 -1
  159. package/dist/v1/resources/team_memberships.d.ts.map +1 -1
  160. package/dist/v1/resources/team_memberships.js +4 -4
  161. package/dist/v1/resources/team_memberships.js.map +1 -1
  162. package/dist/v1/resources/teams.d.ts +135 -59
  163. package/dist/v1/resources/teams.d.ts.map +1 -1
  164. package/dist/v1/resources/teams.js +29 -37
  165. package/dist/v1/resources/teams.js.map +1 -1
  166. package/dist/v1/resources/thread_messages.d.ts +10 -11
  167. package/dist/v1/resources/thread_messages.d.ts.map +1 -1
  168. package/dist/v1/resources/thread_messages.js +4 -12
  169. package/dist/v1/resources/thread_messages.js.map +1 -1
  170. package/dist/v1/resources/threads.d.ts +97 -101
  171. package/dist/v1/resources/threads.d.ts.map +1 -1
  172. package/dist/v1/resources/threads.js +22 -70
  173. package/dist/v1/resources/threads.js.map +1 -1
  174. package/dist/v1/resources/users.d.ts +57 -35
  175. package/dist/v1/resources/users.d.ts.map +1 -1
  176. package/dist/v1/resources/users.js +13 -34
  177. package/dist/v1/resources/users.js.map +1 -1
  178. package/dist/v1.d.ts +19 -13
  179. package/dist/v1.d.ts.map +1 -1
  180. package/dist/v1.js +36 -27
  181. package/dist/v1.js.map +1 -1
  182. package/package.json +6 -2
  183. package/LICENSE +0 -21
  184. package/dist/types/api.d.ts +0 -169
  185. package/dist/types/api.d.ts.map +0 -1
  186. package/dist/types/api.js +0 -49
  187. package/dist/types/api.js.map +0 -1
  188. package/dist/types/device.d.ts +0 -26
  189. package/dist/types/device.d.ts.map +0 -1
  190. package/dist/types/device.js +0 -14
  191. package/dist/types/device.js.map +0 -1
  192. package/dist/types/invite.d.ts +0 -17
  193. package/dist/types/invite.d.ts.map +0 -1
  194. package/dist/types/invite.js +0 -11
  195. package/dist/types/invite.js.map +0 -1
  196. package/dist/types/me.d.ts +0 -257
  197. package/dist/types/me.d.ts.map +0 -1
  198. package/dist/types/me.js +0 -42
  199. package/dist/types/me.js.map +0 -1
  200. package/dist/types/messages.d.ts +0 -517
  201. package/dist/types/messages.d.ts.map +0 -1
  202. package/dist/types/messages.js +0 -50
  203. package/dist/types/messages.js.map +0 -1
  204. package/dist/types/oauth.d.ts +0 -206
  205. package/dist/types/oauth.d.ts.map +0 -1
  206. package/dist/types/oauth.js +0 -51
  207. package/dist/types/oauth.js.map +0 -1
  208. package/dist/types/picture.d.ts +0 -20
  209. package/dist/types/picture.d.ts.map +0 -1
  210. package/dist/types/picture.js +0 -14
  211. package/dist/types/picture.js.map +0 -1
  212. package/dist/types/profile.d.ts +0 -17
  213. package/dist/types/profile.d.ts.map +0 -1
  214. package/dist/types/profile.js +0 -11
  215. package/dist/types/profile.js.map +0 -1
  216. package/dist/types/runs.d.ts +0 -46
  217. package/dist/types/runs.d.ts.map +0 -1
  218. package/dist/types/runs.js +0 -15
  219. package/dist/types/runs.js.map +0 -1
  220. package/dist/v1/resources/ai_chat_completions.d.ts +0 -49
  221. package/dist/v1/resources/ai_chat_completions.d.ts.map +0 -1
  222. package/dist/v1/resources/ai_chat_completions.js +0 -14
  223. package/dist/v1/resources/ai_chat_completions.js.map +0 -1
  224. package/dist/v1/resources/ai_chat_models.d.ts +0 -12
  225. package/dist/v1/resources/ai_chat_models.d.ts.map +0 -1
  226. package/dist/v1/resources/ai_chat_models.js +0 -14
  227. package/dist/v1/resources/ai_chat_models.js.map +0 -1
  228. package/dist/v1/resources/ai_image_edits.d.ts +0 -20
  229. package/dist/v1/resources/ai_image_edits.d.ts.map +0 -1
  230. package/dist/v1/resources/ai_image_edits.js +0 -14
  231. package/dist/v1/resources/ai_image_edits.js.map +0 -1
  232. package/dist/v1/resources/ai_image_generations.d.ts +0 -20
  233. package/dist/v1/resources/ai_image_generations.d.ts.map +0 -1
  234. package/dist/v1/resources/ai_image_generations.js +0 -14
  235. package/dist/v1/resources/ai_image_generations.js.map +0 -1
  236. package/dist/v1/resources/ai_image_models.d.ts +0 -12
  237. package/dist/v1/resources/ai_image_models.d.ts.map +0 -1
  238. package/dist/v1/resources/ai_image_models.js +0 -14
  239. package/dist/v1/resources/ai_image_models.js.map +0 -1
  240. package/dist/v1/resources/api.d.ts +0 -1026
  241. package/dist/v1/resources/api.d.ts.map +0 -1
  242. package/dist/v1/resources/api.js +0 -944
  243. package/dist/v1/resources/api.js.map +0 -1
  244. package/dist/v1/resources/completions.d.ts +0 -49
  245. package/dist/v1/resources/completions.d.ts.map +0 -1
  246. package/dist/v1/resources/completions.js +0 -14
  247. package/dist/v1/resources/completions.js.map +0 -1
  248. package/dist/v1/resources/edits.d.ts +0 -20
  249. package/dist/v1/resources/edits.d.ts.map +0 -1
  250. package/dist/v1/resources/edits.js +0 -14
  251. package/dist/v1/resources/edits.js.map +0 -1
  252. package/dist/v1/resources/generations.d.ts +0 -20
  253. package/dist/v1/resources/generations.d.ts.map +0 -1
  254. package/dist/v1/resources/generations.js +0 -14
  255. package/dist/v1/resources/generations.js.map +0 -1
  256. package/dist/v1/resources/invoke.d.ts +0 -29
  257. package/dist/v1/resources/invoke.d.ts.map +0 -1
  258. package/dist/v1/resources/invoke.js +0 -23
  259. package/dist/v1/resources/invoke.js.map +0 -1
  260. package/dist/v1/resources/models.d.ts +0 -12
  261. package/dist/v1/resources/models.d.ts.map +0 -1
  262. package/dist/v1/resources/models.js +0 -14
  263. package/dist/v1/resources/models.js.map +0 -1
  264. package/dist/v1/resources/oauth.d.ts +0 -25
  265. package/dist/v1/resources/oauth.d.ts.map +0 -1
  266. package/dist/v1/resources/oauth.js +0 -41
  267. package/dist/v1/resources/oauth.js.map +0 -1
@@ -1,47 +1,9 @@
1
1
  // Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: 77f68e7b23d3
3
+ // Content hash: 4303c5c9f783
4
4
  import { z } from "zod";
5
5
  import { imageSourceSchema } from "./image.js";
6
- import { mediaVariantSchema } from "./me.js";
7
6
  import { userSchema } from "./users.js";
8
- /** Schema for a message actor (user or agent).
9
-
10
- Actors represent the entity that sent a message.
11
- Maps to the actor format from MessageActorHelper.build_actor/1.
12
- */
13
- export const actorSchema = z.object({
14
- alias: z.string().optional(), // Actor alias/handle
15
- id: z.string().optional(), // Actor ID (format: user-xxx or agent-xxx)
16
- name: z.string().optional(), // Actor display name
17
- profile_picture: imageSourceSchema.optional(), // Profile picture
18
- });
19
- /** Schema for a message attachment.
20
-
21
- Attachments can be of various types (file, scraped_link, artifact, task, media, action).
22
- Fields present depend on the attachment type.
23
- Maps to format_attachments_for_client/1 output.
24
- */
25
- export const attachmentSchema = z.object({
26
- content_type: z.string().optional(), // MIME content type (file, artifact, media types)
27
- description: z.string().optional(), // Description (scraped_link, artifact, task types)
28
- filename: z.string().optional(), // File name (file, artifact, media types)
29
- height: z.number().int().optional(), // Media height (media type)
30
- id: z.string(), // Attachment ID
31
- image_height: z.number().int().optional(), // Preview image height (scraped_link type)
32
- image_source: imageSourceSchema.optional(), // Image metadata (file, scraped_link, artifact, media types)
33
- image_url: z.string().optional(), // Preview image URL (scraped_link type)
34
- image_width: z.number().int().optional(), // Preview image width (scraped_link type)
35
- media_type: z.string().optional(), // Media type (media type)
36
- name: z.string().optional(), // Media name (media type)
37
- object: z.record(z.unknown()).optional(), // Embedded object (task, action types)
38
- title: z.string().optional(), // Title (scraped_link, artifact, task types)
39
- type: z.string(), // Attachment type: file, scraped_link, artifact, task, media, action
40
- url: z.string().optional(), // URL to the resource (file, scraped_link, artifact, media types)
41
- variants: z.array(mediaVariantSchema).optional(), // Media variants (media type)
42
- version: z.number().int().optional(), // Artifact version number (artifact type)
43
- width: z.number().int().optional(), // Media width (media type)
44
- });
45
7
  /** API schema for a single ACL grant entry. */
46
8
  export const aclGrantSchema = z.object({
47
9
  actions: z.array(z.string()), // List of allowed actions (e.g. read, write)
@@ -74,263 +36,158 @@ export const aclSchema = z.object({
74
36
  grants: z.array(aclGrantSchema).optional(), // Replace mode: full list of grants (replaces all existing). Use [] to clear.
75
37
  remove: z.array(aclRemoveTargetSchema).optional(), // Patch mode: principals to remove from existing
76
38
  });
77
- /** Schema for a thread in the developer portal.
78
-
79
- Maps to serialized thread output from developer portal API.
80
- */
81
- export const developerThreadSchema = z.object({
82
- app_name: z.string().optional(), // Associated app name
83
- created_at: z.string().optional(), // Created timestamp
84
- id: z.string(), // Public ID (thr_...)
85
- is_channel: z.boolean().optional(), // Whether this is a channel thread
86
- is_default: z.boolean().optional(), // Whether this is the default thread
87
- is_unlisted: z.boolean().optional(), // Whether thread is hidden from listings
88
- key: z.string().optional(), // Unique key within owner scope
89
- org: z.string().optional(), // Organization (nullable)
90
- owner: z.string().optional(), // Owner public
91
- owner_name: z.string().optional(), // Owner display name
92
- owner_type: z.string().optional(), // Owner type: team, user, agent, or nil
93
- sandbox: z.string().optional(), // Sandbox identifier (nullable)
94
- slug: z.string().optional(), // URL-friendly slug
95
- title: z.string(), // Thread title
96
- updated_at: z.string().optional(), // Updated timestamp
97
- });
98
- /** Schema for a context ingestion.
39
+ /** Schema for a message actor (user or agent).
99
40
 
100
- Maps to serialized context ingestion output from developer portal API.
101
- */
102
- export const contextIngestionSchema = z.object({
103
- agent: z.string().optional(), // Agent
104
- completed_at: z.string().optional(), // Completed timestamp
105
- created_at: z.string().optional(), // Created timestamp
106
- error: z.record(z.unknown()).optional(), // Error details (if failed)
107
- id: z.string(), // Public ID (cig_...)
108
- metadata: z.record(z.unknown()).optional(), // Additional metadata
109
- source: z.string().optional(), // Source ID
110
- started_at: z.string().optional(), // Started timestamp
111
- status: z.string(), // Status (pending, running, awaiting_callback, succeeded, failed)
112
- team: z.string().optional(), // Owning team ID
113
- updated_at: z.string().optional(), // Updated timestamp
114
- user: z.string().optional(), // Owning user ID
115
- });
116
- /** API schema for a working memory entry. */
117
- export const workingMemoryEntrySchema = z.object({
118
- agent: z.string().optional(), // Owning agent
119
- created_at: z.string().optional(), // Creation timestamp
120
- expires_at: z.string().optional(), // Expiration timestamp
121
- id: z.string(), // Memory entry ID (amm_...)
122
- key: z.string().optional(), // Memory key
123
- updated_at: z.string().optional(), // Last update timestamp
124
- value: z.string().optional(), // Memory value
125
- });
126
- /** Schema for a sandbox-captured email.
41
+ Actors represent the entity that sent a message.
42
+ Maps to the actor format from MessageActorHelper.build_actor/1.
127
43
  */
128
- export const sandboxEmailSchema = z.object({
129
- bcc: z.array(z.record(z.unknown())).optional(), // BCC recipients
130
- cc: z.array(z.record(z.unknown())).optional(), // CC recipients
131
- created_at: z.string().optional(), // When the email was captured
132
- from_address: z.string(), // Sender email address
133
- from_name: z.string().optional(), // Sender display name
134
- headers: z.record(z.unknown()).optional(), // Custom email headers
135
- html_body: z.string().optional(), // HTML body
136
- id: z.string(), // Public ID (sem_...)
137
- reply_to: z.record(z.unknown()).optional(), // Reply-to address
138
- subject: z.string().optional(), // Email subject
139
- text_body: z.string().optional(), // Plain text body
140
- to: z.array(z.record(z.unknown())), // Recipients [{name, address}]
44
+ export const actorSchema = z.object({
45
+ alias: z.string().optional(), // Actor alias/handle
46
+ id: z.string().optional(), // Actor ID (format: user-xxx or agent-xxx)
47
+ name: z.string().optional(), // Actor display name
48
+ profile_picture: imageSourceSchema.optional(), // Profile picture
141
49
  });
142
- /** Schema for an LLM session call.
50
+ /** API schema for per-routine LLM invocation settings.
143
51
 
144
- Maps to serialized LLM call output from developer portal API.
52
+ Mirrors `ArchAstro.Agents.Routines.LLMConfig`. When `model` is present,
53
+ it overrides the agent's `default_model` for the routine (or step).
145
54
  */
146
- export const llmCallSchema = z.object({
147
- call_id: z.string(), // Unique call UUID
148
- completion_tokens: z.number().int(), // Number of completion tokens
149
- created_at: z.string().optional(), // Created timestamp
150
- error_message: z.string().optional(), // Error message if call failed
151
- id: z.string(), // Public ID (alc_...)
152
- latency_ms: z.number().int(), // Latency in milliseconds
153
- message_count: z.number().int().optional(), // Number of messages included in the call metadata
154
- metadata: z.record(z.unknown()).optional(), // Additional metadata
155
- model: z.string().optional(), // LLM model name
156
- prompt_tokens: z.number().int(), // Number of prompt tokens
157
- session_id: z.string(), // Session UUID grouping related calls
158
- source: z.string().optional(), // Machine-readable call source key
159
- status: z.string().optional(), // Call status (success or error)
160
- team: z.string().optional(), // Team if team-scoped
161
- total_tokens: z.number().int(), // Total tokens (prompt + completion)
162
- trajectory: z.string().optional(), // Trajectory identifier
163
- user: z.string().optional(), // User if user-scoped
55
+ export const lLMConfigSchema = z.object({
56
+ model: z.string().optional(), // Model identifier. When set, overrides the agent's default_model.
164
57
  });
165
- /** Schema for a registered domain.
58
+ /** API schema for preset handler configuration.
166
59
 
167
- Maps to serialized domain output from developer portal API.
168
- */
169
- export const domainSchema = z.object({
170
- created_at: z.string().optional(), // Created timestamp
171
- domain: z.string(), // Domain name
172
- id: z.string(), // Public ID (dad_...)
173
- updated_at: z.string().optional(), // Updated timestamp
174
- verified: z.boolean().optional(), // Whether domain is verified
175
- });
176
- /** Schema for a webhook event.
60
+ Mirrors `ArchAstro.Agents.Routines.PresetConfig`. Used wherever a request
61
+ or response carries a preset config — routine-level and chain-step-level.
177
62
 
178
- Maps to serialized webhook event output from developer portal API.
63
+ Server-side validation (length/format rules on `instructions`, enum checks
64
+ on `session_mode`/`session_scope`, model lookup against
65
+ `ChatCompletion.models/0`) is authoritative. This schema defines the
66
+ request shape and typed response shape so OpenAPI consumers see real
67
+ types instead of an opaque object.
179
68
  */
180
- export const webhookEventSchema = z.object({
181
- created_at: z.string().optional(), // Created timestamp
182
- error: z.string().optional(), // Error message if failed
183
- event_type: z.string().optional(), // Event type from the provider
184
- headers: z.record(z.unknown()).optional(), // Request headers
185
- id: z.string(), // Public ID (whe_...)
186
- payload: z.record(z.unknown()).optional(), // Event payload
187
- processed_at: z.string().optional(), // When the event was processed
188
- status: z.string(), // Processing status (pending, processed, failed)
189
- });
190
- /** Schema for an eval result. */
191
- export const evalResultSchema = z.object({
192
- agent_response: z.string().optional(), // Agent response
193
- created_at: z.string().optional(), // Created timestamp
194
- duration_ms: z.number().int().optional(), // Execution duration
195
- grader_details: z.record(z.unknown()).optional(), // Grader details
196
- id: z.string(), // Eval result ID
197
- run: z.string(), // Parent eval run identifier
198
- score: z.number().optional(), // Result score
199
- status: z.string(), // Result status
200
- task: z.string().optional(), // Eval task identifier
201
- task_input: z.string().optional(), // Task input summary
202
- transcript: z.record(z.unknown()).optional(), // Execution transcript
203
- updated_at: z.string().optional(), // Updated timestamp
69
+ export const presetConfigSchema = z.object({
70
+ instructions: z.string().optional(), // Custom task or behavior instructions for the preset (max 10,000 chars).
71
+ llm: lLMConfigSchema.optional(), // LLM invocation settings (e.g. a `model` override for this routine/step).
72
+ session_mode: z.string().optional(), // Session mode: `stateless` (default, new session per trigger) or `session` (find-or-create a persistent session scoped by `session_scope`).
73
+ session_scope: z.string().optional(), // When `session_mode` is `session`, controls session scoping: `per_user` (default), `per_key`, `per_org`, or `global`.
74
+ structured_message_template_ids: z.array(z.string()).optional(), // Config IDs of AgentMessageSchema templates that constrain the agent's responses to predefined structured formats.
204
75
  });
205
- /** Schema for an eval run. */
206
- export const evalRunSchema = z.object({
207
- agent: z.string().optional(), // Agent identifier
208
- agent_name: z.string().optional(), // Agent name
209
- completed_at: z.string().optional(), // Completion timestamp
210
- created_at: z.string().optional(), // Created timestamp
211
- id: z.string(), // Eval run ID
212
- results: z.array(evalResultSchema).optional(), // Eval results for this run
213
- started_at: z.string().optional(), // Start timestamp
214
- status: z.string(), // Run status
215
- suite: z.string(), // Eval suite identifier
216
- summary: z.record(z.unknown()).optional(), // Aggregate run summary
217
- updated_at: z.string().optional(), // Updated timestamp
76
+ /** API schema for background worker status on a routine run. */
77
+ export const workerStatusSchema = z.object({
78
+ attempt: z.number().int(), // Current attempt number (0 = not yet attempted)
79
+ max_attempts: z.number().int(), // Maximum allowed attempts
80
+ status: z.string(), // Worker state: queued, executing, retrying, completed, discarded, or cancelled
218
81
  });
219
- /** API schema for a context entry. */
220
- export const contextEntrySchema = z.object({
221
- after_cursor: z.string().optional(), // Pagination cursor (after)
222
- agent_user: z.string().optional(), // Agent user
223
- before_cursor: z.string().optional(), // Pagination cursor (before)
82
+ /** API schema for a media variant. */
83
+ export const mediaVariantSchema = z.object({
84
+ content_type: z.string().optional(), // File content type
224
85
  created_at: z.string().optional(), // Creation timestamp
225
- files: z.array(z.record(z.unknown())).optional(), // Loaded file objects
226
- id: z.string(), // Context entry ID
227
- links: z.array(z.record(z.unknown())).optional(), // Loaded link objects
228
- media: z.array(z.record(z.unknown())).optional(), // Loaded media objects
229
- metadata: z.record(z.unknown()).optional(), // Entry metadata
230
- org: z.string().optional(), // Organization
231
- sandbox: z.string().optional(), // Sandbox identifier
232
- team: z.string().optional(), // Team
233
- text: z.string().optional(), // Entry text
86
+ file: z.string().optional(), // Storage file
87
+ filename: z.string().optional(), // Original filename
88
+ height: z.number().int().optional(), // Height in pixels
89
+ id: z.string(), // Variant ID
90
+ image_source: imageSourceSchema.optional(), // Image source metadata
234
91
  updated_at: z.string().optional(), // Last update timestamp
235
- user: z.string().optional(), // User
92
+ url: z.string().optional(), // Signed download URL
93
+ variant_key: z.string().optional(), // Variant key (original, thumbnail, etc)
94
+ width: z.number().int().optional(), // Width in pixels
236
95
  });
237
- /** Schema for a developer webhook.
96
+ /** Schema for a message attachment.
238
97
 
239
- Maps to serialized webhook output from developer portal API.
98
+ Attachments can be of various types (file, scraped_link, artifact, task, media, action).
99
+ Fields present depend on the attachment type.
100
+ Maps to format_attachments_for_client/1 output.
240
101
  */
241
- export const webhookSchema = z.object({
242
- context_installation: z.string().optional(), // Bound context installation
243
- context_sources: z.array(z.string()).optional(), // Bound context sources
244
- created_at: z.string().optional(), // Created timestamp
245
- enabled: z.boolean(), // Whether the webhook is enabled
246
- id: z.string(), // Public ID (whk_...)
247
- lookup_key: z.string().optional(), // Lookup key for generic webhooks
248
- metadata: z.record(z.unknown()).optional(), // Additional metadata
249
- provider: z.string().optional(), // Provider type for known providers (github, slack), nil for generic webhooks
250
- updated_at: z.string().optional(), // Updated timestamp
251
- webhook_url: z.string(), // URL to send webhooks to
252
- });
253
- /** API schema for a secret (user, team, or user-team). */
254
- export const secretSchema = z.object({
255
- created_at: z.string().optional(), // Creation timestamp
256
- description: z.string().optional(), // Secret description
257
- id: z.string(), // Secret ID
258
- last_accessed_at: z.string().optional(), // Last accessed timestamp
259
- name: z.string().optional(), // Secret name
260
- org: z.string().optional(), // Organization
261
- sandbox: z.string().optional(), // Sandbox
262
- secret_group: z.string().optional(), // Secret group
263
- team: z.string().optional(), // Team
264
- updated_at: z.string().optional(), // Last update timestamp
265
- });
266
- /** API schema for OAuth device authorization responses. */
267
- export const deviceAuthorizationResponseSchema = z.object({
268
- device_code: z.string(), // Device verification code
269
- expires_in: z.number().int(), // TTL in seconds
270
- interval: z.number().int(), // Polling interval in seconds
271
- user_code: z.string(), // User-facing verification code
272
- verification_uri: z.string(), // Base verification URI
273
- verification_uri_complete: z.string(), // Full verification URI with code
102
+ export const attachmentSchema = z.object({
103
+ content_type: z.string().optional(), // MIME content type (file, artifact, media types)
104
+ description: z.string().optional(), // Description (scraped_link, artifact, task types)
105
+ filename: z.string().optional(), // File name (file, artifact, media types)
106
+ height: z.number().int().optional(), // Media height (media type)
107
+ id: z.string(), // Attachment ID
108
+ image_height: z.number().int().optional(), // Preview image height (scraped_link type)
109
+ image_source: imageSourceSchema.optional(), // Image metadata (file, scraped_link, artifact, media types)
110
+ image_url: z.string().optional(), // Preview image URL (scraped_link type)
111
+ image_width: z.number().int().optional(), // Preview image width (scraped_link type)
112
+ media_type: z.string().optional(), // Media type (media type)
113
+ name: z.string().optional(), // Media name (media type)
114
+ object: z.record(z.unknown()).optional(), // Embedded object (task, action types)
115
+ title: z.string().optional(), // Title (scraped_link, artifact, task types)
116
+ type: z.string(), // Attachment type: file, scraped_link, artifact, task, media, action
117
+ url: z.string().optional(), // URL to the resource (file, scraped_link, artifact, media types)
118
+ variants: z.array(mediaVariantSchema).optional(), // Media variants (media type)
119
+ version: z.number().int().optional(), // Artifact version number (artifact type)
120
+ width: z.number().int().optional(), // Media width (media type)
274
121
  });
275
- /** API schema for OAuth token endpoint responses. */
276
- export const oAuthTokenResponseSchema = z.object({
277
- access_token: z.string(), // OAuth access token
122
+ /** API schema for authentication token responses. */
123
+ export const authTokensSchema = z.object({
278
124
  expires_in: z.number().int(), // Token TTL in seconds
279
- refresh_token: z.string().optional(), // OAuth refresh token
280
- scope: z.string().optional(), // Granted scopes (space-separated)
125
+ metadata: z.record(z.unknown()).optional(), // Additional metadata (e.g., onboarding_job_id)
126
+ refresh_token: z.string(), // Refresh token
127
+ token: z.string(), // Access token (JWT)
281
128
  token_type: z.string(), // Token type (Bearer)
282
- user: userSchema.optional(), // Authenticated user
129
+ user: userSchema, // Authenticated user
130
+ });
131
+ /** An individual tool within a builtin tool catalog entry. */
132
+ export const builtinToolSchema = z.object({
133
+ description: z.string().optional(), // Tool description
134
+ name: z.string(), // Tool name
135
+ });
136
+ /** A builtin tool catalog entry describing an available tool category. */
137
+ export const builtinToolCatalogEntrySchema = z.object({
138
+ config_schema: z.record(z.unknown()).optional(), // JSON schema for tool configuration
139
+ description: z.string().optional(), // Tool description
140
+ instruction: z.string().optional(), // Tool instruction
141
+ key: z.string(), // Unique tool key
142
+ label: z.string().optional(), // Display label
143
+ providers: z.array(z.string()).optional(), // Supported providers
144
+ requires_integration: z.boolean().optional(), // Whether an integration is required
145
+ server_tool_type: z.string().optional(), // Server tool type identifier
146
+ tools: z.array(builtinToolSchema).optional(), // List of individual tools
283
147
  });
284
148
  /** Result of executing a command on an agent computer. */
285
149
  export const computerExecResultSchema = z.object({
286
150
  exit_code: z.number().int().optional(), // Process exit code
287
151
  output: z.string().optional(), // Command output
288
152
  });
289
- /** Source option metadata for LLM call filtering.
290
- */
291
- export const llmCallSourceOptionSchema = z.object({
292
- label: z.string(), // Human-friendly source label
293
- source: z.string(), // Machine-readable LLM source key
294
- });
295
- /** Schema for an app environment variable response that includes the plaintext value. */
296
- export const appEnvVarPlaintextSchema = z.object({
153
+ /** API schema for a custom object. */
154
+ export const customObjectSchema = z.object({
297
155
  created_at: z.string().optional(), // Created timestamp
298
- description: z.string().optional(), // Optional description
299
- id: z.string(), // Environment variable ID
300
- key: z.string(), // Environment variable key
156
+ fields: z.record(z.unknown()).optional(), // Object field values
157
+ id: z.string(), // Public ID (cobj_...)
158
+ org: z.string().optional(), // Organization
159
+ row_key: z.string().optional(), // Row key
160
+ sandbox: z.string().optional(), // Sandbox identifier
161
+ schema_type: z.string().optional(), // Schema type (lookup_key)
162
+ team: z.string().optional(), // Owning team
301
163
  updated_at: z.string().optional(), // Updated timestamp
302
- value: z.string(), // Plaintext environment variable value
164
+ user: z.string().optional(), // Owning user
165
+ version: z.number().int().optional(), // Aggregate version for OCC
303
166
  });
304
- /** Schema for integration records with connector state. */
305
- export const integrationSchema = z.object({
306
- id: z.string(), // Integration ID
307
- org: z.string().optional(), // Organization (nullable)
308
- provider: z.string(), // Provider identifier
309
- sandbox: z.string().optional(), // Sandbox identifier (nullable)
310
- secret_group: z.string().optional(), // Secret group
311
- state: z.record(z.unknown()), // Connector state information
312
- team: z.string().optional(), // Team (if team-scoped)
313
- user: z.string().optional(), // User (if user-scoped)
314
- workspace_key: z.string().optional(), // Provider workspace identifier
167
+ /** API schema for OAuth device authorization responses. */
168
+ export const deviceAuthorizationResponseSchema = z.object({
169
+ device_code: z.string(), // Device verification code
170
+ expires_in: z.number().int(), // TTL in seconds
171
+ interval: z.number().int(), // Polling interval in seconds
172
+ user_code: z.string(), // User-facing verification code
173
+ verification_uri: z.string(), // Base verification URI
174
+ verification_uri_complete: z.string(), // Full verification URI with code
315
175
  });
316
- /** Schema for a single notification setting update entry.
317
- */
318
- export const notificationSettingUpdateSchema = z.object({
319
- level: z.string(), // Notification level (global, team, thread)
320
- muted: z.boolean(), // Whether notifications are muted
321
- team: z.string().optional(), // Team (required for team-level settings)
322
- thread: z.string().optional(), // Thread (required for thread-level settings)
176
+ /** API schema for OAuth device authorization approval and denial responses. */
177
+ export const deviceAuthorizationStatusResponseSchema = z.object({
178
+ status: z.string(), // Authorization status (approved or denied)
323
179
  });
324
- /** Schema for a key-value storage entry.
325
-
326
- Maps exactly to render_entry/1 output in ApiStorageController.
327
- */
328
- export const keyValueStorageEntrySchema = z.object({
180
+ /** API schema for an installation. */
181
+ export const installationSchema = z.object({
182
+ agent: z.string().optional(), // Owning agent
183
+ config: z.record(z.unknown()).optional(), // Configuration
329
184
  created_at: z.string().optional(), // Creation timestamp
330
- key: z.string(), // Storage key
185
+ id: z.string(), // Installation ID (cin_...)
186
+ kind: z.string().optional(), // Installation kind
187
+ shared_integration: z.string().optional(), // Bound shared integration
188
+ state: z.string().optional(), // Installation state
189
+ status_payload: z.record(z.unknown()).optional(), // Status payload
331
190
  updated_at: z.string().optional(), // Last update timestamp
332
- user: z.string(), // User
333
- value: z.string(), // Stored value
334
191
  });
335
192
  /** API schema for an installation kind. */
336
193
  export const installationKindSchema = z.object({
@@ -347,107 +204,70 @@ export const installationKindSchema = z.object({
347
204
  export const installationKindListResponseSchema = z.object({
348
205
  data: z.array(installationKindSchema), // List of installation kinds
349
206
  });
350
- /** Schema for an eval task. */
351
- export const evalTaskSchema = z.object({
352
- created_at: z.string().optional(), // Created timestamp
353
- expected_outcome: z.string(), // Expected outcome
354
- grading_criteria: z.array(z.record(z.unknown())).optional(), // Grading criteria
355
- id: z.string(), // Eval task ID
356
- input_message: z.string(), // Task input message
357
- mock_agent_memory: z.record(z.unknown()).optional(), // Mock agent memory
358
- mock_context_items: z.array(z.record(z.unknown())).optional(), // Mock context items
359
- mock_datetime: z.string().optional(), // Mock datetime
360
- mock_participants: z.array(z.record(z.unknown())).optional(), // Mock participants
361
- mock_tools: z.array(z.record(z.unknown())).optional(), // Mock tool definitions
362
- status: z.string(), // Task status
363
- suite: z.string(), // Parent eval suite identifier
364
- updated_at: z.string().optional(), // Updated timestamp
207
+ /** List response for installations. */
208
+ export const installationListResponseSchema = z.object({
209
+ data: z.array(installationSchema), // List of installations
365
210
  });
366
- /** API schema for a task comment. */
367
- export const taskCommentSchema = z.object({
368
- author: z.string().optional(), // Legacy author
369
- author_actor: z.record(z.unknown()).optional(), // Author actor details
370
- author_persona: z.string().optional(), // Author persona
371
- author_user: z.string().optional(), // Author user
372
- body: z.string(), // Comment body text
211
+ /** API schema for an installation source. */
212
+ export const installationSourceSchema = z.object({
213
+ agent: z.string().optional(), // Owning agent
214
+ context_installation: z.string().optional(), // Installation ID
373
215
  created_at: z.string().optional(), // Creation timestamp
374
- id: z.string(), // Comment ID
375
- org: z.string().optional(), // Organization
376
- sandbox: z.string().optional(), // Sandbox identifier
377
- task: z.string().optional(), // Task
378
- team: z.string().optional(), // Team
216
+ id: z.string(), // Source ID (cso_...)
217
+ metadata: z.record(z.unknown()).optional(), // Arbitrary metadata
218
+ parent_source: z.string().optional(), // Parent source ID
219
+ payload: z.record(z.unknown()).optional(), // Source payload
220
+ state: z.string().optional(), // Source state
221
+ team: z.string().optional(), // Team ID
222
+ thread: z.string().optional(), // Thread ID
223
+ type: z.string().optional(), // Source type
379
224
  updated_at: z.string().optional(), // Last update timestamp
225
+ user: z.string().optional(), // User ID
380
226
  });
381
- /** Schema for eval result list responses. */
382
- export const evalResultListSchema = z.object({
383
- data: z.array(evalResultSchema), // Eval results
384
- });
385
- /** Schema for delete operations that return a deleted count. */
386
- export const deletionConfirmationSchema = z.object({
387
- deleted_count: z.number().int(), // Number of deleted records
388
- });
389
- /** An individual tool within a builtin tool catalog entry. */
390
- export const builtinToolSchema = z.object({
391
- description: z.string().optional(), // Tool description
392
- name: z.string(), // Tool name
393
- });
394
- /** Schema for an eval suite. */
395
- export const evalSuiteSchema = z.object({
396
- created_at: z.string().optional(), // Created timestamp
397
- description: z.string().optional(), // Suite description
398
- id: z.string(), // Eval suite ID
399
- name: z.string(), // Suite name
400
- org: z.string().optional(), // Owner organization identifier
401
- status: z.string(), // Suite status
402
- tasks: z.array(evalTaskSchema).optional(), // Eval tasks included in the suite
403
- updated_at: z.string().optional(), // Updated timestamp
404
- user: z.string().optional(), // Owner user identifier
405
- });
406
- /** Schema for eval suite list responses. */
407
- export const evalSuiteListSchema = z.object({
408
- data: z.array(evalSuiteSchema), // Eval suites
409
- });
410
- /** Schema for a sandbox API key.
411
- */
412
- export const sandboxKeySchema = z.object({
413
- created_at: z.string().optional(), // Created timestamp
414
- expires_at: z.string().optional(), // Expiry timestamp
415
- full_key: z.string().optional(), // Full key shown only once at creation
416
- id: z.string(), // Public ID (dsk_...)
417
- key_hint: z.string().optional(), // Last 4 chars hint
418
- key_value: z.string().optional(), // Full key (publishable only)
419
- last_used_at: z.string().optional(), // Last used timestamp
420
- status: z.string(), // Status (active, revoked)
421
- type: z.string(), // Key type (publishable, secret)
227
+ /** List response for installation sources. */
228
+ export const installationSourceListResponseSchema = z.object({
229
+ data: z.array(installationSourceSchema), // List of installation sources
422
230
  });
423
- /** Schema for a developer sandbox.
231
+ /** Schema for a key-value storage entry.
232
+
233
+ Maps exactly to render_entry/1 output in ApiStorageController.
424
234
  */
425
- export const sandboxSchema = z.object({
426
- created_at: z.string().optional(), // Created timestamp
427
- id: z.string(), // Public ID (dsb_...)
428
- keys: z.array(sandboxKeySchema).optional(), // Sandbox API keys
429
- name: z.string(), // Sandbox name
430
- slug: z.string(), // Sandbox slug (unique per app)
431
- updated_at: z.string().optional(), // Updated timestamp
432
- });
433
- /** API schema for an AI trajectory. */
434
- export const trajectorySchema = z.object({
235
+ export const keyValueStorageEntrySchema = z.object({
435
236
  created_at: z.string().optional(), // Creation timestamp
436
- file: z.string().optional(), // Storage file
437
- id: z.string(), // Trajectory ID (trj_...)
438
- messages: z.record(z.unknown()).optional(), // Trajectory messages
439
- org: z.string().optional(), // Organization
440
- sandbox: z.string().optional(), // Sandbox
441
- team: z.string().optional(), // Team
237
+ key: z.string(), // Storage key
442
238
  updated_at: z.string().optional(), // Last update timestamp
239
+ user: z.string(), // User
240
+ value: z.string(), // Stored value
241
+ });
242
+ /** Schema for a key-value storage entry, optionally enriched with a summary of
243
+ the owning user.
244
+
245
+ Used by the dual-mode list endpoint: user-JWT callers omit the user_email /
246
+ user_name fields (they know who they are); developer / S2S callers populate
247
+ them so the portal can render an owner column without a per-row lookup.
248
+ */
249
+ export const keyValueStorageEntryWithUserSchema = z.object({
250
+ created_at: z.string(), // Creation timestamp
251
+ key: z.string(), // Storage key
252
+ updated_at: z.string(), // Last update timestamp
253
+ user: z.string(), // User ID
254
+ user_email: z.string().optional(), // User email (developer / S2S only)
255
+ user_name: z.string().optional(), // User display name (developer / S2S only)
256
+ value: z.string(), // Stored value
443
257
  });
444
- /** Schema for an event type available for automation triggers.
258
+ /** Response envelope for the dual-mode key-value list endpoint.
445
259
 
446
- Represents events from the workflow event catalog.
260
+ User-JWT callers receive `%{data: [...]}` (no pagination fields).
261
+ Developer / S2S callers receive `%{data: [...]}` plus pagination metadata.
447
262
  */
448
- export const eventTypeSchema = z.object({
449
- description: z.string(), // Human-readable description
450
- name: z.string(), // Event name (e.g., thread.created)
263
+ export const keyValueStorageEntryPageSchema = z.object({
264
+ data: z.array(keyValueStorageEntryWithUserSchema), // Storage entries on this page
265
+ has_next: z.boolean().optional(), // Whether a next page exists (developer / S2S only)
266
+ has_prev: z.boolean().optional(), // Whether a previous page exists (developer / S2S only)
267
+ page: z.number().int().optional(), // Current page number (developer / S2S only)
268
+ page_size: z.number().int().optional(), // Results per page (developer / S2S only)
269
+ total_entries: z.number().int().optional(), // Total entries matching the filters (developer / S2S only)
270
+ total_pages: z.number().int().optional(), // Total number of pages (developer / S2S only)
451
271
  });
452
272
  /** Schema for inline message reactions.
453
273
 
@@ -486,6 +306,15 @@ export const messageSchema = z.object({
486
306
  thread: z.string().optional(), // Parent thread
487
307
  user: z.string().optional(), // Author user (public ID or expanded object when loaded)
488
308
  });
309
+ /** API schema for OAuth token endpoint responses. */
310
+ export const oAuthTokenResponseSchema = z.object({
311
+ access_token: z.string(), // OAuth access token
312
+ expires_in: z.number().int(), // Token TTL in seconds
313
+ refresh_token: z.string().optional(), // OAuth refresh token
314
+ scope: z.string().optional(), // Granted scopes (space-separated)
315
+ token_type: z.string(), // Token type (Bearer)
316
+ user: userSchema.optional(), // Authenticated user
317
+ });
489
318
  /** Schema for paginated message replies response.
490
319
 
491
320
  Used by message replies list endpoints.
@@ -498,433 +327,34 @@ export const paginatedRepliesSchema = z.object({
498
327
  replies: z.array(messageSchema), // List of reply message objects
499
328
  total_count: z.number().int().optional(), // Total number of replies
500
329
  });
501
- /** A routine preset with its metadata. */
330
+ /** A routine preset entry in the preset listing endpoint. Describes *what*
331
+ a preset is, not a per-routine configuration — that's `PresetConfig`.
332
+ */
502
333
  export const routinePresetSchema = z.object({
503
- config: z.record(z.unknown()).optional(), // Default configuration
504
- description: z.string().optional(), // Preset description
505
- event_type: z.string().optional(), // Event type
506
- label: z.string().optional(), // Display label
507
- name: z.string(), // Preset name
508
- });
509
- /** API schema for a persona. */
510
- export const personaSchema = z.object({
511
- activated: z.boolean().optional(), // Whether persona is activated
512
- agent: z.string().optional(), // Associated agent (always nil)
513
- created_at: z.string().optional(), // Creation timestamp
514
- id: z.string(), // Persona ID
515
- is_active: z.boolean().optional(), // Whether persona is active
516
- is_enabled_for_thread: z.boolean().optional(), // Whether persona is enabled for thread
517
- metadata: z.record(z.unknown()).optional(), // Persona metadata
518
- name: z.string().optional(), // Persona display name
519
- org: z.string().optional(), // Organization
520
- personality: z.string().optional(), // Persona personality description
521
- sandbox: z.string().optional(), // Sandbox
522
- team: z.string().optional(), // Owning team
523
- updated_at: z.string().optional(), // Last update timestamp
524
- user: z.string().optional(), // Owning user
525
- });
526
- /** API schema for an installation. */
527
- export const installationSchema = z.object({
528
- agent: z.string().optional(), // Owning agent
529
- config: z.record(z.unknown()).optional(), // Configuration
530
- created_at: z.string().optional(), // Creation timestamp
531
- id: z.string(), // Installation ID (cin_...)
532
- kind: z.string().optional(), // Installation kind
533
- shared_integration: z.string().optional(), // Bound shared integration
534
- state: z.string().optional(), // Installation state
535
- status_payload: z.record(z.unknown()).optional(), // Status payload
536
- updated_at: z.string().optional(), // Last update timestamp
537
- });
538
- /** Schema for persona update parameters.
539
- */
540
- export const personaUpdateParamsSchema = z.object({
541
- metadata: z.record(z.unknown()).optional(), // Additional metadata
542
- name: z.string().optional(), // Persona display name
543
- personality: z.string().optional(), // Persona personality description
544
- });
545
- /** Schema for a dataset dimension field.
546
- */
547
- export const datasetDimensionSchema = z.object({
548
- label: z.string(), // Human-readable label
549
- name: z.string(), // Dimension identifier
550
- type: z.string(), // Data type (string, integer, boolean, datetime, date)
551
- });
552
- /** Schema for an app environment variable response with a masked value. */
553
- export const appEnvVarMaskedSchema = z.object({
554
- created_at: z.string().optional(), // Created timestamp
555
- description: z.string().optional(), // Optional description
556
- id: z.string(), // Environment variable ID
557
- key: z.string(), // Environment variable key
558
- masked_value: z.string(), // Masked environment variable value
559
- updated_at: z.string().optional(), // Updated timestamp
560
- });
561
- /** Schema for masked app environment variable list responses. */
562
- export const appEnvVarMaskedListSchema = z.object({
563
- data: z.array(appEnvVarMaskedSchema), // Environment variables
564
- });
565
- /** Schema for eval run list responses. */
566
- export const evalRunListSchema = z.object({
567
- data: z.array(evalRunSchema), // Eval runs
568
- });
569
- /** Schema for LLM call trajectory contents. */
570
- export const llmCallTrajectorySchema = z.object({
571
- download_url: z.string().optional(), // Signed transcript download URL
572
- messages: z.array(z.record(z.unknown())), // Trajectory messages
573
- });
574
- /** API schema for a user credential. */
575
- export const credentialSchema = z.object({
576
- alt_domains: z.record(z.unknown()).optional(), // Alternative domains
577
- created_at: z.string().optional(), // Creation timestamp
578
- description: z.string().optional(), // Description
579
- domain: z.string().optional(), // Primary domain
580
- id: z.string(), // Credential ID (ucr_...)
581
- last_accessed_at: z.string().optional(), // Last accessed timestamp
582
- org: z.string().optional(), // Organization
583
- sandbox: z.string().optional(), // Sandbox
584
- secret_group: z.string().optional(), // Secret group ID
585
- updated_at: z.string().optional(), // Last update timestamp
586
- });
587
- /** API schema for an activity feed entry. */
588
- export const activityFeedEntrySchema = z.object({
589
- 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(), lookup_key: z.string().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), phone_number: z.string().optional(), sandbox: z.string().optional(), team: z.string().optional(), updated_at: z.string().optional(), user: z.string().optional() })]).optional(), // Agent (public ID or expanded object when loaded)
590
- app: z.string().optional(), // Application
591
- attachments: z.array(z.record(z.unknown())).optional(), // Entry attachments
592
- automation_run: z.string().optional(), // Automation run
593
- content: z.string().optional(), // Longer explanation (markdown)
594
- correlation_id: z.string().optional(), // Correlation ID for grouped entries
595
- created_at: z.string().optional(), // Creation timestamp
596
- id: z.string(), // Entry ID (afe_...)
597
- kind: z.string().optional(), // Entry kind
598
- level: z.string().optional(), // Severity level
599
- metadata: z.record(z.unknown()).optional(), // Entry metadata
600
- org: z.string().optional(), // Organization
601
- routine_run: z.string().optional(), // Routine run
602
- sandbox: z.string().optional(), // Sandbox identifier
603
- session_record: z.string().optional(), // Agent session
604
- team: z.string().optional(), // Team
605
- thread: z.string().optional(), // Thread
606
- title: z.string().optional(), // One-line summary
607
- updated_at: z.string().optional(), // Last update timestamp
608
- user: z.union([z.string(), z.object({ alias: z.string().optional(), email: z.string().optional(), id: z.string(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().optional(), sandbox: z.string().optional() })]).optional(), // User (public ID or expanded object when loaded)
609
- });
610
- /** Schema for a dataset metric field.
611
- */
612
- export const datasetMetricSchema = z.object({
613
- aggregation: z.string(), // Aggregation function (sum, count, avg, min, max, count_distinct)
614
- label: z.string(), // Human-readable label
615
- name: z.string(), // Metric identifier
616
- type: z.string(), // Output type (integer, float)
617
- });
618
- /** Schema for an analytics dataset definition.
619
- */
620
- export const datasetSchema = z.object({
621
- dimensions: z.array(datasetDimensionSchema), // Available dimensions
622
- metrics: z.array(datasetMetricSchema), // Available metrics
623
- name: z.string(), // Dataset identifier
624
- time_dimension: datasetDimensionSchema.optional(), // Time dimension for time series queries
625
- });
626
- /** Schema for paginated messages response.
627
-
628
- Used by thread messages list endpoints.
629
- */
630
- export const paginatedMessagesSchema = z.object({
631
- after_cursor: z.string().optional(), // Cursor for fetching items after this point
632
- before_cursor: z.string().optional(), // Cursor for fetching items before this point
633
- messages: z.array(messageSchema), // List of message objects
634
- });
635
- /** Schema for an event catalog entry with full payload schema and sample.
636
- */
637
- export const eventCatalogEntrySchema = z.object({
638
- description: z.string(), // Human-readable description
639
- name: z.string(), // Event name (e.g., thread.created)
640
- parent: z.string().optional(), // Parent envelope name (only present for sub_event entries)
641
- sample: z.record(z.unknown()), // Sample payload for this event
642
- schema: z.record(z.unknown()), // JSON Schema describing the event payload
643
- sub_events: z.array(z.string()).optional(), // Known sub-event types (only present for envelope entries)
644
- type: z.string().optional(), // Entry type: "event" for exact events, "envelope" for wildcard families
645
- });
646
- /** Schema for a developer portal domain event. */
647
- export const domainEventSchema = z.object({
648
- agent: z.string().optional(), // Agent identifier
649
- created_at: z.string().optional(), // Created timestamp
650
- event_name: z.string(), // Event name
651
- id: z.string(), // Domain event ID
652
- idempotency_key: z.string().optional(), // Idempotency key for the event
653
- payload: z.record(z.unknown()), // Event payload
654
- team: z.string().optional(), // Team identifier
655
- user: z.string().optional(), // User identifier
656
- });
657
- /** List response for installations. */
658
- export const installationListResponseSchema = z.object({
659
- data: z.array(installationSchema), // List of installations
660
- });
661
- /** Public org schema for authenticated endpoints.
662
-
663
- Only exposes fields safe for any authenticated user: id, name, domain,
664
- and logo. Does NOT expose sandbox, status, industry, description, or
665
- other internal fields that the Developer.Org schema includes.
666
- */
667
- export const publicOrgSchema = z.object({
668
- domain: z.string(), // Primary domain
669
- id: z.string(), // Public ID (org_...)
670
- name: z.string(), // Organization name
671
- });
672
- /** API schema for background worker status on a routine run. */
673
- export const workerStatusSchema = z.object({
674
- attempt: z.number().int(), // Current attempt number (0 = not yet attempted)
675
- max_attempts: z.number().int(), // Maximum allowed attempts
676
- status: z.string(), // Worker state: queued, executing, retrying, completed, discarded, or cancelled
334
+ applicable_events: z.array(z.string()), // Event types this preset accepts. `["*"]` means any event. Other event types are rejected at routine validation time.
335
+ chainable: z.boolean(), // Whether this preset may appear as a step inside a `:chain` routine. Presets with session or async execution models are not chainable.
336
+ description: z.string(), // Preset description
337
+ label: z.string(), // Display label
338
+ name: z.string(), // Preset name (e.g. do_task)
339
+ sessionable: z.boolean(), // Whether this preset maintains a persistent chatroom session across turns (e.g. `participate`). Sessionable presets don't expose instructions or session-mode fields at the routine level.
340
+ unique: z.boolean(), // Whether only one routine with this preset may exist per agent. Enforced at the AgentRoutine unique-index layer.
677
341
  });
678
- /** API schema for authentication token responses. */
679
- export const authTokensSchema = z.object({
680
- expires_in: z.number().int(), // Token TTL in seconds
681
- metadata: z.record(z.unknown()).optional(), // Additional metadata (e.g., onboarding_job_id)
682
- refresh_token: z.string(), // Refresh token
683
- token: z.string(), // Access token (JWT)
684
- token_type: z.string(), // Token type (Bearer)
685
- user: userSchema, // Authenticated user
686
- });
687
- /** Filter object for matching personas by template ID. */
688
- export const templateFilterSchema = z.object({
689
- id: z.string(), // Persona template ID to match
690
- type: z.string(), // Filter type (must be "template")
691
- });
692
- /** API schema for a decrypted secret value response. */
693
- export const secretValueSchema = z.object({
694
- name: z.string(), // Secret name
695
- value: z.string(), // Decrypted secret value
696
- });
697
- /** A builtin tool catalog entry describing an available tool category. */
698
- export const builtinToolCatalogEntrySchema = z.object({
699
- config_schema: z.record(z.unknown()).optional(), // JSON schema for tool configuration
700
- description: z.string().optional(), // Tool description
701
- instruction: z.string().optional(), // Tool instruction
702
- key: z.string(), // Unique tool key
703
- label: z.string().optional(), // Display label
704
- providers: z.array(z.string()).optional(), // Supported providers
705
- requires_integration: z.boolean().optional(), // Whether an integration is required
706
- server_tool_type: z.string().optional(), // Server tool type identifier
707
- tools: z.array(builtinToolSchema).optional(), // List of individual tools
708
- });
709
- /** Schema for developer account billing settings. */
710
- export const developerSchema = z.object({
711
- billing_provider_environment: z.string().optional(), // Stripe environment (live or test)
712
- billing_provider_id: z.string().optional(), // Stripe customer ID
713
- });
714
- /** Schema for a task activity entry.
715
-
716
- Maps exactly to the activity entries produced by TaskActivitySentenceGenerator.
717
- */
718
- export const taskActivityEntrySchema = z.object({
719
- event_id: z.string().optional(), // Event ID
720
- event_type: z.string().optional(), // Type of event
721
- sentence: z.string().optional(), // Human-readable description of the activity
722
- timestamp: z.string().optional(), // When the event occurred
723
- });
724
- /** API schema for file URL refresh responses. */
725
- export const fileRefreshResultSchema = z.object({
726
- image_source: imageSourceSchema, // Updated image source with fresh URL
727
- success: z.boolean(), // Whether the refresh succeeded
728
- });
729
- /** Schema for a dataset query result.
730
- */
731
- export const datasetQueryResultSchema = z.object({
732
- columns: z.array(z.record(z.unknown())), // Column definitions with name, type, and label
733
- meta: z.record(z.unknown()), // Query metadata (total_rows, query_time_ms)
734
- rows: z.array(z.record(z.unknown())), // Result rows as maps of column_name → value
735
- });
736
- /** Schema for an API call record.
737
-
738
- Maps to serialized API call output from developer portal API.
739
- */
740
- export const apiCallSchema = z.object({
741
- api_key_type: z.string().optional(), // API key type (publishable or secret)
742
- created_at: z.string().optional(), // Created timestamp
743
- error_message: z.string().optional(), // Error message if request failed
744
- event_type: z.string().optional(), // Webhook event type (e.g. push, pull_request)
745
- full_url: z.string(), // Full request URL with query string
746
- handler_module: z.string().optional(), // ApiDsl action module
747
- id: z.string(), // Public ID (aac_...)
748
- ip_address: z.string().optional(), // Client IP address
749
- latency_ms: z.number().int(), // Latency in milliseconds
750
- metadata: z.record(z.unknown()).optional(), // Additional metadata (e.g. integration_ids for webhooks)
751
- method: z.string(), // HTTP method
752
- org: z.string().optional(), // Org if org-scoped
753
- path: z.string(), // Sanitized path with param placeholders
754
- query_string: z.string().optional(), // Query string
755
- request_body: z.record(z.unknown()).optional(), // Request body payload (webhooks only)
756
- request_headers: z.record(z.unknown()).optional(), // Request headers (webhooks only)
757
- request_id: z.string().optional(), // Request ID from Plug.RequestId
758
- status_code: z.number().int(), // HTTP status code
759
- team: z.string().optional(), // Team if team-scoped
760
- thread: z.string().optional(), // Thread if thread-scoped
761
- user: z.string().optional(), // User if user-scoped
762
- });
763
- /** Schema for paginated domain event responses. */
764
- export const domainEventPageSchema = z.object({
765
- data: z.array(domainEventSchema), // Domain events
766
- has_next: z.boolean(), // Whether a next page exists
767
- has_prev: z.boolean(), // Whether a previous page exists
768
- page: z.number().int(), // Current page number
769
- page_size: z.number().int(), // Page size
770
- total_entries: z.number().int(), // Total entries
771
- total_pages: z.number().int(), // Total pages
772
- });
773
- /** Schema for a documented API endpoint in the developer API explorer. */
774
- export const apiExplorerEndpointSchema = z.object({
775
- deprecated: z.boolean(), // Whether the route is deprecated
776
- description: z.string().optional(), // Endpoint description
777
- errors: z.array(z.record(z.unknown())), // Documented error responses
778
- method: z.string(), // HTTP method
779
- params: z.array(z.record(z.unknown())), // Documented params
780
- path: z.string(), // Route path
781
- returns: z.record(z.unknown()).optional(), // Return schema description
782
- scope: z.string(), // Endpoint scope
783
- tags: z.array(z.string()), // Route tags
784
- });
785
- export const resolvedToolSchema = z.object({
786
- description: z.string().optional(), // What this tool does
787
- name: z.string(), // Callable tool function name
788
- parameters: z.record(z.unknown()).optional(), // JSON Schema describing the expected input
789
- });
790
- /** Schema for an encrypted secret payload. */
791
- export const encryptedSecretSchema = z.object({
792
- encrypted_value: z.string(), // Encrypted ciphertext value
793
- });
794
- /** API schema for a custom object. */
795
- export const customObjectSchema = z.object({
796
- created_at: z.string().optional(), // Created timestamp
797
- fields: z.record(z.unknown()).optional(), // Object field values
798
- id: z.string(), // Public ID (cobj_...)
799
- org: z.string().optional(), // Organization
800
- row_key: z.string().optional(), // Row key
801
- sandbox: z.string().optional(), // Sandbox identifier
802
- schema_type: z.string().optional(), // Schema type (lookup_key)
803
- team: z.string().optional(), // Owning team
804
- updated_at: z.string().optional(), // Updated timestamp
805
- user: z.string().optional(), // Owning user
806
- version: z.number().int().optional(), // Aggregate version for OCC
807
- });
808
- /** Schema for task creation parameters.
809
-
810
- Used by both Users.Tasks.Create and Teams.Tasks.Create actions.
342
+ /** Schema for config validation result.
811
343
  */
812
- export const taskCreateParamsSchema = z.object({
813
- description: z.string().optional(), // Task description
814
- due_date: z.string().optional(), // Due date
815
- links: z.record(z.unknown()).optional(), // Related links
816
- metadata: z.record(z.unknown()).optional(), // Additional metadata
817
- name: z.string(), // Task name
818
- owner_persona: z.string().optional(), // Owner persona if assigned to agent
819
- owner_user: z.string().optional(), // Owner user if assigned to user
820
- priority: z.number().int().optional(), // Priority level (0-4)
821
- status: z.string().optional(), // Task status (open, in_progress, done)
822
- task: z.string().optional(), // Custom task ID (optional, auto-generated if not provided)
344
+ export const validationResultSchema = z.object({
345
+ errors: z.array(z.string()).optional(), // List of validation errors
346
+ valid: z.boolean(), // Whether the config is valid
347
+ warnings: z.array(z.string()).optional(), // Optional warnings emitted during validation
823
348
  });
824
- /** API schema for an installation source. */
825
- export const installationSourceSchema = z.object({
349
+ /** API schema for a working memory entry. */
350
+ export const workingMemoryEntrySchema = z.object({
826
351
  agent: z.string().optional(), // Owning agent
827
- context_installation: z.string().optional(), // Installation ID
828
- created_at: z.string().optional(), // Creation timestamp
829
- id: z.string(), // Source ID (cso_...)
830
- metadata: z.record(z.unknown()).optional(), // Arbitrary metadata
831
- parent_source: z.string().optional(), // Parent source ID
832
- payload: z.record(z.unknown()).optional(), // Source payload
833
- state: z.string().optional(), // Source state
834
- team: z.string().optional(), // Team ID
835
- thread: z.string().optional(), // Thread ID
836
- type: z.string().optional(), // Source type
837
- updated_at: z.string().optional(), // Last update timestamp
838
- user: z.string().optional(), // User ID
839
- });
840
- /** Schema for persona creation parameters.
841
- */
842
- export const personaCreateParamsSchema = z.object({
843
- name: z.string(), // Persona display name
844
- personality: z.string(), // Persona personality description
845
- profile_picture_style: z.string().optional(), // Profile picture generation style
846
- });
847
- /** API schema for a task. */
848
- export const taskSchema = z.object({
849
- closed_at: z.string().optional(), // When the task was closed
850
- comments_count: z.number().int().optional(), // Number of comments
851
352
  created_at: z.string().optional(), // Creation timestamp
852
- created_by: z.string().optional(), // Legacy creator
853
- created_by_actor: z.record(z.unknown()).optional(), // Creator actor details
854
- created_by_persona: z.string().optional(), // Creator persona
855
- created_by_type: z.string().optional(), // Creator type (user, agent)
856
- created_by_user: z.string().optional(), // Creator user
857
- description: z.string().optional(), // Task description
858
- due_date: z.string().optional(), // Due date
859
- id: z.string(), // Task ID (tsk_...)
860
- links: z.record(z.unknown()).optional(), // Related links
861
- metadata: z.record(z.unknown()).optional(), // Additional metadata
862
- name: z.string(), // Task name
863
- org: z.string().optional(), // Organization
864
- owner: z.string().optional(), // Legacy owner
865
- owner_actor: z.record(z.unknown()).optional(), // Owner actor details
866
- owner_persona: z.string().optional(), // Owner persona
867
- owner_user: z.string().optional(), // Owner user
868
- priority: z.number().int().optional(), // Priority level (0-4)
869
- sandbox: z.string().optional(), // Sandbox identifier
870
- status: z.string(), // Task status
871
- team: z.string().optional(), // Team
353
+ expires_at: z.string().optional(), // Expiration timestamp
354
+ id: z.string(), // Memory entry ID (amm_...)
355
+ key: z.string().optional(), // Memory key
872
356
  updated_at: z.string().optional(), // Last update timestamp
873
- });
874
- /** Schema for a developer app.
875
-
876
- Maps to serialized app output from developer portal API.
877
- */
878
- export const appSchema = z.object({
879
- app_slug: z.string().optional(), // Workspace slug (if set)
880
- app_url: z.string().optional(), // App URL
881
- brand_name: z.string().optional(), // Brand name for emails
882
- created_at: z.string().optional(), // Created timestamp
883
- description: z.string().optional(), // App description
884
- from_name: z.string().optional(), // From name for emails
885
- id: z.string(), // Public ID (dap_...)
886
- marketing_url: z.string().optional(), // Marketing URL
887
- muted_color: z.string().optional(), // Muted hex color
888
- name: z.string(), // App name
889
- primary_color: z.string().optional(), // Primary hex color
890
- sandboxes: z.array(sandboxSchema).optional(), // App sandboxes with keys
891
- status: z.string(), // Status (active, suspended)
892
- support_email: z.string().optional(), // Support email address
893
- third_party_oauth_enabled: z.boolean().optional(), // Third-party OAuth enabled
894
- updated_at: z.string().optional(), // Updated timestamp
895
- });
896
- /** Schema for a system access token (developer admin view).
897
-
898
- Maps to serialized system access token output from developer portal API.
899
- */
900
- export const developerSystemAccessTokenSchema = z.object({
901
- created_at: z.string().optional(), // Created timestamp
902
- id: z.string(), // Public ID (sat_...)
903
- last_used_at: z.string().optional(), // Last used timestamp
904
- name: z.string().optional(), // Optional label for the token
905
- revoked_at: z.string().optional(), // Revoked timestamp
906
- token: z.string().optional(), // Raw JWT (only present on creation)
907
- });
908
- /** Schema for a context source.
909
-
910
- Maps to serialized context source output from developer portal API.
911
- */
912
- export const contextSourceSchema = z.object({
913
- agent: z.string().optional(), // Owning agent
914
- context_installation: z.string().optional(), // Associated installation
915
- created_at: z.string().optional(), // Created timestamp
916
- id: z.string(), // Public ID (cso_...)
917
- metadata: z.record(z.unknown()).optional(), // Additional metadata
918
- org: z.string().optional(), // Owning organization
919
- parent_source: z.string().optional(), // Parent source
920
- payload: z.record(z.unknown()).optional(), // Type-specific configuration
921
- sandbox: z.string().optional(), // Owning sandbox
922
- state: z.string(), // State: active or paused
923
- team: z.string().optional(), // Owning team
924
- thread: z.string().optional(), // Associated thread
925
- type: z.string(), // Source type (e.g., gmail, github_activity)
926
- updated_at: z.string().optional(), // Updated timestamp
927
- user: z.string().optional(), // Owning user
357
+ value: z.string().optional(), // Memory value
928
358
  });
929
359
  /** Paginated list response for working memory entries. */
930
360
  export const workingMemoryEntryListResponseSchema = z.object({
@@ -936,318 +366,4 @@ export const workingMemoryEntryListResponseSchema = z.object({
936
366
  total_entries: z.number().int().optional(), // Total number of entries
937
367
  total_pages: z.number().int().optional(), // Total number of pages
938
368
  });
939
- /** Integration fields for auto-creating the underlying integration.
940
-
941
- When creating an agent installation for an `integration/*` kind, callers
942
- can pass this object to auto-create the underlying Integration record.
943
- Required fields depend on the kind's auth type:
944
-
945
- - `app_installation` kinds (slack_bot, github_app): requires `installation_id`
946
- - `oauth` kinds (gmail, outlook, slack): requires `access_token`
947
- */
948
- export const integrationCreateParamsSchema = z.object({
949
- access_token: z.string().optional(), // OAuth access token or API key
950
- installation_id: z.string().optional(), // External installation ID (e.g. GitHub App installation ID, Slack team_id)
951
- metadata: z.record(z.unknown()).optional(), // Provider-specific metadata (e.g. bot_user_id)
952
- refresh_token: z.string().optional(), // OAuth refresh token
953
- workspace_key: z.string().optional(), // Workspace name or identifier
954
- });
955
- /** Schema for a user credential.
956
-
957
- Maps to serialized credential output from developer portal API.
958
- */
959
- export const contextCredentialSchema = z.object({
960
- alt_domains: z.array(z.string()).optional(), // Alternative domains
961
- created_at: z.string().optional(), // Created timestamp
962
- description: z.string().optional(), // Human-readable description
963
- domain: z.string(), // Domain (e.g., app.schoology.com)
964
- id: z.string(), // Public ID (ucr_...)
965
- last_accessed_at: z.string().optional(), // Last accessed timestamp
966
- updated_at: z.string().optional(), // Updated timestamp
967
- user: z.string().optional(), // Owning user
968
- });
969
- /** API schema for the status/ping health check response. */
970
- export const statusPingSchema = z.object({
971
- success: z.boolean(), // Whether the ping succeeded
972
- token: z.record(z.unknown()), // Token status details
973
- user: userSchema.optional(), // Authenticated user (if token is valid)
974
- });
975
- /** Schema for an OAuth provider configuration.
976
-
977
- Maps to serialized OAuth provider output from developer portal API.
978
- */
979
- export const oAuthProviderSchema = z.object({
980
- callback_urls: z.array(z.string()).optional(), // Allowed callback URLs
981
- client_id: z.string(), // OAuth client ID
982
- created_at: z.string().optional(), // Created timestamp
983
- display_name: z.string().optional(), // Display name
984
- enabled: z.boolean().optional(), // Whether provider is enabled
985
- id: z.string(), // Public ID (dop_...)
986
- provider: z.string(), // Provider type (github, google)
987
- scopes: z.array(z.string()).optional(), // OAuth scopes
988
- updated_at: z.string().optional(), // Updated timestamp
989
- });
990
- /** Schema for config validation result.
991
- */
992
- export const validationResultSchema = z.object({
993
- errors: z.array(z.string()).optional(), // List of validation errors
994
- valid: z.boolean(), // Whether the config is valid
995
- warnings: z.array(z.string()).optional(), // Optional warnings emitted during validation
996
- });
997
- /** OAuth error response per RFC 6749 */
998
- export const oAuthErrorSchema = z.object({
999
- error: z.string(), // Error code (e.g. slow_down, invalid_grant)
1000
- error_description: z.string().optional(), // Human-readable error description
1001
- });
1002
- /** Schema for the current developer account. */
1003
- export const accountSchema = z.object({
1004
- alias: z.string().optional(), // Developer alias
1005
- created_at: z.string(), // Account creation date
1006
- email: z.string(), // Email address
1007
- email_verified: z.boolean(), // Whether email is verified
1008
- full_name: z.string().optional(), // Full name
1009
- id: z.string(), // Account ID
1010
- system_role: z.string(), // System role
1011
- timezone: z.string().optional(), // IANA timezone
1012
- });
1013
- /** Schema for eval task list responses. */
1014
- export const evalTaskListSchema = z.object({
1015
- data: z.array(evalTaskSchema), // Eval tasks
1016
- });
1017
- /** API schema for a knowledge search result item. */
1018
- export const knowledgeSearchResultSchema = z.object({
1019
- content: z.string().optional(), // Normalized content text
1020
- content_type: z.string().optional(), // Content MIME type
1021
- created_at: z.string().optional(), // Creation timestamp
1022
- id: z.string(), // Item ID (cim_...)
1023
- metadata: z.record(z.unknown()).optional(), // Additional metadata
1024
- raw_content: z.record(z.unknown()).optional(), // Raw content data
1025
- type: z.string().optional(), // Source type (requires preloaded :source association)
1026
- });
1027
- /** Schema for org billing settings. */
1028
- export const billingSettingsOrgSchema = z.object({
1029
- billing_provider_environment: z.string().optional(), // Stripe environment (live or test)
1030
- billing_provider_id: z.string().optional(), // Stripe customer ID
1031
- primary_user: z.string().optional(), // Org admin user who is the billing contact (public ID)
1032
- });
1033
- /** Schema for an integration provider entry.
1034
-
1035
- Represents an available integration provider (OAuth or MCP) that can be
1036
- used with `create integration --provider <provider>`.
1037
- */
1038
- export const integrationProviderSchema = z.object({
1039
- auth_type: z.string(), // Auth mechanism: oauth, bearer, or app_installation
1040
- description: z.string().optional(), // Short description of the provider
1041
- display_name: z.string(), // Human-readable display name
1042
- provider: z.string(), // Provider key (e.g., google, mcp:system:mcp-github)
1043
- type: z.string(), // Provider type: oauth, mcp, or app_installation
1044
- });
1045
- /** Schema for an organization.
1046
-
1047
- Maps to serialized org output from developer portal API.
1048
- */
1049
- export const developerOrgSchema = z.object({
1050
- created_at: z.string().optional(), // Created timestamp
1051
- description: z.string().optional(), // Organization description
1052
- domain: z.string(), // Primary domain
1053
- id: z.string(), // Public ID (org_...)
1054
- industry: z.string().optional(), // Industry category
1055
- name: z.string(), // Organization name
1056
- sandbox: z.string().optional(), // Sandbox identifier (nullable)
1057
- slug: z.string(), // URL-safe slug
1058
- status: z.string().optional(), // Status (active, suspended, trialing)
1059
- updated_at: z.string().optional(), // Updated timestamp
1060
- website: z.string().optional(), // Website URL
1061
- });
1062
- /** API schema for a credential with decrypted secret values. */
1063
- export const credentialWithSecretsSchema = z.object({
1064
- credential: z.record(z.unknown()), // The credential with decrypted values
1065
- });
1066
- /** API schema for a storage file. */
1067
- export const storageFileSchema = z.object({
1068
- content_type: z.string().optional(), // MIME content type
1069
- created_at: z.string().optional(), // Creation timestamp
1070
- filename: z.string().optional(), // Original filename
1071
- id: z.string(), // File ID
1072
- image_source: imageSourceSchema.optional(), // Image source metadata
1073
- org: z.string().optional(), // Organization
1074
- sandbox: z.string().optional(), // Sandbox
1075
- size: z.number().int().optional(), // File size in bytes
1076
- updated_at: z.string().optional(), // Last update timestamp
1077
- url: z.string().optional(), // Signed download URL
1078
- });
1079
- /** Schema for the API explorer response. */
1080
- export const apiExplorerIndexSchema = z.object({
1081
- data: z.array(apiExplorerEndpointSchema), // Documented API endpoints
1082
- schemas: z.record(z.unknown()).optional(), // Collected schema definitions
1083
- });
1084
- /** Schema for an app slug mapping. */
1085
- export const appSlugSchema = z.object({
1086
- app: z.string(), // App identifier
1087
- created_at: z.string().optional(), // Created timestamp
1088
- creator: z.string().optional(), // Creator identifier
1089
- id: z.string(), // Slug record ID
1090
- slug: z.string(), // Globally unique slug
1091
- updated_at: z.string().optional(), // Updated timestamp
1092
- });
1093
- /** Schema for a context item.
1094
-
1095
- Maps to serialized context item output from developer portal API.
1096
- */
1097
- export const contextItemSchema = z.object({
1098
- agent: z.string().optional(), // Agent
1099
- content_type: z.string().optional(), // Content type
1100
- created_at: z.string().optional(), // Created timestamp
1101
- id: z.string(), // Public ID (cim_...)
1102
- item_group: z.string().optional(), // Item group if part of a group
1103
- metadata: z.record(z.unknown()).optional(), // Additional metadata
1104
- normalized_content: z.string().optional(), // Normalized content text
1105
- raw_content: z.record(z.unknown()).optional(), // Raw content data
1106
- source: z.string().optional(), // Source
1107
- team: z.string().optional(), // Owning team
1108
- updated_at: z.string().optional(), // Updated timestamp
1109
- user: z.string().optional(), // Owning user
1110
- });
1111
- /** API schema for push notification test results. */
1112
- export const pushNotificationResultSchema = z.object({
1113
- results: z.array(z.record(z.unknown())).optional(), // Per-device results
1114
- success: z.boolean(), // Whether the notification was sent
1115
- total_sent: z.number().int().optional(), // Number of notifications sent
1116
- });
1117
- /** Schema for an OAuth client registration. */
1118
- export const oAuthClientSchema = z.object({
1119
- client_id: z.string(), // Public OAuth client ID
1120
- client_name: z.string(), // Display name for the client
1121
- client_secret: z.string().optional(), // Client secret shown only at creation
1122
- created_at: z.string().optional(), // Created timestamp
1123
- enabled: z.boolean(), // Whether the client is enabled
1124
- id: z.string(), // OAuth client registration ID
1125
- redirect_uris: z.array(z.string()), // Allowed redirect URIs
1126
- scopes: z.array(z.string()), // Allowed OAuth scopes
1127
- updated_at: z.string().optional(), // Updated timestamp
1128
- });
1129
- /** Schema for integration action metadata. */
1130
- export const integrationActionSchema = z.object({
1131
- description: z.string().optional(), // Action description
1132
- json_schema: z.record(z.unknown()), // JSON Schema for action parameters
1133
- key: z.string(), // Action key (e.g., gmail.list_messages)
1134
- scopes_any_of: z.record(z.unknown()).optional(), // Required scope sets for this action
1135
- });
1136
- /** Schema for app billing settings. */
1137
- export const billingSettingsAppSchema = z.object({
1138
- billing_account: z.string().optional(), // Developer account that owns billing (public ID)
1139
- org_billing_enabled: z.boolean().optional(), // Whether orgs get their own Stripe customers
1140
- });
1141
- /** Schema for an API key.
1142
-
1143
- Maps to serialized app key output from developer portal API.
1144
- */
1145
- export const appKeySchema = z.object({
1146
- created_at: z.string().optional(), // Created timestamp
1147
- full_key: z.string().optional(), // Full key shown only once at creation
1148
- id: z.string(), // Public ID (dak_...)
1149
- key_hint: z.string().optional(), // Last 4 chars hint
1150
- key_value: z.string().optional(), // Full key (publishable only)
1151
- last_used_at: z.string().optional(), // Last used timestamp
1152
- status: z.string(), // Status (active, revoked)
1153
- type: z.string(), // Key type (publishable, secret)
1154
- });
1155
- /** Schema for task update parameters.
1156
-
1157
- Used by both Users.Tasks.Update and Teams.Tasks.Update actions.
1158
- All fields are optional since updates only modify provided fields.
1159
- */
1160
- export const taskUpdateParamsSchema = z.object({
1161
- description: z.string().optional(), // Task description
1162
- due_date: z.string().optional(), // Due date
1163
- links: z.record(z.unknown()).optional(), // Related links
1164
- metadata: z.record(z.unknown()).optional(), // Additional metadata
1165
- name: z.string().optional(), // Task name
1166
- owner_persona: z.string().optional(), // Owner persona if assigned to agent
1167
- owner_user: z.string().optional(), // Owner user if assigned to user
1168
- priority: z.number().int().optional(), // Priority level (0-4)
1169
- status: z.string().optional(), // Task status (open, in_progress, done)
1170
- });
1171
- /** Schema for a context integration.
1172
-
1173
- Maps to serialized integration output from developer portal API.
1174
- */
1175
- export const contextIntegrationSchema = z.object({
1176
- agent: z.string().optional(), // Owning agent
1177
- auth_type: z.string(), // Auth type: oauth or app_installation
1178
- connected_at: z.string().optional(), // Connection timestamp
1179
- created_at: z.string().optional(), // Created timestamp
1180
- expires_at: z.string().optional(), // Token expiration timestamp
1181
- id: z.string(), // Public ID (int_...)
1182
- installation: z.string().optional(), // External installation (e.g. GitHub App installation)
1183
- last_refreshed_at: z.string().optional(), // Last token refresh timestamp
1184
- metadata: z.record(z.unknown()).optional(), // Additional metadata
1185
- org: z.string().optional(), // Owning org
1186
- provider: z.string(), // Provider name (e.g., google, github)
1187
- scopes: z.array(z.string()).optional(), // OAuth scopes
1188
- status: z.string(), // Connection status: connected, disconnected, or token_expired
1189
- team: z.string().optional(), // Owning team
1190
- updated_at: z.string().optional(), // Updated timestamp
1191
- user: z.string().optional(), // Owning user
1192
- workspace_key: z.string().optional(), // Workspace key
1193
- });
1194
- /** API schema for a scrape result. */
1195
- export const scrapeSchema = z.object({
1196
- created_at: z.string().optional(), // Creation timestamp
1197
- description: z.string().optional(), // Page description
1198
- id: z.string(), // Scrape ID (scp_...)
1199
- image_height: z.number().int().optional(), // Image height in pixels
1200
- image_url: z.string().optional(), // Image URL
1201
- image_width: z.number().int().optional(), // Image width in pixels
1202
- last_scraped_at: z.string().optional(), // Last scraped timestamp
1203
- metadata: z.record(z.unknown()).optional(), // Scrape metadata
1204
- status: z.string().optional(), // Scrape status
1205
- title: z.string().optional(), // Page title
1206
- updated_at: z.string().optional(), // Last update timestamp
1207
- url: z.string().optional(), // Scraped URL
1208
- version: z.number().int().optional(), // Scrape version
1209
- });
1210
- /** Schema for comment creation parameters.
1211
-
1212
- Used by both Users.Tasks.CreateComment and Teams.Tasks.CreateComment actions.
1213
- */
1214
- export const commentCreateParamsSchema = z.object({
1215
- body: z.string(), // Comment body text
1216
- });
1217
- /** Schema for a user (developer admin view).
1218
-
1219
- Maps to serialized user output from developer portal API.
1220
- */
1221
- export const developerUserSchema = z.object({
1222
- alias: z.string().optional(), // User alias
1223
- confirmed_at: z.string().optional(), // Email confirmed timestamp
1224
- created_at: z.string().optional(), // Created timestamp
1225
- email: z.string(), // Email address
1226
- full_name: z.string().optional(), // Full name
1227
- id: z.string(), // Public ID (usr_...)
1228
- is_system_user: z.boolean().optional(), // Whether this is a system user
1229
- org: z.string().optional(), // Organization (nullable)
1230
- org_name: z.string().optional(), // Organization display name (nullable)
1231
- org_role: z.string().optional(), // Organization role (admin, member, viewer; nullable)
1232
- password: z.string().optional(), // Temporary plaintext password returned on reset
1233
- sandbox: z.string().optional(), // Sandbox identifier (nullable)
1234
- updated_at: z.string().optional(), // Updated timestamp
1235
- });
1236
- /** Schema for password update parameters.
1237
- */
1238
- export const passwordUpdateParamsSchema = z.object({
1239
- password: z.string(), // New password
1240
- password_confirmation: z.string(), // New password confirmation
1241
- });
1242
- /** Schema for OAuth client list responses. */
1243
- export const oAuthClientListSchema = z.object({
1244
- data: z.array(oAuthClientSchema), // OAuth clients
1245
- });
1246
- /** Schema for message update request parameters.
1247
-
1248
- Used as the body wrapper when updating a message.
1249
- */
1250
- export const messageUpdateParamsSchema = z.object({
1251
- content: z.string().optional(), // New message content
1252
- });
1253
369
  //# sourceMappingURL=common.js.map