@dxos/plugin-automation 0.7.5-main.ff8607b → 0.7.5-staging.b81e783
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-NCKK3CFN.mjs +8 -0
- package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-AZPLZJ5H.mjs +12 -0
- package/dist/lib/browser/ChatContainer-AZPLZJ5H.mjs.map +7 -0
- package/dist/lib/browser/ai-client-T2PBJISL.mjs +22 -0
- package/dist/lib/browser/ai-client-T2PBJISL.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-F22H4YBQ.mjs +111 -0
- package/dist/lib/browser/app-graph-builder-F22H4YBQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-67KDIIM6.mjs +15 -0
- package/dist/lib/browser/chunk-67KDIIM6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DQ7ZSYJJ.mjs → chunk-HZSTXZWK.mjs} +3 -1
- package/dist/lib/browser/chunk-HZSTXZWK.mjs.map +7 -0
- package/dist/lib/browser/chunk-L2YLAKCS.mjs +151 -0
- package/dist/lib/browser/chunk-L2YLAKCS.mjs.map +7 -0
- package/dist/lib/{node-esm/AutomationPanel-MW42U6I4.mjs → browser/chunk-LJ7F4KDM.mjs} +26 -15
- package/dist/lib/browser/chunk-LJ7F4KDM.mjs.map +7 -0
- package/dist/lib/browser/chunk-M4MWUOUC.mjs +382 -0
- package/dist/lib/browser/chunk-M4MWUOUC.mjs.map +7 -0
- package/dist/lib/browser/chunk-U435IUIA.mjs +1775 -0
- package/dist/lib/browser/chunk-U435IUIA.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +127 -42
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-MONKAKTY.mjs +30 -0
- package/dist/lib/browser/intent-resolver-MONKAKTY.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-7QWCWE4K.mjs +58 -0
- package/dist/lib/browser/react-surface-7QWCWE4K.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +14 -3
- package/dist/lib/node/AutomationPanel-6COLKRIB.cjs +26 -0
- package/dist/lib/node/AutomationPanel-6COLKRIB.cjs.map +7 -0
- package/dist/lib/node/ChatContainer-SBEUFMQ3.cjs +33 -0
- package/dist/lib/node/ChatContainer-SBEUFMQ3.cjs.map +7 -0
- package/dist/lib/node/ai-client-L5GUSAER.cjs +38 -0
- package/dist/lib/node/ai-client-L5GUSAER.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-OCSH5R6U.cjs +123 -0
- package/dist/lib/node/app-graph-builder-OCSH5R6U.cjs.map +7 -0
- package/dist/lib/node/{chunk-TQEDPRY5.cjs → chunk-BAQRBGOJ.cjs} +7 -4
- package/dist/lib/node/chunk-BAQRBGOJ.cjs.map +7 -0
- package/dist/lib/node/chunk-BZFAEBME.cjs +1747 -0
- package/dist/lib/node/chunk-BZFAEBME.cjs.map +7 -0
- package/dist/lib/node/chunk-K3F5JNZ6.cjs +394 -0
- package/dist/lib/node/chunk-K3F5JNZ6.cjs.map +7 -0
- package/dist/lib/node/chunk-NUOYHYAF.cjs +174 -0
- package/dist/lib/node/chunk-NUOYHYAF.cjs.map +7 -0
- package/dist/lib/node/{AutomationPanel-H5WE4FIU.cjs → chunk-V4L7LTWM.cjs} +34 -18
- package/dist/lib/node/chunk-V4L7LTWM.cjs.map +7 -0
- package/dist/lib/node/chunk-VNBYGJ4K.cjs +34 -0
- package/dist/lib/node/chunk-VNBYGJ4K.cjs.map +7 -0
- package/dist/lib/node/index.cjs +157 -86
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-KQGTYVF2.cjs +45 -0
- package/dist/lib/node/intent-resolver-KQGTYVF2.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-S6U5ISJ6.cjs → react-surface-IXKIJFRP.cjs} +31 -12
- package/dist/lib/node/react-surface-IXKIJFRP.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +17 -6
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs +9 -0
- package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-JCDLYMDZ.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-JCDLYMDZ.mjs.map +7 -0
- package/dist/lib/node-esm/ai-client-45LZLW7V.mjs +23 -0
- package/dist/lib/node-esm/ai-client-45LZLW7V.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-XSM7DETF.mjs +112 -0
- package/dist/lib/node-esm/app-graph-builder-XSM7DETF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-53FFD4VO.mjs +1776 -0
- package/dist/lib/node-esm/chunk-53FFD4VO.mjs.map +7 -0
- package/dist/lib/{browser/AutomationPanel-KT3YFV56.mjs → node-esm/chunk-AWAU4BHR.mjs} +27 -14
- package/dist/lib/node-esm/chunk-AWAU4BHR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JFHI22MF.mjs → chunk-IG4GSWZN.mjs} +3 -1
- package/dist/lib/node-esm/chunk-IG4GSWZN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-K5NNSGIV.mjs +152 -0
- package/dist/lib/node-esm/chunk-K5NNSGIV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RAT3GSJP.mjs +383 -0
- package/dist/lib/node-esm/chunk-RAT3GSJP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SS7U6GCX.mjs +16 -0
- package/dist/lib/node-esm/chunk-SS7U6GCX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +127 -42
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-XSZRLU6V.mjs +31 -0
- package/dist/lib/node-esm/intent-resolver-XSZRLU6V.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-FZAAAXGR.mjs +59 -0
- package/dist/lib/node-esm/react-surface-FZAAAXGR.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +14 -3
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- 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 +23 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- 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 +3 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +7 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +8 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/AmbientDialog/index.d.ts +2 -0
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/AssistantDialog/AssistantDialog.d.ts +6 -0
- package/dist/types/src/components/AssistantDialog/AssistantDialog.d.ts.map +1 -0
- package/dist/types/src/components/AssistantDialog/index.d.ts +2 -0
- package/dist/types/src/components/AssistantDialog/index.d.ts.map +1 -0
- 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/ChatContainer/ChatContainer.d.ts +6 -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/Prompt/Prompt.d.ts +13 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +9 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/PromptBar.d.ts +10 -0
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/autocomplete.d.ts +21 -0
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/index.d.ts +3 -0
- package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +1 -2
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +1 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +5 -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/Thread.d.ts +15 -0
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts +11 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +8 -0
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +15 -0
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +13 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +13 -0
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +1 -0
- package/dist/types/src/components/Thread/index.d.ts +3 -0
- package/dist/types/src/components/Thread/index.d.ts.map +1 -0
- package/dist/types/src/components/Thread/reducer.d.ts +12 -0
- package/dist/types/src/components/Thread/reducer.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +19 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +8 -0
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/index.d.ts +2 -0
- package/dist/types/src/components/Toolbox/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/index.d.ts +13 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +75 -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/hooks/useTextInputEvents.d.ts +13 -0
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +1 -0
- 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 +95 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -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 +161 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +19 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/package.json +59 -40
- package/src/AutomationPlugin.tsx +51 -14
- package/src/capabilities/ai-client.ts +19 -0
- package/src/capabilities/app-graph-builder.ts +83 -110
- package/src/capabilities/capabilities.ts +12 -0
- package/src/capabilities/index.ts +4 -0
- package/src/capabilities/intent-resolver.ts +26 -0
- package/src/capabilities/react-surface.tsx +21 -6
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +81 -0
- package/src/components/AmbientDialog/AmbientDialog.tsx +103 -0
- package/src/components/AmbientDialog/index.ts +5 -0
- package/src/components/AssistantDialog/AssistantDialog.tsx +23 -0
- package/src/components/AssistantDialog/index.ts +5 -0
- package/src/components/ChatContainer/ChatContainer.tsx +19 -0
- package/src/components/ChatContainer/index.ts +9 -0
- package/src/components/Prompt/Prompt.stories.tsx +79 -0
- package/src/components/Prompt/Prompt.tsx +79 -0
- package/src/components/Prompt/PromptBar.tsx +100 -0
- package/src/components/Prompt/autocomplete.ts +212 -0
- package/src/components/Prompt/index.ts +6 -0
- package/src/components/PromptEditor/PromptEditor.stories.tsx +3 -3
- package/src/components/PromptEditor/PromptEditor.tsx +3 -3
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +76 -0
- package/src/components/ServiceRegistry/index.ts +5 -0
- package/src/components/Thread/Thread.stories.tsx +210 -0
- package/src/components/Thread/Thread.tsx +106 -0
- package/src/components/Thread/ThreadContainer.stories.tsx +245 -0
- package/src/components/Thread/ThreadContainer.tsx +67 -0
- package/src/components/Thread/ThreadMessage.tsx +187 -0
- package/src/components/Thread/ToolInvocations.tsx +86 -0
- package/src/components/Thread/index.ts +6 -0
- package/src/components/Thread/reducer.ts +52 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +66 -0
- package/src/components/Toolbox/Toolbox.tsx +89 -0
- package/src/components/Toolbox/index.ts +5 -0
- package/src/components/TriggerEditor/TriggerEditor.tsx +18 -11
- package/src/components/index.ts +10 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/processor.test.ts +15 -0
- package/src/hooks/processor.ts +218 -0
- package/src/hooks/useChatProcessor.tsx +75 -0
- package/src/hooks/useMessageQueue.ts +23 -0
- package/src/hooks/useServices.ts +28 -0
- package/src/hooks/useTextInputEvents.ts +49 -0
- package/src/meta.ts +2 -0
- 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 +224 -0
- package/src/tools/openapi.ts +331 -0
- package/src/translations.ts +17 -2
- package/src/types/index.ts +2 -0
- package/src/types/registry.ts +26 -0
- package/src/types/schema.ts +95 -1
- package/src/types/types.ts +22 -0
- package/src/typings.d.ts +9 -0
- package/dist/lib/browser/AssistantPanel-NTOUHOWA.mjs +0 -339
- package/dist/lib/browser/AssistantPanel-NTOUHOWA.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-KT3YFV56.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs +0 -131
- package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ODBJDXM.mjs +0 -10
- package/dist/lib/browser/chunk-4ODBJDXM.mjs.map +0 -7
- package/dist/lib/browser/chunk-DL6LB2NI.mjs +0 -43
- package/dist/lib/browser/chunk-DL6LB2NI.mjs.map +0 -7
- package/dist/lib/browser/chunk-DQ7ZSYJJ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-5YTE5MRE.mjs +0 -34
- package/dist/lib/browser/react-surface-5YTE5MRE.mjs.map +0 -7
- package/dist/lib/node/AssistantPanel-U7GDWPRC.cjs +0 -359
- package/dist/lib/node/AssistantPanel-U7GDWPRC.cjs.map +0 -7
- package/dist/lib/node/AutomationPanel-H5WE4FIU.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-65TBXO3I.cjs +0 -147
- package/dist/lib/node/app-graph-builder-65TBXO3I.cjs.map +0 -7
- package/dist/lib/node/chunk-JNDMZQH7.cjs +0 -68
- package/dist/lib/node/chunk-JNDMZQH7.cjs.map +0 -7
- package/dist/lib/node/chunk-JUSXT4U5.cjs +0 -43
- package/dist/lib/node/chunk-JUSXT4U5.cjs.map +0 -7
- package/dist/lib/node/chunk-TQEDPRY5.cjs.map +0 -7
- package/dist/lib/node/react-surface-S6U5ISJ6.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantPanel-M67P24GS.mjs +0 -340
- package/dist/lib/node-esm/AssistantPanel-M67P24GS.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-MW42U6I4.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs +0 -132
- package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GIAYUM5I.mjs +0 -45
- package/dist/lib/node-esm/chunk-GIAYUM5I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JFHI22MF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs +0 -12
- package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs +0 -35
- package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs.map +0 -7
- 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 -227
- package/src/components/AssistantPanel/index.ts +0 -7
- package/src/components/AssistantPanel/system-instructions.ts +0 -166
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var app_graph_builder_65TBXO3I_exports = {};
|
|
20
|
-
__export(app_graph_builder_65TBXO3I_exports, {
|
|
21
|
-
default: () => app_graph_builder_default
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(app_graph_builder_65TBXO3I_exports);
|
|
24
|
-
var import_chunk_TQEDPRY5 = require("./chunk-TQEDPRY5.cjs");
|
|
25
|
-
var import_app_framework = require("@dxos/app-framework");
|
|
26
|
-
var import_plugin_client = require("@dxos/plugin-client");
|
|
27
|
-
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
28
|
-
var import_plugin_space = require("@dxos/plugin-space");
|
|
29
|
-
var import_echo = require("@dxos/react-client/echo");
|
|
30
|
-
var app_graph_builder_default = (context) => {
|
|
31
|
-
const resolve = (typename) => context.requestCapabilities(import_app_framework.Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
32
|
-
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.AppGraphBuilder, [
|
|
33
|
-
(0, import_plugin_graph.createExtension)({
|
|
34
|
-
id: `${import_chunk_TQEDPRY5.AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
35
|
-
resolver: ({ id }) => {
|
|
36
|
-
if (!id.endsWith("~automation")) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const type = "orphan-settings-for-subject";
|
|
40
|
-
const icon = "ph--magic-wand--regular";
|
|
41
|
-
const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
|
|
42
|
-
const [subjectId] = id.split("~");
|
|
43
|
-
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
44
|
-
const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
45
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === import_echo.SpaceState.SPACE_READY);
|
|
46
|
-
if (!objectId) {
|
|
47
|
-
const label2 = space ? space.properties.name || [
|
|
48
|
-
"unnamed space label",
|
|
49
|
-
{
|
|
50
|
-
ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
|
|
51
|
-
}
|
|
52
|
-
] : [
|
|
53
|
-
"unnamed object settings label",
|
|
54
|
-
{
|
|
55
|
-
ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
|
|
56
|
-
}
|
|
57
|
-
];
|
|
58
|
-
return {
|
|
59
|
-
id,
|
|
60
|
-
type,
|
|
61
|
-
data: null,
|
|
62
|
-
properties: {
|
|
63
|
-
icon,
|
|
64
|
-
label: label2,
|
|
65
|
-
showResolvedThreads: false,
|
|
66
|
-
object: null,
|
|
67
|
-
space
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const [object] = (0, import_plugin_space.memoizeQuery)(space, {
|
|
72
|
-
id: objectId
|
|
73
|
-
});
|
|
74
|
-
if (!object || !subjectId) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const meta = resolve((0, import_echo.getTypename)(object) ?? "");
|
|
78
|
-
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
79
|
-
"unnamed object settings label",
|
|
80
|
-
{
|
|
81
|
-
ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
return {
|
|
85
|
-
id,
|
|
86
|
-
type,
|
|
87
|
-
data: null,
|
|
88
|
-
properties: {
|
|
89
|
-
icon,
|
|
90
|
-
label,
|
|
91
|
-
object
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}),
|
|
96
|
-
(0, import_plugin_graph.createExtension)({
|
|
97
|
-
id: `${import_chunk_TQEDPRY5.AUTOMATION_PLUGIN}/assistant-for-subject`,
|
|
98
|
-
resolver: ({ id }) => {
|
|
99
|
-
if (!id.endsWith("~assistant")) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
|
|
103
|
-
const [subjectId] = id.split("~");
|
|
104
|
-
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
105
|
-
const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
106
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === import_echo.SpaceState.SPACE_READY);
|
|
107
|
-
if (!objectId) {
|
|
108
|
-
return {
|
|
109
|
-
id,
|
|
110
|
-
type: "orphan-automation-for-subject",
|
|
111
|
-
data: null,
|
|
112
|
-
properties: {
|
|
113
|
-
icon: "ph--atom--regular",
|
|
114
|
-
label: [
|
|
115
|
-
"assistant panel label",
|
|
116
|
-
{
|
|
117
|
-
ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
|
|
118
|
-
}
|
|
119
|
-
],
|
|
120
|
-
object: null,
|
|
121
|
-
space
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
const [object] = (0, import_plugin_space.memoizeQuery)(space, {
|
|
126
|
-
id: objectId
|
|
127
|
-
});
|
|
128
|
-
return {
|
|
129
|
-
id,
|
|
130
|
-
type: "orphan-automation-for-subject",
|
|
131
|
-
data: null,
|
|
132
|
-
properties: {
|
|
133
|
-
icon: "ph--atom--regular",
|
|
134
|
-
label: [
|
|
135
|
-
"assistant panel label",
|
|
136
|
-
{
|
|
137
|
-
ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
object
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
})
|
|
145
|
-
]);
|
|
146
|
-
};
|
|
147
|
-
//# sourceMappingURL=app-graph-builder-65TBXO3I.cjs.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}/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 // TODO(Zan): Find util (or make one). Effect schema!!\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\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,2BAA+D;AAC/D,2BAAmC;AACnC,0BAA0C;AAC1C,0BAA6B;AAC7B,kBAAiD;AAIjD,IAAA,4BAAe,CAACA,YAAAA;AACd,QAAMC,UAAU,CAACC,aACfF,QAAQG,oBAAoBC,kCAAaC,QAAQ,EAAEC,KAAK,CAAC,EAAEC,GAAE,MAAOA,OAAOL,QAAAA,GAAWM,YAAY,CAAC;AAErG,aAAOC,kCAAYL,kCAAaM,iBAAiB;QAC/CC,qCAAgB;MACdJ,IAAI,GAAGK,uCAAAA;MACPC,UAAU,CAAC,EAAEN,GAAE,MAAE;AACf,YAAI,CAACA,GAAGO,SAAS,aAAA,GAAgB;AAC/B;QACF;AAEA,cAAMC,OAAO;AACb,cAAMC,OAAO;AAEb,cAAMC,SAASjB,QAAQkB,kBAAkBC,wCAAmBC,MAAM;AAClE,cAAM,CAACC,SAAAA,IAAad,GAAGe,MAAM,GAAA;AAC7B,cAAM,EAAEC,SAASC,SAAQ,QAAKC,qBAAQJ,SAAAA;AACtC,cAAMK,aAASC,8BACb,CAACC,aAAaX,OAAOS,OAAOG,UAAU,MAAMD,SAAAA,CAAAA,EAAYE,aACxD,MAAMb,OAAOS,OAAOK,IAAG,CAAA;AAEzB,cAAMC,QAAQN,QAAQpB,KAAK,CAAC0B,WAAUA,OAAMzB,OAAOgB,WAAWS,OAAMC,MAAMF,IAAG,MAAOG,uBAAWC,WAAW;AAC1G,YAAI,CAACX,UAAU;AAEb,gBAAMY,SAAQJ,QACVA,MAAMK,WAAWC,QAAQ;YAAC;YAAuB;cAAEC,IAAI3B;YAAkB;cACzE;YAAC;YAAiC;cAAE2B,IAAI3B;YAAkB;;AAI9D,iBAAO;YACLL;YACAQ;YACAyB,MAAM;YACNH,YAAY;cACVrB;cACAoB,OAAAA;cACAK,qBAAqB;cACrBC,QAAQ;cACRV;YACF;UACF;QACF;AAEA,cAAM,CAACU,MAAAA,QAAUC,kCAAaX,OAAO;UAAEzB,IAAIiB;QAAS,CAAA;AACpD,YAAI,CAACkB,UAAU,CAACrB,WAAW;AACzB;QACF;AAEA,cAAMuB,OAAO3C,YAAQ4C,yBAAYH,MAAAA,KAAW,EAAA;AAC5C,cAAMN,QAAQQ,KAAKR,QAAQM,MAAAA,KACzBA,OAAOJ,QACPM,KAAKE,eAAe;UAAC;UAAiC;YAAEP,IAAI3B;UAAkB;;AAEhF,eAAO;UACLL;UACAQ;UACAyB,MAAM;UACNH,YAAY;YACVrB;YACAoB;YACAM;UACF;QACF;MACF;IACF,CAAA;QACA/B,qCAAgB;MACdJ,IAAI,GAAGK,uCAAAA;MACPC,UAAU,CAAC,EAAEN,GAAE,MAAE;AAEf,YAAI,CAACA,GAAGO,SAAS,YAAA,GAAe;AAC9B;QACF;AAEA,cAAMG,SAASjB,QAAQkB,kBAAkBC,wCAAmBC,MAAM;AAClE,cAAM,CAACC,SAAAA,IAAad,GAAGe,MAAM,GAAA;AAC7B,cAAM,EAAEC,SAASC,SAAQ,QAAKC,qBAAQJ,SAAAA;AACtC,cAAMK,aAASC,8BACb,CAACC,aAAaX,OAAOS,OAAOG,UAAU,MAAMD,SAAAA,CAAAA,EAAYE,aACxD,MAAMb,OAAOS,OAAOK,IAAG,CAAA;AAEzB,cAAMC,QAAQN,QAAQpB,KAAK,CAAC0B,WAAUA,OAAMzB,OAAOgB,WAAWS,OAAMC,MAAMF,IAAG,MAAOG,uBAAWC,WAAW;AAC1G,YAAI,CAACX,UAAU;AAGb,iBAAO;YACLjB;YACAQ,MAAM;YACNyB,MAAM;YACNH,YAAY;cACVrB,MAAM;cACNoB,OAAO;gBAAC;gBAAyB;kBAAEG,IAAI3B;gBAAkB;;cACzD8B,QAAQ;cACRV;YACF;UACF;QACF;AAEA,cAAM,CAACU,MAAAA,QAAUC,kCAAaX,OAAO;UAAEzB,IAAIiB;QAAS,CAAA;AAEpD,eAAO;UACLjB;UACAQ,MAAM;UACNyB,MAAM;UACNH,YAAY;YACVrB,MAAM;YACNoB,OAAO;cAAC;cAAyB;gBAAEG,IAAI3B;cAAkB;;YACzD8B;UACF;QACF;MACF;IACF,CAAA;GACD;AACH;",
|
|
6
|
-
"names": ["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", "objectId", "parseId", "spaces", "toSignal", "onChange", "subscribe", "unsubscribe", "get", "space", "state", "SpaceState", "SPACE_READY", "label", "properties", "name", "ns", "data", "showResolvedThreads", "object", "memoizeQuery", "meta", "getTypename", "placeholder"]
|
|
7
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_JNDMZQH7_exports = {};
|
|
20
|
-
__export(chunk_JNDMZQH7_exports, {
|
|
21
|
-
ChainInputSchema: () => ChainInputSchema,
|
|
22
|
-
ChainInputType: () => ChainInputType,
|
|
23
|
-
ChainPromptType: () => ChainPromptType,
|
|
24
|
-
ChainType: () => ChainType
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(chunk_JNDMZQH7_exports);
|
|
27
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
28
|
-
var ChainInputType;
|
|
29
|
-
(function(ChainInputType2) {
|
|
30
|
-
ChainInputType2[ChainInputType2["VALUE"] = 0] = "VALUE";
|
|
31
|
-
ChainInputType2[ChainInputType2["PASS_THROUGH"] = 1] = "PASS_THROUGH";
|
|
32
|
-
ChainInputType2[ChainInputType2["RETRIEVER"] = 2] = "RETRIEVER";
|
|
33
|
-
ChainInputType2[ChainInputType2["FUNCTION"] = 3] = "FUNCTION";
|
|
34
|
-
ChainInputType2[ChainInputType2["QUERY"] = 4] = "QUERY";
|
|
35
|
-
ChainInputType2[ChainInputType2["RESOLVER"] = 5] = "RESOLVER";
|
|
36
|
-
ChainInputType2[ChainInputType2["CONTEXT"] = 6] = "CONTEXT";
|
|
37
|
-
ChainInputType2[ChainInputType2["SCHEMA"] = 7] = "SCHEMA";
|
|
38
|
-
})(ChainInputType || (ChainInputType = {}));
|
|
39
|
-
var ChainInputSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
|
|
40
|
-
name: import_echo_schema.S.String,
|
|
41
|
-
type: import_echo_schema.S.optional(import_echo_schema.S.Enums(ChainInputType)),
|
|
42
|
-
value: import_echo_schema.S.optional(import_echo_schema.S.String)
|
|
43
|
-
}));
|
|
44
|
-
var ChainPromptType = class extends (0, import_echo_schema.TypedObject)({
|
|
45
|
-
typename: "dxos.org/type/ChainPrompt",
|
|
46
|
-
version: "0.1.0"
|
|
47
|
-
})({
|
|
48
|
-
command: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
49
|
-
template: import_echo_schema.S.String,
|
|
50
|
-
inputs: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array(ChainInputSchema)))
|
|
51
|
-
}) {
|
|
52
|
-
};
|
|
53
|
-
var ChainType = class extends (0, import_echo_schema.TypedObject)({
|
|
54
|
-
typename: "dxos.org/type/Chain",
|
|
55
|
-
version: "0.1.0"
|
|
56
|
-
})({
|
|
57
|
-
name: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
58
|
-
prompts: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array((0, import_echo_schema.Ref)(ChainPromptType))))
|
|
59
|
-
}) {
|
|
60
|
-
};
|
|
61
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
-
0 && (module.exports = {
|
|
63
|
-
ChainInputSchema,
|
|
64
|
-
ChainInputType,
|
|
65
|
-
ChainPromptType,
|
|
66
|
-
ChainType
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=chunk-JNDMZQH7.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Ref, S, TypedObject } from '@dxos/echo-schema';\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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAoC;;UAGxBA,iBAAAA;;;;;;;;;GAAAA,mBAAAA,iBAAAA,CAAAA,EAAAA;AAWL,IAAMC,mBAAmBC,qBAAEC,QAChCD,qBAAEE,OAAO;EACPC,MAAMH,qBAAEI;EACRC,MAAML,qBAAEM,SAASN,qBAAEO,MAAMT,cAAAA,CAAAA;EACzBU,OAAOR,qBAAEM,SAASN,qBAAEI,MAAM;AAC5B,CAAA,CAAA;AAKK,IAAMK,kBAAN,kBAA8BC,gCAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EAC5GC,SAASb,qBAAEM,SAASN,qBAAEI,MAAM;EAC5BU,UAAUd,qBAAEI;EACZW,QAAQf,qBAAEM,SAASN,qBAAEC,QAAQD,qBAAEgB,MAAMjB,gBAAAA,CAAAA,CAAAA;AACvC,CAAA,EAAA;AAAI;AAEG,IAAMkB,YAAN,kBAAwBP,gCAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAAG;EAChGT,MAAMH,qBAAEM,SAASN,qBAAEI,MAAM;EACzBc,SAASlB,qBAAEM,SAASN,qBAAEC,QAAQD,qBAAEgB,UAAMG,wBAAIV,eAAAA,CAAAA,CAAAA,CAAAA;AAC5C,CAAA,EAAA;AAAI;",
|
|
6
|
-
"names": ["ChainInputType", "ChainInputSchema", "S", "mutable", "Struct", "name", "String", "type", "optional", "Enums", "value", "ChainPromptType", "TypedObject", "typename", "version", "command", "template", "inputs", "Array", "ChainType", "prompts", "Ref"]
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var chunk_JUSXT4U5_exports = {};
|
|
30
|
-
__export(chunk_JUSXT4U5_exports, {
|
|
31
|
-
AssistantPanel: () => AssistantPanel,
|
|
32
|
-
AutomationPanel: () => AutomationPanel
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(chunk_JUSXT4U5_exports);
|
|
35
|
-
var import_react = require("react");
|
|
36
|
-
var AssistantPanel = (0, import_react.lazy)(() => import("./AssistantPanel-U7GDWPRC.cjs"));
|
|
37
|
-
var AutomationPanel = (0, import_react.lazy)(() => import("./AutomationPanel-H5WE4FIU.cjs"));
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
AssistantPanel,
|
|
41
|
-
AutomationPanel
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=chunk-JUSXT4U5.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const AssistantPanel = lazy(() => import('./AssistantPanel'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqB;AAEd,IAAMA,qBAAiBC,mBAAK,MAAM,OAAO,+BAAA,CAAA;AACzC,IAAMC,sBAAkBD,mBAAK,MAAM,OAAO,gCAAA,CAAA;",
|
|
6
|
-
"names": ["AssistantPanel", "lazy", "AutomationPanel"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport const meta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--magic-wand--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',\n tags: ['experimental'],\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,oBAAoB;AAE1B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
|
|
6
|
-
"names": ["AUTOMATION_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { getSpace, isEchoObject, type ReactiveEchoObject } from '@dxos/react-client/echo';\n\nimport { AssistantPanel, AutomationPanel } from '../components';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n role: 'complementary--assistant',\n component: ({ data }) => <AssistantPanel subject={data.subject} />,\n }),\n createSurface({\n id: `${AUTOMATION_PLUGIN}/automation`,\n role: 'complementary--automation',\n filter: (data): data is { subject: ReactiveEchoObject<any> } =>\n isEchoObject(data.subject) && !!getSpace(data.subject),\n component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AACzD,kBAAgE;AAKhE,IAAA,wBAAe,UACbA,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAI,GAAGC,uCAAAA;IACPC,MAAM;IACNC,WAAW,CAAC,EAAEC,KAAI,MAAO,6BAAAC,QAAA,cAACC,sCAAAA;MAAeC,SAASH,KAAKG;;EACzD,CAAA;MACAR,oCAAc;IACZC,IAAI,GAAGC,uCAAAA;IACPC,MAAM;IACNM,QAAQ,CAACJ,aACPK,0BAAaL,KAAKG,OAAO,KAAK,CAAC,KAACG,sBAASN,KAAKG,OAAO;IACvDJ,WAAW,CAAC,EAAEC,KAAI,MAAO,6BAAAC,QAAA,cAACM,uCAAAA;MAAgBC,WAAOF,sBAASN,KAAKG,OAAO;MAAIM,QAAQT,KAAKG;;EACzF,CAAA;CACD;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "ReactSurface", "createSurface", "id", "AUTOMATION_PLUGIN", "role", "component", "data", "React", "AssistantPanel", "subject", "filter", "isEchoObject", "getSpace", "AutomationPanel", "space", "object"]
|
|
7
|
-
}
|
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AUTOMATION_PLUGIN
|
|
4
|
-
} from "./chunk-JFHI22MF.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx
|
|
7
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
8
|
-
import { AIServiceClientImpl, ObjectId } from "@dxos/assistant";
|
|
9
|
-
import { SpaceId } from "@dxos/keys";
|
|
10
|
-
import { useClient, useConfig } from "@dxos/react-client";
|
|
11
|
-
import { ContextMenu } from "@dxos/react-ui";
|
|
12
|
-
import { Icon, Input, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
13
|
-
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
14
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
15
|
-
|
|
16
|
-
// packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts
|
|
17
|
-
import { asyncTimeout } from "@dxos/async";
|
|
18
|
-
import { getTypename } from "@dxos/echo-schema";
|
|
19
|
-
import { log } from "@dxos/log";
|
|
20
|
-
import { Filter, getSpace, ResultFormat } from "@dxos/react-client/echo";
|
|
21
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts";
|
|
22
|
-
var createSystemInstructions = async (context) => {
|
|
23
|
-
let instructions = `
|
|
24
|
-
<instructions>
|
|
25
|
-
Before replying always think step-by-step on how to proceed.
|
|
26
|
-
Print your thoughts inside <cot> tags.
|
|
27
|
-
|
|
28
|
-
<example>
|
|
29
|
-
<cot>To answer the question I need to ...</cot>
|
|
30
|
-
</example>
|
|
31
|
-
</instructions>
|
|
32
|
-
|
|
33
|
-
<current_time>${(/* @__PURE__ */ new Date()).toLocaleString()}</current_time>
|
|
34
|
-
`;
|
|
35
|
-
if (context.subject) {
|
|
36
|
-
instructions += `
|
|
37
|
-
<user_attention>
|
|
38
|
-
The user is currently interacting with an object in Composer application:
|
|
39
|
-
|
|
40
|
-
${await formatContextObject(context.subject)}
|
|
41
|
-
</user_attention>
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
return looseFormatXml(instructions);
|
|
45
|
-
};
|
|
46
|
-
var formatContextObject = async (object) => {
|
|
47
|
-
let data;
|
|
48
|
-
try {
|
|
49
|
-
data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);
|
|
50
|
-
} catch (err) {
|
|
51
|
-
log.error("Failed to preprocess context object:", {
|
|
52
|
-
err
|
|
53
|
-
}, {
|
|
54
|
-
F: __dxlog_file,
|
|
55
|
-
L: 48,
|
|
56
|
-
S: void 0,
|
|
57
|
-
C: (f, a) => f(...a)
|
|
58
|
-
});
|
|
59
|
-
data = object;
|
|
60
|
-
}
|
|
61
|
-
if (typeof data === "string") {
|
|
62
|
-
return data;
|
|
63
|
-
} else {
|
|
64
|
-
return `
|
|
65
|
-
<object>
|
|
66
|
-
<type>${getTypename(object)}</type>
|
|
67
|
-
<id>${object.id}</id>
|
|
68
|
-
${formatObjectAsXMLTags(data)}
|
|
69
|
-
</object>
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
var preprocessContextObject = async (object) => {
|
|
74
|
-
const space = getSpace(object);
|
|
75
|
-
if (!space) {
|
|
76
|
-
return {
|
|
77
|
-
...object
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
switch (getTypename(object)) {
|
|
81
|
-
// TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.
|
|
82
|
-
case "dxos.org/type/Document": {
|
|
83
|
-
const data = space.db.query({
|
|
84
|
-
id: object.id
|
|
85
|
-
}, {
|
|
86
|
-
format: ResultFormat.Plain,
|
|
87
|
-
include: {
|
|
88
|
-
content: true
|
|
89
|
-
}
|
|
90
|
-
}).first() ?? {
|
|
91
|
-
content: {
|
|
92
|
-
content: ""
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
return {
|
|
96
|
-
...data,
|
|
97
|
-
threads: void 0
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
case "dxos.org/type/Table": {
|
|
101
|
-
const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : void 0;
|
|
102
|
-
const { objects: rows } = (schema && await space.db.query(Filter.schema(schema), {
|
|
103
|
-
format: ResultFormat.Plain,
|
|
104
|
-
limit: TABLE_ROWS_LIMIT
|
|
105
|
-
}).run()) ?? {};
|
|
106
|
-
return `
|
|
107
|
-
<object>
|
|
108
|
-
<id>${object.id}</id>
|
|
109
|
-
<type>${getTypename(object)}</type>
|
|
110
|
-
${formatObjectAsXMLTags(object)}
|
|
111
|
-
|
|
112
|
-
<rows>
|
|
113
|
-
<!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->
|
|
114
|
-
${rows?.map((row) => `<row>
|
|
115
|
-
${formatObjectAsXMLTags(row)}
|
|
116
|
-
</row>`).join("\n")}
|
|
117
|
-
</rows>
|
|
118
|
-
|
|
119
|
-
`;
|
|
120
|
-
}
|
|
121
|
-
default:
|
|
122
|
-
return {
|
|
123
|
-
...object
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
var formatObjectAsXMLTags = (object, depth = 1) => {
|
|
128
|
-
return Object.entries(object).filter(([key, value]) => [
|
|
129
|
-
"string",
|
|
130
|
-
"number",
|
|
131
|
-
"boolean",
|
|
132
|
-
"object"
|
|
133
|
-
].includes(typeof value)).map(([key, value]) => {
|
|
134
|
-
if (typeof value === "object" && value !== null) {
|
|
135
|
-
if (depth === 0) {
|
|
136
|
-
return "";
|
|
137
|
-
} else {
|
|
138
|
-
return `<${key}>
|
|
139
|
-
${formatObjectAsXMLTags(value, depth - 1)}
|
|
140
|
-
</${key}>`;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return `<${key}>${value}</${key}>`;
|
|
144
|
-
}).join("\n");
|
|
145
|
-
};
|
|
146
|
-
var CONTEXT_OBJECT_QUERY_TIMEOUT = 5e3;
|
|
147
|
-
var TABLE_ROWS_LIMIT = 10;
|
|
148
|
-
var looseFormatXml = (xml) => {
|
|
149
|
-
let currentIndent = 0;
|
|
150
|
-
return xml.split("\n").map((line) => {
|
|
151
|
-
if (line.match(RE_CLOSE_TAG_LINE)) {
|
|
152
|
-
currentIndent--;
|
|
153
|
-
}
|
|
154
|
-
const indent = currentIndent;
|
|
155
|
-
if (line.match(RE_OPEN_TAG_LINE)) {
|
|
156
|
-
currentIndent++;
|
|
157
|
-
}
|
|
158
|
-
return " ".repeat(indent * 2) + line.trimStart();
|
|
159
|
-
}).join("\n");
|
|
160
|
-
};
|
|
161
|
-
var RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\-_]+>[ ]*$/;
|
|
162
|
-
var RE_CLOSE_TAG_LINE = /^[ ]*<\/[a-zA-Z0-9\-_]+>[ ]*$/;
|
|
163
|
-
|
|
164
|
-
// packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx
|
|
165
|
-
var PROPERTIES_ASSISTANT_KEY = "dxos.assistant.beta.properties";
|
|
166
|
-
var AssistantPanel = ({ subject, classNames }) => {
|
|
167
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
168
|
-
const config = useConfig();
|
|
169
|
-
const client = useClient();
|
|
170
|
-
const aiClient = useRef();
|
|
171
|
-
const [contextSpaceId, setContextSpaceId] = useState();
|
|
172
|
-
const [threadId, setThreadId] = useState();
|
|
173
|
-
const [history, setHistory] = useState([]);
|
|
174
|
-
const [input, setInput] = useState("");
|
|
175
|
-
useEffect(() => {
|
|
176
|
-
if (!aiClient.current) {
|
|
177
|
-
const endpoint = config.values.runtime?.services?.ai?.server;
|
|
178
|
-
if (!endpoint) {
|
|
179
|
-
throw new Error("AI service endpoint is not configured");
|
|
180
|
-
}
|
|
181
|
-
aiClient.current = new AIServiceClientImpl({
|
|
182
|
-
endpoint
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
queueMicrotask(async () => {
|
|
186
|
-
const properties = client.spaces.default.properties;
|
|
187
|
-
properties[PROPERTIES_ASSISTANT_KEY] ??= {};
|
|
188
|
-
properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();
|
|
189
|
-
properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();
|
|
190
|
-
const contextSpaceId2 = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;
|
|
191
|
-
const threadId2 = properties[PROPERTIES_ASSISTANT_KEY].threadId;
|
|
192
|
-
setContextSpaceId(contextSpaceId2);
|
|
193
|
-
setThreadId(threadId2);
|
|
194
|
-
const messages = await aiClient.current.getMessagesInThread(contextSpaceId2, threadId2);
|
|
195
|
-
setHistory(messages);
|
|
196
|
-
});
|
|
197
|
-
}, []);
|
|
198
|
-
const handleRequest = async (input2) => {
|
|
199
|
-
if (input2 === "") {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
setInput("");
|
|
203
|
-
const userMessage = {
|
|
204
|
-
id: ObjectId.random(),
|
|
205
|
-
spaceId: contextSpaceId,
|
|
206
|
-
threadId,
|
|
207
|
-
role: "user",
|
|
208
|
-
content: [
|
|
209
|
-
{
|
|
210
|
-
type: "text",
|
|
211
|
-
text: input2
|
|
212
|
-
}
|
|
213
|
-
]
|
|
214
|
-
};
|
|
215
|
-
await aiClient.current.insertMessages([
|
|
216
|
-
userMessage
|
|
217
|
-
]);
|
|
218
|
-
setHistory([
|
|
219
|
-
...history,
|
|
220
|
-
userMessage
|
|
221
|
-
]);
|
|
222
|
-
const generationStream = await aiClient.current.generate({
|
|
223
|
-
model: "@anthropic/claude-3-5-sonnet-20241022",
|
|
224
|
-
spaceId: contextSpaceId,
|
|
225
|
-
threadId,
|
|
226
|
-
tools: [],
|
|
227
|
-
systemPrompt: await getSystemPrompt()
|
|
228
|
-
});
|
|
229
|
-
const historyBefore = [
|
|
230
|
-
...history,
|
|
231
|
-
userMessage
|
|
232
|
-
];
|
|
233
|
-
for await (const _event of generationStream) {
|
|
234
|
-
setHistory([
|
|
235
|
-
...historyBefore,
|
|
236
|
-
...generationStream.accumulatedMessages
|
|
237
|
-
]);
|
|
238
|
-
}
|
|
239
|
-
await aiClient.current.insertMessages(await generationStream.complete());
|
|
240
|
-
};
|
|
241
|
-
const getSystemPrompt = async () => {
|
|
242
|
-
return createSystemInstructions({
|
|
243
|
-
subject
|
|
244
|
-
});
|
|
245
|
-
};
|
|
246
|
-
const clearThread = async () => {
|
|
247
|
-
const properties = client.spaces.default.properties;
|
|
248
|
-
properties[PROPERTIES_ASSISTANT_KEY] ??= {};
|
|
249
|
-
properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();
|
|
250
|
-
const threadId2 = properties[PROPERTIES_ASSISTANT_KEY].threadId;
|
|
251
|
-
setThreadId(threadId2);
|
|
252
|
-
const messages = await aiClient.current.getMessagesInThread(contextSpaceId, threadId2);
|
|
253
|
-
setHistory(messages);
|
|
254
|
-
};
|
|
255
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
256
|
-
className: mx("flex flex-col h-full overflow-hidden", classNames)
|
|
257
|
-
}, history.length > 0 && /* @__PURE__ */ React.createElement("div", {
|
|
258
|
-
className: "flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto"
|
|
259
|
-
}, history.map((message) => /* @__PURE__ */ React.createElement(MessageItem, {
|
|
260
|
-
key: message.id,
|
|
261
|
-
message
|
|
262
|
-
}))), /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
263
|
-
classNames: "p-1"
|
|
264
|
-
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
265
|
-
autoFocus: true,
|
|
266
|
-
placeholder: t("ask me anything"),
|
|
267
|
-
value: input,
|
|
268
|
-
onChange: (ev) => setInput(ev.target.value),
|
|
269
|
-
onKeyDown: (ev) => ev.key === "Enter" && handleRequest(input)
|
|
270
|
-
})), /* @__PURE__ */ React.createElement(ContextMenu.Root, null, /* @__PURE__ */ React.createElement(ContextMenu.Trigger, {
|
|
271
|
-
asChild: true
|
|
272
|
-
}, /* @__PURE__ */ React.createElement(Toolbar.Button, {
|
|
273
|
-
onClick: () => handleRequest(input)
|
|
274
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
275
|
-
icon: "ph--play--regular",
|
|
276
|
-
size: 4
|
|
277
|
-
}))), /* @__PURE__ */ React.createElement(ContextMenu.Portal, null, /* @__PURE__ */ React.createElement(ContextMenu.Content, null, /* @__PURE__ */ React.createElement(ContextMenu.Viewport, null, /* @__PURE__ */ React.createElement(ContextMenu.Item, {
|
|
278
|
-
onClick: clearThread
|
|
279
|
-
}, "Clear thread"), /* @__PURE__ */ React.createElement(ContextMenu.Item, {
|
|
280
|
-
onClick: async () => console.log(await getSystemPrompt())
|
|
281
|
-
}, "Print instructions to console")))))));
|
|
282
|
-
};
|
|
283
|
-
var MessageItem = ({ classNames, message }) => {
|
|
284
|
-
const { id: _, role, content } = message;
|
|
285
|
-
const styleContainer = "flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator";
|
|
286
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
287
|
-
className: mx("flex", role === "user" ? "ml-[1rem] justify-end" : "mr-[1rem]", classNames)
|
|
288
|
-
}, content.map((content2, i) => {
|
|
289
|
-
switch (content2.type) {
|
|
290
|
-
case "text": {
|
|
291
|
-
const { cot, message: message2 } = parseMessage(content2.text);
|
|
292
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
293
|
-
key: i,
|
|
294
|
-
role: "none",
|
|
295
|
-
className: mx(styleContainer, role === "user" ? "bg-accentSurface" : "bg-input")
|
|
296
|
-
}, cot && /* @__PURE__ */ React.createElement("div", {
|
|
297
|
-
className: "p-2 whitespace-pre-wrap text-xs text-subdued"
|
|
298
|
-
}, cot), /* @__PURE__ */ React.createElement("div", {
|
|
299
|
-
className: "p-2 whitespace-pre-wrap"
|
|
300
|
-
}, message2));
|
|
301
|
-
}
|
|
302
|
-
case "tool_use": {
|
|
303
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
304
|
-
key: i,
|
|
305
|
-
className: mx(styleContainer, "text-xs")
|
|
306
|
-
}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
307
|
-
className: "p-2 text-primary"
|
|
308
|
-
}, "Tool use"), ": ", content2.name, " ", content2.id), /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
|
|
309
|
-
language: "json"
|
|
310
|
-
}, content2.inputJson));
|
|
311
|
-
}
|
|
312
|
-
case "tool_result": {
|
|
313
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
314
|
-
key: i,
|
|
315
|
-
className: mx(styleContainer, "text-xs", content2.isError && "text-error")
|
|
316
|
-
}, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
317
|
-
className: "p-2 text-primary"
|
|
318
|
-
}, "Tool result"), ": ", content2.toolUseId), /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
|
|
319
|
-
language: "json"
|
|
320
|
-
}, content2.content));
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
return null;
|
|
324
|
-
}));
|
|
325
|
-
};
|
|
326
|
-
var parseMessage = (text) => {
|
|
327
|
-
const regex = /<cot>([\s\S]*?)<\/cot>\s*([\s\S]*)/;
|
|
328
|
-
const match = text.match(regex);
|
|
329
|
-
return {
|
|
330
|
-
cot: match?.[1].trim(),
|
|
331
|
-
message: match?.[2] ?? text ?? "\xD8"
|
|
332
|
-
};
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
// packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts
|
|
336
|
-
var AssistantPanel_default = AssistantPanel;
|
|
337
|
-
export {
|
|
338
|
-
AssistantPanel_default as default
|
|
339
|
-
};
|
|
340
|
-
//# sourceMappingURL=AssistantPanel-M67P24GS.mjs.map
|