@dxos/plugin-script 0.6.13-staging.1e988a3 → 0.6.14-main.2b6a0f3
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/README.md +1 -1
- package/dist/lib/browser/AutomationPanel-Y7LQYFOY.mjs +78 -0
- package/dist/lib/browser/AutomationPanel-Y7LQYFOY.mjs.map +7 -0
- package/dist/lib/browser/ScriptContainer-KGZGB5AY.mjs +423 -0
- package/dist/lib/browser/ScriptContainer-KGZGB5AY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RHEZ5LUU.mjs → chunk-C4AX55JL.mjs} +51 -2
- package/dist/lib/browser/{chunk-RHEZ5LUU.mjs.map → chunk-C4AX55JL.mjs.map} +4 -4
- package/dist/lib/browser/{chunk-DL5XQRQM.mjs → chunk-KHNN3F7J.mjs} +18 -6
- package/dist/lib/browser/chunk-KHNN3F7J.mjs.map +7 -0
- package/dist/lib/browser/{chunk-O4LWBX6A.mjs → chunk-KXVQPS4Y.mjs} +2 -2
- package/dist/lib/browser/{chunk-O4LWBX6A.mjs.map → chunk-KXVQPS4Y.mjs.map} +2 -2
- package/dist/lib/browser/chunk-SGQHRB4P.mjs +17 -0
- package/dist/lib/browser/chunk-SGQHRB4P.mjs.map +7 -0
- package/dist/lib/browser/chunk-SP3Q7BCM.mjs +248 -0
- package/dist/lib/browser/chunk-SP3Q7BCM.mjs.map +7 -0
- package/dist/lib/browser/edge/index.mjs +5 -1
- package/dist/lib/browser/index.mjs +86 -61
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node/AutomationPanel-UNLRYLMA.cjs +100 -0
- package/dist/lib/node/AutomationPanel-UNLRYLMA.cjs.map +7 -0
- package/dist/lib/node/ScriptContainer-BIBIIJHP.cjs +425 -0
- package/dist/lib/node/ScriptContainer-BIBIIJHP.cjs.map +7 -0
- package/dist/lib/node/{chunk-5RBVXKXT.cjs → chunk-25PQE7FL.cjs} +6 -6
- package/dist/lib/node/{chunk-5RBVXKXT.cjs.map → chunk-25PQE7FL.cjs.map} +2 -2
- package/dist/lib/node/{TypescriptEditor-M3WWFIP2.cjs → chunk-EJC55SDD.cjs} +18 -8
- package/dist/lib/node/chunk-EJC55SDD.cjs.map +7 -0
- package/dist/lib/node/{chunk-PFH3ROEH.cjs → chunk-FY5KKL5N.cjs} +22 -8
- package/dist/lib/node/chunk-FY5KKL5N.cjs.map +7 -0
- package/dist/lib/node/{chunk-4GTXIELQ.cjs → chunk-NKWNQMJH.cjs} +44 -6
- package/dist/lib/node/chunk-NKWNQMJH.cjs.map +7 -0
- package/dist/lib/node/chunk-NWBG5QDN.cjs +277 -0
- package/dist/lib/node/chunk-NWBG5QDN.cjs.map +7 -0
- package/dist/lib/node/edge/index.cjs +12 -8
- package/dist/lib/node/edge/index.cjs.map +2 -2
- package/dist/lib/node/index.cjs +103 -82
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +3 -3
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/AutomationPanel-D4NHEKM6.mjs +79 -0
- package/dist/lib/node-esm/AutomationPanel-D4NHEKM6.mjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-4VQ46IAZ.mjs +424 -0
- package/dist/lib/node-esm/ScriptContainer-4VQ46IAZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7EDYDVQH.mjs +47 -0
- package/dist/lib/node-esm/chunk-7EDYDVQH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EEDWDGZT.mjs +249 -0
- package/dist/lib/node-esm/chunk-EEDWDGZT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GO7HYFM5.mjs +19 -0
- package/dist/lib/node-esm/chunk-GO7HYFM5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QMTTZYLF.mjs +255 -0
- package/dist/lib/node-esm/chunk-QMTTZYLF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YIISE4MX.mjs +280 -0
- package/dist/lib/node-esm/chunk-YIISE4MX.mjs.map +7 -0
- package/dist/lib/node-esm/edge/index.mjs +24 -0
- package/dist/lib/node-esm/index.mjs +317 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +10 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +13 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +17 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/index.d.ts +4 -0
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/{DebugPanel.d.ts → DebugPanel/DebugPanel.d.ts} +2 -1
- package/dist/types/src/components/DebugPanel/DebugPanel.d.ts.map +1 -0
- package/dist/types/src/components/DebugPanel/index.d.ts +2 -0
- package/dist/types/src/components/DebugPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/{ScriptBlock/FrameContainer → FrameContainer}/FrameContainer.d.ts +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -0
- package/dist/types/src/components/FrameContainer/frame.d.ts.map +1 -0
- package/dist/types/src/components/FrameContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts +1 -3
- package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts.map +1 -1
- package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts +3 -8
- package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +5 -0
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/components/ScriptEditor.d.ts +4 -5
- package/dist/types/src/components/ScriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts +6 -0
- package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts.map +1 -0
- package/dist/types/src/components/ScriptSettings/index.d.ts +2 -0
- package/dist/types/src/components/ScriptSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +23 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +14 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/{TypescriptEditor.d.ts → TypescriptEditor/TypescriptEditor.d.ts} +1 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -0
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +6 -0
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TypescriptEditor/index.d.ts +2 -0
- package/dist/types/src/components/TypescriptEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts +7 -0
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -9
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/templates/chat.d.ts +6 -0
- package/dist/types/src/templates/chat.d.ts.map +1 -0
- package/dist/types/src/templates/chess.d.ts +6 -0
- package/dist/types/src/templates/chess.d.ts.map +1 -0
- package/dist/types/src/templates/echo.d.ts +6 -0
- package/dist/types/src/templates/echo.d.ts.map +1 -0
- package/dist/types/src/templates/email.d.ts +6 -0
- package/dist/types/src/templates/email.d.ts.map +1 -0
- package/dist/types/src/templates/forex.d.ts +6 -0
- package/dist/types/src/templates/forex.d.ts.map +1 -0
- package/dist/types/src/templates.d.ts +8 -0
- package/dist/types/src/templates.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/script.d.ts +4 -4
- package/dist/types/src/types/types.d.ts +4 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +62 -55
- package/src/ScriptPlugin.tsx +26 -39
- package/src/bundler/bundler.test.ts +12 -2
- package/src/components/AutomationPanel/AutomationPanel.tsx +101 -0
- package/src/components/AutomationPanel/index.ts +9 -0
- package/src/components/{DebugPanel.tsx → DebugPanel/DebugPanel.tsx} +83 -78
- package/src/components/DebugPanel/index.ts +5 -0
- package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/FrameContainer.tsx +1 -1
- package/src/components/ScriptBlock/ScriptBlock.stories.tsx +15 -14
- package/src/components/ScriptBlock/ScriptBlock.tsx +23 -51
- package/src/components/ScriptContainer.tsx +22 -0
- package/src/components/ScriptEditor.tsx +58 -55
- package/src/components/ScriptSettings/ScriptSettings.tsx +47 -0
- package/src/components/ScriptSettings/index.ts +5 -0
- package/src/components/Toolbar/Toolbar.stories.tsx +30 -0
- package/src/components/Toolbar/Toolbar.tsx +177 -0
- package/src/components/{ScriptBlock/Splitter → Toolbar}/index.ts +1 -1
- package/src/components/{TypescriptEditor.stories.tsx → TypescriptEditor/TypescriptEditor.stories.tsx} +17 -35
- package/src/components/{TypescriptEditor.tsx → TypescriptEditor/TypescriptEditor.tsx} +1 -3
- package/src/components/TypescriptEditor/index.ts +5 -0
- package/src/components/index.ts +5 -3
- package/src/edge/functions.ts +19 -0
- package/src/meta.ts +15 -0
- package/src/templates/chat.ts +102 -0
- package/src/templates/chess.ts +41 -0
- package/src/templates/echo.ts +15 -0
- package/src/templates/email.ts +38 -0
- package/src/templates/forex.ts +21 -0
- package/src/templates.ts +54 -0
- package/src/translations.ts +2 -0
- package/src/types/types.ts +9 -5
- package/dist/lib/browser/ScriptEditor-5Y3EROG3.mjs +0 -513
- package/dist/lib/browser/ScriptEditor-5Y3EROG3.mjs.map +0 -7
- package/dist/lib/browser/TypescriptEditor-GPE72Y6I.mjs +0 -9
- package/dist/lib/browser/chunk-DL5XQRQM.mjs.map +0 -7
- package/dist/lib/browser/chunk-JBACGDOJ.mjs +0 -21
- package/dist/lib/browser/chunk-JBACGDOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRGOT5RF.mjs +0 -78
- package/dist/lib/browser/chunk-MRGOT5RF.mjs.map +0 -7
- package/dist/lib/node/ScriptEditor-YCUQFWQM.cjs +0 -526
- package/dist/lib/node/ScriptEditor-YCUQFWQM.cjs.map +0 -7
- package/dist/lib/node/TypescriptEditor-M3WWFIP2.cjs.map +0 -7
- package/dist/lib/node/chunk-4GTXIELQ.cjs.map +0 -7
- package/dist/lib/node/chunk-4VMNBXWU.cjs +0 -54
- package/dist/lib/node/chunk-4VMNBXWU.cjs.map +0 -7
- package/dist/lib/node/chunk-IMLDKD5Y.cjs +0 -111
- package/dist/lib/node/chunk-IMLDKD5Y.cjs.map +0 -7
- package/dist/lib/node/chunk-PFH3ROEH.cjs.map +0 -7
- package/dist/types/src/components/DebugPanel.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/FrameContainer/FrameContainer.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/FrameContainer/frame.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/FrameContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.d.ts +0 -15
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.stories.d.ts +0 -13
- package/dist/types/src/components/ScriptBlock/Splitter/Splitter.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptBlock/Splitter/index.d.ts +0 -2
- package/dist/types/src/components/ScriptBlock/Splitter/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar.d.ts +0 -13
- package/dist/types/src/components/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar.stories.d.ts +0 -14
- package/dist/types/src/components/Toolbar.stories.d.ts.map +0 -1
- package/dist/types/src/components/TypescriptEditor.d.ts.map +0 -1
- package/dist/types/src/components/TypescriptEditor.stories.d.ts +0 -10
- package/dist/types/src/components/TypescriptEditor.stories.d.ts.map +0 -1
- package/src/components/ScriptBlock/Splitter/Splitter.stories.tsx +0 -37
- package/src/components/ScriptBlock/Splitter/Splitter.tsx +0 -52
- package/src/components/Toolbar.stories.tsx +0 -17
- package/src/components/Toolbar.tsx +0 -147
- package/src/meta.tsx +0 -19
- /package/dist/lib/{browser/TypescriptEditor-GPE72Y6I.mjs.map → node-esm/edge/index.mjs.map} +0 -0
- /package/dist/types/src/components/{ScriptBlock/FrameContainer → FrameContainer}/frame.d.ts +0 -0
- /package/dist/types/src/components/{ScriptBlock/FrameContainer → FrameContainer}/index.d.ts +0 -0
- /package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/frame.html +0 -0
- /package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/frame.tsx +0 -0
- /package/src/components/{ScriptBlock/FrameContainer → FrameContainer}/index.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../src/templates/email.ts"],"names":[],"mappings":"AAIA;;GAEG;iFAMA,GAAG;AALN,wBA8BE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forex.d.ts","sourceRoot":"","sources":["../../../../src/templates/forex.ts"],"names":[],"mappings":"AAIA;;GAEG;6DAKA,GAAG;AAJN,wBAaE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/templates.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,QAAQ,EA6B/B,CAAC"}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;AAMA,wBAqBE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ref, S } from '@dxos/echo-schema';
|
|
2
2
|
declare const ScriptType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
3
3
|
name?: string | undefined;
|
|
4
|
+
description?: string | undefined;
|
|
4
5
|
source: import("@dxos/echo-schema").Ref<{
|
|
5
6
|
content: string;
|
|
6
7
|
} & {
|
|
7
8
|
id: string;
|
|
8
9
|
}>;
|
|
9
|
-
description?: string | undefined;
|
|
10
10
|
changed?: boolean | undefined;
|
|
11
11
|
} & {
|
|
12
12
|
id: string;
|
|
@@ -27,19 +27,19 @@ export declare class ScriptType extends ScriptType_base {
|
|
|
27
27
|
}
|
|
28
28
|
declare const FunctionType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
29
29
|
name?: string | undefined;
|
|
30
|
-
version: number;
|
|
31
30
|
source?: import("@dxos/echo-schema").Ref<{
|
|
32
31
|
name?: string | undefined;
|
|
32
|
+
description?: string | undefined;
|
|
33
33
|
source: import("@dxos/echo-schema").Ref<{
|
|
34
34
|
content: string;
|
|
35
35
|
} & {
|
|
36
36
|
id: string;
|
|
37
37
|
}>;
|
|
38
|
-
description?: string | undefined;
|
|
39
38
|
changed?: boolean | undefined;
|
|
40
39
|
} & {
|
|
41
40
|
id: string;
|
|
42
41
|
}>;
|
|
42
|
+
version: number;
|
|
43
43
|
binding?: string | undefined;
|
|
44
44
|
} & {
|
|
45
45
|
id: string;
|
|
@@ -49,12 +49,12 @@ declare const FunctionType_base: import("@dxos/echo-schema").AbstractTypedObject
|
|
|
49
49
|
binding: S.optional<typeof S.String>;
|
|
50
50
|
source: S.optional<ref<{
|
|
51
51
|
name?: string | undefined;
|
|
52
|
+
description?: string | undefined;
|
|
52
53
|
source: import("@dxos/echo-schema").Ref<{
|
|
53
54
|
content: string;
|
|
54
55
|
} & {
|
|
55
56
|
id: string;
|
|
56
57
|
}>;
|
|
57
|
-
description?: string | undefined;
|
|
58
58
|
changed?: boolean | undefined;
|
|
59
59
|
} & {
|
|
60
60
|
id: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { GraphBuilderProvides, IntentResolverProvides, MetadataRecordsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
1
|
+
import type { GraphBuilderProvides, IntentResolverProvides, MetadataRecordsProvides, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
2
2
|
import { type SchemaProvides } from '@dxos/plugin-client';
|
|
3
|
-
import { type
|
|
3
|
+
import { type SpaceInitProvides } from '@dxos/plugin-space';
|
|
4
4
|
export declare enum ScriptAction {
|
|
5
5
|
CREATE = "dxos.org/plugin/script/create"
|
|
6
6
|
}
|
|
7
|
-
export type
|
|
7
|
+
export type ScriptSettingsProps = {};
|
|
8
|
+
export type ScriptPluginProvides = GraphBuilderProvides & IntentResolverProvides & MetadataRecordsProvides & SchemaProvides & SettingsProvides<ScriptSettingsProps> & SpaceInitProvides & SurfaceProvides & TranslationsProvides;
|
|
8
9
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAI5D,oBAAY,YAAY;IACtB,MAAM,kCAA4B;CACnC;AAED,MAAM,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GACrD,sBAAsB,GACtB,uBAAuB,GACvB,cAAc,GACd,gBAAgB,CAAC,mBAAmB,CAAC,GACrC,iBAAiB,GACjB,eAAe,GACf,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14-main.2b6a0f3",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
|
+
"sideEffects": false,
|
|
9
10
|
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"browser": "./dist/lib/browser/index.mjs",
|
|
12
|
-
"node": {
|
|
13
|
-
"default": "./dist/lib/node/index.cjs"
|
|
14
|
-
},
|
|
15
|
-
"types": "./dist/types/src/index.d.ts"
|
|
16
|
-
},
|
|
17
11
|
"./edge": {
|
|
18
12
|
"browser": "./dist/lib/browser/edge/index.mjs",
|
|
19
13
|
"node": {
|
|
20
|
-
"
|
|
14
|
+
"require": "./dist/lib/node/edge/index.cjs",
|
|
15
|
+
"default": "./dist/lib/node-esm/edge/index.mjs"
|
|
21
16
|
},
|
|
22
17
|
"types": "./dist/types/src/edge/index.d.ts"
|
|
23
18
|
},
|
|
19
|
+
".": {
|
|
20
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
21
|
+
"node": {
|
|
22
|
+
"require": "./dist/lib/node/index.cjs",
|
|
23
|
+
"default": "./dist/lib/node-esm/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"types": "./dist/types/src/index.d.ts"
|
|
26
|
+
},
|
|
24
27
|
"./meta": {
|
|
25
28
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
26
29
|
"node": {
|
|
27
|
-
"
|
|
30
|
+
"require": "./dist/lib/node/meta.cjs",
|
|
31
|
+
"default": "./dist/lib/node-esm/meta.mjs"
|
|
28
32
|
},
|
|
29
33
|
"types": "./dist/types/src/meta.d.ts"
|
|
30
34
|
},
|
|
31
35
|
"./types": {
|
|
32
36
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
33
37
|
"node": {
|
|
34
|
-
"
|
|
38
|
+
"require": "./dist/lib/node/types/index.cjs",
|
|
39
|
+
"default": "./dist/lib/node-esm/types/index.mjs"
|
|
35
40
|
},
|
|
36
41
|
"types": "./dist/types/src/types/index.d.ts"
|
|
37
42
|
}
|
|
@@ -55,14 +60,15 @@
|
|
|
55
60
|
"src"
|
|
56
61
|
],
|
|
57
62
|
"dependencies": {
|
|
58
|
-
"@codemirror/autocomplete": "^6.18.
|
|
63
|
+
"@codemirror/autocomplete": "^6.18.1",
|
|
59
64
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
60
|
-
"@codemirror/language": "^6.10.
|
|
61
|
-
"@codemirror/lint": "^6.8.
|
|
65
|
+
"@codemirror/language": "^6.10.3",
|
|
66
|
+
"@codemirror/lint": "^6.8.2",
|
|
62
67
|
"@codemirror/state": "^6.4.1",
|
|
63
68
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
64
|
-
"@codemirror/view": "^6.
|
|
65
|
-
"@
|
|
69
|
+
"@codemirror/view": "^6.34.1",
|
|
70
|
+
"@effect/schema": "^0.75.1",
|
|
71
|
+
"@lezer/common": "^1.2.2",
|
|
66
72
|
"@preact/signals-core": "^1.6.0",
|
|
67
73
|
"@typescript/vfs": "^1.6.0",
|
|
68
74
|
"@valtown/codemirror-ts": "^2.2.0",
|
|
@@ -72,32 +78,33 @@
|
|
|
72
78
|
"lodash.get": "^4.4.2",
|
|
73
79
|
"prettier": "^3.2.4",
|
|
74
80
|
"react-syntax-highlighter": "^15.5.0",
|
|
75
|
-
"typescript": "^5.
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/log": "0.6.
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/plugin-
|
|
88
|
-
"@dxos/plugin-
|
|
89
|
-
"@dxos/plugin-
|
|
90
|
-
"@dxos/plugin-
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/react-
|
|
96
|
-
"@dxos/react-ui-
|
|
97
|
-
"@dxos/react-ui-
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/rpc
|
|
100
|
-
"@dxos/
|
|
81
|
+
"typescript": "^5.6.2",
|
|
82
|
+
"@dxos/client": "0.6.14-main.2b6a0f3",
|
|
83
|
+
"@dxos/app-framework": "0.6.14-main.2b6a0f3",
|
|
84
|
+
"@dxos/client-protocol": "0.6.14-main.2b6a0f3",
|
|
85
|
+
"@dxos/async": "0.6.14-main.2b6a0f3",
|
|
86
|
+
"@dxos/crypto": "0.6.14-main.2b6a0f3",
|
|
87
|
+
"@dxos/debug": "0.6.14-main.2b6a0f3",
|
|
88
|
+
"@dxos/invariant": "0.6.14-main.2b6a0f3",
|
|
89
|
+
"@dxos/echo-schema": "0.6.14-main.2b6a0f3",
|
|
90
|
+
"@dxos/log": "0.6.14-main.2b6a0f3",
|
|
91
|
+
"@dxos/keys": "0.6.14-main.2b6a0f3",
|
|
92
|
+
"@dxos/plugin-client": "0.6.14-main.2b6a0f3",
|
|
93
|
+
"@dxos/plugin-explorer": "0.6.14-main.2b6a0f3",
|
|
94
|
+
"@dxos/plugin-graph": "0.6.14-main.2b6a0f3",
|
|
95
|
+
"@dxos/plugin-markdown": "0.6.14-main.2b6a0f3",
|
|
96
|
+
"@dxos/plugin-settings": "0.6.14-main.2b6a0f3",
|
|
97
|
+
"@dxos/plugin-stack": "0.6.14-main.2b6a0f3",
|
|
98
|
+
"@dxos/plugin-theme": "0.6.14-main.2b6a0f3",
|
|
99
|
+
"@dxos/plugin-space": "0.6.14-main.2b6a0f3",
|
|
100
|
+
"@dxos/protocols": "0.6.14-main.2b6a0f3",
|
|
101
|
+
"@dxos/react-client": "0.6.14-main.2b6a0f3",
|
|
102
|
+
"@dxos/react-ui-editor": "0.6.14-main.2b6a0f3",
|
|
103
|
+
"@dxos/react-ui-attention": "0.6.14-main.2b6a0f3",
|
|
104
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.14-main.2b6a0f3",
|
|
105
|
+
"@dxos/rpc": "0.6.14-main.2b6a0f3",
|
|
106
|
+
"@dxos/rpc-tunnel": "0.6.14-main.2b6a0f3",
|
|
107
|
+
"@dxos/util": "0.6.14-main.2b6a0f3"
|
|
101
108
|
},
|
|
102
109
|
"devDependencies": {
|
|
103
110
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -106,21 +113,21 @@
|
|
|
106
113
|
"@types/react-dom": "~18.2.0",
|
|
107
114
|
"react": "~18.2.0",
|
|
108
115
|
"react-dom": "~18.2.0",
|
|
109
|
-
"vite": "
|
|
110
|
-
"@dxos/echo-generator": "0.6.
|
|
111
|
-
"@dxos/random": "0.6.
|
|
112
|
-
"@dxos/react-ui": "0.6.
|
|
113
|
-
"@dxos/react-ui-
|
|
114
|
-
"@dxos/react-ui
|
|
115
|
-
"@dxos/storybook-utils": "0.6.
|
|
116
|
+
"vite": "5.4.7",
|
|
117
|
+
"@dxos/echo-generator": "0.6.14-main.2b6a0f3",
|
|
118
|
+
"@dxos/random": "0.6.14-main.2b6a0f3",
|
|
119
|
+
"@dxos/react-ui-mosaic": "0.6.14-main.2b6a0f3",
|
|
120
|
+
"@dxos/react-ui-theme": "0.6.14-main.2b6a0f3",
|
|
121
|
+
"@dxos/react-ui": "0.6.14-main.2b6a0f3",
|
|
122
|
+
"@dxos/storybook-utils": "0.6.14-main.2b6a0f3"
|
|
116
123
|
},
|
|
117
|
-
"
|
|
124
|
+
"peerDependencies": {
|
|
118
125
|
"@phosphor-icons/react": "^2.1.5",
|
|
119
|
-
"react": "
|
|
120
|
-
"react-dom": "
|
|
121
|
-
"@dxos/react-ui
|
|
122
|
-
"@dxos/react-ui-
|
|
123
|
-
"@dxos/react-ui": "0.6.
|
|
126
|
+
"react": "~18.2.0",
|
|
127
|
+
"react-dom": "~18.2.0",
|
|
128
|
+
"@dxos/react-ui": "0.6.14-main.2b6a0f3",
|
|
129
|
+
"@dxos/react-ui-mosaic": "0.6.14-main.2b6a0f3",
|
|
130
|
+
"@dxos/react-ui-theme": "0.6.14-main.2b6a0f3"
|
|
124
131
|
},
|
|
125
132
|
"publishConfig": {
|
|
126
133
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Code, type IconProps } from '@phosphor-icons/react';
|
|
6
5
|
// @ts-ignore
|
|
7
6
|
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
8
7
|
import React from 'react';
|
|
@@ -17,8 +16,9 @@ import { loadObjectReferences } from '@dxos/react-client/echo';
|
|
|
17
16
|
|
|
18
17
|
import { initializeBundler } from './bundler';
|
|
19
18
|
import { Compiler } from './compiler';
|
|
20
|
-
import {
|
|
19
|
+
import { AutomationPanel, ScriptContainer, ScriptSettings } from './components';
|
|
21
20
|
import meta, { SCRIPT_PLUGIN } from './meta';
|
|
21
|
+
import { templates } from './templates';
|
|
22
22
|
import translations from './translations';
|
|
23
23
|
import { FunctionType, ScriptType } from './types';
|
|
24
24
|
import { ScriptAction, type ScriptPluginProvides } from './types';
|
|
@@ -45,12 +45,12 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
45
45
|
await initializeBundler({ wasmUrl });
|
|
46
46
|
},
|
|
47
47
|
provides: {
|
|
48
|
+
settings: {},
|
|
48
49
|
metadata: {
|
|
49
50
|
records: {
|
|
50
51
|
[ScriptType.typename]: {
|
|
51
52
|
placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],
|
|
52
|
-
icon:
|
|
53
|
-
iconSymbol: 'ph--code--regular',
|
|
53
|
+
icon: 'ph--code--regular',
|
|
54
54
|
// TODO(wittjosiah): Move out of metadata.
|
|
55
55
|
loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),
|
|
56
56
|
},
|
|
@@ -60,6 +60,12 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
60
60
|
echo: {
|
|
61
61
|
schema: [ScriptType, FunctionType],
|
|
62
62
|
},
|
|
63
|
+
space: {
|
|
64
|
+
onSpaceCreate: {
|
|
65
|
+
label: ['create object label', { ns: SCRIPT_PLUGIN }],
|
|
66
|
+
action: ScriptAction.CREATE,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
63
69
|
graph: {
|
|
64
70
|
builder: (plugins) => {
|
|
65
71
|
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
@@ -93,8 +99,7 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
93
99
|
},
|
|
94
100
|
properties: {
|
|
95
101
|
label: ['create object label', { ns: SCRIPT_PLUGIN }],
|
|
96
|
-
icon:
|
|
97
|
-
iconSymbol: 'ph--code--regular',
|
|
102
|
+
icon: 'ph--code--regular',
|
|
98
103
|
testId: 'scriptPlugin.createObject',
|
|
99
104
|
},
|
|
100
105
|
},
|
|
@@ -103,31 +108,24 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
103
108
|
});
|
|
104
109
|
},
|
|
105
110
|
},
|
|
106
|
-
stack: {
|
|
107
|
-
creators: [
|
|
108
|
-
{
|
|
109
|
-
id: 'create-stack-section-script',
|
|
110
|
-
testId: 'scriptPlugin.createSection',
|
|
111
|
-
type: ['plugin name', { ns: SCRIPT_PLUGIN }],
|
|
112
|
-
label: ['create stack section label', { ns: SCRIPT_PLUGIN }],
|
|
113
|
-
icon: (props: any) => <Code {...props} />,
|
|
114
|
-
intent: {
|
|
115
|
-
plugin: SCRIPT_PLUGIN,
|
|
116
|
-
action: ScriptAction.CREATE,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
111
|
surface: {
|
|
122
112
|
component: ({ data, role }) => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
switch (role) {
|
|
114
|
+
case 'settings': {
|
|
115
|
+
return data.plugin === meta.id ? <ScriptSettings settings={{}} /> : null;
|
|
116
|
+
}
|
|
126
117
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
case 'article': {
|
|
119
|
+
if (data.object instanceof ScriptType) {
|
|
120
|
+
return <ScriptContainer script={data.object} env={compiler.environment} />;
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
130
124
|
|
|
125
|
+
case 'complementary--automation': {
|
|
126
|
+
return <AutomationPanel subject={data.subject as any} />;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
131
129
|
return null;
|
|
132
130
|
},
|
|
133
131
|
},
|
|
@@ -135,7 +133,7 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
135
133
|
resolver: (intent) => {
|
|
136
134
|
switch (intent.action) {
|
|
137
135
|
case ScriptAction.CREATE: {
|
|
138
|
-
return { data: create(ScriptType, { source: create(TextType, { content:
|
|
136
|
+
return { data: create(ScriptType, { source: create(TextType, { content: templates[0].source }) }) };
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
},
|
|
@@ -143,14 +141,3 @@ export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
|
|
|
143
141
|
},
|
|
144
142
|
};
|
|
145
143
|
};
|
|
146
|
-
|
|
147
|
-
// TODO(burdon): Import.
|
|
148
|
-
const example = [
|
|
149
|
-
'export default async ({ ',
|
|
150
|
-
' event: { data: { request } },',
|
|
151
|
-
' context: { space, ai } ',
|
|
152
|
-
'}: any) => {',
|
|
153
|
-
" return new Response('Hello DXOS!');",
|
|
154
|
-
'};',
|
|
155
|
-
'',
|
|
156
|
-
].join('\n');
|
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
|
+
import { beforeAll, describe, expect, test } from 'vitest';
|
|
6
8
|
|
|
7
|
-
import {
|
|
9
|
+
import { isNode } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
import { Bundler, initializeBundler } from './bundler';
|
|
8
12
|
|
|
9
13
|
describe('Bundler', () => {
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
if (!isNode()) {
|
|
16
|
+
await initializeBundler({ wasmUrl });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
10
20
|
test('Basic', async () => {
|
|
11
21
|
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
12
22
|
const result = await bundler.bundle('const x = 100'); // TODO(burdon): Test import.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import type { EchoReactiveObject } from '@dxos/client/echo';
|
|
8
|
+
import { failUndefined } from '@dxos/debug';
|
|
9
|
+
import { useClient } from '@dxos/react-client';
|
|
10
|
+
import { Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { Select } from '@dxos/react-ui';
|
|
12
|
+
|
|
13
|
+
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '../../edge';
|
|
14
|
+
import { FunctionType, ScriptType } from '../../types';
|
|
15
|
+
import { DebugPanel } from '../DebugPanel';
|
|
16
|
+
|
|
17
|
+
export interface AutomationPanelProps {
|
|
18
|
+
subject: EchoReactiveObject<any>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const AutomationPanel = ({ subject }: AutomationPanelProps) => {
|
|
22
|
+
const space = getSpace(subject);
|
|
23
|
+
|
|
24
|
+
// TODO(dmaretskyi): Parametric query.
|
|
25
|
+
const functions = useQuery(
|
|
26
|
+
space ?? undefined,
|
|
27
|
+
Filter.schema(FunctionType, (fn) => (subject instanceof ScriptType ? fn.source === subject : fn.binding != null)),
|
|
28
|
+
{},
|
|
29
|
+
[subject],
|
|
30
|
+
);
|
|
31
|
+
const [selectedFunction, setSelectedFunction] = useState<FunctionType | null>(null);
|
|
32
|
+
const functionToChatWith = subject instanceof ScriptType ? functions[0] : selectedFunction;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className='h-full flex flex-col'>
|
|
36
|
+
{!(subject instanceof ScriptType) && (
|
|
37
|
+
<BindingSelect
|
|
38
|
+
selectedFunction={selectedFunction}
|
|
39
|
+
setSelectedFunction={setSelectedFunction}
|
|
40
|
+
functions={functions}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
{functionToChatWith && <ChatPanel fn={functionToChatWith} subject={subject} />}
|
|
44
|
+
{subject instanceof ScriptType && functions.length === 0 && <p>Deploy function to interact with it.</p>}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export interface ChatPanelProps {
|
|
50
|
+
fn: FunctionType;
|
|
51
|
+
subject: EchoReactiveObject<any>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const ChatPanel = ({ fn, subject }: ChatPanelProps) => {
|
|
55
|
+
const client = useClient();
|
|
56
|
+
const space = getSpace(fn);
|
|
57
|
+
const existingFunctionUrl = getUserFunctionUrlInMetadata(getMeta(fn));
|
|
58
|
+
const functionUrl = useMemo(() => {
|
|
59
|
+
if (!existingFunctionUrl) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return getInvocationUrl(existingFunctionUrl, client.config.values.runtime?.services?.edge?.url ?? '', {
|
|
64
|
+
spaceId: space?.id,
|
|
65
|
+
subjectId: subject?.id,
|
|
66
|
+
});
|
|
67
|
+
}, [existingFunctionUrl, space, subject]);
|
|
68
|
+
|
|
69
|
+
return <DebugPanel functionUrl={functionUrl} classNames='flex-1' />;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export interface BindingSelectProps {
|
|
73
|
+
selectedFunction: FunctionType | null;
|
|
74
|
+
setSelectedFunction: (fn: FunctionType) => void;
|
|
75
|
+
functions: FunctionType[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const BindingSelect = ({ selectedFunction, setSelectedFunction, functions }: BindingSelectProps) => {
|
|
79
|
+
return (
|
|
80
|
+
<Select.Root
|
|
81
|
+
value={selectedFunction?.id}
|
|
82
|
+
onValueChange={(id) => setSelectedFunction(functions.find((fn) => fn.id === id) ?? failUndefined())}
|
|
83
|
+
>
|
|
84
|
+
<Select.TriggerButton placeholder='Select value' />
|
|
85
|
+
<Select.Portal>
|
|
86
|
+
<Select.Content>
|
|
87
|
+
<Select.ScrollUpButton />
|
|
88
|
+
<Select.Viewport>
|
|
89
|
+
{functions.map(({ id, binding }) => (
|
|
90
|
+
<Select.Option key={id} value={id}>
|
|
91
|
+
{binding}
|
|
92
|
+
</Select.Option>
|
|
93
|
+
))}
|
|
94
|
+
</Select.Viewport>
|
|
95
|
+
<Select.ScrollDownButton />
|
|
96
|
+
<Select.Arrow />
|
|
97
|
+
</Select.Content>
|
|
98
|
+
</Select.Portal>
|
|
99
|
+
</Select.Root>
|
|
100
|
+
);
|
|
101
|
+
};
|