@dxos/plugin-automation 0.8.4-main.dedc0f3 → 0.8.4-main.e8ec1fe

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 (189) hide show
  1. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +68 -0
  3. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +7 -0
  4. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +151 -0
  5. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs → FunctionsPanel-CRW6SJUN.mjs} +3 -3
  7. package/dist/lib/browser/{app-graph-builder-4OFKIRAI.mjs → app-graph-builder-W7LLC6XW.mjs} +12 -11
  8. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-EPEXQP45.mjs +14 -0
  10. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-S4SM663I.mjs → chunk-JW7XSPYW.mjs} +59 -22
  12. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-LZQFZO3B.mjs +17 -0
  14. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-NAPXRXTY.mjs +100 -0
  16. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +7 -0
  17. package/dist/lib/browser/{chunk-4TWQV33E.mjs → chunk-QKFBHAGN.mjs} +66 -25
  18. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-Z5DT4MHW.mjs → chunk-TWWFNOIR.mjs} +30 -15
  20. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +15 -0
  22. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +7 -0
  23. package/dist/lib/browser/{chunk-HN7OHFCB.mjs → chunk-YBPJCY3F.mjs} +3 -3
  24. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +7 -0
  25. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +113 -0
  26. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +7 -0
  27. package/dist/lib/browser/hooks/index.mjs +13 -0
  28. package/dist/lib/browser/index.mjs +47 -18
  29. package/dist/lib/browser/index.mjs.map +4 -4
  30. package/dist/lib/browser/{intent-resolver-4PSYSQQG.mjs → intent-resolver-5HR7M7T6.mjs} +10 -10
  31. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +7 -0
  32. package/dist/lib/browser/meta.json +1 -1
  33. package/dist/lib/browser/{react-surface-M52XGLXY.mjs → react-surface-YQW7WCFW.mjs} +20 -20
  34. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +7 -0
  35. package/dist/lib/browser/types/index.mjs +2 -2
  36. package/dist/lib/node-esm/{AutomationPanel-MKOLA2FE.mjs → AutomationPanel-HCVFNHGQ.mjs} +4 -4
  37. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +69 -0
  38. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +7 -0
  39. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +152 -0
  40. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +7 -0
  41. package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.mjs → FunctionsPanel-RVVCS6VH.mjs} +3 -3
  42. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs.map +7 -0
  43. package/dist/lib/node-esm/{app-graph-builder-555IHYOB.mjs → app-graph-builder-SLQOO7GH.mjs} +12 -11
  44. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +7 -0
  45. package/dist/lib/node-esm/{chunk-AONUBWBE.mjs → chunk-6YRKST6M.mjs} +66 -25
  46. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +19 -0
  48. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +7 -0
  49. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +16 -0
  50. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +7 -0
  51. package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs → chunk-ECJKIUBO.mjs} +3 -3
  52. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +16 -0
  54. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +7 -0
  55. package/dist/lib/node-esm/chunk-PICJ2REN.mjs +101 -0
  56. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-CX2AILIS.mjs → chunk-RVK52XGK.mjs} +30 -15
  58. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-ZOJVKPCA.mjs → chunk-W76WUTZY.mjs} +59 -22
  60. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +7 -0
  61. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +114 -0
  62. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +7 -0
  63. package/dist/lib/node-esm/hooks/index.mjs +14 -0
  64. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  65. package/dist/lib/node-esm/index.mjs +47 -18
  66. package/dist/lib/node-esm/index.mjs.map +4 -4
  67. package/dist/lib/node-esm/{intent-resolver-6ZGBUILG.mjs → intent-resolver-KDRYB5BC.mjs} +10 -10
  68. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +7 -0
  69. package/dist/lib/node-esm/meta.json +1 -1
  70. package/dist/lib/node-esm/{react-surface-Y6AOXM75.mjs → react-surface-NNHYNBO6.mjs} +20 -20
  71. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +7 -0
  72. package/dist/lib/node-esm/types/index.mjs +2 -2
  73. package/dist/types/src/AutomationPlugin.d.ts +1 -1
  74. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  76. package/dist/types/src/capabilities/capabilities.d.ts +20 -0
  77. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  78. package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
  79. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/index.d.ts +2 -0
  81. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  83. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +2 -2
  84. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  85. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +5 -1
  86. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  87. package/dist/types/src/components/AutomationSettings.d.ts +5 -0
  88. package/dist/types/src/components/AutomationSettings.d.ts.map +1 -0
  89. package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
  90. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  91. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  92. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  93. package/dist/types/src/components/FunctionsRegistry/index.d.ts +2 -0
  94. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  95. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +2 -2
  96. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  97. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  98. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -5
  99. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  100. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +9 -4
  101. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  102. package/dist/types/src/components/TriggerSettings.d.ts +6 -0
  103. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -0
  104. package/dist/types/src/components/index.d.ts +1 -1
  105. package/dist/types/src/components/index.d.ts.map +1 -1
  106. package/dist/types/src/events.d.ts +4 -0
  107. package/dist/types/src/events.d.ts.map +1 -0
  108. package/dist/types/src/hooks/index.d.ts +3 -0
  109. package/dist/types/src/hooks/index.d.ts.map +1 -0
  110. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +12 -0
  111. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  112. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +11 -0
  113. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  114. package/dist/types/src/index.d.ts +3 -0
  115. package/dist/types/src/index.d.ts.map +1 -1
  116. package/dist/types/src/meta.d.ts +0 -1
  117. package/dist/types/src/meta.d.ts.map +1 -1
  118. package/dist/types/src/translations.d.ts +5 -0
  119. package/dist/types/src/translations.d.ts.map +1 -1
  120. package/dist/types/src/types/schema.d.ts +1 -1
  121. package/dist/types/src/types/schema.d.ts.map +1 -1
  122. package/dist/types/tsconfig.tsbuildinfo +1 -1
  123. package/package.json +61 -38
  124. package/src/AutomationPlugin.tsx +36 -30
  125. package/src/capabilities/app-graph-builder.ts +14 -13
  126. package/src/capabilities/capabilities.ts +41 -0
  127. package/src/capabilities/compute-runtime.ts +127 -0
  128. package/src/capabilities/index.ts +3 -0
  129. package/src/capabilities/intent-resolver.ts +5 -5
  130. package/src/capabilities/react-surface.tsx +15 -15
  131. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +7 -11
  132. package/src/components/AutomationPanel/AutomationPanel.tsx +97 -33
  133. package/src/components/{AutomationContainer.tsx → AutomationSettings.tsx} +8 -6
  134. package/src/components/FunctionsContainer.tsx +11 -4
  135. package/src/components/FunctionsPanel/FunctionsPanel.tsx +35 -16
  136. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +135 -0
  137. package/src/components/FunctionsRegistry/index.ts +5 -0
  138. package/src/components/TriggerEditor/FunctionInputEditor.tsx +10 -4
  139. package/src/components/TriggerEditor/SpecSelector.tsx +14 -8
  140. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +62 -22
  141. package/src/components/TriggerEditor/TriggerEditor.tsx +44 -18
  142. package/src/components/TriggerSettings.tsx +25 -0
  143. package/src/components/index.ts +1 -1
  144. package/src/events.ts +11 -0
  145. package/src/hooks/index.ts +6 -0
  146. package/src/hooks/useComputeRuntimeCallback.ts +68 -0
  147. package/src/hooks/useTriggerRuntimeControls.ts +53 -0
  148. package/src/index.ts +3 -0
  149. package/src/meta.ts +6 -5
  150. package/src/testing/test-functions.ts +1 -1
  151. package/src/translations.ts +7 -0
  152. package/src/types/schema.ts +1 -1
  153. package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs +0 -35
  154. package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs.map +0 -7
  155. package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
  156. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs +0 -36
  157. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
  158. package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
  159. package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
  160. package/dist/lib/browser/chunk-EIY2EUWC.mjs +0 -14
  161. package/dist/lib/browser/chunk-EIY2EUWC.mjs.map +0 -7
  162. package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
  163. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  164. package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
  165. package/dist/lib/browser/chunk-S4SM663I.mjs.map +0 -7
  166. package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
  167. package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs.map +0 -7
  168. package/dist/lib/browser/react-surface-M52XGLXY.mjs.map +0 -7
  169. package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs +0 -36
  170. package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs.map +0 -7
  171. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs +0 -37
  172. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
  173. package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
  174. package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
  175. package/dist/lib/node-esm/chunk-CICQ73ZT.mjs +0 -16
  176. package/dist/lib/node-esm/chunk-CICQ73ZT.mjs.map +0 -7
  177. package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
  178. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
  179. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  180. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
  181. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +0 -7
  182. package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs.map +0 -7
  183. package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs.map +0 -7
  184. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  185. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  186. /package/dist/lib/browser/{AutomationPanel-N5HFJJXW.mjs.map → AutomationPanel-7OECLR5N.mjs.map} +0 -0
  187. /package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs.map → FunctionsPanel-CRW6SJUN.mjs.map} +0 -0
  188. /package/dist/lib/{node-esm/AutomationPanel-MKOLA2FE.mjs.map → browser/hooks/index.mjs.map} +0 -0
  189. /package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.mjs.map → AutomationPanel-HCVFNHGQ.mjs.map} +0 -0
