@dxos/plugin-automation 0.7.4-staging.f7e8224 → 0.7.5-labs.071a3e2
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-YPD3AGQN.mjs +8 -0
- package/dist/lib/browser/ChatContainer-ODZECATM.mjs +12 -0
- package/dist/lib/browser/ai-client-UJLNYP7B.mjs +22 -0
- package/dist/lib/browser/ai-client-UJLNYP7B.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-3H5TCRG4.mjs +162 -0
- package/dist/lib/browser/app-graph-builder-3H5TCRG4.mjs.map +7 -0
- package/dist/lib/browser/chunk-43WRHV2L.mjs +150 -0
- package/dist/lib/browser/chunk-43WRHV2L.mjs.map +7 -0
- package/dist/lib/browser/chunk-BQHXJZ4K.mjs +15 -0
- package/dist/lib/browser/chunk-BQHXJZ4K.mjs.map +7 -0
- package/dist/lib/browser/chunk-DL7XA62G.mjs +1531 -0
- package/dist/lib/browser/chunk-DL7XA62G.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-DQ7ZSYJJ.mjs} +4 -4
- package/dist/lib/browser/chunk-DQ7ZSYJJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-PQGFC2ZO.mjs +284 -0
- package/dist/lib/browser/chunk-PQGFC2ZO.mjs.map +7 -0
- package/dist/lib/browser/chunk-Z54KIF6H.mjs +242 -0
- package/dist/lib/browser/chunk-Z54KIF6H.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +152 -252
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-5YVZJFS3.mjs +29 -0
- package/dist/lib/browser/intent-resolver-5YVZJFS3.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-WRHRCEV5.mjs +50 -0
- package/dist/lib/browser/react-surface-WRHRCEV5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +12 -3
- package/dist/lib/node/{meta.cjs → AutomationPanel-CO26O75P.cjs} +7 -11
- package/dist/lib/node/AutomationPanel-CO26O75P.cjs.map +7 -0
- package/dist/lib/node/ChatContainer-5URBEXQD.cjs +33 -0
- package/dist/lib/node/ChatContainer-5URBEXQD.cjs.map +7 -0
- package/dist/lib/node/ai-client-AOB6TLNW.cjs +38 -0
- package/dist/lib/node/ai-client-AOB6TLNW.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-CDEQJEHY.cjs +178 -0
- package/dist/lib/node/app-graph-builder-CDEQJEHY.cjs.map +7 -0
- package/dist/lib/node/chunk-AWZVJZ2I.cjs +34 -0
- package/dist/lib/node/chunk-AWZVJZ2I.cjs.map +7 -0
- package/dist/lib/node/chunk-D2QQXWOY.cjs +302 -0
- package/dist/lib/node/chunk-D2QQXWOY.cjs.map +7 -0
- package/dist/lib/node/chunk-H3RSMGJG.cjs +173 -0
- package/dist/lib/node/chunk-H3RSMGJG.cjs.map +7 -0
- package/dist/lib/node/chunk-NH7STAX6.cjs +1515 -0
- package/dist/lib/node/chunk-NH7STAX6.cjs.map +7 -0
- package/dist/lib/node/chunk-OCW5GAVZ.cjs +266 -0
- package/dist/lib/node/chunk-OCW5GAVZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-TQEDPRY5.cjs} +8 -8
- package/dist/lib/node/chunk-TQEDPRY5.cjs.map +7 -0
- package/dist/lib/node/index.cjs +169 -282
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-MJFZT5IU.cjs +44 -0
- package/dist/lib/node/intent-resolver-MJFZT5IU.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-HDAVE6NU.cjs +70 -0
- package/dist/lib/node/react-surface-HDAVE6NU.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +16 -7
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/AutomationPanel-VQZUKPK2.mjs +9 -0
- package/dist/lib/node-esm/AutomationPanel-VQZUKPK2.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-23QIVDG5.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-23QIVDG5.mjs.map +7 -0
- package/dist/lib/node-esm/ai-client-RUCCJ7JZ.mjs +23 -0
- package/dist/lib/node-esm/ai-client-RUCCJ7JZ.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-GR3URVNX.mjs +163 -0
- package/dist/lib/node-esm/app-graph-builder-GR3URVNX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7JO77AAS.mjs +151 -0
- package/dist/lib/node-esm/chunk-7JO77AAS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-JFHI22MF.mjs} +4 -4
- package/dist/lib/node-esm/chunk-JFHI22MF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JJFWFS6P.mjs +1532 -0
- package/dist/lib/node-esm/chunk-JJFWFS6P.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LSSWQIQD.mjs +16 -0
- package/dist/lib/node-esm/chunk-LSSWQIQD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NSVQZ3EH.mjs +243 -0
- package/dist/lib/node-esm/chunk-NSVQZ3EH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VN2AFV25.mjs +285 -0
- package/dist/lib/node-esm/chunk-VN2AFV25.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +152 -252
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-FCKNRTKQ.mjs +30 -0
- package/dist/lib/node-esm/intent-resolver-FCKNRTKQ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-FZ5OFRDE.mjs +51 -0
- package/dist/lib/node-esm/react-surface-FZ5OFRDE.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +12 -3
- package/dist/types/src/AutomationPlugin.d.ts +1 -3
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/artifacts.stories.d.ts +16 -0
- package/dist/types/src/artifacts.stories.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-client.d.ts +5 -0
- package/dist/types/src/capabilities/ai-client.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +5 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +182 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- 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/ChatContainer/ChatContainer.d.ts +7 -0
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer/index.d.ts +4 -0
- package/dist/types/src/components/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts +14 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +8 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownViewer/index.d.ts +2 -0
- package/dist/types/src/components/MarkdownViewer/index.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +6 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +8 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/index.d.ts +2 -0
- package/dist/types/src/components/ServiceRegistry/index.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ScrollContainer.d.ts +15 -0
- package/dist/types/src/components/Thread/ScrollContainer.d.ts.map +1 -0
- package/dist/types/src/components/Thread/StatusLine.d.ts +11 -0
- package/dist/types/src/components/Thread/StatusLine.d.ts.map +1 -0
- package/dist/types/src/components/Thread/StatusLine.stories.d.ts +9 -0
- package/dist/types/src/components/Thread/StatusLine.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Tabbed.d.ts +9 -0
- package/dist/types/src/components/Thread/Tabbed.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Tabbed.stories.d.ts +8 -0
- package/dist/types/src/components/Thread/Tabbed.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.d.ts +11 -0
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts +10 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +12 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ToggleContainer.d.ts +13 -0
- package/dist/types/src/components/Thread/ToggleContainer.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts +9 -0
- package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/index.d.ts +2 -0
- package/dist/types/src/components/Thread/index.d.ts.map +1 -0
- 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 +12 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/email.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/invocation-handler.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +70 -0
- package/dist/types/src/hooks/processor.d.ts.map +1 -0
- package/dist/types/src/hooks/processor.test.d.ts +2 -0
- package/dist/types/src/hooks/processor.test.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -0
- package/dist/types/src/hooks/useMessageQueue.d.ts +41 -0
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -0
- package/dist/types/src/hooks/useServices.d.ts +7 -0
- package/dist/types/src/hooks/useServices.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/{testing.d.ts → test-functions.d.ts} +3 -1
- package/dist/types/src/testing/test-functions.d.ts.map +1 -0
- package/dist/types/src/testing/test-services.d.ts +5 -0
- package/dist/types/src/testing/test-services.d.ts.map +1 -0
- package/dist/types/src/tools/function.d.ts +5 -0
- package/dist/types/src/tools/function.d.ts.map +1 -0
- package/dist/types/src/tools/index.d.ts +3 -0
- package/dist/types/src/tools/index.d.ts.map +1 -0
- package/dist/types/src/tools/openapi.d.ts +10 -0
- package/dist/types/src/tools/openapi.d.ts.map +1 -0
- package/dist/types/src/tools/openapi.test.d.ts +2 -0
- package/dist/types/src/tools/openapi.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +81 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/registry.d.ts +10 -0
- package/dist/types/src/types/registry.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +189 -39
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +16 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +54 -48
- package/src/AutomationPlugin.tsx +77 -194
- package/src/artifacts.stories.tsx +241 -0
- package/src/capabilities/ai-client.ts +19 -0
- package/src/capabilities/app-graph-builder.ts +156 -0
- package/src/capabilities/capabilities.ts +12 -0
- package/src/capabilities/index.ts +12 -0
- package/src/capabilities/intent-resolver.ts +27 -0
- package/src/capabilities/react-surface.tsx +36 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -2
- package/src/components/AutomationPanel/AutomationPanel.tsx +61 -39
- package/src/components/ChatContainer/ChatContainer.tsx +52 -0
- package/src/components/ChatContainer/index.ts +8 -0
- package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +56 -0
- package/src/components/MarkdownViewer/MarkdownViewer.tsx +79 -0
- package/src/components/MarkdownViewer/index.ts +5 -0
- package/src/components/PromptEditor/PromptEditor.stories.tsx +3 -3
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +75 -0
- package/src/components/ServiceRegistry/index.ts +5 -0
- package/src/components/Thread/ScrollContainer.tsx +92 -0
- package/src/components/Thread/StatusLine.stories.tsx +52 -0
- package/src/components/Thread/StatusLine.tsx +76 -0
- package/src/components/Thread/Tabbed.stories.tsx +52 -0
- package/src/components/Thread/Tabbed.tsx +72 -0
- package/src/components/Thread/Thread.stories.tsx +190 -0
- package/src/components/Thread/Thread.tsx +156 -0
- package/src/components/Thread/ThreadMessage.tsx +203 -0
- package/src/components/Thread/ToggleContainer.stories.tsx +111 -0
- package/src/components/Thread/ToggleContainer.tsx +103 -0
- package/src/components/Thread/index.ts +5 -0
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -2
- package/src/components/TriggerEditor/TriggerEditor.tsx +81 -16
- package/src/components/index.ts +9 -1
- package/src/hooks/email.ts +2 -2
- package/src/hooks/index.ts +5 -0
- package/src/hooks/invocation-handler.ts +2 -2
- package/src/hooks/processor.test.ts +15 -0
- package/src/hooks/processor.ts +210 -0
- package/src/hooks/useChatProcessor.tsx +86 -0
- package/src/hooks/useMessageQueue.ts +23 -0
- package/src/hooks/useServices.ts +28 -0
- package/src/index.ts +1 -4
- package/src/meta.ts +3 -2
- package/src/testing/index.ts +2 -1
- package/src/testing/{testing.ts → test-functions.ts} +9 -2
- package/src/testing/test-services.ts +131 -0
- package/src/tools/function.ts +47 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/openapi.test.ts +227 -0
- package/src/tools/openapi.ts +331 -0
- package/src/translations.ts +17 -2
- package/src/types/index.ts +1 -0
- package/src/types/registry.ts +26 -0
- package/src/types/schema.ts +96 -2
- package/src/types/types.ts +15 -21
- package/dist/lib/browser/AssistantPanel-N3QSALKY.mjs +0 -341
- package/dist/lib/browser/AssistantPanel-N3QSALKY.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs +0 -153
- package/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs.map +0 -7
- package/dist/lib/browser/chunk-7KB4UMXO.mjs +0 -49
- package/dist/lib/browser/chunk-7KB4UMXO.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/node/AssistantPanel-RIA4TI3B.cjs +0 -361
- package/dist/lib/node/AssistantPanel-RIA4TI3B.cjs.map +0 -7
- package/dist/lib/node/AutomationPanel-HZS5WKI5.cjs +0 -173
- package/dist/lib/node/AutomationPanel-HZS5WKI5.cjs.map +0 -7
- package/dist/lib/node/chunk-CUCUWUAF.cjs +0 -73
- package/dist/lib/node/chunk-CUCUWUAF.cjs.map +0 -7
- package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs +0 -342
- package/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs +0 -154
- package/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-23LY7DYS.mjs +0 -51
- package/dist/lib/node-esm/chunk-23LY7DYS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts +0 -8
- package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts.map +0 -1
- package/dist/types/src/components/AssistantPanel/index.d.ts +0 -3
- package/dist/types/src/components/AssistantPanel/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantPanel/system-instructions.d.ts +0 -6
- package/dist/types/src/components/AssistantPanel/system-instructions.d.ts.map +0 -1
- package/dist/types/src/testing/testing.d.ts.map +0 -1
- package/src/components/AssistantPanel/AssistantPanel.tsx +0 -230
- package/src/components/AssistantPanel/index.ts +0 -7
- package/src/components/AssistantPanel/system-instructions.ts +0 -166
- /package/dist/lib/browser/{meta.mjs.map → AutomationPanel-YPD3AGQN.mjs.map} +0 -0
- /package/dist/lib/{node-esm/meta.mjs.map → browser/ChatContainer-ODZECATM.mjs.map} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChatContainer,
|
|
3
|
+
ChatContainer_default
|
|
4
|
+
} from "./chunk-DL7XA62G.mjs";
|
|
5
|
+
import "./chunk-BQHXJZ4K.mjs";
|
|
6
|
+
import "./chunk-43WRHV2L.mjs";
|
|
7
|
+
import "./chunk-DQ7ZSYJJ.mjs";
|
|
8
|
+
export {
|
|
9
|
+
ChatContainer,
|
|
10
|
+
ChatContainer_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ChatContainer-ODZECATM.mjs.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationCapabilities
|
|
3
|
+
} from "./chunk-BQHXJZ4K.mjs";
|
|
4
|
+
import "./chunk-DQ7ZSYJJ.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-UJLNYP7B.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_PLUGIN
|
|
3
|
+
} from "./chunk-DQ7ZSYJJ.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-3H5TCRG4.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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": ";;;;;AAIA,SAASA,cAAcC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AASjB,QAAQkB,kBAAkBC,mBAAmBC,MAAM;AAClE,cAAM,CAACC,SAAAA,IAAad,GAAGe,MAAM,GAAA;AAC7B,cAAM,EAAEC,SAASiB,SAAQ,IAAKhB,QAAQH,SAAAA;AACtC,cAAMI,SAASC,SACb,CAACC,aAAaV,OAAOQ,OAAOG,UAAU,MAAMD,SAAAA,CAAAA,EAAYE,aACxD,MAAMZ,OAAOQ,OAAOK,IAAG,CAAA;AAEzB,cAAMC,QAAQN,QAAQnB,KAAK,CAACyB,WAAUA,OAAMxB,OAAOgB,WAAWQ,OAAMC,MAAMF,IAAG,MAAOG,WAAWC,WAAW;AAC1G,YAAI,CAACM,UAAU;AAGb,iBAAO;YACLjC;YACAQ,MAAM;YACNoB,MAAM;YACNC,YAAY;cACVpB,MAAM;cACNqB,OAAO;gBAAC;gBAAyB;kBAAEC,IAAI1B;gBAAkB;;cACzD2B,QAAQ;cACRR;YACF;UACF;QACF;AAEA,cAAM,CAACQ,MAAAA,IAAUI,aAAaZ,OAAO;UAAExB,IAAIiC;QAAS,CAAA;AACpD,eAAO;UACLjC;UACAQ,MAAM;UACNoB,MAAM;UACNC,YAAY;YACVpB,MAAM;YACNqB,OAAO;cAAC;cAAyB;gBAAEC,IAAI1B;cAAkB;;YACzD2B;UACF;QACF;MACF;IACF,CAAA;GACD;AACH;",
|
|
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
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_PLUGIN
|
|
3
|
+
} from "./chunk-DQ7ZSYJJ.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/experimental/plugin-automation/src/types/registry.ts
|
|
6
|
+
var categoryIcons = {
|
|
7
|
+
finance: "ph--bank--regular",
|
|
8
|
+
health: "ph--heart--regular",
|
|
9
|
+
geolocation: "ph--globe-simple--regular",
|
|
10
|
+
education: "ph--books--regular",
|
|
11
|
+
entertainment: "ph--music-notes--regular",
|
|
12
|
+
shopping: "ph--shopping-cart--regular",
|
|
13
|
+
travel: "ph--airplane-takeoff--regular",
|
|
14
|
+
utilities: "ph--lightning--regular",
|
|
15
|
+
weather: "ph--cloud-rain--regular"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// packages/plugins/experimental/plugin-automation/src/types/schema.ts
|
|
19
|
+
import { ComputeGraph } from "@dxos/conductor";
|
|
20
|
+
import { Expando, Ref, S, TypedObject } from "@dxos/echo-schema";
|
|
21
|
+
import { FunctionType } from "@dxos/functions";
|
|
22
|
+
var ChainInputType;
|
|
23
|
+
(function(ChainInputType2) {
|
|
24
|
+
ChainInputType2[ChainInputType2["VALUE"] = 0] = "VALUE";
|
|
25
|
+
ChainInputType2[ChainInputType2["PASS_THROUGH"] = 1] = "PASS_THROUGH";
|
|
26
|
+
ChainInputType2[ChainInputType2["RETRIEVER"] = 2] = "RETRIEVER";
|
|
27
|
+
ChainInputType2[ChainInputType2["FUNCTION"] = 3] = "FUNCTION";
|
|
28
|
+
ChainInputType2[ChainInputType2["QUERY"] = 4] = "QUERY";
|
|
29
|
+
ChainInputType2[ChainInputType2["RESOLVER"] = 5] = "RESOLVER";
|
|
30
|
+
ChainInputType2[ChainInputType2["CONTEXT"] = 6] = "CONTEXT";
|
|
31
|
+
ChainInputType2[ChainInputType2["SCHEMA"] = 7] = "SCHEMA";
|
|
32
|
+
})(ChainInputType || (ChainInputType = {}));
|
|
33
|
+
var ChainInputSchema = S.mutable(S.Struct({
|
|
34
|
+
name: S.String,
|
|
35
|
+
type: S.optional(S.Enums(ChainInputType)),
|
|
36
|
+
value: S.optional(S.String)
|
|
37
|
+
}));
|
|
38
|
+
var ChainPromptType = class extends TypedObject({
|
|
39
|
+
typename: "dxos.org/type/ChainPrompt",
|
|
40
|
+
version: "0.1.0"
|
|
41
|
+
})({
|
|
42
|
+
command: S.optional(S.String),
|
|
43
|
+
template: S.String,
|
|
44
|
+
inputs: S.optional(S.mutable(S.Array(ChainInputSchema)))
|
|
45
|
+
}) {
|
|
46
|
+
};
|
|
47
|
+
var ChainType = class extends TypedObject({
|
|
48
|
+
typename: "dxos.org/type/Chain",
|
|
49
|
+
version: "0.1.0"
|
|
50
|
+
})({
|
|
51
|
+
name: S.optional(S.String),
|
|
52
|
+
prompts: S.optional(S.mutable(S.Array(Ref(ChainPromptType))))
|
|
53
|
+
}) {
|
|
54
|
+
};
|
|
55
|
+
var AIChatType = class extends TypedObject({
|
|
56
|
+
typename: "dxos.org/type/AIChat",
|
|
57
|
+
version: "0.1.0"
|
|
58
|
+
})({
|
|
59
|
+
name: S.optional(S.String),
|
|
60
|
+
// TODO(wittjosiah): Should be a ref to a Queue.
|
|
61
|
+
queue: Ref(Expando)
|
|
62
|
+
}) {
|
|
63
|
+
};
|
|
64
|
+
var ApiAuthorizationKey = S.Struct({
|
|
65
|
+
type: S.Literal("api-key"),
|
|
66
|
+
key: S.String,
|
|
67
|
+
placement: S.Union(S.Struct({
|
|
68
|
+
type: S.Literal("authorization-header")
|
|
69
|
+
}), S.Struct({
|
|
70
|
+
type: S.Literal("query"),
|
|
71
|
+
name: S.String
|
|
72
|
+
}))
|
|
73
|
+
});
|
|
74
|
+
var ApiAuthorizationOauth = S.Struct({
|
|
75
|
+
type: S.Literal("oauth"),
|
|
76
|
+
clientId: S.String,
|
|
77
|
+
clientSecret: S.String,
|
|
78
|
+
tokenUrl: S.String,
|
|
79
|
+
grantType: S.String
|
|
80
|
+
});
|
|
81
|
+
var ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
|
|
82
|
+
var ServiceInterfaceFunction = S.Struct({
|
|
83
|
+
kind: S.Literal("function"),
|
|
84
|
+
fn: Ref(FunctionType)
|
|
85
|
+
});
|
|
86
|
+
var ServiceInterfaceWorkflow = S.Struct({
|
|
87
|
+
kind: S.Literal("workflow"),
|
|
88
|
+
workflow: Ref(ComputeGraph)
|
|
89
|
+
});
|
|
90
|
+
var ServiceInterfaceApi = S.Struct({
|
|
91
|
+
kind: S.Literal("api"),
|
|
92
|
+
/**
|
|
93
|
+
* URL to fetch the openapi schema.
|
|
94
|
+
*/
|
|
95
|
+
schemaUrl: S.optional(S.String),
|
|
96
|
+
/**
|
|
97
|
+
* Inlined openapi schema.
|
|
98
|
+
*/
|
|
99
|
+
schema: S.optional(S.Any),
|
|
100
|
+
/**
|
|
101
|
+
* Authorization configuration if required.
|
|
102
|
+
*/
|
|
103
|
+
authorization: S.optional(ApiAuthorization)
|
|
104
|
+
});
|
|
105
|
+
var ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
|
|
106
|
+
var ServiceType = class extends TypedObject({
|
|
107
|
+
typename: "dxos.org/type/ServiceType",
|
|
108
|
+
version: "0.1.0"
|
|
109
|
+
})({
|
|
110
|
+
serviceId: S.String,
|
|
111
|
+
name: S.optional(S.String),
|
|
112
|
+
description: S.optional(S.String),
|
|
113
|
+
category: S.optional(S.String),
|
|
114
|
+
enabled: S.optional(S.Boolean),
|
|
115
|
+
/**
|
|
116
|
+
* Entries exposed: functions, workflows, and APIs.
|
|
117
|
+
*/
|
|
118
|
+
interfaces: S.optional(S.Array(ServiceInterface))
|
|
119
|
+
}) {
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// packages/plugins/experimental/plugin-automation/src/types/types.ts
|
|
123
|
+
import { S as S2 } from "@dxos/echo-schema";
|
|
124
|
+
var AutomationAction;
|
|
125
|
+
(function(AutomationAction2) {
|
|
126
|
+
const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
|
|
127
|
+
class Create extends S2.TaggedClass()(`${AUTOMATION_ACTION}/create`, {
|
|
128
|
+
input: S2.Struct({
|
|
129
|
+
name: S2.optional(S2.String)
|
|
130
|
+
}),
|
|
131
|
+
output: S2.Struct({
|
|
132
|
+
object: AIChatType
|
|
133
|
+
})
|
|
134
|
+
}) {
|
|
135
|
+
}
|
|
136
|
+
AutomationAction2.Create = Create;
|
|
137
|
+
})(AutomationAction || (AutomationAction = {}));
|
|
138
|
+
|
|
139
|
+
export {
|
|
140
|
+
categoryIcons,
|
|
141
|
+
ChainInputType,
|
|
142
|
+
ChainInputSchema,
|
|
143
|
+
ChainPromptType,
|
|
144
|
+
ChainType,
|
|
145
|
+
AIChatType,
|
|
146
|
+
ApiAuthorization,
|
|
147
|
+
ServiceType,
|
|
148
|
+
AutomationAction
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=chunk-43WRHV2L.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/registry.ts", "../../../src/types/schema.ts", "../../../src/types/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ServiceType } from './schema';\n\nexport type ServiceQuery = {\n name?: string;\n category?: string;\n};\n\nexport interface BaseServiceRegistry {\n queryServices(query?: ServiceQuery): Promise<ServiceType[]>;\n}\n\nexport const categoryIcons: Record<string, string> = {\n finance: 'ph--bank--regular',\n health: 'ph--heart--regular',\n geolocation: 'ph--globe-simple--regular',\n education: 'ph--books--regular',\n entertainment: 'ph--music-notes--regular',\n shopping: 'ph--shopping-cart--regular',\n travel: 'ph--airplane-takeoff--regular',\n utilities: 'ph--lightning--regular',\n weather: 'ph--cloud-rain--regular',\n} as const;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Expando, Ref, S, TypedObject, type Ref$ } from '@dxos/echo-schema';\nimport { FunctionType } from '@dxos/functions';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum ChainInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const ChainInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(ChainInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type ChainInput = S.Schema.Type<typeof ChainInputSchema>;\n\nexport class ChainPromptType extends TypedObject({ typename: 'dxos.org/type/ChainPrompt', version: '0.1.0' })({\n command: S.optional(S.String),\n template: S.String,\n inputs: S.optional(S.mutable(S.Array(ChainInputSchema))),\n}) {}\n\nexport class ChainType extends TypedObject({ typename: 'dxos.org/type/Chain', version: '0.1.0' })({\n name: S.optional(S.String),\n prompts: S.optional(S.mutable(S.Array(Ref(ChainPromptType)))),\n}) {}\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n name: S.optional(S.String),\n // TODO(wittjosiah): Should be a ref to a Queue.\n queue: Ref(Expando),\n}) {}\n\nconst ApiAuthorizationKey = S.Struct({\n type: S.Literal('api-key'),\n key: S.String,\n placement: S.Union(\n S.Struct({\n type: S.Literal('authorization-header'),\n }),\n S.Struct({\n type: S.Literal('query'),\n name: S.String,\n }),\n ),\n});\n\nconst ApiAuthorizationOauth = S.Struct({\n type: S.Literal('oauth'),\n clientId: S.String,\n clientSecret: S.String,\n tokenUrl: S.String,\n grantType: S.String,\n});\n\nexport const ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);\nexport type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = S.Struct({\n kind: S.Literal('function'),\n fn: Ref(FunctionType) as Ref$<FunctionType>,\n});\n\nconst ServiceInterfaceWorkflow = S.Struct({\n kind: S.Literal('workflow'),\n workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,\n});\n\nconst ServiceInterfaceApi = S.Struct({\n kind: S.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: S.optional(S.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: S.optional(S.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: S.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);\nexport type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;\n\n// export const ServiceType = S.Struct({\n// serviceId: S.String,\n// name: S.optional(S.String),\n// description: S.optional(S.String),\n// category: S.optional(S.String),\n// enabled: S.optional(S.Boolean),\n\n// /**\n// * Entries exposed: functions, workflows, and APIs.\n// */\n// interfaces: S.optional(S.Array(ServiceInterface)),\n// }).pipe(EchoObject('dxos.org/type/Service', '0.1.0'));\n// dxn:type:dxos.org/type/Service\n\n// export type ServiceType = S.Schema.Type<typeof ServiceType>;\n\nexport class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({\n serviceId: S.String,\n name: S.optional(S.String),\n description: S.optional(S.String),\n category: S.optional(S.String),\n enabled: S.optional(S.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: S.optional(S.Array(ServiceInterface)),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { AIChatType } from './schema';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport namespace AutomationAction {\n const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${AUTOMATION_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: AIChatType,\n }),\n }) {}\n}\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ASN,EAAEI,MAAM;EAC7B+C,SAASnD,EAAEM,SAASN,EAAEoD,OAAO;;;;EAK7BC,YAAYrD,EAAEM,SAASN,EAAEgB,MAAM8B,gBAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;AC/HJ,SAASQ,KAAAA,UAAS;;UAKDC,mBAAAA;AACf,QAAMC,oBAAoB,GAAGC,iBAAAA;EAEtB,MAAMC,eAAeC,GAAEC,YAAW,EAAW,GAAGJ,iBAAAA,WAA4B;IACjFK,OAAOF,GAAEG,OAAO;MACdC,MAAMJ,GAAEK,SAASL,GAAEM,MAAM;IAC3B,CAAA;IACAC,QAAQP,GAAEG,OAAO;MACfK,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;oBAPSV,SAAAA;AAQf,GAXiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["categoryIcons", "finance", "health", "geolocation", "education", "entertainment", "shopping", "travel", "utilities", "weather", "ComputeGraph", "Expando", "Ref", "S", "TypedObject", "FunctionType", "ChainInputType", "ChainInputSchema", "S", "mutable", "Struct", "name", "String", "type", "optional", "Enums", "value", "ChainPromptType", "TypedObject", "typename", "version", "command", "template", "inputs", "Array", "ChainType", "prompts", "Ref", "AIChatType", "queue", "Expando", "ApiAuthorizationKey", "Literal", "key", "placement", "Union", "ApiAuthorizationOauth", "clientId", "clientSecret", "tokenUrl", "grantType", "ApiAuthorization", "ServiceInterfaceFunction", "kind", "fn", "FunctionType", "ServiceInterfaceWorkflow", "workflow", "ComputeGraph", "ServiceInterfaceApi", "schemaUrl", "schema", "Any", "authorization", "ServiceInterface", "ServiceType", "serviceId", "description", "category", "enabled", "Boolean", "interfaces", "S", "AutomationAction", "AUTOMATION_ACTION", "AUTOMATION_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "output", "object", "AIChatType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_PLUGIN
|
|
3
|
+
} from "./chunk-DQ7ZSYJJ.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/experimental/plugin-automation/src/capabilities/capabilities.ts
|
|
6
|
+
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
+
var AutomationCapabilities;
|
|
8
|
+
(function(AutomationCapabilities2) {
|
|
9
|
+
AutomationCapabilities2.AiClient = defineCapability(`${AUTOMATION_PLUGIN}/capability/ai-client`);
|
|
10
|
+
})(AutomationCapabilities || (AutomationCapabilities = {}));
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
AutomationCapabilities
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-BQHXJZ4K.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type AIServiceClientImpl } from '@dxos/assistant';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport namespace AutomationCapabilities {\n export const AiClient = defineCapability<AIServiceClientImpl>(`${AUTOMATION_PLUGIN}/capability/ai-client`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAKhBC,yBAAAA;0BACFC,WAAWC,iBAAsC,GAAGC,iBAAAA,uBAAwC;AAC3G,GAFiBH,2BAAAA,yBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["defineCapability", "AutomationCapabilities", "AiClient", "defineCapability", "AUTOMATION_PLUGIN"]
|
|
7
|
+
}
|