monday-cli 0.4.0 → 0.6.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 (154) hide show
  1. package/CHANGELOG.md +645 -0
  2. package/README.md +173 -34
  3. package/dist/api/column-types.d.ts +48 -17
  4. package/dist/api/column-types.d.ts.map +1 -1
  5. package/dist/api/column-types.js +25 -9
  6. package/dist/api/column-types.js.map +1 -1
  7. package/dist/api/column-values.d.ts +17 -9
  8. package/dist/api/column-values.d.ts.map +1 -1
  9. package/dist/api/column-values.js +33 -18
  10. package/dist/api/column-values.js.map +1 -1
  11. package/dist/api/documents.d.ts +1136 -3
  12. package/dist/api/documents.d.ts.map +1 -1
  13. package/dist/api/documents.js +1828 -3
  14. package/dist/api/documents.js.map +1 -1
  15. package/dist/api/file-column-set.d.ts +507 -0
  16. package/dist/api/file-column-set.d.ts.map +1 -0
  17. package/dist/api/file-column-set.js +510 -0
  18. package/dist/api/file-column-set.js.map +1 -0
  19. package/dist/api/raw-write.d.ts +27 -16
  20. package/dist/api/raw-write.d.ts.map +1 -1
  21. package/dist/api/raw-write.js +40 -24
  22. package/dist/api/raw-write.js.map +1 -1
  23. package/dist/api/resolver-error-fold.d.ts +25 -0
  24. package/dist/api/resolver-error-fold.d.ts.map +1 -1
  25. package/dist/api/resolver-error-fold.js +56 -0
  26. package/dist/api/resolver-error-fold.js.map +1 -1
  27. package/dist/api/teams.d.ts +657 -0
  28. package/dist/api/teams.d.ts.map +1 -0
  29. package/dist/api/teams.js +880 -0
  30. package/dist/api/teams.js.map +1 -0
  31. package/dist/commands/board/column-create.d.ts +8 -3
  32. package/dist/commands/board/column-create.d.ts.map +1 -1
  33. package/dist/commands/board/column-create.js +16 -8
  34. package/dist/commands/board/column-create.js.map +1 -1
  35. package/dist/commands/doc/append-markdown.d.ts +117 -0
  36. package/dist/commands/doc/append-markdown.d.ts.map +1 -0
  37. package/dist/commands/doc/append-markdown.js +253 -0
  38. package/dist/commands/doc/append-markdown.js.map +1 -0
  39. package/dist/commands/doc/block-create.d.ts +114 -0
  40. package/dist/commands/doc/block-create.d.ts.map +1 -0
  41. package/dist/commands/doc/block-create.js +206 -0
  42. package/dist/commands/doc/block-create.js.map +1 -0
  43. package/dist/commands/doc/block-delete.d.ts +72 -0
  44. package/dist/commands/doc/block-delete.d.ts.map +1 -0
  45. package/dist/commands/doc/block-delete.js +161 -0
  46. package/dist/commands/doc/block-delete.js.map +1 -0
  47. package/dist/commands/doc/block-update.d.ts +75 -0
  48. package/dist/commands/doc/block-update.d.ts.map +1 -0
  49. package/dist/commands/doc/block-update.js +162 -0
  50. package/dist/commands/doc/block-update.js.map +1 -0
  51. package/dist/commands/doc/create-in-workspace.d.ts +76 -0
  52. package/dist/commands/doc/create-in-workspace.d.ts.map +1 -0
  53. package/dist/commands/doc/create-in-workspace.js +164 -0
  54. package/dist/commands/doc/create-in-workspace.js.map +1 -0
  55. package/dist/commands/doc/create-on-column.d.ts +71 -0
  56. package/dist/commands/doc/create-on-column.d.ts.map +1 -0
  57. package/dist/commands/doc/create-on-column.js +146 -0
  58. package/dist/commands/doc/create-on-column.js.map +1 -0
  59. package/dist/commands/doc/delete.d.ts +68 -0
  60. package/dist/commands/doc/delete.d.ts.map +1 -0
  61. package/dist/commands/doc/delete.js +146 -0
  62. package/dist/commands/doc/delete.js.map +1 -0
  63. package/dist/commands/doc/duplicate.d.ts +101 -0
  64. package/dist/commands/doc/duplicate.d.ts.map +1 -0
  65. package/dist/commands/doc/duplicate.js +191 -0
  66. package/dist/commands/doc/duplicate.js.map +1 -0
  67. package/dist/commands/doc/import-html.d.ts +125 -0
  68. package/dist/commands/doc/import-html.d.ts.map +1 -0
  69. package/dist/commands/doc/import-html.js +273 -0
  70. package/dist/commands/doc/import-html.js.map +1 -0
  71. package/dist/commands/doc/list.d.ts +6 -3
  72. package/dist/commands/doc/list.d.ts.map +1 -1
  73. package/dist/commands/doc/list.js +17 -48
  74. package/dist/commands/doc/list.js.map +1 -1
  75. package/dist/commands/doc/rename.d.ts +60 -0
  76. package/dist/commands/doc/rename.d.ts.map +1 -0
  77. package/dist/commands/doc/rename.js +135 -0
  78. package/dist/commands/doc/rename.js.map +1 -0
  79. package/dist/commands/index.d.ts.map +1 -1
  80. package/dist/commands/index.js +116 -0
  81. package/dist/commands/index.js.map +1 -1
  82. package/dist/commands/item/create.d.ts.map +1 -1
  83. package/dist/commands/item/create.js +131 -33
  84. package/dist/commands/item/create.js.map +1 -1
  85. package/dist/commands/item/set.d.ts +33 -3
  86. package/dist/commands/item/set.d.ts.map +1 -1
  87. package/dist/commands/item/set.js +193 -15
  88. package/dist/commands/item/set.js.map +1 -1
  89. package/dist/commands/item/update.d.ts +34 -3
  90. package/dist/commands/item/update.d.ts.map +1 -1
  91. package/dist/commands/item/update.js +346 -67
  92. package/dist/commands/item/update.js.map +1 -1
  93. package/dist/commands/item/upload.d.ts.map +1 -1
  94. package/dist/commands/item/upload.js +16 -69
  95. package/dist/commands/item/upload.js.map +1 -1
  96. package/dist/commands/update/create.d.ts.map +1 -1
  97. package/dist/commands/update/create.js +6 -4
  98. package/dist/commands/update/create.js.map +1 -1
  99. package/dist/commands/update/edit.d.ts +4 -2
  100. package/dist/commands/update/edit.d.ts.map +1 -1
  101. package/dist/commands/update/edit.js +10 -6
  102. package/dist/commands/update/edit.js.map +1 -1
  103. package/dist/commands/update/reply.d.ts +4 -2
  104. package/dist/commands/update/reply.d.ts.map +1 -1
  105. package/dist/commands/update/reply.js +10 -6
  106. package/dist/commands/update/reply.js.map +1 -1
  107. package/dist/commands/update/upload.d.ts.map +1 -1
  108. package/dist/commands/update/upload.js +9 -59
  109. package/dist/commands/update/upload.js.map +1 -1
  110. package/dist/commands/user/_team-membership.d.ts +10 -0
  111. package/dist/commands/user/_team-membership.d.ts.map +1 -0
  112. package/dist/commands/user/_team-membership.js +88 -0
  113. package/dist/commands/user/_team-membership.js.map +1 -0
  114. package/dist/commands/user/team-add-members.d.ts +81 -0
  115. package/dist/commands/user/team-add-members.d.ts.map +1 -0
  116. package/dist/commands/user/team-add-members.js +186 -0
  117. package/dist/commands/user/team-add-members.js.map +1 -0
  118. package/dist/commands/user/team-create.d.ts +82 -0
  119. package/dist/commands/user/team-create.d.ts.map +1 -0
  120. package/dist/commands/user/team-create.js +206 -0
  121. package/dist/commands/user/team-create.js.map +1 -0
  122. package/dist/commands/user/team-delete.d.ts +56 -0
  123. package/dist/commands/user/team-delete.d.ts.map +1 -0
  124. package/dist/commands/user/team-delete.js +137 -0
  125. package/dist/commands/user/team-delete.js.map +1 -0
  126. package/dist/commands/user/team-get.d.ts +41 -0
  127. package/dist/commands/user/team-get.d.ts.map +1 -0
  128. package/dist/commands/user/team-get.js +87 -0
  129. package/dist/commands/user/team-get.js.map +1 -0
  130. package/dist/commands/user/team-list.d.ts +39 -0
  131. package/dist/commands/user/team-list.d.ts.map +1 -0
  132. package/dist/commands/user/team-list.js +90 -0
  133. package/dist/commands/user/team-list.js.map +1 -0
  134. package/dist/commands/user/team-remove-members.d.ts +71 -0
  135. package/dist/commands/user/team-remove-members.d.ts.map +1 -0
  136. package/dist/commands/user/team-remove-members.js +176 -0
  137. package/dist/commands/user/team-remove-members.js.map +1 -0
  138. package/dist/types/ids.d.ts +6 -0
  139. package/dist/types/ids.d.ts.map +1 -1
  140. package/dist/types/ids.js +46 -5
  141. package/dist/types/ids.js.map +1 -1
  142. package/dist/utils/file-source.d.ts +93 -0
  143. package/dist/utils/file-source.d.ts.map +1 -0
  144. package/dist/utils/file-source.js +140 -0
  145. package/dist/utils/file-source.js.map +1 -0
  146. package/dist/utils/parse-brand-list.d.ts +95 -0
  147. package/dist/utils/parse-brand-list.d.ts.map +1 -0
  148. package/dist/utils/parse-brand-list.js +96 -0
  149. package/dist/utils/parse-brand-list.js.map +1 -0
  150. package/dist/utils/source-content.d.ts +93 -0
  151. package/dist/utils/source-content.d.ts.map +1 -0
  152. package/dist/utils/source-content.js +120 -0
  153. package/dist/utils/source-content.js.map +1 -0
  154. package/package.json +1 -1
