@dxos/plugin-script 0.7.5-labs.8a82073 → 0.7.5-labs.a8b535d
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-3RFMYKTV.mjs +258 -0
- package/dist/lib/browser/ScriptContainer-3RFMYKTV.mjs.map +7 -0
- package/dist/lib/browser/{artifact-3UZZBCZ2.mjs → artifact-definition-4LWPD3DH.mjs} +28 -20
- package/dist/lib/browser/artifact-definition-4LWPD3DH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-45LXDWNF.mjs → chunk-5SXOHNAK.mjs} +3 -3
- package/dist/lib/browser/chunk-5SXOHNAK.mjs.map +7 -0
- package/dist/lib/browser/{ScriptContainer-QI4NQT7V.mjs → chunk-G2FYNDU4.mjs} +20 -258
- package/dist/lib/browser/chunk-G2FYNDU4.mjs.map +7 -0
- package/dist/lib/browser/chunk-PZPYF7M4.mjs +69 -0
- package/dist/lib/browser/chunk-PZPYF7M4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F22QPQ6G.mjs → chunk-VTWBVFBK.mjs} +2 -4
- package/dist/lib/browser/{chunk-F22QPQ6G.mjs.map → chunk-VTWBVFBK.mjs.map} +3 -3
- package/dist/lib/browser/{compiler-K3FNRDDN.mjs → compiler-YY2XSKHQ.mjs} +2 -4
- package/dist/lib/browser/compiler-YY2XSKHQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +61 -36
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-CMKQTLBG.mjs → intent-resolver-D6FPY5ZA.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-YR4YO746.mjs → react-surface-G4C2PZ2K.mjs} +23 -7
- package/dist/lib/browser/react-surface-G4C2PZ2K.mjs.map +7 -0
- package/dist/lib/node/ScriptContainer-G6FZU4AM.cjs +274 -0
- package/dist/lib/node/ScriptContainer-G6FZU4AM.cjs.map +7 -0
- package/dist/lib/node/{artifact-A2QXHFGS.cjs → artifact-definition-BXQCFPAH.cjs} +27 -22
- package/dist/lib/node/artifact-definition-BXQCFPAH.cjs.map +7 -0
- package/dist/lib/node/chunk-ITAJ3WRW.cjs +77 -0
- package/dist/lib/node/chunk-ITAJ3WRW.cjs.map +7 -0
- package/dist/lib/node/{chunk-IID7WUQS.cjs → chunk-K3ZZWVXS.cjs} +5 -5
- package/dist/lib/node/chunk-K3ZZWVXS.cjs.map +7 -0
- package/dist/lib/node/{chunk-JSANQCTA.cjs → chunk-TOXBGIEI.cjs} +5 -8
- package/dist/lib/node/{chunk-JSANQCTA.cjs.map → chunk-TOXBGIEI.cjs.map} +3 -3
- package/dist/lib/node/{ScriptContainer-FSKWJR6Z.cjs → chunk-XKYJYY3T.cjs} +64 -283
- package/dist/lib/node/chunk-XKYJYY3T.cjs.map +7 -0
- package/dist/lib/node/{compiler-P2HQB22H.cjs → compiler-UIBLKJKG.cjs} +6 -6
- package/dist/lib/node/compiler-UIBLKJKG.cjs.map +7 -0
- package/dist/lib/node/index.cjs +59 -36
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-V5ASU5DW.cjs → intent-resolver-NYJFPD5B.cjs} +6 -6
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-MFTICFI5.cjs → react-surface-EGSE3FMN.cjs} +24 -12
- package/dist/lib/node/react-surface-EGSE3FMN.cjs.map +7 -0
- package/dist/lib/node-esm/ScriptContainer-7FTCFIF3.mjs +259 -0
- package/dist/lib/node-esm/ScriptContainer-7FTCFIF3.mjs.map +7 -0
- package/dist/lib/node-esm/{artifact-RFZQ2AJJ.mjs → artifact-definition-KT4DK2LQ.mjs} +27 -20
- package/dist/lib/node-esm/artifact-definition-KT4DK2LQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CGF7EOGD.mjs → chunk-2AFXX34U.mjs} +3 -3
- package/dist/lib/node-esm/chunk-2AFXX34U.mjs.map +7 -0
- package/dist/lib/node-esm/{ScriptContainer-MNETNTNQ.mjs → chunk-NRICF4KE.mjs} +20 -258
- package/dist/lib/node-esm/chunk-NRICF4KE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FGO5DVO2.mjs → chunk-S64WSJQK.mjs} +2 -4
- package/dist/lib/node-esm/{chunk-FGO5DVO2.mjs.map → chunk-S64WSJQK.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-YIWRJ25J.mjs +71 -0
- package/dist/lib/node-esm/chunk-YIWRJ25J.mjs.map +7 -0
- package/dist/lib/node-esm/{compiler-PDN46H4Y.mjs → compiler-XTXFGZJM.mjs} +2 -4
- package/dist/lib/node-esm/compiler-XTXFGZJM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +61 -36
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-75BHFRUK.mjs → intent-resolver-KLBHSMW4.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-NAK6LMCY.mjs → react-surface-7YSGHZQM.mjs} +23 -7
- package/dist/lib/node-esm/react-surface-7YSGHZQM.mjs.map +7 -0
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/{artifact.d.ts → artifact-definition.d.ts} +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DebugPanel/DebugPanel.d.ts +1 -2
- package/dist/types/src/components/DebugPanel/DebugPanel.d.ts.map +1 -1
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +3 -4
- package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +1 -2
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts +1 -2
- package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts.map +1 -1
- package/dist/types/src/components/ScriptSettingsPanel.d.ts +1 -2
- package/dist/types/src/components/ScriptSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -2
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +1 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +4 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -1
- package/dist/types/src/hooks/view.d.ts +1 -1
- package/dist/types/src/hooks/view.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/templates/chess.d.ts +1 -4
- package/dist/types/src/templates/chess.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts +3 -0
- package/dist/types/src/templates/discord.d.ts.map +1 -0
- package/dist/types/src/templates/forex-effect.d.ts +0 -3
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +0 -3
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/index.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 +1 -1
- package/package.json +43 -44
- package/src/ScriptPlugin.tsx +38 -18
- package/src/capabilities/{artifact.ts → artifact-definition.ts} +16 -11
- package/src/capabilities/compiler.ts +1 -1
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/react-surface.tsx +9 -3
- package/src/components/DebugPanel/DebugPanel.tsx +2 -2
- package/src/components/FrameContainer/FrameContainer.tsx +5 -4
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +2 -2
- package/src/components/index.ts +1 -1
- package/src/events.ts +11 -0
- package/src/hooks/deploy.ts +3 -3
- package/src/hooks/view.ts +4 -1
- package/src/index.ts +0 -1
- package/src/templates/chat.ts +4 -4
- package/src/templates/chess.ts +42 -35
- package/src/templates/discord.ts +103 -0
- package/src/templates/forex-effect.ts +16 -17
- package/src/templates/forex.ts +2 -3
- package/src/templates/index.ts +10 -2
- package/src/translations.ts +3 -0
- package/dist/lib/browser/AutomationPanel-J3SZ5L3Y.mjs +0 -78
- package/dist/lib/browser/AutomationPanel-J3SZ5L3Y.mjs.map +0 -7
- package/dist/lib/browser/ScriptContainer-QI4NQT7V.mjs.map +0 -7
- package/dist/lib/browser/artifact-3UZZBCZ2.mjs.map +0 -7
- package/dist/lib/browser/chunk-45LXDWNF.mjs.map +0 -7
- package/dist/lib/browser/chunk-SDHKTS6H.mjs +0 -237
- package/dist/lib/browser/chunk-SDHKTS6H.mjs.map +0 -7
- package/dist/lib/browser/chunk-VIX22OMB.mjs +0 -60
- package/dist/lib/browser/chunk-VIX22OMB.mjs.map +0 -7
- package/dist/lib/browser/compiler-K3FNRDDN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YR4YO746.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-4M55FURO.cjs +0 -104
- package/dist/lib/node/AutomationPanel-4M55FURO.cjs.map +0 -7
- package/dist/lib/node/ScriptContainer-FSKWJR6Z.cjs.map +0 -7
- package/dist/lib/node/artifact-A2QXHFGS.cjs.map +0 -7
- package/dist/lib/node/chunk-IID7WUQS.cjs.map +0 -7
- package/dist/lib/node/chunk-PKT5DD3O.cjs +0 -70
- package/dist/lib/node/chunk-PKT5DD3O.cjs.map +0 -7
- package/dist/lib/node/chunk-T4TXCRN5.cjs +0 -260
- package/dist/lib/node/chunk-T4TXCRN5.cjs.map +0 -7
- package/dist/lib/node/compiler-P2HQB22H.cjs.map +0 -7
- package/dist/lib/node/react-surface-MFTICFI5.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-W6SKG35R.mjs +0 -79
- package/dist/lib/node-esm/AutomationPanel-W6SKG35R.mjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-MNETNTNQ.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-RFZQ2AJJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CGF7EOGD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-G76M6O46.mjs +0 -239
- package/dist/lib/node-esm/chunk-G76M6O46.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NBAL5DXN.mjs +0 -62
- package/dist/lib/node-esm/chunk-NBAL5DXN.mjs.map +0 -7
- package/dist/lib/node-esm/compiler-PDN46H4Y.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NAK6LMCY.mjs.map +0 -7
- package/dist/types/src/bundler/bundler.d.ts +0 -39
- package/dist/types/src/bundler/bundler.d.ts.map +0 -1
- package/dist/types/src/bundler/bundler.test.d.ts +0 -2
- package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
- package/dist/types/src/bundler/index.d.ts +0 -2
- package/dist/types/src/bundler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +0 -17
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +0 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts +0 -4
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +0 -1
- package/src/bundler/bundler.test.ts +0 -55
- package/src/bundler/bundler.ts +0 -250
- package/src/bundler/index.ts +0 -5
- package/src/components/AutomationPanel/AutomationPanel.tsx +0 -104
- package/src/components/AutomationPanel/index.ts +0 -9
- /package/dist/lib/browser/{intent-resolver-CMKQTLBG.mjs.map → intent-resolver-D6FPY5ZA.mjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-V5ASU5DW.cjs.map → intent-resolver-NYJFPD5B.cjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-75BHFRUK.mjs.map → intent-resolver-KLBHSMW4.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAQA,yBAAiB,YAAY,CAAC;IACrB,MAAM,aAAa,+CAAuD,CAAC;CACnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/hooks/deploy.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
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;AAUF,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,wBAqEtG,CAAC;AAEF,eAAO,MAAM,cAAc,cAAe;IAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAAE,wBAMhD,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare const createTemplateSelect: () => {
|
|
|
13
13
|
}];
|
|
14
14
|
variant: string;
|
|
15
15
|
};
|
|
16
|
-
data: typeof import("
|
|
16
|
+
data: typeof import("@dxos/app-graph").actionGroupSymbol;
|
|
17
17
|
} | {
|
|
18
18
|
id: string;
|
|
19
19
|
type: string;
|
|
@@ -18,7 +18,7 @@ export declare const createView: (state: Partial<ViewState>) => {
|
|
|
18
18
|
applyActive: boolean;
|
|
19
19
|
value: ViewType | undefined;
|
|
20
20
|
};
|
|
21
|
-
data: typeof import("
|
|
21
|
+
data: typeof import("@dxos/app-graph").actionGroupSymbol;
|
|
22
22
|
} | {
|
|
23
23
|
id: string;
|
|
24
24
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../src/hooks/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../src/hooks/view.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpD,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;AA+BrE,eAAO,MAAM,UAAU,UAAW,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAUnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AAEvB,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chess.d.ts","sourceRoot":"","sources":["../../../../src/templates/chess.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chess.d.ts","sourceRoot":"","sources":["../../../../src/templates/chess.ts"],"names":[],"mappings":";AAKA,wBA0CG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../../../../src/templates/discord.ts"],"names":[],"mappings":";AA8BA,wBAwEG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forex-effect.d.ts","sourceRoot":"","sources":["../../../../src/templates/forex-effect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forex-effect.d.ts","sourceRoot":"","sources":["../../../../src/templates/forex-effect.ts"],"names":[],"mappings":";AAeA,wBAyBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forex.d.ts","sourceRoot":"","sources":["../../../../src/templates/forex.ts"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"forex.d.ts","sourceRoot":"","sources":["../../../../src/templates/forex.ts"],"names":[],"mappings":";AAOA,wBAoBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"AAqBA,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,EAwC/B,CAAC"}
|
|
@@ -39,6 +39,7 @@ declare const _default: {
|
|
|
39
39
|
'view split label'?: undefined;
|
|
40
40
|
'view debug label'?: undefined;
|
|
41
41
|
'template select group label'?: undefined;
|
|
42
|
+
'function panel label'?: undefined;
|
|
42
43
|
} | {
|
|
43
44
|
'plugin name': string;
|
|
44
45
|
'object title placeholder': string;
|
|
@@ -77,6 +78,7 @@ declare const _default: {
|
|
|
77
78
|
'view split label': string;
|
|
78
79
|
'view debug label': string;
|
|
79
80
|
'template select group label': string;
|
|
81
|
+
'function panel label': string;
|
|
80
82
|
'typename label'?: undefined;
|
|
81
83
|
};
|
|
82
84
|
"dxos.org/plugin/script": {
|
|
@@ -117,6 +119,7 @@ declare const _default: {
|
|
|
117
119
|
'view split label': string;
|
|
118
120
|
'view debug label': string;
|
|
119
121
|
'template select group label': string;
|
|
122
|
+
'function panel label': string;
|
|
120
123
|
};
|
|
121
124
|
};
|
|
122
125
|
}[];
|
|
@@ -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,wBAkDE"}
|
|
@@ -13,7 +13,7 @@ export declare namespace ScriptAction {
|
|
|
13
13
|
name: S.optional<typeof S.String>;
|
|
14
14
|
gistUrl: S.optional<S.SchemaClass<string, string, never>>;
|
|
15
15
|
}>, S.Struct<{
|
|
16
|
-
space: S.Schema<import("@dxos/client
|
|
16
|
+
space: S.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
|
|
17
17
|
}>>;
|
|
18
18
|
output: S.Struct<{
|
|
19
19
|
object: typeof ScriptType;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.a8b535d",
|
|
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
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -53,41 +54,41 @@
|
|
|
53
54
|
"prettier": "^3.2.4",
|
|
54
55
|
"react-syntax-highlighter": "^15.5.0",
|
|
55
56
|
"typescript": "^5.7.2",
|
|
56
|
-
"@dxos/app-framework": "0.7.5-labs.
|
|
57
|
-
"@dxos/artifact": "0.7.5-labs.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/client": "0.7.5-labs.
|
|
61
|
-
"@dxos/client-protocol": "0.7.5-labs.
|
|
62
|
-
"@dxos/compute": "0.7.5-labs.
|
|
63
|
-
"@dxos/debug": "0.7.5-labs.
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/functions": "0.7.5-labs.
|
|
66
|
-
"@dxos/invariant": "0.7.5-labs.
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/plugin-
|
|
74
|
-
"@dxos/plugin-
|
|
75
|
-
"@dxos/plugin-markdown": "0.7.5-labs.
|
|
76
|
-
"@dxos/plugin-space": "0.7.5-labs.
|
|
77
|
-
"@dxos/plugin-stack": "0.7.5-labs.
|
|
78
|
-
"@dxos/plugin-theme": "0.7.5-labs.
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/react-ui-attention": "0.7.5-labs.
|
|
82
|
-
"@dxos/react-ui-editor": "0.7.5-labs.
|
|
83
|
-
"@dxos/react-ui-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-syntax-highlighter": "0.7.5-labs.
|
|
87
|
-
"@dxos/rpc": "0.7.5-labs.
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/util": "0.7.5-labs.
|
|
57
|
+
"@dxos/app-framework": "0.7.5-labs.a8b535d",
|
|
58
|
+
"@dxos/artifact": "0.7.5-labs.a8b535d",
|
|
59
|
+
"@dxos/assistant": "0.7.5-labs.a8b535d",
|
|
60
|
+
"@dxos/async": "0.7.5-labs.a8b535d",
|
|
61
|
+
"@dxos/client": "0.7.5-labs.a8b535d",
|
|
62
|
+
"@dxos/client-protocol": "0.7.5-labs.a8b535d",
|
|
63
|
+
"@dxos/compute": "0.7.5-labs.a8b535d",
|
|
64
|
+
"@dxos/debug": "0.7.5-labs.a8b535d",
|
|
65
|
+
"@dxos/echo-schema": "0.7.5-labs.a8b535d",
|
|
66
|
+
"@dxos/functions": "0.7.5-labs.a8b535d",
|
|
67
|
+
"@dxos/invariant": "0.7.5-labs.a8b535d",
|
|
68
|
+
"@dxos/keys": "0.7.5-labs.a8b535d",
|
|
69
|
+
"@dxos/local-storage": "0.7.5-labs.a8b535d",
|
|
70
|
+
"@dxos/live-object": "0.7.5-labs.a8b535d",
|
|
71
|
+
"@dxos/log": "0.7.5-labs.a8b535d",
|
|
72
|
+
"@dxos/plugin-deck": "0.7.5-labs.a8b535d",
|
|
73
|
+
"@dxos/plugin-explorer": "0.7.5-labs.a8b535d",
|
|
74
|
+
"@dxos/plugin-graph": "0.7.5-labs.a8b535d",
|
|
75
|
+
"@dxos/plugin-client": "0.7.5-labs.a8b535d",
|
|
76
|
+
"@dxos/plugin-markdown": "0.7.5-labs.a8b535d",
|
|
77
|
+
"@dxos/plugin-space": "0.7.5-labs.a8b535d",
|
|
78
|
+
"@dxos/plugin-stack": "0.7.5-labs.a8b535d",
|
|
79
|
+
"@dxos/plugin-theme": "0.7.5-labs.a8b535d",
|
|
80
|
+
"@dxos/protocols": "0.7.5-labs.a8b535d",
|
|
81
|
+
"@dxos/react-client": "0.7.5-labs.a8b535d",
|
|
82
|
+
"@dxos/react-ui-attention": "0.7.5-labs.a8b535d",
|
|
83
|
+
"@dxos/react-ui-editor": "0.7.5-labs.a8b535d",
|
|
84
|
+
"@dxos/react-ui-menu": "0.7.5-labs.a8b535d",
|
|
85
|
+
"@dxos/react-ui-form": "0.7.5-labs.a8b535d",
|
|
86
|
+
"@dxos/react-ui-stack": "0.7.5-labs.a8b535d",
|
|
87
|
+
"@dxos/react-ui-syntax-highlighter": "0.7.5-labs.a8b535d",
|
|
88
|
+
"@dxos/rpc": "0.7.5-labs.a8b535d",
|
|
89
|
+
"@dxos/schema": "0.7.5-labs.a8b535d",
|
|
90
|
+
"@dxos/rpc-tunnel": "0.7.5-labs.a8b535d",
|
|
91
|
+
"@dxos/util": "0.7.5-labs.a8b535d"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
94
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -97,19 +98,17 @@
|
|
|
97
98
|
"react": "~18.2.0",
|
|
98
99
|
"react-dom": "~18.2.0",
|
|
99
100
|
"vite": "5.4.7",
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/storybook-utils": "0.7.5-labs.8a82073"
|
|
101
|
+
"@dxos/random": "0.7.5-labs.a8b535d",
|
|
102
|
+
"@dxos/react-ui": "0.7.5-labs.a8b535d",
|
|
103
|
+
"@dxos/react-ui-theme": "0.7.5-labs.a8b535d",
|
|
104
|
+
"@dxos/storybook-utils": "0.7.5-labs.a8b535d"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@phosphor-icons/react": "^2.1.5",
|
|
108
108
|
"react": "~18.2.0",
|
|
109
109
|
"react-dom": "~18.2.0",
|
|
110
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
111
|
-
"@dxos/react-ui-
|
|
112
|
-
"@dxos/react-ui-theme": "0.7.5-labs.8a82073"
|
|
110
|
+
"@dxos/react-ui": "0.7.5-labs.a8b535d",
|
|
111
|
+
"@dxos/react-ui-theme": "0.7.5-labs.a8b535d"
|
|
113
112
|
},
|
|
114
113
|
"publishConfig": {
|
|
115
114
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
-
import { FunctionType, ScriptType } from '@dxos/functions';
|
|
8
|
+
import { ScriptType } from '@dxos/functions';
|
|
10
9
|
import { RefArray } from '@dxos/live-object';
|
|
11
|
-
import {
|
|
10
|
+
import { ClientEvents } from '@dxos/plugin-client';
|
|
11
|
+
import { DeckCapabilities, DeckEvents } from '@dxos/plugin-deck';
|
|
12
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
13
|
+
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
14
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
12
15
|
|
|
13
|
-
import {
|
|
16
|
+
import { ArtifactDefinition, Compiler, IntentResolver, ReactSurface, ScriptSettings } from './capabilities';
|
|
17
|
+
import { ScriptEvents } from './events';
|
|
14
18
|
import { meta, SCRIPT_PLUGIN } from './meta';
|
|
15
19
|
import translations from './translations';
|
|
16
20
|
import { ScriptAction } from './types';
|
|
@@ -24,7 +28,7 @@ export const ScriptPlugin = () =>
|
|
|
24
28
|
}),
|
|
25
29
|
defineModule({
|
|
26
30
|
id: `${meta.id}/module/compiler`,
|
|
27
|
-
activatesOn:
|
|
31
|
+
activatesOn: ScriptEvents.SetupCompiler,
|
|
28
32
|
activate: Compiler,
|
|
29
33
|
}),
|
|
30
34
|
defineModule({
|
|
@@ -39,9 +43,6 @@ export const ScriptPlugin = () =>
|
|
|
39
43
|
contributes(Capabilities.Metadata, {
|
|
40
44
|
id: ScriptType.typename,
|
|
41
45
|
metadata: {
|
|
42
|
-
creationSchema: ScriptAction.CreateScriptSchema,
|
|
43
|
-
createObject: (props: ScriptAction.CreateScriptProps, { space }: { space: Space }) =>
|
|
44
|
-
createIntent(ScriptAction.Create, { ...props, space }),
|
|
45
46
|
placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],
|
|
46
47
|
icon: 'ph--code--regular',
|
|
47
48
|
// TODO(wittjosiah): Move out of metadata.
|
|
@@ -50,26 +51,45 @@ export const ScriptPlugin = () =>
|
|
|
50
51
|
}),
|
|
51
52
|
}),
|
|
52
53
|
defineModule({
|
|
53
|
-
id: `${meta.id}/module/
|
|
54
|
+
id: `${meta.id}/module/complementary-panels`,
|
|
55
|
+
activatesOn: DeckEvents.SetupComplementaryPanels,
|
|
56
|
+
activate: () =>
|
|
57
|
+
contributes(DeckCapabilities.ComplementaryPanel, {
|
|
58
|
+
id: 'function',
|
|
59
|
+
label: ['function panel label', { ns: SCRIPT_PLUGIN }],
|
|
60
|
+
icon: 'ph--terminal--regular',
|
|
61
|
+
fixed: true,
|
|
62
|
+
filter: (node) => node.data instanceof ScriptType && !!getSpace(node.data),
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
65
|
+
defineModule({
|
|
66
|
+
id: `${meta.id}/module/object-form`,
|
|
54
67
|
activatesOn: ClientEvents.SetupSchema,
|
|
55
|
-
activate: () =>
|
|
56
|
-
contributes(
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
activate: () =>
|
|
69
|
+
contributes(
|
|
70
|
+
SpaceCapabilities.ObjectForm,
|
|
71
|
+
defineObjectForm({
|
|
72
|
+
objectSchema: ScriptType,
|
|
73
|
+
formSchema: ScriptAction.CreateScriptSchema,
|
|
74
|
+
getIntent: (props, options) => createIntent(ScriptAction.Create, { ...props, space: options.space }),
|
|
75
|
+
}),
|
|
76
|
+
),
|
|
59
77
|
}),
|
|
60
78
|
defineModule({
|
|
61
79
|
id: `${meta.id}/module/react-surface`,
|
|
62
|
-
activatesOn: Events.
|
|
80
|
+
activatesOn: Events.SetupReactSurface,
|
|
81
|
+
// TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
|
|
82
|
+
activatesBefore: [ScriptEvents.SetupCompiler],
|
|
63
83
|
activate: ReactSurface,
|
|
64
84
|
}),
|
|
65
85
|
defineModule({
|
|
66
86
|
id: `${meta.id}/module/intent-resolver`,
|
|
67
|
-
activatesOn: Events.
|
|
87
|
+
activatesOn: Events.SetupIntentResolver,
|
|
68
88
|
activate: IntentResolver,
|
|
69
89
|
}),
|
|
70
90
|
defineModule({
|
|
71
|
-
id: `${meta.id}/module/artifact`,
|
|
72
|
-
activatesOn: Events.
|
|
73
|
-
activate:
|
|
91
|
+
id: `${meta.id}/module/artifact-definition`,
|
|
92
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
93
|
+
activate: ArtifactDefinition,
|
|
74
94
|
}),
|
|
75
95
|
]);
|
|
@@ -8,10 +8,11 @@ import { createArtifactElement } from '@dxos/assistant';
|
|
|
8
8
|
import { ObjectId, S } from '@dxos/echo-schema';
|
|
9
9
|
import { ScriptType } from '@dxos/functions';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
11
12
|
import { create, makeRef, type Space } from '@dxos/react-client/echo';
|
|
12
13
|
import { TextType } from '@dxos/schema';
|
|
13
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
14
14
|
|
|
15
|
+
import { meta } from '../meta';
|
|
15
16
|
// TODO(burdon): Factor out.
|
|
16
17
|
declare global {
|
|
17
18
|
interface ToolContextExtensions {
|
|
@@ -22,10 +23,11 @@ declare global {
|
|
|
22
23
|
|
|
23
24
|
export default () => {
|
|
24
25
|
const definition = defineArtifact({
|
|
25
|
-
id:
|
|
26
|
+
id: meta.id,
|
|
27
|
+
name: meta.name,
|
|
26
28
|
// TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
+
// we should offload the work of synthesizing the code to a separate model.
|
|
30
|
+
// The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
|
|
29
31
|
instructions: `
|
|
30
32
|
If the user explicitly requests you to write a script, you can create one.
|
|
31
33
|
If the user requests you to change one of the existing script, you can update it.
|
|
@@ -88,7 +90,7 @@ export default () => {
|
|
|
88
90
|
})
|
|
89
91
|
S.Array(S.String)
|
|
90
92
|
S.Union(S.String, S.Number)
|
|
91
|
-
S.
|
|
93
|
+
S.optional(S.String)
|
|
92
94
|
S.String.annotations({ description: 'The source currency' })
|
|
93
95
|
</apis>
|
|
94
96
|
|
|
@@ -136,9 +138,10 @@ export default () => {
|
|
|
136
138
|
`,
|
|
137
139
|
schema: ScriptType,
|
|
138
140
|
tools: [
|
|
139
|
-
defineTool({
|
|
140
|
-
name: '
|
|
141
|
+
defineTool(meta.id, {
|
|
142
|
+
name: 'create',
|
|
141
143
|
description: 'Create a new script. Returns the artifact definition for the script',
|
|
144
|
+
caption: 'Creating script...',
|
|
142
145
|
schema: S.Struct({
|
|
143
146
|
name: S.String.annotations({ description: 'The name of the script' }),
|
|
144
147
|
code: S.String.annotations({
|
|
@@ -168,9 +171,10 @@ export default () => {
|
|
|
168
171
|
return ToolResult.Success(createArtifactElement(script.id));
|
|
169
172
|
},
|
|
170
173
|
}),
|
|
171
|
-
defineTool({
|
|
172
|
-
name: '
|
|
174
|
+
defineTool(meta.id, {
|
|
175
|
+
name: 'inspect',
|
|
173
176
|
description: 'Inspect a script. Returns the artifact definition for the script',
|
|
177
|
+
caption: 'Inspecting script...',
|
|
174
178
|
schema: S.Struct({
|
|
175
179
|
id: ObjectId,
|
|
176
180
|
}),
|
|
@@ -186,9 +190,10 @@ export default () => {
|
|
|
186
190
|
});
|
|
187
191
|
},
|
|
188
192
|
}),
|
|
189
|
-
defineTool({
|
|
190
|
-
name: '
|
|
193
|
+
defineTool(meta.id, {
|
|
194
|
+
name: 'update',
|
|
191
195
|
description: 'Update a script. Returns the artifact definition for the script',
|
|
196
|
+
caption: 'Updating script...',
|
|
192
197
|
schema: S.Struct({
|
|
193
198
|
id: ObjectId,
|
|
194
199
|
code: S.String.annotations({
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
7
|
|
|
8
8
|
import { contributes } from '@dxos/app-framework';
|
|
9
|
+
import { initializeBundler } from '@dxos/functions/bundler';
|
|
9
10
|
|
|
10
11
|
import { ScriptCapabilities } from './capabilities';
|
|
11
|
-
import { initializeBundler } from '../bundler';
|
|
12
12
|
import { Compiler } from '../compiler';
|
|
13
13
|
|
|
14
14
|
export default async () => {
|
|
@@ -8,6 +8,6 @@ export const Compiler = lazy(() => import('./compiler'));
|
|
|
8
8
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
9
9
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
10
|
export const ScriptSettings = lazy(() => import('./settings'));
|
|
11
|
-
export const
|
|
11
|
+
export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
|
|
12
12
|
|
|
13
13
|
export * from './capabilities';
|
|
@@ -10,7 +10,8 @@ import { SettingsStore } from '@dxos/local-storage';
|
|
|
10
10
|
import { Clipboard } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
12
|
import { ScriptCapabilities } from './capabilities';
|
|
13
|
-
import {
|
|
13
|
+
import { DebugPanel, ScriptSettings, ScriptContainer, ScriptSettingsPanel } from '../components';
|
|
14
|
+
import { useDeployState, useToolbarState } from '../hooks';
|
|
14
15
|
import { SCRIPT_PLUGIN } from '../meta';
|
|
15
16
|
import { type ScriptSettingsProps } from '../types';
|
|
16
17
|
|
|
@@ -36,10 +37,15 @@ export default () =>
|
|
|
36
37
|
}),
|
|
37
38
|
createSurface({
|
|
38
39
|
id: `${SCRIPT_PLUGIN}/automation`,
|
|
39
|
-
role: 'complementary--
|
|
40
|
+
role: 'complementary--function',
|
|
40
41
|
position: 'hoist',
|
|
41
42
|
filter: (data): data is { subject: ScriptType } => data.subject instanceof ScriptType,
|
|
42
|
-
component: ({ data }) =>
|
|
43
|
+
component: ({ data }) => {
|
|
44
|
+
// TODO(wittjosiah): Decouple hooks from toolbar state.
|
|
45
|
+
const state = useToolbarState({ view: 'editor' });
|
|
46
|
+
useDeployState({ state, script: data.subject });
|
|
47
|
+
return <DebugPanel functionUrl={state.functionUrl} />;
|
|
48
|
+
},
|
|
43
49
|
}),
|
|
44
50
|
createSurface({
|
|
45
51
|
id: `${SCRIPT_PLUGIN}/settings-panel`,
|
|
@@ -7,7 +7,7 @@ import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
8
|
import { Avatar, Icon, Input, type ThemedClassName, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
10
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
+
import { errorText, mx } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { SCRIPT_PLUGIN } from '../../meta';
|
|
13
13
|
|
|
@@ -232,7 +232,7 @@ const MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message
|
|
|
232
232
|
const wrapper = 'p-1 px-2 rounded-lg bg-hoverSurface overflow-auto';
|
|
233
233
|
return (
|
|
234
234
|
<div className={mx('flex', type === 'request' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>
|
|
235
|
-
{error && <div className={mx(wrapper, 'whitespace-pre
|
|
235
|
+
{error && <div className={mx(wrapper, 'whitespace-pre', errorText)}>{String(error)}</div>}
|
|
236
236
|
|
|
237
237
|
{text !== undefined && (
|
|
238
238
|
<div className={mx(wrapper, type === 'request' && 'bg-primary-400 dark:bg-primary-600')}>
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
import React, { useEffect, useRef } from 'react';
|
|
6
6
|
|
|
7
7
|
import { clientServiceBundle } from '@dxos/client-protocol';
|
|
8
|
+
import { type BundleResult } from '@dxos/functions/bundler';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
8
10
|
import { log } from '@dxos/log';
|
|
9
11
|
import { useClient } from '@dxos/react-client';
|
|
10
12
|
import { baseSurface, mx } from '@dxos/react-ui-theme';
|
|
11
13
|
import { createProtoRpcPeer } from '@dxos/rpc';
|
|
12
14
|
import { createIFramePort } from '@dxos/rpc-tunnel';
|
|
13
15
|
|
|
14
|
-
import { type BundlerResult } from '../../bundler';
|
|
15
|
-
|
|
16
16
|
export type FrameContainerProps = {
|
|
17
17
|
containerUrl: string;
|
|
18
|
-
result:
|
|
18
|
+
result: BundleResult;
|
|
19
19
|
debug?: boolean;
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -46,6 +46,7 @@ export const FrameContainer = ({ containerUrl, result, debug = true }: FrameCont
|
|
|
46
46
|
}, [iframeRef]);
|
|
47
47
|
|
|
48
48
|
// Encodes compiled code via URL.
|
|
49
|
+
invariant(result.sourceHash, 'Source hash is required.');
|
|
49
50
|
const sourceHash = Buffer.from(result.sourceHash).toString('hex');
|
|
50
51
|
const src = result.bundle && `${containerUrl}?ts=${sourceHash}#code=${encodeURIComponent(result.bundle)}`;
|
|
51
52
|
|
|
@@ -58,7 +59,7 @@ export const FrameContainer = ({ containerUrl, result, debug = true }: FrameCont
|
|
|
58
59
|
<div
|
|
59
60
|
className={mx(
|
|
60
61
|
baseSurface,
|
|
61
|
-
'flex absolute right-2 bottom-2 w-[
|
|
62
|
+
'flex absolute right-2 bottom-2 w-[30rem] h-[200px] ring rounded',
|
|
62
63
|
'z-20 overflow-x-hidden overflow-y-auto',
|
|
63
64
|
)}
|
|
64
65
|
>
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
useTextEditor,
|
|
28
28
|
type UseTextEditorProps,
|
|
29
29
|
} from '@dxos/react-ui-editor';
|
|
30
|
-
import {
|
|
30
|
+
import { isNonNullable } from '@dxos/util';
|
|
31
31
|
|
|
32
32
|
export type TypescriptEditorProps = {
|
|
33
33
|
id: string;
|
|
@@ -94,7 +94,7 @@ export const TypescriptEditor = ({
|
|
|
94
94
|
]
|
|
95
95
|
: [],
|
|
96
96
|
],
|
|
97
|
-
].filter(
|
|
97
|
+
].filter(isNonNullable),
|
|
98
98
|
selection,
|
|
99
99
|
scrollTo,
|
|
100
100
|
}),
|
package/src/components/index.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
+
export * from './DebugPanel';
|
|
7
8
|
export * from './ScriptSettings';
|
|
8
9
|
export * from './ScriptSettingsPanel';
|
|
9
10
|
|
|
10
|
-
export const AutomationPanel = lazy(() => import('./AutomationPanel'));
|
|
11
11
|
export const ScriptContainer = lazy(() => import('./ScriptContainer'));
|
package/src/events.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { SCRIPT_PLUGIN } from './meta';
|
|
8
|
+
|
|
9
|
+
export namespace ScriptEvents {
|
|
10
|
+
export const SetupCompiler = defineEvent(`${SCRIPT_PLUGIN}/event/setup-compiler`);
|
|
11
|
+
}
|
package/src/hooks/deploy.ts
CHANGED
|
@@ -6,13 +6,14 @@ import { useCallback, useEffect, useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
FunctionType,
|
|
9
|
+
type ScriptType,
|
|
9
10
|
getInvocationUrl,
|
|
10
11
|
getUserFunctionUrlInMetadata,
|
|
11
12
|
incrementSemverPatch,
|
|
12
|
-
type ScriptType,
|
|
13
13
|
setUserFunctionUrlInMetadata,
|
|
14
14
|
uploadWorkerFunction,
|
|
15
15
|
} from '@dxos/functions';
|
|
16
|
+
import { Bundler } from '@dxos/functions/bundler';
|
|
16
17
|
import { log } from '@dxos/log';
|
|
17
18
|
import { useClient } from '@dxos/react-client';
|
|
18
19
|
import { Filter, create, getMeta, getSpace, makeRef, useQuery } from '@dxos/react-client/echo';
|
|
@@ -20,7 +21,6 @@ import { useTranslation } from '@dxos/react-ui';
|
|
|
20
21
|
import { createMenuAction } from '@dxos/react-ui-menu';
|
|
21
22
|
|
|
22
23
|
import { type ViewState } from './view';
|
|
23
|
-
import { Bundler } from '../bundler';
|
|
24
24
|
import { SCRIPT_PLUGIN } from '../meta';
|
|
25
25
|
|
|
26
26
|
export type DeployActionProperties = { type: 'deploy' } | { type: 'copy' };
|
|
@@ -105,7 +105,7 @@ export const useDeployHandler = ({ state, script }: { state: Partial<DeployState
|
|
|
105
105
|
const existingFunctionId = existingFunctionUrl?.split('/').at(-1);
|
|
106
106
|
|
|
107
107
|
const bundler = new Bundler({ platform: 'browser', sandboxedModules: [], remoteModules: {} });
|
|
108
|
-
const buildResult = await bundler.bundle(script.source.target!.content);
|
|
108
|
+
const buildResult = await bundler.bundle({ source: script.source.target!.content });
|
|
109
109
|
if (buildResult.error || !buildResult.bundle) {
|
|
110
110
|
throw buildResult.error;
|
|
111
111
|
}
|