@dxos/plugin-automation 0.7.1 → 0.7.2-main.f1adc9f

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 (116) hide show
  1. package/dist/lib/browser/AssistantPanel-622FK3DP.mjs +341 -0
  2. package/dist/lib/browser/AssistantPanel-622FK3DP.mjs.map +7 -0
  3. package/dist/lib/browser/AutomationPanel-PVI2EJNE.mjs +125 -0
  4. package/dist/lib/browser/AutomationPanel-PVI2EJNE.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-B3Z4NQC2.mjs → chunk-R6GS7UA7.mjs} +2 -8
  6. package/dist/lib/browser/{chunk-B3Z4NQC2.mjs.map → chunk-R6GS7UA7.mjs.map} +3 -3
  7. package/dist/lib/browser/{chunk-PQLGYMNY.mjs → chunk-X5KMOH3I.mjs} +2 -2
  8. package/dist/lib/browser/{chunk-PQLGYMNY.mjs.map → chunk-X5KMOH3I.mjs.map} +1 -1
  9. package/dist/lib/browser/index.mjs +277 -1011
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/meta.mjs +1 -1
  13. package/dist/lib/browser/types/index.mjs +1 -2
  14. package/dist/lib/node/AssistantPanel-HRJRVOZD.cjs +361 -0
  15. package/dist/lib/node/AssistantPanel-HRJRVOZD.cjs.map +7 -0
  16. package/dist/lib/node/AutomationPanel-Z2XW24BN.cjs +145 -0
  17. package/dist/lib/node/AutomationPanel-Z2XW24BN.cjs.map +7 -0
  18. package/dist/lib/node/{chunk-JSZ6PAYL.cjs → chunk-DTJ7XVO2.cjs} +5 -5
  19. package/dist/lib/node/{chunk-JSZ6PAYL.cjs.map → chunk-DTJ7XVO2.cjs.map} +1 -1
  20. package/dist/lib/node/{chunk-SUMUWFZA.cjs → chunk-JHKEVE65.cjs} +5 -8
  21. package/dist/lib/node/{chunk-SUMUWFZA.cjs.map → chunk-JHKEVE65.cjs.map} +3 -3
  22. package/dist/lib/node/index.cjs +298 -1008
  23. package/dist/lib/node/index.cjs.map +4 -4
  24. package/dist/lib/node/meta.cjs +3 -3
  25. package/dist/lib/node/meta.cjs.map +1 -1
  26. package/dist/lib/node/meta.json +1 -1
  27. package/dist/lib/node/types/index.cjs +6 -7
  28. package/dist/lib/node/types/index.cjs.map +2 -2
  29. package/dist/lib/node-esm/AssistantPanel-QIIX7S4V.mjs +342 -0
  30. package/dist/lib/node-esm/AssistantPanel-QIIX7S4V.mjs.map +7 -0
  31. package/dist/lib/node-esm/AutomationPanel-5L5NFVKU.mjs +126 -0
  32. package/dist/lib/node-esm/AutomationPanel-5L5NFVKU.mjs.map +7 -0
  33. package/dist/lib/node-esm/{chunk-B35UD3D7.mjs → chunk-HNOBZHWK.mjs} +2 -2
  34. package/dist/lib/node-esm/{chunk-B35UD3D7.mjs.map → chunk-HNOBZHWK.mjs.map} +1 -1
  35. package/dist/lib/node-esm/{chunk-PYT2WY4B.mjs → chunk-ISJZVA2J.mjs} +2 -7
  36. package/dist/lib/node-esm/{chunk-PYT2WY4B.mjs.map → chunk-ISJZVA2J.mjs.map} +3 -3
  37. package/dist/lib/node-esm/index.mjs +277 -1011
  38. package/dist/lib/node-esm/index.mjs.map +4 -4
  39. package/dist/lib/node-esm/meta.json +1 -1
  40. package/dist/lib/node-esm/meta.mjs +1 -1
  41. package/dist/lib/node-esm/types/index.mjs +1 -2
  42. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  43. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts +8 -0
  44. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts.map +1 -0
  45. package/dist/types/src/components/AssistantPanel/index.d.ts +3 -0
  46. package/dist/types/src/components/AssistantPanel/index.d.ts.map +1 -0
  47. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts +6 -0
  48. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts.map +1 -0
  49. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +9 -0
  50. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -0
  51. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +6 -0
  52. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -0
  53. package/dist/types/src/components/AutomationPanel/index.d.ts +3 -0
  54. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -0
  55. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +5 -3
  56. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  57. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +1 -1
  58. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  59. package/dist/types/src/components/index.d.ts +2 -5
  60. package/dist/types/src/components/index.d.ts.map +1 -1
  61. package/dist/types/src/hooks/invocation-handler.d.ts.map +1 -1
  62. package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +1 -1
  63. package/dist/types/src/testing/index.d.ts +2 -0
  64. package/dist/types/src/testing/index.d.ts.map +1 -0
  65. package/dist/types/src/testing/testing.d.ts +12 -0
  66. package/dist/types/src/testing/testing.d.ts.map +1 -0
  67. package/dist/types/src/translations.d.ts +3 -1
  68. package/dist/types/src/translations.d.ts.map +1 -1
  69. package/dist/types/src/types/schema.d.ts +3 -3
  70. package/dist/types/src/types/types.d.ts +0 -1
  71. package/dist/types/src/types/types.d.ts.map +1 -1
  72. package/package.json +37 -34
  73. package/src/AutomationPlugin.tsx +90 -37
  74. package/src/components/AssistantPanel/AssistantPanel.tsx +230 -0
  75. package/src/components/AssistantPanel/index.ts +7 -0
  76. package/src/components/AssistantPanel/system-instructions.ts +166 -0
  77. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +57 -0
  78. package/src/components/AutomationPanel/AutomationPanel.tsx +96 -0
  79. package/src/components/AutomationPanel/index.ts +7 -0
  80. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +15 -27
  81. package/src/components/TriggerEditor/TriggerEditor.tsx +39 -324
  82. package/src/components/index.ts +2 -6
  83. package/src/hooks/invocation-handler.ts +6 -9
  84. package/src/hooks/useLocalTriggerManager.ts +2 -4
  85. package/src/meta.ts +1 -1
  86. package/src/testing/index.ts +5 -0
  87. package/src/testing/testing.ts +34 -0
  88. package/src/translations.ts +4 -1
  89. package/src/types/types.ts +3 -5
  90. package/dist/lib/browser/PromptContainer-6CBNCUKQ.mjs +0 -19
  91. package/dist/lib/browser/PromptContainer-6CBNCUKQ.mjs.map +0 -7
  92. package/dist/lib/browser/chunk-CJMV64XO.mjs +0 -217
  93. package/dist/lib/browser/chunk-CJMV64XO.mjs.map +0 -7
  94. package/dist/lib/node/PromptContainer-7RCGCU3K.cjs +0 -45
  95. package/dist/lib/node/PromptContainer-7RCGCU3K.cjs.map +0 -7
  96. package/dist/lib/node/chunk-YGRHTCOX.cjs +0 -240
  97. package/dist/lib/node/chunk-YGRHTCOX.cjs.map +0 -7
  98. package/dist/lib/node-esm/PromptContainer-4SCHQV5C.mjs +0 -20
  99. package/dist/lib/node-esm/PromptContainer-4SCHQV5C.mjs.map +0 -7
  100. package/dist/lib/node-esm/chunk-62AB5HXX.mjs +0 -218
  101. package/dist/lib/node-esm/chunk-62AB5HXX.mjs.map +0 -7
  102. package/dist/types/src/components/AutomationPanel.d.ts +0 -3
  103. package/dist/types/src/components/AutomationPanel.d.ts.map +0 -1
  104. package/dist/types/src/components/Chain.d.ts +0 -12
  105. package/dist/types/src/components/Chain.d.ts.map +0 -1
  106. package/dist/types/src/components/PromptContainer.d.ts +0 -6
  107. package/dist/types/src/components/PromptContainer.d.ts.map +0 -1
  108. package/dist/types/src/components/TriggerEditor/Form.d.ts +0 -5
  109. package/dist/types/src/components/TriggerEditor/Form.d.ts.map +0 -1
  110. package/dist/types/src/components/TriggerEditor/meta.d.ts +0 -25
  111. package/dist/types/src/components/TriggerEditor/meta.d.ts.map +0 -1
  112. package/src/components/AutomationPanel.tsx +0 -23
  113. package/src/components/Chain.tsx +0 -66
  114. package/src/components/PromptContainer.tsx +0 -19
  115. package/src/components/TriggerEditor/Form.tsx +0 -18
  116. package/src/components/TriggerEditor/meta.tsx +0 -226
