@bendyline/docblocks-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.
Files changed (2) hide show
  1. package/dist/bin.js +38 -4
  2. package/package.json +7 -7
package/dist/bin.js CHANGED
@@ -947,10 +947,22 @@ var init_authority = __esm({
947
947
  }
948
948
  return [...roots.values()].sort((left, right) => left.id.localeCompare(right.id));
949
949
  }
950
- /** Resolve a root-relative read without ever treating the alias as new authority. */
950
+ /**
951
+ * Resolve a root-relative read without ever treating the alias as new
952
+ * authority. A null rootId (the wire schema's flat-string and
953
+ * omitted-rootId convenience forms) selects the SOLE read root; with
954
+ * several roots configured the ambiguity is an error naming the
955
+ * candidates, never a guess — defaulting must not widen authority.
956
+ */
951
957
  async authorizeRootRead(rootId, workspacePath) {
952
- const root = this.readRoots.find((candidate2) => candidate2.id === rootId);
958
+ const root = rootId === null ? this.readRoots.length === 1 ? this.readRoots[0] : void 0 : this.readRoots.find((candidate2) => candidate2.id === rootId);
953
959
  if (!root) {
960
+ if (rootId === null && this.readRoots.length > 1) {
961
+ throw authorityError(
962
+ "Ambiguous MCP root \u2014 several read roots are configured",
963
+ `Pass source.rootId explicitly. Configured read roots: ${this.readRoots.map((candidate2) => candidate2.id).join(", ")}.`
964
+ );
965
+ }
954
966
  throw authorityError(
955
967
  "Unknown or unreadable MCP root",
956
968
  "Call list_roots and copy a returned read-enabled root id. If no roots are listed, use an inline markdown or bundle source, or restart the server with --allow-read."
@@ -4190,7 +4202,7 @@ function registerAgenticTools(server, context) {
4190
4202
  description: "Convert plain text, Markdown, bundles, or linked-registry inputs directly into one or more immutable artifacts. Plain Markdown needs no preflight or annotations; valid Squisq annotations are optional layout hints. For PPTX, heading-based slide boundaries do not need --- separators. Use save_artifact only for durable filesystem output.",
4191
4203
  inputSchema: z.object({
4192
4204
  source: documentSourceSchema,
4193
- targets: z.array(conversionTargetSchema).min(1).max(12),
4205
+ targets: conversionTargetsSchema,
4194
4206
  themeId: identifierSchema.optional().describe(
4195
4207
  "Exact Squisq theme id. Infer it from the brief when the visual direction is clear. If transformId is set and no exact theme was requested, omit themeId so the transform can apply its preferred compatible theme."
4196
4208
  ),
@@ -5272,7 +5284,7 @@ function boundedFormatCapabilities() {
5272
5284
  };
5273
5285
  });
5274
5286
  }
5275
- var READ_ONLY, ARTIFACT_CREATING, MATERIALIZING, identifierSchema, fidelitySchemas, metadataFields, simpleTarget, conversionTargetSchema, MCP_CONVERSION_TARGET_FORMATS;
5287
+ var READ_ONLY, ARTIFACT_CREATING, MATERIALIZING, identifierSchema, fidelitySchemas, metadataFields, simpleTarget, conversionTargetSchema, MCP_CONVERSION_TARGET_FORMATS, conversionTargetsSchema;
5276
5288
  var init_agentic_tools = __esm({
5277
5289
  "src/mcp/agentic-tools.ts"() {
5278
5290
  "use strict";
@@ -5432,6 +5444,28 @@ var init_agentic_tools = __esm({
5432
5444
  MCP_CONVERSION_TARGET_FORMATS = Object.freeze(
5433
5445
  conversionTargetSchema.options.map((schema) => schema.shape.format.value)
5434
5446
  );
5447
+ conversionTargetsSchema = z.preprocess((value) => {
5448
+ const normalizeEntry = (entry) => typeof entry === "string" && !entry.trim().startsWith("{") ? { format: entry.trim().toLowerCase().replace(/^\./u, "") } : typeof entry === "string" ? (() => {
5449
+ try {
5450
+ return JSON.parse(entry);
5451
+ } catch {
5452
+ return entry;
5453
+ }
5454
+ })() : entry;
5455
+ if (typeof value === "string") {
5456
+ const text = value.trim();
5457
+ if (text.startsWith("[")) {
5458
+ try {
5459
+ return JSON.parse(text).map(normalizeEntry);
5460
+ } catch {
5461
+ return value;
5462
+ }
5463
+ }
5464
+ return [normalizeEntry(text)];
5465
+ }
5466
+ if (Array.isArray(value)) return value.map(normalizeEntry);
5467
+ return value;
5468
+ }, z.array(conversionTargetSchema).min(1).max(12));
5435
5469
  }
5436
5470
  });
5437
5471
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/docblocks-cli",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Build, preview, convert, render, inspect, and automate documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -47,12 +47,12 @@
47
47
  "typecheck": "tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
- "@bendyline/docblocks": "2.4.0",
51
- "@bendyline/squisq": "2.8.0",
52
- "@bendyline/squisq-cli": "2.6.0",
53
- "@bendyline/squisq-formats": "2.4.5",
54
- "@bendyline/squisq-react": "2.8.0",
55
- "@bendyline/squisq-video": "2.3.0",
50
+ "@bendyline/docblocks": "2.5.0",
51
+ "@bendyline/squisq": "2.9.0",
52
+ "@bendyline/squisq-cli": "2.6.1",
53
+ "@bendyline/squisq-formats": "2.4.6",
54
+ "@bendyline/squisq-react": "2.9.0",
55
+ "@bendyline/squisq-video": "2.3.1",
56
56
  "@modelcontextprotocol/sdk": "1.29.0",
57
57
  "commander": "13.1.0",
58
58
  "jszip": "3.10.1",