@dxos/plugin-automation 0.7.5-labs.e27f9b9 → 0.7.5-labs.f400bbc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AutomationPanel-ITYXSN5Z.mjs +132 -0
- package/dist/lib/browser/AutomationPanel-ITYXSN5Z.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HKX3D3ZP.mjs → chunk-OFDNNRLE.mjs} +4 -7
- package/dist/lib/browser/{chunk-HKX3D3ZP.mjs.map → chunk-OFDNNRLE.mjs.map} +3 -3
- package/dist/lib/browser/chunk-U7QLNY2S.mjs +8 -0
- package/dist/lib/browser/chunk-U7QLNY2S.mjs.map +7 -0
- package/dist/lib/browser/chunk-WY2C7JY4.mjs +119 -0
- package/dist/lib/browser/chunk-WY2C7JY4.mjs.map +7 -0
- package/dist/lib/browser/complementary-panel-4CPOJL4Y.mjs +56 -0
- package/dist/lib/browser/complementary-panel-4CPOJL4Y.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +22 -372
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-SAPMN4PF.mjs +27 -0
- package/dist/lib/browser/react-surface-SAPMN4PF.mjs.map +7 -0
- package/dist/lib/node/{chunk-WWU5FVAO.cjs → AutomationPanel-X33HHDMQ.cjs} +19 -131
- package/dist/lib/node/AutomationPanel-X33HHDMQ.cjs.map +7 -0
- package/dist/lib/node/chunk-7Q5SNGCL.cjs +148 -0
- package/dist/lib/node/chunk-7Q5SNGCL.cjs.map +7 -0
- package/dist/lib/node/chunk-CB5OB6JH.cjs +40 -0
- package/dist/lib/node/chunk-CB5OB6JH.cjs.map +7 -0
- package/dist/lib/node/{chunk-5VF5JKUN.cjs → chunk-ORMEYEBE.cjs} +7 -10
- package/dist/lib/node/{chunk-5VF5JKUN.cjs.map → chunk-ORMEYEBE.cjs.map} +3 -3
- package/dist/lib/node/complementary-panel-ZYJJ42ZU.cjs +72 -0
- package/dist/lib/node/complementary-panel-ZYJJ42ZU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +37 -373
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-5HYLBDC3.cjs → react-surface-2WRVAPGR.cjs} +9 -28
- package/dist/lib/node/react-surface-2WRVAPGR.cjs.map +7 -0
- package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs +133 -0
- package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X3LPRWIL.mjs → chunk-6MUUH67V.mjs} +4 -7
- package/dist/lib/node-esm/{chunk-X3LPRWIL.mjs.map → chunk-6MUUH67V.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-R3P2WPBQ.mjs +10 -0
- package/dist/lib/node-esm/chunk-R3P2WPBQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UDD2VA6G.mjs +120 -0
- package/dist/lib/node-esm/chunk-UDD2VA6G.mjs.map +7 -0
- package/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs +57 -0
- package/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +22 -372
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-SS5WCRJ2.mjs → react-surface-QWLPOYXO.mjs} +5 -28
- package/dist/lib/node-esm/react-surface-QWLPOYXO.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/{ai-client.d.ts → complementary-panel.d.ts} +2 -3
- package/dist/types/src/capabilities/complementary-panel.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -180
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -2
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -11
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/{testing.d.ts → test-functions.d.ts} +1 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -92
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +23 -71
- package/src/AutomationPlugin.tsx +9 -64
- package/src/capabilities/complementary-panel.ts +56 -0
- package/src/capabilities/index.ts +1 -5
- package/src/capabilities/react-surface.tsx +1 -13
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -2
- package/src/components/AutomationPanel/AutomationPanel.tsx +56 -49
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -2
- package/src/components/TriggerEditor/TriggerEditor.tsx +8 -5
- package/src/components/index.ts +0 -7
- package/src/index.ts +2 -3
- package/src/meta.ts +3 -3
- package/src/testing/index.ts +1 -1
- package/src/testing/{testing.ts → test-functions.ts} +0 -7
- package/src/translations.ts +2 -29
- package/dist/lib/browser/AutomationPanel-WFJZAW4F.mjs +0 -8
- package/dist/lib/browser/AutomationPanel-WFJZAW4F.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-OFCOZ5T2.mjs +0 -12
- package/dist/lib/browser/ChatContainer-OFCOZ5T2.mjs.map +0 -7
- package/dist/lib/browser/ai-client-AARXEMMJ.mjs +0 -22
- package/dist/lib/browser/ai-client-AARXEMMJ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-B4U34VSR.mjs +0 -162
- package/dist/lib/browser/app-graph-builder-B4U34VSR.mjs.map +0 -7
- package/dist/lib/browser/chunk-5SLV6AUA.mjs +0 -1367
- package/dist/lib/browser/chunk-5SLV6AUA.mjs.map +0 -7
- package/dist/lib/browser/chunk-7XADMUOW.mjs +0 -205
- package/dist/lib/browser/chunk-7XADMUOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-HZ4TA7HY.mjs +0 -15
- package/dist/lib/browser/chunk-HZ4TA7HY.mjs.map +0 -7
- package/dist/lib/browser/chunk-IYSMXX6Q.mjs +0 -283
- package/dist/lib/browser/chunk-IYSMXX6Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-RAVNWHNE.mjs +0 -242
- package/dist/lib/browser/chunk-RAVNWHNE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-754MPV7H.mjs +0 -29
- package/dist/lib/browser/intent-resolver-754MPV7H.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4QZ6AKBF.mjs +0 -50
- package/dist/lib/browser/react-surface-4QZ6AKBF.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -24
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-LRDEDGXI.cjs +0 -26
- package/dist/lib/node/AutomationPanel-LRDEDGXI.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-6LZX4K2Z.cjs +0 -33
- package/dist/lib/node/ChatContainer-6LZX4K2Z.cjs.map +0 -7
- package/dist/lib/node/ai-client-SA35GN5Q.cjs +0 -38
- package/dist/lib/node/ai-client-SA35GN5Q.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-ENVDOPS4.cjs +0 -178
- package/dist/lib/node/app-graph-builder-ENVDOPS4.cjs.map +0 -7
- package/dist/lib/node/chunk-6VMSH4P6.cjs +0 -1364
- package/dist/lib/node/chunk-6VMSH4P6.cjs.map +0 -7
- package/dist/lib/node/chunk-HEYQONXC.cjs +0 -302
- package/dist/lib/node/chunk-HEYQONXC.cjs.map +0 -7
- package/dist/lib/node/chunk-LU4HQWJD.cjs +0 -226
- package/dist/lib/node/chunk-LU4HQWJD.cjs.map +0 -7
- package/dist/lib/node/chunk-WWU5FVAO.cjs.map +0 -7
- package/dist/lib/node/chunk-ZS5RZ7RM.cjs +0 -34
- package/dist/lib/node/chunk-ZS5RZ7RM.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-CNVBSG4E.cjs +0 -44
- package/dist/lib/node/intent-resolver-CNVBSG4E.cjs.map +0 -7
- package/dist/lib/node/react-surface-5HYLBDC3.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -46
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-ZV7VEEPP.mjs +0 -9
- package/dist/lib/node-esm/AutomationPanel-ZV7VEEPP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-PPVMC2FC.mjs +0 -13
- package/dist/lib/node-esm/ChatContainer-PPVMC2FC.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-2ZA4TYFZ.mjs +0 -23
- package/dist/lib/node-esm/ai-client-2ZA4TYFZ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-IYOUCQZT.mjs +0 -163
- package/dist/lib/node-esm/app-graph-builder-IYOUCQZT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3KB5HRXA.mjs +0 -284
- package/dist/lib/node-esm/chunk-3KB5HRXA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EVTLHDM2.mjs +0 -206
- package/dist/lib/node-esm/chunk-EVTLHDM2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ISYLEDVU.mjs +0 -16
- package/dist/lib/node-esm/chunk-ISYLEDVU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS7OIGVR.mjs +0 -243
- package/dist/lib/node-esm/chunk-MS7OIGVR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WISKXX7U.mjs +0 -1368
- package/dist/lib/node-esm/chunk-WISKXX7U.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-RQBXW442.mjs +0 -30
- package/dist/lib/node-esm/intent-resolver-RQBXW442.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SS5WCRJ2.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -25
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/artifacts.stories.d.ts +0 -16
- package/dist/types/src/artifacts.stories.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -180
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +0 -8
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/components/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts +0 -14
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +0 -8
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownViewer/index.d.ts +0 -2
- package/dist/types/src/components/MarkdownViewer/index.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +0 -10
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts +0 -6
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/index.d.ts +0 -2
- package/dist/types/src/components/PromptEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts +0 -4
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/types.d.ts +0 -18
- package/dist/types/src/components/PromptEditor/types.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -6
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
- package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ScrollContainer.d.ts +0 -15
- package/dist/types/src/components/Thread/ScrollContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/StatusLine.d.ts +0 -11
- package/dist/types/src/components/Thread/StatusLine.d.ts.map +0 -1
- package/dist/types/src/components/Thread/StatusLine.stories.d.ts +0 -9
- package/dist/types/src/components/Thread/StatusLine.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Tabbed.d.ts +0 -9
- package/dist/types/src/components/Thread/Tabbed.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Tabbed.stories.d.ts +0 -8
- package/dist/types/src/components/Thread/Tabbed.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -10
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -12
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToggleContainer.d.ts +0 -13
- package/dist/types/src/components/Thread/ToggleContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts +0 -9
- package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -2
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/hooks/email.d.ts +0 -4
- package/dist/types/src/hooks/email.d.ts.map +0 -1
- package/dist/types/src/hooks/index.d.ts +0 -4
- package/dist/types/src/hooks/index.d.ts.map +0 -1
- package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
- package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -65
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts +0 -2
- package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
- package/dist/types/src/hooks/useServiceRegistry.d.ts +0 -3
- package/dist/types/src/hooks/useServiceRegistry.d.ts.map +0 -1
- package/dist/types/src/presets.d.ts +0 -9
- package/dist/types/src/presets.d.ts.map +0 -1
- package/dist/types/src/testing/testing.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -4
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/registry.d.ts +0 -9
- package/dist/types/src/types/registry.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -196
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -18
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/artifacts.stories.tsx +0 -241
- package/src/capabilities/ai-client.ts +0 -19
- package/src/capabilities/app-graph-builder.ts +0 -156
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/components/ChatContainer/ChatContainer.tsx +0 -117
- package/src/components/ChatContainer/index.ts +0 -8
- package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +0 -56
- package/src/components/MarkdownViewer/MarkdownViewer.tsx +0 -79
- package/src/components/MarkdownViewer/index.ts +0 -5
- package/src/components/PromptEditor/PromptEditor.stories.tsx +0 -64
- package/src/components/PromptEditor/PromptEditor.tsx +0 -222
- package/src/components/PromptEditor/index.ts +0 -5
- package/src/components/PromptEditor/prompt-extension.ts +0 -43
- package/src/components/PromptEditor/types.tsx +0 -28
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -48
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -75
- package/src/components/ServiceRegistry/index.ts +0 -5
- package/src/components/Thread/ScrollContainer.tsx +0 -92
- package/src/components/Thread/StatusLine.stories.tsx +0 -52
- package/src/components/Thread/StatusLine.tsx +0 -76
- package/src/components/Thread/Tabbed.stories.tsx +0 -52
- package/src/components/Thread/Tabbed.tsx +0 -72
- package/src/components/Thread/Thread.stories.tsx +0 -190
- package/src/components/Thread/Thread.tsx +0 -156
- package/src/components/Thread/ThreadMessage.tsx +0 -195
- package/src/components/Thread/ToggleContainer.stories.tsx +0 -111
- package/src/components/Thread/ToggleContainer.tsx +0 -103
- package/src/components/Thread/index.ts +0 -5
- package/src/hooks/email.ts +0 -49
- package/src/hooks/index.ts +0 -8
- package/src/hooks/invocation-handler.ts +0 -109
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -201
- package/src/hooks/useLocalTriggerManager.ts +0 -82
- package/src/hooks/useServiceRegistry.ts +0 -22
- package/src/presets.ts +0 -248
- package/src/tools/function.ts +0 -47
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -227
- package/src/tools/openapi.ts +0 -331
- package/src/types/index.ts +0 -7
- package/src/types/registry.ts +0 -89
- package/src/types/schema.ts +0 -120
- package/src/types/types.ts +0 -21
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@dxos/functions';
|
|
16
16
|
import { type Client, useClient } from '@dxos/react-client';
|
|
17
17
|
import { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';
|
|
18
|
-
import { IconButton, Input, useTranslation
|
|
18
|
+
import { Clipboard, IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
19
19
|
import { List } from '@dxos/react-ui-list';
|
|
20
20
|
import { ghostHover, mx } from '@dxos/react-ui-theme';
|
|
21
21
|
|
|
@@ -73,57 +73,62 @@ export const AutomationPanel = ({ space, object }: AutomationPanelProps) => {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
{
|
|
79
|
-
<
|
|
80
|
-
{triggers
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<Input.Switch
|
|
90
|
-
checked={trigger.enabled}
|
|
91
|
-
onCheckedChange={(checked) => (trigger.enabled = checked)}
|
|
92
|
-
/>
|
|
93
|
-
</Input.Root>
|
|
94
|
-
|
|
95
|
-
<div className={'flex'}>
|
|
96
|
-
<List.ItemTitle
|
|
97
|
-
classNames='px-1 cursor-pointer w-0 shrink truncate'
|
|
98
|
-
onClick={() => handleSelect(trigger)}
|
|
76
|
+
<Clipboard.Provider>
|
|
77
|
+
<div className='flex flex-col w-full'>
|
|
78
|
+
{!trigger && (
|
|
79
|
+
<List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>
|
|
80
|
+
{({ items: triggers }) => (
|
|
81
|
+
<div role='list' className='flex flex-col w-full'>
|
|
82
|
+
{triggers?.map((trigger) => {
|
|
83
|
+
const copyAction = getCopyAction(client, trigger);
|
|
84
|
+
return (
|
|
85
|
+
<List.Item<FunctionTrigger>
|
|
86
|
+
key={trigger.id}
|
|
87
|
+
item={trigger}
|
|
88
|
+
classNames={mx(grid, ghostHover, 'items-center', 'px-2')}
|
|
99
89
|
>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
<Input.Root>
|
|
91
|
+
<Input.Switch
|
|
92
|
+
checked={trigger.enabled}
|
|
93
|
+
onCheckedChange={(checked) => (trigger.enabled = checked)}
|
|
94
|
+
/>
|
|
95
|
+
</Input.Root>
|
|
96
|
+
|
|
97
|
+
<div className={'flex'}>
|
|
98
|
+
<List.ItemTitle
|
|
99
|
+
classNames='px-1 cursor-pointer w-0 shrink truncate'
|
|
100
|
+
onClick={() => handleSelect(trigger)}
|
|
101
|
+
>
|
|
102
|
+
{getFunctionName(scripts, functions, trigger) ?? '∅'}
|
|
103
|
+
</List.ItemTitle>
|
|
104
|
+
|
|
105
|
+
{/* TODO: a better way to expose copy action */}
|
|
106
|
+
{copyAction && (
|
|
107
|
+
<Clipboard.IconButton
|
|
108
|
+
label={t(copyAction.translationKey)}
|
|
109
|
+
value={copyAction.contentProvider()}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<List.ItemDeleteButton onClick={() => handleDelete(trigger)} />
|
|
115
|
+
</List.Item>
|
|
116
|
+
);
|
|
117
|
+
})}
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
</List.Root>
|
|
116
121
|
)}
|
|
117
|
-
</List.Root>
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
{trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}
|
|
120
124
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
{!trigger && (
|
|
126
|
+
<div className='flex p-2 justify-center'>
|
|
127
|
+
<IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />
|
|
128
|
+
</div>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
</Clipboard.Provider>
|
|
127
132
|
);
|
|
128
133
|
};
|
|
129
134
|
|
|
@@ -148,8 +153,10 @@ const getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {
|
|
|
148
153
|
};
|
|
149
154
|
|
|
150
155
|
const getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {
|
|
156
|
+
// TODO(wittjosiah): Truncation should be done in the UI.
|
|
157
|
+
// Warning that the List component is currently a can of worms.
|
|
151
158
|
const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;
|
|
152
|
-
const functionObject = functions.find((fn) => fn.name === trigger.function);
|
|
159
|
+
const functionObject = functions.find((fn) => `dxn:worker:${fn.name}` === trigger.function);
|
|
153
160
|
if (!functionObject) {
|
|
154
161
|
return shortId;
|
|
155
162
|
}
|
|
@@ -16,7 +16,6 @@ import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
|
16
16
|
import { TriggerEditor } from './TriggerEditor';
|
|
17
17
|
import { functions } from '../../testing';
|
|
18
18
|
import translations from '../../translations';
|
|
19
|
-
import { ChainPromptType } from '../../types';
|
|
20
19
|
|
|
21
20
|
const DefaultStory = () => {
|
|
22
21
|
const spaces = useSpaces();
|
|
@@ -50,7 +49,7 @@ const meta: Meta = {
|
|
|
50
49
|
withClientProvider({
|
|
51
50
|
createIdentity: true,
|
|
52
51
|
createSpace: true,
|
|
53
|
-
types: [FunctionType, FunctionTrigger
|
|
52
|
+
types: [FunctionType, FunctionTrigger],
|
|
54
53
|
onSpaceCreated: ({ space }) => {
|
|
55
54
|
for (const fn of functions) {
|
|
56
55
|
space.db.add(create(FunctionType, fn));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useState } from 'react';
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { ComputeGraph } from '@dxos/conductor';
|
|
8
8
|
import {
|
|
@@ -61,11 +61,9 @@ export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEdito
|
|
|
61
61
|
),
|
|
62
62
|
['meta' as const]: (props) => {
|
|
63
63
|
const meta = props.getValue()!;
|
|
64
|
-
|
|
64
|
+
useEffect(() => props.onValueChange('object', { ...meta }), []);
|
|
65
65
|
const [newMetaFieldName, setNewMetaFieldName] = useState('');
|
|
66
66
|
|
|
67
|
-
React.useEffect(() => props.onValueChange('object', { ...meta }), []);
|
|
68
|
-
|
|
69
67
|
return (
|
|
70
68
|
<>
|
|
71
69
|
<div>{props.label}</div>
|
|
@@ -74,7 +72,12 @@ export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEdito
|
|
|
74
72
|
return (
|
|
75
73
|
<div key={compositeKey} role='none' className='flex items-center mt-2 gap-1'>
|
|
76
74
|
<div role='none' className='flex-1'>
|
|
77
|
-
<TextInput
|
|
75
|
+
<TextInput
|
|
76
|
+
{...props}
|
|
77
|
+
getValue={() => (props.getValue() as any)[key]}
|
|
78
|
+
type={'string'}
|
|
79
|
+
label={key}
|
|
80
|
+
/>
|
|
78
81
|
</div>
|
|
79
82
|
<IconButton
|
|
80
83
|
icon='ph--trash--regular'
|
package/src/components/index.ts
CHANGED
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export * from './AutomationPanel';
|
|
8
|
-
export * from './ChatContainer';
|
|
9
|
-
export * from './MarkdownViewer';
|
|
10
|
-
export * from './PromptEditor';
|
|
11
|
-
export * from './ServiceRegistry';
|
|
12
|
-
export * from './Thread';
|
|
13
7
|
export * from './TriggerEditor';
|
|
14
8
|
|
|
15
9
|
export const AutomationPanel = lazy(() => import('./AutomationPanel'));
|
|
16
|
-
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -9,8 +9,8 @@ export const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';
|
|
|
9
9
|
export const meta = {
|
|
10
10
|
id: AUTOMATION_PLUGIN,
|
|
11
11
|
name: 'Automation',
|
|
12
|
-
description:
|
|
13
|
-
|
|
12
|
+
description:
|
|
13
|
+
'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',
|
|
14
|
+
icon: 'ph--robot--regular',
|
|
14
15
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',
|
|
15
|
-
tags: ['experimental'],
|
|
16
16
|
} satisfies PluginMeta;
|
package/src/testing/index.ts
CHANGED
|
@@ -2,15 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { createSystemPrompt } from '@dxos/artifact';
|
|
6
|
-
import { type GenerateRequest } from '@dxos/assistant';
|
|
7
5
|
import { AST, S, toJsonSchema } from '@dxos/echo-schema';
|
|
8
6
|
|
|
9
|
-
export const createProcessorOptions = (artifacts: string[]): Pick<GenerateRequest, 'model' | 'systemPrompt'> => ({
|
|
10
|
-
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
11
|
-
systemPrompt: createSystemPrompt({ artifacts }),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
7
|
export const functions = [
|
|
15
8
|
{
|
|
16
9
|
name: 'example.com/function/chess',
|
package/src/translations.ts
CHANGED
|
@@ -3,48 +3,21 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { AUTOMATION_PLUGIN } from './meta';
|
|
6
|
-
import { AIChatType } from './types';
|
|
7
6
|
|
|
8
7
|
export default [
|
|
9
8
|
{
|
|
10
9
|
'en-US': {
|
|
11
|
-
[AIChatType.typename]: {
|
|
12
|
-
'typename label': 'AI Chat',
|
|
13
|
-
},
|
|
14
10
|
[AUTOMATION_PLUGIN]: {
|
|
15
11
|
'plugin name': 'Automation',
|
|
16
|
-
'object placeholder': 'New prompt',
|
|
17
|
-
'create object label': 'Create prompt',
|
|
18
|
-
'create trigger label': 'Create trigger',
|
|
19
|
-
'create stack section label': 'Create prompt',
|
|
20
|
-
'command placeholder': 'Enter slash command...',
|
|
21
|
-
'template placeholder': 'Enter template...',
|
|
22
|
-
'value placeholder': 'Enter value...',
|
|
23
|
-
'select preset template placeholder': 'Select preset',
|
|
24
|
-
'open automation panel label': 'Show Automations',
|
|
25
12
|
'automation panel label': 'Automations',
|
|
26
|
-
'service registry label': 'Service Registry',
|
|
27
|
-
|
|
28
|
-
'chat input placeholder': 'Ask a question...',
|
|
29
|
-
'chat stop': 'Cancel request.',
|
|
30
|
-
|
|
31
|
-
'function select label': 'Function',
|
|
32
|
-
'function select placeholder': 'Select function',
|
|
33
|
-
'function enabled': 'Enabled',
|
|
34
|
-
|
|
35
|
-
'trigger select label': 'Trigger',
|
|
36
|
-
'trigger select placeholder': 'Trigger type',
|
|
37
13
|
|
|
14
|
+
'new trigger label': 'New Trigger',
|
|
38
15
|
'trigger type timer': 'Timer',
|
|
39
16
|
'trigger type webhook': 'Webhook',
|
|
40
17
|
'trigger type websocket': 'Websocket',
|
|
41
18
|
'trigger type subscription': 'Subscription',
|
|
42
19
|
'trigger type email': 'Email',
|
|
43
|
-
|
|
44
|
-
'trigger filter': 'Filter',
|
|
45
|
-
'trigger cron': 'Cron',
|
|
46
|
-
'trigger method': 'Method',
|
|
47
|
-
'trigger endpoint': 'Endpoint',
|
|
20
|
+
'trigger type queue': 'Queue',
|
|
48
21
|
|
|
49
22
|
'trigger copy url': 'Copy URL',
|
|
50
23
|
'trigger copy email': 'Copy Email',
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatContainer,
|
|
3
|
-
ChatContainer_default
|
|
4
|
-
} from "./chunk-5SLV6AUA.mjs";
|
|
5
|
-
import "./chunk-HZ4TA7HY.mjs";
|
|
6
|
-
import "./chunk-7XADMUOW.mjs";
|
|
7
|
-
import "./chunk-HKX3D3ZP.mjs";
|
|
8
|
-
export {
|
|
9
|
-
ChatContainer,
|
|
10
|
-
ChatContainer_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=ChatContainer-OFCOZ5T2.mjs.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationCapabilities
|
|
3
|
-
} from "./chunk-HZ4TA7HY.mjs";
|
|
4
|
-
import "./chunk-HKX3D3ZP.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/experimental/plugin-automation/src/capabilities/ai-client.ts
|
|
7
|
-
import { contributes } from "@dxos/app-framework";
|
|
8
|
-
import { AIServiceClientImpl } from "@dxos/assistant";
|
|
9
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
10
|
-
var DEFAULT_AI_SERVICE_URL = "http://localhost:8788";
|
|
11
|
-
var ai_client_default = (context) => {
|
|
12
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
13
|
-
const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
|
|
14
|
-
const aiClient = new AIServiceClientImpl({
|
|
15
|
-
endpoint
|
|
16
|
-
});
|
|
17
|
-
return contributes(AutomationCapabilities.AiClient, aiClient);
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
ai_client_default as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=ai-client-AARXEMMJ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/ai-client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { AIServiceClientImpl } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AutomationCapabilities } from './capabilities';\n\n// TODO(wittjosiah): Factor out.\nconst DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;\n const aiClient = new AIServiceClientImpl({ endpoint });\n return contributes(AutomationCapabilities.AiClient, aiClient);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,mBAAwC;AACjD,SAASC,2BAA2B;AACpC,SAASC,0BAA0B;AAKnC,IAAMC,yBAAyB;AAE/B,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,mBAAmBC,MAAM;AAClE,QAAMC,WAAWJ,OAAOK,OAAOC,OAAOC,SAASC,UAAUC,IAAIC,UAAUZ;AACvE,QAAMa,WAAW,IAAIC,oBAAoB;IAAER;EAAS,CAAA;AACpD,SAAOS,YAAYC,uBAAuBC,UAAUJ,QAAAA;AACtD;",
|
|
6
|
-
"names": ["contributes", "AIServiceClientImpl", "ClientCapabilities", "DEFAULT_AI_SERVICE_URL", "context", "client", "requestCapability", "ClientCapabilities", "Client", "endpoint", "config", "values", "runtime", "services", "ai", "server", "aiClient", "AIServiceClientImpl", "contributes", "AutomationCapabilities", "AiClient"]
|
|
7
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AUTOMATION_PLUGIN
|
|
3
|
-
} from "./chunk-HKX3D3ZP.mjs";
|
|
4
|
-
|
|
5
|
-
// packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts
|
|
6
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
7
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
8
|
-
import { createExtension, toSignal } from "@dxos/plugin-graph";
|
|
9
|
-
import { memoizeQuery } from "@dxos/plugin-space";
|
|
10
|
-
import { getTypename, parseId, SpaceState } from "@dxos/react-client/echo";
|
|
11
|
-
var app_graph_builder_default = (context) => {
|
|
12
|
-
const resolve = (typename) => context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
13
|
-
return contributes(Capabilities.AppGraphBuilder, [
|
|
14
|
-
createExtension({
|
|
15
|
-
id: `${AUTOMATION_PLUGIN}/service-registry`,
|
|
16
|
-
resolver: ({ id }) => {
|
|
17
|
-
if (!id.endsWith("~service-registry")) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const type = "orphan-settings-for-subject";
|
|
21
|
-
const icon = "ph--plugs--regular";
|
|
22
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
23
|
-
const [subjectId] = id.split("~");
|
|
24
|
-
const { spaceId } = parseId(subjectId);
|
|
25
|
-
const spaces = toSignal((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
26
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === SpaceState.SPACE_READY);
|
|
27
|
-
return {
|
|
28
|
-
id,
|
|
29
|
-
type,
|
|
30
|
-
data: null,
|
|
31
|
-
properties: {
|
|
32
|
-
icon,
|
|
33
|
-
label: [
|
|
34
|
-
"service registry label",
|
|
35
|
-
{
|
|
36
|
-
ns: AUTOMATION_PLUGIN
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
object: null,
|
|
40
|
-
space
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}),
|
|
45
|
-
createExtension({
|
|
46
|
-
id: `${AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
47
|
-
resolver: ({ id }) => {
|
|
48
|
-
if (!id.endsWith("~automation")) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const type = "orphan-settings-for-subject";
|
|
52
|
-
const icon = "ph--magic-wand--regular";
|
|
53
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
54
|
-
const [subjectId] = id.split("~");
|
|
55
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
56
|
-
const spaces = toSignal((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
57
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === SpaceState.SPACE_READY);
|
|
58
|
-
if (!objectId) {
|
|
59
|
-
const label2 = space ? space.properties.name || [
|
|
60
|
-
"unnamed space label",
|
|
61
|
-
{
|
|
62
|
-
ns: AUTOMATION_PLUGIN
|
|
63
|
-
}
|
|
64
|
-
] : [
|
|
65
|
-
"unnamed object settings label",
|
|
66
|
-
{
|
|
67
|
-
ns: AUTOMATION_PLUGIN
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
return {
|
|
71
|
-
id,
|
|
72
|
-
type,
|
|
73
|
-
data: null,
|
|
74
|
-
properties: {
|
|
75
|
-
icon,
|
|
76
|
-
label: label2,
|
|
77
|
-
showResolvedThreads: false,
|
|
78
|
-
object: null,
|
|
79
|
-
space
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
const [object] = memoizeQuery(space, {
|
|
84
|
-
id: objectId
|
|
85
|
-
});
|
|
86
|
-
if (!object || !subjectId) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const meta = resolve(getTypename(object) ?? "");
|
|
90
|
-
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
91
|
-
"unnamed object settings label",
|
|
92
|
-
{
|
|
93
|
-
ns: AUTOMATION_PLUGIN
|
|
94
|
-
}
|
|
95
|
-
];
|
|
96
|
-
return {
|
|
97
|
-
id,
|
|
98
|
-
type,
|
|
99
|
-
data: null,
|
|
100
|
-
properties: {
|
|
101
|
-
icon,
|
|
102
|
-
label,
|
|
103
|
-
object
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}),
|
|
108
|
-
createExtension({
|
|
109
|
-
id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,
|
|
110
|
-
resolver: ({ id }) => {
|
|
111
|
-
if (!id.endsWith("~assistant")) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
115
|
-
const [subjectId] = id.split("~");
|
|
116
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
117
|
-
const spaces = toSignal((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
118
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === SpaceState.SPACE_READY);
|
|
119
|
-
if (!objectId) {
|
|
120
|
-
return {
|
|
121
|
-
id,
|
|
122
|
-
type: "orphan-automation-for-subject",
|
|
123
|
-
data: null,
|
|
124
|
-
properties: {
|
|
125
|
-
icon: "ph--atom--regular",
|
|
126
|
-
label: [
|
|
127
|
-
"assistant panel label",
|
|
128
|
-
{
|
|
129
|
-
ns: AUTOMATION_PLUGIN
|
|
130
|
-
}
|
|
131
|
-
],
|
|
132
|
-
object: null,
|
|
133
|
-
space
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
const [object] = memoizeQuery(space, {
|
|
138
|
-
id: objectId
|
|
139
|
-
});
|
|
140
|
-
return {
|
|
141
|
-
id,
|
|
142
|
-
type: "orphan-automation-for-subject",
|
|
143
|
-
data: null,
|
|
144
|
-
properties: {
|
|
145
|
-
icon: "ph--atom--regular",
|
|
146
|
-
label: [
|
|
147
|
-
"assistant panel label",
|
|
148
|
-
{
|
|
149
|
-
ns: AUTOMATION_PLUGIN
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
object
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
]);
|
|
158
|
-
};
|
|
159
|
-
export {
|
|
160
|
-
app_graph_builder_default as default
|
|
161
|
-
};
|
|
162
|
-
//# sourceMappingURL=app-graph-builder-B4U34VSR.mjs.map
|
|
@@ -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 { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport { getTypename, parseId, SpaceState } from '@dxos/react-client/echo';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport default (context: PluginsContext) => {\n const resolve = (typename: string) =>\n context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};\n\n return contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${AUTOMATION_PLUGIN}/service-registry`,\n resolver: ({ id }) => {\n if (!id.endsWith('~service-registry')) {\n return;\n }\n\n const type = 'orphan-settings-for-subject';\n const icon = 'ph--plugs--regular';\n\n const client = context.requestCapability(ClientCapabilities.Client);\n const [subjectId] = id.split('~');\n const { spaceId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label: ['service registry label', { ns: AUTOMATION_PLUGIN }],\n object: null,\n space,\n },\n };\n },\n }),\n createExtension({\n id: `${AUTOMATION_PLUGIN}/automation-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~automation')) {\n return;\n }\n\n const type = 'orphan-settings-for-subject';\n const icon = 'ph--magic-wand--regular';\n\n const client = context.requestCapability(ClientCapabilities.Client);\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);\n if (!objectId) {\n // TODO(burdon): Ref SPACE_PLUGIN ns.\n const label = space\n ? space.properties.name || ['unnamed space label', { ns: AUTOMATION_PLUGIN }]\n : ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n // TODO(wittjosiah): Support comments for arbitrary subjects.\n // This is to ensure that the comments panel is not stuck on an old object.\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n showResolvedThreads: false,\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n if (!object || !subjectId) {\n return;\n }\n\n const meta = resolve(getTypename(object) ?? '');\n const label = meta.label?.(object) ||\n object.name ||\n meta.placeholder || ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n object,\n },\n };\n },\n }),\n createExtension({\n id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~assistant')) {\n return;\n }\n\n const client = context.requestCapability(ClientCapabilities.Client);\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);\n if (!objectId) {\n // TODO(wittjosiah): Support assistant for arbitrary subjects.\n // This is to ensure that the assistant panel is not stuck on an old object.\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object,\n },\n };\n },\n }),\n ]);\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Capabilities", "contributes", "ClientCapabilities", "createExtension", "toSignal", "memoizeQuery", "getTypename", "parseId", "SpaceState", "context", "resolve", "typename", "requestCapabilities", "Capabilities", "Metadata", "find", "id", "metadata", "contributes", "AppGraphBuilder", "createExtension", "AUTOMATION_PLUGIN", "resolver", "endsWith", "type", "icon", "client", "requestCapability", "ClientCapabilities", "Client", "subjectId", "split", "spaceId", "parseId", "spaces", "toSignal", "onChange", "subscribe", "unsubscribe", "get", "space", "state", "SpaceState", "SPACE_READY", "data", "properties", "label", "ns", "object", "objectId", "name", "showResolvedThreads", "memoizeQuery", "meta", "getTypename", "placeholder"]
|
|
7
|
-
}
|