@dxos/plugin-script 0.8.1-main.303c73a → 0.8.1-main.81238a8
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/{ScriptContainer-QGF55ZZJ.mjs → ScriptContainer-7PTOJ4KY.mjs} +13 -18
- package/dist/lib/browser/ScriptContainer-7PTOJ4KY.mjs.map +7 -0
- package/dist/lib/browser/{artifact-definition-4LWPD3DH.mjs → artifact-definition-GYCZJGR4.mjs} +8 -7
- package/dist/lib/browser/artifact-definition-GYCZJGR4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FVVCAWNP.mjs → chunk-27LV6ARH.mjs} +1 -1
- package/dist/lib/browser/chunk-27LV6ARH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LYOFJ3FM.mjs → chunk-4SSKJNMZ.mjs} +3 -3
- package/dist/lib/browser/chunk-4SSKJNMZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2H6QBQ5Q.mjs → chunk-AJNRPWAA.mjs} +3 -3
- package/dist/lib/browser/{chunk-2H6QBQ5Q.mjs.map → chunk-AJNRPWAA.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-THELDT6E.mjs → chunk-DZB4KWOI.mjs} +29 -49
- package/dist/lib/browser/chunk-DZB4KWOI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6MOQ4BP3.mjs → chunk-FG66JYON.mjs} +2 -2
- package/dist/lib/browser/{chunk-35UHX7XH.mjs → chunk-QHE53FDV.mjs} +4 -4
- package/dist/lib/browser/{chunk-35UHX7XH.mjs.map → chunk-QHE53FDV.mjs.map} +1 -1
- package/dist/lib/browser/{compiler-YY2XSKHQ.mjs → compiler-ZQLHHJ5P.mjs} +3 -3
- package/dist/lib/browser/index.mjs +17 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NWAKTBZC.mjs → intent-resolver-3B3Z67FP.mjs} +5 -5
- package/dist/lib/browser/{intent-resolver-NWAKTBZC.mjs.map → intent-resolver-3B3Z67FP.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-6CYOO66B.mjs → react-surface-GQD6LJDJ.mjs} +13 -13
- package/dist/lib/browser/react-surface-GQD6LJDJ.mjs.map +7 -0
- package/dist/lib/browser/{settings-LRHZSUEJ.mjs → settings-467GVEBU.mjs} +3 -3
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{ScriptContainer-XSYHQ4MZ.cjs → ScriptContainer-VHHYWC3A.cjs} +22 -27
- package/dist/lib/node/ScriptContainer-VHHYWC3A.cjs.map +7 -0
- package/dist/lib/node/{artifact-definition-BXQCFPAH.cjs → artifact-definition-3SNVJ34V.cjs} +20 -19
- package/dist/lib/node/artifact-definition-3SNVJ34V.cjs.map +7 -0
- package/dist/lib/node/{chunk-5UH3F7TA.cjs → chunk-2XX4L67K.cjs} +4 -4
- package/dist/lib/node/chunk-2XX4L67K.cjs.map +7 -0
- package/dist/lib/node/{chunk-ALY3N6PW.cjs → chunk-AOKGOI5J.cjs} +6 -6
- package/dist/lib/node/{chunk-DA6RBNFV.cjs → chunk-MSH4SVCN.cjs} +43 -63
- package/dist/lib/node/chunk-MSH4SVCN.cjs.map +7 -0
- package/dist/lib/node/{chunk-RGHRAT2U.cjs → chunk-W4U3OWKO.cjs} +13 -13
- package/dist/lib/node/{chunk-RGHRAT2U.cjs.map → chunk-W4U3OWKO.cjs.map} +2 -2
- package/dist/lib/node/{chunk-QYIAUPWY.cjs → chunk-XCQNFRZ6.cjs} +6 -6
- package/dist/lib/node/chunk-XCQNFRZ6.cjs.map +7 -0
- package/dist/lib/node/{chunk-3ICET6JB.cjs → chunk-XFB6JL2G.cjs} +8 -8
- package/dist/lib/node/{chunk-3ICET6JB.cjs.map → chunk-XFB6JL2G.cjs.map} +2 -2
- package/dist/lib/node/{compiler-UIBLKJKG.cjs → compiler-5ALLTH2B.cjs} +7 -7
- package/dist/lib/node/index.cjs +46 -44
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-WZVIHKA7.cjs → intent-resolver-CN5WMMAD.cjs} +11 -11
- package/dist/lib/node/intent-resolver-CN5WMMAD.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-I7V6DSYF.cjs → react-surface-VV7J7PQN.cjs} +28 -28
- package/dist/lib/node/react-surface-VV7J7PQN.cjs.map +7 -0
- package/dist/lib/node/{settings-TR2CA4IH.cjs → settings-WLYT2XQF.cjs} +9 -9
- package/dist/lib/node/types.cjs +4 -4
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{ScriptContainer-5OTO5SJM.mjs → ScriptContainer-A4J44DZD.mjs} +13 -18
- package/dist/lib/node-esm/ScriptContainer-A4J44DZD.mjs.map +7 -0
- package/dist/lib/node-esm/{artifact-definition-KT4DK2LQ.mjs → artifact-definition-VAFNV62U.mjs} +8 -7
- package/dist/lib/node-esm/artifact-definition-VAFNV62U.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YSOCSUGC.mjs → chunk-2RKD5MCW.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-YSOCSUGC.mjs.map → chunk-2RKD5MCW.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-2D6G2Y2O.mjs → chunk-4YUSGXJ2.mjs} +3 -3
- package/dist/lib/node-esm/chunk-4YUSGXJ2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P2V2Y5LV.mjs → chunk-5S2KBIMH.mjs} +1 -1
- package/dist/lib/node-esm/chunk-5S2KBIMH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CP5LXTK5.mjs → chunk-MFXRE7ZD.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-34AL6Y3D.mjs → chunk-QHZ6KA5J.mjs} +29 -49
- package/dist/lib/node-esm/chunk-QHZ6KA5J.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-N52CCVF5.mjs → chunk-WQ4YIZ2L.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-N52CCVF5.mjs.map → chunk-WQ4YIZ2L.mjs.map} +1 -1
- package/dist/lib/node-esm/{compiler-XTXFGZJM.mjs → compiler-K7GYROAO.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +17 -15
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-E4EOZUBH.mjs → intent-resolver-6F7CVQEX.mjs} +5 -5
- package/dist/lib/node-esm/{intent-resolver-E4EOZUBH.mjs.map → intent-resolver-6F7CVQEX.mjs.map} +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-FQ4K7UST.mjs → react-surface-RPNDRJVD.mjs} +13 -13
- package/dist/lib/node-esm/react-surface-RPNDRJVD.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-Q6B4K7LO.mjs → settings-DR3B6GHE.mjs} +3 -3
- 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/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/LogsPanel/LogsPanel.d.ts +1 -1
- package/dist/types/src/components/LogsPanel/LogsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +3 -2
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptSettingsPanel.d.ts +1 -1
- package/dist/types/src/components/ScriptSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +7 -6
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +1 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarAction.d.ts +1 -1
- package/dist/types/src/hooks/useToolbarAction.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +2 -8
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/hooks/view.d.ts +3 -15
- package/dist/types/src/hooks/view.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -9
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +8 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +47 -47
- package/src/ScriptPlugin.tsx +3 -2
- package/src/capabilities/artifact-definition.ts +2 -1
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/capabilities/react-surface.tsx +16 -6
- package/src/components/LogsPanel/LogsPanel.tsx +4 -9
- package/src/components/ScriptContainer.tsx +12 -10
- package/src/components/ScriptSettingsPanel.tsx +1 -1
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +1 -1
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +1 -0
- package/src/hooks/deploy.ts +1 -2
- package/src/hooks/format.ts +1 -1
- package/src/hooks/template.ts +1 -1
- package/src/hooks/useToolbarAction.ts +13 -4
- package/src/hooks/useToolbarState.ts +2 -2
- package/src/hooks/view.ts +6 -20
- package/src/meta.ts +2 -2
- package/src/templates/discord.ts +15 -8
- package/src/templates/forex-effect.ts +2 -2
- package/src/translations.ts +2 -1
- package/src/types.ts +1 -1
- package/dist/lib/browser/ScriptContainer-QGF55ZZJ.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-4LWPD3DH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FVVCAWNP.mjs.map +0 -7
- package/dist/lib/browser/chunk-LYOFJ3FM.mjs.map +0 -7
- package/dist/lib/browser/chunk-THELDT6E.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6CYOO66B.mjs.map +0 -7
- package/dist/lib/node/ScriptContainer-XSYHQ4MZ.cjs.map +0 -7
- package/dist/lib/node/artifact-definition-BXQCFPAH.cjs.map +0 -7
- package/dist/lib/node/chunk-5UH3F7TA.cjs.map +0 -7
- package/dist/lib/node/chunk-DA6RBNFV.cjs.map +0 -7
- package/dist/lib/node/chunk-QYIAUPWY.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-WZVIHKA7.cjs.map +0 -7
- package/dist/lib/node/react-surface-I7V6DSYF.cjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-5OTO5SJM.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-KT4DK2LQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2D6G2Y2O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34AL6Y3D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P2V2Y5LV.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FQ4K7UST.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-6MOQ4BP3.mjs.map → chunk-FG66JYON.mjs.map} +0 -0
- /package/dist/lib/browser/{compiler-YY2XSKHQ.mjs.map → compiler-ZQLHHJ5P.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-LRHZSUEJ.mjs.map → settings-467GVEBU.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-ALY3N6PW.cjs.map → chunk-AOKGOI5J.cjs.map} +0 -0
- /package/dist/lib/node/{compiler-UIBLKJKG.cjs.map → compiler-5ALLTH2B.cjs.map} +0 -0
- /package/dist/lib/node/{settings-TR2CA4IH.cjs.map → settings-WLYT2XQF.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-CP5LXTK5.mjs.map → chunk-MFXRE7ZD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{compiler-XTXFGZJM.mjs.map → compiler-K7GYROAO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-Q6B4K7LO.mjs.map → settings-DR3B6GHE.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/hooks/deploy.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,UAAU,EAMhB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGxC,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;CA8BvD,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE;;;;;;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/hooks/deploy.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,UAAU,EAMhB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGxC,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;CA8BvD,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE;;;;;;wDAvC9B,mBACrB;;gBAEO,CAAC;2DAIK,mBAAmB;;sBAEjC,mBAAmB;uBAC1B,CAAC;mBACF,CAAD;;;;;;;;CAkCF,CAAC;AAEF,eAAO,MAAM,cAAc,sBAAuB;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,SAepG,CAAC;AAEF,eAAO,MAAM,gBAAgB,sBAAuB;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,wBAoEtG,CAAC;AAEF,eAAO,MAAM,cAAc,cAAe;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAAE,wBAMhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/hooks/format.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/hooks/format.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAExD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAUxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,wBAiB9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/hooks/template.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/hooks/template.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOnF,MAAM,MAAM,wBAAwB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAmB3E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;CAUhC,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,kBAE1D,MAAM,SAiBtB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ScriptType } from '@dxos/functions';
|
|
1
|
+
import { type ScriptType } from '@dxos/functions/types';
|
|
2
2
|
import { type MenuAction, type MenuActionHandler } from '@dxos/react-ui-menu';
|
|
3
3
|
import { type DeployActionProperties } from './deploy';
|
|
4
4
|
import { type FormatActionProperties } from './format';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarAction.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useToolbarAction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useToolbarAction.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useToolbarAction.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIxD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,KAAK,sBAAsB,EAAoC,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,KAAK,sBAAsB,EAAoB,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,KAAK,wBAAwB,EAA4B,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEnD,MAAM,MAAM,6BAA6B,GACrC,wBAAwB,GACxB,oBAAoB,GACpB,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAE5E,eAAO,MAAM,gBAAgB,UAAW;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,sBAmCxF,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { type DeployState } from './deploy';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare const useToolbarState: (initialState?: ScriptToolbarState) => import("@dxos/live-object").ReactiveObject<Partial<ViewState & {
|
|
5
|
-
deploying: boolean;
|
|
6
|
-
deployed: boolean;
|
|
7
|
-
functionUrl: string;
|
|
8
|
-
error: string;
|
|
9
|
-
}>>;
|
|
2
|
+
export type ScriptToolbarState = Partial<DeployState>;
|
|
3
|
+
export declare const useToolbarState: (initialState?: ScriptToolbarState) => import("@dxos/live-object").ReactiveObject<Partial<DeployState>>;
|
|
10
4
|
//# sourceMappingURL=useToolbarState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarState.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useToolbarState.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useToolbarState.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useToolbarState.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAGtD,eAAO,MAAM,eAAe,kBAAkB,kBAAkB,qEAE/D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ViewType = '
|
|
1
|
+
export type ViewType = 'logs';
|
|
2
2
|
export type ViewState = {
|
|
3
3
|
view: ViewType;
|
|
4
4
|
};
|
|
@@ -7,24 +7,12 @@ export type ViewActionProperties = {
|
|
|
7
7
|
value: ViewType;
|
|
8
8
|
};
|
|
9
9
|
export declare const createView: (state: Partial<ViewState>) => {
|
|
10
|
-
nodes:
|
|
11
|
-
id: string;
|
|
12
|
-
type: string;
|
|
13
|
-
properties: {
|
|
14
|
-
label: [string, {
|
|
15
|
-
ns: string;
|
|
16
|
-
}];
|
|
17
|
-
variant: string;
|
|
18
|
-
applyActive: boolean;
|
|
19
|
-
value: ViewType | undefined;
|
|
20
|
-
};
|
|
21
|
-
data: typeof import("@dxos/app-graph").actionGroupSymbol;
|
|
22
|
-
} | {
|
|
10
|
+
nodes: {
|
|
23
11
|
id: string;
|
|
24
12
|
type: string;
|
|
25
13
|
properties: ViewActionProperties & import("@dxos/react-ui-menu").MenuActionProperties;
|
|
26
14
|
data: () => void;
|
|
27
|
-
}
|
|
15
|
+
}[];
|
|
28
16
|
edges: {
|
|
29
17
|
source: string;
|
|
30
18
|
target: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../src/hooks/view.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../src/hooks/view.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAA8B,MAAM,CAAC;AAEzD,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC;AAmBrE,eAAO,MAAM,UAAU,UAAW,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;CAMnD,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
1
2
|
export declare const SCRIPT_PLUGIN = "dxos.org/plugin/script";
|
|
2
|
-
export declare const meta:
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
source: string;
|
|
8
|
-
tags: string[];
|
|
9
|
-
screenshots: string[];
|
|
10
|
-
};
|
|
3
|
+
export declare const meta: PluginMeta;
|
|
11
4
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,eAAO,MAAM,IAAI,EAAE,UASlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../../../../src/templates/discord.ts"],"names":[],"mappings":";AA8BA,
|
|
1
|
+
{"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../../../../src/templates/discord.ts"],"names":[],"mappings":";AA8BA,wBA+EG"}
|
|
@@ -40,6 +40,7 @@ declare const _default: {
|
|
|
40
40
|
'view logs label'?: undefined;
|
|
41
41
|
'template select group label'?: undefined;
|
|
42
42
|
'function panel label'?: undefined;
|
|
43
|
+
'logs plank heading'?: undefined;
|
|
43
44
|
} | {
|
|
44
45
|
'plugin name': string;
|
|
45
46
|
'object title placeholder': string;
|
|
@@ -79,6 +80,7 @@ declare const _default: {
|
|
|
79
80
|
'view logs label': string;
|
|
80
81
|
'template select group label': string;
|
|
81
82
|
'function panel label': string;
|
|
83
|
+
'logs plank heading': string;
|
|
82
84
|
'typename label'?: undefined;
|
|
83
85
|
};
|
|
84
86
|
"dxos.org/plugin/script": {
|
|
@@ -120,6 +122,7 @@ declare const _default: {
|
|
|
120
122
|
'view logs label': string;
|
|
121
123
|
'template select group label': string;
|
|
122
124
|
'function panel label': string;
|
|
125
|
+
'logs plank heading': string;
|
|
123
126
|
};
|
|
124
127
|
};
|
|
125
128
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAiDE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { S } from '@dxos/echo-schema';
|
|
2
|
-
import { ScriptType } from '@dxos/functions';
|
|
3
2
|
export declare namespace ScriptAction {
|
|
4
3
|
export const CreateScriptSchema: S.Struct<{
|
|
5
4
|
name: S.optional<typeof S.String>;
|
|
@@ -16,7 +15,14 @@ export declare namespace ScriptAction {
|
|
|
16
15
|
space: S.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
|
|
17
16
|
}>>;
|
|
18
17
|
output: S.Struct<{
|
|
19
|
-
object:
|
|
18
|
+
object: import("@dxos/echo-schema").EchoObjectSchema<S.Struct<{
|
|
19
|
+
name: S.optional<typeof S.String>;
|
|
20
|
+
description: S.optional<typeof S.String>;
|
|
21
|
+
changed: S.optional<typeof S.Boolean>;
|
|
22
|
+
source: import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
|
|
23
|
+
content: typeof S.String;
|
|
24
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>>;
|
|
25
|
+
}>>;
|
|
20
26
|
}>;
|
|
21
27
|
}>;
|
|
22
28
|
export class Create extends Create_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAMtC,yBAAiB,YAAY,CAAC;IAG5B,MAAM,CAAC,MAAM,kBAAkB;;;MAI7B,CAAC;IAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;;;;;;;;;;;;sBAdpE,EAAG,QAAQ,QAAO,EAAG,MAAM;6BACjC,EAAG,QAAQ,QAAO,EAAG,MAAM;yBAAe,EAAG,QAAQ,QAEnD,EAAI,OAAM;+BAAsB,mBAEtB,cAAc,mBACb;oCAEP,EAAG,MAAM;0BAAgB,mBAC5B;;;;IAOF,MAAM,OAAO,MAAO,SAAQ,WAK1B;KAAG;;CACN;AAED,eAAO,MAAM,oBAAoB;;GAIhC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.8.1-main.
|
|
3
|
+
"version": "0.8.1-main.81238a8",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -53,66 +53,66 @@
|
|
|
53
53
|
"prettier": "^3.2.4",
|
|
54
54
|
"react-syntax-highlighter": "^15.5.0",
|
|
55
55
|
"typescript": "^5.7.2",
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/client
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/echo-
|
|
66
|
-
"@dxos/functions": "0.8.1-main.
|
|
67
|
-
"@dxos/invariant": "0.8.1-main.
|
|
68
|
-
"@dxos/keys": "0.8.1-main.
|
|
69
|
-
"@dxos/live-object": "0.8.1-main.
|
|
70
|
-
"@dxos/local-storage": "0.8.1-main.
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/plugin-deck": "0.8.1-main.
|
|
74
|
-
"@dxos/plugin-graph": "0.8.1-main.
|
|
75
|
-
"@dxos/plugin-explorer": "0.8.1-main.
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/react-
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/react-ui-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-list": "0.8.1-main.
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/react-ui-
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/rpc": "0.8.1-main.
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/schema": "0.8.1-main.
|
|
56
|
+
"@dxos/app-framework": "0.8.1-main.81238a8",
|
|
57
|
+
"@dxos/artifact": "0.8.1-main.81238a8",
|
|
58
|
+
"@dxos/assistant": "0.8.1-main.81238a8",
|
|
59
|
+
"@dxos/client": "0.8.1-main.81238a8",
|
|
60
|
+
"@dxos/async": "0.8.1-main.81238a8",
|
|
61
|
+
"@dxos/client-protocol": "0.8.1-main.81238a8",
|
|
62
|
+
"@dxos/echo-protocol": "0.8.1-main.81238a8",
|
|
63
|
+
"@dxos/compute": "0.8.1-main.81238a8",
|
|
64
|
+
"@dxos/debug": "0.8.1-main.81238a8",
|
|
65
|
+
"@dxos/echo-schema": "0.8.1-main.81238a8",
|
|
66
|
+
"@dxos/functions": "0.8.1-main.81238a8",
|
|
67
|
+
"@dxos/invariant": "0.8.1-main.81238a8",
|
|
68
|
+
"@dxos/keys": "0.8.1-main.81238a8",
|
|
69
|
+
"@dxos/live-object": "0.8.1-main.81238a8",
|
|
70
|
+
"@dxos/local-storage": "0.8.1-main.81238a8",
|
|
71
|
+
"@dxos/log": "0.8.1-main.81238a8",
|
|
72
|
+
"@dxos/plugin-client": "0.8.1-main.81238a8",
|
|
73
|
+
"@dxos/plugin-deck": "0.8.1-main.81238a8",
|
|
74
|
+
"@dxos/plugin-graph": "0.8.1-main.81238a8",
|
|
75
|
+
"@dxos/plugin-explorer": "0.8.1-main.81238a8",
|
|
76
|
+
"@dxos/plugin-markdown": "0.8.1-main.81238a8",
|
|
77
|
+
"@dxos/plugin-space": "0.8.1-main.81238a8",
|
|
78
|
+
"@dxos/plugin-stack": "0.8.1-main.81238a8",
|
|
79
|
+
"@dxos/protocols": "0.8.1-main.81238a8",
|
|
80
|
+
"@dxos/plugin-theme": "0.8.1-main.81238a8",
|
|
81
|
+
"@dxos/react-client": "0.8.1-main.81238a8",
|
|
82
|
+
"@dxos/react-edge-client": "0.8.1-main.81238a8",
|
|
83
|
+
"@dxos/react-ui-editor": "0.8.1-main.81238a8",
|
|
84
|
+
"@dxos/react-ui-attention": "0.8.1-main.81238a8",
|
|
85
|
+
"@dxos/react-ui-form": "0.8.1-main.81238a8",
|
|
86
|
+
"@dxos/react-ui-list": "0.8.1-main.81238a8",
|
|
87
|
+
"@dxos/react-ui-stack": "0.8.1-main.81238a8",
|
|
88
|
+
"@dxos/react-ui-menu": "0.8.1-main.81238a8",
|
|
89
|
+
"@dxos/rpc": "0.8.1-main.81238a8",
|
|
90
|
+
"@dxos/rpc-tunnel": "0.8.1-main.81238a8",
|
|
91
|
+
"@dxos/util": "0.8.1-main.81238a8",
|
|
92
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.1-main.81238a8",
|
|
93
|
+
"@dxos/schema": "0.8.1-main.81238a8"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@phosphor-icons/react": "^2.1.5",
|
|
97
97
|
"@types/lodash.get": "^4.4.7",
|
|
98
98
|
"@types/react": "~18.2.0",
|
|
99
99
|
"@types/react-dom": "~18.2.0",
|
|
100
|
-
"effect": "3.
|
|
100
|
+
"effect": "3.13.3",
|
|
101
101
|
"react": "~18.2.0",
|
|
102
102
|
"react-dom": "~18.2.0",
|
|
103
103
|
"vite": "5.4.7",
|
|
104
|
-
"@dxos/random": "0.8.1-main.
|
|
105
|
-
"@dxos/react-ui
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/
|
|
104
|
+
"@dxos/random": "0.8.1-main.81238a8",
|
|
105
|
+
"@dxos/react-ui": "0.8.1-main.81238a8",
|
|
106
|
+
"@dxos/react-ui-theme": "0.8.1-main.81238a8",
|
|
107
|
+
"@dxos/storybook-utils": "0.8.1-main.81238a8"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
110
|
"@phosphor-icons/react": "^2.1.5",
|
|
111
|
-
"effect": "3.
|
|
111
|
+
"effect": "3.13.3",
|
|
112
112
|
"react": "~18.2.0",
|
|
113
113
|
"react-dom": "~18.2.0",
|
|
114
|
-
"@dxos/react-ui": "0.8.1-main.
|
|
115
|
-
"@dxos/react-ui-theme": "0.8.1-main.
|
|
114
|
+
"@dxos/react-ui": "0.8.1-main.81238a8",
|
|
115
|
+
"@dxos/react-ui-theme": "0.8.1-main.81238a8"
|
|
116
116
|
},
|
|
117
117
|
"publishConfig": {
|
|
118
118
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
9
|
+
import { ScriptType } from '@dxos/functions/types';
|
|
9
10
|
import { RefArray } from '@dxos/live-object';
|
|
10
11
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
11
12
|
import { DeckCapabilities, DeckEvents } from '@dxos/plugin-deck';
|
|
@@ -59,7 +60,7 @@ export const ScriptPlugin = () =>
|
|
|
59
60
|
label: ['function panel label', { ns: SCRIPT_PLUGIN }],
|
|
60
61
|
icon: 'ph--terminal--regular',
|
|
61
62
|
fixed: true,
|
|
62
|
-
filter: (node) => node.data
|
|
63
|
+
filter: (node) => isInstanceOf(ScriptType, node.data) && !!getSpace(node.data),
|
|
63
64
|
}),
|
|
64
65
|
}),
|
|
65
66
|
defineModule({
|
|
@@ -6,7 +6,7 @@ import { Capabilities, contributes, createIntent, type PromiseIntentDispatcher }
|
|
|
6
6
|
import { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';
|
|
7
7
|
import { createArtifactElement } from '@dxos/assistant';
|
|
8
8
|
import { ObjectId, S } from '@dxos/echo-schema';
|
|
9
|
-
import { ScriptType } from '@dxos/functions';
|
|
9
|
+
import { ScriptType } from '@dxos/functions/types';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
12
12
|
import { create, makeRef, type Space } from '@dxos/react-client/echo';
|
|
@@ -31,6 +31,7 @@ export default () => {
|
|
|
31
31
|
instructions: `
|
|
32
32
|
If the user explicitly requests you to write a script, you can create one.
|
|
33
33
|
If the user requests you to change one of the existing script, you can update it.
|
|
34
|
+
You must not create a script unless the user explicitly requests it.
|
|
34
35
|
Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.
|
|
35
36
|
Each script must follow as strict shape for the definition but the body can contain any valid executable code.
|
|
36
37
|
Scripts are written in JavaScript or TypeScript.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Octokit } from '@octokit/core';
|
|
6
6
|
|
|
7
7
|
import { contributes, Capabilities, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { ScriptType } from '@dxos/functions';
|
|
8
|
+
import { ScriptType } from '@dxos/functions/types';
|
|
9
9
|
import { create, makeRef } from '@dxos/live-object';
|
|
10
10
|
import { TextType } from '@dxos/schema';
|
|
11
11
|
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
9
|
+
import { ScriptType } from '@dxos/functions/types';
|
|
9
10
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
11
|
import { Clipboard } from '@dxos/react-ui';
|
|
11
12
|
|
|
@@ -27,22 +28,31 @@ export default () =>
|
|
|
27
28
|
createSurface({
|
|
28
29
|
id: `${SCRIPT_PLUGIN}/article`,
|
|
29
30
|
role: 'article',
|
|
30
|
-
filter: (data): data is { subject: ScriptType
|
|
31
|
+
filter: (data): data is { subject: ScriptType; variant: 'logs' | undefined } =>
|
|
32
|
+
isInstanceOf(ScriptType, data.subject),
|
|
31
33
|
component: ({ data, role }) => {
|
|
32
34
|
const compiler = useCapability(ScriptCapabilities.Compiler);
|
|
33
35
|
// TODO(dmaretskyi): Since settings store is not reactive, this would break on the script plugin being enabled without a page reload.
|
|
34
36
|
const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettingsProps>(SCRIPT_PLUGIN)?.value;
|
|
35
|
-
return
|
|
37
|
+
return (
|
|
38
|
+
<ScriptContainer
|
|
39
|
+
role={role}
|
|
40
|
+
script={data.subject}
|
|
41
|
+
variant={data.variant}
|
|
42
|
+
settings={settings}
|
|
43
|
+
env={compiler.environment}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
36
46
|
},
|
|
37
47
|
}),
|
|
38
48
|
createSurface({
|
|
39
49
|
id: `${SCRIPT_PLUGIN}/automation`,
|
|
40
50
|
role: 'complementary--function',
|
|
41
51
|
position: 'hoist',
|
|
42
|
-
filter: (data): data is { subject: ScriptType } => data.subject
|
|
52
|
+
filter: (data): data is { subject: ScriptType } => isInstanceOf(ScriptType, data.subject),
|
|
43
53
|
component: ({ data }) => {
|
|
44
54
|
// TODO(wittjosiah): Decouple hooks from toolbar state.
|
|
45
|
-
const state = useToolbarState(
|
|
55
|
+
const state = useToolbarState();
|
|
46
56
|
useDeployState({ state, script: data.subject });
|
|
47
57
|
return <DebugPanel functionUrl={state.functionUrl} />;
|
|
48
58
|
},
|
|
@@ -50,7 +60,7 @@ export default () =>
|
|
|
50
60
|
createSurface({
|
|
51
61
|
id: `${SCRIPT_PLUGIN}/settings-panel`,
|
|
52
62
|
role: 'complementary--settings',
|
|
53
|
-
filter: (data): data is { subject: ScriptType } => data.subject
|
|
63
|
+
filter: (data): data is { subject: ScriptType } => isInstanceOf(ScriptType, data.subject),
|
|
54
64
|
component: ({ data }) => (
|
|
55
65
|
<Clipboard.Provider>
|
|
56
66
|
<ScriptSettingsPanel script={data.subject} />
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { decodeReference } from '@dxos/echo-protocol';
|
|
8
|
-
import { type
|
|
9
|
-
import {
|
|
8
|
+
import { type InvocationTraceEvent, type ScriptType, type TraceEvent } from '@dxos/functions/types';
|
|
9
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
10
10
|
import { Icon, List, ListItem, useTranslation, type ThemedClassName } from '@dxos/react-ui';
|
|
11
11
|
import { mx } from '@dxos/react-ui-theme';
|
|
12
12
|
|
|
@@ -21,8 +21,7 @@ export const LogsPanel = ({ script, classNames }: LogsPanelProps) => {
|
|
|
21
21
|
const { t } = useTranslation(SCRIPT_PLUGIN);
|
|
22
22
|
// TODO(wittjosiah): Refactor these hooks.
|
|
23
23
|
const { space, existingFunctionUrl } = useDeployDeps({ script });
|
|
24
|
-
const
|
|
25
|
-
const invocationTraceQueue = useQueue<InvocationTraceEvent>(edgeClient, space?.properties.invocationTraceQueue?.dxn, {
|
|
24
|
+
const invocationTraceQueue = useQueue<InvocationTraceEvent>(space?.properties.invocationTraceQueue?.dxn, {
|
|
26
25
|
pollInterval: 500,
|
|
27
26
|
});
|
|
28
27
|
const [selected, setSelected] = useState<InvocationTraceEvent>();
|
|
@@ -61,11 +60,7 @@ const InvocationTraceItem = ({
|
|
|
61
60
|
open?: boolean;
|
|
62
61
|
setOpen?: (trace: InvocationTraceEvent, open: boolean) => void;
|
|
63
62
|
}) => {
|
|
64
|
-
const
|
|
65
|
-
const eventQueue = useQueue<TraceEvent>(
|
|
66
|
-
edgeClient,
|
|
67
|
-
open ? decodeReference(trace.invocationTraceQueue).dxn : undefined,
|
|
68
|
-
);
|
|
63
|
+
const eventQueue = useQueue<TraceEvent>(open ? decodeReference(trace.invocationTraceQueue).dxn : undefined);
|
|
69
64
|
|
|
70
65
|
const handleOpenChange = useCallback(
|
|
71
66
|
(open: boolean) => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ScriptType } from '@dxos/functions';
|
|
7
|
+
import { type ScriptType } from '@dxos/functions/types';
|
|
8
8
|
import { createDocAccessor, getSpace } from '@dxos/react-client/echo';
|
|
9
9
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
10
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
@@ -20,6 +20,7 @@ import { type ScriptSettingsProps } from '../types';
|
|
|
20
20
|
|
|
21
21
|
export type ScriptEditorProps = ThemedClassName<{
|
|
22
22
|
script: ScriptType;
|
|
23
|
+
variant?: 'logs';
|
|
23
24
|
settings?: ScriptSettingsProps;
|
|
24
25
|
role?: string;
|
|
25
26
|
}> &
|
|
@@ -29,6 +30,7 @@ export const ScriptContainer = ({
|
|
|
29
30
|
role,
|
|
30
31
|
classNames,
|
|
31
32
|
script,
|
|
33
|
+
variant,
|
|
32
34
|
settings = { editorInputMode: 'vscode' },
|
|
33
35
|
env,
|
|
34
36
|
}: ScriptEditorProps) => {
|
|
@@ -54,7 +56,7 @@ export const ScriptContainer = ({
|
|
|
54
56
|
[script, script.source.target, space, identity],
|
|
55
57
|
);
|
|
56
58
|
|
|
57
|
-
const state = useToolbarState(
|
|
59
|
+
const state = useToolbarState();
|
|
58
60
|
useDeployState({ state, script });
|
|
59
61
|
|
|
60
62
|
if (!space) {
|
|
@@ -62,10 +64,12 @@ export const ScriptContainer = ({
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
return (
|
|
65
|
-
<StackItem.Content toolbar>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
<StackItem.Content toolbar={variant !== 'logs'}>
|
|
68
|
+
{variant === 'logs' ? (
|
|
69
|
+
<LogsPanel script={script} />
|
|
70
|
+
) : (
|
|
71
|
+
<>
|
|
72
|
+
<ScriptToolbar state={state} role={role} script={script} />
|
|
69
73
|
<TypescriptEditor
|
|
70
74
|
id={script.id}
|
|
71
75
|
env={env}
|
|
@@ -75,10 +79,8 @@ export const ScriptContainer = ({
|
|
|
75
79
|
inputMode={settings.editorInputMode}
|
|
76
80
|
toolbar
|
|
77
81
|
/>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{state.view !== 'editor' && <LogsPanel script={script} classNames='grow' />}
|
|
81
|
-
</div>
|
|
82
|
+
</>
|
|
83
|
+
)}
|
|
82
84
|
</StackItem.Content>
|
|
83
85
|
);
|
|
84
86
|
};
|
|
@@ -6,7 +6,7 @@ import { Octokit } from '@octokit/core';
|
|
|
6
6
|
import React, { type ChangeEvent, useCallback, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { createIntent, SettingsAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
|
|
9
|
+
import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions/types';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ScriptType } from '@dxos/functions';
|
|
7
|
+
import { type ScriptType } from '@dxos/functions/types';
|
|
8
8
|
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
9
9
|
import { ElevationProvider, type ThemedClassName } from '@dxos/react-ui';
|
|
10
10
|
import { stackItemContentToolbarClassNames } from '@dxos/react-ui-editor';
|
package/src/hooks/deploy.ts
CHANGED
|
@@ -143,6 +143,7 @@ export const useDeployHandler = ({ state, script }: { state: Partial<DeployState
|
|
|
143
143
|
} else {
|
|
144
144
|
log.verbose('no input schema in function metadata', { functionId });
|
|
145
145
|
}
|
|
146
|
+
|
|
146
147
|
if (meta.outputSchema) {
|
|
147
148
|
deployedFunction.outputSchema = meta.outputSchema;
|
|
148
149
|
} else {
|
|
@@ -150,8 +151,6 @@ export const useDeployHandler = ({ state, script }: { state: Partial<DeployState
|
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
setUserFunctionUrlInMetadata(getMeta(deployedFunction), `/${space.id}/${functionId}`);
|
|
153
|
-
|
|
154
|
-
state.view = 'split';
|
|
155
154
|
} catch (err: any) {
|
|
156
155
|
log.catch(err);
|
|
157
156
|
state.error = t('upload failed label');
|
package/src/hooks/format.ts
CHANGED
|
@@ -7,7 +7,7 @@ import prettierPluginEstree from 'prettier/plugins/estree';
|
|
|
7
7
|
import prettierPluginTypescript from 'prettier/plugins/typescript';
|
|
8
8
|
import { useCallback } from 'react';
|
|
9
9
|
|
|
10
|
-
import { type ScriptType } from '@dxos/functions';
|
|
10
|
+
import { type ScriptType } from '@dxos/functions/types';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import { createMenuAction } from '@dxos/react-ui-menu';
|
|
13
13
|
|
package/src/hooks/template.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions';
|
|
7
|
+
import { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions/types';
|
|
8
8
|
import { getMeta } from '@dxos/live-object';
|
|
9
9
|
import { createMenuItemGroup, createMenuAction } from '@dxos/react-ui-menu';
|
|
10
10
|
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { type ScriptType } from '@dxos/functions/types';
|
|
8
9
|
import { log } from '@dxos/log';
|
|
10
|
+
import { DeckAction, surfaceVariant } from '@dxos/plugin-deck/types';
|
|
11
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
9
12
|
import { type MenuAction, type MenuActionHandler } from '@dxos/react-ui-menu';
|
|
10
13
|
|
|
11
14
|
import { type DeployActionProperties, useDeployHandler, useCopyHandler } from './deploy';
|
|
@@ -27,15 +30,21 @@ export const useToolbarAction = (props: { state: ScriptToolbarState; script: Scr
|
|
|
27
30
|
const handleFormat = useFormatHandler(props);
|
|
28
31
|
const handleDeploy = useDeployHandler(props);
|
|
29
32
|
const handleCopy = useCopyHandler(props);
|
|
33
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
30
34
|
return useCallback(
|
|
31
35
|
((action: ScriptToolbarAction) => {
|
|
32
36
|
switch (action.properties.type) {
|
|
37
|
+
case 'view':
|
|
38
|
+
void dispatch(
|
|
39
|
+
createIntent(DeckAction.ChangeCompanion, {
|
|
40
|
+
primary: fullyQualifiedId(props.script),
|
|
41
|
+
companion: surfaceVariant('logs'),
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
break;
|
|
33
45
|
case 'template':
|
|
34
46
|
handleTemplateSelect(action.properties.value);
|
|
35
47
|
break;
|
|
36
|
-
case 'view':
|
|
37
|
-
props.state.view = action.properties.value;
|
|
38
|
-
break;
|
|
39
48
|
case 'format':
|
|
40
49
|
void handleFormat();
|
|
41
50
|
break;
|