@archastro/sdk 0.15.0 → 0.16.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 (107) hide show
  1. package/dist/client.d.ts +4 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +5 -1
  4. package/dist/client.js.map +1 -1
  5. package/dist/effective-access.d.ts +34 -0
  6. package/dist/effective-access.d.ts.map +1 -0
  7. package/dist/effective-access.js +51 -0
  8. package/dist/effective-access.js.map +1 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/types/ai.d.ts +109 -109
  14. package/dist/types/ai.js +10 -10
  15. package/dist/types/ai.js.map +1 -1
  16. package/dist/types/automations.d.ts +15 -15
  17. package/dist/types/automations.js +6 -6
  18. package/dist/types/automations.js.map +1 -1
  19. package/dist/types/chat.d.ts +2520 -2520
  20. package/dist/types/chat.js +3 -3
  21. package/dist/types/chat.js.map +1 -1
  22. package/dist/types/common.d.ts +2545 -3272
  23. package/dist/types/common.d.ts.map +1 -1
  24. package/dist/types/common.js +204 -228
  25. package/dist/types/common.js.map +1 -1
  26. package/dist/types/config.d.ts +11 -11
  27. package/dist/types/config.js +3 -3
  28. package/dist/types/config.js.map +1 -1
  29. package/dist/types/events.d.ts +810 -0
  30. package/dist/types/events.d.ts.map +1 -0
  31. package/dist/types/events.js +77 -0
  32. package/dist/types/events.js.map +1 -0
  33. package/dist/types/expressions.d.ts +66 -0
  34. package/dist/types/expressions.d.ts.map +1 -0
  35. package/dist/types/expressions.js +27 -0
  36. package/dist/types/expressions.js.map +1 -0
  37. package/dist/types/extractions.d.ts +3 -3
  38. package/dist/types/extractions.js +2 -2
  39. package/dist/types/extractions.js.map +1 -1
  40. package/dist/types/graph.d.ts +34 -0
  41. package/dist/types/graph.d.ts.map +1 -0
  42. package/dist/types/graph.js +16 -0
  43. package/dist/types/graph.js.map +1 -0
  44. package/dist/types/index.d.ts +5 -0
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/types/index.js +6 -1
  47. package/dist/types/index.js.map +1 -1
  48. package/dist/types/notifications.d.ts +3 -3
  49. package/dist/types/notifications.js +2 -2
  50. package/dist/types/notifications.js.map +1 -1
  51. package/dist/types/oauth.d.ts +5 -5
  52. package/dist/types/scripts.d.ts +800 -0
  53. package/dist/types/scripts.d.ts.map +1 -0
  54. package/dist/types/scripts.js +112 -0
  55. package/dist/types/scripts.js.map +1 -0
  56. package/dist/types/status.d.ts +8 -8
  57. package/dist/types/status.js +2 -2
  58. package/dist/types/status.js.map +1 -1
  59. package/dist/types/tasks.d.ts +6 -6
  60. package/dist/types/tasks.js +3 -3
  61. package/dist/types/tasks.js.map +1 -1
  62. package/dist/types/teams.d.ts +334 -334
  63. package/dist/types/teams.js +5 -5
  64. package/dist/types/teams.js.map +1 -1
  65. package/dist/types/threads.d.ts +209 -209
  66. package/dist/types/threads.js +6 -6
  67. package/dist/types/threads.js.map +1 -1
  68. package/dist/types/users.d.ts +6 -6
  69. package/dist/types/users.js +3 -3
  70. package/dist/types/users.js.map +1 -1
  71. package/dist/types/workflows.d.ts +544 -0
  72. package/dist/types/workflows.d.ts.map +1 -0
  73. package/dist/types/workflows.js +91 -0
  74. package/dist/types/workflows.js.map +1 -0
  75. package/dist/v1/resources/agents.d.ts +4 -3
  76. package/dist/v1/resources/agents.d.ts.map +1 -1
  77. package/dist/v1/resources/agents.js +1 -1
  78. package/dist/v1/resources/agents.js.map +1 -1
  79. package/dist/v1/resources/ai.d.ts +2 -2
  80. package/dist/v1/resources/ai.d.ts.map +1 -1
  81. package/dist/v1/resources/ai.js +1 -1
  82. package/dist/v1/resources/event_subscriptions.d.ts +1 -1
  83. package/dist/v1/resources/event_subscriptions.js +1 -1
  84. package/dist/v1/resources/index.d.ts +2 -0
  85. package/dist/v1/resources/index.d.ts.map +1 -1
  86. package/dist/v1/resources/index.js +3 -1
  87. package/dist/v1/resources/index.js.map +1 -1
  88. package/dist/v1/resources/scripts.d.ts +117 -0
  89. package/dist/v1/resources/scripts.d.ts.map +1 -0
  90. package/dist/v1/resources/scripts.js +116 -0
  91. package/dist/v1/resources/scripts.js.map +1 -0
  92. package/dist/v1/resources/users.d.ts +8 -3
  93. package/dist/v1/resources/users.d.ts.map +1 -1
  94. package/dist/v1/resources/users.js +9 -3
  95. package/dist/v1/resources/users.js.map +1 -1
  96. package/dist/v1/resources/work_items.d.ts +1 -1
  97. package/dist/v1/resources/work_items.d.ts.map +1 -1
  98. package/dist/v1/resources/work_items.js +1 -1
  99. package/dist/v1/resources/workflows.d.ts +205 -0
  100. package/dist/v1/resources/workflows.d.ts.map +1 -0
  101. package/dist/v1/resources/workflows.js +205 -0
  102. package/dist/v1/resources/workflows.js.map +1 -0
  103. package/dist/v1.d.ts +4 -0
  104. package/dist/v1.d.ts.map +1 -1
  105. package/dist/v1.js +7 -1
  106. package/dist/v1.js.map +1 -1
  107. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  // Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
2
2
  // This file is auto-generated by @archastro/sdk-generator. Do not edit.
3
- // Content hash: 4b056560955c
3
+ // Content hash: 9577d3104f06
4
4
  import { z } from "zod";
5
5
  import { automationParticipantSlotSchema, automationPrefillsSchema } from "./automations.js";
6
6
  import { configSchema } from "./config.js";
7
7
  import { imageSourceSchema } from "./image.js";
8
8
  import { userSchema } from "./users.js";
9
+ import { workflowJournalSchema, workflowJournalEntrySchema } from "./workflows.js";
9
10
  /** Runtime validator for {@link AclGrant}. */
10
11
  export const aclGrantSchema = z.object({
11
12
  /** Array of action strings the principal is permitted to perform, e.g. `["read", "write"]`. Must contain at least one entry. */
@@ -34,11 +35,11 @@ export const aclSchema = z.object({
34
35
  /** Runtime validator for {@link ActivityFeedEntry}. */
35
36
  export const activityFeedEntrySchema = z.object({
36
37
  /** The agent that produced this event. Returns an agent ID (`agi_...`) by default, or an expanded agent object when the association is loaded. `null` if no agent is associated. */
37
- agent: z.union([z.string(), z.object({ acl: z.object({ add: z.array(z.object({ actions: z.array(z.string()), principal: z.string().optional(), principal_type: z.string() })).optional(), grants: z.array(z.object({ actions: z.array(z.string()), principal: z.string().optional(), principal_type: z.string() })).optional(), remove: z.array(z.object({ principal: z.string().optional(), principal_type: z.string() })).optional() }).nullable().optional(), app: z.string().optional(), created_at: z.string().optional(), default_model: z.string().nullable().optional(), description: z.string().nullable().optional(), email: z.string().nullable().optional(), id: z.string(), identity: z.string().nullable().optional(), last_applied_template_config: z.string().nullable().optional(), lookup_key: z.string().nullable().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().optional(), org: z.string().nullable().optional(), org_name: z.string().nullable().optional(), originator: z.string().nullable().optional(), phone_number: z.string().nullable().optional(), sandbox: z.string().nullable().optional(), source_solution: z.object({ current_solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().nullable().optional(), events: z.record(z.unknown()).optional(), id: z.string(), image_url: z.string().nullable().optional(), kind: z.string(), latest_solution: z.string().nullable().optional(), latest_version: z.string().nullable().optional(), lookup_key: z.string().nullable().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_logo: z.object({ file: z.string().nullable().optional(), height: z.number().int().nullable().optional(), media: z.string().nullable().optional(), mime_type: z.string().nullable().optional(), refresh_url: z.string().nullable().optional(), url: z.string().nullable().optional(), width: z.number().int().nullable().optional() }).nullable().optional(), org_name: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), owners: z.array(z.string()), readme_url: z.string().nullable().optional(), screenshot_urls: z.array(z.string()).optional(), solution_id: z.string().nullable().optional(), solution_version: z.string().nullable().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().nullable().optional(), templates: z.array(z.object({ description: z.string().nullable().optional(), details: z.object({ automation_type: z.string().nullable().optional(), invoke_contract: z.object({ input_schema: z.record(z.unknown()).nullable().optional(), participants: z.array(z.object({ description: z.string().nullable().optional(), name: z.string(), required: z.boolean(), type: z.string() })).nullable().optional(), prefills: z.object({ participants: z.record(z.unknown()).optional(), payload: z.record(z.unknown()).optional() }) }).nullable().optional(), type: z.literal("automation") }).nullable().optional(), display_name: z.string().nullable().optional(), id: z.string().nullable().optional(), kind: z.string(), lookup_key: z.string().nullable().optional(), name: z.string().nullable().optional(), readme_url: z.string().nullable().optional(), virtual_path: z.string().nullable().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().nullable().optional() }).optional(), solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().nullable().optional(), events: z.record(z.unknown()).optional(), id: z.string(), image_url: z.string().nullable().optional(), kind: z.string(), latest_solution: z.string().nullable().optional(), latest_version: z.string().nullable().optional(), lookup_key: z.string().nullable().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_logo: z.object({ file: z.string().nullable().optional(), height: z.number().int().nullable().optional(), media: z.string().nullable().optional(), mime_type: z.string().nullable().optional(), refresh_url: z.string().nullable().optional(), url: z.string().nullable().optional(), width: z.number().int().nullable().optional() }).nullable().optional(), org_name: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), owners: z.array(z.string()), readme_url: z.string().nullable().optional(), screenshot_urls: z.array(z.string()).optional(), solution_id: z.string().nullable().optional(), solution_version: z.string().nullable().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().nullable().optional(), templates: z.array(z.object({ description: z.string().nullable().optional(), details: z.object({ automation_type: z.string().nullable().optional(), invoke_contract: z.object({ input_schema: z.record(z.unknown()).nullable().optional(), participants: z.array(z.object({ description: z.string().nullable().optional(), name: z.string(), required: z.boolean(), type: z.string() })).nullable().optional(), prefills: z.object({ participants: z.record(z.unknown()).optional(), payload: z.record(z.unknown()).optional() }) }).nullable().optional(), type: z.literal("automation") }).nullable().optional(), display_name: z.string().nullable().optional(), id: z.string().nullable().optional(), kind: z.string(), lookup_key: z.string().nullable().optional(), name: z.string().nullable().optional(), readme_url: z.string().nullable().optional(), virtual_path: z.string().nullable().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().nullable().optional() }), template: z.object({ created_at: z.string().optional(), description: z.string().nullable().optional(), display_name: z.string().nullable().optional(), id: z.string(), kind: z.string(), lookup_key: z.string().nullable().optional(), name: z.string().nullable().optional(), updated_at: z.string().optional(), virtual_path: z.string().nullable().optional() }) }).nullable().optional(), team: z.string().nullable().optional(), template_upgrade_available: z.boolean().nullable().optional(), updated_at: z.string().optional(), user: z.string().nullable().optional() })]).optional().describe("The agent that produced this event. Returns an agent ID (`agi_...`) by default, or an expanded agent object when the association is loaded. `null` if no agent is associated."),
38
+ 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() }).nullable().optional(), app: z.string().optional(), created_at: z.string().optional(), default_model: z.string().nullable().optional(), description: z.string().nullable().optional(), email: z.string().nullable().optional(), id: z.string(), identity: z.string().nullable().optional(), last_applied_template_config: z.string().nullable().optional(), lookup_key: z.string().nullable().optional(), metadata: z.record(z.custom((value) => value !== undefined)).optional(), name: z.string().optional(), org: z.string().nullable().optional(), org_name: z.string().nullable().optional(), originator: z.string().nullable().optional(), phone_number: z.string().nullable().optional(), sandbox: z.string().nullable().optional(), source_solution: z.object({ current_solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().nullable().optional(), events: z.record(z.custom((value) => value !== undefined)).optional(), id: z.string(), image_url: z.string().nullable().optional(), kind: z.string(), latest_solution: z.string().nullable().optional(), latest_version: z.string().nullable().optional(), lookup_key: z.string().nullable().optional(), metadata: z.record(z.custom((value) => value !== undefined)).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_logo: z.object({ file: z.string().nullable().optional(), height: z.number().int().nullable().optional(), media: z.string().nullable().optional(), mime_type: z.string().nullable().optional(), refresh_url: z.string().nullable().optional(), url: z.string().nullable().optional(), width: z.number().int().nullable().optional() }).nullable().optional(), org_name: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), owners: z.array(z.string()), readme_url: z.string().nullable().optional(), screenshot_urls: z.array(z.string()).optional(), solution_id: z.string().nullable().optional(), solution_version: z.string().nullable().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().nullable().optional(), templates: z.array(z.object({ description: z.string().nullable().optional(), details: z.object({ automation_type: z.string().nullable().optional(), invoke_contract: z.object({ input_schema: z.record(z.custom((value) => value !== undefined)).nullable().optional(), participants: z.array(z.object({ description: z.string().nullable().optional(), name: z.string(), required: z.boolean(), type: z.string() })).nullable().optional(), prefills: z.object({ participants: z.record(z.custom((value) => value !== undefined)).optional(), payload: z.record(z.custom((value) => value !== undefined)).optional() }) }).nullable().optional(), type: z.literal("automation") }).nullable().optional(), display_name: z.string().nullable().optional(), id: z.string().nullable().optional(), kind: z.string(), lookup_key: z.string().nullable().optional(), name: z.string().nullable().optional(), readme_url: z.string().nullable().optional(), virtual_path: z.string().nullable().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().nullable().optional() }).optional(), solution: z.object({ category_keys: z.array(z.string()).optional(), created_at: z.string().optional(), description: z.string().nullable().optional(), events: z.record(z.custom((value) => value !== undefined)).optional(), id: z.string(), image_url: z.string().nullable().optional(), kind: z.string(), latest_solution: z.string().nullable().optional(), latest_version: z.string().nullable().optional(), lookup_key: z.string().nullable().optional(), metadata: z.record(z.custom((value) => value !== undefined)).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_logo: z.object({ file: z.string().nullable().optional(), height: z.number().int().nullable().optional(), media: z.string().nullable().optional(), mime_type: z.string().nullable().optional(), refresh_url: z.string().nullable().optional(), url: z.string().nullable().optional(), width: z.number().int().nullable().optional() }).nullable().optional(), org_name: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), owners: z.array(z.string()), readme_url: z.string().nullable().optional(), screenshot_urls: z.array(z.string()).optional(), solution_id: z.string().nullable().optional(), solution_version: z.string().nullable().optional(), tag_keys: z.array(z.string()).optional(), template_kind: z.string().nullable().optional(), templates: z.array(z.object({ description: z.string().nullable().optional(), details: z.object({ automation_type: z.string().nullable().optional(), invoke_contract: z.object({ input_schema: z.record(z.custom((value) => value !== undefined)).nullable().optional(), participants: z.array(z.object({ description: z.string().nullable().optional(), name: z.string(), required: z.boolean(), type: z.string() })).nullable().optional(), prefills: z.object({ participants: z.record(z.custom((value) => value !== undefined)).optional(), payload: z.record(z.custom((value) => value !== undefined)).optional() }) }).nullable().optional(), type: z.literal("automation") }).nullable().optional(), display_name: z.string().nullable().optional(), id: z.string().nullable().optional(), kind: z.string(), lookup_key: z.string().nullable().optional(), name: z.string().nullable().optional(), readme_url: z.string().nullable().optional(), virtual_path: z.string().nullable().optional() })), updated_at: z.string().optional(), upgrade_available: z.boolean(), virtual_path: z.string().nullable().optional() }), template: z.object({ created_at: z.string().optional(), description: z.string().nullable().optional(), display_name: z.string().nullable().optional(), id: z.string(), kind: z.string(), lookup_key: z.string().nullable().optional(), name: z.string().nullable().optional(), updated_at: z.string().optional(), virtual_path: z.string().nullable().optional() }) }).nullable().optional(), team: z.string().nullable().optional(), template_upgrade_available: z.boolean().nullable().optional(), updated_at: z.string().optional(), user: z.string().nullable().optional() })]).optional().describe("The agent that produced this event. Returns an agent ID (`agi_...`) by default, or an expanded agent object when the association is loaded. `null` if no agent is associated."),
38
39
  /** ID of the application that produced this entry (`dap_...`). `null` if not scoped to an app. */
