@dxos/plugin-automation 0.8.1 → 0.8.2-main.2f9c567

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.
Files changed (163) hide show
  1. package/dist/lib/browser/AutomationContainer-3MP23OGQ.mjs +34 -0
  2. package/dist/lib/browser/AutomationContainer-3MP23OGQ.mjs.map +7 -0
  3. package/dist/lib/browser/AutomationPanel-75HVBBNG.mjs +11 -0
  4. package/dist/lib/browser/AutomationPanel-75HVBBNG.mjs.map +7 -0
  5. package/dist/lib/browser/FunctionsContainer-HLISW5QI.mjs +33 -0
  6. package/dist/lib/browser/FunctionsContainer-HLISW5QI.mjs.map +7 -0
  7. package/dist/lib/browser/FunctionsPanel-OKFRBXLO.mjs +10 -0
  8. package/dist/lib/browser/FunctionsPanel-OKFRBXLO.mjs.map +7 -0
  9. package/dist/lib/browser/{app-graph-builder-K3BIQFWW.mjs → app-graph-builder-ND64CHOM.mjs} +42 -1
  10. package/dist/lib/browser/app-graph-builder-ND64CHOM.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-ADYCSC6Y.mjs +39 -0
  12. package/dist/lib/browser/chunk-ADYCSC6Y.mjs.map +7 -0
  13. package/dist/lib/browser/{AutomationPanel-YAHFXQX6.mjs → chunk-HTVXRMNH.mjs} +19 -18
  14. package/dist/lib/browser/chunk-HTVXRMNH.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-IDCVJ2JW.mjs +88 -0
  16. package/dist/lib/browser/chunk-IDCVJ2JW.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-N4PTKEWO.mjs +14 -0
  18. package/dist/lib/browser/chunk-N4PTKEWO.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-Q2ACSERA.mjs +211 -0
  20. package/dist/lib/browser/chunk-Q2ACSERA.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +25 -19
  22. package/dist/lib/browser/index.mjs.map +3 -3
  23. package/dist/lib/browser/intent-resolver-YH4YPX52.mjs +77 -0
  24. package/dist/lib/browser/intent-resolver-YH4YPX52.mjs.map +7 -0
  25. package/dist/lib/browser/meta.json +1 -1
  26. package/dist/lib/browser/react-surface-GA67CQBV.mjs +68 -0
  27. package/dist/lib/browser/react-surface-GA67CQBV.mjs.map +7 -0
  28. package/dist/lib/browser/types.mjs +8 -0
  29. package/dist/lib/browser/types.mjs.map +7 -0
  30. package/dist/lib/node/AutomationContainer-RIDHNHPT.cjs +62 -0
  31. package/dist/lib/node/AutomationContainer-RIDHNHPT.cjs.map +7 -0
  32. package/dist/lib/node/AutomationPanel-6RLBWAGL.cjs +32 -0
  33. package/dist/lib/node/AutomationPanel-6RLBWAGL.cjs.map +7 -0
  34. package/dist/lib/node/FunctionsContainer-RNZTNQEU.cjs +61 -0
  35. package/dist/lib/node/FunctionsContainer-RNZTNQEU.cjs.map +7 -0
  36. package/dist/lib/node/FunctionsPanel-7I7YCHPJ.cjs +31 -0
  37. package/dist/lib/node/FunctionsPanel-7I7YCHPJ.cjs.map +7 -0
  38. package/dist/lib/node/{app-graph-builder-HO4FPGZ5.cjs → app-graph-builder-TVFR6RXO.cjs} +45 -4
  39. package/dist/lib/node/app-graph-builder-TVFR6RXO.cjs.map +7 -0
  40. package/dist/lib/node/{AutomationPanel-ZKAMIU6O.cjs → chunk-52JFIUOD.cjs} +31 -26
  41. package/dist/lib/node/chunk-52JFIUOD.cjs.map +7 -0
  42. package/dist/lib/node/chunk-ESVJ2X6U.cjs +234 -0
  43. package/dist/lib/node/chunk-ESVJ2X6U.cjs.map +7 -0
  44. package/dist/lib/node/chunk-GDCG2BML.cjs +58 -0
  45. package/dist/lib/node/chunk-GDCG2BML.cjs.map +7 -0
  46. package/dist/lib/node/chunk-GLXGAIZC.cjs +116 -0
  47. package/dist/lib/node/chunk-GLXGAIZC.cjs.map +7 -0
  48. package/dist/lib/node/{chunk-AGJ6XTDN.cjs → chunk-HZTVNN4S.cjs} +16 -7
  49. package/dist/lib/node/chunk-HZTVNN4S.cjs.map +7 -0
  50. package/dist/lib/node/index.cjs +28 -22
  51. package/dist/lib/node/index.cjs.map +3 -3
  52. package/dist/lib/node/intent-resolver-6FJ6PJJI.cjs +93 -0
  53. package/dist/lib/node/intent-resolver-6FJ6PJJI.cjs.map +7 -0
  54. package/dist/lib/node/meta.json +1 -1
  55. package/dist/lib/node/{react-surface-52M54VWV.cjs → react-surface-UJDYSHZ5.cjs} +39 -15
  56. package/dist/lib/node/react-surface-UJDYSHZ5.cjs.map +7 -0
  57. package/dist/lib/node/types.cjs +30 -0
  58. package/dist/lib/node/types.cjs.map +7 -0
  59. package/dist/lib/node-esm/AutomationContainer-MCUWF267.mjs +35 -0
  60. package/dist/lib/node-esm/AutomationContainer-MCUWF267.mjs.map +7 -0
  61. package/dist/lib/node-esm/AutomationPanel-U34H2Q7Z.mjs +12 -0
  62. package/dist/lib/node-esm/AutomationPanel-U34H2Q7Z.mjs.map +7 -0
  63. package/dist/lib/node-esm/FunctionsContainer-435FW56J.mjs +34 -0
  64. package/dist/lib/node-esm/FunctionsContainer-435FW56J.mjs.map +7 -0
  65. package/dist/lib/node-esm/FunctionsPanel-NXXT5ERU.mjs +11 -0
  66. package/dist/lib/node-esm/FunctionsPanel-NXXT5ERU.mjs.map +7 -0
  67. package/dist/lib/node-esm/{app-graph-builder-XCJR33VS.mjs → app-graph-builder-NYLOXWVV.mjs} +42 -1
  68. package/dist/lib/node-esm/app-graph-builder-NYLOXWVV.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-5JC4JVYZ.mjs +212 -0
  70. package/dist/lib/node-esm/chunk-5JC4JVYZ.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-EEA6CZ6B.mjs +40 -0
  72. package/dist/lib/node-esm/chunk-EEA6CZ6B.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-RG3M42SO.mjs +16 -0
  74. package/dist/lib/node-esm/chunk-RG3M42SO.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-VYSTWH6Q.mjs +89 -0
  76. package/dist/lib/node-esm/chunk-VYSTWH6Q.mjs.map +7 -0
  77. package/dist/lib/node-esm/{AutomationPanel-XF7YPSKM.mjs → chunk-WYXWQFPK.mjs} +19 -18
  78. package/dist/lib/node-esm/chunk-WYXWQFPK.mjs.map +7 -0
  79. package/dist/lib/node-esm/index.mjs +25 -19
  80. package/dist/lib/node-esm/index.mjs.map +3 -3
  81. package/dist/lib/node-esm/intent-resolver-PVY22PBL.mjs +78 -0
  82. package/dist/lib/node-esm/intent-resolver-PVY22PBL.mjs.map +7 -0
  83. package/dist/lib/node-esm/meta.json +1 -1
  84. package/dist/lib/node-esm/react-surface-R72A4EHM.mjs +69 -0
  85. package/dist/lib/node-esm/react-surface-R72A4EHM.mjs.map +7 -0
  86. package/dist/lib/node-esm/types.mjs +9 -0
  87. package/dist/lib/node-esm/types.mjs.map +7 -0
  88. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  90. package/dist/types/src/capabilities/index.d.ts +1 -0
  91. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  92. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  93. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  94. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  95. package/dist/types/src/components/AutomationContainer.d.ts +7 -0
  96. package/dist/types/src/components/AutomationContainer.d.ts.map +1 -0
  97. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -3
  98. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  99. package/dist/types/src/components/AutomationPanel/index.d.ts +1 -0
  100. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  101. package/dist/types/src/components/FunctionsContainer.d.ts +7 -0
  102. package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -0
  103. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts +7 -0
  104. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -0
  105. package/dist/types/src/components/FunctionsPanel/index.d.ts +4 -0
  106. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -0
  107. package/dist/types/src/components/TriggerEditor/FunctionPayloadEditor.d.ts +12 -0
  108. package/dist/types/src/components/TriggerEditor/FunctionPayloadEditor.d.ts.map +1 -0
  109. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +5 -0
  110. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -0
  111. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
  112. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  113. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  114. package/dist/types/src/components/index.d.ts +8 -1
  115. package/dist/types/src/components/index.d.ts.map +1 -1
  116. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  117. package/dist/types/src/translations.d.ts +8 -0
  118. package/dist/types/src/translations.d.ts.map +1 -1
  119. package/dist/types/src/types.d.ts +25 -0
  120. package/dist/types/src/types.d.ts.map +1 -0
  121. package/package.json +33 -24
  122. package/src/AutomationPlugin.tsx +5 -10
  123. package/src/capabilities/app-graph-builder.ts +31 -0
  124. package/src/capabilities/index.ts +1 -0
  125. package/src/capabilities/intent-resolver.ts +73 -0
  126. package/src/capabilities/react-surface.tsx +32 -8
  127. package/src/components/AutomationContainer.tsx +31 -0
  128. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +5 -5
  129. package/src/components/AutomationPanel/AutomationPanel.tsx +67 -67
  130. package/src/components/AutomationPanel/index.ts +2 -0
  131. package/src/components/FunctionsContainer.tsx +31 -0
  132. package/src/components/FunctionsPanel/FunctionsPanel.tsx +95 -0
  133. package/src/components/FunctionsPanel/index.ts +8 -0
  134. package/src/components/TriggerEditor/FunctionPayloadEditor.tsx +77 -0
  135. package/src/components/TriggerEditor/SpecSelector.tsx +59 -0
  136. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +18 -9
  137. package/src/components/TriggerEditor/TriggerEditor.tsx +49 -89
  138. package/src/components/index.ts +3 -0
  139. package/src/testing/test-functions.ts +23 -9
  140. package/src/translations.ts +10 -1
  141. package/src/types.ts +33 -0
  142. package/dist/lib/browser/AutomationPanel-YAHFXQX6.mjs.map +0 -7
  143. package/dist/lib/browser/app-graph-builder-K3BIQFWW.mjs.map +0 -7
  144. package/dist/lib/browser/chunk-FALBBJNO.mjs +0 -138
  145. package/dist/lib/browser/chunk-FALBBJNO.mjs.map +0 -7
  146. package/dist/lib/browser/chunk-MT3FZH4V.mjs +0 -8
  147. package/dist/lib/browser/chunk-MT3FZH4V.mjs.map +0 -7
  148. package/dist/lib/browser/react-surface-4QQSJR4A.mjs +0 -42
  149. package/dist/lib/browser/react-surface-4QQSJR4A.mjs.map +0 -7
  150. package/dist/lib/node/AutomationPanel-ZKAMIU6O.cjs.map +0 -7
  151. package/dist/lib/node/app-graph-builder-HO4FPGZ5.cjs.map +0 -7
  152. package/dist/lib/node/chunk-AGJ6XTDN.cjs.map +0 -7
  153. package/dist/lib/node/chunk-FTEDH5Q6.cjs +0 -167
  154. package/dist/lib/node/chunk-FTEDH5Q6.cjs.map +0 -7
  155. package/dist/lib/node/react-surface-52M54VWV.cjs.map +0 -7
  156. package/dist/lib/node-esm/AutomationPanel-XF7YPSKM.mjs.map +0 -7
  157. package/dist/lib/node-esm/app-graph-builder-XCJR33VS.mjs.map +0 -7
  158. package/dist/lib/node-esm/chunk-M4QXMIIB.mjs +0 -139
  159. package/dist/lib/node-esm/chunk-M4QXMIIB.mjs.map +0 -7
  160. package/dist/lib/node-esm/chunk-OA75PSGH.mjs +0 -10
  161. package/dist/lib/node-esm/chunk-OA75PSGH.mjs.map +0 -7
  162. package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs +0 -43
  163. package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs.map +0 -7
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_ESVJ2X6U_exports = {};
30
+ __export(chunk_ESVJ2X6U_exports, {
31
+ TriggerEditor: () => TriggerEditor
32
+ });
33
+ module.exports = __toCommonJS(chunk_ESVJ2X6U_exports);
34
+ var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
35
+ var import_react = __toESM(require("react"));
36
+ var import_conductor = require("@dxos/conductor");
37
+ var import_echo = require("@dxos/echo");
38
+ var import_functions = require("@dxos/functions");
39
+ var import_echo2 = require("@dxos/react-client/echo");
40
+ var import_react_ui = require("@dxos/react-ui");
41
+ var import_react_ui_form = require("@dxos/react-ui-form");
42
+ var import_react2 = __toESM(require("react"));
43
+ var import_echo_schema = require("@dxos/echo-schema");
44
+ var import_react_ui2 = require("@dxos/react-ui");
45
+ var import_react_ui_form2 = require("@dxos/react-ui-form");
46
+ var import_react3 = __toESM(require("react"));
47
+ var import_functions2 = require("@dxos/functions");
48
+ var import_react_ui3 = require("@dxos/react-ui");
49
+ var import_react_ui_form3 = require("@dxos/react-ui-form");
50
+ var FunctionPayloadEditor = ({ functions, getValue, onValueChange, onQueryRefOptions }) => {
51
+ const selectedFunctionValue = (0, import_react_ui_form2.useFormValues)([
52
+ "function"
53
+ ]);
54
+ const selectedFunctionName = (0, import_react2.useMemo)(() => {
55
+ if (selectedFunctionValue instanceof import_echo_schema.RefImpl) {
56
+ return selectedFunctionValue.dxn.toString().split("dxn:worker:").at(1);
57
+ }
58
+ }, [
59
+ selectedFunctionValue
60
+ ]);
61
+ const selectedFunction = (0, import_react2.useMemo)(() => functions.find((f) => f.name === selectedFunctionName), [
62
+ functions,
63
+ selectedFunctionName
64
+ ]);
65
+ (0, import_react_ui2.useOnTransition)(
66
+ // Clear function parameter meta when the function changes.
67
+ selectedFunctionValue,
68
+ (prevValue) => prevValue !== void 0 && prevValue !== selectedFunctionValue,
69
+ (currValue) => currValue !== void 0,
70
+ () => onValueChange("object", {})
71
+ );
72
+ const inputSchema = (0, import_react2.useMemo)(() => selectedFunction?.inputSchema, [
73
+ selectedFunction
74
+ ]);
75
+ const effectSchema = (0, import_react2.useMemo)(() => inputSchema ? (0, import_echo_schema.toEffectSchema)(inputSchema) : void 0, [
76
+ inputSchema
77
+ ]);
78
+ const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
79
+ const values = (0, import_react2.useMemo)(() => getValue() ?? {}, [
80
+ getValue
81
+ ]);
82
+ const handleValuesChanged = (0, import_react2.useCallback)((values2) => {
83
+ onValueChange("object", values2);
84
+ }, [
85
+ onValueChange
86
+ ]);
87
+ if (selectedFunction === void 0 || effectSchema === void 0 || propertyCount === 0) {
88
+ return null;
89
+ }
90
+ return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("h3", {
91
+ className: "text-md"
92
+ }, "Function parameters"), /* @__PURE__ */ import_react2.default.createElement(import_react_ui_form2.Form, {
93
+ schema: effectSchema,
94
+ values,
95
+ classNames: "p-0",
96
+ onValuesChanged: handleValuesChanged,
97
+ onQueryRefOptions
98
+ }));
99
+ };
100
+ var SpecSelector = (props) => {
101
+ const { t } = (0, import_react_ui3.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
102
+ const specProps = (0, import_react_ui_form3.useInputProps)([
103
+ "spec"
104
+ ]);
105
+ const handleTypeChange = (0, import_react3.useCallback)((_type, value) => {
106
+ const getDefaultTriggerSpec = (kind) => {
107
+ switch (kind) {
108
+ case import_functions2.TriggerKind.Timer:
109
+ return {
110
+ type: import_functions2.TriggerKind.Timer,
111
+ cron: ""
112
+ };
113
+ case import_functions2.TriggerKind.Subscription:
114
+ return {
115
+ type: import_functions2.TriggerKind.Subscription,
116
+ filter: {}
117
+ };
118
+ case import_functions2.TriggerKind.Queue:
119
+ return {
120
+ type: import_functions2.TriggerKind.Queue,
121
+ queue: ""
122
+ };
123
+ case import_functions2.TriggerKind.Email:
124
+ return {
125
+ type: import_functions2.TriggerKind.Email
126
+ };
127
+ case import_functions2.TriggerKind.Webhook:
128
+ return {
129
+ type: import_functions2.TriggerKind.Webhook
130
+ };
131
+ default:
132
+ return void 0;
133
+ }
134
+ };
135
+ const defaultSpec = getDefaultTriggerSpec(value);
136
+ if (!defaultSpec) {
137
+ return;
138
+ }
139
+ specProps.onValueChange("object", defaultSpec);
140
+ }, [
141
+ specProps
142
+ ]);
143
+ const options = (0, import_react3.useMemo)(() => Object.values(import_functions2.TriggerKind).map((kind) => ({
144
+ value: kind,
145
+ label: t(`trigger type ${kind}`)
146
+ })), [
147
+ t
148
+ ]);
149
+ return /* @__PURE__ */ import_react3.default.createElement(import_react_ui_form3.SelectInput, {
150
+ ...props,
151
+ options,
152
+ onValueChange: handleTypeChange
153
+ });
154
+ };
155
+ var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
156
+ const { t } = (0, import_react_ui.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
157
+ const functions = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_functions.FunctionType));
158
+ const workflows = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_conductor.ComputeGraph));
159
+ const scripts = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_functions.ScriptType));
160
+ const handleSave = (values) => {
161
+ onSave?.(values);
162
+ };
163
+ const handleRefQueryLookup = (0, import_react_ui_form.useRefQueryLookupHandler)({
164
+ space
165
+ });
166
+ const Custom = (0, import_react.useMemo)(() => ({
167
+ ["function"]: (props) => {
168
+ const getValue = (0, import_react.useCallback)(() => {
169
+ const formValue = props.getValue();
170
+ if (formValue instanceof import_echo.DXN) {
171
+ return formValue.toString();
172
+ }
173
+ return void 0;
174
+ }, [
175
+ props
176
+ ]);
177
+ const handleOnValueChange = (0, import_react.useCallback)((_type, dxnString) => {
178
+ const dxn = import_echo.DXN.parse(dxnString);
179
+ if (dxn) {
180
+ const ref = import_echo2.Ref.fromDXN(dxn);
181
+ props.onValueChange("object", ref);
182
+ }
183
+ }, [
184
+ props.onValueChange
185
+ ]);
186
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.SelectInput, {
187
+ ...props,
188
+ getValue,
189
+ onValueChange: handleOnValueChange,
190
+ options: getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))
191
+ });
192
+ },
193
+ ["spec.type"]: SpecSelector,
194
+ ["payload"]: (props) => /* @__PURE__ */ import_react.default.createElement(FunctionPayloadEditor, {
195
+ ...props,
196
+ functions,
197
+ onQueryRefOptions: handleRefQueryLookup
198
+ })
199
+ }), [
200
+ workflows,
201
+ scripts,
202
+ functions,
203
+ t
204
+ ]);
205
+ return /* @__PURE__ */ import_react.default.createElement("div", {
206
+ role: "none",
207
+ className: "bs-full is-full"
208
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_form.Form, {
209
+ schema: import_functions.FunctionTriggerSchema,
210
+ values: trigger,
211
+ onSave: handleSave,
212
+ onCancel,
213
+ Custom,
214
+ onQueryRefOptions: handleRefQueryLookup
215
+ }));
216
+ };
217
+ var getWorkflowOptions = (graphs) => {
218
+ return graphs.map((graph) => ({
219
+ label: `compute-${graph.id}`,
220
+ value: `dxn:echo:@:${graph.id}`
221
+ }));
222
+ };
223
+ var getFunctionOptions = (scripts, functions) => {
224
+ const getLabel = (fn) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
225
+ return functions.map((fn) => ({
226
+ label: getLabel(fn),
227
+ value: `dxn:worker:${fn.name}`
228
+ }));
229
+ };
230
+ // Annotate the CommonJS export names for ESM import in node:
231
+ 0 && (module.exports = {
232
+ TriggerEditor
233
+ });
234
+ //# sourceMappingURL=chunk-ESVJ2X6U.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/TriggerEditor/FunctionPayloadEditor.tsx", "../../../src/components/TriggerEditor/SpecSelector.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { DXN } from '@dxos/echo';\nimport {\n FunctionType,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n ScriptType,\n} from '@dxos/functions';\nimport { Filter, Ref, useQuery, type Space } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';\n\nimport { FunctionPayloadEditor } from './FunctionPayloadEditor';\nimport { SpecSelector } from './SpecSelector';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTriggerType;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const functions = useQuery(space, Filter.schema(FunctionType));\n const workflows = useQuery(space, Filter.schema(ComputeGraph));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const handleSave = (values: FunctionTriggerType) => {\n onSave?.(values);\n };\n\n const handleRefQueryLookup = useRefQueryLookupHandler({ space });\n\n const Custom = useMemo(\n (): CustomInputMap => ({\n ['function' satisfies keyof FunctionTriggerType]: (props) => {\n const getValue = useCallback(() => {\n const formValue = props.getValue();\n if (formValue instanceof DXN) {\n return formValue.toString() as string;\n }\n return undefined;\n }, [props]);\n\n const handleOnValueChange = useCallback(\n (_type: any, dxnString: string) => {\n const dxn = DXN.parse(dxnString);\n if (dxn) {\n const ref = Ref.fromDXN(dxn);\n props.onValueChange('object', ref);\n }\n },\n [props.onValueChange],\n );\n\n return (\n <SelectInput\n {...props}\n getValue={getValue as any}\n onValueChange={handleOnValueChange}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n );\n },\n ['spec.type' as const]: SpecSelector,\n ['payload' as const]: (props) => (\n <FunctionPayloadEditor {...props} functions={functions} onQueryRefOptions={handleRefQueryLookup} />\n ),\n }),\n [workflows, scripts, functions, t],\n );\n\n return (\n <div role='none' className='bs-full is-full'>\n <Form\n schema={FunctionTriggerSchema}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n Custom={Custom}\n onQueryRefOptions={handleRefQueryLookup}\n />\n </div>\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {\n const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:worker:${fn.name}` }));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type JsonPath, RefImpl, toEffectSchema } from '@dxos/echo-schema';\nimport { type FunctionType } from '@dxos/functions';\nimport { useOnTransition } from '@dxos/react-ui';\nimport { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';\n\nexport type FunctionMetaEditorProps = {\n functions: FunctionType[];\n onQueryRefOptions: QueryRefOptions;\n} & FormInputStateProps;\n\n/**\n * Editor component for function meta parameters.\n */\nexport const FunctionPayloadEditor = ({\n functions,\n getValue,\n onValueChange,\n onQueryRefOptions,\n}: FunctionMetaEditorProps) => {\n const selectedFunctionValue = useFormValues(['function' as JsonPath]);\n const selectedFunctionName = useMemo(() => {\n if (selectedFunctionValue instanceof RefImpl) {\n return selectedFunctionValue.dxn.toString().split('dxn:worker:').at(1);\n }\n }, [selectedFunctionValue]);\n\n const selectedFunction = useMemo(\n () => functions.find((f) => f.name === selectedFunctionName),\n [functions, selectedFunctionName],\n );\n\n useOnTransition(\n // Clear function parameter meta when the function changes.\n selectedFunctionValue,\n (prevValue) => prevValue !== undefined && prevValue !== selectedFunctionValue,\n (currValue) => currValue !== undefined,\n () => onValueChange('object', {}),\n );\n\n const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);\n const effectSchema = useMemo(() => (inputSchema ? toEffectSchema(inputSchema) : undefined), [inputSchema]);\n const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;\n\n const values = useMemo(() => getValue() ?? {}, [getValue]);\n\n const handleValuesChanged = useCallback(\n (values: any) => {\n onValueChange('object', values);\n },\n [onValueChange],\n );\n\n if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {\n return null;\n }\n\n return (\n <>\n <h3 className='text-md'>Function parameters</h3>\n {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.\n This would allow errors to flow up to the root context. */}\n <Form\n schema={effectSchema}\n values={values}\n classNames='p-0'\n onValuesChanged={handleValuesChanged}\n onQueryRefOptions={onQueryRefOptions}\n />\n </>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type FunctionTriggerType, TriggerKind, type TriggerType } from '@dxos/functions';\nimport { useTranslation } from '@dxos/react-ui';\nimport { SelectInput, type InputProps, useInputProps } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type SpecSelectorProps = InputProps;\n\nexport const SpecSelector = (props: SpecSelectorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const specProps = useInputProps(['spec' satisfies keyof FunctionTriggerType]);\n\n const handleTypeChange = useCallback(\n (_type: any, value: string): TriggerType | undefined => {\n const getDefaultTriggerSpec = (kind: string) => {\n switch (kind) {\n case TriggerKind.Timer:\n return { type: TriggerKind.Timer, cron: '' };\n case TriggerKind.Subscription:\n return { type: TriggerKind.Subscription, filter: {} };\n case TriggerKind.Queue:\n return { type: TriggerKind.Queue, queue: '' };\n case TriggerKind.Email:\n return { type: TriggerKind.Email };\n case TriggerKind.Webhook:\n return { type: TriggerKind.Webhook };\n default:\n return undefined;\n }\n };\n\n const defaultSpec = getDefaultTriggerSpec(value);\n if (!defaultSpec) {\n return;\n }\n\n // Update the entire spec object, not just the `spec.type`.\n specProps.onValueChange('object', defaultSpec);\n },\n [specProps],\n );\n\n const options = useMemo(\n () =>\n Object.values(TriggerKind).map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n })),\n [t],\n );\n\n return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA4C;AAE5C,uBAA6B;AAC7B,kBAAoB;AACpB,uBAMO;AACP,IAAAA,eAA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C,UACrBR,6BAAAA,QAAA,cAACjC,uBAAAA;MAAuB,GAAGyC;MAAOxC;MAAsBG,mBAAmB4E;;EAE/E,IACA;IAACL;IAAWE;IAAS5E;IAAWyC;GAAE;AAGpC,SACET,6BAAAA,QAAA,cAAC6D,OAAAA;IAAIC,MAAK;IAAO5D,WAAU;KACzBF,6BAAAA,QAAA,cAACG,qBAAAA,MAAAA;IACCC,QAAQ2D;IACRlE,QAAQuC;IACRC,QAAQS;IACRR;IACAW;IACA9E,mBAAmB4E;;AAI3B;AAEA,IAAMW,qBAAqB,CAACM,WAAAA;AAC1B,SAAOA,OAAOjC,IAAI,CAACkC,WAAW;IAAEjC,OAAO,WAAWiC,MAAMC,EAAE;IAAIlD,OAAO,cAAciD,MAAMC,EAAE;EAAG,EAAA;AAChG;AAEA,IAAMN,qBAAqB,CAAChB,SAAuB5E,cAAAA;AACjD,QAAMmG,WAAW,CAACC,OAAqBxB,QAAQ9D,KAAK,CAACuF,MAAMD,GAAGE,QAAQC,QAAQL,OAAOG,EAAEH,EAAE,GAAGlF,QAAQoF,GAAGpF;AACvG,SAAOhB,UAAU+D,IAAI,CAACqC,QAAQ;IAAEpC,OAAOmC,SAASC,EAAAA;IAAKpD,OAAO,cAAcoD,GAAGpF,IAAI;EAAG,EAAA;AACtF;",
6
+ "names": ["import_echo", "import_react", "import_react_ui", "import_react_ui_form", "import_functions", "FunctionPayloadEditor", "functions", "getValue", "onValueChange", "onQueryRefOptions", "selectedFunctionValue", "useFormValues", "selectedFunctionName", "useMemo", "RefImpl", "dxn", "toString", "split", "at", "selectedFunction", "find", "f", "name", "useOnTransition", "prevValue", "undefined", "currValue", "inputSchema", "effectSchema", "toEffectSchema", "propertyCount", "properties", "Object", "keys", "length", "values", "handleValuesChanged", "useCallback", "React", "h3", "className", "Form", "schema", "classNames", "onValuesChanged", "SpecSelector", "props", "t", "useTranslation", "AUTOMATION_PLUGIN", "specProps", "useInputProps", "handleTypeChange", "_type", "value", "getDefaultTriggerSpec", "kind", "TriggerKind", "Timer", "type", "cron", "Subscription", "filter", "Queue", "queue", "Email", "Webhook", "defaultSpec", "options", "map", "label", "SelectInput", "TriggerEditor", "space", "trigger", "onSave", "onCancel", "useQuery", "Filter", "FunctionType", "workflows", "ComputeGraph", "scripts", "ScriptType", "handleSave", "handleRefQueryLookup", "useRefQueryLookupHandler", "Custom", "formValue", "DXN", "handleOnValueChange", "dxnString", "parse", "ref", "Ref", "fromDXN", "getWorkflowOptions", "concat", "getFunctionOptions", "div", "role", "FunctionTriggerSchema", "graphs", "graph", "id", "getLabel", "fn", "s", "source", "target"]
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_GDCG2BML_exports = {};
20
+ __export(chunk_GDCG2BML_exports, {
21
+ AutomationAction: () => AutomationAction
22
+ });
23
+ module.exports = __toCommonJS(chunk_GDCG2BML_exports);
24
+ var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
25
+ var import_effect = require("effect");
26
+ var import_echo = require("@dxos/react-client/echo");
27
+ var TriggerTemplate = import_effect.Schema.Union(import_effect.Schema.Struct({
28
+ type: import_effect.Schema.Literal("timer"),
29
+ cron: import_effect.Schema.String
30
+ }), import_effect.Schema.Struct({
31
+ type: import_effect.Schema.Literal("queue"),
32
+ queueDXN: import_effect.Schema.Any
33
+ }));
34
+ var AutomationAction;
35
+ (function(AutomationAction2) {
36
+ const AUTOMATION_ACTION = `${import_chunk_7GXNXMSM.AUTOMATION_PLUGIN}/action`;
37
+ class CreateTriggerFromTemplate extends import_effect.Schema.TaggedClass()(`${AUTOMATION_ACTION}/create-trigger-from-template`, {
38
+ input: import_effect.Schema.Struct({
39
+ space: import_echo.SpaceSchema,
40
+ template: TriggerTemplate,
41
+ enabled: import_effect.Schema.optional(import_effect.Schema.Boolean),
42
+ // TODO(wittjosiah): Improve how this lookup is done.
43
+ scriptName: import_effect.Schema.optional(import_effect.Schema.String),
44
+ input: import_effect.Schema.optional(import_effect.Schema.Record({
45
+ key: import_effect.Schema.String,
46
+ value: import_effect.Schema.Any
47
+ }))
48
+ }),
49
+ output: import_effect.Schema.Void
50
+ }) {
51
+ }
52
+ AutomationAction2.CreateTriggerFromTemplate = CreateTriggerFromTemplate;
53
+ })(AutomationAction || (AutomationAction = {}));
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ AutomationAction
57
+ });
58
+ //# sourceMappingURL=chunk-GDCG2BML.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { SpaceSchema } from '@dxos/react-client/echo';\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nconst TriggerTemplate = Schema.Union(\n Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),\n Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),\n);\n\nexport namespace AutomationAction {\n const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\n export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(\n `${AUTOMATION_ACTION}/create-trigger-from-template`,\n {\n input: Schema.Struct({\n space: SpaceSchema,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n // TODO(wittjosiah): Improve how this lookup is done.\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,kBAA4B;AAI5B,IAAMA,kBAAkBC,qBAAOC,MAC7BD,qBAAOE,OAAO;EAAEC,MAAMH,qBAAOI,QAAQ,OAAA;EAAUC,MAAML,qBAAOM;AAAO,CAAA,GACnEN,qBAAOE,OAAO;EAAEC,MAAMH,qBAAOI,QAAQ,OAAA;EAAUG,UAAUP,qBAAOQ;AAAI,CAAA,CAAA;;UAGrDC,mBAAAA;AACf,QAAMC,oBAAoB,GAAGC,uCAAAA;EAEtB,MAAMC,kCAAkCZ,qBAAOa,YAAW,EAC/D,GAAGH,iBAAAA,iCACH;IACEI,OAAOd,qBAAOE,OAAO;MACnBa,OAAOC;MACPC,UAAUlB;MACVmB,SAASlB,qBAAOmB,SAASnB,qBAAOoB,OAAO;;MAEvCC,YAAYrB,qBAAOmB,SAASnB,qBAAOM,MAAM;MACzCQ,OAAOd,qBAAOmB,SAASnB,qBAAOsB,OAAO;QAAEC,KAAKvB,qBAAOM;QAAQkB,OAAOxB,qBAAOQ;MAAI,CAAA,CAAA;IAC/E,CAAA;IACAiB,QAAQzB,qBAAO0B;EACjB,CAAA,EAAA;EACC;oBAbUd,4BAAAA;AAcf,GAjBiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
6
+ "names": ["TriggerTemplate", "Schema", "Union", "Struct", "type", "Literal", "cron", "String", "queueDXN", "Any", "AutomationAction", "AUTOMATION_ACTION", "AUTOMATION_PLUGIN", "CreateTriggerFromTemplate", "TaggedClass", "input", "space", "SpaceSchema", "template", "enabled", "optional", "Boolean", "scriptName", "Record", "key", "value", "output", "Void"]
7
+ }
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_GLXGAIZC_exports = {};
30
+ __export(chunk_GLXGAIZC_exports, {
31
+ FunctionsPanel: () => FunctionsPanel,
32
+ FunctionsPanel_default: () => FunctionsPanel_default
33
+ });
34
+ module.exports = __toCommonJS(chunk_GLXGAIZC_exports);
35
+ var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
36
+ var import_effect = require("effect");
37
+ var import_react = __toESM(require("react"));
38
+ var import_app_framework = require("@dxos/app-framework");
39
+ var import_functions = require("@dxos/functions");
40
+ var import_echo = require("@dxos/react-client/echo");
41
+ var import_react_ui = require("@dxos/react-ui");
42
+ var import_react_ui_form = require("@dxos/react-ui-form");
43
+ var import_react_ui_list = require("@dxos/react-ui-list");
44
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
45
+ var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
46
+ var FunctionsPanel = ({ space }) => {
47
+ const { t } = (0, import_react_ui.useTranslation)(import_chunk_7GXNXMSM.AUTOMATION_PLUGIN);
48
+ const functions = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_functions.FunctionType));
49
+ const scripts = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_functions.ScriptType));
50
+ const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
51
+ const functionToScriptMap = (0, import_react.useMemo)(() => functions.reduce((map, func) => {
52
+ const scriptId = func.source?.target?.id;
53
+ if (scriptId) {
54
+ const script = scripts.find((s) => s.id === scriptId);
55
+ if (script) {
56
+ map[func.id] = script;
57
+ }
58
+ }
59
+ return map;
60
+ }, {}), [
61
+ functions,
62
+ scripts
63
+ ]);
64
+ const getScriptName = (0, import_react.useCallback)((func) => {
65
+ const script = functionToScriptMap[func.id];
66
+ return script?.name;
67
+ }, [
68
+ functionToScriptMap
69
+ ]);
70
+ const handleGoToScript = (0, import_react.useCallback)((func) => {
71
+ const script = functionToScriptMap[func.id];
72
+ if (script) {
73
+ void dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.Open, {
74
+ part: "main",
75
+ subject: [
76
+ (0, import_echo.fullyQualifiedId)(script)
77
+ ]
78
+ }));
79
+ }
80
+ }, [
81
+ functionToScriptMap,
82
+ dispatch
83
+ ]);
84
+ return /* @__PURE__ */ import_react.default.createElement("div", {
85
+ role: "none",
86
+ className: (0, import_react_ui_theme.mx)(import_react_ui_form.controlItemClasses)
87
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.Root, {
88
+ items: functions,
89
+ isItem: import_effect.Schema.is(import_functions.FunctionType),
90
+ getId: (func) => func.id
91
+ }, ({ items }) => /* @__PURE__ */ import_react.default.createElement("div", {
92
+ role: "list",
93
+ className: "flex flex-col w-full"
94
+ }, items?.map((func) => /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.Item, {
95
+ key: func.id,
96
+ item: func,
97
+ classNames: (0, import_react_ui_theme.mx)(grid, import_react_ui_theme.ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
98
+ }, /* @__PURE__ */ import_react.default.createElement("div", {
99
+ className: "flex flex-col truncate"
100
+ }, /* @__PURE__ */ import_react.default.createElement(import_react_ui_list.List.ItemTitle, {
101
+ classNames: "truncate"
102
+ }, func.name), getScriptName(func) && /* @__PURE__ */ import_react.default.createElement("div", {
103
+ className: "text-xs text-description truncate"
104
+ }, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ import_react.default.createElement(import_react_ui.Button, {
105
+ onClick: () => handleGoToScript(func)
106
+ }, t("go to function source button label")))))), functions.length === 0 && /* @__PURE__ */ import_react.default.createElement("div", {
107
+ className: "text-center plb-4 text-gray-500"
108
+ }, t("no functions found")));
109
+ };
110
+ var FunctionsPanel_default = FunctionsPanel;
111
+ // Annotate the CommonJS export names for ESM import in node:
112
+ 0 && (module.exports = {
113
+ FunctionsPanel,
114
+ FunctionsPanel_default
115
+ });
116
+ //# sourceMappingURL=chunk-GLXGAIZC.cjs.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 { Schema } from 'effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { FunctionType, ScriptType } from '@dxos/functions';\nimport { Filter, fullyQualifiedId, useQuery, type Space } from '@dxos/react-client/echo';\nimport { Button, 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 { AUTOMATION_PLUGIN } 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(AUTOMATION_PLUGIN);\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(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 return (\n <div role='none' className={mx(controlItemClasses)}>\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 </List.Item>\n ))}\n </div>\n )}\n </List.Root>\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,oBAAuB;AACvB,mBAA4C;AAE5C,2BAAgE;AAChE,uBAAyC;AACzC,kBAA+D;AAC/D,sBAAuC;AACvC,2BAAmC;AACnC,2BAAqB;AACrB,4BAA+B;AAI/B,IAAMA,OAAO;AAMN,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;AAC3D,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,uCAAAA;AAC7B,QAAMC,gBAAYC,sBAASL,OAAOM,mBAAOC,OAAOC,6BAAAA,CAAAA;AAChD,QAAMC,cAAUJ,sBAASL,OAAOM,mBAAOC,OAAOG,2BAAAA,CAAAA;AAC9C,QAAM,EAAEC,iBAAiBC,SAAQ,QAAKC,0CAAAA;AAEtC,QAAMC,0BAAsBC,sBAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,UAAMC,WAAWD,KAAKE,QAAQC,QAAQC;AACtC,QAAIH,UAAU;AACZ,YAAMI,SAASd,QAAQe,KAAK,CAACC,MAAMA,EAAEH,OAAOH,QAAAA;AAC5C,UAAII,QAAQ;AACVN,YAAIC,KAAKI,EAAE,IAAIC;MACjB;IACF;AACA,WAAON;EACT,GACA,CAAC,CAAA,GAEL;IAACb;IAAWK;GAAQ;AAGtB,QAAMiB,oBAAgBC,0BACpB,CAACT,SAAAA;AACC,UAAMK,SAAST,oBAAoBI,KAAKI,EAAE;AAC1C,WAAOC,QAAQK;EACjB,GACA;IAACd;GAAoB;AAGvB,QAAMe,uBAAmBF,0BACvB,CAACT,SAAAA;AACC,UAAMK,SAAST,oBAAoBI,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MATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "FunctionType", "scripts", "ScriptType", "dispatchPromise", "dispatch", "useIntentDispatcher", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "id", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "createIntent", "LayoutAction", "Open", "part", "subject", "fullyQualifiedId", "React", "div", "role", "className", "mx", "controlItemClasses", "List", "Root", "items", "isItem", "Schema", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "length"]
7
+ }
@@ -26,15 +26,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_AGJ6XTDN_exports = {};
30
- __export(chunk_AGJ6XTDN_exports, {
31
- AutomationPanel: () => AutomationPanel
29
+ var chunk_HZTVNN4S_exports = {};
30
+ __export(chunk_HZTVNN4S_exports, {
31
+ AutomationContainer: () => AutomationContainer,
32
+ AutomationPanel: () => AutomationPanel,
33
+ FunctionsContainer: () => FunctionsContainer,
34
+ FunctionsPanel: () => FunctionsPanel
32
35
  });
33
- module.exports = __toCommonJS(chunk_AGJ6XTDN_exports);
36
+ module.exports = __toCommonJS(chunk_HZTVNN4S_exports);
34
37
  var import_react = require("react");
35
- var AutomationPanel = (0, import_react.lazy)(() => import("./AutomationPanel-ZKAMIU6O.cjs"));
38
+ var AutomationContainer = (0, import_react.lazy)(() => import("./AutomationContainer-RIDHNHPT.cjs"));
39
+ var AutomationPanel = (0, import_react.lazy)(() => import("./AutomationPanel-6RLBWAGL.cjs"));
40
+ var FunctionsContainer = (0, import_react.lazy)(() => import("./FunctionsContainer-RNZTNQEU.cjs"));
41
+ var FunctionsPanel = (0, import_react.lazy)(() => import("./FunctionsPanel-7I7YCHPJ.cjs"));
36
42
  // Annotate the CommonJS export names for ESM import in node:
37
43
  0 && (module.exports = {
38
- AutomationPanel
44
+ AutomationContainer,
45
+ AutomationPanel,
46
+ FunctionsContainer,
47
+ FunctionsPanel
39
48
  });
40
- //# sourceMappingURL=chunk-AGJ6XTDN.cjs.map
49
+ //# sourceMappingURL=chunk-HZTVNN4S.cjs.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 AutomationContainer = lazy(() => import('./AutomationContainer'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\nexport const FunctionsContainer = lazy(() => import('./FunctionsContainer'));\nexport const FunctionsPanel = lazy(() => import('./FunctionsPanel'));\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqB;AAId,IAAMA,0BAAsBC,mBAAK,MAAM,OAAO,oCAAA,CAAA;AAC9C,IAAMC,sBAAkBD,mBAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAME,yBAAqBF,mBAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAMG,qBAAiBH,mBAAK,MAAM,OAAO,+BAAA,CAAA;",
6
+ "names": ["AutomationContainer", "lazy", "AutomationPanel", "FunctionsContainer", "FunctionsPanel"]
7
+ }
@@ -29,22 +29,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var node_exports = {};
30
30
  __export(node_exports, {
31
31
  AUTOMATION_PLUGIN: () => import_chunk_7GXNXMSM.AUTOMATION_PLUGIN,
32
- AutomationPanel: () => import_chunk_AGJ6XTDN.AutomationPanel,
32
+ AutomationContainer: () => import_chunk_HZTVNN4S.AutomationContainer,
33
+ AutomationPanel: () => import_chunk_HZTVNN4S.AutomationPanel,
33
34
  AutomationPlugin: () => AutomationPlugin,
34
- TriggerEditor: () => import_chunk_FTEDH5Q6.TriggerEditor,
35
+ FunctionsContainer: () => import_chunk_HZTVNN4S.FunctionsContainer,
36
+ FunctionsPanel: () => import_chunk_HZTVNN4S.FunctionsPanel,
37
+ TriggerEditor: () => import_chunk_ESVJ2X6U.TriggerEditor,
35
38
  meta: () => import_chunk_7GXNXMSM.meta
36
39
  });
37
40
  module.exports = __toCommonJS(node_exports);
38
- var import_chunk_AGJ6XTDN = require("./chunk-AGJ6XTDN.cjs");
39
- var import_chunk_FTEDH5Q6 = require("./chunk-FTEDH5Q6.cjs");
41
+ var import_chunk_HZTVNN4S = require("./chunk-HZTVNN4S.cjs");
42
+ var import_chunk_ESVJ2X6U = require("./chunk-ESVJ2X6U.cjs");
40
43
  var import_chunk_7GXNXMSM = require("./chunk-7GXNXMSM.cjs");
41
44
  var import_app_framework = require("@dxos/app-framework");
42
- var import_types = require("@dxos/functions/types");
45
+ var import_functions = require("@dxos/functions");
43
46
  var import_plugin_client = require("@dxos/plugin-client");
44
- var import_plugin_space = require("@dxos/plugin-space");
45
47
  var import_app_framework2 = require("@dxos/app-framework");
46
- var AppGraphBuilder = (0, import_app_framework2.lazy)(() => import("./app-graph-builder-HO4FPGZ5.cjs"));
47
- var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-52M54VWV.cjs"));
48
+ var AppGraphBuilder = (0, import_app_framework2.lazy)(() => import("./app-graph-builder-TVFR6RXO.cjs"));
49
+ var IntentResolver = (0, import_app_framework2.lazy)(() => import("./intent-resolver-6FJ6PJJI.cjs"));
50
+ var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-UJDYSHZ5.cjs"));
48
51
  var translations_default = [
49
52
  {
50
53
  "en-US": {
@@ -52,7 +55,15 @@ var translations_default = [
52
55
  "plugin name": "Automation",
53
56
  "automation panel label": "Automations",
54
57
  "script automation label": "Automation",
55
- "trigger editor title": "New Trigger",
58
+ "automation verbose label": "Manage automations",
59
+ "automation description": "You can manage all the triggers which automate your space here.",
60
+ "functions panel label": "Functions",
61
+ "functions verbose label": "Manage deployed functions",
62
+ "functions description": "You can manage all the functions deployed from your space on EDGE here.",
63
+ "function copy id": "Copy Function ID",
64
+ "no functions found": "No functions found",
65
+ "go to function source button label": "Show function source",
66
+ "trigger editor title": "Configure Trigger",
56
67
  "new trigger label": "Add Trigger",
57
68
  "trigger type timer": "Timer",
58
69
  "trigger type webhook": "Webhook",
@@ -79,8 +90,8 @@ var AutomationPlugin = () => (0, import_app_framework.definePlugin)(import_chunk
79
90
  id: `${import_chunk_7GXNXMSM.meta.id}/module/schema`,
80
91
  activatesOn: import_plugin_client.ClientEvents.SetupSchema,
81
92
  activate: () => (0, import_app_framework.contributes)(import_plugin_client.ClientCapabilities.Schema, [
82
- import_types.FunctionType,
83
- import_types.FunctionTrigger
93
+ import_functions.FunctionType,
94
+ import_functions.FunctionTrigger
84
95
  ])
85
96
  }),
86
97
  (0, import_app_framework.defineModule)({
@@ -89,17 +100,9 @@ var AutomationPlugin = () => (0, import_app_framework.definePlugin)(import_chunk
89
100
  activate: AppGraphBuilder
90
101
  }),
91
102
  (0, import_app_framework.defineModule)({
92
- id: `${import_chunk_7GXNXMSM.meta.id}/module/space-settings`,
93
- activatesOn: import_plugin_space.SpaceEvents.SetupSettingsPanel,
94
- activate: () => (0, import_app_framework.contributes)(import_plugin_space.SpaceCapabilities.SettingsSection, {
95
- id: "automation",
96
- label: [
97
- "automation panel label",
98
- {
99
- ns: import_chunk_7GXNXMSM.meta.id
100
- }
101
- ]
102
- })
103
+ id: `${import_chunk_7GXNXMSM.meta.id}/module/intent-resolver`,
104
+ activatesOn: import_app_framework.Events.SetupIntentResolver,
105
+ activate: IntentResolver
103
106
  }),
104
107
  (0, import_app_framework.defineModule)({
105
108
  id: `${import_chunk_7GXNXMSM.meta.id}/module/react-surface`,
@@ -110,8 +113,11 @@ var AutomationPlugin = () => (0, import_app_framework.definePlugin)(import_chunk
110
113
  // Annotate the CommonJS export names for ESM import in node:
111
114
  0 && (module.exports = {
112
115
  AUTOMATION_PLUGIN,
116
+ AutomationContainer,
113
117
  AutomationPanel,
114
118
  AutomationPlugin,
119
+ FunctionsContainer,
120
+ FunctionsPanel,
115
121
  TriggerEditor,
116
122
  meta
117
123
  });