@plitzi/sdk-mcp 0.39.0 → 0.39.2
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/CHANGELOG.md +29 -0
- package/README.md +5 -1
- package/dist/createServer.d.ts +3 -2
- package/dist/createServer.js +3 -13
- package/dist/index.js +8 -8
- package/dist/modules/mcp/accessibilityOutline.js +1 -2
- package/dist/modules/mcp/apps/index.js +3 -4
- package/dist/modules/mcp/apps/render/index.js +3 -7
- package/dist/modules/mcp/apps/render/styles.js +2 -3
- package/dist/modules/mcp/apps/shared/assets.d.ts +6 -0
- package/dist/modules/mcp/apps/shared/assets.js +15 -4
- package/dist/modules/mcp/apps/shared/bundle.js +3 -4
- package/dist/modules/mcp/apps/shared/index.d.ts +1 -1
- package/dist/modules/mcp/apps/shared/page.js +3 -5
- package/dist/modules/mcp/apps/shared/registerApp.js +1 -2
- package/dist/modules/mcp/apps/shared/resolve.js +1 -2
- package/dist/modules/mcp/apps/shared/zodEnglishOnly.js +1 -2
- package/dist/modules/mcp/catalogs/observed.js +1 -2
- package/dist/modules/mcp/catalogs/pluginCatalog.d.ts +1 -1
- package/dist/modules/mcp/catalogs/pluginCatalog.js +1 -2
- package/dist/modules/mcp/catalogs/registry.d.ts +2 -1
- package/dist/modules/mcp/catalogs/registry.js +1 -2
- package/dist/modules/mcp/handler.d.ts +1 -1
- package/dist/modules/mcp/handler.js +1 -2
- package/dist/modules/mcp/helpers/callToolResult.js +1 -2
- package/dist/modules/mcp/helpers/components.js +1 -2
- package/dist/modules/mcp/helpers/computeVersion.js +1 -2
- package/dist/modules/mcp/helpers/guide/index.js +1 -2
- package/dist/modules/mcp/helpers/guide/instructions.js +1 -2
- package/dist/modules/mcp/helpers/guide/logic.js +1 -2
- package/dist/modules/mcp/helpers/guide/practice.js +5 -5
- package/dist/modules/mcp/helpers/guide/reference.d.ts +1 -1
- package/dist/modules/mcp/helpers/guide/reference.js +3 -3
- package/dist/modules/mcp/helpers/guide/server.d.ts +1 -1
- package/dist/modules/mcp/helpers/guide/server.js +3 -4
- package/dist/modules/mcp/helpers/guide/structure.d.ts +1 -1
- package/dist/modules/mcp/helpers/guide/structure.js +3 -2
- package/dist/modules/mcp/helpers/guide/styling.js +1 -2
- package/dist/modules/mcp/helpers/guide/values.js +1 -2
- package/dist/modules/mcp/helpers/interactions.js +1 -2
- package/dist/modules/mcp/helpers/log.d.ts +1 -1
- package/dist/modules/mcp/helpers/log.js +2 -3
- package/dist/modules/mcp/helpers/opResult.js +1 -2
- package/dist/modules/mcp/helpers/space.d.ts +2 -1
- package/dist/modules/mcp/helpers/space.js +1 -2
- package/dist/modules/mcp/helpers/uris.js +1 -2
- package/dist/modules/mcp/localScreenshotClient.js +9 -6
- package/dist/modules/mcp/previewClient.js +1 -2
- package/dist/modules/mcp/proxy/config.d.ts +1 -1
- package/dist/modules/mcp/proxy/config.js +2 -3
- package/dist/modules/mcp/proxy/fetch.js +1 -2
- package/dist/modules/mcp/proxy/grant.js +1 -2
- package/dist/modules/mcp/proxy/guard.js +2 -3
- package/dist/modules/mcp/proxy/handler.d.ts +1 -1
- package/dist/modules/mcp/proxy/handler.js +2 -3
- package/dist/modules/mcp/proxy/payload.js +1 -2
- package/dist/modules/mcp/proxy/rewrite.js +1 -2
- package/dist/modules/mcp/proxy/sign.js +1 -2
- package/dist/modules/mcp/proxy/types.js +1 -2
- package/dist/modules/mcp/resources/actions.js +2 -3
- package/dist/modules/mcp/resources/canonical.js +1 -2
- package/dist/modules/mcp/resources/connectors.js +2 -3
- package/dist/modules/mcp/resources/core.js +4 -5
- package/dist/modules/mcp/resources/data.js +1 -2
- package/dist/modules/mcp/resources/envelope.js +1 -2
- package/dist/modules/mcp/resources/explain.js +1 -2
- package/dist/modules/mcp/resources/functions.js +1 -2
- package/dist/modules/mcp/resources/primer.js +7 -8
- package/dist/modules/mcp/resources/register.d.ts +1 -1
- package/dist/modules/mcp/resources/register.js +6 -7
- package/dist/modules/mcp/resources/renderGuide.js +2 -3
- package/dist/modules/mcp/resources/router.js +3 -4
- package/dist/modules/mcp/resources/schema.js +3 -4
- package/dist/modules/mcp/resources/style.js +2 -3
- package/dist/modules/mcp/screenshotClient.js +6 -5
- package/dist/modules/mcp/server.d.ts +1 -1
- package/dist/modules/mcp/server.js +4 -5
- package/dist/modules/mcp/tools/activity.js +1 -2
- package/dist/modules/mcp/tools/apply/dispatch.js +4 -5
- package/dist/modules/mcp/tools/apply/index.d.ts +5 -0
- package/dist/modules/mcp/tools/apply/index.js +3 -4
- package/dist/modules/mcp/tools/apply/writeResult.js +1 -2
- package/dist/modules/mcp/tools/describeOperation.js +2 -3
- package/dist/modules/mcp/tools/index.js +1 -2
- package/dist/modules/mcp/tools/intents.js +3 -4
- package/dist/modules/mcp/tools/look.js +2 -3
- package/dist/modules/mcp/tools/operations/actions/deleteAction.js +2 -3
- package/dist/modules/mcp/tools/operations/actions/document.d.ts +2 -0
- package/dist/modules/mcp/tools/operations/actions/document.js +4 -3
- package/dist/modules/mcp/tools/operations/actions/index.d.ts +4 -0
- package/dist/modules/mcp/tools/operations/actions/index.js +1 -2
- package/dist/modules/mcp/tools/operations/actions/patchAction.d.ts +2 -0
- package/dist/modules/mcp/tools/operations/actions/patchAction.js +3 -4
- package/dist/modules/mcp/tools/operations/actions/upsertAction.d.ts +2 -0
- package/dist/modules/mcp/tools/operations/actions/upsertAction.js +3 -4
- package/dist/modules/mcp/tools/operations/closed.js +1 -2
- package/dist/modules/mcp/tools/operations/connectors/deleteConnector.js +2 -3
- package/dist/modules/mcp/tools/operations/connectors/index.js +1 -2
- package/dist/modules/mcp/tools/operations/connectors/manifest.js +1 -2
- package/dist/modules/mcp/tools/operations/connectors/patchConnector.js +3 -4
- package/dist/modules/mcp/tools/operations/connectors/upsertConnector.js +3 -4
- package/dist/modules/mcp/tools/operations/data/index.js +1 -2
- package/dist/modules/mcp/tools/operations/functions/index.js +2 -3
- package/dist/modules/mcp/tools/operations/index.d.ts +12 -0
- package/dist/modules/mcp/tools/operations/index.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/components/deleteComponent.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/components/upsertComponent.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +3 -4
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +3 -4
- package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +3 -4
- package/dist/modules/mcp/tools/operations/schema/flags/deleteFlag.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/flags/upsertFlag.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/operations.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/schema/operations.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/pages/deleteLayout.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/pages/upsertLayout.js +3 -4
- package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +3 -4
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +3 -3
- package/dist/modules/mcp/tools/operations/schema/shared.js +1 -2
- package/dist/modules/mcp/tools/operations/schema/translator.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +2 -3
- package/dist/modules/mcp/tools/operations/schema/write.js +3 -4
- package/dist/modules/mcp/tools/operations/schemaIds.js +1 -2
- package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +1 -2
- package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +2 -3
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +1 -2
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.js +1 -2
- package/dist/modules/mcp/tools/operations/style/fonts/deleteFont.js +2 -3
- package/dist/modules/mcp/tools/operations/style/fonts/upsertFont.js +2 -3
- package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +1 -2
- package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +2 -3
- package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +1 -2
- package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +1 -2
- package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +2 -3
- package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +1 -2
- package/dist/modules/mcp/tools/operations/style/operations.js +1 -2
- package/dist/modules/mcp/tools/operations/style/shared.js +1 -2
- package/dist/modules/mcp/tools/operations/style/translator.js +1 -2
- package/dist/modules/mcp/tools/operations/style/validate.js +1 -2
- package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +2 -3
- package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +2 -3
- package/dist/modules/mcp/tools/operations/style/write.js +2 -3
- package/dist/modules/mcp/tools/read.js +2 -3
- package/dist/modules/mcp/tools/render.d.ts +1 -0
- package/dist/modules/mcp/tools/render.js +3 -4
- package/dist/modules/mcp/tools/renderWidget.d.ts +1 -0
- package/dist/modules/mcp/tools/renderWidget.js +2 -3
- package/dist/modules/mcp/tools/search.js +2 -3
- package/dist/modules/mcp/tools/shared/draftBatch.js +2 -3
- package/dist/modules/mcp/tools/shared/effects.js +1 -2
- package/dist/modules/mcp/tools/shared/expandOperations.js +1 -2
- package/dist/modules/mcp/tools/shared/interactionReport.js +1 -2
- package/dist/modules/mcp/tools/shared/lintDraft.js +1 -2
- package/dist/modules/mcp/tools/shared/look.js +1 -2
- package/dist/modules/mcp/tools/shared/newSuggestions.js +1 -2
- package/dist/modules/mcp/tools/shared/normalizeOperations.js +1 -2
- package/dist/modules/mcp/tools/shared/repeats.js +1 -2
- package/dist/modules/mcp/tools/shared/tool.js +1 -2
- package/dist/modules/mcp/tools/shared/validator/batch.js +1 -2
- package/dist/modules/mcp/tools/shared/validator/bindings.js +1 -2
- package/dist/modules/mcp/tools/shared/validator/connectors.js +2 -3
- package/dist/modules/mcp/tools/shared/validator/context.js +1 -2
- package/dist/modules/mcp/tools/shared/validator/css.js +2 -3
- package/dist/modules/mcp/tools/shared/validator/elements.js +2 -3
- package/dist/modules/mcp/tools/shared/validator/index.js +20 -10
- package/dist/modules/mcp/tools/shared/validator/interactions.js +2 -3
- package/dist/modules/mcp/tools/shared/validator/refs.js +1 -2
- package/dist/modules/mcp/tools/test.js +1 -2
- package/dist/modules/mcp/tools/tryFunction.js +1 -2
- package/dist/modules/mcp/types/aiSchema.d.ts +2 -0
- package/dist/modules/mcp/types/screenshotTypes.d.ts +8 -0
- package/dist/options.d.ts +1 -1
- package/dist/pipeline.d.ts +2 -1
- package/dist/pipeline.js +4 -3
- package/dist/preview/createPreview.d.ts +1 -1
- package/dist/preview/createPreview.js +1 -2
- package/dist/preview.d.ts +7 -0
- package/dist/preview.js +1 -0
- package/dist/render.js +1 -1
- package/dist/server.js +3 -3
- package/dist/stages/mcp.d.ts +1 -1
- package/dist/stages/mcp.js +2 -3
- package/dist/stages/preview.d.ts +2 -1
- package/dist/stages/preview.js +3 -4
- package/dist/stages/proxy.d.ts +1 -1
- package/dist/stages/proxy.js +2 -3
- package/package.json +23 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @plitzi/sdk-mcp
|
|
2
2
|
|
|
3
|
+
## 0.39.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fad1264: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
8
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
9
|
+
- Updated dependencies [fad1264]
|
|
10
|
+
- @plitzi/plitzi-sdk@0.39.2
|
|
11
|
+
- @plitzi/sdk-server@0.39.2
|
|
12
|
+
- @plitzi/sdk-authoring@0.39.2
|
|
13
|
+
- @plitzi/sdk-kernel@0.39.2
|
|
14
|
+
- @plitzi/sdk-schema@0.39.2
|
|
15
|
+
- @plitzi/sdk-shared@0.39.2
|
|
16
|
+
- @plitzi/sdk-style@0.39.2
|
|
17
|
+
|
|
18
|
+
## 0.39.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- f174a61: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
23
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
24
|
+
- Updated dependencies [f174a61]
|
|
25
|
+
- @plitzi/plitzi-sdk@0.39.1
|
|
26
|
+
- @plitzi/sdk-server@0.39.1
|
|
27
|
+
- @plitzi/sdk-authoring@0.39.1
|
|
28
|
+
- @plitzi/sdk-schema@0.39.1
|
|
29
|
+
- @plitzi/sdk-shared@0.39.1
|
|
30
|
+
- @plitzi/sdk-style@0.39.1
|
|
31
|
+
|
|
3
32
|
## 0.39.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -55,11 +55,14 @@ draft-preview (off unless `preview.enabled`, then guarded by a shared secret). I
|
|
|
55
55
|
want only some:
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
|
-
import { previewStage } from '@plitzi/sdk-mcp';
|
|
58
|
+
import { previewStage } from '@plitzi/sdk-mcp/preview';
|
|
59
59
|
|
|
60
60
|
const server = createServer({ adapters, preview: { enabled: true, secret } }, { preAuth: [previewStage] });
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
`@plitzi/sdk-mcp/preview` is the endpoint alone: a page server mounting it loads what a preview needs — the
|
|
64
|
+
operations, their lint, the draft's render — with the first preview it is asked for, not when it starts.
|
|
65
|
+
|
|
63
66
|
## Adapters
|
|
64
67
|
|
|
65
68
|
The server is stateless: it resolves the space per request and reads and writes through adapters you supply.
|
|
@@ -233,6 +236,7 @@ MCP server, [self-hosting/07](../../examples/self-hosting/07-ssr-preview) is the
|
|
|
233
236
|
| `@plitzi/sdk-mcp/server` | The dedicated MCP server and its clients. What an MCP deployment wires. |
|
|
234
237
|
| `@plitzi/sdk-mcp` | Everything above plus the pipeline stages, `createPreview` and the tool engine. |
|
|
235
238
|
| `@plitzi/sdk-mcp/render` | `plitzi_render`'s widget render alone — no MCP server, no SSR, no OAuth — for a project's own agent. |
|
|
239
|
+
| `@plitzi/sdk-mcp/preview` | `previewStage` alone, for the page server that mounts it; the preview itself is loaded by the first one. |
|
|
236
240
|
|
|
237
241
|
The split is about weight, not taste: ESM re-exports load eagerly, so the barrel pulls the draft-preview path and
|
|
238
242
|
the renderer it reaches into. A `no-restricted-imports` rule and a test in `src/packageBoundary.test.ts` keep this
|
package/dist/createServer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { McpOptions } from './options';
|
|
2
|
-
import {
|
|
2
|
+
import { HttpServer } from '@plitzi/sdk-kernel/http';
|
|
3
|
+
import { SSRServerConfig } from '@plitzi/sdk-server';
|
|
3
4
|
/** The server this package makes: the lean MCP pipeline over the bare context — no render template, caches
|
|
4
5
|
* or plugin manager. `config` is the HTTP server's (port, TLS, health, logger, adapters); `options` is what MCP
|
|
5
6
|
* itself serves, and lives here rather than in that config because the server does not need to know. Pair it with
|
|
@@ -8,4 +9,4 @@ import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
|
|
|
8
9
|
*
|
|
9
10
|
* It owns its whole sub-domain, answering JSON-RPC on every path rather than under /mcp. To serve MCP alongside
|
|
10
11
|
* pages on one port instead, hand `mcpExtensions(options)` to createServer from `@plitzi/sdk-server`. */
|
|
11
|
-
export declare const createServer: (config: SSRServerConfig, options?: McpOptions) =>
|
|
12
|
+
export declare const createServer: (config: SSRServerConfig, options?: McpOptions) => HttpServer;
|
package/dist/createServer.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { buildMCPPipeline } from "./pipeline.js";
|
|
2
|
-
import { createHttpServer, makeHandler } from "@plitzi/sdk-
|
|
3
|
-
|
|
4
|
-
var noPlugins = {
|
|
5
|
-
register: () => void 0,
|
|
6
|
-
unregister: () => void 0,
|
|
7
|
-
invalidate: () => Promise.resolve()
|
|
8
|
-
};
|
|
2
|
+
import { createHttpServer, makeHandler } from "@plitzi/sdk-kernel/http";
|
|
3
|
+
// src/createServer.ts
|
|
9
4
|
/** The server this package makes: the lean MCP pipeline over the bare context — no render template, caches
|
|
10
5
|
* or plugin manager. `config` is the HTTP server's (port, TLS, health, logger, adapters); `options` is what MCP
|
|
11
6
|
* itself serves, and lives here rather than in that config because the server does not need to know. Pair it with
|
|
@@ -27,11 +22,6 @@ var createServer = (config, options = {}) => {
|
|
|
27
22
|
});
|
|
28
23
|
return makeHandler("MCP", buildContext, stages, { compression: config.compression });
|
|
29
24
|
};
|
|
30
|
-
return createHttpServer(config, makeHandlerForPort, {
|
|
31
|
-
label: "MCP",
|
|
32
|
-
cache: null,
|
|
33
|
-
plugins: noPlugins
|
|
34
|
-
});
|
|
25
|
+
return createHttpServer(config, makeHandlerForPort, { label: "MCP" });
|
|
35
26
|
};
|
|
36
|
-
//#endregion
|
|
37
27
|
export { createServer };
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { operation } from "./modules/mcp/tools/operations/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { createServer } from "./createServer.js";
|
|
3
3
|
import { apply, applyShape } from "./modules/mcp/tools/apply/index.js";
|
|
4
4
|
import { read, readShape } from "./modules/mcp/tools/read.js";
|
|
5
5
|
import { search, searchShape } from "./modules/mcp/tools/search.js";
|
|
6
|
-
import {
|
|
6
|
+
import { buildMCPPipeline, mcpExtensions } from "./pipeline.js";
|
|
7
|
+
import { createMcpOnlyStage, createMcpStage } from "./stages/mcp.js";
|
|
8
|
+
import { previewStage } from "./stages/preview.js";
|
|
9
|
+
import { createWidgetProxyStage } from "./stages/proxy.js";
|
|
10
|
+
import { createPreview } from "./preview/createPreview.js";
|
|
7
11
|
import { createMcpServer } from "./modules/mcp/server.js";
|
|
8
12
|
import { handleMcp, readMcpBody, serveMcp } from "./modules/mcp/handler.js";
|
|
9
13
|
import { createHttpPreviewClient } from "./modules/mcp/previewClient.js";
|
|
10
14
|
import { createHttpScreenshotClient } from "./modules/mcp/screenshotClient.js";
|
|
11
|
-
import { createMcpOnlyStage, createMcpStage } from "./stages/mcp.js";
|
|
12
|
-
import { createPreview } from "./preview/createPreview.js";
|
|
13
|
-
import { previewStage } from "./stages/preview.js";
|
|
14
|
-
import { createWidgetProxyStage } from "./stages/proxy.js";
|
|
15
|
-
import { buildMCPPipeline, mcpExtensions } from "./pipeline.js";
|
|
16
|
-
import { createServer } from "./createServer.js";
|
|
17
15
|
import { createLocalScreenshotClient, resolveLocalBrowser } from "./modules/mcp/localScreenshotClient.js";
|
|
16
|
+
import { outlineOfSnapshot, outlineOfTree, unnamedControls } from "./modules/mcp/accessibilityOutline.js";
|
|
17
|
+
import { tools } from "./modules/mcp/tools/index.js";
|
|
18
18
|
import { createOAuthGuardStage, createOAuthStage } from "@plitzi/sdk-server/oauth";
|
|
19
19
|
export { apply, applyShape, buildMCPPipeline, createHttpPreviewClient, createHttpScreenshotClient, createLocalScreenshotClient, createMcpOnlyStage, createMcpServer, createMcpStage, createOAuthGuardStage, createOAuthStage, createPreview, createServer, createWidgetProxyStage, handleMcp, mcpExtensions, operation, outlineOfSnapshot, outlineOfTree, previewStage, read, readMcpBody, readShape, resolveLocalBrowser, search, searchShape, serveMcp, tools, unnamedControls };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/modules/mcp/accessibilityOutline.ts
|
|
2
2
|
/** Past this an outline is cut, and says so: a page is read to find something in it, not to be held whole. */
|
|
3
3
|
var OUTLINE_LIMIT = 24e3;
|
|
4
4
|
/** Nodes that are only structure: their children are written in their place. */
|
|
@@ -71,5 +71,4 @@ var unnamedControls = (outline) => outline.split("\n").flatMap((text, index) =>
|
|
|
71
71
|
line: index + 1
|
|
72
72
|
}] : [];
|
|
73
73
|
});
|
|
74
|
-
//#endregion
|
|
75
74
|
export { OUTLINE_LIMIT, outlineOfSnapshot, outlineOfTree, unnamedControls };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerApp } from "./shared/registerApp.js";
|
|
2
|
-
import { iconFontCss } from "./render/styles.js";
|
|
3
1
|
import { RENDER_APP_URI, renderApp } from "./render/index.js";
|
|
4
|
-
|
|
2
|
+
import { iconFontCss } from "./render/styles.js";
|
|
3
|
+
import { registerApp } from "./shared/registerApp.js";
|
|
4
|
+
// src/modules/mcp/apps/index.ts
|
|
5
5
|
/** What a view gets when the deployment says nothing: streaming on, because a host that streams no arguments
|
|
6
6
|
* paints exactly what it painted before. */
|
|
7
7
|
var DEFAULT_VIEW_SETTINGS = { streaming: true };
|
|
@@ -12,5 +12,4 @@ var apps = [renderApp];
|
|
|
12
12
|
var registerApps = (server, settings = DEFAULT_VIEW_SETTINGS) => {
|
|
13
13
|
for (const app of apps) registerApp(server, app, settings);
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { DEFAULT_VIEW_SETTINGS, RENDER_APP_URI, apps, iconFontCss, registerApps };
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { VIEW_DIR } from "../shared/assets.js";
|
|
2
1
|
import { iconFontCss, widgetCss } from "./styles.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
//#region src/modules/mcp/apps/render/index.ts
|
|
2
|
+
import { VIEW_DIR, shippedPath } from "../shared/assets.js";
|
|
3
|
+
// src/modules/mcp/apps/render/index.ts
|
|
6
4
|
var RENDER_APP_URI = "ui://plitzi/render.html";
|
|
7
|
-
var HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
8
5
|
var renderApp = {
|
|
9
6
|
uri: RENDER_APP_URI,
|
|
10
7
|
name: "plitzi-render-app",
|
|
11
8
|
title: "Plitzi widget",
|
|
12
9
|
description: "Interactive view that renders a plitzi_render widget with the Plitzi SDK.",
|
|
13
|
-
entry:
|
|
10
|
+
entry: shippedPath(import.meta.url, `${VIEW_DIR}/index.tsx`, `modules/mcp/apps/render/${VIEW_DIR}/index.tsx`),
|
|
14
11
|
styles: () => [widgetCss()]
|
|
15
12
|
};
|
|
16
|
-
//#endregion
|
|
17
13
|
export { RENDER_APP_URI, iconFontCss, renderApp };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { require } from "../shared/resolve.js";
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import { readFileSync } from "node:fs";
|
|
4
|
-
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
// src/modules/mcp/apps/render/styles.ts
|
|
5
5
|
/** The SDK's stylesheets, as a widget gets them.
|
|
6
6
|
*
|
|
7
7
|
* Everything the page shell inlines is paid for by EVERY widget: the host loads the ui:// page into a fresh
|
|
@@ -19,5 +19,4 @@ var icons;
|
|
|
19
19
|
var widgetCss = () => base ??= readFileSync(path.join(sdkDist(), "plitzi-sdk.css"), "utf-8");
|
|
20
20
|
/** Font Awesome, fonts and all, for the renders that draw an icon. */
|
|
21
21
|
var iconFontCss = () => icons ??= inlineIconFonts(readFileSync(path.join(sdkDist(), "plitzi-sdk-icons.css"), "utf-8"), (file) => readFileSync(path.join(sdkDist(), file)));
|
|
22
|
-
//#endregion
|
|
23
22
|
export { iconFontCss, inlineIconFonts, widgetCss };
|
|
@@ -8,3 +8,9 @@ export declare const VIEW_DIR = "view";
|
|
|
8
8
|
* every app's bundle — so a view that grows a sibling module either lives in `view/` or fails the suite, instead
|
|
9
9
|
* of failing a deployment. Tests stay behind; the page shell travels with the views it renders. */
|
|
10
10
|
export declare const shipsAsSource: (file: string) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* A file this package ships beside one of its modules (`view/`, the page shell): beside the module when it runs from
|
|
13
|
+
* the package — its source or its `dist` — and, when a program bundled the module into its own files, in the package
|
|
14
|
+
* as it is installed, found by its name. `inPackage` is where it is under the package's `dist`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const shippedPath: (moduleUrl: string, besideModule: string, inPackage: string) => string;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import "node:
|
|
2
|
-
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
// src/modules/mcp/apps/shared/assets.ts
|
|
3
5
|
/** The one folder of an app that ships to dist as SOURCE: its browser entry (`view/index.tsx`) and every module
|
|
4
6
|
* that entry bundles. The server builds it with esbuild at request time, so none of it is in the module graph the
|
|
5
7
|
* library build compiles — a view-side module that does not travel verbatim is simply missing at runtime, which
|
|
6
8
|
* the package only finds out when a host asks for the page. Everything else in an app (its definition) compiles
|
|
7
9
|
* like any other module. */
|
|
8
10
|
var VIEW_DIR = "view";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* A file this package ships beside one of its modules (`view/`, the page shell): beside the module when it runs from
|
|
13
|
+
* the package — its source or its `dist` — and, when a program bundled the module into its own files, in the package
|
|
14
|
+
* as it is installed, found by its name. `inPackage` is where it is under the package's `dist`.
|
|
15
|
+
*/
|
|
16
|
+
var shippedPath = (moduleUrl, besideModule, inPackage) => {
|
|
17
|
+
const beside = path.resolve(path.dirname(fileURLToPath(moduleUrl)), besideModule);
|
|
18
|
+
if (existsSync(beside)) return beside;
|
|
19
|
+
return path.resolve(path.dirname(fileURLToPath(import.meta.resolve("@plitzi/sdk-mcp"))), inPackage);
|
|
20
|
+
};
|
|
21
|
+
export { VIEW_DIR, shippedPath };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { require } from "./resolve.js";
|
|
2
2
|
import { zodEnglishOnly } from "./zodEnglishOnly.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { esbuildBuild } from "@plitzi/sdk-kernel/build";
|
|
4
|
+
// src/modules/mcp/apps/shared/bundle.ts
|
|
5
5
|
var options = (entry) => ({
|
|
6
6
|
entryPoints: [entry],
|
|
7
7
|
bundle: true,
|
|
@@ -17,7 +17,6 @@ var options = (entry) => ({
|
|
|
17
17
|
logLevel: "silent"
|
|
18
18
|
});
|
|
19
19
|
var bundle = async (entry) => {
|
|
20
|
-
return (await
|
|
20
|
+
return (await esbuildBuild(options(entry))).outputFiles[0].text;
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { bundle };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { shippedPath } from "./assets.js";
|
|
1
2
|
import { bundle } from "./bundle.js";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
3
|
import { readFileSync } from "node:fs";
|
|
5
4
|
import ejs from "ejs";
|
|
6
|
-
|
|
7
|
-
var SHELL =
|
|
5
|
+
// src/modules/mcp/apps/shared/page.ts
|
|
6
|
+
var SHELL = shippedPath(import.meta.url, "shell.ejs", "modules/mcp/apps/shared/shell.ejs");
|
|
8
7
|
var template = () => ejs.compile(readFileSync(SHELL, "utf-8"), { filename: SHELL });
|
|
9
8
|
var scripts = /* @__PURE__ */ new Map();
|
|
10
9
|
var pages = /* @__PURE__ */ new Map();
|
|
@@ -30,5 +29,4 @@ var page = (app, settings) => {
|
|
|
30
29
|
}
|
|
31
30
|
return html;
|
|
32
31
|
};
|
|
33
|
-
//#endregion
|
|
34
32
|
export { page };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { page } from "./page.js";
|
|
2
2
|
import { RESOURCE_MIME_TYPE, registerAppResource } from "@modelcontextprotocol/ext-apps/server";
|
|
3
|
-
|
|
3
|
+
// src/modules/mcp/apps/shared/registerApp.ts
|
|
4
4
|
var WILDCARDS = [
|
|
5
5
|
"*",
|
|
6
6
|
"https:",
|
|
@@ -39,5 +39,4 @@ var registerApp = (server, app, settings) => {
|
|
|
39
39
|
_meta: meta
|
|
40
40
|
}] }));
|
|
41
41
|
};
|
|
42
|
-
//#endregion
|
|
43
42
|
export { registerApp };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/modules/mcp/apps/shared/zodEnglishOnly.ts
|
|
2
2
|
var NAMESPACE = "zod-locales-stub";
|
|
3
3
|
var ZOD_PACKAGE = /node_modules[/\\]zod[/\\]/u;
|
|
4
4
|
/** Drops zod's ~40 translations (194 KB): they are re-exported as a namespace, which no bundler can tree-shake.
|
|
@@ -19,5 +19,4 @@ var zodEnglishOnly = {
|
|
|
19
19
|
}));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { zodEnglishOnly };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, BUILTIN_UTILITIES, GLOBAL_SOURCES, transformerCatalog } from "@plitzi/sdk-authoring";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/catalogs/observed.ts
|
|
3
3
|
var INTERACTION_NOTE = "Interaction actions observed on this space, grouped by node type. A flow is a trigger followed by ordered callbacks/utilities; write one with upsertInteractionFlow. Names not listed may still be valid plugin actions.";
|
|
4
4
|
var GLOBAL_CALLBACKS_NOTE = "Built-in global callbacks always available in every space. A globalCallback is registered on its SOURCE MODULE, so its node `elementId` is the listed `source` (e.g. \"space\" for addNotification) — NOT the element that hosts the flow. Omit `elementId` and the MCP sets the right source and fills the param defaults for you. Use ONLY the params listed under each callback (with the exact spelling shown) — for addNotification the visible text goes in `content`; there is no title/message/type param. When strictParams is true, any other key is rejected.";
|
|
5
5
|
var ELEMENT_CALLBACKS_NOTE = "Built-in `callback`-type actions every element registers on ITSELF. Unlike a globalCallback, an element callback runs against a real element, so its node `elementId` is that element (the flow host by default, or another element to act on) and its nodeType is \"callback\". `setState` here changes the element's own attribute/state (params category/key/value/revertOnFinish) — NOT the global state setState (which is a globalCallback on source \"state\" with params key/type/value). Set revertOnFinish:true for a TEMPORARY change (e.g. a \"loading…\" label): it is undone automatically when the flow finishes, so you do NOT add manual restore steps. A specific element type may register more callbacks beyond these defaults.";
|
|
@@ -84,5 +84,4 @@ var observedDataSources = (schema) => {
|
|
|
84
84
|
for (const el of Object.values(schema.flat)) for (const list of Object.values(el.definition.bindings ?? {})) for (const binding of list) sources.add(binding.source);
|
|
85
85
|
return sources;
|
|
86
86
|
};
|
|
87
|
-
//#endregion
|
|
88
87
|
export { buildDataSourceCatalog, buildInteractionCatalog, observedDataSources, observedInteractionActions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentCatalog } from '@plitzi/sdk-
|
|
1
|
+
import { ComponentCatalog } from '@plitzi/sdk-kernel/types';
|
|
2
2
|
/**
|
|
3
3
|
* Keeps only string css declarations from a `base.default` block — dropping nested states and variants, and any
|
|
4
4
|
* non-scalar value — so the catalog carries a flat `prop: value` map an agent can read as the element's starting
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/modules/mcp/catalogs/pluginCatalog.ts
|
|
2
2
|
/**
|
|
3
3
|
* The catalog entries for a space's PLUGIN (custom) element types, read from each plugin's published manifest.
|
|
4
4
|
*
|
|
@@ -96,5 +96,4 @@ var pluginCatalog = async (plugins) => {
|
|
|
96
96
|
for (const [type, entry] of entries.flat()) catalog[type] = entry;
|
|
97
97
|
return catalog;
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
export { pluginCatalog, stringDeclarations };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cssProperties, elementCatalog } from "@plitzi/sdk-authoring";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/catalogs/registry.ts
|
|
3
3
|
var enrichType = (typeName, info, catalog) => {
|
|
4
4
|
const entry = catalog?.[typeName];
|
|
5
5
|
if (entry) {
|
|
@@ -84,5 +84,4 @@ var buildTypeRegistry = (schema, catalog) => {
|
|
|
84
84
|
types
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
//#endregion
|
|
88
87
|
export { buildTypeRegistry };
|
|
@@ -2,7 +2,7 @@ import { createMcpServer } from './server';
|
|
|
2
2
|
import { ResourceProxy } from './proxy';
|
|
3
3
|
import { PreviewClient, ScreenshotClient } from './types';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
import { SSRAdapters, SSRRequest, ServerLogger } from '@plitzi/sdk-
|
|
5
|
+
import { SSRAdapters, SSRRequest, ServerLogger } from '@plitzi/sdk-kernel/types';
|
|
6
6
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
7
7
|
/** Per-request wiring the MCP service does not resolve itself: the renderer clients and the log sink. Everything
|
|
8
8
|
* here is optional — the service degrades feature by feature. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createMcpServer } from "./server.js";
|
|
2
2
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
3
|
-
|
|
3
|
+
// src/modules/mcp/handler.ts
|
|
4
4
|
var readMcpBody = (req) => new Promise((resolve, reject) => {
|
|
5
5
|
let raw = "";
|
|
6
6
|
req.on("data", (chunk) => {
|
|
@@ -109,5 +109,4 @@ var handleMcp = async (raw, res, req, adapters, options = {}) => serveMcp(raw, r
|
|
|
109
109
|
getGrant: () => adapters.getGrant?.(req) ?? Promise.resolve(void 0),
|
|
110
110
|
...options
|
|
111
111
|
}), adapters.admitToolCalls ? (calls) => adapters.admitToolCalls?.(req, calls) ?? Promise.resolve(void 0) : void 0);
|
|
112
|
-
//#endregion
|
|
113
112
|
export { createMcpServer, handleMcp, readMcpBody, serveMcp };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { componentNamed, instancesOf } from "@plitzi/sdk-schema";
|
|
2
|
-
|
|
2
|
+
// 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);
|
|
5
5
|
/**
|
|
@@ -28,5 +28,4 @@ var componentSummariesToAI = (schema) => Object.values(schema.components).map((c
|
|
|
28
28
|
instances: instancesOf(schema, component.id).length,
|
|
29
29
|
elementCount: Object.keys(component.flat).length
|
|
30
30
|
}));
|
|
31
|
-
//#endregion
|
|
32
31
|
export { componentSummariesToAI, componentView, findComponentByRef };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/helpers/computeVersion.ts
|
|
3
3
|
var canonicalize = (data) => {
|
|
4
4
|
if (data === null || data === void 0) return "null";
|
|
5
5
|
if (typeof data === "string") return JSON.stringify(data);
|
|
@@ -12,5 +12,4 @@ var canonicalize = (data) => {
|
|
|
12
12
|
var computeVersion = (data) => {
|
|
13
13
|
return createHash("sha1").update(canonicalize(data)).digest("hex").slice(0, 12);
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { computeVersion };
|
|
@@ -5,7 +5,7 @@ import { serverGuide } from "./server.js";
|
|
|
5
5
|
import { structureGuide } from "./structure.js";
|
|
6
6
|
import { stylingGuide } from "./styling.js";
|
|
7
7
|
import { guideQuickstart, serverInstructions, widgetsOnlyInstructions } from "./instructions.js";
|
|
8
|
-
|
|
8
|
+
// src/modules/mcp/helpers/guide/index.ts
|
|
9
9
|
/** The full reference, `plitzi://guide`: its sections in order, each a module. */
|
|
10
10
|
var guideText = [
|
|
11
11
|
referenceGuide,
|
|
@@ -15,5 +15,4 @@ var guideText = [
|
|
|
15
15
|
structureGuide,
|
|
16
16
|
practiceGuide
|
|
17
17
|
].join("");
|
|
18
|
-
//#endregion
|
|
19
18
|
export { guideQuickstart, guideText, serverInstructions, widgetsOnlyInstructions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GLOBALS } from "./values.js";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/helpers/guide/instructions.ts
|
|
3
3
|
var serverInstructions = "Plitzi AI server: read-then-write editing of a Plitzi space. Reads follow a filesystem model — list cheap, read one item in detail on demand; never fetch a whole tree you do not need. Workflow: (1) read plitzi://primer/{env} once — it bundles a quickstart of the guide, types, css-properties and page/definition/variable summaries in a single call; (2) plitzi_search with include:\"detail\" to jump to elements — each hit then carries its uri, stateVersion AND full style/resolvedStyle, so an edit needs no per-element read; open a page skeleton or element only when you need its tree/detail (the skeleton already lists the style classes of each node, and plitzi_read fetches many uris at once); (3) plitzi_apply with dryRun to preview a batch; (4) plitzi_apply to persist, passing expectedResourceVersions to guard against concurrent edits — apply and search both hand back the versions you need for the next edit. Use patchElement / patchDefinition to change only some props / CSS (the upsert variants replace them all). An element read (and search include:\"detail\") inlines the CSS of the definitions it attaches under resolvedStyle, so you rarely need a separate definition read. Every element has ONE name and it IS its id ([A-Za-z0-9_-] starting with a letter, unique, chosen by you) — the same name is the runtime wiring key, so a provider source is `<type>_<name>.<field>`, visible to the provider’s DESCENDANTS only (bind inside its subtree). CSS is plain kebab-case — write shorthands freely (`border: 1px solid red`, `padding: 8px 16px`, `font: bold 16px/1.5 Arial`), they are expanded to longhands for you and STORED that way, so read-back shows the longhands; style vars are var(--name), schema vars are {{name}}. READERS — do not confuse them: MCP *resources* are the browsable catalog (list them, or open one by URI); plitzi_search FINDS elements by label/type/attribute and hands you the name to write ops against; plitzi_read BATCH-fetches URIs you already hold. Reach for search/read to work; browse resources to discover. CMS / API integrations (Strapi, WordPress, Contentful, any REST service) go through a CONNECTOR: a manifest you author declaring the base URL, endpoints and auth template, which the SERVER executes — read plitzi://connector-presets for working ones and plitzi://connectors/{env} for this space’s. You never see or create the credential; the space owner attaches it, and the connector saves without one. An apiContainer reads through it only with runtime:\"server\". Elements also carry applied style variants + visibility (initialState), data bindings and interaction flows: edit them with patchElement (initialState), upsertBinding/patchBinding/deleteBinding, and upsertInteractionFlow/patchInteractionNode/deleteInteraction. An element read shows all three plus availableVariants (which variant each of its classes offers). Build pages people can use without sight: screen readers and browser agents (Claude in Chrome) work a page through its accessibility tree, so every control needs words and clicks go on buttons and links — see Accessibility in plitzi://guide, and plitzi_look (its accessibility outline, the default view) to check. On a space people edit too, plitzi_activity says — and waits for — what they changed since you last looked. What the person asks to change on this space is changed HERE, on the space as Plitzi keeps it — no project. A project is the Plitzi CLI’s (a self-hosted space in code, or one taken out with plitzi create --from and sent back with plitzi space push): an edit here while one is out makes that push refuse until it pulls — tell the person. A job for a team of agents is never several agents on one space here: it is done on a project (plitzi create --from, then plitzi run start) and pushed once. Separately, to SHOW the user a small self-contained widget (offline, no space or backend) instead of editing the space — a card, hero, pricing table, a visual answer — use plitzi_render; read plitzi://render/guide for it.";
|
|
4
4
|
var widgetsOnlyInstructions = "Plitzi widget server (widgets-only connection). This connection carries NO Plitzi space: nothing can be read or edited in one, and the space tools are not offered here — do not look for them. What it does do is build self-contained UI widgets fully offline, with no backend, account or setup: call plitzi_render to SHOW the user a real rendered layout (card, hero, pricing table, checklist, form, gallery) instead of describing one. Read plitzi://render/guide first — the element/prop table, the style model and a worked example; plitzi://render/types lists every element type you can author (plitzi_read fetches both). To change a widget you already rendered, call plitzi_render again with patch:true and its renderId. If the user wants to edit their real Plitzi space from here, that is a reconnection they make: the integration must be re-authorized and granted a space (the consent screen lists theirs) — you cannot do it from this connection, and no retry will change it.";
|
|
5
5
|
var guideQuickstart = `# Plitzi AI MCP — quickstart
|
|
@@ -102,5 +102,4 @@ problem leads with its \`[code]\`, and its hint says what to write instead.
|
|
|
102
102
|
|
|
103
103
|
Read \`plitzi://guide\` before anything above is unclear.
|
|
104
104
|
`;
|
|
105
|
-
//#endregion
|
|
106
105
|
export { guideQuickstart, serverInstructions, widgetsOnlyInstructions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GLOBALS, OTHER_TRANSFORMERS } from "./values.js";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/helpers/guide/logic.ts
|
|
3
3
|
/** What an element reads and does: bindings, interactions, and what is public. */
|
|
4
4
|
var logicGuide = `## Data bindings
|
|
5
5
|
Connect a data **source** to an element field. A binding is \`{ to, source, transformers?, when?, enabled? }\` grouped
|
|
@@ -162,5 +162,4 @@ Data only some visitors may read comes from a \`runtime: "server"\` provider or
|
|
|
162
162
|
who is asking — never from a public file or a document the page filters on the client.
|
|
163
163
|
|
|
164
164
|
`;
|
|
165
|
-
//#endregion
|
|
166
165
|
export { logicGuide };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MOTION_ENTERS, MOTION_LOOPS } from "@plitzi/sdk-authoring";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/helpers/guide/practice.ts
|
|
3
3
|
/** Good practice: motion, accessibility and semantics. */
|
|
4
4
|
var practiceGuide = `## Motion — good practices
|
|
5
5
|
A preset first: an element's \`motion\` field (\`upsertElement\`/\`patchElement\`) —
|
|
@@ -61,8 +61,9 @@ tree names nothing is invisible to both, however it looks. So build every page t
|
|
|
61
61
|
as real elements — a list, a table — with a button for every action; one hidden until focused cannot be clicked by an
|
|
62
62
|
agent that clicks by position, so offer a visible "list view".
|
|
63
63
|
The linter warns about these (\`control-without-name\`, \`image-without-alt\`, \`click-on-static-element\`,
|
|
64
|
-
\`dropdown-without-control\`, \`
|
|
65
|
-
|
|
64
|
+
\`dropdown-without-control\`, \`label-ignored\`, \`control-in-decorative\`) on every element you touch; fix them in the
|
|
65
|
+
same batch. A heading that skips a level, on the page as it is drawn, is a suggestion (\`heading-level-skipped\`): give
|
|
66
|
+
it the level it skipped. Then look:
|
|
66
67
|
\`plitzi_look\` shows the page as those readers get it, and lists what has no name.
|
|
67
68
|
|
|
68
69
|
## Semantics
|
|
@@ -104,7 +105,7 @@ journey counted against the plan's month (a refusal says why, and when it comes
|
|
|
104
105
|
'variant' | 'state', … }] }\` — one element resolved for a state, no browser.
|
|
105
106
|
- \`e2e\`: \`{ id, title, page, width, steps: [{ kind: 'click', element }, { kind: 'expectText', element, text }, …] }\`
|
|
106
107
|
— a visitor's steps on a page, elements by id (a list's copy \`row:3\`), what must hold between them; \`type\` names
|
|
107
|
-
a form control and writes in its field; \`click\`/\`hover\` take \`point: { x, y }\`, percent of the element's box —
|
|
108
|
+
a form control and writes in its field (a file field picks the small real file its text names: \`me.png\`); \`click\`/\`hover\` take \`point: { x, y }\`, percent of the element's box —
|
|
108
109
|
what a canvas draws (a map's marker); \`page\` may be a wrong address the space's own not-found page answers.
|
|
109
110
|
\`{ kind: 'expectCheck', check: '<unit id>' }\` holds an element check for the state the journey reached;
|
|
110
111
|
\`given: { state: { … } }\` starts it with a state; \`as: '<account>'\` plays it signed in as a test account;
|
|
@@ -119,5 +120,4 @@ When a test fails over a change the user asked for, say so and fix the test with
|
|
|
119
120
|
The plan keeps a number of journeys per space (Free one): a \`set\` that adds past it is refused, naming the plan that
|
|
120
121
|
keeps more — tell the user; never remove a journey of theirs to make room.
|
|
121
122
|
`;
|
|
122
|
-
//#endregion
|
|
123
123
|
export { practiceGuide };
|