@diviops/mcp-server 1.5.29 → 1.5.31
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/README.md +68 -1
- package/dist/compatibility.d.ts +9 -0
- package/dist/compatibility.js +12 -0
- package/dist/cross-env-preflight/bin.d.ts +2 -0
- package/dist/cross-env-preflight/bin.js +8 -0
- package/dist/cross-env-preflight/cli.d.ts +9 -0
- package/dist/cross-env-preflight/cli.js +80 -0
- package/dist/cross-env-preflight/header-preflight.d.ts +151 -0
- package/dist/cross-env-preflight/header-preflight.js +783 -0
- package/dist/cross-env-preflight/source-payload-ref.d.ts +20 -0
- package/dist/cross-env-preflight/source-payload-ref.js +178 -0
- package/dist/index.js +436 -36
- package/dist/preset-cli/cli.d.ts +4 -0
- package/dist/preset-cli/cli.js +55 -0
- package/dist/preset-cli/nav-emitter.d.ts +64 -0
- package/dist/preset-cli/nav-emitter.js +328 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -12,8 +12,10 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
12
12
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import { WPClient } from "./wp-client.js";
|
|
15
|
-
import { MissingCapabilityError } from "./compatibility.js";
|
|
15
|
+
import { MissingCapabilityError, proToolGatesSatisfied } from "./compatibility.js";
|
|
16
16
|
import { ErrorCodes, envelopeMap, recordIdempotent, serializeEnvelope, withCode, wrapResponse, } from "./envelope.js";
|
|
17
|
+
import { preflightCrossEnvHeaderSync, } from "./cross-env-preflight/header-preflight.js";
|
|
18
|
+
import { createSourcePayloadRef, loadSourcePayloadRef, } from "./cross-env-preflight/source-payload-ref.js";
|
|
17
19
|
import { optimizeSchema } from "./schema-optimizer.js";
|
|
18
20
|
import { schemaModuleRoute } from "./schema-route.js";
|
|
19
21
|
import { createWpCli } from "./wp-cli.js";
|
|
@@ -86,6 +88,95 @@ const server = new McpServer({
|
|
|
86
88
|
version: SERVER_VERSION,
|
|
87
89
|
});
|
|
88
90
|
let handshakeState = { kind: "pending" };
|
|
91
|
+
const BASE_META_CAPABILITIES = [
|
|
92
|
+
"pages",
|
|
93
|
+
"modules",
|
|
94
|
+
"presets",
|
|
95
|
+
"library",
|
|
96
|
+
"theme_builder",
|
|
97
|
+
"canvas",
|
|
98
|
+
"variables",
|
|
99
|
+
"templates",
|
|
100
|
+
"icons",
|
|
101
|
+
"validation",
|
|
102
|
+
"preview",
|
|
103
|
+
];
|
|
104
|
+
function enabledCapabilityKeys(prefix) {
|
|
105
|
+
if (handshakeState.kind !== "ok")
|
|
106
|
+
return [];
|
|
107
|
+
const state = handshakeState;
|
|
108
|
+
return Object.keys(state.capabilities)
|
|
109
|
+
.filter((key) => state.capabilities[key])
|
|
110
|
+
.filter((key) => (prefix ? key.startsWith(prefix) : true))
|
|
111
|
+
.sort();
|
|
112
|
+
}
|
|
113
|
+
function buildMetaInfo() {
|
|
114
|
+
const fluentCartCapabilityKeys = enabledCapabilityKeys("fluentcart_");
|
|
115
|
+
const crossEnvCapabilityKeys = enabledCapabilityKeys("cross_env_");
|
|
116
|
+
const fluentCartTarget = handshakeState.kind === "ok"
|
|
117
|
+
? handshakeState.availableTargets.fluentcart ?? null
|
|
118
|
+
: null;
|
|
119
|
+
const crossEnvTarget = handshakeState.kind === "ok"
|
|
120
|
+
? handshakeState.availableTargets.cross_env ?? null
|
|
121
|
+
: null;
|
|
122
|
+
const fluentCartActive = handshakeState.kind === "ok" &&
|
|
123
|
+
handshakeState.proActive === true &&
|
|
124
|
+
fluentCartTarget?.present === true &&
|
|
125
|
+
handshakeState.activeModules.fluentcart === true &&
|
|
126
|
+
fluentCartCapabilityKeys.length > 0;
|
|
127
|
+
const crossEnvActive = handshakeState.kind === "ok" &&
|
|
128
|
+
handshakeState.proActive === true &&
|
|
129
|
+
crossEnvTarget?.present === true &&
|
|
130
|
+
handshakeState.activeModules.cross_env === true &&
|
|
131
|
+
crossEnvCapabilityKeys.length > 0;
|
|
132
|
+
const capabilities = fluentCartActive
|
|
133
|
+
? [...BASE_META_CAPABILITIES, "fluentcart"]
|
|
134
|
+
: [...BASE_META_CAPABILITIES];
|
|
135
|
+
if (crossEnvActive)
|
|
136
|
+
capabilities.push("cross_env");
|
|
137
|
+
return {
|
|
138
|
+
brand: "DiviOps",
|
|
139
|
+
server: "diviops-mcp",
|
|
140
|
+
version: SERVER_VERSION,
|
|
141
|
+
license: "MIT",
|
|
142
|
+
capabilities,
|
|
143
|
+
handshake: handshakeState.kind === "ok"
|
|
144
|
+
? {
|
|
145
|
+
state: "ok",
|
|
146
|
+
plugin_version: handshakeState.pluginVersion,
|
|
147
|
+
capability_count: enabledCapabilityKeys().length,
|
|
148
|
+
}
|
|
149
|
+
: { state: handshakeState.kind },
|
|
150
|
+
pro: handshakeState.kind === "ok"
|
|
151
|
+
? {
|
|
152
|
+
active: handshakeState.proActive,
|
|
153
|
+
version: handshakeState.proVersion ?? null,
|
|
154
|
+
}
|
|
155
|
+
: {
|
|
156
|
+
active: false,
|
|
157
|
+
version: null,
|
|
158
|
+
},
|
|
159
|
+
slices: {
|
|
160
|
+
fluentcart: {
|
|
161
|
+
target: fluentCartTarget,
|
|
162
|
+
active: fluentCartActive,
|
|
163
|
+
module_active: handshakeState.kind === "ok"
|
|
164
|
+
? handshakeState.activeModules.fluentcart === true
|
|
165
|
+
: false,
|
|
166
|
+
tool_capabilities: fluentCartCapabilityKeys,
|
|
167
|
+
},
|
|
168
|
+
cross_env: {
|
|
169
|
+
target: crossEnvTarget,
|
|
170
|
+
active: crossEnvActive,
|
|
171
|
+
module_active: handshakeState.kind === "ok"
|
|
172
|
+
? handshakeState.activeModules.cross_env === true
|
|
173
|
+
: false,
|
|
174
|
+
tool_capabilities: crossEnvCapabilityKeys,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
wp_cli: wpCli ? wpCli.getAllowedCommands() : false,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
89
180
|
function requireCapability(key) {
|
|
90
181
|
// Only gate when we have a real capability map. On handshake failure,
|
|
91
182
|
// bypass the gate so the underlying request surfaces the actual cause
|
|
@@ -177,14 +268,7 @@ function registerLocalTool(name, config, handler) {
|
|
|
177
268
|
function registerProTool(name, config, handler, gates) {
|
|
178
269
|
if (handshakeState.kind !== "ok")
|
|
179
270
|
return;
|
|
180
|
-
if (!handshakeState
|
|
181
|
-
return;
|
|
182
|
-
const target = handshakeState.availableTargets[gates.target];
|
|
183
|
-
if (!target || target.present !== true)
|
|
184
|
-
return;
|
|
185
|
-
if (handshakeState.activeModules[gates.target] !== true)
|
|
186
|
-
return;
|
|
187
|
-
if (!handshakeState.capabilities[gates.capabilityKey])
|
|
271
|
+
if (!proToolGatesSatisfied(handshakeState, gates))
|
|
188
272
|
return;
|
|
189
273
|
recordIdempotent(name, config?._meta);
|
|
190
274
|
server.registerTool(name, config, handler);
|
|
@@ -278,6 +362,61 @@ registerPluginTool("diviops_page_get_layout", {
|
|
|
278
362
|
],
|
|
279
363
|
};
|
|
280
364
|
});
|
|
365
|
+
registerPluginTool("diviops_module_get", {
|
|
366
|
+
description: 'Get one targeted Divi module/block from a page, post, or Theme Builder layout by auto_index (e.g. "text:5"), admin label, or text content. Uses the same selector validation as diviops_module_update: pass exactly one of auto_index, label, or match_text; use occurrence with duplicate labels. Default mode returns identity, block name, admin label, auto_index, text preview, source bounds, and a compact attr summary. Use full: true to include decoded attrs and raw serialized block markup for the matched module only. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing module returns code "not_found" with error.data = { target_kind: "module", target_mode, target_value, page_id }.',
|
|
367
|
+
inputSchema: {
|
|
368
|
+
page_id: z
|
|
369
|
+
.number()
|
|
370
|
+
.int()
|
|
371
|
+
.describe("WordPress post/layout ID whose Divi block content should be searched"),
|
|
372
|
+
label: z
|
|
373
|
+
.string()
|
|
374
|
+
.optional()
|
|
375
|
+
.describe("Admin label of the module (exact match)"),
|
|
376
|
+
match_text: z
|
|
377
|
+
.string()
|
|
378
|
+
.optional()
|
|
379
|
+
.describe("Text to find in module attrs/innerContent (case-insensitive substring, first match)"),
|
|
380
|
+
auto_index: z
|
|
381
|
+
.string()
|
|
382
|
+
.optional()
|
|
383
|
+
.describe('Auto-index target in "type:N" format (e.g. "text:5", "icon:3"). Get from diviops_page_get_layout.'),
|
|
384
|
+
occurrence: z
|
|
385
|
+
.number()
|
|
386
|
+
.int()
|
|
387
|
+
.min(1)
|
|
388
|
+
.optional()
|
|
389
|
+
.default(1)
|
|
390
|
+
.describe("Which occurrence to target when multiple modules share the same label (1-based)"),
|
|
391
|
+
full: z
|
|
392
|
+
.boolean()
|
|
393
|
+
.optional()
|
|
394
|
+
.default(false)
|
|
395
|
+
.describe("Include decoded attrs and raw serialized block markup for the matched module only"),
|
|
396
|
+
},
|
|
397
|
+
annotations: { idempotentHint: true },
|
|
398
|
+
_meta: { idempotent: "true" },
|
|
399
|
+
}, async ({ page_id, label, match_text, auto_index, occurrence, full }) => {
|
|
400
|
+
const params = {};
|
|
401
|
+
if (auto_index)
|
|
402
|
+
params.auto_index = auto_index;
|
|
403
|
+
if (label)
|
|
404
|
+
params.label = label;
|
|
405
|
+
if (match_text)
|
|
406
|
+
params.match_text = match_text;
|
|
407
|
+
if (occurrence > 1)
|
|
408
|
+
params.occurrence = String(occurrence);
|
|
409
|
+
if (full)
|
|
410
|
+
params.full = "true";
|
|
411
|
+
const qs = new URLSearchParams(params).toString();
|
|
412
|
+
const suffix = qs ? `?${qs}` : "";
|
|
413
|
+
const result = await wp.requestEnveloped(`/module/get/${page_id}${suffix}`);
|
|
414
|
+
return {
|
|
415
|
+
content: [
|
|
416
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_module_get") },
|
|
417
|
+
],
|
|
418
|
+
};
|
|
419
|
+
});
|
|
281
420
|
registerPluginTool("diviops_schema_list_modules", {
|
|
282
421
|
description: "List all available Divi modules (block types) with their names, titles, and categories. Use this to discover what modules can be used in layouts. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
|
|
283
422
|
annotations: { idempotentHint: true },
|
|
@@ -1750,6 +1889,111 @@ registerPluginTool("diviops_tb_layout_get", {
|
|
|
1750
1889
|
],
|
|
1751
1890
|
};
|
|
1752
1891
|
});
|
|
1892
|
+
registerPluginTool("diviops_cross_env_target_context_get", {
|
|
1893
|
+
description: "Export read-only, secret-free target-site context for the offline cross-environment Theme Builder header preflight. Produces JSON suitable for `diviops-cross-env-preflight --target`: target origin derived from WordPress, destination header layout metadata, a sha256 checksum of current target layout post_content without exposing raw content, target global colors, built-in customizer color IDs, sha256 value evidence for user/customizer global colors, defensible attachment candidates/remaps from optional source asset hints, and cache_scope. This Free/core tool does not write layouts, upload media, create global colors, or expose cookies, nonces, app passwords, signed URLs, query strings, fragments, or local filesystem paths. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; unsupported destination_kind returns invalid_input, and missing/non-header layouts return not_found.",
|
|
1894
|
+
inputSchema: {
|
|
1895
|
+
destination_id: z
|
|
1896
|
+
.number()
|
|
1897
|
+
.int()
|
|
1898
|
+
.positive()
|
|
1899
|
+
.describe("Existing target Theme Builder header layout post ID."),
|
|
1900
|
+
destination_kind: z
|
|
1901
|
+
.enum(["tb_header_layout"])
|
|
1902
|
+
.optional()
|
|
1903
|
+
.default("tb_header_layout")
|
|
1904
|
+
.describe("Destination kind. Only tb_header_layout is supported in this read-only slice."),
|
|
1905
|
+
source_asset_hints: z
|
|
1906
|
+
.array(z.string())
|
|
1907
|
+
.optional()
|
|
1908
|
+
.describe("Optional source upload paths, asset URLs, or basenames used to search target media candidates. Query strings, fragments, and credentials are stripped from output."),
|
|
1909
|
+
source_attachment_ids: z
|
|
1910
|
+
.array(z.number())
|
|
1911
|
+
.optional()
|
|
1912
|
+
.describe("Optional numeric source attachment IDs found in source markup. A remap is emitted only when exactly one source ID and one exact target candidate are present."),
|
|
1913
|
+
dry_run: z
|
|
1914
|
+
.boolean()
|
|
1915
|
+
.optional()
|
|
1916
|
+
.default(true)
|
|
1917
|
+
.describe("Accepted for workflow symmetry; the tool is always read-only and never mutates state."),
|
|
1918
|
+
},
|
|
1919
|
+
annotations: { idempotentHint: true },
|
|
1920
|
+
_meta: { idempotent: "true" },
|
|
1921
|
+
}, async ({ destination_id, destination_kind, source_asset_hints, source_attachment_ids, }) => {
|
|
1922
|
+
const body = {
|
|
1923
|
+
destination_id,
|
|
1924
|
+
destination_kind: destination_kind ?? "tb_header_layout",
|
|
1925
|
+
};
|
|
1926
|
+
if (source_asset_hints && source_asset_hints.length > 0) {
|
|
1927
|
+
body.source_asset_hints = source_asset_hints;
|
|
1928
|
+
}
|
|
1929
|
+
if (source_attachment_ids && source_attachment_ids.length > 0) {
|
|
1930
|
+
body.source_attachment_ids = source_attachment_ids;
|
|
1931
|
+
}
|
|
1932
|
+
const result = await wp.requestEnveloped("/cross-env/target-context", {
|
|
1933
|
+
method: "POST",
|
|
1934
|
+
body,
|
|
1935
|
+
});
|
|
1936
|
+
return {
|
|
1937
|
+
content: [
|
|
1938
|
+
{
|
|
1939
|
+
type: "text",
|
|
1940
|
+
text: serializeEnvelope(result, "diviops_cross_env_target_context_get"),
|
|
1941
|
+
},
|
|
1942
|
+
],
|
|
1943
|
+
};
|
|
1944
|
+
});
|
|
1945
|
+
registerPluginTool("diviops_cross_env_source_export_get", {
|
|
1946
|
+
description: "Export read-only, secret-free source-site payload for the offline cross-environment Theme Builder header preflight. Produces JSON suitable for `diviops-cross-env-preflight --source`: source origin, `tb_header_layout` metadata, sanitized markup, bare sha256 checksum of that exported markup, export timestamp, DiviOps plugin version, and best-effort attachment inventory from markup media URLs and attachment IDs. The MCP server also writes the exported payload to a bounded local artifact under `.diviops-tmp/cross-env-source-payloads/` and returns `source_payload_ref` so large real headers can be applied later without inlining full markup through the model. This Free/core tool does not write WordPress layouts, upload media, create global colors, reconcile references, expose cookies, nonces, app passwords, signed URLs, query strings, fragments, admin URLs, or arbitrary local filesystem paths. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; unsupported source_kind returns invalid_input, and missing/non-header source layouts return not_found.",
|
|
1947
|
+
inputSchema: {
|
|
1948
|
+
source_id: z
|
|
1949
|
+
.number()
|
|
1950
|
+
.int()
|
|
1951
|
+
.positive()
|
|
1952
|
+
.describe("Existing source Theme Builder header layout post ID."),
|
|
1953
|
+
source_kind: z
|
|
1954
|
+
.enum(["tb_header_layout"])
|
|
1955
|
+
.optional()
|
|
1956
|
+
.default("tb_header_layout")
|
|
1957
|
+
.describe("Source kind. Only tb_header_layout is supported in this read-only slice."),
|
|
1958
|
+
dry_run: z
|
|
1959
|
+
.boolean()
|
|
1960
|
+
.optional()
|
|
1961
|
+
.default(true)
|
|
1962
|
+
.describe("Accepted for workflow symmetry; the tool is always read-only and never mutates state."),
|
|
1963
|
+
},
|
|
1964
|
+
annotations: { idempotentHint: true },
|
|
1965
|
+
_meta: { idempotent: "true" },
|
|
1966
|
+
}, async ({ source_id, source_kind }) => {
|
|
1967
|
+
const withRef = await wrapResponse(async () => {
|
|
1968
|
+
const body = {
|
|
1969
|
+
source_id,
|
|
1970
|
+
source_kind: source_kind ?? "tb_header_layout",
|
|
1971
|
+
};
|
|
1972
|
+
const result = await wp.requestEnveloped("/cross-env/source-export", {
|
|
1973
|
+
method: "POST",
|
|
1974
|
+
body,
|
|
1975
|
+
});
|
|
1976
|
+
return envelopeMap(result, (data) => ({
|
|
1977
|
+
...data,
|
|
1978
|
+
source_payload_ref: createSourcePayloadRef(data),
|
|
1979
|
+
_meta: {
|
|
1980
|
+
...(typeof data._meta === "object" &&
|
|
1981
|
+
data._meta !== null
|
|
1982
|
+
? (data._meta ?? {})
|
|
1983
|
+
: {}),
|
|
1984
|
+
source_payload_ref: "server-local artifact handle for diviops_cross_env_header_apply; stores the same source payload under .diviops-tmp/cross-env-source-payloads and is bounded by handle + checksum + TTL",
|
|
1985
|
+
},
|
|
1986
|
+
}));
|
|
1987
|
+
});
|
|
1988
|
+
return {
|
|
1989
|
+
content: [
|
|
1990
|
+
{
|
|
1991
|
+
type: "text",
|
|
1992
|
+
text: serializeEnvelope(withRef, "diviops_cross_env_source_export_get"),
|
|
1993
|
+
},
|
|
1994
|
+
],
|
|
1995
|
+
};
|
|
1996
|
+
});
|
|
1753
1997
|
registerPluginTool("diviops_tb_layout_update", {
|
|
1754
1998
|
description: "Update a Theme Builder layout's block markup (header, body, or footer). Replaces the full content. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing layout_id returns ok:false with code 'not_found'." +
|
|
1755
1999
|
DRY_RUN_DESC_SUFFIX,
|
|
@@ -2553,30 +2797,11 @@ registerLocalTool("diviops_meta_ping", {
|
|
|
2553
2797
|
};
|
|
2554
2798
|
});
|
|
2555
2799
|
registerLocalTool("diviops_meta_info", {
|
|
2556
|
-
description: "Returns DiviOps MCP server identity, version, license type, and
|
|
2800
|
+
description: "Returns DiviOps MCP server identity, version, license type, available capability groups, WP-CLI allowlist, and plugin handshake/slice state including Pro and FluentCart target readiness. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
|
|
2557
2801
|
annotations: { idempotentHint: true },
|
|
2558
2802
|
_meta: { idempotent: "true" },
|
|
2559
2803
|
}, async () => {
|
|
2560
|
-
const response = await wrapResponse(async () => (
|
|
2561
|
-
brand: "DiviOps",
|
|
2562
|
-
server: "diviops-mcp",
|
|
2563
|
-
version: SERVER_VERSION,
|
|
2564
|
-
license: "MIT",
|
|
2565
|
-
capabilities: [
|
|
2566
|
-
"pages",
|
|
2567
|
-
"modules",
|
|
2568
|
-
"presets",
|
|
2569
|
-
"library",
|
|
2570
|
-
"theme_builder",
|
|
2571
|
-
"canvas",
|
|
2572
|
-
"variables",
|
|
2573
|
-
"templates",
|
|
2574
|
-
"icons",
|
|
2575
|
-
"validation",
|
|
2576
|
-
"preview",
|
|
2577
|
-
],
|
|
2578
|
-
wp_cli: wpCli ? wpCli.getAllowedCommands() : false,
|
|
2579
|
-
}));
|
|
2804
|
+
const response = await wrapResponse(async () => buildMetaInfo());
|
|
2580
2805
|
return {
|
|
2581
2806
|
content: [
|
|
2582
2807
|
{ type: "text", text: serializeEnvelope(response, "diviops_meta_info") },
|
|
@@ -3077,7 +3302,7 @@ registerPluginTool("diviops_variable_used_on_page", {
|
|
|
3077
3302
|
};
|
|
3078
3303
|
});
|
|
3079
3304
|
registerPluginTool("diviops_meta_flush_cache", {
|
|
3080
|
-
description: "Flush Divi's compiled static CSS cache under wp-content/et-cache/. wp cache flush does NOT touch these files — the frontend can keep serving stale CSS after a preset/variable/module mutation until the cache is cleared. Delegates to Divi's native ET_Core_PageResource::remove_static_resources when available (response backend: \"divi_native\"), which additionally clears Theme Builder CSS scattered across other post dirs, archive/taxonomy/home/notfound CSS, the object cache, module features cache, post features cache, Google Fonts cache, dynamic assets cache, and post meta caches. Falls back to a targeted filesystem walk of numeric-named et-cache subdirs when the Divi class is absent (backend: \"fs_fallback\"). Provide exactly one selector — no site-wide default to prevent accidental full flush. Idempotent: missing cache root returns 200 with empty list. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; namespace-specific error codes: meta_flush_cache.unwritable (filesystem refused), meta_flush_cache.fs_init_failed (WP_Filesystem could not authenticate)." +
|
|
3305
|
+
description: "Flush Divi's compiled static CSS cache under wp-content/et-cache/. wp cache flush does NOT touch these files — the frontend can keep serving stale CSS after a preset/variable/module mutation until the cache is cleared. Delegates to Divi's native ET_Core_PageResource::remove_static_resources when available (response backend: \"divi_native\"), which additionally clears Theme Builder CSS scattered across other post dirs, archive/taxonomy/home/notfound CSS, the object cache, module features cache, post features cache, Google Fonts cache, dynamic assets cache, and post meta caches. Falls back to a targeted filesystem walk of numeric-named et-cache subdirs when the Divi class is absent (backend: \"fs_fallback\"). Provide exactly one selector — no site-wide default to prevent accidental full flush. Optional cleanup_dynamic_assets=true explicitly deletes and reports _divi_dynamic_assets_cached_feature_used postmeta for the selected target IDs; cleanup_canvas_refs=true also deletes _divi_dynamic_assets_canvases_used and is only appropriate when canvas/off-canvas references are affected. Dynamic-assets postmeta cleanup is supported with post_id or all (bounded to posts that already carry the selected meta keys), not after. Idempotent: missing cache root returns 200 with empty list and repeat postmeta cleanup reports absent keys. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; namespace-specific error codes: meta_flush_cache.unwritable (filesystem refused), meta_flush_cache.fs_init_failed (WP_Filesystem could not authenticate)." +
|
|
3081
3306
|
DRY_RUN_DESC_SUFFIX +
|
|
3082
3307
|
" Note: in `after` mode the dry-run plan reports the cutoff only — accurate file count requires the live mtime walk.",
|
|
3083
3308
|
inputSchema: {
|
|
@@ -3099,10 +3324,20 @@ registerPluginTool("diviops_meta_flush_cache", {
|
|
|
3099
3324
|
.optional()
|
|
3100
3325
|
.describe("Unix timestamp — flush Divi CSS files (et-*.css) with mtime strictly greater than this value. Useful for flushing entries touched since a known deployment or mutation batch. Native backend does a single-pass filesystem sweep covering numeric post dirs AND archive/taxonomy/home/notfound/global subtrees in one walk (Visual Builder -vb-* runtime CSS preserved); fs_fallback iterates numeric post dirs whose latest file mtime > after. `flushed` lists numeric post_ids whose files were actually deleted; `skipped` lists numeric post_ids that exist but had no files pass the filter."),
|
|
3101
3326
|
dry_run: DRY_RUN_FIELD,
|
|
3327
|
+
cleanup_dynamic_assets: z
|
|
3328
|
+
.boolean()
|
|
3329
|
+
.optional()
|
|
3330
|
+
.default(false)
|
|
3331
|
+
.describe("Explicitly delete and report Divi's _divi_dynamic_assets_cached_feature_used postmeta for the selected post_id, or for all posts that already carry selected dynamic-assets postmeta when all=true. Supported with post_id or all only."),
|
|
3332
|
+
cleanup_canvas_refs: z
|
|
3333
|
+
.boolean()
|
|
3334
|
+
.optional()
|
|
3335
|
+
.default(false)
|
|
3336
|
+
.describe("Opt-in canvas/off-canvas cleanup. Requires cleanup_dynamic_assets=true and also deletes _divi_dynamic_assets_canvases_used. Use only when canvas/off-canvas references are affected."),
|
|
3102
3337
|
},
|
|
3103
3338
|
annotations: { idempotentHint: true },
|
|
3104
3339
|
_meta: { idempotent: "true" },
|
|
3105
|
-
}, async ({ post_id, all, after, dry_run }) => {
|
|
3340
|
+
}, async ({ post_id, all, after, dry_run, cleanup_dynamic_assets, cleanup_canvas_refs }) => {
|
|
3106
3341
|
const body = {};
|
|
3107
3342
|
if (post_id !== undefined)
|
|
3108
3343
|
body.post_id = post_id;
|
|
@@ -3112,6 +3347,10 @@ registerPluginTool("diviops_meta_flush_cache", {
|
|
|
3112
3347
|
body.after = after;
|
|
3113
3348
|
if (dry_run)
|
|
3114
3349
|
body.dry_run = true;
|
|
3350
|
+
if (cleanup_dynamic_assets)
|
|
3351
|
+
body.cleanup_dynamic_assets = true;
|
|
3352
|
+
if (cleanup_canvas_refs)
|
|
3353
|
+
body.cleanup_canvas_refs = true;
|
|
3115
3354
|
const result = await wp.requestEnveloped("/meta/flush-cache", {
|
|
3116
3355
|
method: "POST",
|
|
3117
3356
|
body,
|
|
@@ -3132,7 +3371,166 @@ registerPluginTool("diviops_meta_flush_cache", {
|
|
|
3132
3371
|
//
|
|
3133
3372
|
// Run inside `registerProTools()` rather than at module load because the
|
|
3134
3373
|
// gates read handshakeState which is `pending` until `main()` runs.
|
|
3374
|
+
const CrossEnvSourceAttachmentSchema = z
|
|
3375
|
+
.object({
|
|
3376
|
+
id: z.number().int().positive().optional(),
|
|
3377
|
+
url: z.string().optional(),
|
|
3378
|
+
path: z.string().optional(),
|
|
3379
|
+
filename: z.string().optional(),
|
|
3380
|
+
mime: z.string().optional(),
|
|
3381
|
+
})
|
|
3382
|
+
.passthrough();
|
|
3383
|
+
const CrossEnvSourcePayloadSchema = z
|
|
3384
|
+
.object({
|
|
3385
|
+
origin: z.string().describe("Source site origin, e.g. https://source.example."),
|
|
3386
|
+
object_kind: z
|
|
3387
|
+
.enum(["tb_header_layout"])
|
|
3388
|
+
.describe("Source object kind. MVP supports tb_header_layout only."),
|
|
3389
|
+
object_id: z.union([z.number(), z.string()]).optional(),
|
|
3390
|
+
object_title: z.string().optional(),
|
|
3391
|
+
markup: z.string().describe("Sanitized source header layout block markup."),
|
|
3392
|
+
checksum: z
|
|
3393
|
+
.string()
|
|
3394
|
+
.regex(/^(sha256:)?[a-fA-F0-9]{64}$/)
|
|
3395
|
+
.describe("sha256 checksum of source_payload.markup from source export."),
|
|
3396
|
+
attachments: z.array(CrossEnvSourceAttachmentSchema).optional(),
|
|
3397
|
+
})
|
|
3398
|
+
.passthrough();
|
|
3399
|
+
const CrossEnvSourcePayloadRefSchema = z
|
|
3400
|
+
.object({
|
|
3401
|
+
handle: z
|
|
3402
|
+
.string()
|
|
3403
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)
|
|
3404
|
+
.describe("Server-created source payload artifact handle returned by diviops_cross_env_source_export_get."),
|
|
3405
|
+
checksum: z
|
|
3406
|
+
.string()
|
|
3407
|
+
.regex(/^(sha256:)?[a-fA-F0-9]{64}$/)
|
|
3408
|
+
.describe("sha256 checksum of the referenced source payload markup."),
|
|
3409
|
+
algorithm: z.literal("sha256").optional(),
|
|
3410
|
+
storage: z.literal("server_local_artifact").optional(),
|
|
3411
|
+
expires_at: z.string().optional(),
|
|
3412
|
+
})
|
|
3413
|
+
.passthrough();
|
|
3414
|
+
function normalizeReviewedFingerprint(value) {
|
|
3415
|
+
return value.trim().replace(/^sha256:/i, "").toLowerCase();
|
|
3416
|
+
}
|
|
3417
|
+
function sourceHintsFromPayload(source) {
|
|
3418
|
+
const hints = new Set();
|
|
3419
|
+
const ids = new Set();
|
|
3420
|
+
for (const attachment of source.attachments ?? []) {
|
|
3421
|
+
if (typeof attachment.id === "number" && Number.isInteger(attachment.id) && attachment.id > 0) {
|
|
3422
|
+
ids.add(attachment.id);
|
|
3423
|
+
}
|
|
3424
|
+
for (const value of [attachment.path, attachment.url, attachment.filename]) {
|
|
3425
|
+
if (typeof value === "string" && value.trim())
|
|
3426
|
+
hints.add(value.trim());
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
return {
|
|
3430
|
+
...(hints.size > 0 ? { source_asset_hints: [...hints].sort((a, b) => a.localeCompare(b)) } : {}),
|
|
3431
|
+
...(ids.size > 0 ? { source_attachment_ids: [...ids].sort((a, b) => a - b) } : {}),
|
|
3432
|
+
};
|
|
3433
|
+
}
|
|
3135
3434
|
function registerProTools() {
|
|
3435
|
+
// diviops_cross_env_header_apply — guarded Pro apply for reviewed header preflight
|
|
3436
|
+
registerProTool("diviops_cross_env_header_apply", {
|
|
3437
|
+
description: "Apply a reviewed cross-environment Theme Builder header payload into an existing target header layout (Pro tier; requires the cross_env Pro module). This first MVP is intentionally narrow: it requires `confirm_apply: true`, either an inline source export payload or a bounded `source_payload_ref` returned by diviops_cross_env_source_export_get, an existing target `destination_id`, and the reviewed `confirmation_binding.fingerprint` from `diviops-cross-env-preflight`. Large real headers should use `source_payload_ref`; inline `source_payload` remains supported for small/disposable tests. The server loads referenced payload bytes from its own `.diviops-tmp/cross-env-source-payloads/` artifact store, verifies checksum, re-exports current target context, reruns the TypeScript preflight engine, refuses fingerprint mismatch, unsafe verdicts, destination checksum drift, missing/ambiguous attachment remaps, missing global-color value evidence, and off-canvas/canvas references, then calls the Pro route with the verified plan. The Pro route re-loads the destination post, verifies the current checksum again, builds content only from source-origin upload URL rewrites and proven attachment-ID remaps, writes with readback/rollback evidence, and runs Divi static-resource cleanup plus explicit _divi_dynamic_assets_cached_feature_used cleanup. No media upload/import, global-color creation/import, new layout creation, off-canvas reconcile, public/store/license change, or live-site smoke is performed by this tool. Returns the standardized envelope { ok, data?, error: { code, message, hint?, data? } }. Error codes include cross_env.confirmation_required, cross_env.source_payload_ref_invalid, cross_env.fingerprint_mismatch, cross_env.preflight_not_safe, cross_env.destination_checksum_drift, cross_env.source_checksum_mismatch, cross_env.content_write_corruption, invalid_input, not_found, forbidden, and wp_error.",
|
|
3438
|
+
inputSchema: {
|
|
3439
|
+
source_payload: CrossEnvSourcePayloadSchema.optional().describe("The `data` object returned by diviops_cross_env_source_export_get on the source site. Use source_payload_ref instead for large real headers."),
|
|
3440
|
+
source_payload_ref: CrossEnvSourcePayloadRefSchema.optional().describe("Bounded server-local artifact reference returned as data.source_payload_ref by diviops_cross_env_source_export_get. Preferred for large real headers because it avoids inlining full markup through the model."),
|
|
3441
|
+
destination_id: z
|
|
3442
|
+
.number()
|
|
3443
|
+
.int()
|
|
3444
|
+
.positive()
|
|
3445
|
+
.describe("Existing target Theme Builder header layout post ID."),
|
|
3446
|
+
destination_kind: z
|
|
3447
|
+
.enum(["tb_header_layout"])
|
|
3448
|
+
.optional()
|
|
3449
|
+
.default("tb_header_layout")
|
|
3450
|
+
.describe("Destination kind. MVP supports tb_header_layout only."),
|
|
3451
|
+
reviewed_fingerprint: z
|
|
3452
|
+
.string()
|
|
3453
|
+
.regex(/^(sha256:)?[a-fA-F0-9]{64}$/)
|
|
3454
|
+
.describe("Reviewed confirmation_binding.fingerprint from the safe preflight report."),
|
|
3455
|
+
confirm_apply: z
|
|
3456
|
+
.boolean()
|
|
3457
|
+
.describe("Must be true. Missing/false refuses before any target mutation."),
|
|
3458
|
+
},
|
|
3459
|
+
annotations: { idempotentHint: false },
|
|
3460
|
+
_meta: { idempotent: "conditional" },
|
|
3461
|
+
}, async ({ source_payload, source_payload_ref, destination_id, destination_kind, reviewed_fingerprint, confirm_apply, }) => {
|
|
3462
|
+
const result = await wrapResponse(async () => {
|
|
3463
|
+
if (confirm_apply !== true) {
|
|
3464
|
+
withCode("cross_env.confirmation_required", "confirm_apply: true is required before a cross-env header apply can mutate content.", "Review the preflight report, then retry with confirm_apply: true.");
|
|
3465
|
+
}
|
|
3466
|
+
if (source_payload && source_payload_ref) {
|
|
3467
|
+
withCode("invalid_input", "Provide either source_payload or source_payload_ref, not both.", "Use source_payload_ref for large real headers and inline source_payload only for small/disposable tests.", { fields: ["source_payload", "source_payload_ref"] });
|
|
3468
|
+
}
|
|
3469
|
+
if (!source_payload && !source_payload_ref) {
|
|
3470
|
+
withCode("invalid_input", "Either source_payload or source_payload_ref is required.", "Run diviops_cross_env_source_export_get and pass its data.source_payload_ref for large real headers.", { fields: ["source_payload", "source_payload_ref"] });
|
|
3471
|
+
}
|
|
3472
|
+
let resolvedSourcePayload;
|
|
3473
|
+
if (source_payload) {
|
|
3474
|
+
resolvedSourcePayload = source_payload;
|
|
3475
|
+
}
|
|
3476
|
+
else {
|
|
3477
|
+
try {
|
|
3478
|
+
resolvedSourcePayload = loadSourcePayloadRef(source_payload_ref);
|
|
3479
|
+
}
|
|
3480
|
+
catch (err) {
|
|
3481
|
+
withCode("cross_env.source_payload_ref_invalid", err instanceof Error ? err.message : String(err), "Re-run diviops_cross_env_source_export_get and pass the fresh data.source_payload_ref.", { source_payload_ref });
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
const targetBody = {
|
|
3485
|
+
destination_id,
|
|
3486
|
+
destination_kind: destination_kind ?? "tb_header_layout",
|
|
3487
|
+
...sourceHintsFromPayload(resolvedSourcePayload),
|
|
3488
|
+
};
|
|
3489
|
+
const targetEnvelope = await wp.requestEnveloped("/cross-env/target-context", { method: "POST", body: targetBody });
|
|
3490
|
+
if (!targetEnvelope.ok)
|
|
3491
|
+
return targetEnvelope;
|
|
3492
|
+
const report = preflightCrossEnvHeaderSync({
|
|
3493
|
+
source: resolvedSourcePayload,
|
|
3494
|
+
target: targetEnvelope.data,
|
|
3495
|
+
});
|
|
3496
|
+
const reviewed = normalizeReviewedFingerprint(reviewed_fingerprint);
|
|
3497
|
+
if (report.confirmation_binding.fingerprint !== reviewed) {
|
|
3498
|
+
withCode("cross_env.fingerprint_mismatch", "Reviewed confirmation fingerprint does not match the recomputed current preflight report.", "Re-run diviops-cross-env-preflight against the latest target context and confirm the new fingerprint.", {
|
|
3499
|
+
reviewed_fingerprint: reviewed,
|
|
3500
|
+
recomputed_fingerprint: report.confirmation_binding.fingerprint,
|
|
3501
|
+
current_destination_checksum: report.target.destination_checksum ?? null,
|
|
3502
|
+
});
|
|
3503
|
+
}
|
|
3504
|
+
if (report.verdict !== "safe_dry_run") {
|
|
3505
|
+
withCode("cross_env.preflight_not_safe", "Recomputed preflight verdict is not safe for this MVP apply path.", "Resolve blockers/operator actions, then re-run and re-confirm preflight.", {
|
|
3506
|
+
verdict: report.verdict,
|
|
3507
|
+
blockers: report.blockers,
|
|
3508
|
+
operator_actions: report.operator_actions,
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
return wp.requestEnveloped("/pro/cross-env/header-layout/apply", {
|
|
3512
|
+
method: "POST",
|
|
3513
|
+
body: {
|
|
3514
|
+
confirm_apply: true,
|
|
3515
|
+
destination_id,
|
|
3516
|
+
destination_kind: destination_kind ?? "tb_header_layout",
|
|
3517
|
+
source_payload: resolvedSourcePayload,
|
|
3518
|
+
source_checksum: resolvedSourcePayload.checksum,
|
|
3519
|
+
destination_checksum: report.target.destination_checksum,
|
|
3520
|
+
reviewed_fingerprint: reviewed,
|
|
3521
|
+
preflight_report: report,
|
|
3522
|
+
},
|
|
3523
|
+
});
|
|
3524
|
+
});
|
|
3525
|
+
return {
|
|
3526
|
+
content: [
|
|
3527
|
+
{
|
|
3528
|
+
type: "text",
|
|
3529
|
+
text: serializeEnvelope(result, "diviops_cross_env_header_apply"),
|
|
3530
|
+
},
|
|
3531
|
+
],
|
|
3532
|
+
};
|
|
3533
|
+
}, { target: "cross_env", capabilityKey: "cross_env_header_apply" });
|
|
3136
3534
|
// diviops_fc_product_list — bridges /diviops/v1/pro/fluentcart/products
|
|
3137
3535
|
registerProTool("diviops_fc_product_list", {
|
|
3138
3536
|
description: "List FluentCart Pro products (Pro tier; requires FluentCart Pro installed + activated). Returns a paginated summary list with product identity (id, title, slug, status), variation_type, variants_count, and min/max price. Filterable by `search` (LIKE post_title), `type` (one of physical/digital/subscription/onetime/simple/variations), and `status` (one of publish/draft/pending/private/trash; default returns publish+draft+pending+private). Read-only. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; the success payload is { products: ProductSummary[], pagination: { page, per_page, total, total_pages }, filters: { search, type, status } }. Error codes: invalid_input (HTTP 400) when type/status filter is out of range; fluentcart.module_inactive (HTTP 412) when FluentCart is uninstalled or the diviops-agent-pro module toggle is off; fluentcart.query_failed (HTTP 500) when the underlying FluentCart model query raises an exception (message field carries the upstream exception). Use this before authoring a Divi commerce page to identify which product IDs / types to render.",
|
|
@@ -3669,9 +4067,10 @@ function registerProTools() {
|
|
|
3669
4067
|
//
|
|
3670
4068
|
// Store-deployment helper surface. This intentionally complements
|
|
3671
4069
|
// FluentCart's native MCP by focusing on DiviOps-specific launch
|
|
3672
|
-
// readiness: metadata-only download rows,
|
|
3673
|
-
// server-side ZIP,
|
|
3674
|
-
//
|
|
4070
|
+
// readiness: metadata-only download rows, validating an already-present
|
|
4071
|
+
// server-side ZIP, copying it into FluentCart-managed download storage,
|
|
4072
|
+
// and the FCP Pro updater changelog field. No MCP-client binary upload and
|
|
4073
|
+
// no signed buyer URLs.
|
|
3675
4074
|
// diviops_fc_download_list — POST /diviops/v1/pro/fluentcart/products/{id}/downloads
|
|
3676
4075
|
registerProTool("diviops_fc_download_list", {
|
|
3677
4076
|
description: "List FluentCart downloadable-file rows for a product (Pro tier; V3.4; requires FluentCart Pro installed + activated). Read-only metadata surface for store artifact deployment. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { product_id, downloads: DownloadRow[] }. DownloadRow is { id, title, file_name, driver, file_size, type, variation_ids, is_update_file } — metadata only, never file_path, file_url, download_identifier, signed URLs, or buyer URLs. `is_update_file` is derived from the product's license_settings.global_update_file pointer when present. Use this before `diviops_fc_license_settings_update` so the updater pointer can be set to the plugin ZIP row, not the suite ZIP row. Error codes: invalid_input (400), not_found (404), fluentcart.module_inactive (412), fluentcart.query_failed (500). Idempotency: read-only.",
|
|
@@ -3697,7 +4096,7 @@ function registerProTools() {
|
|
|
3697
4096
|
}, { target: "fluentcart", capabilityKey: "fluentcart_download_list" });
|
|
3698
4097
|
// diviops_fc_download_attach — POST /diviops/v1/pro/fluentcart/products/{id}/downloads/attach
|
|
3699
4098
|
registerProTool("diviops_fc_download_attach", {
|
|
3700
|
-
description: "Attach an already-present server-side ZIP as a FluentCart downloadable-file row (Pro tier; V3.4; requires FluentCart Pro installed + activated). This is NOT a binary upload tool: `file_path` must resolve to a readable .zip on the WordPress server under ABSPATH or the uploads directory. The response never exposes file paths, file URLs, download identifiers, signed URLs, or buyer URLs. Required: product_id, file_path. Optional: file_name (defaults to basename(file_path), must end in .zip), title (defaults to filename without .zip), variation_ids (must belong to this product; empty means all variants), expected_sha1, expected_size, allow_duplicate (default false), dry_run. Duplicate detection rejects an existing row with the same file_name or title unless allow_duplicate:true is passed. Expected hash/size let operators verify the server-side file matches the locally built artifact before creating the row. Apply-mode success payload is { product_id, created: DownloadRow, downloads: DownloadRow[] } with DownloadRow metadata only. This tool only creates the download row and enables manage_downloadable; it does NOT set license_settings.global_update_file — follow with diviops_fc_license_settings_update using the created row ID. Error codes: invalid_input (400), not_found (404), fluentcart.download_duplicate (409), fluentcart.module_inactive (412), fluentcart.command_failed (500). Idempotency: false; repeat calls are rejected by duplicate detection unless allow_duplicate:true." +
|
|
4099
|
+
description: "Attach an already-present server-side ZIP as a FluentCart downloadable-file row (Pro tier; V3.4; requires FluentCart Pro installed + activated). This is NOT a binary upload tool: `file_path` must resolve to a readable .zip on the WordPress server under ABSPATH or the uploads directory. Apply mode copies the validated file into FluentCart's managed `wp-content/uploads/fluent-cart/*__fluent-cart__*.zip` storage before creating the row, because FluentCart's signed package endpoint serves that managed filename shape. The response never exposes file paths, file URLs, download identifiers, signed URLs, or buyer URLs. Required: product_id, file_path. Optional: file_name (defaults to basename(file_path), must end in .zip), title (defaults to filename without .zip), variation_ids (must belong to this product; empty means all variants), expected_sha1, expected_size, allow_duplicate (default false), dry_run. Duplicate detection rejects an existing row with the same file_name or title unless allow_duplicate:true is passed. Expected hash/size let operators verify the server-side file matches the locally built artifact before creating the row. Apply-mode success payload is { product_id, created: DownloadRow, downloads: DownloadRow[] } with DownloadRow metadata only. This tool only creates the download row and enables manage_downloadable; it does NOT set license_settings.global_update_file — follow with diviops_fc_license_settings_update using the created row ID. Error codes: invalid_input (400), not_found (404), fluentcart.download_duplicate (409), fluentcart.module_inactive (412), fluentcart.command_failed (500). Idempotency: false; repeat calls are rejected by duplicate detection unless allow_duplicate:true." +
|
|
3701
4100
|
DRY_RUN_DESC_SUFFIX,
|
|
3702
4101
|
inputSchema: {
|
|
3703
4102
|
product_id: z
|
|
@@ -4246,6 +4645,7 @@ async function main() {
|
|
|
4246
4645
|
kind: "ok",
|
|
4247
4646
|
capabilities: hs.capabilities,
|
|
4248
4647
|
pluginVersion: hs.plugin_version,
|
|
4648
|
+
proVersion: hs.pro_version,
|
|
4249
4649
|
proActive: hs.pro_active === true,
|
|
4250
4650
|
availableTargets: hs.available_targets ?? {},
|
|
4251
4651
|
activeModules: hs.active_modules ?? {},
|
package/dist/preset-cli/cli.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Usage:
|
|
10
10
|
* diviops-preset button [options] Emit a divi/button group preset
|
|
11
|
+
* diviops-preset nav [options] Emit a Divi nav drawer block skeleton
|
|
11
12
|
* diviops-preset --help Show help
|
|
12
13
|
*
|
|
13
14
|
* Modes:
|
|
@@ -27,6 +28,7 @@ import { type ButtonEmitterInput } from "./button-emitter.js";
|
|
|
27
28
|
import { type HeadingFontEmitterInput } from "./heading-font-emitter.js";
|
|
28
29
|
import { type TextBodyFontEmitterInput } from "./text-body-font-emitter.js";
|
|
29
30
|
import { type SpacingEmitterInput } from "./spacing-emitter.js";
|
|
31
|
+
import { type NavEmitterInput } from "./nav-emitter.js";
|
|
30
32
|
export declare const EXIT: {
|
|
31
33
|
readonly OK: 0;
|
|
32
34
|
readonly INVALID_INPUT: 1;
|
|
@@ -60,6 +62,8 @@ export declare function buildHeadingFontInput(parsed: ParsedArgs): HeadingFontEm
|
|
|
60
62
|
export declare function buildTextBodyFontInput(parsed: ParsedArgs): TextBodyFontEmitterInput;
|
|
61
63
|
/** Map parsed `spacing` options into the spacing emitter input shape. */
|
|
62
64
|
export declare function buildSpacingInput(parsed: ParsedArgs): SpacingEmitterInput;
|
|
65
|
+
/** Map parsed `nav` options into the nav block-markup emitter input shape. */
|
|
66
|
+
export declare function buildNavInput(parsed: ParsedArgs): NavEmitterInput;
|
|
63
67
|
/**
|
|
64
68
|
* Run the CLI. Returns the structured exit code (does NOT call
|
|
65
69
|
* `process.exit` — the thin bin wrapper does). `io` is injectable so
|