@dxos/plugin-automation 0.8.4-main.67995b8 → 0.8.4-main.ae835ea
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/AutomationPanel-LBXJDM6Z.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs +68 -0
- package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsContainer-IOB333TX.mjs → FunctionsContainer-IZTCGNJZ.mjs} +9 -12
- package/dist/lib/browser/FunctionsContainer-IZTCGNJZ.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs → FunctionsPanel-HFCK3JRB.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-ZTAUTFI4.mjs → app-graph-builder-7VKA2GS3.mjs} +12 -11
- package/dist/lib/browser/app-graph-builder-7VKA2GS3.mjs.map +7 -0
- package/dist/lib/browser/chunk-CVYJM6OO.mjs +66 -0
- package/dist/lib/browser/chunk-CVYJM6OO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LYJVTIVD.mjs → chunk-FHSN7G4H.mjs} +25 -12
- package/dist/lib/browser/chunk-FHSN7G4H.mjs.map +7 -0
- package/dist/lib/browser/chunk-GCGHLQM2.mjs +15 -0
- package/dist/lib/browser/chunk-GCGHLQM2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FSJZXTS2.mjs → chunk-JW7XSPYW.mjs} +69 -32
- package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ERTIGJYE.mjs → chunk-K5YNWESC.mjs} +68 -32
- package/dist/lib/browser/chunk-K5YNWESC.mjs.map +7 -0
- package/dist/lib/browser/chunk-LZQFZO3B.mjs +17 -0
- package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +7 -0
- package/dist/lib/browser/chunk-XXZNGORC.mjs +14 -0
- package/dist/lib/browser/chunk-XXZNGORC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HN7OHFCB.mjs → chunk-YBPJCY3F.mjs} +3 -3
- package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-PFYRMGN2.mjs +114 -0
- package/dist/lib/browser/compute-runtime-PFYRMGN2.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +11 -0
- package/dist/lib/browser/index.mjs +44 -19
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-U3ZAQEFW.mjs → intent-resolver-5HR7M7T6.mjs} +15 -14
- package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-4DFSM7OX.mjs → react-surface-WPMY3EX2.mjs} +18 -19
- package/dist/lib/browser/react-surface-WPMY3EX2.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{AutomationPanel-YYUMSK2W.mjs → AutomationPanel-NVEIUIZP.mjs} +4 -4
- package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs +69 -0
- package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsContainer-DJWB6WFH.mjs → FunctionsContainer-KKRCIXGB.mjs} +9 -12
- package/dist/lib/node-esm/FunctionsContainer-KKRCIXGB.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs → FunctionsPanel-74ELGR7P.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-74ELGR7P.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3FP63ZSG.mjs → app-graph-builder-RTOFJNFV.mjs} +12 -11
- package/dist/lib/node-esm/app-graph-builder-RTOFJNFV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs +67 -0
- package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +19 -0
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs → chunk-ECJKIUBO.mjs} +3 -3
- package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZGPUV5VS.mjs → chunk-JOCKHLFT.mjs} +25 -12
- package/dist/lib/node-esm/chunk-JOCKHLFT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MRYKW5TM.mjs +16 -0
- package/dist/lib/node-esm/chunk-MRYKW5TM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U5Q2NI7H.mjs +16 -0
- package/dist/lib/node-esm/chunk-U5Q2NI7H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AZH66CED.mjs → chunk-W76WUTZY.mjs} +69 -32
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HIMYPGHF.mjs → chunk-Y7PJXFCJ.mjs} +68 -32
- package/dist/lib/node-esm/chunk-Y7PJXFCJ.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs +115 -0
- package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +12 -0
- package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +44 -19
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-3QWXEBPX.mjs → intent-resolver-KDRYB5BC.mjs} +15 -14
- package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-3PNW7NDW.mjs → react-surface-Y2BBJV2I.mjs} +18 -19
- package/dist/lib/node-esm/react-surface-Y2BBJV2I.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AutomationPlugin.d.ts +1 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +19 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -5
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +46 -4
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationSettings.d.ts +5 -0
- package/dist/types/src/components/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +2 -2
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -5
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +47 -4
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerSettings.d.ts +6 -0
- package/dist/types/src/components/TriggerSettings.d.ts.map +1 -0
- 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/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +11 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.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/schema.d.ts +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +62 -41
- package/src/AutomationPlugin.tsx +37 -31
- package/src/capabilities/app-graph-builder.ts +12 -11
- package/src/capabilities/capabilities.ts +48 -0
- package/src/capabilities/compute-runtime.ts +138 -0
- package/src/capabilities/index.ts +3 -0
- package/src/capabilities/intent-resolver.ts +11 -11
- package/src/capabilities/react-surface.tsx +13 -14
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +15 -16
- package/src/components/AutomationPanel/AutomationPanel.tsx +101 -50
- package/src/components/AutomationSettings.tsx +30 -0
- package/src/components/FunctionsContainer.tsx +11 -13
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +26 -14
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +10 -4
- package/src/components/TriggerEditor/SpecSelector.tsx +23 -17
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +68 -26
- package/src/components/TriggerEditor/TriggerEditor.tsx +45 -25
- package/src/components/TriggerSettings.tsx +25 -0
- package/src/components/index.ts +1 -1
- package/src/events.ts +11 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useComputeRuntimeCallback.ts +32 -0
- package/src/hooks/useTriggerRuntimeControls.ts +52 -0
- package/src/index.ts +3 -0
- package/src/meta.ts +6 -5
- package/src/testing/test-functions.ts +1 -1
- package/src/translations.ts +5 -0
- package/src/types/schema.ts +1 -1
- package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs +0 -38
- package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-ZWA6GOFY.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ECSTS2UI.mjs +0 -14
- package/dist/lib/browser/chunk-ECSTS2UI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERTIGJYE.mjs.map +0 -7
- package/dist/lib/browser/chunk-FSJZXTS2.mjs.map +0 -7
- package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
- package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
- package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
- package/dist/lib/browser/chunk-LYJVTIVD.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4DFSM7OX.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs +0 -39
- package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AZH66CED.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HIMYPGHF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SGZPTJ47.mjs +0 -16
- package/dist/lib/node-esm/chunk-SGZPTJ47.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-3PNW7NDW.mjs.map +0 -7
- package/dist/types/src/components/AutomationContainer.d.ts +0 -5
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/src/components/AutomationContainer.tsx +0 -30
- /package/dist/lib/browser/{AutomationPanel-ZWA6GOFY.mjs.map → AutomationPanel-LBXJDM6Z.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs.map → FunctionsPanel-HFCK3JRB.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-YYUMSK2W.mjs.map → browser/hooks/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs.map → AutomationPanel-NVEIUIZP.mjs.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationPanel,
|
|
3
|
+
AutomationPanel_default
|
|
4
|
+
} from "./chunk-K5YNWESC.mjs";
|
|
5
|
+
import "./chunk-JW7XSPYW.mjs";
|
|
6
|
+
import "./chunk-LZQFZO3B.mjs";
|
|
7
|
+
export {
|
|
8
|
+
AutomationPanel,
|
|
9
|
+
AutomationPanel_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=AutomationPanel-LBXJDM6Z.mjs.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTriggerRuntimeControls
|
|
3
|
+
} from "./chunk-CVYJM6OO.mjs";
|
|
4
|
+
import "./chunk-GCGHLQM2.mjs";
|
|
5
|
+
import {
|
|
6
|
+
AutomationPanel
|
|
7
|
+
} from "./chunk-K5YNWESC.mjs";
|
|
8
|
+
import "./chunk-JW7XSPYW.mjs";
|
|
9
|
+
import {
|
|
10
|
+
meta
|
|
11
|
+
} from "./chunk-LZQFZO3B.mjs";
|
|
12
|
+
|
|
13
|
+
// src/components/AutomationSettings.tsx
|
|
14
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
15
|
+
import React2 from "react";
|
|
16
|
+
import { useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
17
|
+
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
18
|
+
|
|
19
|
+
// src/components/TriggerSettings.tsx
|
|
20
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
21
|
+
import React from "react";
|
|
22
|
+
import { Input, useTranslation } from "@dxos/react-ui";
|
|
23
|
+
import { ControlItemInput } from "@dxos/react-ui-form";
|
|
24
|
+
var TriggersSettings = ({ space }) => {
|
|
25
|
+
var _effect = _useSignals();
|
|
26
|
+
try {
|
|
27
|
+
const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
|
|
28
|
+
const { t } = useTranslation(meta.id);
|
|
29
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
30
|
+
className: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
31
|
+
}, /* @__PURE__ */ React.createElement(ControlItemInput, {
|
|
32
|
+
title: t("runtime label"),
|
|
33
|
+
description: t("runtime description")
|
|
34
|
+
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
35
|
+
classNames: "justify-self-end",
|
|
36
|
+
checked: isRunning,
|
|
37
|
+
onCheckedChange: isRunning ? stop : start
|
|
38
|
+
})));
|
|
39
|
+
} finally {
|
|
40
|
+
_effect.f();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// src/components/AutomationSettings.tsx
|
|
45
|
+
var AutomationSettings = (props) => {
|
|
46
|
+
var _effect = _useSignals2();
|
|
47
|
+
try {
|
|
48
|
+
const { t } = useTranslation2(meta.id);
|
|
49
|
+
return /* @__PURE__ */ React2.createElement(ControlPage, null, /* @__PURE__ */ React2.createElement(ControlSection, {
|
|
50
|
+
title: t("automation verbose label", {
|
|
51
|
+
ns: meta.id
|
|
52
|
+
}),
|
|
53
|
+
description: t("automation description", {
|
|
54
|
+
ns: meta.id
|
|
55
|
+
})
|
|
56
|
+
}, /* @__PURE__ */ React2.createElement(AutomationPanel, props), /* @__PURE__ */ React2.createElement(TriggersSettings, {
|
|
57
|
+
space: props.space
|
|
58
|
+
})));
|
|
59
|
+
} finally {
|
|
60
|
+
_effect.f();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var AutomationSettings_default = AutomationSettings;
|
|
64
|
+
export {
|
|
65
|
+
AutomationSettings,
|
|
66
|
+
AutomationSettings_default as default
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=AutomationSettings-IIEI5D2K.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/AutomationSettings.tsx", "../../../src/components/TriggerSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\n\nimport { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';\nimport { TriggersSettings } from './TriggerSettings';\n\nexport const AutomationSettings = (props: AutomationPanelProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <ControlPage>\n <ControlSection\n title={t('automation verbose label', { ns: meta.id })}\n description={t('automation description', { ns: meta.id })}\n >\n <AutomationPanel {...props} />\n <TriggersSettings space={props.space} />\n </ControlSection>\n </ControlPage>\n );\n};\n\nexport default AutomationSettings;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { ControlItemInput } from '@dxos/react-ui-form';\n\nimport { useTriggerRuntimeControls } from '../hooks';\nimport { meta } from '../meta';\n\nexport const TriggersSettings = ({ space }: { space: Space }) => {\n const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);\n const { t } = useTranslation(meta.id);\n\n return (\n <div className='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>\n <ControlItemInput title={t('runtime label')} description={t('runtime description')}>\n <Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />\n </ControlItemInput>\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,kBAAAA,uBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;;;;ACH5C,OAAOC,WAAW;AAGlB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,wBAAwB;AAK1B,IAAMC,mBAAmB,CAAC,EAAEC,MAAK,MAAoB;;;AAC1D,UAAM,EAAEC,UAAUC,WAAWC,OAAOC,KAAI,IAAKC,0BAA0BL,KAAAA;AACvE,UAAM,EAAEM,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,WACE,sBAAA,cAACC,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACC,kBAAAA;MAAiBC,OAAOP,EAAE,eAAA;MAAkBQ,aAAaR,EAAE,qBAAA;OAC1D,sBAAA,cAACS,MAAMC,QAAM;MAACC,YAAW;MAAmBC,SAAShB;MAAWiB,iBAAiBjB,YAAYE,OAAOD;;;;;AAI5G;;;ADVO,IAAMiB,qBAAqB,CAACC,UAAAA;;;AACjC,UAAM,EAAEC,EAAC,IAAKC,gBAAeC,KAAKC,EAAE;AACpC,WACE,gBAAAC,OAAA,cAACC,aAAAA,MACC,gBAAAD,OAAA,cAACE,gBAAAA;MACCC,OAAOP,EAAE,4BAA4B;QAAEQ,IAAIN,KAAKC;MAAG,CAAA;MACnDM,aAAaT,EAAE,0BAA0B;QAAEQ,IAAIN,KAAKC;MAAG,CAAA;OAEvD,gBAAAC,OAAA,cAACM,iBAAoBX,KAAAA,GACrB,gBAAAK,OAAA,cAACO,kBAAAA;MAAiBC,OAAOb,MAAMa;;;;;AAIvC;AAEA,IAAA,6BAAed;",
|
|
6
|
+
"names": ["React", "useTranslation", "ControlPage", "ControlSection", "React", "Input", "useTranslation", "ControlItemInput", "TriggersSettings", "space", "triggers", "isRunning", "start", "stop", "useTriggerRuntimeControls", "t", "useTranslation", "meta", "id", "div", "className", "ControlItemInput", "title", "description", "Input", "Switch", "classNames", "checked", "onCheckedChange", "AutomationSettings", "props", "t", "useTranslation", "meta", "id", "React", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel", "TriggersSettings", "space"]
|
|
7
|
+
}
|
package/dist/lib/browser/{FunctionsContainer-IOB333TX.mjs → FunctionsContainer-IZTCGNJZ.mjs}
RENAMED
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FunctionsPanel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHSN7G4H.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-LZQFZO3B.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/FunctionsContainer.tsx
|
|
9
9
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
10
10
|
import React from "react";
|
|
11
11
|
import { useTranslation } from "@dxos/react-ui";
|
|
12
12
|
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
13
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
14
13
|
var FunctionsContainer = ({ space }) => {
|
|
15
14
|
var _effect = _useSignals();
|
|
16
15
|
try {
|
|
17
|
-
const { t } = useTranslation(
|
|
18
|
-
return /* @__PURE__ */ React.createElement(
|
|
19
|
-
classNames: "block overflow-y-auto"
|
|
20
|
-
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
return /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
21
18
|
title: t("functions verbose label", {
|
|
22
|
-
ns:
|
|
19
|
+
ns: meta.id
|
|
23
20
|
}),
|
|
24
21
|
description: t("functions description", {
|
|
25
|
-
ns:
|
|
22
|
+
ns: meta.id
|
|
26
23
|
})
|
|
27
24
|
}, /* @__PURE__ */ React.createElement(FunctionsPanel, {
|
|
28
25
|
space
|
|
29
|
-
})))
|
|
26
|
+
})));
|
|
30
27
|
} finally {
|
|
31
28
|
_effect.f();
|
|
32
29
|
}
|
|
@@ -36,4 +33,4 @@ export {
|
|
|
36
33
|
FunctionsContainer,
|
|
37
34
|
FunctionsContainer_default as default
|
|
38
35
|
};
|
|
39
|
-
//# sourceMappingURL=FunctionsContainer-
|
|
36
|
+
//# sourceMappingURL=FunctionsContainer-IZTCGNJZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/FunctionsContainer.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport const FunctionsContainer = ({ space }: { space: Space }) => {\n const { t } = useTranslation(meta.id);\n return (\n <ControlPage>\n <ControlSection\n title={t('functions verbose label', { ns: meta.id })}\n description={t('functions description', { ns: meta.id })}\n >\n <FunctionsPanel space={space} />\n </ControlSection>\n </ControlPage>\n );\n};\n\nexport default FunctionsContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;AAMrC,IAAMC,qBAAqB,CAAC,EAAEC,MAAK,MAAoB;;;AAC5D,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,WACE,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAON,EAAE,2BAA2B;QAAEO,IAAIL,KAAKC;MAAG,CAAA;MAClDK,aAAaR,EAAE,yBAAyB;QAAEO,IAAIL,KAAKC;MAAG,CAAA;OAEtD,sBAAA,cAACM,gBAAAA;MAAeV;;;;;AAIxB;AAEA,IAAA,6BAAeD;",
|
|
6
|
+
"names": ["React", "useTranslation", "ControlPage", "ControlSection", "FunctionsContainer", "space", "t", "useTranslation", "meta", "id", "ControlPage", "ControlSection", "title", "ns", "description", "FunctionsPanel"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FunctionsPanel,
|
|
3
3
|
FunctionsPanel_default
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-FHSN7G4H.mjs";
|
|
5
|
+
import "./chunk-LZQFZO3B.mjs";
|
|
6
6
|
export {
|
|
7
7
|
FunctionsPanel,
|
|
8
8
|
FunctionsPanel_default as default
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=FunctionsPanel-
|
|
10
|
+
//# sourceMappingURL=FunctionsPanel-HFCK3JRB.mjs.map
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LZQFZO3B.mjs";
|
|
4
4
|
|
|
5
5
|
// src/capabilities/app-graph-builder.ts
|
|
6
6
|
import { Rx } from "@effect-rx/rx-react";
|
|
7
|
-
import
|
|
7
|
+
import * as Function from "effect/Function";
|
|
8
|
+
import * as Option from "effect/Option";
|
|
8
9
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
9
10
|
import { Obj } from "@dxos/echo";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { Script } from "@dxos/functions";
|
|
12
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
12
13
|
import { createExtension } from "@dxos/plugin-graph";
|
|
13
|
-
import {
|
|
14
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
14
|
+
import { meta as spaceMeta } from "@dxos/plugin-space";
|
|
15
|
+
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, [
|
|
15
16
|
createExtension({
|
|
16
17
|
id: `${meta.id}/space-settings-automation`,
|
|
17
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.type === `${
|
|
18
|
+
connector: (node) => Rx.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.type === `${spaceMeta.id}/settings` ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
18
19
|
{
|
|
19
20
|
id: `automation-${node2.id}`,
|
|
20
21
|
type: `${meta.id}/space-settings-automation`,
|
|
@@ -33,7 +34,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
33
34
|
}),
|
|
34
35
|
createExtension({
|
|
35
36
|
id: `${meta.id}/space-settings-functions`,
|
|
36
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.type === `${
|
|
37
|
+
connector: (node) => Rx.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.type === `${spaceMeta.id}/settings` ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
37
38
|
{
|
|
38
39
|
id: `functions-${node2.id}`,
|
|
39
40
|
type: `${meta.id}/space-settings-functions`,
|
|
@@ -52,7 +53,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
52
53
|
}),
|
|
53
54
|
createExtension({
|
|
54
55
|
id: `${meta.id}/script-companion`,
|
|
55
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => Obj.instanceOf(
|
|
56
|
+
connector: (node) => Rx.make((get) => Function.pipe(get(node), Option.flatMap((node2) => Obj.instanceOf(Script.Script, node2.data) ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
56
57
|
{
|
|
57
58
|
id: [
|
|
58
59
|
node2.id,
|
|
@@ -73,8 +74,8 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
73
74
|
}
|
|
74
75
|
]), Option.getOrElse(() => [])))
|
|
75
76
|
})
|
|
76
|
-
]);
|
|
77
|
+
]));
|
|
77
78
|
export {
|
|
78
79
|
app_graph_builder_default as default
|
|
79
80
|
};
|
|
80
|
-
//# sourceMappingURL=app-graph-builder-
|
|
81
|
+
//# sourceMappingURL=app-graph-builder-7VKA2GS3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { Script } from '@dxos/functions';\nimport { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { createExtension } from '@dxos/plugin-graph';\nimport { meta as spaceMeta } from '@dxos/plugin-space';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-settings-automation`,\n connector: (node) =>\n Rx.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: `automation-${node.id}`,\n type: `${meta.id}/space-settings-automation`,\n data: `${meta.id}/space-settings-automation`,\n properties: {\n label: ['automation panel label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/space-settings-functions`,\n connector: (node) =>\n Rx.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: `functions-${node.id}`,\n type: `${meta.id}/space-settings-functions`,\n data: `${meta.id}/space-settings-functions`,\n properties: {\n label: ['functions panel label', { ns: meta.id }],\n icon: 'ph--function--regular',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/script-companion`,\n connector: (node) =>\n Rx.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (Obj.instanceOf(Script.Script, node.data) ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: [node.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'automation',\n properties: {\n label: ['script automation label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n disposition: 'hidden',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,UAAU;AACnB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,cAAkCC,mBAAmB;AAC9D,SAASC,WAAW;AACpB,SAASC,cAAc;AACvB,SAASC,2BAA2BC,4BAA4B;AAChE,SAASC,uBAAuB;AAChC,SAASC,QAAQC,iBAAiB;AAIlC,IAAA,6BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACEC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKM,SAAS,GAAGC,UAAUV,EAAE,cAAqBW,YAAKR,KAAAA,IAAeS,YAAI,CAAA,GAC7FC,WAAI,CAACV,UAAS;MACnB;QACEH,IAAI,cAAcG,MAAKH,EAAE;QACzBS,MAAM,GAAGR,KAAKD,EAAE;QAChBc,MAAM,GAAGb,KAAKD,EAAE;QAChBe,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIhB,KAAKD;YAAG;;UAChDkB,MAAM;QACR;MACF;KACD,GACMC,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACApB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACEC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKM,SAAS,GAAGC,UAAUV,EAAE,cAAqBW,YAAKR,KAAAA,IAAeS,YAAI,CAAA,GAC7FC,WAAI,CAACV,UAAS;MACnB;QACEH,IAAI,aAAaG,MAAKH,EAAE;QACxBS,MAAM,GAAGR,KAAKD,EAAE;QAChBc,MAAM,GAAGb,KAAKD,EAAE;QAChBe,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIhB,KAAKD;YAAG;;UAC/CkB,MAAM;QACR;MACF;KACD,GACMC,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACApB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACEC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUiB,IAAIC,WAAWC,OAAOA,QAAQnB,MAAKW,IAAI,IAAWH,YAAKR,KAAAA,IAAeS,YAAI,CAAA,GAC7FC,WAAI,CAACV,UAAS;MACnB;QACEH,IAAI;UAACG,MAAKH;UAAI;UAAcuB,KAAKC,yBAAAA;QACjCf,MAAMgB;QACNX,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIhB,KAAKD;YAAG;;UACjDkB,MAAM;UACNQ,aAAa;QACf;MACF;KACD,GACMP,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
|
|
6
|
+
"names": ["Rx", "Function", "Option", "Capabilities", "contributes", "Obj", "Script", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "createExtension", "meta", "spaceMeta", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Rx", "make", "get", "pipe", "flatMap", "type", "spaceMeta", "some", "none", "map", "data", "properties", "label", "ns", "icon", "getOrElse", "Obj", "instanceOf", "Script", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationCapabilities
|
|
3
|
+
} from "./chunk-GCGHLQM2.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useComputeRuntimeCallback.ts
|
|
6
|
+
import { useCallback } from "react";
|
|
7
|
+
import { useCapability } from "@dxos/app-framework";
|
|
8
|
+
|
|
9
|
+
// src/capabilities/index.ts
|
|
10
|
+
import { lazy } from "@dxos/app-framework";
|
|
11
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-7VKA2GS3.mjs"));
|
|
12
|
+
var ComputeRuntime = lazy(() => import("./compute-runtime-PFYRMGN2.mjs"));
|
|
13
|
+
var IntentResolver = lazy(() => import("./intent-resolver-5HR7M7T6.mjs"));
|
|
14
|
+
var ReactSurface = lazy(() => import("./react-surface-WPMY3EX2.mjs"));
|
|
15
|
+
|
|
16
|
+
// src/hooks/useComputeRuntimeCallback.ts
|
|
17
|
+
var useComputeRuntimeCallback = (space, fn, deps) => {
|
|
18
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
19
|
+
const runtime = space !== void 0 ? computeRuntime.getRuntime(space.id) : void 0;
|
|
20
|
+
return useCallback(() => {
|
|
21
|
+
if (!runtime) {
|
|
22
|
+
throw new TypeError("Space not provided to useComputeRuntimeCallback");
|
|
23
|
+
}
|
|
24
|
+
return runtime.runPromise(fn());
|
|
25
|
+
}, [
|
|
26
|
+
runtime,
|
|
27
|
+
...deps ?? []
|
|
28
|
+
]);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/hooks/useTriggerRuntimeControls.ts
|
|
32
|
+
import * as Effect from "effect/Effect";
|
|
33
|
+
import { Filter } from "@dxos/echo";
|
|
34
|
+
import { Trigger, TriggerDispatcher } from "@dxos/functions";
|
|
35
|
+
import { useQuery } from "@dxos/react-client/echo";
|
|
36
|
+
import { useAsyncState } from "@dxos/react-ui";
|
|
37
|
+
var useTriggerRuntimeControls = (space) => {
|
|
38
|
+
const triggers = useQuery(space, Filter.type(Trigger.Trigger));
|
|
39
|
+
const [isRunningState, setIsRunningState] = useAsyncState(useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))));
|
|
40
|
+
const start = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
|
|
41
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
42
|
+
yield* dispatcher.start();
|
|
43
|
+
setIsRunningState(true);
|
|
44
|
+
}));
|
|
45
|
+
const stop = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
|
|
46
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
47
|
+
yield* dispatcher.stop();
|
|
48
|
+
setIsRunningState(false);
|
|
49
|
+
}));
|
|
50
|
+
return {
|
|
51
|
+
triggers,
|
|
52
|
+
isRunning: isRunningState ?? false,
|
|
53
|
+
start: () => void start(),
|
|
54
|
+
stop: () => void stop()
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
useComputeRuntimeCallback,
|
|
60
|
+
useTriggerRuntimeControls,
|
|
61
|
+
AppGraphBuilder,
|
|
62
|
+
ComputeRuntime,
|
|
63
|
+
IntentResolver,
|
|
64
|
+
ReactSurface
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=chunk-CVYJM6OO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/useComputeRuntimeCallback.ts", "../../../src/capabilities/index.ts", "../../../src/hooks/useTriggerRuntimeControls.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Effect from 'effect/Effect';\nimport { useCallback } from 'react';\n\nimport { useCapability } from '@dxos/app-framework';\nimport type { Space } from '@dxos/react-client/echo';\n\nimport { AutomationCapabilities } from '../capabilities';\n\n/**\n * Create an effectful function that has access to compute services\n */\n// TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).\nexport const useComputeRuntimeCallback = <T>(\n space: Space | undefined,\n fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,\n deps?: React.DependencyList,\n): (() => Promise<T>) => {\n const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);\n const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;\n\n return useCallback(() => {\n if (!runtime) {\n throw new TypeError('Space not provided to useComputeRuntimeCallback');\n }\n\n return runtime.runPromise(fn());\n }, [runtime, ...(deps ?? [])]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ComputeRuntime = lazy(() => import('./compute-runtime'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Filter } from '@dxos/echo';\nimport { Trigger, TriggerDispatcher } from '@dxos/functions';\nimport { type Space, useQuery } from '@dxos/react-client/echo';\nimport { useAsyncState } from '@dxos/react-ui';\n\nimport { useComputeRuntimeCallback } from './useComputeRuntimeCallback';\n\ninterface TriggerRuntimeControls {\n triggers: Trigger.Trigger[];\n isRunning: boolean;\n start: () => void;\n stop: () => void;\n}\n\nexport const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {\n const triggers = useQuery(space, Filter.type(Trigger.Trigger));\n\n const [isRunningState, setIsRunningState] = useAsyncState(\n useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),\n );\n\n const start = useComputeRuntimeCallback(\n space,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* dispatcher.start();\n setIsRunningState(true);\n }),\n );\n\n const stop = useComputeRuntimeCallback(\n space,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* dispatcher.stop();\n setIsRunningState(false);\n }),\n );\n\n return {\n triggers,\n isRunning: isRunningState ?? false,\n start: () => void start(),\n stop: () => void stop(),\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAKA,SAASA,mBAAmB;AAE5B,SAASC,qBAAqB;;;ACH9B,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,iBAAiBF,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMG,eAAeH,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ADOvC,IAAMI,4BAA4B,CACvCC,OACAC,IACAC,SAAAA;AAEA,QAAMC,iBAAiBC,cAAcC,uBAAuBC,cAAc;AAC1E,QAAMC,UAAUP,UAAUQ,SAAYL,eAAeM,WAAWT,MAAMU,EAAE,IAAIF;AAE5E,SAAOG,YAAY,MAAA;AACjB,QAAI,CAACJ,SAAS;AACZ,YAAM,IAAIK,UAAU,iDAAA;IACtB;AAEA,WAAOL,QAAQM,WAAWZ,GAAAA,CAAAA;EAC5B,GAAG;IAACM;OAAaL,QAAQ,CAAA;GAAI;AAC/B;;;AE3BA,YAAYY,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,SAASC,yBAAyB;AAC3C,SAAqBC,gBAAgB;AACrC,SAASC,qBAAqB;AAWvB,IAAMC,4BAA4B,CAACC,UAAAA;AACxC,QAAMC,WAAWC,SAASF,OAAOG,OAAOC,KAAKC,QAAQA,OAAO,CAAA;AAE5D,QAAM,CAACC,gBAAgBC,iBAAAA,IAAqBC,cAC1CC,0BAA0BT,OAAO,MAAMU,kBAAkBC,KAAYC,WAAI,CAACC,MAAMA,EAAEC,OAAO,CAAA,CAAA,CAAA;AAG3F,QAAMC,QAAQN,0BACZT,OACOgB,kBAAW,aAAA;AAChB,UAAMC,aAAa,OAAOP;AAC1B,WAAOO,WAAWF,MAAK;AACvBR,sBAAkB,IAAA;EACpB,CAAA,CAAA;AAGF,QAAMW,OAAOT,0BACXT,OACOgB,kBAAW,aAAA;AAChB,UAAMC,aAAa,OAAOP;AAC1B,WAAOO,WAAWC,KAAI;AACtBX,sBAAkB,KAAA;EACpB,CAAA,CAAA;AAGF,SAAO;IACLN;IACAkB,WAAWb,kBAAkB;IAC7BS,OAAO,MAAM,KAAKA,MAAAA;IAClBG,MAAM,MAAM,KAAKA,KAAAA;EACnB;AACF;",
|
|
6
|
+
"names": ["useCallback", "useCapability", "lazy", "AppGraphBuilder", "lazy", "ComputeRuntime", "IntentResolver", "ReactSurface", "useComputeRuntimeCallback", "space", "fn", "deps", "computeRuntime", "useCapability", "AutomationCapabilities", "ComputeRuntime", "runtime", "undefined", "getRuntime", "id", "useCallback", "TypeError", "runPromise", "Effect", "Filter", "Trigger", "TriggerDispatcher", "useQuery", "useAsyncState", "useTriggerRuntimeControls", "space", "triggers", "useQuery", "Filter", "type", "Trigger", "isRunningState", "setIsRunningState", "useAsyncState", "useComputeRuntimeCallback", "TriggerDispatcher", "pipe", "map", "t", "running", "start", "fnUntraced", "dispatcher", "stop", "isRunning"]
|
|
7
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-LZQFZO3B.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/FunctionsPanel/FunctionsPanel.tsx
|
|
6
6
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
8
|
import React, { useCallback, useMemo } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
10
|
+
import { Function, Script } from "@dxos/functions";
|
|
11
|
+
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
11
12
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
12
|
-
import { Button, useTranslation } from "@dxos/react-ui";
|
|
13
|
+
import { Button, IconButton, useTranslation } from "@dxos/react-ui";
|
|
13
14
|
import { controlItemClasses } from "@dxos/react-ui-form";
|
|
14
15
|
import { List } from "@dxos/react-ui-list";
|
|
15
16
|
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
@@ -17,9 +18,9 @@ var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
|
|
|
17
18
|
var FunctionsPanel = ({ space }) => {
|
|
18
19
|
var _effect = _useSignals();
|
|
19
20
|
try {
|
|
20
|
-
const { t } = useTranslation(
|
|
21
|
-
const functions = useQuery(space, Filter.type(
|
|
22
|
-
const scripts = useQuery(space, Filter.type(
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const functions = useQuery(space, Filter.type(Function.Function));
|
|
23
|
+
const scripts = useQuery(space, Filter.type(Script.Script));
|
|
23
24
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
25
|
const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
|
|
25
26
|
const scriptId = func.source?.target?.id;
|
|
@@ -54,12 +55,19 @@ var FunctionsPanel = ({ space }) => {
|
|
|
54
55
|
functionToScriptMap,
|
|
55
56
|
dispatch
|
|
56
57
|
]);
|
|
58
|
+
const handleDelete = useCallback((func) => dispatch(createIntent(SpaceAction.RemoveObjects, {
|
|
59
|
+
objects: [
|
|
60
|
+
func
|
|
61
|
+
]
|
|
62
|
+
})), [
|
|
63
|
+
dispatch
|
|
64
|
+
]);
|
|
57
65
|
return /* @__PURE__ */ React.createElement("div", {
|
|
58
66
|
role: "none",
|
|
59
67
|
className: mx(controlItemClasses)
|
|
60
68
|
}, functions.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
|
|
61
69
|
items: functions,
|
|
62
|
-
isItem: Schema.is(
|
|
70
|
+
isItem: Schema.is(Function.Function),
|
|
63
71
|
getId: (func) => func.id
|
|
64
72
|
}, ({ items }) => /* @__PURE__ */ React.createElement("div", {
|
|
65
73
|
role: "list",
|
|
@@ -76,7 +84,12 @@ var FunctionsPanel = ({ space }) => {
|
|
|
76
84
|
className: "text-xs text-description truncate"
|
|
77
85
|
}, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
|
|
78
86
|
onClick: () => handleGoToScript(func)
|
|
79
|
-
}, t("go to function source button label"))
|
|
87
|
+
}, t("go to function source button label")), /* @__PURE__ */ React.createElement(IconButton, {
|
|
88
|
+
iconOnly: true,
|
|
89
|
+
icon: "ph--trash--regular",
|
|
90
|
+
label: t("delete function button label"),
|
|
91
|
+
onClick: () => handleDelete(func)
|
|
92
|
+
}))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
80
93
|
className: "text-center plb-4 text-gray-500"
|
|
81
94
|
}, t("no functions found")));
|
|
82
95
|
} finally {
|
|
@@ -91,4 +104,4 @@ export {
|
|
|
91
104
|
FunctionsPanel,
|
|
92
105
|
FunctionsPanel_default
|
|
93
106
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-FHSN7G4H.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/FunctionsPanel/FunctionsPanel.tsx", "../../../src/components/FunctionsPanel/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { Function, Script } from '@dxos/functions';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';\nimport { Button, IconButton, useTranslation } from '@dxos/react-ui';\nimport { controlItemClasses } from '@dxos/react-ui-form';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../../meta';\n\nconst grid = 'grid grid-cols-[1fr_auto] min-bs-[2.5rem]';\n\nexport type FunctionsPanelProps = {\n space: Space;\n};\n\nexport const FunctionsPanel = ({ space }: FunctionsPanelProps) => {\n const { t } = useTranslation(meta.id);\n const functions = useQuery(space, Filter.type(Function.Function));\n const scripts = useQuery(space, Filter.type(Script.Script));\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const functionToScriptMap = useMemo(\n () =>\n functions.reduce(\n (map, func) => {\n const scriptId = func.source?.target?.id;\n if (scriptId) {\n const script = scripts.find((s) => s.id === scriptId);\n if (script) {\n map[func.id] = script;\n }\n }\n return map;\n },\n {} as Record<string, Script.Script>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: Function.Function) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: Function.Function) => {\n const script = functionToScriptMap[func.id];\n if (script) {\n void dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [fullyQualifiedId(script)] }));\n }\n },\n [functionToScriptMap, dispatch],\n );\n\n const handleDelete = useCallback(\n (func: Function.Function) => dispatch(createIntent(SpaceAction.RemoveObjects, { objects: [func] })),\n [dispatch],\n );\n\n return (\n <div role='none' className={mx(controlItemClasses)}>\n {functions.length > 0 && (\n <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<Function.Function>\n key={func.id}\n item={func}\n classNames={mx(grid, ghostHover, 'items-center', 'pli-2', 'min-bs-[3rem]')}\n >\n <div className='flex flex-col truncate'>\n <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>\n {getScriptName(func) && (\n <div className='text-xs text-description truncate'>{getScriptName(func)}</div>\n )}\n </div>\n {functionToScriptMap[func.id] && (\n <Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>\n )}\n <IconButton\n iconOnly\n icon='ph--trash--regular'\n label={t('delete function button label')}\n onClick={() => handleDelete(func)}\n />\n </List.Item>\n ))}\n </div>\n )}\n </List.Root>\n )}\n\n {functions.length === 0 && <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport * from './FunctionsPanel';\nexport default FunctionsPanel;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Schema", "React", "useCallback", "useMemo", "LayoutAction", "createIntent", "useIntentDispatcher", "Function", "Script", "SpaceAction", "Filter", "fullyQualifiedId", "useQuery", "Button", "IconButton", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "meta", "id", "functions", "useQuery", "Filter", "type", "Function", "scripts", "Script", "dispatchPromise", "dispatch", "useIntentDispatcher", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "createIntent", "LayoutAction", "Open", "part", "subject", "fullyQualifiedId", "handleDelete", "SpaceAction", "RemoveObjects", "objects", "div", "role", "className", "mx", "controlItemClasses", "length", "List", "Root", "items", "isItem", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "IconButton", "iconOnly", "icon", "label", "FunctionsPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-LZQFZO3B.mjs";
|
|
4
|
+
|
|
5
|
+
// src/capabilities/capabilities.ts
|
|
6
|
+
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
+
(function(AutomationCapabilities2) {
|
|
8
|
+
AutomationCapabilities2.ComputeRuntime = defineCapability(`${meta.id}/capability/compute-runtime`);
|
|
9
|
+
})(AutomationCapabilities || (AutomationCapabilities = {}));
|
|
10
|
+
var AutomationCapabilities;
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
AutomationCapabilities
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-GCGHLQM2.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';\nimport { defineCapability } from '@dxos/app-framework';\nimport type {\n CredentialsService,\n DatabaseService,\n FunctionInvocationService,\n InvocationTracer,\n QueueService,\n TriggerDispatcher,\n TriggerStateStore,\n} from '@dxos/functions';\nimport type { SpaceId } from '@dxos/keys';\n\nimport { meta } from '../meta';\n\nexport namespace AutomationCapabilities {\n /**\n * Service stack for executing agents, functions, and triggers.\n */\n export type ComputeServices =\n | TriggerDispatcher\n | AiService.AiService\n | DatabaseService\n | QueueService\n | CredentialsService\n | FunctionInvocationService\n | InvocationTracer\n | TriggerStateStore\n // TODO(dmaretskyi): Those should be provided at AI-chat call site.\n | ToolResolverService\n | ToolExecutionService;\n\n export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;\n export interface ComputeRuntimeProvider {\n getRuntime(spaceId: SpaceId): ComputeRuntime;\n }\n\n /**\n * Runtime for executing agents, functions, and triggers.\n */\n export const ComputeRuntime = defineCapability<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAOA,SAASA,wBAAwB;UAchBC,yBAAAA;0BAyBFC,iBAAiBC,iBAAyC,GAAGC,KAAKC,EAAE,6BAA6B;AAChH,GA1BiBJ,2BAAAA,yBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["defineCapability", "AutomationCapabilities", "ComputeRuntime", "defineCapability", "meta", "id"]
|
|
7
|
+
}
|