@dxos/plugin-script 0.8.1-main.ba2dec9 → 0.8.1-staging.5be625a
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-AIBCQZ7S.mjs → ScriptContainer-DDXZNAPF.mjs} +12 -17
- package/dist/lib/browser/ScriptContainer-DDXZNAPF.mjs.map +7 -0
- package/dist/lib/browser/{artifact-definition-GTL3ZSF2.mjs → artifact-definition-GYCZJGR4.mjs} +7 -6
- 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-JL34HAEL.mjs → chunk-AJNRPWAA.mjs} +2 -2
- package/dist/lib/browser/{chunk-6MOQ4BP3.mjs → chunk-FG66JYON.mjs} +2 -2
- package/dist/lib/browser/{chunk-5WPOWUPI.mjs → chunk-LJN26TSM.mjs} +32 -48
- package/dist/lib/browser/chunk-LJN26TSM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5RZVHFGR.mjs → chunk-T7XG5GED.mjs} +3 -3
- package/dist/lib/browser/{compiler-YY2XSKHQ.mjs → compiler-ZQLHHJ5P.mjs} +3 -3
- package/dist/lib/browser/index.mjs +16 -22
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-BJ76DBGE.mjs → intent-resolver-3B3Z67FP.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-M4RD24IN.mjs → react-surface-ICXHFHN7.mjs} +11 -11
- package/dist/lib/browser/react-surface-ICXHFHN7.mjs.map +7 -0
- package/dist/lib/browser/{settings-HIWURVAS.mjs → settings-467GVEBU.mjs} +3 -3
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{ScriptContainer-ZYVN7ZW6.cjs → ScriptContainer-DM4WSS4Y.cjs} +21 -26
- package/dist/lib/node/ScriptContainer-DM4WSS4Y.cjs.map +7 -0
- package/dist/lib/node/{artifact-definition-64KZC4UT.cjs → artifact-definition-3SNVJ34V.cjs} +15 -14
- 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-B2O7H2AU.cjs → chunk-I5Z6TRZY.cjs} +42 -58
- package/dist/lib/node/chunk-I5Z6TRZY.cjs.map +7 -0
- package/dist/lib/node/{chunk-PTXU7QFZ.cjs → chunk-VLQUYHPB.cjs} +9 -9
- package/dist/lib/node/{chunk-VJ73IG7P.cjs → chunk-XFB6JL2G.cjs} +6 -6
- package/dist/lib/node/{compiler-UIBLKJKG.cjs → compiler-5ALLTH2B.cjs} +7 -7
- package/dist/lib/node/index.cjs +39 -45
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-HQ3FGK2K.cjs → intent-resolver-CN5WMMAD.cjs} +7 -7
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-JDA5UZCC.cjs → react-surface-IER3VEZR.cjs} +26 -26
- package/dist/lib/node/react-surface-IER3VEZR.cjs.map +7 -0
- package/dist/lib/node/{settings-ZASSNBKR.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-PI7PU5T7.mjs → ScriptContainer-HWCHDARL.mjs} +12 -17
- package/dist/lib/node-esm/ScriptContainer-HWCHDARL.mjs.map +7 -0
- package/dist/lib/node-esm/{artifact-definition-SF46QOO7.mjs → artifact-definition-VAFNV62U.mjs} +7 -6
- package/dist/lib/node-esm/artifact-definition-VAFNV62U.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-AXFGQDAD.mjs → chunk-BIFA5BEB.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-GLW67SM7.mjs → chunk-F2O475DQ.mjs} +32 -48
- package/dist/lib/node-esm/chunk-F2O475DQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CP5LXTK5.mjs → chunk-MFXRE7ZD.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-FHQKFLM7.mjs → chunk-WQ4YIZ2L.mjs} +2 -2
- package/dist/lib/node-esm/{compiler-XTXFGZJM.mjs → compiler-K7GYROAO.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +16 -22
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-CDTQKQD4.mjs → intent-resolver-6F7CVQEX.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-ODWVGWV4.mjs → react-surface-EXSKKZNP.mjs} +11 -11
- package/dist/lib/node-esm/react-surface-EXSKKZNP.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-FDGLXN4I.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.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +2 -1
- package/dist/types/src/components/ScriptContainer.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/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/translations.d.ts +5 -9
- 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 +45 -45
- package/src/ScriptPlugin.tsx +2 -2
- package/src/capabilities/artifact-definition.ts +1 -0
- package/src/capabilities/react-surface.tsx +15 -5
- package/src/components/LogsPanel/LogsPanel.tsx +19 -14
- package/src/components/ScriptContainer.tsx +11 -9
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +1 -0
- package/src/hooks/deploy.ts +1 -2
- package/src/hooks/useToolbarAction.ts +12 -3
- package/src/hooks/useToolbarState.ts +2 -2
- package/src/hooks/view.ts +6 -20
- package/src/meta.ts +2 -2
- package/src/translations.ts +2 -3
- package/dist/lib/browser/ScriptContainer-AIBCQZ7S.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-GTL3ZSF2.mjs.map +0 -7
- package/dist/lib/browser/chunk-5WPOWUPI.mjs.map +0 -7
- package/dist/lib/browser/chunk-FVVCAWNP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-M4RD24IN.mjs.map +0 -7
- package/dist/lib/node/ScriptContainer-ZYVN7ZW6.cjs.map +0 -7
- package/dist/lib/node/artifact-definition-64KZC4UT.cjs.map +0 -7
- package/dist/lib/node/chunk-5UH3F7TA.cjs.map +0 -7
- package/dist/lib/node/chunk-B2O7H2AU.cjs.map +0 -7
- package/dist/lib/node/react-surface-JDA5UZCC.cjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-PI7PU5T7.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-SF46QOO7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GLW67SM7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P2V2Y5LV.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ODWVGWV4.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-JL34HAEL.mjs.map → chunk-AJNRPWAA.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-6MOQ4BP3.mjs.map → chunk-FG66JYON.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-5RZVHFGR.mjs.map → chunk-T7XG5GED.mjs.map} +0 -0
- /package/dist/lib/browser/{compiler-YY2XSKHQ.mjs.map → compiler-ZQLHHJ5P.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-BJ76DBGE.mjs.map → intent-resolver-3B3Z67FP.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-HIWURVAS.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/{chunk-PTXU7QFZ.cjs.map → chunk-VLQUYHPB.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-VJ73IG7P.cjs.map → chunk-XFB6JL2G.cjs.map} +0 -0
- /package/dist/lib/node/{compiler-UIBLKJKG.cjs.map → compiler-5ALLTH2B.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-HQ3FGK2K.cjs.map → intent-resolver-CN5WMMAD.cjs.map} +0 -0
- /package/dist/lib/node/{settings-ZASSNBKR.cjs.map → settings-WLYT2XQF.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-AXFGQDAD.mjs.map → chunk-BIFA5BEB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-CP5LXTK5.mjs.map → chunk-MFXRE7ZD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-FHQKFLM7.mjs.map → chunk-WQ4YIZ2L.mjs.map} +0 -0
- /package/dist/lib/node-esm/{compiler-XTXFGZJM.mjs.map → compiler-K7GYROAO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-CDTQKQD4.mjs.map → intent-resolver-6F7CVQEX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-FDGLXN4I.mjs.map → settings-DR3B6GHE.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { ScriptType } from '@dxos/functions/types';\nimport { SettingsStore } from '@dxos/local-storage';\nimport { Clipboard } from '@dxos/react-ui';\n\nimport { ScriptCapabilities } from './capabilities';\nimport { DebugPanel, ScriptSettings, ScriptContainer, ScriptSettingsPanel } from '../components';\nimport { useDeployState, useToolbarState } from '../hooks';\nimport { SCRIPT_PLUGIN } from '../meta';\nimport { type ScriptSettingsProps } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${SCRIPT_PLUGIN}/settings`,\n role: 'article',\n filter: (data): data is { subject: SettingsStore<ScriptSettingsProps> } =>\n data.subject instanceof SettingsStore && data.subject.prefix === SCRIPT_PLUGIN,\n component: ({ data: { subject } }) => <ScriptSettings settings={subject.value} />,\n }),\n createSurface({\n id: `${SCRIPT_PLUGIN}/article`,\n role: 'article',\n filter: (data): data is { subject: ScriptType; variant: 'logs' | undefined } =>\n isInstanceOf(ScriptType, data.subject),\n component: ({ data, role }) => {\n const compiler = useCapability(ScriptCapabilities.Compiler);\n // TODO(dmaretskyi): Since settings store is not reactive, this would break on the script plugin being enabled without a page reload.\n const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettingsProps>(SCRIPT_PLUGIN)?.value;\n return (\n <ScriptContainer\n role={role}\n script={data.subject}\n variant={data.variant}\n settings={settings}\n env={compiler.environment}\n />\n );\n },\n }),\n createSurface({\n id: `${SCRIPT_PLUGIN}/automation`,\n role: 'complementary--function',\n position: 'hoist',\n filter: (data): data is { subject: ScriptType } => isInstanceOf(ScriptType, data.subject),\n component: ({ data }) => {\n // TODO(wittjosiah): Decouple hooks from toolbar state.\n const state = useToolbarState();\n useDeployState({ state, script: data.subject });\n return <DebugPanel functionUrl={state.functionUrl} />;\n },\n }),\n createSurface({\n id: `${SCRIPT_PLUGIN}/settings-panel`,\n role: 'complementary--settings',\n filter: (data): data is { subject: ScriptType } => isInstanceOf(ScriptType, data.subject),\n component: ({ data }) => (\n <Clipboard.Provider>\n <ScriptSettingsPanel script={data.subject} />\n </Clipboard.Provider>\n ),\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,eAAeC,qBAAqB;AACxE,SAASC,oBAAoB;AAC7B,SAASC,kBAAkB;AAC3B,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAQ1B,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,aAAAA;IACPC,MAAM;IACNC,QAAQ,CAACC,SACPA,KAAKC,mBAAmBC,iBAAiBF,KAAKC,QAAQE,WAAWN;IACnEO,WAAW,CAAC,EAAEJ,MAAM,EAAEC,QAAO,EAAE,MAAO,sBAAA,cAACI,gBAAAA;MAAeC,UAAUL,QAAQM;;EAC1E,CAAA;EACAZ,cAAc;IACZC,IAAI,GAAGC,aAAAA;IACPC,MAAM;IACNC,QAAQ,CAACC,SACPQ,aAAaC,YAAYT,KAAKC,OAAO;IACvCG,WAAW,CAAC,EAAEJ,MAAMF,KAAI,MAAE;AACxB,YAAMY,WAAWC,cAAcC,mBAAmBC,QAAQ;AAE1D,YAAMP,WAAWK,cAAclB,aAAaS,aAAa,EAAEY,SAA8BjB,aAAAA,GAAgBU;AACzG,aACE,sBAAA,cAACQ,iBAAAA;QACCjB;QACAkB,QAAQhB,KAAKC;QACbgB,SAASjB,KAAKiB;QACdX;QACAY,KAAKR,SAASS;;IAGpB;EACF,CAAA;EACAxB,cAAc;IACZC,IAAI,GAAGC,aAAAA;IACPC,MAAM;IACNsB,UAAU;IACVrB,QAAQ,CAACC,SAA0CQ,aAAaC,YAAYT,KAAKC,OAAO;IACxFG,WAAW,CAAC,EAAEJ,KAAI,MAAE;AAElB,YAAMqB,QAAQC,gBAAAA;AACdC,qBAAe;QAAEF;QAAOL,QAAQhB,KAAKC;MAAQ,CAAA;AAC7C,aAAO,sBAAA,cAACuB,YAAAA;QAAWC,aAAaJ,MAAMI;;IACxC;EACF,CAAA;EACA9B,cAAc;IACZC,IAAI,GAAGC,aAAAA;IACPC,MAAM;IACNC,QAAQ,CAACC,SAA0CQ,aAAaC,YAAYT,KAAKC,OAAO;IACxFG,WAAW,CAAC,EAAEJ,KAAI,MAChB,sBAAA,cAAC0B,UAAUC,UAAQ,MACjB,sBAAA,cAACC,qBAAAA;MAAoBZ,QAAQhB,KAAKC;;EAGxC,CAAA;CACD;",
|
|
6
|
+
"names": ["React", "Capabilities", "contributes", "createSurface", "useCapability", "isInstanceOf", "ScriptType", "SettingsStore", "Clipboard", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "SCRIPT_PLUGIN", "role", "filter", "data", "subject", "SettingsStore", "prefix", "component", "ScriptSettings", "settings", "value", "isInstanceOf", "ScriptType", "compiler", "useCapability", "ScriptCapabilities", "Compiler", "getStore", "ScriptContainer", "script", "variant", "env", "environment", "position", "state", "useToolbarState", "useDeployState", "DebugPanel", "functionUrl", "Clipboard", "Provider", "ScriptSettingsPanel"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ScriptSettingsSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WQ4YIZ2L.mjs";
|
|
5
5
|
import {
|
|
6
6
|
SCRIPT_PLUGIN
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5S2KBIMH.mjs";
|
|
8
8
|
|
|
9
9
|
// packages/plugins/experimental/plugin-script/src/capabilities/settings.ts
|
|
10
10
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
@@ -22,4 +22,4 @@ var settings_default = () => {
|
|
|
22
22
|
export {
|
|
23
23
|
settings_default as default
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=settings-
|
|
25
|
+
//# sourceMappingURL=settings-DR3B6GHE.mjs.map
|
|
@@ -2,8 +2,8 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
ScriptAction,
|
|
4
4
|
ScriptSettingsSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-WQ4YIZ2L.mjs";
|
|
6
|
+
import "./chunk-5S2KBIMH.mjs";
|
|
7
7
|
export {
|
|
8
8
|
ScriptAction,
|
|
9
9
|
ScriptSettingsSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptPlugin.d.ts","sourceRoot":"","sources":["../../../src/ScriptPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScriptPlugin.d.ts","sourceRoot":"","sources":["../../../src/ScriptPlugin.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,YAAY,4CAwErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-definition.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/artifact-definition.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAO5G,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKtE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,
|
|
1
|
+
{"version":3,"file":"artifact-definition.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/artifact-definition.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAO5G,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKtE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,wBAyME"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA6C,MAAM,qBAAqB,CAAC;;
|
|
1
|
+
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA6C,MAAM,qBAAqB,CAAC;;AAY9F,wBAmDK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/LogsPanel/LogsPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,
|
|
1
|
+
{"version":3,"file":"LogsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/LogsPanel/LogsPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,EAEL,KAAK,UAAU,EAIhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAM5F,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;IAC3C,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,SAAS,2BAA4B,cAAc,sBAoC/D,CAAC"}
|
|
@@ -5,9 +5,10 @@ import { type TypescriptEditorProps } from './TypescriptEditor';
|
|
|
5
5
|
import { type ScriptSettingsProps } from '../types';
|
|
6
6
|
export type ScriptEditorProps = ThemedClassName<{
|
|
7
7
|
script: ScriptType;
|
|
8
|
+
variant?: 'logs';
|
|
8
9
|
settings?: ScriptSettingsProps;
|
|
9
10
|
role?: string;
|
|
10
11
|
}> & Pick<TypescriptEditorProps, 'env'>;
|
|
11
|
-
export declare const ScriptContainer: ({ role, classNames, script, settings, env, }: ScriptEditorProps) => React.JSX.Element | null;
|
|
12
|
+
export declare const ScriptContainer: ({ role, classNames, script, variant, settings, env, }: ScriptEditorProps) => React.JSX.Element | null;
|
|
12
13
|
export default ScriptContainer;
|
|
13
14
|
//# sourceMappingURL=ScriptContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ScriptContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOtD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC;IAC9C,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,GACA,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;AAErC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"ScriptContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ScriptContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOtD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC;IAC9C,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,GACA,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;AAErC,eAAO,MAAM,eAAe,0DAOzB,iBAAiB,6BAkDnB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypescriptEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TypescriptEditor/TypescriptEditor.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAKL,KAAK,eAAe,EAMpB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,GAAG,CAAC,EAAE,4BAA4B,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC,CAAC;AAErG,eAAO,MAAM,gBAAgB,+FAU1B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"TypescriptEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TypescriptEditor/TypescriptEditor.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAKL,KAAK,eAAe,EAMpB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,GAAG,CAAC,EAAE,4BAA4B,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC,CAAC;AAErG,eAAO,MAAM,gBAAgB,+FAU1B,qBAAqB,sBA2DvB,CAAC;AAqCF,eAAe,gBAAgB,CAAC"}
|
|
@@ -2,5 +2,5 @@ export * from './DebugPanel';
|
|
|
2
2
|
export * from './LogsPanel';
|
|
3
3
|
export * from './ScriptSettings';
|
|
4
4
|
export * from './ScriptSettingsPanel';
|
|
5
|
-
export declare const ScriptContainer: import("react").LazyExoticComponent<({ role, classNames, script, settings, env, }: import("./ScriptContainer").ScriptEditorProps) => import("react").JSX.Element | null>;
|
|
5
|
+
export declare const ScriptContainer: import("react").LazyExoticComponent<({ role, classNames, script, variant, settings, env, }: import("./ScriptContainer").ScriptEditorProps) => import("react").JSX.Element | null>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,eAAO,MAAM,eAAe,mLAA0C,CAAC"}
|
|
@@ -42,14 +42,15 @@ export declare const useDeployDeps: ({ script }: {
|
|
|
42
42
|
name: typeof import("effect/Schema").NonEmptyString;
|
|
43
43
|
version: typeof import("effect/Schema").String;
|
|
44
44
|
description: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
45
|
-
source: import("effect/Schema").optional<import("@dxos/echo-schema").Ref$<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
source: import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
|
|
45
|
+
source: import("effect/Schema").optional<import("@dxos/echo-schema").Ref$<{
|
|
46
|
+
readonly id: string;
|
|
47
|
+
name?: string | undefined;
|
|
48
|
+
source: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").TypedObjectFields<{
|
|
50
49
|
content: typeof import("effect/Schema").String;
|
|
51
50
|
}, import("@dxos/echo-schema").TypedObjectOptions>>;
|
|
52
|
-
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
changed?: boolean | undefined;
|
|
53
|
+
}>>;
|
|
53
54
|
inputSchema: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
54
55
|
outputSchema: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
55
56
|
binding: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
@@ -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":"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"}
|
|
@@ -2,10 +2,8 @@ declare const _default: {
|
|
|
2
2
|
'en-US': {
|
|
3
3
|
[x: string]: {
|
|
4
4
|
'typename label': string;
|
|
5
|
+
'object name placeholder': string;
|
|
5
6
|
'plugin name'?: undefined;
|
|
6
|
-
'object title placeholder'?: undefined;
|
|
7
|
-
'create object label'?: undefined;
|
|
8
|
-
'create stack section label'?: undefined;
|
|
9
7
|
'description label'?: undefined;
|
|
10
8
|
'description placeholder'?: undefined;
|
|
11
9
|
'binding placeholder'?: undefined;
|
|
@@ -40,11 +38,9 @@ declare const _default: {
|
|
|
40
38
|
'view logs label'?: undefined;
|
|
41
39
|
'template select group label'?: undefined;
|
|
42
40
|
'function panel label'?: undefined;
|
|
41
|
+
'logs plank heading'?: undefined;
|
|
43
42
|
} | {
|
|
44
43
|
'plugin name': string;
|
|
45
|
-
'object title placeholder': string;
|
|
46
|
-
'create object label': string;
|
|
47
|
-
'create stack section label': string;
|
|
48
44
|
'description label': string;
|
|
49
45
|
'description placeholder': string;
|
|
50
46
|
'binding placeholder': string;
|
|
@@ -79,13 +75,12 @@ declare const _default: {
|
|
|
79
75
|
'view logs label': string;
|
|
80
76
|
'template select group label': string;
|
|
81
77
|
'function panel label': string;
|
|
78
|
+
'logs plank heading': string;
|
|
82
79
|
'typename label'?: undefined;
|
|
80
|
+
'object name placeholder'?: undefined;
|
|
83
81
|
};
|
|
84
82
|
"dxos.org/plugin/script": {
|
|
85
83
|
'plugin name': string;
|
|
86
|
-
'object title placeholder': string;
|
|
87
|
-
'create object label': string;
|
|
88
|
-
'create stack section label': string;
|
|
89
84
|
'description label': string;
|
|
90
85
|
'description placeholder': string;
|
|
91
86
|
'binding placeholder': string;
|
|
@@ -120,6 +115,7 @@ declare const _default: {
|
|
|
120
115
|
'view logs label': string;
|
|
121
116
|
'template select group label': string;
|
|
122
117
|
'function panel label': string;
|
|
118
|
+
'logs plank heading': string;
|
|
123
119
|
};
|
|
124
120
|
};
|
|
125
121
|
}[];
|
|
@@ -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,wBA+CE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { S } from '@dxos/echo-schema';
|
|
2
|
-
import { ScriptType } from '@dxos/functions/types';
|
|
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-
|
|
3
|
+
"version": "0.8.1-staging.5be625a",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -53,44 +53,44 @@
|
|
|
53
53
|
"prettier": "^3.2.4",
|
|
54
54
|
"react-syntax-highlighter": "^15.5.0",
|
|
55
55
|
"typescript": "^5.7.2",
|
|
56
|
-
"@dxos/app-framework": "0.8.1-
|
|
57
|
-
"@dxos/artifact": "0.8.1-
|
|
58
|
-
"@dxos/assistant": "0.8.1-
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/client-protocol": "0.8.1-
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/compute": "0.8.1-
|
|
63
|
-
"@dxos/debug": "0.8.1-
|
|
64
|
-
"@dxos/echo-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/live-object": "0.8.1-
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/plugin-client": "0.8.1-
|
|
73
|
-
"@dxos/plugin-
|
|
74
|
-
"@dxos/plugin-
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/react-client": "0.8.1-
|
|
82
|
-
"@dxos/react-
|
|
83
|
-
"@dxos/react-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-form": "0.8.1-
|
|
86
|
-
"@dxos/react-ui-
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/react-ui-
|
|
89
|
-
"@dxos/react-ui-
|
|
90
|
-
"@dxos/rpc-tunnel": "0.8.1-
|
|
91
|
-
"@dxos/schema": "0.8.1-
|
|
92
|
-
"@dxos/rpc": "0.8.1-
|
|
93
|
-
"@dxos/util": "0.8.1-
|
|
56
|
+
"@dxos/app-framework": "0.8.1-staging.5be625a",
|
|
57
|
+
"@dxos/artifact": "0.8.1-staging.5be625a",
|
|
58
|
+
"@dxos/assistant": "0.8.1-staging.5be625a",
|
|
59
|
+
"@dxos/client": "0.8.1-staging.5be625a",
|
|
60
|
+
"@dxos/client-protocol": "0.8.1-staging.5be625a",
|
|
61
|
+
"@dxos/async": "0.8.1-staging.5be625a",
|
|
62
|
+
"@dxos/compute": "0.8.1-staging.5be625a",
|
|
63
|
+
"@dxos/debug": "0.8.1-staging.5be625a",
|
|
64
|
+
"@dxos/echo-protocol": "0.8.1-staging.5be625a",
|
|
65
|
+
"@dxos/functions": "0.8.1-staging.5be625a",
|
|
66
|
+
"@dxos/echo-schema": "0.8.1-staging.5be625a",
|
|
67
|
+
"@dxos/keys": "0.8.1-staging.5be625a",
|
|
68
|
+
"@dxos/invariant": "0.8.1-staging.5be625a",
|
|
69
|
+
"@dxos/live-object": "0.8.1-staging.5be625a",
|
|
70
|
+
"@dxos/local-storage": "0.8.1-staging.5be625a",
|
|
71
|
+
"@dxos/log": "0.8.1-staging.5be625a",
|
|
72
|
+
"@dxos/plugin-client": "0.8.1-staging.5be625a",
|
|
73
|
+
"@dxos/plugin-deck": "0.8.1-staging.5be625a",
|
|
74
|
+
"@dxos/plugin-graph": "0.8.1-staging.5be625a",
|
|
75
|
+
"@dxos/plugin-explorer": "0.8.1-staging.5be625a",
|
|
76
|
+
"@dxos/plugin-markdown": "0.8.1-staging.5be625a",
|
|
77
|
+
"@dxos/plugin-space": "0.8.1-staging.5be625a",
|
|
78
|
+
"@dxos/plugin-stack": "0.8.1-staging.5be625a",
|
|
79
|
+
"@dxos/protocols": "0.8.1-staging.5be625a",
|
|
80
|
+
"@dxos/plugin-theme": "0.8.1-staging.5be625a",
|
|
81
|
+
"@dxos/react-edge-client": "0.8.1-staging.5be625a",
|
|
82
|
+
"@dxos/react-client": "0.8.1-staging.5be625a",
|
|
83
|
+
"@dxos/react-ui-editor": "0.8.1-staging.5be625a",
|
|
84
|
+
"@dxos/react-ui-attention": "0.8.1-staging.5be625a",
|
|
85
|
+
"@dxos/react-ui-form": "0.8.1-staging.5be625a",
|
|
86
|
+
"@dxos/react-ui-list": "0.8.1-staging.5be625a",
|
|
87
|
+
"@dxos/react-ui-menu": "0.8.1-staging.5be625a",
|
|
88
|
+
"@dxos/react-ui-stack": "0.8.1-staging.5be625a",
|
|
89
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.1-staging.5be625a",
|
|
90
|
+
"@dxos/rpc-tunnel": "0.8.1-staging.5be625a",
|
|
91
|
+
"@dxos/schema": "0.8.1-staging.5be625a",
|
|
92
|
+
"@dxos/rpc": "0.8.1-staging.5be625a",
|
|
93
|
+
"@dxos/util": "0.8.1-staging.5be625a"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -101,18 +101,18 @@
|
|
|
101
101
|
"react": "~18.2.0",
|
|
102
102
|
"react-dom": "~18.2.0",
|
|
103
103
|
"vite": "5.4.7",
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/react-ui-theme": "0.8.1-
|
|
107
|
-
"@dxos/storybook-utils": "0.8.1-
|
|
104
|
+
"@dxos/react-ui": "0.8.1-staging.5be625a",
|
|
105
|
+
"@dxos/random": "0.8.1-staging.5be625a",
|
|
106
|
+
"@dxos/react-ui-theme": "0.8.1-staging.5be625a",
|
|
107
|
+
"@dxos/storybook-utils": "0.8.1-staging.5be625a"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
110
|
"@phosphor-icons/react": "^2.1.5",
|
|
111
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-
|
|
115
|
-
"@dxos/react-ui-theme": "0.8.1-
|
|
114
|
+
"@dxos/react-ui": "0.8.1-staging.5be625a",
|
|
115
|
+
"@dxos/react-ui-theme": "0.8.1-staging.5be625a"
|
|
116
116
|
},
|
|
117
117
|
"publishConfig": {
|
|
118
118
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
|
|
8
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
8
9
|
import { ScriptType } from '@dxos/functions/types';
|
|
9
10
|
import { RefArray } from '@dxos/live-object';
|
|
10
11
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
@@ -43,7 +44,6 @@ export const ScriptPlugin = () =>
|
|
|
43
44
|
contributes(Capabilities.Metadata, {
|
|
44
45
|
id: ScriptType.typename,
|
|
45
46
|
metadata: {
|
|
46
|
-
placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],
|
|
47
47
|
icon: 'ph--code--regular',
|
|
48
48
|
// TODO(wittjosiah): Move out of metadata.
|
|
49
49
|
loadReferences: async (script: ScriptType) => await RefArray.loadAll([script.source]),
|
|
@@ -59,7 +59,7 @@ export const ScriptPlugin = () =>
|
|
|
59
59
|
label: ['function panel label', { ns: SCRIPT_PLUGIN }],
|
|
60
60
|
icon: 'ph--terminal--regular',
|
|
61
61
|
fixed: true,
|
|
62
|
-
filter: (node) => node.data
|
|
62
|
+
filter: (node) => isInstanceOf(ScriptType, node.data) && !!getSpace(node.data),
|
|
63
63
|
}),
|
|
64
64
|
}),
|
|
65
65
|
defineModule({
|
|
@@ -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,6 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
8
9
|
import { ScriptType } from '@dxos/functions/types';
|
|
9
10
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
11
|
import { Clipboard } from '@dxos/react-ui';
|
|
@@ -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,14 @@
|
|
|
5
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { decodeReference } from '@dxos/echo-protocol';
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
type InvocationTraceEvent,
|
|
10
|
+
type ScriptType,
|
|
11
|
+
type TraceEvent,
|
|
12
|
+
type InvocationSpan,
|
|
13
|
+
createInvocationSpans,
|
|
14
|
+
} from '@dxos/functions/types';
|
|
15
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
10
16
|
import { Icon, List, ListItem, useTranslation, type ThemedClassName } from '@dxos/react-ui';
|
|
11
17
|
import { mx } from '@dxos/react-ui-theme';
|
|
12
18
|
|
|
@@ -21,24 +27,27 @@ export const LogsPanel = ({ script, classNames }: LogsPanelProps) => {
|
|
|
21
27
|
const { t } = useTranslation(SCRIPT_PLUGIN);
|
|
22
28
|
// TODO(wittjosiah): Refactor these hooks.
|
|
23
29
|
const { space, existingFunctionUrl } = useDeployDeps({ script });
|
|
24
|
-
const
|
|
25
|
-
const invocationTraceQueue = useQueue<InvocationTraceEvent>(edgeClient, space?.properties.invocationTraceQueue?.dxn, {
|
|
30
|
+
const invocationTraceQueue = useQueue<InvocationTraceEvent>(space?.properties.invocationTraceQueue?.dxn, {
|
|
26
31
|
pollInterval: 500,
|
|
27
32
|
});
|
|
28
|
-
const
|
|
33
|
+
const invocationSpans = useMemo(
|
|
34
|
+
() => createInvocationSpans(invocationTraceQueue?.items),
|
|
35
|
+
[invocationTraceQueue?.items ?? []],
|
|
36
|
+
);
|
|
37
|
+
const [selected, setSelected] = useState<InvocationSpan>();
|
|
29
38
|
const workerDxn = `dxn:worker:${existingFunctionUrl?.split('/').at(-1)}`;
|
|
30
39
|
|
|
31
40
|
if (!invocationTraceQueue) {
|
|
32
41
|
return <div>{t('no invocations message')}</div>;
|
|
33
42
|
}
|
|
34
43
|
|
|
35
|
-
const handleOpenChange = useCallback((trace:
|
|
44
|
+
const handleOpenChange = useCallback((trace: InvocationSpan, open: boolean) => {
|
|
36
45
|
setSelected(open ? trace : undefined);
|
|
37
46
|
}, []);
|
|
38
47
|
|
|
39
48
|
return (
|
|
40
49
|
<List classNames={mx('overflow-y-auto', classNames)}>
|
|
41
|
-
{
|
|
50
|
+
{invocationSpans
|
|
42
51
|
.filter((trace) => decodeReference(trace.invocationTarget).dxn?.toString() === workerDxn)
|
|
43
52
|
.map((trace) => (
|
|
44
53
|
<InvocationTraceItem
|
|
@@ -57,15 +66,11 @@ const InvocationTraceItem = ({
|
|
|
57
66
|
open,
|
|
58
67
|
setOpen,
|
|
59
68
|
}: {
|
|
60
|
-
trace:
|
|
69
|
+
trace: InvocationSpan;
|
|
61
70
|
open?: boolean;
|
|
62
|
-
setOpen?: (trace:
|
|
71
|
+
setOpen?: (trace: InvocationSpan, open: boolean) => void;
|
|
63
72
|
}) => {
|
|
64
|
-
const
|
|
65
|
-
const eventQueue = useQueue<TraceEvent>(
|
|
66
|
-
edgeClient,
|
|
67
|
-
open ? decodeReference(trace.invocationTraceQueue).dxn : undefined,
|
|
68
|
-
);
|
|
73
|
+
const eventQueue = useQueue<TraceEvent>(open ? decodeReference(trace.invocationTraceQueue).dxn : undefined);
|
|
69
74
|
|
|
70
75
|
const handleOpenChange = useCallback(
|
|
71
76
|
(open: boolean) => {
|