@plitzi/sdk-mcp 0.38.3 → 0.38.5
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 +540 -0
- package/README.md +38 -12
- package/dist/createServer.d.ts +1 -1
- package/dist/createServer.js +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +1 -4
- package/dist/modules/mcp/apps/render/styles.d.ts +4 -8
- package/dist/modules/mcp/apps/render/styles.js +16 -47
- package/dist/modules/mcp/apps/render/view/index.tsx +1 -1
- package/dist/modules/mcp/catalogs/index.js +2 -2
- package/dist/modules/mcp/catalogs/pluginCatalog.js +2 -2
- package/dist/modules/mcp/e2e/mcpEndpoint.d.ts +2 -1
- package/dist/modules/mcp/handler.d.ts +2 -2
- package/dist/modules/mcp/helpers/callToolResult.d.ts +2 -0
- package/dist/modules/mcp/helpers/callToolResult.js +4 -0
- package/dist/modules/mcp/helpers/guide.js +68 -14
- package/dist/modules/mcp/helpers/index.d.ts +1 -1
- package/dist/modules/mcp/helpers/space.d.ts +4 -1
- package/dist/modules/mcp/helpers/space.js +1 -0
- package/dist/modules/mcp/helpers/uris.d.ts +2 -0
- package/dist/modules/mcp/helpers/uris.js +3 -1
- package/dist/modules/mcp/index.d.ts +1 -1
- package/dist/modules/mcp/localScreenshotClient.d.ts +3 -0
- package/dist/modules/mcp/localScreenshotClient.js +2 -0
- package/dist/modules/mcp/resources/connectors.d.ts +1 -1
- package/dist/modules/mcp/resources/core.js +2 -2
- package/dist/modules/mcp/resources/data.d.ts +8 -0
- package/dist/modules/mcp/resources/data.js +46 -0
- package/dist/modules/mcp/resources/explain.js +1 -1
- package/dist/modules/mcp/resources/primer.js +3 -3
- package/dist/modules/mcp/resources/register.js +12 -2
- package/dist/modules/mcp/resources/renderGuide.js +6 -6
- package/dist/modules/mcp/resources/router.js +3 -1
- package/dist/modules/mcp/resources/schema.js +1 -1
- package/dist/modules/mcp/server.d.ts +3 -3
- package/dist/modules/mcp/server.js +12 -8
- package/dist/modules/mcp/tools/apply/dispatch.js +9 -1
- package/dist/modules/mcp/tools/apply/index.d.ts +12 -2
- package/dist/modules/mcp/tools/apply/index.js +27 -1
- package/dist/modules/mcp/tools/index.d.ts +2 -2
- package/dist/modules/mcp/tools/index.js +2 -2
- package/dist/modules/mcp/tools/operations/connectors/index.d.ts +2 -2
- package/dist/modules/mcp/tools/operations/connectors/manifest.d.ts +1 -1
- package/dist/modules/mcp/tools/operations/connectors/patchConnector.d.ts +1 -1
- package/dist/modules/mcp/tools/operations/connectors/upsertConnector.d.ts +1 -1
- package/dist/modules/mcp/tools/operations/data/data.test.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/data/index.d.ts +32 -0
- package/dist/modules/mcp/tools/operations/data/index.js +54 -0
- package/dist/modules/mcp/tools/operations/index.d.ts +30 -4
- package/dist/modules/mcp/tools/operations/index.js +4 -1
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +5 -2
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +1 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +1 -0
- package/dist/modules/mcp/tools/operations/schema/operations.d.ts +3 -0
- package/dist/modules/mcp/tools/operations/schema/shared.d.ts +5 -0
- package/dist/modules/mcp/tools/operations/schema/shared.js +13 -7
- package/dist/modules/mcp/tools/operations/schema/translator.js +1 -1
- package/dist/modules/mcp/tools/operations/schema/write.js +3 -2
- package/dist/modules/mcp/tools/operations/schemaIds.js +3 -3
- package/dist/modules/mcp/tools/operations/style/write.js +1 -1
- package/dist/modules/mcp/tools/preview.d.ts +3 -0
- package/dist/modules/mcp/tools/render.d.ts +3 -0
- package/dist/modules/mcp/tools/screenshot.d.ts +12 -2
- package/dist/modules/mcp/tools/shared/newSuggestions.d.ts +2 -2
- package/dist/modules/mcp/tools/shared/newSuggestions.js +10 -5
- package/dist/modules/mcp/tools/shared/newSuggestions.test.d.ts +1 -0
- package/dist/modules/mcp/tools/shared/tool.d.ts +7 -6
- package/dist/modules/mcp/tools/shared/validator/index.js +2 -2
- package/dist/modules/mcp/tools/tryFunction.js +1 -1
- package/dist/modules/mcp/tools/validate.d.ts +12 -2
- package/dist/modules/mcp/types/appTypes.d.ts +2 -2
- package/dist/modules/mcp/types/toolTypes.d.ts +5 -1
- package/package.json +7 -9
- package/dist/modules/ai/AIEngine.d.ts +0 -20
- package/dist/modules/ai/AIEngine.js +0 -120
- package/dist/modules/ai/index.d.ts +0 -4
- package/dist/modules/ai/toolkit.d.ts +0 -17
- package/dist/modules/ai/toolkit.js +0 -59
- package/dist/modules/mcp/helpers/agentPrompt.d.ts +0 -4
- package/dist/modules/mcp/helpers/agentPrompt.js +0 -123
- /package/dist/modules/{ai/toolkit.test.d.ts → mcp/helpers/callToolResult.test.d.ts} +0 -0
|
@@ -53,6 +53,7 @@ export declare const documentOperation: z.ZodDiscriminatedUnion<readonly [z.ZodO
|
|
|
53
53
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
54
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
55
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
56
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
56
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
57
58
|
type: z.ZodLiteral<"deleteElement">;
|
|
58
59
|
pageRef: z.ZodString;
|
|
@@ -207,6 +208,7 @@ export declare const documentOperation: z.ZodDiscriminatedUnion<readonly [z.ZodO
|
|
|
207
208
|
skip: "skip";
|
|
208
209
|
parallel: "parallel";
|
|
209
210
|
queue: "queue";
|
|
211
|
+
latest: "latest";
|
|
210
212
|
}>>;
|
|
211
213
|
elementId: z.ZodOptional<z.ZodString>;
|
|
212
214
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -225,6 +227,7 @@ export declare const documentOperation: z.ZodDiscriminatedUnion<readonly [z.ZodO
|
|
|
225
227
|
skip: "skip";
|
|
226
228
|
parallel: "parallel";
|
|
227
229
|
queue: "queue";
|
|
230
|
+
latest: "latest";
|
|
228
231
|
}>>;
|
|
229
232
|
elementId: z.ZodOptional<z.ZodString>;
|
|
230
233
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -838,6 +841,7 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
838
841
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
839
842
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
840
843
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
844
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
841
845
|
}, z.core.$strip>, z.ZodObject<{
|
|
842
846
|
type: z.ZodLiteral<"deleteElement">;
|
|
843
847
|
pageRef: z.ZodString;
|
|
@@ -992,6 +996,7 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
992
996
|
skip: "skip";
|
|
993
997
|
parallel: "parallel";
|
|
994
998
|
queue: "queue";
|
|
999
|
+
latest: "latest";
|
|
995
1000
|
}>>;
|
|
996
1001
|
elementId: z.ZodOptional<z.ZodString>;
|
|
997
1002
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1010,6 +1015,7 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1010
1015
|
skip: "skip";
|
|
1011
1016
|
parallel: "parallel";
|
|
1012
1017
|
queue: "queue";
|
|
1018
|
+
latest: "latest";
|
|
1013
1019
|
}>>;
|
|
1014
1020
|
elementId: z.ZodOptional<z.ZodString>;
|
|
1015
1021
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1598,11 +1604,11 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1598
1604
|
file: "file";
|
|
1599
1605
|
text: "text";
|
|
1600
1606
|
color: "color";
|
|
1607
|
+
image: "image";
|
|
1601
1608
|
switch: "switch";
|
|
1602
1609
|
email: "email";
|
|
1603
1610
|
date: "date";
|
|
1604
1611
|
richText: "richText";
|
|
1605
|
-
image: "image";
|
|
1606
1612
|
multiImage: "multiImage";
|
|
1607
1613
|
video: "video";
|
|
1608
1614
|
link: "link";
|
|
@@ -1686,11 +1692,11 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1686
1692
|
file: "file";
|
|
1687
1693
|
text: "text";
|
|
1688
1694
|
color: "color";
|
|
1695
|
+
image: "image";
|
|
1689
1696
|
switch: "switch";
|
|
1690
1697
|
email: "email";
|
|
1691
1698
|
date: "date";
|
|
1692
1699
|
richText: "richText";
|
|
1693
|
-
image: "image";
|
|
1694
1700
|
multiImage: "multiImage";
|
|
1695
1701
|
video: "video";
|
|
1696
1702
|
link: "link";
|
|
@@ -1837,6 +1843,13 @@ export declare const operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1837
1843
|
}, z.core.$strip>, z.ZodObject<{
|
|
1838
1844
|
type: z.ZodLiteral<"deleteFunctionFile">;
|
|
1839
1845
|
path: z.ZodString;
|
|
1846
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1847
|
+
type: z.ZodLiteral<"upsertDataFile">;
|
|
1848
|
+
path: z.ZodString;
|
|
1849
|
+
content: z.ZodString;
|
|
1850
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1851
|
+
type: z.ZodLiteral<"deleteDataFile">;
|
|
1852
|
+
path: z.ZodString;
|
|
1840
1853
|
}, z.core.$strip>], "type">;
|
|
1841
1854
|
export type Operation = z.infer<typeof operation>;
|
|
1842
1855
|
export type OperationType = Operation['type'];
|
|
@@ -1895,6 +1908,7 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
1895
1908
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1896
1909
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1897
1910
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1911
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1898
1912
|
}, z.core.$strip>, z.ZodObject<{
|
|
1899
1913
|
type: z.ZodLiteral<"deleteElement">;
|
|
1900
1914
|
pageRef: z.ZodString;
|
|
@@ -2049,6 +2063,7 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
2049
2063
|
skip: "skip";
|
|
2050
2064
|
parallel: "parallel";
|
|
2051
2065
|
queue: "queue";
|
|
2066
|
+
latest: "latest";
|
|
2052
2067
|
}>>;
|
|
2053
2068
|
elementId: z.ZodOptional<z.ZodString>;
|
|
2054
2069
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2067,6 +2082,7 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
2067
2082
|
skip: "skip";
|
|
2068
2083
|
parallel: "parallel";
|
|
2069
2084
|
queue: "queue";
|
|
2085
|
+
latest: "latest";
|
|
2070
2086
|
}>>;
|
|
2071
2087
|
elementId: z.ZodOptional<z.ZodString>;
|
|
2072
2088
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2655,11 +2671,11 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
2655
2671
|
file: "file";
|
|
2656
2672
|
text: "text";
|
|
2657
2673
|
color: "color";
|
|
2674
|
+
image: "image";
|
|
2658
2675
|
switch: "switch";
|
|
2659
2676
|
email: "email";
|
|
2660
2677
|
date: "date";
|
|
2661
2678
|
richText: "richText";
|
|
2662
|
-
image: "image";
|
|
2663
2679
|
multiImage: "multiImage";
|
|
2664
2680
|
video: "video";
|
|
2665
2681
|
link: "link";
|
|
@@ -2743,11 +2759,11 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
2743
2759
|
file: "file";
|
|
2744
2760
|
text: "text";
|
|
2745
2761
|
color: "color";
|
|
2762
|
+
image: "image";
|
|
2746
2763
|
switch: "switch";
|
|
2747
2764
|
email: "email";
|
|
2748
2765
|
date: "date";
|
|
2749
2766
|
richText: "richText";
|
|
2750
|
-
image: "image";
|
|
2751
2767
|
multiImage: "multiImage";
|
|
2752
2768
|
video: "video";
|
|
2753
2769
|
link: "link";
|
|
@@ -2894,6 +2910,13 @@ export declare const operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
2894
2910
|
}, z.core.$strip>, z.ZodObject<{
|
|
2895
2911
|
type: z.ZodLiteral<"deleteFunctionFile">;
|
|
2896
2912
|
path: z.ZodString;
|
|
2913
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2914
|
+
type: z.ZodLiteral<"upsertDataFile">;
|
|
2915
|
+
path: z.ZodString;
|
|
2916
|
+
content: z.ZodString;
|
|
2917
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2918
|
+
type: z.ZodLiteral<"deleteDataFile">;
|
|
2919
|
+
path: z.ZodString;
|
|
2897
2920
|
}, z.core.$strip>], "type">>;
|
|
2898
2921
|
export declare const documentOperations: z.ZodArray<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
2899
2922
|
type: z.ZodLiteral<"upsertElement">;
|
|
@@ -2947,6 +2970,7 @@ export declare const documentOperations: z.ZodArray<z.ZodDiscriminatedUnion<read
|
|
|
2947
2970
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2948
2971
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2949
2972
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
2973
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
2950
2974
|
}, z.core.$strip>, z.ZodObject<{
|
|
2951
2975
|
type: z.ZodLiteral<"deleteElement">;
|
|
2952
2976
|
pageRef: z.ZodString;
|
|
@@ -3101,6 +3125,7 @@ export declare const documentOperations: z.ZodArray<z.ZodDiscriminatedUnion<read
|
|
|
3101
3125
|
skip: "skip";
|
|
3102
3126
|
parallel: "parallel";
|
|
3103
3127
|
queue: "queue";
|
|
3128
|
+
latest: "latest";
|
|
3104
3129
|
}>>;
|
|
3105
3130
|
elementId: z.ZodOptional<z.ZodString>;
|
|
3106
3131
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -3119,6 +3144,7 @@ export declare const documentOperations: z.ZodArray<z.ZodDiscriminatedUnion<read
|
|
|
3119
3144
|
skip: "skip";
|
|
3120
3145
|
parallel: "parallel";
|
|
3121
3146
|
queue: "queue";
|
|
3147
|
+
latest: "latest";
|
|
3122
3148
|
}>>;
|
|
3123
3149
|
elementId: z.ZodOptional<z.ZodString>;
|
|
3124
3150
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { actionOps } from "./actions/index.js";
|
|
2
2
|
import { connectorOps } from "./connectors/index.js";
|
|
3
|
+
import { dataOps } from "./data/index.js";
|
|
3
4
|
import { functionOps } from "./functions/index.js";
|
|
4
5
|
import { elementOps } from "./schema/operations.js";
|
|
5
6
|
import { registerSharedSchemaIds } from "./schemaIds.js";
|
|
@@ -57,7 +58,9 @@ var operation = z.discriminatedUnion("type", [
|
|
|
57
58
|
actionOps.patchAction,
|
|
58
59
|
actionOps.deleteAction,
|
|
59
60
|
functionOps.upsertFunctionFile,
|
|
60
|
-
functionOps.deleteFunctionFile
|
|
61
|
+
functionOps.deleteFunctionFile,
|
|
62
|
+
dataOps.upsertDataFile,
|
|
63
|
+
dataOps.deleteDataFile
|
|
61
64
|
]);
|
|
62
65
|
var STYLE_OP_TYPES = new Set(Object.keys(styleOps));
|
|
63
66
|
var isStyleOp = (type) => STYLE_OP_TYPES.has(type);
|
|
@@ -25,6 +25,7 @@ export declare const patchElementOp: z.ZodObject<{
|
|
|
25
25
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
26
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
27
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
28
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
28
29
|
}, z.core.$strip>;
|
|
29
30
|
export type PatchElement = z.infer<typeof patchElementOp>;
|
|
30
31
|
export declare const patchElement: (space: Space, env: Env, op: PatchElement) => OpResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findRootByRef, invalidateIndex, resolveRef } from "../../../../helpers/space.js";
|
|
2
2
|
import { pageUri } from "../../../../helpers/uris.js";
|
|
3
3
|
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
4
|
-
import { elementAnchor, elementFlag, elementMotion, elementRuntime, initialStateInput, styleRefs } from "../shared.js";
|
|
4
|
+
import { elementAnchor, elementFlag, elementMotion, elementQuiet, elementRuntime, initialStateInput, styleRefs } from "../shared.js";
|
|
5
5
|
import { guardNewRef, writeInitialState } from "../write.js";
|
|
6
6
|
import { flagGateOf } from "@plitzi/sdk-authoring";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -21,7 +21,8 @@ var patchElementOp = z.object({
|
|
|
21
21
|
runtime: elementRuntime.optional(),
|
|
22
22
|
flag: elementFlag.nullable().optional(),
|
|
23
23
|
anchor: elementAnchor.nullable().optional().describe("null removes it"),
|
|
24
|
-
motion: elementMotion.nullable().optional().describe("null removes it")
|
|
24
|
+
motion: elementMotion.nullable().optional().describe("null removes it"),
|
|
25
|
+
quiet: elementQuiet.nullable().optional()
|
|
25
26
|
}).describe("Partially update an EXISTING element: only the fields you pass change (props/style/initialState are merged, not replaced). Never creates — fails if ref does not resolve. Use upsertElement to create or fully replace.");
|
|
26
27
|
var patchElement = (space, env, op) => {
|
|
27
28
|
const page = findRootByRef(space.schema, op.pageRef);
|
|
@@ -59,6 +60,8 @@ var patchElement = (space, env, op) => {
|
|
|
59
60
|
else if (op.anchor !== void 0) el.definition.anchor = op.anchor;
|
|
60
61
|
if (op.motion === null) Reflect.deleteProperty(el.definition, "motion");
|
|
61
62
|
else if (isMotion(op.motion)) el.definition.motion = op.motion;
|
|
63
|
+
if (op.quiet === null) Reflect.deleteProperty(el.definition, "quiet");
|
|
64
|
+
else if (op.quiet !== void 0) el.definition.quiet = op.quiet;
|
|
62
65
|
return {
|
|
63
66
|
...empty(),
|
|
64
67
|
updated: 1,
|
|
@@ -37,6 +37,7 @@ var upsertElement = (space, env, op) => {
|
|
|
37
37
|
if (op.element.flag !== void 0) existing.definition.flag = flagGateOf(op.element.flag, `Element "${op.element.ref}"`);
|
|
38
38
|
if (op.element.anchor !== void 0) existing.definition.anchor = op.element.anchor;
|
|
39
39
|
if (isMotion(op.element.motion)) existing.definition.motion = op.element.motion;
|
|
40
|
+
if (op.element.quiet !== void 0) existing.definition.quiet = op.element.quiet;
|
|
40
41
|
return {
|
|
41
42
|
...empty(),
|
|
42
43
|
updated: 1,
|
|
@@ -53,6 +53,7 @@ export declare const elementOps: {
|
|
|
53
53
|
flag: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
|
|
54
54
|
anchor: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodString>>;
|
|
55
55
|
motion: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>>;
|
|
56
|
+
quiet: import('zod').ZodOptional<import('zod').ZodNullable<import('zod').ZodArray<import('zod').ZodString>>>;
|
|
56
57
|
}, import('zod/v4/core').$strip>;
|
|
57
58
|
deleteElement: import('zod').ZodObject<{
|
|
58
59
|
type: import('zod').ZodLiteral<"deleteElement">;
|
|
@@ -223,6 +224,7 @@ export declare const elementOps: {
|
|
|
223
224
|
skip: "skip";
|
|
224
225
|
parallel: "parallel";
|
|
225
226
|
queue: "queue";
|
|
227
|
+
latest: "latest";
|
|
226
228
|
}>>;
|
|
227
229
|
elementId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
228
230
|
preview: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>;
|
|
@@ -242,6 +244,7 @@ export declare const elementOps: {
|
|
|
242
244
|
skip: "skip";
|
|
243
245
|
parallel: "parallel";
|
|
244
246
|
queue: "queue";
|
|
247
|
+
latest: "latest";
|
|
245
248
|
}>>;
|
|
246
249
|
elementId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
247
250
|
preview: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>;
|
|
@@ -22,6 +22,7 @@ export interface ElementInput {
|
|
|
22
22
|
anchor?: string;
|
|
23
23
|
/** Checked by `motionProblems`: what arrives here is one, which `isMotion` narrows it to where it is written. */
|
|
24
24
|
motion?: Record<string, unknown>;
|
|
25
|
+
quiet?: string[];
|
|
25
26
|
children?: ElementInput[];
|
|
26
27
|
}
|
|
27
28
|
export declare const styleRefs: z.ZodObject<{
|
|
@@ -49,6 +50,8 @@ export declare const elementAnchor: z.ZodString;
|
|
|
49
50
|
* refused with the list of right ones, and the guide's Motion section names them all.
|
|
50
51
|
*/
|
|
51
52
|
export declare const elementMotion: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
53
|
+
/** Suggestions' codes an element is not offered, written that way on purpose; never a problem's code. */
|
|
54
|
+
export declare const elementQuiet: z.ZodArray<z.ZodString>;
|
|
52
55
|
export declare const initialStateInput: z.ZodObject<{
|
|
53
56
|
styleVariant: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>>;
|
|
54
57
|
visibility: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -75,6 +78,7 @@ export declare const elementShape: {
|
|
|
75
78
|
flag: z.ZodOptional<z.ZodString>;
|
|
76
79
|
anchor: z.ZodOptional<z.ZodString>;
|
|
77
80
|
motion: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
81
|
+
quiet: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
82
|
};
|
|
79
83
|
export declare const elementInput: z.ZodType<ElementInput>;
|
|
80
84
|
export declare const position: z.ZodEnum<{
|
|
@@ -124,6 +128,7 @@ export declare const interactionNode: z.ZodObject<{
|
|
|
124
128
|
skip: "skip";
|
|
125
129
|
parallel: "parallel";
|
|
126
130
|
queue: "queue";
|
|
131
|
+
latest: "latest";
|
|
127
132
|
}>>;
|
|
128
133
|
elementId: z.ZodOptional<z.ZodString>;
|
|
129
134
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { isSuggestionCode } from "@plitzi/sdk-authoring";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { FLAG_GATE_PATTERN } from "@plitzi/sdk-shared/flags";
|
|
3
4
|
import { ANCHOR_PATTERN } from "@plitzi/sdk-shared/schema/anchor";
|
|
4
5
|
import { motionProblems } from "@plitzi/sdk-shared/schema/motion";
|
|
6
|
+
import { WHILE_RUNNING_MODES } from "@plitzi/sdk-shared/types/SchemaTypes";
|
|
5
7
|
//#region src/modules/mcp/tools/operations/schema/shared.ts
|
|
6
8
|
var combinator = z.enum(["and", "or"]);
|
|
7
9
|
var operator = z.enum([
|
|
@@ -84,6 +86,13 @@ var elementMotion = z.record(z.string(), z.unknown()).superRefine((motion, ctx)
|
|
|
84
86
|
message: problem
|
|
85
87
|
});
|
|
86
88
|
}).describe("{enter,on,duration,delay,stagger,loop} — guide: Motion");
|
|
89
|
+
/** Suggestions' codes an element is not offered, written that way on purpose; never a problem's code. */
|
|
90
|
+
var elementQuiet = z.array(z.string()).superRefine((codes, ctx) => {
|
|
91
|
+
for (const code of codes.filter((code) => !isSuggestionCode(code))) ctx.addIssue({
|
|
92
|
+
code: "custom",
|
|
93
|
+
message: `"${code}" is no suggestion's code`
|
|
94
|
+
});
|
|
95
|
+
}).describe("Suggestion codes not offered on it, e.g. [\"repeated-shape\"]");
|
|
87
96
|
var initialStateInput = z.object({
|
|
88
97
|
styleVariant: styleVariantInput.optional().describe("Variant each attached class uses: { className: { base|slot: variantName | [names] } }"),
|
|
89
98
|
visibility: z.boolean().optional().describe("Initial visibility of the element")
|
|
@@ -99,7 +108,8 @@ var elementShape = {
|
|
|
99
108
|
runtime: elementRuntime.optional(),
|
|
100
109
|
flag: elementFlag.optional(),
|
|
101
110
|
anchor: elementAnchor.optional(),
|
|
102
|
-
motion: elementMotion.optional()
|
|
111
|
+
motion: elementMotion.optional(),
|
|
112
|
+
quiet: elementQuiet.optional()
|
|
103
113
|
};
|
|
104
114
|
var elementInput = z.lazy(() => z.object({
|
|
105
115
|
...elementShape,
|
|
@@ -147,13 +157,9 @@ var interactionNode = z.object({
|
|
|
147
157
|
params: z.record(z.string(), z.unknown()).optional(),
|
|
148
158
|
enabled: z.boolean().optional(),
|
|
149
159
|
when: ruleGroup.optional().describe("QueryBuilder RuleGroup gating this step (validated structurally)"),
|
|
150
|
-
whileRunning: z.enum(
|
|
151
|
-
"skip",
|
|
152
|
-
"parallel",
|
|
153
|
-
"queue"
|
|
154
|
-
]).optional().describe("Trigger only: a refiring while this flow runs"),
|
|
160
|
+
whileRunning: z.enum(WHILE_RUNNING_MODES).optional().describe("Trigger only: a refiring while this flow runs"),
|
|
155
161
|
elementId: z.string().optional().describe("Element whose callback this step invokes, by name; defaults to this element"),
|
|
156
162
|
preview: z.record(z.string(), z.unknown()).optional()
|
|
157
163
|
});
|
|
158
164
|
//#endregion
|
|
159
|
-
export { bindingCategory, bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementRuntime, elementShape, initialStateInput, interactionNode, interactionNodeType, position, ruleGroup, scalar, styleRefs, styleVariantInput };
|
|
165
|
+
export { bindingCategory, bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementQuiet, elementRuntime, elementShape, initialStateInput, interactionNode, interactionNodeType, position, ruleGroup, scalar, styleRefs, styleVariantInput };
|
|
@@ -2,8 +2,8 @@ import { computeVersion } from "../../../helpers/computeVersion.js";
|
|
|
2
2
|
import { descendantCount, elementById, getLayoutElements, getPageElements, nameOf, orderedChildren, pageFoldersOf, pageRefOfElement, pagesUsingLayout, slugRouteParams, spaceIndex, strOr } from "../../../helpers/space.js";
|
|
3
3
|
import { bindingsToAI, flowsFromInteractions } from "../../../helpers/interactions.js";
|
|
4
4
|
import { definitionToAI, globalStylesForType, idStyleToAI } from "../style/translator.js";
|
|
5
|
-
import { flagSpecOf, splitNotificationsCss } from "@plitzi/sdk-authoring";
|
|
6
5
|
import { descendants } from "@plitzi/sdk-schema/helpers/elementTree";
|
|
6
|
+
import { flagSpecOf, splitNotificationsCss } from "@plitzi/sdk-authoring";
|
|
7
7
|
//#region src/modules/mcp/tools/operations/schema/translator.ts
|
|
8
8
|
var splitClasses = (value) => value ? value.split(/\s+/).filter(Boolean) : [];
|
|
9
9
|
var propsOf = (el) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { findRootByRef, indexAddElement, resolveRef } from "../../../helpers/space.js";
|
|
2
2
|
import { folderUri, foldersUri, layoutsUri, pageUri, pagesUri, schemaVarsUri, settingsUri } from "../../../helpers/uris.js";
|
|
3
3
|
import { fail } from "../../../helpers/opResult.js";
|
|
4
|
-
import { flagGateOf } from "@plitzi/sdk-authoring";
|
|
5
4
|
import { documentIds } from "@plitzi/sdk-schema/helpers/components";
|
|
5
|
+
import { flagGateOf } from "@plitzi/sdk-authoring";
|
|
6
6
|
import { isMotion } from "@plitzi/sdk-shared/schema/motion";
|
|
7
7
|
import { elementIdConflict, isValidElementId } from "@plitzi/sdk-schema/helpers/elementId";
|
|
8
8
|
import FlatMap from "@plitzi/sdk-schema/helpers/FlatMap";
|
|
@@ -69,7 +69,8 @@ var createElement = (space, page, input, anchorId, drop) => {
|
|
|
69
69
|
...input.runtime === void 0 ? {} : { runtime: input.runtime },
|
|
70
70
|
...input.flag === void 0 ? {} : { flag: flagGateOf(input.flag, `Element "${input.ref}"`) },
|
|
71
71
|
...input.anchor === void 0 ? {} : { anchor: input.anchor },
|
|
72
|
-
...isMotion(input.motion) ? { motion: input.motion } : {}
|
|
72
|
+
...isMotion(input.motion) ? { motion: input.motion } : {},
|
|
73
|
+
...input.quiet === void 0 ? {} : { quiet: input.quiet }
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
76
|
if (!new FlatMap({ flat: space.schema.flat }).addElement(el, anchorId, drop)) return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { actionAccess, actionField, actionLimits, actionNode, actionTriggerParams } from "./actions/document.js";
|
|
2
2
|
import { connectorConnection, readEndpoint, writeEndpoint } from "./connectors/manifest.js";
|
|
3
|
-
import { bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, initialStateInput, interactionNode, position, ruleGroup, styleRefs, styleVariantInput } from "./schema/shared.js";
|
|
3
|
+
import { bindingInput, elementAnchor, elementFlag, elementInput, elementMotion, elementQuiet, initialStateInput, interactionNode, position, ruleGroup, styleRefs, styleVariantInput } from "./schema/shared.js";
|
|
4
4
|
import { ancestors, ancestorsPatch, cssMap, cssPatchMap, definitionSlot, definitionSlotPatch, displayModeCss, displayModeCssPatch, themeValue } from "./style/shared.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/modules/mcp/tools/operations/schemaIds.ts
|
|
@@ -19,13 +19,13 @@ import { z } from "zod";
|
|
|
19
19
|
* because the `definitions` entry and the ref cost more than the single copy they replace (measured, and reverted).
|
|
20
20
|
*
|
|
21
21
|
* The ids are the names the MODEL reads in the refs, so they are written for it: `Element`, not `ElementInput`.
|
|
22
|
-
* This runs once, at module load of the op vocabulary, so every conversion path benefits
|
|
23
|
-
* the co-worker's own tool-schema converter alike. */
|
|
22
|
+
* This runs once, at module load of the op vocabulary, so every conversion path benefits. */
|
|
24
23
|
var SHARED_SCHEMAS = [
|
|
25
24
|
[elementInput, "Element"],
|
|
26
25
|
[elementFlag, "ElementFlag"],
|
|
27
26
|
[elementAnchor, "ElementAnchor"],
|
|
28
27
|
[elementMotion, "ElementMotion"],
|
|
28
|
+
[elementQuiet, "ElementQuiet"],
|
|
29
29
|
[ruleGroup, "RuleGroup"],
|
|
30
30
|
[styleRefs, "StyleRefs"],
|
|
31
31
|
[initialStateInput, "InitialState"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { expandShorthand, expandShorthandPatch } from "../../../catalogs/index.js";
|
|
2
1
|
import { defUri, defsUri, globalUri, globalsUri, idUri, idsUri, styleVarUri, styleVarsUri } from "../../../helpers/uris.js";
|
|
2
|
+
import { expandShorthand, expandShorthandPatch } from "../../../catalogs/index.js";
|
|
3
3
|
import { fail } from "../../../helpers/opResult.js";
|
|
4
4
|
import processSelector from "@plitzi/sdk-style/helpers/processSelector";
|
|
5
5
|
//#region src/modules/mcp/tools/operations/style/write.ts
|
|
@@ -53,6 +53,7 @@ export declare const previewShape: {
|
|
|
53
53
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
54
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
55
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
56
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
56
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
57
58
|
type: z.ZodLiteral<"deleteElement">;
|
|
58
59
|
pageRef: z.ZodString;
|
|
@@ -207,6 +208,7 @@ export declare const previewShape: {
|
|
|
207
208
|
skip: "skip";
|
|
208
209
|
parallel: "parallel";
|
|
209
210
|
queue: "queue";
|
|
211
|
+
latest: "latest";
|
|
210
212
|
}>>;
|
|
211
213
|
elementId: z.ZodOptional<z.ZodString>;
|
|
212
214
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -225,6 +227,7 @@ export declare const previewShape: {
|
|
|
225
227
|
skip: "skip";
|
|
226
228
|
parallel: "parallel";
|
|
227
229
|
queue: "queue";
|
|
230
|
+
latest: "latest";
|
|
228
231
|
}>>;
|
|
229
232
|
elementId: z.ZodOptional<z.ZodString>;
|
|
230
233
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -55,6 +55,7 @@ export declare const renderShape: {
|
|
|
55
55
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
56
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
57
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
58
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
58
59
|
}, z.core.$strip>, z.ZodObject<{
|
|
59
60
|
type: z.ZodLiteral<"deleteElement">;
|
|
60
61
|
pageRef: z.ZodString;
|
|
@@ -209,6 +210,7 @@ export declare const renderShape: {
|
|
|
209
210
|
skip: "skip";
|
|
210
211
|
parallel: "parallel";
|
|
211
212
|
queue: "queue";
|
|
213
|
+
latest: "latest";
|
|
212
214
|
}>>;
|
|
213
215
|
elementId: z.ZodOptional<z.ZodString>;
|
|
214
216
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -227,6 +229,7 @@ export declare const renderShape: {
|
|
|
227
229
|
skip: "skip";
|
|
228
230
|
parallel: "parallel";
|
|
229
231
|
queue: "queue";
|
|
232
|
+
latest: "latest";
|
|
230
233
|
}>>;
|
|
231
234
|
elementId: z.ZodOptional<z.ZodString>;
|
|
232
235
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -53,6 +53,7 @@ export declare const screenshotShape: {
|
|
|
53
53
|
flag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
54
|
anchor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
55
|
motion: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
56
|
+
quiet: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
56
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
57
58
|
type: z.ZodLiteral<"deleteElement">;
|
|
58
59
|
pageRef: z.ZodString;
|
|
@@ -207,6 +208,7 @@ export declare const screenshotShape: {
|
|
|
207
208
|
skip: "skip";
|
|
208
209
|
parallel: "parallel";
|
|
209
210
|
queue: "queue";
|
|
211
|
+
latest: "latest";
|
|
210
212
|
}>>;
|
|
211
213
|
elementId: z.ZodOptional<z.ZodString>;
|
|
212
214
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -225,6 +227,7 @@ export declare const screenshotShape: {
|
|
|
225
227
|
skip: "skip";
|
|
226
228
|
parallel: "parallel";
|
|
227
229
|
queue: "queue";
|
|
230
|
+
latest: "latest";
|
|
228
231
|
}>>;
|
|
229
232
|
elementId: z.ZodOptional<z.ZodString>;
|
|
230
233
|
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -813,11 +816,11 @@ export declare const screenshotShape: {
|
|
|
813
816
|
file: "file";
|
|
814
817
|
text: "text";
|
|
815
818
|
color: "color";
|
|
819
|
+
image: "image";
|
|
816
820
|
switch: "switch";
|
|
817
821
|
email: "email";
|
|
818
822
|
date: "date";
|
|
819
823
|
richText: "richText";
|
|
820
|
-
image: "image";
|
|
821
824
|
multiImage: "multiImage";
|
|
822
825
|
video: "video";
|
|
823
826
|
link: "link";
|
|
@@ -901,11 +904,11 @@ export declare const screenshotShape: {
|
|
|
901
904
|
file: "file";
|
|
902
905
|
text: "text";
|
|
903
906
|
color: "color";
|
|
907
|
+
image: "image";
|
|
904
908
|
switch: "switch";
|
|
905
909
|
email: "email";
|
|
906
910
|
date: "date";
|
|
907
911
|
richText: "richText";
|
|
908
|
-
image: "image";
|
|
909
912
|
multiImage: "multiImage";
|
|
910
913
|
video: "video";
|
|
911
914
|
link: "link";
|
|
@@ -1052,6 +1055,13 @@ export declare const screenshotShape: {
|
|
|
1052
1055
|
}, z.core.$strip>, z.ZodObject<{
|
|
1053
1056
|
type: z.ZodLiteral<"deleteFunctionFile">;
|
|
1054
1057
|
path: z.ZodString;
|
|
1058
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1059
|
+
type: z.ZodLiteral<"upsertDataFile">;
|
|
1060
|
+
path: z.ZodString;
|
|
1061
|
+
content: z.ZodString;
|
|
1062
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1063
|
+
type: z.ZodLiteral<"deleteDataFile">;
|
|
1064
|
+
path: z.ZodString;
|
|
1055
1065
|
}, z.core.$strip>], "type">>>;
|
|
1056
1066
|
viewport: z.ZodOptional<z.ZodEnum<{
|
|
1057
1067
|
desktop: "desktop";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Space } from '../../helpers';
|
|
2
2
|
/**
|
|
3
3
|
* The shorter ways to the same page a batch opened up — a header the agent just copied onto a third page, a button it
|
|
4
|
-
* gave a text child — and none the space already had: those were said when they
|
|
5
|
-
* batch would bury the new ones. Not problems: nothing here blocks anything.
|
|
4
|
+
* gave a text child, a class it left nothing wearing — and none the space already had: those were said when they
|
|
5
|
+
* appeared, and saying them on every batch would bury the new ones. Not problems: nothing here blocks anything.
|
|
6
6
|
*/
|
|
7
7
|
export declare const newSuggestions: (before: Space, after: Space) => string[];
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { suggestSpace } from "@plitzi/sdk-authoring";
|
|
2
2
|
//#region src/modules/mcp/tools/shared/newSuggestions.ts
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* What a suggestion is about, one key each: its elements together, or — for one about declarations, which names many
|
|
5
|
+
* at once — each class, token or component on its own, so the one a batch just left unused is new beside the ones the
|
|
6
|
+
* space already had.
|
|
7
|
+
*/
|
|
8
|
+
var keysOf = ({ code, elementIds, subjects }) => subjects?.length ? subjects.map((subject) => `${code}|${subject}`) : [`${code}|${[...elementIds].sort().join(",")}`];
|
|
4
9
|
/**
|
|
5
10
|
* The shorter ways to the same page a batch opened up — a header the agent just copied onto a third page, a button it
|
|
6
|
-
* gave a text child — and none the space already had: those were said when they
|
|
7
|
-
* batch would bury the new ones. Not problems: nothing here blocks anything.
|
|
11
|
+
* gave a text child, a class it left nothing wearing — and none the space already had: those were said when they
|
|
12
|
+
* appeared, and saying them on every batch would bury the new ones. Not problems: nothing here blocks anything.
|
|
8
13
|
*/
|
|
9
14
|
var newSuggestions = (before, after) => {
|
|
10
15
|
const had = new Set(suggestSpace({
|
|
11
16
|
schema: before.schema,
|
|
12
17
|
style: before.style
|
|
13
|
-
}).
|
|
18
|
+
}).flatMap(keysOf));
|
|
14
19
|
return suggestSpace({
|
|
15
20
|
schema: after.schema,
|
|
16
21
|
style: after.style
|
|
17
|
-
}).filter((suggestion) => !had.has(
|
|
22
|
+
}).filter((suggestion) => keysOf(suggestion).some((key) => !had.has(key))).map(({ code, message, saves }) => `[${code}] ${message}${saves > 0 ? ` (saves ${String(saves)} element${saves === 1 ? "" : "s"})` : ""}`);
|
|
18
23
|
};
|
|
19
24
|
//#endregion
|
|
20
25
|
export { newSuggestions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,9 +6,9 @@ import { McpUiToolMeta } from '@modelcontextprotocol/ext-apps';
|
|
|
6
6
|
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import { ActionRunReport } from '@plitzi/sdk-shared';
|
|
8
8
|
/** Everything a tool needs at call time: the loaded space, the target environment, and the persisters (only the
|
|
9
|
-
* write tools use them). Built by whoever hosts the tools — the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* write tools use them). Built by whoever hosts the tools — the MCP server, or a host calling them in-process — so
|
|
10
|
+
* a tool's behavior never touches spaceId resolution or adapters directly. `spaceId`, `preview` and `screenshot`
|
|
11
|
+
* are present only when the host wired them (the visual-preview tools need them). */
|
|
12
12
|
export interface ToolContext {
|
|
13
13
|
space: Space;
|
|
14
14
|
env: Env;
|
|
@@ -16,7 +16,7 @@ export interface ToolContext {
|
|
|
16
16
|
spaceId?: number;
|
|
17
17
|
preview?: PreviewClient;
|
|
18
18
|
screenshot?: ScreenshotClient;
|
|
19
|
-
/** Where a rendered widget loads its external resources from, when the host wired one (see `
|
|
19
|
+
/** Where a rendered widget loads its external resources from, when the host wired one (see `McpOptions.proxy`). Only
|
|
20
20
|
* plitzi_render uses it: a widget renders inside the host's sandbox, where an undeclared origin cannot be
|
|
21
21
|
* reached at all. */
|
|
22
22
|
proxy?: ResourceProxy;
|
|
@@ -32,7 +32,8 @@ export type ToolRequires = 'screenshot';
|
|
|
32
32
|
export declare const imageResult: (images: ScreenshotImage[], meta: unknown) => CallToolResult;
|
|
33
33
|
/** What a tool author writes: identity, the input schema that is the contract sent to the agent, and a typed
|
|
34
34
|
* `run` (its args are inferred from `inputShape`, so no cast). `access` marks whether it persists — a 'write'
|
|
35
|
-
* tool
|
|
35
|
+
* tool can persist (or only preview, with `dryRun`); a 'read' tool never writes. The server advertises it as the
|
|
36
|
+
* tool's `readOnlyHint`. */
|
|
36
37
|
export interface ToolSpec<Shape extends ZodRawShape> {
|
|
37
38
|
name: string;
|
|
38
39
|
title: string;
|
|
@@ -54,7 +55,7 @@ export interface ToolSpec<Shape extends ZodRawShape> {
|
|
|
54
55
|
* something that cannot work. */
|
|
55
56
|
runPublic?: (input: z.infer<ZodObject<Shape>>, env: Env) => unknown;
|
|
56
57
|
}
|
|
57
|
-
/** What the registry holds and the
|
|
58
|
+
/** What the registry holds and the server registers from: the same metadata plus a type-erased `execute` that
|
|
58
59
|
* validates raw args against the shape and delegates to the typed `run`. Produced by `defineTool`. */
|
|
59
60
|
export interface ToolDef {
|
|
60
61
|
name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { componentView, findComponentByRef } from "../../../helpers/components.js";
|
|
2
|
+
import { findElementByRef, findFolderByRef, findPageByRef, findRootByRef, folderAncestorIds, getLayoutElements, getPageElements, pageFoldersOf, resolveRef, routeParamNames } from "../../../helpers/space.js";
|
|
1
3
|
import { observedDataSources, observedInteractionActions } from "../../../catalogs/observed.js";
|
|
2
4
|
import { buildTypeRegistry } from "../../../catalogs/registry.js";
|
|
3
5
|
import { elementTypeNames } from "../../../catalogs/index.js";
|
|
4
|
-
import { componentView, findComponentByRef } from "../../../helpers/components.js";
|
|
5
|
-
import { findElementByRef, findFolderByRef, findPageByRef, findRootByRef, folderAncestorIds, getLayoutElements, getPageElements, pageFoldersOf, resolveRef, routeParamNames } from "../../../helpers/space.js";
|
|
6
6
|
import { MAX_OPS } from "../../operations/index.js";
|
|
7
7
|
import { batchDeclaredElements, batchDeclaredFolders, batchDeclaredPages, batchDeclaredVariants, batchDeclaredVars } from "./batch.js";
|
|
8
8
|
import { checkObservedName, warnOnce } from "./context.js";
|