@plitzi/sdk-mcp 0.38.16 → 0.38.18

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 (30) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/dist/modules/mcp/apps/render/view/streamProgress.ts +1 -1
  3. package/dist/modules/mcp/helpers/components.js +1 -1
  4. package/dist/modules/mcp/helpers/interactions.d.ts +1 -2
  5. package/dist/modules/mcp/helpers/space.js +1 -1
  6. package/dist/modules/mcp/resources/renderGuide.js +1 -1
  7. package/dist/modules/mcp/resources/schema.js +1 -1
  8. package/dist/modules/mcp/server.js +1 -1
  9. package/dist/modules/mcp/tools/apply/index.js +1 -1
  10. package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +1 -1
  11. package/dist/modules/mcp/tools/operations/schema/components/deleteComponent.js +1 -1
  12. package/dist/modules/mcp/tools/operations/schema/components/upsertComponent.js +1 -3
  13. package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +1 -2
  14. package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +1 -1
  15. package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +2 -2
  16. package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +1 -1
  17. package/dist/modules/mcp/tools/operations/schema/pages/deleteLayout.js +1 -1
  18. package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +1 -1
  19. package/dist/modules/mcp/tools/operations/schema/shared.d.ts +1 -2
  20. package/dist/modules/mcp/tools/operations/schema/shared.js +2 -3
  21. package/dist/modules/mcp/tools/operations/schema/translator.js +1 -1
  22. package/dist/modules/mcp/tools/operations/schema/write.js +2 -4
  23. package/dist/modules/mcp/tools/operations/style/validate.js +1 -2
  24. package/dist/modules/mcp/tools/operations/style/write.js +2 -3
  25. package/dist/modules/mcp/tools/renderWidget.js +1 -1
  26. package/dist/modules/mcp/tools/shared/effects.js +1 -2
  27. package/dist/modules/mcp/tools/shared/lintDraft.js +1 -2
  28. package/dist/modules/mcp/tools/shared/validator/index.js +1 -2
  29. package/dist/modules/mcp/tools/shared/validator/refs.js +1 -1
  30. package/package.json +21 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,128 @@
1
1
  # @plitzi/sdk-mcp
2
2
 
