@plitzi/sdk-mcp 0.39.3 → 0.39.6

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 (106) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +39 -39
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +2 -1
  5. package/dist/modules/mcp/answerBudgets.d.ts +29 -0
  6. package/dist/modules/mcp/answerBudgets.js +37 -0
  7. package/dist/modules/mcp/apps/example/view/index.tsx +0 -1
  8. package/dist/modules/mcp/apps/render/view/index.tsx +0 -1
  9. package/dist/modules/mcp/catalogs/pluginCatalog.d.ts +8 -0
  10. package/dist/modules/mcp/catalogs/pluginCatalog.js +35 -1
  11. package/dist/modules/mcp/helpers/guide/reference.d.ts +1 -1
  12. package/dist/modules/mcp/helpers/guide/reference.js +16 -2
  13. package/dist/modules/mcp/helpers/guide/structure.d.ts +1 -1
  14. package/dist/modules/mcp/helpers/guide/structure.js +1 -0
  15. package/dist/modules/mcp/helpers/opResult.d.ts +3 -1
  16. package/dist/modules/mcp/helpers/opResult.js +3 -1
  17. package/dist/modules/mcp/localScreenshotClient.d.ts +10 -0
  18. package/dist/modules/mcp/localScreenshotClient.js +46 -16
  19. package/dist/modules/mcp/previewClient.js +2 -2
  20. package/dist/modules/mcp/resources/canonical.js +2 -2
  21. package/dist/modules/mcp/server.d.ts +1 -1
  22. package/dist/modules/mcp/server.js +10 -3
  23. package/dist/modules/mcp/tools/activity.js +2 -2
  24. package/dist/modules/mcp/tools/apply/dispatch.js +7 -1
  25. package/dist/modules/mcp/tools/apply/index.d.ts +25 -1
  26. package/dist/modules/mcp/tools/apply/index.js +21 -5
  27. package/dist/modules/mcp/tools/describeOperation.js +1 -1
  28. package/dist/modules/mcp/tools/index.js +5 -1
  29. package/dist/modules/mcp/tools/intents.js +26 -4
  30. package/dist/modules/mcp/tools/look.d.ts +1 -0
  31. package/dist/modules/mcp/tools/look.js +2 -1
  32. package/dist/modules/mcp/tools/operations/actions/deleteAction.js +1 -1
  33. package/dist/modules/mcp/tools/operations/actions/patchAction.js +3 -3
  34. package/dist/modules/mcp/tools/operations/actions/upsertAction.js +1 -1
  35. package/dist/modules/mcp/tools/operations/connectors/deleteConnector.js +1 -1
  36. package/dist/modules/mcp/tools/operations/connectors/patchConnector.js +2 -2
  37. package/dist/modules/mcp/tools/operations/data/index.js +3 -3
  38. package/dist/modules/mcp/tools/operations/functions/index.js +2 -2
  39. package/dist/modules/mcp/tools/operations/index.d.ts +97 -4
  40. package/dist/modules/mcp/tools/operations/index.js +1 -0
  41. package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +1 -1
  42. package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +1 -1
  43. package/dist/modules/mcp/tools/operations/schema/components/deleteComponent.js +2 -2
  44. package/dist/modules/mcp/tools/operations/schema/components/upsertComponent.js +8 -8
  45. package/dist/modules/mcp/tools/operations/schema/elements/addSpec.d.ts +29 -0
  46. package/dist/modules/mcp/tools/operations/schema/elements/addSpec.js +118 -0
  47. package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +2 -2
  48. package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +4 -4
  49. package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +2 -2
  50. package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.js +2 -0
  51. package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +3 -3
  52. package/dist/modules/mcp/tools/operations/schema/flags/deleteFlag.js +1 -1
  53. package/dist/modules/mcp/tools/operations/schema/flags/upsertFlag.js +2 -2
  54. package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +1 -1
  55. package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +1 -1
  56. package/dist/modules/mcp/tools/operations/schema/index.d.ts +1 -0
  57. package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +4 -4
  58. package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +1 -1
  59. package/dist/modules/mcp/tools/operations/schema/operations.d.ts +25 -1
  60. package/dist/modules/mcp/tools/operations/schema/operations.js +2 -0
  61. package/dist/modules/mcp/tools/operations/schema/pages/deleteLayout.js +2 -2
  62. package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +1 -1
  63. package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +4 -0
  64. package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +14 -7
  65. package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +8 -1
  66. package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +9 -6
  67. package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +3 -2
  68. package/dist/modules/mcp/tools/operations/schema/write.js +3 -3
  69. package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +2 -1
  70. package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +1 -1
  71. package/dist/modules/mcp/tools/operations/style/fonts/deleteFont.js +2 -2
  72. package/dist/modules/mcp/tools/operations/style/fonts/upsertFont.js +1 -1
  73. package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +2 -1
  74. package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +1 -1
  75. package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +2 -1
  76. package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +1 -1
  77. package/dist/modules/mcp/tools/operations/style/validate.js +6 -6
  78. package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +3 -2
  79. package/dist/modules/mcp/tools/operations/style/write.js +1 -1
  80. package/dist/modules/mcp/tools/releases.d.ts +3 -0
  81. package/dist/modules/mcp/tools/releases.js +60 -0
  82. package/dist/modules/mcp/tools/render.d.ts +24 -1
  83. package/dist/modules/mcp/tools/renderWidget.d.ts +24 -1
  84. package/dist/modules/mcp/tools/search.js +1 -1
  85. package/dist/modules/mcp/tools/shared/agentHtml.d.ts +8 -0
  86. package/dist/modules/mcp/tools/shared/agentHtml.js +18 -0
  87. package/dist/modules/mcp/tools/shared/lintDraft.js +1 -0
  88. package/dist/modules/mcp/tools/shared/look.d.ts +2 -0
  89. package/dist/modules/mcp/tools/shared/look.js +15 -8
  90. package/dist/modules/mcp/tools/shared/repeats.d.ts +1 -1
  91. package/dist/modules/mcp/tools/shared/repeats.js +1 -1
  92. package/dist/modules/mcp/tools/shared/tool.d.ts +21 -1
  93. package/dist/modules/mcp/tools/shared/validator/connectors.js +3 -0
  94. package/dist/modules/mcp/tools/shared/validator/css.js +2 -0
  95. package/dist/modules/mcp/tools/shared/validator/elements.js +3 -0
  96. package/dist/modules/mcp/tools/shared/validator/index.js +39 -0
  97. package/dist/modules/mcp/tools/shared/validator/interactions.js +1 -0
  98. package/dist/modules/mcp/tools/shared/validator/refs.js +3 -0
  99. package/dist/modules/mcp/tools/tryFunction.js +2 -2
  100. package/dist/modules/mcp/types/aiSchema.d.ts +3 -0
  101. package/dist/modules/mcp/types/previewTypes.d.ts +9 -1
  102. package/dist/options.d.ts +1 -1
  103. package/dist/preview/createPreview.js +38 -7
  104. package/dist/server.d.ts +1 -1
  105. package/dist/server.js +2 -2
  106. package/package.json +10 -10