39
40
  app: z.string().optional().describe("ID of the application that produced this entry (`dap_...`). `null` if not scoped to an app."),
40
41
  /** Array of attachment objects associated with this entry. Each attachment has a `type` field (e.g. `"file"`, `"task"`, `"artifact"`) and type-specific additional fields. Empty array when there are no attachments. */
41
- attachments: z.array(z.record(z.unknown())).optional().describe("Array of attachment objects associated with this entry. Each attachment has a `type` field (e.g. `\"file\"`, `\"task\"`, `\"artifact\"`) and type-specific additional fields. Empty array when there are no attachments."),
42
+ attachments: z.array(z.record(z.custom((value) => value !== undefined))).optional().describe("Array of attachment objects associated with this entry. Each attachment has a `type` field (e.g. `\"file\"`, `\"task\"`, `\"artifact\"`) and type-specific additional fields. Empty array when there are no attachments."),
42
43
  /** ID of the automation run that produced this entry (`atr_...`). `null` if not produced by an automation run. */
43
44
  automation_run: z.string().optional().describe("ID of the automation run that produced this entry (`atr_...`). `null` if not produced by an automation run."),
44
45
  /** A longer explanation of the event rendered as Markdown. `null` if no additional content is available. */
@@ -54,7 +55,7 @@ export const activityFeedEntrySchema = z.object({
54
55
  /** Severity level of the event. One of `"info"`, `"warning"`, or `"error"`. `null` if no severity is set. */
55
56
  level: z.string().optional().describe("Severity level of the event. One of `\"info\"`, `\"warning\"`, or `\"error\"`. `null` if no severity is set."),
56
57
  /** Arbitrary key-value metadata stored on this entry. Returns an empty object when no metadata is set. */
57
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata stored on this entry. Returns an empty object when no metadata is set."),
58
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata stored on this entry. Returns an empty object when no metadata is set."),
58
59
  /** ID of the organization this entry belongs to (`org_...`). `null` if not org-scoped. */
59
60
  org: z.string().optional().describe("ID of the organization this entry belongs to (`org_...`). `null` if not org-scoped."),
60
61
  /** ID of the agent routine run that produced this entry (`arr_...`). `null` if not produced by a routine run. */
@@ -72,7 +73,7 @@ export const activityFeedEntrySchema = z.object({
72
73
  /** When this activity feed entry was last modified (ISO 8601). */
73
74
  updated_at: z.string().optional().describe("When this activity feed entry was last modified (ISO 8601)."),
74
75
  /** The user who triggered this event. Returns a user ID (`usr_...`) by default, or an expanded user object when the association is loaded. `null` if no user is associated. */
75
- user: z.union([z.string(), z.object({ alias: z.string().nullable().optional(), app: z.string().nullable().optional(), app_name: z.string().nullable().optional(), created_by_agent_user: z.string().nullable().optional(), created_by_developer: z.string().nullable().optional(), created_by_org: z.string().nullable().optional(), created_by_team: z.string().nullable().optional(), created_by_user: z.string().nullable().optional(), email: z.string().nullable().optional(), id: z.string(), is_system_user: z.boolean().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_name: z.string().nullable().optional(), org_role: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), sandbox: z.string().nullable().optional(), sandbox_name: z.string().nullable().optional() })]).optional().describe("The user who triggered this event. Returns a user ID (`usr_...`) by default, or an expanded user object when the association is loaded. `null` if no user is associated."),
76
+ user: z.union([z.string(), z.object({ alias: z.string().nullable().optional(), app: z.string().nullable().optional(), app_name: z.string().nullable().optional(), created_by_agent_user: z.string().nullable().optional(), created_by_developer: z.string().nullable().optional(), created_by_org: z.string().nullable().optional(), created_by_team: z.string().nullable().optional(), created_by_user: z.string().nullable().optional(), email: z.string().nullable().optional(), id: z.string(), is_system_user: z.boolean().optional(), metadata: z.record(z.custom((value) => value !== undefined)).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_name: z.string().nullable().optional(), org_role: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), sandbox: z.string().nullable().optional(), sandbox_name: z.string().nullable().optional() })]).optional().describe("The user who triggered this event. Returns a user ID (`usr_...`) by default, or an expanded user object when the association is loaded. `null` if no user is associated."),
76
77
  }).describe("A single event record in an activity feed, capturing what happened, who caused it, and which resources were involved.");
77
78
  /** Runtime validator for {@link ActivityFeedEntryListResponse}. */