3
+ ## 0.38.18
4
+
5
+ ### Patch Changes
6
+
7
+ - b3023c9: ## Security
8
+
9
+ - **A page of the same site on another origin is no longer this server's own** (`@plitzi/sdk-server`): the guard
10
+ against writes another page caused (`crossSiteWrites`, the sign-in's login-CSRF check and `createOriginGuardMiddleware`)
11
+ trusted `Sec-Fetch-Site: same-site` — and a site has no port and spans every sub-domain, so another port of the host
12
+ (where `createAuthoringHost` serves pages an agent wrote) or a sibling sub-domain (every space of a platform on one
13
+ domain) could write as if it were the server's own page. Now only `same-origin` (and `none`, a typed URL) is; `same-site`
14
+ is refused 403 `reason: 'foreign'` unless its origin is named (`crossSiteWrites.origins`, `identity.platformOrigins`),
15
+ and the `Origin` fallback compares host and port. In production an app and its spaces are already on different sites,
16
+ so a deployment that works there needs nothing; one that relied on a sibling sub-domain locally names it.
17
+ `createAuthoringHost`'s docs now say to serve on a host of its own — a cookie belongs to a host whatever its port.
18
+
19
+ ## Server
20
+ - **An open page takes a new version of its space where it stands** (`@plitzi/sdk-server`, `@plitzi/plitzi-sdk`):
21
+ `server.updatePages(documents, { draft? })` hands the pages showing that space — or that draft — its new documents,
22
+ and each swaps them in place, its state, scroll and focus kept (`replaceSpace` on what the SDK's `render` returns;
23
+ `false`, and the page loads again, for a page with elements the server draws). The development loop of a project uses
24
+ it: a save to the space no longer reloads the open page. `createAuthoringHost`'s `put` over an id that pages show
25
+ hands them the new version and answers how many took it (`updated`), so a page an agent keeps improving is seen to
26
+ grow instead of reloading — no second iframe needed.
27
+ - **`devReload` is `livePages`** (`@plitzi/sdk-server`): the channel the open pages listen on now carries the space,
28
+ not only "load again", and a host that is not developing uses it too. Its address is `/__plitzi/live`; a draft's page
29
+ listens for its own changes alone (`?__pt=`). A plugin swapped where it is drawn stays a development server's
30
+ (`devMode`). `plitzi upgrade migrations --write` renames the option in a project's code (`livePagesOption`).
31
+
32
+ ## Packages
33
+ - **`@plitzi/sdk-server` starts in half the time** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): importing it took
34
+ ~310 ms, ~200 of them `date-fns` — 108 modules nothing on the server uses, brought by `@plitzi/sdk-shared/helpers` —
35
+ and loaded the browser's hooks and contexts of every folder of `@plitzi/sdk-shared` it read, `@plitzi/nexus/react`
36
+ with them. Now ~150 ms (`@plitzi/sdk-shared` 139 → 113 modules, `@plitzi/nexus` 53 → 31). What moved, each
37
+ rewritten by `plitzi upgrade migrations --write` (`movedExports`):
38
+ - the dates — `formatDate`, `formatDateUTC`, `formatFromNow`, `formatUTCToLocal`, `getDurationMs`, `isDate`,
39
+ `isValidFormat`, `parseDate`, `toUnixSeconds`, `SupportedLocale` — from `@plitzi/sdk-shared/helpers` to
40
+ `@plitzi/sdk-shared/dates`;
41
+ - React's bindings to an entry of their own beside each area, as `@plitzi/nexus/react` is: `useDisplayMode`,
42
+ `useElementSize` → `@plitzi/sdk-shared/style/react`; `SchemaContext` → `schema/react`; `PluginsContext` →
43
+ `plugins/react`; `DevToolsContext` → `devTools/react`; `useFlagResolution` → `flags/react` (`flagUserFrom` stays
44
+ in `flags`);
45
+ - `PROJECT_DATA_PREFIX` from `@plitzi/sdk-shared/server` to `@plitzi/sdk-shared/project/paths` — the project's
46
+ layout names, an entry a browser imports too (`@plitzi/sdk-shared/project` stays Node only and re-exports them).
47
+ The theme cookie's helpers (`themeFromCookies`…) are also `@plitzi/sdk-shared/theme/cookie`, still exported by
48
+ `@plitzi/sdk-shared/theme`.
49
+
50
+ `yarn check:server-footprint` (in CI after the build) holds what the server's root loads, package by package — Plitzi's
51
+ and every other — to a budget: a heavy library or a folder of hooks coming back fails with what came in.
52
+
53
+ ## CLI
54
+ - **`plitzi upgrade migrations --write` writes a file import's new home when it has one** (`@plitzi/cli`): the
55
+ `folderImports` migration of 0.38.17 named every import of a package's FILE and wrote none. It now reads the installed
56
+ declarations with the project's own TypeScript and rewrites each `import` / `export … from` whose every name the folder
57
+ exports under one name — `import usePlitzi from '@plitzi/sdk-shared/hooks/usePlitzi'` →
58
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`, `type` modifiers and aliases kept. What has no one answer is
59
+ said with why (a namespace import, an `import()` or mock, a name the folder does not export, a project with no
60
+ TypeScript). The report says which places `--write` writes (`writable` in `--json`) instead of calling every one
61
+ "yours to change"; a migration now gives each place its own `edit` in place of a whole-file `rewrite`
62
+ (`docs/en/releases.md`).
63
+ - **`plitzi doctor` says an import of a path the installed package does not export** (`@plitzi/cli`):
64
+ `import-not-exported`, an error, at the importing file — what Node otherwise reports at start as an
65
+ `ERR_MODULE_NOT_FOUND` into the package's `dist`, which reads as a broken install rather than a changed API. For a
66
+ `@plitzi` package the fix names `plitzi upgrade migrations --write`; for any other, its `exports`. Asked only of a
67
+ package that is installed.
68
+
69
+ - Updated dependencies [b3023c9]
70
+ - @plitzi/plitzi-sdk@0.38.18
71
+ - @plitzi/sdk-server@0.38.18
72
+ - @plitzi/sdk-authoring@0.38.18
73
+ - @plitzi/sdk-schema@0.38.18
74
+ - @plitzi/sdk-shared@0.38.18
75
+ - @plitzi/sdk-style@0.38.18
76
+
77
+ ## 0.38.17
78
+
79
+ ### Patch Changes
80
+
81
+ - 4f8dc37: ## Packages
82
+
83
+ - **A library package is imported by its root and its folders, never by a file** (`@plitzi/sdk-shared`, `sdk-schema`,
84
+ `sdk-style`, `sdk-elements`, `sdk-interactions`, `sdk-auth`, `sdk-dev-tools`, `sdk-event-bridge`, `sdk-navigation`,
85
+ `sdk-plugins`, `sdk-variables`): each `exports` is now `"."` and `"./*"`, the latter a folder's `index`.
86
+ `@plitzi/sdk-shared/helpers/isRecord` becomes `import { isRecord } from '@plitzi/sdk-shared/helpers'`, and a default
87
+ export by the name its folder gives it — almost always its file's (`import usePlitzi from '…/hooks/usePlitzi'` →
88
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`). A file-level specifier now fails with `ERR_MODULE_NOT_FOUND`.
89
+ New entries where a folder barrel would have brought more than was asked for: `@plitzi/sdk-shared/project` and
90
+ `@plitzi/sdk-shared/plugins/bundle` (Node only), `@plitzi/sdk-interactions/declarations` (the global callbacks and
91
+ utility specs, without React), and `@plitzi/sdk-elements/elements/declarations`, which now also carries the
92
+ declarations' attribute types and the constants they are checked with. `RuleGroup` is exported by `@plitzi/sdk-shared`
93
+ with the document types that use it. `plitzi upgrade migrations` names every such import in a project, with the folder to
94
+ import it from instead.
95
+ - **`@plitzi/sdk-shared`'s root exports the document types, and only them** (`@plitzi/sdk-shared`): what the package
96
+ does is imported from its folder — `formatDate` from `@plitzi/sdk-shared/helpers`, `ThemeProvider` from
97
+ `@plitzi/sdk-shared/theme`, a GraphQL operation's types from `@plitzi/sdk-shared/network/graphql` — so a module that
98
+ imports a type from the root no longer loads every area of the package.
99
+ - **What one package alone used lives in that package** (`@plitzi/sdk-shared`, `@plitzi/sdk-elements`): the data
100
+ source hooks moved from `@plitzi/sdk-shared/dataSource/hooks` to `@plitzi/sdk-elements/dataSource`
101
+ (`useRegisterSource`, `useResolvedVariables`), and the Apollo links the builder's client is built with into the
102
+ builder.
103
+ - **The builder's panels are an entry of their own** (`@plitzi/sdk-style`, `@plitzi/sdk-variables`,
104
+ `@plitzi/sdk-elements`): the style inspector, the advanced style editor and `BuilderStyleContextProvider` are imported
105
+ from `@plitzi/sdk-style/builder`; the variables' lists and forms from `@plitzi/sdk-variables/builder`; the elements'
106
+ settings panels (`defaultElementsSettings`) from `@plitzi/sdk-elements/builder`. Each package's root keeps what a page
107
+ and a server use — `generateCache` no longer loads the inspector, on a server 227 modules down to 21.
108
+
109
+ ## CLI
110
+ - **`plitzi upgrade`'s `renames` part is now `migrations`** (`@plitzi/cli`): what a version changed that a project's
111
+ own source must follow, one file per change in the CLI's `src/migrations/changes/` with the version it shipped in —
112
+ rewritten with `--write` when it has one right answer, said otherwise. The `--json` report carries `migrations` (each
113
+ with its `migration`, `since`, `file`, `line`, `what` and whether it was `written`) in place of `renames` and
114
+ `changes`. The changes of 0.38.0 (`canTemplate` → `canSnippet`, the `*Template` authoring names), 0.38.9 (a
115
+ `formControl` without `required` is optional) and 0.38.12 (`usePlitziServiceContext` → `usePlitzi`) are no longer
116
+ looked for: a project still on one of those versions makes them by hand.
117
+
118
+ - Updated dependencies [4f8dc37]
119
+ - @plitzi/plitzi-sdk@0.38.17
120
+ - @plitzi/sdk-server@0.38.17
121
+ - @plitzi/sdk-authoring@0.38.17
122
+ - @plitzi/sdk-schema@0.38.17
123
+ - @plitzi/sdk-shared@0.38.17
124
+ - @plitzi/sdk-style@0.38.17
125
+
3
126
  ## 0.38.16