@@ -2,33 +2,56 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
- import React, { useEffect, useState } from 'react';
6
+ import React, { useState } from 'react';
9
7
 
10
- import { Obj } from '@dxos/echo';
11
- import { FunctionTrigger, FunctionType } from '@dxos/functions';
8
+ import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
+ import { Function } from '@dxos/functions';
10
+ import { Trigger } from '@dxos/functions';
11
+ import { invariant } from '@dxos/invariant';
12
12
  import { faker } from '@dxos/random';
13
- import { useSpaces } from '@dxos/react-client/echo';
14
- import { ContactType, withClientProvider } from '@dxos/react-client/testing';
15
- import { withLayout, withTheme } from '@dxos/storybook-utils';
13
+ import { useQuery } from '@dxos/react-client/echo';
14
+ import { ContactType, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
15
+ import { useAsyncEffect } from '@dxos/react-ui';
16
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
+ import { Employer, Organization, Person, Project } from '@dxos/types';
16
18
 
17
19
  import { functions } from '../../testing';
18
20
  import { translations } from '../../translations';
19
21
 
20
- import { TriggerEditor } from './TriggerEditor';
22
+ import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
23
+
24
+ const types = [
25
+ // TODO(burdon): Get label from annotation.
26
+ { value: Organization.Organization.typename, label: 'Organization' },
27
+ { value: Person.Person.typename, label: 'Person' },
28
+ { value: Type.getTypename(Project.Project), label: 'Project' },
29
+ { value: Employer.Employer.typename, label: 'Employer' },
30
+ ];
31
+
32
+ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
33
+ const { space } = useClientProvider();
34
+ const [trigger, setTrigger] = useState<Trigger.Trigger>();
35
+ const tags = useQuery(space, Filter.type(Tag.Tag));
21
36
 
22
- const DefaultStory = () => {
23
- const spaces = useSpaces();
24
- const space = spaces[1];
25
- const [trigger, setTrigger] = useState<FunctionTrigger>();
26
- useEffect(() => {
37
+ useAsyncEffect(async () => {
27
38
  if (!space) {
28
39
  return;
29
40
  }
30
41
 
31
- const trigger = space.db.add(Obj.make(FunctionTrigger, { spec: { kind: 'timer', cron: '' } }));
42
+ const result = await space.db.query(Filter.type(Function.Function)).run();
43
+ const fn = result.objects.find((fn) => fn.name === 'example.com/function/forex');
44
+ invariant(fn);
45
+ const trigger = space.db.add(
46
+ Trigger.make({
47
+ function: Ref.make(fn),
48
+ spec: { kind: 'webhook' },
49
+ input: {
50
+ from: 'USD',
51
+ to: 'JPY',
52
+ },
53
+ }),
54
+ );
32
55
  setTrigger(trigger);
33
56
  }, [space]);
34
57
 
@@ -37,8 +60,15 @@ const DefaultStory = () => {
37
60
  }
38
61
 
39
62
  return (
40
- <div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
41
- <TriggerEditor space={space} trigger={trigger} onSave={(values) => console.log('on save', values)} />
63
+ <div role='none' className='is-[32rem] bs-fit border border-separator rounded-sm'>
64
+ <TriggerEditor
65
+ space={space}
66
+ trigger={trigger}
67
+ types={types}
68
+ tags={tags}
69
+ onSave={(values) => console.log('on save', values)}
70
+ {...props}
71
+ />
42
72
  </div>
43
73
  );
44
74
  };
@@ -48,13 +78,19 @@ const meta = {
48
78
  component: TriggerEditor as any,
49
79
  render: DefaultStory,
50
80
  decorators: [
81
+ withTheme,
82
+ withLayout({ container: 'column' }),
51
83
  withClientProvider({
52
84
  createIdentity: true,
53
85
  createSpace: true,
54
- types: [FunctionType, FunctionTrigger, ContactType],
55
- onSpaceCreated: ({ space }) => {
86
+ types: [Tag.Tag, Function.Function, Trigger.Trigger, ContactType],
87
+ onCreateSpace: ({ space }) => {
88
+ space.db.add(Tag.make({ label: 'Important' }));
89
+ space.db.add(Tag.make({ label: 'Investor' }));
90
+ space.db.add(Tag.make({ label: 'New' }));
91
+
56
92
  for (const fn of functions) {
57
- space.db.add(Obj.make(FunctionType, fn));
93
+ space.db.add(Function.make(fn));
58
94
  }
59
95
  Array.from({ length: 10 }).map(() => {
60
96
  return space.db.add(
@@ -66,8 +102,6 @@ const meta = {
66
102
  });
67
103
  },
68
104
  }),
69
- withLayout({ fullscreen: true, classNames: 'flex justify-center m-2' }),
70
- withTheme,
71
105
  ],
72
106
  parameters: {
73
107
  translations,
@@ -79,3 +113,9 @@ export default meta;
79
113
  type Story = StoryObj<typeof meta>;
80
114
 
81
115
  export const Default: Story = {};
116
+
117
+ export const ReadonlySpec: Story = {
118
+ args: {
119
+ readonlySpec: true,
120
+ },
121
+ };
@@ -5,34 +5,38 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
- import { Type } from '@dxos/echo';
9
- import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
8
+ import { type Query, Type } from '@dxos/echo';
9
+ import { Function, Script, Trigger } from '@dxos/functions';
10
10
  import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
11
- import { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
11
+ import { Input } from '@dxos/react-ui';
12
+ import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
13
+ import { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
12
14
 
13
15
  import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
14
16
  import { SpecSelector } from './SpecSelector';
15
17
 
16
18
  export type TriggerEditorProps = {
17
19
  space: Space;
18
- trigger: FunctionTrigger;
19
- onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;
20
+ trigger: Trigger.Trigger;
21
+ // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
22
+ readonlySpec?: boolean;
23
+ onSave?: (trigger: Omit<Trigger.Trigger, 'id'>) => void;
20
24
  onCancel?: () => void;
21
- };
25
+ } & Pick<QueryFormProps, 'types' | 'tags'>;
22
26
 
23
- export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {
24
- const handleSave = (values: FunctionTrigger) => {
27
+ export const TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }: TriggerEditorProps) => {
28
+ const handleSave = ({ id: _, ...values }: Trigger.Trigger) => {
25
29
  onSave?.(values);
26
30
  };
27
31
 
28
32
  const handleRefQueryLookup = useRefQueryLookupHandler({ space });
29
- const Custom = useCustomInputs(space, handleRefQueryLookup);
33
+ const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
30
34
 
31
35
  return (
32
36
  <Form
33
37
  outerSpacing={false}
34
38
  Custom={Custom}
35
- schema={FunctionTrigger}
39
+ schema={Trigger.Trigger}
36
40
  values={trigger}
37
41
  onSave={handleSave}
38
42
  onCancel={onCancel}
@@ -41,15 +45,21 @@ export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEdito
41
45
  );
42
46
  };
43
47
 
44
- const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions']) => {
45
- const functions = useQuery(space, Filter.type(FunctionType));
48
+ type UseCustomInputsProps = {
49
+ space: Space;
50
+ readonlySpec?: boolean;
51
+ onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
52
+ } & Pick<QueryFormProps, 'types' | 'tags'>;
53
+
54
+ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }: UseCustomInputsProps) => {
55
+ const functions = useQuery(space, Filter.type(Function.Function));
46
56
  const workflows = useQuery(space, Filter.type(ComputeGraph));
47
- const scripts = useQuery(space, Filter.type(ScriptType));
57
+ const scripts = useQuery(space, Filter.type(Script.Script));
48
58
 
49
59
  return useMemo(
50
60
  (): CustomInputMap => ({
51
61
  // Function selector.
52
- ['function' satisfies keyof FunctionTrigger]: (props) => {
62
+ ['function' satisfies keyof Trigger.Trigger]: (props) => {
53
63
  const getValue = useCallback(() => {
54
64
  const formValue = props.getValue();
55
65
  if (Ref.isRef(formValue)) {
@@ -80,14 +90,30 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
80
90
  },
81
91
 
82
92
  // Spec selector.
83
- ['spec.kind' as const]: SpecSelector,
93
+ ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
94
+
95
+ // TODO(wittjosiah): Copied from ViewEditor.
96
+ // Query input editor.
97
+ ['spec.query' as const]: (props) => {
98
+ const handleChange = useCallback(
99
+ (query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
100
+ [props.onValueChange],
101
+ );
102
+
103
+ return (
104
+ <Input.Root>
105
+ <InputHeader label={props.label} />
106
+ <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
107
+ </Input.Root>
108
+ );
109
+ },
84
110
 
85
111
  // Function input editor.
86
112
  ['input' as const]: (props) => (
87
113
  <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
88
114
  ),
89
115
  }),
90
- [workflows, scripts, functions],
116
+ [workflows, scripts, functions, readonlySpec],
91
117
  );
92
118
  };
93
119
 
@@ -95,7 +121,7 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
95
121
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
96
122
  };
97
123
 
98
- const getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {
99
- const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
124
+ const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
125
+ const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
100
126
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
101
127
  };
@@ -0,0 +1,25 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type Space } from '@dxos/react-client/echo';
8
+ import { Input, useTranslation } from '@dxos/react-ui';
9
+ import { ControlItemInput } from '@dxos/react-ui-form';
10
+
11
+ import { useTriggerRuntimeControls } from '../hooks';
12
+ import { meta } from '../meta';
13
+
14
+ export const TriggersSettings = ({ space }: { space: Space }) => {
15
+ const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
16
+ const { t } = useTranslation(meta.id);
17
+
18
+ return (
19
+ <div className='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
20
+ <ControlItemInput title={t('runtime label')} description={t('runtime description')}>
21
+ <Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />
22
+ </ControlItemInput>
23
+ </div>
24
+ );
25
+ };
@@ -6,7 +6,7 @@ import { lazy } from 'react';
6
6
 
7
7
  export * from './TriggerEditor';
8
8
 
9
- export const AutomationContainer = lazy(() => import('./AutomationContainer'));
10
9
  export const AutomationPanel = lazy(() => import('./AutomationPanel'));
10
+ export const AutomationSettings = lazy(() => import('./AutomationSettings'));
11
11
  export const FunctionsContainer = lazy(() => import('./FunctionsContainer'));
12
12
  export const FunctionsPanel = lazy(() => import('./FunctionsPanel'));
package/src/events.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { defineEvent } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export namespace AutomationEvents {
10
+ export const ComputeRuntimeReady = defineEvent(`${meta.id}/event/compute-runtime-ready`);
11
+ }
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './useComputeRuntimeCallback';
6
+ export * from './useTriggerRuntimeControls';
@@ -0,0 +1,68 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Cause from 'effect/Cause';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Exit from 'effect/Exit';
8
+ import { useCallback } from 'react';
9
+
10
+ import { useCapability } from '@dxos/app-framework/react';
11
+ import { type FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
12
+ import { InvocationTracer, TracingServiceExt } from '@dxos/functions-runtime';
13
+ import { log } from '@dxos/log';
14
+ import type { Space } from '@dxos/react-client/echo';
15
+
16
+ import { AutomationCapabilities } from '../capabilities';
17
+
18
+ /**
19
+ * Create an effectful function that has access to compute services
20
+ */
21
+ // TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
22
+ export const useComputeRuntimeCallback = <T>(
23
+ space: Space | undefined,
24
+ fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
25
+ deps?: React.DependencyList,
26
+ ): (() => Promise<T>) => {
27
+ const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
28
+ const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;
29
+
30
+ return useCallback(() => {
31
+ if (!runtime) {
32
+ throw new TypeError('Space not provided to useComputeRuntimeCallback');
33
+ }
34
+
35
+ return runtime.runPromise(fn());
36
+ }, [runtime, ...(deps ?? [])]);
37
+ };
38
+
39
+ // TODO(wittjosiah): Function invoking should automatically be traced (DX-647).
40
+ export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>
41
+ Effect.gen(function* () {
42
+ const tracer = yield* InvocationTracer;
43
+ const trace = yield* tracer.traceInvocationStart({
44
+ target: undefined,
45
+ payload: {
46
+ data: {},
47
+ },
48
+ });
49
+
50
+ // Invoke the function.
51
+ const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(
52
+ Effect.provide(TracingServiceExt.layerQueue(trace.invocationTraceQueue)),
53
+ Effect.exit,
54
+ );
55
+
56
+ if (Exit.isFailure(result)) {
57
+ const error = Cause.prettyErrors(result.cause)[0];
58
+ log.error(error.message, error.cause ?? error.stack);
59
+ }
60
+
61
+ yield* tracer.traceInvocationEnd({
62
+ trace,
63
+ // TODO(dmaretskyi): Might miss errors.
64
+ exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
65
+ });
66
+
67
+ return result;
68
+ });
@@ -0,0 +1,53 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Filter } from '@dxos/echo';
8
+ import { Trigger } from '@dxos/functions';
9
+ import { TriggerDispatcher } from '@dxos/functions-runtime';
10
+ import { type Space, useQuery } from '@dxos/react-client/echo';
11
+ import { useAsyncState } from '@dxos/react-ui';
12
+
13
+ import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
14
+
15
+ interface TriggerRuntimeControls {
16
+ triggers: Trigger.Trigger[];
17
+ isRunning: boolean;
18
+ start: () => void;
19
+ stop: () => void;
20
+ }
21
+
22
+ export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {
23
+ const triggers = useQuery(space, Filter.type(Trigger.Trigger));
24
+
25
+ const [isRunningState, setIsRunningState] = useAsyncState(
26
+ useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
27
+ );
28
+
29
+ const start = useComputeRuntimeCallback(
30
+ space,
31
+ Effect.fnUntraced(function* () {
32
+ const dispatcher = yield* TriggerDispatcher;
33
+ yield* dispatcher.start();
34
+ setIsRunningState(true);
35
+ }),
36
+ );
37
+
38
+ const stop = useComputeRuntimeCallback(
39
+ space,
40
+ Effect.fnUntraced(function* () {
41
+ const dispatcher = yield* TriggerDispatcher;
42
+ yield* dispatcher.stop();
43
+ setIsRunningState(false);
44
+ }),
45
+ );
46
+
47
+ return {
48
+ triggers,
49
+ isRunning: isRunningState ?? false,
50
+ start: () => void start(),
51
+ stop: () => void stop(),
52
+ };
53
+ };
package/src/index.ts CHANGED
@@ -2,7 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ export { AutomationCapabilities } from './capabilities';
5
6
  export * from './components';
6
7
  export * from './meta';
8
+ export * from './events';
9
+ export * from './hooks';
7
10
 
8
11
  export * from './AutomationPlugin';
package/src/meta.ts CHANGED
@@ -3,14 +3,15 @@
3
3
  //
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';
6
+ import { trim } from '@dxos/util';
8
7
 
9
8
  export const meta: PluginMeta = {
10
- id: AUTOMATION_PLUGIN,
9
+ id: 'dxos.org/plugin/automation',
11
10
  name: 'Automation',
12
- description:
13
- 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',
11
+ description: trim`
12
+ Workflow automation engine that triggers custom actions based on object events and conditions.
13
+ Create automated pipelines that respond to changes and streamline repetitive tasks.
14
+ `,
14
15
  icon: 'ph--robot--regular',
15
16
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
16
17
  };
@@ -2,7 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { ContactType } from '@dxos/client/testing';
8
8
  import { Type } from '@dxos/echo';
@@ -16,12 +16,19 @@ export const translations = [
16
16
  'automation verbose label': 'Manage automations',
17
17
  'automation description': 'You can manage all the triggers which automate your space here.',
18
18
 
19
+ 'runtime label': 'Enable Local Runtime',
20
+ 'runtime description':
21
+ 'This will start a trigger dispatcher locally for this space to run triggers on your device while Composer is running.',
22
+
19
23
  'functions panel label': 'Functions',
20
24
  'functions verbose label': 'Manage deployed functions',
25
+ 'functions registry verbose label': 'Functions registry',
26
+ 'functions registry description': 'Import functions from the registry',
21
27
  'functions description': 'You can manage all the functions deployed from your space on EDGE here.',
22
28
  'function copy id': 'Copy Function ID',
23
29
  'no functions found': 'No functions found',
24
30
  'go to function source button label': 'Show function source',
31
+ 'delete function button label': 'Delete function',
25
32
 
26
33
  'trigger editor title': 'Configure Trigger',
27
34
  'new trigger label': 'Add Trigger',
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { SpaceSchema } from '@dxos/react-client/echo';
8
8
 
@@ -1,35 +0,0 @@
1
- import {
2
- AutomationPanel
3
- } from "./chunk-4TWQV33E.mjs";
4
- import "./chunk-S4SM663I.mjs";
5
- import {
6
- AUTOMATION_PLUGIN
7
- } from "./chunk-GW5U2DGT.mjs";
8
-
9
- // src/components/AutomationContainer.tsx
10
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
11
- import React from "react";
12
- import { useTranslation } from "@dxos/react-ui";
13
- import { ControlPage, ControlSection } from "@dxos/react-ui-form";
14
- var AutomationContainer = (props) => {
15
- var _effect = _useSignals();
16
- try {
17
- const { t } = useTranslation(AUTOMATION_PLUGIN);
18
- return /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
19
- title: t("automation verbose label", {
20
- ns: AUTOMATION_PLUGIN
21
- }),
22
- description: t("automation description", {
23
- ns: AUTOMATION_PLUGIN
24
- })
25
- }, /* @__PURE__ */ React.createElement(AutomationPanel, props)));
26
- } finally {
27
- _effect.f();
28
- }
29
- };
30
- var AutomationContainer_default = AutomationContainer;
31
- export {
32
- AutomationContainer,
33
- AutomationContainer_default as default
34
- };
35
- //# sourceMappingURL=AutomationContainer-BRV5AJZ3.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/AutomationContainer.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 { AUTOMATION_PLUGIN } from '../meta';\n\nimport { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';\n\nexport const AutomationContainer = (props: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <ControlPage>\n <ControlSection\n title={t('automation verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('automation description', { ns: AUTOMATION_PLUGIN })}\n >\n <AutomationPanel {...props} />\n </ControlSection>\n </ControlPage>\n );\n};\n\nexport default AutomationContainer;\n"],
5
- "mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,sBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;AAMrC,IAAMC,sBAAsB,CAACC,UAAAA;;;AAClC,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,WACE,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAOL,EAAE,4BAA4B;QAAEM,IAAIJ;MAAkB,CAAA;MAC7DK,aAAaP,EAAE,0BAA0B;QAAEM,IAAIJ;MAAkB,CAAA;OAEjE,sBAAA,cAACM,iBAAoBT,KAAAA,CAAAA,CAAAA;;;;AAI7B;AAEA,IAAA,8BAAeD;",
6
- "names": ["React", "useTranslation", "ControlPage", "ControlSection", "AutomationContainer", "props", "t", "useTranslation", "AUTOMATION_PLUGIN", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel"]
7
- }
@@ -1,11 +0,0 @@
1
- import {
2
- AutomationPanel,
3
- AutomationPanel_default
4
- } from "./chunk-4TWQV33E.mjs";
5
- import "./chunk-S4SM663I.mjs";
6
- import "./chunk-GW5U2DGT.mjs";
7
- export {
8
- AutomationPanel,
9
- AutomationPanel_default as default
10
- };
11
- //# sourceMappingURL=AutomationPanel-N5HFJJXW.mjs.map
@@ -1,36 +0,0 @@
1
- import {
2
- FunctionsPanel
3
- } from "./chunk-Z5DT4MHW.mjs";
4
- import {
5
- AUTOMATION_PLUGIN
6
- } from "./chunk-GW5U2DGT.mjs";
7
-
8
- // src/components/FunctionsContainer.tsx
9
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
10
- import React from "react";
11
- import { useTranslation } from "@dxos/react-ui";
12
- import { ControlPage, ControlSection } from "@dxos/react-ui-form";
13
- var FunctionsContainer = ({ space }) => {
14
- var _effect = _useSignals();
15
- try {
16
- const { t } = useTranslation(AUTOMATION_PLUGIN);
17
- return /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
18
- title: t("functions verbose label", {
19
- ns: AUTOMATION_PLUGIN
20
- }),
21
- description: t("functions description", {
22
- ns: AUTOMATION_PLUGIN
23
- })
24
- }, /* @__PURE__ */ React.createElement(FunctionsPanel, {
25
- space
26
- })));
27
- } finally {
28
- _effect.f();
29
- }
30
- };
31
- var FunctionsContainer_default = FunctionsContainer;
32
- export {
33
- FunctionsContainer,
34
- FunctionsContainer_default as default
35
- };
36
- //# sourceMappingURL=FunctionsContainer-U4HASI4P.mjs.map
@@ -1,7 +0,0 @@
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 { AUTOMATION_PLUGIN } from '../meta';\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport const FunctionsContainer = ({ space }: { space: Space }) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <ControlPage>\n <ControlSection\n title={t('functions verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('functions description', { ns: AUTOMATION_PLUGIN })}\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,iBAAAA;AAC7B,WACE,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAOL,EAAE,2BAA2B;QAAEM,IAAIJ;MAAkB,CAAA;MAC5DK,aAAaP,EAAE,yBAAyB;QAAEM,IAAIJ;MAAkB,CAAA;OAEhE,sBAAA,cAACM,gBAAAA;MAAeT;;;;;AAIxB;AAEA,IAAA,6BAAeD;",
6
- "names": ["React", "useTranslation", "ControlPage", "ControlSection", "FunctionsContainer", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "ControlPage", "ControlSection", "title", "ns", "description", "FunctionsPanel"]
7
- }
@@ -1,7 +0,0 @@
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 { Option, pipe } from 'effect';\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 { SPACE_PLUGIN } 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 pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/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 pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/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 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,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAkCC,mBAAmB;AAC9D,SAASC,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,2BAA2BC,4BAA4B;AAChE,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAI7B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,cAAcG,MAAKH,EAAE;QACzBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIjB,KAAKD;YAAG;;UAChDmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,aAAaG,MAAKH,EAAE;QACxBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIjB,KAAKD;YAAG;;UAC/CmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUkB,IAAIC,WAAWC,YAAYpB,MAAKY,IAAI,IAAIP,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACjGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI;UAACG,MAAKH;UAAI;UAAcwB,KAAKC,yBAAAA;QACjCf,MAAMgB;QACNX,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIjB,KAAKD;YAAG;;UACjDmB,MAAM;UACNQ,aAAa;QACf;MACF;KACD,GACDnB,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
6
- "names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "Obj", "ScriptType", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "createExtension", "SPACE_PLUGIN", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "type", "SPACE_PLUGIN", "some", "none", "map", "data", "properties", "label", "ns", "icon", "getOrElse", "Obj", "instanceOf", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
7
- }