@dxos/plugin-script 0.8.1-staging.391c573 → 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-4FIJVITA.mjs → ScriptContainer-DDXZNAPF.mjs} +10 -16
- 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-7TZYIGBS.mjs → chunk-LJN26TSM.mjs} +30 -45
- package/dist/lib/browser/chunk-LJN26TSM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SFG422OU.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-HXCDELEA.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-54GQSZCU.cjs → ScriptContainer-DM4WSS4Y.cjs} +19 -25
- 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-CJ45RBS4.cjs → chunk-I5Z6TRZY.cjs} +40 -55
- package/dist/lib/node/chunk-I5Z6TRZY.cjs.map +7 -0
- package/dist/lib/node/{chunk-45OE3V5M.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-QQL4EDUS.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-JAQY5F3X.mjs → ScriptContainer-HWCHDARL.mjs} +10 -16
- 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-LBFWIT3Y.mjs → chunk-BIFA5BEB.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-RI35DJSW.mjs → chunk-F2O475DQ.mjs} +30 -45
- 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-PCW5HN3B.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/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/hooks/useToolbarAction.ts +12 -3
- package/src/hooks/useToolbarState.ts +1 -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-4FIJVITA.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-GTL3ZSF2.mjs.map +0 -7
- package/dist/lib/browser/chunk-7TZYIGBS.mjs.map +0 -7
- package/dist/lib/browser/chunk-FVVCAWNP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HXCDELEA.mjs.map +0 -7
- package/dist/lib/node/ScriptContainer-54GQSZCU.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-CJ45RBS4.cjs.map +0 -7
- package/dist/lib/node/react-surface-QQL4EDUS.cjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-JAQY5F3X.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-SF46QOO7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P2V2Y5LV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RI35DJSW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-PCW5HN3B.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-SFG422OU.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-45OE3V5M.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-LBFWIT3Y.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
|
@@ -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-staging.
|
|
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-staging.
|
|
57
|
-
"@dxos/artifact": "0.8.1-staging.
|
|
58
|
-
"@dxos/assistant": "0.8.1-staging.
|
|
59
|
-
"@dxos/client
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/compute": "0.8.1-staging.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/live-object": "0.8.1-staging.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/plugin-deck": "0.8.1-staging.
|
|
74
|
-
"@dxos/plugin-graph": "0.8.1-staging.
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/react-client": "0.8.1-staging.
|
|
83
|
-
"@dxos/react-ui-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-
|
|
87
|
-
"@dxos/react-ui-menu": "0.8.1-staging.
|
|
88
|
-
"@dxos/react-ui-stack": "0.8.1-staging.
|
|
89
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.1-staging.
|
|
90
|
-
"@dxos/rpc-tunnel": "0.8.1-staging.
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/util": "0.8.1-staging.
|
|
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-staging.
|
|
107
|
-
"@dxos/storybook-utils": "0.8.1-staging.
|
|
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
|
|
115
|
-
"@dxos/react-ui": "0.8.1-staging.
|
|
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) => {
|
|
@@ -20,6 +20,7 @@ import { type ScriptSettingsProps } from '../types';
|
|
|
20
20
|
|
|
21
21
|
export type ScriptEditorProps = ThemedClassName<{
|
|
22
22
|
script: ScriptType;
|
|
23
|
+
variant?: 'logs';
|
|
23
24
|
settings?: ScriptSettingsProps;
|
|
24
25
|
role?: string;
|
|
25
26
|
}> &
|
|
@@ -29,6 +30,7 @@ export const ScriptContainer = ({
|
|
|
29
30
|
role,
|
|
30
31
|
classNames,
|
|
31
32
|
script,
|
|
33
|
+
variant,
|
|
32
34
|
settings = { editorInputMode: 'vscode' },
|
|
33
35
|
env,
|
|
34
36
|
}: ScriptEditorProps) => {
|
|
@@ -54,7 +56,7 @@ export const ScriptContainer = ({
|
|
|
54
56
|
[script, script.source.target, space, identity],
|
|
55
57
|
);
|
|
56
58
|
|
|
57
|
-
const state = useToolbarState(
|
|
59
|
+
const state = useToolbarState();
|
|
58
60
|
useDeployState({ state, script });
|
|
59
61
|
|
|
60
62
|
if (!space) {
|
|
@@ -62,10 +64,12 @@ export const ScriptContainer = ({
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
return (
|
|
65
|
-
<StackItem.Content toolbar>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
<StackItem.Content toolbar={variant !== 'logs'}>
|
|
68
|
+
{variant === 'logs' ? (
|
|
69
|
+
<LogsPanel script={script} />
|
|
70
|
+
) : (
|
|
71
|
+
<>
|
|
72
|
+
<ScriptToolbar state={state} role={role} script={script} />
|
|
69
73
|
<TypescriptEditor
|
|
70
74
|
id={script.id}
|
|
71
75
|
env={env}
|
|
@@ -75,10 +79,8 @@ export const ScriptContainer = ({
|
|
|
75
79
|
inputMode={settings.editorInputMode}
|
|
76
80
|
toolbar
|
|
77
81
|
/>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{state.view !== 'editor' && <LogsPanel script={script} classNames='grow' />}
|
|
81
|
-
</div>
|
|
82
|
+
</>
|
|
83
|
+
)}
|
|
82
84
|
</StackItem.Content>
|
|
83
85
|
);
|
|
84
86
|
};
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
+
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
7
8
|
import { type ScriptType } from '@dxos/functions/types';
|
|
8
9
|
import { log } from '@dxos/log';
|
|
10
|
+
import { DeckAction, surfaceVariant } from '@dxos/plugin-deck/types';
|
|
11
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
9
12
|
import { type MenuAction, type MenuActionHandler } from '@dxos/react-ui-menu';
|
|
10
13
|
|
|
11
14
|
import { type DeployActionProperties, useDeployHandler, useCopyHandler } from './deploy';
|
|
@@ -27,15 +30,21 @@ export const useToolbarAction = (props: { state: ScriptToolbarState; script: Scr
|
|
|
27
30
|
const handleFormat = useFormatHandler(props);
|
|
28
31
|
const handleDeploy = useDeployHandler(props);
|
|
29
32
|
const handleCopy = useCopyHandler(props);
|
|
33
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
30
34
|
return useCallback(
|
|
31
35
|
((action: ScriptToolbarAction) => {
|
|
32
36
|
switch (action.properties.type) {
|
|
37
|
+
case 'view':
|
|
38
|
+
void dispatch(
|
|
39
|
+
createIntent(DeckAction.ChangeCompanion, {
|
|
40
|
+
primary: fullyQualifiedId(props.script),
|
|
41
|
+
companion: surfaceVariant('logs'),
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
break;
|
|
33
45
|
case 'template':
|
|
34
46
|
handleTemplateSelect(action.properties.value);
|
|
35
47
|
break;
|
|
36
|
-
case 'view':
|
|
37
|
-
props.state.view = action.properties.value;
|
|
38
|
-
break;
|
|
39
48
|
case 'format':
|
|
40
49
|
void handleFormat();
|
|
41
50
|
break;
|
|
@@ -7,9 +7,8 @@ import { useMemo } from 'react';
|
|
|
7
7
|
import { create } from '@dxos/live-object';
|
|
8
8
|
|
|
9
9
|
import { type DeployState } from './deploy';
|
|
10
|
-
import { type ViewState } from './view';
|
|
11
10
|
|
|
12
|
-
export type ScriptToolbarState = Partial<DeployState
|
|
11
|
+
export type ScriptToolbarState = Partial<DeployState>;
|
|
13
12
|
|
|
14
13
|
// TODO(burdon): Replace with context provider?
|
|
15
14
|
export const useToolbarState = (initialState: ScriptToolbarState = {}) => {
|