4
127
 
5
128
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { isRecord } from '@plitzi/sdk-shared/helpers/isRecord';
1
+ import { isRecord } from '@plitzi/sdk-shared/helpers';
2
2
  /** What the host has streamed of the tool call so far, reduced to the little a placeholder can honestly show.
3
3
  *
4
4
  * The wait a user sees is almost entirely the model TYPING this batch — the server render takes milliseconds —
@@ -1,4 +1,4 @@
1
- import { componentNamed, instancesOf } from "@plitzi/sdk-schema/helpers/components";
1
+ import { componentNamed, instancesOf } from "@plitzi/sdk-schema";
2
2
  //#region src/modules/mcp/helpers/components.ts
3
3
  /** A component by the name it is placed by, unless a page or a layout answers to it first. */
4
4
  var findComponentByRef = (schema, ref) => Object.hasOwn(schema.flat, ref) ? void 0 : componentNamed(schema, ref);
@@ -1,6 +1,5 @@
1
1
  import { AIBinding, AIBindings, AIInteractionFlow, AIInteractionNodeType } from '../types';
2
- import { RuleGroup } from '@plitzi/plitzi-ui/QueryBuilder';
3
- import { ElementBinding, ElementDefinition, ElementInteraction, WhileRunning } from '@plitzi/sdk-shared';
2
+ import { ElementBinding, ElementDefinition, ElementInteraction, RuleGroup, WhileRunning } from '@plitzi/sdk-shared';
4
3
  /** The node shape agents supply on write: same as AIInteractionNode but `id` is optional (generated when
5
4
  * omitted). Kept structural so the tool-layer zod type assigns to it without importing the tool layer here. */
