@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
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { ComputeGraph } from '@dxos/conductor';
|
|
2
|
-
import { Expando, Ref, S, type Ref$ } from '@dxos/echo-schema';
|
|
3
|
-
import { FunctionType } from '@dxos/functions';
|
|
4
|
-
export declare enum ChainInputType {
|
|
5
|
-
VALUE = 0,
|
|
6
|
-
PASS_THROUGH = 1,
|
|
7
|
-
RETRIEVER = 2,
|
|
8
|
-
FUNCTION = 3,
|
|
9
|
-
QUERY = 4,
|
|
10
|
-
RESOLVER = 5,
|
|
11
|
-
CONTEXT = 6,
|
|
12
|
-
SCHEMA = 7
|
|
13
|
-
}
|
|
14
|
-
export declare const ChainInputSchema: S.mutable<S.Struct<{
|
|
15
|
-
name: typeof S.String;
|
|
16
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
17
|
-
value: S.optional<typeof S.String>;
|
|
18
|
-
}>>;
|
|
19
|
-
export type ChainInput = S.Schema.Type<typeof ChainInputSchema>;
|
|
20
|
-
declare const ChainPromptType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
21
|
-
command: S.optional<typeof S.String>;
|
|
22
|
-
template: typeof S.String;
|
|
23
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
24
|
-
name: typeof S.String;
|
|
25
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
26
|
-
value: S.optional<typeof S.String>;
|
|
27
|
-
}>>>>>;
|
|
28
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
29
|
-
command: S.optional<typeof S.String>;
|
|
30
|
-
template: typeof S.String;
|
|
31
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
32
|
-
name: typeof S.String;
|
|
33
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
34
|
-
value: S.optional<typeof S.String>;
|
|
35
|
-
}>>>>>;
|
|
36
|
-
}>>;
|
|
37
|
-
export declare class ChainPromptType extends ChainPromptType_base {
|
|
38
|
-
}
|
|
39
|
-
declare const ChainType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
40
|
-
name: S.optional<typeof S.String>;
|
|
41
|
-
prompts: S.optional<S.mutable<S.Array$<Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
42
|
-
command: S.optional<typeof S.String>;
|
|
43
|
-
template: typeof S.String;
|
|
44
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
45
|
-
name: typeof S.String;
|
|
46
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
47
|
-
value: S.optional<typeof S.String>;
|
|
48
|
-
}>>>>>;
|
|
49
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>>;
|
|
50
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
51
|
-
name: S.optional<typeof S.String>;
|
|
52
|
-
prompts: S.optional<S.mutable<S.Array$<Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
53
|
-
command: S.optional<typeof S.String>;
|
|
54
|
-
template: typeof S.String;
|
|
55
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
56
|
-
name: typeof S.String;
|
|
57
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
58
|
-
value: S.optional<typeof S.String>;
|
|
59
|
-
}>>>>>;
|
|
60
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>>;
|
|
61
|
-
}>>;
|
|
62
|
-
export declare class ChainType extends ChainType_base {
|
|
63
|
-
}
|
|
64
|
-
declare const AIChatType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
65
|
-
name: S.optional<typeof S.String>;
|
|
66
|
-
queue: Ref$<Expando>;
|
|
67
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
68
|
-
name: S.optional<typeof S.String>;
|
|
69
|
-
queue: Ref$<Expando>;
|
|
70
|
-
}>>;
|
|
71
|
-
export declare class AIChatType extends AIChatType_base {
|
|
72
|
-
}
|
|
73
|
-
export declare const ApiAuthorization: S.Union<[S.Struct<{
|
|
74
|
-
type: S.Literal<["api-key"]>;
|
|
75
|
-
key: typeof S.String;
|
|
76
|
-
placement: S.Union<[S.Struct<{
|
|
77
|
-
type: S.Literal<["authorization-header"]>;
|
|
78
|
-
}>, S.Struct<{
|
|
79
|
-
type: S.Literal<["query"]>;
|
|
80
|
-
name: typeof S.String;
|
|
81
|
-
}>]>;
|
|
82
|
-
}>, S.Struct<{
|
|
83
|
-
type: S.Literal<["oauth"]>;
|
|
84
|
-
clientId: typeof S.String;
|
|
85
|
-
clientSecret: typeof S.String;
|
|
86
|
-
tokenUrl: typeof S.String;
|
|
87
|
-
grantType: typeof S.String;
|
|
88
|
-
}>]>;
|
|
89
|
-
export type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;
|
|
90
|
-
declare const ServiceInterface: S.Union<[S.Struct<{
|
|
91
|
-
kind: S.Literal<["function"]>;
|
|
92
|
-
fn: Ref$<FunctionType>;
|
|
93
|
-
}>, S.Struct<{
|
|
94
|
-
kind: S.Literal<["workflow"]>;
|
|
95
|
-
workflow: Ref$<ComputeGraph>;
|
|
96
|
-
}>, S.Struct<{
|
|
97
|
-
kind: S.Literal<["api"]>;
|
|
98
|
-
/**
|
|
99
|
-
* URL to fetch the openapi schema.
|
|
100
|
-
*/
|
|
101
|
-
schemaUrl: S.optional<typeof S.String>;
|
|
102
|
-
/**
|
|
103
|
-
* Inlined openapi schema.
|
|
104
|
-
*/
|
|
105
|
-
schema: S.optional<typeof S.Any>;
|
|
106
|
-
/**
|
|
107
|
-
* Authorization configuration if required.
|
|
108
|
-
*/
|
|
109
|
-
authorization: S.optional<S.Union<[S.Struct<{
|
|
110
|
-
type: S.Literal<["api-key"]>;
|
|
111
|
-
key: typeof S.String;
|
|
112
|
-
placement: S.Union<[S.Struct<{
|
|
113
|
-
type: S.Literal<["authorization-header"]>;
|
|
114
|
-
}>, S.Struct<{
|
|
115
|
-
type: S.Literal<["query"]>;
|
|
116
|
-
name: typeof S.String;
|
|
117
|
-
}>]>;
|
|
118
|
-
}>, S.Struct<{
|
|
119
|
-
type: S.Literal<["oauth"]>;
|
|
120
|
-
clientId: typeof S.String;
|
|
121
|
-
clientSecret: typeof S.String;
|
|
122
|
-
tokenUrl: typeof S.String;
|
|
123
|
-
grantType: typeof S.String;
|
|
124
|
-
}>]>>;
|
|
125
|
-
}>]>;
|
|
126
|
-
export type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;
|
|
127
|
-
export declare const ServiceType: S.Schema<{
|
|
128
|
-
readonly id: string;
|
|
129
|
-
name?: string | undefined;
|
|
130
|
-
description?: string | undefined;
|
|
131
|
-
serviceId: string;
|
|
132
|
-
enabled?: boolean | undefined;
|
|
133
|
-
interfaces?: readonly ({
|
|
134
|
-
readonly kind: "function";
|
|
135
|
-
readonly fn: Ref<FunctionType>;
|
|
136
|
-
} | {
|
|
137
|
-
readonly kind: "workflow";
|
|
138
|
-
readonly workflow: Ref<ComputeGraph>;
|
|
139
|
-
} | {
|
|
140
|
-
readonly kind: "api";
|
|
141
|
-
readonly schemaUrl?: string | undefined;
|
|
142
|
-
readonly schema?: any;
|
|
143
|
-
readonly authorization?: {
|
|
144
|
-
readonly type: "api-key";
|
|
145
|
-
readonly key: string;
|
|
146
|
-
readonly placement: {
|
|
147
|
-
readonly type: "authorization-header";
|
|
148
|
-
} | {
|
|
149
|
-
readonly type: "query";
|
|
150
|
-
readonly name: string;
|
|
151
|
-
};
|
|
152
|
-
} | {
|
|
153
|
-
readonly type: "oauth";
|
|
154
|
-
readonly clientId: string;
|
|
155
|
-
readonly clientSecret: string;
|
|
156
|
-
readonly tokenUrl: string;
|
|
157
|
-
readonly grantType: string;
|
|
158
|
-
} | undefined;
|
|
159
|
-
})[] | undefined;
|
|
160
|
-
}, {
|
|
161
|
-
readonly id: string;
|
|
162
|
-
name?: string | undefined;
|
|
163
|
-
description?: string | undefined;
|
|
164
|
-
serviceId: string;
|
|
165
|
-
enabled?: boolean | undefined;
|
|
166
|
-
interfaces?: readonly ({
|
|
167
|
-
readonly kind: "function";
|
|
168
|
-
readonly fn: Ref<FunctionType>;
|
|
169
|
-
} | {
|
|
170
|
-
readonly kind: "workflow";
|
|
171
|
-
readonly workflow: Ref<ComputeGraph>;
|
|
172
|
-
} | {
|
|
173
|
-
readonly kind: "api";
|
|
174
|
-
readonly schemaUrl?: string | undefined;
|
|
175
|
-
readonly schema?: any;
|
|
176
|
-
readonly authorization?: {
|
|
177
|
-
readonly type: "api-key";
|
|
178
|
-
readonly key: string;
|
|
179
|
-
readonly placement: {
|
|
180
|
-
readonly type: "authorization-header";
|
|
181
|
-
} | {
|
|
182
|
-
readonly type: "query";
|
|
183
|
-
readonly name: string;
|
|
184
|
-
};
|
|
185
|
-
} | {
|
|
186
|
-
readonly type: "oauth";
|
|
187
|
-
readonly clientId: string;
|
|
188
|
-
readonly clientSecret: string;
|
|
189
|
-
readonly tokenUrl: string;
|
|
190
|
-
readonly grantType: string;
|
|
191
|
-
} | undefined;
|
|
192
|
-
})[] | undefined;
|
|
193
|
-
}, never>;
|
|
194
|
-
export type ServiceType = S.Schema.Type<typeof ServiceType>;
|
|
195
|
-
export {};
|
|
196
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAe,KAAK,IAAI,EAAc,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,oBAAY,cAAc;IACxB,KAAK,IAAI;IACT,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,eAAO,MAAM,gBAAgB;;;;GAM5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;;;;;;;;;;;;;;;;;;AAEhE,qBAAa,eAAgB,SAAQ,oBAInC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,SAAU,SAAQ,cAG7B;CAAG;;;;;;;;AAEL,qBAAa,UAAW,SAAQ,eAI9B;CAAG;AAwBL,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;IAAsD,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AA+BtE,QAAA,MAAM,gBAAgB;;QA3BK,IAAI,CAAC,YAAY,CAAC;;;cAKZ,IAAI,CAAC,YAAY,CAAC;;;IAMjD;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;IAIoG,CAAC;AAC1G,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAY6B,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { S } from '@dxos/echo-schema';
|
|
2
|
-
import { AIChatType } from './schema';
|
|
3
|
-
export declare namespace AutomationAction {
|
|
4
|
-
const Create_base: S.TaggedClass<Create, "dxos.org/plugin/automation/action/create", {
|
|
5
|
-
readonly _tag: S.tag<"dxos.org/plugin/automation/action/create">;
|
|
6
|
-
} & {
|
|
7
|
-
input: S.Struct<{
|
|
8
|
-
name: S.optional<typeof S.String>;
|
|
9
|
-
}>;
|
|
10
|
-
output: S.Struct<{
|
|
11
|
-
object: typeof AIChatType;
|
|
12
|
-
}>;
|
|
13
|
-
}>;
|
|
14
|
-
export class Create extends Create_base {
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,yBAAiB,gBAAgB,CAAC;;;;;;;;;;;IAGhC,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;CACN"}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { Capabilities, IntentPlugin, Surface, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { Message, type Tool } from '@dxos/artifact';
|
|
13
|
-
import { capabilities, genericTools, localServiceEndpoints, type IsObject } from '@dxos/artifact-testing';
|
|
14
|
-
import { AIServiceClientImpl } from '@dxos/assistant';
|
|
15
|
-
import { createStatic, ObjectId } from '@dxos/echo-schema';
|
|
16
|
-
import { EdgeHttpClient } from '@dxos/edge-client';
|
|
17
|
-
import { invariant } from '@dxos/invariant';
|
|
18
|
-
import { DXN, QueueSubspaceTags, SpaceId } from '@dxos/keys';
|
|
19
|
-
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
20
|
-
import { ChessType } from '@dxos/plugin-chess/types';
|
|
21
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
22
|
-
import { MapPlugin } from '@dxos/plugin-map';
|
|
23
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
24
|
-
import { TablePlugin } from '@dxos/plugin-table';
|
|
25
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
26
|
-
import { useQueue } from '@dxos/react-edge-client';
|
|
27
|
-
import { IconButton, Input, Toolbar } from '@dxos/react-ui';
|
|
28
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
29
|
-
import { withLayout, withSignals, withTheme } from '@dxos/storybook-utils';
|
|
30
|
-
|
|
31
|
-
import { Thread, type ThreadProps } from './components';
|
|
32
|
-
import { ChatProcessor } from './hooks';
|
|
33
|
-
import { createProcessorOptions } from './testing';
|
|
34
|
-
import translations from './translations';
|
|
35
|
-
|
|
36
|
-
const endpoints = localServiceEndpoints;
|
|
37
|
-
|
|
38
|
-
type RenderProps = {
|
|
39
|
-
items?: IsObject[];
|
|
40
|
-
prompts?: string[];
|
|
41
|
-
} & Pick<ThreadProps, 'debug'>;
|
|
42
|
-
|
|
43
|
-
// TODO(burdon): Use ChatContainer.
|
|
44
|
-
const Render = ({ items: _items, prompts = [], ...props }: RenderProps) => {
|
|
45
|
-
const space = useSpace();
|
|
46
|
-
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
47
|
-
const tools = useMemo<Tool[]>(
|
|
48
|
-
() => [...genericTools, ...artifactDefinitions.flatMap((definition) => definition.tools)],
|
|
49
|
-
[genericTools, artifactDefinitions],
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const [aiClient] = useState(() => new AIServiceClientImpl({ endpoint: endpoints.ai }));
|
|
53
|
-
const [edgeClient] = useState(() => new EdgeHttpClient(endpoints.edge));
|
|
54
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
55
|
-
const processor = useMemo<ChatProcessor | undefined>(() => {
|
|
56
|
-
if (!space) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return new ChatProcessor(
|
|
61
|
-
aiClient,
|
|
62
|
-
tools,
|
|
63
|
-
{
|
|
64
|
-
space,
|
|
65
|
-
dispatch,
|
|
66
|
-
},
|
|
67
|
-
createProcessorOptions(artifactDefinitions.map((definition) => definition.instructions)),
|
|
68
|
-
);
|
|
69
|
-
}, [aiClient, tools, space, dispatch, artifactDefinitions]);
|
|
70
|
-
|
|
71
|
-
// Queue.
|
|
72
|
-
const [queueDxn, setQueueDxn] = useState(() => randomQueueDxn());
|
|
73
|
-
const queue = useQueue<Message>(edgeClient, DXN.tryParse(queueDxn));
|
|
74
|
-
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (queue?.items.length === 0 && !queue.isLoading && prompts.length > 0) {
|
|
77
|
-
queue.append([
|
|
78
|
-
createStatic(Message, {
|
|
79
|
-
role: 'assistant',
|
|
80
|
-
content: prompts.map(
|
|
81
|
-
(prompt) =>
|
|
82
|
-
({
|
|
83
|
-
type: 'json',
|
|
84
|
-
disposition: 'suggest',
|
|
85
|
-
json: JSON.stringify({ text: prompt }),
|
|
86
|
-
}) as const,
|
|
87
|
-
),
|
|
88
|
-
}),
|
|
89
|
-
]);
|
|
90
|
-
}
|
|
91
|
-
}, [queueDxn, prompts, queue?.items.length, queue?.isLoading]);
|
|
92
|
-
|
|
93
|
-
// State.
|
|
94
|
-
const artifactItems: any[] = []; // TODO(burdon): Query from space.
|
|
95
|
-
const messages = [...(queue?.items ?? []), ...(processor?.messages.value ?? [])];
|
|
96
|
-
|
|
97
|
-
const handleSubmit = processor
|
|
98
|
-
? async (message: string) => {
|
|
99
|
-
invariant(processor);
|
|
100
|
-
if (processor.streaming.value) {
|
|
101
|
-
await processor.cancel();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
invariant(queue);
|
|
105
|
-
await processor.request(message, {
|
|
106
|
-
history: queue.items,
|
|
107
|
-
onComplete: (messages) => {
|
|
108
|
-
queue.append(messages);
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
: undefined;
|
|
113
|
-
|
|
114
|
-
const handleSuggest = useCallback(
|
|
115
|
-
(text: string) => {
|
|
116
|
-
void handleSubmit?.(text);
|
|
117
|
-
},
|
|
118
|
-
[handleSubmit],
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
const handleDelete = useCallback(
|
|
122
|
-
(id: string) => {
|
|
123
|
-
invariant(ObjectId.isValid(id), 'Invalid message id');
|
|
124
|
-
void queue?.delete([id]);
|
|
125
|
-
},
|
|
126
|
-
[queue],
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<div className='grid grid-cols-2 w-full h-full divide-x divide-separator overflow-hidden'>
|
|
131
|
-
{/* Thread */}
|
|
132
|
-
<div className='flex flex-col gap-4 overflow-hidden'>
|
|
133
|
-
<Toolbar.Root classNames='p-2'>
|
|
134
|
-
<Input.Root>
|
|
135
|
-
<Input.TextInput
|
|
136
|
-
spellCheck={false}
|
|
137
|
-
placeholder='Queue DXN'
|
|
138
|
-
value={queueDxn}
|
|
139
|
-
// onClick={() => setQueueDxn('')} Why?????
|
|
140
|
-
onChange={(ev) => setQueueDxn(ev.target.value)}
|
|
141
|
-
/>
|
|
142
|
-
<IconButton
|
|
143
|
-
iconOnly
|
|
144
|
-
label='Copy DXN'
|
|
145
|
-
icon='ph--copy--regular'
|
|
146
|
-
onClick={() => navigator.clipboard.writeText(queueDxn)}
|
|
147
|
-
/>
|
|
148
|
-
<IconButton
|
|
149
|
-
iconOnly
|
|
150
|
-
label='Clear history'
|
|
151
|
-
icon='ph--trash--regular'
|
|
152
|
-
onClick={() => setQueueDxn(randomQueueDxn())}
|
|
153
|
-
/>
|
|
154
|
-
<IconButton iconOnly label='Stop' icon='ph--stop--regular' onClick={() => processor?.cancel()} />
|
|
155
|
-
</Input.Root>
|
|
156
|
-
</Toolbar.Root>
|
|
157
|
-
|
|
158
|
-
<Thread
|
|
159
|
-
messages={messages}
|
|
160
|
-
streaming={processor?.streaming.value}
|
|
161
|
-
onSubmit={processor ? handleSubmit : undefined}
|
|
162
|
-
onSuggest={processor ? handleSuggest : undefined}
|
|
163
|
-
onDelete={processor ? handleDelete : undefined}
|
|
164
|
-
{...props}
|
|
165
|
-
/>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
{/* Artifacts Deck/Mosaic */}
|
|
169
|
-
<div className='overflow-hidden grid grid-rows-[2fr_1fr] divide-y divide-separator'>
|
|
170
|
-
{artifactItems.length > 0 && (
|
|
171
|
-
<div className={mx('flex grow overflow-hidden', artifactItems.length === 1 && 'row-span-2')}>
|
|
172
|
-
<Surface role='canvas-node' limit={1} data={artifactItems[0]} />
|
|
173
|
-
</div>
|
|
174
|
-
)}
|
|
175
|
-
|
|
176
|
-
{artifactItems.length > 1 && (
|
|
177
|
-
<div className='flex shrink-0 overflow-hidden divide-x divide-separator'>
|
|
178
|
-
<div className='flex flex-1 h-full'>
|
|
179
|
-
{artifactItems.slice(1, 3).map((item, idx) => (
|
|
180
|
-
<Surface key={idx} role='canvas-node' limit={1} data={item} />
|
|
181
|
-
))}
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
)}
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
);
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const randomQueueDxn = () =>
|
|
191
|
-
new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, SpaceId.random(), ObjectId.random()]).toString();
|
|
192
|
-
|
|
193
|
-
const meta: Meta<typeof Render> = {
|
|
194
|
-
title: 'plugins/plugin-automation/artifacts',
|
|
195
|
-
render: Render,
|
|
196
|
-
decorators: [
|
|
197
|
-
withSignals,
|
|
198
|
-
withPluginManager({
|
|
199
|
-
plugins: [
|
|
200
|
-
ClientPlugin({
|
|
201
|
-
onClientInitialized: async (_, client) => {
|
|
202
|
-
await client.halo.createIdentity();
|
|
203
|
-
},
|
|
204
|
-
}),
|
|
205
|
-
SpacePlugin({ observability: false }),
|
|
206
|
-
IntentPlugin(),
|
|
207
|
-
ChessPlugin(),
|
|
208
|
-
MapPlugin(),
|
|
209
|
-
TablePlugin(),
|
|
210
|
-
],
|
|
211
|
-
capabilities,
|
|
212
|
-
}),
|
|
213
|
-
withTheme,
|
|
214
|
-
withLayout({ fullscreen: true, tooltips: true }),
|
|
215
|
-
],
|
|
216
|
-
parameters: {
|
|
217
|
-
translations,
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
export default meta;
|
|
222
|
-
|
|
223
|
-
type Story = StoryObj<typeof Render>;
|
|
224
|
-
|
|
225
|
-
export const Default: Story = {
|
|
226
|
-
args: {
|
|
227
|
-
debug: true,
|
|
228
|
-
prompts: ['Ask me a question', 'Show me a chess puzzle'],
|
|
229
|
-
},
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export const WithInitialItems: Story = {
|
|
233
|
-
args: {
|
|
234
|
-
debug: true,
|
|
235
|
-
items: [
|
|
236
|
-
createStatic(ChessType, {
|
|
237
|
-
fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
|
|
238
|
-
}),
|
|
239
|
-
],
|
|
240
|
-
},
|
|
241
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
-
import { AIServiceClientImpl } from '@dxos/assistant';
|
|
7
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
8
|
-
|
|
9
|
-
import { AutomationCapabilities } from './capabilities';
|
|
10
|
-
|
|
11
|
-
// TODO(wittjosiah): Factor out.
|
|
12
|
-
const DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';
|
|
13
|
-
|
|
14
|
-
export default (context: PluginsContext) => {
|
|
15
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
16
|
-
const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
|
|
17
|
-
const aiClient = new AIServiceClientImpl({ endpoint });
|
|
18
|
-
return contributes(AutomationCapabilities.AiClient, aiClient);
|
|
19
|
-
};
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
|
-
import { createExtension, toSignal } from '@dxos/plugin-graph';
|
|
8
|
-
import { memoizeQuery } from '@dxos/plugin-space';
|
|
9
|
-
import { getTypename, parseId, SpaceState } from '@dxos/react-client/echo';
|
|
10
|
-
|
|
11
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
12
|
-
|
|
13
|
-
export default (context: PluginsContext) => {
|
|
14
|
-
const resolve = (typename: string) =>
|
|
15
|
-
context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
16
|
-
|
|
17
|
-
return contributes(Capabilities.AppGraphBuilder, [
|
|
18
|
-
createExtension({
|
|
19
|
-
id: `${AUTOMATION_PLUGIN}/service-registry`,
|
|
20
|
-
resolver: ({ id }) => {
|
|
21
|
-
if (!id.endsWith('~service-registry')) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const type = 'orphan-settings-for-subject';
|
|
26
|
-
const icon = 'ph--plugs--regular';
|
|
27
|
-
|
|
28
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
29
|
-
const [subjectId] = id.split('~');
|
|
30
|
-
const { spaceId } = parseId(subjectId);
|
|
31
|
-
const spaces = toSignal(
|
|
32
|
-
(onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
|
|
33
|
-
() => client.spaces.get(),
|
|
34
|
-
);
|
|
35
|
-
const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);
|
|
36
|
-
return {
|
|
37
|
-
id,
|
|
38
|
-
type,
|
|
39
|
-
data: null,
|
|
40
|
-
properties: {
|
|
41
|
-
icon,
|
|
42
|
-
label: ['service registry label', { ns: AUTOMATION_PLUGIN }],
|
|
43
|
-
object: null,
|
|
44
|
-
space,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
}),
|
|
49
|
-
createExtension({
|
|
50
|
-
id: `${AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
51
|
-
resolver: ({ id }) => {
|
|
52
|
-
if (!id.endsWith('~automation')) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const type = 'orphan-settings-for-subject';
|
|
57
|
-
const icon = 'ph--magic-wand--regular';
|
|
58
|
-
|
|
59
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
60
|
-
const [subjectId] = id.split('~');
|
|
61
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
62
|
-
const spaces = toSignal(
|
|
63
|
-
(onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
|
|
64
|
-
() => client.spaces.get(),
|
|
65
|
-
);
|
|
66
|
-
const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);
|
|
67
|
-
if (!objectId) {
|
|
68
|
-
// TODO(burdon): Ref SPACE_PLUGIN ns.
|
|
69
|
-
const label = space
|
|
70
|
-
? space.properties.name || ['unnamed space label', { ns: AUTOMATION_PLUGIN }]
|
|
71
|
-
: ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];
|
|
72
|
-
|
|
73
|
-
// TODO(wittjosiah): Support comments for arbitrary subjects.
|
|
74
|
-
// This is to ensure that the comments panel is not stuck on an old object.
|
|
75
|
-
return {
|
|
76
|
-
id,
|
|
77
|
-
type,
|
|
78
|
-
data: null,
|
|
79
|
-
properties: {
|
|
80
|
-
icon,
|
|
81
|
-
label,
|
|
82
|
-
showResolvedThreads: false,
|
|
83
|
-
object: null,
|
|
84
|
-
space,
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const [object] = memoizeQuery(space, { id: objectId });
|
|
90
|
-
if (!object || !subjectId) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const meta = resolve(getTypename(object) ?? '');
|
|
95
|
-
const label = meta.label?.(object) ||
|
|
96
|
-
object.name ||
|
|
97
|
-
meta.placeholder || ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
id,
|
|
101
|
-
type,
|
|
102
|
-
data: null,
|
|
103
|
-
properties: {
|
|
104
|
-
icon,
|
|
105
|
-
label,
|
|
106
|
-
object,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
}),
|
|
111
|
-
createExtension({
|
|
112
|
-
id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,
|
|
113
|
-
resolver: ({ id }) => {
|
|
114
|
-
if (!id.endsWith('~assistant')) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
119
|
-
const [subjectId] = id.split('~');
|
|
120
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
121
|
-
const spaces = toSignal(
|
|
122
|
-
(onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
|
|
123
|
-
() => client.spaces.get(),
|
|
124
|
-
);
|
|
125
|
-
const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);
|
|
126
|
-
if (!objectId) {
|
|
127
|
-
// TODO(wittjosiah): Support assistant for arbitrary subjects.
|
|
128
|
-
// This is to ensure that the assistant panel is not stuck on an old object.
|
|
129
|
-
return {
|
|
130
|
-
id,
|
|
131
|
-
type: 'orphan-automation-for-subject',
|
|
132
|
-
data: null,
|
|
133
|
-
properties: {
|
|
134
|
-
icon: 'ph--atom--regular',
|
|
135
|
-
label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],
|
|
136
|
-
object: null,
|
|
137
|
-
space,
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const [object] = memoizeQuery(space, { id: objectId });
|
|
143
|
-
return {
|
|
144
|
-
id,
|
|
145
|
-
type: 'orphan-automation-for-subject',
|
|
146
|
-
data: null,
|
|
147
|
-
properties: {
|
|
148
|
-
icon: 'ph--atom--regular',
|
|
149
|
-
label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],
|
|
150
|
-
object,
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
},
|
|
154
|
-
}),
|
|
155
|
-
]);
|
|
156
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type AIServiceClientImpl } from '@dxos/assistant';
|
|
7
|
-
|
|
8
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace AutomationCapabilities {
|
|
11
|
-
export const AiClient = defineCapability<AIServiceClientImpl>(`${AUTOMATION_PLUGIN}/capability/ai-client`);
|
|
12
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
-
import { ObjectId } from '@dxos/echo-schema';
|
|
7
|
-
import { create, makeRef } from '@dxos/live-object';
|
|
8
|
-
|
|
9
|
-
import { AutomationAction, AIChatType } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () =>
|
|
12
|
-
contributes(
|
|
13
|
-
Capabilities.IntentResolver,
|
|
14
|
-
createResolver({
|
|
15
|
-
intent: AutomationAction.Create,
|
|
16
|
-
resolve: ({ name }) => ({
|
|
17
|
-
data: {
|
|
18
|
-
object: create(AIChatType, {
|
|
19
|
-
name,
|
|
20
|
-
// TODO(burdon): ???
|
|
21
|
-
// new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, SpaceId.random(), ObjectId.random()]).toString(),
|
|
22
|
-
queue: makeRef({ id: ObjectId.random() }),
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
26
|
-
}),
|
|
27
|
-
);
|