@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
|
@@ -2,7 +2,7 @@ import { pageUri } from "../../../../helpers/uris.js";
|
|
|
2
2
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
3
3
|
import { resolveElement } from "../write.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/schema/interactions/deleteInteraction.ts
|
|
6
6
|
var deleteInteractionOp = z.object({
|
|
7
7
|
type: z.literal("deleteInteraction"),
|
|
8
8
|
pageRef: z.string().describe("The page, by name"),
|
|
@@ -48,5 +48,4 @@ var deleteInteraction = (space, env, op) => {
|
|
|
48
48
|
elementRefs: [op.ref]
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { deleteInteraction, deleteInteractionOp };
|
|
@@ -4,7 +4,7 @@ import { empty, fail } from "../../../../helpers/opResult.js";
|
|
|
4
4
|
import { interactionNode } from "../shared.js";
|
|
5
5
|
import { resolveElement, resolveTargetRef } from "../write.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.ts
|
|
8
8
|
var { title, action, params, enabled, when, whileRunning, elementId, preview } = interactionNode.shape;
|
|
9
9
|
var patchInteractionNodeOp = z.object({
|
|
10
10
|
type: z.literal("patchInteractionNode"),
|
|
@@ -45,5 +45,4 @@ var patchInteractionNode = (space, env, op) => {
|
|
|
45
45
|
elementRefs: [op.ref]
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
//#endregion
|
|
49
48
|
export { patchInteractionNode, patchInteractionNodeOp };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { pageUri } from "../../../../helpers/uris.js";
|
|
2
|
-
import { materializeFlow } from "../../../../helpers/interactions.js";
|
|
3
2
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
|
+
import { materializeFlow } from "../../../../helpers/interactions.js";
|
|
4
4
|
import { interactionNode } from "../shared.js";
|
|
5
5
|
import { resolveElement, resolveTargetRef } from "../write.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.ts
|
|
8
8
|
var upsertInteractionFlowOp = z.object({
|
|
9
9
|
type: z.literal("upsertInteractionFlow"),
|
|
10
10
|
pageRef: z.string().describe("The page, by name"),
|
|
@@ -40,5 +40,4 @@ var upsertInteractionFlow = (space, env, op) => {
|
|
|
40
40
|
elementRefs: [op.ref]
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { upsertInteractionFlow, upsertInteractionFlowOp };
|
|
@@ -272,6 +272,7 @@ export declare const elementOps: {
|
|
|
272
272
|
transientState: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>;
|
|
273
273
|
keptState: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>;
|
|
274
274
|
paintedState: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>;
|
|
275
|
+
browserState: import('zod').ZodOptional<import('zod').ZodArray<import('zod').ZodString>>;
|
|
275
276
|
userProvider: import('zod').ZodOptional<import('zod').ZodString>;
|
|
276
277
|
tokenStorage: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
277
278
|
"": "";
|
|
@@ -22,7 +22,7 @@ import { upsertPageOp } from "./pages/upsertPage.js";
|
|
|
22
22
|
import { patchSettingsOp } from "./settings/patchSettings.js";
|
|
23
23
|
import { deleteVariableOp } from "./variables/deleteVariable.js";
|
|
24
24
|
import { upsertVariableOp } from "./variables/upsertVariable.js";
|
|
25
|
-
|
|
25
|
+
// src/modules/mcp/tools/operations/schema/operations.ts
|
|
26
26
|
var elementOps = {
|
|
27
27
|
upsertElement: upsertElementOp,
|
|
28
28
|
repeatElement: repeatElementOp,
|
|
@@ -49,5 +49,4 @@ var elementOps = {
|
|
|
49
49
|
upsertComponent: upsertComponentOp,
|
|
50
50
|
deleteComponent: deleteComponentOp
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { elementOps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
1
2
|
import { findLayoutByRef, indexRemoveLayout, pagesUsingLayout } from "../../../../helpers/space.js";
|
|
2
3
|
import { layoutsUri, pageUri } from "../../../../helpers/uris.js";
|
|
3
|
-
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
4
4
|
import { descendants } from "@plitzi/sdk-schema";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/schema/pages/deleteLayout.ts
|
|
7
7
|
var deleteLayoutOp = z.object({
|
|
8
8
|
type: z.literal("deleteLayout"),
|
|
9
9
|
ref: z.string().describe("The layout shell, by name")
|
|
@@ -30,5 +30,4 @@ var deleteLayout = (space, env, op) => {
|
|
|
30
30
|
staleResources: [pageUri(env, op.ref), layoutsUri(env)]
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
//#endregion
|
|
34
33
|
export { deleteLayout, deleteLayoutOp };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
1
2
|
import { findPageByRef, indexRemovePage } from "../../../../helpers/space.js";
|
|
2
3
|
import { pageUri, pagesUri } from "../../../../helpers/uris.js";
|
|
3
|
-
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
4
4
|
import { descendants } from "@plitzi/sdk-schema";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/schema/pages/deletePage.ts
|
|
7
7
|
var deletePageOp = z.object({
|
|
8
8
|
type: z.literal("deletePage"),
|
|
9
9
|
ref: z.string().describe("The page, by name")
|
|
@@ -22,5 +22,4 @@ var deletePage = (space, env, op) => {
|
|
|
22
22
|
staleResources: [pageUri(env, op.ref), pagesUri(env)]
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { deletePage, deletePageOp };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { findLayoutByRef, indexAddLayout } from "../../../../helpers/space.js";
|
|
2
|
-
import { layoutsUri, pageUri } from "../../../../helpers/uris.js";
|
|
3
1
|
import { empty } from "../../../../helpers/opResult.js";
|
|
2
|
+
import { layoutsUri, pageUri } from "../../../../helpers/uris.js";
|
|
3
|
+
import { findLayoutByRef, indexAddLayout } from "../../../../helpers/space.js";
|
|
4
4
|
import { guardNewRef } from "../write.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/schema/pages/upsertLayout.ts
|
|
7
7
|
var upsertLayoutOp = z.object({
|
|
8
8
|
type: z.literal("upsertLayout"),
|
|
9
9
|
ref: z.string().describe("Layout id to update, or a new id to create one. Pages reference it by this name."),
|
|
@@ -57,5 +57,4 @@ var upsertLayout = (space, env, op) => {
|
|
|
57
57
|
staleResources: [pageUri(env, op.ref), layoutsUri(env)]
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
//#endregion
|
|
61
60
|
export { upsertLayout, upsertLayoutOp };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { findFolderByRef, findLayoutByRef, findPageByRef, indexAddPage, resolveRef } from "../../../../helpers/space.js";
|
|
2
|
-
import { layoutsUri, pageUri, pagesUri } from "../../../../helpers/uris.js";
|
|
3
1
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
2
|
+
import { layoutsUri, pageUri, pagesUri } from "../../../../helpers/uris.js";
|
|
3
|
+
import { findFolderByRef, findLayoutByRef, findPageByRef, indexAddPage, resolveRef } from "../../../../helpers/space.js";
|
|
4
4
|
import { elementFlag } from "../shared.js";
|
|
5
5
|
import { guardNewRef } from "../write.js";
|
|
6
6
|
import { DOCUMENT_SCROLLS, flagGateOf } from "@plitzi/sdk-authoring";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
-
|
|
8
|
+
// src/modules/mcp/tools/operations/schema/pages/upsertPage.ts
|
|
9
9
|
var upsertPageOp = z.object({
|
|
10
10
|
type: z.literal("upsertPage"),
|
|
11
11
|
ref: z.string().describe("Page id to update, or a new id you choose to create one. The id IS the page name — starts with a letter, then letters, numbers, hyphens and underscores (\"pricing\"), unique across the space."),
|
|
@@ -118,5 +118,4 @@ var upsertPage = (space, env, op) => {
|
|
|
118
118
|
]
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
|
-
//#endregion
|
|
122
121
|
export { upsertPage, upsertPageOp };
|
|
@@ -13,6 +13,7 @@ export declare const patchSettingsOp: z.ZodObject<{
|
|
|
13
13
|
transientState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
14
|
keptState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
15
|
paintedState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
browserState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
17
|
userProvider: z.ZodOptional<z.ZodString>;
|
|
17
18
|
tokenStorage: z.ZodOptional<z.ZodEnum<{
|
|
18
19
|
"": "";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { settingsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
2
|
+
import { settingsUri } from "../../../../helpers/uris.js";
|
|
3
3
|
import { NOTIFICATIONS_FIELDS, splitNotificationsCss, withNotificationsCss } from "@plitzi/sdk-authoring";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { spaceIdentity, spaceIdentityProblems, withheldPageOf } from "@plitzi/sdk-shared/schema";
|
|
6
6
|
import { channelProblems } from "@plitzi/sdk-shared/realtime";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/schema/settings/patchSettings.ts
|
|
8
8
|
var userProvider = z.string();
|
|
9
9
|
var storage = z.enum([
|
|
10
10
|
"localStorage",
|
|
@@ -37,6 +37,7 @@ var patchSettingsOp = z.object({
|
|
|
37
37
|
transientState: z.array(z.string()).optional().describe("Top-level state keys never kept"),
|
|
38
38
|
keptState: z.array(z.string()).optional().describe("The only top-level state keys kept (not with transientState)"),
|
|
39
39
|
paintedState: z.array(z.string()).optional().describe("Kept keys the first paint shows"),
|
|
40
|
+
browserState: z.array(z.string()).optional().describe("Kept keys that are the browser’s, not the account’s: no change of account takes them (the cookie consent)"),
|
|
40
41
|
userProvider: userProvider.optional().describe("Auth provider: \"basic\" for an HTTP+JSON backend, a registered name, or \"\" to disable auth"),
|
|
41
42
|
tokenStorage: storage.optional(),
|
|
42
43
|
loginUrl: z.string().optional(),
|
|
@@ -123,5 +124,4 @@ var patchSettings = (space, env, op) => {
|
|
|
123
124
|
staleResources: [settingsUri(env)]
|
|
124
125
|
};
|
|
125
126
|
};
|
|
126
|
-
//#endregion
|
|
127
127
|
export { patchSettings, patchSettingsOp };
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { FLAG_GATE_PATTERN } from "@plitzi/sdk-shared/flags";
|
|
5
5
|
import { ANCHOR_PATTERN, motionProblems } from "@plitzi/sdk-shared/schema";
|
|
6
6
|
import { WHILE_RUNNING_MODES } from "@plitzi/sdk-shared/types";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/schema/shared.ts
|
|
8
8
|
var combinator = z.enum(["and", "or"]);
|
|
9
9
|
var operator = z.enum([
|
|
10
10
|
"",
|
|
@@ -161,5 +161,4 @@ var interactionNode = closedObject("A flow step", {
|
|
|
161
161
|
elementId: z.string().optional().describe("Element whose callback this step invokes, by name; defaults to this element"),
|
|
162
162
|
preview: z.record(z.string(), z.unknown()).optional()
|
|
163
163
|
}, "plitzi_describe_operation { type: \"upsertInteractionFlow\" }");
|
|
164
|
-
//#endregion
|
|
165
164
|
export { bindingCategory, bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementQuiet, elementRuntime, elementShape, initialStateInput, interactionNode, interactionNodeType, position, ruleGroup, scalar, styleRefs, styleVariantInput };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { bindingsToAI, flowsFromInteractions } from "../../../helpers/interactions.js";
|
|
1
2
|
import { computeVersion } from "../../../helpers/computeVersion.js";
|
|
2
3
|
import { descendantCount, elementById, getLayoutElements, getPageElements, nameOf, orderedChildren, pageFoldersOf, pageRefOfElement, pagesUsingLayout, slugRouteParams, spaceIndex, strOr } from "../../../helpers/space.js";
|
|
3
|
-
import { bindingsToAI, flowsFromInteractions } from "../../../helpers/interactions.js";
|
|
4
4
|
import { definitionToAI, globalStylesForType, idStyleToAI } from "../style/translator.js";
|
|
5
5
|
import { descendants } from "@plitzi/sdk-schema";
|
|
6
6
|
import { flagSpecOf, isDocumentScroll, splitNotificationsCss } from "@plitzi/sdk-authoring";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/schema/translator.ts
|
|
8
8
|
var splitClasses = (value) => value ? value.split(/\s+/).filter(Boolean) : [];
|
|
9
9
|
var propsOf = (el) => {
|
|
10
10
|
const { subType, ...rest } = el.attributes;
|
|
@@ -234,5 +234,4 @@ var settingsToAI = (schema) => {
|
|
|
234
234
|
}
|
|
235
235
|
return result;
|
|
236
236
|
};
|
|
237
|
-
//#endregion
|
|
238
237
|
export { elementDetailToAI, elementView, folderRefToAI, foldersToAI, layoutSummariesToAI, pageSkeletonToAI, pageStylesToAI, pageSummariesToAI, schemaVariablesToAI, settingsToAI };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { schemaVarsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty } from "../../../../helpers/opResult.js";
|
|
2
|
+
import { schemaVarsUri } from "../../../../helpers/uris.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
4
|
+
// src/modules/mcp/tools/operations/schema/variables/deleteVariable.ts
|
|
5
5
|
var deleteVariableOp = z.object({
|
|
6
6
|
type: z.literal("deleteVariable"),
|
|
7
7
|
name: z.string().describe("Name of the schema variable to delete")
|
|
@@ -14,5 +14,4 @@ var deleteVariable = (space, env, op) => {
|
|
|
14
14
|
staleResources: [schemaVarsUri(env)]
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { deleteVariable, deleteVariableOp };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { schemaVarsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
2
|
import { scalar } from "../shared.js";
|
|
3
|
+
import { schemaVarsUri } from "../../../../helpers/uris.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/schema/variables/upsertVariable.ts
|
|
6
6
|
var upsertVariableOp = z.object({
|
|
7
7
|
type: z.literal("upsertVariable"),
|
|
8
8
|
name: z.string().describe("Variable name; referenced in content as {{name}}"),
|
|
@@ -38,5 +38,4 @@ var upsertVariable = (space, env, op) => {
|
|
|
38
38
|
staleResources: [schemaVarsUri(env)]
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
//#endregion
|
|
42
41
|
export { upsertVariable, upsertVariableOp };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { findRootByRef, indexAddElement, resolveRef } from "../../../helpers/space.js";
|
|
2
|
-
import { folderUri, foldersUri, layoutsUri, pageUri, pagesUri, schemaVarsUri, settingsUri } from "../../../helpers/uris.js";
|
|
3
1
|
import { fail } from "../../../helpers/opResult.js";
|
|
2
|
+
import { folderUri, foldersUri, layoutsUri, pageUri, pagesUri, schemaVarsUri, settingsUri } from "../../../helpers/uris.js";
|
|
3
|
+
import { findRootByRef, indexAddElement, resolveRef } from "../../../helpers/space.js";
|
|
4
4
|
import { FlatMap, documentIds, elementIdConflict, isValidElementId } from "@plitzi/sdk-schema";
|
|
5
5
|
import { flagGateOf } from "@plitzi/sdk-authoring";
|
|
6
6
|
import { isMotion } from "@plitzi/sdk-shared/schema";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/schema/write.ts
|
|
8
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).";
|
|
9
9
|
var TAKEN_HINT = "A name must be unique across the space — pick a different one, or address the existing element by this name.";
|
|
10
10
|
/** Every name in an element input tree (the element plus its nested children) — each becomes an element's id. */
|
|
@@ -94,5 +94,4 @@ var resolveElement = (space, env, pageRef, ref) => {
|
|
|
94
94
|
if (!el || el.id === page.id) return { error: fail("ref", `Element "${ref}" not found in page "${pageRef}"`, "Name an element this page holds") };
|
|
95
95
|
return { el };
|
|
96
96
|
};
|
|
97
|
-
//#endregion
|
|
98
97
|
export { DROP_POSITION, ID_REF_HINT, collectInputRefs, createElement, folderUri, foldersUri, guardNewRef, layoutsUri, pageUri, pagesUri, resolveElement, resolveTargetRef, schemaVarsUri, settingsUri, writeInitialState };
|
|
@@ -3,7 +3,7 @@ import { connectorConnection, readEndpoint, writeEndpoint } from "./connectors/m
|
|
|
3
3
|
import { bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementQuiet, initialStateInput, interactionNode, position, ruleGroup, styleRefs, styleVariantInput } from "./schema/shared.js";
|
|
4
4
|
import { ancestors, ancestorsPatch, conditions, conditionsPatch, cssMap, cssPatchMap, definitionSlot, definitionSlotPatch, displayModeCss, displayModeCssPatch, pseudos, pseudosPatch, themeValue, variantPart, variantPartPatch } from "./style/shared.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/schemaIds.ts
|
|
7
7
|
/** The op union is the tool input of plitzi_apply (and of plitzi_render where apply is not listed), and every host
|
|
8
8
|
* reads it as JSON Schema on tools/list — on EVERY request of every conversation the server is connected to. It
|
|
9
9
|
* measured ~25k tokens a copy, which dwarfs anything a widget payload ever costs; one copy per connection is what
|
|
@@ -71,5 +71,4 @@ var claimSchemaId = (schema, id) => {
|
|
|
71
71
|
var registerSharedSchemaIds = () => {
|
|
72
72
|
for (const [schema, id] of SHARED_SCHEMAS) if (z.globalRegistry.get(schema)?.id === void 0) claimSchemaId(schema, id);
|
|
73
73
|
};
|
|
74
|
-
//#endregion
|
|
75
74
|
export { claimSchemaId, registerSharedSchemaIds };
|
|
@@ -2,7 +2,7 @@ import { defUri, defsUri } from "../../../../helpers/uris.js";
|
|
|
2
2
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
3
|
import { MODES, guardKind } from "../write.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/style/definitions/deleteDefinition.ts
|
|
6
6
|
var deleteDefinitionOp = z.object({
|
|
7
7
|
type: z.literal("deleteDefinition"),
|
|
8
8
|
ref: z.string().describe("Class ref of the definition to delete")
|
|
@@ -17,5 +17,4 @@ var deleteDefinition = (space, env, op) => {
|
|
|
17
17
|
staleResources: [defUri(env, op.ref), defsUri(env)]
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { deleteDefinition, deleteDefinitionOp };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defUri, defsUri } from "../../../../helpers/uris.js";
|
|
2
2
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
3
|
-
import { definitionToAI } from "../translator.js";
|
|
4
3
|
import { patchCssShape } from "../shared.js";
|
|
4
|
+
import { definitionToAI } from "../translator.js";
|
|
5
5
|
import { guardKind, mergePatch, writeStyleItem } from "../write.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/style/definitions/patchDefinition.ts
|
|
8
8
|
var patchDefinitionOp = z.object({
|
|
9
9
|
type: z.literal("patchDefinition"),
|
|
10
10
|
ref: z.string().describe("Existing class ref to patch"),
|
|
@@ -25,5 +25,4 @@ var patchDefinition = (space, env, op) => {
|
|
|
25
25
|
staleResources: [defUri(env, ref), defsUri(env)]
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { patchDefinition, patchDefinitionOp };
|
|
@@ -3,7 +3,7 @@ import { empty } from "../../../../helpers/opResult.js";
|
|
|
3
3
|
import { upsertCssShape } from "../shared.js";
|
|
4
4
|
import { guardKind, writeStyleItem } from "../write.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/style/definitions/upsertDefinition.ts
|
|
7
7
|
var upsertDefinitionOp = z.object({
|
|
8
8
|
type: z.literal("upsertDefinition"),
|
|
9
9
|
ref: z.string().describe("Class name you choose (kebab-case), or an existing class ref to fully replace"),
|
|
@@ -21,5 +21,4 @@ var upsertDefinition = (space, env, op) => {
|
|
|
21
21
|
staleResources: [defUri(env, ref), defsUri(env)]
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { upsertDefinition, upsertDefinitionOp };
|
|
@@ -3,7 +3,7 @@ import { empty } from "../../../../helpers/opResult.js";
|
|
|
3
3
|
import { upsertCssShape } from "../shared.js";
|
|
4
4
|
import { guardKind, writeStyleItem } from "../write.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/style/definitions/upsertDefinitions.ts
|
|
7
7
|
var definitionBody = z.object(upsertCssShape);
|
|
8
8
|
var upsertDefinitionsOp = z.object({
|
|
9
9
|
type: z.literal("upsertDefinitions"),
|
|
@@ -43,5 +43,4 @@ var upsertDefinitions = (space, env, op) => {
|
|
|
43
43
|
errors
|
|
44
44
|
} : result;
|
|
45
45
|
};
|
|
46
|
-
//#endregion
|
|
47
46
|
export { upsertDefinitions, upsertDefinitionsOp };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { fontUri, fontsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty } from "../../../../helpers/opResult.js";
|
|
2
|
+
import { fontUri, fontsUri } from "../../../../helpers/uris.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
4
|
+
// src/modules/mcp/tools/operations/style/fonts/deleteFont.ts
|
|
5
5
|
var deleteFontOp = z.object({
|
|
6
6
|
type: z.literal("deleteFont"),
|
|
7
7
|
family: z.string()
|
|
@@ -17,5 +17,4 @@ var deleteFont = (space, env, op) => {
|
|
|
17
17
|
staleResources: [fontUri(env, op.family), fontsUri(env)]
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { deleteFont, deleteFontOp };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fontUri, fontsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
2
|
+
import { fontUri, fontsUri } from "../../../../helpers/uris.js";
|
|
3
3
|
import { FontValidationError, parseSpaceFont } from "@plitzi/sdk-shared/style";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/style/fonts/upsertFont.ts
|
|
6
6
|
/**
|
|
7
7
|
* What an AGENT can say about a font, which is less than a manifest entry can hold.
|
|
8
8
|
*
|
|
@@ -62,5 +62,4 @@ var upsertFont = (space, env, op) => {
|
|
|
62
62
|
staleResources: [fontUri(env, font.family), fontsUri(env)]
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
//#endregion
|
|
66
65
|
export { upsertFont, upsertFontOp };
|
|
@@ -2,7 +2,7 @@ import { globalUri, globalsUri } from "../../../../helpers/uris.js";
|
|
|
2
2
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
3
|
import { MODES, guardKind } from "../write.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.ts
|
|
6
6
|
var deleteGlobalStyleOp = z.object({
|
|
7
7
|
type: z.literal("deleteGlobalStyle"),
|
|
8
8
|
componentType: z.string().describe("Element type whose site-wide style to remove")
|
|
@@ -17,5 +17,4 @@ var deleteGlobalStyle = (space, env, op) => {
|
|
|
17
17
|
staleResources: [globalUri(env, op.componentType), globalsUri(env)]
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { deleteGlobalStyle, deleteGlobalStyleOp };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globalUri, globalsUri } from "../../../../helpers/uris.js";
|
|
2
2
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
3
|
-
import { globalStyleToAI } from "../translator.js";
|
|
4
3
|
import { patchCssShape } from "../shared.js";
|
|
4
|
+
import { globalStyleToAI } from "../translator.js";
|
|
5
5
|
import { guardKind, mergePatch, writeStyleItem } from "../write.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.ts
|
|
8
8
|
var patchGlobalStyleOp = z.object({
|
|
9
9
|
type: z.literal("patchGlobalStyle"),
|
|
10
10
|
componentType: z.string().describe("Element type whose global style to merge into; affects ALL of that type"),
|
|
@@ -25,5 +25,4 @@ var patchGlobalStyle = (space, env, op) => {
|
|
|
25
25
|
staleResources: [globalUri(env, componentType), globalsUri(env)]
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { patchGlobalStyle, patchGlobalStyleOp };
|
|
@@ -3,7 +3,7 @@ import { empty } from "../../../../helpers/opResult.js";
|
|
|
3
3
|
import { upsertCssShape } from "../shared.js";
|
|
4
4
|
import { guardKind, writeStyleItem } from "../write.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.ts
|
|
7
7
|
var upsertGlobalStyleOp = z.object({
|
|
8
8
|
type: z.literal("upsertGlobalStyle"),
|
|
9
9
|
componentType: z.string().describe("Element type to style site-wide (e.g. \"button\"); affects ALL of that type"),
|
|
@@ -21,5 +21,4 @@ var upsertGlobalStyle = (space, env, op) => {
|
|
|
21
21
|
staleResources: [globalUri(env, componentType), globalsUri(env)]
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { upsertGlobalStyle, upsertGlobalStyleOp };
|
|
@@ -2,7 +2,7 @@ import { idUri, idsUri } from "../../../../helpers/uris.js";
|
|
|
2
2
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
3
|
import { MODES, guardKind } from "../write.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.ts
|
|
6
6
|
var deleteIdStyleOp = z.object({
|
|
7
7
|
type: z.literal("deleteIdStyle"),
|
|
8
8
|
targetId: z.string().describe("DOM id whose id rule to remove (without the # prefix)")
|
|
@@ -17,5 +17,4 @@ var deleteIdStyle = (space, env, op) => {
|
|
|
17
17
|
staleResources: [idUri(env, op.targetId), idsUri(env)]
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { deleteIdStyle, deleteIdStyleOp };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { idUri, idsUri } from "../../../../helpers/uris.js";
|
|
2
2
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
3
|
-
import { idStyleToAI } from "../translator.js";
|
|
4
3
|
import { patchCssShape } from "../shared.js";
|
|
4
|
+
import { idStyleToAI } from "../translator.js";
|
|
5
5
|
import { guardKind, mergePatch, writeStyleItem } from "../write.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/style/idStyles/patchIdStyle.ts
|
|
8
8
|
var patchIdStyleOp = z.object({
|
|
9
9
|
type: z.literal("patchIdStyle"),
|
|
10
10
|
targetId: z.string().describe("DOM id whose id rule to merge into (without the # prefix)"),
|
|
@@ -25,5 +25,4 @@ var patchIdStyle = (space, env, op) => {
|
|
|
25
25
|
staleResources: [idUri(env, targetId), idsUri(env)]
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { patchIdStyle, patchIdStyleOp };
|
|
@@ -3,7 +3,7 @@ import { empty } from "../../../../helpers/opResult.js";
|
|
|
3
3
|
import { upsertCssShape } from "../shared.js";
|
|
4
4
|
import { guardKind, writeStyleItem } from "../write.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.ts
|
|
7
7
|
var upsertIdStyleOp = z.object({
|
|
8
8
|
type: z.literal("upsertIdStyle"),
|
|
9
9
|
targetId: z.string().describe("DOM id of the element to style (without the # prefix); matches its `id` attribute"),
|
|
@@ -21,5 +21,4 @@ var upsertIdStyle = (space, env, op) => {
|
|
|
21
21
|
staleResources: [idUri(env, targetId), idsUri(env)]
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { upsertIdStyle, upsertIdStyleOp };
|
|
@@ -12,7 +12,7 @@ import { patchIdStyleOp } from "./idStyles/patchIdStyle.js";
|
|
|
12
12
|
import { upsertIdStyleOp } from "./idStyles/upsertIdStyle.js";
|
|
13
13
|
import { deleteStyleVariableOp } from "./variables/deleteStyleVariable.js";
|
|
14
14
|
import { upsertStyleVariableOp } from "./variables/upsertStyleVariable.js";
|
|
15
|
-
|
|
15
|
+
// src/modules/mcp/tools/operations/style/operations.ts
|
|
16
16
|
var styleOps = {
|
|
17
17
|
upsertDefinition: upsertDefinitionOp,
|
|
18
18
|
upsertDefinitions: upsertDefinitionsOp,
|
|
@@ -29,5 +29,4 @@ var styleOps = {
|
|
|
29
29
|
upsertFont: upsertFontOp,
|
|
30
30
|
deleteFont: deleteFontOp
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { styleOps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/tools/operations/style/shared.ts
|
|
3
3
|
var cssMap = z.record(z.string(), z.union([z.string(), z.number()])).describe("Plain kebab-case CSS. Shorthands are welcome — `border: 1px solid red`, `padding: 8px 16px`, `font: bold 16px/1.5 Arial`, `transition: opacity 200ms ease` — and are stored as their longhands so a breakpoint/state/variant can override each property on its own. Use var(--name) for style tokens and {{name}} for schema vars.");
|
|
4
4
|
var displayModeCss = z.object({
|
|
5
5
|
desktop: cssMap.optional(),
|
|
@@ -88,5 +88,4 @@ var patchCssShape = {
|
|
|
88
88
|
conditions: conditionsPatch.optional(),
|
|
89
89
|
slots: z.record(z.string(), definitionSlotPatch).optional()
|
|
90
90
|
};
|
|
91
|
-
//#endregion
|
|
92
91
|
export { ancestorCondition, ancestorConditionPatch, ancestors, ancestorsPatch, conditions, conditionsPatch, cssMap, cssPatchMap, definitionSlot, definitionSlotPatch, displayModeCss, displayModeCssPatch, patchCssShape, pseudoPart, pseudoPartPatch, pseudos, pseudosPatch, styleCategory, themeValue, upsertCssShape, variantPart, variantPartPatch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SYSTEM_FONTS, familiesInCss } from "@plitzi/sdk-shared/style";
|
|
2
|
-
|
|
2
|
+
// src/modules/mcp/tools/operations/style/translator.ts
|
|
3
3
|
var DISPLAY_MODES = [
|
|
4
4
|
"desktop",
|
|
5
5
|
"tablet",
|
|
@@ -143,5 +143,4 @@ var fontsToAI = (style) => {
|
|
|
143
143
|
namedButNotDeclared: familiesInCss(style.cache).filter((family) => !known.has(family.toLowerCase()))
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
|
-
//#endregion
|
|
147
146
|
export { definitionRefs, definitionToAI, definitionVariantNames, fontsToAI, globalStyleToAI, globalStyleTypes, globalStylesForType, idStyleIds, idStyleToAI, isClassDefinition, styleVariablesToAI };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expandShorthand } from "../../../catalogs/index.js";
|
|
2
2
|
import { fail } from "../../../helpers/opResult.js";
|
|
3
3
|
import { CONTENT_PSEUDOS, GENERATED_PSEUDOS, PSEUDO_PROPERTIES, STYLE_MOTION_CONDITIONS, STYLE_PSEUDOS, canonicalCondition, isContentValue, isStylePseudo, pseudoHonours } from "@plitzi/sdk-shared/style";
|
|
4
|
-
|
|
4
|
+
// src/modules/mcp/tools/operations/style/validate.ts
|
|
5
5
|
var MODES = [
|
|
6
6
|
"desktop",
|
|
7
7
|
"tablet",
|
|
@@ -58,5 +58,4 @@ var styleInputProblem = (base, slots) => {
|
|
|
58
58
|
}
|
|
59
59
|
return null;
|
|
60
60
|
};
|
|
61
|
-
//#endregion
|
|
62
61
|
export { styleInputProblem };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
2
|
import { styleCategory } from "../shared.js";
|
|
3
|
+
import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/style/variables/deleteStyleVariable.ts
|
|
6
6
|
var deleteStyleVariableOp = z.object({
|
|
7
7
|
type: z.literal("deleteStyleVariable"),
|
|
8
8
|
category: styleCategory,
|
|
@@ -17,5 +17,4 @@ var deleteStyleVariable = (space, env, op) => {
|
|
|
17
17
|
staleResources: [styleVarUri(env, op.category), styleVarsUri(env)]
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { deleteStyleVariable, deleteStyleVariableOp };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
|
|
2
1
|
import { empty } from "../../../../helpers/opResult.js";
|
|
3
2
|
import { styleCategory, themeValue } from "../shared.js";
|
|
3
|
+
import { styleVarUri, styleVarsUri } from "../../../../helpers/uris.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/modules/mcp/tools/operations/style/variables/upsertStyleVariable.ts
|
|
6
6
|
var upsertStyleVariableOp = z.object({
|
|
7
7
|
type: z.literal("upsertStyleVariable"),
|
|
8
8
|
category: styleCategory,
|
|
@@ -18,5 +18,4 @@ var upsertStyleVariable = (space, env, op) => {
|
|
|
18
18
|
staleResources: [styleVarUri(env, op.category), styleVarsUri(env)]
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { upsertStyleVariable, upsertStyleVariableOp };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defUri, defsUri, globalUri, globalsUri, idUri, idsUri, styleVarUri, styleVarsUri } from "../../../helpers/uris.js";
|
|
2
|
+
import { styleInputProblem } from "./validate.js";
|
|
2
3
|
import { expandShorthand, expandShorthandPatch } from "../../../catalogs/index.js";
|
|
3
4
|
import { fail } from "../../../helpers/opResult.js";
|
|
4
|
-
import { styleInputProblem } from "./validate.js";
|
|
5
5
|
import { canonicalCondition, isStylePseudo } from "@plitzi/sdk-shared/style";
|
|
6
6
|
import { processSelector } from "@plitzi/sdk-style/helpers";
|
|
7
|
-
|
|
7
|
+
// src/modules/mcp/tools/operations/style/write.ts
|
|
8
8
|
var MODES = [
|
|
9
9
|
"desktop",
|
|
10
10
|
"tablet",
|
|
@@ -216,5 +216,4 @@ var mergePatch = (existing, basePatch, slotsPatch) => {
|
|
|
216
216
|
slots: Object.keys(slots).length > 0 ? slots : void 0
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
//#endregion
|
|
220
219
|
export { MODES, defUri, defsUri, globalUri, globalsUri, guardKind, idUri, idsUri, mergePatch, styleVarUri, styleVarsUri, writeStyleItem };
|