@dxos/plugin-automation 0.8.4-main.e098934 → 0.8.4-main.ead640a
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-3PHA5FTJ.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-OQERZHTG.mjs +69 -0
- package/dist/lib/browser/AutomationSettings-OQERZHTG.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsContainer-U4HASI4P.mjs → FunctionsContainer-V3OM6BFC.mjs} +7 -7
- package/dist/lib/browser/FunctionsContainer-V3OM6BFC.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs → FunctionsPanel-PTFCCUTB.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-4OFKIRAI.mjs → app-graph-builder-DV5HMFX4.mjs} +10 -9
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs.map +7 -0
- package/dist/lib/browser/chunk-2AOFK5FW.mjs +14 -0
- package/dist/lib/browser/chunk-2AOFK5FW.mjs.map +7 -0
- package/dist/lib/browser/chunk-5ARH77PV.mjs +15 -0
- package/dist/lib/browser/chunk-5ARH77PV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z5DT4MHW.mjs → chunk-DK7R2HNC.mjs} +20 -7
- package/dist/lib/browser/chunk-DK7R2HNC.mjs.map +7 -0
- package/dist/lib/browser/chunk-MVPRI3DB.mjs +53 -0
- package/dist/lib/browser/chunk-MVPRI3DB.mjs.map +7 -0
- package/dist/lib/browser/chunk-QACR4BJ7.mjs +14 -0
- package/dist/lib/browser/chunk-QACR4BJ7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S4SM663I.mjs → chunk-SUKAEYF3.mjs} +55 -18
- package/dist/lib/browser/chunk-SUKAEYF3.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HN7OHFCB.mjs → chunk-VGBZKM3O.mjs} +3 -3
- package/dist/lib/browser/chunk-VGBZKM3O.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4TWQV33E.mjs → chunk-VL3KSDVL.mjs} +57 -17
- package/dist/lib/browser/chunk-VL3KSDVL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GW5U2DGT.mjs → chunk-WWURMV25.mjs} +2 -4
- package/dist/lib/browser/chunk-WWURMV25.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs +160 -0
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +12 -0
- package/dist/lib/browser/index.mjs +35 -14
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-4PSYSQQG.mjs → intent-resolver-D2OHKQRR.mjs} +5 -5
- package/dist/lib/browser/{intent-resolver-4PSYSQQG.mjs.map → intent-resolver-D2OHKQRR.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-M52XGLXY.mjs → react-surface-POLPITTD.mjs} +18 -19
- package/dist/lib/browser/react-surface-POLPITTD.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{AutomationPanel-MKOLA2FE.mjs → AutomationPanel-EETYIR35.mjs} +4 -4
- package/dist/lib/node-esm/AutomationSettings-MCB7HK3O.mjs +70 -0
- package/dist/lib/node-esm/AutomationSettings-MCB7HK3O.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsContainer-VZIVURH6.mjs → FunctionsContainer-UGODP6YP.mjs} +7 -7
- package/dist/lib/node-esm/FunctionsContainer-UGODP6YP.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.mjs → FunctionsPanel-JQFBRVOC.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-JQFBRVOC.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-555IHYOB.mjs → app-graph-builder-TR2WXPX2.mjs} +10 -9
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NK5N3QKD.mjs → chunk-5MQJPJR2.mjs} +2 -4
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AONUBWBE.mjs → chunk-AKHETVIQ.mjs} +57 -17
- package/dist/lib/node-esm/chunk-AKHETVIQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs → chunk-CJUI6AKX.mjs} +3 -3
- package/dist/lib/node-esm/chunk-CJUI6AKX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CX2AILIS.mjs → chunk-G72KHW5A.mjs} +20 -7
- package/dist/lib/node-esm/chunk-G72KHW5A.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZOJVKPCA.mjs → chunk-J3XEBEIE.mjs} +55 -18
- package/dist/lib/node-esm/chunk-J3XEBEIE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LB7UQ4SK.mjs +16 -0
- package/dist/lib/node-esm/chunk-LB7UQ4SK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs +54 -0
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TXFXIA34.mjs +16 -0
- package/dist/lib/node-esm/chunk-TXFXIA34.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs +16 -0
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs +161 -0
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +13 -0
- package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +35 -14
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-6ZGBUILG.mjs → intent-resolver-2LGBVXT5.mjs} +5 -5
- package/dist/lib/node-esm/{intent-resolver-6ZGBUILG.mjs.map → intent-resolver-2LGBVXT5.mjs.map} +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-Y6AOXM75.mjs → react-surface-5ULTTXAZ.mjs} +18 -19
- package/dist/lib/node-esm/react-surface-5ULTTXAZ.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.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 +2 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +3 -1
- 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/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- 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 +4 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +7 -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 +1 -1
- 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 +2 -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 +58 -37
- package/src/AutomationPlugin.tsx +35 -29
- package/src/capabilities/app-graph-builder.ts +8 -7
- 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/react-surface.tsx +13 -14
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +3 -6
- package/src/components/AutomationPanel/AutomationPanel.tsx +78 -15
- package/src/components/{AutomationContainer.tsx → AutomationSettings.tsx} +8 -6
- package/src/components/FunctionsContainer.tsx +4 -4
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +16 -4
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +8 -2
- package/src/components/TriggerEditor/SpecSelector.tsx +10 -4
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +57 -18
- package/src/components/TriggerEditor/TriggerEditor.tsx +35 -9
- 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 +30 -0
- package/src/hooks/useTriggerRuntimeControls.ts +52 -0
- package/src/index.ts +2 -0
- package/src/meta.ts +1 -3
- 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-BRV5AJZ3.mjs +0 -35
- package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
- package/dist/lib/browser/chunk-EIY2EUWC.mjs +0 -14
- package/dist/lib/browser/chunk-EIY2EUWC.mjs.map +0 -7
- 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-S4SM663I.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-M52XGLXY.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs +0 -36
- package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CICQ73ZT.mjs +0 -16
- package/dist/lib/node-esm/chunk-CICQ73ZT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
- 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-ZOJVKPCA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-Y6AOXM75.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/dist/lib/browser/{AutomationPanel-N5HFJJXW.mjs.map → AutomationPanel-3PHA5FTJ.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs.map → FunctionsPanel-PTFCCUTB.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-MKOLA2FE.mjs.map → browser/hooks/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.mjs.map → AutomationPanel-EETYIR35.mjs.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationPanel,
|
|
3
|
+
AutomationPanel_default
|
|
4
|
+
} from "./chunk-VL3KSDVL.mjs";
|
|
5
|
+
import "./chunk-SUKAEYF3.mjs";
|
|
6
|
+
import "./chunk-WWURMV25.mjs";
|
|
7
|
+
export {
|
|
8
|
+
AutomationPanel,
|
|
9
|
+
AutomationPanel_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=AutomationPanel-3PHA5FTJ.mjs.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTriggerRuntimeControls
|
|
3
|
+
} from "./chunk-MVPRI3DB.mjs";
|
|
4
|
+
import "./chunk-QACR4BJ7.mjs";
|
|
5
|
+
import "./chunk-5ARH77PV.mjs";
|
|
6
|
+
import {
|
|
7
|
+
AutomationPanel
|
|
8
|
+
} from "./chunk-VL3KSDVL.mjs";
|
|
9
|
+
import "./chunk-SUKAEYF3.mjs";
|
|
10
|
+
import {
|
|
11
|
+
meta
|
|
12
|
+
} from "./chunk-WWURMV25.mjs";
|
|
13
|
+
|
|
14
|
+
// src/components/AutomationSettings.tsx
|
|
15
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
16
|
+
import React2 from "react";
|
|
17
|
+
import { useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
18
|
+
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
19
|
+
|
|
20
|
+
// src/components/TriggerSettings.tsx
|
|
21
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
22
|
+
import React from "react";
|
|
23
|
+
import { Input, useTranslation } from "@dxos/react-ui";
|
|
24
|
+
import { ControlItemInput } from "@dxos/react-ui-form";
|
|
25
|
+
var TriggersSettings = ({ space }) => {
|
|
26
|
+
var _effect = _useSignals();
|
|
27
|
+
try {
|
|
28
|
+
const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
|
|
29
|
+
const { t } = useTranslation(meta.id);
|
|
30
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
31
|
+
className: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
32
|
+
}, /* @__PURE__ */ React.createElement(ControlItemInput, {
|
|
33
|
+
title: t("runtime label"),
|
|
34
|
+
description: t("runtime description")
|
|
35
|
+
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
36
|
+
classNames: "justify-self-end",
|
|
37
|
+
checked: isRunning,
|
|
38
|
+
onCheckedChange: isRunning ? stop : start
|
|
39
|
+
})));
|
|
40
|
+
} finally {
|
|
41
|
+
_effect.f();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// src/components/AutomationSettings.tsx
|
|
46
|
+
var AutomationSettings = (props) => {
|
|
47
|
+
var _effect = _useSignals2();
|
|
48
|
+
try {
|
|
49
|
+
const { t } = useTranslation2(meta.id);
|
|
50
|
+
return /* @__PURE__ */ React2.createElement(ControlPage, null, /* @__PURE__ */ React2.createElement(ControlSection, {
|
|
51
|
+
title: t("automation verbose label", {
|
|
52
|
+
ns: meta.id
|
|
53
|
+
}),
|
|
54
|
+
description: t("automation description", {
|
|
55
|
+
ns: meta.id
|
|
56
|
+
})
|
|
57
|
+
}, /* @__PURE__ */ React2.createElement(AutomationPanel, props), /* @__PURE__ */ React2.createElement(TriggersSettings, {
|
|
58
|
+
space: props.space
|
|
59
|
+
})));
|
|
60
|
+
} finally {
|
|
61
|
+
_effect.f();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var AutomationSettings_default = AutomationSettings;
|
|
65
|
+
export {
|
|
66
|
+
AutomationSettings,
|
|
67
|
+
AutomationSettings_default as default
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=AutomationSettings-OQERZHTG.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-U4HASI4P.mjs → FunctionsContainer-V3OM6BFC.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FunctionsPanel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DK7R2HNC.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-WWURMV25.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/FunctionsContainer.tsx
|
|
9
9
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
@@ -13,13 +13,13 @@ import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
|
13
13
|
var FunctionsContainer = ({ space }) => {
|
|
14
14
|
var _effect = _useSignals();
|
|
15
15
|
try {
|
|
16
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
17
|
return /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
18
18
|
title: t("functions verbose label", {
|
|
19
|
-
ns:
|
|
19
|
+
ns: meta.id
|
|
20
20
|
}),
|
|
21
21
|
description: t("functions description", {
|
|
22
|
-
ns:
|
|
22
|
+
ns: meta.id
|
|
23
23
|
})
|
|
24
24
|
}, /* @__PURE__ */ React.createElement(FunctionsPanel, {
|
|
25
25
|
space
|
|
@@ -33,4 +33,4 @@ export {
|
|
|
33
33
|
FunctionsContainer,
|
|
34
34
|
FunctionsContainer_default as default
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=FunctionsContainer-
|
|
36
|
+
//# sourceMappingURL=FunctionsContainer-V3OM6BFC.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-DK7R2HNC.mjs";
|
|
5
|
+
import "./chunk-WWURMV25.mjs";
|
|
6
6
|
export {
|
|
7
7
|
FunctionsPanel,
|
|
8
8
|
FunctionsPanel_default as default
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=FunctionsPanel-
|
|
10
|
+
//# sourceMappingURL=FunctionsPanel-PTFCCUTB.mjs.map
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WWURMV25.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
11
|
import { ScriptType } from "@dxos/functions";
|
|
11
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(ScriptType, node2.data) ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
56
|
+
connector: (node) => Rx.make((get) => Function.pipe(get(node), Option.flatMap((node2) => Obj.instanceOf(ScriptType, 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-DV5HMFX4.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 { ScriptType } 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(ScriptType, 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,kBAAkB;AAC3B,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,YAAYnB,MAAKW,IAAI,IAAWH,YAAKR,KAAAA,IAAeS,YAAI,CAAA,GAC1FC,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", "ScriptType", "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", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/components/index.ts
|
|
2
|
+
import { lazy } from "react";
|
|
3
|
+
var AutomationPanel = lazy(() => import("./AutomationPanel-3PHA5FTJ.mjs"));
|
|
4
|
+
var AutomationSettings = lazy(() => import("./AutomationSettings-OQERZHTG.mjs"));
|
|
5
|
+
var FunctionsContainer = lazy(() => import("./FunctionsContainer-V3OM6BFC.mjs"));
|
|
6
|
+
var FunctionsPanel = lazy(() => import("./FunctionsPanel-PTFCCUTB.mjs"));
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
AutomationPanel,
|
|
10
|
+
AutomationSettings,
|
|
11
|
+
FunctionsContainer,
|
|
12
|
+
FunctionsPanel
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-2AOFK5FW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './TriggerEditor';\n\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\nexport const AutomationSettings = lazy(() => import('./AutomationSettings'));\nexport const FunctionsContainer = lazy(() => import('./FunctionsContainer'));\nexport const FunctionsPanel = lazy(() => import('./FunctionsPanel'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,YAAY;AAId,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAMC,qBAAqBD,KAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAME,qBAAqBF,KAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAMG,iBAAiBH,KAAK,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "AutomationPanel", "lazy", "AutomationSettings", "FunctionsContainer", "FunctionsPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-WWURMV25.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-5ARH77PV.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
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-WWURMV25.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
9
|
import { LayoutAction, createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
10
10
|
import { FunctionType, ScriptType } 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,7 +18,7 @@ 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 { t } = useTranslation(meta.id);
|
|
21
22
|
const functions = useQuery(space, Filter.type(FunctionType));
|
|
22
23
|
const scripts = useQuery(space, Filter.type(ScriptType));
|
|
23
24
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -54,6 +55,13 @@ 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)
|
|
@@ -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-DK7R2HNC.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 { FunctionType, ScriptType } 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(FunctionType));\n const scripts = useQuery(space, Filter.type(ScriptType));\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, ScriptType>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: FunctionType) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: FunctionType) => {\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: FunctionType) => 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<FunctionType> items={functions} isItem={Schema.is(FunctionType)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<FunctionType>\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": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,cAAcC,kBAAkB;AACzC,SAASC,mBAAmB;AAC5B,SAASC,QAAoBC,kBAAkBC,gBAAgB;AAC/D,SAASC,QAAQC,YAAYC,sBAAsB;AACnD,SAASC,0BAA0B;AACnC,SAASC,YAAY;AACrB,SAASC,YAAYC,UAAU;AAI/B,IAAMC,OAAO;AAMN,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;;;AAC3D,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAMC,YAAYC,SAASN,OAAOO,OAAOC,KAAKC,YAAAA,CAAAA;AAC9C,UAAMC,UAAUJ,SAASN,OAAOO,OAAOC,KAAKG,UAAAA,CAAAA;AAC5C,UAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,UAAMC,sBAAsBC,QAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,YAAMC,WAAWD,KAAKE,QAAQC,QAAQlB;AACtC,UAAIgB,UAAU;AACZ,cAAMG,SAASb,QAAQc,KAAK,CAACC,MAAMA,EAAErB,OAAOgB,QAAAA;AAC5C,YAAIG,QAAQ;AACVL,cAAIC,KAAKf,EAAE,IAAImB;QACjB;MACF;AACA,aAAOL;IACT,GACA,CAAC,CAAA,GAEL;MAACb;MAAWK;KAAQ;AAGtB,UAAMgB,gBAAgBC,YACpB,CAACR,SAAAA;AACC,YAAMI,SAASR,oBAAoBI,KAAKf,EAAE;AAC1C,aAAOmB,QAAQK;IACjB,GACA;MAACb;KAAoB;AAGvB,UAAMc,mBAAmBF,YACvB,CAACR,SAAAA;AACC,YAAMI,SAASR,oBAAoBI,KAAKf,EAAE;AAC1C,UAAImB,QAAQ;AACV,aAAKV,SAASiB,aAAaC,aAAaC,MAAM;UAAEC,MAAM;UAAQC,SAAS;YAACC,iBAAiBZ,MAAAA;;QAAS,CAAA,CAAA;MACpG;IACF,GACA;MAACR;MAAqBF;KAAS;AAGjC,UAAMuB,eAAeT,YACnB,CAACR,SAAuBN,SAASiB,aAAaO,YAAYC,eAAe;MAAEC,SAAS;QAACpB;;IAAM,CAAA,CAAA,GAC3F;MAACN;KAAS;AAGZ,WACE,sBAAA,cAAC2B,OAAAA;MAAIC,MAAK;MAAOC,WAAWC,GAAGC,kBAAAA;OAC5BvC,UAAUwC,SAAS,KAClB,sBAAA,cAACC,KAAKC,MAAI;MAAeC,OAAO3C;MAAW4C,QAAeC,UAAGzC,YAAAA;MAAe0C,OAAO,CAAChC,SAASA,KAAKf;OAC/F,CAAC,EAAE4C,MAAK,MACP,sBAAA,cAACR,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACxBM,OAAO9B,IAAI,CAACC,SACX,sBAAA,cAAC2B,KAAKM,MAAI;MACRC,KAAKlC,KAAKf;MACVkD,MAAMnC;MACNoC,YAAYZ,GAAG7C,MAAM0D,YAAY,gBAAgB,SAAS,eAAA;OAE1D,sBAAA,cAAChB,OAAAA;MAAIE,WAAU;OACb,sBAAA,cAACI,KAAKW,WAAS;MAACF,YAAW;OAAYpC,KAAKS,IAAI,GAC/CF,cAAcP,IAAAA,KACb,sBAAA,cAACqB,OAAAA;MAAIE,WAAU;OAAqChB,cAAcP,IAAAA,CAAAA,CAAAA,GAGrEJ,oBAAoBI,KAAKf,EAAE,KAC1B,sBAAA,cAACsD,QAAAA;MAAOC,SAAS,MAAM9B,iBAAiBV,IAAAA;OAAQlB,EAAE,oCAAA,CAAA,GAEpD,sBAAA,cAAC2D,YAAAA;MACCC,UAAAA;MACAC,MAAK;MACLC,OAAO9D,EAAE,8BAAA;MACT0D,SAAS,MAAMvB,aAAajB,IAAAA;YASzCd,UAAUwC,WAAW,KAAK,sBAAA,cAACL,OAAAA;MAAIE,WAAU;OAAmCzC,EAAE,oBAAA,CAAA,CAAA;;;;AAGrF;;;ACrGA,IAAA,yBAAe+D;",
|
|
6
|
+
"names": ["Schema", "React", "useCallback", "useMemo", "LayoutAction", "createIntent", "useIntentDispatcher", "FunctionType", "ScriptType", "SpaceAction", "Filter", "fullyQualifiedId", "useQuery", "Button", "IconButton", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "meta", "id", "functions", "useQuery", "Filter", "type", "FunctionType", "scripts", "ScriptType", "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,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationCapabilities
|
|
3
|
+
} from "./chunk-5ARH77PV.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useComputeRuntimeCallback.ts
|
|
6
|
+
import { useCallback } from "react";
|
|
7
|
+
import { useCapability } from "@dxos/app-framework";
|
|
8
|
+
var useComputeRuntimeCallback = (space, fn, deps) => {
|
|
9
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
10
|
+
const runtime = space !== void 0 ? computeRuntime.getRuntime(space.id) : void 0;
|
|
11
|
+
return useCallback(() => {
|
|
12
|
+
if (!runtime) {
|
|
13
|
+
throw new TypeError("Space not provided to useComputeRuntimeCallback");
|
|
14
|
+
}
|
|
15
|
+
return runtime.runPromise(fn());
|
|
16
|
+
}, [
|
|
17
|
+
runtime,
|
|
18
|
+
...deps ?? []
|
|
19
|
+
]);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/hooks/useTriggerRuntimeControls.ts
|
|
23
|
+
import * as Effect from "effect/Effect";
|
|
24
|
+
import { Filter } from "@dxos/echo";
|
|
25
|
+
import { FunctionTrigger, TriggerDispatcher } from "@dxos/functions";
|
|
26
|
+
import { useQuery } from "@dxos/react-client/echo";
|
|
27
|
+
import { useAsyncState } from "@dxos/react-ui";
|
|
28
|
+
var useTriggerRuntimeControls = (space) => {
|
|
29
|
+
const triggers = useQuery(space, Filter.type(FunctionTrigger));
|
|
30
|
+
const [isRunningState, setIsRunningState] = useAsyncState(useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))));
|
|
31
|
+
const start = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
|
|
32
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
33
|
+
yield* dispatcher.start();
|
|
34
|
+
setIsRunningState(true);
|
|
35
|
+
}));
|
|
36
|
+
const stop = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
|
|
37
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
38
|
+
yield* dispatcher.stop();
|
|
39
|
+
setIsRunningState(false);
|
|
40
|
+
}));
|
|
41
|
+
return {
|
|
42
|
+
triggers,
|
|
43
|
+
isRunning: isRunningState ?? false,
|
|
44
|
+
start: () => void start(),
|
|
45
|
+
stop: () => void stop()
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
useComputeRuntimeCallback,
|
|
51
|
+
useTriggerRuntimeControls
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=chunk-MVPRI3DB.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/useComputeRuntimeCallback.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 */\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 return runtime.runPromise(fn());\n }, [runtime, ...(deps ?? [])]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Filter } from '@dxos/echo';\nimport { FunctionTrigger, 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: FunctionTrigger[];\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(FunctionTrigger));\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;AAQvB,IAAMC,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;AACA,WAAOL,QAAQM,WAAWZ,GAAAA,CAAAA;EAC5B,GAAG;IAACM;OAAaL,QAAQ,CAAA;GAAI;AAC/B;;;ACzBA,YAAYY,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiBC,yBAAyB;AACnD,SAAqBC,gBAAgB;AACrC,SAASC,qBAAqB;AAWvB,IAAMC,4BAA4B,CAACC,UAAAA;AACxC,QAAMC,WAAWC,SAASF,OAAOG,OAAOC,KAAKC,eAAAA,CAAAA;AAE7C,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", "useComputeRuntimeCallback", "space", "fn", "deps", "computeRuntime", "useCapability", "AutomationCapabilities", "ComputeRuntime", "runtime", "undefined", "getRuntime", "id", "useCallback", "TypeError", "runPromise", "Effect", "Filter", "FunctionTrigger", "TriggerDispatcher", "useQuery", "useAsyncState", "useTriggerRuntimeControls", "space", "triggers", "useQuery", "Filter", "type", "FunctionTrigger", "isRunningState", "setIsRunningState", "useAsyncState", "useComputeRuntimeCallback", "TriggerDispatcher", "pipe", "map", "t", "running", "start", "fnUntraced", "dispatcher", "stop", "isRunning"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/capabilities/index.ts
|
|
2
|
+
import { lazy } from "@dxos/app-framework";
|
|
3
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-DV5HMFX4.mjs"));
|
|
4
|
+
var ComputeRuntime = lazy(() => import("./compute-runtime-YJREH6WP.mjs"));
|
|
5
|
+
var IntentResolver = lazy(() => import("./intent-resolver-D2OHKQRR.mjs"));
|
|
6
|
+
var ReactSurface = lazy(() => import("./react-surface-POLPITTD.mjs"));
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
AppGraphBuilder,
|
|
10
|
+
ComputeRuntime,
|
|
11
|
+
IntentResolver,
|
|
12
|
+
ReactSurface
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-QACR4BJ7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\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"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,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;",
|
|
6
|
+
"names": ["lazy", "AppGraphBuilder", "lazy", "ComputeRuntime", "IntentResolver", "ReactSurface"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-WWURMV25.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/TriggerEditor/TriggerEditor.tsx
|
|
6
6
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
@@ -8,8 +8,10 @@ import React3, { useCallback as useCallback3, useMemo as useMemo3 } from "react"
|
|
|
8
8
|
import { ComputeGraph } from "@dxos/conductor";
|
|
9
9
|
import { Type as Type2 } from "@dxos/echo";
|
|
10
10
|
import { FunctionTrigger, FunctionType, ScriptType } from "@dxos/functions";
|
|
11
|
-
import { Filter, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
|
|
12
|
-
import {
|
|
11
|
+
import { Filter as Filter2, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
|
|
12
|
+
import { Input } from "@dxos/react-ui";
|
|
13
|
+
import { QueryForm } from "@dxos/react-ui-components";
|
|
14
|
+
import { Form as Form2, InputHeader, SelectInput as SelectInput2, useRefQueryLookupHandler } from "@dxos/react-ui-form";
|
|
13
15
|
|
|
14
16
|
// src/components/TriggerEditor/FunctionInputEditor.tsx
|
|
15
17
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
@@ -37,7 +39,12 @@ var FunctionInputEditor = ({ functions, getValue, onValueChange, onQueryRefOptio
|
|
|
37
39
|
useOnTransition(
|
|
38
40
|
// Clear function parameter input when the function changes.
|
|
39
41
|
selectedFunctionValue,
|
|
40
|
-
(prevValue) =>
|
|
42
|
+
(prevValue) => {
|
|
43
|
+
if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
|
|
47
|
+
},
|
|
41
48
|
(currValue) => currValue !== void 0,
|
|
42
49
|
() => onValueChange("object", {})
|
|
43
50
|
);
|
|
@@ -76,13 +83,14 @@ var FunctionInputEditor = ({ functions, getValue, onValueChange, onQueryRefOptio
|
|
|
76
83
|
// src/components/TriggerEditor/SpecSelector.tsx
|
|
77
84
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
78
85
|
import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
86
|
+
import { Filter, Query } from "@dxos/echo";
|
|
79
87
|
import { TriggerKinds } from "@dxos/functions";
|
|
80
88
|
import { useTranslation } from "@dxos/react-ui";
|
|
81
89
|
import { SelectInput, useInputProps } from "@dxos/react-ui-form";
|
|
82
90
|
var SpecSelector = (props) => {
|
|
83
91
|
var _effect = _useSignals2();
|
|
84
92
|
try {
|
|
85
|
-
const { t } = useTranslation(
|
|
93
|
+
const { t } = useTranslation(meta.id);
|
|
86
94
|
const specProps = useInputProps([
|
|
87
95
|
"spec"
|
|
88
96
|
]);
|
|
@@ -97,12 +105,14 @@ var SpecSelector = (props) => {
|
|
|
97
105
|
case "subscription":
|
|
98
106
|
return {
|
|
99
107
|
kind: "subscription",
|
|
100
|
-
|
|
108
|
+
query: {
|
|
109
|
+
ast: Query.select(Filter.nothing()).ast
|
|
110
|
+
}
|
|
101
111
|
};
|
|
102
112
|
case "queue":
|
|
103
113
|
return {
|
|
104
114
|
kind: "queue",
|
|
105
|
-
queue: ""
|
|
115
|
+
queue: "dxn:"
|
|
106
116
|
};
|
|
107
117
|
case "email":
|
|
108
118
|
return {
|
|
@@ -141,16 +151,22 @@ var SpecSelector = (props) => {
|
|
|
141
151
|
};
|
|
142
152
|
|
|
143
153
|
// src/components/TriggerEditor/TriggerEditor.tsx
|
|
144
|
-
var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
|
|
154
|
+
var TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }) => {
|
|
145
155
|
var _effect = _useSignals3();
|
|
146
156
|
try {
|
|
147
|
-
const handleSave = (values) => {
|
|
157
|
+
const handleSave = ({ id: _, ...values }) => {
|
|
148
158
|
onSave?.(values);
|
|
149
159
|
};
|
|
150
160
|
const handleRefQueryLookup = useRefQueryLookupHandler({
|
|
151
161
|
space
|
|
152
162
|
});
|
|
153
|
-
const Custom = useCustomInputs(
|
|
163
|
+
const Custom = useCustomInputs({
|
|
164
|
+
space,
|
|
165
|
+
readonlySpec,
|
|
166
|
+
types,
|
|
167
|
+
tags,
|
|
168
|
+
onQueryRefOptions: handleRefQueryLookup
|
|
169
|
+
});
|
|
154
170
|
return /* @__PURE__ */ React3.createElement(Form2, {
|
|
155
171
|
outerSpacing: false,
|
|
156
172
|
Custom,
|
|
@@ -164,10 +180,10 @@ var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
|
|
|
164
180
|
_effect.f();
|
|
165
181
|
}
|
|
166
182
|
};
|
|
167
|
-
var useCustomInputs = (space, onQueryRefOptions) => {
|
|
168
|
-
const functions = useQuery(space,
|
|
169
|
-
const workflows = useQuery(space,
|
|
170
|
-
const scripts = useQuery(space,
|
|
183
|
+
var useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }) => {
|
|
184
|
+
const functions = useQuery(space, Filter2.type(FunctionType));
|
|
185
|
+
const workflows = useQuery(space, Filter2.type(ComputeGraph));
|
|
186
|
+
const scripts = useQuery(space, Filter2.type(ScriptType));
|
|
171
187
|
return useMemo3(() => ({
|
|
172
188
|
// Function selector.
|
|
173
189
|
["function"]: (props) => {
|
|
@@ -197,7 +213,27 @@ var useCustomInputs = (space, onQueryRefOptions) => {
|
|
|
197
213
|
});
|
|
198
214
|
},
|
|
199
215
|
// Spec selector.
|
|
200
|
-
["spec.kind"]: SpecSelector,
|
|
216
|
+
["spec.kind"]: (props) => /* @__PURE__ */ React3.createElement(SpecSelector, {
|
|
217
|
+
...props,
|
|
218
|
+
readonly: readonlySpec ? "disabled-input" : false
|
|
219
|
+
}),
|
|
220
|
+
// TODO(wittjosiah): Copied from ViewEditor.
|
|
221
|
+
// Query input editor.
|
|
222
|
+
["spec.query"]: (props) => {
|
|
223
|
+
const handleChange = useCallback3((query) => props.onValueChange("object", {
|
|
224
|
+
ast: query.ast
|
|
225
|
+
}), [
|
|
226
|
+
props.onValueChange
|
|
227
|
+
]);
|
|
228
|
+
return /* @__PURE__ */ React3.createElement(Input.Root, null, /* @__PURE__ */ React3.createElement(InputHeader, {
|
|
229
|
+
label: props.label
|
|
230
|
+
}), /* @__PURE__ */ React3.createElement(QueryForm, {
|
|
231
|
+
initialQuery: props.getValue().ast,
|
|
232
|
+
types,
|
|
233
|
+
tags,
|
|
234
|
+
onChange: handleChange
|
|
235
|
+
}));
|
|
236
|
+
},
|
|
201
237
|
// Function input editor.
|
|
202
238
|
["input"]: (props) => /* @__PURE__ */ React3.createElement(FunctionInputEditor, {
|
|
203
239
|
...props,
|
|
@@ -207,7 +243,8 @@ var useCustomInputs = (space, onQueryRefOptions) => {
|
|
|
207
243
|
}), [
|
|
208
244
|
workflows,
|
|
209
245
|
scripts,
|
|
210
|
-
functions
|
|
246
|
+
functions,
|
|
247
|
+
readonlySpec
|
|
211
248
|
]);
|
|
212
249
|
};
|
|
213
250
|
var getWorkflowOptions = (graphs) => {
|
|
@@ -227,4 +264,4 @@ var getFunctionOptions = (scripts, functions) => {
|
|
|
227
264
|
export {
|
|
228
265
|
TriggerEditor
|
|
229
266
|
};
|
|
230
|
-
//# sourceMappingURL=chunk-
|
|
267
|
+
//# sourceMappingURL=chunk-SUKAEYF3.mjs.map
|