@plitzi/sdk-mcp 0.37.2 → 0.37.3
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 +1156 -0
- package/README.md +6 -2
- package/dist/createServer.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/modules/mcp/accessibilityOutline.d.ts +38 -0
- package/dist/modules/mcp/accessibilityOutline.js +75 -0
- package/dist/modules/mcp/accessibilityOutline.test.d.ts +1 -0
- package/dist/modules/mcp/catalogs/index.d.ts +2 -2
- package/dist/modules/mcp/catalogs/index.js +2 -2
- package/dist/modules/mcp/catalogs/observed.js +2 -2
- package/dist/modules/mcp/catalogs/pluginCatalog.d.ts +6 -3
- package/dist/modules/mcp/catalogs/pluginCatalog.js +12 -7
- package/dist/modules/mcp/helpers/agentPrompt.js +22 -5
- package/dist/modules/mcp/helpers/guide.d.ts +2 -2
- package/dist/modules/mcp/helpers/guide.js +212 -48
- package/dist/modules/mcp/helpers/interactions.d.ts +2 -1
- package/dist/modules/mcp/helpers/interactions.js +2 -0
- package/dist/modules/mcp/helpers/space.d.ts +6 -4
- package/dist/modules/mcp/helpers/space.js +7 -20
- package/dist/modules/mcp/helpers/uris.d.ts +3 -1
- package/dist/modules/mcp/helpers/uris.js +4 -1
- package/dist/modules/mcp/index.d.ts +2 -0
- package/dist/modules/mcp/localScreenshotClient.d.ts +11 -0
- package/dist/modules/mcp/localScreenshotClient.js +24 -9
- package/dist/modules/mcp/proxy/guard.d.ts +6 -0
- package/dist/modules/mcp/proxy/guard.js +8 -12
- package/dist/modules/mcp/resources/functions.d.ts +8 -0
- package/dist/modules/mcp/resources/functions.js +35 -0
- package/dist/modules/mcp/resources/register.d.ts +2 -1
- package/dist/modules/mcp/resources/register.js +49 -2
- package/dist/modules/mcp/resources/renderGuide.js +3 -2
- package/dist/modules/mcp/resources/router.js +3 -1
- package/dist/modules/mcp/screenshotClient.js +12 -4
- package/dist/modules/mcp/server.js +20 -10
- package/dist/modules/mcp/tests/guide.test.d.ts +1 -0
- package/dist/modules/mcp/tools/apply/dispatch.js +9 -1
- package/dist/modules/mcp/tools/apply/index.d.ts +34 -0
- package/dist/modules/mcp/tools/apply/index.js +35 -70
- package/dist/modules/mcp/tools/index.js +4 -2
- package/dist/modules/mcp/tools/operations/connectors/manifest.d.ts +0 -1
- package/dist/modules/mcp/tools/operations/functions/functions.test.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/functions/index.d.ts +31 -0
- package/dist/modules/mcp/tools/operations/functions/index.js +48 -0
- package/dist/modules/mcp/tools/operations/index.d.ts +122 -2
- package/dist/modules/mcp/tools/operations/index.js +4 -3
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +5 -6
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +3 -11
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +6 -9
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +5 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +3 -1
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +5 -0
- package/dist/modules/mcp/tools/operations/schema/operations.d.ts +27 -0
- package/dist/modules/mcp/tools/operations/schema/pages/deleteLayout.js +6 -5
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +6 -5
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +17 -0
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +34 -5
- package/dist/modules/mcp/tools/operations/schema/shared.d.ts +6 -0
- package/dist/modules/mcp/tools/operations/schema/shared.js +5 -0
- package/dist/modules/mcp/tools/operations/schema/translator.js +3 -2
- package/dist/modules/mcp/tools/operations/schema/write.d.ts +10 -5
- package/dist/modules/mcp/tools/operations/schema/write.js +16 -16
- package/dist/modules/mcp/tools/preview.d.ts +27 -0
- package/dist/modules/mcp/tools/render.d.ts +27 -0
- package/dist/modules/mcp/tools/render.js +7 -43
- package/dist/modules/mcp/tools/screenshot.d.ts +39 -0
- package/dist/modules/mcp/tools/screenshot.js +40 -5
- package/dist/modules/mcp/tools/shared/draftBatch.d.ts +25 -0
- package/dist/modules/mcp/tools/shared/draftBatch.js +58 -0
- package/dist/modules/mcp/tools/shared/draftBatch.test.d.ts +1 -0
- package/dist/modules/mcp/tools/shared/lintDraft.d.ts +30 -0
- package/dist/modules/mcp/tools/shared/lintDraft.js +142 -0
- package/dist/modules/mcp/tools/shared/lintDraft.test.d.ts +1 -0
- package/dist/modules/mcp/tools/shared/tool.d.ts +4 -0
- package/dist/modules/mcp/tools/shared/validator/bindings.d.ts +0 -4
- package/dist/modules/mcp/tools/shared/validator/bindings.js +1 -60
- package/dist/modules/mcp/tools/shared/validator/elements.js +3 -15
- package/dist/modules/mcp/tools/shared/validator/index.d.ts +1 -4
- package/dist/modules/mcp/tools/shared/validator/index.js +25 -20
- package/dist/modules/mcp/tools/shared/validator/interactions.js +3 -58
- package/dist/modules/mcp/tools/tryFunction.d.ts +18 -0
- package/dist/modules/mcp/tools/tryFunction.js +43 -0
- package/dist/modules/mcp/tools/validate.d.ts +34 -0
- package/dist/modules/mcp/tools/validate.js +9 -26
- package/dist/modules/mcp/types/aiSchema.d.ts +8 -1
- package/dist/modules/mcp/types/previewTypes.d.ts +6 -0
- package/dist/modules/mcp/types/screenshotTypes.d.ts +16 -0
- package/dist/modules/mcp/types/toolTypes.d.ts +5 -1
- package/dist/preview/createPreview.js +5 -4
- package/dist/stages/preview.js +15 -1
- package/package.json +11 -10
- package/skills/plitzi-render/SKILL.md +1 -2
- package/dist/modules/mcp/tools/shared/validator/audit.d.ts +0 -4
- package/dist/modules/mcp/tools/shared/validator/audit.js +0 -127
|
@@ -3,9 +3,9 @@ export declare const guideUri = "plitzi://guide";
|
|
|
3
3
|
export declare const typesUri = "plitzi://types";
|
|
4
4
|
export declare const cssPropertiesUri = "plitzi://css-properties";
|
|
5
5
|
export declare const primerUri: (env: Env) => string;
|
|
6
|
+
export declare const changesUri: (env: Env) => string;
|
|
6
7
|
export declare const pagesUri: (env: Env) => string;
|
|
7
8
|
export declare const pageUri: (env: Env, ref: string) => string;
|
|
8
|
-
export declare const pageStylesUri: (env: Env, ref: string) => string;
|
|
9
9
|
/** The shared layout shells. One of them is read as a page is — `pages/{ref}` resolves either root. */
|
|
10
10
|
export declare const layoutsUri: (env: Env) => string;
|
|
11
11
|
export declare const elementUri: (env: Env, ref: string) => string;
|
|
@@ -23,6 +23,8 @@ export declare const actionUri: (env: Env, ref: string) => string;
|
|
|
23
23
|
/** The step vocabulary. Under the actions root because that is where an author looks for it, and resolved before
|
|
24
24
|
* the `{ref}` shape so an action can never be named `tasks`. */
|
|
25
25
|
export declare const actionTasksUri: (env: Env) => string;
|
|
26
|
+
export declare const functionsUri: (env: Env) => string;
|
|
27
|
+
export declare const functionFileUri: (env: Env, path: string) => string;
|
|
26
28
|
export declare const foldersUri: (env: Env) => string;
|
|
27
29
|
export declare const folderUri: (env: Env, ref: string) => string;
|
|
28
30
|
export declare const defsUri: (env: Env) => string;
|
|
@@ -3,6 +3,7 @@ var guideUri = "plitzi://guide";
|
|
|
3
3
|
var typesUri = "plitzi://types";
|
|
4
4
|
var cssPropertiesUri = "plitzi://css-properties";
|
|
5
5
|
var primerUri = (env) => `plitzi://primer/${env}`;
|
|
6
|
+
var changesUri = (env) => `plitzi://changes/${env}`;
|
|
6
7
|
var pagesUri = (env) => `plitzi://schema/${env}/pages`;
|
|
7
8
|
var pageUri = (env, ref) => `plitzi://schema/${env}/pages/${ref}`;
|
|
8
9
|
/** The shared layout shells. One of them is read as a page is — `pages/{ref}` resolves either root. */
|
|
@@ -22,6 +23,8 @@ var actionUri = (env, ref) => `plitzi://actions/${env}/${ref}`;
|
|
|
22
23
|
/** The step vocabulary. Under the actions root because that is where an author looks for it, and resolved before
|
|
23
24
|
* the `{ref}` shape so an action can never be named `tasks`. */
|
|
24
25
|
var actionTasksUri = (env) => `plitzi://actions/${env}/tasks`;
|
|
26
|
+
var functionsUri = (env) => `plitzi://functions/${env}`;
|
|
27
|
+
var functionFileUri = (env, path) => `plitzi://functions/${env}/${path}`;
|
|
25
28
|
var foldersUri = (env) => `plitzi://folders/${env}`;
|
|
26
29
|
var folderUri = (env, ref) => `plitzi://folders/${env}/${ref}`;
|
|
27
30
|
var defsUri = (env) => `plitzi://definitions/${env}`;
|
|
@@ -56,4 +59,4 @@ var itemTemplates = (env) => [
|
|
|
56
59
|
* family and extracts its ref in one step, without repeating the prefix string for both the startsWith and slice. */
|
|
57
60
|
var afterPrefix = (uri, prefix) => uri.startsWith(prefix) ? uri.slice(prefix.length) : void 0;
|
|
58
61
|
//#endregion
|
|
59
|
-
export { actionTasksUri, actionUri, actionsUri, afterPrefix, aliasedRoots, connectorPresetsUri, connectorUri, connectorsUri, cssPropertiesUri, dataSourcesUri, defUri, defsUri, elementUri, folderUri, foldersUri, fontUri, fontsUri, globalUri, globalsUri, guideUri, idUri, idsUri, interactionsUri, itemTemplates, layoutsUri, pageUri, pagesUri, primerUri, schemaVarsUri, settingsUri, styleVarUri, styleVarsUri, typesUri };
|
|
62
|
+
export { actionTasksUri, actionUri, actionsUri, afterPrefix, aliasedRoots, changesUri, connectorPresetsUri, connectorUri, connectorsUri, cssPropertiesUri, dataSourcesUri, defUri, defsUri, elementUri, folderUri, foldersUri, fontUri, fontsUri, functionFileUri, functionsUri, globalUri, globalsUri, guideUri, idUri, idsUri, interactionsUri, itemTemplates, layoutsUri, pageUri, pagesUri, primerUri, schemaVarsUri, settingsUri, styleVarUri, styleVarsUri, typesUri };
|
|
@@ -5,10 +5,12 @@ export { computeVersion, buildAgentGuide } from './helpers';
|
|
|
5
5
|
export { createHttpPreviewClient } from './previewClient';
|
|
6
6
|
export { createLocalScreenshotClient, resolveLocalBrowser } from './localScreenshotClient';
|
|
7
7
|
export { createHttpScreenshotClient } from './screenshotClient';
|
|
8
|
+
export { outlineOfSnapshot, outlineOfTree, unnamedControls } from './accessibilityOutline';
|
|
8
9
|
export type { McpRequestOptions } from './handler';
|
|
9
10
|
export type { HttpPreviewClientConfig } from './previewClient';
|
|
10
11
|
export type { LocalScreenshotClientConfig } from './localScreenshotClient';
|
|
11
12
|
export type { HttpScreenshotClientConfig } from './screenshotClient';
|
|
13
|
+
export type { AccessibilityNode, UnnamedControl } from './accessibilityOutline';
|
|
12
14
|
export type { McpServerContext } from './server';
|
|
13
15
|
export type { ApplyInput, WriteResponse, Persisters, SearchInput, ReadInput, ReadResponse, ValidateInput, Operation, ToolDef, ToolContext } from './tools';
|
|
14
16
|
export type { Space } from './helpers';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AccessibilityNode } from './accessibilityOutline';
|
|
1
2
|
import { ScreenshotClient, ScreenshotInput } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* A capture that needs no service to be running.
|
|
@@ -37,6 +38,16 @@ type Page = {
|
|
|
37
38
|
}[]) => Promise<void>;
|
|
38
39
|
evaluate: <T>(fn: () => T) => Promise<T>;
|
|
39
40
|
screenshot: (options: Record<string, unknown>) => Promise<Buffer | Uint8Array>;
|
|
41
|
+
/** Playwright's: the page's accessibility tree, already written as an outline. */
|
|
42
|
+
locator?: (selector: string) => {
|
|
43
|
+
ariaSnapshot: () => Promise<string>;
|
|
44
|
+
};
|
|
45
|
+
/** Puppeteer's: the same tree, as nodes. */
|
|
46
|
+
accessibility?: {
|
|
47
|
+
snapshot: (options?: {
|
|
48
|
+
interestingOnly?: boolean;
|
|
49
|
+
}) => Promise<AccessibilityNode | null>;
|
|
50
|
+
};
|
|
40
51
|
};
|
|
41
52
|
type Browser = {
|
|
42
53
|
newPage: () => Promise<Page>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { outlineOfSnapshot, outlineOfTree } from "./accessibilityOutline.js";
|
|
1
2
|
import { PREVIEW_TOKEN_PARAM } from "@plitzi/sdk-server/kernel";
|
|
2
3
|
//#region src/modules/mcp/localScreenshotClient.ts
|
|
3
4
|
/**
|
|
@@ -38,6 +39,11 @@ var resolveLocalBrowser = async () => await importDriver("playwright") ?? await
|
|
|
38
39
|
var setViewport = async (page, size) => {
|
|
39
40
|
await (page.setViewportSize ? page.setViewportSize(size) : page.setViewport?.(size));
|
|
40
41
|
};
|
|
42
|
+
/** The tree a screen reader walks, from whichever driver this is; `undefined` from one that offers neither. */
|
|
43
|
+
var readOutline = async (page) => {
|
|
44
|
+
if (page.locator) return outlineOfSnapshot(await page.locator("body").ariaSnapshot());
|
|
45
|
+
if (page.accessibility) return outlineOfTree(await page.accessibility.snapshot({ interestingOnly: false }));
|
|
46
|
+
};
|
|
41
47
|
/** Before the navigation: a space on the `system` theme paints from `prefers-color-scheme` from its first frame. */
|
|
42
48
|
var emulateColorScheme = async (page, colorScheme) => {
|
|
43
49
|
await (page.emulateMedia ? page.emulateMedia({ colorScheme }) : page.emulateMediaFeatures?.([{
|
|
@@ -55,7 +61,7 @@ var emulateColorScheme = async (page, colorScheme) => {
|
|
|
55
61
|
var createLocalScreenshotClient = async ({ renderBaseUrl, ignoreHttpsErrors = true }) => {
|
|
56
62
|
const driver = await resolveLocalBrowser();
|
|
57
63
|
if (!driver) return;
|
|
58
|
-
return { async capture({ pagePath, token, viewports, fullPage = true, colorScheme }) {
|
|
64
|
+
return { async capture({ pagePath, token, viewports, fullPage = true, colorScheme, views = ["image"] }) {
|
|
59
65
|
const url = new URL(pagePath, renderBaseUrl);
|
|
60
66
|
if (token) url.searchParams.set(PREVIEW_TOKEN_PARAM, token);
|
|
61
67
|
/**
|
|
@@ -72,6 +78,7 @@ var createLocalScreenshotClient = async ({ renderBaseUrl, ignoreHttpsErrors = tr
|
|
|
72
78
|
...ignoreHttpsErrors ? { ignoreHTTPSErrors: true } : {}
|
|
73
79
|
});
|
|
74
80
|
const images = [];
|
|
81
|
+
const accessibility = [];
|
|
75
82
|
for (const viewport of viewports) {
|
|
76
83
|
const page = await browser.newPage();
|
|
77
84
|
await setViewport(page, viewport);
|
|
@@ -90,19 +97,27 @@ var createLocalScreenshotClient = async ({ renderBaseUrl, ignoreHttpsErrors = tr
|
|
|
90
97
|
height
|
|
91
98
|
});
|
|
92
99
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
if (views.includes("image")) {
|
|
101
|
+
const shot = await page.screenshot({
|
|
102
|
+
type: "png",
|
|
103
|
+
fullPage
|
|
104
|
+
});
|
|
105
|
+
images.push({
|
|
106
|
+
label: viewport.label,
|
|
107
|
+
mimeType: "image/png",
|
|
108
|
+
data: Buffer.from(shot).toString("base64")
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const outline = views.includes("accessibility") ? await readOutline(page) : void 0;
|
|
112
|
+
if (outline !== void 0) accessibility.push({
|
|
98
113
|
label: viewport.label,
|
|
99
|
-
|
|
100
|
-
data: Buffer.from(shot).toString("base64")
|
|
114
|
+
outline
|
|
101
115
|
});
|
|
102
116
|
}
|
|
103
117
|
return {
|
|
104
118
|
ok: true,
|
|
105
|
-
images
|
|
119
|
+
images,
|
|
120
|
+
...views.includes("accessibility") ? { accessibility } : {}
|
|
106
121
|
};
|
|
107
122
|
} catch (err) {
|
|
108
123
|
return {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an ADDRESS is never the public internet. The ranges are sdk-server's, the same rule its `http.request` task
|
|
3
|
+
* and connector engine follow: this module used to keep its own copy, and the copy judged `::ffff:7f00:1` — the form a
|
|
4
|
+
* URL parser writes `[::ffff:127.0.0.1]` in — as public. Anything that is not an address is refused here; a NAME is
|
|
5
|
+
* judged by what it resolves to, in `isPublicHost`.
|
|
6
|
+
*/
|
|
1
7
|
export declare const isPrivateAddress: (address: string) => boolean;
|
|
2
8
|
/** Does this hostname resolve somewhere on the public internet? The endpoint fetches URLs an agent authored, so
|
|
3
9
|
* without this it would be a way to read whatever the pod itself can reach — the cluster's services, the cloud
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
+
import { isBlockedHost } from "@plitzi/sdk-server/kernel";
|
|
1
2
|
import { lookup } from "node:dns/promises";
|
|
2
3
|
import { isIP } from "node:net";
|
|
3
4
|
//#region src/modules/mcp/proxy/guard.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
const normalized = address.toLowerCase().split("%")[0] ?? "";
|
|
12
|
-
if (normalized.startsWith("::ffff:") && normalized.includes(".")) return isPrivateIpv4(normalized.slice(7));
|
|
13
|
-
return normalized === "::" || normalized === "::1" || normalized.startsWith("fc") || normalized.startsWith("fd") || normalized.startsWith("fe8") || normalized.startsWith("fe9") || normalized.startsWith("fea") || normalized.startsWith("feb");
|
|
14
|
-
};
|
|
15
|
-
var isPrivateAddress = (address) => isIP(address) === 6 ? isPrivateIpv6(address) : isPrivateIpv4(address);
|
|
5
|
+
/**
|
|
6
|
+
* Whether an ADDRESS is never the public internet. The ranges are sdk-server's, the same rule its `http.request` task
|
|
7
|
+
* and connector engine follow: this module used to keep its own copy, and the copy judged `::ffff:7f00:1` — the form a
|
|
8
|
+
* URL parser writes `[::ffff:127.0.0.1]` in — as public. Anything that is not an address is refused here; a NAME is
|
|
9
|
+
* judged by what it resolves to, in `isPublicHost`.
|
|
10
|
+
*/
|
|
11
|
+
var isPrivateAddress = (address) => isIP(address) === 0 || isBlockedHost(address);
|
|
16
12
|
var PRIVATE_SUFFIXES = [
|
|
17
13
|
".local",
|
|
18
14
|
".internal",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Space } from '../helpers';
|
|
2
|
+
import { Env, ResourceEnvelope } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* The space's own functions: the listing says what they declare and which files they are, so an agent knows where to
|
|
5
|
+
* look before it reads one; a file reads whole. Server-side code — never a browser payload — and it holds no secret: a
|
|
6
|
+
* request NAMES a credential, the platform writes it in.
|
|
7
|
+
*/
|
|
8
|
+
export declare const readFunctionsResource: (space: Space, env: Env, uri: string) => ResourceEnvelope<unknown> | null | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { afterPrefix, functionFileUri, functionsUri } from "../helpers/uris.js";
|
|
2
|
+
import { envelope } from "./envelope.js";
|
|
3
|
+
//#region src/modules/mcp/resources/functions.ts
|
|
4
|
+
/**
|
|
5
|
+
* The space's own functions: the listing says what they declare and which files they are, so an agent knows where to
|
|
6
|
+
* look before it reads one; a file reads whole. Server-side code — never a browser payload — and it holds no secret: a
|
|
7
|
+
* request NAMES a credential, the platform writes it in.
|
|
8
|
+
*/
|
|
9
|
+
var readFunctionsResource = (space, env, uri) => {
|
|
10
|
+
if (uri === functionsUri(env)) {
|
|
11
|
+
if (!space.functions) return envelope({
|
|
12
|
+
available: false,
|
|
13
|
+
reason: "This deployment runs no space functions"
|
|
14
|
+
});
|
|
15
|
+
const { files, version, manifest } = space.functions;
|
|
16
|
+
return envelope({
|
|
17
|
+
available: true,
|
|
18
|
+
version,
|
|
19
|
+
files: Object.entries(files).map(([path, content]) => ({
|
|
20
|
+
path,
|
|
21
|
+
bytes: content.length
|
|
22
|
+
})),
|
|
23
|
+
declares: manifest
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const path = afterPrefix(uri, functionFileUri(env, ""));
|
|
27
|
+
if (path === void 0) return;
|
|
28
|
+
const content = space.functions && Object.hasOwn(space.functions.files, path) ? space.functions.files[path] : void 0;
|
|
29
|
+
return content === void 0 ? null : envelope({
|
|
30
|
+
path,
|
|
31
|
+
content
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { readFunctionsResource };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { McpLog, Space } from '../helpers';
|
|
2
2
|
import { Env } from '../types';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { SSRChangePage, SSRChangeQuery } from '@plitzi/sdk-shared';
|
|
4
5
|
/** Register every resource on the MCP server: fixed listings plus templated per-item reads. The space is
|
|
5
6
|
* loaded lazily via getSpace, so listing resources never touches the store — only reading one does.
|
|
6
7
|
*
|
|
7
8
|
* `hasSpace` is false when the connection reaches no space (a guest / widgets-only grant): the space-dependent
|
|
8
9
|
* families are then not registered at all, so the catalog the agent browses holds only what it can actually
|
|
9
10
|
* open — no listing that answers every read with the same refusal. */
|
|
10
|
-
export declare const registerResources: (server: McpServer, getSpace: () => Promise<Space>, env: Env, log: McpLog, hasSpace: boolean) => void;
|
|
11
|
+
export declare const registerResources: (server: McpServer, getSpace: () => Promise<Space>, env: Env, log: McpLog, hasSpace: boolean, readChanges?: (query: SSRChangeQuery) => Promise<SSRChangePage>) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cssProperties, cssShorthands } from "../catalogs/index.js";
|
|
2
|
+
import { changesUri } from "../helpers/uris.js";
|
|
2
3
|
import { guideText } from "../helpers/guide.js";
|
|
3
4
|
import { envelope, jsonContents } from "./envelope.js";
|
|
4
5
|
import { resourceErrorMessage } from "./canonical.js";
|
|
@@ -6,13 +7,15 @@ import { registerRenderResources } from "./renderGuide.js";
|
|
|
6
7
|
import { readResource } from "./router.js";
|
|
7
8
|
import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
9
|
//#region src/modules/mcp/resources/register.ts
|
|
10
|
+
/** A page an agent can read in one go: each change carries whole elements before and after. */
|
|
11
|
+
var CHANGES_PAGE = 20;
|
|
9
12
|
/** Register every resource on the MCP server: fixed listings plus templated per-item reads. The space is
|
|
10
13
|
* loaded lazily via getSpace, so listing resources never touches the store — only reading one does.
|
|
11
14
|
*
|
|
12
15
|
* `hasSpace` is false when the connection reaches no space (a guest / widgets-only grant): the space-dependent
|
|
13
16
|
* families are then not registered at all, so the catalog the agent browses holds only what it can actually
|
|
14
17
|
* open — no listing that answers every read with the same refusal. */
|
|
15
|
-
var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
18
|
+
var registerResources = (server, getSpace, env, log, hasSpace, readChanges) => {
|
|
16
19
|
const emit = async (uri) => {
|
|
17
20
|
const start = performance.now();
|
|
18
21
|
try {
|
|
@@ -52,7 +55,7 @@ var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
|
52
55
|
[
|
|
53
56
|
"Primer",
|
|
54
57
|
`plitzi://primer/${env}`,
|
|
55
|
-
"Read this FIRST. Cold-start bundle in one call: guide, types, css-properties and SUMMARIES of pages, definitions and variables — summaries only, never full page/element trees, so it stays small even on a large space. Open a page or element on demand afterwards."
|
|
58
|
+
"Read this FIRST. Cold-start bundle in one call: the guide’s quickstart, types, css-properties and SUMMARIES of pages, definitions and variables — summaries only, never full page/element trees, so it stays small even on a large space. Open a page or element on demand afterwards."
|
|
56
59
|
],
|
|
57
60
|
[
|
|
58
61
|
"Element types",
|
|
@@ -94,6 +97,11 @@ var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
|
94
97
|
`plitzi://style-variables/${env}`,
|
|
95
98
|
"Design tokens by category"
|
|
96
99
|
],
|
|
100
|
+
[
|
|
101
|
+
"Fonts",
|
|
102
|
+
`plitzi://fonts/${env}`,
|
|
103
|
+
"The font families the space loads, with their source and fallback"
|
|
104
|
+
],
|
|
97
105
|
[
|
|
98
106
|
"Schema variables",
|
|
99
107
|
`plitzi://schema-variables/${env}`,
|
|
@@ -134,6 +142,11 @@ var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
|
134
142
|
`plitzi://actions/${env}`,
|
|
135
143
|
"Server actions this space runs: what starts each one, who may run it, and the input/output contract a caller is held to — what a runServerAction step points at"
|
|
136
144
|
],
|
|
145
|
+
[
|
|
146
|
+
"Functions",
|
|
147
|
+
`plitzi://functions/${env}`,
|
|
148
|
+
"The space’s own server code: which files it is, and the tasks, routes and hosts it declares — its tasks are steps like any server task"
|
|
149
|
+
],
|
|
137
150
|
[
|
|
138
151
|
"Style definitions (schema alias)",
|
|
139
152
|
`plitzi://schema/${env}/definitions`,
|
|
@@ -150,6 +163,30 @@ var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
|
150
163
|
"Alias of plitzi://schema-variables/{env}"
|
|
151
164
|
]
|
|
152
165
|
];
|
|
166
|
+
if (readChanges) {
|
|
167
|
+
const emitChanges = async (uri, query) => {
|
|
168
|
+
const start = performance.now();
|
|
169
|
+
try {
|
|
170
|
+
const page = await readChanges(query);
|
|
171
|
+
log.resourceRead(uri, performance.now() - start);
|
|
172
|
+
return jsonContents(uri, { data: page });
|
|
173
|
+
} catch (error) {
|
|
174
|
+
log.resourceRead(uri, performance.now() - start, error);
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
server.registerResource("Change history", changesUri(env), {
|
|
179
|
+
description: "Read-only: the latest changes to this space, newest first — who made each (a person, an agent, the autofix), from where, and every element, class or token it touched, whole, before and after",
|
|
180
|
+
mimeType: "application/json"
|
|
181
|
+
}, () => emitChanges(changesUri(env), { limit: CHANGES_PAGE }));
|
|
182
|
+
server.registerResource("Change history of one entity", new ResourceTemplate(`${changesUri(env)}/{id}`, { list: void 0 }), {
|
|
183
|
+
description: "Read-only: the changes that touched one element, class, token or font, newest first",
|
|
184
|
+
mimeType: "application/json"
|
|
185
|
+
}, (uri, { id }) => emitChanges(uri.href, {
|
|
186
|
+
entityId: decodeURIComponent(String(id)),
|
|
187
|
+
limit: CHANGES_PAGE
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
153
190
|
for (const [name, uri, description] of fixed) server.registerResource(name, uri, {
|
|
154
191
|
description,
|
|
155
192
|
mimeType: "application/json"
|
|
@@ -185,6 +222,11 @@ var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
|
185
222
|
`plitzi://actions/${env}/{ref}`,
|
|
186
223
|
"One action document in full: its access rule, triggers, declared credentials and connectors, and every step"
|
|
187
224
|
],
|
|
225
|
+
[
|
|
226
|
+
"Function file",
|
|
227
|
+
`plitzi://functions/${env}/{+path}`,
|
|
228
|
+
"One file of the space’s functions, whole"
|
|
229
|
+
],
|
|
188
230
|
[
|
|
189
231
|
"Style definition",
|
|
190
232
|
`plitzi://definitions/${env}/{ref}`,
|
|
@@ -205,6 +247,11 @@ var registerResources = (server, getSpace, env, log, hasSpace) => {
|
|
|
205
247
|
`plitzi://style-variables/${env}/{category}`,
|
|
206
248
|
"Design tokens for one category"
|
|
207
249
|
],
|
|
250
|
+
[
|
|
251
|
+
"Font",
|
|
252
|
+
`plitzi://fonts/${env}/{family}`,
|
|
253
|
+
"One font family the space loads: its source, fallback and files"
|
|
254
|
+
],
|
|
208
255
|
[
|
|
209
256
|
"Style definition (schema alias)",
|
|
210
257
|
`plitzi://schema/${env}/definitions/{ref}`,
|
|
@@ -381,7 +381,8 @@ The widget runs the live SDK, so beyond static layout it can fetch data and resp
|
|
|
381
381
|
\`ref\`, just like styling. (Full reference: **plitzi://guide** — sections Data bindings and Interactions.)
|
|
382
382
|
|
|
383
383
|
### Fetch data — a provider + a binding
|
|
384
|
-
An \`apiContainer\` fetches at runtime and exposes the result as the source **\`apiContainer_<id>.data
|
|
384
|
+
An \`apiContainer\` fetches at runtime and exposes the result as the source **\`apiContainer_<id>.data\`** (the
|
|
385
|
+
parsed body; \`.status\` is the HTTP status, beside \`.isLoading\`, \`.isEmpty\` and \`.hasError\`), visible
|
|
385
386
|
to its **DESCENDANTS only** — the bound element must live inside the container's subtree. \`upsertBinding\` then
|
|
386
387
|
connects that source to a descendant's field. With no \`subType\` (its default) the provider renders **no element of
|
|
387
388
|
its own** — its children lay out in its parent, and a class on it styles nothing; give it \`"subType": "div"\` when the
|
|
@@ -431,7 +432,7 @@ An element starts hidden with \`initialState: { "visibility": false }\` on the e
|
|
|
431
432
|
\`true\` counts as false, so a panel that has never been set flips **open** on the first click.
|
|
432
433
|
|
|
433
434
|
Expand/collapse is therefore **ONE step on ONE trigger** — never two \`setState\` branches under opposite \`when\`
|
|
434
|
-
conditions
|
|
435
|
+
conditions: every step reads the state as it is when it runs, so the second sees what the first wrote and flips it back:
|
|
435
436
|
|
|
436
437
|
\`\`\`json
|
|
437
438
|
{ "operations": [
|
|
@@ -4,6 +4,7 @@ import { readActionResource } from "./actions.js";
|
|
|
4
4
|
import { canonicalUri } from "./canonical.js";
|
|
5
5
|
import { readConnectorResource } from "./connectors.js";
|
|
6
6
|
import { readCoreResource } from "./core.js";
|
|
7
|
+
import { readFunctionsResource } from "./functions.js";
|
|
7
8
|
import { readPrimerResource } from "./primer.js";
|
|
8
9
|
import { readRenderResource } from "./renderGuide.js";
|
|
9
10
|
import { readSchemaResource } from "./schema.js";
|
|
@@ -16,7 +17,8 @@ var resolvers = [
|
|
|
16
17
|
readSchemaResource,
|
|
17
18
|
readStyleResource,
|
|
18
19
|
readConnectorResource,
|
|
19
|
-
readActionResource
|
|
20
|
+
readActionResource,
|
|
21
|
+
readFunctionsResource
|
|
20
22
|
];
|
|
21
23
|
/** Resolve a resource URI to its versioned envelope, or null if unknown / not found. */
|
|
22
24
|
var readResource = (space, env, rawUri) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { outlineOfTree } from "./accessibilityOutline.js";
|
|
1
2
|
import { PREVIEW_TOKEN_PARAM } from "@plitzi/sdk-server/kernel";
|
|
2
3
|
//#region src/modules/mcp/screenshotClient.ts
|
|
3
4
|
var composeUrl = (base, pagePath, token) => {
|
|
@@ -23,7 +24,7 @@ var readRefusal = async (res) => {
|
|
|
23
24
|
/** Default `ScreenshotClient`: composes the navigable preview URL (renderBaseUrl + pagePath + `?__pt=token`) and
|
|
24
25
|
* POSTs it to the browser service. Any network/HTTP failure surfaces as `ok:false` so the tool can fall back to
|
|
25
26
|
* the HTML preview instead of hard-failing. */
|
|
26
|
-
var createHttpScreenshotClient = ({ serviceUrl, renderBaseUrl, fetchImpl = fetch }) => ({ async capture({ pagePath, token, viewports, fullPage, colorScheme }) {
|
|
27
|
+
var createHttpScreenshotClient = ({ serviceUrl, renderBaseUrl, fetchImpl = fetch }) => ({ async capture({ pagePath, token, viewports, fullPage, colorScheme, views = ["image"] }) {
|
|
27
28
|
const url = composeUrl(renderBaseUrl, pagePath, token);
|
|
28
29
|
let res;
|
|
29
30
|
try {
|
|
@@ -34,7 +35,8 @@ var createHttpScreenshotClient = ({ serviceUrl, renderBaseUrl, fetchImpl = fetch
|
|
|
34
35
|
url,
|
|
35
36
|
viewports,
|
|
36
37
|
fullPage,
|
|
37
|
-
colorScheme
|
|
38
|
+
colorScheme,
|
|
39
|
+
views
|
|
38
40
|
})
|
|
39
41
|
});
|
|
40
42
|
} catch (err) {
|
|
@@ -58,14 +60,20 @@ var createHttpScreenshotClient = ({ serviceUrl, renderBaseUrl, fetchImpl = fetch
|
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
const body = await res.json();
|
|
61
|
-
|
|
63
|
+
const images = body.images ?? [];
|
|
64
|
+
if (views.includes("image") && images.length === 0) return {
|
|
62
65
|
ok: false,
|
|
63
66
|
error: "SCREENSHOT_EMPTY",
|
|
64
67
|
message: "Browser service returned no images."
|
|
65
68
|
};
|
|
69
|
+
const accessibility = body.accessibility?.map(({ label, tree }) => ({
|
|
70
|
+
label,
|
|
71
|
+
outline: outlineOfTree(tree)
|
|
72
|
+
}));
|
|
66
73
|
return {
|
|
67
74
|
ok: true,
|
|
68
|
-
images
|
|
75
|
+
images,
|
|
76
|
+
...accessibility ? { accessibility } : {}
|
|
69
77
|
};
|
|
70
78
|
} });
|
|
71
79
|
//#endregion
|
|
@@ -6,6 +6,7 @@ import { proxyForTool } from "./proxy/config.js";
|
|
|
6
6
|
import { registerResources } from "./resources/register.js";
|
|
7
7
|
import { tools } from "./tools/index.js";
|
|
8
8
|
import { isCallToolResult } from "../ai/toolkit.js";
|
|
9
|
+
import { randomUUID } from "node:crypto";
|
|
9
10
|
import { registerAppTool } from "@modelcontextprotocol/ext-apps/server";
|
|
10
11
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
12
|
//#region src/modules/mcp/server.ts
|
|
@@ -30,13 +31,14 @@ var createMcpServer = async ({ adapters, getGrant, preview, screenshot, logger,
|
|
|
30
31
|
};
|
|
31
32
|
const loadSpace = async () => {
|
|
32
33
|
const id = requireSpaceId();
|
|
33
|
-
const [schema, style, catalog, connectors, actions, actionTasks] = await Promise.all([
|
|
34
|
+
const [schema, style, catalog, connectors, actions, actionTasks, functions] = await Promise.all([
|
|
34
35
|
adapters.getSchema?.(id, MCP_ENV),
|
|
35
36
|
adapters.getStyle?.(id, MCP_ENV),
|
|
36
37
|
adapters.getComponentCatalog?.(id, MCP_ENV).catch(() => void 0),
|
|
37
38
|
adapters.getConnectors?.(id).catch(() => void 0),
|
|
38
39
|
adapters.getActions?.(id).catch(() => void 0),
|
|
39
|
-
adapters.getActionTasks?.(id).catch(() => void 0)
|
|
40
|
+
adapters.getActionTasks?.(id).catch(() => void 0),
|
|
41
|
+
adapters.getFunctions?.(id).catch(() => void 0)
|
|
40
42
|
]);
|
|
41
43
|
if (!schema || !style) throw new Error(emptySpaceMessage);
|
|
42
44
|
return {
|
|
@@ -45,25 +47,32 @@ var createMcpServer = async ({ adapters, getGrant, preview, screenshot, logger,
|
|
|
45
47
|
catalog,
|
|
46
48
|
connectors: connectors ?? [],
|
|
47
49
|
actions: actions ?? [],
|
|
48
|
-
actionTasks
|
|
50
|
+
actionTasks,
|
|
51
|
+
...functions ? { functions } : {}
|
|
49
52
|
};
|
|
50
53
|
};
|
|
51
|
-
const { saveSchema, saveStyle, saveConnector, deleteConnector, saveAction, deleteAction } = adapters;
|
|
54
|
+
const { saveSchema, saveStyle, saveConnector, deleteConnector, saveAction, deleteAction, saveFunctions, tryFunction } = adapters;
|
|
55
|
+
const write = {
|
|
56
|
+
userId: grant?.userId,
|
|
57
|
+
batch: randomUUID()
|
|
58
|
+
};
|
|
52
59
|
const persisters = {
|
|
53
|
-
schema: saveSchema ? (schema) => saveSchema(requireWritableSpaceId(), MCP_ENV, schema) : void 0,
|
|
54
|
-
style: saveStyle ? (style) => saveStyle(requireWritableSpaceId(), MCP_ENV, style) : void 0,
|
|
60
|
+
schema: saveSchema ? (schema) => saveSchema(requireWritableSpaceId(), MCP_ENV, schema, write) : void 0,
|
|
61
|
+
style: saveStyle ? (style) => saveStyle(requireWritableSpaceId(), MCP_ENV, style, write) : void 0,
|
|
55
62
|
saveConnector: saveConnector ? (entry) => saveConnector(requireWritableSpaceId(), entry) : void 0,
|
|
56
63
|
deleteConnector: deleteConnector ? (id) => deleteConnector(requireWritableSpaceId(), id) : void 0,
|
|
57
64
|
saveAction: saveAction ? (entry) => saveAction(requireWritableSpaceId(), entry) : void 0,
|
|
58
|
-
deleteAction: deleteAction ? (id) => deleteAction(requireWritableSpaceId(), id) : void 0
|
|
65
|
+
deleteAction: deleteAction ? (id) => deleteAction(requireWritableSpaceId(), id) : void 0,
|
|
66
|
+
saveFunctions: saveFunctions ? (files, base) => saveFunctions(requireWritableSpaceId(), files, base, write) : void 0
|
|
59
67
|
};
|
|
60
68
|
let spacePromise;
|
|
61
69
|
const getSpace = () => spacePromise ??= loadSpace();
|
|
62
70
|
const server = new McpServer({
|
|
63
71
|
name: "plitzi-mcp",
|
|
64
|
-
version: "0.37.
|
|
72
|
+
version: "0.37.3"
|
|
65
73
|
}, { instructions: hasSpace ? serverInstructions : widgetsOnlyInstructions });
|
|
66
|
-
|
|
74
|
+
const { getChanges } = adapters;
|
|
75
|
+
registerResources(server, getSpace, MCP_ENV, log, hasSpace, getChanges ? (query) => getChanges(requireSpaceId(), MCP_ENV, query) : void 0);
|
|
67
76
|
registerApps(server, {
|
|
68
77
|
streaming: renderStreaming,
|
|
69
78
|
proxyEndpoint: proxy?.endpoint
|
|
@@ -75,7 +84,8 @@ var createMcpServer = async ({ adapters, getGrant, preview, screenshot, logger,
|
|
|
75
84
|
spaceId: requireSpaceId(),
|
|
76
85
|
preview,
|
|
77
86
|
screenshot,
|
|
78
|
-
proxy: proxyForTool(proxy, tool)
|
|
87
|
+
proxy: proxyForTool(proxy, tool),
|
|
88
|
+
...tryFunction ? { tryFunction: (task, params) => tryFunction(requireWritableSpaceId(), task, params, write) } : {}
|
|
79
89
|
});
|
|
80
90
|
const spacelessContext = (tool) => ({
|
|
81
91
|
space: emptySpace(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import { upsertAction } from "../operations/actions/upsertAction.js";
|
|
|
5
5
|
import { deleteConnector } from "../operations/connectors/deleteConnector.js";
|
|
6
6
|
import { patchConnector } from "../operations/connectors/patchConnector.js";
|
|
7
7
|
import { upsertConnector } from "../operations/connectors/upsertConnector.js";
|
|
8
|
+
import { deleteFunctionFile, upsertFunctionFile } from "../operations/functions/index.js";
|
|
8
9
|
import { deleteBinding } from "../operations/schema/bindings/deleteBinding.js";
|
|
9
10
|
import { patchBinding } from "../operations/schema/bindings/patchBinding.js";
|
|
10
11
|
import { upsertBinding } from "../operations/schema/bindings/upsertBinding.js";
|
|
@@ -81,6 +82,8 @@ var executeOp = (space, env, op) => {
|
|
|
81
82
|
case "upsertAction": return upsertAction(space, env, op);
|
|
82
83
|
case "patchAction": return patchAction(space, env, op);
|
|
83
84
|
case "deleteAction": return deleteAction(space, env, op);
|
|
85
|
+
case "upsertFunctionFile": return upsertFunctionFile(space, env, op);
|
|
86
|
+
case "deleteFunctionFile": return deleteFunctionFile(space, env, op);
|
|
84
87
|
default: return fail("type", `Unknown operation "${op.type}"`, "See the Operation union");
|
|
85
88
|
}
|
|
86
89
|
};
|
|
@@ -99,7 +102,8 @@ var applyOperations = (space, env, ops) => {
|
|
|
99
102
|
changedConnectors: [],
|
|
100
103
|
deletedConnectors: [],
|
|
101
104
|
changedActions: [],
|
|
102
|
-
deletedActions: []
|
|
105
|
+
deletedActions: [],
|
|
106
|
+
changedFunctions: false
|
|
103
107
|
};
|
|
104
108
|
const stale = /* @__PURE__ */ new Set();
|
|
105
109
|
const elements = /* @__PURE__ */ new Set();
|
|
@@ -136,6 +140,10 @@ var applyOperations = (space, env, ops) => {
|
|
|
136
140
|
savedActions.delete(op.ref);
|
|
137
141
|
droppedActions.add(op.ref);
|
|
138
142
|
break;
|
|
143
|
+
case "upsertFunctionFile":
|
|
144
|
+
case "deleteFunctionFile":
|
|
145
|
+
outcome.changedFunctions = true;
|
|
146
|
+
break;
|
|
139
147
|
default: if (isStyleOp(op.type)) outcome.changedStyle = true;
|
|
140
148
|
else outcome.changedSchema = true;
|
|
141
149
|
}
|
|
@@ -191,6 +191,11 @@ export declare const applyShape: {
|
|
|
191
191
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
192
192
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
193
193
|
when: z.ZodOptional<z.ZodType<import('@plitzi/sdk-shared').RuleGroup, unknown, z.core.$ZodTypeInternals<import('@plitzi/sdk-shared').RuleGroup, unknown>>>;
|
|
194
|
+
whileRunning: z.ZodOptional<z.ZodEnum<{
|
|
195
|
+
skip: "skip";
|
|
196
|
+
parallel: "parallel";
|
|
197
|
+
queue: "queue";
|
|
198
|
+
}>>;
|
|
194
199
|
elementId: z.ZodOptional<z.ZodString>;
|
|
195
200
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
196
201
|
}, z.core.$strip>>;
|
|
@@ -204,6 +209,11 @@ export declare const applyShape: {
|
|
|
204
209
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
205
210
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
206
211
|
when: z.ZodOptional<z.ZodType<import('@plitzi/sdk-shared').RuleGroup, unknown, z.core.$ZodTypeInternals<import('@plitzi/sdk-shared').RuleGroup, unknown>>>;
|
|
212
|
+
whileRunning: z.ZodOptional<z.ZodEnum<{
|
|
213
|
+
skip: "skip";
|
|
214
|
+
parallel: "parallel";
|
|
215
|
+
queue: "queue";
|
|
216
|
+
}>>;
|
|
207
217
|
elementId: z.ZodOptional<z.ZodString>;
|
|
208
218
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
209
219
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -220,6 +230,8 @@ export declare const applyShape: {
|
|
|
220
230
|
localStorage: "localStorage";
|
|
221
231
|
sessionStorage: "sessionStorage";
|
|
222
232
|
}>>;
|
|
233
|
+
transientState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
paintedState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
223
235
|
userProvider: z.ZodOptional<z.ZodString>;
|
|
224
236
|
tokenStorage: z.ZodOptional<z.ZodEnum<{
|
|
225
237
|
"": "";
|
|
@@ -242,6 +254,21 @@ export declare const applyShape: {
|
|
|
242
254
|
strict: "strict";
|
|
243
255
|
}>>;
|
|
244
256
|
sessionRevalidateSeconds: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
channels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodObject<{
|
|
258
|
+
access: z.ZodObject<{
|
|
259
|
+
mode: z.ZodEnum<{
|
|
260
|
+
public: "public";
|
|
261
|
+
session: "session";
|
|
262
|
+
role: "role";
|
|
263
|
+
}>;
|
|
264
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
publish: z.ZodOptional<z.ZodEnum<{
|
|
267
|
+
server: "server";
|
|
268
|
+
clients: "clients";
|
|
269
|
+
}>>;
|
|
270
|
+
presence: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
+
}, z.core.$strip>>>>;
|
|
245
272
|
}, z.core.$strip>, z.ZodObject<{
|
|
246
273
|
desktop: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
247
274
|
tablet: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
@@ -994,6 +1021,13 @@ export declare const applyShape: {
|
|
|
994
1021
|
}, z.core.$strip>, z.ZodObject<{
|
|
995
1022
|
type: z.ZodLiteral<"deleteAction">;
|
|
996
1023
|
ref: z.ZodString;
|
|
1024
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1025
|
+
type: z.ZodLiteral<"upsertFunctionFile">;
|
|
1026
|
+
path: z.ZodString;
|
|
1027
|
+
content: z.ZodString;
|
|
1028
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1029
|
+
type: z.ZodLiteral<"deleteFunctionFile">;
|
|
1030
|
+
path: z.ZodString;
|
|
997
1031
|
}, z.core.$strip>], "type">>;
|
|
998
1032
|
};
|
|
999
1033
|
export declare const apply: (input: ApplyInput, space: Space, persisters?: Persisters) => Promise<WriteResponse>;
|