78
79
  export const activityFeedEntryListResponseSchema = z.object({
@@ -212,7 +213,7 @@ export const attachmentSchema = z.object({
212
213
  /** Display name of the media item. Present on `media` type only. `null` otherwise. */
213
214
  name: z.string().nullable().optional().describe("Display name of the media item. Present on `media` type only. `null` otherwise."),
214
215
  /** The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. Omitted on other types. */
215
- object: z.record(z.unknown()).optional().describe("The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. Omitted on other types."),
216
+ object: z.record(z.custom((value) => value !== undefined)).optional().describe("The full embedded object payload. For `task` type, contains the task record. For `action` type, contains the action definition. For `chart` type, contains the chart with its inline `spec`. Omitted on other types."),
216
217
  /** Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types. */
217
218
  title: z.string().nullable().optional().describe("Display title. The page title for `scraped_link`, the artifact name for `artifact`, and the task title for `task` types. `null` on other types."),
218
219
  /** The attachment type. One of `"file"`, `"scraped_link"`, `"artifact"`, `"task"`, `"media"`, `"action"`, or `"chart"`. Determines which additional fields are present. */
@@ -231,7 +232,7 @@ export const authTokensSchema = z.object({
231
232
  /** Number of seconds until `token` expires. After this period, use `refresh_token` to obtain a new access token. */
232
233
  expires_in: z.number().int().describe("Number of seconds until `token` expires. After this period, use `refresh_token` to obtain a new access token."),
233
234
  /** Optional auxiliary data associated with this authentication event, such as `onboarding_job_id` when the user is completing onboarding. `null` when no extra context is present. */
234
- metadata: z.record(z.unknown()).optional().describe("Optional auxiliary data associated with this authentication event, such as `onboarding_job_id` when the user is completing onboarding. `null` when no extra context is present."),
235
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Optional auxiliary data associated with this authentication event, such as `onboarding_job_id` when the user is completing onboarding. `null` when no extra context is present."),
235
236
  /** Long-lived opaque refresh token. Use this to obtain a new access token when `token` expires. */
236
237
  refresh_token: z.string().describe("Long-lived opaque refresh token. Use this to obtain a new access token when `token` expires."),
237
238
  /** Short-lived JWT access token. Include this value in the `Authorization: Bearer <token>` header for all authenticated API requests. */
@@ -250,7 +251,7 @@ export const bugReportSchema = z.object({
250
251
  /** Version string of the submitting client at the time of submission, e.g. `"1.4.2"`. */
251
252
  client_version: z.string().describe("Version string of the submitting client at the time of submission, e.g. `\"1.4.2\"`."),
252
253
  /** Optional free-form JSON object providing additional context captured by the client (e.g. viewport size, active route). `null` when no context was provided. Maximum 5 KB when serialized. */
253
- context: z.record(z.unknown()).optional().describe("Optional free-form JSON object providing additional context captured by the client (e.g. viewport size, active route). `null` when no context was provided. Maximum 5 KB when serialized."),
254
+ context: z.record(z.custom((value) => value !== undefined)).optional().describe("Optional free-form JSON object providing additional context captured by the client (e.g. viewport size, active route). `null` when no context was provided. Maximum 5 KB when serialized."),
254
255
  /** When the bug report was submitted (ISO 8601). */
255
256
  created_at: z.string().optional().describe("When the bug report was submitted (ISO 8601)."),
256
257
  /** Freeform text describing the issue or feedback, as entered by the user. Up to 10,000 characters. */
@@ -276,7 +277,7 @@ export const builtinToolSchema = z.object({
276
277
  /** Runtime validator for {@link BuiltinToolCatalogEntry}. */
277
278
  export const builtinToolCatalogEntrySchema = z.object({
278
279
  /** JSON Schema object describing the configuration options for this tool category. Clients should use this schema to render and validate configuration forms before submitting. `null` when no configuration is needed. */
279
- config_schema: z.record(z.unknown()).optional().describe("JSON Schema object describing the configuration options for this tool category. Clients should use this schema to render and validate configuration forms before submitting. `null` when no configuration is needed."),
280
+ config_schema: z.record(z.custom((value) => value !== undefined)).optional().describe("JSON Schema object describing the configuration options for this tool category. Clients should use this schema to render and validate configuration forms before submitting. `null` when no configuration is needed."),
280
281
  /** Short prose description of what this tool category does. Suitable for display in setup UIs. `null` when no description has been defined. */
281
282
  description: z.string().optional().describe("Short prose description of what this tool category does. Suitable for display in setup UIs. `null` when no description has been defined."),
282
283
  /** Additional guidance surfaced to the agent at runtime when this tool category is enabled. `null` when no custom instruction is set. */
@@ -307,7 +308,7 @@ export const channelAckSchema = z.object({}).describe("Empty acknowledgement pay
307
308
  /** Runtime validator for {@link MessageContext}. */
308
309
  export const messageContextSchema = z.object({
309
310
  /** Scalar key-value fields describing the context, such as route, repository, or pull-request number. */
310
- attributes: z.record(z.unknown()).optional().describe("Scalar key-value fields describing the context, such as route, repository, or pull-request number."),
311
+ attributes: z.record(z.custom((value) => value !== undefined)).optional().describe("Scalar key-value fields describing the context, such as route, repository, or pull-request number."),
311
312
  /** Optional context body. The model receives it as escaped XML data, not a system instruction. */
312
313
  content: z.string().nullable().optional().describe("Optional context body. The model receives it as escaped XML data, not a system instruction."),
313
314
  /** Optional human-readable label for this context block. */
@@ -318,7 +319,7 @@ export const messageContextSchema = z.object({
318
319
  /** Runtime validator for {@link MessageReaction}. */
319
320
  export const messageReactionSchema = z.object({
320
321
  /** Type-specific reaction data. For `"emoji_reaction"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `"👍"`). */
321
- payload: z.record(z.unknown()).optional().describe("Type-specific reaction data. For `\"emoji_reaction\"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `\"👍\"`)."),
322
+ payload: z.record(z.custom((value) => value !== undefined)).optional().describe("Type-specific reaction data. For `\"emoji_reaction\"` reactions, contains an `emoji` key with the Unicode emoji string (e.g., `\"👍\"`)."),
322
323
  /** Reaction type identifier. Currently always `"emoji_reaction"` for emoji-based reactions. */
323
324
  type: z.string().describe("Reaction type identifier. Currently always `\"emoji_reaction\"` for emoji-based reactions."),
324
325
  /** Public ID of the user who added the reaction (`usr_...`). */
@@ -355,7 +356,7 @@ export const messageSchema = z.object({
355
356
  /** Identifier of the legacy chat agent that sent this message, if applicable. `null` for messages sent by users or modern agent users. */
356
357
  legacy_agent: z.string().nullable().optional().describe("Identifier of the legacy chat agent that sent this message, if applicable. `null` for messages sent by users or modern agent users."),
357
358
  /** Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set. */
358
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set."),
359
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to the message. Always present; defaults to an empty object when no metadata has been set."),
359
360
  /** ID of the organization that owns this message (`org_...`). */
360
361
  org: z.string().nullable().optional().describe("ID of the organization that owns this message (`org_...`)."),
361
362
  /** Emoji and other reactions added to this message by users. Empty array if no reactions have been added or the association is not preloaded. */
@@ -363,7 +364,7 @@ export const messageSchema = z.object({
363
364
  /** Display hint for how the message should be rendered. One of `"reply"`, `"direct"`, or `"inline"`. `null` for user-authored messages, which are always rendered as standard replies. */
364
365
  rendering_mode: z.string().nullable().optional().describe("Display hint for how the message should be rendered. One of `\"reply\"`, `\"direct\"`, or `\"inline\"`. `null` for user-authored messages, which are always rendered as standard replies."),
365
366
  /** Inline array of reply messages, each serialized as a full message object. Only present when the server has preloaded replies for this message. */
366
- replies: z.array(z.record(z.unknown())).optional().describe("Inline array of reply messages, each serialized as a full message object. Only present when the server has preloaded replies for this message."),
367
+ replies: z.array(z.record(z.custom((value) => value !== undefined))).optional().describe("Inline array of reply messages, each serialized as a full message object. Only present when the server has preloaded replies for this message."),
367
368
  /** Opaque pagination cursor to fetch replies posted after the current page. Only present when inline replies are included in the response. */
368
369
  replies_after_cursor: z.string().nullable().optional().describe("Opaque pagination cursor to fetch replies posted after the current page. Only present when inline replies are included in the response."),
369
370
  /** Opaque pagination cursor to fetch replies posted before the current page. Only present when inline replies are included in the response. */
@@ -371,7 +372,7 @@ export const messageSchema = z.object({
371
372
  /** Total number of direct replies to this message. Only present when explicitly requested or computed by the server. */
372
373
  reply_count: z.number().int().optional().describe("Total number of direct replies to this message. Only present when explicitly requested or computed by the server."),
373
374
  /** The parent message this message is a reply to, expanded as a full message object when loaded. `null` if this is a top-level message or the association is not preloaded. */
374
- reply_to: z.record(z.unknown()).nullable().optional().describe("The parent message this message is a reply to, expanded as a full message object when loaded. `null` if this is a top-level message or the association is not preloaded."),
375
+ reply_to: z.record(z.custom((value) => value !== undefined)).nullable().optional().describe("The parent message this message is a reply to, expanded as a full message object when loaded. `null` if this is a top-level message or the association is not preloaded."),
375
376
  /** ID of the root message in this reply chain (`msg_...`). `null` for a top-level message. The value is persisted when the reply is created, so callers can correlate a multi-turn session without walking parent messages. */
376
377
  root_message_id: z.string().nullable().optional().describe("ID of the root message in this reply chain (`msg_...`). `null` for a top-level message. The value is persisted when the reply is created, so callers can correlate a multi-turn session without walking parent messages."),
377
378
  /** ID of the developer sandbox this message belongs to (`dsb_...`). `null` for non-sandbox messages. */
@@ -383,7 +384,7 @@ export const messageSchema = z.object({
383
384
  /** Optional client-defined classification for the message (for example `note` or `status`). Free-form string up to 64 characters. The value `system` is reserved for platform-authored messages and cannot be set by clients. `null` when unset. */
384
385
  type: z.string().nullable().optional().describe("Optional client-defined classification for the message (for example `note` or `status`). Free-form string up to 64 characters. The value `system` is reserved for platform-authored messages and cannot be set by clients. `null` when unset."),
385
386
  /** The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents. */
386
- user: z.union([z.string(), z.object({ alias: z.string().nullable().optional(), app: z.string().nullable().optional(), app_name: z.string().nullable().optional(), created_by_agent_user: z.string().nullable().optional(), created_by_developer: z.string().nullable().optional(), created_by_org: z.string().nullable().optional(), created_by_team: z.string().nullable().optional(), created_by_user: z.string().nullable().optional(), email: z.string().nullable().optional(), id: z.string(), is_system_user: z.boolean().optional(), metadata: z.record(z.unknown()).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_name: z.string().nullable().optional(), org_role: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), sandbox: z.string().nullable().optional(), sandbox_name: z.string().nullable().optional() })]).nullable().optional().describe("The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents."),
387
+ user: z.union([z.string(), z.object({ alias: z.string().nullable().optional(), app: z.string().nullable().optional(), app_name: z.string().nullable().optional(), created_by_agent_user: z.string().nullable().optional(), created_by_developer: z.string().nullable().optional(), created_by_org: z.string().nullable().optional(), created_by_team: z.string().nullable().optional(), created_by_user: z.string().nullable().optional(), email: z.string().nullable().optional(), id: z.string(), is_system_user: z.boolean().optional(), metadata: z.record(z.custom((value) => value !== undefined)).optional(), name: z.string().nullable().optional(), org: z.string().nullable().optional(), org_name: z.string().nullable().optional(), org_role: z.string().nullable().optional(), org_slug: z.string().nullable().optional(), sandbox: z.string().nullable().optional(), sandbox_name: z.string().nullable().optional() })]).nullable().optional().describe("The human user who sent this message. Returns a public ID string (`usr_...`) when the association is not preloaded, or an expanded user object when it is. `null` for messages sent by agents."),
387
388
  /** Message-level visibility. `default` is visible to anyone who can see the parent thread. `private` is restricted to the sender and explicit ACL `read` grantees. */
388
389
  visibility: z.enum(["default", "private"]).optional().describe("Message-level visibility. `default` is visible to anyone who can see the parent thread. `private` is restricted to the sender and explicit ACL `read` grantees."),
389
390
  }).describe("A chat message posted in a thread, including its content, author, attachments, reactions, and optional reply metadata.");
@@ -400,6 +401,21 @@ export const errorSchema = z.object({
400
401
  message: z.string(),
401
402
  status: z.literal("error"),
402
403
  }).describe("A failed local-tool outcome.");
404
+ /** Runtime validator for {@link Command}. */
405
+ export const commandSchema = z.object({
406
+ /** Human-readable description of what the command does, shown alongside the name in the workflow builder. */
407
+ description: z.string().describe("Human-readable description of what the command does, shown alongside the name in the workflow builder."),
408
+ /** JSON Schema describing the shape of an error output. `null` if the command does not produce structured error data. */
409
+ errorOutput: z.record(z.custom((value) => value !== undefined)).optional().describe("JSON Schema describing the shape of an error output. `null` if the command does not produce structured error data."),
410
+ /** JSON Schema describing the input the command expects. `null` if the command takes no input. */
411
+ expectedInput: z.record(z.custom((value) => value !== undefined)).optional().describe("JSON Schema describing the input the command expects. `null` if the command takes no input."),
412
+ /** Unique string identifier for the command, used to reference it in workflow node configurations. */
413
+ id: z.string().describe("Unique string identifier for the command, used to reference it in workflow node configurations."),
414
+ /** Human-readable display name for the command shown in the workflow builder. */
415
+ name: z.string().describe("Human-readable display name for the command shown in the workflow builder."),
416
+ /** JSON Schema describing the shape of a successful output. `null` if the command produces no output on success. */
417
+ successOutput: z.record(z.custom((value) => value !== undefined)).optional().describe("JSON Schema describing the shape of a successful output. `null` if the command produces no output on success."),
418
+ }).describe("A workflow command that a workflow node can invoke, including its identifier, human-readable name, and JSON schemas for its inputs and outputs.");
403
419
  /** Runtime validator for {@link ComputerExecResult}. */
404
420
  export const computerExecResultSchema = z.object({
405
421
  /** The UNIX exit code returned by the process. `0` indicates success; any non-zero value indicates an error. `null` if the process did not terminate normally. */
@@ -420,7 +436,7 @@ export const contextDocumentSchema = z.object({
420
436
  /** Context document ID (`cdo_...`). */
421
437
  id: z.string().describe("Context document ID (`cdo_...`)."),
422
438
  /** Arbitrary key-value metadata attached to the document. Shape varies by source type. */
423
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to the document. Shape varies by source type."),
439
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to the document. Shape varies by source type."),
424
440
  /** ID of the context source this document belongs to (`cso_...`). */
425
441
  source: z.string().optional().describe("ID of the context source this document belongs to (`cso_...`)."),
426
442
  /** ID of the team that owns this document (`tem_...`). `null` if owned by a user or agent. */
@@ -449,7 +465,7 @@ export const contextDocumentContentSchema = z.object({
449
465
  /** The `limit` value echoed from the request. `null` when no limit was requested. */
450
466
  limit: z.number().int().optional().describe("The `limit` value echoed from the request. `null` when no limit was requested."),
451
467
  /** Arbitrary key-value metadata attached to the document, such as source URL or author. `null` if no metadata was recorded. */
452
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to the document, such as source URL or author. `null` if no metadata was recorded."),
468
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to the document, such as source URL or author. `null` if no metadata was recorded."),
453
469
  /** The `offset` value echoed from the request. `null` when no offset was requested. */
454
470
  offset: z.number().int().optional().describe("The `offset` value echoed from the request. `null` when no offset was requested."),
455
471
  /** Zero-based index of the first byte included in `content`. Populated only when `unit` is `"bytes"`; `null` otherwise. */
@@ -474,11 +490,11 @@ export const contextIngestionSchema = z.object({
474
490
  /** When the ingestion was submitted (ISO 8601). */
475
491
  created_at: z.string().optional().describe("When the ingestion was submitted (ISO 8601)."),
476
492
  /** Structured error details when the ingestion has `status: "failed"`. `null` for any other status. */
477
- error: z.record(z.unknown()).optional().describe("Structured error details when the ingestion has `status: \"failed\"`. `null` for any other status."),
493
+ error: z.record(z.custom((value) => value !== undefined)).optional().describe("Structured error details when the ingestion has `status: \"failed\"`. `null` for any other status."),
478
494
  /** Context ingestion ID (`cig_...`). */
479
495
  id: z.string().describe("Context ingestion ID (`cig_...`)."),
480
496
  /** Arbitrary key-value metadata associated with this ingestion run. Shape is caller-defined. */
481
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata associated with this ingestion run. Shape is caller-defined."),
497
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata associated with this ingestion run. Shape is caller-defined."),
482
498
  /** ID of the context source being ingested (`cso_...`). `null` if the source has been deleted. */
483
499
  source: z.string().optional().describe("ID of the context source being ingested (`cso_...`). `null` if the source has been deleted."),
484
500
  /** When the ingestion job began processing. `null` if the job is still pending. */
@@ -502,6 +518,71 @@ export const createdPrivateServiceEnrollmentSchema = z.object({
502
518
  id: z.string(),
503
519
  private_service: z.string(),
504
520
  }).describe("Creation-only private service enrollment response. The raw token is shown once and is omitted from every read schema.");
521
+ /** Runtime validator for {@link EffectiveAccessBillingPrincipal}. */
522
+ export const effectiveAccessBillingPrincipalSchema = z.object({
523
+ /** Whether the authenticated user may administer this principal's billing account. */
524
+ administrator: z.boolean().describe("Whether the authenticated user may administer this principal's billing account."),
525
+ principal_type: z.enum(["user", "org"]),
526
+ }).describe("Billing administration authority for one Viewer-derived principal kind.");
527
+ /** Runtime validator for {@link EffectiveAccessEntitlement}. */
528
+ export const effectiveAccessEntitlementSchema = z.object({
529
+ /** Whether any eligible source grants the key. */
530
+ granted: z.boolean().describe("Whether any eligible source grants the key."),
531
+ /** Stable entitlement catalog key. */
532
+ key: z.string().describe("Stable entitlement catalog key."),
533
+ /** Privacy-safe principal kinds that contribute to the effective value. */
534
+ provided_by: z.array(z.enum(["personal", "organization"])).describe("Privacy-safe principal kinds that contribute to the effective value."),
535
+ /** Merged entitlement value, or `null` when the key is not granted. */
536
+ value: z.boolean().nullable().optional().describe("Merged entitlement value, or `null` when the key is not granted."),
537
+ /** Catalog type used to interpret `value`. */
538
+ value_type: z.literal("boolean").describe("Catalog type used to interpret `value`."),
539
+ }).describe("A billing-derived effective entitlement for the authenticated user.");
540
+ /** Runtime validator for {@link EffectiveAccess}. */
541
+ export const effectiveAccessSchema = z.object({
542
+ /** Administration authority for the personal and current-organization principals. */
543
+ billing: z.array(effectiveAccessBillingPrincipalSchema).describe("Administration authority for the personal and current-organization principals."),
544
+ /** Requested catalog entitlements in request order. */
545
+ entitlements: z.array(effectiveAccessEntitlementSchema).describe("Requested catalog entitlements in request order."),
546
+ }).describe("Live effective access and billing authority for the authenticated user.");
547
+ /** Runtime validator for {@link CurrentUser}. */
548
+ export const currentUserSchema = z.object({
549
+ /** Short handle or alias of the user. */
550
+ alias: z.string().nullable().optional().describe("Short handle or alias of the user."),
551
+ /** ID of the token-scoped app (`dap_...`). */
552
+ app: z.string().nullable().optional().describe("ID of the token-scoped app (`dap_...`)."),
553
+ /** Display name of the token-scoped app. */
554
+ app_name: z.string().nullable().optional().describe("Display name of the token-scoped app."),
555
+ /** Present only when the request supplies one or more `entitlement[]` values. */
556
+ effective_access: effectiveAccessSchema.optional().describe("Present only when the request supplies one or more `entitlement[]` values."),
557
+ /** Email address of the user. */
558
+ email: z.string().nullable().optional().describe("Email address of the user."),
559
+ /** User ID (`usr_...`). */
560
+ id: z.string().describe("User ID (`usr_...`)."),
561
+ /** Whether the authenticated account is an internal system user. */
562
+ is_system_user: z.boolean().describe("Whether the authenticated account is an internal system user."),
563
+ /** Arbitrary user metadata. */
564
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary user metadata."),
565
+ /** Full display name of the user. */
566
+ name: z.string().nullable().optional().describe("Full display name of the user."),
567
+ /** The authenticated user's notification preferences. */
568
+ notification_settings: z.record(z.custom((value) => value !== undefined)).describe("The authenticated user's notification preferences."),
569
+ /** ID of the current organization (`org_...`). */
570
+ org: z.string().nullable().optional().describe("ID of the current organization (`org_...`)."),
571
+ /** Display name of the current organization. */
572
+ org_name: z.string().nullable().optional().describe("Display name of the current organization."),
573
+ /** The authenticated user's role in the current organization. */
574
+ org_role: z.string().nullable().optional().describe("The authenticated user's role in the current organization."),
575
+ /** Stable slug of the current organization. */
576
+ org_slug: z.string().nullable().optional().describe("Stable slug of the current organization."),
577
+ /** Resolved profile picture metadata. */
578
+ profile_picture: imageSourceSchema.nullable().optional().describe("Resolved profile picture metadata."),
579
+ /** ID of the current sandbox (`sbx_...`). */
580
+ sandbox: z.string().nullable().optional().describe("ID of the current sandbox (`sbx_...`)."),
581
+ /** Display name of the current sandbox. */
582
+ sandbox_name: z.string().nullable().optional().describe("Display name of the current sandbox."),
583
+ /** The user's IANA timezone. */
584
+ timezone: z.string().nullable().optional().describe("The user's IANA timezone."),
585
+ }).describe("The authenticated user's profile, live session context, and optional effective access.");
505
586
  /** Runtime validator for {@link CustomObject}. */
506
587
  export const customObjectSchema = z.object({
507
588
  /** Access control list governing read and write access to this custom object. Only returned to resource owners and privileged or organization-admin viewers; `null` for everyone else. */
@@ -509,7 +590,7 @@ export const customObjectSchema = z.object({
509
590
  /** When the custom object was created (ISO 8601). */
510
591
  created_at: z.string().optional().describe("When the custom object was created (ISO 8601)."),
511
592
  /** Map of field names to their current values as defined by the object's schema type. */
512
- fields: z.record(z.unknown()).optional().describe("Map of field names to their current values as defined by the object's schema type."),
593
+ fields: z.record(z.custom((value) => value !== undefined)).optional().describe("Map of field names to their current values as defined by the object's schema type."),
513
594
  /** Unique identifier for the custom object (`cobj_...`). */
514
595
  id: z.string().describe("Unique identifier for the custom object (`cobj_...`)."),
515
596
  /** ID of the organization this object belongs to (`org_...`). */
@@ -534,11 +615,11 @@ export const customObjectJoinResponseSchema = z.object({
534
615
  /** Collision-free identifier for this browser connection. */
535
616
  connection_id: z.string().describe("Collision-free identifier for this browser connection."),
536
617
  /** Current materialized fields, or `null` while waiting for object creation. */
537
- fields: z.record(z.unknown()).nullable().describe("Current materialized fields, or `null` while waiting for object creation."),
618
+ fields: z.record(z.custom((value) => value !== undefined)).nullable().describe("Current materialized fields, or `null` while waiting for object creation."),
538
619
  /** Custom-object ID, or `null` while a row-key subscription waits for creation. */
539
620
  id: z.string().nullable().describe("Custom-object ID, or `null` while a row-key subscription waits for creation."),
540
621
  /** Current ephemeral collaborator presence. */
541
- presence: z.array(z.record(z.unknown())).describe("Current ephemeral collaborator presence."),
622
+ presence: z.array(z.record(z.custom((value) => value !== undefined))).describe("Current ephemeral collaborator presence."),
542
623
  /** Whether the current connection may only read the object. */
543
624
  readonly: z.boolean().describe("Whether the current connection may only read the object."),
544
625
  }).describe("Initial authoritative snapshot returned by a custom-object channel join.");
@@ -572,7 +653,7 @@ export const customObjectSaveResponseSchema = z.object({
572
653
  /** Runtime validator for {@link CustomObjectUpdateFieldsResponse}. */
573
654
  export const customObjectUpdateFieldsResponseSchema = z.object({
574
655
  /** The materialized object fields after the update. */
575
- fields: z.record(z.unknown()).describe("The materialized object fields after the update."),
656
+ fields: z.record(z.custom((value) => value !== undefined)).describe("The materialized object fields after the update."),
576
657
  /** ID of the custom object that was updated (`cobj_...`). */
577
658
  id: z.string().describe("ID of the custom object that was updated (`cobj_...`)."),
578
659
  /** Idempotency key acknowledged for this update. */
@@ -594,82 +675,11 @@ export const domainEventSchema = z.object({
594
675
  idempotency_key: z.string().optional(),
595
676
  org: z.string().optional(),
596
677
  /** Opaque event-specific JSON. Use event_name to select the expected payload schema. */
597
- payload: z.record(z.unknown()).describe("Opaque event-specific JSON. Use event_name to select the expected payload schema."),
678
+ payload: z.record(z.custom((value) => value !== undefined)).describe("Opaque event-specific JSON. Use event_name to select the expected payload schema."),
598
679
  sandbox: z.string().optional(),
599
680
  team: z.string().optional(),
600
681
  user: z.string().optional(),
601
682
  }).describe("A domain event with stable attribution fields and an event-specific payload.");
602
- /** Runtime validator for {@link EventSubscription}. */
603
- export const eventSubscriptionSchema = z.object({
604
- agent: z.string().optional(),
605
- available_count: z.number().int(),
606
- created_at: z.string(),
607
- dropped_events_total: z.number().int(),
608
- dropped_through_position: z.number().int(),
609
- event_names: z.array(z.string()),
610
- id: z.string(),
611
- last_overflow_at: z.string().optional(),
612
- leased_count: z.number().int(),
613
- max_pending_events: z.number().int(),
614
- name: z.string(),
615
- org: z.string().optional(),
616
- queue_epoch: z.number().int(),
617
- retention_seconds: z.number().int(),
618
- sandbox: z.string().optional(),
619
- status: z.enum(["active", "paused"]),
620
- team: z.string().optional(),
621
- updated_at: z.string(),
622
- user: z.string().optional(),
623
- visibility_timeout_seconds: z.number().int(),
624
- }).describe("An app-scoped subscription to exact domain-event names.");
625
- /** Runtime validator for {@link EventSubscriptionDelivery}. */
626
- export const eventSubscriptionDeliverySchema = z.object({
627
- delivery_id: z.string(),
628
- event: domainEventSchema,
629
- lease_expires_at: z.string(),
630
- receipt_handle: z.string(),
631
- receive_count: z.number().int(),
632
- sequence: z.number().int(),
633
- }).describe("A domain event leased from a subscription queue.");
634
- /** Runtime validator for {@link EventSubscriptionClaim}. */
635
- export const eventSubscriptionClaimSchema = z.object({
636
- data: z.array(eventSubscriptionDeliverySchema),
637
- dropped_events_total: z.number().int(),
638
- dropped_through_position: z.number().int(),
639
- has_more: z.boolean(),
640
- queue_epoch: z.number().int(),
641
- }).describe("Result of atomically claiming the head delivery.");
642
- /** Runtime validator for {@link EventSubscriptionQueueEntry}. */
643
- export const eventSubscriptionQueueEntrySchema = z.object({
644
- delivery_id: z.string(),
645
- event: domainEventSchema,
646
- lease_expires_at: z.string().optional(),
647
- receive_count: z.number().int(),
648
- sequence: z.number().int(),
649
- state: z.enum(["available", "leased"]),
650
- }).describe("A non-reserving view of one queued delivery.");
651
- /** Runtime validator for {@link EventSubscriptionHead}. */
652
- export const eventSubscriptionHeadSchema = z.object({
653
- data: eventSubscriptionQueueEntrySchema.optional(),
654
- }).describe("A non-reserving view of the queue head.");
655
- /** Runtime validator for {@link EventSubscriptionPage}. */
656
- export const eventSubscriptionPageSchema = z.object({
657
- data: z.array(eventSubscriptionSchema),
658
- page: z.number().int(),
659
- per_page: z.number().int(),
660
- total_count: z.number().int(),
661
- total_pages: z.number().int(),
662
- }).describe("A page of domain-event subscriptions.");
663
- /** Runtime validator for {@link EventSubscriptionQueue}. */
664
- export const eventSubscriptionQueueSchema = z.object({
665
- after_cursor: z.string().optional(),
666
- before_cursor: z.string().optional(),
667
- data: z.array(eventSubscriptionQueueEntrySchema),
668
- dropped_events_total: z.number().int(),
669
- dropped_through_position: z.number().int(),
670
- has_more: z.boolean(),
671
- queue_epoch: z.number().int(),
672
- }).describe("A cursor-paginated non-reserving view of a subscription queue.");
673
683
  /** Runtime validator for {@link StorageFile}. */
674
684
  export const storageFileSchema = z.object({
675
685
  /** ID of the app this file belongs to (`app_...`). */
@@ -724,7 +734,7 @@ export const agentHealthActionSchema = z.object({
724
734
  /** ID of the organization this action is associated with (`org_...`). `null` when not org-scoped. */
725
735
  org: z.string().optional().describe("ID of the organization this action is associated with (`org_...`). `null` when not org-scoped."),
726
736
  /** Kind-specific structured data used to construct the deep-link for this action. For `"env_var"` actions includes `key` and `scope`; for `"install"` actions includes `installation_kind`; for `"integration"` actions includes `mcp_server_ref`, and when resolvable also includes `provider`, `integration_id` for OAuth handoff, and `connection_status` (`"connected"`, `"disconnected"`, or `"token_expired"`). Empty object `{}` when no additional parameters are needed. */
727
- params: z.record(z.unknown()).optional().describe("Kind-specific structured data used to construct the deep-link for this action. For `\"env_var\"` actions includes `key` and `scope`; for `\"install\"` actions includes `installation_kind`; for `\"integration\"` actions includes `mcp_server_ref`, and when resolvable also includes `provider`, `integration_id` for OAuth handoff, and `connection_status` (`\"connected\"`, `\"disconnected\"`, or `\"token_expired\"`). Empty object `{}` when no additional parameters are needed."),
737
+ params: z.record(z.custom((value) => value !== undefined)).optional().describe("Kind-specific structured data used to construct the deep-link for this action. For `\"env_var\"` actions includes `key` and `scope`; for `\"install\"` actions includes `installation_kind`; for `\"integration\"` actions includes `mcp_server_ref`, and when resolvable also includes `provider`, `integration_id` for OAuth handoff, and `connection_status` (`\"connected\"`, `\"disconnected\"`, or `\"token_expired\"`). Empty object `{}` when no additional parameters are needed."),
728
738
  /** `true` if this action must be completed before the agent is considered fully operational and counts toward the blocking checklist progress bar. */
729
739
  required: z.boolean().describe("`true` if this action must be completed before the agent is considered fully operational and counts toward the blocking checklist progress bar."),
730
740
  /** Display order within the same `source` group. Lower values appear first. */
@@ -738,7 +748,7 @@ export const agentHealthActionSchema = z.object({
738
748
  /** When this health action was last modified (ISO 8601). */
739
749
  updated_at: z.string().optional().describe("When this health action was last modified (ISO 8601)."),
740
750
  /** Configuration for the action's verifier step. Contains at minimum a `type` field that indicates which verification affordance to render. Server-internal fields are stripped before this is returned. */
741
- verify_config: z.record(z.unknown()).optional().describe("Configuration for the action's verifier step. Contains at minimum a `type` field that indicates which verification affordance to render. Server-internal fields are stripped before this is returned."),
751
+ verify_config: z.record(z.custom((value) => value !== undefined)).optional().describe("Configuration for the action's verifier step. Contains at minimum a `type` field that indicates which verification affordance to render. Server-internal fields are stripped before this is returned."),
742
752
  }).describe("A single actionable item in an agent's health or setup checklist, carrying the structured data needed to render the item and deep-link to the resolution flow.");
743
753
  /** Runtime validator for {@link HealthActionListResponse}. */
744
754
  export const healthActionListResponseSchema = z.object({
@@ -750,7 +760,7 @@ export const installationSchema = z.object({
750
760
  /** ID of the agent that owns this installation (`agi_...`). `null` if the installation has no agent owner. */
751
761
  agent: z.string().optional().describe("ID of the agent that owns this installation (`agi_...`). `null` if the installation has no agent owner."),
752
762
  /** Kind-specific configuration object for this installation. Shape depends on the `kind` value. `null` if the kind requires no configuration. */
753
- config: z.record(z.unknown()).optional().describe("Kind-specific configuration object for this installation. Shape depends on the `kind` value. `null` if the kind requires no configuration."),
763
+ config: z.record(z.custom((value) => value !== undefined)).optional().describe("Kind-specific configuration object for this installation. Shape depends on the `kind` value. `null` if the kind requires no configuration."),
754
764
  /** When the installation was created (ISO 8601). */
755
765
  created_at: z.string().optional().describe("When the installation was created (ISO 8601)."),
756
766
  /** Installation ID (`cin_...`). */
@@ -764,7 +774,7 @@ export const installationSchema = z.object({
764
774
  /** Current lifecycle state of the installation. One of `"pending"`, `"active"`, `"paused"`, or `"error"`. `"error"` indicates the installation was suspended due to a policy or compliance issue and requires attention. */
765
775
  state: z.string().optional().describe("Current lifecycle state of the installation. One of `\"pending\"`, `\"active\"`, `\"paused\"`, or `\"error\"`. `\"error\"` indicates the installation was suspended due to a policy or compliance issue and requires attention."),
766
776
  /** Provider-supplied status detail for this installation, set during activation or event processing. `null` if no status has been reported. */
767
- status_payload: z.record(z.unknown()).optional().describe("Provider-supplied status detail for this installation, set during activation or event processing. `null` if no status has been reported."),
777
+ status_payload: z.record(z.custom((value) => value !== undefined)).optional().describe("Provider-supplied status detail for this installation, set during activation or event processing. `null` if no status has been reported."),
768
778
  /** When the installation record was last updated (ISO 8601). */
769
779
  updated_at: z.string().optional().describe("When the installation record was last updated (ISO 8601)."),
770
780
  }).describe("An installation representing a connection between an agent and an external service or enablement channel. Tracks configuration, lifecycle state, and any bound integration.");
@@ -775,7 +785,7 @@ export const installationKindSchema = z.object({
775
785
  /** Grouping category for UI display purposes, e.g. `"enablement"` or `"integration"`. `null` if uncategorized. */
776
786
  category: z.string().optional().describe("Grouping category for UI display purposes, e.g. `\"enablement\"` or `\"integration\"`. `null` if uncategorized."),
777
787
  /** JSON Schema object describing the shape of the `config` parameter accepted when creating or updating an installation of this kind. `null` if the kind accepts no configuration. */
778
- config_schema: z.record(z.unknown()).optional().describe("JSON Schema object describing the shape of the `config` parameter accepted when creating or updating an installation of this kind. `null` if the kind accepts no configuration."),
788
+ config_schema: z.record(z.custom((value) => value !== undefined)).optional().describe("JSON Schema object describing the shape of the `config` parameter accepted when creating or updating an installation of this kind. `null` if the kind accepts no configuration."),
779
789
  /** Short prose description of what this kind connects to and how it is used. `null` if no description is defined. */
780
790
  description: z.string().optional().describe("Short prose description of what this kind connects to and how it is used. `null` if no description is defined."),
781
791
  /** Unique slug identifying this installation kind, e.g. `"enablement/github_app"`, `"integration/gmail"`, or `"web/site"`. Pass this value as `kind` when creating an installation. */
@@ -808,11 +818,11 @@ export const installationSourceSchema = z.object({
808
818
  /** Source ID (`cso_...`). */
809
819
  id: z.string().describe("Source ID (`cso_...`)."),
810
820
  /** Arbitrary key-value metadata associated with this source. Shape is caller-defined. `null` if no metadata was set. */
811
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata associated with this source. Shape is caller-defined. `null` if no metadata was set."),
821
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata associated with this source. Shape is caller-defined. `null` if no metadata was set."),
812
822
  /** ID of the parent source (`cso_...`) when this source was derived from another source. `null` for top-level sources. */
813
823
  parent_source: z.string().optional().describe("ID of the parent source (`cso_...`) when this source was derived from another source. `null` for top-level sources."),
814
824
  /** Type-specific payload provided when the source was created. The shape depends on the `type` value. `null` if no payload was supplied. */
815
- payload: z.record(z.unknown()).optional().describe("Type-specific payload provided when the source was created. The shape depends on the `type` value. `null` if no payload was supplied."),
825
+ payload: z.record(z.custom((value) => value !== undefined)).optional().describe("Type-specific payload provided when the source was created. The shape depends on the `type` value. `null` if no payload was supplied."),
816
826
  /** Current lifecycle state of this source. One of `"active"` (ingestion running normally) or `"paused"` (ingestion suspended). Note that per-run ingestion progress is tracked separately and is not exposed on this field. */
817
827
  state: z.string().optional().describe("Current lifecycle state of this source. One of `\"active\"` (ingestion running normally) or `\"paused\"` (ingestion suspended). Note that per-run ingestion progress is tracked separately and is not exposed on this field."),
818
828
  /** ID of the team associated with this source (`tem_...`). `null` if the source has no team association. */
@@ -889,13 +899,13 @@ export const knowledgeSourceSchema = z.object({
889
899
  /** Knowledge source ID (`cso_...`). */
890
900
  id: z.string().describe("Knowledge source ID (`cso_...`)."),
891
901
  /** Arbitrary key-value metadata attached to this source. Useful for storing caller-defined labels or references. */
892
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this source. Useful for storing caller-defined labels or references."),
902
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to this source. Useful for storing caller-defined labels or references."),
893
903
  /** ID of the organization this source belongs to (`org_...`). `null` if not scoped to an org. */
894
904
  org: z.string().optional().describe("ID of the organization this source belongs to (`org_...`). `null` if not scoped to an org."),
895
905
  /** ID of the parent knowledge source (`cso_...`) when this source was derived from another. `null` for top-level sources. */
896
906
  parent_source: z.string().optional().describe("ID of the parent knowledge source (`cso_...`) when this source was derived from another. `null` for top-level sources."),
897
907
  /** Type-specific configuration object. The keys depend on the source `type`; see the create endpoint for the expected shape per type. */
898
- payload: z.record(z.unknown()).optional().describe("Type-specific configuration object. The keys depend on the source `type`; see the create endpoint for the expected shape per type."),
908
+ payload: z.record(z.custom((value) => value !== undefined)).optional().describe("Type-specific configuration object. The keys depend on the source `type`; see the create endpoint for the expected shape per type."),
899
909
  /** ID of the developer sandbox this source is scoped to (`sbx_...`). `null` outside sandbox contexts. */
900
910
  sandbox: z.string().optional().describe("ID of the developer sandbox this source is scoped to (`sbx_...`). `null` outside sandbox contexts."),
901
911
  /** Current lifecycle state of the source. One of `"active"` (ingestion running normally) or `"paused"` (ingestion suspended). */
@@ -925,6 +935,44 @@ export const knowledgeSourceKindListResponseSchema = z.object({
925
935
  /** Array of knowledge source kind objects describing each creatable source type. */
926
936
  data: z.array(knowledgeSourceKindSchema).describe("Array of knowledge source kind objects describing each creatable source type."),
927
937
  }).describe("List response containing the knowledge source kinds available for creation via the API.");
938
+ /** Runtime validator for {@link NodeField}. */
939
+ export const nodeFieldSchema = z.object({
940
+ /** Whether the field accepts expressions */
941
+ allowExpression: z.boolean().optional().describe("Whether the field accepts expressions"),
942
+ /** Default JSON-safe value for the field */
943
+ defaultValue: z.custom((value) => value !== undefined).optional().describe("Default JSON-safe value for the field"),
944
+ /** Field description */
945
+ description: z.string().optional().describe("Field description"),
946
+ /** Field identifier */
947
+ key: z.string().describe("Field identifier"),
948
+ /** Display label */
949
+ label: z.string().describe("Display label"),
950
+ /** Available options for select fields */
951
+ options: z.array(z.record(z.custom((value) => value !== undefined))).optional().describe("Available options for select fields"),
952
+ /** Whether the field is required */
953
+ required: z.boolean().optional().describe("Whether the field is required"),
954
+ /** Field type (string, number, boolean, expression, etc.) */
955
+ type: z.string().describe("Field type (string, number, boolean, expression, etc.)"),
956
+ }).describe("Schema for a field definition within a node type");
957
+ /** Runtime validator for {@link NodeType}. */
958
+ export const nodeTypeSchema = z.object({
959
+ /** Short badge text for UI */
960
+ badge: z.string().optional().describe("Short badge text for UI"),
961
+ /** Category for grouping (e.g., Logic, Network, Utility) */
962
+ category: z.string().optional().describe("Category for grouping (e.g., Logic, Network, Utility)"),
963
+ /** Hex color for UI display */
964
+ color: z.string().optional().describe("Hex color for UI display"),
965
+ /** Node description */
966
+ description: z.string().describe("Node description"),
967
+ /** Extended documentation */
968
+ docs: z.string().optional().describe("Extended documentation"),
969
+ /** Field definitions for this node type */
970
+ fields: z.array(nodeFieldSchema).describe("Field definitions for this node type"),
971
+ /** Unique node type identifier */
972
+ id: z.string().describe("Unique node type identifier"),
973
+ /** Display label */
974
+ label: z.string().describe("Display label"),
975
+ }).describe("Schema for a workflow node type definition");
928
976
  /** Runtime validator for {@link PaginatedReplies}. */
929
977
  export const paginatedRepliesSchema = z.object({
930
978
  /** Opaque cursor to pass as the pagination cursor to retrieve the page of replies that follow this one. `null` when no further pages exist. */
@@ -943,11 +991,11 @@ export const privateServiceFunctionSchema = z.object({
943
991
  /** Human-readable guidance describing when and why to call the operation. */
944
992
  description: z.string().describe("Human-readable guidance describing when and why to call the operation."),
945
993
  /** JSON Schema Draft 7 object describing the operation's argument object. */
946
- input_schema: z.record(z.unknown()).describe("JSON Schema Draft 7 object describing the operation's argument object."),
994
+ input_schema: z.record(z.custom((value) => value !== undefined)).describe("JSON Schema Draft 7 object describing the operation's argument object."),
947
995
  /** Stable operation name used when invoking the private service. */
948
996
  name: z.string().describe("Stable operation name used when invoking the private service."),
949
997
  /** Optional JSON Schema Draft 7 object describing the successful result. */
950
- output_schema: z.record(z.unknown()).optional().describe("Optional JSON Schema Draft 7 object describing the successful result."),
998
+ output_schema: z.record(z.custom((value) => value !== undefined)).optional().describe("Optional JSON Schema Draft 7 object describing the successful result."),
951
999
  }).describe("A documented callable operation exposed by a private service.");
952
1000
  /** Runtime validator for {@link PrivateService}. */
953
1001
  export const privateServiceSchema = z.object({
@@ -1020,42 +1068,6 @@ export const routinePresetSchema = z.object({
1020
1068
  /** Whether at most one routine with this preset may exist per agent. Attempting to create a second routine with a unique preset on the same agent will be rejected. */
1021
1069
  unique: z.boolean().describe("Whether at most one routine with this preset may exist per agent. Attempting to create a second routine with a unique preset on the same agent will be rejected."),
1022
1070
  }).describe("A named preset that defines the execution model and constraints for a routine. Presets are shared definitions; individual routines reference a preset by name.");
1023
- /** Runtime validator for {@link WorkflowJournalEntry}. */
1024
- export const workflowJournalEntrySchema = z.object({
1025
- /** Durable command identifier associated with the record, when present. */
1026
- command_id: z.string().optional().describe("Durable command identifier associated with the record, when present."),
1027
- /** When this entry was durably committed. */
1028
- created_at: z.string().optional().describe("When this entry was durably committed."),
1029
- /** Journal entry ID (`wdr_...`). */
1030
- id: z.string().describe("Journal entry ID (`wdr_...`)."),
1031
- /** Workflow node associated with the record. `null` for execution-level records. */
1032
- node_id: z.string().optional().describe("Workflow node associated with the record. `null` for execution-level records."),
1033
- /** Replayable workflow record body, including payload, context, environment, metadata, and timestamp. */
1034
- record: z.record(z.unknown()).describe("Replayable workflow record body, including payload, context, environment, metadata, and timestamp."),
1035
- /** Monotonically increasing sequence within the journal. */
1036
- sequence: z.number().int().describe("Monotonically increasing sequence within the journal."),
1037
- /** Durable timer identifier associated with the record, when present. */
1038
- timer_id: z.string().optional().describe("Durable timer identifier associated with the record, when present."),
1039
- /** Workflow record type, such as `node_started`, `node_completed`, or `node_failed`. */
1040
- type: z.string().describe("Workflow record type, such as `node_started`, `node_completed`, or `node_failed`."),
1041
- }).describe("One ordered, replayable record from a durable workflow journal.");
1042
- /** Runtime validator for {@link WorkflowJournal}. */
1043
- export const workflowJournalSchema = z.object({
1044
- /** When durable workflow execution reached a terminal state. `null` while it is active. */
1045
- completed_at: z.string().optional().describe("When durable workflow execution reached a terminal state. `null` while it is active."),
1046
- /** When the journal was created. */
1047
- created_at: z.string().optional().describe("When the journal was created."),
1048
- /** Highest workflow record sequence durably committed to this journal. */
1049
- current_sequence: z.number().int().describe("Highest workflow record sequence durably committed to this journal."),
1050
- /** Journal execution ID (`wde_...`). */
1051
- id: z.string().describe("Journal execution ID (`wde_...`)."),
1052
- /** When durable workflow execution started. */
1053
- started_at: z.string().optional().describe("When durable workflow execution started."),
1054
- /** Current durable execution status: `pending`, `running`, `waiting`, `completed`, `failed`, or `cancelled`. */
1055
- status: z.string().describe("Current durable execution status: `pending`, `running`, `waiting`, `completed`, `failed`, or `cancelled`."),
1056
- /** When the journal was last updated. */
1057
- updated_at: z.string().optional().describe("When the journal was last updated."),
1058
- }).describe("Summary of the durable workflow execution journal associated with a run.");
1059
1071
  /** Runtime validator for {@link RunJournalPage}. */
1060
1072
  export const runJournalPageSchema = z.object({
1061
1073
  /** Opaque cursor for the next entry page. `null` when this is the final page. */
@@ -1069,6 +1081,20 @@ export const runJournalPageSchema = z.object({
1069
1081
  /** Durable execution summary. `null` when this run has no journal, which is valid for script-backed, preview, or legacy runs. */
1070
1082
  journal: workflowJournalSchema.optional().describe("Durable execution summary. `null` when this run has no journal, which is valid for script-backed, preview, or legacy runs."),
1071
1083
  }).describe("A forward-paginated journal entry page for an automation or routine run.");
1084
+ /** Runtime validator for {@link RuntimeEnvVar}. */
1085
+ export const runtimeEnvVarSchema = z.object({
1086
+ /** Human-readable explanation of the variable's purpose. `null` if no description has been set. */
1087
+ description: z.string().optional().describe("Human-readable explanation of the variable's purpose. `null` if no description has been set."),
1088
+ /** The name of the environment variable as it appears in the script runtime (e.g. `DATABASE_URL`). */
1089
+ key: z.string().describe("The name of the environment variable as it appears in the script runtime (e.g. `DATABASE_URL`)."),
1090
+ /** Origin of the environment variable. One of `"app"` (set on the application) or `"org"` (inherited from the organization). */
1091
+ source: z.string().describe("Origin of the environment variable. One of `\"app\"` (set on the application) or `\"org\"` (inherited from the organization)."),
1092
+ }).describe("A single runtime environment variable available within a script execution context, including its key, description, and origin.");
1093
+ /** Runtime validator for {@link RuntimeEnvVarList}. */
1094
+ export const runtimeEnvVarListSchema = z.object({
1095
+ /** Array of runtime environment variable objects available in the current script execution context. */
1096
+ data: z.array(runtimeEnvVarSchema).describe("Array of runtime environment variable objects available in the current script execution context."),
1097
+ }).describe("The collection of runtime environment variables available to the current script execution context.");
1072
1098
  /** Runtime validator for {@link SandboxKey}. */
1073
1099
  export const sandboxKeySchema = z.object({
1074
1100
  /** When this key was created (ISO 8601). */
@@ -1216,7 +1242,7 @@ export const trajectorySchema = z.object({
1216
1242
  /** Trajectory ID (`trj_...`). */
1217
1243
  id: z.string().describe("Trajectory ID (`trj_...`)."),
1218
1244
  /** Serialized message log for this trajectory. Contains the ordered sequence of AI and tool messages produced during the session. */
1219
- messages: z.array(z.record(z.unknown())).optional().describe("Serialized message log for this trajectory. Contains the ordered sequence of AI and tool messages produced during the session."),
1245
+ messages: z.array(z.record(z.custom((value) => value !== undefined))).optional().describe("Serialized message log for this trajectory. Contains the ordered sequence of AI and tool messages produced during the session."),
1220
1246
  /** ID of the organization this trajectory belongs to (`org_...`). `null` for trajectories outside an org context. */
1221
1247
  org: z.string().nullable().optional().describe("ID of the organization this trajectory belongs to (`org_...`). `null` for trajectories outside an org context."),
1222
1248
  /** ID of the developer sandbox this trajectory is scoped to (`sbx_...`). `null` for production trajectories. */
@@ -1235,56 +1261,6 @@ export const validationResultSchema = z.object({
1235
1261
  /** List of human-readable warning messages emitted during validation. Warnings do not cause `valid` to be `false` but indicate potentially problematic configuration. */
1236
1262
  warnings: z.array(z.string()).optional().describe("List of human-readable warning messages emitted during validation. Warnings do not cause `valid` to be `false` but indicate potentially problematic configuration."),
1237
1263
  }).describe("The result of a configuration validation check, indicating whether the config is valid and listing any errors or warnings.");
1238
- /** Runtime validator for {@link WorkflowWorkItem}. */
1239
- export const workflowWorkItemSchema = z.object({
1240
- /** Agent assigned to execute this work. */
1241
- agent: z.string().describe("Agent assigned to execute this work."),
1242
- /** Number of times this work has been freshly claimed or reclaimed. */
1243
- attempt_count: z.number().int().describe("Number of times this work has been freshly claimed or reclaimed."),
1244
- /** Opaque journal command identity used to resume the workflow exactly once. */
1245
- command_id: z.string().describe("Opaque journal command identity used to resume the workflow exactly once."),
1246
- created_at: z.string(),
1247
- /** Durable workflow execution that owns this work. */
1248
- execution: z.string().describe("Durable workflow execution that owns this work."),
1249
- /** Work item ID (`wdi_...`). */
1250
- id: z.string().describe("Work item ID (`wdi_...`)."),
1251
- /** When the current claim expires. Null for queued or terminal work. */
1252
- lease_expires_at: z.string().optional().describe("When the current claim expires. Null for queued or terminal work."),
1253
- /** Workflow graph node that yielded the work. */
1254
- node_id: z.string().describe("Workflow graph node that yielded the work."),
1255
- /** Instructions and participant bindings needed to execute the work. */
1256
- payload: z.record(z.unknown()).describe("Instructions and participant bindings needed to execute the work."),
1257
- /** Routine run that owns the execution, when this work came from a routine. */
1258
- routine_run: z.string().optional().describe("Routine run that owns the execution, when this work came from a routine."),
1259
- /** Current queue lifecycle status. */
1260
- status: z.string().describe("Current queue lifecycle status."),
1261
- /** Stable resource discriminator. Always `workflow_work_item`. */
1262
- type: z.string().describe("Stable resource discriminator. Always `workflow_work_item`."),
1263
- updated_at: z.string(),
1264
- }).describe("Externally executable work yielded by a durable workflow.");
1265
- /** Runtime validator for {@link WorkflowWorkItemLease}. */
1266
- export const workflowWorkItemLeaseSchema = z.object({
1267
- /** Opaque lease token that must be persisted and presented for later transitions. */
1268
- lease_owner: z.string().describe("Opaque lease token that must be persisted and presented for later transitions."),
1269
- /** The claimed, resumed, started, or heartbeated work item. */
1270
- work_item: workflowWorkItemSchema.describe("The claimed, resumed, started, or heartbeated work item."),
1271
- }).describe("A claimed workflow work item and its caller-held lease token.");
1272
- /** Runtime validator for {@link WorkflowWorkItemClaim}. */
1273
- export const workflowWorkItemClaimSchema = z.object({
1274
- /** Claimed or resumed work and its lease; null when no eligible item exists. */
1275
- data: workflowWorkItemLeaseSchema.optional().describe("Claimed or resumed work and its lease; null when no eligible item exists."),
1276
- }).describe("Result of polling an agent's durable workflow work queue.");
1277
- /** Runtime validator for {@link WorkflowWorkItemList}. */
1278
- export const workflowWorkItemListSchema = z.object({
1279
- /** Opaque cursor for the next page, or null at the end. */
1280
- after_cursor: z.string().optional().describe("Opaque cursor for the next page, or null at the end."),
1281
- /** Always null because queue pagination is forward-only. */
1282
- before_cursor: z.string().optional().describe("Always null because queue pagination is forward-only."),
1283
- /** Active work items. Lease tokens are intentionally never included in list responses. */
1284
- data: z.array(workflowWorkItemSchema).describe("Active work items. Lease tokens are intentionally never included in list responses."),
1285
- /** Whether another page of work exists. */
1286
- has_more: z.boolean().describe("Whether another page of work exists."),
1287
- }).describe("Active durable workflow work available to the viewer.");
1288
1264
  /** Runtime validator for {@link WorkingMemoryEntry}. */
1289
1265
  export const workingMemoryEntrySchema = z.object({
1290
1266
  /** ID of the agent that owns this memory entry (`agt_...`). */
@@ -1322,7 +1298,7 @@ export const workingMemoryEntryListResponseSchema = z.object({
1322
1298
  /** Runtime validator for {@link SolutionAutomationInvokeContract}. */
1323
1299
  export const solutionAutomationInvokeContractSchema = z.object({
1324
1300
  /** JSON Schema validated against the whole invoke payload, from the automation's `input_schema_config`. `null` when none is configured. */
1325
- input_schema: z.record(z.unknown()).nullable().optional().describe("JSON Schema validated against the whole invoke payload, from the automation's `input_schema_config`. `null` when none is configured."),
1301
+ input_schema: z.record(z.custom((value) => value !== undefined)).nullable().optional().describe("JSON Schema validated against the whole invoke payload, from the automation's `input_schema_config`. `null` when none is configured."),
1326
1302
  /** Named participant slots declared by the workflow, sorted by name. `null` when the workflow declares none. Values supplied under the top-level `participants` field are agent IDs. */
1327
1303
  participants: z.array(automationParticipantSlotSchema).nullable().optional().describe("Named participant slots declared by the workflow, sorted by name. `null` when the workflow declares none. Values supplied under the top-level `participants` field are agent IDs."),
1328
1304
  /** Owner-controlled payload and participant values the platform applies to every invocation. Supplying a conflicting value is rejected. */
@@ -1369,7 +1345,7 @@ export const solutionSummarySchema = z.object({
1369
1345
  /** Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. `null` when the Solution body does not set one. */
1370
1346
  description: z.string().nullable().optional().describe("Short tagline or summary declared in the Solution body, used as the card subhead in catalog UIs. `null` when the Solution body does not set one."),
1371
1347
  /** Custom analytics events declared in the Solution body's `events:` manifest — a map of event key (snake_case) to its definition (`label`, optional `description`, optional typed `fields`). Dashboards use the `label` as the event's display name. Present as an empty object when the body declares none. */
1372
- events: z.record(z.unknown()).optional().describe("Custom analytics events declared in the Solution body's `events:` manifest — a map of event key (snake_case) to its definition (`label`, optional `description`, optional typed `fields`). Dashboards use the `label` as the event's display name. Present as an empty object when the body declares none."),
1348
+ events: z.record(z.custom((value) => value !== undefined)).optional().describe("Custom analytics events declared in the Solution body's `events:` manifest — a map of event key (snake_case) to its definition (`label`, optional `description`, optional typed `fields`). Dashboards use the `label` as the event's display name. Present as an empty object when the body declares none."),
1373
1349
  /** Solution config ID (`cfg_...`). */
1374
1350
  id: z.string().describe("Solution config ID (`cfg_...`)."),
1375
1351
  /** Absolute URL of the Solution's cover image — the bundled asset the body's `image:` field names. A stable, non-expiring capability URL (like `org_logo.url`), safe to hold in caches and OpenGraph tags; it 404s if the Solution stops declaring a cover. `null` when the Solution has no cover image, and always `null` for org-scoped rows — the permanent URL is minted for system-scope (catalog) Solutions only. */
@@ -1383,7 +1359,7 @@ export const solutionSummarySchema = z.object({
1383
1359
  /** The lookup key stored on the Solution config, if one was assigned during import. `null` when no lookup key was set. */
1384
1360
  lookup_key: z.string().nullable().optional().describe("The lookup key stored on the Solution config, if one was assigned during import. `null` when no lookup key was set."),
1385
1361
  /** Arbitrary key-value metadata declared in the Solution body (e.g. category or display hints). Present as an empty object when the body declares none. */
1386
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata declared in the Solution body (e.g. category or display hints). Present as an empty object when the body declares none."),
1362
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata declared in the Solution body (e.g. category or display hints). Present as an empty object when the body declares none."),
1387
1363
  /** Human-facing display name declared in the Solution body. `null` when the Solution body does not set one. */
1388
1364
  name: z.string().nullable().optional().describe("Human-facing display name declared in the Solution body. `null` when the Solution body does not set one."),
1389
1365
  /** Organization ID (`org_...`) that owns this Solution config, when the Solution is scoped to a specific org. `null` for system-scope (app-level) Solutions. */
@@ -1449,7 +1425,7 @@ export const agentSchema = z.object({
1449
1425
  /** Stable, user-defined identifier for this agent within the application. Unique per app. */
1450
1426
  lookup_key: z.string().nullable().optional().describe("Stable, user-defined identifier for this agent within the application. Unique per app."),
1451
1427
  /** Arbitrary key-value metadata attached to the agent. Not interpreted by the platform. */
1452
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to the agent. Not interpreted by the platform."),
1428
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to the agent. Not interpreted by the platform."),
1453
1429
  /** Human-readable display name for the agent. `null` if not set. */
1454
1430
  name: z.string().optional().describe("Human-readable display name for the agent. `null` if not set."),
1455
1431
  /** ID of the organization this agent belongs to (`org_...`). `null` if the agent is not org-scoped. */
@@ -1480,7 +1456,7 @@ export const agentComputerSchema = z.object({
1480
1456
  /** ID of the app this computer belongs to (`dap_...`). */
1481
1457
  app: z.string().optional().describe("ID of the app this computer belongs to (`dap_...`)."),
1482
1458
  /** Provider-specific configuration key-value pairs for the computer. Structure depends on the underlying compute provider. */
1483
- config: z.record(z.unknown()).optional().describe("Provider-specific configuration key-value pairs for the computer. Structure depends on the underlying compute provider."),
1459
+ config: z.record(z.custom((value) => value !== undefined)).optional().describe("Provider-specific configuration key-value pairs for the computer. Structure depends on the underlying compute provider."),
1484
1460
  /** When the computer was created (ISO 8601). */
1485
1461
  created_at: z.string().optional().describe("When the computer was created (ISO 8601)."),
1486
1462
  /** Human-readable error description when `status` is `"error"`. `null` otherwise. */
@@ -1492,7 +1468,7 @@ export const agentComputerSchema = z.object({
1492
1468
  /** Unique, stable identifier you assign to this computer within its app. `null` if not set. */
1493
1469
  lookup_key: z.string().optional().describe("Unique, stable identifier you assign to this computer within its app. `null` if not set."),
1494
1470
  /** Arbitrary key-value metadata you attached to the computer. `null` if none was provided. */
1495
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata you attached to the computer. `null` if none was provided."),
1471
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata you attached to the computer. `null` if none was provided."),
1496
1472
  /** Human-readable display name for the computer. `null` if not set. */
1497
1473
  name: z.string().optional().describe("Human-readable display name for the computer. `null` if not set."),
1498
1474
  /** Compute backend powering this computer: `"sprites"` (Fly Sprites) or `"vercel"` (Vercel Sandbox). */
@@ -1532,7 +1508,7 @@ export const agentCreateResponseSchema = z.object({
1532
1508
  /** Unique, stable identifier for the agent within its app. `null` if not set. */
1533
1509
  lookup_key: z.string().nullable().optional().describe("Unique, stable identifier for the agent within its app. `null` if not set."),
1534
1510
  /** Arbitrary key-value metadata attached to the agent. `null` if none was provided. */
1535
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to the agent. `null` if none was provided."),
1511
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to the agent. `null` if none was provided."),
1536
1512
  /** Human-readable display name for the agent. `null` if not set. */
1537
1513
  name: z.string().optional().describe("Human-readable display name for the agent. `null` if not set."),
1538
1514
  /** ID of the organization this agent belongs to (`org_...`). `null` for agents outside an org. */
@@ -1577,24 +1553,24 @@ export const agentExportSchema = z.object({
1577
1553
  /** Ordered list of config file objects that the agent depends on. Included in full so the import can recreate all dependencies without additional requests. */
1578
1554
  configs: z.array(configSchema).describe("Ordered list of config file objects that the agent depends on. Included in full so the import can recreate all dependencies without additional requests."),
1579
1555
  /** The agent template definition as a structured map. Pass this directly to the import endpoint to recreate the agent. */
1580
- template: z.record(z.unknown()).describe("The agent template definition as a structured map. Pass this directly to the import endpoint to recreate the agent."),
1556
+ template: z.record(z.custom((value) => value !== undefined)).describe("The agent template definition as a structured map. Pass this directly to the import endpoint to recreate the agent."),
1581
1557
  }).describe("A portable export bundle for an agent, containing everything needed to re-deploy it in another workspace or environment.");
1582
1558
  /** Runtime validator for {@link AgentHealth}. */
1583
1559
  export const agentHealthSchema = z.object({
1584
1560
  /** Timestamps for the agent's most recent and next scheduled activity, used to surface last-run and upcoming-run information. */
1585
- activity: z.record(z.unknown()).describe("Timestamps for the agent's most recent and next scheduled activity, used to surface last-run and upcoming-run information."),
1561
+ activity: z.record(z.custom((value) => value !== undefined)).describe("Timestamps for the agent's most recent and next scheduled activity, used to surface last-run and upcoming-run information."),
1586
1562
  /** The agent this health profile describes. */
1587
1563
  agent: agentSchema.describe("The agent this health profile describes."),
1588
1564
  /** When the health profile was last computed (ISO 8601). */
1589
1565
  checked_at: z.string().describe("When the health profile was last computed (ISO 8601)."),
1590
1566
  /** Renderable health check results. Each object includes at minimum `key`, `label`, `status`, and `summary` fields. */
1591
- checks: z.array(z.record(z.unknown())).describe("Renderable health check results. Each object includes at minimum `key`, `label`, `status`, and `summary` fields."),
1567
+ checks: z.array(z.record(z.custom((value) => value !== undefined))).describe("Renderable health check results. Each object includes at minimum `key`, `label`, `status`, and `summary` fields."),
1592
1568
  /** Action counts broken down by dependency area and resolution status, used to render progress indicators per category. */
1593
- counts: z.record(z.unknown()).describe("Action counts broken down by dependency area and resolution status, used to render progress indicators per category."),
1569
+ counts: z.record(z.custom((value) => value !== undefined)).describe("Action counts broken down by dependency area and resolution status, used to render progress indicators per category."),
1594
1570
  /** All actionable items tracked for this agent, including both `"setup"` items (post-install checklist) and `"health"` items (probe-detected issues). Sorted by `(source, sort_order, id)`. Use each item's `params` field to construct deep-links that route the user to the correct resolution flow. */
1595
1571
  health_actions: z.array(agentHealthActionSchema).describe("All actionable items tracked for this agent, including both `\"setup\"` items (post-install checklist) and `\"health\"` items (probe-detected issues). Sorted by `(source, sort_order, id)`. Use each item's `params` field to construct deep-links that route the user to the correct resolution flow."),
1596
1572
  /** Recent execution metrics for the agent, including run counts and failure counts over a recent time window. */
1597
- recent: z.record(z.unknown()).describe("Recent execution metrics for the agent, including run counts and failure counts over a recent time window."),
1573
+ recent: z.record(z.custom((value) => value !== undefined)).describe("Recent execution metrics for the agent, including run counts and failure counts over a recent time window."),
1598
1574
  /** Normalized health score from `0` (fully degraded) to `100` (fully healthy), derived from the weight and status of all health actions. */
1599
1575
  score: z.number().int().describe("Normalized health score from `0` (fully degraded) to `100` (fully healthy), derived from the weight and status of all health actions."),
1600
1576
  /** Overall health status of the agent. One of `"ok"`, `"warning"`, or `"critical"`. */
@@ -1632,7 +1608,7 @@ export const agentRoutineSchema = z.object({
1632
1608
  /** Optional description of what this routine does. `null` when not set. */
1633
1609
  description: z.string().optional().describe("Optional description of what this routine does. `null` when not set."),
1634
1610
  /** Additional configuration controlling how the event trigger is matched or filtered. Shape depends on `event_type`. `null` when not configured. */
1635
- event_config: z.record(z.unknown()).optional().describe("Additional configuration controlling how the event trigger is matched or filtered. Shape depends on `event_type`. `null` when not configured."),
1611
+ event_config: z.record(z.custom((value) => value !== undefined)).optional().describe("Additional configuration controlling how the event trigger is matched or filtered. Shape depends on `event_type`. `null` when not configured."),
1636
1612
  /** Platform event type that triggers this routine, e.g. `"agentroutine.invoked"`. `null` for schedule-only routines. */
1637
1613
  event_type: z.string().optional().describe("Platform event type that triggers this routine, e.g. `\"agentroutine.invoked\"`. `null` for schedule-only routines."),
1638
1614
  /** Execution strategy for this routine. One of `"workflow_graph"`, `"script"`, `"preset"`, or `"chain"`. */
@@ -1646,7 +1622,7 @@ export const agentRoutineSchema = z.object({
1646
1622
  /** Visibility and explicit recipient selection for messages emitted by this routine. */
1647
1623
  message_policy: messagePolicySchema.optional().describe("Visibility and explicit recipient selection for messages emitted by this routine."),
1648
1624
  /** Arbitrary key-value metadata attached to this routine. `null` when not set. */
1649
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this routine. `null` when not set."),
1625
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to this routine. `null` when not set."),
1650
1626
  /** Human-readable name for the routine. */
1651
1627
  name: z.string().optional().describe("Human-readable name for the routine."),
1652
1628
  /** Resolved preset configuration when `handler_type` is `"preset"`. `null` for other handler types. */
@@ -1660,7 +1636,7 @@ export const agentRoutineSchema = z.object({
1660
1636
  /** Lifecycle status of the routine. One of `"draft"`, `"active"`, or `"paused"`. Only `"active"` routines respond to triggers. */
1661
1637
  status: z.string().optional().describe("Lifecycle status of the routine. One of `\"draft\"`, `\"active\"`, or `\"paused\"`. Only `\"active\"` routines respond to triggers."),
1662
1638
  /** Ordered list of chain steps (present when handler_type is "chain"). Each step is a plain map with handler_type, optional body fields (preset_name / preset_config / script / config), and step-local plumbing (name, inputs, output_key, on_error). */
1663
- steps: z.array(z.record(z.unknown())).optional().describe("Ordered list of chain steps (present when handler_type is \"chain\"). Each step is a plain map with handler_type, optional body fields (preset_name / preset_config / script / config), and step-local plumbing (name, inputs, output_key, on_error)."),
1639
+ steps: z.array(z.record(z.custom((value) => value !== undefined))).optional().describe("Ordered list of chain steps (present when handler_type is \"chain\"). Each step is a plain map with handler_type, optional body fields (preset_name / preset_config / script / config), and step-local plumbing (name, inputs, output_key, on_error)."),
1664
1640
  /** Execution context in which runs are created. One of `"event"` (background job) or `"chat_session"` (interactive session). Defaults to `"event"`. */
1665
1641
  trigger_context: z.string().optional().describe("Execution context in which runs are created. One of `\"event\"` (background job) or `\"chat_session\"` (interactive session). Defaults to `\"event\"`."),
1666
1642
  /** When this routine was last updated (ISO 8601). */
@@ -1709,19 +1685,19 @@ export const agentRoutineRunSchema = z.object({
1709
1685
  /** Routine run ID (`arr_...`). */
1710
1686
  id: z.string().describe("Routine run ID (`arr_...`)."),
1711
1687
  /** Arbitrary key-value metadata attached to this run. Empty object when no metadata was set. */
1712
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this run. Empty object when no metadata was set."),
1688
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to this run. Empty object when no metadata was set."),
1713
1689
  /** Invoke-time map of symbolic participant references to agent IDs. `null` when no participants were supplied. */
1714
- participants: z.record(z.unknown()).optional().describe("Invoke-time map of symbolic participant references to agent IDs. `null` when no participants were supplied."),
1690
+ participants: z.record(z.custom((value) => value !== undefined)).optional().describe("Invoke-time map of symbolic participant references to agent IDs. `null` when no participants were supplied."),
1715
1691
  /** Input payload delivered to the routine when this run was triggered. Empty object when no payload was provided. */
1716
- payload: z.record(z.unknown()).optional().describe("Input payload delivered to the routine when this run was triggered. Empty object when no payload was provided."),
1692
+ payload: z.record(z.custom((value) => value !== undefined)).optional().describe("Input payload delivered to the routine when this run was triggered. Empty object when no payload was provided."),
1717
1693
  /** Output produced by the routine after execution. `null` while the run has not yet completed. */
1718
- result: z.record(z.unknown()).optional().describe("Output produced by the routine after execution. `null` while the run has not yet completed."),
1694
+ result: z.record(z.custom((value) => value !== undefined)).optional().describe("Output produced by the routine after execution. `null` while the run has not yet completed."),
1719
1695
  /** ID of the parent routine that produced this run (`arn_...`). */
1720
1696
  routine: z.string().optional().describe("ID of the parent routine that produced this run (`arn_...`)."),
1721
1697
  /** Current execution status. One of `"pending"`, `"running"`, `"completed"`, `"failed"`, `"skipped"`, or `"cancelled"`. */
1722
1698
  status: z.string().optional().describe("Current execution status. One of `\"pending\"`, `\"running\"`, `\"completed\"`, `\"failed\"`, `\"skipped\"`, or `\"cancelled\"`."),
1723
1699
  /** Validated structured output extracted from `result` when the routine uses an AgentMessageSchema. `null` if the routine does not use a schema or the run has not completed. */
1724
- structured_response: z.record(z.unknown()).optional().describe("Validated structured output extracted from `result` when the routine uses an AgentMessageSchema. `null` if the routine does not use a schema or the run has not completed."),
1700
+ structured_response: z.record(z.custom((value) => value !== undefined)).optional().describe("Validated structured output extracted from `result` when the routine uses an AgentMessageSchema. `null` if the routine does not use a schema or the run has not completed."),
1725
1701
  /** When this run was last updated (ISO 8601). */
1726
1702
  updated_at: z.string().optional().describe("When this run was last updated (ISO 8601)."),
1727
1703
  /** Background worker status. `null` when no worker job is associated with this run. */
@@ -1755,7 +1731,7 @@ export const agentScheduleSchema = z.object({
1755
1731
  /** Maximum number of times a recurring schedule may fire before automatically transitioning to `"completed"`. `null` means no limit. */
1756
1732
  max_runs: z.number().int().optional().describe("Maximum number of times a recurring schedule may fire before automatically transitioning to `\"completed\"`. `null` means no limit."),
1757
1733
  /** Arbitrary key-value pairs attached to the schedule by the agent. Not interpreted by the platform. */
1758
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value pairs attached to the schedule by the agent. Not interpreted by the platform."),
1734
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value pairs attached to the schedule by the agent. Not interpreted by the platform."),
1759
1735
  /** UTC datetime of the next planned execution. `null` if the schedule has completed, been cancelled, or has not yet been computed. */
1760
1736
  next_run_at: z.string().optional().describe("UTC datetime of the next planned execution. `null` if the schedule has completed, been cancelled, or has not yet been computed."),
1761
1737
  /** Total number of times this schedule has fired. */
@@ -1786,7 +1762,7 @@ export const agentSessionSchema = z.object({
1786
1762
  /** Session ID (`ase_...`). */
1787
1763
  id: z.string().describe("Session ID (`ase_...`)."),
1788
1764
  /** Ordered list of messages delivered to the session's inbox while it was in the `"waiting"` state. Each entry includes `id`, `role`, `content`, `sender_id`, `sender_type`, `sent_at`, and `metadata`. */
1789
- inbox: z.array(z.record(z.unknown())).optional().describe("Ordered list of messages delivered to the session's inbox while it was in the `\"waiting\"` state. Each entry includes `id`, `role`, `content`, `sender_id`, `sender_type`, `sent_at`, and `metadata`."),
1765
+ inbox: z.array(z.record(z.custom((value) => value !== undefined))).optional().describe("Ordered list of messages delivered to the session's inbox while it was in the `\"waiting\"` state. Each entry includes `id`, `role`, `content`, `sender_id`, `sender_type`, `sent_at`, and `metadata`."),
1790
1766
  /** The task the agent is instructed to perform in this session. */
1791
1767
  instructions: z.string().optional().describe("The task the agent is instructed to perform in this session."),
1792
1768
  /** `true` if this session was created by the platform internally (e.g. by a schedule or health action) rather than by a user or API caller. */
@@ -1798,11 +1774,11 @@ export const agentSessionSchema = z.object({
1798
1774
  /** Maximum number of agent turns (LLM calls) allowed before the session is forcibly terminated. Defaults to `100`. */
1799
1775
  max_turns: z.number().int().optional().describe("Maximum number of agent turns (LLM calls) allowed before the session is forcibly terminated. Defaults to `100`."),
1800
1776
  /** Arbitrary key-value pairs attached to the session. Not interpreted by the platform. */
1801
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value pairs attached to the session. Not interpreted by the platform."),
1777
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value pairs attached to the session. Not interpreted by the platform."),
1802
1778
  /** Optional human-readable label for the session. `null` when not set. */
1803
1779
  name: z.string().optional().describe("Optional human-readable label for the session. `null` when not set."),
1804
1780
  /** Structured output produced by the session on successful completion. Shape is agent-defined. `null` while the session is still running or if it failed. */
1805
- result: z.record(z.unknown()).optional().describe("Structured output produced by the session on successful completion. Shape is agent-defined. `null` while the session is still running or if it failed."),
1781
+ result: z.record(z.custom((value) => value !== undefined)).optional().describe("Structured output produced by the session on successful completion. Shape is agent-defined. `null` while the session is still running or if it failed."),
1806
1782
  /** When the session began executing. `null` if still `"pending"`. */
1807
1783
  started_at: z.string().optional().describe("When the session began executing. `null` if still `\"pending\"`."),
1808
1784
  /** Current execution status. One of `"pending"` (queued, not yet started), `"running"` (actively executing), `"waiting"` (paused for an inbox message or external event), `"completed"` (finished successfully), `"failed"` (terminated with an error), or `"cancelled"` (manually stopped). */
@@ -1832,7 +1808,7 @@ export const agentSkillSchema = z.object({
1832
1808
  /** ID of the agent template config from which this skill was last provisioned or updated (`cfg_...`). `null` if the skill was not provisioned from a template. */
1833
1809
  last_applied_template_config: z.string().optional().describe("ID of the agent template config from which this skill was last provisioned or updated (`cfg_...`). `null` if the skill was not provisioned from a template."),
1834
1810
  /** Arbitrary key-value pairs attached to the skill. Not interpreted by the platform. */
1835
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value pairs attached to the skill. Not interpreted by the platform."),
1811
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value pairs attached to the skill. Not interpreted by the platform."),
1836
1812
  /** Whether the skill is currently in use. `"active"` means the agent will use this skill during sessions. `"inactive"` means it is disabled but not deleted. */
1837
1813
  status: z.string().optional().describe("Whether the skill is currently in use. `\"active\"` means the agent will use this skill during sessions. `\"inactive\"` means it is disabled but not deleted."),
1838
1814
  /** When the skill was last modified (ISO 8601). */
@@ -1852,7 +1828,7 @@ export const agentToolSchema = z.object({
1852
1828
  /** `true` when the tool executes asynchronously and returns a task handle rather than an immediate result. */
1853
1829
  async: z.boolean().optional().describe("`true` when the tool executes asynchronously and returns a task handle rather than an immediate result."),
1854
1830
  /** Provider-specific configuration for the built-in tool. Present only when `kind` is `"builtin"`. Shape varies by `builtin_tool_key`. */
1855
- builtin_tool_config: z.record(z.unknown()).optional().describe("Provider-specific configuration for the built-in tool. Present only when `kind` is `\"builtin\"`. Shape varies by `builtin_tool_key`."),
1831
+ builtin_tool_config: z.record(z.custom((value) => value !== undefined)).optional().describe("Provider-specific configuration for the built-in tool. Present only when `kind` is `\"builtin\"`. Shape varies by `builtin_tool_key`."),
1856
1832
  /** Registry key identifying the built-in tool implementation. Present only when `kind` is `"builtin"`. */
1857
1833
  builtin_tool_key: z.string().optional().describe("Registry key identifying the built-in tool implementation. Present only when `kind` is `\"builtin\"`."),
1858
1834
  /** ID of the config record (`cfg_...`) containing this tool's full configuration. `null` for inline-only tools. */
@@ -1874,13 +1850,13 @@ export const agentToolSchema = z.object({
1874
1850
  /** Stable, user-defined identifier for this tool within the agent. Unique per agent. */
1875
1851
  lookup_key: z.string().optional().describe("Stable, user-defined identifier for this tool within the agent. Unique per agent."),
1876
1852
  /** Arbitrary key-value metadata attached to the tool. Not interpreted by the platform. */
1877
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to the tool. Not interpreted by the platform."),
1853
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to the tool. Not interpreted by the platform."),
1878
1854
  /** Human-readable name of the tool as exposed to the LLM. Resolved from the built-in registry for `kind: "builtin"` tools. */
1879
1855
  name: z.string().optional().describe("Human-readable name of the tool as exposed to the LLM. Resolved from the built-in registry for `kind: \"builtin\"` tools."),
1880
1856
  /** Per-instance namespace prepended to LLM-facing tool names for built-in tools that support multiple instances per agent. `null` when not applicable. */
1881
1857
  name_prefix: z.string().optional().describe("Per-instance namespace prepended to LLM-facing tool names for built-in tools that support multiple instances per agent. `null` when not applicable."),
1882
1858
  /** JSON Schema object describing the tool's input parameters as presented to the LLM. */
1883
- parameters: z.record(z.unknown()).optional().describe("JSON Schema object describing the tool's input parameters as presented to the LLM."),
1859
+ parameters: z.record(z.custom((value) => value !== undefined)).optional().describe("JSON Schema object describing the tool's input parameters as presented to the LLM."),
1884
1860
  /** ID of the config record (`cfg_...`) storing the tool's parameter schema. `null` when parameters are defined inline. */
1885
1861
  parameters_config: z.string().optional().describe("ID of the config record (`cfg_...`) storing the tool's parameter schema. `null` when parameters are defined inline."),
1886
1862
  /** Current status of the tool. One of `"active"` or `"disabled"`. */
@@ -1896,15 +1872,15 @@ export const agentToolListResponseSchema = z.object({
1896
1872
  /** Runtime validator for {@link AgentUpgradeFieldChange}. */
1897
1873
  export const agentUpgradeFieldChangeSchema = z.object({
1898
1874
  /** Value that was set by the last-applied template version (pinned baseline). Populated only on `agent_base` field changes. `null` when no baseline is available (legacy agent or deleted version). */
1899
- baseline: z.unknown().optional().describe("Value that was set by the last-applied template version (pinned baseline). Populated only on `agent_base` field changes. `null` when no baseline is available (legacy agent or deleted version)."),
1875
+ baseline: z.custom((value) => value !== undefined).optional().describe("Value that was set by the last-applied template version (pinned baseline). Populated only on `agent_base` field changes. `null` when no baseline is available (legacy agent or deleted version)."),
1900
1876
  /** Name of the field that will change, e.g. `"name"` or `"identity"`. */
1901
1877
  field: z.string().describe("Name of the field that will change, e.g. `\"name\"` or `\"identity\"`."),
1902
1878
  /** `true` when the agent's current value differs from `baseline`, indicating a local edit that this upgrade will overwrite. `false` when the current value matches the baseline. `null` when `baseline` is unavailable. Populated only on `agent_base` field changes. */
1903
1879
  locally_edited: z.boolean().optional().describe("`true` when the agent's current value differs from `baseline`, indicating a local edit that this upgrade will overwrite. `false` when the current value matches the baseline. `null` when `baseline` is unavailable. Populated only on `agent_base` field changes."),
1904
1880
  /** Incoming value the field will be set to after the upgrade (string, number, boolean, or `null`). */
1905
- new: z.unknown().optional().describe("Incoming value the field will be set to after the upgrade (string, number, boolean, or `null`)."),
1881
+ new: z.custom((value) => value !== undefined).optional().describe("Incoming value the field will be set to after the upgrade (string, number, boolean, or `null`)."),
1906
1882
  /** Current value of the field before the upgrade (string, number, boolean, or `null`). */
1907
- old: z.unknown().optional().describe("Current value of the field before the upgrade (string, number, boolean, or `null`)."),
1883
+ old: z.custom((value) => value !== undefined).optional().describe("Current value of the field before the upgrade (string, number, boolean, or `null`)."),
1908
1884
  }).describe("One field-level diff entry within an agent upgrade change, describing how a single field will change. `baseline` and `locally_edited` are populated only for `agent_base` entries; child resource entries (tools, routines, skills, computers) carry only `field`, `old`, and `new`.");
1909
1885
  /** Runtime validator for {@link AgentUpgradeChange}. */
1910
1886
  export const agentUpgradeChangeSchema = z.object({
@@ -1923,7 +1899,7 @@ export const agentUpgradeChangeSchema = z.object({
1923
1899
  /** Summary of the parent AgentTemplate config (`cfg_...`) being applied in this upgrade. */
1924
1900
  parent_template_config: upgradeTemplateSummarySchema.describe("Summary of the parent AgentTemplate config (`cfg_...`) being applied in this upgrade."),
1925
1901
  /** Resource-type-specific identity details. Tools: `tool_type`, `builtin_tool_key`, `name_prefix`, `handler_type`, `instruction`. Routines: `handler_type`, `preset_name`, `event_type`, `schedule`, `trigger_context`. Skills: `instruction`. Computers: `region`. Only populated keys are present; `null` when nothing is known. */
1926
- resource: z.record(z.unknown()).optional().describe("Resource-type-specific identity details. Tools: `tool_type`, `builtin_tool_key`, `name_prefix`, `handler_type`, `instruction`. Routines: `handler_type`, `preset_name`, `event_type`, `schedule`, `trigger_context`. Skills: `instruction`. Computers: `region`. Only populated keys are present; `null` when nothing is known."),
1902
+ resource: z.record(z.custom((value) => value !== undefined)).optional().describe("Resource-type-specific identity details. Tools: `tool_type`, `builtin_tool_key`, `name_prefix`, `handler_type`, `instruction`. Routines: `handler_type`, `preset_name`, `event_type`, `schedule`, `trigger_context`. Skills: `instruction`. Computers: `region`. Only populated keys are present; `null` when nothing is known."),
1927
1903
  /** Type of the child resource being changed. One of `"agent"`, `"tool"`, `"routine"`, `"skill"`, or `"computer"`. */
1928
1904
  resource_type: z.string().describe("Type of the child resource being changed. One of `\"agent\"`, `\"tool\"`, `\"routine\"`, `\"skill\"`, or `\"computer\"`."),
1929
1905
  /** Summary of the specific child template config (`cfg_...`) that defines this resource. `null` when no source template is resolvable. */
@@ -1981,7 +1957,7 @@ export const solutionCategorySummarySchema = z.object({
1981
1957
  /** Lookup key of the underlying config record. `null` when not set. */
1982
1958
  lookup_key: z.string().optional().describe("Lookup key of the underlying config record. `null` when not set."),
1983
1959
  /** Arbitrary key-value metadata attached to this category by the publisher. */
1984
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this category by the publisher."),
1960
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to this category by the publisher."),
1985
1961
  /** Display name shown to users. `null` when not configured. */
1986
1962
  name: z.string().optional().describe("Display name shown to users. `null` when not configured."),
1987
1963
  /** Organization ID (`org_...`) that owns this category. `null` for system-scoped categories. */
@@ -2155,7 +2131,7 @@ export const solutionInstanceSchema = z.object({
2155
2131
  /** Human-readable display name of the materialized agent. `null` when no agent is visible. */
2156
2132
  agent_name: z.string().nullable().optional().describe("Human-readable display name of the materialized agent. `null` when no agent is visible."),
2157
2133
  /** Opaque tagged reference to the deployment target. Consumers interpret its kind. */
2158
- attachment_ref: z.record(z.unknown()).nullable().optional().describe("Opaque tagged reference to the deployment target. Consumers interpret its kind."),
2134
+ attachment_ref: z.record(z.custom((value) => value !== undefined)).nullable().optional().describe("Opaque tagged reference to the deployment target. Consumers interpret its kind."),
2159
2135
  /** When this instance was stamped. */
2160
2136
  created_at: z.string().describe("When this instance was stamped."),
2161
2137
  /** Stable vendor-defined key for the customer. */
@@ -2220,7 +2196,7 @@ export const solutionTagSummarySchema = z.object({
2220
2196
  /** Human-readable stable identifier for this tag config, used for lookups and imports. `null` if not assigned. */
2221
2197
  lookup_key: z.string().optional().describe("Human-readable stable identifier for this tag config, used for lookups and imports. `null` if not assigned."),
2222
2198
  /** Arbitrary key-value metadata attached to this tag. Empty object `{}` when no metadata is present. */
2223
- metadata: z.record(z.unknown()).optional().describe("Arbitrary key-value metadata attached to this tag. Empty object `{}` when no metadata is present."),
2199
+ metadata: z.record(z.custom((value) => value !== undefined)).optional().describe("Arbitrary key-value metadata attached to this tag. Empty object `{}` when no metadata is present."),
2224
2200
  /** Human-readable display name for the tag. `null` if not yet set. */
2225
2201
  name: z.string().optional().describe("Human-readable display name for the tag. `null` if not yet set."),
2226
2202
  /** ID of the organization that owns this tag (`org_...`). `null` for system-scoped tags. */