6
5
  export interface FlowNodeInput {
@@ -1,4 +1,4 @@
1
- import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
1
+ import { descendants } from "@plitzi/sdk-schema";
2
2
  //#region src/modules/mcp/helpers/space.ts
3
3
  var cloneSpace = (space) => ({
4
4
  schema: structuredClone(space.schema),
@@ -1,6 +1,6 @@
1
1
  import { elementCatalog } from "../catalogs/index.js";
2
2
  import { envelope, jsonContents } from "./envelope.js";
3
- import { STYLE_STATES } from "@plitzi/sdk-shared/style/styleStates";
3
+ import { STYLE_STATES } from "@plitzi/sdk-shared/style";
4
4
  //#region src/modules/mcp/resources/renderGuide.ts
5
5
  var RENDER_GUIDE_URI = "plitzi://render/guide";
6
6
  var RENDER_TYPES_URI = "plitzi://render/types";
@@ -4,7 +4,7 @@ import { afterPrefix, componentsUri, dataSourcesUri, elementUri, flagsUri, folde
4
4
  import { buildDataSourceCatalog, buildInteractionCatalog } from "../catalogs/observed.js";
5
5
  import { envelope } from "./envelope.js";
6
6
  import { elementView, folderRefToAI, foldersToAI, layoutSummariesToAI, pageSkeletonToAI, pageStylesToAI, pageSummariesToAI, schemaVariablesToAI, settingsToAI } from "../tools/operations/schema/translator.js";
7
- import { treeOf } from "@plitzi/sdk-schema/helpers/components";
7
+ import { treeOf } from "@plitzi/sdk-schema";
8
8
  //#region src/modules/mcp/resources/schema.ts
9
9
  /** Element-schema reads: page listings/skeletons/styles, folders, single elements and schema variables. Returns
10
10
  * undefined when the URI belongs to another domain, null when the shape is ours but the ref does not resolve. */
@@ -73,7 +73,7 @@ var createMcpServer = async ({ adapters, getGrant, preview, screenshot, logger,
73
73
  const getSpace = () => spacePromise ??= loadSpace();
74
74
  const server = new McpServer({
75
75
  name: "plitzi-mcp",
76
- version: "0.38.16"
76
+ version: "0.38.18"
77
77
  }, { instructions: hasSpace ? serverInstructions : widgetsOnlyInstructions });
78
78
  const { getChanges } = adapters;
79
79
  registerResources(server, getSpace, MCP_ENV, log, hasSpace, getChanges ? (query) => getChanges(requireSpaceId(), MCP_ENV, query) : void 0);
@@ -7,7 +7,7 @@ import { effectsOf } from "../shared/effects.js";
7
7
  import { fullPage, lookAt, pageRef, viewport } from "../shared/look.js";
8
8
  import { AGAIN, REPEATED, batchKey, forgetRefused, noteRefused, timesRefused } from "../shared/repeats.js";
9
9
  import { z } from "zod";
10
- import { generateCache } from "@plitzi/sdk-style/StyleHelper";
10
+ import { generateCache } from "@plitzi/sdk-style";
11
11
  //#region src/modules/mcp/tools/apply/index.ts
12
12
  var applyShape = {
13
13
  environment,
@@ -2,8 +2,8 @@ import { pageUri } from "../../../../helpers/uris.js";
2
2
  import { empty } from "../../../../helpers/opResult.js";
3
3
  import { bindingCategory, bindingInput } from "../shared.js";
4
4
  import { resolveElement } from "../write.js";
5
+ import { positionalElementId } from "@plitzi/sdk-schema";
5
6
  import { z } from "zod";
6
- import { positionalElementId } from "@plitzi/sdk-schema/helpers/elementId";
7
7
  //#region src/modules/mcp/tools/operations/schema/bindings/upsertBinding.ts
8
8
  var upsertBindingOp = z.object({
9
9
  type: z.literal("upsertBinding"),
@@ -1,6 +1,6 @@
1
1
  import { componentsUri } from "../../../../helpers/uris.js";
2
2
  import { empty, fail } from "../../../../helpers/opResult.js";
3
- import { componentNamed, instancesOf, removeComponent } from "@plitzi/sdk-schema/helpers/components";
3
+ import { componentNamed, instancesOf, removeComponent } from "@plitzi/sdk-schema";
4
4
  import { z } from "zod";
5
5
  //#region src/modules/mcp/tools/operations/schema/components/deleteComponent.ts
6
6
  var deleteComponentOp = z.object({
@@ -2,10 +2,8 @@ import { invalidateIndex } from "../../../../helpers/space.js";
2
2
  import { componentsUri, pageUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
4
  import { ID_REF_HINT, guardNewRef } from "../write.js";
5
- import { addComponent, componentNamed, propNameProblem, treeOf, updateComponent } from "@plitzi/sdk-schema/helpers/components";
6
- import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
5
+ import { addComponent, componentNamed, descendants, isValidElementId, propNameProblem, treeOf, updateComponent } from "@plitzi/sdk-schema";
7
6
  import { z } from "zod";
8
- import { isValidElementId } from "@plitzi/sdk-schema/helpers/elementId";
9
7
  //#region src/modules/mcp/tools/operations/schema/components/upsertComponent.ts
10
8
  /**
11
9
  * A prop as a component declares it. Checked when the op runs rather than spelled out in the op's schema: the op union
@@ -1,9 +1,8 @@
1
1
  import { findRootByRef, indexRemoveElements, resolveRef } from "../../../../helpers/space.js";
2
2
  import { pageUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
- import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
4
+ import { FlatMap, descendants } from "@plitzi/sdk-schema";
5
5
  import { z } from "zod";
6
- import FlatMap from "@plitzi/sdk-schema/helpers/FlatMap";
7
6
  //#region src/modules/mcp/tools/operations/schema/elements/deleteElement.ts
8
7
  var deleteElementOp = z.object({
9
8
  type: z.literal("deleteElement"),
@@ -3,8 +3,8 @@ import { pageUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
4
  import { position } from "../shared.js";
5
5
  import { DROP_POSITION } from "../write.js";
6
+ import { FlatMap } from "@plitzi/sdk-schema";
6
7
  import { z } from "zod";
7
- import FlatMap from "@plitzi/sdk-schema/helpers/FlatMap";
8
8
  //#region src/modules/mcp/tools/operations/schema/elements/moveElement.ts
9
9
  var moveElementOp = z.object({
10
10
  type: z.literal("moveElement"),
@@ -3,10 +3,10 @@ import { pageUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
4
  import { elementAnchor, elementFlag, elementMotion, elementQuiet, elementRuntime, initialStateInput, styleRefs } from "../shared.js";
5
5
  import { guardNewRef, writeInitialState } from "../write.js";
6
+ import { repointIds } from "@plitzi/sdk-schema";
6
7
  import { flagGateOf } from "@plitzi/sdk-authoring";
7
8
  import { z } from "zod";
8
- import { isMotion } from "@plitzi/sdk-shared/schema/motion";
9
- import { repointIds } from "@plitzi/sdk-schema/helpers/elementId";
9
+ import { isMotion } from "@plitzi/sdk-shared/schema";
10
10
  //#region src/modules/mcp/tools/operations/schema/elements/patchElement.ts
11
11
  var patchElementOp = z.object({
12
12
  type: z.literal("patchElement"),
@@ -5,7 +5,7 @@ import { elementInput, position } from "../shared.js";
5
5
  import { DROP_POSITION, collectInputRefs, createElement, guardNewRef, writeInitialState } from "../write.js";
6
6
  import { flagGateOf } from "@plitzi/sdk-authoring";
7
7
  import { z } from "zod";
8
- import { isMotion } from "@plitzi/sdk-shared/schema/motion";
8
+ import { isMotion } from "@plitzi/sdk-shared/schema";
9
9
  //#region src/modules/mcp/tools/operations/schema/elements/upsertElement.ts
10
10
  var upsertElementOp = z.object({
11
11
  type: z.literal("upsertElement"),
@@ -1,7 +1,7 @@
1
1
  import { findLayoutByRef, indexRemoveLayout, pagesUsingLayout } from "../../../../helpers/space.js";
2
2
  import { layoutsUri, pageUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
- import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
4
+ import { descendants } from "@plitzi/sdk-schema";
5
5
  import { z } from "zod";
6
6
  //#region src/modules/mcp/tools/operations/schema/pages/deleteLayout.ts
7
7
  var deleteLayoutOp = z.object({
@@ -1,7 +1,7 @@
1
1
  import { findPageByRef, indexRemovePage } from "../../../../helpers/space.js";
2
2
  import { pageUri, pagesUri } from "../../../../helpers/uris.js";
3
3
  import { empty, fail } from "../../../../helpers/opResult.js";
4
- import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
4
+ import { descendants } from "@plitzi/sdk-schema";
5
5
  import { z } from "zod";
6
6
  //#region src/modules/mcp/tools/operations/schema/pages/deletePage.ts
7
7
  var deletePageOp = z.object({
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { RuleGroup } from '@plitzi/plitzi-ui/QueryBuilder';
3
- import { ElementRuntime } from '@plitzi/sdk-shared';
2
+ import { ElementRuntime, RuleGroup } from '@plitzi/sdk-shared';
4
3
  export declare const ruleGroup: z.ZodType<RuleGroup>;
5
4
  export interface InitialStateInput {
6
5
  styleVariant?: Record<string, Record<string, string | string[]>>;
@@ -2,9 +2,8 @@ import { closedObject } from "../closed.js";
2
2
  import { isSuggestionCode } from "@plitzi/sdk-authoring";
3
3
  import { z } from "zod";
4
4
  import { FLAG_GATE_PATTERN } from "@plitzi/sdk-shared/flags";
5
- import { ANCHOR_PATTERN } from "@plitzi/sdk-shared/schema/anchor";
6
- import { motionProblems } from "@plitzi/sdk-shared/schema/motion";
7
- import { WHILE_RUNNING_MODES } from "@plitzi/sdk-shared/types/SchemaTypes";
5
+ import { ANCHOR_PATTERN, motionProblems } from "@plitzi/sdk-shared/schema";
6
+ import { WHILE_RUNNING_MODES } from "@plitzi/sdk-shared/types";
8
7
  //#region src/modules/mcp/tools/operations/schema/shared.ts
9
8
  var combinator = z.enum(["and", "or"]);
10
9
  var operator = z.enum([
@@ -2,7 +2,7 @@ import { computeVersion } from "../../../helpers/computeVersion.js";
2
2
  import { descendantCount, elementById, getLayoutElements, getPageElements, nameOf, orderedChildren, pageFoldersOf, pageRefOfElement, pagesUsingLayout, slugRouteParams, spaceIndex, strOr } from "../../../helpers/space.js";
3
3
  import { bindingsToAI, flowsFromInteractions } from "../../../helpers/interactions.js";
4
4
  import { definitionToAI, globalStylesForType, idStyleToAI } from "../style/translator.js";
5
- import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
5
+ import { descendants } from "@plitzi/sdk-schema";
6
6
  import { flagSpecOf, isDocumentScroll, splitNotificationsCss } from "@plitzi/sdk-authoring";
7
7
  //#region src/modules/mcp/tools/operations/schema/translator.ts
8
8
  var splitClasses = (value) => value ? value.split(/\s+/).filter(Boolean) : [];
@@ -1,11 +1,9 @@
1
1
  import { findRootByRef, indexAddElement, resolveRef } from "../../../helpers/space.js";
2
2
  import { folderUri, foldersUri, layoutsUri, pageUri, pagesUri, schemaVarsUri, settingsUri } from "../../../helpers/uris.js";
3
3
  import { fail } from "../../../helpers/opResult.js";
4
- import { documentIds } from "@plitzi/sdk-schema/helpers/components";
4
+ import { FlatMap, documentIds, elementIdConflict, isValidElementId } from "@plitzi/sdk-schema";
5
5
  import { flagGateOf } from "@plitzi/sdk-authoring";
6
- import { isMotion } from "@plitzi/sdk-shared/schema/motion";
7
- import { elementIdConflict, isValidElementId } from "@plitzi/sdk-schema/helpers/elementId";
8
- import FlatMap from "@plitzi/sdk-schema/helpers/FlatMap";
6
+ import { isMotion } from "@plitzi/sdk-shared/schema";
9
7
  //#region src/modules/mcp/tools/operations/schema/write.ts
10
8
  var ID_REF_HINT = "Start with a letter, then letters, numbers, hyphens and underscores (e.g. \"hero-cta\" or \"food_item\"). The name IS the element id, which the runtime embeds in source names like `apiContainer_<id>.field` and in interaction targets — a dot would split those paths (an underscore is fine: the FIRST `_` separates the type from the id, and element types carry none, so extra underscores are unambiguous).";
11
9
  var TAKEN_HINT = "A name must be unique across the space — pick a different one, or address the existing element by this name.";
@@ -1,7 +1,6 @@
1
1
  import { expandShorthand } from "../../../catalogs/index.js";
2
2
  import { fail } from "../../../helpers/opResult.js";
3
- import { STYLE_MOTION_CONDITIONS, canonicalCondition } from "@plitzi/sdk-shared/style/styleConditions";
4
- import { CONTENT_PSEUDOS, GENERATED_PSEUDOS, PSEUDO_PROPERTIES, STYLE_PSEUDOS, isContentValue, isStylePseudo, pseudoHonours } from "@plitzi/sdk-shared/style/stylePseudos";
3
+ import { CONTENT_PSEUDOS, GENERATED_PSEUDOS, PSEUDO_PROPERTIES, STYLE_MOTION_CONDITIONS, STYLE_PSEUDOS, canonicalCondition, isContentValue, isStylePseudo, pseudoHonours } from "@plitzi/sdk-shared/style";
5
4
  //#region src/modules/mcp/tools/operations/style/validate.ts
6
5
  var MODES = [
7
6
  "desktop",
@@ -2,9 +2,8 @@ import { defUri, defsUri, globalUri, globalsUri, idUri, idsUri, styleVarUri, sty
2
2
  import { expandShorthand, expandShorthandPatch } from "../../../catalogs/index.js";
3
3
  import { fail } from "../../../helpers/opResult.js";
4
4
  import { styleInputProblem } from "./validate.js";
5
- import { canonicalCondition } from "@plitzi/sdk-shared/style/styleConditions";
6
- import { isStylePseudo } from "@plitzi/sdk-shared/style/stylePseudos";
7
- import processSelector from "@plitzi/sdk-style/helpers/processSelector";
5
+ import { canonicalCondition, isStylePseudo } from "@plitzi/sdk-shared/style";
6
+ import { processSelector } from "@plitzi/sdk-style/helpers";
8
7
  //#region src/modules/mcp/tools/operations/style/write.ts
9
8
  var MODES = [
10
9
  "desktop",
@@ -3,7 +3,7 @@ import { proxifyResources } from "../proxy/rewrite.js";
3
3
  import { documentOperations } from "./operations/index.js";
4
4
  import { draftBatch } from "./shared/draftBatch.js";
5
5
  import { interactionReport } from "./shared/interactionReport.js";
6
- import { generateCache } from "@plitzi/sdk-style/StyleHelper";
6
+ import { generateCache } from "@plitzi/sdk-style";
7
7
  //#region src/modules/mcp/tools/renderWidget.ts
8
8
  /**
9
9
  * A widget built from an agent's operations, with no space and no backend: the engine behind `plitzi_render`, apart
@@ -1,5 +1,4 @@
1
- import { canonicalJson } from "@plitzi/sdk-shared/helpers/canonicalJson";
2
- import { isRecord } from "@plitzi/sdk-shared/helpers/isRecord";
1
+ import { canonicalJson, isRecord } from "@plitzi/sdk-shared/helpers";
3
2
  //#region src/modules/mcp/tools/shared/effects.ts
4
3
  /**
5
4
  * What a write did to the space, read off the documents before and after it — never off what was asked. An agent
@@ -1,7 +1,6 @@
1
1
  import { findElementByRef, findPageByRef } from "../../helpers/space.js";
2
+ import { styleWithoutTag, validateSchema } from "@plitzi/sdk-schema";
2
3
  import { authoringCodeEntry, elementSourceTypes, fixSpace, lintSpace } from "@plitzi/sdk-authoring";
3
- import { validateSchema } from "@plitzi/sdk-schema/helpers/schemaValidator";
4
- import { styleWithoutTag } from "@plitzi/sdk-schema/helpers/styleWithoutTag";
5
4
  //#region src/modules/mcp/tools/shared/lintDraft.ts
6
5
  /** The elements a batch touches, by the ref each op names — what the lint of the result is held to. */
7
6
  var touchedRefs = (ops) => {
@@ -11,9 +11,8 @@ import { checkSlotCss } from "./css.js";
11
11
  import { checkRef } from "./refs.js";
12
12
  import { checkElementInput, checkRawMarkup, checkTypeProps, checkVariantApplication } from "./elements.js";
13
13
  import { checkInteractionNode } from "./interactions.js";
14
- import { treeOf } from "@plitzi/sdk-schema/helpers/components";
14
+ import { isValidElementId, treeOf } from "@plitzi/sdk-schema";
15
15
  import { closest } from "@plitzi/sdk-authoring";
16
- import { isValidElementId } from "@plitzi/sdk-schema/helpers/elementId";
17
16
  //#region src/modules/mcp/tools/shared/validator/index.ts
18
17
  var STYLE_CATEGORIES = [
19
18
  "color",
@@ -1,4 +1,4 @@
1
- import { isValidElementId } from "@plitzi/sdk-schema/helpers/elementId";
1
+ import { isValidElementId } from "@plitzi/sdk-schema";
2
2
  //#region src/modules/mcp/tools/shared/validator/refs.ts
3
3
  var REF_RE = /^[a-zA-Z0-9._-]+$/;
4
4
  var checkRef = (ref, path, ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-mcp",
3
- "version": "0.38.16",
3
+ "version": "0.38.18",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -11,16 +11,19 @@
11
11
  "types": "dist/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
+ "@plitzi/source": "./src/index.ts",
14
15
  "types": "./dist/index.d.ts",
15
16
  "import": "./dist/index.js",
16
17
  "default": "./dist/index.js"
17
18
  },
18
19
  "./server": {
20
+ "@plitzi/source": "./src/server.ts",
19
21
  "types": "./dist/server.d.ts",
20
22
  "import": "./dist/server.js",
21
23
  "default": "./dist/server.js"
22
24
  },
23
25
  "./render": {
26
+ "@plitzi/source": "./src/render.ts",
24
27
  "types": "./dist/render.d.ts",
25
28
  "import": "./dist/render.js",
26
29
  "default": "./dist/render.js"
@@ -34,16 +37,16 @@
34
37
  "sideEffects": false,
35
38
  "dependencies": {
36
39
  "@modelcontextprotocol/ext-apps": "^1.7.5",
37
- "@modelcontextprotocol/sdk": "^1.32.0",
38
- "@plitzi/plitzi-sdk": "0.38.16",
39
- "@plitzi/sdk-authoring": "0.38.16",
40
- "@plitzi/sdk-schema": "0.38.16",
41
- "@plitzi/sdk-server": "0.38.16",
42
- "@plitzi/sdk-shared": "0.38.16",
43
- "@plitzi/sdk-style": "0.38.16",
44
- "ejs": "^6.0.1",
40
+ "@modelcontextprotocol/sdk": "^1.32.1",
41
+ "@plitzi/plitzi-sdk": "0.38.18",
42
+ "@plitzi/sdk-authoring": "0.38.18",
43
+ "@plitzi/sdk-schema": "0.38.18",
44
+ "@plitzi/sdk-server": "0.38.18",
45
+ "@plitzi/sdk-shared": "0.38.18",
46
+ "@plitzi/sdk-style": "0.38.18",
47
+ "ejs": "^7.0.1",
45
48
  "esbuild": "^0.28.2",
46
- "zod": "^4.6.5"
49
+ "zod": "^4.6.7"
47
50
  },
48
51
  "peerDependencies": {
49
52
  "react": "^19",
@@ -52,20 +55,20 @@
52
55
  "devDependencies": {
53
56
  "@types/ejs": "^3.1.5",
54
57
  "@types/jsdom": "^30.0.0",
55
- "@types/node": "^26.6.4",
58
+ "@types/node": "^26.6.5",
56
59
  "@types/react": "^19.3.0",
57
- "@vitejs/plugin-react": "^6.1.1",
58
- "@vitest/coverage-v8": "^5.0.3",
60
+ "@vitejs/plugin-react": "^6.1.2",
61
+ "@vitest/coverage-v8": "^5.0.5",
59
62
  "eslint": "^9.39.5",
60
63
  "eslint-plugin-import": "^2.32.0",
61
- "jsdom": "^30.1.1",
62
- "react": "^19.3.0",
63
- "react-dom": "^19.3.0",
64
+ "jsdom": "^30.1.3",
65
+ "react": "^19.3.1",
66
+ "react-dom": "^19.3.1",
64
67
  "tsx": "^4.23.15",
65
68
  "typescript": "^6.0.3",
66
- "vite": "^8.3.2",
69
+ "vite": "^8.3.4",
67
70
  "vite-plugin-dts": "^5.1.2",
68
- "vitest": "^5.0.3"
71
+ "vitest": "^5.0.5"
69
72
  },
70
73
  "scripts": {
71
74
  "start": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx dev/main.ts",