@@ -1,7 +1,11 @@
1
1
  /**
2
- * Workdocs read surface for the v0.4-M32 `monday doc list/get` verbs
3
- * (`cli-design.md` §2.7 + §4.3 + §13 v0.4 entry; `v0.4-plan.md` §3
4
- * M32).
2
+ * Workdocs read + mutation surface for the v0.4-M32 `monday doc
3
+ * list/get` verbs, the v0.5-M35 doc-level CRUD verbs, the v0.5-M36
4
+ * per-block CRUD verbs, and the v0.5-M37 doc-content import verbs
5
+ * (`cli-design.md` §2.7 + §4.3 + §13 v0.4/v0.5 entries;
6
+ * `v0.4-plan.md` §3 M32; `v0.5-plan.md` §3 M35 + §8 D7-D9;
7
+ * `v0.5-plan.md` §3 M36 + §8 D10-D11; `v0.5-plan.md` §3 M37 + §8
8
+ * D12-D13).
5
9
  *
6
10
  * **Wire surface (empirical probe 2026-05-14, API `2026-01`).** Two
7
11
  * Monday GraphQL operations land here, both against `Query.docs(...)`:
@@ -105,6 +109,158 @@
105
109
  * `details.issues`. The `doc get` empty-array case rewraps to
106
110
  * `not_found` with `details.doc_id` per D8 (Monday's wire collapses
107
111
  * "doesn't exist" + "not visible to token" into the same shape).
112
+ *
113
+ * **v0.5-M35 mutation surface (empirical probe 2026-05-15, API
114
+ * `2026-01`; v0.5 kickoff rounds 1-3).** Five CLI verbs land here
115
+ * at v0.5-M35, backed by four Monday GraphQL mutations —
116
+ * `create_doc` (2 CLI verbs because Monday's `CreateDocInput` is
117
+ * mutually-exclusive `board` vs `workspace` per D7) +
118
+ * `update_doc_name` + `delete_doc` + `duplicate_doc`. All four
119
+ * wire mutations are synchronous on Monday's wire — the v0.4-W1
120
+ * `dispatchPollingLoop` watch-item DOES NOT fire here.
121
+ *
122
+ * - **Create-in-workspace variant** — `create_doc(location:
123
+ * CreateDocInput!) → Document` with `location: { workspace:
124
+ * CreateDocWorkspaceInput { workspace_id!, name!, kind?:
125
+ * BoardKind, folder_id? } }`. CLI envelope OMITS the wire's
126
+ * `blocks` slot entirely (the base 13-field
127
+ * {@link documentSchema} M32 pin is the create projection).
128
+ * Monday returns `blocks: null` on a fresh create — agents
129
+ * needing block hydration (rare on a fresh create — usually
130
+ * the next step is content authoring) call `monday doc get
131
+ * <new-doc-id>` per the M32 read cadence.
132
+ * - **Create-on-column variant** — `create_doc(location:
133
+ * CreateDocInput!) → Document` with `location: { board:
134
+ * CreateDocBoardInput { column_id!, item_id! } }`.
135
+ * - **Rename variant** — `update_doc_name(docId: ID!,
136
+ * name: String!) → JSON` (opaque scalar). Returns wire-side
137
+ * opaque payload; the CLI projects to flat `{ doc_id: <input>,
138
+ * success: true }` envelope at the fetcher boundary per D9.
139
+ * The agent contract is the projected envelope shape, NOT the
140
+ * opaque Monday return value.
141
+ * - **Delete variant** — `delete_doc(docId: ID!) → JSON`
142
+ * (opaque). Same `{ doc_id, success }` projection per D9.
143
+ * Destructive gate per cli-design §3.1 (M35 verb requires
144
+ * `--yes`).
145
+ * - **Duplicate variant** — `duplicate_doc(docId: ID!,
146
+ * duplicateType?: DuplicateType) → JSON` (opaque). Same
147
+ * `{ doc_id, success }` projection per D9. `--with-updates`
148
+ * argv flag flips wire `duplicateType` from
149
+ * `duplicate_doc_with_content` (default) to
150
+ * `duplicate_doc_with_content_and_updates`. **No `--name <n>`
151
+ * rename slot per D8** — Monday's `duplicate_doc` mutation
152
+ * carries no name-override arg on the wire, so the CLI defers
153
+ * the rename-on-duplicate UX (an agent that needs a renamed
154
+ * duplicate pairs the verb with a follow-up `monday doc
155
+ * rename <new-id> --name <n>` call).
156
+ *
157
+ * **`CreateDocInput` is mutually-exclusive on Monday's wire.**
158
+ * Per Finding 6 + round-3 nested-inputs probe, supplying both
159
+ * `board` AND `workspace` slots fails server-side. The CLI's
160
+ * two-verb split (`monday doc create-in-workspace` vs `monday doc
161
+ * create-on-column`) flows the mutual-exclusion into the argv
162
+ * boundary — each verb's input schema declares the slot it
163
+ * supports, and there's no way to set both via the CLI surface.
164
+ * Single verb with `--workspace` / `--board` choosers was the
165
+ * D7 alternative; pre-flight ratified the two-verb shape per the
166
+ * agent-UX principle of "fewer ambiguous flags is clearer than
167
+ * one verb with mutually-exclusive choosers" (mirrors how the
168
+ * v0.4 cli-design ships separate `monday item upload` /
169
+ * `monday update upload` verbs for the same multipart wire path).
170
+ *
171
+ * **camelCase vs snake_case asymmetry across the doc-mutation
172
+ * surface (Finding 7).** Monday's `update_doc_name` /
173
+ * `delete_doc` / `duplicate_doc` mutations use **camelCase** arg
174
+ * names (`docId`, `duplicateType`) on the wire — distinct from
175
+ * the snake_case `doc_id` Monday uses for `Document` field names
176
+ * elsewhere on the schema. The fetcher boundary uses the wire's
177
+ * camelCase variable shape verbatim; the CLI argv stays kebab-case
178
+ * throughout (`--name <n>`, `--with-updates`); the error envelope
179
+ * `details.*` keys stay snake_case per cli-design §6.5 (e.g.
180
+ * `details.doc_id`). The asymmetry is wire-side and stays at the
181
+ * fetcher boundary; agents see camelCase nowhere. Cross-link to
182
+ * `docs/architecture.md` "Wire-vs-CLI semantics documentation
183
+ * conventions" — 4th supporting site for R-NEW-41 (camelCase vs
184
+ * snake_case arg-name asymmetry; R-v0.5-NEW-3 graduation candidate
185
+ * at v0.5-plan §22).
186
+ *
187
+ * **Opaque-JSON return shape (D9 closure).** 3 of 4 M35 mutations
188
+ * return Monday's `JSON` scalar — an untyped wire payload whose
189
+ * exact shape isn't pinned by introspection. The CLI projects to
190
+ * a flat `{ doc_id: string, success: true }` envelope at the
191
+ * fetcher boundary so agents read a uniform shape across rename /
192
+ * delete / duplicate; `success` is pinned literal-`true` because
193
+ * Monday surfaces failure via GraphQL `errors[]` (mapped to typed
194
+ * `ApiError`s upstream), not via a wire-side success flag.
195
+ *
196
+ * Per-fetcher null-payload semantics ARE asymmetric (round-1 P2-1
197
+ * closure):
198
+ *
199
+ * - **`renameDoc` (`update_doc_name`)** — present-but-null
200
+ * payload → success envelope. Monday's probe description
201
+ * carries NO "returns X" prose, so null is plausibly an
202
+ * empty-success indicator.
203
+ * - **`deleteDoc` (`delete_doc`)** — present-but-null payload
204
+ * → `not_found`. Probe description: "Returns success status
205
+ * and the deleted document ID" — null indicates the source
206
+ * doc was bogus or already-deleted.
207
+ * - **`duplicateDoc` (`duplicate_doc`)** — present-but-null
208
+ * payload → `not_found`. Probe description: "Returns the new
209
+ * document's ID on success" — null indicates the source
210
+ * wasn't duplicable.
211
+ *
212
+ * Missing-root-key cases for all three uniformly throw
213
+ * `internal_error` via `assertResponseFieldPresent` (schema
214
+ * drift). For `duplicate_doc`, the projected `doc_id` is the
215
+ * **NEWLY-CREATED doc's id** extracted from the opaque JSON via
216
+ * {@link extractDuplicateDocId} — defensive across multiple
217
+ * plausible wire shapes (bare string / number / record-with-`id`
218
+ * / `doc_id` / `new_doc_id`). Capturing a live duplicate-doc wire
219
+ * response would let a future revision narrow the helper's
220
+ * accepted shapes; today's helper is constructed against the
221
+ * read-only probe + Monday's wire description, not a live wire
222
+ * response.
223
+ *
224
+ * **No new ERROR_CODES at M35.** Existing codes route doc-mutation
225
+ * failures: `not_found` (rename/delete/duplicate against a
226
+ * non-existent or inaccessible doc), `usage_error` (argv-parse
227
+ * rejections — bad DocId, missing `--name`, unknown `--kind`),
228
+ * `validation_failed` (Monday-side rejection, e.g. workspace
229
+ * lacks doc-create permission), `forbidden`/`unauthorized` (token
230
+ * lacks workdoc write scope), `confirmation_required` (destructive
231
+ * gate on `doc delete` missing `--yes`).
232
+ *
233
+ * **Doc mutations are live-only at v0.5-M35.** Pure-mutation
234
+ * surfaces don't cache by definition (cli-design §8); `meta.source:
235
+ * "live"`. Dry-run paths emit `meta.source: "none"` per §6.4
236
+ * mutation-dry-run discipline.
237
+ *
238
+ * **Runtime bodies landed at v0.5-M35 IMPL.** All five fetchers
239
+ * issue a single `client.raw` round-trip with their pinned
240
+ * `operationName`; responses parse through the wrapping schemas
241
+ * via `unwrapOrThrow` + `assertResponseFieldPresent`, then either
242
+ * unwrap the per-Document payload (create variants) or project
243
+ * the opaque JSON return to the flat `{ doc_id, success: true }`
244
+ * envelope (rename / delete / duplicate per D9). The
245
+ * `duplicate_doc` projection extracts the new doc id from the
246
+ * opaque JSON via {@link extractDuplicateDocId} — defensive
247
+ * across common wire shapes (bare string, `{id}`, `{doc_id}`,
248
+ * `{new_doc_id}`); unrecognised shapes surface `internal_error`
249
+ * with a re-probe hint.
250
+ *
251
+ * **R-NEW-76 discipline preserved** across all 5 M35 command
252
+ * action bodies — `parseArgv` fires BEFORE `resolveClient` on
253
+ * every verb so invalid argv surfaces `usage_error` from the
254
+ * parse boundary, ahead of any `config_error` from a missing
255
+ * token. `doc delete` additionally calls `parseGlobalFlags` +
256
+ * `enforceDestructiveGate` BEFORE `resolveClient` (the gate
257
+ * needs the parsed global flags to check `--yes`; M10 round-1
258
+ * P2 invariant); the other four verbs let `resolveClient` parse
259
+ * global flags internally before `loadConfig` runs. M35 verbs
260
+ * do not consume comma-separated brand-list flags
261
+ * (`parseBrandedListArg` is an M34 team-writer / M32 `doc list
262
+ * --workspace` helper); the M35
263
+ * surface doesn't need it.
108
264
  */