@@ -0,0 +1,166 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { asyncTimeout } from '@dxos/async';
6
+ import type { ReactiveEchoObject } from '@dxos/echo-db';
7
+ import { getTypename } from '@dxos/echo-schema';
8
+ import { log } from '@dxos/log';
9
+ import { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';
10
+
11
+ // TODO(burdon): Move into assistant-protocol.
12
+ export type ThreadContext = {
13
+ subject?: ReactiveEchoObject<any>;
14
+ };
15
+
16
+ export const createSystemInstructions = async (context: ThreadContext): Promise<string> => {
17
+ let instructions = `
18
+ <instructions>
19
+ Before replying always think step-by-step on how to proceed.
20
+ Print your thoughts inside <cot> tags.
21
+
22
+ <example>
23
+ <cot>To answer the question I need to ...</cot>
24
+ </example>
25
+ </instructions>
26
+
27
+ <current_time>${new Date().toLocaleString()}</current_time>
28
+ `;
29
+
30
+ if (context.subject) {
31
+ instructions += `
32
+ <user_attention>
33
+ The user is currently interacting with an object in Composer application:
34
+
35
+ ${await formatContextObject(context.subject)}
36
+ </user_attention>
37
+ `;
38
+ }
39
+
40
+ return looseFormatXml(instructions);
41
+ };
42
+
43
+ const formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {
44
+ let data;
45
+ try {
46
+ data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);
47
+ } catch (err: any) {
48
+ log.error('Failed to preprocess context object:', { err });
49
+ data = object;
50
+ }
51
+
52
+ if (typeof data === 'string') {
53
+ return data;
54
+ } else {
55
+ return `
56
+ <object>
57
+ <type>${getTypename(object)}</type>
58
+ <id>${object.id}</id>
59
+ ${formatObjectAsXMLTags(data)}
60
+ </object>
61
+ `;
62
+ }
63
+ };
64
+
65
+ const preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {
66
+ const space = getSpace(object);
67
+ if (!space) {
68
+ return { ...object };
69
+ }
70
+
71
+ // TODO(dmaretskyi): Serialize based on schema annotations.
72
+ switch (getTypename(object)) {
73
+ // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.
74
+ case 'dxos.org/type/Document': {
75
+ const data = space.db
76
+ .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })
77
+ .first() ?? { content: { content: '' } };
78
+
79
+ return {
80
+ ...data,
81
+ threads: undefined,
82
+ };
83
+ }
84
+
85
+ case 'dxos.org/type/Table': {
86
+ // TODO(dmaretskyi): Load references.
87
+ const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : undefined;
88
+ const { objects: rows } =
89
+ (schema &&
90
+ (await space.db
91
+ .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })
92
+ .run())) ??
93
+ {};
94
+
95
+ // TODO(dmaretskyi): Format table schema.
96
+ return `
97
+ <object>
98
+ <id>${object.id}</id>
99
+ <type>${getTypename(object)}</type>
100
+ ${formatObjectAsXMLTags(object)}
101
+
102
+ <rows>
103
+ <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->
104
+ ${rows
105
+ ?.map(
106
+ (row: any) => `<row>
107
+ ${formatObjectAsXMLTags(row)}
108
+ </row>`,
109
+ )
110
+ .join('\n')}
111
+ </rows>
112
+
113
+ `;
114
+ }
115
+
116
+ default:
117
+ return { ...object };
118
+ }
119
+ };
120
+
121
+ const formatObjectAsXMLTags = (object: any, depth = 1): string => {
122
+ return Object.entries(object)
123
+ .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))
124
+ .map(([key, value]) => {
125
+ if (typeof value === 'object' && value !== null) {
126
+ if (depth === 0) {
127
+ return '';
128
+ } else {
129
+ return `<${key}>
130
+ ${formatObjectAsXMLTags(value, depth - 1)}
131
+ </${key}>`;
132
+ }
133
+ }
134
+
135
+ return `<${key}>${value}</${key}>`;
136
+ })
137
+ .join('\n');
138
+ };
139
+
140
+ const CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;
141
+
142
+ const TABLE_ROWS_LIMIT = 10;
143
+
144
+ /**
145
+ * Formats XML indentation for instructions so they are easier to read during debugging.
146
+ */
147
+ const looseFormatXml = (xml: string): string => {
148
+ let currentIndent = 0;
149
+
150
+ return xml
151
+ .split('\n')
152
+ .map((line) => {
153
+ if (line.match(RE_CLOSE_TAG_LINE)) {
154
+ currentIndent--;
155
+ }
156
+ const indent = currentIndent;
157
+ if (line.match(RE_OPEN_TAG_LINE)) {
158
+ currentIndent++;
159
+ }
160
+ return ' '.repeat(indent * 2) + line.trimStart();
161
+ })
162
+ .join('\n');
163
+ };
164
+
165
+ const RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\-_]+>[ ]*$/;
166
+ const RE_CLOSE_TAG_LINE = /^[ ]*<\/[a-zA-Z0-9\-_]+>[ ]*$/;
@@ -0,0 +1,57 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import '@dxos-theme';
6
+
7
+ import { type Meta } from '@storybook/react';
8
+ import React from 'react';
9
+
10
+ import { FunctionTrigger } from '@dxos/functions';
11
+ import { FunctionType } from '@dxos/plugin-script/types';
12
+ import { create, useSpaces } from '@dxos/react-client/echo';
13
+ import { withClientProvider } from '@dxos/react-client/testing';
14
+ import { withLayout, withTheme } from '@dxos/storybook-utils';
15
+
16
+ import { AutomationPanel } from './AutomationPanel';
17
+ import { functions } from '../../testing';
18
+ import translations from '../../translations';
19
+ import { ChainPromptType } from '../../types';
20
+
21
+ const DefaultStory = () => {
22
+ const spaces = useSpaces();
23
+ const space = spaces[1];
24
+
25
+ return (
26
+ <div role='none' className='flex w-[350px] border border-separator overflow-hidden'>
27
+ <AutomationPanel space={space} />
28
+ </div>
29
+ );
30
+ };
31
+
32
+ const meta: Meta = {
33
+ title: 'plugins/plugin-automation/AutomationPanel',
34
+ component: AutomationPanel,
35
+ render: DefaultStory,
36
+ decorators: [
37
+ withClientProvider({
38
+ createIdentity: true,
39
+ createSpace: true,
40
+ types: [FunctionType, FunctionTrigger, ChainPromptType],
41
+ onSpaceCreated: ({ space }) => {
42
+ for (const fn of functions) {
43
+ space.db.add(create(FunctionType, fn));
44
+ }
45
+ },
46
+ }),
47
+ withLayout({ fullscreen: true, tooltips: true, classNames: 'flex justify-center m-2' }),
48
+ withTheme,
49
+ ],
50
+ parameters: {
51
+ translations,
52
+ },
53
+ };
54
+
55
+ export default meta;
56
+
57
+ export const Default = {};
@@ -0,0 +1,96 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React, { useState } from 'react';
6
+
7
+ import { type ReactiveObject, S } from '@dxos/echo-schema';
8
+ import { FunctionTriggerSchema, FunctionTrigger, type FunctionTriggerType } from '@dxos/functions';
9
+ import { create, Filter, useQuery, type Space } from '@dxos/react-client/echo';
10
+ import { IconButton, Input, useTranslation } from '@dxos/react-ui';
11
+ import { List } from '@dxos/react-ui-list';
12
+ import { ghostHover, mx } from '@dxos/react-ui-theme';
13
+
14
+ import { AUTOMATION_PLUGIN } from '../../meta';
15
+ import { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';
16
+
17
+ const grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';
18
+
19
+ export type AutomationPanelProps = {
20
+ space: Space;
21
+ object?: ReactiveObject<any>;
22
+ };
23
+
24
+ // TODO(burdon): Factor out common layout with ViewEditor.
25
+ export const AutomationPanel = ({ space }: AutomationPanelProps) => {
26
+ const { t } = useTranslation(AUTOMATION_PLUGIN);
27
+ const triggers = useQuery(space, Filter.schema(FunctionTrigger));
28
+ const [trigger, setTrigger] = useState<FunctionTriggerType>();
29
+ const [selected, setSelected] = useState<FunctionTrigger>();
30
+
31
+ const handleSelect = (trigger: FunctionTrigger) => {
32
+ const { id: _, ...values } = trigger;
33
+ setTrigger(values);
34
+ setSelected(trigger);
35
+ };
36
+
37
+ const handleAdd = () => {
38
+ setTrigger(create(FunctionTriggerSchema, {}));
39
+ setSelected(undefined);
40
+ };
41
+
42
+ const handleDelete = (trigger: FunctionTrigger) => {
43
+ space.db.remove(trigger);
44
+ setTrigger(undefined);
45
+ setSelected(undefined);
46
+ };
47
+
48
+ const handleSave: TriggerEditorProps['onSave'] = (trigger) => {
49
+ if (selected) {
50
+ Object.assign(selected, trigger);
51
+ } else {
52
+ space.db.add(create(FunctionTrigger, trigger));
53
+ }
54
+
55
+ setTrigger(undefined);
56
+ setSelected(undefined);
57
+ };
58
+
59
+ const handleCancel: TriggerEditorProps['onCancel'] = () => {
60
+ setTrigger(undefined);
61
+ };
62
+
63
+ return (
64
+ <div className='flex flex-col w-full divide-y divide-separator overflow-y-auto'>
65
+ <List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>
66
+ {({ items: triggers }) => (
67
+ <div role='list' className='flex flex-col w-full'>
68
+ {triggers?.map((trigger) => (
69
+ <List.Item<FunctionTrigger>
70
+ key={trigger.id}
71
+ item={trigger}
72
+ classNames={mx(grid, ghostHover, 'items-center')}
73
+ >
74
+ <Input.Root>
75
+ <Input.Switch checked={trigger.enabled} onCheckedChange={(checked) => (trigger.enabled = checked)} />
76
+ </Input.Root>
77
+ <List.ItemTitle classNames='px-2 cursor-pointer' onClick={() => handleSelect(trigger)}>
78
+ {trigger.function}
79
+ </List.ItemTitle>
80
+ <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />
81
+ </List.Item>
82
+ ))}
83
+ </div>
84
+ )}
85
+ </List.Root>
86
+
87
+ {trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}
88
+
89
+ {!trigger && (
90
+ <div className='flex p-2 justify-center'>
91
+ <IconButton icon='ph--plus--regular' label={t('new trigger')} onClick={handleAdd} />
92
+ </div>
93
+ )}
94
+ </div>
95
+ );
96
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { AutomationPanel } from './AutomationPanel';
6
+
7
+ export default AutomationPanel;
@@ -8,42 +8,30 @@ import { type Meta } from '@storybook/react';
8
8
  import React, { useEffect, useState } from 'react';
9
9
 
10
10
  import { create } from '@dxos/echo-schema';
11
- import { FunctionDef, FunctionTrigger } from '@dxos/functions/types';
12
- import { useClient } from '@dxos/react-client';
11
+ import { FunctionTrigger, TriggerKind } from '@dxos/functions';
12
+ import { FunctionType } from '@dxos/plugin-script/types';
13
+ import { useSpaces } from '@dxos/react-client/echo';
13
14
  import { withClientProvider } from '@dxos/react-client/testing';
14
15
  import { withLayout, withTheme } from '@dxos/storybook-utils';
15
16
 
16
17
  import { TriggerEditor } from './TriggerEditor';
18
+ import { functions } from '../../testing';
17
19
  import translations from '../../translations';
18
20
  import { ChainPromptType } from '../../types';
19
21
 
20
- const functions: Omit<FunctionDef, 'id'>[] = [
21
- {
22
- uri: 'dxos.org/function/email-worker',
23
- route: '/email',
24
- handler: 'email-worker',
25
- description: 'Email Sync',
26
- },
27
- {
28
- uri: 'dxos.org/function/gpt',
29
- route: '/gpt',
30
- handler: 'gpt',
31
- description: 'GPT Chat',
32
- },
33
- ];
34
-
35
- const Story = () => {
22
+ const DefaultStory = () => {
23
+ const spaces = useSpaces();
24
+ const space = spaces[1];
36
25
  const [trigger, setTrigger] = useState<FunctionTrigger>();
37
- const client = useClient();
38
- const space = client.spaces.default;
39
26
  useEffect(() => {
40
27
  if (!space) {
41
28
  return;
42
29
  }
43
30
 
44
- const trigger = space.db.add(create(FunctionTrigger, { function: '', spec: { type: 'timer', cron: '0 0 * * *' } }));
31
+ const trigger = space.db.add(create(FunctionTrigger, { spec: { type: TriggerKind.Timer, cron: '' } }));
45
32
  setTrigger(trigger);
46
- }, [space, setTrigger]);
33
+ }, [space]);
34
+
47
35
  if (!space || !trigger) {
48
36
  return <div />;
49
37
  }
@@ -55,20 +43,18 @@ const Story = () => {
55
43
  );
56
44
  };
57
45
 
58
- export const Default = {};
59
-
60
46
  const meta: Meta = {
61
47
  title: 'plugins/plugin-automation/TriggerEditor',
62
48
  component: TriggerEditor,
63
- render: Story,
49
+ render: DefaultStory,
64
50
  decorators: [
65
51
  withClientProvider({
66
52
  createIdentity: true,
67
53
  createSpace: true,
68
- types: [FunctionTrigger, FunctionDef, ChainPromptType],
54
+ types: [FunctionType, FunctionTrigger, ChainPromptType],
69
55
  onSpaceCreated: ({ space }) => {
70
56
  for (const fn of functions) {
71
- space.db.add(create(FunctionDef, fn));
57
+ space.db.add(create(FunctionType, fn));
72
58
  }
73
59
  },
74
60
  }),
@@ -81,3 +67,5 @@ const meta: Meta = {
81
67
  };
82
68
 
83
69
  export default meta;
70
+
71
+ export const Default = {};