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