@dxos/plugin-script 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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/dist/lib/browser/DeploymentDialog-AEPYJKPO.mjs +12 -0
- package/dist/lib/browser/{ScriptContainer-ATBYTIFH.mjs → ScriptContainer-R25PRK2D.mjs} +6 -6
- package/dist/lib/browser/{app-graph-builder-2GIBRQLV.mjs → app-graph-builder-RRLY67QC.mjs} +2 -2
- package/dist/lib/browser/{artifact-definition-OEDM2SCN.mjs → artifact-definition-WXFYD2V5.mjs} +5 -5
- package/dist/lib/browser/artifact-definition-WXFYD2V5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QNXJNXQZ.mjs → chunk-2CGZFDCR.mjs} +4 -4
- package/dist/lib/browser/{chunk-A4VOGQ2P.mjs → chunk-4VD3K3PY.mjs} +2 -2
- package/dist/lib/browser/{chunk-OZEMT3NO.mjs → chunk-CSZXPLYY.mjs} +3 -3
- package/dist/lib/browser/{chunk-EGDYE5MW.mjs → chunk-KLEOGVXY.mjs} +6 -6
- package/dist/lib/browser/chunk-KLEOGVXY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SXS6PUU5.mjs → chunk-MQZQB5VD.mjs} +10 -9
- package/dist/lib/browser/chunk-MQZQB5VD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZFTDU4WS.mjs → chunk-R2CHVWJ2.mjs} +2 -2
- package/dist/lib/browser/chunk-SUCBNCEQ.mjs +87 -0
- package/dist/lib/browser/chunk-SUCBNCEQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KJMVDGRB.mjs → chunk-WSK3YQXI.mjs} +1 -2
- package/dist/lib/browser/{chunk-KJMVDGRB.mjs.map → chunk-WSK3YQXI.mjs.map} +2 -2
- package/dist/lib/browser/{compiler-O4FJK7RR.mjs → compiler-56LTBEQB.mjs} +3 -3
- package/dist/lib/browser/index.mjs +13 -14
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-C5D6TNPC.mjs → intent-resolver-WCVXKRBR.mjs} +10 -10
- package/dist/lib/browser/intent-resolver-WCVXKRBR.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-XJCN7XXF.mjs → react-surface-WXZVPNGI.mjs} +9 -9
- package/dist/lib/browser/{settings-NK4XVS2E.mjs → settings-Z7B37V2I.mjs} +5 -5
- package/dist/lib/browser/settings-Z7B37V2I.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{DeploymentDialog-NUKZNILK.cjs → DeploymentDialog-O4MU4OMF.cjs} +10 -10
- package/dist/lib/node/DeploymentDialog-O4MU4OMF.cjs.map +7 -0
- package/dist/lib/node/{ScriptContainer-OHHMLPUE.cjs → ScriptContainer-5KY6ZOQD.cjs} +15 -15
- package/dist/lib/node/{app-graph-builder-LNI22TZF.cjs → app-graph-builder-6I2BWD46.cjs} +9 -9
- package/dist/lib/node/{artifact-definition-SEGATFNH.cjs → artifact-definition-6NVXEHJD.cjs} +12 -12
- package/dist/lib/node/artifact-definition-6NVXEHJD.cjs.map +7 -0
- package/dist/lib/node/{chunk-PMGWL64F.cjs → chunk-65MIJR3Q.cjs} +17 -17
- package/dist/lib/node/{chunk-UUGLBCMY.cjs → chunk-F4DP7WON.cjs} +19 -19
- package/dist/lib/node/{chunk-UUGLBCMY.cjs.map → chunk-F4DP7WON.cjs.map} +3 -3
- package/dist/lib/node/{chunk-KFJQVOGS.cjs → chunk-JICWAOWZ.cjs} +6 -6
- package/dist/lib/node/{chunk-ZZ4HK5KM.cjs → chunk-SLDJM45C.cjs} +12 -12
- package/dist/lib/node/{chunk-DSFCLQ5F.cjs → chunk-VYBEBLDO.cjs} +12 -11
- package/dist/lib/node/chunk-VYBEBLDO.cjs.map +7 -0
- package/dist/lib/node/chunk-X7MHLHHS.cjs +91 -0
- package/dist/lib/node/chunk-X7MHLHHS.cjs.map +7 -0
- package/dist/lib/node/{chunk-PGEGRJP3.cjs → chunk-XFZPWFEG.cjs} +6 -6
- package/dist/lib/node/{chunk-NO5Y74F3.cjs → chunk-YJQZHKKA.cjs} +4 -5
- package/dist/lib/node/{chunk-NO5Y74F3.cjs.map → chunk-YJQZHKKA.cjs.map} +2 -2
- package/dist/lib/node/{compiler-FBC6ELQN.cjs → compiler-W2RU3M7U.cjs} +7 -7
- package/dist/lib/node/index.cjs +37 -38
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-BQPBRVHM.cjs → intent-resolver-J4NBDNFH.cjs} +17 -17
- package/dist/lib/node/intent-resolver-J4NBDNFH.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-5XHS5WYW.cjs → react-surface-27KTUBIZ.cjs} +31 -31
- package/dist/lib/node/{settings-7PVJBWC4.cjs → settings-EI6VPNKN.cjs} +9 -9
- package/dist/lib/node/settings-EI6VPNKN.cjs.map +7 -0
- package/dist/lib/node/types.cjs +5 -5
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{DeploymentDialog-BIXZ5Q57.mjs → DeploymentDialog-SSQSWLHX.mjs} +5 -5
- package/dist/lib/node-esm/{ScriptContainer-4YWGWPY7.mjs → ScriptContainer-W2F4FGDV.mjs} +6 -6
- package/dist/lib/node-esm/{app-graph-builder-NNUXXXMZ.mjs → app-graph-builder-H5XLRVX3.mjs} +2 -2
- package/dist/lib/node-esm/{artifact-definition-5UHIXXHW.mjs → artifact-definition-KQ64AYBP.mjs} +5 -5
- package/dist/lib/node-esm/artifact-definition-KQ64AYBP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4ISQLIIH.mjs → chunk-4MTPYMV2.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-HKJUN636.mjs → chunk-EB5DSAD4.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-TN35DSTF.mjs → chunk-F4HA5C34.mjs} +10 -9
- package/dist/lib/node-esm/chunk-F4HA5C34.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-H7FRB3M7.mjs → chunk-FDEAVT67.mjs} +1 -2
- package/dist/lib/node-esm/{chunk-H7FRB3M7.mjs.map → chunk-FDEAVT67.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-GR4VTXVM.mjs → chunk-MU3JKVL2.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-NNQXJQBG.mjs → chunk-PBGVTGL2.mjs} +6 -6
- package/dist/lib/node-esm/chunk-PBGVTGL2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QDYGTY4L.mjs +89 -0
- package/dist/lib/node-esm/chunk-QDYGTY4L.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KGYTIL33.mjs → chunk-RW2APVMV.mjs} +2 -2
- package/dist/lib/node-esm/{compiler-3NG4T5LH.mjs → compiler-VT5C2Z3T.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +13 -14
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-PPJKPHUQ.mjs → intent-resolver-PDZ2A26X.mjs} +10 -10
- package/dist/lib/node-esm/intent-resolver-PDZ2A26X.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7ELFL7IO.mjs → react-surface-UCUVDVSH.mjs} +9 -9
- package/dist/lib/node-esm/{settings-SJYC4JLT.mjs → settings-HU5UEFRF.mjs} +5 -5
- package/dist/lib/node-esm/settings-HU5UEFRF.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +2 -2
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/templates/data-generator.d.ts +7 -0
- package/dist/types/src/templates/data-generator.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/package.json +47 -47
- package/src/ScriptPlugin.tsx +1 -3
- package/src/capabilities/artifact-definition.ts +3 -3
- package/src/capabilities/intent-resolver.ts +3 -3
- package/src/capabilities/settings.ts +2 -2
- package/src/hooks/useToolbarState.ts +2 -2
- package/src/meta.ts +0 -1
- package/src/templates/data-generator.ts +45 -25
- package/src/templates/discord.ts +2 -2
- package/src/templates/gmail.ts +2 -2
- package/src/util/deploy.ts +7 -4
- package/dist/lib/browser/DeploymentDialog-QEKJ54ZB.mjs +0 -12
- package/dist/lib/browser/artifact-definition-OEDM2SCN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EGDYE5MW.mjs.map +0 -7
- package/dist/lib/browser/chunk-SXS6PUU5.mjs.map +0 -7
- package/dist/lib/browser/chunk-XEPVXV72.mjs +0 -87
- package/dist/lib/browser/chunk-XEPVXV72.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-C5D6TNPC.mjs.map +0 -7
- package/dist/lib/browser/settings-NK4XVS2E.mjs.map +0 -7
- package/dist/lib/node/DeploymentDialog-NUKZNILK.cjs.map +0 -7
- package/dist/lib/node/artifact-definition-SEGATFNH.cjs.map +0 -7
- package/dist/lib/node/chunk-4K23KEYT.cjs +0 -91
- package/dist/lib/node/chunk-4K23KEYT.cjs.map +0 -7
- package/dist/lib/node/chunk-DSFCLQ5F.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-BQPBRVHM.cjs.map +0 -7
- package/dist/lib/node/settings-7PVJBWC4.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-5UHIXXHW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NNQXJQBG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TN35DSTF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X64SI6XO.mjs +0 -89
- package/dist/lib/node-esm/chunk-X64SI6XO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-PPJKPHUQ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-SJYC4JLT.mjs.map +0 -7
- /package/dist/lib/browser/{DeploymentDialog-QEKJ54ZB.mjs.map → DeploymentDialog-AEPYJKPO.mjs.map} +0 -0
- /package/dist/lib/browser/{ScriptContainer-ATBYTIFH.mjs.map → ScriptContainer-R25PRK2D.mjs.map} +0 -0
- /package/dist/lib/browser/{app-graph-builder-2GIBRQLV.mjs.map → app-graph-builder-RRLY67QC.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-QNXJNXQZ.mjs.map → chunk-2CGZFDCR.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-A4VOGQ2P.mjs.map → chunk-4VD3K3PY.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-OZEMT3NO.mjs.map → chunk-CSZXPLYY.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-ZFTDU4WS.mjs.map → chunk-R2CHVWJ2.mjs.map} +0 -0
- /package/dist/lib/browser/{compiler-O4FJK7RR.mjs.map → compiler-56LTBEQB.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-XJCN7XXF.mjs.map → react-surface-WXZVPNGI.mjs.map} +0 -0
- /package/dist/lib/node/{ScriptContainer-OHHMLPUE.cjs.map → ScriptContainer-5KY6ZOQD.cjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-LNI22TZF.cjs.map → app-graph-builder-6I2BWD46.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-PMGWL64F.cjs.map → chunk-65MIJR3Q.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-KFJQVOGS.cjs.map → chunk-JICWAOWZ.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-ZZ4HK5KM.cjs.map → chunk-SLDJM45C.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-PGEGRJP3.cjs.map → chunk-XFZPWFEG.cjs.map} +0 -0
- /package/dist/lib/node/{compiler-FBC6ELQN.cjs.map → compiler-W2RU3M7U.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-5XHS5WYW.cjs.map → react-surface-27KTUBIZ.cjs.map} +0 -0
- /package/dist/lib/node-esm/{DeploymentDialog-BIXZ5Q57.mjs.map → DeploymentDialog-SSQSWLHX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ScriptContainer-4YWGWPY7.mjs.map → ScriptContainer-W2F4FGDV.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-NNUXXXMZ.mjs.map → app-graph-builder-H5XLRVX3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-4ISQLIIH.mjs.map → chunk-4MTPYMV2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-HKJUN636.mjs.map → chunk-EB5DSAD4.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-GR4VTXVM.mjs.map → chunk-MU3JKVL2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-KGYTIL33.mjs.map → chunk-RW2APVMV.mjs.map} +0 -0
- /package/dist/lib/node-esm/{compiler-3NG4T5LH.mjs.map → compiler-VT5C2Z3T.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-7ELFL7IO.mjs.map → react-surface-UCUVDVSH.mjs.map} +0 -0
|
@@ -26,19 +26,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var react_surface_27KTUBIZ_exports = {};
|
|
30
|
+
__export(react_surface_27KTUBIZ_exports, {
|
|
31
31
|
default: () => react_surface_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(react_surface_27KTUBIZ_exports);
|
|
34
|
+
var import_chunk_JICWAOWZ = require("./chunk-JICWAOWZ.cjs");
|
|
35
|
+
var import_chunk_F4DP7WON = require("./chunk-F4DP7WON.cjs");
|
|
36
|
+
var import_chunk_SLDJM45C = require("./chunk-SLDJM45C.cjs");
|
|
37
|
+
var import_chunk_65MIJR3Q = require("./chunk-65MIJR3Q.cjs");
|
|
38
|
+
var import_chunk_X7MHLHHS = require("./chunk-X7MHLHHS.cjs");
|
|
39
|
+
var import_chunk_VYBEBLDO = require("./chunk-VYBEBLDO.cjs");
|
|
40
|
+
var import_chunk_XFZPWFEG = require("./chunk-XFZPWFEG.cjs");
|
|
41
|
+
var import_chunk_YJQZHKKA = require("./chunk-YJQZHKKA.cjs");
|
|
42
42
|
var import_react = __toESM(require("react"));
|
|
43
43
|
var import_app_framework = require("@dxos/app-framework");
|
|
44
44
|
var import_devtools = require("@dxos/devtools");
|
|
@@ -49,21 +49,21 @@ var import_echo = require("@dxos/react-client/echo");
|
|
|
49
49
|
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
50
50
|
var react_surface_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
|
|
51
51
|
(0, import_app_framework.createSurface)({
|
|
52
|
-
id: `${
|
|
52
|
+
id: `${import_chunk_YJQZHKKA.meta.id}/plugin-settings`,
|
|
53
53
|
role: "article",
|
|
54
|
-
filter: (data) => data.subject instanceof import_local_storage.SettingsStore && data.subject.prefix ===
|
|
55
|
-
component: ({ data: { subject } }) => /* @__PURE__ */ import_react.default.createElement(
|
|
54
|
+
filter: (data) => data.subject instanceof import_local_storage.SettingsStore && data.subject.prefix === import_chunk_YJQZHKKA.meta.id,
|
|
55
|
+
component: ({ data: { subject } }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_SLDJM45C.ScriptPluginSettings, {
|
|
56
56
|
settings: subject.value
|
|
57
57
|
})
|
|
58
58
|
}),
|
|
59
59
|
(0, import_app_framework.createSurface)({
|
|
60
|
-
id: `${
|
|
60
|
+
id: `${import_chunk_YJQZHKKA.meta.id}/article`,
|
|
61
61
|
role: "article",
|
|
62
62
|
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.ScriptType, data.subject),
|
|
63
63
|
component: ({ data, role }) => {
|
|
64
|
-
const compiler = (0, import_app_framework.useCapability)(
|
|
65
|
-
const settings = (0, import_app_framework.useCapability)(import_app_framework.Capabilities.SettingsStore).getStore(
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
const compiler = (0, import_app_framework.useCapability)(import_chunk_JICWAOWZ.ScriptCapabilities.Compiler);
|
|
65
|
+
const settings = (0, import_app_framework.useCapability)(import_app_framework.Capabilities.SettingsStore).getStore(import_chunk_YJQZHKKA.meta.id)?.value;
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement(import_chunk_SLDJM45C.ScriptContainer, {
|
|
67
67
|
role,
|
|
68
68
|
script: data.subject,
|
|
69
69
|
settings,
|
|
@@ -72,40 +72,40 @@ var react_surface_default = () => (0, import_app_framework.contributes)(import_a
|
|
|
72
72
|
}
|
|
73
73
|
}),
|
|
74
74
|
(0, import_app_framework.createSurface)({
|
|
75
|
-
id: `${
|
|
75
|
+
id: `${import_chunk_YJQZHKKA.meta.id}/companion/base-settings`,
|
|
76
76
|
role: "base-object-settings",
|
|
77
77
|
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.ScriptType, data.subject),
|
|
78
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
78
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_SLDJM45C.ScriptProperties, {
|
|
79
79
|
object: data.subject
|
|
80
80
|
})
|
|
81
81
|
}),
|
|
82
82
|
(0, import_app_framework.createSurface)({
|
|
83
|
-
id: `${
|
|
83
|
+
id: `${import_chunk_YJQZHKKA.meta.id}/companion/settings`,
|
|
84
84
|
role: "object-settings",
|
|
85
85
|
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.ScriptType, data.subject),
|
|
86
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
86
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_SLDJM45C.ScriptObjectSettings, {
|
|
87
87
|
object: data.subject
|
|
88
88
|
})
|
|
89
89
|
}),
|
|
90
90
|
(0, import_app_framework.createSurface)({
|
|
91
|
-
id: `${
|
|
91
|
+
id: `${import_chunk_YJQZHKKA.meta.id}/companion/execute`,
|
|
92
92
|
role: "article",
|
|
93
93
|
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.ScriptType, data.companionTo) && data.subject === "execute",
|
|
94
94
|
component: ({ data, role }) => {
|
|
95
|
-
const state = (0,
|
|
96
|
-
(0,
|
|
95
|
+
const state = (0, import_chunk_F4DP7WON.useToolbarState)();
|
|
96
|
+
(0, import_chunk_F4DP7WON.useDeployState)({
|
|
97
97
|
state,
|
|
98
98
|
script: data.companionTo
|
|
99
99
|
});
|
|
100
100
|
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
101
101
|
role
|
|
102
|
-
}, /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_SLDJM45C.TestPanel, {
|
|
103
103
|
functionUrl: state.functionUrl
|
|
104
104
|
}));
|
|
105
105
|
}
|
|
106
106
|
}),
|
|
107
107
|
(0, import_app_framework.createSurface)({
|
|
108
|
-
id: `${
|
|
108
|
+
id: `${import_chunk_YJQZHKKA.meta.id}/companion/logs`,
|
|
109
109
|
role: "article",
|
|
110
110
|
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.ScriptType, data.companionTo) && data.subject === "logs",
|
|
111
111
|
component: ({ data, role }) => {
|
|
@@ -120,10 +120,10 @@ var react_surface_default = () => (0, import_app_framework.contributes)(import_a
|
|
|
120
120
|
}
|
|
121
121
|
}),
|
|
122
122
|
(0, import_app_framework.createSurface)({
|
|
123
|
-
id:
|
|
123
|
+
id: import_chunk_65MIJR3Q.DEPLOYMENT_DIALOG,
|
|
124
124
|
role: "dialog",
|
|
125
|
-
filter: (data) => data.component ===
|
|
126
|
-
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
filter: (data) => data.component === import_chunk_65MIJR3Q.DEPLOYMENT_DIALOG,
|
|
126
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_SLDJM45C.DeploymentDialog, data.props)
|
|
127
127
|
})
|
|
128
128
|
]);
|
|
129
|
-
//# sourceMappingURL=react-surface-
|
|
129
|
+
//# sourceMappingURL=react-surface-27KTUBIZ.cjs.map
|
|
@@ -16,23 +16,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var settings_EI6VPNKN_exports = {};
|
|
20
|
+
__export(settings_EI6VPNKN_exports, {
|
|
21
21
|
default: () => settings_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(settings_EI6VPNKN_exports);
|
|
24
|
+
var import_chunk_XFZPWFEG = require("./chunk-XFZPWFEG.cjs");
|
|
25
|
+
var import_chunk_YJQZHKKA = require("./chunk-YJQZHKKA.cjs");
|
|
26
26
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
27
|
var import_live_object = require("@dxos/live-object");
|
|
28
28
|
var settings_default = () => {
|
|
29
|
-
const settings = (0, import_live_object.
|
|
29
|
+
const settings = (0, import_live_object.create)(import_chunk_XFZPWFEG.ScriptSettingsSchema, {
|
|
30
30
|
editorInputMode: "vscode"
|
|
31
31
|
});
|
|
32
32
|
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.Settings, {
|
|
33
|
-
schema:
|
|
34
|
-
prefix:
|
|
33
|
+
schema: import_chunk_XFZPWFEG.ScriptSettingsSchema,
|
|
34
|
+
prefix: import_chunk_YJQZHKKA.meta.id,
|
|
35
35
|
value: settings
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=settings-
|
|
38
|
+
//# sourceMappingURL=settings-EI6VPNKN.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/settings.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { meta } from '../meta';\nimport { ScriptSettingsSchema } from '../types';\n\nexport default () => {\n const settings = create(ScriptSettingsSchema, { editorInputMode: 'vscode' });\n return contributes(Capabilities.Settings, { schema: ScriptSettingsSchema, prefix: meta.id, value: settings });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA0C;AAC1C,yBAAuB;AAKvB,IAAA,mBAAe,MAAA;AACb,QAAMA,eAAWC,2BAAOC,4CAAsB;IAAEC,iBAAiB;EAAS,CAAA;AAC1E,aAAOC,kCAAYC,kCAAaC,UAAU;IAAEC,QAAQL;IAAsBM,QAAQC,2BAAKC;IAAIC,OAAOX;EAAS,CAAA;AAC7G;",
|
|
6
|
+
"names": ["settings", "create", "ScriptSettingsSchema", "editorInputMode", "contributes", "Capabilities", "Settings", "schema", "prefix", "meta", "id", "value"]
|
|
7
|
+
}
|
package/dist/lib/node/types.cjs
CHANGED
|
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
SCRIPT_PLUGIN: () =>
|
|
22
|
-
ScriptAction: () =>
|
|
23
|
-
ScriptSettingsSchema: () =>
|
|
21
|
+
SCRIPT_PLUGIN: () => import_chunk_YJQZHKKA.SCRIPT_PLUGIN,
|
|
22
|
+
ScriptAction: () => import_chunk_XFZPWFEG.ScriptAction,
|
|
23
|
+
ScriptSettingsSchema: () => import_chunk_XFZPWFEG.ScriptSettingsSchema
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(types_exports);
|
|
26
|
-
var
|
|
27
|
-
var
|
|
26
|
+
var import_chunk_XFZPWFEG = require("./chunk-XFZPWFEG.cjs");
|
|
27
|
+
var import_chunk_YJQZHKKA = require("./chunk-YJQZHKKA.cjs");
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
|
30
30
|
SCRIPT_PLUGIN,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["types.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n ScriptAction,\n ScriptSettingsSchema\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n ScriptAction,\n ScriptSettingsSchema\n} from \"./chunk-XFZPWFEG.cjs\";\nimport {\n SCRIPT_PLUGIN\n} from \"./chunk-YJQZHKKA.cjs\";\nexport {\n SCRIPT_PLUGIN,\n ScriptAction,\n ScriptSettingsSchema\n};\n//# sourceMappingURL=types.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;AACP,4BAEO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,12 +2,12 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
DEPLOYMENT_DIALOG,
|
|
4
4
|
DeploymentDialog_default
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-MU3JKVL2.mjs";
|
|
6
|
+
import "./chunk-F4HA5C34.mjs";
|
|
7
|
+
import "./chunk-RW2APVMV.mjs";
|
|
8
|
+
import "./chunk-FDEAVT67.mjs";
|
|
9
9
|
export {
|
|
10
10
|
DEPLOYMENT_DIALOG,
|
|
11
11
|
DeploymentDialog_default as default
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=DeploymentDialog-
|
|
13
|
+
//# sourceMappingURL=DeploymentDialog-SSQSWLHX.mjs.map
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
useDeployState,
|
|
7
7
|
useToolbarAction,
|
|
8
8
|
useToolbarState
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-PBGVTGL2.mjs";
|
|
10
|
+
import "./chunk-QDYGTY4L.mjs";
|
|
11
|
+
import "./chunk-F4HA5C34.mjs";
|
|
12
|
+
import "./chunk-RW2APVMV.mjs";
|
|
13
|
+
import "./chunk-FDEAVT67.mjs";
|
|
14
14
|
|
|
15
15
|
// packages/plugins/plugin-script/src/components/ScriptContainer.tsx
|
|
16
16
|
import React3, { useMemo } from "react";
|
|
@@ -246,4 +246,4 @@ export {
|
|
|
246
246
|
ScriptContainer,
|
|
247
247
|
ScriptContainer_default as default
|
|
248
248
|
};
|
|
249
|
-
//# sourceMappingURL=ScriptContainer-
|
|
249
|
+
//# sourceMappingURL=ScriptContainer-W2F4FGDV.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
meta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FDEAVT67.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-script/src/capabilities/app-graph-builder.ts
|
|
7
7
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
@@ -62,4 +62,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
62
62
|
export {
|
|
63
63
|
app_graph_builder_default as default
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=app-graph-builder-
|
|
65
|
+
//# sourceMappingURL=app-graph-builder-H5XLRVX3.mjs.map
|
package/dist/lib/node-esm/{artifact-definition-5UHIXXHW.mjs → artifact-definition-KQ64AYBP.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
meta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FDEAVT67.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-script/src/capabilities/artifact-definition.ts
|
|
7
7
|
import { Capabilities, contributes, createIntent } from "@dxos/app-framework";
|
|
@@ -11,7 +11,7 @@ import { ObjectId, S } from "@dxos/echo-schema";
|
|
|
11
11
|
import { ScriptType } from "@dxos/functions/types";
|
|
12
12
|
import { invariant } from "@dxos/invariant";
|
|
13
13
|
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
14
|
-
import {
|
|
14
|
+
import { create, makeRef } from "@dxos/react-client/echo";
|
|
15
15
|
import { TextType } from "@dxos/schema";
|
|
16
16
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-script/src/capabilities/artifact-definition.ts";
|
|
17
17
|
var artifact_definition_default = () => {
|
|
@@ -163,9 +163,9 @@ var artifact_definition_default = () => {
|
|
|
163
163
|
"'No intent dispatcher'"
|
|
164
164
|
]
|
|
165
165
|
});
|
|
166
|
-
const script =
|
|
166
|
+
const script = create(ScriptType, {
|
|
167
167
|
name,
|
|
168
|
-
source: makeRef(
|
|
168
|
+
source: makeRef(create(TextType, {
|
|
169
169
|
content: code
|
|
170
170
|
}))
|
|
171
171
|
});
|
|
@@ -250,4 +250,4 @@ var artifact_definition_default = () => {
|
|
|
250
250
|
export {
|
|
251
251
|
artifact_definition_default as default
|
|
252
252
|
};
|
|
253
|
-
//# sourceMappingURL=artifact-definition-
|
|
253
|
+
//# sourceMappingURL=artifact-definition-KQ64AYBP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/artifact-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { ObjectId, S } from '@dxos/echo-schema';\nimport { ScriptType } from '@dxos/functions/types';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { create, makeRef, type Space } from '@dxos/react-client/echo';\nimport { TextType } from '@dxos/schema';\n\nimport { meta } from '../meta';\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: `artifact:${meta.id}`,\n name: meta.name,\n // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,\n // we should offload the work of synthesizing the code to a separate model.\n // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.\n instructions: `\n If the user explicitly requests you to write a script, you can create one.\n If the user requests you to change one of the existing script, you can update it.\n You must not create a script unless the user explicitly requests it.\n Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.\n Each script must follow as strict shape for the definition but the body can contain any valid executable code.\n Scripts are written in JavaScript or TypeScript.\n Each script must define an input schema and output schema.\n Each script must have its own detailed description.\n\n Important: You cannot execute scripts. Scripts are only available as tools after the user deploys them. You must only call the available tools.\n\n Description:\n The description is a detailed description of the script.\n It is used to describe the script's purpose, input, and output.\n The description is used to generate the script's documentation.\n The description is also goes into the script metadata.\n The description is used by AI to understand the script and its purpose.\n The description must provide cases on when the script should be used.\n\n Schema: \n The schema is defined using a schema-DSL library called Effect Schema.\n The input schema describes the arguments that the script accepts.\n The output schema describes the result that the script produces.\n The schema is used to validate the script's input and output.\n The schema is also goes into the script metadata.\n The properties in the schema must have valid descriptions.\n The input and output schemas must both be a struct of fields.\n\n Restricts:\n The scripts can only import code from \"dxos:functions\" module. No other modules are allowed.\n Some web APIs are available - like fetch.\n\n Reasoning:\n Before writing a script, synthesize the following information:\n - Description\n - What APIs will be used.\n - Detailed input schema\n - Detailed output schema\n\n <apis>\n export function defineFunction(params: { \n description: string, \n inputSchema: S.Schema, \n outputSchema: S.Schema, \n handler: (params: { event: { data: TInput } }) => Promise<TOutput> \n }): FunctionDefinition\n /**\n * Effect Schema\n */\n export const S; \n\n // Examples: \n\n S.String\n S.Number\n S.Boolean\n S.Struct({\n from: S.String.annotations({ description: 'The source currency' }),\n to: S.String.annotations({ description: 'The target currency' }),\n })\n S.Array(S.String)\n S.Union(S.String, S.Number)\n S.optional(S.String)\n S.String.annotations({ description: 'The source currency' })\n </apis>\n\n <handler_function>\n Async function that takes the argument in the form of:\n\n type HandlerFunctionParam = {\n event: {\n data: T // The input schema\n },\n }\n\n The function must return the result that matches the output schema.\n </handler_function>\n \n <example>\n import { defineFunction, S } from 'dxos:functions';\n\n export default defineFunction({\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: S.Struct({\n from: S.String.annotations({ description: 'The source currency' }),\n to: S.String.annotations({ description: 'The target currency' }),\n }),\n\n outputSchema: S.Struct({\n rate: S.String.annotations({ description: 'The exchange rate' }),\n }),\n\n handler: async ({\n event: {\n data: { from, to },\n },\n }: any) => {\n const res = await fetch(\\`https://free.ratesdb.com/v1/rates?from=\\${from}&to=\\${to}\\`);\n const {\n data: { rates },\n } = await res.json();\n\n return { rate: rates[to].toString() };\n },\n });\n </example>\n `,\n schema: ScriptType,\n tools: [\n defineTool(meta.id, {\n name: 'create',\n description: 'Create a new script. Returns the artifact definition for the script',\n caption: 'Creating script...',\n schema: S.Struct({\n name: S.String.annotations({ description: 'The name of the script' }),\n code: S.String.annotations({\n description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',\n }),\n }),\n execute: async ({ name, code }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const script = create(ScriptType, {\n name,\n source: makeRef(\n create(TextType, {\n content: code,\n }),\n ),\n });\n extensions.space.db.add(script);\n await extensions.space.db.flush();\n\n const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(script.id));\n },\n }),\n defineTool(meta.id, {\n name: 'inspect',\n description: 'Inspect a script. Returns the artifact definition for the script',\n caption: 'Inspecting script...',\n schema: S.Struct({\n id: ObjectId,\n }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n\n const script = (await extensions.space.db.query({ id }).first()) as ScriptType;\n const { content } = await script.source.load();\n\n return ToolResult.Success({\n name: script.name,\n code: content,\n });\n },\n }),\n defineTool(meta.id, {\n name: 'update',\n description: 'Update a script. Returns the artifact definition for the script',\n caption: 'Updating script...',\n schema: S.Struct({\n id: ObjectId,\n code: S.String.annotations({\n description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',\n }),\n }),\n execute: async ({ id, code }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n\n const script = (await extensions.space.db.query({ id }).first()) as ScriptType;\n const source = await script.source.load();\n if (!source) {\n return ToolResult.Error('Script not found');\n }\n\n source.content = code;\n await extensions.space?.db.flush();\n\n return ToolResult.Success({\n name: script.name,\n });\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
+
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Q,GAAGE,MAAAA;AAE3B,iBAAOS,WAAWG,QAAQ;YACxBtC,MAAMkB,OAAOlB;UACf,CAAA;QACF;MACF,CAAA;;EAEJ,CAAA;AAEA,SAAO4C,YAAYC,aAAaC,oBAAoBlD,UAAAA;AACtD;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "createIntent", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "ObjectId", "S", "ScriptType", "invariant", "SpaceAction", "create", "makeRef", "TextType", "definition", "defineArtifact", "id", "meta", "name", "instructions", "schema", "ScriptType", "tools", "defineTool", "description", "caption", "S", "Struct", "String", "annotations", "code", "execute", "extensions", "invariant", "space", "dispatch", "script", "create", "source", "makeRef", "TextType", "content", "db", "add", "flush", "intent", "createIntent", "SpaceAction", "AddObject", "target", "object", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "ObjectId", "query", "first", "load", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
+
}
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
SCRIPT_PLUGIN,
|
|
4
4
|
meta
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FDEAVT67.mjs";
|
|
6
6
|
|
|
7
7
|
// packages/plugins/plugin-script/src/components/Settings/ScriptObjectSettings.tsx
|
|
8
8
|
import { Octokit } from "@octokit/core";
|
|
@@ -467,8 +467,8 @@ var RobotAvatar = () => /* @__PURE__ */ React3.createElement(Avatar.Root, null,
|
|
|
467
467
|
|
|
468
468
|
// packages/plugins/plugin-script/src/components/index.ts
|
|
469
469
|
import { lazy } from "react";
|
|
470
|
-
var ScriptContainer = lazy(() => import("./ScriptContainer-
|
|
471
|
-
var DeploymentDialog = lazy(() => import("./DeploymentDialog-
|
|
470
|
+
var ScriptContainer = lazy(() => import("./ScriptContainer-W2F4FGDV.mjs"));
|
|
471
|
+
var DeploymentDialog = lazy(() => import("./DeploymentDialog-SSQSWLHX.mjs"));
|
|
472
472
|
|
|
473
473
|
export {
|
|
474
474
|
ScriptObjectSettings,
|
|
@@ -478,4 +478,4 @@ export {
|
|
|
478
478
|
ScriptContainer,
|
|
479
479
|
DeploymentDialog
|
|
480
480
|
};
|
|
481
|
-
//# sourceMappingURL=chunk-
|
|
481
|
+
//# sourceMappingURL=chunk-4MTPYMV2.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
meta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FDEAVT67.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-script/src/capabilities/capabilities.ts
|
|
7
7
|
import { defineCapability } from "@dxos/app-framework";
|
|
@@ -13,4 +13,4 @@ var ScriptCapabilities;
|
|
|
13
13
|
export {
|
|
14
14
|
ScriptCapabilities
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-EB5DSAD4.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ScriptAction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RW2APVMV.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-script/src/util/functions.ts
|
|
7
7
|
import { getInvocationUrl, getUserFunctionUrlInMetadata } from "@dxos/functions";
|
|
@@ -60,10 +60,10 @@ var updateFunctionMetadata = (script, storedFunction, meta, functionId) => {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
// packages/plugins/plugin-script/src/util/deploy.ts
|
|
63
|
-
import { FunctionType, getUserFunctionUrlInMetadata as getUserFunctionUrlInMetadata2, incrementSemverPatch,
|
|
63
|
+
import { FunctionType, getUserFunctionUrlInMetadata as getUserFunctionUrlInMetadata2, incrementSemverPatch, setUserFunctionUrlInMetadata, uploadWorkerFunction } from "@dxos/functions";
|
|
64
64
|
import { Bundler } from "@dxos/functions/bundler";
|
|
65
65
|
import { log as log2 } from "@dxos/log";
|
|
66
|
-
import {
|
|
66
|
+
import { create, getMeta as getMeta2, makeRef } from "@dxos/react-client/echo";
|
|
67
67
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-script/src/util/deploy.ts";
|
|
68
68
|
var isScriptDeployed = ({ script, fn }) => {
|
|
69
69
|
const existingFunctionUrl = fn && getUserFunctionUrlInMetadata2(getMeta2(fn));
|
|
@@ -99,9 +99,7 @@ var deployScript = async ({ script, client, space, fn, existingFunctionUrl }) =>
|
|
|
99
99
|
const storedFunction = createOrUpdateFunctionInSpace(space, fn, script, functionId, version);
|
|
100
100
|
script.changed = false;
|
|
101
101
|
updateFunctionMetadata(script, storedFunction, meta, functionId);
|
|
102
|
-
const functionUrl = makeFunctionUrl(space.id,
|
|
103
|
-
functionId
|
|
104
|
-
});
|
|
102
|
+
const functionUrl = makeFunctionUrl(space.id, functionId);
|
|
105
103
|
setUserFunctionUrlInMetadata(getMeta2(storedFunction), functionUrl);
|
|
106
104
|
return {
|
|
107
105
|
success: true,
|
|
@@ -110,7 +108,7 @@ var deployScript = async ({ script, client, space, fn, existingFunctionUrl }) =>
|
|
|
110
108
|
} catch (err) {
|
|
111
109
|
log2.catch(err, void 0, {
|
|
112
110
|
F: __dxlog_file2,
|
|
113
|
-
L:
|
|
111
|
+
L: 79,
|
|
114
112
|
S: void 0,
|
|
115
113
|
C: (f, a) => f(...a)
|
|
116
114
|
});
|
|
@@ -152,13 +150,16 @@ var createOrUpdateFunctionInSpace = (space, fn, script, functionId, version) =>
|
|
|
152
150
|
fn.version = version;
|
|
153
151
|
return fn;
|
|
154
152
|
} else {
|
|
155
|
-
return space.db.add(
|
|
153
|
+
return space.db.add(create(FunctionType, {
|
|
156
154
|
name: functionId,
|
|
157
155
|
version,
|
|
158
156
|
source: makeRef(script)
|
|
159
157
|
}));
|
|
160
158
|
}
|
|
161
159
|
};
|
|
160
|
+
var makeFunctionUrl = (spaceId, functionId) => {
|
|
161
|
+
return `/${spaceId}/${functionId}`;
|
|
162
|
+
};
|
|
162
163
|
|
|
163
164
|
// packages/plugins/plugin-script/src/hooks/useCreateAndDeployScriptTemplates.ts
|
|
164
165
|
import { pipe } from "effect/Function";
|
|
@@ -230,4 +231,4 @@ export {
|
|
|
230
231
|
deployScript,
|
|
231
232
|
useCreateAndDeployScriptTemplates
|
|
232
233
|
};
|
|
233
|
-
//# sourceMappingURL=chunk-
|
|
234
|
+
//# sourceMappingURL=chunk-F4HA5C34.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/functions.ts", "../../../src/util/deploy.ts", "../../../src/hooks/useCreateAndDeployScriptTemplates.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { getMeta, getSpace } from '@dxos/react-client/echo';\n\n/**\n * Get the function URL for a given script and client configuration\n */\nexport const getFunctionUrl = ({\n script,\n fn,\n edgeUrl,\n}: {\n script: ScriptType;\n fn: any;\n edgeUrl: string;\n}): string | undefined => {\n const space = getSpace(script);\n const existingFunctionUrl = fn && getUserFunctionUrlInMetadata(getMeta(fn));\n\n if (!existingFunctionUrl) {\n return undefined;\n }\n\n return getInvocationUrl(existingFunctionUrl, edgeUrl, {\n spaceId: space?.id,\n });\n};\n\nexport const updateFunctionMetadata = (script: ScriptType, storedFunction: any, meta: any, functionId: string) => {\n if (script.description !== undefined && script.description.trim() !== '') {\n storedFunction.description = script.description;\n } else if (meta.description) {\n storedFunction.description = meta.description;\n } else {\n log.verbose('no description in function metadata', { functionId });\n }\n\n if (meta.inputSchema) {\n storedFunction.inputSchema = meta.inputSchema;\n } else {\n log.verbose('no input schema in function metadata', { functionId });\n }\n\n if (meta.outputSchema) {\n storedFunction.outputSchema = meta.outputSchema;\n } else {\n log.verbose('no output schema in function metadata', { functionId });\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Client } from '@dxos/client';\nimport {\n FunctionType,\n type ScriptType,\n getUserFunctionUrlInMetadata,\n incrementSemverPatch,\n setUserFunctionUrlInMetadata,\n uploadWorkerFunction,\n} from '@dxos/functions';\nimport { Bundler } from '@dxos/functions/bundler';\nimport { log } from '@dxos/log';\nimport { create, getMeta, makeRef, type Space } from '@dxos/react-client/echo';\n\nimport { updateFunctionMetadata } from './functions';\n\nexport const isScriptDeployed = ({ script, fn }: { script: ScriptType; fn: any }): boolean => {\n const existingFunctionUrl = fn && getUserFunctionUrlInMetadata(getMeta(fn));\n return Boolean(existingFunctionUrl) && !script.changed;\n};\n\ntype DeployScriptProps = {\n script: ScriptType;\n client: Client;\n space: Space;\n fn?: FunctionType;\n existingFunctionUrl?: string;\n};\n\ntype DeployScriptResult = { success: boolean; error?: Error; functionUrl?: string };\n\n/**\n * Deploy a script to a space, handling bundling and uploading to the FaaS infrastructure.\n */\nexport const deployScript = async ({\n script,\n client,\n space,\n fn,\n existingFunctionUrl,\n}: DeployScriptProps): Promise<DeployScriptResult> => {\n const validationError = validateDeployInputs(script, space);\n if (validationError) {\n return { success: false, error: validationError };\n }\n\n try {\n const existingFunctionId = extractFunctionId(existingFunctionUrl);\n\n const { bundle, error } = await bundleScript(script.source!.target!.content);\n if (error || !bundle) {\n throw error || new Error('Bundle creation failed');\n }\n\n const { functionId, version, meta } = await uploadWorkerFunction({\n client,\n spaceId: space.id,\n version: fn ? incrementSemverPatch(fn.version) : '0.0.1',\n functionId: existingFunctionId,\n source: bundle,\n });\n\n if (functionId === undefined || version === undefined) {\n throw new Error(`Upload didn't return expected data: ${JSON.stringify({ functionId, version })}`);\n }\n\n const storedFunction = createOrUpdateFunctionInSpace(space, fn, script, functionId, version);\n script.changed = false;\n updateFunctionMetadata(script, storedFunction, meta, functionId);\n\n const functionUrl = makeFunctionUrl(space.id, functionId);\n setUserFunctionUrlInMetadata(getMeta(storedFunction), functionUrl);\n\n return { success: true, functionUrl };\n } catch (err: any) {\n log.catch(err);\n return { success: false, error: err };\n }\n};\n\n/**\n * Validate inputs for script deployment.\n */\nconst validateDeployInputs = (script: ScriptType, space: Space): Error | null => {\n if (!script.source || !space) {\n return new Error('Script source or space not available');\n }\n return null;\n};\n\nconst extractFunctionId = (functionUrl?: string): string | undefined => {\n return functionUrl?.split('/').at(-1);\n};\n\nconst bundleScript = async (source: string): Promise<{ bundle?: string; error?: Error }> => {\n const bundler = new Bundler({ platform: 'browser', sandboxedModules: [], remoteModules: {} });\n const buildResult = await bundler.bundle({ source });\n\n if (buildResult.error || !buildResult.bundle) {\n return { error: buildResult.error || new Error('Bundle creation failed') };\n }\n\n return { bundle: buildResult.bundle };\n};\n\nconst createOrUpdateFunctionInSpace = (\n space: Space,\n fn: FunctionType | undefined,\n script: ScriptType,\n functionId: string,\n version: string,\n): FunctionType => {\n if (fn) {\n fn.version = version;\n return fn;\n } else {\n return space.db.add(create(FunctionType, { name: functionId, version, source: makeRef(script) }));\n }\n};\n\nconst makeFunctionUrl = (spaceId: string, functionId: string): string => {\n return `/${spaceId}/${functionId}`;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { pipe } from 'effect/Function';\nimport { useCallback, useState } from 'react';\n\nimport { chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { ScriptType } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { useClient } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { type Template } from '../templates';\nimport { ScriptAction } from '../types';\nimport { deployScript } from '../util';\n\ntype DeploymentStatus = 'idle' | 'pending' | 'success' | 'error';\n\n/**\n * Hook for creating and deploying multiple script templates concurrently.\n *\n * Takes a space and an array of script template IDs, then provides a callback\n * function that creates each script from its template and deploys it to the space.\n * All creation / deployment operations run concurrently for improved performance.\n */\nexport const useCreateAndDeployScriptTemplates = (space: Space | undefined, scriptTemplates: Template[]) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const client = useClient();\n const [status, setStatus] = useState<DeploymentStatus>('idle');\n const [error, setError] = useState<Error | undefined>(undefined);\n\n const handleCreateAndDeployScripts = useCallback(async () => {\n invariant(space);\n setStatus('pending');\n setError(undefined);\n\n const deploymentResults = await Promise.all(\n scriptTemplates.map(async (template) => {\n const result = await dispatch(\n pipe(\n createIntent(ScriptAction.Create, { space, initialTemplateId: template.id }),\n chain(SpaceAction.AddObject, { target: space }),\n ),\n );\n invariant(isInstanceOf(ScriptType, result.data?.object));\n\n return deployScript({ space, client, script: result.data.object });\n }),\n );\n\n const hasErrors = deploymentResults.some((result) => !result.success);\n setStatus(hasErrors ? 'error' : 'success');\n }, [space, dispatch, client, scriptTemplates]);\n\n return { handleCreateAndDeployScripts, status, error };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAA0BA,kBAAkBC,oCAAoC;AAChF,SAASC,WAAW;AACpB,SAASC,SAASC,gBAAgB;;AAK3B,IAAMC,iBAAiB,CAAC,EAC7BC,QACAC,IACAC,QAAO,MAKR;AACC,QAAMC,QAAQL,SAASE,MAAAA;AACvB,QAAMI,sBAAsBH,MAAMN,6BAA6BE,QAAQI,EAAAA,CAAAA;AAEvE,MAAI,CAACG,qBAAqB;AACxB,WAAOC;EACT;AAEA,SAAOX,iBAAiBU,qBAAqBF,SAAS;IACpDI,SAASH,OAAOI;EAClB,CAAA;AACF;AAEO,IAAMC,yBAAyB,CAACR,QAAoBS,gBAAqBC,MAAWC,eAAAA;AACzF,MAAIX,OAAOY,gBAAgBP,UAAaL,OAAOY,YAAYC,KAAI,MAAO,IAAI;AACxEJ,mBAAeG,cAAcZ,OAAOY;EACtC,WAAWF,KAAKE,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C,aAAa;QAAEpC;QAAOK;QAAQgC,QAAQhB,OAAOa,KAAKC;MAAO,CAAA;IAClE,CAAA,CAAA;AAGF,UAAMG,YAAYtB,kBAAkBuB,KAAK,CAAClB,WAAW,CAACA,OAAOmB,OAAO;AACpEhC,cAAU8B,YAAY,UAAU,SAAA;EAClC,GAAG;IAACtC;IAAOG;IAAUE;IAAQJ;GAAgB;AAE7C,SAAO;IAAEY;IAA8BN;IAAQG;EAAM;AACvD;",
|
|
6
|
+
"names": ["getInvocationUrl", "getUserFunctionUrlInMetadata", "log", "getMeta", "getSpace", "getFunctionUrl", "script", "fn", "edgeUrl", "space", "existingFunctionUrl", "undefined", "spaceId", "id", "updateFunctionMetadata", "storedFunction", "meta", "functionId", "description", "trim", "verbose", "inputSchema", "outputSchema", "FunctionType", "getUserFunctionUrlInMetadata", "incrementSemverPatch", "setUserFunctionUrlInMetadata", "uploadWorkerFunction", "Bundler", "log", "create", "getMeta", "makeRef", "isScriptDeployed", "script", "fn", "existingFunctionUrl", "getUserFunctionUrlInMetadata", "getMeta", "Boolean", "changed", "deployScript", "client", "space", "validationError", "validateDeployInputs", "success", "error", "existingFunctionId", "extractFunctionId", "bundle", "bundleScript", "source", "target", "content", "Error", "functionId", "version", "meta", "uploadWorkerFunction", "spaceId", "id", "incrementSemverPatch", "undefined", "JSON", "stringify", "storedFunction", "createOrUpdateFunctionInSpace", "updateFunctionMetadata", "functionUrl", "makeFunctionUrl", "setUserFunctionUrlInMetadata", "err", "log", "catch", "split", "at", "bundler", "Bundler", "platform", "sandboxedModules", "remoteModules", "buildResult", "db", "add", "create", "FunctionType", "name", "makeRef", "pipe", "useCallback", "useState", "chain", "createIntent", "useIntentDispatcher", "isInstanceOf", "ScriptType", "invariant", "SpaceAction", "useClient", "useCreateAndDeployScriptTemplates", "space", "scriptTemplates", "dispatchPromise", "dispatch", "useIntentDispatcher", "client", "useClient", "status", "setStatus", "useState", "error", "setError", "undefined", "handleCreateAndDeployScripts", "useCallback", "invariant", "deploymentResults", "Promise", "all", "map", "template", "result", "pipe", "createIntent", "ScriptAction", "Create", "initialTemplateId", "id", "chain", "SpaceAction", "AddObject", "target", "isInstanceOf", "ScriptType", "data", "object", "deployScript", "script", "hasErrors", "some", "success"]
|
|
7
|
+
}
|
|
@@ -16,7 +16,6 @@ var meta = {
|
|
|
16
16
|
]
|
|
17
17
|
};
|
|
18
18
|
var defaultScriptsForIntegration = {
|
|
19
|
-
// TODO(wittjosiah): Also include content extraction scripts in the default set.
|
|
20
19
|
"gmail.com": [
|
|
21
20
|
"dxos.org/script/gmail"
|
|
22
21
|
]
|
|
@@ -27,4 +26,4 @@ export {
|
|
|
27
26
|
meta,
|
|
28
27
|
defaultScriptsForIntegration
|
|
29
28
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-FDEAVT67.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SCRIPT_PLUGIN = 'dxos.org/plugin/script';\n\nexport const meta: PluginMeta = {\n id: SCRIPT_PLUGIN,\n name: 'Scripts',\n description:\n 'Scripts in Composer allow you to deploy custom functions that run on the edge. These functions can be referenced by your AI agent and called inside of cells in any Sheet. Use scripts to interact with API’s or external data inside of Composer.',\n icon: 'ph--code--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-explorer',\n tags: ['experimental'],\n screenshots: ['https://dxos.network/plugin-details-scripts-dark.png'],\n};\n\n// TODO(ZaymonFC): Configure by scopes?\nexport const defaultScriptsForIntegration: Record<string, string[]> = {\n
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;AAGO,IAAMC,+BAAyD
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SCRIPT_PLUGIN = 'dxos.org/plugin/script';\n\nexport const meta: PluginMeta = {\n id: SCRIPT_PLUGIN,\n name: 'Scripts',\n description:\n 'Scripts in Composer allow you to deploy custom functions that run on the edge. These functions can be referenced by your AI agent and called inside of cells in any Sheet. Use scripts to interact with API’s or external data inside of Composer.',\n icon: 'ph--code--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-explorer',\n tags: ['experimental'],\n screenshots: ['https://dxos.network/plugin-details-scripts-dark.png'],\n};\n\n// TODO(ZaymonFC): Configure by scopes?\nexport const defaultScriptsForIntegration: Record<string, string[]> = {\n 'gmail.com': ['dxos.org/script/gmail'],\n};\n"],
|
|
5
|
+
"mappings": ";;;AAMO,IAAMA,gBAAgB;AAEtB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;AAGO,IAAMC,+BAAyD;EACpE,aAAa;IAAC;;AAChB;",
|
|
6
6
|
"names": ["SCRIPT_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots", "defaultScriptsForIntegration"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
useCreateAndDeployScriptTemplates
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F4HA5C34.mjs";
|
|
5
5
|
import {
|
|
6
6
|
SCRIPT_PLUGIN
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FDEAVT67.mjs";
|
|
8
8
|
|
|
9
9
|
// packages/plugins/plugin-script/src/components/DeploymentDialog/DeploymentDialog.tsx
|
|
10
10
|
import React, { useEffect, useMemo } from "react";
|
|
@@ -145,4 +145,4 @@ export {
|
|
|
145
145
|
DEPLOYMENT_DIALOG,
|
|
146
146
|
DeploymentDialog_default
|
|
147
147
|
};
|
|
148
|
-
//# sourceMappingURL=chunk-
|
|
148
|
+
//# sourceMappingURL=chunk-MU3JKVL2.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
templates
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QDYGTY4L.mjs";
|
|
5
5
|
import {
|
|
6
6
|
deployScript,
|
|
7
7
|
getFunctionUrl,
|
|
8
8
|
isScriptDeployed
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F4HA5C34.mjs";
|
|
10
10
|
import {
|
|
11
11
|
SCRIPT_PLUGIN
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FDEAVT67.mjs";
|
|
13
13
|
|
|
14
14
|
// packages/plugins/plugin-script/src/hooks/deploy.ts
|
|
15
15
|
import { useCallback, useEffect, useMemo } from "react";
|
|
@@ -174,9 +174,9 @@ var useCopyHandler = ({ state }) => useCallback(async () => {
|
|
|
174
174
|
|
|
175
175
|
// packages/plugins/plugin-script/src/hooks/useToolbarState.ts
|
|
176
176
|
import { useMemo as useMemo2 } from "react";
|
|
177
|
-
import {
|
|
177
|
+
import { create } from "@dxos/live-object";
|
|
178
178
|
var useToolbarState = (initialState = {}) => {
|
|
179
|
-
return useMemo2(() =>
|
|
179
|
+
return useMemo2(() => create(initialState), []);
|
|
180
180
|
};
|
|
181
181
|
|
|
182
182
|
// packages/plugins/plugin-script/src/hooks/format.ts
|
|
@@ -350,4 +350,4 @@ export {
|
|
|
350
350
|
useToolbarAction,
|
|
351
351
|
useToolbarState
|
|
352
352
|
};
|
|
353
|
-
//# sourceMappingURL=chunk-
|
|
353
|
+
//# sourceMappingURL=chunk-PBGVTGL2.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/deploy.ts", "../../../src/hooks/useToolbarState.ts", "../../../src/hooks/format.ts", "../../../src/hooks/template.ts", "../../../src/hooks/useToolbarAction.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback, useEffect, useMemo } from 'react';\n\nimport { FunctionType, type ScriptType, getUserFunctionUrlInMetadata } from '@dxos/functions';\nimport { log } from '@dxos/log';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { createMenuAction } from '@dxos/react-ui-menu';\nimport { errorMessageColors } from '@dxos/react-ui-theme';\n\nimport { SCRIPT_PLUGIN } from '../meta';\nimport { deployScript, getFunctionUrl, isScriptDeployed } from '../util';\n\nexport type DeployActionProperties = { type: 'deploy' } | { type: 'copy' };\n\nexport type DeployState = {\n deploying: boolean;\n deployed: boolean;\n functionUrl: string;\n error: string;\n};\n\nexport const createDeploy = (state: Partial<DeployState>) => {\n const errorItem = createMenuAction('error', {\n label: state.error ?? ['no error label', { ns: SCRIPT_PLUGIN }],\n icon: 'ph--warning-circle--regular',\n hidden: !state.error,\n classNames: state.error && errorMessageColors,\n });\n\n const deployAction = createMenuAction<DeployActionProperties>('deploy', {\n type: 'deploy',\n label: [state.deploying ? 'pending label' : 'deploy label', { ns: SCRIPT_PLUGIN }],\n icon: state.deploying ? 'ph--spinner-gap--regular' : 'ph--cloud-arrow-up--regular',\n disabled: state.deploying,\n classNames: state.deploying ? '[&_svg]:animate-spin' : '',\n });\n\n const copyAction = createMenuAction<DeployActionProperties>('copy', {\n type: 'copy',\n label: ['copy link label', { ns: SCRIPT_PLUGIN }],\n icon: 'ph--link--regular',\n disabled: !state.functionUrl,\n });\n\n return {\n nodes: [errorItem, deployAction, copyAction],\n edges: [\n { source: 'root', target: 'error' },\n { source: 'root', target: 'deploy' },\n { source: 'root', target: 'copy' },\n ],\n };\n};\n\nexport const useDeployState = ({ state, script }: { state: Partial<DeployState>; script: ScriptType }) => {\n const { space, client, fn, existingFunctionUrl } = useDeployDeps({ script });\n useEffect(() => {\n if (!existingFunctionUrl) {\n return;\n }\n\n state.functionUrl = getFunctionUrl({\n script,\n fn,\n edgeUrl: client.config.values.runtime?.services?.edge?.url ?? '',\n });\n }, [existingFunctionUrl, space, fn, script, client.config.values.runtime?.services?.edge?.url]);\n\n useEffect(() => {\n state.deployed = isScriptDeployed({ script, fn });\n }, [script.changed, existingFunctionUrl, fn, script]);\n};\n\nexport const useDeployDeps = ({ script }: { script: ScriptType }) => {\n const space = getSpace(script);\n const [fn] = useQuery(space, Filter.schema(FunctionType, { source: script }));\n const client = useClient();\n const existingFunctionUrl = useMemo(() => fn && getUserFunctionUrlInMetadata(getMeta(fn)), [fn]);\n return { space, fn, client, existingFunctionUrl };\n};\n\n/**\n * Manage EDGE function deployment.\n */\nexport const useDeployHandler = ({ state, script }: { state: Partial<DeployState>; script: ScriptType }) => {\n const { space, fn, client, existingFunctionUrl } = useDeployDeps({ script });\n const { t } = useTranslation(SCRIPT_PLUGIN);\n\n return useCallback(async () => {\n if (!script.source || !space) {\n return;\n }\n\n state.error = undefined;\n state.deploying = true;\n\n const result = await deployScript({ script, client, space, fn, existingFunctionUrl });\n\n if (!result.success) {\n log.catch(result.error);\n state.error = t('upload failed label');\n }\n\n state.deploying = false;\n }, [fn, client, t, existingFunctionUrl, script, space]);\n};\n\nexport const useCopyHandler = ({ state }: { state: Partial<DeployState> }) =>\n useCallback(async () => {\n if (!state.functionUrl) {\n return;\n }\n await navigator.clipboard.writeText(state.functionUrl);\n }, [state.functionUrl]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { create } from '@dxos/live-object';\n\nimport { type DeployState } from './deploy';\n\nexport type ScriptToolbarState = Partial<DeployState>;\n\n// TODO(burdon): Replace with context provider?\nexport const useToolbarState = (initialState: ScriptToolbarState = {}) => {\n return useMemo(() => create<ScriptToolbarState>(initialState), []);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { format } from 'prettier';\nimport prettierPluginEstree from 'prettier/plugins/estree';\nimport prettierPluginTypescript from 'prettier/plugins/typescript';\nimport { useCallback } from 'react';\n\nimport { type ScriptType } from '@dxos/functions/types';\nimport { log } from '@dxos/log';\nimport { createMenuAction } from '@dxos/react-ui-menu';\n\nimport { SCRIPT_PLUGIN } from '../meta';\n\nexport type FormatActionProperties = { type: 'format' };\n\nexport const createFormat = () => {\n const formatAction = createMenuAction('format', {\n label: ['format label', { ns: SCRIPT_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n });\n\n return {\n nodes: [formatAction],\n edges: [{ source: 'root', target: 'format' }],\n };\n};\n\nexport const useFormatHandler = ({ script }: { script: ScriptType }) =>\n useCallback(async () => {\n if (!script.source) {\n return;\n }\n\n try {\n script.source.target!.content = await format(script.source.target!.content, {\n parser: 'typescript',\n plugins: [prettierPluginEstree, prettierPluginTypescript],\n semi: true,\n singleQuote: true,\n });\n } catch (err: any) {\n // TODO(wittjosiah): Show error in UI.\n log.catch(err);\n }\n }, [script.source]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions/types';\nimport { getMeta } from '@dxos/live-object';\nimport { createMenuItemGroup, createMenuAction } from '@dxos/react-ui-menu';\n\nimport { SCRIPT_PLUGIN } from '../meta';\nimport { templates } from '../templates';\n\nexport type TemplateActionProperties = { type: 'template'; value: string };\n\nconst createTemplateSelectGroup = () => {\n return createMenuItemGroup('template-select', {\n label: ['template select group label', { ns: SCRIPT_PLUGIN }],\n variant: 'dropdownMenu',\n });\n};\n\nconst createTemplateSelectActions = () => {\n return templates.map((template) => {\n return createMenuAction<TemplateActionProperties>(`template--${template.id}`, {\n label: template.name,\n value: template.id,\n type: 'template',\n });\n });\n};\n\nexport const createTemplateSelect = () => {\n const templateSelectGroup = createTemplateSelectGroup();\n const templateSelectActions = createTemplateSelectActions();\n return {\n nodes: [templateSelectGroup, ...templateSelectActions],\n edges: [\n { source: 'root', target: 'template-select' },\n ...templateSelectActions.map((action) => ({ source: 'template-select', target: action.id })),\n ],\n };\n};\n\nexport const useTemplateSelectHandler = ({ script }: { script: ScriptType }) => {\n return useCallback(\n (templateId: string) => {\n const template = templates.find((template) => template.id === templateId);\n if (template) {\n script.name = template.name;\n script.source!.target!.content = template.source;\n const metaKeys = getMeta(script).keys;\n const oldPresetIndex = metaKeys.findIndex((key) => key.source === FUNCTIONS_PRESET_META_KEY);\n if (oldPresetIndex >= 0) {\n metaKeys.splice(oldPresetIndex, 1);\n }\n if (template.presetId) {\n metaKeys.push({ source: FUNCTIONS_PRESET_META_KEY, id: template.presetId });\n }\n }\n },\n [script],\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { type ScriptType } from '@dxos/functions/types';\nimport { log } from '@dxos/log';\nimport { type MenuAction, type MenuActionHandler } from '@dxos/react-ui-menu';\n\nimport { type DeployActionProperties, useDeployHandler, useCopyHandler } from './deploy';\nimport { type FormatActionProperties, useFormatHandler } from './format';\nimport { type TemplateActionProperties, useTemplateSelectHandler } from './template';\nimport { type ScriptToolbarState } from './useToolbarState';\n\nexport type ScriptToolbarActionProperties = TemplateActionProperties | FormatActionProperties | DeployActionProperties;\n\nexport type ScriptToolbarAction = MenuAction<ScriptToolbarActionProperties>;\n\nexport const useToolbarAction = (props: {\n state: ScriptToolbarState;\n script: ScriptType;\n}): MenuActionHandler<ScriptToolbarAction> => {\n const handleTemplateSelect = useTemplateSelectHandler(props);\n const handleFormat = useFormatHandler(props);\n const handleDeploy = useDeployHandler(props);\n const handleCopy = useCopyHandler(props);\n\n return useCallback<MenuActionHandler<ScriptToolbarAction>>(\n (action: ScriptToolbarAction) => {\n switch (action.properties.type) {\n case 'template':\n handleTemplateSelect(action.properties.value);\n break;\n case 'format':\n void handleFormat();\n break;\n case 'deploy':\n void handleDeploy();\n break;\n case 'copy':\n void handleCopy();\n break;\n default:\n log.error('Unknown action type', action);\n }\n },\n [handleTemplateSelect, handleFormat, handleDeploy, handleCopy],\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAIA,SAASA,aAAaC,WAAWC,eAAe;AAEhD,SAASC,cAA+BC,oCAAoC;AAC5E,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,QAAQC,SAASC,UAAUC,gBAAgB;AACpD,SAASC,sBAAsB;AAC/B,SAASC,wBAAwB;AACjC,SAASC,0BAA0B;;AAc5B,IAAMC,eAAe,CAACC,UAAAA;AAC3B,QAAMC,YAAYC,iBAAiB,SAAS;IAC1CC,OAAOH,MAAMI,SAAS;MAAC;MAAkB;QAAEC,IAAIC;MAAc;;IAC7DC,MAAM;IACNC,QAAQ,CAACR,MAAMI;IACfK,YAAYT,MAAMI,SAASM;EAC7B,CAAA;AAEA,QAAMC,eAAeT,iBAAyC,UAAU;IACtEU,MAAM;IACNT,OAAO;MAACH,MAAMa,YAAY,kBAAkB;MAAgB;QAAER,IAAIC;MAAc;;IAChFC,MAAMP,MAAMa,YAAY,6BAA6B;IACrDC,UAAUd,MAAMa;IAChBJ,YAAYT,MAAMa,YAAY,yBAAyB;EACzD,CAAA;AAEA,QAAME,aAAab,iBAAyC,QAAQ;IAClEU,MAAM;IACNT,OAAO;MAAC;MAAmB;QAAEE,IAAIC;MAAc;;IAC/CC,MAAM;IACNO,UAAU,CAACd,MAAMgB;EACnB,CAAA;AAEA,SAAO;IACLC,OAAO;MAAChB;MAAWU;MAAcI;;IACjCG,OAAO;MACL;QAAEC,QAAQ;QAAQC,QAAQ;MAAQ;MAClC;QAAED,QAAQ;QAAQ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UnB,SAASW;AAC1C,YAAMS,WAAWC,SAAQN,MAAAA,EAAQO;AACjC,YAAMC,iBAAiBH,SAASI,UAAU,CAACC,QAAQA,IAAId,WAAWe,yBAAAA;AAClE,UAAIH,kBAAkB,GAAG;AACvBH,iBAASO,OAAOJ,gBAAgB,CAAA;MAClC;AACA,UAAIvB,SAAS4B,UAAU;AACrBR,iBAASS,KAAK;UAAElB,QAAQe;UAA2BxB,IAAIF,SAAS4B;QAAS,CAAA;MAC3E;IACF;EACF,GACA;IAACb;GAAO;AAEZ;;;AC3DA,SAASe,eAAAA,oBAAmB;AAG5B,SAASC,OAAAA,YAAW;;AAYb,IAAMC,mBAAmB,CAACC,UAAAA;AAI/B,QAAMC,uBAAuBC,yBAAyBF,KAAAA;AACtD,QAAMG,eAAeC,iBAAiBJ,KAAAA;AACtC,QAAMK,eAAeC,iBAAiBN,KAAAA;AACtC,QAAMO,aAAaC,eAAeR,KAAAA;AAElC,SAAOS,aACL,CAACC,WAAAA;AACC,YAAQA,OAAOC,WAAWC,MAAI;MAC5B,KAAK;AACHX,6BAAqBS,OAAOC,WAAWE,KAAK;AAC5C;MACF,KAAK;AACH,aAAKV,aAAAA;AACL;MACF,KAAK;AACH,aAAKE,aAAAA;AACL;MACF,KAAK;AACH,aAAKE,WAAAA;AACL;MACF;AACEO,QAAAA,KAAIC,MAAM,uBAAuBL,QAAAA;;;;;;IACrC;EACF,GACA;IAACT;IAAsBE;IAAcE;IAAcE;GAAW;AAElE;",
|
|
6
|
+
"names": ["useCallback", "useEffect", "useMemo", "FunctionType", "getUserFunctionUrlInMetadata", "log", "useClient", "Filter", "getMeta", "getSpace", "useQuery", "useTranslation", "createMenuAction", "errorMessageColors", "createDeploy", "state", "errorItem", "createMenuAction", "label", "error", "ns", "SCRIPT_PLUGIN", "icon", "hidden", "classNames", "errorMessageColors", "deployAction", "type", "deploying", "disabled", "copyAction", "functionUrl", "nodes", "edges", "source", "target", "useDeployState", "script", "space", "client", "fn", "existingFunctionUrl", "useDeployDeps", "useEffect", "getFunctionUrl", "edgeUrl", "config", "values", "runtime", "services", "edge", "url", "deployed", "isScriptDeployed", "changed", "getSpace", "useQuery", "Filter", "schema", "FunctionType", "useClient", "useMemo", "getUserFunctionUrlInMetadata", "getMeta", "useDeployHandler", "t", "useTranslation", "useCallback", "undefined", "result", "deployScript", "success", "log", "catch", "useCopyHandler", "navigator", "clipboard", "writeText", "useMemo", "create", "useToolbarState", "initialState", "useMemo", "create", "format", "prettierPluginEstree", "prettierPluginTypescript", "useCallback", "log", "createMenuAction", "createFormat", "formatAction", "createMenuAction", "label", "ns", "SCRIPT_PLUGIN", "icon", "nodes", "edges", "source", "target", "useFormatHandler", "script", "useCallback", "content", "format", "parser", "plugins", "prettierPluginEstree", "prettierPluginTypescript", "semi", "singleQuote", "err", "log", "catch", "useCallback", "FUNCTIONS_PRESET_META_KEY", "getMeta", "createMenuItemGroup", "createMenuAction", "createTemplateSelectGroup", "createMenuItemGroup", "label", "ns", "SCRIPT_PLUGIN", "variant", "createTemplateSelectActions", "templates", "map", "template", "createMenuAction", "id", "name", "value", "type", "createTemplateSelect", "templateSelectGroup", "templateSelectActions", "nodes", "edges", "source", "target", "action", "useTemplateSelectHandler", "script", "useCallback", "templateId", "find", "content", "metaKeys", "getMeta", "keys", "oldPresetIndex", "findIndex", "key", "FUNCTIONS_PRESET_META_KEY", "splice", "presetId", "push", "useCallback", "log", "useToolbarAction", "props", "handleTemplateSelect", "useTemplateSelectHandler", "handleFormat", "useFormatHandler", "handleDeploy", "useDeployHandler", "handleCopy", "useCopyHandler", "useCallback", "action", "properties", "type", "value", "log", "error"]
|
|
7
|
+
}
|