109
265
  import { z } from 'zod';
110
266
  import type { MondayClient } from './client.js';
@@ -516,4 +672,981 @@ export interface GetDocumentResult {
516
672
  * loudly rather than silently dropping entries.
517
673
  */
518
674
  export declare const getDocument: (inputs: GetDocumentInputs) => Promise<GetDocumentResult>;
675
+ /**
676
+ * Monday's `DuplicateType` enum vocabulary (empirical probe 2026-05-15,
677
+ * API `2026-01`; 2 values). Pinned at M35 pre-flight as a closed
678
+ * literal-union so unknown values reject at the parse boundary with
679
+ * `usage_error`.
680
+ *
681
+ * - `duplicate_doc_with_content` — clone the doc body only; comments
682
+ * and update history are NOT copied. Wire-side default when
683
+ * `duplicateType` is omitted.
684
+ * - `duplicate_doc_with_content_and_updates` — clone the doc body
685
+ * AND every comment / update thread attached to the source doc.
686
+ * Picks up Monday's "full backup" duplicate semantics.
687
+ *
688
+ * Maps to the CLI's boolean `--with-updates` flag at the M35
689
+ * `monday doc duplicate` argv boundary: absent → wire default
690
+ * (`duplicate_doc_with_content`, content-only); present → wire
691
+ * `duplicate_doc_with_content_and_updates`. The two-value enum
692
+ * stays internal to the fetcher — agents see a boolean opt-in, not
693
+ * the wire enum name.
694
+ *
695
+ * Adding a third value to Monday's enum is a minor (additive) bump
696
+ * for the CLI — extend this list + the fetcher mapping; the
697
+ * boolean argv stays.
698
+ */
699
+ export declare const DUPLICATE_TYPE_VALUES: readonly ["duplicate_doc_with_content", "duplicate_doc_with_content_and_updates"];
700
+ export type DuplicateType = (typeof DUPLICATE_TYPE_VALUES)[number];
701
+ export declare const duplicateTypeSchema: z.ZodEnum<{
702
+ duplicate_doc_with_content: "duplicate_doc_with_content";
703
+ duplicate_doc_with_content_and_updates: "duplicate_doc_with_content_and_updates";
704
+ }>;
705
+ /**
706
+ * Projected envelope shape for the three opaque-JSON mutation
707
+ * results (`update_doc_name` / `delete_doc` / `duplicate_doc`).
708
+ * Per D9 closure, the CLI surfaces a flat `{ doc_id: string,
709
+ * success: true }` envelope so agents read a uniform shape across
710
+ * mutations — Monday's wire returns an opaque `JSON` scalar whose
711
+ * exact shape isn't pinned by introspection (the v0.5 doc-CRUD
712
+ * probe was read-only — no live mutation response was captured).
713
+ * The projection insulates agents from any wire-side shape drift;
714
+ * the runtime accepts plausible-defensive shapes today, and a
715
+ * future live wire response would narrow what the helper accepts.
716
+ *
717
+ * `success` is pinned to literal `true` because Monday surfaces
718
+ * failure via GraphQL `errors[]` (mapped to typed `ApiError`s at
719
+ * the transport layer); a JSON return that reaches this projection
720
+ * is by construction the success path. If Monday ever flips to a
721
+ * `success/error` result OBJECT shape for these mutations (mirroring
722
+ * `import_doc_from_html` / `add_content_to_doc_from_markdown` per
723
+ * Finding 6), the projection widens to a discriminated union — for
724
+ * today the literal-`true` form keeps the shape pinned.
725
+ *
726
+ * `doc_id` semantics differ per mutation:
727
+ *
728
+ * - `rename` / `delete` — echoes the input id (the operation
729
+ * targets that specific doc; success means it was renamed /
730
+ * deleted).
731
+ * - `duplicate` — emits the **NEWLY-CREATED** doc's id (Monday's
732
+ * `duplicate_doc` description: "Returns the new document's ID
733
+ * on success"; the fetcher extracts the new id from the
734
+ * opaque JSON via {@link extractDuplicateDocId}, which is
735
+ * defensive across plausible wire shapes today). The original
736
+ * source-doc id stays available via the argv positional.
737
+ */
738
+ export declare const docMutationResultSchema: z.ZodObject<{
739
+ doc_id: z.ZodString;
740
+ success: z.ZodLiteral<true>;
741
+ }, z.core.$strict>;
742
+ export type DocMutationResult = z.infer<typeof docMutationResultSchema>;
743
+ /**
744
+ * Output shape for `monday doc create-in-workspace --workspace
745
+ * <wid> --name <n> [--folder <fid>] [--kind public|private|share]`.
746
+ * Direct unwrap of the created Document — `data: <Document>` per
747
+ * cli-design §6.1 single-record convention. The envelope OMITS
748
+ * the `blocks` slot entirely (the base {@link documentSchema} M32
749
+ * pin is the 13-field projection without `blocks`).
750
+ *
751
+ * **Rationale for the omit.** Monday's wire returns
752
+ * `blocks: null` on a fresh `create_doc` because a freshly-
753
+ * created doc has no rich-text body yet (Monday hasn't
754
+ * materialised it). Surfacing a constant-null `blocks` slot on
755
+ * every create envelope would add agent-noise — every caller
756
+ * has to ignore it. Agents that need block hydration (rare on a
757
+ * fresh create — usually the next step is content authoring)
758
+ * call `monday doc get <new-doc-id>` per the M32 read cadence.
759
+ * The omit is a contract decision, not a schema-flexibility
760
+ * artifact.
761
+ */
762
+ export declare const docCreateInWorkspaceOutputSchema: z.ZodObject<{
763
+ id: z.ZodString;
764
+ object_id: z.ZodString;
765
+ name: z.ZodString;
766
+ doc_kind: z.ZodEnum<{
767
+ public: "public";
768
+ private: "private";
769
+ share: "share";
770
+ }>;
771
+ url: z.ZodNullable<z.ZodString>;
772
+ relative_url: z.ZodNullable<z.ZodString>;
773
+ workspace_id: z.ZodNullable<z.ZodString>;
774
+ workspace: z.ZodNullable<z.ZodObject<{
775
+ id: z.ZodString;
776
+ name: z.ZodString;
777
+ }, z.core.$strict>>;
778
+ doc_folder_id: z.ZodNullable<z.ZodString>;
779
+ created_at: z.ZodNullable<z.ZodString>;
780
+ created_by: z.ZodNullable<z.ZodObject<{
781
+ id: z.ZodString;
782
+ name: z.ZodString;
783
+ }, z.core.$strict>>;
784
+ updated_at: z.ZodNullable<z.ZodString>;
785
+ settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
786
+ }, z.core.$strict>;
787
+ export type DocCreateInWorkspaceOutput = Document;
788
+ /**
789
+ * Output shape for `monday doc create-on-column --item <iid>
790
+ * --column <cid>`. Same shape as
791
+ * {@link docCreateInWorkspaceOutputSchema} — Monday's wire returns
792
+ * the full Document regardless of placement; the two-verb split
793
+ * (per D7) lives at the argv layer, not the response shape.
794
+ */
795
+ export declare const docCreateOnColumnOutputSchema: z.ZodObject<{
796
+ id: z.ZodString;
797
+ object_id: z.ZodString;
798
+ name: z.ZodString;
799
+ doc_kind: z.ZodEnum<{
800
+ public: "public";
801
+ private: "private";
802
+ share: "share";
803
+ }>;
804
+ url: z.ZodNullable<z.ZodString>;
805
+ relative_url: z.ZodNullable<z.ZodString>;
806
+ workspace_id: z.ZodNullable<z.ZodString>;
807
+ workspace: z.ZodNullable<z.ZodObject<{
808
+ id: z.ZodString;
809
+ name: z.ZodString;
810
+ }, z.core.$strict>>;
811
+ doc_folder_id: z.ZodNullable<z.ZodString>;
812
+ created_at: z.ZodNullable<z.ZodString>;
813
+ created_by: z.ZodNullable<z.ZodObject<{
814
+ id: z.ZodString;
815
+ name: z.ZodString;
816
+ }, z.core.$strict>>;
817
+ updated_at: z.ZodNullable<z.ZodString>;
818
+ settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
819
+ }, z.core.$strict>;
820
+ export type DocCreateOnColumnOutput = Document;
821
+ /**
822
+ * Output shape for `monday doc rename <doc-id> --name <n>`.
823
+ * Projected from Monday's opaque `JSON` scalar return per D9 — the
824
+ * fetcher emits `{ doc_id: <echoed>, success: true }`. Agents key
825
+ * off `ok: true` for retry/idempotency reasoning; the literal
826
+ * `success: true` slot exists for envelope-snapshot stability and
827
+ * future-proofing (if Monday ever surfaces a wire-side success
828
+ * flag, the schema widens to read the wire value rather than
829
+ * always emitting `true`).
830
+ */
831
+ export declare const docRenameOutputSchema: z.ZodObject<{
832
+ doc_id: z.ZodString;
833
+ success: z.ZodLiteral<true>;
834
+ }, z.core.$strict>;
835
+ export type DocRenameOutput = DocMutationResult;
836
+ /**
837
+ * Output shape for `monday doc delete <doc-id> --yes`. Same
838
+ * `{ doc_id: <echoed>, success: true }` projection as rename per
839
+ * D9. The destructive-gate envelope sits at the action body —
840
+ * `confirmation_required` fires BEFORE this output schema is
841
+ * referenced (cli-design §3.1 #6).
842
+ */
843
+ export declare const docDeleteOutputSchema: z.ZodObject<{
844
+ doc_id: z.ZodString;
845
+ success: z.ZodLiteral<true>;
846
+ }, z.core.$strict>;
847
+ export type DocDeleteOutput = DocMutationResult;
848
+ /**
849
+ * Output shape for `monday doc duplicate <doc-id> [--with-updates]`.
850
+ * Same flat `{ doc_id, success: true }` projection per D9, BUT the
851
+ * `doc_id` slot carries the **newly-created duplicate's id** — NOT
852
+ * the source-doc id. The verb's positional argv is the source-doc
853
+ * id; the wire returns the new id in its JSON payload, which
854
+ * {@link extractDuplicateDocId} pulls out (defensive across
855
+ * plausible shapes today; a future live wire response would
856
+ * narrow what the helper accepts).
857
+ *
858
+ * **No `--name <n>` slot per D8** — Monday's `duplicate_doc`
859
+ * mutation carries no rename-on-duplicate arg. Agents needing a
860
+ * renamed duplicate pair with a follow-up `monday doc rename
861
+ * <new-id> --name <n>` call.
862
+ */
863
+ export declare const docDuplicateOutputSchema: z.ZodObject<{
864
+ doc_id: z.ZodString;
865
+ success: z.ZodLiteral<true>;
866
+ }, z.core.$strict>;
867
+ export type DocDuplicateOutput = DocMutationResult;
868
+ /**
869
+ * GraphQL mutation document for `create_doc(location: {workspace:
870
+ * ...})`. Operation name pinned to `CreateDocInWorkspace`
871
+ * (R-NEW-37 W2 audit-point — operationNames NOT caller-overridable).
872
+ * Selects every base-Document field per the M32 cadence; `blocks`
873
+ * deliberately omitted (Monday's wire returns `blocks: null` on a
874
+ * fresh create — see the module header's create-variant note).
875
+ *
876
+ * `$input: CreateDocInput!` carries the mutually-exclusive wire
877
+ * shape; the verb's action body composes
878
+ * `{ workspace: { workspace_id, name, folder_id?, kind? } }` from
879
+ * the parsed argv. The `board` slot stays unset at the wire — the
880
+ * two-verb CLI split (per D7) makes the mutual-exclusion safely-
881
+ * by-construction.
882
+ */
883
+ export declare const CREATE_DOC_IN_WORKSPACE_MUTATION = "\n mutation CreateDocInWorkspace($input: CreateDocInput!) {\n create_doc(location: $input) {\n id\n object_id\n name\n doc_kind\n url\n relative_url\n workspace_id\n workspace { id name }\n doc_folder_id\n created_at\n created_by { id name }\n updated_at\n settings\n }\n }\n";
884
+ /**
885
+ * GraphQL mutation document for `create_doc(location: {board: ...})`.
886
+ * Operation name pinned to `CreateDocOnColumn` (R-NEW-37 W2). Same
887
+ * Document selection as {@link CREATE_DOC_IN_WORKSPACE_MUTATION};
888
+ * `$input: CreateDocInput!` is composed as `{ board: { column_id,
889
+ * item_id } }` at the action body. Distinct named operation per
890
+ * verb so the wire-side `operationName` payload mirrors the CLI
891
+ * verb name verbatim (agents tracing wire traffic can identify the
892
+ * verb without parsing the doc body).
893
+ */
894
+ export declare const CREATE_DOC_ON_COLUMN_MUTATION = "\n mutation CreateDocOnColumn($input: CreateDocInput!) {\n create_doc(location: $input) {\n id\n object_id\n name\n doc_kind\n url\n relative_url\n workspace_id\n workspace { id name }\n doc_folder_id\n created_at\n created_by { id name }\n updated_at\n settings\n }\n }\n";
895
+ /**
896
+ * GraphQL mutation document for `update_doc_name(docId, name) →
897
+ * JSON`. Operation name pinned to `UpdateDocName` (R-NEW-37 W2).
898
+ * The wire return type is the opaque `JSON` scalar — no selection
899
+ * set per GraphQL grammar (scalars are leaves). The CLI projects
900
+ * the opaque value to the flat `{ doc_id, success }` envelope at
901
+ * the fetcher boundary per D9.
902
+ *
903
+ * `docId` + `name` are camelCase on Monday's wire per Finding 7;
904
+ * the variable names mirror the wire shape verbatim. CLI argv is
905
+ * `<doc-id>` positional + `--name <n>` flag (kebab-case throughout).
906
+ */
907
+ export declare const UPDATE_DOC_NAME_MUTATION = "\n mutation UpdateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n";
908
+ /**
909
+ * GraphQL mutation document for `delete_doc(docId) → JSON`.
910
+ * Operation name pinned to `DeleteDoc` (R-NEW-37 W2). Wire return
911
+ * is opaque JSON — same projection cadence as
912
+ * {@link UPDATE_DOC_NAME_MUTATION}.
913
+ *
914
+ * **Destructive-gate ordering.** The verb's action body MUST call
915
+ * `enforceDestructiveGate` BEFORE this fetcher per the M10 round-1
916
+ * P2 invariant. A missing `--yes` surfaces as
917
+ * `confirmation_required` from the action layer, never masked by
918
+ * `config_error` when no token is configured.
919
+ */
920
+ export declare const DELETE_DOC_MUTATION = "\n mutation DeleteDoc($docId: ID!) {\n delete_doc(docId: $docId)\n }\n";
921
+ /**
922
+ * GraphQL mutation document for `duplicate_doc(docId,
923
+ * duplicateType?) → JSON`. Operation name pinned to `DuplicateDoc`
924
+ * (R-NEW-37 W2). `duplicateType` is the optional 2-value enum
925
+ * (see {@link DUPLICATE_TYPE_VALUES}); when omitted at the variable
926
+ * boundary, Monday's wire-side default (`duplicate_doc_with_content`,
927
+ * content-only) applies.
928
+ *
929
+ * The verb's `--with-updates` boolean argv maps to:
930
+ * absent → omit the variable entirely (wire default applies);
931
+ * present → `duplicateType: 'duplicate_doc_with_content_and_updates'`.
932
+ * The omit-vs-null discipline mirrors M34 `team-create`'s
933
+ * `is_guest_team` handling — Monday treats a `null` variable as
934
+ * "field present with null value" rather than "field omitted".
935
+ *
936
+ * Wire return is opaque JSON — same projection cadence as the
937
+ * rename + delete mutations.
938
+ */
939
+ export declare const DUPLICATE_DOC_MUTATION = "\n mutation DuplicateDoc($docId: ID!, $duplicateType: DuplicateType) {\n duplicate_doc(docId: $docId, duplicateType: $duplicateType)\n }\n";
940
+ export interface CreateDocInWorkspaceInputs {
941
+ readonly client: MondayClient;
942
+ readonly workspaceId: string;
943
+ readonly name: string;
944
+ readonly folderId?: string;
945
+ readonly kind?: DocKind;
946
+ }
947
+ export interface CreateDocInWorkspaceResult {
948
+ readonly document: Document;
949
+ readonly source: 'live';
950
+ readonly cacheAgeSeconds: null;
951
+ readonly complexity: Complexity | null;
952
+ }
953
+ /**
954
+ * Creates a workspace-scoped workdoc via `create_doc(location:
955
+ * { workspace: {...} })` with `operationName:
956
+ * 'CreateDocInWorkspace'` (R-NEW-37 W2). Returns the created
957
+ * Document with `id` populated post-create.
958
+ *
959
+ * The fetcher composes `location: { workspace: { workspace_id,
960
+ * name, folder_id?, kind? } }` from the inputs; `folderId` /
961
+ * `kind` are omitted entirely from the wire payload when unset
962
+ * (Monday's per-arg server-side defaults apply — null would be
963
+ * treated as "field present" rather than "field omitted",
964
+ * mirroring M34 `createTeam`'s discipline).
965
+ *
966
+ * A missing-key wire response surfaces `internal_error` via
967
+ * `assertResponseFieldPresent`; a null payload surfaces
968
+ * `internal_error` too — a successful `create_doc` mutation must
969
+ * return the created Document per Monday's documented contract.
970
+ */
971
+ export declare const createDocInWorkspace: (inputs: CreateDocInWorkspaceInputs) => Promise<CreateDocInWorkspaceResult>;
972
+ export interface CreateDocOnColumnInputs {
973
+ readonly client: MondayClient;
974
+ readonly itemId: string;
975
+ readonly columnId: string;
976
+ }
977
+ export interface CreateDocOnColumnResult {
978
+ readonly document: Document;
979
+ readonly source: 'live';
980
+ readonly cacheAgeSeconds: null;
981
+ readonly complexity: Complexity | null;
982
+ }
983
+ /**
984
+ * Creates an item-scoped workdoc via `create_doc(location:
985
+ * { board: {...} })` with `operationName: 'CreateDocOnColumn'`
986
+ * (R-NEW-37 W2). Returns the created Document; the doc is
987
+ * embedded into the named column of the named item.
988
+ *
989
+ * The fetcher composes `location: { board: { column_id, item_id
990
+ * } }` from the inputs. Both slots are required on Monday's wire
991
+ * (`CreateDocBoardInput.column_id!` + `CreateDocBoardInput.
992
+ * item_id!`); the CLI verb's `--item <iid>` + `--column <cid>`
993
+ * flags are both required at the parse boundary.
994
+ *
995
+ * Failure modes mirror the workspace variant: missing-key
996
+ * response → `internal_error`; null payload → `internal_error`;
997
+ * column not configured for docs → `validation_failed` (Monday-
998
+ * side rejection — the CLI doesn't pre-check column-type
999
+ * compatibility, mirroring M8's `change_column_value` cadence).
1000
+ */
1001
+ export declare const createDocOnColumn: (inputs: CreateDocOnColumnInputs) => Promise<CreateDocOnColumnResult>;
1002
+ export interface RenameDocInputs {
1003
+ readonly client: MondayClient;
1004
+ readonly docId: string;
1005
+ readonly name: string;
1006
+ }
1007
+ export interface RenameDocResult {
1008
+ readonly result: DocMutationResult;
1009
+ readonly source: 'live';
1010
+ readonly cacheAgeSeconds: null;
1011
+ readonly complexity: Complexity | null;
1012
+ }
1013
+ /**
1014
+ * Renames a workdoc via `update_doc_name(docId, name)` with
1015
+ * `operationName: 'UpdateDocName'` (R-NEW-37 W2). Projects
1016
+ * Monday's opaque JSON return into the flat
1017
+ * `{ doc_id: <echoed>, success: true }` envelope per D9.
1018
+ *
1019
+ * Failure modes:
1020
+ *
1021
+ * - **Missing `update_doc_name` key** → `internal_error` via
1022
+ * `assertResponseFieldPresent` (schema drift — Monday's
1023
+ * response shape regressed).
1024
+ * - **Present-but-null payload** → projected as success (the
1025
+ * `{doc_id, success: true}` envelope). Monday's probe
1026
+ * description for `update_doc_name` carries NO "returns X"
1027
+ * prose (unlike `delete_doc` which promises "success status
1028
+ * and the deleted document ID"), so a null wire payload is a
1029
+ * plausible empty-success indicator. If Monday returns a
1030
+ * typed error for non-existent doc IDs, that bubbles via
1031
+ * GraphQL `errors[]` (mapped to typed `ApiError`s upstream) —
1032
+ * a present-but-null JSON return reaching this projection is
1033
+ * by construction the success path. Distinct from
1034
+ * `deleteDoc` + `duplicateDoc` cadence which DO treat null
1035
+ * as `not_found` because their probe descriptions explicitly
1036
+ * promise a non-null return payload on success.
1037
+ * - **Typed Monday errors** (forbidden / not_found from a wire-
1038
+ * side `errors[]`) → bubble through the transport's error-
1039
+ * mapping layer.
1040
+ */
1041
+ export declare const renameDoc: (inputs: RenameDocInputs) => Promise<RenameDocResult>;
1042
+ export interface DeleteDocInputs {
1043
+ readonly client: MondayClient;
1044
+ readonly docId: string;
1045
+ }
1046
+ export interface DeleteDocResult {
1047
+ readonly result: DocMutationResult;
1048
+ readonly source: 'live';
1049
+ readonly cacheAgeSeconds: null;
1050
+ readonly complexity: Complexity | null;
1051
+ }
1052
+ /**
1053
+ * Deletes a workdoc by ID via `delete_doc(docId)` with
1054
+ * `operationName: 'DeleteDoc'` (R-NEW-37 W2). Projects Monday's
1055
+ * opaque JSON return into the flat `{ doc_id: <echoed>,
1056
+ * success: true }` envelope per D9.
1057
+ *
1058
+ * A null `delete_doc` payload surfaces `not_found` — same
1059
+ * cadence as M34 team-delete + M14 workspace-delete. A missing
1060
+ * key surfaces `internal_error`.
1061
+ *
1062
+ * **Destructive-gate ordering.** The verb's action body MUST
1063
+ * call `enforceDestructiveGate` BEFORE this fetcher per the
1064
+ * M10 round-1 P2 invariant. A missing `--yes` surfaces as
1065
+ * `confirmation_required` from the action layer, never masked
1066
+ * by `config_error` when no token is configured.
1067
+ */
1068
+ export declare const deleteDoc: (inputs: DeleteDocInputs) => Promise<DeleteDocResult>;
1069
+ export interface DuplicateDocInputs {
1070
+ readonly client: MondayClient;
1071
+ readonly docId: string;
1072
+ readonly duplicateType?: DuplicateType;
1073
+ }
1074
+ export interface DuplicateDocResult {
1075
+ readonly result: DocMutationResult;
1076
+ readonly source: 'live';
1077
+ readonly cacheAgeSeconds: null;
1078
+ readonly complexity: Complexity | null;
1079
+ }
1080
+ /**
1081
+ * Duplicates a workdoc by ID via `duplicate_doc(docId,
1082
+ * duplicateType?)` with `operationName: 'DuplicateDoc'`
1083
+ * (R-NEW-37 W2). Projects Monday's opaque JSON return into the
1084
+ * flat `{ doc_id: <NEW>, success: true }` envelope per D9 — the
1085
+ * `doc_id` slot carries the **newly-created duplicate's id**,
1086
+ * NOT the input source-doc id (the source id stays accessible
1087
+ * via the verb's positional argv).
1088
+ *
1089
+ * The fetcher omits the `duplicateType` variable entirely when
1090
+ * `inputs.duplicateType` is unset so Monday's wire-side default
1091
+ * applies (the M34 `team-create` omit-vs-null discipline). A
1092
+ * null `duplicate_doc` payload surfaces `not_found` (source
1093
+ * doc id bogus or inaccessible); missing key surfaces
1094
+ * `internal_error`. The new-id extraction tolerates several
1095
+ * common shapes Monday's opaque JSON might carry (bare string,
1096
+ * `{id}`, `{doc_id}`, `{new_doc_id}`) — anything else surfaces
1097
+ * `internal_error` with a re-probe hint.
1098
+ */
1099
+ export declare const duplicateDoc: (inputs: DuplicateDocInputs) => Promise<DuplicateDocResult>;
1100
+ /**
1101
+ * Monday's `DocBlockContentType` enum vocabulary (empirical probe
1102
+ * 2026-05-15, API `2026-01`; 16 closed values per Finding 8). Pinned
1103
+ * at M36 pre-flight as a closed literal-union enum so unknown
1104
+ * `--type` values reject at the argv-parse boundary with
1105
+ * `usage_error.details.issues[]` (D10 closure).
1106
+ *
1107
+ * Adding a 17th value to Monday's enum is a minor (additive) bump
1108
+ * for the CLI — extend this list + the per-command flag help; the
1109
+ * per-block content schema documentation in `docs/output-shapes.md`
1110
+ * "Per-block content shapes" reference table gains a new row for
1111
+ * the new variant once a live cassette pins its shape (extending
1112
+ * the table is additive at any future v0.5.x patch).
1113
+ */
1114
+ export declare const DOC_BLOCK_CONTENT_TYPE_VALUES: readonly ["bulleted_list", "check_list", "code", "divider", "image", "large_title", "layout", "medium_title", "normal_text", "notice_box", "numbered_list", "page_break", "quote", "small_title", "table", "video"];
1115
+ export type DocBlockContentType = (typeof DOC_BLOCK_CONTENT_TYPE_VALUES)[number];
1116
+ export declare const docBlockContentTypeSchema: z.ZodEnum<{
1117
+ code: "code";
1118
+ table: "table";
1119
+ bulleted_list: "bulleted_list";
1120
+ check_list: "check_list";
1121
+ divider: "divider";
1122
+ image: "image";
1123
+ large_title: "large_title";
1124
+ layout: "layout";
1125
+ medium_title: "medium_title";
1126
+ normal_text: "normal_text";
1127
+ notice_box: "notice_box";
1128
+ numbered_list: "numbered_list";
1129
+ page_break: "page_break";
1130
+ quote: "quote";
1131
+ small_title: "small_title";
1132
+ video: "video";
1133
+ }>;
1134
+ /**
1135
+ * `DocumentBlockIdOnly` projection — Monday's `delete_doc_block`
1136
+ * mutation return shape per the v0.5 empirical probe. Single-field
1137
+ * OBJECT carrying only the deleted block's id; the wire description
1138
+ * is "A monday.com doc block" but introspection pins exactly one
1139
+ * field. Mirrors `DocumentBlock.id`'s `String!` shape (non-empty,
1140
+ * opaque).
1141
+ */
1142
+ export declare const documentBlockIdOnlySchema: z.ZodObject<{
1143
+ id: z.ZodString;
1144
+ }, z.core.$strict>;
1145
+ export type DocumentBlockIdOnly = z.infer<typeof documentBlockIdOnlySchema>;
1146
+ /**
1147
+ * Output shape for `monday doc block-create <doc-id> --type <t>
1148
+ * --content <json> [--after <bid>] [--parent <bid>]`. Direct unwrap
1149
+ * of the created DocumentBlock — `data: <DocumentBlock>` per cli-
1150
+ * design §6.1 single-record convention. The 9-field `DocumentBlock`
1151
+ * schema reused from {@link documentBlockSchema} (M32's `doc get`
1152
+ * blocks-hydration leg).
1153
+ */
1154
+ export declare const docBlockCreateOutputSchema: z.ZodObject<{
1155
+ id: z.ZodString;
1156
+ type: z.ZodNullable<z.ZodString>;
1157
+ content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
1158
+ position: z.ZodNullable<z.ZodNumber>;
1159
+ parent_block_id: z.ZodNullable<z.ZodString>;
1160
+ doc_id: z.ZodNullable<z.ZodString>;
1161
+ created_at: z.ZodNullable<z.ZodString>;
1162
+ created_by: z.ZodNullable<z.ZodObject<{
1163
+ id: z.ZodString;
1164
+ name: z.ZodString;
1165
+ }, z.core.$strict>>;
1166
+ updated_at: z.ZodNullable<z.ZodString>;
1167
+ }, z.core.$strict>;
1168
+ export type DocBlockCreateOutput = DocumentBlock;
1169
+ /**
1170
+ * Output shape for `monday doc block-update <block-id> --content
1171
+ * <json>`. Same 9-field `DocumentBlock` shape as block-create —
1172
+ * Monday's wire returns the updated block with content / type /
1173
+ * position / parent_block_id all reflecting post-update state.
1174
+ */
1175
+ export declare const docBlockUpdateOutputSchema: z.ZodObject<{
1176
+ id: z.ZodString;
1177
+ type: z.ZodNullable<z.ZodString>;
1178
+ content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
1179
+ position: z.ZodNullable<z.ZodNumber>;
1180
+ parent_block_id: z.ZodNullable<z.ZodString>;
1181
+ doc_id: z.ZodNullable<z.ZodString>;
1182
+ created_at: z.ZodNullable<z.ZodString>;
1183
+ created_by: z.ZodNullable<z.ZodObject<{
1184
+ id: z.ZodString;
1185
+ name: z.ZodString;
1186
+ }, z.core.$strict>>;
1187
+ updated_at: z.ZodNullable<z.ZodString>;
1188
+ }, z.core.$strict>;
1189
+ export type DocBlockUpdateOutput = DocumentBlock;
1190
+ /**
1191
+ * Output shape for `monday doc block-delete <block-id> --yes`.
1192
+ * Single-field `{id: <echoed-block-id>}` projection from Monday's
1193
+ * `DocumentBlockIdOnly` wire return — agents key off the echoed id
1194
+ * for retry/idempotency reasoning. Envelope is intentionally
1195
+ * narrower than the create/update variants because Monday's
1196
+ * `delete_doc_block` wire only returns the id (NOT the full
1197
+ * pre-delete block); the agent contract doesn't gain from
1198
+ * speculatively rehydrating the block on the way out.
1199
+ */
1200
+ export declare const docBlockDeleteOutputSchema: z.ZodObject<{
1201
+ id: z.ZodString;
1202
+ }, z.core.$strict>;
1203
+ export type DocBlockDeleteOutput = DocumentBlockIdOnly;
1204
+ /**
1205
+ * GraphQL mutation document for `create_doc_block(doc_id, type,
1206
+ * content, after_block_id?, parent_block_id?) → DocumentBlock`.
1207
+ * Operation name pinned literally to `CreateDocBlock` (R-NEW-37
1208
+ * W2 audit-point — operationNames NOT caller-overridable). Wire
1209
+ * args are snake_case (Finding 7); variable names are camelCase
1210
+ * (TS convention).
1211
+ *
1212
+ * Selects every `DocumentBlock` field per the M32 probe. The 9-
1213
+ * field selection matches the `doc get` blocks-hydration leg so a
1214
+ * future create-then-get pipeline can compare envelopes byte-for-
1215
+ * byte.
1216
+ */
1217
+ export declare const CREATE_DOC_BLOCK_MUTATION = "\n mutation CreateDocBlock(\n $docId: ID!,\n $type: DocBlockContentType!,\n $content: JSON!,\n $afterBlockId: String,\n $parentBlockId: String\n ) {\n create_doc_block(\n doc_id: $docId,\n type: $type,\n content: $content,\n after_block_id: $afterBlockId,\n parent_block_id: $parentBlockId\n ) {\n id\n type\n content\n position\n parent_block_id\n doc_id\n created_at\n created_by { id name }\n updated_at\n }\n }\n";
1218
+ /**
1219
+ * GraphQL mutation document for `update_doc_block(block_id,
1220
+ * content) → DocumentBlock`. Operation name pinned to
1221
+ * `UpdateDocBlock` (R-NEW-37 W2). Same 9-field `DocumentBlock`
1222
+ * selection as the create variant — Monday's wire returns the
1223
+ * full post-update block, not just a delta.
1224
+ *
1225
+ * No `--type` slot on `update_doc_block` (Monday's wire signature
1226
+ * has no `type` arg); agents that need to switch a block's content
1227
+ * type must `block-delete` + `block-create` (lossy: new id, new
1228
+ * position). The CLI surface mirrors the wire constraint exactly
1229
+ * — no client-side "change type" shim that papers over the
1230
+ * destructive recreate.
1231
+ */
1232
+ export declare const UPDATE_DOC_BLOCK_MUTATION = "\n mutation UpdateDocBlock($blockId: String!, $content: JSON!) {\n update_doc_block(block_id: $blockId, content: $content) {\n id\n type\n content\n position\n parent_block_id\n doc_id\n created_at\n created_by { id name }\n updated_at\n }\n }\n";
1233
+ /**
1234
+ * GraphQL mutation document for `delete_doc_block(block_id) →
1235
+ * DocumentBlockIdOnly`. Operation name pinned to `DeleteDocBlock`
1236
+ * (R-NEW-37 W2). Single-field selection — Monday's wire return is
1237
+ * `DocumentBlockIdOnly` (`{id: String!}`).
1238
+ *
1239
+ * **Destructive-gate ordering.** The verb's action body MUST call
1240
+ * `enforceDestructiveGate` BEFORE this fetcher per the M10 round-1
1241
+ * P2 invariant. A missing `--yes` surfaces as
1242
+ * `confirmation_required` from the action layer, never masked by
1243
+ * `config_error` when no token is configured.
1244
+ */
1245
+ export declare const DELETE_DOC_BLOCK_MUTATION = "\n mutation DeleteDocBlock($blockId: String!) {\n delete_doc_block(block_id: $blockId) {\n id\n }\n }\n";
1246
+ export interface CreateDocBlockInputs {
1247
+ readonly client: MondayClient;
1248
+ readonly docId: string;
1249
+ readonly type: DocBlockContentType;
1250
+ /**
1251
+ * Per-block content payload. Shape varies per
1252
+ * {@link DocBlockContentType} value — Monday's wire is the source
1253
+ * of truth for what each variant accepts; the CLI passes the JS
1254
+ * value through to the wire `JSON` scalar unmodified. Per-type
1255
+ * structure pinned by `docs/output-shapes.md` "Per-block content
1256
+ * shapes" reference table (cassette-sourced rows + TBD / inferred
1257
+ * rows pending live-probe cassettes).
1258
+ */
1259
+ readonly content: unknown;
1260
+ /**
1261
+ * Optional anchor block — newly-created block lands immediately
1262
+ * after `afterBlockId` in the doc body order. Absent → block
1263
+ * inserted at the document head (Monday's `create_doc_block`
1264
+ * default per probe description: "If not provided, will be
1265
+ * inserted first in the document").
1266
+ */
1267
+ readonly afterBlockId?: string;
1268
+ /**
1269
+ * Optional parent block — newly-created block nests under
1270
+ * `parentBlockId` (for layout / nested-list variants where
1271
+ * Monday supports parent/child block relationships per
1272
+ * `DocumentBlock.parent_block_id`). Absent → block lands at the
1273
+ * document root level.
1274
+ */
1275
+ readonly parentBlockId?: string;
1276
+ }
1277
+ export interface CreateDocBlockResult {
1278
+ readonly block: DocumentBlock;
1279
+ readonly source: 'live';
1280
+ readonly cacheAgeSeconds: null;
1281
+ readonly complexity: Complexity | null;
1282
+ }
1283
+ /**
1284
+ * Creates a per-doc rich-text block via `create_doc_block(doc_id,
1285
+ * type, content, after_block_id?, parent_block_id?)` with
1286
+ * `operationName: 'CreateDocBlock'` (R-NEW-37 W2). Two-stage parse
1287
+ * mirrors M34 / M35 cadence: the loose wrapping schema tolerates
1288
+ * Monday's side-band debug keys, then the inner OBJECT pins via
1289
+ * {@link documentBlockSchema} so per-field drift surfaces with
1290
+ * structured `details.issues`.
1291
+ *
1292
+ * Failure modes:
1293
+ *
1294
+ * - **Missing `create_doc_block` key** → `internal_error` via
1295
+ * `assertResponseFieldPresent` (Monday's response shape
1296
+ * regressed).
1297
+ * - **Present-but-null payload** → `internal_error` (a successful
1298
+ * `create_doc_block` mutation must return the created block per
1299
+ * Monday's documented contract — null indicates a wire-shape
1300
+ * regression worth surfacing loudly; distinct from
1301
+ * {@link updateDocBlock} / {@link deleteDocBlock} which treat
1302
+ * null as `not_found` per their probe-description-derived
1303
+ * contracts at R-v0.5-NEW-11).
1304
+ * - **Inner OBJECT drift** → `internal_error` via `unwrapOrThrow`
1305
+ * on {@link documentBlockSchema} (per-field shape regression).
1306
+ *
1307
+ * Omits `afterBlockId` / `parentBlockId` variables when unset so
1308
+ * Monday's wire-side defaults apply (the M34 / M35 omit-vs-null
1309
+ * discipline — undefined-keyed JSON serialises to a missing key,
1310
+ * NOT `null`).
1311
+ */
1312
+ export declare const createDocBlock: (inputs: CreateDocBlockInputs) => Promise<CreateDocBlockResult>;
1313
+ export interface UpdateDocBlockInputs {
1314
+ readonly client: MondayClient;
1315
+ readonly blockId: string;
1316
+ /**
1317
+ * Per-block content payload. Same shape contract as
1318
+ * {@link CreateDocBlockInputs.content} — opaque JS value passed
1319
+ * through to Monday's wire `JSON` scalar. Per-type structure
1320
+ * pinned by `docs/output-shapes.md` "Per-block content shapes"
1321
+ * reference table from M36 IMPL cassettes.
1322
+ */
1323
+ readonly content: unknown;
1324
+ }
1325
+ export interface UpdateDocBlockResult {
1326
+ readonly block: DocumentBlock;
1327
+ readonly source: 'live';
1328
+ readonly cacheAgeSeconds: null;
1329
+ readonly complexity: Complexity | null;
1330
+ }
1331
+ /**
1332
+ * Updates a per-doc rich-text block's content via
1333
+ * `update_doc_block(block_id, content)` with `operationName:
1334
+ * 'UpdateDocBlock'` (R-NEW-37 W2). No type-switching slot on the
1335
+ * wire — agents needing to change a block's content type
1336
+ * `block-delete` + `block-create` (lossy: new id, new position).
1337
+ *
1338
+ * Failure modes:
1339
+ *
1340
+ * - **Missing `update_doc_block` key** → `internal_error` via
1341
+ * `assertResponseFieldPresent` (schema drift).
1342
+ * - **Present-but-null payload** → `not_found` (the probe
1343
+ * description "Update a document block" promises the updated
1344
+ * block on success, so null reads as missing-record — block
1345
+ * bogus or not visible to the token; per R-v0.5-NEW-11
1346
+ * per-fetcher null-payload discipline).
1347
+ * - **Inner OBJECT drift** → `internal_error` via `unwrapOrThrow`
1348
+ * on {@link documentBlockSchema}.
1349
+ */
1350
+ export declare const updateDocBlock: (inputs: UpdateDocBlockInputs) => Promise<UpdateDocBlockResult>;
1351
+ export interface DeleteDocBlockInputs {
1352
+ readonly client: MondayClient;
1353
+ readonly blockId: string;
1354
+ }
1355
+ export interface DeleteDocBlockResult {
1356
+ readonly block: DocumentBlockIdOnly;
1357
+ readonly source: 'live';
1358
+ readonly cacheAgeSeconds: null;
1359
+ readonly complexity: Complexity | null;
1360
+ }
1361
+ /**
1362
+ * Deletes a per-doc rich-text block via `delete_doc_block(block_id)`
1363
+ * with `operationName: 'DeleteDocBlock'` (R-NEW-37 W2). Wire return
1364
+ * is `DocumentBlockIdOnly` (`{id: String!}`).
1365
+ *
1366
+ * Failure modes:
1367
+ *
1368
+ * - **Missing `delete_doc_block` key** → `internal_error` via
1369
+ * `assertResponseFieldPresent` (schema drift).
1370
+ * - **Present-but-null payload** → `not_found` (id bogus or
1371
+ * block already deleted by a concurrent caller; mirrors M14
1372
+ * workspace-delete + M34 team-delete + M35 doc-delete cadence;
1373
+ * `delete_doc_block`'s probe description "Delete a document
1374
+ * block" promises confirmation on success).
1375
+ * - **Inner OBJECT drift** → `internal_error` via `unwrapOrThrow`
1376
+ * on {@link documentBlockIdOnlySchema}.
1377
+ *
1378
+ * The action body's destructive gate fires BEFORE this fetcher per
1379
+ * the M10 round-1 P2 invariant.
1380
+ */
1381
+ export declare const deleteDocBlock: (inputs: DeleteDocBlockInputs) => Promise<DeleteDocBlockResult>;
1382
+ /**
1383
+ * Maximum byte-size for the inline `--html-string` / `--markdown-string`
1384
+ * payload at the argv-parse boundary (empirical probe 2026-05-17, API
1385
+ * `2026-01`; `scripts/probe/v0.5-m37-size-limits.report.txt`). Set
1386
+ * conservatively at the LAST-KNOWN-GOOD probe size (250KB) — the wire's
1387
+ * first-known-rejection sits at 500KB, so 250KB leaves the agent contract
1388
+ * comfortably below the threshold without leaving room for the wire-side
1389
+ * `INTERNAL_SERVER_ERROR` surprise.
1390
+ *
1391
+ * Bytes (NOT UTF-16 code units) — the parse-boundary check measures the
1392
+ * payload via `Buffer.byteLength(payload, 'utf8')` so multi-byte
1393
+ * characters in the payload count toward the limit the same way Monday's
1394
+ * transport layer sees them.
1395
+ *
1396
+ * Raising this constant is a contract bump: any agent that relied on
1397
+ * being rejected at the old limit might now silently succeed with a
1398
+ * larger payload (additive change). Lowering it is a tighter rejection
1399
+ * surface (potentially breaking — fold into a Codex review at the v0.6+
1400
+ * pre-flight that touches doc-content import). Future API versions may
1401
+ * shift Monday's wire threshold; re-running the probe at any v0.5.x or
1402
+ * v0.6 pre-flight that re-opens this surface pins the new threshold.
1403
+ */
1404
+ export declare const MAX_DOC_IMPORT_PAYLOAD_BYTES = 256000;
1405
+ /**
1406
+ * Inner OBJECT schema for `import_doc_from_html`'s
1407
+ * `ImportDocFromHtmlResult` wire return shape — 3 fields per the
1408
+ * v0.5 introspection probe (`scripts/probe/v0.5-inputs-and-results.
1409
+ * report.txt`):
1410
+ *
1411
+ * - `success: Boolean!` — discriminator; pinned NON_NULL per
1412
+ * introspection.
1413
+ * - `doc_id: String` — nullable; populated on `success: true`,
1414
+ * null on `success: false` per Monday's documented contract.
1415
+ * Note Monday's wire types this slot as `String` (NOT `ID`!)
1416
+ * despite the value being a doc-id-shaped reference. The CLI
1417
+ * surfaces it as a brand-untyped string at the wire layer; the
1418
+ * CLI projection envelope re-brands via {@link DocIdSchema} on
1419
+ * the way out so agents read a `DocId`-shaped slot.
1420
+ * - `error: String` — nullable; populated on `success: false`,
1421
+ * null on `success: true`. Wire-side rejection reason (invalid
1422
+ * HTML, payload-too-large, etc.).
1423
+ *
1424
+ * `.strict()` mode — Monday's wire OBJECT shape is documented at
1425
+ * exactly 3 fields; an unknown key would indicate wire-shape
1426
+ * regression worth catching loudly (the wrapping `loose()` schema
1427
+ * tolerates side-band debug keys at the response root, not at the
1428
+ * inner OBJECT layer).
1429
+ */
1430
+ export declare const importDocFromHtmlResultSchema: z.ZodObject<{
1431
+ success: z.ZodBoolean;
1432
+ doc_id: z.ZodNullable<z.ZodString>;
1433
+ error: z.ZodNullable<z.ZodString>;
1434
+ }, z.core.$strict>;
1435
+ export type ImportDocFromHtmlResult = z.infer<typeof importDocFromHtmlResultSchema>;
1436
+ /**
1437
+ * Inner OBJECT schema for `add_content_to_doc_from_markdown`'s
1438
+ * `DocBlocksFromMarkdownResult` wire return shape — 3 fields per the
1439
+ * v0.5 introspection probe:
1440
+ *
1441
+ * - `success: Boolean!` — discriminator; NON_NULL.
1442
+ * - `block_ids: [String!]` — nullable LIST of NON_NULL strings;
1443
+ * populated on `success: true` with the newly-created block
1444
+ * ids (one per parsed markdown block); null on `success:
1445
+ * false`. EMPTY array on success is plausible for non-empty
1446
+ * markdown that Monday parses to zero convertible blocks (e.g.
1447
+ * comments-only input); the schema accepts empty. Empty /
1448
+ * whitespace-only `--markdown-string` rejects at the parse /
1449
+ * read boundary as `usage_error` and never reaches the wire.
1450
+ * - `error: String` — nullable; populated on `success: false`,
1451
+ * null on `success: true`.
1452
+ *
1453
+ * `.strict()` mode for the same reason as
1454
+ * {@link importDocFromHtmlResultSchema}.
1455
+ */
1456
+ export declare const docBlocksFromMarkdownResultSchema: z.ZodObject<{
1457
+ success: z.ZodBoolean;
1458
+ block_ids: z.ZodNullable<z.ZodArray<z.ZodString>>;
1459
+ error: z.ZodNullable<z.ZodString>;
1460
+ }, z.core.$strict>;
1461
+ export type DocBlocksFromMarkdownResult = z.infer<typeof docBlocksFromMarkdownResultSchema>;
1462
+ /**
1463
+ * CLI projection envelope for `monday doc import-html` — flat
1464
+ * `{ doc_id, success: true }` shape mirroring M35's
1465
+ * {@link docMutationResultSchema} cadence so agents read a uniform
1466
+ * `{ doc_id, success }` shape across every doc-mutation success
1467
+ * envelope (rename / delete / duplicate / import-html). `doc_id`
1468
+ * carries the **NEWLY-CREATED** doc's id; `success` is literal-
1469
+ * `true` because failure paths throw typed `ApiError`s
1470
+ * (`validation_failed` for `success: false + error` per D12 / null
1471
+ * for wire regression) BEFORE this projection schema is referenced.
1472
+ *
1473
+ * No `error` slot — failures don't reach this envelope. Agents read
1474
+ * `error.code` + `error.details.error` from the failure envelope
1475
+ * instead.
1476
+ */
1477
+ export declare const docImportHtmlOutputSchema: z.ZodObject<{
1478
+ doc_id: z.ZodString;
1479
+ success: z.ZodLiteral<true>;
1480
+ }, z.core.$strict>;
1481
+ export type DocImportHtmlOutput = z.infer<typeof docImportHtmlOutputSchema>;
1482
+ /**
1483
+ * CLI projection envelope for `monday doc append-markdown` —
1484
+ * `{ doc_id (echoed input), block_ids, success: true }`. Echoes
1485
+ * the input source-doc id so agents that pipe the append envelope
1486
+ * into a follow-up call (e.g. a `monday doc get <doc-id>` to verify
1487
+ * post-append state) have the parent doc context inline.
1488
+ * `block_ids` carries the wire's full list of NEWLY-CREATED block
1489
+ * ids (one per parsed markdown block) preserved in markdown-source
1490
+ * order. Empty array IS a valid success shape for non-empty markdown
1491
+ * that Monday parses to zero convertible blocks (e.g. comments-only
1492
+ * input); empty / whitespace-only `--markdown-string` rejects at the
1493
+ * parse / read boundary as `usage_error` and never reaches the wire.
1494
+ *
1495
+ * `success` is literal-`true` for the same reason as
1496
+ * {@link docImportHtmlOutputSchema}.
1497
+ */
1498
+ export declare const docAppendMarkdownOutputSchema: z.ZodObject<{
1499
+ doc_id: z.ZodString;
1500
+ block_ids: z.ZodArray<z.ZodString>;
1501
+ success: z.ZodLiteral<true>;
1502
+ }, z.core.$strict>;
1503
+ export type DocAppendMarkdownOutput = z.infer<typeof docAppendMarkdownOutputSchema>;
1504
+ /**
1505
+ * GraphQL mutation document for `import_doc_from_html(html,
1506
+ * workspaceId, kind?, folderId?, title?) → ImportDocFromHtmlResult`.
1507
+ * Operation name pinned literally to `ImportDocFromHtml` (R-NEW-37
1508
+ * W2 audit-point — operationNames NOT caller-overridable). All wire
1509
+ * args are camelCase (Finding 7); variable names match the wire
1510
+ * shape verbatim.
1511
+ *
1512
+ * Selects every `ImportDocFromHtmlResult` field per the introspection
1513
+ * probe — the 3-field selection lets the fetcher project the
1514
+ * discriminator + payload + error in a single round-trip.
1515
+ */
1516
+ export declare const IMPORT_DOC_FROM_HTML_MUTATION = "\n mutation ImportDocFromHtml(\n $html: String!,\n $workspaceId: ID!,\n $kind: DocKind,\n $folderId: ID,\n $title: String\n ) {\n import_doc_from_html(\n html: $html,\n workspaceId: $workspaceId,\n kind: $kind,\n folderId: $folderId,\n title: $title\n ) {\n success\n doc_id\n error\n }\n }\n";
1517
+ /**
1518
+ * GraphQL mutation document for `add_content_to_doc_from_markdown(
1519
+ * docId, markdown, afterBlockId?) → DocBlocksFromMarkdownResult`.
1520
+ * Operation name pinned to `AddContentToDocFromMarkdown` (R-NEW-37
1521
+ * W2). camelCase wire arg names (Finding 7).
1522
+ *
1523
+ * `afterBlockId` is the optional opaque block-id positional anchor —
1524
+ * Monday inserts the parsed markdown blocks immediately after the
1525
+ * named block; absent → blocks land at the document tail (append-end
1526
+ * semantics, NOT append-head; Monday's probe description: "Use this
1527
+ * to append content to the end of a document or insert content after
1528
+ * a specific block").
1529
+ */
1530
+ export declare const ADD_CONTENT_TO_DOC_FROM_MARKDOWN_MUTATION = "\n mutation AddContentToDocFromMarkdown(\n $docId: ID!,\n $markdown: String!,\n $afterBlockId: String\n ) {\n add_content_to_doc_from_markdown(\n docId: $docId,\n markdown: $markdown,\n afterBlockId: $afterBlockId\n ) {\n success\n block_ids\n error\n }\n }\n";
1531
+ export interface ImportDocFromHtmlInputs {
1532
+ readonly client: MondayClient;
1533
+ readonly html: string;
1534
+ readonly workspaceId: string;
1535
+ /**
1536
+ * Optional doc-kind enum (`public` / `private` / `share`) — maps
1537
+ * to wire `kind: DocKind`. Absent → omitted from the wire payload
1538
+ * (Monday's wire-side default "public" applies per the probe
1539
+ * description: "Defaults to 'public' if not specified").
1540
+ */
1541
+ readonly kind?: DocKind;
1542
+ /**
1543
+ * Optional folder id — maps to wire `folderId: ID`. Absent →
1544
+ * omitted; Monday creates the doc at the workspace root level per
1545
+ * the probe description: "If not provided, the document will be
1546
+ * created at the root level of the workspace".
1547
+ */
1548
+ readonly folderId?: string;
1549
+ /**
1550
+ * Optional title — maps to wire `title: String`. Absent → omitted;
1551
+ * Monday infers the title from the HTML content per the probe
1552
+ * description: "If not provided, the title will be inferred from
1553
+ * the HTML content".
1554
+ */
1555
+ readonly title?: string;
1556
+ }
1557
+ export interface ImportDocFromHtmlActionResult {
1558
+ readonly result: DocImportHtmlOutput;
1559
+ readonly source: 'live';
1560
+ readonly cacheAgeSeconds: null;
1561
+ readonly complexity: Complexity | null;
1562
+ }
1563
+ /**
1564
+ * Imports an HTML payload as a new workdoc via
1565
+ * `import_doc_from_html(html, workspaceId, kind?, folderId?, title?)`
1566
+ * with `operationName: 'ImportDocFromHtml'` (R-NEW-37 W2 — pinned
1567
+ * literally at the call site; NOT a caller-overridable input slot).
1568
+ *
1569
+ * Two-stage parse: the loose {@link importDocFromHtmlResponseSchema}
1570
+ * wrapping schema tolerates side-band keys at the response root;
1571
+ * `assertResponseFieldPresent` rewraps a missing key as
1572
+ * `internal_error`; the inner OBJECT pins via
1573
+ * {@link importDocFromHtmlResultSchema} (`.strict()` — drift surfaces
1574
+ * `internal_error` with structured `details.issues`).
1575
+ *
1576
+ * Custom-OBJECT projection per D12 (5 branches):
1577
+ *
1578
+ * - `success: true + doc_id present` → flat envelope
1579
+ * `{doc_id, success: true}` (mirrors M35
1580
+ * {@link docMutationResultSchema} cadence).
1581
+ * - `success: false + populated error` → throw `validation_failed`
1582
+ * with `details: {workspace_id, error, hint}` (Monday-side
1583
+ * rejection — invalid HTML, payload too large, etc.).
1584
+ * - `success: false + empty/null error` → throw `internal_error`
1585
+ * with a wire-regression hint (Monday's contract: `error` is
1586
+ * populated when `success: false`).
1587
+ * - `success: true + missing doc_id` → throw `internal_error`
1588
+ * (per-fetcher null-payload contract derived from Monday's probe
1589
+ * description "Returns the ID of the newly created document on
1590
+ * success" per R-v0.5-NEW-11).
1591
+ * - `success: true + null doc_id` → same as missing — wire-side
1592
+ * regression on the documented payload promise.
1593
+ *
1594
+ * Omits optional variables (`kind` / `folderId` / `title`) entirely
1595
+ * when unset so Monday's per-arg server-side defaults apply (the M34 /
1596
+ * M35 / M36 omit-vs-null discipline — undefined-keyed JSON serialises
1597
+ * to a missing key, NOT `null`).
1598
+ */
1599
+ export declare const importDocFromHtml: (inputs: ImportDocFromHtmlInputs) => Promise<ImportDocFromHtmlActionResult>;
1600
+ export interface AddContentToDocFromMarkdownInputs {
1601
+ readonly client: MondayClient;
1602
+ readonly docId: string;
1603
+ readonly markdown: string;
1604
+ /**
1605
+ * Optional opaque block-id anchor — Monday inserts the parsed
1606
+ * markdown blocks immediately after `afterBlockId` in the doc body
1607
+ * order. Absent → blocks land at the document tail (append-end
1608
+ * semantics per Monday's probe description).
1609
+ */
1610
+ readonly afterBlockId?: string;
1611
+ }
1612
+ export interface AddContentToDocFromMarkdownActionResult {
1613
+ readonly result: DocAppendMarkdownOutput;
1614
+ readonly source: 'live';
1615
+ readonly cacheAgeSeconds: null;
1616
+ readonly complexity: Complexity | null;
1617
+ }
1618
+ /**
1619
+ * Appends parsed-markdown blocks to an existing workdoc via
1620
+ * `add_content_to_doc_from_markdown(docId, markdown, afterBlockId?)`
1621
+ * with `operationName: 'AddContentToDocFromMarkdown'` (R-NEW-37 W2).
1622
+ *
1623
+ * Two-stage parse: the loose
1624
+ * {@link addContentToDocFromMarkdownResponseSchema} wrapping schema
1625
+ * tolerates side-band keys; `assertResponseFieldPresent` rewraps a
1626
+ * missing key as `internal_error`; the inner OBJECT pins via
1627
+ * {@link docBlocksFromMarkdownResultSchema}.
1628
+ *
1629
+ * Custom-OBJECT projection per D12 (5 branches):
1630
+ *
1631
+ * - `success: true + block_ids present (incl. EMPTY array)` →
1632
+ * success envelope `{doc_id (echoed), block_ids, success: true}`.
1633
+ * Empty `block_ids: []` IS a valid success shape per probe
1634
+ * finding — for non-empty markdown that Monday parses to zero
1635
+ * convertible blocks (e.g. comments-only payload Monday
1636
+ * collapses to zero structural blocks). Empty / whitespace-only
1637
+ * input is rejected at the parse / read boundary by
1638
+ * {@link readSourceContent}, so it can never reach this fetcher.
1639
+ * - `success: false + populated error` → throw `validation_failed`
1640
+ * with `details: {doc_id, error, hint}`.
1641
+ * - `success: false + empty/null error` → throw `internal_error`
1642
+ * with wire-regression hint.
1643
+ * - `success: true + null block_ids` → throw `internal_error`
1644
+ * (per-fetcher null-payload contract per R-v0.5-NEW-11 — Monday's
1645
+ * probe description "Returns the IDs of the newly created blocks
1646
+ * on success" promises a non-null array).
1647
+ *
1648
+ * Omits `afterBlockId` when undefined (M34 / M35 / M36 omit-vs-null
1649
+ * discipline).
1650
+ */
1651
+ export declare const addContentToDocFromMarkdown: (inputs: AddContentToDocFromMarkdownInputs) => Promise<AddContentToDocFromMarkdownActionResult>;
519
1652
  //# sourceMappingURL=documents.d.ts.map