ask-marcel-office-cli 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -14817,7 +14817,10 @@ var extractPeople = (root) => {
14817
14817
  return out;
14818
14818
  }, extractFormatChanges = (root) => [
14819
14819
  ...changesIn(root, "w:r", "w:rPr", "w:rPrChange", "run"),
14820
- ...changesIn(root, "w:p", "w:pPr", "w:pPrChange", "paragraph")
14820
+ ...changesIn(root, "w:p", "w:pPr", "w:pPrChange", "paragraph"),
14821
+ ...changesIn(root, "w:tbl", "w:tblPr", "w:tblPrChange", "table"),
14822
+ ...changesIn(root, "w:tr", "w:trPr", "w:trPrChange", "row"),
14823
+ ...changesIn(root, "w:tc", "w:tcPr", "w:tcPrChange", "cell")
14821
14824
  ], extractDocxMetadata = async (bytes) => {
14822
14825
  const zipR = await openOoxmlZip(bytes);
14823
14826
  if (!zipR.ok)
@@ -15266,6 +15269,8 @@ var TEXT2 = "#text", ATTRS2 = ":@", MAX_REPEAT = 1024, parser3, tagOf2 = (node)
15266
15269
  return [padRow(rows[0] ?? []), separator, ...rows.slice(1).map(padRow)].join(`
15267
15270
  `);
15268
15271
  }, renderBlock = (node, tag) => {
15272
+ if (tag === "text:tracked-changes")
15273
+ return [];
15269
15274
  const kids = kidsOf(node, tag);
15270
15275
  if (tag === "text:h")
15271
15276
  return [renderHeading(node, kids)];
@@ -16095,7 +16100,7 @@ var init_download_drive_item_as_markdown = __esm(() => {
16095
16100
  name: "include-metadata",
16096
16101
  key: "includeMetadata",
16097
16102
  required: false,
16098
- description: "Pass `--include-metadata true` to surface the side-channel content the rendered body hides. For docx (`## DOCX metadata`): core/app/custom document properties, people registry, external hyperlinks, comments, tracked changes (a deletion sitting next to an insertion by the same author is reported once as a `replacement` carrying `before` + `after`; the halves that pair with nothing stay under `insertions` / `deletions`; `moves` joins the two ends of a moved span by its range name; `formatChanges` names which run or paragraph properties a reviewer altered. Table-structure revisions — cell insert / delete / merge, numbering and section properties — are still unreported), hidden-formatted text (w:vanish), field instructions (MERGEFIELD / HYPERLINK / DOCVARIABLE), bookmarks. For xlsx (`## Workbook metadata`): core/app/custom properties, external relationships, defined names, hidden / very-hidden sheets, legacy cell comments, threaded comments, persons. For pptx (`## PPTX metadata`): properties, external relationships, slide tags, comment authors + comments (legacy + modern), and per-slide title / speaker notes / hidden flag — returned as a standalone document since pptx has no convertible body (use `download-drive-item-as-pdf` for slide visuals). For OpenDocument (`.odt`/`.ods`/`.odp`, `## OpenDocument metadata`): Dublin Core + ODF properties, keywords, user-defined custom fields — appended after the converted body. Each OOXML family also covers its macro-enabled (`.docm` / `.xlsm` / `.pptm`) and template (`.dotx` / `.xltx` / `.potx`, etc.) variants, with a `### Macros (VBA)` section flagging an embedded `vbaProject.bin`. No-op on other sources.",
16103
+ description: "Pass `--include-metadata true` to surface the side-channel content the rendered body hides. For docx (`## DOCX metadata`): core/app/custom document properties, people registry, external hyperlinks, comments, tracked changes (a deletion sitting next to an insertion by the same author is reported once as a `replacement` carrying `before` + `after`; the halves that pair with nothing stay under `insertions` / `deletions`; `moves` joins the two ends of a moved span by its range name; `formatChanges` names which run, paragraph, table, row or cell properties a reviewer altered, and a property whose values hang off child elements rather than its own attributes (`w:tblBorders` is the common one) is reported with its author and scope but names no property. Structural revisions — cell insert / delete / merge, numbering and section properties — are still unreported), hidden-formatted text (w:vanish), field instructions (MERGEFIELD / HYPERLINK / DOCVARIABLE), bookmarks. For xlsx (`## Workbook metadata`): core/app/custom properties, external relationships, defined names, hidden / very-hidden sheets, legacy cell comments, threaded comments, persons. For pptx (`## PPTX metadata`): properties, external relationships, slide tags, comment authors + comments (legacy + modern), and per-slide title / speaker notes / hidden flag — returned as a standalone document since pptx has no convertible body (use `download-drive-item-as-pdf` for slide visuals). For OpenDocument (`.odt`/`.ods`/`.odp`, `## OpenDocument metadata`): Dublin Core + ODF properties, keywords, user-defined custom fields — appended after the converted body. Each OOXML family also covers its macro-enabled (`.docm` / `.xlsm` / `.pptm`) and template (`.dotx` / `.xltx` / `.potx`, etc.) variants, with a `### Macros (VBA)` section flagging an embedded `vbaProject.bin`. No-op on other sources.",
16099
16104
  argumentHint: { kind: "magicValue", values: ["true", "false"] }
16100
16105
  },
16101
16106
  keepQuotedOption,
@@ -17795,12 +17800,15 @@ __export(exports_convert_mail_to_markdown, {
17795
17800
  attachmentsListSchema: () => attachmentsListSchema,
17796
17801
  execute: () => execute18,
17797
17802
  fetchInlineImageBytes: () => fetchInlineImageBytes,
17803
+ formatAddress: () => formatAddress2,
17798
17804
  formatBytes: () => formatBytes,
17799
17805
  isInlineImage: () => isInlineImage,
17800
17806
  meta: () => meta20,
17807
+ nonEmpty: () => nonEmpty,
17808
+ renderMessageAsMarkdown: () => renderMessageAsMarkdown,
17801
17809
  schema: () => schema18
17802
17810
  });
17803
- var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELECT = "$select=id,name,contentType,size,isInline,microsoft.graph.fileAttachment/contentId", nonEmpty = (v) => typeof v === "string" && v !== "", formatAddress2 = (a) => {
17811
+ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELECT = "$select=id,name,contentType,size,isInline,microsoft.graph.fileAttachment/contentId", nonEmpty = (v) => typeof v === "string" && v !== "", referencesCidImage = (html) => /\bsrc\s*=\s*["']cid:/i.test(html), formatAddress2 = (a) => {
17804
17812
  if (!nonEmpty(a?.address))
17805
17813
  return;
17806
17814
  return nonEmpty(a?.name) ? `${a.name} <${a.address}>` : a.address;
@@ -17832,12 +17840,12 @@ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELEC
17832
17840
  if (n < 1e6)
17833
17841
  return `${(n / 1000).toFixed(1)} KB`;
17834
17842
  return `${(n / 1e6).toFixed(1)} MB`;
17835
- }, isInlineImage = (a) => a.isInline === true && nonEmpty(a.contentType) && a.contentType.toLowerCase().startsWith("image/") && nonEmpty(a.contentId), fetchInlineImageBytes = async (graph, messageId, meta20) => {
17843
+ }, isInlineImage = (a) => a.isInline === true && nonEmpty(a.contentType) && a.contentType.toLowerCase().startsWith("image/") && nonEmpty(a.contentId), fetchInlineImageBytes = async (graph, resourcePath, meta20) => {
17836
17844
  if ((meta20.size ?? 0) > INLINE_IMAGE_SIZE_LIMIT_BYTES)
17837
17845
  return { meta: meta20, oversize: true };
17838
17846
  if (!nonEmpty(meta20.id))
17839
17847
  return { meta: meta20, oversize: false };
17840
- const fetched = await graph.get(`/me/messages/${messageId}/attachments/${meta20.id}`);
17848
+ const fetched = await graph.get(`${resourcePath}/attachments/${meta20.id}`);
17841
17849
  if (!fetched.ok)
17842
17850
  return { meta: meta20, oversize: false };
17843
17851
  const body = fetched.value;
@@ -17857,7 +17865,7 @@ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELEC
17857
17865
  out = out.replaceAll(`cid:${e.meta.contentId}`, label);
17858
17866
  }
17859
17867
  return out;
17860
- }, renderFileAttachmentsList = (attachments, includeInlineImages = false) => {
17868
+ }, renderFileAttachmentsList = (attachments, includeInlineImages, fetchHint) => {
17861
17869
  const fileAttachments = attachments.filter((a) => (includeInlineImages || !isInlineImage(a)) && nonEmpty(a.name));
17862
17870
  if (fileAttachments.length === 0)
17863
17871
  return "";
@@ -17867,7 +17875,7 @@ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELEC
17867
17875
  const id = nonEmpty(a.id) ? `, id: ${a.id}` : "";
17868
17876
  return `- ${a.name ?? ""}${size}${type}${id})`;
17869
17877
  });
17870
- return ["**Attachments:**", ...items, "_Use `convert-mail-attachment-to-pdf` or `get-mail-attachment` with the attachment id to fetch._"].join(`
17878
+ return ["**Attachments:**", ...items, fetchHint].join(`
17871
17879
  `);
17872
17880
  }, withoutTags = (body) => {
17873
17881
  const [leadingText, ...afterTagOpen] = body.split("<");
@@ -17877,37 +17885,32 @@ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELEC
17877
17885
  if (total === 0)
17878
17886
  return 100;
17879
17887
  return Math.round((total - visibleLength(body.slice(0, boundary))) / total * 100);
17880
- }, execute18 = async (graph, params) => {
17881
- const parsed = schema18.safeParse(params);
17882
- if (!parsed.success)
17883
- return err({ type: "validation_error", message: formatZodError(parsed.error) });
17884
- const { messageId } = parsed.data;
17885
- const embedInlineImagesEnabled = parsed.data.inlineImages === "true";
17886
- const keepQuoted = parsed.data.keepQuoted === "true";
17887
- const fetched = await graph.get(`/me/messages/${messageId}`);
17888
+ }, renderMessageAsMarkdown = async (graph, resourcePath, options) => {
17889
+ const { inlineImages: embedInlineImagesEnabled, keepQuoted } = options;
17890
+ const fetched = await graph.get(resourcePath);
17888
17891
  if (!fetched.ok)
17889
17892
  return fetched;
17890
17893
  const m = fetched.value;
17894
+ const rawHtml = m.body?.content ?? "";
17891
17895
  let attachments = [];
17892
17896
  let attachmentsListNote;
17893
- if (m.hasAttachments === true) {
17894
- const listed = await graph.get(`/me/messages/${messageId}/attachments?${ATTACHMENT_METADATA_SELECT}`);
17897
+ if (m.hasAttachments === true || referencesCidImage(rawHtml)) {
17898
+ const listed = await graph.get(`${resourcePath}/attachments?${ATTACHMENT_METADATA_SELECT}`);
17895
17899
  if (!listed.ok) {
17896
17900
  attachmentsListNote = `attachments-list fetch failed (${listed.error.type}: ${listed.error.message}) — markdown body returned without attachment metadata`;
17897
17901
  } else {
17898
- const parsed2 = attachmentsListSchema.safeParse(listed.value);
17899
- if (parsed2.success) {
17900
- attachments = parsed2.data.value ?? [];
17902
+ const parsed = attachmentsListSchema.safeParse(listed.value);
17903
+ if (parsed.success) {
17904
+ attachments = parsed.data.value ?? [];
17901
17905
  } else {
17902
- attachmentsListNote = `attachments-list returned a malformed shape (${formatZodError(parsed2.error)}) — markdown body returned without attachment metadata`;
17906
+ attachmentsListNote = `attachments-list returned a malformed shape (${formatZodError(parsed.error)}) — markdown body returned without attachment metadata`;
17903
17907
  }
17904
17908
  }
17905
17909
  }
17906
17910
  const inlineImageCandidates = embedInlineImagesEnabled ? attachments.filter(isInlineImage) : [];
17907
- const embedResults = await Promise.all(inlineImageCandidates.map((meta20) => fetchInlineImageBytes(graph, messageId, meta20)));
17911
+ const embedResults = await Promise.all(inlineImageCandidates.map((meta20) => fetchInlineImageBytes(graph, resourcePath, meta20)));
17908
17912
  const inlineImages = embedResults.flatMap((r) => r.inline ? [r.inline] : []);
17909
- const headers = renderHeaders(m);
17910
- const rawHtml = m.body?.content ?? "";
17913
+ const headers = options.renderHeaders(m);
17911
17914
  const withPlaceholders = renderOversizePlaceholders(rawHtml, embedResults);
17912
17915
  const embedded = inlineImages.length > 0 ? embedInlineImages(withPlaceholders, inlineImages) : withPlaceholders;
17913
17916
  const labelByContentId = new Map;
@@ -17933,7 +17936,7 @@ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELEC
17933
17936
  quotedBoundary = findPlainTextQuoteBoundary(inlined);
17934
17937
  bodyMd = stripped.text;
17935
17938
  }
17936
- const fileList = renderFileAttachmentsList(attachments, !embedInlineImagesEnabled);
17939
+ const fileList = renderFileAttachmentsList(attachments, !embedInlineImagesEnabled, options.attachmentHint);
17937
17940
  const text = [headers, bodyMd, fileList].filter((s) => s !== "").join(`
17938
17941
 
17939
17942
  `);
@@ -17950,6 +17953,16 @@ var schema18, INLINE_IMAGE_SIZE_LIMIT_BYTES = 2000000, ATTACHMENT_METADATA_SELEC
17950
17953
  if (notes.length > 0)
17951
17954
  envelope.note = notes.join("; ");
17952
17955
  return ok(envelope);
17956
+ }, MAIL_ATTACHMENT_HINT = "_Use `convert-mail-attachment-to-pdf` or `get-mail-attachment` with the attachment id to fetch._", execute18 = async (graph, params) => {
17957
+ const parsed = schema18.safeParse(params);
17958
+ if (!parsed.success)
17959
+ return err({ type: "validation_error", message: formatZodError(parsed.error) });
17960
+ return renderMessageAsMarkdown(graph, `/me/messages/${parsed.data.messageId}`, {
17961
+ inlineImages: parsed.data.inlineImages === "true",
17962
+ keepQuoted: parsed.data.keepQuoted === "true",
17963
+ attachmentHint: MAIL_ATTACHMENT_HINT,
17964
+ renderHeaders
17965
+ });
17953
17966
  }, meta20;
17954
17967
  var init_convert_mail_to_markdown = __esm(() => {
17955
17968
  init_zod();
@@ -17974,7 +17987,7 @@ var init_convert_mail_to_markdown = __esm(() => {
17974
17987
  value: exports_external.array(attachmentMetaSchema).optional()
17975
17988
  });
17976
17989
  meta20 = {
17977
- summary: "Render a single Outlook email as markdown — headers (`**Subject:**`, `**From:**`, `**To:**`, `**Cc:**` only when present, `**Date:**`), followed by the body run through turndown. By default NO image bytes are fetched: every inline `cid:` image renders as a readable `[inline image: <name>]` placeholder and the images surface in the file-attachments list, so the output stays close to the text size (an email whose 6 KB body carried 30 KB of signature-image base64 now ships at ~6 KB). Pass `--inline-images true` to embed inline images (`isInline:true` + `image/*` content-type, size ≤ 2 MB) as base64 `data:` URIs for self-contained output (non-image inline attachments are never embedded; oversize inline images keep a placeholder note; a cid whose per-image fetch fails degrades to the placeholder too). File attachments are always listed below the body by name + size + id; their bytes are NOT fetched here — call `convert-mail-attachment-to-pdf` or `get-mail-attachment` with the id when you actually need them. Staged-fetch design: one call for the body, one for the attachments-metadata list (only if `hasAttachments:true`), and with `--inline-images true` one per small inline image — replaces the old `?$expand=attachments` which timed out / truncated on messages with multi-MB attachments.",
17990
+ summary: "Render a single Outlook email as markdown — headers (`**Subject:**`, `**From:**`, `**To:**`, `**Cc:**` only when present, `**Date:**`), followed by the body run through turndown. By default NO image bytes are fetched: every inline `cid:` image renders as a readable `[inline image: <name>]` placeholder and the images surface in the file-attachments list, so the output stays close to the text size (an email whose 6 KB body carried 30 KB of signature-image base64 now ships at ~6 KB). Pass `--inline-images true` to embed inline images (`isInline:true` + `image/*` content-type, size ≤ 2 MB) as base64 `data:` URIs for self-contained output (non-image inline attachments are never embedded; oversize inline images keep a placeholder note; a cid whose per-image fetch fails degrades to the placeholder too). File attachments are always listed below the body by name + size + id; their bytes are NOT fetched here — call `convert-mail-attachment-to-pdf` or `get-mail-attachment` with the id when you actually need them. Staged-fetch design: one call for the body, one for the attachments-metadata list (when `hasAttachments` is true or the body references a `cid:` image, since Graph reports false for inline-only mail), and with `--inline-images true` one per small inline image — replaces the old `?$expand=attachments` which timed out / truncated on messages with multi-MB attachments.",
17978
17991
  category: "mail",
17979
17992
  graphMethod: "GET",
17980
17993
  graphPathTemplate: "/me/messages/{message-id}",
@@ -18048,7 +18061,7 @@ var schema19, SCAN_LIMIT = 10, SENT_SCAN_PATH, sentListSchema, messageSchema, in
18048
18061
  if (!parsed.success)
18049
18062
  return { html: block, count: 0, note: "the inline-image list came back in an unreadable shape, so any cid: references are unresolved" };
18050
18063
  const referenced = (parsed.data.value ?? []).filter(isInlineImage).filter((a) => block.includes(`cid:${a.contentId}`));
18051
- const fetched = await Promise.all(referenced.map((meta21) => fetchInlineImageBytes(graph, messageId, meta21)));
18064
+ const fetched = await Promise.all(referenced.map((meta21) => fetchInlineImageBytes(graph, `/me/messages/${messageId}`, meta21)));
18052
18065
  const embeddable = fetched.flatMap((f) => f.inline === undefined ? [] : [f.inline]);
18053
18066
  const skipped = fetched.filter((f) => f.inline === undefined);
18054
18067
  const html = embeddable.length > 0 ? embedInlineImages(block, embeddable) : block;
@@ -18056,7 +18069,7 @@ var schema19, SCAN_LIMIT = 10, SENT_SCAN_PATH, sentListSchema, messageSchema, in
18056
18069
  return { html, count: embeddable.length };
18057
18070
  const named = skipped.map((f) => `${f.meta.name ?? "image"} (${formatBytes(f.meta.size ?? 0)})`).join(", ");
18058
18071
  return { html, count: embeddable.length, note: `${skipped.length} inline image${skipped.length === 1 ? "" : "s"} left as a cid: reference: ${named}` };
18059
- }, referencesCidImage = (block) => /\bsrc\s*=\s*["']cid:/i.test(block), noSignatureFound = (messageId, scanned) => {
18072
+ }, referencesCidImage2 = (block) => /\bsrc\s*=\s*["']cid:/i.test(block), noSignatureFound = (messageId, scanned) => {
18060
18073
  const plural = scanned === 1 ? "" : "s";
18061
18074
  const scanMessage = `No OWA signature block (\`<div id="Signature">\`) was found in the last ${scanned} sent message${plural}. Mail composed in Outlook desktop does not carry the marker, so a signature may exist without being findable this way - pass --message-id to pin a message you know was sent from Outlook on the web.`;
18062
18075
  const pinnedMessage = `Message ${messageId} carries no OWA signature block (\`<div id="Signature">\`). Mail composed in Outlook desktop does not carry the marker; pin a message sent from Outlook on the web instead.`;
@@ -18102,7 +18115,7 @@ var schema19, SCAN_LIMIT = 10, SENT_SCAN_PATH, sentListSchema, messageSchema, in
18102
18115
  const block = extractSignatureBlock(message.data.body.content);
18103
18116
  if (block === undefined)
18104
18117
  continue;
18105
- const inlined = referencesCidImage(block) ? await inlineSignatureImages(graph, id, block) : { html: block, count: 0 };
18118
+ const inlined = referencesCidImage2(block) ? await inlineSignatureImages(graph, id, block) : { html: block, count: 0 };
18106
18119
  return ok(buildEnvelope(id, block, message.data.sentDateTime, inlined));
18107
18120
  }
18108
18121
  return err(noSignatureFound(messageId, candidates.value.length));
@@ -21142,13 +21155,14 @@ var init_sharepoint_link_extractor = __esm(() => {
21142
21155
  // src/use-cases/commands/convert-mail-attachment-to-markdown.ts
21143
21156
  var exports_convert_mail_attachment_to_markdown = {};
21144
21157
  __export(exports_convert_mail_attachment_to_markdown, {
21158
+ MAIL_HINTS: () => MAIL_HINTS,
21145
21159
  convertAttachmentToMarkdown: () => convertAttachmentToMarkdown,
21146
21160
  convertFetchedAttachment: () => convertFetchedAttachment,
21147
21161
  execute: () => execute86,
21148
21162
  meta: () => meta88,
21149
21163
  schema: () => schema86
21150
21164
  });
21151
- var schema86, MAIL_HINTS, convertFileAttachment = (attachment, opts) => bytesToMarkdown(base64ToBytes(attachment.contentBytes ?? ""), attachment.name ?? "unnamed", opts, MAIL_HINTS), convertReferenceAttachment = async (graph, attachment, opts) => {
21165
+ var schema86, MAIL_HINTS, convertFileAttachment = (attachment, opts, hints) => bytesToMarkdown(base64ToBytes(attachment.contentBytes ?? ""), attachment.name ?? "unnamed", opts, hints), convertReferenceAttachment = async (graph, attachment, opts) => {
21152
21166
  const sourceUrl = attachment.sourceUrl;
21153
21167
  if (typeof sourceUrl !== "string" || sourceUrl === "") {
21154
21168
  return err({
@@ -21196,14 +21210,14 @@ var schema86, MAIL_HINTS, convertFileAttachment = (attachment, opts) => bytesToM
21196
21210
  default:
21197
21211
  return err({ type: "api_error", status: 400, message: `unsupported embedded item type: ${innerType}` });
21198
21212
  }
21199
- }, convertFetchedAttachment = (graph, a, opts) => {
21213
+ }, convertFetchedAttachment = (graph, a, opts, hints) => {
21200
21214
  const odataType = a["@odata.type"];
21201
21215
  if (typeof odataType !== "string") {
21202
21216
  return err({ type: "api_error", status: 400, message: "attachment response missing @odata.type discriminator" });
21203
21217
  }
21204
21218
  switch (odataType) {
21205
21219
  case "#microsoft.graph.fileAttachment":
21206
- return convertFileAttachment(a, opts);
21220
+ return convertFileAttachment(a, opts, hints);
21207
21221
  case "#microsoft.graph.referenceAttachment":
21208
21222
  return convertReferenceAttachment(graph, a, opts);
21209
21223
  case "#microsoft.graph.itemAttachment":
@@ -21211,20 +21225,17 @@ var schema86, MAIL_HINTS, convertFileAttachment = (attachment, opts) => bytesToM
21211
21225
  default:
21212
21226
  return err({ type: "api_error", status: 400, message: `unsupported attachment type: ${odataType}` });
21213
21227
  }
21214
- }, convertAttachmentToMarkdown = async (graph, attachmentPath, opts) => {
21228
+ }, convertAttachmentToMarkdown = async (graph, attachmentPath, opts, hints) => {
21215
21229
  const fetched = await graph.get(attachmentPath);
21216
21230
  if (!fetched.ok)
21217
21231
  return fetched;
21218
- return convertFetchedAttachment(graph, fetched.value, opts);
21232
+ return convertFetchedAttachment(graph, fetched.value, opts, hints);
21219
21233
  }, execute86 = async (graph, params) => {
21220
21234
  const parsed = schema86.safeParse(params);
21221
21235
  if (!parsed.success)
21222
21236
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
21223
21237
  const { messageId, attachmentId } = parsed.data;
21224
- return convertAttachmentToMarkdown(graph, `/me/messages/${messageId}/attachments/${attachmentId}`, {
21225
- includeMetadata: parsed.data.includeMetadata === "true",
21226
- keepQuoted: parsed.data.keepQuoted === "true"
21227
- });
21238
+ return convertAttachmentToMarkdown(graph, `/me/messages/${messageId}/attachments/${attachmentId}`, { includeMetadata: parsed.data.includeMetadata === "true", keepQuoted: parsed.data.keepQuoted === "true" }, MAIL_HINTS);
21228
21239
  }, meta88;
21229
21240
  var init_convert_mail_attachment_to_markdown = __esm(() => {
21230
21241
  init_zod();
@@ -21346,11 +21357,7 @@ var schema87, isZipAttachment = (a) => {
21346
21357
  const ext = Object.hasOwn(CONTENT_TYPE_EXTENSIONS, contentType) ? CONTENT_TYPE_EXTENSIONS[contentType] : undefined;
21347
21358
  if (ext === undefined)
21348
21359
  return a;
21349
- const name = typeof a["name"] === "string" ? a["name"] : "";
21350
- const dot = name.lastIndexOf(".");
21351
- if ((dot === -1 ? "" : name.slice(dot + 1).toLowerCase()) === ext)
21352
- return a;
21353
- return { ...a, name: `${dot === -1 ? name || "attachment" : name.slice(0, dot)}.${ext}` };
21360
+ return { ...a, name: `attachment.${ext}` };
21354
21361
  }, execute87 = async (graph, params) => {
21355
21362
  const parsed = schema87.safeParse(params);
21356
21363
  if (!parsed.success)
@@ -21369,7 +21376,7 @@ var schema87, isZipAttachment = (a) => {
21369
21376
  }
21370
21377
  return convertZipArchive(base64ToBytes(contentBytes), { includeMetadata, keepQuoted });
21371
21378
  }
21372
- return convertFetchedAttachment(graph, nameByContentType(a), { includeMetadata, keepQuoted });
21379
+ return convertFetchedAttachment(graph, nameByContentType(a), { includeMetadata, keepQuoted }, MAIL_HINTS);
21373
21380
  }, meta89;
21374
21381
  var init_read_mail_attachment = __esm(() => {
21375
21382
  init_zod();
@@ -21702,21 +21709,24 @@ __export(exports_convert_calendar_event_attachment_to_markdown, {
21702
21709
  meta: () => meta93,
21703
21710
  schema: () => schema91
21704
21711
  });
21705
- var schema91, execute91 = async (graph, params) => {
21712
+ var CALENDAR_HINTS, schema91, execute91 = async (graph, params) => {
21706
21713
  const parsed = schema91.safeParse(params);
21707
21714
  if (!parsed.success)
21708
21715
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
21709
21716
  const { eventId, attachmentId } = parsed.data;
21710
- return convertAttachmentToMarkdown(graph, `/me/events/${eventId}/attachments/${attachmentId}`, {
21711
- includeMetadata: parsed.data.includeMetadata === "true",
21712
- keepQuoted: parsed.data.keepQuoted === "true"
21713
- });
21717
+ return convertAttachmentToMarkdown(graph, `/me/events/${eventId}/attachments/${attachmentId}`, { includeMetadata: parsed.data.includeMetadata === "true", keepQuoted: parsed.data.keepQuoted === "true" }, CALENDAR_HINTS);
21714
21718
  }, meta93;
21715
21719
  var init_convert_calendar_event_attachment_to_markdown = __esm(() => {
21716
21720
  init_zod();
21717
21721
  init_convert_mail_attachment_to_markdown();
21718
21722
  init_format_zod_error();
21719
21723
  init_mail_quote_stripper();
21724
+ CALENDAR_HINTS = {
21725
+ pdfNoText: "pdf attachment has no extractable text layer — it looks scanned / image-only (only page images, no embedded text). Use `convert-calendar-event-attachment-to-pdf --output-path /tmp/file.pdf` to land the bytes on disk, then read the PDF with a vision-capable model, or run OCR.",
21726
+ legacyPpt: "ppt (legacy PowerPoint 97-2003, OLE binary) cannot be converted to markdown — there is no pure-JS parser for the format. Use `convert-calendar-event-attachment-to-pdf --output-path /tmp/file.pdf` to render it, then read the PDF with a vision-capable model.",
21727
+ image: (ext) => `${ext} attachment is an image and cannot be converted to markdown. Fetch the bytes with \`get-calendar-event --event-id <id> --expand attachments\`, which returns each attachment's base64 \`contentBytes\` inline, and feed them into a vision-capable model. (\`convert-calendar-event-attachment-to-pdf\` is NOT a workaround: Graph's format=pdf rejects images with InputFormatNotSupported.)`,
21728
+ generic: (ext) => `${ext} attachment not supported by \`convert-calendar-event-attachment-to-markdown\`. Use \`convert-calendar-event-attachment-to-pdf\` — Graph \`?format=pdf\` accepts 38 input extensions.`
21729
+ };
21720
21730
  schema91 = exports_external.object({
21721
21731
  eventId: exports_external.string().min(1),
21722
21732
  attachmentId: exports_external.string().min(1),
@@ -25508,15 +25518,16 @@ __export(exports_list_group_conversations, {
25508
25518
  meta: () => meta164,
25509
25519
  schema: () => schema162
25510
25520
  });
25511
- var baseSchema85, execute162, schema162, meta164;
25521
+ var HONOURED, baseSchema85, execute162, schema162, meta164;
25512
25522
  var init_list_group_conversations = __esm(() => {
25513
25523
  init_zod();
25514
25524
  init_build_command();
25515
25525
  init_odata_query();
25526
+ HONOURED = ["top", "skip", "select", "orderby", "expand"];
25516
25527
  baseSchema85 = exports_external.object({ groupId: exports_external.string().min(1) });
25517
- ({ execute: execute162, schema: schema162 } = buildListCommand((p) => `/groups/${p.groupId}/conversations`, baseSchema85));
25528
+ ({ execute: execute162, schema: schema162 } = buildPickODataListCommand((p) => `/groups/${p.groupId}/conversations`, baseSchema85, HONOURED));
25518
25529
  meta164 = {
25519
- summary: "List conversations in a unified (Microsoft 365) group inbox. Each conversation aggregates one or more threads. Only Microsoft 365 groups have a mailbox — security and distribution groups return `MailboxNotEnabledForRESTAPI`. Verify the group is unified before calling.",
25530
+ summary: "List conversations in a unified (Microsoft 365) group inbox. Each conversation aggregates one or more threads. Only Microsoft 365 groups have a mailbox — security and distribution groups return `MailboxNotEnabledForRESTAPI`. Verify the group is unified before calling. Bodies live two levels down: `list-group-threads` then `list-group-thread-posts`, or `--expand 'threads($expand=posts)'` here to fetch conversations, threads and posts in one call.",
25520
25531
  category: "mail",
25521
25532
  graphMethod: "GET",
25522
25533
  graphPathTemplate: "/groups/{group-id}/conversations",
@@ -25528,7 +25539,7 @@ var init_list_group_conversations = __esm(() => {
25528
25539
  required: true,
25529
25540
  description: "Azure AD group object ID for a unified (Microsoft 365) group."
25530
25541
  },
25531
- ...odataQueryOptions
25542
+ ...pickODataOptions(HONOURED)
25532
25543
  ],
25533
25544
  example: "ask-marcel-office list-group-conversations --group-id 'a1b2c3d4-...'",
25534
25545
  responseShape: "collection of Microsoft Graph `conversation` resources under `value[]`",
@@ -25543,15 +25554,16 @@ __export(exports_list_group_threads, {
25543
25554
  meta: () => meta165,
25544
25555
  schema: () => schema163
25545
25556
  });
25546
- var baseSchema86, execute163, schema163, meta165;
25557
+ var HONOURED2, baseSchema86, execute163, schema163, meta165;
25547
25558
  var init_list_group_threads = __esm(() => {
25548
25559
  init_zod();
25549
25560
  init_build_command();
25550
25561
  init_odata_query();
25562
+ HONOURED2 = ["top", "skip", "select", "orderby", "expand"];
25551
25563
  baseSchema86 = exports_external.object({ groupId: exports_external.string().min(1) });
25552
- ({ execute: execute163, schema: schema163 } = buildListCommand((p) => `/groups/${p.groupId}/threads`, baseSchema86));
25564
+ ({ execute: execute163, schema: schema163 } = buildPickODataListCommand((p) => `/groups/${p.groupId}/threads`, baseSchema86, HONOURED2));
25553
25565
  meta165 = {
25554
- summary: "List threads in a unified (Microsoft 365) group inbox. Threads are flatter than conversations — one per topic, useful when conversation-level grouping isn't needed. Only Microsoft 365 groups have a mailbox — security and distribution groups return `MailboxNotEnabledForRESTAPI`.",
25566
+ summary: "List threads in a unified (Microsoft 365) group inbox. Threads are flatter than conversations — one per topic, useful when conversation-level grouping isn't needed. Only Microsoft 365 groups have a mailbox — security and distribution groups return `MailboxNotEnabledForRESTAPI`. Each thread carries only a truncated `preview` of its latest post: read the full posts with `list-group-thread-posts`, or pass `--expand posts` here to inline them.",
25555
25567
  category: "mail",
25556
25568
  graphMethod: "GET",
25557
25569
  graphPathTemplate: "/groups/{group-id}/threads",
@@ -25563,7 +25575,7 @@ var init_list_group_threads = __esm(() => {
25563
25575
  required: true,
25564
25576
  description: "Azure AD group object ID for a unified (Microsoft 365) group."
25565
25577
  },
25566
- ...odataQueryOptions
25578
+ ...pickODataOptions(HONOURED2)
25567
25579
  ],
25568
25580
  example: "ask-marcel-office list-group-threads --group-id 'a1b2c3d4-...'",
25569
25581
  responseShape: "collection of Microsoft Graph `conversationThread` resources under `value[]`",
@@ -25571,25 +25583,391 @@ var init_list_group_threads = __esm(() => {
25571
25583
  };
25572
25584
  });
25573
25585
 
25574
- // src/use-cases/commands/get-mail-message-mime.ts
25575
- var exports_get_mail_message_mime = {};
25576
- __export(exports_get_mail_message_mime, {
25586
+ // src/use-cases/commands/list-group-thread-posts.ts
25587
+ var exports_list_group_thread_posts = {};
25588
+ __export(exports_list_group_thread_posts, {
25577
25589
  execute: () => execute164,
25578
25590
  meta: () => meta166,
25579
25591
  schema: () => schema164
25580
25592
  });
25581
- var schema164, execute164 = async (graph, params) => {
25582
- const parsed = schema164.safeParse(params);
25593
+ var baseSchema87, execute164, schema164, meta166;
25594
+ var init_list_group_thread_posts = __esm(() => {
25595
+ init_zod();
25596
+ init_build_command();
25597
+ init_odata_query();
25598
+ baseSchema87 = exports_external.object({ groupId: exports_external.string().min(1), threadId: exports_external.string().min(1) });
25599
+ ({ execute: execute164, schema: schema164 } = buildPickODataListCommand((p) => `/groups/${p.groupId}/threads/${p.threadId}/posts`, baseSchema87, ["select", "expand"]));
25600
+ meta166 = {
25601
+ summary: "List every post in one thread of a unified (Microsoft 365) group inbox: the full `post` resources with the HTML `body.content`, `from`, `sender`, `receivedDateTime` and `hasAttachments`, where `list-group-threads` stops at a truncated `preview`. Graph returns the whole thread in one call with no page cursor, and it silently ignores `$top`, `$skip` and `$orderby` while rejecting `$filter` (probed live 2026-09-03), so only `--select` and `--expand` are exposed; sort on `receivedDateTime` client-side if order matters. `sender` is the person who wrote the post and `from` is normally the group's own address. Render one post as markdown with `convert-group-post-to-markdown`. Access is membership-gated, not scope-gated: a group the signed-in user does not belong to answers `ErrorAccessDenied` even though `list-groups` lists it.",
25602
+ category: "mail",
25603
+ graphMethod: "GET",
25604
+ graphPathTemplate: "/groups/{group-id}/threads/{thread-id}/posts",
25605
+ graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/conversationthread-list-posts",
25606
+ options: [
25607
+ {
25608
+ name: "group-id",
25609
+ key: "groupId",
25610
+ required: true,
25611
+ description: "Azure AD group object ID for a unified (Microsoft 365) group the signed-in user belongs to."
25612
+ },
25613
+ {
25614
+ name: "thread-id",
25615
+ key: "threadId",
25616
+ required: true,
25617
+ description: "Conversation thread ID, the `id` of a `list-group-threads` entry (also inlined by `list-group-conversations --expand threads`)."
25618
+ },
25619
+ ...selectExpandOptions
25620
+ ],
25621
+ example: "ask-marcel-office list-group-thread-posts --group-id 'a1b2c3d4-...' --thread-id 'AAQkAD...'",
25622
+ responseShape: "collection of Microsoft Graph `post` resources under `value[]`: `id`, `createdDateTime`, `lastModifiedDateTime`, `changeKey`, `categories`, `receivedDateTime`, `hasAttachments`, `body { contentType, content }`, `from`, `sender`. No `nextLink` is ever emitted. `hasAttachments` is false for a post whose only attachments are inline images. `--expand attachments` inlines every attachment of every post with its base64 `contentBytes`, so use it sparingly."
25623
+ };
25624
+ });
25625
+
25626
+ // src/use-cases/commands/get-group-post.ts
25627
+ var exports_get_group_post = {};
25628
+ __export(exports_get_group_post, {
25629
+ execute: () => execute165,
25630
+ meta: () => meta167,
25631
+ schema: () => schema165
25632
+ });
25633
+ var baseSchema88, execute165, schema165, meta167;
25634
+ var init_get_group_post = __esm(() => {
25635
+ init_zod();
25636
+ init_build_command();
25637
+ init_odata_query();
25638
+ baseSchema88 = exports_external.object({ groupId: exports_external.string().min(1), threadId: exports_external.string().min(1), postId: exports_external.string().min(1) });
25639
+ ({ execute: execute165, schema: schema165 } = buildSelectableCommand((p) => `/groups/${p.groupId}/threads/${p.threadId}/posts/${p.postId}`, baseSchema88));
25640
+ meta167 = {
25641
+ summary: "Get a single post of a unified (Microsoft 365) group thread by ID, the sibling of `get-mail-message` for a group inbox: the full `post` resource including the HTML `body`. `--select` trims the projection. `--expand attachments` returns every attachment inline with its base64 `contentBytes`, which is convenient for a small post and the wrong shape for one carrying a multi-MB file: list them with `list-group-post-attachments` and fetch one with `get-group-post-attachment` instead. Post IDs come from `list-group-thread-posts`; use `convert-group-post-to-markdown` for a readable rendering.",
25642
+ category: "mail",
25643
+ graphMethod: "GET",
25644
+ graphPathTemplate: "/groups/{group-id}/threads/{thread-id}/posts/{post-id}",
25645
+ graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/post-get",
25646
+ options: [
25647
+ {
25648
+ name: "group-id",
25649
+ key: "groupId",
25650
+ required: true,
25651
+ description: "Azure AD group object ID for a unified (Microsoft 365) group the signed-in user belongs to."
25652
+ },
25653
+ {
25654
+ name: "thread-id",
25655
+ key: "threadId",
25656
+ required: true,
25657
+ description: "Conversation thread ID, the `id` of a `list-group-threads` entry."
25658
+ },
25659
+ {
25660
+ name: "post-id",
25661
+ key: "postId",
25662
+ required: true,
25663
+ description: "Post ID inside that thread. Returned by `list-group-thread-posts`."
25664
+ },
25665
+ ...selectExpandOptions
25666
+ ],
25667
+ example: "ask-marcel-office get-group-post --group-id 'a1b2c3d4-...' --thread-id 'AAQkAD...' --post-id 'AQMkAD...'",
25668
+ responseShape: "single Microsoft Graph `post` resource: `id`, `createdDateTime`, `lastModifiedDateTime`, `changeKey`, `categories`, `receivedDateTime`, `hasAttachments`, `body { contentType, content }`, `from` (normally the group address), `sender` (the person who wrote it). With `--expand attachments`, an `attachments[]` array of `fileAttachment` / `itemAttachment` / `referenceAttachment` entries, file attachments carrying `contentBytes` inline."
25669
+ };
25670
+ });
25671
+
25672
+ // src/use-cases/commands/convert-group-post-to-markdown.ts
25673
+ var exports_convert_group_post_to_markdown = {};
25674
+ __export(exports_convert_group_post_to_markdown, {
25675
+ execute: () => execute166,
25676
+ meta: () => meta168,
25677
+ schema: () => schema166
25678
+ });
25679
+ var schema166, renderPostHeaders = (m) => {
25680
+ const lines = [];
25681
+ const from = formatAddress2(m.from?.emailAddress);
25682
+ const author = formatAddress2(m.sender?.emailAddress) ?? from;
25683
+ if (author !== undefined)
25684
+ lines.push(from === undefined || from === author ? `**From:** ${author}` : `**From:** ${author} on behalf of ${from}`);
25685
+ if (nonEmpty(m.receivedDateTime))
25686
+ lines.push(`**Date:** ${m.receivedDateTime}`);
25687
+ return lines.join(`
25688
+ `);
25689
+ }, POST_ATTACHMENT_HINT = "_Use `convert-group-post-attachment-to-markdown` or `get-group-post-attachment` with the attachment id to fetch._", execute166 = async (graph, params) => {
25690
+ const parsed = schema166.safeParse(params);
25691
+ if (!parsed.success)
25692
+ return err({ type: "validation_error", message: formatZodError(parsed.error) });
25693
+ const { groupId, threadId, postId } = parsed.data;
25694
+ return renderMessageAsMarkdown(graph, `/groups/${groupId}/threads/${threadId}/posts/${postId}`, {
25695
+ inlineImages: parsed.data.inlineImages === "true",
25696
+ keepQuoted: parsed.data.keepQuoted === "true",
25697
+ attachmentHint: POST_ATTACHMENT_HINT,
25698
+ renderHeaders: renderPostHeaders
25699
+ });
25700
+ }, meta168;
25701
+ var init_convert_group_post_to_markdown = __esm(() => {
25702
+ init_zod();
25703
+ init_convert_mail_to_markdown();
25704
+ init_format_zod_error();
25705
+ schema166 = exports_external.object({
25706
+ groupId: exports_external.string().min(1),
25707
+ threadId: exports_external.string().min(1),
25708
+ postId: exports_external.string().min(1),
25709
+ inlineImages: exports_external.enum(["true", "false"]).optional(),
25710
+ keepQuoted: exports_external.enum(["true", "false"]).optional()
25711
+ });
25712
+ meta168 = {
25713
+ summary: "Render one post of a unified (Microsoft 365) group thread as markdown, the way `convert-mail-to-markdown` renders an Outlook message: a `**From:**` line, a `**Date:**` line, then the HTML body through turndown with quoted reply chains stripped. A post arrives from the group's own address with the writer in `sender`, so the author line reads `Robin Chen <robin.chen@contoso.com> on behalf of Support <support@contoso.com>`. There is no subject line: the thread `topic` is the subject and lives on `list-group-threads`. By default no image bytes are fetched; inline `cid:` images render as `[inline image: <name>]` placeholders unless `--inline-images true`. File attachments are listed below the body by name, size and id and their bytes are never fetched here; read one with `convert-group-post-attachment-to-markdown` or fetch it with `get-group-post-attachment`. Same staged-fetch design as the mail command: one call for the post, one for the attachment list when `hasAttachments` is true or the body references a `cid:` image (Graph reports false for a post whose only attachments are inline), and with `--inline-images true` one per small inline image.",
25714
+ category: "mail",
25715
+ graphMethod: "GET",
25716
+ graphPathTemplate: "/groups/{group-id}/threads/{thread-id}/posts/{post-id}",
25717
+ graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/post-get",
25718
+ options: [
25719
+ {
25720
+ name: "group-id",
25721
+ key: "groupId",
25722
+ required: true,
25723
+ description: "Azure AD group object ID for a unified (Microsoft 365) group the signed-in user belongs to."
25724
+ },
25725
+ {
25726
+ name: "thread-id",
25727
+ key: "threadId",
25728
+ required: true,
25729
+ description: "Conversation thread ID, the `id` of a `list-group-threads` entry."
25730
+ },
25731
+ {
25732
+ name: "post-id",
25733
+ key: "postId",
25734
+ required: true,
25735
+ description: "Post ID inside that thread. Returned by `list-group-thread-posts`."
25736
+ },
25737
+ {
25738
+ name: "inline-images",
25739
+ key: "inlineImages",
25740
+ required: false,
25741
+ description: "Pass `--inline-images true` to fetch small inline images (≤ 2 MB, `image/*` only) and embed them as base64 `data:` URIs. Default is `false`: no per-image bytes fetch, and every inline `cid:` image renders as a `[inline image: <name>]` placeholder while still appearing in the attachments list. Same rule as `convert-mail-to-markdown`.",
25742
+ argumentHint: { kind: "magicValue", values: ["true", "false"] }
25743
+ },
25744
+ {
25745
+ name: "keep-quoted",
25746
+ key: "keepQuoted",
25747
+ required: false,
25748
+ description: "Quoted reply chains and forwarded-message blocks are stripped by default and replaced with a single visible marker naming this flag; the `note` reports the share of the body text that went with them. Pass `--keep-quoted true` to preserve the full body. The markers recognised are the ones `convert-mail-to-markdown` documents.",
25749
+ argumentHint: { kind: "magicValue", values: ["true", "false"] }
25750
+ }
25751
+ ],
25752
+ example: "ask-marcel-office convert-group-post-to-markdown --group-id 'a1b2c3d4-...' --thread-id 'AAQkAD...' --post-id 'AQMkAD...'",
25753
+ responseShape: '`{ contentType: "text/markdown", size, text, note? }`, the same envelope as `convert-mail-to-markdown`: headers, the turndown-rendered body and, when present, an attachments list. The optional `note` carries the attachments-list failure hint and/or the quoted-chain notice with the share of the body text it removed.',
25754
+ producesBytes: true
25755
+ };
25756
+ });
25757
+
25758
+ // src/use-cases/commands/list-group-post-attachments.ts
25759
+ var exports_list_group_post_attachments = {};
25760
+ __export(exports_list_group_post_attachments, {
25761
+ execute: () => execute167,
25762
+ meta: () => meta169,
25763
+ schema: () => schema167
25764
+ });
25765
+ var baseSchema89, DEFAULT_SELECT7 = "id,name,contentType,size,isInline", execute167, schema167, meta169;
25766
+ var init_list_group_post_attachments = __esm(() => {
25767
+ init_zod();
25768
+ init_build_command();
25769
+ init_odata_query();
25770
+ baseSchema89 = exports_external.object({ groupId: exports_external.string().min(1), threadId: exports_external.string().min(1), postId: exports_external.string().min(1) });
25771
+ ({ execute: execute167, schema: schema167 } = buildPickODataListCommand((p) => `/groups/${p.groupId}/threads/${p.threadId}/posts/${p.postId}/attachments`, baseSchema89, ["select", "expand"], {
25772
+ defaultSelect: DEFAULT_SELECT7
25773
+ }));
25774
+ meta169 = {
25775
+ summary: "List the attachments (file, item, reference) on one post of a unified (Microsoft 365) group thread. Ships the slim default `--select=id,name,contentType,size,isInline` the mail and calendar siblings use, so a caller sees what is attached without pulling any bytes — the staged alternative to `get-group-post --expand attachments`, which inlines EVERY attachment at once and times out on a post carrying a multi-MB file. Graph returns the whole collection in one response and silently ignores `$top`, `$skip`, `$orderby` and `$filter` (probed live 2026-09-03), so only `--select` and `--expand` are exposed. A post whose only attachments are inline images reports `hasAttachments: false`, so call this whenever the body shows `cid:` references. Read one with `convert-group-post-attachment-to-markdown`, or fetch its bytes with `get-group-post-attachment`.",
25776
+ category: "mail",
25777
+ graphMethod: "GET",
25778
+ graphPathTemplate: "/groups/{group-id}/threads/{thread-id}/posts/{post-id}/attachments",
25779
+ graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/post-list-attachments",
25780
+ options: [
25781
+ {
25782
+ name: "group-id",
25783
+ key: "groupId",
25784
+ required: true,
25785
+ description: "Azure AD group object ID for a unified (Microsoft 365) group you belong to."
25786
+ },
25787
+ {
25788
+ name: "thread-id",
25789
+ key: "threadId",
25790
+ required: true,
25791
+ description: "Conversation thread ID, the `id` of a `list-group-threads` entry."
25792
+ },
25793
+ {
25794
+ name: "post-id",
25795
+ key: "postId",
25796
+ required: true,
25797
+ description: "Post ID inside that thread. Returned by `list-group-thread-posts`."
25798
+ },
25799
+ ...selectExpandOptions
25800
+ ],
25801
+ example: "ask-marcel-office list-group-post-attachments --group-id 'a1b2c3d4-...' --thread-id 'AAQkAD...' --post-id 'AQMkAD...'",
25802
+ responseShape: "collection of Microsoft Graph `attachment` resources under `value[]` (slim metadata by default — see summary), with no page cursor. Graph always includes `@odata.type` and `@odata.mediaContentType` on every entry regardless of `--select`; that discriminator is what the converting sibling branches on. An inline image carries `isInline: true` and a `contentId` matching a `cid:` reference in the post body."
25803
+ };
25804
+ });
25805
+
25806
+ // src/use-cases/commands/get-group-post-attachment.ts
25807
+ var exports_get_group_post_attachment = {};
25808
+ __export(exports_get_group_post_attachment, {
25809
+ execute: () => execute168,
25810
+ meta: () => meta170,
25811
+ schema: () => schema168
25812
+ });
25813
+ var schema168, execute168 = async (graph, params) => {
25814
+ const parsed = schema168.safeParse(params);
25815
+ if (!parsed.success)
25816
+ return err({ type: "validation_error", message: formatZodError(parsed.error) });
25817
+ const { groupId, threadId, postId, attachmentId } = parsed.data;
25818
+ const path = appendOData(`/groups/${groupId}/threads/${threadId}/posts/${postId}/attachments/${attachmentId}`, parsed.data);
25819
+ const result = await graph.get(path);
25820
+ if (!result.ok)
25821
+ return result;
25822
+ const value = result.value;
25823
+ const contentBytes = value["contentBytes"];
25824
+ if (value["@odata.type"] === "#microsoft.graph.fileAttachment" && typeof contentBytes === "string") {
25825
+ return ok({ ...value, base64: contentBytes });
25826
+ }
25827
+ return ok(value);
25828
+ }, meta170;
25829
+ var init_get_group_post_attachment = __esm(() => {
25830
+ init_zod();
25831
+ init_format_zod_error();
25832
+ init_odata_query();
25833
+ schema168 = exports_external.object({ groupId: exports_external.string().min(1), threadId: exports_external.string().min(1), postId: exports_external.string().min(1), attachmentId: exports_external.string().min(1) }).extend(selectExpandSchema.shape);
25834
+ meta170 = {
25835
+ summary: "Get a single attachment on one post of a unified (Microsoft 365) group thread, the `get-mail-attachment` sibling for a group inbox. Prefer it over `get-group-post --expand attachments`, which expands every attachment at once. fileAttachments carry a `base64` mirror of `contentBytes` so the global output-path flag lands the bytes on disk in one call; with an output-path set both byte fields are stripped from stdout in favour of `savedTo`. Pass `--select id,name,contentType,size` for metadata only. This is also the route to an image attached to a post: fetch the bytes and feed them to a vision-capable model.",
25836
+ category: "mail",
25837
+ graphMethod: "GET",
25838
+ graphPathTemplate: "/groups/{group-id}/threads/{thread-id}/posts/{post-id}/attachments/{attachment-id}",
25839
+ graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/attachment-get",
25840
+ options: [
25841
+ {
25842
+ name: "group-id",
25843
+ key: "groupId",
25844
+ required: true,
25845
+ description: "Azure AD group object ID for a unified (Microsoft 365) group the signed-in user belongs to."
25846
+ },
25847
+ {
25848
+ name: "thread-id",
25849
+ key: "threadId",
25850
+ required: true,
25851
+ description: "Conversation thread ID, the `id` of a `list-group-threads` entry."
25852
+ },
25853
+ {
25854
+ name: "post-id",
25855
+ key: "postId",
25856
+ required: true,
25857
+ description: "Post ID inside that thread. Returned by `list-group-thread-posts`."
25858
+ },
25859
+ {
25860
+ name: "attachment-id",
25861
+ key: "attachmentId",
25862
+ required: true,
25863
+ description: "Attachment ID inside that post. Returned by `list-group-post-attachments`."
25864
+ },
25865
+ ...selectExpandOptions
25866
+ ],
25867
+ example: "ask-marcel-office get-group-post-attachment --group-id 'a1b2c3d4-...' --thread-id 'AAQkAD...' --post-id 'AQMkAD...' --attachment-id 'AAMkAD...'",
25868
+ responseShape: "single Microsoft Graph `attachment` resource. fileAttachments include `contentBytes` (Graph) AND `base64` (CLI mirror) so `--output-path` works; with `--output-path` set, both byte fields are stripped from stdout and replaced by `savedTo`. itemAttachments and referenceAttachments are returned unchanged.",
25869
+ producesBytes: true
25870
+ };
25871
+ });
25872
+
25873
+ // src/use-cases/commands/convert-group-post-attachment-to-markdown.ts
25874
+ var exports_convert_group_post_attachment_to_markdown = {};
25875
+ __export(exports_convert_group_post_attachment_to_markdown, {
25876
+ execute: () => execute169,
25877
+ meta: () => meta171,
25878
+ schema: () => schema169
25879
+ });
25880
+ var POST_HINTS, schema169, execute169 = async (graph, params) => {
25881
+ const parsed = schema169.safeParse(params);
25882
+ if (!parsed.success)
25883
+ return err({ type: "validation_error", message: formatZodError(parsed.error) });
25884
+ const { groupId, threadId, postId, attachmentId } = parsed.data;
25885
+ return convertAttachmentToMarkdown(graph, `/groups/${groupId}/threads/${threadId}/posts/${postId}/attachments/${attachmentId}`, { includeMetadata: parsed.data.includeMetadata === "true", keepQuoted: parsed.data.keepQuoted === "true" }, POST_HINTS);
25886
+ }, meta171;
25887
+ var init_convert_group_post_attachment_to_markdown = __esm(() => {
25888
+ init_zod();
25889
+ init_convert_mail_attachment_to_markdown();
25890
+ init_format_zod_error();
25891
+ init_mail_quote_stripper();
25892
+ POST_HINTS = {
25893
+ pdfNoText: "pdf attachment has no extractable text layer — it looks scanned / image-only (only page images, no embedded text). Fetch the bytes with `get-group-post-attachment --output-path /tmp/file.pdf`, then read the PDF with a vision-capable model, or run OCR.",
25894
+ legacyPpt: "ppt (legacy PowerPoint 97-2003, OLE binary) cannot be converted to markdown — there is no pure-JS parser for the format. Fetch the bytes with `get-group-post-attachment --output-path /tmp/deck.ppt` and convert them outside the CLI, or open the post in Outlook.",
25895
+ image: (ext) => `${ext} attachment is an image and cannot be converted to markdown. Use \`get-group-post-attachment\` to fetch the bytes (returned base64-encoded) and feed them into a vision-capable model directly — that's the right shape for image content.`,
25896
+ generic: (ext) => `${ext} attachment not supported by \`convert-group-post-attachment-to-markdown\`. Fetch the raw bytes with \`get-group-post-attachment\` (add \`--output-path\` to land them on disk) and handle the format outside the CLI.`
25897
+ };
25898
+ schema169 = exports_external.object({
25899
+ groupId: exports_external.string().min(1),
25900
+ threadId: exports_external.string().min(1),
25901
+ postId: exports_external.string().min(1),
25902
+ attachmentId: exports_external.string().min(1),
25903
+ includeMetadata: exports_external.enum(["true", "false"]).optional(),
25904
+ keepQuoted: keepQuotedSchemaField
25905
+ });
25906
+ meta171 = {
25907
+ summary: "Convert an attachment on one post of a unified (Microsoft 365) group thread to markdown, the `convert-mail-attachment-to-markdown` sibling for a group inbox. Polymorphic on the attachment’s `@odata.type` and sharing the mail pipeline: fileAttachment decodes the inline bytes and converts them locally (docx, xlsx, csv, odt/ods/odp, pptx as per-slide text, pdf text layer, legacy .xls/.doc, an Outlook `.msg` rendered recursively with its quoted chain stripped unless `--keep-quoted true`, plain text passed through); referenceAttachment resolves via `/shares/{token}/driveItem`; an embedded mail, event or contact is rendered locally. There is no PDF sibling here, so an image, a scanned PDF, a legacy `.ppt` and any other unsupported format return a 415 pointing at `get-group-post-attachment` for the raw bytes.",
25908
+ category: "mail",
25909
+ graphMethod: "GET",
25910
+ graphPathTemplate: "/groups/{group-id}/threads/{thread-id}/posts/{post-id}/attachments/{attachment-id}",
25911
+ graphDocsUrl: "https://learn.microsoft.com/en-us/graph/api/attachment-get",
25912
+ options: [
25913
+ {
25914
+ name: "group-id",
25915
+ key: "groupId",
25916
+ required: true,
25917
+ description: "Azure AD group object ID for a unified (Microsoft 365) group the signed-in user belongs to."
25918
+ },
25919
+ {
25920
+ name: "thread-id",
25921
+ key: "threadId",
25922
+ required: true,
25923
+ description: "Conversation thread ID, the `id` of a `list-group-threads` entry."
25924
+ },
25925
+ {
25926
+ name: "post-id",
25927
+ key: "postId",
25928
+ required: true,
25929
+ description: "Post ID inside that thread. Returned by `list-group-thread-posts`."
25930
+ },
25931
+ {
25932
+ name: "attachment-id",
25933
+ key: "attachmentId",
25934
+ required: true,
25935
+ description: "Attachment ID inside that post. Returned by `list-group-post-attachments`."
25936
+ },
25937
+ {
25938
+ name: "include-metadata",
25939
+ key: "includeMetadata",
25940
+ required: false,
25941
+ description: "Pass `--include-metadata true` to append the Office side-channel metadata block, exactly as `convert-mail-attachment-to-markdown` documents it. No-op on other attachment types.",
25942
+ argumentHint: { kind: "magicValue", values: ["true", "false"] }
25943
+ },
25944
+ keepQuotedOption
25945
+ ],
25946
+ example: "ask-marcel-office convert-group-post-attachment-to-markdown --group-id 'a1b2c3d4-...' --thread-id 'AAQkAD...' --post-id 'AQMkAD...' --attachment-id 'AAMkAD...'",
25947
+ responseShape: '`{ contentType: "text/markdown", size, text }` on success (file and reference attachments run through the conversion dispatch; an embedded item is rendered locally). Plain-text sources return the raw-bytes envelope, and a PDF source carries `pageCount`. Unsupported types return an api_error with status 415 naming `get-group-post-attachment` as the way to the bytes.',
25948
+ producesBytes: true
25949
+ };
25950
+ });
25951
+
25952
+ // src/use-cases/commands/get-mail-message-mime.ts
25953
+ var exports_get_mail_message_mime = {};
25954
+ __export(exports_get_mail_message_mime, {
25955
+ execute: () => execute170,
25956
+ meta: () => meta172,
25957
+ schema: () => schema170
25958
+ });
25959
+ var schema170, execute170 = async (graph, params) => {
25960
+ const parsed = schema170.safeParse(params);
25583
25961
  if (!parsed.success)
25584
25962
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
25585
25963
  return inlineBinary(graph, `/me/messages/${parsed.data.messageId}/$value`);
25586
- }, meta166;
25964
+ }, meta172;
25587
25965
  var init_get_mail_message_mime = __esm(() => {
25588
25966
  init_zod();
25589
25967
  init_fetch_raw_bytes();
25590
25968
  init_format_zod_error();
25591
- schema164 = exports_external.object({ messageId: exports_external.string().min(1) });
25592
- meta166 = {
25969
+ schema170 = exports_external.object({ messageId: exports_external.string().min(1) });
25970
+ meta172 = {
25593
25971
  summary: "Return the raw RFC 5322 MIME source of a single Outlook message — full headers, every attachment encoded inline. Useful for archiving, full-fidelity forensic inspection, or feeding into a tool that reads MIME directly. For human-readable content prefer `get-mail-message` or `convert-mail-to-markdown`.",
25594
25972
  category: "mail",
25595
25973
  graphMethod: "GET",
@@ -25612,12 +25990,12 @@ var init_get_mail_message_mime = __esm(() => {
25612
25990
  // src/use-cases/commands/list-mail-folder-messages-delta.ts
25613
25991
  var exports_list_mail_folder_messages_delta = {};
25614
25992
  __export(exports_list_mail_folder_messages_delta, {
25615
- execute: () => execute165,
25616
- meta: () => meta167,
25617
- schema: () => schema165
25993
+ execute: () => execute171,
25994
+ meta: () => meta173,
25995
+ schema: () => schema171
25618
25996
  });
25619
- var schema165, execute165 = async (graph, params) => {
25620
- const parsed = schema165.safeParse(params);
25997
+ var schema171, execute171 = async (graph, params) => {
25998
+ const parsed = schema171.safeParse(params);
25621
25999
  if (!parsed.success)
25622
26000
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
25623
26001
  const { mailFolderId, top, ...odata } = parsed.data;
@@ -25625,13 +26003,13 @@ var schema165, execute165 = async (graph, params) => {
25625
26003
  if (top !== undefined)
25626
26004
  headers["Prefer"] = `odata.maxpagesize=${top}`;
25627
26005
  return graph.get(appendOData(`/me/mailFolders/${mailFolderId}/messages/delta()`, odata), headers);
25628
- }, meta167;
26006
+ }, meta173;
25629
26007
  var init_list_mail_folder_messages_delta = __esm(() => {
25630
26008
  init_zod();
25631
26009
  init_format_zod_error();
25632
26010
  init_odata_query();
25633
- schema165 = exports_external.object({ mailFolderId: exports_external.string().min(1) }).extend(pickODataShape(["top", "select", "filter", "expand"]));
25634
- meta167 = {
26011
+ schema171 = exports_external.object({ mailFolderId: exports_external.string().min(1) }).extend(pickODataShape(["top", "select", "filter", "expand"]));
26012
+ meta173 = {
25635
26013
  summary: 'Track incremental changes (added / updated / deleted messages) within a single mail folder using Microsoft Graph delta tokens. The first call returns the current snapshot plus a `@odata.deltaLink`; subsequent calls with that link return only what has changed since. `--top` is translated into the `Prefer: odata.maxpagesize=N` header: as a `$top` query parameter Graph reads a satisfied count as "sync complete" and hands back a deltaLink after N items, silently abandoning the rest of the folder. `$skip` and `$orderby` are NOT exposed — Graph ignores the former on this endpoint and rejects the latter unless it merely restates the default `receivedDateTime desc`.',
25636
26014
  category: "mail",
25637
26015
  graphMethod: "GET",
@@ -25656,19 +26034,19 @@ var init_list_mail_folder_messages_delta = __esm(() => {
25656
26034
  // src/use-cases/commands/list-shared-mailbox-messages.ts
25657
26035
  var exports_list_shared_mailbox_messages = {};
25658
26036
  __export(exports_list_shared_mailbox_messages, {
25659
- execute: () => execute166,
25660
- meta: () => meta168,
25661
- schema: () => schema166
26037
+ execute: () => execute172,
26038
+ meta: () => meta174,
26039
+ schema: () => schema172
25662
26040
  });
25663
- var baseSchema87, execute166, schema166, meta168;
26041
+ var baseSchema90, execute172, schema172, meta174;
25664
26042
  var init_list_shared_mailbox_messages = __esm(() => {
25665
26043
  init_zod();
25666
26044
  init_build_command();
25667
26045
  init_odata_query();
25668
- baseSchema87 = exports_external.object({ userId: exports_external.string().min(1) });
25669
- ({ execute: execute166, schema: schema166 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/messages`, baseSchema87));
25670
- meta168 = {
25671
- summary: "List messages from a shared or delegated mailbox the signed-in user has read access to. Same shape as `list-mail-messages` but scoped to a specific mailbox owner. 403 if the signed-in user does not have shared access to that mailbox.",
26046
+ baseSchema90 = exports_external.object({ userId: exports_external.string().min(1) });
26047
+ ({ execute: execute172, schema: schema172 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/messages`, baseSchema90));
26048
+ meta174 = {
26049
+ summary: "List messages from a shared or delegated mailbox the signed-in user has read access to. Same shape as `list-mail-messages` but scoped to a specific mailbox owner. Requires the delegated `Mail.Read.Shared` scope, which neither token this CLI can mint carries (verified live on two tenants, 2026-08-30), so any mailbox other than the signed-in user's own is expected to answer `ErrorAccessDenied` whatever delegation Exchange holds. Your own UPN works; a Microsoft 365 group's mailbox is the shared-mail path that does (`list-group-conversations`, `list-group-thread-posts`).",
25672
26050
  category: "mail",
25673
26051
  graphMethod: "GET",
25674
26052
  graphPathTemplate: "/users/{user-id}/messages",
@@ -25691,19 +26069,19 @@ var init_list_shared_mailbox_messages = __esm(() => {
25691
26069
  // src/use-cases/commands/list-shared-mailbox-folder-messages.ts
25692
26070
  var exports_list_shared_mailbox_folder_messages = {};
25693
26071
  __export(exports_list_shared_mailbox_folder_messages, {
25694
- execute: () => execute167,
25695
- meta: () => meta169,
25696
- schema: () => schema167
26072
+ execute: () => execute173,
26073
+ meta: () => meta175,
26074
+ schema: () => schema173
25697
26075
  });
25698
- var baseSchema88, execute167, schema167, meta169;
26076
+ var baseSchema91, execute173, schema173, meta175;
25699
26077
  var init_list_shared_mailbox_folder_messages = __esm(() => {
25700
26078
  init_zod();
25701
26079
  init_build_command();
25702
26080
  init_odata_query();
25703
- baseSchema88 = exports_external.object({ userId: exports_external.string().min(1), mailFolderId: exports_external.string().min(1) });
25704
- ({ execute: execute167, schema: schema167 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/mailFolders/${p.mailFolderId}/messages`, baseSchema88));
25705
- meta169 = {
25706
- summary: "List messages in a single folder of a shared / delegated mailbox.",
26081
+ baseSchema91 = exports_external.object({ userId: exports_external.string().min(1), mailFolderId: exports_external.string().min(1) });
26082
+ ({ execute: execute173, schema: schema173 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/mailFolders/${p.mailFolderId}/messages`, baseSchema91));
26083
+ meta175 = {
26084
+ summary: "List messages in a single folder of a shared / delegated mailbox. Requires the delegated `Mail.Read.Shared` scope, which neither token this CLI can mint carries (verified live on two tenants, 2026-08-30), so any mailbox other than the signed-in user's own is expected to answer `ErrorAccessDenied` whatever delegation Exchange holds. Your own UPN works; a Microsoft 365 group's mailbox is the shared-mail path that does (`list-group-conversations`, `list-group-thread-posts`).",
25707
26085
  category: "mail",
25708
26086
  graphMethod: "GET",
25709
26087
  graphPathTemplate: "/users/{user-id}/mailFolders/{mail-folder-id}/messages",
@@ -25732,20 +26110,20 @@ var init_list_shared_mailbox_folder_messages = __esm(() => {
25732
26110
  // src/use-cases/commands/list-shared-mailbox-folders.ts
25733
26111
  var exports_list_shared_mailbox_folders = {};
25734
26112
  __export(exports_list_shared_mailbox_folders, {
25735
- execute: () => execute168,
25736
- meta: () => meta170,
25737
- schema: () => schema168
26113
+ execute: () => execute174,
26114
+ meta: () => meta176,
26115
+ schema: () => schema174
25738
26116
  });
25739
- var baseSchema89, execute168, schema168, meta170;
26117
+ var baseSchema92, execute174, schema174, meta176;
25740
26118
  var init_list_shared_mailbox_folders = __esm(() => {
25741
26119
  init_zod();
25742
26120
  init_build_command();
25743
26121
  init_include_hidden_folders();
25744
26122
  init_odata_query();
25745
- baseSchema89 = exports_external.object({ userId: exports_external.string().min(1), includeHiddenFolders: exports_external.enum(["true", "false"]).optional() });
25746
- ({ execute: execute168, schema: schema168 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/mailFolders${p.includeHiddenFolders === "true" ? "?includeHiddenFolders=true" : ""}`, baseSchema89));
25747
- meta170 = {
25748
- summary: "List the top-level mail folders of a shared or delegated mailbox. The `/me` sibling is `list-mail-folders`. Use it to discover the folder IDs that `list-shared-mailbox-folder-messages` needs: without it only the well-known names (`inbox`, `sentitems`, `drafts`, …) are reachable, so custom folders are invisible. 403 if the signed-in user does not have shared access to that mailbox.",
26123
+ baseSchema92 = exports_external.object({ userId: exports_external.string().min(1), includeHiddenFolders: exports_external.enum(["true", "false"]).optional() });
26124
+ ({ execute: execute174, schema: schema174 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/mailFolders${p.includeHiddenFolders === "true" ? "?includeHiddenFolders=true" : ""}`, baseSchema92));
26125
+ meta176 = {
26126
+ summary: "List the top-level mail folders of a shared or delegated mailbox. The `/me` sibling is `list-mail-folders`. Use it to discover the folder IDs that `list-shared-mailbox-folder-messages` needs: without it only the well-known names (`inbox`, `sentitems`, `drafts`, …) are reachable, so custom folders are invisible. Requires the delegated `Mail.Read.Shared` scope, which neither token this CLI can mint carries (verified live on two tenants, 2026-08-30), so any mailbox other than the signed-in user's own is expected to answer `ErrorAccessDenied` whatever delegation Exchange holds. Your own UPN works; a Microsoft 365 group's mailbox is the shared-mail path that does (`list-group-conversations`, `list-group-thread-posts`).",
25749
26127
  category: "mail",
25750
26128
  graphMethod: "GET",
25751
26129
  graphPathTemplate: "/users/{user-id}/mailFolders",
@@ -25769,20 +26147,20 @@ var init_list_shared_mailbox_folders = __esm(() => {
25769
26147
  // src/use-cases/commands/list-shared-mailbox-child-folders.ts
25770
26148
  var exports_list_shared_mailbox_child_folders = {};
25771
26149
  __export(exports_list_shared_mailbox_child_folders, {
25772
- execute: () => execute169,
25773
- meta: () => meta171,
25774
- schema: () => schema169
26150
+ execute: () => execute175,
26151
+ meta: () => meta177,
26152
+ schema: () => schema175
25775
26153
  });
25776
- var baseSchema90, execute169, schema169, meta171;
26154
+ var baseSchema93, execute175, schema175, meta177;
25777
26155
  var init_list_shared_mailbox_child_folders = __esm(() => {
25778
26156
  init_zod();
25779
26157
  init_build_command();
25780
26158
  init_include_hidden_folders();
25781
26159
  init_odata_query();
25782
- baseSchema90 = exports_external.object({ userId: exports_external.string().min(1), mailFolderId: exports_external.string().min(1), includeHiddenFolders: exports_external.enum(["true", "false"]).optional() });
25783
- ({ execute: execute169, schema: schema169 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/mailFolders/${p.mailFolderId}/childFolders${p.includeHiddenFolders === "true" ? "?includeHiddenFolders=true" : ""}`, baseSchema90));
25784
- meta171 = {
25785
- summary: "List the subfolders of one mail folder in a shared or delegated mailbox. The `/me` sibling is `list-mail-child-folders`. Walk it from the folder IDs `list-shared-mailbox-folders` returns to reach nested custom folders. 403 if the signed-in user does not have shared access to that mailbox.",
26160
+ baseSchema93 = exports_external.object({ userId: exports_external.string().min(1), mailFolderId: exports_external.string().min(1), includeHiddenFolders: exports_external.enum(["true", "false"]).optional() });
26161
+ ({ execute: execute175, schema: schema175 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/mailFolders/${p.mailFolderId}/childFolders${p.includeHiddenFolders === "true" ? "?includeHiddenFolders=true" : ""}`, baseSchema93));
26162
+ meta177 = {
26163
+ summary: "List the subfolders of one mail folder in a shared or delegated mailbox. The `/me` sibling is `list-mail-child-folders`. Walk it from the folder IDs `list-shared-mailbox-folders` returns to reach nested custom folders. Requires the delegated `Mail.Read.Shared` scope, which neither token this CLI can mint carries (verified live on two tenants, 2026-08-30), so any mailbox other than the signed-in user's own is expected to answer `ErrorAccessDenied` whatever delegation Exchange holds. Your own UPN works; a Microsoft 365 group's mailbox is the shared-mail path that does (`list-group-conversations`, `list-group-thread-posts`).",
25786
26164
  category: "mail",
25787
26165
  graphMethod: "GET",
25788
26166
  graphPathTemplate: "/users/{user-id}/mailFolders/{mail-folder-id}/childFolders",
@@ -25812,19 +26190,19 @@ var init_list_shared_mailbox_child_folders = __esm(() => {
25812
26190
  // src/use-cases/commands/get-shared-mailbox-message.ts
25813
26191
  var exports_get_shared_mailbox_message = {};
25814
26192
  __export(exports_get_shared_mailbox_message, {
25815
- execute: () => execute170,
25816
- meta: () => meta172,
25817
- schema: () => schema170
26193
+ execute: () => execute176,
26194
+ meta: () => meta178,
26195
+ schema: () => schema176
25818
26196
  });
25819
- var baseSchema91, execute170, schema170, meta172;
26197
+ var baseSchema94, execute176, schema176, meta178;
25820
26198
  var init_get_shared_mailbox_message = __esm(() => {
25821
26199
  init_zod();
25822
26200
  init_build_command();
25823
26201
  init_odata_query();
25824
- baseSchema91 = exports_external.object({ userId: exports_external.string().min(1), messageId: exports_external.string().min(1) });
25825
- ({ execute: execute170, schema: schema170 } = buildSelectableCommand((p) => `/users/${encodeURIComponent(p.userId)}/messages/${p.messageId}`, baseSchema91));
25826
- meta172 = {
25827
- summary: "Return a single message from a shared / delegated mailbox. Use `--select` to fetch only specific fields (e.g. `--select id,subject,from,receivedDateTime`) — sibling to `get-mail-message` for /me.",
26202
+ baseSchema94 = exports_external.object({ userId: exports_external.string().min(1), messageId: exports_external.string().min(1) });
26203
+ ({ execute: execute176, schema: schema176 } = buildSelectableCommand((p) => `/users/${encodeURIComponent(p.userId)}/messages/${p.messageId}`, baseSchema94));
26204
+ meta178 = {
26205
+ summary: "Return a single message from a shared / delegated mailbox. Use `--select` to fetch only specific fields (e.g. `--select id,subject,from,receivedDateTime`) — sibling to `get-mail-message` for /me. Requires the delegated `Mail.Read.Shared` scope, which neither token this CLI can mint carries (verified live on two tenants, 2026-08-30), so any mailbox other than the signed-in user's own is expected to answer `ErrorAccessDenied` whatever delegation Exchange holds. Your own UPN works; a Microsoft 365 group's mailbox is the shared-mail path that does (`list-group-conversations`, `list-group-thread-posts`).",
25828
26206
  category: "mail",
25829
26207
  graphMethod: "GET",
25830
26208
  graphPathTemplate: "/users/{user-id}/messages/{message-id}",
@@ -25852,25 +26230,25 @@ var init_get_shared_mailbox_message = __esm(() => {
25852
26230
  // src/use-cases/commands/list-conversation-messages.ts
25853
26231
  var exports_list_conversation_messages = {};
25854
26232
  __export(exports_list_conversation_messages, {
25855
- execute: () => execute171,
25856
- meta: () => meta173,
25857
- schema: () => schema171
26233
+ execute: () => execute177,
26234
+ meta: () => meta179,
26235
+ schema: () => schema177
25858
26236
  });
25859
- var allowedShape, allowedOptions, schema171, execute171 = async (graph, params) => {
25860
- const parsed = schema171.safeParse(params);
26237
+ var allowedShape, allowedOptions, schema177, execute177 = async (graph, params) => {
26238
+ const parsed = schema177.safeParse(params);
25861
26239
  if (!parsed.success)
25862
26240
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
25863
26241
  const path = appendOData(`/me/messages?$filter=conversationId eq '${odataStringLiteral(parsed.data.conversationId)}'`, parsed.data);
25864
26242
  return graph.get(path);
25865
- }, meta173;
26243
+ }, meta179;
25866
26244
  var init_list_conversation_messages = __esm(() => {
25867
26245
  init_zod();
25868
26246
  init_format_zod_error();
25869
26247
  init_odata_query();
25870
26248
  allowedShape = Object.fromEntries(Object.entries(odataQuerySchema.shape).filter(([key]) => key !== "filter" && key !== "orderby"));
25871
26249
  allowedOptions = odataQueryOptions.filter((o) => o.name !== "filter" && o.name !== "orderby");
25872
- schema171 = exports_external.object({ conversationId: exports_external.string().min(1) }).extend(allowedShape);
25873
- meta173 = {
26250
+ schema177 = exports_external.object({ conversationId: exports_external.string().min(1) }).extend(allowedShape);
26251
+ meta179 = {
25874
26252
  summary: "List every message in a single Outlook conversation (thread) using `$filter=conversationId eq '...'`. Reconstructs a complete thread regardless of which subject lines or folders the replies landed in. Accepts the OData passthrough flags top/skip/select/expand — the filter and orderby passthroughs are intentionally omitted (the path already pins a `$filter`, and Graph rejects this filter combined with `$orderby` as `InefficientFilter` since `conversationId` is not a sortable index). The caller can sort by `receivedDateTime` client-side. KQL `$search` does not index `conversationId`, so `$filter` is the only documented Graph idiom for whole-thread retrieval.",
25875
26253
  category: "mail",
25876
26254
  graphMethod: "GET",
@@ -25894,18 +26272,18 @@ var init_list_conversation_messages = __esm(() => {
25894
26272
  // src/use-cases/commands/list-focused-inbox-overrides.ts
25895
26273
  var exports_list_focused_inbox_overrides = {};
25896
26274
  __export(exports_list_focused_inbox_overrides, {
25897
- execute: () => execute172,
25898
- meta: () => meta174,
25899
- schema: () => schema172
26275
+ execute: () => execute178,
26276
+ meta: () => meta180,
26277
+ schema: () => schema178
25900
26278
  });
25901
- var baseSchema92, execute172, schema172, meta174;
26279
+ var baseSchema95, execute178, schema178, meta180;
25902
26280
  var init_list_focused_inbox_overrides = __esm(() => {
25903
26281
  init_zod();
25904
26282
  init_build_command();
25905
26283
  init_odata_query();
25906
- baseSchema92 = exports_external.object({}).strict();
25907
- ({ execute: execute172, schema: schema172 } = buildListCommand(() => "/me/inferenceClassification/overrides", baseSchema92));
25908
- meta174 = {
26284
+ baseSchema95 = exports_external.object({}).strict();
26285
+ ({ execute: execute178, schema: schema178 } = buildListCommand(() => "/me/inferenceClassification/overrides", baseSchema95));
26286
+ meta180 = {
25909
26287
  summary: "List the signed-in user's Focused Inbox classification overrides — sender addresses they've manually moved to Focused or Other, which override Microsoft's automatic classifier.",
25910
26288
  category: "mail",
25911
26289
  graphMethod: "GET",
@@ -25921,17 +26299,17 @@ var init_list_focused_inbox_overrides = __esm(() => {
25921
26299
  // src/use-cases/commands/list-outlook-categories.ts
25922
26300
  var exports_list_outlook_categories = {};
25923
26301
  __export(exports_list_outlook_categories, {
25924
- execute: () => execute173,
25925
- meta: () => meta175,
25926
- schema: () => schema173
26302
+ execute: () => execute179,
26303
+ meta: () => meta181,
26304
+ schema: () => schema179
25927
26305
  });
25928
- var schema173, execute173, meta175;
26306
+ var schema179, execute179, meta181;
25929
26307
  var init_list_outlook_categories = __esm(() => {
25930
26308
  init_zod();
25931
26309
  init_build_command();
25932
- schema173 = exports_external.object({}).strict();
25933
- ({ execute: execute173 } = buildCommand(() => "/me/outlook/masterCategories", schema173));
25934
- meta175 = {
26310
+ schema179 = exports_external.object({}).strict();
26311
+ ({ execute: execute179 } = buildCommand(() => "/me/outlook/masterCategories", schema179));
26312
+ meta181 = {
25935
26313
  summary: "List the signed-in user's Outlook color categories — the named tags that can be applied to mail, calendar items, and contacts. Each entry has `displayName` and a `color` from Outlook's preset palette. Note: Graph silently ignores every OData passthrough on this endpoint (`$top`, `$skip`, `$select`, `$filter`, `$orderby`, `$expand`), so the CLI does not expose any of those flags — the full collection is always returned. Slice client-side.",
25936
26314
  category: "mail",
25937
26315
  graphMethod: "GET",
@@ -25946,18 +26324,18 @@ var init_list_outlook_categories = __esm(() => {
25946
26324
  // src/use-cases/commands/list-shared-calendar-events.ts
25947
26325
  var exports_list_shared_calendar_events = {};
25948
26326
  __export(exports_list_shared_calendar_events, {
25949
- execute: () => execute174,
25950
- meta: () => meta176,
25951
- schema: () => schema174
26327
+ execute: () => execute180,
26328
+ meta: () => meta182,
26329
+ schema: () => schema180
25952
26330
  });
25953
- var baseSchema93, execute174, schema174, meta176;
26331
+ var baseSchema96, execute180, schema180, meta182;
25954
26332
  var init_list_shared_calendar_events = __esm(() => {
25955
26333
  init_zod();
25956
26334
  init_build_command();
25957
26335
  init_odata_query();
25958
- baseSchema93 = exports_external.object({ userId: exports_external.string().min(1) });
25959
- ({ execute: execute174, schema: schema174 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/calendar/events`, baseSchema93));
25960
- meta176 = {
26336
+ baseSchema96 = exports_external.object({ userId: exports_external.string().min(1) });
26337
+ ({ execute: execute180, schema: schema180 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/calendar/events`, baseSchema96));
26338
+ meta182 = {
25961
26339
  summary: "List events from another user's primary calendar (shared / delegated access). 403 without `Calendars.Read.Shared`.",
25962
26340
  category: "calendar",
25963
26341
  graphMethod: "GET",
@@ -25981,19 +26359,19 @@ var init_list_shared_calendar_events = __esm(() => {
25981
26359
  // src/use-cases/commands/get-shared-calendar-view.ts
25982
26360
  var exports_get_shared_calendar_view = {};
25983
26361
  __export(exports_get_shared_calendar_view, {
25984
- execute: () => execute175,
25985
- meta: () => meta177,
25986
- schema: () => schema175
26362
+ execute: () => execute181,
26363
+ meta: () => meta183,
26364
+ schema: () => schema181
25987
26365
  });
25988
- var baseSchema94, execute175, schema175, meta177;
26366
+ var baseSchema97, execute181, schema181, meta183;
25989
26367
  var init_get_shared_calendar_view = __esm(() => {
25990
26368
  init_zod();
25991
26369
  init_build_command();
25992
26370
  init_iso_datetime_schema();
25993
26371
  init_odata_query();
25994
- baseSchema94 = exports_external.object({ userId: exports_external.string().min(1), startDateTime: isoDateTimeField, endDateTime: isoDateTimeField });
25995
- ({ execute: execute175, schema: schema175 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/calendarView?startDateTime=${encodeURIComponent(p.startDateTime)}&endDateTime=${encodeURIComponent(p.endDateTime)}`, baseSchema94));
25996
- meta177 = {
26372
+ baseSchema97 = exports_external.object({ userId: exports_external.string().min(1), startDateTime: isoDateTimeField, endDateTime: isoDateTimeField });
26373
+ ({ execute: execute181, schema: schema181 } = buildListCommand((p) => `/users/${encodeURIComponent(p.userId)}/calendarView?startDateTime=${encodeURIComponent(p.startDateTime)}&endDateTime=${encodeURIComponent(p.endDateTime)}`, baseSchema97));
26374
+ meta183 = {
25997
26375
  summary: "Return a date-windowed calendar view from another user's primary calendar (shared / delegated access). Recurrences expanded into individual occurrences.",
25998
26376
  category: "calendar",
25999
26377
  graphMethod: "GET",
@@ -26019,18 +26397,18 @@ var init_get_shared_calendar_view = __esm(() => {
26019
26397
  // src/use-cases/commands/list-sharepoint-list-columns.ts
26020
26398
  var exports_list_sharepoint_list_columns = {};
26021
26399
  __export(exports_list_sharepoint_list_columns, {
26022
- execute: () => execute176,
26023
- meta: () => meta178,
26024
- schema: () => schema176
26400
+ execute: () => execute182,
26401
+ meta: () => meta184,
26402
+ schema: () => schema182
26025
26403
  });
26026
- var baseSchema95, execute176, schema176, meta178;
26404
+ var baseSchema98, execute182, schema182, meta184;
26027
26405
  var init_list_sharepoint_list_columns = __esm(() => {
26028
26406
  init_zod();
26029
26407
  init_build_command();
26030
26408
  init_odata_query();
26031
- baseSchema95 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1) });
26032
- ({ execute: execute176, schema: schema176 } = buildSelectableCommand((p) => `/sites/${p.siteId}/lists/${p.listId}/columns`, baseSchema95));
26033
- meta178 = {
26409
+ baseSchema98 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1) });
26410
+ ({ execute: execute182, schema: schema182 } = buildSelectableCommand((p) => `/sites/${p.siteId}/lists/${p.listId}/columns`, baseSchema98));
26411
+ meta184 = {
26034
26412
  summary: "List the column definitions (schema) of a SharePoint list. Useful before reading list items so you know which fields exist and their types. Note: Graph silently ignores `$top` and `$skip` on this endpoint, so the CLI exposes only `--select` and `--expand`.",
26035
26413
  category: "sharepoint",
26036
26414
  graphMethod: "GET",
@@ -26059,18 +26437,18 @@ var init_list_sharepoint_list_columns = __esm(() => {
26059
26437
  // src/use-cases/commands/get-sharepoint-list-column.ts
26060
26438
  var exports_get_sharepoint_list_column = {};
26061
26439
  __export(exports_get_sharepoint_list_column, {
26062
- execute: () => execute177,
26063
- meta: () => meta179,
26064
- schema: () => schema177
26440
+ execute: () => execute183,
26441
+ meta: () => meta185,
26442
+ schema: () => schema183
26065
26443
  });
26066
- var baseSchema96, execute177, schema177, meta179;
26444
+ var baseSchema99, execute183, schema183, meta185;
26067
26445
  var init_get_sharepoint_list_column = __esm(() => {
26068
26446
  init_zod();
26069
26447
  init_build_command();
26070
26448
  init_odata_query();
26071
- baseSchema96 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1), columnId: exports_external.string().min(1) });
26072
- ({ execute: execute177, schema: schema177 } = buildSelectableCommand((p) => `/sites/${p.siteId}/lists/${p.listId}/columns/${p.columnId}`, baseSchema96));
26073
- meta179 = {
26449
+ baseSchema99 = exports_external.object({ siteId: exports_external.string().min(1), listId: exports_external.string().min(1), columnId: exports_external.string().min(1) });
26450
+ ({ execute: execute183, schema: schema183 } = buildSelectableCommand((p) => `/sites/${p.siteId}/lists/${p.listId}/columns/${p.columnId}`, baseSchema99));
26451
+ meta185 = {
26074
26452
  summary: "Return a single column definition from a SharePoint list.",
26075
26453
  category: "sharepoint",
26076
26454
  graphMethod: "GET",
@@ -26123,21 +26501,21 @@ var init_onenote_5k_limit = () => {};
26123
26501
  // src/use-cases/commands/list-sharepoint-site-onenote-notebooks.ts
26124
26502
  var exports_list_sharepoint_site_onenote_notebooks = {};
26125
26503
  __export(exports_list_sharepoint_site_onenote_notebooks, {
26126
- execute: () => execute178,
26127
- meta: () => meta180,
26128
- schema: () => schema178
26504
+ execute: () => execute184,
26505
+ meta: () => meta186,
26506
+ schema: () => schema184
26129
26507
  });
26130
- var baseSchema97, inner14, execute178, schema178, meta180;
26508
+ var baseSchema100, inner14, execute184, schema184, meta186;
26131
26509
  var init_list_sharepoint_site_onenote_notebooks = __esm(() => {
26132
26510
  init_zod();
26133
26511
  init_build_command();
26134
26512
  init_odata_query();
26135
26513
  init_onenote_5k_limit();
26136
- baseSchema97 = exports_external.object({ siteId: exports_external.string().min(1) });
26137
- inner14 = buildListCommand((p) => `/sites/${p.siteId}/onenote/notebooks`, baseSchema97);
26138
- execute178 = wrapOnenote5kLimit(inner14.execute);
26139
- ({ schema: schema178 } = inner14);
26140
- meta180 = {
26514
+ baseSchema100 = exports_external.object({ siteId: exports_external.string().min(1) });
26515
+ inner14 = buildListCommand((p) => `/sites/${p.siteId}/onenote/notebooks`, baseSchema100);
26516
+ execute184 = wrapOnenote5kLimit(inner14.execute);
26517
+ ({ schema: schema184 } = inner14);
26518
+ meta186 = {
26141
26519
  summary: "List OneNote notebooks attached to a SharePoint site (separate from the personal `list-onenote-notebooks` which targets `/me`).",
26142
26520
  category: "notes",
26143
26521
  graphMethod: "GET",
@@ -26161,21 +26539,21 @@ var init_list_sharepoint_site_onenote_notebooks = __esm(() => {
26161
26539
  // src/use-cases/commands/list-sharepoint-site-onenote-notebook-sections.ts
26162
26540
  var exports_list_sharepoint_site_onenote_notebook_sections = {};
26163
26541
  __export(exports_list_sharepoint_site_onenote_notebook_sections, {
26164
- execute: () => execute179,
26165
- meta: () => meta181,
26166
- schema: () => schema179
26542
+ execute: () => execute185,
26543
+ meta: () => meta187,
26544
+ schema: () => schema185
26167
26545
  });
26168
- var baseSchema98, inner15, execute179, schema179, meta181;
26546
+ var baseSchema101, inner15, execute185, schema185, meta187;
26169
26547
  var init_list_sharepoint_site_onenote_notebook_sections = __esm(() => {
26170
26548
  init_zod();
26171
26549
  init_build_command();
26172
26550
  init_odata_query();
26173
26551
  init_onenote_5k_limit();
26174
- baseSchema98 = exports_external.object({ siteId: exports_external.string().min(1), notebookId: exports_external.string().min(1) });
26175
- inner15 = buildListCommand((p) => `/sites/${p.siteId}/onenote/notebooks/${p.notebookId}/sections`, baseSchema98);
26176
- execute179 = wrapOnenote5kLimit(inner15.execute);
26177
- ({ schema: schema179 } = inner15);
26178
- meta181 = {
26552
+ baseSchema101 = exports_external.object({ siteId: exports_external.string().min(1), notebookId: exports_external.string().min(1) });
26553
+ inner15 = buildListCommand((p) => `/sites/${p.siteId}/onenote/notebooks/${p.notebookId}/sections`, baseSchema101);
26554
+ execute185 = wrapOnenote5kLimit(inner15.execute);
26555
+ ({ schema: schema185 } = inner15);
26556
+ meta187 = {
26179
26557
  summary: "List sections inside one OneNote notebook attached to a SharePoint site.",
26180
26558
  category: "notes",
26181
26559
  graphMethod: "GET",
@@ -26205,21 +26583,21 @@ var init_list_sharepoint_site_onenote_notebook_sections = __esm(() => {
26205
26583
  // src/use-cases/commands/list-sharepoint-site-onenote-section-pages.ts
26206
26584
  var exports_list_sharepoint_site_onenote_section_pages = {};
26207
26585
  __export(exports_list_sharepoint_site_onenote_section_pages, {
26208
- execute: () => execute180,
26209
- meta: () => meta182,
26210
- schema: () => schema180
26586
+ execute: () => execute186,
26587
+ meta: () => meta188,
26588
+ schema: () => schema186
26211
26589
  });
26212
- var baseSchema99, inner16, execute180, schema180, meta182;
26590
+ var baseSchema102, inner16, execute186, schema186, meta188;
26213
26591
  var init_list_sharepoint_site_onenote_section_pages = __esm(() => {
26214
26592
  init_zod();
26215
26593
  init_build_command();
26216
26594
  init_odata_query();
26217
26595
  init_onenote_5k_limit();
26218
- baseSchema99 = exports_external.object({ siteId: exports_external.string().min(1), onenoteSectionId: exports_external.string().min(1) });
26219
- inner16 = buildListCommand((p) => `/sites/${p.siteId}/onenote/sections/${p.onenoteSectionId}/pages`, baseSchema99);
26220
- execute180 = wrapOnenote5kLimit(inner16.execute);
26221
- ({ schema: schema180 } = inner16);
26222
- meta182 = {
26596
+ baseSchema102 = exports_external.object({ siteId: exports_external.string().min(1), onenoteSectionId: exports_external.string().min(1) });
26597
+ inner16 = buildListCommand((p) => `/sites/${p.siteId}/onenote/sections/${p.onenoteSectionId}/pages`, baseSchema102);
26598
+ execute186 = wrapOnenote5kLimit(inner16.execute);
26599
+ ({ schema: schema186 } = inner16);
26600
+ meta188 = {
26223
26601
  summary: "List pages inside one section of a SharePoint-site OneNote notebook.",
26224
26602
  category: "notes",
26225
26603
  graphMethod: "GET",
@@ -26249,23 +26627,23 @@ var init_list_sharepoint_site_onenote_section_pages = __esm(() => {
26249
26627
  // src/use-cases/commands/get-sharepoint-site-onenote-page-content.ts
26250
26628
  var exports_get_sharepoint_site_onenote_page_content = {};
26251
26629
  __export(exports_get_sharepoint_site_onenote_page_content, {
26252
- execute: () => execute181,
26253
- meta: () => meta183,
26254
- schema: () => schema181
26630
+ execute: () => execute187,
26631
+ meta: () => meta189,
26632
+ schema: () => schema187
26255
26633
  });
26256
- var schema181, innerExecute = async (graph, params) => {
26257
- const parsed = schema181.safeParse(params);
26634
+ var schema187, innerExecute = async (graph, params) => {
26635
+ const parsed = schema187.safeParse(params);
26258
26636
  if (!parsed.success)
26259
26637
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
26260
26638
  return graph.getBinary(`/sites/${parsed.data.siteId}/onenote/pages/${parsed.data.onenotePageId}/content`);
26261
- }, execute181, meta183;
26639
+ }, execute187, meta189;
26262
26640
  var init_get_sharepoint_site_onenote_page_content = __esm(() => {
26263
26641
  init_zod();
26264
26642
  init_format_zod_error();
26265
26643
  init_onenote_5k_limit();
26266
- schema181 = exports_external.object({ siteId: exports_external.string().min(1), onenotePageId: exports_external.string().min(1) });
26267
- execute181 = wrapOnenote5kLimit(innerExecute);
26268
- meta183 = {
26644
+ schema187 = exports_external.object({ siteId: exports_external.string().min(1), onenotePageId: exports_external.string().min(1) });
26645
+ execute187 = wrapOnenote5kLimit(innerExecute);
26646
+ meta189 = {
26269
26647
  summary: "Return the HTML content of a single OneNote page from a SharePoint site (parallel to `get-onenote-page-content` for `/me`). The response carries the standard `{contentType: text/html, size, text}` shape so the HTML body is available verbatim under either output format.",
26270
26648
  category: "notes",
26271
26649
  graphMethod: "GET",
@@ -26294,19 +26672,19 @@ var init_get_sharepoint_site_onenote_page_content = __esm(() => {
26294
26672
  // src/use-cases/commands/list-drive-item-thumbnails.ts
26295
26673
  var exports_list_drive_item_thumbnails = {};
26296
26674
  __export(exports_list_drive_item_thumbnails, {
26297
- execute: () => execute182,
26298
- meta: () => meta184,
26299
- schema: () => schema182
26675
+ execute: () => execute188,
26676
+ meta: () => meta190,
26677
+ schema: () => schema188
26300
26678
  });
26301
- var baseSchema100, execute182, schema182, meta184;
26679
+ var baseSchema103, execute188, schema188, meta190;
26302
26680
  var init_list_drive_item_thumbnails = __esm(() => {
26303
26681
  init_zod();
26304
26682
  init_build_command();
26305
26683
  init_odata_query();
26306
26684
  init_tenant_option();
26307
- baseSchema100 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1), ...tenantIdShape });
26308
- ({ execute: execute182, schema: schema182 } = buildNoSkipListCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/thumbnails`, baseSchema100));
26309
- meta184 = {
26685
+ baseSchema103 = exports_external.object({ driveId: exports_external.string().min(1), itemId: exports_external.string().min(1), ...tenantIdShape });
26686
+ ({ execute: execute188, schema: schema188 } = buildNoSkipListCommand((p) => `/drives/${p.driveId}/items/${p.itemId}/thumbnails`, baseSchema103));
26687
+ meta190 = {
26310
26688
  summary: "List thumbnail URLs (small / medium / large) for a OneDrive / SharePoint file. Each thumbnail set has pre-signed CDN URLs you can render in a UI without further auth.",
26311
26689
  category: "drive",
26312
26690
  graphMethod: "GET",
@@ -26338,12 +26716,12 @@ var init_list_drive_item_thumbnails = __esm(() => {
26338
26716
  // src/use-cases/commands/get-excel-used-range.ts
26339
26717
  var exports_get_excel_used_range = {};
26340
26718
  __export(exports_get_excel_used_range, {
26341
- execute: () => execute183,
26342
- meta: () => meta185,
26343
- schema: () => schema183
26719
+ execute: () => execute189,
26720
+ meta: () => meta191,
26721
+ schema: () => schema189
26344
26722
  });
26345
- var DEFAULT_MAX_CELLS2 = 50000, schema183, execute183 = async (graph, params) => {
26346
- const parsed = schema183.safeParse(params);
26723
+ var DEFAULT_MAX_CELLS2 = 50000, schema189, execute189 = async (graph, params) => {
26724
+ const parsed = schema189.safeParse(params);
26347
26725
  if (!parsed.success)
26348
26726
  return err({ type: "validation_error", message: formatZodError(parsed.error) });
26349
26727
  const { driveId, itemId, worksheetId } = parsed.data;
@@ -26377,19 +26755,19 @@ var DEFAULT_MAX_CELLS2 = 50000, schema183, execute183 = async (graph, params) =>
26377
26755
  values: body.values,
26378
26756
  projection: "slim"
26379
26757
  });
26380
- }, meta185;
26758
+ }, meta191;
26381
26759
  var init_get_excel_used_range = __esm(() => {
26382
26760
  init_zod();
26383
26761
  init_excel_error();
26384
26762
  init_format_zod_error();
26385
- schema183 = exports_external.object({
26763
+ schema189 = exports_external.object({
26386
26764
  driveId: exports_external.string().min(1),
26387
26765
  itemId: exports_external.string().min(1),
26388
26766
  worksheetId: exports_external.string().min(1),
26389
26767
  full: exports_external.enum(["true", "false"]).optional(),
26390
26768
  maxCells: exports_external.string().regex(/^[1-9]\d*$/, "must be a positive integer").optional()
26391
26769
  });
26392
- meta185 = {
26770
+ meta191 = {
26393
26771
  summary: 'Return the worksheet\'s used range — the bounding box of every non-empty cell — as a single Excel range. The CLI ships a slim default that strips the redundant `text` / `numberFormat` / `formulas` 2D arrays Graph returns (mostly `"General"` repeated cell-by-cell), keeping `address` / `rowCount` / `columnCount` / `values`. Pass `--full true` to return the raw four-array Graph shape. `--max-cells` (default 50 000) caps the size of the projected `values[]`; oversize ranges drop `values` and surface a hint pointing at `get-excel-range` for band-by-band reads. Avoids fetching the entire 1M × 16K-cell sheet when only a small data island is populated.',
26394
26772
  category: "excel",
26395
26773
  graphMethod: "GET",
@@ -26436,18 +26814,18 @@ var init_get_excel_used_range = __esm(() => {
26436
26814
  // src/use-cases/commands/list-rooms.ts
26437
26815
  var exports_list_rooms = {};
26438
26816
  __export(exports_list_rooms, {
26439
- execute: () => execute184,
26440
- meta: () => meta186,
26441
- schema: () => schema184
26817
+ execute: () => execute190,
26818
+ meta: () => meta192,
26819
+ schema: () => schema190
26442
26820
  });
26443
- var baseSchema101, execute184, schema184, meta186;
26821
+ var baseSchema104, execute190, schema190, meta192;
26444
26822
  var init_list_rooms = __esm(() => {
26445
26823
  init_zod();
26446
26824
  init_build_command();
26447
26825
  init_odata_query();
26448
- baseSchema101 = exports_external.object({}).strict();
26449
- ({ execute: execute184, schema: schema184 } = buildListCommand(() => "/places/microsoft.graph.room", baseSchema101));
26450
- meta186 = {
26826
+ baseSchema104 = exports_external.object({}).strict();
26827
+ ({ execute: execute190, schema: schema190 } = buildListCommand(() => "/places/microsoft.graph.room", baseSchema104));
26828
+ meta192 = {
26451
26829
  summary: "List bookable meeting rooms in the tenant. Each `room` has `displayName`, `emailAddress`, `capacity`, `building`, `floorNumber`, and `isWheelChairAccessible`. Use the `emailAddress` as a meeting `attendee` for room booking. Pass `--top 5` to limit the response — large tenants return tens of KB by default.",
26452
26830
  category: "calendar",
26453
26831
  graphMethod: "GET",
@@ -26463,18 +26841,18 @@ var init_list_rooms = __esm(() => {
26463
26841
  // src/use-cases/commands/list-room-lists.ts
26464
26842
  var exports_list_room_lists = {};
26465
26843
  __export(exports_list_room_lists, {
26466
- execute: () => execute185,
26467
- meta: () => meta187,
26468
- schema: () => schema185
26844
+ execute: () => execute191,
26845
+ meta: () => meta193,
26846
+ schema: () => schema191
26469
26847
  });
26470
- var baseSchema102, execute185, schema185, meta187;
26848
+ var baseSchema105, execute191, schema191, meta193;
26471
26849
  var init_list_room_lists = __esm(() => {
26472
26850
  init_zod();
26473
26851
  init_build_command();
26474
26852
  init_odata_query();
26475
- baseSchema102 = exports_external.object({}).strict();
26476
- ({ execute: execute185, schema: schema185 } = buildListCommand(() => "/places/microsoft.graph.roomList", baseSchema102));
26477
- meta187 = {
26853
+ baseSchema105 = exports_external.object({}).strict();
26854
+ ({ execute: execute191, schema: schema191 } = buildListCommand(() => "/places/microsoft.graph.roomList", baseSchema105));
26855
+ meta193 = {
26478
26856
  summary: "List room lists — usually one per building. Use these to scope a room search by location: a roomList groups the rooms in one office, then `/places/{roomList}/rooms` lists just those rooms. Pass `--top N` to limit the response on large tenants.",
26479
26857
  category: "calendar",
26480
26858
  graphMethod: "GET",
@@ -26490,18 +26868,18 @@ var init_list_room_lists = __esm(() => {
26490
26868
  // src/use-cases/commands/list-trending-insights.ts
26491
26869
  var exports_list_trending_insights = {};
26492
26870
  __export(exports_list_trending_insights, {
26493
- execute: () => execute186,
26494
- meta: () => meta188,
26495
- schema: () => schema186
26871
+ execute: () => execute192,
26872
+ meta: () => meta194,
26873
+ schema: () => schema192
26496
26874
  });
26497
- var baseSchema103, execute186, schema186, meta188;
26875
+ var baseSchema106, execute192, schema192, meta194;
26498
26876
  var init_list_trending_insights = __esm(() => {
26499
26877
  init_zod();
26500
26878
  init_build_command();
26501
26879
  init_odata_query();
26502
- baseSchema103 = exports_external.object({}).strict();
26503
- ({ execute: execute186, schema: schema186 } = buildListCommand(() => "/me/insights/trending", baseSchema103));
26504
- meta188 = {
26880
+ baseSchema106 = exports_external.object({}).strict();
26881
+ ({ execute: execute192, schema: schema192 } = buildListCommand(() => "/me/insights/trending", baseSchema106));
26882
+ meta194 = {
26505
26883
  summary: "List documents trending around the signed-in user — files popular in their working network (colleagues' recent edits, shares, opens). Microsoft's relevance ranking, useful for surfacing unfamiliar but related work.",
26506
26884
  category: "drive",
26507
26885
  graphMethod: "GET",
@@ -26681,6 +27059,12 @@ var init_commands = __esm(() => {
26681
27059
  init_get_group_calendar_view();
26682
27060
  init_list_group_conversations();
26683
27061
  init_list_group_threads();
27062
+ init_list_group_thread_posts();
27063
+ init_get_group_post();
27064
+ init_convert_group_post_to_markdown();
27065
+ init_list_group_post_attachments();
27066
+ init_get_group_post_attachment();
27067
+ init_convert_group_post_attachment_to_markdown();
26684
27068
  init_get_mail_message_mime();
26685
27069
  init_list_mail_folder_messages_delta();
26686
27070
  init_list_shared_mailbox_messages();
@@ -26832,6 +27216,12 @@ var init_commands = __esm(() => {
26832
27216
  "list-group-calendar-view": exports_get_group_calendar_view,
26833
27217
  "list-group-conversations": exports_list_group_conversations,
26834
27218
  "list-group-threads": exports_list_group_threads,
27219
+ "list-group-thread-posts": exports_list_group_thread_posts,
27220
+ "get-group-post": exports_get_group_post,
27221
+ "convert-group-post-to-markdown": exports_convert_group_post_to_markdown,
27222
+ "list-group-post-attachments": exports_list_group_post_attachments,
27223
+ "get-group-post-attachment": exports_get_group_post_attachment,
27224
+ "convert-group-post-attachment-to-markdown": exports_convert_group_post_attachment_to_markdown,
26835
27225
  "get-mail-message-mime": exports_get_mail_message_mime,
26836
27226
  "list-mail-folder-messages-delta": exports_list_mail_folder_messages_delta,
26837
27227
  "list-shared-mailbox-messages": exports_list_shared_mailbox_messages,
@@ -29062,7 +29452,7 @@ var init_error_hints = __esm(() => {
29062
29452
  {
29063
29453
  source: "cli",
29064
29454
  matchCode: (c) => c === "commander.unknownOption",
29065
- hint: "Unknown CLI flag. Run `ask-marcel-office <command> --help` for the supported flags on that command, or `ask-marcel-office help-json --terse --category <name>` (~6 KB) to scan the whole category."
29455
+ hint: "Unknown CLI flag. Run `ask-marcel-office <command> --help` for the supported flags on that command, or `ask-marcel-office help-json --terse --category <name>` (~8 KB) to scan the whole category."
29066
29456
  },
29067
29457
  {
29068
29458
  source: "cli",
@@ -29082,7 +29472,7 @@ var init_error_hints = __esm(() => {
29082
29472
  {
29083
29473
  source: "cli",
29084
29474
  matchCode: (c) => c === "commander.unknownCommand" || c === "cli_unknown_command",
29085
- hint: "Unknown ask-marcel-office subcommand. Run `ask-marcel-office help-json --terse` (~31 KB across all categories) or `ask-marcel-office help-json --terse --category mail` (~6 KB for one category) to discover the right command."
29475
+ hint: "Unknown ask-marcel-office subcommand. Run `ask-marcel-office help-json --terse` (~33 KB across all categories) or `ask-marcel-office help-json --terse --category mail` (~8 KB for one category) to discover the right command."
29086
29476
  },
29087
29477
  {
29088
29478
  source: "cli",
@@ -29648,6 +30038,12 @@ var init_graph_scopes = __esm(() => {
29648
30038
  "list-group-owners": ["GroupMember.Read.All"],
29649
30039
  "list-group-conversations": ["Group.Read.All"],
29650
30040
  "list-group-threads": ["Group.Read.All"],
30041
+ "list-group-thread-posts": ["Group.Read.All"],
30042
+ "get-group-post": ["Group.Read.All"],
30043
+ "convert-group-post-to-markdown": ["Group.Read.All"],
30044
+ "list-group-post-attachments": ["Group.Read.All"],
30045
+ "get-group-post-attachment": ["Group.Read.All"],
30046
+ "convert-group-post-attachment-to-markdown": ["Group.Read.All"],
29651
30047
  "list-onenote-notebooks": ["Notes.Read"],
29652
30048
  "list-onenote-notebook-sections": ["Notes.Read"],
29653
30049
  "list-all-onenote-sections": ["Notes.Read"],
@@ -29829,7 +30225,7 @@ var init_docs = __esm(() => {
29829
30225
  },
29830
30226
  {
29831
30227
  name: "help-json",
29832
- summary: "Print the machine-readable command manifest as JSON. For fresh-session discovery use `--terse --category <name>` (~6 KB for one category). The unflagged form is the *full* reference (every option / example / response shape per command) and is roughly 13× the size of `ask-marcel-office --help` — reach for it only after `--terse` has narrowed the search. `--terse` alone projects each entry to `{name, summary, category}` (summary compacted to its first sentence). Categories: lifecycle, drive, excel, sharepoint, tasks, mail, notes, user, calendar, chats, teams, meta.",
30228
+ summary: "Print the machine-readable command manifest as JSON. For fresh-session discovery use `--terse --category <name>` (~8 KB for one category). The unflagged form is the *full* reference (every option / example / response shape per command) and is roughly 15× the size of `ask-marcel-office --help` — reach for it only after `--terse` has narrowed the search. `--terse` alone projects each entry to `{name, summary, category}` (summary compacted to its first sentence). Categories: lifecycle, drive, excel, sharepoint, tasks, mail, notes, user, calendar, chats, teams, meta.",
29833
30229
  category: "lifecycle",
29834
30230
  graphMethod: "GET",
29835
30231
  graphPathTemplate: "(lifecycle) renders the in-process command manifest",
@@ -29853,7 +30249,7 @@ var init_docs = __esm(() => {
29853
30249
  });
29854
30250
 
29855
30251
  // src/use-cases/commands/login.ts
29856
- var schema187, execute187 = async (auth, options) => {
30252
+ var schema193, execute193 = async (auth, options) => {
29857
30253
  const authenticated = await auth.getAccessToken(options);
29858
30254
  if (!authenticated.ok || options?.force === true)
29859
30255
  return authenticated;
@@ -29868,7 +30264,7 @@ var schema187, execute187 = async (auth, options) => {
29868
30264
  };
29869
30265
  var init_login = __esm(() => {
29870
30266
  init_zod();
29871
- schema187 = exports_external.object({}).strict();
30267
+ schema193 = exports_external.object({}).strict();
29872
30268
  });
29873
30269
 
29874
30270
  // src/use-cases/commands/login-status.ts
@@ -30922,30 +31318,30 @@ function floatSafeRemainder2(val, step) {
30922
31318
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
30923
31319
  return valInt % stepInt / 10 ** decCount;
30924
31320
  }
30925
- function deepPartialify(schema190) {
30926
- if (schema190 instanceof ZodObject2) {
31321
+ function deepPartialify(schema196) {
31322
+ if (schema196 instanceof ZodObject2) {
30927
31323
  const newShape = {};
30928
- for (const key in schema190.shape) {
30929
- const fieldSchema = schema190.shape[key];
31324
+ for (const key in schema196.shape) {
31325
+ const fieldSchema = schema196.shape[key];
30930
31326
  newShape[key] = ZodOptional2.create(deepPartialify(fieldSchema));
30931
31327
  }
30932
31328
  return new ZodObject2({
30933
- ...schema190._def,
31329
+ ...schema196._def,
30934
31330
  shape: () => newShape
30935
31331
  });
30936
- } else if (schema190 instanceof ZodArray2) {
31332
+ } else if (schema196 instanceof ZodArray2) {
30937
31333
  return new ZodArray2({
30938
- ...schema190._def,
30939
- type: deepPartialify(schema190.element)
31334
+ ...schema196._def,
31335
+ type: deepPartialify(schema196.element)
30940
31336
  });
30941
- } else if (schema190 instanceof ZodOptional2) {
30942
- return ZodOptional2.create(deepPartialify(schema190.unwrap()));
30943
- } else if (schema190 instanceof ZodNullable2) {
30944
- return ZodNullable2.create(deepPartialify(schema190.unwrap()));
30945
- } else if (schema190 instanceof ZodTuple2) {
30946
- return ZodTuple2.create(schema190.items.map((item) => deepPartialify(item)));
31337
+ } else if (schema196 instanceof ZodOptional2) {
31338
+ return ZodOptional2.create(deepPartialify(schema196.unwrap()));
31339
+ } else if (schema196 instanceof ZodNullable2) {
31340
+ return ZodNullable2.create(deepPartialify(schema196.unwrap()));
31341
+ } else if (schema196 instanceof ZodTuple2) {
31342
+ return ZodTuple2.create(schema196.items.map((item) => deepPartialify(item)));
30947
31343
  } else {
30948
- return schema190;
31344
+ return schema196;
30949
31345
  }
30950
31346
  }
30951
31347
  function mergeValues2(a, b) {
@@ -32366,9 +32762,9 @@ var init_types = __esm(() => {
32366
32762
  return this.min(1, message);
32367
32763
  }
32368
32764
  };
32369
- ZodArray2.create = (schema190, params) => {
32765
+ ZodArray2.create = (schema196, params) => {
32370
32766
  return new ZodArray2({
32371
- type: schema190,
32767
+ type: schema196,
32372
32768
  minLength: null,
32373
32769
  maxLength: null,
32374
32770
  exactLength: null,
@@ -32528,8 +32924,8 @@ var init_types = __esm(() => {
32528
32924
  });
32529
32925
  return merged;
32530
32926
  }
32531
- setKey(key, schema190) {
32532
- return this.augment({ [key]: schema190 });
32927
+ setKey(key, schema196) {
32928
+ return this.augment({ [key]: schema196 });
32533
32929
  }
32534
32930
  catchall(index) {
32535
32931
  return new ZodObject2({
@@ -32874,10 +33270,10 @@ var init_types = __esm(() => {
32874
33270
  status.dirty();
32875
33271
  }
32876
33272
  const items = [...ctx.data].map((item, itemIndex) => {
32877
- const schema190 = this._def.items[itemIndex] || this._def.rest;
32878
- if (!schema190)
33273
+ const schema196 = this._def.items[itemIndex] || this._def.rest;
33274
+ if (!schema196)
32879
33275
  return null;
32880
- return schema190._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
33276
+ return schema196._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
32881
33277
  }).filter((x) => !!x);
32882
33278
  if (ctx.common.async) {
32883
33279
  return Promise.all(items).then((results) => {
@@ -33384,9 +33780,9 @@ var init_types = __esm(() => {
33384
33780
  }));
33385
33781
  }
33386
33782
  };
33387
- ZodPromise2.create = (schema190, params) => {
33783
+ ZodPromise2.create = (schema196, params) => {
33388
33784
  return new ZodPromise2({
33389
- type: schema190,
33785
+ type: schema196,
33390
33786
  typeName: ZodFirstPartyTypeKind2.ZodPromise,
33391
33787
  ...processCreateParams(params)
33392
33788
  });
@@ -33514,17 +33910,17 @@ var init_types = __esm(() => {
33514
33910
  util.assertNever(effect);
33515
33911
  }
33516
33912
  };
33517
- ZodEffects.create = (schema190, effect, params) => {
33913
+ ZodEffects.create = (schema196, effect, params) => {
33518
33914
  return new ZodEffects({
33519
- schema: schema190,
33915
+ schema: schema196,
33520
33916
  typeName: ZodFirstPartyTypeKind2.ZodEffects,
33521
33917
  effect,
33522
33918
  ...processCreateParams(params)
33523
33919
  });
33524
33920
  };
33525
- ZodEffects.createWithPreprocess = (preprocess2, schema190, params) => {
33921
+ ZodEffects.createWithPreprocess = (preprocess2, schema196, params) => {
33526
33922
  return new ZodEffects({
33527
- schema: schema190,
33923
+ schema: schema196,
33528
33924
  effect: { type: "preprocess", transform: preprocess2 },
33529
33925
  typeName: ZodFirstPartyTypeKind2.ZodEffects,
33530
33926
  ...processCreateParams(params)
@@ -33892,8 +34288,8 @@ var init_schemas3 = __esm(() => {
33892
34288
  inst.with = inst.check;
33893
34289
  inst.clone = (_def, params) => clone(inst, _def, params);
33894
34290
  inst.brand = () => inst;
33895
- inst.register = (reg, meta189) => {
33896
- reg.add(inst, meta189);
34291
+ inst.register = (reg, meta195) => {
34292
+ reg.add(inst, meta195);
33897
34293
  return inst;
33898
34294
  };
33899
34295
  inst.apply = (fn) => fn(inst);
@@ -33933,8 +34329,8 @@ var init_v4_mini = __esm(() => {
33933
34329
 
33934
34330
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
33935
34331
  function isZ4Schema(s) {
33936
- const schema190 = s;
33937
- return !!schema190._zod;
34332
+ const schema196 = s;
34333
+ return !!schema196._zod;
33938
34334
  }
33939
34335
  function objectFromShape(shape) {
33940
34336
  const values = Object.values(shape);
@@ -33948,33 +34344,33 @@ function objectFromShape(shape) {
33948
34344
  return objectType(shape);
33949
34345
  throw new Error("Mixed Zod versions detected in object shape.");
33950
34346
  }
33951
- function safeParse3(schema190, data) {
33952
- if (isZ4Schema(schema190)) {
33953
- const result2 = safeParse(schema190, data);
34347
+ function safeParse3(schema196, data) {
34348
+ if (isZ4Schema(schema196)) {
34349
+ const result2 = safeParse(schema196, data);
33954
34350
  return result2;
33955
34351
  }
33956
- const v3Schema = schema190;
34352
+ const v3Schema = schema196;
33957
34353
  const result = v3Schema.safeParse(data);
33958
34354
  return result;
33959
34355
  }
33960
- async function safeParseAsync3(schema190, data) {
33961
- if (isZ4Schema(schema190)) {
33962
- const result2 = await safeParseAsync(schema190, data);
34356
+ async function safeParseAsync3(schema196, data) {
34357
+ if (isZ4Schema(schema196)) {
34358
+ const result2 = await safeParseAsync(schema196, data);
33963
34359
  return result2;
33964
34360
  }
33965
- const v3Schema = schema190;
34361
+ const v3Schema = schema196;
33966
34362
  const result = await v3Schema.safeParseAsync(data);
33967
34363
  return result;
33968
34364
  }
33969
- function getObjectShape(schema190) {
33970
- if (!schema190)
34365
+ function getObjectShape(schema196) {
34366
+ if (!schema196)
33971
34367
  return;
33972
34368
  let rawShape;
33973
- if (isZ4Schema(schema190)) {
33974
- const v4Schema = schema190;
34369
+ if (isZ4Schema(schema196)) {
34370
+ const v4Schema = schema196;
33975
34371
  rawShape = v4Schema._zod?.def?.shape;
33976
34372
  } else {
33977
- const v3Schema = schema190;
34373
+ const v3Schema = schema196;
33978
34374
  rawShape = v3Schema.shape;
33979
34375
  }
33980
34376
  if (!rawShape)
@@ -33988,29 +34384,29 @@ function getObjectShape(schema190) {
33988
34384
  }
33989
34385
  return rawShape;
33990
34386
  }
33991
- function normalizeObjectSchema(schema190) {
33992
- if (!schema190)
34387
+ function normalizeObjectSchema(schema196) {
34388
+ if (!schema196)
33993
34389
  return;
33994
- if (typeof schema190 === "object") {
33995
- const asV3 = schema190;
33996
- const asV4 = schema190;
34390
+ if (typeof schema196 === "object") {
34391
+ const asV3 = schema196;
34392
+ const asV4 = schema196;
33997
34393
  if (!asV3._def && !asV4._zod) {
33998
- const values = Object.values(schema190);
34394
+ const values = Object.values(schema196);
33999
34395
  if (values.length > 0 && values.every((v) => typeof v === "object" && v !== null && (v._def !== undefined || v._zod !== undefined || typeof v.parse === "function"))) {
34000
- return objectFromShape(schema190);
34396
+ return objectFromShape(schema196);
34001
34397
  }
34002
34398
  }
34003
34399
  }
34004
- if (isZ4Schema(schema190)) {
34005
- const v4Schema = schema190;
34400
+ if (isZ4Schema(schema196)) {
34401
+ const v4Schema = schema196;
34006
34402
  const def = v4Schema._zod?.def;
34007
34403
  if (def && (def.type === "object" || def.shape !== undefined)) {
34008
- return schema190;
34404
+ return schema196;
34009
34405
  }
34010
34406
  } else {
34011
- const v3Schema = schema190;
34407
+ const v3Schema = schema196;
34012
34408
  if (v3Schema.shape !== undefined) {
34013
- return schema190;
34409
+ return schema196;
34014
34410
  }
34015
34411
  }
34016
34412
  return;
@@ -34034,23 +34430,23 @@ function getParseErrorMessage(error48) {
34034
34430
  }
34035
34431
  return String(error48);
34036
34432
  }
34037
- function getSchemaDescription(schema190) {
34038
- return schema190.description;
34433
+ function getSchemaDescription(schema196) {
34434
+ return schema196.description;
34039
34435
  }
34040
- function isSchemaOptional(schema190) {
34041
- if (isZ4Schema(schema190)) {
34042
- const v4Schema = schema190;
34436
+ function isSchemaOptional(schema196) {
34437
+ if (isZ4Schema(schema196)) {
34438
+ const v4Schema = schema196;
34043
34439
  return v4Schema._zod?.def?.type === "optional";
34044
34440
  }
34045
- const v3Schema = schema190;
34046
- if (typeof schema190.isOptional === "function") {
34047
- return schema190.isOptional();
34441
+ const v3Schema = schema196;
34442
+ if (typeof schema196.isOptional === "function") {
34443
+ return schema196.isOptional();
34048
34444
  }
34049
34445
  return v3Schema._def?.typeName === "ZodOptional";
34050
34446
  }
34051
- function getLiteralValue(schema190) {
34052
- if (isZ4Schema(schema190)) {
34053
- const v4Schema = schema190;
34447
+ function getLiteralValue(schema196) {
34448
+ if (isZ4Schema(schema196)) {
34449
+ const v4Schema = schema196;
34054
34450
  const def2 = v4Schema._zod?.def;
34055
34451
  if (def2) {
34056
34452
  if (def2.value !== undefined)
@@ -34060,7 +34456,7 @@ function getLiteralValue(schema190) {
34060
34456
  }
34061
34457
  }
34062
34458
  }
34063
- const v3Schema = schema190;
34459
+ const v3Schema = schema196;
34064
34460
  const def = v3Schema._def;
34065
34461
  if (def) {
34066
34462
  if (def.value !== undefined)
@@ -34069,7 +34465,7 @@ function getLiteralValue(schema190) {
34069
34465
  return def.values[0];
34070
34466
  }
34071
34467
  }
34072
- const directValue = schema190.value;
34468
+ const directValue = schema196.value;
34073
34469
  if (directValue !== undefined)
34074
34470
  return directValue;
34075
34471
  return;
@@ -35220,16 +35616,16 @@ function parseIntersectionDef(def, refs) {
35220
35616
  ].filter((x) => !!x);
35221
35617
  let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : undefined;
35222
35618
  const mergedAllOf = [];
35223
- allOf.forEach((schema190) => {
35224
- if (isJsonSchema7AllOfType(schema190)) {
35225
- mergedAllOf.push(...schema190.allOf);
35226
- if (schema190.unevaluatedProperties === undefined) {
35619
+ allOf.forEach((schema196) => {
35620
+ if (isJsonSchema7AllOfType(schema196)) {
35621
+ mergedAllOf.push(...schema196.allOf);
35622
+ if (schema196.unevaluatedProperties === undefined) {
35227
35623
  unevaluatedProperties = undefined;
35228
35624
  }
35229
35625
  } else {
35230
- let nestedSchema = schema190;
35231
- if ("additionalProperties" in schema190 && schema190.additionalProperties === false) {
35232
- const { additionalProperties, ...rest } = schema190;
35626
+ let nestedSchema = schema196;
35627
+ if ("additionalProperties" in schema196 && schema196.additionalProperties === false) {
35628
+ const { additionalProperties, ...rest } = schema196;
35233
35629
  nestedSchema = rest;
35234
35630
  } else {
35235
35631
  unevaluatedProperties = undefined;
@@ -35414,60 +35810,60 @@ function escapeNonAlphaNumeric(source) {
35414
35810
  }
35415
35811
  return result;
35416
35812
  }
35417
- function addFormat(schema190, value, message, refs) {
35418
- if (schema190.format || schema190.anyOf?.some((x) => x.format)) {
35419
- if (!schema190.anyOf) {
35420
- schema190.anyOf = [];
35813
+ function addFormat(schema196, value, message, refs) {
35814
+ if (schema196.format || schema196.anyOf?.some((x) => x.format)) {
35815
+ if (!schema196.anyOf) {
35816
+ schema196.anyOf = [];
35421
35817
  }
35422
- if (schema190.format) {
35423
- schema190.anyOf.push({
35424
- format: schema190.format,
35425
- ...schema190.errorMessage && refs.errorMessages && {
35426
- errorMessage: { format: schema190.errorMessage.format }
35818
+ if (schema196.format) {
35819
+ schema196.anyOf.push({
35820
+ format: schema196.format,
35821
+ ...schema196.errorMessage && refs.errorMessages && {
35822
+ errorMessage: { format: schema196.errorMessage.format }
35427
35823
  }
35428
35824
  });
35429
- delete schema190.format;
35430
- if (schema190.errorMessage) {
35431
- delete schema190.errorMessage.format;
35432
- if (Object.keys(schema190.errorMessage).length === 0) {
35433
- delete schema190.errorMessage;
35825
+ delete schema196.format;
35826
+ if (schema196.errorMessage) {
35827
+ delete schema196.errorMessage.format;
35828
+ if (Object.keys(schema196.errorMessage).length === 0) {
35829
+ delete schema196.errorMessage;
35434
35830
  }
35435
35831
  }
35436
35832
  }
35437
- schema190.anyOf.push({
35833
+ schema196.anyOf.push({
35438
35834
  format: value,
35439
35835
  ...message && refs.errorMessages && { errorMessage: { format: message } }
35440
35836
  });
35441
35837
  } else {
35442
- setResponseValueAndErrors(schema190, "format", value, message, refs);
35838
+ setResponseValueAndErrors(schema196, "format", value, message, refs);
35443
35839
  }
35444
35840
  }
35445
- function addPattern(schema190, regex, message, refs) {
35446
- if (schema190.pattern || schema190.allOf?.some((x) => x.pattern)) {
35447
- if (!schema190.allOf) {
35448
- schema190.allOf = [];
35841
+ function addPattern(schema196, regex, message, refs) {
35842
+ if (schema196.pattern || schema196.allOf?.some((x) => x.pattern)) {
35843
+ if (!schema196.allOf) {
35844
+ schema196.allOf = [];
35449
35845
  }
35450
- if (schema190.pattern) {
35451
- schema190.allOf.push({
35452
- pattern: schema190.pattern,
35453
- ...schema190.errorMessage && refs.errorMessages && {
35454
- errorMessage: { pattern: schema190.errorMessage.pattern }
35846
+ if (schema196.pattern) {
35847
+ schema196.allOf.push({
35848
+ pattern: schema196.pattern,
35849
+ ...schema196.errorMessage && refs.errorMessages && {
35850
+ errorMessage: { pattern: schema196.errorMessage.pattern }
35455
35851
  }
35456
35852
  });
35457
- delete schema190.pattern;
35458
- if (schema190.errorMessage) {
35459
- delete schema190.errorMessage.pattern;
35460
- if (Object.keys(schema190.errorMessage).length === 0) {
35461
- delete schema190.errorMessage;
35853
+ delete schema196.pattern;
35854
+ if (schema196.errorMessage) {
35855
+ delete schema196.errorMessage.pattern;
35856
+ if (Object.keys(schema196.errorMessage).length === 0) {
35857
+ delete schema196.errorMessage;
35462
35858
  }
35463
35859
  }
35464
35860
  }
35465
- schema190.allOf.push({
35861
+ schema196.allOf.push({
35466
35862
  pattern: stringifyRegExpWithFlags(regex, refs),
35467
35863
  ...message && refs.errorMessages && { errorMessage: { pattern: message } }
35468
35864
  });
35469
35865
  } else {
35470
- setResponseValueAndErrors(schema190, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
35866
+ setResponseValueAndErrors(schema196, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
35471
35867
  }
35472
35868
  }
35473
35869
  function stringifyRegExpWithFlags(regex, refs) {
@@ -35589,7 +35985,7 @@ function parseRecordDef(def, refs) {
35589
35985
  additionalProperties: refs.rejectedAdditionalProperties
35590
35986
  };
35591
35987
  }
35592
- const schema190 = {
35988
+ const schema196 = {
35593
35989
  type: "object",
35594
35990
  additionalProperties: parseDef(def.valueType._def, {
35595
35991
  ...refs,
@@ -35597,17 +35993,17 @@ function parseRecordDef(def, refs) {
35597
35993
  }) ?? refs.allowedAdditionalProperties
35598
35994
  };
35599
35995
  if (refs.target === "openApi3") {
35600
- return schema190;
35996
+ return schema196;
35601
35997
  }
35602
35998
  if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodString && def.keyType._def.checks?.length) {
35603
35999
  const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
35604
36000
  return {
35605
- ...schema190,
36001
+ ...schema196,
35606
36002
  propertyNames: keyType
35607
36003
  };
35608
36004
  } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodEnum) {
35609
36005
  return {
35610
- ...schema190,
36006
+ ...schema196,
35611
36007
  propertyNames: {
35612
36008
  enum: def.keyType._def.values
35613
36009
  }
@@ -35615,11 +36011,11 @@ function parseRecordDef(def, refs) {
35615
36011
  } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind2.ZodString && def.keyType._def.type._def.checks?.length) {
35616
36012
  const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
35617
36013
  return {
35618
- ...schema190,
36014
+ ...schema196,
35619
36015
  propertyNames: keyType
35620
36016
  };
35621
36017
  }
35622
- return schema190;
36018
+ return schema196;
35623
36019
  }
35624
36020
  var init_record = __esm(() => {
35625
36021
  init_v3();
@@ -35915,9 +36311,9 @@ function decideAdditionalProperties(def, refs) {
35915
36311
  return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
35916
36312
  }
35917
36313
  }
35918
- function safeIsOptional(schema190) {
36314
+ function safeIsOptional(schema196) {
35919
36315
  try {
35920
- return schema190.isOptional();
36316
+ return schema196.isOptional();
35921
36317
  } catch {
35922
36318
  return true;
35923
36319
  }
@@ -35986,18 +36382,18 @@ function parseSetDef(def, refs) {
35986
36382
  ...refs,
35987
36383
  currentPath: [...refs.currentPath, "items"]
35988
36384
  });
35989
- const schema190 = {
36385
+ const schema196 = {
35990
36386
  type: "array",
35991
36387
  uniqueItems: true,
35992
36388
  items
35993
36389
  };
35994
36390
  if (def.minSize) {
35995
- setResponseValueAndErrors(schema190, "minItems", def.minSize.value, def.minSize.message, refs);
36391
+ setResponseValueAndErrors(schema196, "minItems", def.minSize.value, def.minSize.message, refs);
35996
36392
  }
35997
36393
  if (def.maxSize) {
35998
- setResponseValueAndErrors(schema190, "maxItems", def.maxSize.value, def.maxSize.message, refs);
36394
+ setResponseValueAndErrors(schema196, "maxItems", def.maxSize.value, def.maxSize.message, refs);
35999
36395
  }
36000
- return schema190;
36396
+ return schema196;
36001
36397
  }
36002
36398
  var init_set = __esm(() => {
36003
36399
  init_parseDef();
@@ -36230,17 +36626,17 @@ var init_parseDef = __esm(() => {
36230
36626
  var init_parseTypes = () => {};
36231
36627
 
36232
36628
  // node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
36233
- var zodToJsonSchema = (schema190, options) => {
36629
+ var zodToJsonSchema = (schema196, options) => {
36234
36630
  const refs = getRefs(options);
36235
- let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema191]) => ({
36631
+ let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema197]) => ({
36236
36632
  ...acc,
36237
- [name2]: parseDef(schema191._def, {
36633
+ [name2]: parseDef(schema197._def, {
36238
36634
  ...refs,
36239
36635
  currentPath: [...refs.basePath, refs.definitionPath, name2]
36240
36636
  }, true) ?? parseAnyDef(refs)
36241
36637
  }), {}) : undefined;
36242
36638
  const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? undefined : options?.name;
36243
- const main = parseDef(schema190._def, name === undefined ? refs : {
36639
+ const main = parseDef(schema196._def, name === undefined ? refs : {
36244
36640
  ...refs,
36245
36641
  currentPath: [...refs.basePath, refs.definitionPath, name]
36246
36642
  }, false) ?? parseAnyDef(refs);
@@ -36341,20 +36737,20 @@ function mapMiniTarget(t) {
36341
36737
  return "draft-2020-12";
36342
36738
  return "draft-7";
36343
36739
  }
36344
- function toJsonSchemaCompat(schema190, opts) {
36345
- if (isZ4Schema(schema190)) {
36346
- return toJSONSchema(schema190, {
36740
+ function toJsonSchemaCompat(schema196, opts) {
36741
+ if (isZ4Schema(schema196)) {
36742
+ return toJSONSchema(schema196, {
36347
36743
  target: mapMiniTarget(opts?.target),
36348
36744
  io: opts?.pipeStrategy ?? "input"
36349
36745
  });
36350
36746
  }
36351
- return zodToJsonSchema(schema190, {
36747
+ return zodToJsonSchema(schema196, {
36352
36748
  strictUnions: opts?.strictUnions ?? true,
36353
36749
  pipeStrategy: opts?.pipeStrategy ?? "input"
36354
36750
  });
36355
36751
  }
36356
- function getMethodLiteral(schema190) {
36357
- const shape = getObjectShape(schema190);
36752
+ function getMethodLiteral(schema196) {
36753
+ const shape = getObjectShape(schema196);
36358
36754
  const methodSchema = shape?.method;
36359
36755
  if (!methodSchema) {
36360
36756
  throw new Error("Schema is missing a method literal");
@@ -36365,8 +36761,8 @@ function getMethodLiteral(schema190) {
36365
36761
  }
36366
36762
  return value;
36367
36763
  }
36368
- function parseWithCompat(schema190, data) {
36369
- const result = safeParse3(schema190, data);
36764
+ function parseWithCompat(schema196, data) {
36765
+ const result = safeParse3(schema196, data);
36370
36766
  if (!result.success) {
36371
36767
  throw result.error;
36372
36768
  }
@@ -38246,52 +38642,52 @@ var require_util = __commonJS(function(exports) {
38246
38642
  return hash2;
38247
38643
  }
38248
38644
  exports.toHash = toHash;
38249
- function alwaysValidSchema(it, schema190) {
38250
- if (typeof schema190 == "boolean")
38251
- return schema190;
38252
- if (Object.keys(schema190).length === 0)
38645
+ function alwaysValidSchema(it, schema196) {
38646
+ if (typeof schema196 == "boolean")
38647
+ return schema196;
38648
+ if (Object.keys(schema196).length === 0)
38253
38649
  return true;
38254
- checkUnknownRules(it, schema190);
38255
- return !schemaHasRules(schema190, it.self.RULES.all);
38650
+ checkUnknownRules(it, schema196);
38651
+ return !schemaHasRules(schema196, it.self.RULES.all);
38256
38652
  }
38257
38653
  exports.alwaysValidSchema = alwaysValidSchema;
38258
- function checkUnknownRules(it, schema190 = it.schema) {
38654
+ function checkUnknownRules(it, schema196 = it.schema) {
38259
38655
  const { opts, self } = it;
38260
38656
  if (!opts.strictSchema)
38261
38657
  return;
38262
- if (typeof schema190 === "boolean")
38658
+ if (typeof schema196 === "boolean")
38263
38659
  return;
38264
38660
  const rules = self.RULES.keywords;
38265
- for (const key in schema190) {
38661
+ for (const key in schema196) {
38266
38662
  if (!rules[key])
38267
38663
  checkStrictMode(it, `unknown keyword: "${key}"`);
38268
38664
  }
38269
38665
  }
38270
38666
  exports.checkUnknownRules = checkUnknownRules;
38271
- function schemaHasRules(schema190, rules) {
38272
- if (typeof schema190 == "boolean")
38273
- return !schema190;
38274
- for (const key in schema190)
38667
+ function schemaHasRules(schema196, rules) {
38668
+ if (typeof schema196 == "boolean")
38669
+ return !schema196;
38670
+ for (const key in schema196)
38275
38671
  if (rules[key])
38276
38672
  return true;
38277
38673
  return false;
38278
38674
  }
38279
38675
  exports.schemaHasRules = schemaHasRules;
38280
- function schemaHasRulesButRef(schema190, RULES) {
38281
- if (typeof schema190 == "boolean")
38282
- return !schema190;
38283
- for (const key in schema190)
38676
+ function schemaHasRulesButRef(schema196, RULES) {
38677
+ if (typeof schema196 == "boolean")
38678
+ return !schema196;
38679
+ for (const key in schema196)
38284
38680
  if (key !== "$ref" && RULES.all[key])
38285
38681
  return true;
38286
38682
  return false;
38287
38683
  }
38288
38684
  exports.schemaHasRulesButRef = schemaHasRulesButRef;
38289
- function schemaRefOrVal({ topSchemaRef, schemaPath }, schema190, keyword, $data) {
38685
+ function schemaRefOrVal({ topSchemaRef, schemaPath }, schema196, keyword, $data) {
38290
38686
  if (!$data) {
38291
- if (typeof schema190 == "number" || typeof schema190 == "boolean")
38292
- return schema190;
38293
- if (typeof schema190 == "string")
38294
- return (0, codegen_1._)`${schema190}`;
38687
+ if (typeof schema196 == "number" || typeof schema196 == "boolean")
38688
+ return schema196;
38689
+ if (typeof schema196 == "string")
38690
+ return (0, codegen_1._)`${schema196}`;
38295
38691
  }
38296
38692
  return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
38297
38693
  }
@@ -38551,10 +38947,10 @@ var require_boolSchema = __commonJS(function(exports) {
38551
38947
  message: "boolean schema is false"
38552
38948
  };
38553
38949
  function topBoolOrEmptySchema(it) {
38554
- const { gen, schema: schema190, validateName } = it;
38555
- if (schema190 === false) {
38950
+ const { gen, schema: schema196, validateName } = it;
38951
+ if (schema196 === false) {
38556
38952
  falseSchemaError(it, false);
38557
- } else if (typeof schema190 == "object" && schema190.$async === true) {
38953
+ } else if (typeof schema196 == "object" && schema196.$async === true) {
38558
38954
  gen.return(names_1.default.data);
38559
38955
  } else {
38560
38956
  gen.assign((0, codegen_1._)`${validateName}.errors`, null);
@@ -38563,8 +38959,8 @@ var require_boolSchema = __commonJS(function(exports) {
38563
38959
  }
38564
38960
  exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
38565
38961
  function boolOrEmptySchema(it, valid) {
38566
- const { gen, schema: schema190 } = it;
38567
- if (schema190 === false) {
38962
+ const { gen, schema: schema196 } = it;
38963
+ if (schema196 === false) {
38568
38964
  gen.var(valid, false);
38569
38965
  falseSchemaError(it);
38570
38966
  } else {
@@ -38620,18 +39016,18 @@ var require_rules = __commonJS(function(exports) {
38620
39016
  var require_applicability = __commonJS(function(exports) {
38621
39017
  Object.defineProperty(exports, "__esModule", { value: true });
38622
39018
  exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = undefined;
38623
- function schemaHasRulesForType({ schema: schema190, self }, type) {
39019
+ function schemaHasRulesForType({ schema: schema196, self }, type) {
38624
39020
  const group = self.RULES.types[type];
38625
- return group && group !== true && shouldUseGroup(schema190, group);
39021
+ return group && group !== true && shouldUseGroup(schema196, group);
38626
39022
  }
38627
39023
  exports.schemaHasRulesForType = schemaHasRulesForType;
38628
- function shouldUseGroup(schema190, group) {
38629
- return group.rules.some((rule) => shouldUseRule(schema190, rule));
39024
+ function shouldUseGroup(schema196, group) {
39025
+ return group.rules.some((rule) => shouldUseRule(schema196, rule));
38630
39026
  }
38631
39027
  exports.shouldUseGroup = shouldUseGroup;
38632
- function shouldUseRule(schema190, rule) {
39028
+ function shouldUseRule(schema196, rule) {
38633
39029
  var _a2;
38634
- return schema190[rule.keyword] !== undefined || ((_a2 = rule.definition.implements) === null || _a2 === undefined ? undefined : _a2.some((kwd) => schema190[kwd] !== undefined));
39030
+ return schema196[rule.keyword] !== undefined || ((_a2 = rule.definition.implements) === null || _a2 === undefined ? undefined : _a2.some((kwd) => schema196[kwd] !== undefined));
38635
39031
  }
38636
39032
  exports.shouldUseRule = shouldUseRule;
38637
39033
  });
@@ -38650,17 +39046,17 @@ var require_dataType = __commonJS(function(exports) {
38650
39046
  DataType2[DataType2["Correct"] = 0] = "Correct";
38651
39047
  DataType2[DataType2["Wrong"] = 1] = "Wrong";
38652
39048
  })(DataType || (exports.DataType = DataType = {}));
38653
- function getSchemaTypes(schema190) {
38654
- const types2 = getJSONTypes(schema190.type);
39049
+ function getSchemaTypes(schema196) {
39050
+ const types2 = getJSONTypes(schema196.type);
38655
39051
  const hasNull = types2.includes("null");
38656
39052
  if (hasNull) {
38657
- if (schema190.nullable === false)
39053
+ if (schema196.nullable === false)
38658
39054
  throw new Error("type: null contradicts nullable: false");
38659
39055
  } else {
38660
- if (!types2.length && schema190.nullable !== undefined) {
39056
+ if (!types2.length && schema196.nullable !== undefined) {
38661
39057
  throw new Error('"nullable" cannot be used without "type"');
38662
39058
  }
38663
- if (schema190.nullable === true)
39059
+ if (schema196.nullable === true)
38664
39060
  types2.push("null");
38665
39061
  }
38666
39062
  return types2;
@@ -38792,8 +39188,8 @@ var require_dataType = __commonJS(function(exports) {
38792
39188
  }
38793
39189
  exports.checkDataTypes = checkDataTypes;
38794
39190
  var typeError = {
38795
- message: ({ schema: schema190 }) => `must be ${schema190}`,
38796
- params: ({ schema: schema190, schemaValue }) => typeof schema190 == "string" ? (0, codegen_1._)`{type: ${schema190}}` : (0, codegen_1._)`{type: ${schemaValue}}`
39191
+ message: ({ schema: schema196 }) => `must be ${schema196}`,
39192
+ params: ({ schema: schema196, schemaValue }) => typeof schema196 == "string" ? (0, codegen_1._)`{type: ${schema196}}` : (0, codegen_1._)`{type: ${schemaValue}}`
38797
39193
  };
38798
39194
  function reportTypeError(it) {
38799
39195
  const cxt = getTypeErrorContext(it);
@@ -38801,16 +39197,16 @@ var require_dataType = __commonJS(function(exports) {
38801
39197
  }
38802
39198
  exports.reportTypeError = reportTypeError;
38803
39199
  function getTypeErrorContext(it) {
38804
- const { gen, data, schema: schema190 } = it;
38805
- const schemaCode = (0, util_1.schemaRefOrVal)(it, schema190, "type");
39200
+ const { gen, data, schema: schema196 } = it;
39201
+ const schemaCode = (0, util_1.schemaRefOrVal)(it, schema196, "type");
38806
39202
  return {
38807
39203
  gen,
38808
39204
  keyword: "type",
38809
39205
  data,
38810
- schema: schema190.type,
39206
+ schema: schema196.type,
38811
39207
  schemaCode,
38812
39208
  schemaValue: schemaCode,
38813
- parentSchema: schema190,
39209
+ parentSchema: schema196,
38814
39210
  params: {},
38815
39211
  it
38816
39212
  };
@@ -38956,15 +39352,15 @@ var require_code2 = __commonJS(function(exports) {
38956
39352
  }
38957
39353
  exports.validateArray = validateArray;
38958
39354
  function validateUnion(cxt) {
38959
- const { gen, schema: schema190, keyword, it } = cxt;
38960
- if (!Array.isArray(schema190))
39355
+ const { gen, schema: schema196, keyword, it } = cxt;
39356
+ if (!Array.isArray(schema196))
38961
39357
  throw new Error("ajv implementation error");
38962
- const alwaysValid = schema190.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
39358
+ const alwaysValid = schema196.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
38963
39359
  if (alwaysValid && !it.opts.unevaluated)
38964
39360
  return;
38965
39361
  const valid = gen.let("valid", false);
38966
39362
  const schValid = gen.name("_valid");
38967
- gen.block(() => schema190.forEach((_sch, i) => {
39363
+ gen.block(() => schema196.forEach((_sch, i) => {
38968
39364
  const schCxt = cxt.subschema({
38969
39365
  keyword,
38970
39366
  schemaProp: i,
@@ -38989,8 +39385,8 @@ var require_keyword = __commonJS(function(exports) {
38989
39385
  var code_1 = require_code2();
38990
39386
  var errors_1 = require_errors();
38991
39387
  function macroKeywordCode(cxt, def) {
38992
- const { gen, keyword, schema: schema190, parentSchema, it } = cxt;
38993
- const macroSchema = def.macro.call(it.self, schema190, parentSchema, it);
39388
+ const { gen, keyword, schema: schema196, parentSchema, it } = cxt;
39389
+ const macroSchema = def.macro.call(it.self, schema196, parentSchema, it);
38994
39390
  const schemaRef = useKeyword(gen, keyword, macroSchema);
38995
39391
  if (it.opts.validateSchema !== false)
38996
39392
  it.self.validateSchema(macroSchema, true);
@@ -39007,9 +39403,9 @@ var require_keyword = __commonJS(function(exports) {
39007
39403
  exports.macroKeywordCode = macroKeywordCode;
39008
39404
  function funcKeywordCode(cxt, def) {
39009
39405
  var _a2;
39010
- const { gen, keyword, schema: schema190, parentSchema, $data, it } = cxt;
39406
+ const { gen, keyword, schema: schema196, parentSchema, $data, it } = cxt;
39011
39407
  checkAsyncKeyword(it, def);
39012
- const validate = !$data && def.compile ? def.compile.call(it.self, schema190, parentSchema, it) : def.validate;
39408
+ const validate = !$data && def.compile ? def.compile.call(it.self, schema196, parentSchema, it) : def.validate;
39013
39409
  const validateRef = useKeyword(gen, keyword, validate);
39014
39410
  const valid = gen.let("valid");
39015
39411
  cxt.block$data(valid, validateKeyword);
@@ -39069,20 +39465,20 @@ var require_keyword = __commonJS(function(exports) {
39069
39465
  throw new Error(`keyword "${keyword}" failed to compile`);
39070
39466
  return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
39071
39467
  }
39072
- function validSchemaType(schema190, schemaType, allowUndefined = false) {
39073
- return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema190) : st === "object" ? schema190 && typeof schema190 == "object" && !Array.isArray(schema190) : typeof schema190 == st || allowUndefined && typeof schema190 == "undefined");
39468
+ function validSchemaType(schema196, schemaType, allowUndefined = false) {
39469
+ return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema196) : st === "object" ? schema196 && typeof schema196 == "object" && !Array.isArray(schema196) : typeof schema196 == st || allowUndefined && typeof schema196 == "undefined");
39074
39470
  }
39075
39471
  exports.validSchemaType = validSchemaType;
39076
- function validateKeywordUsage({ schema: schema190, opts, self, errSchemaPath }, def, keyword) {
39472
+ function validateKeywordUsage({ schema: schema196, opts, self, errSchemaPath }, def, keyword) {
39077
39473
  if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
39078
39474
  throw new Error("ajv implementation error");
39079
39475
  }
39080
39476
  const deps = def.dependencies;
39081
- if (deps === null || deps === undefined ? undefined : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema190, kwd))) {
39477
+ if (deps === null || deps === undefined ? undefined : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema196, kwd))) {
39082
39478
  throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
39083
39479
  }
39084
39480
  if (def.validateSchema) {
39085
- const valid = def.validateSchema(schema190[keyword]);
39481
+ const valid = def.validateSchema(schema196[keyword]);
39086
39482
  if (!valid) {
39087
39483
  const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors);
39088
39484
  if (opts.validateSchema === "log")
@@ -39101,8 +39497,8 @@ var require_subschema = __commonJS(function(exports) {
39101
39497
  exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = undefined;
39102
39498
  var codegen_1 = require_codegen();
39103
39499
  var util_1 = require_util();
39104
- function getSubschema(it, { keyword, schemaProp, schema: schema190, schemaPath, errSchemaPath, topSchemaRef }) {
39105
- if (keyword !== undefined && schema190 !== undefined) {
39500
+ function getSubschema(it, { keyword, schemaProp, schema: schema196, schemaPath, errSchemaPath, topSchemaRef }) {
39501
+ if (keyword !== undefined && schema196 !== undefined) {
39106
39502
  throw new Error('both "keyword" and "schema" passed, only one allowed');
39107
39503
  }
39108
39504
  if (keyword !== undefined) {
@@ -39117,12 +39513,12 @@ var require_subschema = __commonJS(function(exports) {
39117
39513
  errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`
39118
39514
  };
39119
39515
  }
39120
- if (schema190 !== undefined) {
39516
+ if (schema196 !== undefined) {
39121
39517
  if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
39122
39518
  throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
39123
39519
  }
39124
39520
  return {
39125
- schema: schema190,
39521
+ schema: schema196,
39126
39522
  schemaPath,
39127
39523
  topSchemaRef,
39128
39524
  errSchemaPath
@@ -39219,7 +39615,7 @@ var require_fast_deep_equal = __commonJS(function(exports, module) {
39219
39615
 
39220
39616
  // node_modules/json-schema-traverse/index.js
39221
39617
  var require_json_schema_traverse = __commonJS(function(exports, module) {
39222
- var traverse = module.exports = function(schema190, opts, cb) {
39618
+ var traverse = module.exports = function(schema196, opts, cb) {
39223
39619
  if (typeof opts == "function") {
39224
39620
  cb = opts;
39225
39621
  opts = {};
@@ -39227,7 +39623,7 @@ var require_json_schema_traverse = __commonJS(function(exports, module) {
39227
39623
  cb = opts.cb || cb;
39228
39624
  var pre = typeof cb == "function" ? cb : cb.pre || function() {};
39229
39625
  var post = cb.post || function() {};
39230
- _traverse(opts, pre, post, schema190, "", schema190);
39626
+ _traverse(opts, pre, post, schema196, "", schema196);
39231
39627
  };
39232
39628
  traverse.keywords = {
39233
39629
  additionalItems: true,
@@ -39273,26 +39669,26 @@ var require_json_schema_traverse = __commonJS(function(exports, module) {
39273
39669
  maxProperties: true,
39274
39670
  minProperties: true
39275
39671
  };
39276
- function _traverse(opts, pre, post, schema190, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
39277
- if (schema190 && typeof schema190 == "object" && !Array.isArray(schema190)) {
39278
- pre(schema190, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
39279
- for (var key in schema190) {
39280
- var sch = schema190[key];
39672
+ function _traverse(opts, pre, post, schema196, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
39673
+ if (schema196 && typeof schema196 == "object" && !Array.isArray(schema196)) {
39674
+ pre(schema196, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
39675
+ for (var key in schema196) {
39676
+ var sch = schema196[key];
39281
39677
  if (Array.isArray(sch)) {
39282
39678
  if (key in traverse.arrayKeywords) {
39283
39679
  for (var i = 0;i < sch.length; i++)
39284
- _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema190, i);
39680
+ _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema196, i);
39285
39681
  }
39286
39682
  } else if (key in traverse.propsKeywords) {
39287
39683
  if (sch && typeof sch == "object") {
39288
39684
  for (var prop in sch)
39289
- _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema190, prop);
39685
+ _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema196, prop);
39290
39686
  }
39291
39687
  } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
39292
- _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema190);
39688
+ _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema196);
39293
39689
  }
39294
39690
  }
39295
- post(schema190, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
39691
+ post(schema196, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
39296
39692
  }
39297
39693
  }
39298
39694
  function escapeJsonPtr(str3) {
@@ -39325,14 +39721,14 @@ var require_resolve = __commonJS(function(exports) {
39325
39721
  "enum",
39326
39722
  "const"
39327
39723
  ]);
39328
- function inlineRef(schema190, limit = true) {
39329
- if (typeof schema190 == "boolean")
39724
+ function inlineRef(schema196, limit = true) {
39725
+ if (typeof schema196 == "boolean")
39330
39726
  return true;
39331
39727
  if (limit === true)
39332
- return !hasRef(schema190);
39728
+ return !hasRef(schema196);
39333
39729
  if (!limit)
39334
39730
  return false;
39335
- return countKeys(schema190) <= limit;
39731
+ return countKeys(schema196) <= limit;
39336
39732
  }
39337
39733
  exports.inlineRef = inlineRef;
39338
39734
  var REF_KEYWORDS = new Set([
@@ -39342,11 +39738,11 @@ var require_resolve = __commonJS(function(exports) {
39342
39738
  "$dynamicRef",
39343
39739
  "$dynamicAnchor"
39344
39740
  ]);
39345
- function hasRef(schema190) {
39346
- for (const key in schema190) {
39741
+ function hasRef(schema196) {
39742
+ for (const key in schema196) {
39347
39743
  if (REF_KEYWORDS.has(key))
39348
39744
  return true;
39349
- const sch = schema190[key];
39745
+ const sch = schema196[key];
39350
39746
  if (Array.isArray(sch) && sch.some(hasRef))
39351
39747
  return true;
39352
39748
  if (typeof sch == "object" && hasRef(sch))
@@ -39354,16 +39750,16 @@ var require_resolve = __commonJS(function(exports) {
39354
39750
  }
39355
39751
  return false;
39356
39752
  }
39357
- function countKeys(schema190) {
39753
+ function countKeys(schema196) {
39358
39754
  let count = 0;
39359
- for (const key in schema190) {
39755
+ for (const key in schema196) {
39360
39756
  if (key === "$ref")
39361
39757
  return Infinity;
39362
39758
  count++;
39363
39759
  if (SIMPLE_INLINED.has(key))
39364
39760
  continue;
39365
- if (typeof schema190[key] == "object") {
39366
- (0, util_1.eachItem)(schema190[key], (sch) => count += countKeys(sch));
39761
+ if (typeof schema196[key] == "object") {
39762
+ (0, util_1.eachItem)(schema196[key], (sch) => count += countKeys(sch));
39367
39763
  }
39368
39764
  if (count === Infinity)
39369
39765
  return Infinity;
@@ -39393,16 +39789,16 @@ var require_resolve = __commonJS(function(exports) {
39393
39789
  }
39394
39790
  exports.resolveUrl = resolveUrl;
39395
39791
  var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
39396
- function getSchemaRefs(schema190, baseId) {
39397
- if (typeof schema190 == "boolean")
39792
+ function getSchemaRefs(schema196, baseId) {
39793
+ if (typeof schema196 == "boolean")
39398
39794
  return {};
39399
39795
  const { schemaId, uriResolver } = this.opts;
39400
- const schId = normalizeId(schema190[schemaId] || baseId);
39796
+ const schId = normalizeId(schema196[schemaId] || baseId);
39401
39797
  const baseIds = { "": schId };
39402
39798
  const pathPrefix = getFullPath(uriResolver, schId, false);
39403
39799
  const localRefs = {};
39404
39800
  const schemaRefs = new Set;
39405
- traverse(schema190, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
39801
+ traverse(schema196, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
39406
39802
  if (parentJsonPtr === undefined)
39407
39803
  return;
39408
39804
  const fullPath = pathPrefix + jsonPtr;
@@ -39480,15 +39876,15 @@ var require_validate = __commonJS(function(exports) {
39480
39876
  validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
39481
39877
  }
39482
39878
  exports.validateFunctionCode = validateFunctionCode;
39483
- function validateFunction({ gen, validateName, schema: schema190, schemaEnv, opts }, body) {
39879
+ function validateFunction({ gen, validateName, schema: schema196, schemaEnv, opts }, body) {
39484
39880
  if (opts.code.es5) {
39485
39881
  gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
39486
- gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema190, opts)}`);
39882
+ gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema196, opts)}`);
39487
39883
  destructureValCxtES5(gen, opts);
39488
39884
  gen.code(body);
39489
39885
  });
39490
39886
  } else {
39491
- gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema190, opts)).code(body));
39887
+ gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema196, opts)).code(body));
39492
39888
  }
39493
39889
  }
39494
39890
  function destructureValCxt(opts) {
@@ -39512,9 +39908,9 @@ var require_validate = __commonJS(function(exports) {
39512
39908
  });
39513
39909
  }
39514
39910
  function topSchemaObjCode(it) {
39515
- const { schema: schema190, opts, gen } = it;
39911
+ const { schema: schema196, opts, gen } = it;
39516
39912
  validateFunction(it, () => {
39517
- if (opts.$comment && schema190.$comment)
39913
+ if (opts.$comment && schema196.$comment)
39518
39914
  commentKeyword(it);
39519
39915
  checkNoDefault(it);
39520
39916
  gen.let(names_1.default.vErrors, null);
@@ -39532,8 +39928,8 @@ var require_validate = __commonJS(function(exports) {
39532
39928
  gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
39533
39929
  gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
39534
39930
  }
39535
- function funcSourceUrl(schema190, opts) {
39536
- const schId = typeof schema190 == "object" && schema190[opts.schemaId];
39931
+ function funcSourceUrl(schema196, opts) {
39932
+ const schId = typeof schema196 == "object" && schema196[opts.schemaId];
39537
39933
  return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
39538
39934
  }
39539
39935
  function subschemaCode(it, valid) {
@@ -39546,10 +39942,10 @@ var require_validate = __commonJS(function(exports) {
39546
39942
  }
39547
39943
  (0, boolSchema_1.boolOrEmptySchema)(it, valid);
39548
39944
  }
39549
- function schemaCxtHasRules({ schema: schema190, self }) {
39550
- if (typeof schema190 == "boolean")
39551
- return !schema190;
39552
- for (const key in schema190)
39945
+ function schemaCxtHasRules({ schema: schema196, self }) {
39946
+ if (typeof schema196 == "boolean")
39947
+ return !schema196;
39948
+ for (const key in schema196)
39553
39949
  if (self.RULES.all[key])
39554
39950
  return true;
39555
39951
  return false;
@@ -39558,8 +39954,8 @@ var require_validate = __commonJS(function(exports) {
39558
39954
  return typeof it.schema != "boolean";
39559
39955
  }
39560
39956
  function subSchemaObjCode(it, valid) {
39561
- const { schema: schema190, gen, opts } = it;
39562
- if (opts.$comment && schema190.$comment)
39957
+ const { schema: schema196, gen, opts } = it;
39958
+ if (opts.$comment && schema196.$comment)
39563
39959
  commentKeyword(it);
39564
39960
  updateContext(it);
39565
39961
  checkAsyncSchema(it);
@@ -39579,14 +39975,14 @@ var require_validate = __commonJS(function(exports) {
39579
39975
  schemaKeywords(it, types2, !checkedTypes, errsCount);
39580
39976
  }
39581
39977
  function checkRefsAndKeywords(it) {
39582
- const { schema: schema190, errSchemaPath, opts, self } = it;
39583
- if (schema190.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema190, self.RULES)) {
39978
+ const { schema: schema196, errSchemaPath, opts, self } = it;
39979
+ if (schema196.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema196, self.RULES)) {
39584
39980
  self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
39585
39981
  }
39586
39982
  }
39587
39983
  function checkNoDefault(it) {
39588
- const { schema: schema190, opts } = it;
39589
- if (schema190.default !== undefined && opts.useDefaults && opts.strictSchema) {
39984
+ const { schema: schema196, opts } = it;
39985
+ if (schema196.default !== undefined && opts.useDefaults && opts.strictSchema) {
39590
39986
  (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
39591
39987
  }
39592
39988
  }
@@ -39599,8 +39995,8 @@ var require_validate = __commonJS(function(exports) {
39599
39995
  if (it.schema.$async && !it.schemaEnv.$async)
39600
39996
  throw new Error("async schema in sync schema");
39601
39997
  }
39602
- function commentKeyword({ gen, schemaEnv, schema: schema190, errSchemaPath, opts }) {
39603
- const msg = schema190.$comment;
39998
+ function commentKeyword({ gen, schemaEnv, schema: schema196, errSchemaPath, opts }) {
39999
+ const msg = schema196.$comment;
39604
40000
  if (opts.$comment === true) {
39605
40001
  gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
39606
40002
  } else if (typeof opts.$comment == "function") {
@@ -39627,9 +40023,9 @@ var require_validate = __commonJS(function(exports) {
39627
40023
  gen.assign((0, codegen_1._)`${evaluated}.items`, items);
39628
40024
  }
39629
40025
  function schemaKeywords(it, types2, typeErrors, errsCount) {
39630
- const { gen, schema: schema190, data, allErrors, opts, self } = it;
40026
+ const { gen, schema: schema196, data, allErrors, opts, self } = it;
39631
40027
  const { RULES } = self;
39632
- if (schema190.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema190, RULES))) {
40028
+ if (schema196.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema196, RULES))) {
39633
40029
  gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
39634
40030
  return;
39635
40031
  }
@@ -39641,7 +40037,7 @@ var require_validate = __commonJS(function(exports) {
39641
40037
  groupKeywords(RULES.post);
39642
40038
  });
39643
40039
  function groupKeywords(group) {
39644
- if (!(0, applicability_1.shouldUseGroup)(schema190, group))
40040
+ if (!(0, applicability_1.shouldUseGroup)(schema196, group))
39645
40041
  return;
39646
40042
  if (group.type) {
39647
40043
  gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
@@ -39659,12 +40055,12 @@ var require_validate = __commonJS(function(exports) {
39659
40055
  }
39660
40056
  }
39661
40057
  function iterateKeywords(it, group) {
39662
- const { gen, schema: schema190, opts: { useDefaults } } = it;
40058
+ const { gen, schema: schema196, opts: { useDefaults } } = it;
39663
40059
  if (useDefaults)
39664
40060
  (0, defaults_1.assignDefaults)(it, group.type);
39665
40061
  gen.block(() => {
39666
40062
  for (const rule of group.rules) {
39667
- if ((0, applicability_1.shouldUseRule)(schema190, rule)) {
40063
+ if ((0, applicability_1.shouldUseRule)(schema196, rule)) {
39668
40064
  keywordCode(it, rule.keyword, rule.definition, group.type);
39669
40065
  }
39670
40066
  }
@@ -40003,17 +40399,17 @@ var require_compile = __commonJS(function(exports) {
40003
40399
  var _a2;
40004
40400
  this.refs = {};
40005
40401
  this.dynamicAnchors = {};
40006
- let schema190;
40402
+ let schema196;
40007
40403
  if (typeof env.schema == "object")
40008
- schema190 = env.schema;
40404
+ schema196 = env.schema;
40009
40405
  this.schema = env.schema;
40010
40406
  this.schemaId = env.schemaId;
40011
40407
  this.root = env.root || this;
40012
- this.baseId = (_a2 = env.baseId) !== null && _a2 !== undefined ? _a2 : (0, resolve_1.normalizeId)(schema190 === null || schema190 === undefined ? undefined : schema190[env.schemaId || "$id"]);
40408
+ this.baseId = (_a2 = env.baseId) !== null && _a2 !== undefined ? _a2 : (0, resolve_1.normalizeId)(schema196 === null || schema196 === undefined ? undefined : schema196[env.schemaId || "$id"]);
40013
40409
  this.schemaPath = env.schemaPath;
40014
40410
  this.localRefs = env.localRefs;
40015
40411
  this.meta = env.meta;
40016
- this.$async = schema190 === null || schema190 === undefined ? undefined : schema190.$async;
40412
+ this.$async = schema196 === null || schema196 === undefined ? undefined : schema196.$async;
40017
40413
  this.refs = {};
40018
40414
  }
40019
40415
  }
@@ -40111,10 +40507,10 @@ var require_compile = __commonJS(function(exports) {
40111
40507
  return schOrFunc;
40112
40508
  let _sch = resolve.call(this, root, ref);
40113
40509
  if (_sch === undefined) {
40114
- const schema190 = (_a2 = root.localRefs) === null || _a2 === undefined ? undefined : _a2[ref];
40510
+ const schema196 = (_a2 = root.localRefs) === null || _a2 === undefined ? undefined : _a2[ref];
40115
40511
  const { schemaId } = this.opts;
40116
- if (schema190)
40117
- _sch = new SchemaEnv({ schema: schema190, schemaId, root, baseId });
40512
+ if (schema196)
40513
+ _sch = new SchemaEnv({ schema: schema196, schemaId, root, baseId });
40118
40514
  }
40119
40515
  if (_sch === undefined)
40120
40516
  return;
@@ -40162,12 +40558,12 @@ var require_compile = __commonJS(function(exports) {
40162
40558
  if (!schOrRef.validate)
40163
40559
  compileSchema.call(this, schOrRef);
40164
40560
  if (id === (0, resolve_1.normalizeId)(ref)) {
40165
- const { schema: schema190 } = schOrRef;
40561
+ const { schema: schema196 } = schOrRef;
40166
40562
  const { schemaId } = this.opts;
40167
- const schId = schema190[schemaId];
40563
+ const schId = schema196[schemaId];
40168
40564
  if (schId)
40169
40565
  baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
40170
- return new SchemaEnv({ schema: schema190, schemaId, root, baseId });
40566
+ return new SchemaEnv({ schema: schema196, schemaId, root, baseId });
40171
40567
  }
40172
40568
  return getJsonPointer.call(this, p, schOrRef);
40173
40569
  }
@@ -40179,29 +40575,29 @@ var require_compile = __commonJS(function(exports) {
40179
40575
  "dependencies",
40180
40576
  "definitions"
40181
40577
  ]);
40182
- function getJsonPointer(parsedRef, { baseId, schema: schema190, root }) {
40578
+ function getJsonPointer(parsedRef, { baseId, schema: schema196, root }) {
40183
40579
  var _a2;
40184
40580
  if (((_a2 = parsedRef.fragment) === null || _a2 === undefined ? undefined : _a2[0]) !== "/")
40185
40581
  return;
40186
40582
  for (const part of parsedRef.fragment.slice(1).split("/")) {
40187
- if (typeof schema190 === "boolean")
40583
+ if (typeof schema196 === "boolean")
40188
40584
  return;
40189
- const partSchema = schema190[(0, util_1.unescapeFragment)(part)];
40585
+ const partSchema = schema196[(0, util_1.unescapeFragment)(part)];
40190
40586
  if (partSchema === undefined)
40191
40587
  return;
40192
- schema190 = partSchema;
40193
- const schId = typeof schema190 === "object" && schema190[this.opts.schemaId];
40588
+ schema196 = partSchema;
40589
+ const schId = typeof schema196 === "object" && schema196[this.opts.schemaId];
40194
40590
  if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
40195
40591
  baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
40196
40592
  }
40197
40593
  }
40198
40594
  let env;
40199
- if (typeof schema190 != "boolean" && schema190.$ref && !(0, util_1.schemaHasRulesButRef)(schema190, this.RULES)) {
40200
- const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema190.$ref);
40595
+ if (typeof schema196 != "boolean" && schema196.$ref && !(0, util_1.schemaHasRulesButRef)(schema196, this.RULES)) {
40596
+ const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema196.$ref);
40201
40597
  env = resolveSchema.call(this, root, $ref);
40202
40598
  }
40203
40599
  const { schemaId } = this.opts;
40204
- env = env || new SchemaEnv({ schema: schema190, schemaId, root, baseId });
40600
+ env = env || new SchemaEnv({ schema: schema196, schemaId, root, baseId });
40205
40601
  if (env.schema !== env.root.schema)
40206
40602
  return env;
40207
40603
  return;
@@ -40229,9 +40625,28 @@ var require_data = __commonJS(function(exports, module) {
40229
40625
  var require_utils = __commonJS(function(exports, module) {
40230
40626
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
40231
40627
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
40628
+ var isPort = RegExp.prototype.test.bind(/^\d*$/u);
40232
40629
  var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
40233
40630
  var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
40234
- var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
40631
+ var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
40632
+ var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
40633
+ var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
40634
+ var BYTE_HEX = new Array(256);
40635
+ {
40636
+ const HEX_DIGITS = "0123456789ABCDEF";
40637
+ for (let i = 0;i < 256; i++) {
40638
+ BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
40639
+ }
40640
+ }
40641
+ function percentEncodeNonAscii(cp) {
40642
+ if (cp < 2048) {
40643
+ return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
40644
+ }
40645
+ if (cp < 65536) {
40646
+ return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
40647
+ }
40648
+ return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
40649
+ }
40235
40650
  function stringArrayToHexStripped(input) {
40236
40651
  let acc = "";
40237
40652
  let code = 0;
@@ -40256,91 +40671,122 @@ var require_utils = __commonJS(function(exports, module) {
40256
40671
  }
40257
40672
  return acc;
40258
40673
  }
40674
+ var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
40675
+ var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
40676
+ var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
40259
40677
  var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
40260
- function consumeIsZone(buffer) {
40261
- buffer.length = 0;
40262
- return true;
40263
- }
40264
- function consumeHextets(buffer, address, output) {
40265
- if (buffer.length) {
40266
- const hex3 = stringArrayToHexStripped(buffer);
40267
- if (hex3 !== "") {
40268
- address.push(hex3);
40269
- } else {
40270
- output.error = true;
40271
- return false;
40678
+ function isZoneIdentifier(zone) {
40679
+ if (zone.length === 0)
40680
+ return false;
40681
+ for (let i = 0;i < zone.length; i++) {
40682
+ if (isZoneCharacter(zone[i]))
40683
+ continue;
40684
+ if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
40685
+ i += 2;
40686
+ continue;
40272
40687
  }
40273
- buffer.length = 0;
40688
+ return false;
40274
40689
  }
40275
40690
  return true;
40276
40691
  }
40277
- function getIPV6(input) {
40278
- let tokenCount = 0;
40279
- const output = { error: false, address: "", zone: "" };
40280
- const address = [];
40281
- const buffer = [];
40282
- let endipv6Encountered = false;
40283
- let endIpv6 = false;
40284
- let consume = consumeHextets;
40285
- for (let i = 0;i < input.length; i++) {
40286
- const cursor = input[i];
40287
- if (cursor === "[" || cursor === "]") {
40288
- continue;
40289
- }
40290
- if (cursor === ":") {
40291
- if (endipv6Encountered === true) {
40292
- endIpv6 = true;
40293
- }
40294
- if (!consume(buffer, address, output)) {
40295
- break;
40296
- }
40297
- if (++tokenCount > 7) {
40298
- output.error = true;
40299
- break;
40300
- }
40301
- if (i > 0 && input[i - 1] === ":") {
40302
- endipv6Encountered = true;
40692
+ function compressIPv6ZeroRun(hextets) {
40693
+ let bestStart = -1;
40694
+ let bestLength = 0;
40695
+ let runStart = -1;
40696
+ let runLength = 0;
40697
+ for (let i = 0;i < hextets.length; i++) {
40698
+ if (hextets[i] === "0") {
40699
+ if (runStart === -1)
40700
+ runStart = i;
40701
+ runLength++;
40702
+ if (runLength > bestLength) {
40703
+ bestLength = runLength;
40704
+ bestStart = runStart;
40303
40705
  }
40304
- address.push(":");
40305
- continue;
40306
- } else if (cursor === "%") {
40307
- if (!consume(buffer, address, output)) {
40308
- break;
40309
- }
40310
- consume = consumeIsZone;
40311
40706
  } else {
40312
- buffer.push(cursor);
40313
- continue;
40707
+ runStart = -1;
40708
+ runLength = 0;
40314
40709
  }
40315
40710
  }
40316
- if (buffer.length) {
40317
- if (consume === consumeIsZone) {
40318
- output.zone = buffer.join("");
40319
- } else if (endIpv6) {
40320
- address.push(buffer.join(""));
40321
- } else {
40322
- address.push(stringArrayToHexStripped(buffer));
40711
+ if (bestLength < 2)
40712
+ return hextets.join(":");
40713
+ const head = hextets.slice(0, bestStart).join(":");
40714
+ const tail = hextets.slice(bestStart + bestLength).join(":");
40715
+ return head + "::" + tail;
40716
+ }
40717
+ function normalizeIPv6Address(input) {
40718
+ const compression = input.indexOf("::");
40719
+ if (compression !== -1 && input.indexOf("::", compression + 1) !== -1)
40720
+ return;
40721
+ const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
40722
+ const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
40723
+ if (compression !== -1) {
40724
+ if (left.length === 1 && left[0] === "")
40725
+ left.length = 0;
40726
+ if (right.length === 1 && right[0] === "")
40727
+ right.length = 0;
40728
+ }
40729
+ const parts = left.concat(right);
40730
+ let hextetCount = 0;
40731
+ for (let i = 0;i < parts.length; i++) {
40732
+ const part = parts[i];
40733
+ if (part === "")
40734
+ return;
40735
+ if (part.indexOf(".") !== -1) {
40736
+ if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part))
40737
+ return;
40738
+ hextetCount += 2;
40739
+ continue;
40323
40740
  }
40741
+ if (!isHextet(part))
40742
+ return;
40743
+ parts[i] = parseInt(part, 16).toString(16);
40744
+ hextetCount++;
40324
40745
  }
40325
- output.address = address.join("");
40326
- return output;
40746
+ if (compression === -1) {
40747
+ if (hextetCount !== 8)
40748
+ return;
40749
+ return compressIPv6ZeroRun(parts);
40750
+ }
40751
+ if (hextetCount >= 8)
40752
+ return;
40753
+ const expanded = parts.slice(0, left.length);
40754
+ for (let i = hextetCount;i < 8; i++)
40755
+ expanded.push("0");
40756
+ for (let i = left.length;i < parts.length; i++)
40757
+ expanded.push(parts[i]);
40758
+ return compressIPv6ZeroRun(expanded);
40327
40759
  }
40328
40760
  function normalizeIPv6(host) {
40329
- if (findToken(host, ":") < 2) {
40330
- return { host, isIPV6: false };
40331
- }
40332
- const ipv63 = getIPV6(host);
40333
- if (!ipv63.error) {
40334
- let newHost = ipv63.address;
40335
- let escapedHost = ipv63.address;
40336
- if (ipv63.zone) {
40337
- newHost += "%" + ipv63.zone;
40338
- escapedHost += "%25" + ipv63.zone;
40339
- }
40340
- return { host: newHost, isIPV6: true, escapedHost };
40341
- } else {
40342
- return { host, isIPV6: false };
40343
- }
40761
+ const bracketed = host[0] === "[" && host[host.length - 1] === "]";
40762
+ const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
40763
+ if (hasBracket && !bracketed)
40764
+ return { host, isIPV6: false, error: true };
40765
+ let input = bracketed ? host.slice(1, -1) : host;
40766
+ if (bracketed && isIPvFuture(input)) {
40767
+ input = input.toLowerCase();
40768
+ return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
40769
+ }
40770
+ if (findToken(input, ":") < 2) {
40771
+ return { host, isIPV6: false, error: bracketed };
40772
+ }
40773
+ let zoneIdentifier = "";
40774
+ const zoneSeparator = input.indexOf("%");
40775
+ if (zoneSeparator !== -1) {
40776
+ const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
40777
+ zoneIdentifier = input.slice(zoneSeparator + separatorLength);
40778
+ if (!isZoneIdentifier(zoneIdentifier))
40779
+ return { host, isIPV6: false, error: true };
40780
+ input = input.slice(0, zoneSeparator);
40781
+ }
40782
+ const address = normalizeIPv6Address(input);
40783
+ if (address === undefined)
40784
+ return { host, isIPV6: false, error: true };
40785
+ return {
40786
+ host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
40787
+ escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
40788
+ isIPV6: true
40789
+ };
40344
40790
  }
40345
40791
  function findToken(str3, token) {
40346
40792
  let ind = 0;
@@ -40460,7 +40906,8 @@ var require_utils = __commonJS(function(exports, module) {
40460
40906
  function normalizePathEncoding(input) {
40461
40907
  let output = "";
40462
40908
  for (let i = 0;i < input.length; i++) {
40463
- if (input[i] === "%" && i + 2 < input.length) {
40909
+ const ch = input[i];
40910
+ if (ch === "%" && i + 2 < input.length) {
40464
40911
  const hex3 = input.slice(i + 1, i + 3);
40465
40912
  if (isHexPair(hex3)) {
40466
40913
  const normalizedHex = hex3.toUpperCase();
@@ -40474,10 +40921,152 @@ var require_utils = __commonJS(function(exports, module) {
40474
40921
  continue;
40475
40922
  }
40476
40923
  }
40477
- if (isPathCharacter(input[i])) {
40478
- output += input[i];
40924
+ if (isPathCharacter(ch)) {
40925
+ output += ch;
40926
+ } else {
40927
+ const code = input.charCodeAt(i);
40928
+ if (code < 128) {
40929
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
40930
+ } else if (code < 55296 || code > 57343) {
40931
+ output += percentEncodeNonAscii(code);
40932
+ } else if (code <= 56319 && i + 1 < input.length) {
40933
+ const low = input.charCodeAt(i + 1);
40934
+ if (low >= 56320 && low <= 57343) {
40935
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
40936
+ i++;
40937
+ } else {
40938
+ output += percentEncodeNonAscii(65533);
40939
+ }
40940
+ } else {
40941
+ output += percentEncodeNonAscii(65533);
40942
+ }
40943
+ }
40944
+ }
40945
+ return output;
40946
+ }
40947
+ function serializePathEncoding(input, pathNoScheme = false) {
40948
+ let output = "";
40949
+ let firstSegment = pathNoScheme && input[0] !== "/";
40950
+ for (let i = 0;i < input.length; i++) {
40951
+ const ch = input[i];
40952
+ if (ch === "%" && i + 2 < input.length) {
40953
+ const hex3 = input.slice(i + 1, i + 3);
40954
+ if (isHexPair(hex3)) {
40955
+ output += "%" + hex3.toUpperCase();
40956
+ i += 2;
40957
+ continue;
40958
+ }
40959
+ }
40960
+ if (ch === "/") {
40961
+ firstSegment = false;
40962
+ }
40963
+ if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
40964
+ output += ch;
40965
+ } else {
40966
+ const code = input.charCodeAt(i);
40967
+ if (code < 128) {
40968
+ output += BYTE_HEX[code];
40969
+ } else if (code < 55296 || code > 57343) {
40970
+ output += percentEncodeNonAscii(code);
40971
+ } else if (code <= 56319 && i + 1 < input.length) {
40972
+ const low = input.charCodeAt(i + 1);
40973
+ if (low >= 56320 && low <= 57343) {
40974
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
40975
+ i++;
40976
+ } else {
40977
+ output += percentEncodeNonAscii(65533);
40978
+ }
40979
+ } else {
40980
+ output += percentEncodeNonAscii(65533);
40981
+ }
40982
+ }
40983
+ }
40984
+ return output;
40985
+ }
40986
+ function encodeComponent(input, isAllowed) {
40987
+ let output = "";
40988
+ for (let i = 0;i < input.length; i++) {
40989
+ const ch = input[i];
40990
+ if (ch === "%" && i + 2 < input.length) {
40991
+ const hex3 = input.slice(i + 1, i + 3);
40992
+ if (isHexPair(hex3)) {
40993
+ output += "%" + hex3.toUpperCase();
40994
+ i += 2;
40995
+ continue;
40996
+ }
40997
+ }
40998
+ if (isAllowed(ch)) {
40999
+ output += ch;
41000
+ } else {
41001
+ const code = input.charCodeAt(i);
41002
+ if (code < 128) {
41003
+ output += BYTE_HEX[code];
41004
+ } else if (code < 55296 || code > 57343) {
41005
+ output += percentEncodeNonAscii(code);
41006
+ } else if (code <= 56319 && i + 1 < input.length) {
41007
+ const low = input.charCodeAt(i + 1);
41008
+ if (low >= 56320 && low <= 57343) {
41009
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
41010
+ i++;
41011
+ } else {
41012
+ output += percentEncodeNonAscii(65533);
41013
+ }
41014
+ } else {
41015
+ output += percentEncodeNonAscii(65533);
41016
+ }
41017
+ }
41018
+ }
41019
+ return output;
41020
+ }
41021
+ function encodeUserinfo(input) {
41022
+ return encodeComponent(input, isUserinfoCharacter);
41023
+ }
41024
+ function encodeQuery(input) {
41025
+ return encodeComponent(input, isQueryFragmentCharacter);
41026
+ }
41027
+ function encodeFragment(input) {
41028
+ return encodeComponent(input, isQueryFragmentCharacter);
41029
+ }
41030
+ function isEscapeSafe(cp) {
41031
+ return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
41032
+ }
41033
+ function normalizeQueryFragmentEncoding(input) {
41034
+ let output = "";
41035
+ for (let i = 0;i < input.length; i++) {
41036
+ const ch = input[i];
41037
+ if (ch === "%" && i + 2 < input.length) {
41038
+ const hex3 = input.slice(i + 1, i + 3);
41039
+ if (isHexPair(hex3)) {
41040
+ const normalizedHex = hex3.toUpperCase();
41041
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
41042
+ if (isUnreserved(decoded)) {
41043
+ output += decoded;
41044
+ } else {
41045
+ output += "%" + normalizedHex;
41046
+ }
41047
+ i += 2;
41048
+ continue;
41049
+ }
41050
+ }
41051
+ if (isQueryFragmentCharacter(ch)) {
41052
+ output += ch;
40479
41053
  } else {
40480
- output += escape(input[i]);
41054
+ const code = input.charCodeAt(i);
41055
+ if (code < 128) {
41056
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
41057
+ } else if (code < 55296 || code > 57343) {
41058
+ output += percentEncodeNonAscii(code);
41059
+ } else if (code <= 56319 && i + 1 < input.length) {
41060
+ const low = input.charCodeAt(i + 1);
41061
+ if (low >= 56320 && low <= 57343) {
41062
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
41063
+ i++;
41064
+ } else {
41065
+ output += percentEncodeNonAscii(65533);
41066
+ }
41067
+ } else {
41068
+ output += percentEncodeNonAscii(65533);
41069
+ }
40481
41070
  }
40482
41071
  }
40483
41072
  return output;
@@ -40500,14 +41089,18 @@ var require_utils = __commonJS(function(exports, module) {
40500
41089
  function recomposeAuthority(component) {
40501
41090
  const uriTokens = [];
40502
41091
  if (component.userinfo !== undefined) {
40503
- uriTokens.push(component.userinfo);
41092
+ uriTokens.push(encodeUserinfo(component.userinfo));
40504
41093
  uriTokens.push("@");
40505
41094
  }
40506
41095
  if (component.host !== undefined) {
40507
- let host = unescape(component.host);
41096
+ let host = component.host;
40508
41097
  if (!isIPv4(host)) {
40509
- const ipV6res = normalizeIPv6(host);
40510
- if (ipV6res.isIPV6 === true) {
41098
+ let ipV6res = normalizeIPv6(host);
41099
+ if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
41100
+ host = normalizePercentEncoding(host, true);
41101
+ ipV6res = normalizeIPv6(host);
41102
+ }
41103
+ if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
40511
41104
  host = `[${ipV6res.escapedHost}]`;
40512
41105
  } else {
40513
41106
  host = reescapeHostDelimiters(host, false);
@@ -40516,8 +41109,12 @@ var require_utils = __commonJS(function(exports, module) {
40516
41109
  uriTokens.push(host);
40517
41110
  }
40518
41111
  if (typeof component.port === "number" || typeof component.port === "string") {
41112
+ const port = String(component.port);
41113
+ if (!isPort(port)) {
41114
+ throw new TypeError("URI port is malformed.");
41115
+ }
40519
41116
  uriTokens.push(":");
40520
- uriTokens.push(String(component.port));
41117
+ uriTokens.push(port);
40521
41118
  }
40522
41119
  return uriTokens.length ? uriTokens.join("") : undefined;
40523
41120
  }
@@ -40527,6 +41124,11 @@ var require_utils = __commonJS(function(exports, module) {
40527
41124
  reescapeHostDelimiters,
40528
41125
  normalizePercentEncoding,
40529
41126
  normalizePathEncoding,
41127
+ serializePathEncoding,
41128
+ normalizeQueryFragmentEncoding,
41129
+ encodeUserinfo,
41130
+ encodeQuery,
41131
+ encodeFragment,
40530
41132
  escapePreservingEscapes,
40531
41133
  removeDotSegments,
40532
41134
  isIPv4,
@@ -40539,7 +41141,7 @@ var require_utils = __commonJS(function(exports, module) {
40539
41141
  // node_modules/fast-uri/lib/schemes.js
40540
41142
  var require_schemes = __commonJS(function(exports, module) {
40541
41143
  var { isUUID } = require_utils();
40542
- var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
41144
+ var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
40543
41145
  var supportedSchemeNames = [
40544
41146
  "http",
40545
41147
  "https",
@@ -40594,9 +41196,10 @@ var require_schemes = __commonJS(function(exports, module) {
40594
41196
  wsComponent.secure = undefined;
40595
41197
  }
40596
41198
  if (wsComponent.resourceName) {
40597
- const [path, query] = wsComponent.resourceName.split("?");
41199
+ const queryIndex = wsComponent.resourceName.indexOf("?");
41200
+ const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
40598
41201
  wsComponent.path = path && path !== "/" ? path : undefined;
40599
- wsComponent.query = query;
41202
+ wsComponent.query = queryIndex === -1 ? undefined : wsComponent.resourceName.slice(queryIndex + 1);
40600
41203
  wsComponent.resourceName = undefined;
40601
41204
  }
40602
41205
  wsComponent.fragment = undefined;
@@ -40608,7 +41211,7 @@ var require_schemes = __commonJS(function(exports, module) {
40608
41211
  return urnComponent;
40609
41212
  }
40610
41213
  const matches = urnComponent.path.match(URN_REG);
40611
- if (matches) {
41214
+ if (matches && matches[0] === urnComponent.path) {
40612
41215
  const scheme = options.scheme || urnComponent.scheme || "urn";
40613
41216
  urnComponent.nid = matches[1].toLowerCase();
40614
41217
  urnComponent.nss = matches[2];
@@ -40712,8 +41315,17 @@ var require_schemes = __commonJS(function(exports, module) {
40712
41315
 
40713
41316
  // node_modules/fast-uri/index.js
40714
41317
  var require_fast_uri = __commonJS(function(exports, module) {
40715
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
41318
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
40716
41319
  var { SCHEMES, getSchemeHandler } = require_schemes();
41320
+ var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
41321
+ var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
41322
+ function decodeValidScheme(scheme) {
41323
+ const decodedScheme = unescape(String(scheme));
41324
+ if (!VALID_SCHEME.test(decodedScheme)) {
41325
+ throw new TypeError(MALFORMED_SCHEME_ERROR);
41326
+ }
41327
+ return decodedScheme;
41328
+ }
40717
41329
  function normalize(uri, options) {
40718
41330
  if (typeof uri === "string") {
40719
41331
  uri = normalizeString(uri, options);
@@ -40724,12 +41336,34 @@ var require_fast_uri = __commonJS(function(exports, module) {
40724
41336
  }
40725
41337
  function resolve(baseURI, relativeURI, options) {
40726
41338
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
40727
- const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions);
40728
- const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
40729
- if (baseMalformed || relativeMalformed) {
41339
+ const {
41340
+ parsed: baseParsed,
41341
+ malformedAuthorityOrPort: baseMalformed,
41342
+ malformedPercentEncoding: baseMalformedPercentEncoding,
41343
+ malformedSchemeSpecific: baseMalformedSchemeSpecific,
41344
+ malformedHost: baseMalformedHost,
41345
+ malformedScheme: baseMalformedScheme
41346
+ } = parseWithStatus(baseURI, schemelessOptions);
41347
+ const {
41348
+ parsed: relativeParsed,
41349
+ malformedAuthorityOrPort: relativeMalformed,
41350
+ malformedPercentEncoding: relativeMalformedPercentEncoding,
41351
+ malformedSchemeSpecific: relativeMalformedSchemeSpecific,
41352
+ malformedHost: relativeMalformedHost,
41353
+ malformedScheme: relativeMalformedScheme
41354
+ } = parseWithStatus(relativeURI, schemelessOptions);
41355
+ if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
40730
41356
  throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
40731
41357
  }
40732
41358
  const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
41359
+ const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
41360
+ const resolvedHost = resolved.host;
41361
+ const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
41362
+ canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
41363
+ const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
41364
+ if (resolved.error && !encodedASCIIHost) {
41365
+ throw new Error(resolved.error);
41366
+ }
40733
41367
  schemelessOptions.skipEscape = true;
40734
41368
  return serialize(resolved, schemelessOptions);
40735
41369
  }
@@ -40789,7 +41423,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
40789
41423
  function equal(uriA, uriB, options) {
40790
41424
  const normalizedA = normalizeComparableURI(uriA, options);
40791
41425
  const normalizedB = normalizeComparableURI(uriB, options);
40792
- return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase();
41426
+ return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB;
40793
41427
  }
40794
41428
  function serialize(cmpts, opts) {
40795
41429
  const component = {
@@ -40810,20 +41444,23 @@ var require_fast_uri = __commonJS(function(exports, module) {
40810
41444
  };
40811
41445
  const options = Object.assign({}, opts);
40812
41446
  const uriTokens = [];
41447
+ if (component.scheme) {
41448
+ component.scheme = decodeValidScheme(component.scheme);
41449
+ }
40813
41450
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
40814
41451
  if (schemeHandler && schemeHandler.serialize)
40815
41452
  schemeHandler.serialize(component, options);
41453
+ const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
41454
+ const pathNoScheme = !options.skipEscape && component.scheme === undefined && !hasAuthority;
40816
41455
  if (component.path !== undefined) {
40817
41456
  if (!options.skipEscape) {
40818
- component.path = escapePreservingEscapes(component.path);
40819
- if (component.scheme !== undefined) {
40820
- component.path = component.path.split("%3A").join(":");
40821
- }
41457
+ component.path = serializePathEncoding(component.path, pathNoScheme);
40822
41458
  } else {
40823
41459
  component.path = normalizePercentEncoding(component.path);
40824
41460
  }
40825
41461
  }
40826
41462
  if (options.reference !== "suffix" && component.scheme) {
41463
+ component.scheme = decodeValidScheme(component.scheme);
40827
41464
  uriTokens.push(component.scheme, ":");
40828
41465
  }
40829
41466
  const authority = recomposeAuthority(component);
@@ -40841,16 +41478,19 @@ var require_fast_uri = __commonJS(function(exports, module) {
40841
41478
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
40842
41479
  s = removeDotSegments(s);
40843
41480
  }
41481
+ if (pathNoScheme) {
41482
+ s = serializePathEncoding(s, true);
41483
+ }
40844
41484
  if (authority === undefined && s[0] === "/" && s[1] === "/") {
40845
41485
  s = "/%2F" + s.slice(2);
40846
41486
  }
40847
41487
  uriTokens.push(s);
40848
41488
  }
40849
41489
  if (component.query !== undefined) {
40850
- uriTokens.push("?", component.query);
41490
+ uriTokens.push("?", encodeQuery(component.query));
40851
41491
  }
40852
41492
  if (component.fragment !== undefined) {
40853
- uriTokens.push("#", component.fragment);
41493
+ uriTokens.push("#", encodeFragment(component.fragment));
40854
41494
  }
40855
41495
  return uriTokens.join("");
40856
41496
  }
@@ -40866,6 +41506,36 @@ var require_fast_uri = __commonJS(function(exports, module) {
40866
41506
  }
40867
41507
  return;
40868
41508
  }
41509
+ function hasMalformedPercentEncoding(component) {
41510
+ if (component === undefined)
41511
+ return false;
41512
+ let percent = component.indexOf("%");
41513
+ while (percent !== -1) {
41514
+ if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
41515
+ return true;
41516
+ }
41517
+ percent = component.indexOf("%", percent + 3);
41518
+ }
41519
+ return false;
41520
+ }
41521
+ function isIPLiteral(host) {
41522
+ return host[0] === "[" && host[host.length - 1] === "]";
41523
+ }
41524
+ function hasMalformedComponentPercentEncoding(matches) {
41525
+ const host = matches[4];
41526
+ return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
41527
+ }
41528
+ function canonicalizeHost(parsed, options, schemeHandler, isIP) {
41529
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
41530
+ try {
41531
+ parsed.host = new URL("http://" + parsed.host).hostname;
41532
+ } catch (e) {
41533
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
41534
+ return true;
41535
+ }
41536
+ }
41537
+ return false;
41538
+ }
40869
41539
  function parseWithStatus(uri, opts) {
40870
41540
  const options = Object.assign({}, opts);
40871
41541
  const parsed = {
@@ -40878,6 +41548,11 @@ var require_fast_uri = __commonJS(function(exports, module) {
40878
41548
  fragment: undefined
40879
41549
  };
40880
41550
  let malformedAuthorityOrPort = false;
41551
+ let malformedPercentEncoding = false;
41552
+ let malformedSchemeSpecific = false;
41553
+ let malformedHost = false;
41554
+ let malformedIPLiteral = false;
41555
+ let malformedScheme = false;
40881
41556
  let isIP = false;
40882
41557
  if (options.reference === "suffix") {
40883
41558
  if (options.scheme) {
@@ -40914,6 +41589,19 @@ var require_fast_uri = __commonJS(function(exports, module) {
40914
41589
  parsed.path = matches[6] || "";
40915
41590
  parsed.query = matches[7];
40916
41591
  parsed.fragment = matches[8];
41592
+ if (parsed.scheme !== undefined) {
41593
+ const decodedScheme = unescape(parsed.scheme);
41594
+ if (VALID_SCHEME.test(decodedScheme)) {
41595
+ parsed.scheme = decodedScheme.toLowerCase();
41596
+ } else {
41597
+ parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
41598
+ malformedScheme = true;
41599
+ }
41600
+ }
41601
+ malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
41602
+ if (malformedPercentEncoding) {
41603
+ parsed.error = parsed.error || "URI contains malformed percent-encoding.";
41604
+ }
40917
41605
  if (isNaN(parsed.port)) {
40918
41606
  parsed.port = matches[5];
40919
41607
  }
@@ -40925,9 +41613,16 @@ var require_fast_uri = __commonJS(function(exports, module) {
40925
41613
  if (parsed.host) {
40926
41614
  const ipv4result = isIPv4(parsed.host);
40927
41615
  if (ipv4result === false) {
41616
+ const bracketedIPLiteral = isIPLiteral(parsed.host);
41617
+ const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
40928
41618
  const ipv6result = normalizeIPv6(parsed.host);
40929
- parsed.host = ipv6result.host.toLowerCase();
40930
- isIP = ipv6result.isIPV6;
41619
+ isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
41620
+ malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
41621
+ parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
41622
+ if (malformedIPLiteral) {
41623
+ parsed.error = parsed.error || "URI host is malformed.";
41624
+ malformedAuthorityOrPort = true;
41625
+ }
40931
41626
  } else {
40932
41627
  isIP = true;
40933
41628
  }
@@ -40945,42 +41640,36 @@ var require_fast_uri = __commonJS(function(exports, module) {
40945
41640
  parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
40946
41641
  }
40947
41642
  const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
40948
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
40949
- if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
40950
- try {
40951
- parsed.host = new URL("http://" + parsed.host).hostname;
40952
- } catch (e) {
40953
- parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
40954
- }
40955
- }
41643
+ if (!malformedIPLiteral) {
41644
+ malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
40956
41645
  }
40957
41646
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
40958
41647
  if (uri.indexOf("%") !== -1) {
40959
- if (parsed.scheme !== undefined) {
40960
- parsed.scheme = unescape(parsed.scheme);
40961
- }
40962
- if (parsed.host !== undefined) {
40963
- parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
41648
+ if (parsed.host !== undefined && !malformedIPLiteral) {
41649
+ const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
41650
+ parsed.host = reescapeHostDelimiters(host, isIP);
40964
41651
  }
40965
41652
  }
40966
41653
  if (parsed.path) {
40967
41654
  parsed.path = normalizePathEncoding(parsed.path);
40968
41655
  }
41656
+ if (parsed.query) {
41657
+ parsed.query = normalizeQueryFragmentEncoding(parsed.query);
41658
+ }
40969
41659
  if (parsed.fragment) {
40970
- try {
40971
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
40972
- } catch {
40973
- parsed.error = parsed.error || "URI malformed";
40974
- }
41660
+ parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
40975
41661
  }
40976
41662
  }
40977
41663
  if (schemeHandler && schemeHandler.parse) {
40978
41664
  schemeHandler.parse(parsed, options);
41665
+ if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {
41666
+ malformedSchemeSpecific = true;
41667
+ }
40979
41668
  }
40980
41669
  } else {
40981
41670
  parsed.error = parsed.error || "URI can not be parsed.";
40982
41671
  }
40983
- return { parsed, malformedAuthorityOrPort };
41672
+ return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
40984
41673
  }
40985
41674
  function parse10(uri, opts) {
40986
41675
  return parseWithStatus(uri, opts).parsed;
@@ -40989,20 +41678,28 @@ var require_fast_uri = __commonJS(function(exports, module) {
40989
41678
  return normalizeStringWithStatus(uri, opts).normalized;
40990
41679
  }
40991
41680
  function normalizeStringWithStatus(uri, opts) {
40992
- const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
41681
+ const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
40993
41682
  return {
40994
- normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
40995
- malformedAuthorityOrPort
41683
+ normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
41684
+ malformedAuthorityOrPort,
41685
+ malformedPercentEncoding,
41686
+ malformedSchemeSpecific,
41687
+ malformedHost,
41688
+ malformedScheme
40996
41689
  };
40997
41690
  }
40998
41691
  function normalizeComparableURI(uri, opts) {
40999
- if (typeof uri === "string") {
41000
- const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
41001
- return malformedAuthorityOrPort ? undefined : normalized;
41692
+ if (typeof uri !== "string" && typeof uri !== "object") {
41693
+ return;
41002
41694
  }
41003
- if (typeof uri === "object") {
41004
- return serialize(uri, opts);
41695
+ let value;
41696
+ try {
41697
+ value = typeof uri === "string" ? uri : serialize(uri, opts);
41698
+ } catch {
41699
+ return;
41005
41700
  }
41701
+ const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
41702
+ return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
41006
41703
  }
41007
41704
  var fastUri = {
41008
41705
  SCHEMES,
@@ -41166,19 +41863,19 @@ var require_core = __commonJS(function(exports) {
41166
41863
  this.addKeyword("$async");
41167
41864
  }
41168
41865
  _addDefaultMetaSchema() {
41169
- const { $data, meta: meta189, schemaId } = this.opts;
41866
+ const { $data, meta: meta195, schemaId } = this.opts;
41170
41867
  let _dataRefSchema = $dataRefSchema;
41171
41868
  if (schemaId === "id") {
41172
41869
  _dataRefSchema = { ...$dataRefSchema };
41173
41870
  _dataRefSchema.id = _dataRefSchema.$id;
41174
41871
  delete _dataRefSchema.$id;
41175
41872
  }
41176
- if (meta189 && $data)
41873
+ if (meta195 && $data)
41177
41874
  this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
41178
41875
  }
41179
41876
  defaultMeta() {
41180
- const { meta: meta189, schemaId } = this.opts;
41181
- return this.opts.defaultMeta = typeof meta189 == "object" ? meta189[schemaId] || meta189 : undefined;
41877
+ const { meta: meta195, schemaId } = this.opts;
41878
+ return this.opts.defaultMeta = typeof meta195 == "object" ? meta195[schemaId] || meta195 : undefined;
41182
41879
  }
41183
41880
  validate(schemaKeyRef, data) {
41184
41881
  let v;
@@ -41194,16 +41891,16 @@ var require_core = __commonJS(function(exports) {
41194
41891
  this.errors = v.errors;
41195
41892
  return valid;
41196
41893
  }
41197
- compile(schema190, _meta) {
41198
- const sch = this._addSchema(schema190, _meta);
41894
+ compile(schema196, _meta) {
41895
+ const sch = this._addSchema(schema196, _meta);
41199
41896
  return sch.validate || this._compileSchemaEnv(sch);
41200
41897
  }
41201
- compileAsync(schema190, meta189) {
41898
+ compileAsync(schema196, meta195) {
41202
41899
  if (typeof this.opts.loadSchema != "function") {
41203
41900
  throw new Error("options.loadSchema should be a function");
41204
41901
  }
41205
41902
  const { loadSchema } = this.opts;
41206
- return runCompileAsync.call(this, schema190, meta189);
41903
+ return runCompileAsync.call(this, schema196, meta195);
41207
41904
  async function runCompileAsync(_schema, _meta) {
41208
41905
  await loadMetaSchema.call(this, _schema.$schema);
41209
41906
  const sch = this._addSchema(_schema, _meta);
@@ -41235,7 +41932,7 @@ var require_core = __commonJS(function(exports) {
41235
41932
  if (!this.refs[ref])
41236
41933
  await loadMetaSchema.call(this, _schema.$schema);
41237
41934
  if (!this.refs[ref])
41238
- this.addSchema(_schema, ref, meta189);
41935
+ this.addSchema(_schema, ref, meta195);
41239
41936
  }
41240
41937
  async function _loadSchema(ref) {
41241
41938
  const p = this._loading[ref];
@@ -41248,34 +41945,34 @@ var require_core = __commonJS(function(exports) {
41248
41945
  }
41249
41946
  }
41250
41947
  }
41251
- addSchema(schema190, key, _meta, _validateSchema = this.opts.validateSchema) {
41252
- if (Array.isArray(schema190)) {
41253
- for (const sch of schema190)
41948
+ addSchema(schema196, key, _meta, _validateSchema = this.opts.validateSchema) {
41949
+ if (Array.isArray(schema196)) {
41950
+ for (const sch of schema196)
41254
41951
  this.addSchema(sch, undefined, _meta, _validateSchema);
41255
41952
  return this;
41256
41953
  }
41257
41954
  let id;
41258
- if (typeof schema190 === "object") {
41955
+ if (typeof schema196 === "object") {
41259
41956
  const { schemaId } = this.opts;
41260
- id = schema190[schemaId];
41957
+ id = schema196[schemaId];
41261
41958
  if (id !== undefined && typeof id != "string") {
41262
41959
  throw new Error(`schema ${schemaId} must be string`);
41263
41960
  }
41264
41961
  }
41265
41962
  key = (0, resolve_1.normalizeId)(key || id);
41266
41963
  this._checkUnique(key);
41267
- this.schemas[key] = this._addSchema(schema190, _meta, key, _validateSchema, true);
41964
+ this.schemas[key] = this._addSchema(schema196, _meta, key, _validateSchema, true);
41268
41965
  return this;
41269
41966
  }
41270
- addMetaSchema(schema190, key, _validateSchema = this.opts.validateSchema) {
41271
- this.addSchema(schema190, key, true, _validateSchema);
41967
+ addMetaSchema(schema196, key, _validateSchema = this.opts.validateSchema) {
41968
+ this.addSchema(schema196, key, true, _validateSchema);
41272
41969
  return this;
41273
41970
  }
41274
- validateSchema(schema190, throwOrLogError) {
41275
- if (typeof schema190 == "boolean")
41971
+ validateSchema(schema196, throwOrLogError) {
41972
+ if (typeof schema196 == "boolean")
41276
41973
  return true;
41277
41974
  let $schema;
41278
- $schema = schema190.$schema;
41975
+ $schema = schema196.$schema;
41279
41976
  if ($schema !== undefined && typeof $schema != "string") {
41280
41977
  throw new Error("$schema must be a string");
41281
41978
  }
@@ -41285,7 +41982,7 @@ var require_core = __commonJS(function(exports) {
41285
41982
  this.errors = null;
41286
41983
  return true;
41287
41984
  }
41288
- const valid = this.validate($schema, schema190);
41985
+ const valid = this.validate($schema, schema196);
41289
41986
  if (!valid && throwOrLogError) {
41290
41987
  const message = "schema is invalid: " + this.errorsText();
41291
41988
  if (this.opts.validateSchema === "log")
@@ -41419,9 +42116,9 @@ var require_core = __commonJS(function(exports) {
41419
42116
  if (typeof rule != "object")
41420
42117
  continue;
41421
42118
  const { $data } = rule.definition;
41422
- const schema190 = keywords[key];
41423
- if ($data && schema190)
41424
- keywords[key] = schemaOrData(schema190);
42119
+ const schema196 = keywords[key];
42120
+ if ($data && schema196)
42121
+ keywords[key] = schemaOrData(schema196);
41425
42122
  }
41426
42123
  }
41427
42124
  return metaSchema;
@@ -41439,23 +42136,23 @@ var require_core = __commonJS(function(exports) {
41439
42136
  }
41440
42137
  }
41441
42138
  }
41442
- _addSchema(schema190, meta189, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
42139
+ _addSchema(schema196, meta195, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
41443
42140
  let id;
41444
42141
  const { schemaId } = this.opts;
41445
- if (typeof schema190 == "object") {
41446
- id = schema190[schemaId];
42142
+ if (typeof schema196 == "object") {
42143
+ id = schema196[schemaId];
41447
42144
  } else {
41448
42145
  if (this.opts.jtd)
41449
42146
  throw new Error("schema must be object");
41450
- else if (typeof schema190 != "boolean")
42147
+ else if (typeof schema196 != "boolean")
41451
42148
  throw new Error("schema must be object or boolean");
41452
42149
  }
41453
- let sch = this._cache.get(schema190);
42150
+ let sch = this._cache.get(schema196);
41454
42151
  if (sch !== undefined)
41455
42152
  return sch;
41456
42153
  baseId = (0, resolve_1.normalizeId)(id || baseId);
41457
- const localRefs = resolve_1.getSchemaRefs.call(this, schema190, baseId);
41458
- sch = new compile_1.SchemaEnv({ schema: schema190, schemaId, meta: meta189, baseId, localRefs });
42154
+ const localRefs = resolve_1.getSchemaRefs.call(this, schema196, baseId);
42155
+ sch = new compile_1.SchemaEnv({ schema: schema196, schemaId, meta: meta195, baseId, localRefs });
41459
42156
  this._cache.set(sch.schema, sch);
41460
42157
  if (addSchema && !baseId.startsWith("#")) {
41461
42158
  if (baseId)
@@ -41463,7 +42160,7 @@ var require_core = __commonJS(function(exports) {
41463
42160
  this.refs[baseId] = sch;
41464
42161
  }
41465
42162
  if (validateSchema)
41466
- this.validateSchema(schema190, true);
42163
+ this.validateSchema(schema196, true);
41467
42164
  return sch;
41468
42165
  }
41469
42166
  _checkUnique(id) {
@@ -41614,8 +42311,8 @@ var require_core = __commonJS(function(exports) {
41614
42311
  var $dataRef = {
41615
42312
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
41616
42313
  };
41617
- function schemaOrData(schema190) {
41618
- return { anyOf: [schema190, $dataRef] };
42314
+ function schemaOrData(schema196) {
42315
+ return { anyOf: [schema196, $dataRef] };
41619
42316
  }
41620
42317
  });
41621
42318
 
@@ -41891,7 +42588,7 @@ var require_pattern = __commonJS(function(exports) {
41891
42588
  $data: true,
41892
42589
  error: error48,
41893
42590
  code(cxt) {
41894
- const { gen, data, $data, schema: schema190, schemaCode, it } = cxt;
42591
+ const { gen, data, $data, schema: schema196, schemaCode, it } = cxt;
41895
42592
  const u = it.opts.unicodeRegExp ? "u" : "";
41896
42593
  if ($data) {
41897
42594
  const { regExp } = it.opts.code;
@@ -41900,7 +42597,7 @@ var require_pattern = __commonJS(function(exports) {
41900
42597
  gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
41901
42598
  cxt.fail$data((0, codegen_1._)`!${valid}`);
41902
42599
  } else {
41903
- const regExp = (0, code_1.usePattern)(cxt, schema190);
42600
+ const regExp = (0, code_1.usePattern)(cxt, schema196);
41904
42601
  cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
41905
42602
  }
41906
42603
  }
@@ -41951,11 +42648,11 @@ var require_required = __commonJS(function(exports) {
41951
42648
  $data: true,
41952
42649
  error: error48,
41953
42650
  code(cxt) {
41954
- const { gen, schema: schema190, schemaCode, data, $data, it } = cxt;
42651
+ const { gen, schema: schema196, schemaCode, data, $data, it } = cxt;
41955
42652
  const { opts } = it;
41956
- if (!$data && schema190.length === 0)
42653
+ if (!$data && schema196.length === 0)
41957
42654
  return;
41958
- const useLoop = schema190.length >= opts.loopRequired;
42655
+ const useLoop = schema196.length >= opts.loopRequired;
41959
42656
  if (it.allErrors)
41960
42657
  allErrorsMode();
41961
42658
  else
@@ -41963,7 +42660,7 @@ var require_required = __commonJS(function(exports) {
41963
42660
  if (opts.strictRequired) {
41964
42661
  const props = cxt.parentSchema.properties;
41965
42662
  const { definedProperties } = cxt.it;
41966
- for (const requiredKey of schema190) {
42663
+ for (const requiredKey of schema196) {
41967
42664
  if ((props === null || props === undefined ? undefined : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {
41968
42665
  const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
41969
42666
  const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
@@ -41975,7 +42672,7 @@ var require_required = __commonJS(function(exports) {
41975
42672
  if (useLoop || $data) {
41976
42673
  cxt.block$data(codegen_1.nil, loopAllRequired);
41977
42674
  } else {
41978
- for (const prop of schema190) {
42675
+ for (const prop of schema196) {
41979
42676
  (0, code_1.checkReportMissingProp)(cxt, prop);
41980
42677
  }
41981
42678
  }
@@ -41987,7 +42684,7 @@ var require_required = __commonJS(function(exports) {
41987
42684
  cxt.block$data(valid, () => loopUntilMissing(missing, valid));
41988
42685
  cxt.ok(valid);
41989
42686
  } else {
41990
- gen.if((0, code_1.checkMissingProp)(cxt, schema190, missing));
42687
+ gen.if((0, code_1.checkMissingProp)(cxt, schema196, missing));
41991
42688
  (0, code_1.reportMissingProp)(cxt, missing);
41992
42689
  gen.else();
41993
42690
  }
@@ -42065,8 +42762,8 @@ var require_uniqueItems = __commonJS(function(exports) {
42065
42762
  $data: true,
42066
42763
  error: error48,
42067
42764
  code(cxt) {
42068
- const { gen, data, $data, schema: schema190, parentSchema, schemaCode, it } = cxt;
42069
- if (!$data && !schema190)
42765
+ const { gen, data, $data, schema: schema196, parentSchema, schemaCode, it } = cxt;
42766
+ if (!$data && !schema196)
42070
42767
  return;
42071
42768
  const valid = gen.let("valid");
42072
42769
  const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
@@ -42126,11 +42823,11 @@ var require_const = __commonJS(function(exports) {
42126
42823
  $data: true,
42127
42824
  error: error48,
42128
42825
  code(cxt) {
42129
- const { gen, data, $data, schemaCode, schema: schema190 } = cxt;
42130
- if ($data || schema190 && typeof schema190 == "object") {
42826
+ const { gen, data, $data, schemaCode, schema: schema196 } = cxt;
42827
+ if ($data || schema196 && typeof schema196 == "object") {
42131
42828
  cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
42132
42829
  } else {
42133
- cxt.fail((0, codegen_1._)`${schema190} !== ${data}`);
42830
+ cxt.fail((0, codegen_1._)`${schema196} !== ${data}`);
42134
42831
  }
42135
42832
  }
42136
42833
  };
@@ -42153,10 +42850,10 @@ var require_enum = __commonJS(function(exports) {
42153
42850
  $data: true,
42154
42851
  error: error48,
42155
42852
  code(cxt) {
42156
- const { gen, data, $data, schema: schema190, schemaCode, it } = cxt;
42157
- if (!$data && schema190.length === 0)
42853
+ const { gen, data, $data, schema: schema196, schemaCode, it } = cxt;
42854
+ if (!$data && schema196.length === 0)
42158
42855
  throw new Error("enum must have non-empty array");
42159
- const useLoop = schema190.length >= it.opts.loopEnum;
42856
+ const useLoop = schema196.length >= it.opts.loopEnum;
42160
42857
  let eql;
42161
42858
  const getEql = () => eql !== null && eql !== undefined ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
42162
42859
  let valid;
@@ -42164,10 +42861,10 @@ var require_enum = __commonJS(function(exports) {
42164
42861
  valid = gen.let("valid");
42165
42862
  cxt.block$data(valid, loopEnum);
42166
42863
  } else {
42167
- if (!Array.isArray(schema190))
42864
+ if (!Array.isArray(schema196))
42168
42865
  throw new Error("ajv implementation error");
42169
42866
  const vSchema = gen.const("vSchema", schemaCode);
42170
- valid = (0, codegen_1.or)(...schema190.map((_x, i) => equalCode(vSchema, i)));
42867
+ valid = (0, codegen_1.or)(...schema196.map((_x, i) => equalCode(vSchema, i)));
42171
42868
  }
42172
42869
  cxt.pass(valid);
42173
42870
  function loopEnum() {
@@ -42175,7 +42872,7 @@ var require_enum = __commonJS(function(exports) {
42175
42872
  gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
42176
42873
  }
42177
42874
  function equalCode(vSchema, i) {
42178
- const sch = schema190[i];
42875
+ const sch = schema196[i];
42179
42876
  return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
42180
42877
  }
42181
42878
  }
@@ -42240,13 +42937,13 @@ var require_additionalItems = __commonJS(function(exports) {
42240
42937
  }
42241
42938
  };
42242
42939
  function validateAdditionalItems(cxt, items) {
42243
- const { gen, schema: schema190, data, keyword, it } = cxt;
42940
+ const { gen, schema: schema196, data, keyword, it } = cxt;
42244
42941
  it.items = true;
42245
42942
  const len = gen.const("len", (0, codegen_1._)`${data}.length`);
42246
- if (schema190 === false) {
42943
+ if (schema196 === false) {
42247
42944
  cxt.setParams({ len: items.length });
42248
42945
  cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
42249
- } else if (typeof schema190 == "object" && !(0, util_1.alwaysValidSchema)(it, schema190)) {
42946
+ } else if (typeof schema196 == "object" && !(0, util_1.alwaysValidSchema)(it, schema196)) {
42250
42947
  const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
42251
42948
  gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
42252
42949
  cxt.ok(valid);
@@ -42276,11 +42973,11 @@ var require_items = __commonJS(function(exports) {
42276
42973
  schemaType: ["object", "array", "boolean"],
42277
42974
  before: "uniqueItems",
42278
42975
  code(cxt) {
42279
- const { schema: schema190, it } = cxt;
42280
- if (Array.isArray(schema190))
42281
- return validateTuple(cxt, "additionalItems", schema190);
42976
+ const { schema: schema196, it } = cxt;
42977
+ if (Array.isArray(schema196))
42978
+ return validateTuple(cxt, "additionalItems", schema196);
42282
42979
  it.items = true;
42283
- if ((0, util_1.alwaysValidSchema)(it, schema190))
42980
+ if ((0, util_1.alwaysValidSchema)(it, schema196))
42284
42981
  return;
42285
42982
  cxt.ok((0, code_1.validateArray)(cxt));
42286
42983
  }
@@ -42349,10 +43046,10 @@ var require_items2020 = __commonJS(function(exports) {
42349
43046
  before: "uniqueItems",
42350
43047
  error: error48,
42351
43048
  code(cxt) {
42352
- const { schema: schema190, parentSchema, it } = cxt;
43049
+ const { schema: schema196, parentSchema, it } = cxt;
42353
43050
  const { prefixItems } = parentSchema;
42354
43051
  it.items = true;
42355
- if ((0, util_1.alwaysValidSchema)(it, schema190))
43052
+ if ((0, util_1.alwaysValidSchema)(it, schema196))
42356
43053
  return;
42357
43054
  if (prefixItems)
42358
43055
  (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
@@ -42380,7 +43077,7 @@ var require_contains = __commonJS(function(exports) {
42380
43077
  trackErrors: true,
42381
43078
  error: error48,
42382
43079
  code(cxt) {
42383
- const { gen, schema: schema190, parentSchema, data, it } = cxt;
43080
+ const { gen, schema: schema196, parentSchema, data, it } = cxt;
42384
43081
  let min;
42385
43082
  let max;
42386
43083
  const { minContains, maxContains } = parentSchema;
@@ -42401,7 +43098,7 @@ var require_contains = __commonJS(function(exports) {
42401
43098
  cxt.fail();
42402
43099
  return;
42403
43100
  }
42404
- if ((0, util_1.alwaysValidSchema)(it, schema190)) {
43101
+ if ((0, util_1.alwaysValidSchema)(it, schema196)) {
42405
43102
  let cond = (0, codegen_1._)`${len} >= ${min}`;
42406
43103
  if (max !== undefined)
42407
43104
  cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
@@ -42482,14 +43179,14 @@ var require_dependencies = __commonJS(function(exports) {
42482
43179
  validateSchemaDeps(cxt, schDeps);
42483
43180
  }
42484
43181
  };
42485
- function splitDependencies({ schema: schema190 }) {
43182
+ function splitDependencies({ schema: schema196 }) {
42486
43183
  const propertyDeps = {};
42487
43184
  const schemaDeps = {};
42488
- for (const key in schema190) {
43185
+ for (const key in schema196) {
42489
43186
  if (key === "__proto__")
42490
43187
  continue;
42491
- const deps = Array.isArray(schema190[key]) ? propertyDeps : schemaDeps;
42492
- deps[key] = schema190[key];
43188
+ const deps = Array.isArray(schema196[key]) ? propertyDeps : schemaDeps;
43189
+ deps[key] = schema196[key];
42493
43190
  }
42494
43191
  return [propertyDeps, schemaDeps];
42495
43192
  }
@@ -42554,8 +43251,8 @@ var require_propertyNames = __commonJS(function(exports) {
42554
43251
  schemaType: ["object", "boolean"],
42555
43252
  error: error48,
42556
43253
  code(cxt) {
42557
- const { gen, schema: schema190, data, it } = cxt;
42558
- if ((0, util_1.alwaysValidSchema)(it, schema190))
43254
+ const { gen, schema: schema196, data, it } = cxt;
43255
+ if ((0, util_1.alwaysValidSchema)(it, schema196))
42559
43256
  return;
42560
43257
  const valid = gen.name("valid");
42561
43258
  gen.forIn("key", data, (key) => {
@@ -42598,12 +43295,12 @@ var require_additionalProperties = __commonJS(function(exports) {
42598
43295
  trackErrors: true,
42599
43296
  error: error48,
42600
43297
  code(cxt) {
42601
- const { gen, schema: schema190, parentSchema, data, errsCount, it } = cxt;
43298
+ const { gen, schema: schema196, parentSchema, data, errsCount, it } = cxt;
42602
43299
  if (!errsCount)
42603
43300
  throw new Error("ajv implementation error");
42604
43301
  const { allErrors, opts } = it;
42605
43302
  it.props = true;
42606
- if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema190))
43303
+ if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema196))
42607
43304
  return;
42608
43305
  const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
42609
43306
  const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
@@ -42636,18 +43333,18 @@ var require_additionalProperties = __commonJS(function(exports) {
42636
43333
  gen.code((0, codegen_1._)`delete ${data}[${key}]`);
42637
43334
  }
42638
43335
  function additionalPropertyCode(key) {
42639
- if (opts.removeAdditional === "all" || opts.removeAdditional && schema190 === false) {
43336
+ if (opts.removeAdditional === "all" || opts.removeAdditional && schema196 === false) {
42640
43337
  deleteAdditional(key);
42641
43338
  return;
42642
43339
  }
42643
- if (schema190 === false) {
43340
+ if (schema196 === false) {
42644
43341
  cxt.setParams({ additionalProperty: key });
42645
43342
  cxt.error();
42646
43343
  if (!allErrors)
42647
43344
  gen.break();
42648
43345
  return;
42649
43346
  }
42650
- if (typeof schema190 == "object" && !(0, util_1.alwaysValidSchema)(it, schema190)) {
43347
+ if (typeof schema196 == "object" && !(0, util_1.alwaysValidSchema)(it, schema196)) {
42651
43348
  const valid = gen.name("valid");
42652
43349
  if (opts.removeAdditional === "failing") {
42653
43350
  applyAdditionalSchema(key, valid, false);
@@ -42694,18 +43391,18 @@ var require_properties = __commonJS(function(exports) {
42694
43391
  type: "object",
42695
43392
  schemaType: "object",
42696
43393
  code(cxt) {
42697
- const { gen, schema: schema190, parentSchema, data, it } = cxt;
43394
+ const { gen, schema: schema196, parentSchema, data, it } = cxt;
42698
43395
  if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) {
42699
43396
  additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
42700
43397
  }
42701
- const allProps = (0, code_1.allSchemaProperties)(schema190);
43398
+ const allProps = (0, code_1.allSchemaProperties)(schema196);
42702
43399
  for (const prop of allProps) {
42703
43400
  it.definedProperties.add(prop);
42704
43401
  }
42705
43402
  if (it.opts.unevaluated && allProps.length && it.props !== true) {
42706
43403
  it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
42707
43404
  }
42708
- const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema190[p]));
43405
+ const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema196[p]));
42709
43406
  if (properties.length === 0)
42710
43407
  return;
42711
43408
  const valid = gen.name("valid");
@@ -42723,7 +43420,7 @@ var require_properties = __commonJS(function(exports) {
42723
43420
  cxt.ok(valid);
42724
43421
  }
42725
43422
  function hasDefault(prop) {
42726
- return it.opts.useDefaults && !it.compositeRule && schema190[prop].default !== undefined;
43423
+ return it.opts.useDefaults && !it.compositeRule && schema196[prop].default !== undefined;
42727
43424
  }
42728
43425
  function applyPropertySchema(prop) {
42729
43426
  cxt.subschema({
@@ -42749,10 +43446,10 @@ var require_patternProperties = __commonJS(function(exports) {
42749
43446
  type: "object",
42750
43447
  schemaType: "object",
42751
43448
  code(cxt) {
42752
- const { gen, schema: schema190, data, parentSchema, it } = cxt;
43449
+ const { gen, schema: schema196, data, parentSchema, it } = cxt;
42753
43450
  const { opts } = it;
42754
- const patterns = (0, code_1.allSchemaProperties)(schema190);
42755
- const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema190[p]));
43451
+ const patterns = (0, code_1.allSchemaProperties)(schema196);
43452
+ const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema196[p]));
42756
43453
  if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
42757
43454
  return;
42758
43455
  }
@@ -42817,8 +43514,8 @@ var require_not = __commonJS(function(exports) {
42817
43514
  schemaType: ["object", "boolean"],
42818
43515
  trackErrors: true,
42819
43516
  code(cxt) {
42820
- const { gen, schema: schema190, it } = cxt;
42821
- if ((0, util_1.alwaysValidSchema)(it, schema190)) {
43517
+ const { gen, schema: schema196, it } = cxt;
43518
+ if ((0, util_1.alwaysValidSchema)(it, schema196)) {
42822
43519
  cxt.fail();
42823
43520
  return;
42824
43521
  }
@@ -42865,12 +43562,12 @@ var require_oneOf = __commonJS(function(exports) {
42865
43562
  trackErrors: true,
42866
43563
  error: error48,
42867
43564
  code(cxt) {
42868
- const { gen, schema: schema190, parentSchema, it } = cxt;
42869
- if (!Array.isArray(schema190))
43565
+ const { gen, schema: schema196, parentSchema, it } = cxt;
43566
+ if (!Array.isArray(schema196))
42870
43567
  throw new Error("ajv implementation error");
42871
43568
  if (it.opts.discriminator && parentSchema.discriminator)
42872
43569
  return;
42873
- const schArr = schema190;
43570
+ const schArr = schema196;
42874
43571
  const valid = gen.let("valid", false);
42875
43572
  const passing = gen.let("passing", null);
42876
43573
  const schValid = gen.name("_valid");
@@ -42913,11 +43610,11 @@ var require_allOf = __commonJS(function(exports) {
42913
43610
  keyword: "allOf",
42914
43611
  schemaType: "array",
42915
43612
  code(cxt) {
42916
- const { gen, schema: schema190, it } = cxt;
42917
- if (!Array.isArray(schema190))
43613
+ const { gen, schema: schema196, it } = cxt;
43614
+ if (!Array.isArray(schema196))
42918
43615
  throw new Error("ajv implementation error");
42919
43616
  const valid = gen.name("valid");
42920
- schema190.forEach((sch, i) => {
43617
+ schema196.forEach((sch, i) => {
42921
43618
  if ((0, util_1.alwaysValidSchema)(it, sch))
42922
43619
  return;
42923
43620
  const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
@@ -42989,8 +43686,8 @@ var require_if = __commonJS(function(exports) {
42989
43686
  }
42990
43687
  };
42991
43688
  function hasSchema(it, keyword) {
42992
- const schema190 = it.schema[keyword];
42993
- return schema190 !== undefined && !(0, util_1.alwaysValidSchema)(it, schema190);
43689
+ const schema196 = it.schema[keyword];
43690
+ return schema196 !== undefined && !(0, util_1.alwaysValidSchema)(it, schema196);
42994
43691
  }
42995
43692
  exports.default = def;
42996
43693
  });
@@ -43068,7 +43765,7 @@ var require_format = __commonJS(function(exports) {
43068
43765
  $data: true,
43069
43766
  error: error48,
43070
43767
  code(cxt, ruleType) {
43071
- const { gen, data, $data, schema: schema190, schemaCode, it } = cxt;
43768
+ const { gen, data, $data, schema: schema196, schemaCode, it } = cxt;
43072
43769
  const { opts, errSchemaPath, schemaEnv, self } = it;
43073
43770
  if (!opts.validateFormats)
43074
43771
  return;
@@ -43098,7 +43795,7 @@ var require_format = __commonJS(function(exports) {
43098
43795
  }
43099
43796
  }
43100
43797
  function validateFormat() {
43101
- const formatDef = self.formats[schema190];
43798
+ const formatDef = self.formats[schema196];
43102
43799
  if (!formatDef) {
43103
43800
  unknownFormat();
43104
43801
  return;
@@ -43115,12 +43812,12 @@ var require_format = __commonJS(function(exports) {
43115
43812
  }
43116
43813
  throw new Error(unknownMsg());
43117
43814
  function unknownMsg() {
43118
- return `unknown format "${schema190}" ignored in schema at path "${errSchemaPath}"`;
43815
+ return `unknown format "${schema196}" ignored in schema at path "${errSchemaPath}"`;
43119
43816
  }
43120
43817
  }
43121
43818
  function getFormat(fmtDef) {
43122
- const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema190)}` : undefined;
43123
- const fmt = gen.scopeValue("formats", { key: schema190, ref: fmtDef, code });
43819
+ const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema196)}` : undefined;
43820
+ const fmt = gen.scopeValue("formats", { key: schema196, ref: fmtDef, code });
43124
43821
  if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
43125
43822
  return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
43126
43823
  }
@@ -43216,15 +43913,15 @@ var require_discriminator = __commonJS(function(exports) {
43216
43913
  schemaType: "object",
43217
43914
  error: error48,
43218
43915
  code(cxt) {
43219
- const { gen, data, schema: schema190, parentSchema, it } = cxt;
43916
+ const { gen, data, schema: schema196, parentSchema, it } = cxt;
43220
43917
  const { oneOf } = parentSchema;
43221
43918
  if (!it.opts.discriminator) {
43222
43919
  throw new Error("discriminator: requires discriminator option");
43223
43920
  }
43224
- const tagName = schema190.propertyName;
43921
+ const tagName = schema196.propertyName;
43225
43922
  if (typeof tagName != "string")
43226
43923
  throw new Error("discriminator: requires propertyName");
43227
- if (schema190.mapping)
43924
+ if (schema196.mapping)
43228
43925
  throw new Error("discriminator: mapping is not supported");
43229
43926
  if (!oneOf)
43230
43927
  throw new Error("discriminator: requires oneOf keyword");
@@ -43825,8 +44522,8 @@ class AjvJsonSchemaValidator {
43825
44522
  constructor(ajv) {
43826
44523
  this._ajv = ajv ?? createDefaultAjvInstance();
43827
44524
  }
43828
- getValidator(schema190) {
43829
- const ajvValidator = "$id" in schema190 && typeof schema190.$id === "string" ? this._ajv.getSchema(schema190.$id) ?? this._ajv.compile(schema190) : this._ajv.compile(schema190);
44525
+ getValidator(schema196) {
44526
+ const ajvValidator = "$id" in schema196 && typeof schema196.$id === "string" ? this._ajv.getSchema(schema196.$id) ?? this._ajv.compile(schema196) : this._ajv.compile(schema196);
43830
44527
  return (input) => {
43831
44528
  const valid = ajvValidator(input);
43832
44529
  if (valid) {
@@ -44309,12 +45006,12 @@ var init_server2 = __esm(() => {
44309
45006
  });
44310
45007
 
44311
45008
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
44312
- function isCompletable(schema190) {
44313
- return !!schema190 && typeof schema190 === "object" && COMPLETABLE_SYMBOL in schema190;
45009
+ function isCompletable(schema196) {
45010
+ return !!schema196 && typeof schema196 === "object" && COMPLETABLE_SYMBOL in schema196;
44314
45011
  }
44315
- function getCompleter(schema190) {
44316
- const meta189 = schema190[COMPLETABLE_SYMBOL];
44317
- return meta189?.complete;
45012
+ function getCompleter(schema196) {
45013
+ const meta195 = schema196[COMPLETABLE_SYMBOL];
45014
+ return meta195?.complete;
44318
45015
  }
44319
45016
  var COMPLETABLE_SYMBOL, McpZodTypeKind;
44320
45017
  var init_completable = __esm(() => {
@@ -45067,20 +45764,20 @@ function isZodRawShapeCompat(obj) {
45067
45764
  }
45068
45765
  return Object.values(obj).some(isZodTypeLike);
45069
45766
  }
45070
- function getZodSchemaObject(schema190) {
45071
- if (!schema190) {
45767
+ function getZodSchemaObject(schema196) {
45768
+ if (!schema196) {
45072
45769
  return;
45073
45770
  }
45074
- if (isZodRawShapeCompat(schema190)) {
45075
- return objectFromShape(schema190);
45771
+ if (isZodRawShapeCompat(schema196)) {
45772
+ return objectFromShape(schema196);
45076
45773
  }
45077
- if (!isZodSchemaInstance(schema190)) {
45774
+ if (!isZodSchemaInstance(schema196)) {
45078
45775
  throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");
45079
45776
  }
45080
- return schema190;
45777
+ return schema196;
45081
45778
  }
45082
- function promptArgumentsFromSchema(schema190) {
45083
- const shape = getObjectShape(schema190);
45779
+ function promptArgumentsFromSchema(schema196) {
45780
+ const shape = getObjectShape(schema196);
45084
45781
  if (!shape)
45085
45782
  return [];
45086
45783
  return Object.entries(shape).map(([name, field]) => {
@@ -45093,8 +45790,8 @@ function promptArgumentsFromSchema(schema190) {
45093
45790
  };
45094
45791
  });
45095
45792
  }
45096
- function getMethodValue(schema190) {
45097
- const shape = getObjectShape(schema190);
45793
+ function getMethodValue(schema196) {
45794
+ const shape = getObjectShape(schema196);
45098
45795
  const methodSchema = shape?.method;
45099
45796
  if (!methodSchema) {
45100
45797
  throw new Error("Schema is missing a method literal");
@@ -45227,7 +45924,7 @@ var PACKAGE_NAME = "ask-marcel-office-cli", okText = (text) => ({ content: [{ ty
45227
45924
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }
45228
45925
  }, async ({ force }) => {
45229
45926
  const loginAuth = deps.makeLoginAuth ? deps.makeLoginAuth() : auth;
45230
- const result = await execute187(loginAuth, { force: force ?? false });
45927
+ const result = await execute193(loginAuth, { force: force ?? false });
45231
45928
  if (!result.ok)
45232
45929
  return errText(result.error.type === "auth_cancelled" ? "Authentication cancelled" : result.error.message);
45233
45930
  const info = await graph.getCachedTokenInfo();
@@ -45362,7 +46059,7 @@ import updateNotifier from "update-notifier";
45362
46059
  // package.json
45363
46060
  var package_default = {
45364
46061
  name: "ask-marcel-office-cli",
45365
- version: "2.4.0",
46062
+ version: "2.5.0",
45366
46063
  description: "Microsoft Graph CLI + library — typed Bun/TypeScript wrapper around 150+ Graph operations (read + on-the-fly PDF/markdown conversion + federated Microsoft Search) reachable from a Teams browser-OAuth token.",
45367
46064
  license: "MIT",
45368
46065
  author: "Vincent Delacourt <vincent.delacourt@adama-development.com>",
@@ -45438,6 +46135,7 @@ var package_default = {
45438
46135
  "lint:strict": "LINT_STRICT=1 eslint --max-warnings=0",
45439
46136
  typecheck: "bun --bun x tsc --noEmit",
45440
46137
  coverage: "bun run scripts/check-coverage.ts",
46138
+ "check:docs": "bun run scripts/check-doc-numbers.ts",
45441
46139
  mutate: "stryker run",
45442
46140
  "mutate:changed": "bash scripts/mutate-changed.sh",
45443
46141
  "mutate:staged": "bash scripts/mutate-staged.sh",
@@ -47385,9 +48083,9 @@ var createWinstonLogger = (config2 = {}) => {
47385
48083
  transports: [new transports.Console({ stderrLevels: ALL_LEVELS })]
47386
48084
  });
47387
48085
  return {
47388
- info: (event, meta189) => winston.info(event, meta189),
47389
- warn: (event, meta189) => winston.warn(event, meta189),
47390
- error: (event, meta189) => winston.error(event, meta189)
48086
+ info: (event, meta195) => winston.info(event, meta195),
48087
+ warn: (event, meta195) => winston.warn(event, meta195),
48088
+ error: (event, meta195) => winston.error(event, meta195)
47391
48089
  };
47392
48090
  };
47393
48091
  // src/infra/process-runner-bun.ts
@@ -47421,9 +48119,9 @@ var createNodeProcessRunner = () => ({
47421
48119
  var defaultCachePath = (home) => join2(home, ".ask-marcel", "token-cache.json");
47422
48120
  var commandNamesWhere = (matches) => Object.entries(commands).filter(([, cmd]) => matches(cmd.meta)).map(([name]) => name).toSorted((a, b) => a.localeCompare(b));
47423
48121
  var secondaryTokenCommands = {
47424
- elevated: commandNamesWhere((meta189) => meta189.needsElevatedToken === true),
47425
- chatsvcagg: commandNamesWhere((meta189) => meta189.needsSubstrateToken === "chatsvcagg"),
47426
- ic3: commandNamesWhere((meta189) => meta189.needsSubstrateToken === "ic3")
48122
+ elevated: commandNamesWhere((meta195) => meta195.needsElevatedToken === true),
48123
+ chatsvcagg: commandNamesWhere((meta195) => meta195.needsSubstrateToken === "chatsvcagg"),
48124
+ ic3: commandNamesWhere((meta195) => meta195.needsSubstrateToken === "ic3")
47427
48125
  };
47428
48126
  var defaultFileSystem3 = () => typeof globalThis.Bun !== "undefined" ? createBunFileSystem() : createNodeFileSystem();
47429
48127
  var defaultProcessRunner = () => typeof globalThis.Bun !== "undefined" ? createBunProcessRunner() : createNodeProcessRunner();
@@ -47485,8 +48183,8 @@ init_login_status();
47485
48183
 
47486
48184
  // src/use-cases/commands/logout.ts
47487
48185
  init_zod();
47488
- var schema188 = exports_external.object({}).strict();
47489
- var execute188 = async (auth) => auth.logout();
48186
+ var schema194 = exports_external.object({}).strict();
48187
+ var execute194 = async (auth) => auth.logout();
47490
48188
 
47491
48189
  // src/composition/cli.ts
47492
48190
  init_output_path();
@@ -47495,8 +48193,8 @@ init_output_path();
47495
48193
  init_zod();
47496
48194
  var PACKAGE = "ask-marcel-office-cli";
47497
48195
  var argsFor = (manager) => manager === "bun" ? ["add", "-g", `${PACKAGE}@latest`] : ["i", "-g", `${PACKAGE}@latest`];
47498
- var schema189 = exports_external.object({}).strict();
47499
- var execute189 = async (runner, manager) => {
48196
+ var schema195 = exports_external.object({}).strict();
48197
+ var execute195 = async (runner, manager) => {
47500
48198
  const result = await runner.runInherit(manager, argsFor(manager));
47501
48199
  if (!result.ok)
47502
48200
  return err({ type: "spawn_failed", message: result.error.message });
@@ -47560,6 +48258,7 @@ var buildCli = (deps) => {
47560
48258
  const searchPostNames = Object.entries(commands).filter(([, c]) => c.meta.graphMethod === "POST" && c.meta.mutates !== true).map(([n]) => n).toSorted((a, b) => a.localeCompare(b));
47561
48259
  const surfaceDescription = `Microsoft Graph CLI. Read-mostly by design — the ONLY writes are the ${mutatingCommandNames.length} mail-draft commands (${mutatingCommandNames.join(", ")}), which can only create or update an UNSENT draft; the CLI cannot send mail, create or modify calendar items, or write files (there is no send-mail / send-draft / create-event / upload-file command). ${getEndpointCount} GET endpoints + ${searchPostNames.length} search POST (${searchPostNames.join(", ")}). Safe default for LLM autonomy.`;
47562
48260
  program2.name("ask-marcel-office").description(surfaceDescription).version(version2 ?? "0.0.0").configureHelp({
48261
+ helpWidth: 80,
47563
48262
  subcommandDescription: (cmd) => firstSentence(cmd.description())
47564
48263
  }).option("--output-path <path>", 'Globally available. When the command returns inlined bytes (`{contentType, size, base64}` for binary or `{..., text}` for text), decode and write them to <path>, replacing the inline field with `savedTo: <path>` in the JSON envelope. Use this for multi-MB PDFs / images so the LLM never has to round-trip a base64 string through stdout. Parent directories are auto-created. When applied to a command whose response has neither `base64` nor `text` (e.g. plain JSON gets like `get-current-user`) the CLI emits a clear `{"ok":false,"error":"--output-path: <cmd> did not return inlined bytes …"}` envelope rather than silently writing nothing — a JSON-only command paired with this flag is almost certainly a mistake.').option("--output-dir <dir>", "Globally available. For commands that return a `media` array (the `extract-*-images` family), decode and write every image to <dir>/<filename>, replacing each `base64` with `savedTo` in the JSON envelope. The directory is auto-created. Use this for image-heavy decks so the LLM never round-trips a base64 blob through stdout. Applied to a command that returns no media array, the CLI emits a clear error rather than writing nothing.").addOption((() => {
47565
48264
  const ALLOWED = ["text", "json"];
@@ -47609,7 +48308,7 @@ var buildCli = (deps) => {
47609
48308
  }
47610
48309
  fail(`Unknown command "${result.error.name}". Run \`ask-marcel-office --help\` to list every command.`, "cli_unknown_command");
47611
48310
  });
47612
- program2.command("help-json").description("Print the machine-readable command manifest as JSON. **Use `--terse --category <name>` for fresh-session discovery** — that combo is the actual token-friendly path (~6 KB for one category, vs ~440 KB unfiltered). The unflagged form is the *full* reference (every option / example / response shape per command) and is well over 10× the size of `ask-marcel-office --help`; reach for it only after `--terse` has narrowed the search. `--terse` alone projects to `{name, summary, category}` with each summary compacted to its first sentence (~30 KB across all categories). Categories: lifecycle, drive, excel, sharepoint, tasks, mail, notes, user, calendar, chats, teams, meta.").option("--terse", "Strip per-command options/example/graphPathTemplate/responseShape/etc., emitting only `{ name, summary, category }`. Roughly 95% smaller than the full manifest — use for command discovery, switch to the full manifest once you know which command to invoke.").option("--category <name>", "Filter the manifest to a single category (one of: lifecycle, drive, excel, sharepoint, tasks, mail, notes, user, calendar, chats, teams, meta). Composes with `--terse`. Unknown categories return a structured `{ ok: false, error }` envelope.").action(async (opts) => {
48311
+ program2.command("help-json").description("Print the machine-readable command manifest as JSON. **Use `--terse --category <name>` for fresh-session discovery** — that combo is the actual token-friendly path (~8 KB for one category, vs ~505 KB unfiltered). The unflagged form is the *full* reference (every option / example / response shape per command) and is well over 10× the size of `ask-marcel-office --help`; reach for it only after `--terse` has narrowed the search. `--terse` alone projects to `{name, summary, category}` with each summary compacted to its first sentence (~33 KB across all categories). Categories: lifecycle, drive, excel, sharepoint, tasks, mail, notes, user, calendar, chats, teams, meta.").option("--terse", "Strip per-command options/example/graphPathTemplate/responseShape/etc., emitting only `{ name, summary, category }`. Roughly 95% smaller than the full manifest — use for command discovery, switch to the full manifest once you know which command to invoke.").option("--category <name>", "Filter the manifest to a single category (one of: lifecycle, drive, excel, sharepoint, tasks, mail, notes, user, calendar, chats, teams, meta). Composes with `--terse`. Unknown categories return a structured `{ ok: false, error }` envelope.").action(async (opts) => {
47613
48312
  const outputSource = program2.getOptionValueSource("output");
47614
48313
  if (outputSource === "cli" && getFormat() === "text") {
47615
48314
  fail("help-json always emits JSON (that's the contract — the manifest is the LLM-consumable serialized form of every command's meta). Drop `--output text` for this command. To browse the manifest as Markdown, use `ask-marcel-office docs <command>` instead.");
@@ -47631,7 +48330,7 @@ var buildCli = (deps) => {
47631
48330
  const loginCmd = program2.command("login").description("Authenticate against Microsoft Graph via the Teams web client (cached token → refresh → browser). Already signed in? Reports all four cached tokens (basic / elevated / chatsvcagg / ic3) with their time-left and refresh route; --force re-captures every token via the browser.").option("--force", 'Ignore the cache and re-capture every token via the browser. Rarely needed, and NOT free: it clears the browser session first so the token grant re-fires, which deletes the 90-day "Stay signed in" cookie and usually means entering your password again. A plain `login` already re-captures the elevated (M365) token when it is missing and leaves that session intact, so reach for `--force` only when a tier is stuck and a plain `login` has not fixed it.').action(async () => {
47632
48331
  const force = loginCmd.opts().force ?? false;
47633
48332
  const loginAuth = deps.makeLoginAuth ? deps.makeLoginAuth() : auth;
47634
- const result = await execute187(loginAuth, { force });
48333
+ const result = await execute193(loginAuth, { force });
47635
48334
  if (!result.ok) {
47636
48335
  fail(result.error.type === "auth_cancelled" ? "Authentication cancelled" : result.error.message);
47637
48336
  return;
@@ -47660,7 +48359,7 @@ var buildCli = (deps) => {
47660
48359
  ].join(`
47661
48360
  `));
47662
48361
  const logoutCmd = program2.command("logout").description("Clear the cached Microsoft Graph token so the next command forces a fresh sign-in.").action(async () => {
47663
- const result = await execute188(auth);
48362
+ const result = await execute194(auth);
47664
48363
  if (result.ok)
47665
48364
  renderOut({ status: "logged_out" });
47666
48365
  else
@@ -47676,7 +48375,7 @@ var buildCli = (deps) => {
47676
48375
  `));
47677
48376
  const updateCmd = program2.command("update").description("Re-install the latest published ask-marcel-office from npm, in place. Auto-detects whether you originally installed via npm or bun.").action(async () => {
47678
48377
  const manager = deps.packageManager ?? detectPackageManager(process.argv[1] ?? "");
47679
- const result = await execute189(processRunner, manager);
48378
+ const result = await execute195(processRunner, manager);
47680
48379
  if (result.ok)
47681
48380
  renderOut({ status: "updated", via: manager });
47682
48381
  else if (result.error.type === "spawn_failed")