@terreno/blocks 57.10.1

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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/biome.jsonc +18 -0
  4. package/bunfig.toml +6 -0
  5. package/dist/asks/errors.d.ts +77 -0
  6. package/dist/asks/errors.js +364 -0
  7. package/dist/asks/files.d.ts +53 -0
  8. package/dist/asks/files.js +171 -0
  9. package/dist/asks/formValues.d.ts +32 -0
  10. package/dist/asks/formValues.js +229 -0
  11. package/dist/asks/headless.d.ts +227 -0
  12. package/dist/asks/headless.js +94 -0
  13. package/dist/asks/jsonSchema.d.ts +6 -0
  14. package/dist/asks/jsonSchema.js +62 -0
  15. package/dist/asks/limits.d.ts +58 -0
  16. package/dist/asks/limits.js +61 -0
  17. package/dist/asks/prompt.d.ts +10 -0
  18. package/dist/asks/prompt.js +144 -0
  19. package/dist/asks/schema.d.ts +826 -0
  20. package/dist/asks/schema.js +864 -0
  21. package/dist/asks/simpleCard.d.ts +85 -0
  22. package/dist/asks/simpleCard.js +279 -0
  23. package/dist/asks/validateInput.d.ts +13 -0
  24. package/dist/asks/validateInput.js +19 -0
  25. package/dist/asks/validateResponse.d.ts +13 -0
  26. package/dist/asks/validateResponse.js +278 -0
  27. package/dist/cli.d.ts +11 -0
  28. package/dist/cli.js +58 -0
  29. package/dist/errors.d.ts +51 -0
  30. package/dist/errors.js +106 -0
  31. package/dist/index.d.ts +31 -0
  32. package/dist/index.js +111 -0
  33. package/dist/jsonSchema.d.ts +5 -0
  34. package/dist/jsonSchema.js +12 -0
  35. package/dist/limits.d.ts +27 -0
  36. package/dist/limits.js +30 -0
  37. package/dist/lint.d.ts +21 -0
  38. package/dist/lint.js +388 -0
  39. package/dist/parse.d.ts +16 -0
  40. package/dist/parse.js +95 -0
  41. package/dist/parsePartial.d.ts +12 -0
  42. package/dist/parsePartial.js +105 -0
  43. package/dist/prompt.d.ts +9 -0
  44. package/dist/prompt.js +95 -0
  45. package/dist/schema.d.ts +199 -0
  46. package/dist/schema.js +277 -0
  47. package/dist/validate.d.ts +17 -0
  48. package/dist/validate.js +331 -0
  49. package/package.json +60 -0
  50. package/schemas/pendingAsksResponse.schema.json +195 -0
  51. package/schemas/simpleCard.schema.json +135 -0
  52. package/schemas/turnRequest.schema.json +108 -0
  53. package/schemas/turnResponse.schema.json +204 -0
  54. package/scripts/writeJsonSchemas.ts +11 -0
  55. package/src/asks/docParity.test.ts +65 -0
  56. package/src/asks/errors.test.ts +250 -0
  57. package/src/asks/errors.ts +449 -0
  58. package/src/asks/files.test.ts +294 -0
  59. package/src/asks/files.ts +216 -0
  60. package/src/asks/fixtures/invalid/choice-blank-text.json +20 -0
  61. package/src/asks/fixtures/invalid/choice-default-not-in-options.json +13 -0
  62. package/src/asks/fixtures/invalid/choice-default-selects-two.json +16 -0
  63. package/src/asks/fixtures/invalid/choice-description-too-long.json +24 -0
  64. package/src/asks/fixtures/invalid/choice-duplicate-ids.json +17 -0
  65. package/src/asks/fixtures/invalid/choice-label-too-long.json +23 -0
  66. package/src/asks/fixtures/invalid/choice-many-bounds-not-whole.json +17 -0
  67. package/src/asks/fixtures/invalid/choice-many-bounds-out-of-range.json +17 -0
  68. package/src/asks/fixtures/invalid/choice-many-default-duplicate.json +17 -0
  69. package/src/asks/fixtures/invalid/choice-many-default-too-many.json +15 -0
  70. package/src/asks/fixtures/invalid/choice-many-max-above-options.json +14 -0
  71. package/src/asks/fixtures/invalid/choice-many-min-above-choices.json +13 -0
  72. package/src/asks/fixtures/invalid/choice-many-min-above-max.json +15 -0
  73. package/src/asks/fixtures/invalid/choice-missing-required.json +14 -0
  74. package/src/asks/fixtures/invalid/choice-mixed-errors.json +19 -0
  75. package/src/asks/fixtures/invalid/choice-not-an-object.json +5 -0
  76. package/src/asks/fixtures/invalid/choice-one-with-many-fields.json +19 -0
  77. package/src/asks/fixtures/invalid/choice-option-id-format.json +35 -0
  78. package/src/asks/fixtures/invalid/choice-options-not-objects.json +12 -0
  79. package/src/asks/fixtures/invalid/choice-other-label-too-long.json +25 -0
  80. package/src/asks/fixtures/invalid/choice-other-label-without-allow-other.json +14 -0
  81. package/src/asks/fixtures/invalid/choice-prompt-empty.json +12 -0
  82. package/src/asks/fixtures/invalid/choice-prompt-too-long.json +23 -0
  83. package/src/asks/fixtures/invalid/choice-select-unknown.json +12 -0
  84. package/src/asks/fixtures/invalid/choice-submit-label-too-long.json +13 -0
  85. package/src/asks/fixtures/invalid/choice-title-too-long.json +24 -0
  86. package/src/asks/fixtures/invalid/choice-too-few-options.json +9 -0
  87. package/src/asks/fixtures/invalid/choice-too-many-options.json +219 -0
  88. package/src/asks/fixtures/invalid/choice-unknown-key-option.json +15 -0
  89. package/src/asks/fixtures/invalid/choice-unknown-key-root.json +13 -0
  90. package/src/asks/fixtures/invalid/choice-wrong-types.json +16 -0
  91. package/src/asks/fixtures/invalid/confirm-emoji-label-too-long.json +13 -0
  92. package/src/asks/fixtures/invalid/confirm-label-too-long.json +14 -0
  93. package/src/asks/fixtures/invalid/confirm-labels-alike-after-trim.json +14 -0
  94. package/src/asks/fixtures/invalid/confirm-labels-alike.json +13 -0
  95. package/src/asks/fixtures/invalid/confirm-missing-prompt-blank-label.json +16 -0
  96. package/src/asks/fixtures/invalid/confirm-unknown-keys.json +23 -0
  97. package/src/asks/fixtures/invalid/confirm-wrong-types.json +18 -0
  98. package/src/asks/fixtures/invalid/files-accept-duplicate.json +13 -0
  99. package/src/asks/fixtures/invalid/files-accept-empty.json +13 -0
  100. package/src/asks/fixtures/invalid/files-accept-unknown.json +13 -0
  101. package/src/asks/fixtures/invalid/files-counts-out-of-range.json +19 -0
  102. package/src/asks/fixtures/invalid/files-min-above-max.json +15 -0
  103. package/src/asks/fixtures/invalid/files-missing-accept-unknown-key.json +17 -0
  104. package/src/asks/fixtures/invalid/form-default-bad-format.json +40 -0
  105. package/src/asks/fixtures/invalid/form-default-invalid-date.json +40 -0
  106. package/src/asks/fixtures/invalid/form-default-not-in-options.json +58 -0
  107. package/src/asks/fixtures/invalid/form-default-out-of-range.json +33 -0
  108. package/src/asks/fixtures/invalid/form-default-text-bounds.json +42 -0
  109. package/src/asks/fixtures/invalid/form-default-wrong-type.json +30 -0
  110. package/src/asks/fixtures/invalid/form-duplicate-field-ids.json +24 -0
  111. package/src/asks/fixtures/invalid/form-field-id-format.json +19 -0
  112. package/src/asks/fixtures/invalid/form-field-text-limits.json +33 -0
  113. package/src/asks/fixtures/invalid/form-keys-of-another-type.json +39 -0
  114. package/src/asks/fixtures/invalid/form-length-above-cap.json +30 -0
  115. package/src/asks/fixtures/invalid/form-min-above-max.json +32 -0
  116. package/src/asks/fixtures/invalid/form-no-fields.json +13 -0
  117. package/src/asks/fixtures/invalid/form-select-options.json +44 -0
  118. package/src/asks/fixtures/invalid/form-too-many-fields.json +59 -0
  119. package/src/asks/fixtures/invalid/form-unknown-field-type.json +27 -0
  120. package/src/asks/fixtures/invalid/markdown-bounds-out-of-range.json +18 -0
  121. package/src/asks/fixtures/invalid/markdown-initial-above-cap.json +13 -0
  122. package/src/asks/fixtures/invalid/markdown-max-above-cap.json +13 -0
  123. package/src/asks/fixtures/invalid/markdown-min-above-cap.json +13 -0
  124. package/src/asks/fixtures/invalid/markdown-min-above-max.json +14 -0
  125. package/src/asks/fixtures/invalid/markdown-placeholder-too-long.json +13 -0
  126. package/src/asks/fixtures/invalid/markdown-wrong-types-unknown-key.json +27 -0
  127. package/src/asks/fixtures/valid/choice-emoji-label-cut.json +32 -0
  128. package/src/asks/fixtures/valid/choice-labels-collide-after-cut.json +21 -0
  129. package/src/asks/fixtures/valid/choice-long-text-cut.json +41 -0
  130. package/src/asks/fixtures/valid/choice-many-default-below-min.json +24 -0
  131. package/src/asks/fixtures/valid/choice-many-every-choice-with-other.json +24 -0
  132. package/src/asks/fixtures/valid/choice-many-no-default.json +21 -0
  133. package/src/asks/fixtures/valid/choice-many-optional-no-buttons.json +20 -0
  134. package/src/asks/fixtures/valid/choice-many-options-default-label-collides.json +23 -0
  135. package/src/asks/fixtures/valid/choice-many-options-no-buttons.json +21 -0
  136. package/src/asks/fixtures/valid/choice-many-options-no-default.json +22 -0
  137. package/src/asks/fixtures/valid/choice-many-options-with-default.json +30 -0
  138. package/src/asks/fixtures/valid/choice-many-required-with-default.json +29 -0
  139. package/src/asks/fixtures/valid/choice-many-single-pick-or-other.json +29 -0
  140. package/src/asks/fixtures/valid/choice-many-toppings-with-default.json +36 -0
  141. package/src/asks/fixtures/valid/choice-max-limits.json +245 -0
  142. package/src/asks/fixtures/valid/choice-plan-with-default.json +42 -0
  143. package/src/asks/fixtures/valid/choice-two-options-no-decline.json +32 -0
  144. package/src/asks/fixtures/valid/choice-two-options.json +32 -0
  145. package/src/asks/fixtures/valid/confirm-allow-decline.json +40 -0
  146. package/src/asks/fixtures/valid/confirm-default-labels.json +36 -0
  147. package/src/asks/fixtures/valid/confirm-destructive-delete.json +41 -0
  148. package/src/asks/fixtures/valid/confirm-emoji-labels.json +38 -0
  149. package/src/asks/fixtures/valid/confirm-long-text-cut.json +40 -0
  150. package/src/asks/fixtures/valid/files-every-type.json +28 -0
  151. package/src/asks/fixtures/valid/files-one-csv-no-decline.json +16 -0
  152. package/src/asks/fixtures/valid/files-receipt-photos.json +24 -0
  153. package/src/asks/fixtures/valid/form-boolean-newsletter.json +30 -0
  154. package/src/asks/fixtures/valid/form-date-due.json +44 -0
  155. package/src/asks/fixtures/valid/form-datetime-meeting.json +44 -0
  156. package/src/asks/fixtures/valid/form-datetime-minutes-offset.json +44 -0
  157. package/src/asks/fixtures/valid/form-eight-fields.json +71 -0
  158. package/src/asks/fixtures/valid/form-email-contact.json +44 -0
  159. package/src/asks/fixtures/valid/form-invoice-details.json +68 -0
  160. package/src/asks/fixtures/valid/form-multiselect-channels.json +64 -0
  161. package/src/asks/fixtures/valid/form-number-budget.json +45 -0
  162. package/src/asks/fixtures/valid/form-phone-callback.json +44 -0
  163. package/src/asks/fixtures/valid/form-select-shipping.json +58 -0
  164. package/src/asks/fixtures/valid/form-text-required-default.json +47 -0
  165. package/src/asks/fixtures/valid/form-textarea-notes.json +23 -0
  166. package/src/asks/fixtures/valid/form-time-reminder.json +44 -0
  167. package/src/asks/fixtures/valid/form-url-website.json +30 -0
  168. package/src/asks/fixtures/valid/markdown-announcement-draft.json +39 -0
  169. package/src/asks/fixtures/valid/markdown-empty-draft.json +34 -0
  170. package/src/asks/fixtures/valid/markdown-initial-blank-below-min.json +24 -0
  171. package/src/asks/fixtures/valid/markdown-initial-over-max.json +24 -0
  172. package/src/asks/fixtures/valid/markdown-long-text-cut.json +37 -0
  173. package/src/asks/fixtures/valid/markdown-no-decline.json +28 -0
  174. package/src/asks/fixtures/valid/markdown-no-initial-with-min.json +25 -0
  175. package/src/asks/formValues.ts +320 -0
  176. package/src/asks/headless.test.ts +146 -0
  177. package/src/asks/headless.ts +130 -0
  178. package/src/asks/jsonSchema.test.ts +171 -0
  179. package/src/asks/jsonSchema.ts +89 -0
  180. package/src/asks/limits.ts +58 -0
  181. package/src/asks/prompt.test.ts +200 -0
  182. package/src/asks/prompt.ts +173 -0
  183. package/src/asks/schema.test.ts +198 -0
  184. package/src/asks/schema.ts +1203 -0
  185. package/src/asks/simpleCard.test.ts +998 -0
  186. package/src/asks/simpleCard.ts +341 -0
  187. package/src/asks/validateInput.test.ts +875 -0
  188. package/src/asks/validateInput.ts +24 -0
  189. package/src/asks/validateResponse.test.ts +740 -0
  190. package/src/asks/validateResponse.ts +341 -0
  191. package/src/blocksDocParity.test.ts +21 -0
  192. package/src/cli.test.ts +134 -0
  193. package/src/cli.ts +65 -0
  194. package/src/display.test.ts +68 -0
  195. package/src/errors.test.ts +29 -0
  196. package/src/errors.ts +125 -0
  197. package/src/fixtures/invalid/column-not-found.yaml +14 -0
  198. package/src/fixtures/invalid/column-type.yaml +14 -0
  199. package/src/fixtures/invalid/dataset-not-found.yaml +7 -0
  200. package/src/fixtures/invalid/dataset-too-large.yaml +20 -0
  201. package/src/fixtures/invalid/depth-exceeded.yaml +10 -0
  202. package/src/fixtures/invalid/duplicate-id.yaml +6 -0
  203. package/src/fixtures/invalid/invalid-enum.yaml +5 -0
  204. package/src/fixtures/invalid/key-order.yaml +4 -0
  205. package/src/fixtures/invalid/missing-required.yaml +3 -0
  206. package/src/fixtures/invalid/not-a-document.txt +1 -0
  207. package/src/fixtures/invalid/row-arity.yaml +11 -0
  208. package/src/fixtures/invalid/select-target.yaml +12 -0
  209. package/src/fixtures/invalid/table-too-wide.yaml +9 -0
  210. package/src/fixtures/invalid/too-many-points.yaml +8 -0
  211. package/src/fixtures/invalid/unknown-key.yaml +5 -0
  212. package/src/fixtures/invalid/unsupported-version.yaml +4 -0
  213. package/src/fixtures/invalid/yaml-anchor.yaml +6 -0
  214. package/src/fixtures/partial/cut-after-divider.yaml +5 -0
  215. package/src/fixtures/valid/actions.yaml +32 -0
  216. package/src/fixtures/valid/chart.yaml +20 -0
  217. package/src/fixtures/valid/layout.yaml +26 -0
  218. package/src/fixtures/valid/prose.yaml +4 -0
  219. package/src/html.test.ts +52 -0
  220. package/src/index.test.ts +114 -0
  221. package/src/index.ts +175 -0
  222. package/src/jsonSchema.test.ts +33 -0
  223. package/src/jsonSchema.ts +11 -0
  224. package/src/limits.ts +27 -0
  225. package/src/lint.test.ts +289 -0
  226. package/src/lint.ts +484 -0
  227. package/src/parse.test.ts +281 -0
  228. package/src/parse.ts +104 -0
  229. package/src/parsePartial.test.ts +53 -0
  230. package/src/parsePartial.ts +116 -0
  231. package/src/prompt.test.ts +24 -0
  232. package/src/prompt.ts +104 -0
  233. package/src/schema.ts +509 -0
  234. package/src/tests/askFixtures.ts +40 -0
  235. package/src/validate.perf.test.ts +43 -0
  236. package/src/validate.ts +369 -0
  237. package/tsconfig.json +18 -0