@@ -19,15 +19,15 @@ var removeFlow = (interactions, flowId) => {
19
19
  return deleted;
20
20
  };
21
21
  var deleteInteraction = (space, env, op) => {
22
- if (Boolean(op.flowId) === Boolean(op.nodeId)) return fail("nodeId", "Provide exactly one of flowId or nodeId", "flowId removes a whole flow; nodeId removes a step");
22
+ if (Boolean(op.flowId) === Boolean(op.nodeId)) return fail("wrong-options", "nodeId", "Provide exactly one of flowId or nodeId", "flowId removes a whole flow; nodeId removes a step");
23
23
  const found = resolveElement(space, env, op.pageRef, op.ref);
24
24
  if ("error" in found) return found.error;
25
25
  const interactions = found.el.definition.interactions;
26
- if (!interactions) return fail("ref", `Element "${op.ref}" has no interactions`, "Nothing to delete");
26
+ if (!interactions) return fail("missing", "ref", `Element "${op.ref}" has no interactions`, "Check the ref: read the element to see the flows it holds");
27
27
  let deleted = 0;
28
28
  if (op.flowId) deleted = removeFlow(interactions, op.flowId);
29
29
  else if (op.nodeId) {
30
- if (!(op.nodeId in interactions)) return fail("nodeId", `Interaction node "${op.nodeId}" not found on "${op.ref}"`, "Read the element to list nodes");
30
+ if (!(op.nodeId in interactions)) return fail("missing", "nodeId", `Interaction node "${op.nodeId}" not found on "${op.ref}"`, "Read the element to list nodes");
31
31
  const node = interactions[op.nodeId];
32
32
  if (node.type === "trigger") deleted = removeFlow(interactions, node.flowId || node.id);
33
33
  else {
@@ -39,7 +39,7 @@ var deleteInteraction = (space, env, op) => {
39
39
  deleted = 1;
40
40
  }
41
41
  }
42
- if (deleted === 0) return fail("flowId", `No interaction matching "${op.flowId ?? op.nodeId}" on "${op.ref}"`, "Nothing to delete");
42
+ if (deleted === 0) return fail("missing", "flowId", `No interaction matching "${op.flowId ?? op.nodeId}" on "${op.ref}"`, "Read the element to list its flows and their nodes, and name one of them");
43
43
  if (Object.keys(interactions).length === 0) Reflect.deleteProperty(found.el.definition, "interactions");
44
44
  return {
45
45
  ...empty(),
@@ -24,7 +24,7 @@ var patchInteractionNode = (space, env, op) => {
24
24
  const found = resolveElement(space, env, op.pageRef, op.ref);
25
25
  if ("error" in found) return found.error;
26
26
  const node = found.el.definition.interactions?.[op.nodeId];
27
- if (!node) return fail("nodeId", `Interaction node "${op.nodeId}" not found on "${op.ref}"`, "Read the element to list nodes");
27
+ if (!node) return fail("missing", "nodeId", `Interaction node "${op.nodeId}" not found on "${op.ref}"`, "Read the element to list nodes");
28
28
  if (op.title !== void 0) node.title = op.title;
29
29
  if (op.action !== void 0) node.action = op.action;
30
30
  if (op.params !== void 0) node.params = {
@@ -71,6 +71,19 @@ export declare const elementOps: {
71
71
  inside: "inside";
72
72
  }>;
73
73
  }, import('zod/v4/core').$strip>;
74
+ addSpec: import('zod').ZodObject<{
75
+ type: import('zod').ZodLiteral<"addSpec">;
76
+ pageRef: import('zod').ZodString;
77
+ parentRef: import('zod').ZodOptional<import('zod').ZodString>;
78
+ position: import('zod').ZodOptional<import('zod').ZodEnum<{
79
+ before: "before";
80
+ after: "after";
81
+ inside: "inside";
82
+ }>>;
83
+ replaces: import('zod').ZodOptional<import('zod').ZodString>;
84
+ spec: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>;
85
+ classes: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>>;
86
+ }, import('zod/v4/core').$strip>;
74
87
  upsertPage: import('zod').ZodObject<{
75
88
  type: import('zod').ZodLiteral<"upsertPage">;
76
89
  ref: import('zod').ZodString;
@@ -86,6 +99,10 @@ export declare const elementOps: {
86
99
  noBounce: "noBounce";
87
100
  }>>>;
88
101
  flag: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
102
+ style: import('zod').ZodOptional<import('zod').ZodObject<{
103
+ base: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>;
104
+ slots: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodArray<import('zod').ZodString>>>;
105
+ }, import('zod/v4/core').$strip>>;
89
106
  }, import('zod/v4/core').$strip>;
90
107
  deletePage: import('zod').ZodObject<{
91
108
  type: import('zod').ZodLiteral<"deletePage">;
@@ -304,9 +321,16 @@ export declare const elementOps: {
304
321
  dark: import('zod').ZodOptional<import('zod').ZodString>;
305
322
  }, import('zod/v4/core').$strip>]>>;
306
323
  robotsTxt: import('zod').ZodOptional<import('zod').ZodString>;
307
- blockAiCrawlers: import('zod').ZodOptional<import('zod').ZodBoolean>;
324
+ securityTxt: import('zod').ZodOptional<import('zod').ZodString>;
325
+ llmsTxt: import('zod').ZodOptional<import('zod').ZodString>;
326
+ blockAiCrawlers: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodEnum<{
327
+ training: "training";
328
+ assistants: "assistants";
329
+ search: "search";
330
+ }>>>;
308
331
  viewTransitions: import('zod').ZodOptional<import('zod').ZodBoolean>;
309
332
  withheldPage: import('zod').ZodOptional<import('zod').ZodString>;
333
+ wholeDocument: import('zod').ZodOptional<import('zod').ZodBoolean>;
310
334
  channels: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodNullable<import('zod').ZodObject<{
311
335
  access: import('zod').ZodObject<{
312
336
  mode: import('zod').ZodEnum<{
@@ -3,6 +3,7 @@ import { patchBindingOp } from "./bindings/patchBinding.js";
3
3
  import { upsertBindingOp } from "./bindings/upsertBinding.js";
4
4
  import { deleteComponentOp } from "./components/deleteComponent.js";
5
5
  import { upsertComponentOp } from "./components/upsertComponent.js";
6
+ import { addSpecOp } from "./elements/addSpec.js";
6
7
  import { deleteElementOp } from "./elements/deleteElement.js";
7
8
  import { moveElementOp } from "./elements/moveElement.js";
8
9
  import { patchElementOp } from "./elements/patchElement.js";
@@ -29,6 +30,7 @@ var elementOps = {
29
30
  patchElement: patchElementOp,
30
31
  deleteElement: deleteElementOp,
31
32
  moveElement: moveElementOp,
33
+ addSpec: addSpecOp,
32
34
  upsertPage: upsertPageOp,
33
35
  deletePage: deletePageOp,
34
36
  upsertLayout: upsertLayoutOp,
@@ -10,7 +10,7 @@ var deleteLayoutOp = z.object({
10
10
  }).describe("Delete a layout shell and everything in it. Refused while a page still renders inside it (detach with upsertPage { layout: null }). Destructive: what it holds is on every page that uses it — confirm first.");
11
11
  var deleteLayout = (space, env, op) => {
12
12
  const layout = findLayoutByRef(space.schema, op.ref);
13
- if (!layout) return fail("ref", `Layout "${op.ref}" not found`, `Read plitzi://schema/${env}/layouts for valid refs`);
13
+ if (!layout) return fail("missing", "ref", `Layout "${op.ref}" not found`, `Read plitzi://schema/${env}/layouts for valid refs`);
14
14
  /**
15
15
  * A shell still in use is not deleted, it is REFUSED — and the pages are named.
16
16
  *
@@ -19,7 +19,7 @@ var deleteLayout = (space, env, op) => {
19
19
  * a decision about pages the caller did not mention.
20
20
  */
21
21
  const inUse = pagesUsingLayout(space.schema, layout.id);
22
- if (inUse.length > 0) return fail("ref", `Layout "${op.ref}" is still used by ${inUse.length} page(s): ${inUse.map((page) => page.id).join(", ")}`, "Detach them first with upsertPage { layout: null }, or point them at another shell");
22
+ if (inUse.length > 0) return fail("in-use", "ref", `Layout "${op.ref}" is still used by ${inUse.length} page(s): ${inUse.map((page) => page.id).join(", ")}`, "Detach them first with upsertPage { layout: null }, or point them at another shell");
23
23
  const removedIds = descendants(space.schema.flat, layout.id);
24
24
  const removed = removedIds.map((id) => space.schema.flat[id]);
25
25
  for (const id of [...removedIds, layout.id]) Reflect.deleteProperty(space.schema.flat, id);
@@ -10,7 +10,7 @@ var deletePageOp = z.object({
10
10
  }).describe("Delete a page and every element on it.");
11
11
  var deletePage = (space, env, op) => {
12
12
  const page = findPageByRef(space.schema, op.ref);
13
- if (!page) return fail("ref", `Page "${op.ref}" not found`, "Read the pages resource for valid refs");
13
+ if (!page) return fail("missing", "ref", `Page "${op.ref}" not found`, "Read the pages resource for valid refs");
14
14
  const removedIds = descendants(space.schema.flat, page.id);
15
15
  const removed = removedIds.map((id) => space.schema.flat[id]);
16
16
  for (const id of [...removedIds, page.id]) Reflect.deleteProperty(space.schema.flat, id);
@@ -16,6 +16,10 @@ export declare const upsertPageOp: z.ZodObject<{
16
16
  noBounce: "noBounce";
17
17
  }>>>;
18
18
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
+ style: z.ZodOptional<z.ZodObject<{
20
+ base: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
22
+ }, z.core.$strip>>;
19
23
  }, z.core.$strip>;
20
24
  export type UpsertPage = z.infer<typeof upsertPageOp>;
21
25
  export declare const upsertPage: (space: Space, env: Env, op: UpsertPage) => OpResult;
@@ -1,7 +1,7 @@
1
1
  import { empty, fail } from "../../../../helpers/opResult.js";
2
2
  import { layoutsUri, pageUri, pagesUri } from "../../../../helpers/uris.js";
3
3
  import { findFolderByRef, findLayoutByRef, findPageByRef, indexAddPage, resolveRef } from "../../../../helpers/space.js";
4
- import { elementFlag } from "../shared.js";
4
+ import { elementFlag, styleRefs } from "../shared.js";
5
5
  import { guardNewRef } from "../write.js";
6
6
  import { DOCUMENT_SCROLLS, flagGateOf } from "@plitzi/sdk-authoring";
7
7
  import { z } from "zod";
@@ -17,8 +17,14 @@ var upsertPageOp = z.object({
17
17
  layoutContainer: z.string().nullable().optional().describe("Ref of the container INSIDE that shell where this page body goes — the slot. Must belong to it."),
18
18
  enabled: z.boolean().optional().describe("false disables the page in the published SDK runtime (not routable/accessible to end users); it stays editable here. Defaults to true"),
19
19
  documentScroll: z.enum(DOCUMENT_SCROLLS).nullable().optional().describe("\"locked\": the document never moves, only overflow:auto panels scroll; \"noBounce\": no rubber band"),
20
- flag: elementFlag.nullable().optional()
20
+ flag: elementFlag.nullable().optional(),
21
+ style: styleRefs.optional().describe("The page's own classes — its root: the page's background, its padding, how it lays its body out. Replaces what the page wore; a class is a definition (upsertDefinition)")
21
22
  }).describe("Create a page, or update it when ref already exists (only the fields you pass change).");
23
+ /** A page root's selectors, from the classes the operation names: base, and each slot's. */
24
+ var selectorsOf = (style) => ({
25
+ base: (style.base ?? []).join(" "),
26
+ ...Object.fromEntries(Object.entries(style.slots ?? {}).map(([slot, classes]) => [slot, classes.join(" ")]))
27
+ });
22
28
  var upsertPage = (space, env, op) => {
23
29
  const slug = op.slug === void 0 ? void 0 : op.slug.replace(/^\/+/, "");
24
30
  let folderValue;
@@ -26,7 +32,7 @@ var upsertPage = (space, env, op) => {
26
32
  if (op.folder === null || op.folder === "") folderValue = "";
27
33
  else {
28
34
  const resolved = findFolderByRef(space.schema, op.folder);
29
- if (!resolved) return fail("folder", `Folder "${op.folder}" not found`, "Create it with upsertFolder, or read plitzi://folders");
35
+ if (!resolved) return fail("missing", "folder", `Folder "${op.folder}" not found`, "Create it with upsertFolder, or read plitzi://folders");
30
36
  folderValue = resolved.id;
31
37
  }
32
38
  }
@@ -41,7 +47,7 @@ var upsertPage = (space, env, op) => {
41
47
  let slotValue;
42
48
  if (op.layout !== void 0) {
43
49
  if (op.layout === null || op.layout === "") layoutValue = "";
44
- else if (!findLayoutByRef(space.schema, op.layout)) return fail("layout", `Layout "${op.layout}" not found`, "Create it with upsertLayout, or read plitzi://schema/" + env + "/layouts");
50
+ else if (!findLayoutByRef(space.schema, op.layout)) return fail("missing", "layout", `Layout "${op.layout}" not found`, "Create it with upsertLayout, or read plitzi://schema/" + env + "/layouts");
45
51
  else layoutValue = op.layout;
46
52
  }
47
53
  if (op.layoutContainer !== void 0) {
@@ -50,8 +56,8 @@ var upsertPage = (space, env, op) => {
50
56
  const existingPage = findPageByRef(space.schema, op.ref);
51
57
  const shellRef = layoutValue ?? existingPage?.attributes.layout;
52
58
  const shell = shellRef ? findLayoutByRef(space.schema, shellRef) : void 0;
53
- if (!shell) return fail("layoutContainer", "A slot needs a layout to be part of", "Pass `layout` in the same op (or set it first) so the slot can be checked against that shell");
54
- if (!resolveRef(space.schema, shell, op.layoutContainer)) return fail("layoutContainer", `"${op.layoutContainer}" is not an element of layout "${shell.id}"`, `Read plitzi://schema/${env}/pages/${shell.id} and name a container from that tree`);
59
+ if (!shell) return fail("wrong-options", "layoutContainer", "A slot needs a layout to be part of", "Pass `layout` in the same op (or set it first) so the slot can be checked against that shell");
60
+ if (!resolveRef(space.schema, shell, op.layoutContainer)) return fail("bad-value", "layoutContainer", `"${op.layoutContainer}" is not an element of layout "${shell.id}"`, `Read plitzi://schema/${env}/pages/${shell.id} and name a container from that tree`);
55
61
  slotValue = op.layoutContainer;
56
62
  }
57
63
  }
@@ -69,6 +75,7 @@ var upsertPage = (space, env, op) => {
69
75
  };
70
76
  if (op.documentScroll === null) Reflect.deleteProperty(existing.attributes, "documentScroll");
71
77
  else if (op.documentScroll !== void 0) existing.attributes.documentScroll = op.documentScroll;
78
+ if (op.style) existing.definition.styleSelectors = selectorsOf(op.style);
72
79
  if (op.flag === null) Reflect.deleteProperty(existing.definition, "flag");
73
80
  else if (op.flag !== void 0) existing.definition.flag = flagGateOf(op.flag, `Page "${op.ref}"`);
74
81
  return {
@@ -101,7 +108,7 @@ var upsertPage = (space, env, op) => {
101
108
  label: op.label ?? op.ref,
102
109
  type: "page",
103
110
  items: [],
104
- styleSelectors: { base: "" },
111
+ styleSelectors: op.style ? selectorsOf(op.style) : { base: "" },
105
112
  ...op.flag ? { flag: flagGateOf(op.flag, `Page "${op.ref}"`) } : {}
106
113
  }
107
114
  };
@@ -45,9 +45,16 @@ export declare const patchSettingsOp: z.ZodObject<{
45
45
  dark: z.ZodOptional<z.ZodString>;
46
46
  }, z.core.$strip>]>>;
47
47
  robotsTxt: z.ZodOptional<z.ZodString>;
48
- blockAiCrawlers: z.ZodOptional<z.ZodBoolean>;
48
+ securityTxt: z.ZodOptional<z.ZodString>;
49
+ llmsTxt: z.ZodOptional<z.ZodString>;
50
+ blockAiCrawlers: z.ZodOptional<z.ZodArray<z.ZodEnum<{
51
+ training: "training";
52
+ assistants: "assistants";
53
+ search: "search";
54
+ }>>>;
49
55
  viewTransitions: z.ZodOptional<z.ZodBoolean>;
50
56
  withheldPage: z.ZodOptional<z.ZodString>;
57
+ wholeDocument: z.ZodOptional<z.ZodBoolean>;
51
58
  channels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodObject<{
52
59
  access: z.ZodObject<{
53
60
  mode: z.ZodEnum<{
@@ -2,7 +2,7 @@ import { empty, fail } from "../../../../helpers/opResult.js";
2
2
  import { settingsUri } from "../../../../helpers/uris.js";
3
3
  import { NOTIFICATIONS_FIELDS, splitNotificationsCss, withNotificationsCss } from "@plitzi/sdk-authoring";
4
4
  import { z } from "zod";
5
- import { spaceIdentity, spaceIdentityProblems, withheldPageOf } from "@plitzi/sdk-shared/schema";
5
+ import { AI_CRAWLER_KINDS, spaceIdentity, spaceIdentityProblems, withheldPageOf } from "@plitzi/sdk-shared/schema";
6
6
  import { channelProblems } from "@plitzi/sdk-shared/realtime";
7
7
  // src/modules/mcp/tools/operations/schema/settings/patchSettings.ts
8
8
  var userProvider = z.string();
@@ -62,9 +62,12 @@ var patchSettingsOp = z.object({
62
62
  dark: z.string().optional()
63
63
  })]).optional(),
64
64
  robotsTxt: z.string().optional(),
65
- blockAiCrawlers: z.boolean().optional().describe("robots.txt bars AI-training crawlers"),
65
+ securityTxt: z.string().optional().describe("/.well-known/security.txt, as written (RFC 9116: Contact, Expires)"),
66
+ llmsTxt: z.string().optional().describe("/llms.txt, as written; left out, the site writes one from its public pages (404 with assistants kept out)"),
67
+ blockAiCrawlers: z.array(z.enum(AI_CRAWLER_KINDS)).optional().describe("AI crawlers robots.txt keeps out, by kind: training, assistants (fetching for a person), search"),
66
68
  viewTransitions: z.boolean().optional(),
67
69
  withheldPage: z.string().optional().describe("Page id drawn for a withheld page (its 401/403); \"\" = Plitzi's words"),
70
+ wholeDocument: z.boolean().optional().describe("Whole space with every page, not in parts"),
68
71
  channels: z.record(z.string(), channel.nullable()).optional().describe("Realtime channels by topic pattern (`board:{id}`); null removes one. See the guide")
69
72
  }).describe("Merge space-level settings — global CSS, notifications, kept state, auth, realtime channels, the site's identity and robots.txt. Only the fields sent change. customCss is for site-wide CSS, never to style one element (attach a definition for that).");
70
73
  /** The space's channels with the patch merged in, pattern by pattern — `null` takes one out. */
@@ -94,13 +97,13 @@ var patchSettings = (space, env, op) => {
94
97
  const { type, channels, customCss, notifications: notificationsPatch, ...patch } = op;
95
98
  for (const [pattern, declaration] of Object.entries(channels ?? {})) {
96
99
  const [problem] = declaration === null ? [] : channelProblems(pattern, declaration);
97
- if (problem) return fail(`channels["${pattern}"]`, `Channel "${pattern}": ${problem}.`, "Fix the pattern or declaration and send it again");
100
+ if (problem) return fail("bad-value", `channels["${pattern}"]`, `Channel "${pattern}": ${problem}.`, "Fix the pattern or declaration and send it again");
98
101
  }
99
102
  const [identityProblem] = spaceIdentityProblems(spaceIdentity({
100
103
  ...space.schema.settings,
101
104
  ...patch
102
105
  }));
103
- if (identityProblem) return fail("settings", identityProblem, "Fix the field and send it again");
106
+ if (identityProblem) return fail("bad-value", "settings", identityProblem, "Fix the field and send it again");
104
107
  const next = { ...space.schema.settings };
105
108
  for (const [key, value] of Object.entries(patch)) next[key] = value;
106
109
  if (channels) next.channels = mergeChannels(space.schema.settings.channels, channels);
@@ -109,14 +112,14 @@ var patchSettings = (space, env, op) => {
109
112
  try {
110
113
  next.customCss = patchCustomCss(typeof current === "string" ? current : "", customCss, notificationsPatch);
111
114
  } catch (error) {
112
- return fail("notifications", error instanceof Error ? error.message : String(error), "Write one CSS value per field — a colour, a length or a token like var(--card)");
115
+ return fail("bad-value", "notifications", error instanceof Error ? error.message : String(error), "Write one CSS value per field — a colour, a length or a token like var(--card)");
113
116
  }
114
117
  }
115
118
  if (next.withheldPage === "") delete next.withheldPage;
116
119
  else if (next.withheldPage !== void 0 && withheldPageOf({
117
120
  ...space.schema,
118
121
  settings: next
119
- }) === void 0) return fail("withheldPage", `withheldPage "${next.withheldPage}" is no page of the space, or one with an access of its own — withheld from the visitor it is drawn for.`, "Name the id of a page every visitor may see, or \"\" for the platform's words");
122
+ }) === void 0) return fail("bad-value", "withheldPage", `withheldPage "${next.withheldPage}" is no page of the space, or one with an access of its own — withheld from the visitor it is drawn for.`, "Name the id of a page every visitor may see, or \"\" for the platform's words");
120
123
  space.schema.settings = next;
121
124
  return {
122
125
  ...empty(),
@@ -1,4 +1,4 @@
1
- import { empty } from "../../../../helpers/opResult.js";
1
+ import { empty, fail } from "../../../../helpers/opResult.js";
2
2
  import { schemaVarsUri } from "../../../../helpers/uris.js";
3
3
  import { z } from "zod";
4
4
  // src/modules/mcp/tools/operations/schema/variables/deleteVariable.ts
@@ -7,7 +7,8 @@ var deleteVariableOp = z.object({
7
7
  name: z.string().describe("Name of the schema variable to delete")
8
8
  }).describe("Delete a space-level schema variable by name.");
9
9
  var deleteVariable = (space, env, op) => {
10
- space.schema.variables = space.schema.variables.filter((v) => v.name !== op.name);
10
+ if (!space.schema.variables.some((variable) => variable.name === op.name)) return fail("missing", "name", `No variable "${op.name}"`, `Read ${schemaVarsUri(env)} for the variables the space has`);
11
+ space.schema.variables = space.schema.variables.filter((variable) => variable.name !== op.name);
11
12
  return {
12
13
  ...empty(),
13
14
  deleted: 1,
@@ -16,7 +16,7 @@ var guardNewRef = (space, ref, field) => {
16
16
  const elsewhere = documentIds(space.document ?? space.schema).has(ref) ? `"${ref}" is already used by another element here` : null;
17
17
  const conflict = elementIdConflict(space.schema.flat, ref) ?? elsewhere;
18
18
  if (!conflict) return null;
19
- return isValidElementId(ref) ? fail(field, conflict, TAKEN_HINT) : fail(field, conflict, ID_REF_HINT);
19
+ return isValidElementId(ref) ? fail("exists", field, conflict, TAKEN_HINT) : fail("bad-value", field, conflict, ID_REF_HINT);
20
20
  };
21
21
  /** Where an op's `position` puts an element, in the vocabulary of the tree operations every writer shares. */
22
22
  var DROP_POSITION = {
@@ -89,9 +89,9 @@ var resolveTargetRef = (space, elementId) => {
89
89
  * errors as patchElement without repeating them. */
90
90
  var resolveElement = (space, env, pageRef, ref) => {
91
91
  const page = findRootByRef(space.schema, pageRef);
92
- if (!page) return { error: fail("pageRef", `Page or layout "${pageRef}" not found`, `Read plitzi://schema/${env}/pages for valid refs — a layout shell is named there too`) };
92
+ if (!page) return { error: fail("missing", "pageRef", `Page or layout "${pageRef}" not found`, `Read plitzi://schema/${env}/pages for valid refs — a layout shell is named there too`) };
93
93
  const el = resolveRef(space.schema, page, ref);
94
- if (!el || el.id === page.id) return { error: fail("ref", `Element "${ref}" not found in page "${pageRef}"`, "Name an element this page holds") };
94
+ if (!el || el.id === page.id) return { error: fail("missing", "ref", `Element "${ref}" not found in page "${pageRef}"`, "Name an element this page holds") };
95
95
  return { el };
96
96
  };
97
97
  export { DROP_POSITION, ID_REF_HINT, collectInputRefs, createElement, folderUri, foldersUri, guardNewRef, layoutsUri, pageUri, pagesUri, resolveElement, resolveTargetRef, schemaVarsUri, settingsUri, writeInitialState };
@@ -1,5 +1,5 @@
1
1
  import { defUri, defsUri } from "../../../../helpers/uris.js";
2
- import { empty } from "../../../../helpers/opResult.js";
2
+ import { empty, fail } from "../../../../helpers/opResult.js";
3
3
  import { MODES, guardKind } from "../write.js";
4
4
  import { z } from "zod";
5
5
  // src/modules/mcp/tools/operations/style/definitions/deleteDefinition.ts
@@ -10,6 +10,7 @@ var deleteDefinitionOp = z.object({
10
10
  var deleteDefinition = (space, env, op) => {
11
11
  const guard = guardKind(space.style, op.ref, "class");
12
12
  if (guard) return guard;
13
+ if (!MODES.some((mode) => Object.hasOwn(space.style.platform[mode], op.ref))) return fail("missing", "ref", `No class "${op.ref}"`, `Read ${defsUri(env)} for what there is`);
13
14
  for (const mode of MODES) Reflect.deleteProperty(space.style.platform[mode], op.ref);
14
15
  return {
15
16
  ...empty(),
@@ -14,7 +14,7 @@ var patchDefinition = (space, env, op) => {
14
14
  const guard = guardKind(space.style, op.ref, "class");
15
15
  if (guard) return guard;
16
16
  const existing = definitionToAI(space.style, op.ref);
17
- if (!existing) return fail("ref", `Definition "${op.ref}" not found`, "patchDefinition only updates an existing definition; use upsertDefinition to create one");
17
+ if (!existing) return fail("missing", "ref", `Definition "${op.ref}" not found`, "patchDefinition only updates an existing definition; use upsertDefinition to create one");
18
18
  const { type, ref, slots: slotsPatch, ...basePatch } = op;
19
19
  const { base, slots } = mergePatch(existing, basePatch, slotsPatch);
20
20
  const problem = writeStyleItem(space.style, ref, base, slots, "class", void 0);
@@ -1,4 +1,4 @@
1
- import { empty } from "../../../../helpers/opResult.js";
1
+ import { empty, fail } from "../../../../helpers/opResult.js";
2
2
  import { fontUri, fontsUri } from "../../../../helpers/uris.js";
3
3
  import { z } from "zod";
4
4
  // src/modules/mcp/tools/operations/style/fonts/deleteFont.ts
@@ -9,7 +9,7 @@ var deleteFontOp = z.object({
9
9
  var deleteFont = (space, env, op) => {
10
10
  const fonts = space.style.fonts ?? [];
11
11
  const index = fonts.findIndex((item) => item.family === op.family);
12
- if (index === -1) return empty();
12
+ if (index === -1) return fail("missing", "family", `The space has no font "${op.family}"`, `Read ${fontsUri(env)} for the fonts it has`);
13
13
  fonts.splice(index, 1);
14
14
  return {
15
15
  ...empty(),
@@ -43,7 +43,7 @@ var upsertFont = (space, env, op) => {
43
43
  });
44
44
  } catch (err) {
45
45
  if (!(err instanceof FontValidationError)) throw err;
46
- return fail("font", err.message, "Fix the field the message names and send the operation again.");
46
+ return fail("bad-value", "font", err.message, "Fix the field the message names and send the operation again.");
47
47
  }
48
48
  const fonts = space.style.fonts ??= [];
49
49
  const index = fonts.findIndex((item) => item.family === font.family);
@@ -1,5 +1,5 @@
1
1
  import { globalUri, globalsUri } from "../../../../helpers/uris.js";
2
- import { empty } from "../../../../helpers/opResult.js";
2
+ import { empty, fail } from "../../../../helpers/opResult.js";
3
3
  import { MODES, guardKind } from "../write.js";
4
4
  import { z } from "zod";
5
5
  // src/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.ts
@@ -10,6 +10,7 @@ var deleteGlobalStyleOp = z.object({
10
10
  var deleteGlobalStyle = (space, env, op) => {
11
11
  const guard = guardKind(space.style, op.componentType, "element");
12
12
  if (guard) return guard;
13
+ if (!MODES.some((mode) => Object.hasOwn(space.style.platform[mode], op.componentType))) return fail("missing", "componentType", `No global style for "${op.componentType}"`, `Read ${globalsUri(env)} for what there is`);
13
14
  for (const mode of MODES) Reflect.deleteProperty(space.style.platform[mode], op.componentType);
14
15
  return {
15
16
  ...empty(),
@@ -14,7 +14,7 @@ var patchGlobalStyle = (space, env, op) => {
14
14
  const guard = guardKind(space.style, op.componentType, "element");
15
15
  if (guard) return guard;
16
16
  const existing = globalStyleToAI(space.style, op.componentType);
17
- if (!existing) return fail("componentType", `No global style for "${op.componentType}"`, "patchGlobalStyle only updates an existing global; use upsertGlobalStyle to create one");
17
+ if (!existing) return fail("missing", "componentType", `No global style for "${op.componentType}"`, "patchGlobalStyle only updates an existing global; use upsertGlobalStyle to create one");
18
18
  const { type, componentType, slots: slotsPatch, ...basePatch } = op;
19
19
  const { base, slots } = mergePatch(existing, basePatch, slotsPatch);
20
20
  const problem = writeStyleItem(space.style, componentType, base, slots, "element", componentType);
@@ -1,5 +1,5 @@
1
1
  import { idUri, idsUri } from "../../../../helpers/uris.js";
2
- import { empty } from "../../../../helpers/opResult.js";
2
+ import { empty, fail } from "../../../../helpers/opResult.js";
3
3
  import { MODES, guardKind } from "../write.js";
4
4
  import { z } from "zod";
5
5
  // src/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.ts
@@ -10,6 +10,7 @@ var deleteIdStyleOp = z.object({
10
10
  var deleteIdStyle = (space, env, op) => {
11
11
  const guard = guardKind(space.style, op.targetId, "id");
12
12
  if (guard) return guard;
13
+ if (!MODES.some((mode) => Object.hasOwn(space.style.platform[mode], op.targetId))) return fail("missing", "targetId", `No id rule for "${op.targetId}"`, `Read ${idsUri(env)} for what there is`);
13
14
  for (const mode of MODES) Reflect.deleteProperty(space.style.platform[mode], op.targetId);
14
15
  return {
15
16
  ...empty(),
@@ -14,7 +14,7 @@ var patchIdStyle = (space, env, op) => {
14
14
  const guard = guardKind(space.style, op.targetId, "id");
15
15
  if (guard) return guard;
16
16
  const existing = idStyleToAI(space.style, op.targetId);
17
- if (!existing) return fail("targetId", `No id rule for "${op.targetId}"`, "patchIdStyle only updates an existing id rule; use upsertIdStyle to create one");
17
+ if (!existing) return fail("missing", "targetId", `No id rule for "${op.targetId}"`, "patchIdStyle only updates an existing id rule; use upsertIdStyle to create one");
18
18
  const { type, targetId, slots: slotsPatch, ...basePatch } = op;
19
19
  const { base, slots } = mergePatch(existing, basePatch, slotsPatch);
20
20
  const problem = writeStyleItem(space.style, targetId, base, slots, "id", void 0);
@@ -13,18 +13,18 @@ var rulesOf = (part) => [...MODES.flatMap((mode) => part[mode] ? [expandShorthan
13
13
  var pseudoProblem = (path, name, part) => {
14
14
  if (!isStylePseudo(name)) {
15
15
  const bare = name.replace(/^:+/, "");
16
- return fail(path, `"${name}" is not a pseudo-element a class dresses`, isStylePseudo(bare) ? `Write it without the colons: "${bare}".` : `Use one of ${STYLE_PSEUDOS.join(", ")}.`, [...STYLE_PSEUDOS]);
16
+ return fail("bad-value", path, `"${name}" is not a pseudo-element a class dresses`, isStylePseudo(bare) ? `Write it without the colons: "${bare}".` : `Use one of ${STYLE_PSEUDOS.join(", ")}.`, [...STYLE_PSEUDOS]);
17
17
  }
18
18
  const rules = rulesOf(part);
19
19
  for (const rule of rules) for (const [property, value] of Object.entries(rule)) {
20
20
  if (property === "content") {
21
- if (!CONTENT_PSEUDOS.includes(name)) return fail(path, `content on ::${name} draws nothing`, `Only ${CONTENT_PSEUDOS.map((pseudo) => `::${pseudo}`).join(", ")} take one.`);
22
- if (!isContentValue(String(value))) return fail(path, `content: ${String(value)} on ::${name} is not text CSS can read, so nothing is drawn`, `Write the text in quotes inside the string — "\\"${String(value)}\\"" — and an empty box as "\\"\\""; counter(), attr() and url() are written as they are.`);
21
+ if (!CONTENT_PSEUDOS.includes(name)) return fail("bad-value", path, `content on ::${name} draws nothing`, `Only ${CONTENT_PSEUDOS.map((pseudo) => `::${pseudo}`).join(", ")} take one.`);
22
+ if (!isContentValue(String(value))) return fail("bad-value", path, `content: ${String(value)} on ::${name} is not text CSS can read, so nothing is drawn`, `Write the text in quotes inside the string — "\\"${String(value)}\\"" — and an empty box as "\\"\\""; counter(), attr() and url() are written as they are.`);
23
23
  continue;
24
24
  }
25
- if (!pseudoHonours(name, property)) return fail(path, `${property} on ::${name} is dropped by every browser`, `::${name} honours ${(PSEUDO_PROPERTIES[name] ?? []).join(", ")}; style the element itself for the rest.`);
25
+ if (!pseudoHonours(name, property)) return fail("bad-value", path, `${property} on ::${name} is dropped by every browser`, `::${name} honours ${(PSEUDO_PROPERTIES[name] ?? []).join(", ")}; style the element itself for the rest.`);
26
26
  }
27
- if (GENERATED_PSEUDOS.includes(name) && !rules.some((rule) => Object.hasOwn(rule, "content"))) return fail(path, `::${name} has no content, so nothing is drawn`, "Give it one: content \"\\\"\\\"\" for an empty box.");
27
+ if (GENERATED_PSEUDOS.includes(name) && !rules.some((rule) => Object.hasOwn(rule, "content"))) return fail("bad-value", path, `::${name} has no content, so nothing is drawn`, "Give it one: content \"\\\"\\\"\" for an empty box.");
28
28
  return null;
29
29
  };
30
30
  var pseudosProblem = (path, pseudos) => {
@@ -42,7 +42,7 @@ var slotProblem = (path, slot) => {
42
42
  if (problem) return problem;
43
43
  }
44
44
  for (const [key, condition] of Object.entries(slot.conditions ?? {})) {
45
- if (!canonicalCondition(key)) return fail(`${path}conditions.${key}`, `"${key}" is not a condition a class's rules can hold under`, CONDITION_HINT);
45
+ if (!canonicalCondition(key)) return fail("bad-value", `${path}conditions.${key}`, `"${key}" is not a condition a class's rules can hold under`, CONDITION_HINT);
46
46
  const problem = pseudosProblem(`${path}conditions.${key}.`, condition.pseudos);
47
47
  if (problem) return problem;
48
48
  }
@@ -1,4 +1,4 @@
1
- import { empty } from "../../../../helpers/opResult.js";
1
+ import { empty, fail } from "../../../../helpers/opResult.js";
2
2
  import { styleCategory } from "../shared.js";
3
3
  import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
4
4
  import { z } from "zod";
@@ -10,7 +10,8 @@ var deleteStyleVariableOp = z.object({
10
10
  }).describe("Delete a design token by category + name.");
11
11
  var deleteStyleVariable = (space, env, op) => {
12
12
  const group = space.style.variables[op.category];
13
- if (group) Reflect.deleteProperty(group, op.name);
13
+ if (!group || !Object.hasOwn(group, op.name)) return fail("missing", "name", `No ${op.category} token "${op.name}"`, `Read ${styleVarUri(env, op.category)} for the tokens of that category`);
14
+ Reflect.deleteProperty(group, op.name);
14
15
  return {
15
16
  ...empty(),
16
17
  deleted: 1,
@@ -28,7 +28,7 @@ var KIND_FIELD = {
28
28
  var guardKind = (style, ref, want) => {
29
29
  const clash = MODES.map((mode) => style.platform[mode][ref]).find((item) => item !== void 0 && item.type !== want);
30
30
  if (!clash) return null;
31
- return fail(KIND_FIELD[want], `"${ref}" is already ${KIND_LABEL[clash.type]}; it cannot be edited as ${KIND_LABEL[want]}`, `Edit it with ${KIND_TOOL[clash.type]}, or choose a different ${KIND_FIELD[want]}.`);
31
+ return fail("exists", KIND_FIELD[want], `"${ref}" is already ${KIND_LABEL[clash.type]}; it cannot be edited as ${KIND_LABEL[want]}`, `Edit it with ${KIND_TOOL[clash.type]}, or choose a different ${KIND_FIELD[want]}.`);
32
32
  };
33
33
  /** A part with rules and states — a pseudo-element, a variant, a condition — at one breakpoint, or nothing there. */
34
34
  var partAt = (part, mode) => {
@@ -0,0 +1,3 @@
1
+ export declare const releasesTool: import('.').ToolDef;
2
+ export declare const publishTool: import('.').ToolDef;
3
+ export declare const rollbackTool: import('.').ToolDef;
@@ -0,0 +1,60 @@
1
+ import { defineTool } from "./shared/tool.js";
2
+ import { z } from "zod";
3
+ // src/modules/mcp/tools/releases.ts
4
+ /**
5
+ * A space's releases, for an agent as for a person: what each domain serves and what a rollback would put
6
+ * back, a domain's history, a publish and a rollback — held on the platform to the same rules as the builder's Publish
7
+ * (who may publish, the plan, the revision's tests), a refusal answered in its words.
8
+ */
9
+ var environment = z.enum([
10
+ "main",
11
+ "development",
12
+ "staging",
13
+ "production"
14
+ ]);
15
+ var notWired = {
16
+ done: false,
17
+ reason: "This deployment keeps no releases for its spaces"
18
+ };
19
+ var releasesTool = defineTool({
20
+ name: "plitzi_releases",
21
+ title: "Space releases",
22
+ description: "Every domain of the space with the revision it serves, where its site is (Plitzi, or a copy on a provider) and what it asks, and what a rollback would put back — or, with `domain`, that domain’s releases, newest first: what each put on it, who, when, publish or rollback.",
23
+ inputShape: { domain: z.string().optional().describe("One domain’s history; every domain when left out") },
24
+ access: "read",
25
+ documents: false,
26
+ run: async ({ domain }, ctx) => {
27
+ if (!ctx.releases) return notWired;
28
+ return domain ? ctx.releases.history(domain) : { domains: await ctx.releases.domains() };
29
+ }
30
+ });
31
+ var publishTool = defineTool({
32
+ name: "plitzi_publish",
33
+ title: "Publish a revision",
34
+ description: "Point a domain at a revision, recorded as a release: named, it stays on it; left out, it follows its environment’s latest — each revision kept there afterwards shows on it. Live at once for the visitors of that domain: publish only what the person asked to be published.",
35
+ inputShape: {
36
+ domain: z.string().describe("One of the space’s domains"),
37
+ environment: environment.describe("The revision’s environment; `main` serves the draft as it is saved"),
38
+ revision: z.number().int().positive().optional().describe("The revision it stays on; left out, it follows the environment’s latest"),
39
+ deploy: z.boolean().optional().describe("A domain whose site a provider holds: deploy it when the revision needs one (refused otherwise)")
40
+ },
41
+ access: "write",
42
+ documents: false,
43
+ run: (asked, ctx) => ctx.releases ? ctx.releases.publish(asked) : notWired
44
+ });
45
+ var rollbackTool = defineTool({
46
+ name: "plitzi_rollback",
47
+ title: "Roll a domain back",
48
+ description: "Put back on a domain what it served right before its latest release — or the version `to` names from its history. Never refused by plan. Feature flags and the space’s data stay as they are.",
49
+ inputShape: {
50
+ domain: z.string().describe("One of the space’s domains"),
51
+ to: z.object({
52
+ environment,
53
+ revision: z.number().int().nonnegative()
54
+ }).optional().describe("A version from its history; what it served right before its latest release when left out")
55
+ },
56
+ access: "write",
57
+ documents: false,
58
+ run: (asked, ctx) => ctx.releases ? ctx.releases.rollback(asked) : notWired
59
+ });
60
+ export { publishTool, releasesTool, rollbackTool };
@@ -70,6 +70,18 @@ export declare const renderShape: {
70
70
  after: "after";
71
71
  inside: "inside";
72
72
  }>;
73
+ }, z.core.$strict>, z.ZodObject<{
74
+ type: z.ZodLiteral<"addSpec">;
75
+ pageRef: z.ZodString;
76
+ parentRef: z.ZodOptional<z.ZodString>;
77
+ position: z.ZodOptional<z.ZodEnum<{
78
+ before: "before";
79
+ after: "after";
80
+ inside: "inside";
81
+ }>>;
82
+ replaces: z.ZodOptional<z.ZodString>;
83
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
84
+ classes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
73
85
  }, z.core.$strict>, z.ZodObject<{
74
86
  type: z.ZodLiteral<"upsertPage">;
75
87
  ref: z.ZodString;
@@ -85,6 +97,10 @@ export declare const renderShape: {
85
97
  noBounce: "noBounce";
86
98
  }>>>;
87
99
  flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
+ style: z.ZodOptional<z.ZodObject<{
101
+ base: z.ZodOptional<z.ZodArray<z.ZodString>>;
102
+ slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
103
+ }, z.core.$strip>>;
88
104
  }, z.core.$strict>, z.ZodObject<{
89
105
  type: z.ZodLiteral<"deletePage">;
90
106
  ref: z.ZodString;
@@ -287,9 +303,16 @@ export declare const renderShape: {
287
303
  dark: z.ZodOptional<z.ZodString>;
288
304
  }, z.core.$strip>]>>;
289
305
  robotsTxt: z.ZodOptional<z.ZodString>;
290
- blockAiCrawlers: z.ZodOptional<z.ZodBoolean>;
306
+ securityTxt: z.ZodOptional<z.ZodString>;
307
+ llmsTxt: z.ZodOptional<z.ZodString>;
308
+ blockAiCrawlers: z.ZodOptional<z.ZodArray<z.ZodEnum<{
309
+ training: "training";
310
+ assistants: "assistants";
311
+ search: "search";
312
+ }>>>;
291
313
  viewTransitions: z.ZodOptional<z.ZodBoolean>;
292
314
  withheldPage: z.ZodOptional<z.ZodString>;
315
+ wholeDocument: z.ZodOptional<z.ZodBoolean>;
293
316
  channels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodObject<{
294
317
  access: z.ZodObject<{
295
318
  mode: z.ZodEnum<{