@@ -0,0 +1,826 @@
1
+ import { z } from "zod";
2
+ import { type AskFileAccept } from "./files";
3
+ /** Ask kinds in the catalog. Each kind is offered to the model as the tool `ask_<kind>`. */
4
+ export declare const ASK_KINDS: readonly ["choice", "confirm", "markdown", "form", "files"];
5
+ export type AskKind = (typeof ASK_KINDS)[number];
6
+ /**
7
+ * Where the user answers. `compact` is a small screen, such as a watch: the model is offered only
8
+ * asks whose simple card shows every option, so the user never has to continue on a phone.
9
+ */
10
+ export declare const ASK_SURFACES: readonly ["full", "compact"];
11
+ export type AskSurface = (typeof ASK_SURFACES)[number];
12
+ /** Ask kinds the compact surface offers, each with a narrowed input schema. */
13
+ export declare const COMPACT_ASK_KINDS: readonly ["choice", "confirm"];
14
+ export type CompactAskKind = (typeof COMPACT_ASK_KINDS)[number];
15
+ /** Reasons the server records when it answers an ask with `cancel` on the user's behalf. */
16
+ export declare const ASK_CANCEL_REASONS: {
17
+ readonly oneAskAtATime: "one_ask_at_a_time";
18
+ readonly userSentMessage: "user_sent_message";
19
+ };
20
+ export declare const choiceOptionSchema: z.ZodObject<{
21
+ description: z.ZodOptional<z.ZodString>;
22
+ id: z.ZodString;
23
+ label: z.ZodString;
24
+ }, z.core.$strict>;
25
+ export type ChoiceOption = z.infer<typeof choiceOptionSchema>;
26
+ /** How many options a `choice` lets the user pick. */
27
+ export declare const CHOICE_SELECT_MODES: readonly ["one", "many"];
28
+ export type ChoiceSelectMode = (typeof CHOICE_SELECT_MODES)[number];
29
+ /** The fields of a `choice` input that its semantic rules read. */
30
+ interface ChoiceRuleInput {
31
+ allowOther?: boolean;
32
+ default?: string[];
33
+ maxSelected?: number;
34
+ minSelected?: number;
35
+ options: ChoiceOption[];
36
+ otherLabel?: string;
37
+ select: ChoiceSelectMode;
38
+ }
39
+ /**
40
+ * How many choices an answer to a `choice` must make, counting a typed Other answer as one.
41
+ * `select: "one"` is always exactly one. `select: "many"` defaults to at least 1 and at most every
42
+ * choice the ask offers: each option, plus Other when `allowOther` is true.
43
+ */
44
+ export declare const choiceSelectionBounds: (input: ChoiceRuleInput) => {
45
+ max: number;
46
+ min: number;
47
+ };
48
+ /**
49
+ * A label as its button shows it. Spaces at either end don't show, so "Go " and "Go" look the same
50
+ * and are compared, and put on simple card buttons, without them.
51
+ */
52
+ export declare const visibleLabel: (label: string) => string;
53
+ /** Input for `ask_choice`: pick one option, or several with `select: "many"`, from a list. */
54
+ export declare const choiceAskInputSchema: z.ZodObject<{
55
+ allowOther: z.ZodOptional<z.ZodBoolean>;
56
+ maxSelected: z.ZodOptional<z.ZodNumber>;
57
+ minSelected: z.ZodOptional<z.ZodNumber>;
58
+ otherLabel: z.ZodOptional<z.ZodString>;
59
+ select: z.ZodEnum<{
60
+ one: "one";
61
+ many: "many";
62
+ }>;
63
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ options: z.ZodArray<z.ZodObject<{
65
+ description: z.ZodOptional<z.ZodString>;
66
+ id: z.ZodString;
67
+ label: z.ZodString;
68
+ }, z.core.$strict>>;
69
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
70
+ prompt: z.ZodString;
71
+ submitLabel: z.ZodOptional<z.ZodString>;
72
+ title: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strict>;
74
+ export type ChoiceAskInput = z.infer<typeof choiceAskInputSchema>;
75
+ /**
76
+ * Input for `ask_choice` on the compact surface: pick one option by tapping its button, so the
77
+ * card never hands off. At most 3 options, labels of at most 20 characters (each emoji counts as 2
78
+ * or more), and no two labels alike. `select: "many"` and Other are not offered.
79
+ */
80
+ export declare const compactChoiceAskInputSchema: z.ZodObject<{
81
+ select: z.ZodLiteral<"one">;
82
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
83
+ options: z.ZodArray<z.ZodObject<{
84
+ description: z.ZodOptional<z.ZodString>;
85
+ id: z.ZodString;
86
+ label: z.ZodString;
87
+ }, z.core.$strict>>;
88
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
89
+ prompt: z.ZodString;
90
+ submitLabel: z.ZodOptional<z.ZodString>;
91
+ title: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strict>;
93
+ /** The fields of a `confirm` input that its semantic rules read. */
94
+ interface ConfirmRuleInput {
95
+ confirmLabel?: string;
96
+ denyLabel?: string;
97
+ }
98
+ /** The labels of a `confirm` ask's approve and deny buttons, with the defaults filled in. */
99
+ export declare const confirmButtonLabels: (input: ConfirmRuleInput) => {
100
+ confirm: string;
101
+ deny: string;
102
+ };
103
+ /**
104
+ * Input for `ask_confirm`: approve or deny one action. It has no Submit, so no `submitLabel`, and
105
+ * `allowDecline` defaults to false because deny is already the negative answer.
106
+ */
107
+ export declare const confirmAskInputSchema: z.ZodObject<{
108
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
109
+ confirmLabel: z.ZodOptional<z.ZodString>;
110
+ denyLabel: z.ZodOptional<z.ZodString>;
111
+ destructive: z.ZodOptional<z.ZodBoolean>;
112
+ prompt: z.ZodString;
113
+ title: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strict>;
115
+ export type ConfirmAskInput = z.infer<typeof confirmAskInputSchema>;
116
+ /** The fields of a `markdown` input that its length rules read. */
117
+ interface MarkdownRuleInput {
118
+ initial?: string;
119
+ maxLength?: number;
120
+ minLength?: number;
121
+ }
122
+ /**
123
+ * How long an answer to a `markdown` ask may be. `max` counts UTF-16 code units (the `length` of a
124
+ * JavaScript string, so most emoji count as 2 or more) and defaults to the 20,000 cap. `min`
125
+ * counts the text without spaces at either end and defaults to 0.
126
+ */
127
+ export declare const markdownLengthBounds: (input: MarkdownRuleInput) => {
128
+ max: number;
129
+ min: number;
130
+ };
131
+ /** Input for `ask_markdown`: the user edits a markdown draft and sends it back. */
132
+ export declare const markdownAskInputSchema: z.ZodObject<{
133
+ initial: z.ZodOptional<z.ZodString>;
134
+ maxLength: z.ZodOptional<z.ZodNumber>;
135
+ minLength: z.ZodOptional<z.ZodNumber>;
136
+ placeholder: z.ZodOptional<z.ZodString>;
137
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
138
+ prompt: z.ZodString;
139
+ submitLabel: z.ZodOptional<z.ZodString>;
140
+ title: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strict>;
142
+ export type MarkdownAskInput = z.infer<typeof markdownAskInputSchema>;
143
+ /** The field types a `form` offers. Every field is flat: no nesting and no conditional fields. */
144
+ export declare const FORM_FIELD_TYPES: readonly ["text", "textarea", "email", "url", "phone", "number", "date", "time", "datetime", "boolean", "select", "multiselect"];
145
+ export type FormFieldType = (typeof FORM_FIELD_TYPES)[number];
146
+ export declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
147
+ default: z.ZodOptional<z.ZodString>;
148
+ maxLength: z.ZodOptional<z.ZodNumber>;
149
+ minLength: z.ZodOptional<z.ZodNumber>;
150
+ helperText: z.ZodOptional<z.ZodString>;
151
+ id: z.ZodString;
152
+ label: z.ZodString;
153
+ required: z.ZodOptional<z.ZodBoolean>;
154
+ type: z.ZodLiteral<"text">;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ default: z.ZodOptional<z.ZodString>;
157
+ maxLength: z.ZodOptional<z.ZodNumber>;
158
+ minLength: z.ZodOptional<z.ZodNumber>;
159
+ helperText: z.ZodOptional<z.ZodString>;
160
+ id: z.ZodString;
161
+ label: z.ZodString;
162
+ required: z.ZodOptional<z.ZodBoolean>;
163
+ type: z.ZodLiteral<"textarea">;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ default: z.ZodOptional<z.ZodString>;
166
+ helperText: z.ZodOptional<z.ZodString>;
167
+ id: z.ZodString;
168
+ label: z.ZodString;
169
+ required: z.ZodOptional<z.ZodBoolean>;
170
+ type: z.ZodLiteral<"email">;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ default: z.ZodOptional<z.ZodString>;
173
+ helperText: z.ZodOptional<z.ZodString>;
174
+ id: z.ZodString;
175
+ label: z.ZodString;
176
+ required: z.ZodOptional<z.ZodBoolean>;
177
+ type: z.ZodLiteral<"url">;
178
+ }, z.core.$strict>, z.ZodObject<{
179
+ default: z.ZodOptional<z.ZodString>;
180
+ helperText: z.ZodOptional<z.ZodString>;
181
+ id: z.ZodString;
182
+ label: z.ZodString;
183
+ required: z.ZodOptional<z.ZodBoolean>;
184
+ type: z.ZodLiteral<"phone">;
185
+ }, z.core.$strict>, z.ZodObject<{
186
+ default: z.ZodOptional<z.ZodNumber>;
187
+ integer: z.ZodOptional<z.ZodBoolean>;
188
+ max: z.ZodOptional<z.ZodNumber>;
189
+ min: z.ZodOptional<z.ZodNumber>;
190
+ helperText: z.ZodOptional<z.ZodString>;
191
+ id: z.ZodString;
192
+ label: z.ZodString;
193
+ required: z.ZodOptional<z.ZodBoolean>;
194
+ type: z.ZodLiteral<"number">;
195
+ }, z.core.$strict>, z.ZodObject<{
196
+ default: z.ZodOptional<z.ZodString>;
197
+ helperText: z.ZodOptional<z.ZodString>;
198
+ id: z.ZodString;
199
+ label: z.ZodString;
200
+ required: z.ZodOptional<z.ZodBoolean>;
201
+ type: z.ZodLiteral<"date">;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ default: z.ZodOptional<z.ZodString>;
204
+ helperText: z.ZodOptional<z.ZodString>;
205
+ id: z.ZodString;
206
+ label: z.ZodString;
207
+ required: z.ZodOptional<z.ZodBoolean>;
208
+ type: z.ZodLiteral<"time">;
209
+ }, z.core.$strict>, z.ZodObject<{
210
+ default: z.ZodOptional<z.ZodString>;
211
+ helperText: z.ZodOptional<z.ZodString>;
212
+ id: z.ZodString;
213
+ label: z.ZodString;
214
+ required: z.ZodOptional<z.ZodBoolean>;
215
+ type: z.ZodLiteral<"datetime">;
216
+ }, z.core.$strict>, z.ZodObject<{
217
+ default: z.ZodOptional<z.ZodBoolean>;
218
+ helperText: z.ZodOptional<z.ZodString>;
219
+ id: z.ZodString;
220
+ label: z.ZodString;
221
+ required: z.ZodOptional<z.ZodBoolean>;
222
+ type: z.ZodLiteral<"boolean">;
223
+ }, z.core.$strict>, z.ZodObject<{
224
+ default: z.ZodOptional<z.ZodString>;
225
+ options: z.ZodArray<z.ZodObject<{
226
+ id: z.ZodString;
227
+ label: z.ZodString;
228
+ }, z.core.$strict>>;
229
+ helperText: z.ZodOptional<z.ZodString>;
230
+ id: z.ZodString;
231
+ label: z.ZodString;
232
+ required: z.ZodOptional<z.ZodBoolean>;
233
+ type: z.ZodLiteral<"select">;
234
+ }, z.core.$strict>, z.ZodObject<{
235
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
+ options: z.ZodArray<z.ZodObject<{
237
+ id: z.ZodString;
238
+ label: z.ZodString;
239
+ }, z.core.$strict>>;
240
+ helperText: z.ZodOptional<z.ZodString>;
241
+ id: z.ZodString;
242
+ label: z.ZodString;
243
+ required: z.ZodOptional<z.ZodBoolean>;
244
+ type: z.ZodLiteral<"multiselect">;
245
+ }, z.core.$strict>], "type">;
246
+ export type FormField = z.infer<typeof formFieldSchema>;
247
+ /** Input for `ask_form`: a few flat fields the user fills in and submits at once. */
248
+ export declare const formAskInputSchema: z.ZodObject<{
249
+ fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
250
+ default: z.ZodOptional<z.ZodString>;
251
+ maxLength: z.ZodOptional<z.ZodNumber>;
252
+ minLength: z.ZodOptional<z.ZodNumber>;
253
+ helperText: z.ZodOptional<z.ZodString>;
254
+ id: z.ZodString;
255
+ label: z.ZodString;
256
+ required: z.ZodOptional<z.ZodBoolean>;
257
+ type: z.ZodLiteral<"text">;
258
+ }, z.core.$strict>, z.ZodObject<{
259
+ default: z.ZodOptional<z.ZodString>;
260
+ maxLength: z.ZodOptional<z.ZodNumber>;
261
+ minLength: z.ZodOptional<z.ZodNumber>;
262
+ helperText: z.ZodOptional<z.ZodString>;
263
+ id: z.ZodString;
264
+ label: z.ZodString;
265
+ required: z.ZodOptional<z.ZodBoolean>;
266
+ type: z.ZodLiteral<"textarea">;
267
+ }, z.core.$strict>, z.ZodObject<{
268
+ default: z.ZodOptional<z.ZodString>;
269
+ helperText: z.ZodOptional<z.ZodString>;
270
+ id: z.ZodString;
271
+ label: z.ZodString;
272
+ required: z.ZodOptional<z.ZodBoolean>;
273
+ type: z.ZodLiteral<"email">;
274
+ }, z.core.$strict>, z.ZodObject<{
275
+ default: z.ZodOptional<z.ZodString>;
276
+ helperText: z.ZodOptional<z.ZodString>;
277
+ id: z.ZodString;
278
+ label: z.ZodString;
279
+ required: z.ZodOptional<z.ZodBoolean>;
280
+ type: z.ZodLiteral<"url">;
281
+ }, z.core.$strict>, z.ZodObject<{
282
+ default: z.ZodOptional<z.ZodString>;
283
+ helperText: z.ZodOptional<z.ZodString>;
284
+ id: z.ZodString;
285
+ label: z.ZodString;
286
+ required: z.ZodOptional<z.ZodBoolean>;
287
+ type: z.ZodLiteral<"phone">;
288
+ }, z.core.$strict>, z.ZodObject<{
289
+ default: z.ZodOptional<z.ZodNumber>;
290
+ integer: z.ZodOptional<z.ZodBoolean>;
291
+ max: z.ZodOptional<z.ZodNumber>;
292
+ min: z.ZodOptional<z.ZodNumber>;
293
+ helperText: z.ZodOptional<z.ZodString>;
294
+ id: z.ZodString;
295
+ label: z.ZodString;
296
+ required: z.ZodOptional<z.ZodBoolean>;
297
+ type: z.ZodLiteral<"number">;
298
+ }, z.core.$strict>, z.ZodObject<{
299
+ default: z.ZodOptional<z.ZodString>;
300
+ helperText: z.ZodOptional<z.ZodString>;
301
+ id: z.ZodString;
302
+ label: z.ZodString;
303
+ required: z.ZodOptional<z.ZodBoolean>;
304
+ type: z.ZodLiteral<"date">;
305
+ }, z.core.$strict>, z.ZodObject<{
306
+ default: z.ZodOptional<z.ZodString>;
307
+ helperText: z.ZodOptional<z.ZodString>;
308
+ id: z.ZodString;
309
+ label: z.ZodString;
310
+ required: z.ZodOptional<z.ZodBoolean>;
311
+ type: z.ZodLiteral<"time">;
312
+ }, z.core.$strict>, z.ZodObject<{
313
+ default: z.ZodOptional<z.ZodString>;
314
+ helperText: z.ZodOptional<z.ZodString>;
315
+ id: z.ZodString;
316
+ label: z.ZodString;
317
+ required: z.ZodOptional<z.ZodBoolean>;
318
+ type: z.ZodLiteral<"datetime">;
319
+ }, z.core.$strict>, z.ZodObject<{
320
+ default: z.ZodOptional<z.ZodBoolean>;
321
+ helperText: z.ZodOptional<z.ZodString>;
322
+ id: z.ZodString;
323
+ label: z.ZodString;
324
+ required: z.ZodOptional<z.ZodBoolean>;
325
+ type: z.ZodLiteral<"boolean">;
326
+ }, z.core.$strict>, z.ZodObject<{
327
+ default: z.ZodOptional<z.ZodString>;
328
+ options: z.ZodArray<z.ZodObject<{
329
+ id: z.ZodString;
330
+ label: z.ZodString;
331
+ }, z.core.$strict>>;
332
+ helperText: z.ZodOptional<z.ZodString>;
333
+ id: z.ZodString;
334
+ label: z.ZodString;
335
+ required: z.ZodOptional<z.ZodBoolean>;
336
+ type: z.ZodLiteral<"select">;
337
+ }, z.core.$strict>, z.ZodObject<{
338
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
+ options: z.ZodArray<z.ZodObject<{
340
+ id: z.ZodString;
341
+ label: z.ZodString;
342
+ }, z.core.$strict>>;
343
+ helperText: z.ZodOptional<z.ZodString>;
344
+ id: z.ZodString;
345
+ label: z.ZodString;
346
+ required: z.ZodOptional<z.ZodBoolean>;
347
+ type: z.ZodLiteral<"multiselect">;
348
+ }, z.core.$strict>], "type">>;
349
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
350
+ prompt: z.ZodString;
351
+ submitLabel: z.ZodOptional<z.ZodString>;
352
+ title: z.ZodOptional<z.ZodString>;
353
+ }, z.core.$strict>;
354
+ export type FormAskInput = z.infer<typeof formAskInputSchema>;
355
+ /** The `content` of an accepted answer from any client, before its values meet their fields. */
356
+ export declare const formAnswerEnvelopeSchema: z.ZodObject<{
357
+ values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
358
+ }, z.core.$strict>;
359
+ /**
360
+ * The `content` of an accepted `form` answer: one value per answered field, keyed by field id.
361
+ * Unanswered optional fields are left out.
362
+ */
363
+ export declare const formAnswerSchema: z.ZodObject<{
364
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
365
+ }, z.core.$strict>;
366
+ export type FormAnswer = z.infer<typeof formAnswerSchema>;
367
+ /** The fields of a `files` input that its count rules read. */
368
+ interface FilesRuleInput {
369
+ accept: AskFileAccept[];
370
+ maxFiles?: number;
371
+ minFiles?: number;
372
+ }
373
+ /** How many files an answer to a `files` ask must carry: 1 to 10 unless the ask narrows it. */
374
+ export declare const filesCountBounds: (input: FilesRuleInput) => {
375
+ max: number;
376
+ min: number;
377
+ };
378
+ /** Input for `ask_files`: the user uploads one or more images or documents. */
379
+ export declare const filesAskInputSchema: z.ZodObject<{
380
+ accept: z.ZodArray<z.ZodEnum<{
381
+ text: "text";
382
+ image: "image";
383
+ pdf: "pdf";
384
+ csv: "csv";
385
+ json: "json";
386
+ }>>;
387
+ maxFiles: z.ZodOptional<z.ZodNumber>;
388
+ minFiles: z.ZodOptional<z.ZodNumber>;
389
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
390
+ prompt: z.ZodString;
391
+ submitLabel: z.ZodOptional<z.ZodString>;
392
+ title: z.ZodOptional<z.ZodString>;
393
+ }, z.core.$strict>;
394
+ export type FilesAskInput = z.infer<typeof filesAskInputSchema>;
395
+ /** One file in an accepted `files` answer: an upload (`fileId`) or inline bytes (`url`). */
396
+ export declare const askFileRefSchema: z.ZodObject<{
397
+ fileId: z.ZodOptional<z.ZodString>;
398
+ filename: z.ZodString;
399
+ mimeType: z.ZodString;
400
+ size: z.ZodNumber;
401
+ url: z.ZodOptional<z.ZodString>;
402
+ }, z.core.$strict>;
403
+ export type AskFileRef = z.infer<typeof askFileRefSchema>;
404
+ /** The `content` of an accepted `files` answer: the files the user sent, in the order they chose. */
405
+ export declare const filesAnswerSchema: z.ZodObject<{
406
+ files: z.ZodArray<z.ZodObject<{
407
+ fileId: z.ZodOptional<z.ZodString>;
408
+ filename: z.ZodString;
409
+ mimeType: z.ZodString;
410
+ size: z.ZodNumber;
411
+ url: z.ZodOptional<z.ZodString>;
412
+ }, z.core.$strict>>;
413
+ }, z.core.$strict>;
414
+ export type FilesAnswer = z.infer<typeof filesAnswerSchema>;
415
+ /** The `content` of an accepted `choice` answer. */
416
+ export declare const choiceAnswerSchema: z.ZodObject<{
417
+ other: z.ZodOptional<z.ZodString>;
418
+ selected: z.ZodArray<z.ZodString>;
419
+ }, z.core.$strict>;
420
+ export type ChoiceAnswer = z.infer<typeof choiceAnswerSchema>;
421
+ export declare const askAcceptResponseSchema: z.ZodObject<{
422
+ action: z.ZodLiteral<"accept">;
423
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
424
+ }, z.core.$strict>;
425
+ export declare const askDeclineResponseSchema: z.ZodObject<{
426
+ action: z.ZodLiteral<"decline">;
427
+ }, z.core.$strict>;
428
+ export declare const askCancelResponseSchema: z.ZodObject<{
429
+ action: z.ZodLiteral<"cancel">;
430
+ reason: z.ZodOptional<z.ZodString>;
431
+ }, z.core.$strict>;
432
+ /**
433
+ * The answer envelope for every ask (the MCP elicitation shape). `accept` carries the kind's
434
+ * answer in `content`; `decline` means the user pressed Skip; `cancel` means the ask was dropped.
435
+ */
436
+ export declare const askResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
437
+ action: z.ZodLiteral<"accept">;
438
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
439
+ }, z.core.$strict>, z.ZodObject<{
440
+ action: z.ZodLiteral<"decline">;
441
+ }, z.core.$strict>, z.ZodObject<{
442
+ action: z.ZodLiteral<"cancel">;
443
+ reason: z.ZodOptional<z.ZodString>;
444
+ }, z.core.$strict>], "action">;
445
+ export type AskResponse = z.infer<typeof askResponseSchema>;
446
+ /** The answer envelope for `ask_choice`, with `content` typed. Used as the tool's output schema. */
447
+ export declare const choiceAskResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
448
+ action: z.ZodLiteral<"accept">;
449
+ content: z.ZodObject<{
450
+ other: z.ZodOptional<z.ZodString>;
451
+ selected: z.ZodArray<z.ZodString>;
452
+ }, z.core.$strict>;
453
+ }, z.core.$strict>, z.ZodObject<{
454
+ action: z.ZodLiteral<"decline">;
455
+ }, z.core.$strict>, z.ZodObject<{
456
+ action: z.ZodLiteral<"cancel">;
457
+ reason: z.ZodOptional<z.ZodString>;
458
+ }, z.core.$strict>], "action">;
459
+ export type ChoiceAskResponse = z.infer<typeof choiceAskResponseSchema>;
460
+ /** The `content` of an accepted `confirm` answer: true approves the action, false denies it. */
461
+ export declare const confirmAnswerSchema: z.ZodObject<{
462
+ confirmed: z.ZodBoolean;
463
+ }, z.core.$strict>;
464
+ export type ConfirmAnswer = z.infer<typeof confirmAnswerSchema>;
465
+ /** The answer envelope for `ask_confirm`, with `content` typed. Used as the tool's output schema. */
466
+ export declare const confirmAskResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
467
+ action: z.ZodLiteral<"accept">;
468
+ content: z.ZodObject<{
469
+ confirmed: z.ZodBoolean;
470
+ }, z.core.$strict>;
471
+ }, z.core.$strict>, z.ZodObject<{
472
+ action: z.ZodLiteral<"decline">;
473
+ }, z.core.$strict>, z.ZodObject<{
474
+ action: z.ZodLiteral<"cancel">;
475
+ reason: z.ZodOptional<z.ZodString>;
476
+ }, z.core.$strict>], "action">;
477
+ export type ConfirmAskResponse = z.infer<typeof confirmAskResponseSchema>;
478
+ /**
479
+ * The `content` of an accepted `markdown` answer: the text the user sends back, and whether it
480
+ * differs from the ask's `initial` draft.
481
+ */
482
+ export declare const markdownAnswerSchema: z.ZodObject<{
483
+ changed: z.ZodBoolean;
484
+ markdown: z.ZodString;
485
+ }, z.core.$strict>;
486
+ export type MarkdownAnswer = z.infer<typeof markdownAnswerSchema>;
487
+ /** The answer envelope for `ask_markdown`, with `content` typed. Used as the tool's output schema. */
488
+ export declare const markdownAskResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
489
+ action: z.ZodLiteral<"accept">;
490
+ content: z.ZodObject<{
491
+ changed: z.ZodBoolean;
492
+ markdown: z.ZodString;
493
+ }, z.core.$strict>;
494
+ }, z.core.$strict>, z.ZodObject<{
495
+ action: z.ZodLiteral<"decline">;
496
+ }, z.core.$strict>, z.ZodObject<{
497
+ action: z.ZodLiteral<"cancel">;
498
+ reason: z.ZodOptional<z.ZodString>;
499
+ }, z.core.$strict>], "action">;
500
+ export type MarkdownAskResponse = z.infer<typeof markdownAskResponseSchema>;
501
+ /** The answer envelope for `ask_form`, with `content` typed. Used as the tool's output schema. */
502
+ export declare const formAskResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
503
+ action: z.ZodLiteral<"accept">;
504
+ content: z.ZodObject<{
505
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
506
+ }, z.core.$strict>;
507
+ }, z.core.$strict>, z.ZodObject<{
508
+ action: z.ZodLiteral<"decline">;
509
+ }, z.core.$strict>, z.ZodObject<{
510
+ action: z.ZodLiteral<"cancel">;
511
+ reason: z.ZodOptional<z.ZodString>;
512
+ }, z.core.$strict>], "action">;
513
+ export type FormAskResponse = z.infer<typeof formAskResponseSchema>;
514
+ /** The answer envelope for `ask_files`, with `content` typed. Used as the tool's output schema. */
515
+ export declare const filesAskResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
516
+ action: z.ZodLiteral<"accept">;
517
+ content: z.ZodObject<{
518
+ files: z.ZodArray<z.ZodObject<{
519
+ fileId: z.ZodOptional<z.ZodString>;
520
+ filename: z.ZodString;
521
+ mimeType: z.ZodString;
522
+ size: z.ZodNumber;
523
+ url: z.ZodOptional<z.ZodString>;
524
+ }, z.core.$strict>>;
525
+ }, z.core.$strict>;
526
+ }, z.core.$strict>, z.ZodObject<{
527
+ action: z.ZodLiteral<"decline">;
528
+ }, z.core.$strict>, z.ZodObject<{
529
+ action: z.ZodLiteral<"cancel">;
530
+ reason: z.ZodOptional<z.ZodString>;
531
+ }, z.core.$strict>], "action">;
532
+ export type FilesAskResponse = z.infer<typeof filesAskResponseSchema>;
533
+ /** Input schemas by kind. */
534
+ export declare const askInputSchemas: {
535
+ readonly choice: z.ZodObject<{
536
+ allowOther: z.ZodOptional<z.ZodBoolean>;
537
+ maxSelected: z.ZodOptional<z.ZodNumber>;
538
+ minSelected: z.ZodOptional<z.ZodNumber>;
539
+ otherLabel: z.ZodOptional<z.ZodString>;
540
+ select: z.ZodEnum<{
541
+ one: "one";
542
+ many: "many";
543
+ }>;
544
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
545
+ options: z.ZodArray<z.ZodObject<{
546
+ description: z.ZodOptional<z.ZodString>;
547
+ id: z.ZodString;
548
+ label: z.ZodString;
549
+ }, z.core.$strict>>;
550
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
551
+ prompt: z.ZodString;
552
+ submitLabel: z.ZodOptional<z.ZodString>;
553
+ title: z.ZodOptional<z.ZodString>;
554
+ }, z.core.$strict>;
555
+ readonly confirm: z.ZodObject<{
556
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
557
+ confirmLabel: z.ZodOptional<z.ZodString>;
558
+ denyLabel: z.ZodOptional<z.ZodString>;
559
+ destructive: z.ZodOptional<z.ZodBoolean>;
560
+ prompt: z.ZodString;
561
+ title: z.ZodOptional<z.ZodString>;
562
+ }, z.core.$strict>;
563
+ readonly files: z.ZodObject<{
564
+ accept: z.ZodArray<z.ZodEnum<{
565
+ text: "text";
566
+ image: "image";
567
+ pdf: "pdf";
568
+ csv: "csv";
569
+ json: "json";
570
+ }>>;
571
+ maxFiles: z.ZodOptional<z.ZodNumber>;
572
+ minFiles: z.ZodOptional<z.ZodNumber>;
573
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
574
+ prompt: z.ZodString;
575
+ submitLabel: z.ZodOptional<z.ZodString>;
576
+ title: z.ZodOptional<z.ZodString>;
577
+ }, z.core.$strict>;
578
+ readonly form: z.ZodObject<{
579
+ fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
580
+ default: z.ZodOptional<z.ZodString>;
581
+ maxLength: z.ZodOptional<z.ZodNumber>;
582
+ minLength: z.ZodOptional<z.ZodNumber>;
583
+ helperText: z.ZodOptional<z.ZodString>;
584
+ id: z.ZodString;
585
+ label: z.ZodString;
586
+ required: z.ZodOptional<z.ZodBoolean>;
587
+ type: z.ZodLiteral<"text">;
588
+ }, z.core.$strict>, z.ZodObject<{
589
+ default: z.ZodOptional<z.ZodString>;
590
+ maxLength: z.ZodOptional<z.ZodNumber>;
591
+ minLength: z.ZodOptional<z.ZodNumber>;
592
+ helperText: z.ZodOptional<z.ZodString>;
593
+ id: z.ZodString;
594
+ label: z.ZodString;
595
+ required: z.ZodOptional<z.ZodBoolean>;
596
+ type: z.ZodLiteral<"textarea">;
597
+ }, z.core.$strict>, z.ZodObject<{
598
+ default: z.ZodOptional<z.ZodString>;
599
+ helperText: z.ZodOptional<z.ZodString>;
600
+ id: z.ZodString;
601
+ label: z.ZodString;
602
+ required: z.ZodOptional<z.ZodBoolean>;
603
+ type: z.ZodLiteral<"email">;
604
+ }, z.core.$strict>, z.ZodObject<{
605
+ default: z.ZodOptional<z.ZodString>;
606
+ helperText: z.ZodOptional<z.ZodString>;
607
+ id: z.ZodString;
608
+ label: z.ZodString;
609
+ required: z.ZodOptional<z.ZodBoolean>;
610
+ type: z.ZodLiteral<"url">;
611
+ }, z.core.$strict>, z.ZodObject<{
612
+ default: z.ZodOptional<z.ZodString>;
613
+ helperText: z.ZodOptional<z.ZodString>;
614
+ id: z.ZodString;
615
+ label: z.ZodString;
616
+ required: z.ZodOptional<z.ZodBoolean>;
617
+ type: z.ZodLiteral<"phone">;
618
+ }, z.core.$strict>, z.ZodObject<{
619
+ default: z.ZodOptional<z.ZodNumber>;
620
+ integer: z.ZodOptional<z.ZodBoolean>;
621
+ max: z.ZodOptional<z.ZodNumber>;
622
+ min: z.ZodOptional<z.ZodNumber>;
623
+ helperText: z.ZodOptional<z.ZodString>;
624
+ id: z.ZodString;
625
+ label: z.ZodString;
626
+ required: z.ZodOptional<z.ZodBoolean>;
627
+ type: z.ZodLiteral<"number">;
628
+ }, z.core.$strict>, z.ZodObject<{
629
+ default: z.ZodOptional<z.ZodString>;
630
+ helperText: z.ZodOptional<z.ZodString>;
631
+ id: z.ZodString;
632
+ label: z.ZodString;
633
+ required: z.ZodOptional<z.ZodBoolean>;
634
+ type: z.ZodLiteral<"date">;
635
+ }, z.core.$strict>, z.ZodObject<{
636
+ default: z.ZodOptional<z.ZodString>;
637
+ helperText: z.ZodOptional<z.ZodString>;
638
+ id: z.ZodString;
639
+ label: z.ZodString;
640
+ required: z.ZodOptional<z.ZodBoolean>;
641
+ type: z.ZodLiteral<"time">;
642
+ }, z.core.$strict>, z.ZodObject<{
643
+ default: z.ZodOptional<z.ZodString>;
644
+ helperText: z.ZodOptional<z.ZodString>;
645
+ id: z.ZodString;
646
+ label: z.ZodString;
647
+ required: z.ZodOptional<z.ZodBoolean>;
648
+ type: z.ZodLiteral<"datetime">;
649
+ }, z.core.$strict>, z.ZodObject<{
650
+ default: z.ZodOptional<z.ZodBoolean>;
651
+ helperText: z.ZodOptional<z.ZodString>;
652
+ id: z.ZodString;
653
+ label: z.ZodString;
654
+ required: z.ZodOptional<z.ZodBoolean>;
655
+ type: z.ZodLiteral<"boolean">;
656
+ }, z.core.$strict>, z.ZodObject<{
657
+ default: z.ZodOptional<z.ZodString>;
658
+ options: z.ZodArray<z.ZodObject<{
659
+ id: z.ZodString;
660
+ label: z.ZodString;
661
+ }, z.core.$strict>>;
662
+ helperText: z.ZodOptional<z.ZodString>;
663
+ id: z.ZodString;
664
+ label: z.ZodString;
665
+ required: z.ZodOptional<z.ZodBoolean>;
666
+ type: z.ZodLiteral<"select">;
667
+ }, z.core.$strict>, z.ZodObject<{
668
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
669
+ options: z.ZodArray<z.ZodObject<{
670
+ id: z.ZodString;
671
+ label: z.ZodString;
672
+ }, z.core.$strict>>;
673
+ helperText: z.ZodOptional<z.ZodString>;
674
+ id: z.ZodString;
675
+ label: z.ZodString;
676
+ required: z.ZodOptional<z.ZodBoolean>;
677
+ type: z.ZodLiteral<"multiselect">;
678
+ }, z.core.$strict>], "type">>;
679
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
680
+ prompt: z.ZodString;
681
+ submitLabel: z.ZodOptional<z.ZodString>;
682
+ title: z.ZodOptional<z.ZodString>;
683
+ }, z.core.$strict>;
684
+ readonly markdown: z.ZodObject<{
685
+ initial: z.ZodOptional<z.ZodString>;
686
+ maxLength: z.ZodOptional<z.ZodNumber>;
687
+ minLength: z.ZodOptional<z.ZodNumber>;
688
+ placeholder: z.ZodOptional<z.ZodString>;
689
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
690
+ prompt: z.ZodString;
691
+ submitLabel: z.ZodOptional<z.ZodString>;
692
+ title: z.ZodOptional<z.ZodString>;
693
+ }, z.core.$strict>;
694
+ };
695
+ /** Input schemas by kind on the compact surface. Every compact input is also a valid full input. */
696
+ export declare const compactAskInputSchemas: {
697
+ readonly choice: z.ZodObject<{
698
+ select: z.ZodLiteral<"one">;
699
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
700
+ options: z.ZodArray<z.ZodObject<{
701
+ description: z.ZodOptional<z.ZodString>;
702
+ id: z.ZodString;
703
+ label: z.ZodString;
704
+ }, z.core.$strict>>;
705
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
706
+ prompt: z.ZodString;
707
+ submitLabel: z.ZodOptional<z.ZodString>;
708
+ title: z.ZodOptional<z.ZodString>;
709
+ }, z.core.$strict>;
710
+ readonly confirm: z.ZodObject<{
711
+ allowDecline: z.ZodOptional<z.ZodBoolean>;
712
+ confirmLabel: z.ZodOptional<z.ZodString>;
713
+ denyLabel: z.ZodOptional<z.ZodString>;
714
+ destructive: z.ZodOptional<z.ZodBoolean>;
715
+ prompt: z.ZodString;
716
+ title: z.ZodOptional<z.ZodString>;
717
+ }, z.core.$strict>;
718
+ };
719
+ export declare const isCompactAskKind: (kind: AskKind) => kind is CompactAskKind;
720
+ /** The kinds a surface offers, in the given order. The compact surface drops kinds it cannot show. */
721
+ export declare const askKindsForSurface: ({ kinds, surface, }: {
722
+ kinds: readonly AskKind[];
723
+ surface: AskSurface;
724
+ }) => AskKind[];
725
+ /**
726
+ * The input schema for a kind on a surface. Throws for an unknown kind or surface, and when the
727
+ * compact surface does not offer the kind.
728
+ */
729
+ export declare const askInputSchemaFor: ({ kind, surface, }: {
730
+ kind: AskKind;
731
+ surface?: AskSurface;
732
+ }) => (typeof askInputSchemas)[AskKind] | (typeof compactAskInputSchemas)[CompactAskKind];
733
+ /** Output (answer envelope) schemas by kind. */
734
+ export declare const askOutputSchemas: {
735
+ readonly choice: z.ZodDiscriminatedUnion<[z.ZodObject<{
736
+ action: z.ZodLiteral<"accept">;
737
+ content: z.ZodObject<{
738
+ other: z.ZodOptional<z.ZodString>;
739
+ selected: z.ZodArray<z.ZodString>;
740
+ }, z.core.$strict>;
741
+ }, z.core.$strict>, z.ZodObject<{
742
+ action: z.ZodLiteral<"decline">;
743
+ }, z.core.$strict>, z.ZodObject<{
744
+ action: z.ZodLiteral<"cancel">;
745
+ reason: z.ZodOptional<z.ZodString>;
746
+ }, z.core.$strict>], "action">;
747
+ readonly confirm: z.ZodDiscriminatedUnion<[z.ZodObject<{
748
+ action: z.ZodLiteral<"accept">;
749
+ content: z.ZodObject<{
750
+ confirmed: z.ZodBoolean;
751
+ }, z.core.$strict>;
752
+ }, z.core.$strict>, z.ZodObject<{
753
+ action: z.ZodLiteral<"decline">;
754
+ }, z.core.$strict>, z.ZodObject<{
755
+ action: z.ZodLiteral<"cancel">;
756
+ reason: z.ZodOptional<z.ZodString>;
757
+ }, z.core.$strict>], "action">;
758
+ readonly files: z.ZodDiscriminatedUnion<[z.ZodObject<{
759
+ action: z.ZodLiteral<"accept">;
760
+ content: z.ZodObject<{
761
+ files: z.ZodArray<z.ZodObject<{
762
+ fileId: z.ZodOptional<z.ZodString>;
763
+ filename: z.ZodString;
764
+ mimeType: z.ZodString;
765
+ size: z.ZodNumber;
766
+ url: z.ZodOptional<z.ZodString>;
767
+ }, z.core.$strict>>;
768
+ }, z.core.$strict>;
769
+ }, z.core.$strict>, z.ZodObject<{
770
+ action: z.ZodLiteral<"decline">;
771
+ }, z.core.$strict>, z.ZodObject<{
772
+ action: z.ZodLiteral<"cancel">;
773
+ reason: z.ZodOptional<z.ZodString>;
774
+ }, z.core.$strict>], "action">;
775
+ readonly form: z.ZodDiscriminatedUnion<[z.ZodObject<{
776
+ action: z.ZodLiteral<"accept">;
777
+ content: z.ZodObject<{
778
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
779
+ }, z.core.$strict>;
780
+ }, z.core.$strict>, z.ZodObject<{
781
+ action: z.ZodLiteral<"decline">;
782
+ }, z.core.$strict>, z.ZodObject<{
783
+ action: z.ZodLiteral<"cancel">;
784
+ reason: z.ZodOptional<z.ZodString>;
785
+ }, z.core.$strict>], "action">;
786
+ readonly markdown: z.ZodDiscriminatedUnion<[z.ZodObject<{
787
+ action: z.ZodLiteral<"accept">;
788
+ content: z.ZodObject<{
789
+ changed: z.ZodBoolean;
790
+ markdown: z.ZodString;
791
+ }, z.core.$strict>;
792
+ }, z.core.$strict>, z.ZodObject<{
793
+ action: z.ZodLiteral<"decline">;
794
+ }, z.core.$strict>, z.ZodObject<{
795
+ action: z.ZodLiteral<"cancel">;
796
+ reason: z.ZodOptional<z.ZodString>;
797
+ }, z.core.$strict>], "action">;
798
+ };
799
+ export interface ChoiceAsk {
800
+ input: ChoiceAskInput;
801
+ kind: "choice";
802
+ }
803
+ export interface ConfirmAsk {
804
+ input: ConfirmAskInput;
805
+ kind: "confirm";
806
+ }
807
+ export interface MarkdownAsk {
808
+ input: MarkdownAskInput;
809
+ kind: "markdown";
810
+ }
811
+ export interface FormAsk {
812
+ input: FormAskInput;
813
+ kind: "form";
814
+ }
815
+ export interface FilesAsk {
816
+ input: FilesAskInput;
817
+ kind: "files";
818
+ }
819
+ /** A validated ask: its kind and its input. */
820
+ export type Ask = ChoiceAsk | ConfirmAsk | MarkdownAsk | FormAsk | FilesAsk;
821
+ /**
822
+ * Whether the user may skip the ask. `allowDecline` defaults to true, except on `confirm`, where
823
+ * deny is already the negative answer.
824
+ */
825
+ export declare const askAllowsDecline: ({ input, kind }: Ask) => boolean;
826
+ export {};