@dxos/plugin-assistant 0.8.1 → 0.8.2-main.2f9c567

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/lib/browser/{AssistantDialog-YSHMAHW5.mjs → AssistantDialog-WX6EKSXI.mjs} +3 -3
  2. package/dist/lib/browser/{ChatContainer-V5GP7DYF.mjs → ChatContainer-HMNWYDQ5.mjs} +3 -3
  3. package/dist/lib/browser/ChatContainer-HMNWYDQ5.mjs.map +7 -0
  4. package/dist/lib/browser/TemplateContainer-WKU5XFSO.mjs +22 -0
  5. package/dist/lib/browser/TemplateContainer-WKU5XFSO.mjs.map +7 -0
  6. package/dist/lib/browser/{ai-client-CDZLSNXE.mjs → ai-client-OK5SMYJC.mjs} +1 -1
  7. package/dist/lib/browser/{ai-client-CDZLSNXE.mjs.map → ai-client-OK5SMYJC.mjs.map} +2 -2
  8. package/dist/lib/browser/{app-graph-builder-MF5EVDWW.mjs → app-graph-builder-J5ISIFTE.mjs} +9 -39
  9. package/dist/lib/browser/app-graph-builder-J5ISIFTE.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-FMB7RGMP.mjs → chunk-4EXBK6UE.mjs} +127 -112
  11. package/dist/lib/browser/chunk-4EXBK6UE.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-5P7U35RJ.mjs +192 -0
  13. package/dist/lib/browser/chunk-5P7U35RJ.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-J3V74ZRF.mjs +143 -0
  15. package/dist/lib/browser/chunk-J3V74ZRF.mjs.map +7 -0
  16. package/dist/lib/browser/index.mjs +14 -11
  17. package/dist/lib/browser/index.mjs.map +3 -3
  18. package/dist/lib/browser/{intent-resolver-WJGLKKVO.mjs → intent-resolver-MGHOSZY3.mjs} +5 -5
  19. package/dist/lib/browser/intent-resolver-MGHOSZY3.mjs.map +7 -0
  20. package/dist/lib/browser/meta.json +1 -1
  21. package/dist/lib/browser/{react-surface-57VRDOQT.mjs → react-surface-VP4ABBMH.mjs} +15 -15
  22. package/dist/lib/browser/react-surface-VP4ABBMH.mjs.map +7 -0
  23. package/dist/lib/browser/{settings-U6UFQX32.mjs → settings-OZX7J65A.mjs} +4 -4
  24. package/dist/lib/browser/settings-OZX7J65A.mjs.map +7 -0
  25. package/dist/lib/browser/types/index.mjs +3 -1
  26. package/dist/lib/node/{AssistantDialog-YI2BSGSX.cjs → AssistantDialog-2OTAZADX.cjs} +7 -7
  27. package/dist/lib/node/{ChatContainer-ZJ5JXF6A.cjs → ChatContainer-3CTBKBS2.cjs} +7 -7
  28. package/dist/lib/node/ChatContainer-3CTBKBS2.cjs.map +7 -0
  29. package/dist/lib/node/TemplateContainer-EQXKHWTF.cjs +52 -0
  30. package/dist/lib/node/TemplateContainer-EQXKHWTF.cjs.map +7 -0
  31. package/dist/lib/node/{ai-client-URCCYU6B.cjs → ai-client-3EVTLXTT.cjs} +4 -4
  32. package/dist/lib/node/{ai-client-URCCYU6B.cjs.map → ai-client-3EVTLXTT.cjs.map} +2 -2
  33. package/dist/lib/node/{app-graph-builder-N5ZUUI2Z.cjs → app-graph-builder-BBNLIGYJ.cjs} +14 -44
  34. package/dist/lib/node/app-graph-builder-BBNLIGYJ.cjs.map +7 -0
  35. package/dist/lib/node/chunk-VG2UQY4S.cjs +216 -0
  36. package/dist/lib/node/chunk-VG2UQY4S.cjs.map +7 -0
  37. package/dist/lib/node/{chunk-ZKOC4ZFY.cjs → chunk-WFSXNO4H.cjs} +78 -61
  38. package/dist/lib/node/chunk-WFSXNO4H.cjs.map +7 -0
  39. package/dist/lib/node/{chunk-RPBKMP2E.cjs → chunk-XC7A3KUG.cjs} +138 -116
  40. package/dist/lib/node/chunk-XC7A3KUG.cjs.map +7 -0
  41. package/dist/lib/node/index.cjs +46 -43
  42. package/dist/lib/node/index.cjs.map +3 -3
  43. package/dist/lib/node/{intent-resolver-R3OSTIMH.cjs → intent-resolver-Z2NTL2FV.cjs} +9 -9
  44. package/dist/lib/node/intent-resolver-Z2NTL2FV.cjs.map +7 -0
  45. package/dist/lib/node/meta.json +1 -1
  46. package/dist/lib/node/{react-surface-NUQTM6MS.cjs → react-surface-HNXDAZ7C.cjs} +22 -22
  47. package/dist/lib/node/react-surface-HNXDAZ7C.cjs.map +7 -0
  48. package/dist/lib/node/{settings-TXGRCYAL.cjs → settings-WLTC7XO5.cjs} +7 -7
  49. package/dist/lib/node/settings-WLTC7XO5.cjs.map +7 -0
  50. package/dist/lib/node/types/index.cjs +14 -12
  51. package/dist/lib/node/types/index.cjs.map +2 -2
  52. package/dist/lib/node-esm/{AssistantDialog-U2FQX5TD.mjs → AssistantDialog-GNLPYXY4.mjs} +3 -3
  53. package/dist/lib/node-esm/{ChatContainer-QW3OOXTT.mjs → ChatContainer-FGHDDORQ.mjs} +3 -3
  54. package/dist/lib/node-esm/ChatContainer-FGHDDORQ.mjs.map +7 -0
  55. package/dist/lib/node-esm/TemplateContainer-3LEBT5ZC.mjs +23 -0
  56. package/dist/lib/node-esm/TemplateContainer-3LEBT5ZC.mjs.map +7 -0
  57. package/dist/lib/node-esm/{ai-client-WMHS5EGV.mjs → ai-client-LYCBXZI7.mjs} +1 -1
  58. package/dist/lib/node-esm/{ai-client-WMHS5EGV.mjs.map → ai-client-LYCBXZI7.mjs.map} +2 -2
  59. package/dist/lib/node-esm/{app-graph-builder-DWBNIMHM.mjs → app-graph-builder-245AWCPJ.mjs} +9 -39
  60. package/dist/lib/node-esm/app-graph-builder-245AWCPJ.mjs.map +7 -0
  61. package/dist/lib/node-esm/chunk-G5LUEW72.mjs +144 -0
  62. package/dist/lib/node-esm/chunk-G5LUEW72.mjs.map +7 -0
  63. package/dist/lib/node-esm/{chunk-MVDAY3CZ.mjs → chunk-JX73NOSL.mjs} +127 -112
  64. package/dist/lib/node-esm/chunk-JX73NOSL.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-UZWYXNR5.mjs +193 -0
  66. package/dist/lib/node-esm/chunk-UZWYXNR5.mjs.map +7 -0
  67. package/dist/lib/node-esm/index.mjs +14 -11
  68. package/dist/lib/node-esm/index.mjs.map +3 -3
  69. package/dist/lib/node-esm/{intent-resolver-H32TL4X6.mjs → intent-resolver-DMQXPV2H.mjs} +5 -5
  70. package/dist/lib/node-esm/intent-resolver-DMQXPV2H.mjs.map +7 -0
  71. package/dist/lib/node-esm/meta.json +1 -1
  72. package/dist/lib/node-esm/{react-surface-JBVZF6CP.mjs → react-surface-NYXMBFPY.mjs} +15 -15
  73. package/dist/lib/node-esm/react-surface-NYXMBFPY.mjs.map +7 -0
  74. package/dist/lib/node-esm/{settings-DZU5PNXM.mjs → settings-CLE57WEP.mjs} +4 -4
  75. package/dist/lib/node-esm/settings-CLE57WEP.mjs.map +7 -0
  76. package/dist/lib/node-esm/types/index.mjs +3 -1
  77. package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
  78. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/index.d.ts +1 -1
  80. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  82. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  83. package/dist/types/src/components/ChatContainer.d.ts +4 -3
  84. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  85. package/dist/types/src/components/PromptSettings.d.ts +6 -0
  86. package/dist/types/src/components/PromptSettings.d.ts.map +1 -0
  87. package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
  88. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -2
  89. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  90. package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -1
  91. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +2 -2
  92. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
  93. package/dist/types/src/components/Toolbox/Toolbox.d.ts +1 -1
  94. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  95. package/dist/types/src/components/index.d.ts +2 -6
  96. package/dist/types/src/components/index.d.ts.map +1 -1
  97. package/dist/types/src/hooks/index.d.ts +0 -1
  98. package/dist/types/src/hooks/index.d.ts.map +1 -1
  99. package/dist/types/src/hooks/processor.d.ts.map +1 -1
  100. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  101. package/dist/types/src/hooks/useMessageQueue.d.ts +0 -3
  102. package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -1
  103. package/dist/types/src/tools/function.d.ts +1 -1
  104. package/dist/types/src/tools/function.d.ts.map +1 -1
  105. package/dist/types/src/tools/openapi.d.ts.map +1 -1
  106. package/dist/types/src/translations.d.ts +3 -0
  107. package/dist/types/src/translations.d.ts.map +1 -1
  108. package/dist/types/src/types/service.d.ts +96 -95
  109. package/dist/types/src/types/service.d.ts.map +1 -1
  110. package/dist/types/src/types/template.d.ts +52 -52
  111. package/dist/types/src/types/template.d.ts.map +1 -1
  112. package/dist/types/src/types/types.d.ts +20 -18
  113. package/dist/types/src/types/types.d.ts.map +1 -1
  114. package/package.json +61 -58
  115. package/src/AssistantPlugin.tsx +2 -2
  116. package/src/capabilities/ai-client.ts +0 -1
  117. package/src/capabilities/app-graph-builder.ts +6 -38
  118. package/src/capabilities/index.ts +1 -1
  119. package/src/capabilities/intent-resolver.ts +3 -3
  120. package/src/capabilities/react-surface.tsx +11 -9
  121. package/src/capabilities/settings.ts +2 -2
  122. package/src/components/AssistantSettings/AssistantSettings.tsx +28 -6
  123. package/src/components/ChatContainer.tsx +6 -8
  124. package/src/components/PromptSettings.tsx +91 -0
  125. package/src/components/TemplateContainer.tsx +3 -79
  126. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
  127. package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -2
  128. package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
  129. package/src/components/Thread/ThreadContainer.stories.tsx +12 -20
  130. package/src/components/Thread/ThreadContainer.tsx +24 -2
  131. package/src/components/Thread/ThreadMessage.tsx +5 -2
  132. package/src/components/Toolbox/Toolbox.stories.tsx +1 -1
  133. package/src/components/Toolbox/Toolbox.tsx +1 -1
  134. package/src/components/index.ts +1 -1
  135. package/src/hooks/index.ts +0 -1
  136. package/src/hooks/processor.ts +26 -4
  137. package/src/hooks/useChatProcessor.tsx +4 -3
  138. package/src/testing/test-services.ts +6 -6
  139. package/src/tools/function.ts +2 -2
  140. package/src/tools/openapi.ts +4 -3
  141. package/src/translations.ts +5 -4
  142. package/src/types/service.ts +39 -37
  143. package/src/types/template.ts +27 -25
  144. package/src/types/types.ts +20 -17
  145. package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs.map +0 -7
  146. package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs +0 -78
  147. package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs.map +0 -7
  148. package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs.map +0 -7
  149. package/dist/lib/browser/chunk-FMB7RGMP.mjs.map +0 -7
  150. package/dist/lib/browser/chunk-IAMR2FAE.mjs +0 -183
  151. package/dist/lib/browser/chunk-IAMR2FAE.mjs.map +0 -7
  152. package/dist/lib/browser/chunk-KYMKVE6M.mjs +0 -128
  153. package/dist/lib/browser/chunk-KYMKVE6M.mjs.map +0 -7
  154. package/dist/lib/browser/intent-resolver-WJGLKKVO.mjs.map +0 -7
  155. package/dist/lib/browser/react-surface-57VRDOQT.mjs.map +0 -7
  156. package/dist/lib/browser/settings-U6UFQX32.mjs.map +0 -7
  157. package/dist/lib/node/ChatContainer-ZJ5JXF6A.cjs.map +0 -7
  158. package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs +0 -104
  159. package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs.map +0 -7
  160. package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs.map +0 -7
  161. package/dist/lib/node/chunk-APRU3QWK.cjs +0 -206
  162. package/dist/lib/node/chunk-APRU3QWK.cjs.map +0 -7
  163. package/dist/lib/node/chunk-RPBKMP2E.cjs.map +0 -7
  164. package/dist/lib/node/chunk-ZKOC4ZFY.cjs.map +0 -7
  165. package/dist/lib/node/intent-resolver-R3OSTIMH.cjs.map +0 -7
  166. package/dist/lib/node/react-surface-NUQTM6MS.cjs.map +0 -7
  167. package/dist/lib/node/settings-TXGRCYAL.cjs.map +0 -7
  168. package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs.map +0 -7
  169. package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs +0 -79
  170. package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs.map +0 -7
  171. package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs.map +0 -7
  172. package/dist/lib/node-esm/chunk-GBBXIW5F.mjs +0 -129
  173. package/dist/lib/node-esm/chunk-GBBXIW5F.mjs.map +0 -7
  174. package/dist/lib/node-esm/chunk-MVDAY3CZ.mjs.map +0 -7
  175. package/dist/lib/node-esm/chunk-MXK2EANZ.mjs +0 -184
  176. package/dist/lib/node-esm/chunk-MXK2EANZ.mjs.map +0 -7
  177. package/dist/lib/node-esm/intent-resolver-H32TL4X6.mjs.map +0 -7
  178. package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs.map +0 -7
  179. package/dist/lib/node-esm/settings-DZU5PNXM.mjs.map +0 -7
  180. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -6
  181. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
  182. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
  183. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
  184. package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
  185. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
  186. package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
  187. package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
  188. package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
  189. package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
  190. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -49
  191. package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -76
  192. package/src/components/ServiceRegistry/index.ts +0 -5
  193. package/src/hooks/invocation-handler.ts +0 -107
  194. package/src/hooks/useLocalTriggerManager.ts +0 -82
  195. /package/dist/lib/browser/{AssistantDialog-YSHMAHW5.mjs.map → AssistantDialog-WX6EKSXI.mjs.map} +0 -0
  196. /package/dist/lib/node/{AssistantDialog-YI2BSGSX.cjs.map → AssistantDialog-2OTAZADX.cjs.map} +0 -0
  197. /package/dist/lib/node-esm/{AssistantDialog-U2FQX5TD.mjs.map → AssistantDialog-GNLPYXY4.mjs.map} +0 -0
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var AssistantDialog_YI2BSGSX_exports = {};
30
- __export(AssistantDialog_YI2BSGSX_exports, {
29
+ var AssistantDialog_2OTAZADX_exports = {};
30
+ __export(AssistantDialog_2OTAZADX_exports, {
31
31
  AssistantDialog: () => AssistantDialog,
32
32
  default: () => AssistantDialog_default
33
33
  });
34
- module.exports = __toCommonJS(AssistantDialog_YI2BSGSX_exports);
35
- var import_chunk_RPBKMP2E = require("./chunk-RPBKMP2E.cjs");
34
+ module.exports = __toCommonJS(AssistantDialog_2OTAZADX_exports);
35
+ var import_chunk_XC7A3KUG = require("./chunk-XC7A3KUG.cjs");
36
36
  var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
37
- var import_chunk_APRU3QWK = require("./chunk-APRU3QWK.cjs");
37
+ var import_chunk_VG2UQY4S = require("./chunk-VG2UQY4S.cjs");
38
38
  var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
39
39
  var import_react = __toESM(require("react"));
40
40
  var import_app_framework = require("@dxos/app-framework");
@@ -125,7 +125,7 @@ var AssistantDialog = ({ chat }) => {
125
125
  open,
126
126
  onOpenChange: setOpen,
127
127
  title: t("assistant dialog title")
128
- }, /* @__PURE__ */ import_react.default.createElement(import_chunk_RPBKMP2E.ThreadContainer, {
128
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_XC7A3KUG.ThreadContainer, {
129
129
  chat,
130
130
  onOpenChange: setOpen,
131
131
  settings,
@@ -138,4 +138,4 @@ var AssistantDialog_default = AssistantDialog;
138
138
  0 && (module.exports = {
139
139
  AssistantDialog
140
140
  });
141
- //# sourceMappingURL=AssistantDialog-YI2BSGSX.cjs.map
141
+ //# sourceMappingURL=AssistantDialog-2OTAZADX.cjs.map
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var ChatContainer_ZJ5JXF6A_exports = {};
30
- __export(ChatContainer_ZJ5JXF6A_exports, {
29
+ var ChatContainer_3CTBKBS2_exports = {};
30
+ __export(ChatContainer_3CTBKBS2_exports, {
31
31
  ChatContainer: () => ChatContainer,
32
32
  default: () => ChatContainer_default
33
33
  });
34
- module.exports = __toCommonJS(ChatContainer_ZJ5JXF6A_exports);
35
- var import_chunk_RPBKMP2E = require("./chunk-RPBKMP2E.cjs");
34
+ module.exports = __toCommonJS(ChatContainer_3CTBKBS2_exports);
35
+ var import_chunk_XC7A3KUG = require("./chunk-XC7A3KUG.cjs");
36
36
  var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
37
- var import_chunk_APRU3QWK = require("./chunk-APRU3QWK.cjs");
37
+ var import_chunk_VG2UQY4S = require("./chunk-VG2UQY4S.cjs");
38
38
  var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
39
39
  var import_react = __toESM(require("react"));
40
40
  var import_app_framework = require("@dxos/app-framework");
@@ -46,7 +46,7 @@ var ChatContainer = ({ role, chat, associatedArtifact }) => {
46
46
  return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
47
47
  role,
48
48
  classNames: "container-max-width"
49
- }, /* @__PURE__ */ import_react.default.createElement(import_chunk_RPBKMP2E.ThreadContainer, {
49
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_XC7A3KUG.ThreadContainer, {
50
50
  chat,
51
51
  settings,
52
52
  transcription,
@@ -58,4 +58,4 @@ var ChatContainer_default = ChatContainer;
58
58
  0 && (module.exports = {
59
59
  ChatContainer
60
60
  });
61
- //# sourceMappingURL=ChatContainer-ZJ5JXF6A.cjs.map
61
+ //# sourceMappingURL=ChatContainer-3CTBKBS2.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ChatContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { Capabilities, useCapabilities, useCapability } from '@dxos/app-framework';\nimport { type AssociatedArtifact } from '@dxos/artifact';\nimport { TranscriptionCapabilities } from '@dxos/plugin-transcription';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { ThreadContainer } from './Thread';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps, type AIChatType } from '../types';\n\nexport type ChatContainerProps = {\n role: string;\n chat: AIChatType;\n associatedArtifact?: AssociatedArtifact;\n};\n\n// TODO(burdon): Attention.\nexport const ChatContainer: FC<ChatContainerProps> = ({ role, chat, associatedArtifact }) => {\n const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;\n const settings = useCapability(Capabilities.SettingsStore).getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n return (\n <StackItem.Content role={role} classNames='container-max-width'>\n <ThreadContainer\n chat={chat}\n settings={settings}\n transcription={transcription}\n associatedArtifact={associatedArtifact}\n />\n </StackItem.Content>\n );\n};\n\nexport default ChatContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA+B;AAE/B,2BAA6D;AAE7D,kCAA0C;AAC1C,4BAA0B;AAanB,IAAMA,gBAAwC,CAAC,EAAEC,MAAMC,MAAMC,mBAAkB,MAAE;AACtF,QAAMC,oBAAgBC,sCAAgBC,sDAA0BC,WAAW,EAAEC,SAAS;AACtF,QAAMC,eAAWC,oCAAcC,kCAAaC,aAAa,EAAEC,SAAiCC,sCAAAA,GAAmBC;AAE/G,SACE,6BAAAC,QAAA,cAACC,gCAAUC,SAAO;IAACjB;IAAYkB,YAAW;KACxC,6BAAAH,QAAA,cAACI,uCAAAA;IACClB;IACAO;IACAL;IACAD;;AAIR;AAEA,IAAA,wBAAeH;",
6
+ "names": ["ChatContainer", "role", "chat", "associatedArtifact", "transcription", "useCapabilities", "TranscriptionCapabilities", "Transcriber", "length", "settings", "useCapability", "Capabilities", "SettingsStore", "getStore", "ASSISTANT_PLUGIN", "value", "React", "StackItem", "Content", "classNames", "ThreadContainer"]
7
+ }
@@ -0,0 +1,52 @@
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 TemplateContainer_EQXKHWTF_exports = {};
30
+ __export(TemplateContainer_EQXKHWTF_exports, {
31
+ TemplateContainer: () => TemplateContainer,
32
+ default: () => TemplateContainer_default
33
+ });
34
+ module.exports = __toCommonJS(TemplateContainer_EQXKHWTF_exports);
35
+ var import_chunk_XI2ARIEO = require("./chunk-XI2ARIEO.cjs");
36
+ var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
37
+ var import_react = __toESM(require("react"));
38
+ var import_react_ui_stack = require("@dxos/react-ui-stack");
39
+ var TemplateContainer = ({ template, role }) => {
40
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
41
+ role,
42
+ classNames: "container-max-width"
43
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_XI2ARIEO.TemplateEditor, {
44
+ template
45
+ }));
46
+ };
47
+ var TemplateContainer_default = TemplateContainer;
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ TemplateContainer
51
+ });
52
+ //# sourceMappingURL=TemplateContainer-EQXKHWTF.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/TemplateContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { TemplateEditor } from './TemplateEditor';\nimport { type TemplateType } from '../types';\n\nexport const TemplateContainer = ({ template, role }: { template: TemplateType; role: string }) => {\n return (\n <StackItem.Content role={role} classNames='container-max-width'>\n <TemplateEditor template={template} />\n </StackItem.Content>\n );\n};\n\nexport default TemplateContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,4BAA0B;AAKnB,IAAMA,oBAAoB,CAAC,EAAEC,UAAUC,KAAI,MAA4C;AAC5F,SACE,6BAAAC,QAAA,cAACC,gCAAUC,SAAO;IAACH;IAAYI,YAAW;KACxC,6BAAAH,QAAA,cAACI,sCAAAA;IAAeN;;AAGtB;AAEA,IAAA,4BAAeD;",
6
+ "names": ["TemplateContainer", "template", "role", "React", "StackItem", "Content", "classNames", "TemplateEditor"]
7
+ }
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var ai_client_URCCYU6B_exports = {};
20
- __export(ai_client_URCCYU6B_exports, {
19
+ var ai_client_3EVTLXTT_exports = {};
20
+ __export(ai_client_3EVTLXTT_exports, {
21
21
  default: () => ai_client_default
22
22
  });
23
- module.exports = __toCommonJS(ai_client_URCCYU6B_exports);
23
+ module.exports = __toCommonJS(ai_client_3EVTLXTT_exports);
24
24
  var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
25
25
  var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
26
26
  var import_signals_core = require("@preact/signals-core");
@@ -46,4 +46,4 @@ var ai_client_default = (context) => {
46
46
  });
47
47
  return (0, import_app_framework.contributes)(import_chunk_GBUNQ257.AssistantCapabilities.AiClient, ai, () => unsubscribe());
48
48
  };
49
- //# sourceMappingURL=ai-client-URCCYU6B.cjs.map
49
+ //# sourceMappingURL=ai-client-3EVTLXTT.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/ai-client.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect, signal } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type AIServiceClient, AIServiceEdgeClient, OllamaClient } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AssistantCapabilities } from './capabilities';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps } from '../types';\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\n const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));\n\n const unsubscribe = effect(() => {\n // TODO(burdon): Could be undefined.\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n if (settings?.llmProvider === 'ollama') {\n ai.value = new OllamaClient();\n } else {\n ai.value = new AIServiceEdgeClient({ endpoint });\n }\n });\n\n return contributes(AssistantCapabilities.AiClient, ai, () => unsubscribe());\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAA+B;AAE/B,2BAA+D;AAC/D,uBAAwE;AACxE,2BAAmC;AAOnC,IAAMA,yBAAyB;AAE/B,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,wCAAmBC,MAAM;AAClE,QAAMC,WAAWJ,OAAOK,OAAOC,OAAOC,SAASC,UAAUC,IAAIC,UAAUZ;AAEvE,QAAMW,SAAKE,4BAAwB,IAAIC,qCAAoB;IAAER;EAAS,CAAA,CAAA;AAEtE,QAAMS,kBAAcC,4BAAO,MAAA;AAEzB,UAAMC,WAAWhB,QACdE,kBAAkBe,kCAAaC,aAAa,EAC5CC,SAAiCC,sCAAAA,GAAmBC;AAEvD,QAAIL,UAAUM,gBAAgB,UAAU;AACtCZ,SAAGW,QAAQ,IAAIE,8BAAAA;IACjB,OAAO;AACLb,SAAGW,QAAQ,IAAIR,qCAAoB;QAAER;MAAS,CAAA;IAChD;EACF,CAAA;AAEA,aAAOmB,kCAAYC,4CAAsBC,UAAUhB,IAAI,MAAMI,YAAAA,CAAAA;AAC/D;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect, signal } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type AIServiceClient, AIServiceEdgeClient, OllamaClient } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AssistantCapabilities } from './capabilities';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps } from '../types';\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\n const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));\n\n const unsubscribe = effect(() => {\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n if (settings?.llmProvider === 'ollama') {\n ai.value = new OllamaClient();\n } else {\n ai.value = new AIServiceEdgeClient({ endpoint });\n }\n });\n\n return contributes(AssistantCapabilities.AiClient, ai, () => unsubscribe());\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAA+B;AAE/B,2BAA+D;AAC/D,uBAAwE;AACxE,2BAAmC;AAOnC,IAAMA,yBAAyB;AAE/B,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,wCAAmBC,MAAM;AAClE,QAAMC,WAAWJ,OAAOK,OAAOC,OAAOC,SAASC,UAAUC,IAAIC,UAAUZ;AAEvE,QAAMW,SAAKE,4BAAwB,IAAIC,qCAAoB;IAAER;EAAS,CAAA,CAAA;AAEtE,QAAMS,kBAAcC,4BAAO,MAAA;AACzB,UAAMC,WAAWhB,QACdE,kBAAkBe,kCAAaC,aAAa,EAC5CC,SAAiCC,sCAAAA,GAAmBC;AAEvD,QAAIL,UAAUM,gBAAgB,UAAU;AACtCZ,SAAGW,QAAQ,IAAIE,8BAAAA;IACjB,OAAO;AACLb,SAAGW,QAAQ,IAAIR,qCAAoB;QAAER;MAAS,CAAA;IAChD;EACF,CAAA;AAEA,aAAOmB,kCAAYC,4CAAsBC,UAAUhB,IAAI,MAAMI,YAAAA,CAAAA;AAC/D;",
6
6
  "names": ["DEFAULT_AI_SERVICE_URL", "context", "client", "requestCapability", "ClientCapabilities", "Client", "endpoint", "config", "values", "runtime", "services", "ai", "server", "signal", "AIServiceEdgeClient", "unsubscribe", "effect", "settings", "Capabilities", "SettingsStore", "getStore", "ASSISTANT_PLUGIN", "value", "llmProvider", "OllamaClient", "contributes", "AssistantCapabilities", "AiClient"]
7
7
  }
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var app_graph_builder_N5ZUUI2Z_exports = {};
20
- __export(app_graph_builder_N5ZUUI2Z_exports, {
19
+ var app_graph_builder_BBNLIGYJ_exports = {};
20
+ __export(app_graph_builder_BBNLIGYJ_exports, {
21
21
  default: () => app_graph_builder_default
22
22
  });
23
- module.exports = __toCommonJS(app_graph_builder_N5ZUUI2Z_exports);
24
- var import_chunk_APRU3QWK = require("./chunk-APRU3QWK.cjs");
23
+ module.exports = __toCommonJS(app_graph_builder_BBNLIGYJ_exports);
24
+ var import_chunk_VG2UQY4S = require("./chunk-VG2UQY4S.cjs");
25
25
  var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
26
26
  var import_app_framework = require("@dxos/app-framework");
27
27
  var import_invariant = require("@dxos/invariant");
@@ -90,39 +90,9 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
90
90
  }
91
91
  ]
92
92
  }),
93
- (0, import_plugin_graph.createExtension)({
94
- id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/service-registry`,
95
- filter: (node) => node.id === "root",
96
- connector: ({ node }) => {
97
- const layout = context.requestCapability(import_app_framework.Capabilities.Layout);
98
- const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
99
- const { spaceId } = (0, import_echo.parseId)(layout.workspace);
100
- const space = spaceId ? client.spaces.get(spaceId) : null;
101
- return [
102
- {
103
- id: [
104
- node.id,
105
- "service-registry"
106
- ].join(import_types.ATTENDABLE_PATH_SEPARATOR),
107
- type: import_types.DECK_COMPANION_TYPE,
108
- data: space,
109
- properties: {
110
- label: [
111
- "service registry label",
112
- {
113
- ns: import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN
114
- }
115
- ],
116
- icon: "ph--plugs--regular",
117
- disposition: "hidden"
118
- }
119
- }
120
- ];
121
- }
122
- }),
123
93
  (0, import_plugin_graph.createExtension)({
124
94
  id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/object-chat-companion`,
125
- filter: (node) => (0, import_echo.isReactiveObject)(node.data) && node.data.assistantChatQueue && node.data.type !== import_chunk_APRU3QWK.AIChatType.typename,
95
+ filter: (node) => (0, import_echo.isLiveObject)(node.data) && node.data.assistantChatQueue && node.data.type !== import_chunk_VG2UQY4S.AIChatType.typename,
126
96
  connector: ({ node }) => [
127
97
  {
128
98
  id: [
@@ -146,9 +116,9 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
146
116
  }),
147
117
  (0, import_plugin_graph.createExtension)({
148
118
  id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/root`,
149
- filter: (node) => (0, import_echo.isSpace)(node.data),
119
+ filter: (node) => node.type === import_types2.SPACE_TYPE,
150
120
  connector: ({ node }) => {
151
- const templates = (0, import_plugin_space.memoizeQuery)(node.data, import_echo.Filter.schema(import_chunk_APRU3QWK.TemplateType));
121
+ const templates = (0, import_plugin_space.memoizeQuery)(node.data, import_echo.Filter.schema(import_chunk_VG2UQY4S.TemplateType));
152
122
  return templates.length > 0 ? [
153
123
  {
154
124
  id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/templates`,
@@ -172,7 +142,7 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
172
142
  id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/templates`,
173
143
  filter: (node) => node.id === `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/templates`,
174
144
  connector: ({ node }) => {
175
- const templates = (0, import_plugin_space.memoizeQuery)(node.properties.space, import_echo.Filter.schema(import_chunk_APRU3QWK.TemplateType));
145
+ const templates = (0, import_plugin_space.memoizeQuery)(node.properties.space, import_echo.Filter.schema(import_chunk_VG2UQY4S.TemplateType));
176
146
  return templates.toSorted((a, b) => {
177
147
  const nameA = a.name ?? "";
178
148
  const nameB = b.name ?? "";
@@ -183,7 +153,7 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
183
153
  data: template,
184
154
  properties: {
185
155
  label: template.name ?? [
186
- "template title placeholder",
156
+ "object placeholder",
187
157
  {
188
158
  ns: import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN
189
159
  }
@@ -195,16 +165,16 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
195
165
  })
196
166
  ]);
197
167
  var getOrCreateChat = async (dispatch, space) => {
198
- const { objects } = await space.db.query(import_echo.Filter.schema(import_chunk_APRU3QWK.AIChatType)).run();
168
+ const { objects } = await space.db.query(import_echo.Filter.schema(import_chunk_VG2UQY4S.AIChatType)).run();
199
169
  if (objects.length > 0) {
200
170
  return objects[objects.length - 1];
201
171
  }
202
- const { data } = await dispatch((0, import_app_framework.createIntent)(import_chunk_APRU3QWK.AssistantAction.CreateChat, {
172
+ const { data } = await dispatch((0, import_app_framework.createIntent)(import_chunk_VG2UQY4S.AssistantAction.CreateChat, {
203
173
  spaceId: space.id
204
174
  }));
205
- (0, import_invariant.invariant)(data?.object instanceof import_chunk_APRU3QWK.AIChatType, void 0, {
175
+ (0, import_invariant.invariant)(data?.object instanceof import_chunk_VG2UQY4S.AIChatType, void 0, {
206
176
  F: __dxlog_file,
207
- L: 192,
177
+ L: 160,
208
178
  S: void 0,
209
179
  A: [
210
180
  "data?.object instanceof AIChatType",
@@ -217,4 +187,4 @@ var getOrCreateChat = async (dispatch, space) => {
217
187
  }));
218
188
  return data.object;
219
189
  };
220
- //# sourceMappingURL=app-graph-builder-N5ZUUI2Z.cjs.map
190
+ //# sourceMappingURL=app-graph-builder-BBNLIGYJ.cjs.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 {\n Capabilities,\n contributes,\n createIntent,\n LayoutAction,\n type PromiseIntentDispatcher,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport { SPACE_TYPE, SpaceAction } from '@dxos/plugin-space/types';\nimport { type Space, Filter, fullyQualifiedId, getSpace, isLiveObject } from '@dxos/react-client/echo';\n\nimport { ASSISTANT_DIALOG, ASSISTANT_PLUGIN } from '../meta';\nimport { AIChatType, AssistantAction, TemplateType } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${ASSISTANT_PLUGIN}/assistant`,\n filter: (node): node is Node<null> => node.id === ROOT_ID,\n actions: () => [\n {\n id: `${LayoutAction.UpdateDialog._tag}/assistant/open`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const client = context.requestCapability(ClientCapabilities.Client);\n const layout = context.requestCapability(Capabilities.Layout);\n const { graph } = context.requestCapability(Capabilities.AppGraph);\n\n // TODO(burdon): Get space from workspace.\n // TODO(burdon): If need to create chat, then add to dispatch stack below.\n let chat: AIChatType | undefined;\n if (layout.active.length > 0) {\n const node = graph.findNode(layout.active[0]);\n if (node) {\n const space = getSpace(node.data);\n if (space) {\n chat = await getOrCreateChat(dispatch, space);\n }\n }\n } else {\n const space = client.spaces.default;\n chat = await getOrCreateChat(dispatch, space);\n }\n\n if (!chat) {\n return;\n }\n\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: ASSISTANT_DIALOG,\n options: {\n state: true,\n blockAlign: 'end',\n props: {\n chat,\n },\n },\n }),\n );\n },\n properties: {\n label: ['open assistant label', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--star-four--regular',\n disposition: 'pin-end',\n position: 'hoist',\n keyBinding: {\n macos: 'shift+meta+k',\n windows: 'shift+ctrl+k',\n },\n },\n },\n ],\n }),\n\n createExtension({\n id: `${ASSISTANT_PLUGIN}/object-chat-companion`,\n filter: (node): node is Node<AIChatType> =>\n isLiveObject(node.data) && node.data.assistantChatQueue && node.data.type !== AIChatType.typename,\n connector: ({ node }) => [\n {\n id: [node.id, 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'assistant-chat',\n properties: {\n label: ['assistant chat label', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--star-four--regular',\n position: 'hoist',\n },\n },\n ],\n }),\n\n createExtension({\n id: `${ASSISTANT_PLUGIN}/root`,\n filter: (node): node is Node<Space> => node.type === SPACE_TYPE,\n connector: ({ node }) => {\n const templates = memoizeQuery(node.data, Filter.schema(TemplateType));\n return templates.length > 0\n ? [\n {\n id: `${ASSISTANT_PLUGIN}/templates`,\n type: `${ASSISTANT_PLUGIN}/templates`,\n data: null,\n properties: {\n label: ['templates label', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--file-code--regular',\n space: node.data,\n },\n },\n ]\n : [];\n },\n }),\n\n createExtension({\n id: `${ASSISTANT_PLUGIN}/templates`,\n filter: (node): node is Node<null, { space: Space }> => node.id === `${ASSISTANT_PLUGIN}/templates`,\n connector: ({ node }) => {\n const templates = memoizeQuery(node.properties.space, Filter.schema(TemplateType));\n return templates\n .toSorted((a, b) => {\n const nameA = a.name ?? '';\n const nameB = b.name ?? '';\n return nameA.localeCompare(nameB);\n })\n .map((template) => ({\n id: fullyQualifiedId(template),\n type: `${ASSISTANT_PLUGIN}/template`,\n data: template,\n properties: {\n label: template.name ?? ['object placeholder', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--file-code--regular',\n },\n }));\n },\n }),\n ]);\n\n// TODO(burdon): Factor out.\nconst getOrCreateChat = async (dispatch: PromiseIntentDispatcher, space: Space): Promise<AIChatType | undefined> => {\n const { objects } = await space.db.query(Filter.schema(AIChatType)).run();\n // console.log('objects', JSON.stringify(objects, null, 2));\n if (objects.length > 0) {\n // TODO(burdon): Is this the most recent?\n return objects[objects.length - 1];\n }\n\n const { data } = await dispatch(createIntent(AssistantAction.CreateChat, { spaceId: space.id }));\n invariant(data?.object instanceof AIChatType);\n await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));\n return data.object;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAOO;AACP,uBAA0B;AAC1B,2BAAmC;AACnC,mBAAgE;AAChE,0BAAoD;AACpD,0BAA6B;AAC7B,IAAAA,gBAAwC;AACxC,kBAA6E;;AAK7E,IAAA,4BAAe,CAACC,gBACdC,kCAA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AAIuE,8BAAiBD,QAAAA;QACrBrB,MAAM,GAAGhD,sCAAAA;QACTQ,MAAM6D;QACNhC,YAAY;UACVC,OAAO+B,SAASJ,QAAQ;YAAC;YAAsB;cAAE1B,IAAIvC;YAAiB;;UACtEwC,MAAM;QACR;MACF,EAAA;IACJ;EACF,CAAA;CACD;AAGH,IAAMd,kBAAkB,OAAOhB,UAAmCc,UAAAA;AAChE,QAAM,EAAE+C,QAAO,IAAK,MAAM/C,MAAMgD,GAAGC,MAAMf,mBAAOC,OAAOV,gCAAAA,CAAAA,EAAayB,IAAG;AAEvE,MAAIH,QAAQjD,SAAS,GAAG;AAEtB,WAAOiD,QAAQA,QAAQjD,SAAS,CAAA;EAClC;AAEA,QAAM,EAAEd,KAAI,IAAK,MAAME,aAASmB,mCAAa8C,sCAAgBC,YAAY;IAAEC,SAASrD,MAAMzB;EAAG,CAAA,CAAA;AAC7F+E,kCAAUtE,MAAMuE,kBAAkB9B,kCAAAA,QAAAA;;;;;;;;;AAClC,QAAMvC,aAASmB,mCAAamD,0BAAYC,WAAW;IAAEC,QAAQ1D;IAAOuD,QAAQvE,KAAKuE;EAAO,CAAA,CAAA;AACxF,SAAOvE,KAAKuE;AACd;",
6
+ "names": ["import_types", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "ASSISTANT_PLUGIN", "filter", "node", "ROOT_ID", "actions", "LayoutAction", "UpdateDialog", "_tag", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "client", "ClientCapabilities", "Client", "layout", "Layout", "graph", "AppGraph", "chat", "active", "length", "findNode", "space", "getSpace", "getOrCreateChat", "spaces", "default", "createIntent", "part", "subject", "ASSISTANT_DIALOG", "options", "state", "blockAlign", "props", "properties", "label", "ns", "icon", "disposition", "position", "keyBinding", "macos", "windows", "isLiveObject", "assistantChatQueue", "type", "AIChatType", "typename", "connector", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "SPACE_TYPE", "templates", "memoizeQuery", "Filter", "schema", "TemplateType", "toSorted", "a", "b", "nameA", "name", "nameB", "localeCompare", "map", "template", "fullyQualifiedId", "objects", "db", "query", "run", "AssistantAction", "CreateChat", "spaceId", "invariant", "object", "SpaceAction", "AddObject", "target"]
7
+ }
@@ -0,0 +1,216 @@
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_VG2UQY4S_exports = {};
20
+ __export(chunk_VG2UQY4S_exports, {
21
+ AIChatType: () => AIChatType,
22
+ ApiAuthorization: () => ApiAuthorization,
23
+ AssistantAction: () => AssistantAction,
24
+ AssistantSettingsSchema: () => AssistantSettingsSchema,
25
+ LLM_PROVIDERS: () => LLM_PROVIDERS,
26
+ ServiceType: () => ServiceType,
27
+ TemplateInputSchema: () => TemplateInputSchema,
28
+ TemplateInputType: () => TemplateInputType,
29
+ TemplateKindSchema: () => TemplateKindSchema,
30
+ TemplateKinds: () => TemplateKinds,
31
+ TemplateType: () => TemplateType,
32
+ categoryIcons: () => categoryIcons
33
+ });
34
+ module.exports = __toCommonJS(chunk_VG2UQY4S_exports);
35
+ var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
36
+ var import_echo_schema = require("@dxos/echo-schema");
37
+ var import_effect = require("effect");
38
+ var import_conductor = require("@dxos/conductor");
39
+ var import_echo_schema2 = require("@dxos/echo-schema");
40
+ var import_functions = require("@dxos/functions");
41
+ var import_effect2 = require("effect");
42
+ var import_echo_schema3 = require("@dxos/echo-schema");
43
+ var import_effect3 = require("effect");
44
+ var AIChatType = class extends (0, import_echo_schema.TypedObject)({
45
+ typename: "dxos.org/type/AIChat",
46
+ version: "0.1.0"
47
+ })({
48
+ // TODO(wittjosiah): Should be a ref to a Queue.
49
+ assistantChatQueue: (0, import_echo_schema.Ref)(import_echo_schema.Expando)
50
+ }) {
51
+ };
52
+ var ApiAuthorizationKey = import_effect.Schema.Struct({
53
+ type: import_effect.Schema.Literal("api-key"),
54
+ key: import_effect.Schema.String,
55
+ placement: import_effect.Schema.Union(import_effect.Schema.Struct({
56
+ type: import_effect.Schema.Literal("authorization-header")
57
+ }), import_effect.Schema.Struct({
58
+ type: import_effect.Schema.Literal("query"),
59
+ name: import_effect.Schema.String
60
+ }))
61
+ });
62
+ var ApiAuthorizationOauth = import_effect.Schema.Struct({
63
+ type: import_effect.Schema.Literal("oauth"),
64
+ clientId: import_effect.Schema.String,
65
+ clientSecret: import_effect.Schema.String,
66
+ tokenUrl: import_effect.Schema.String,
67
+ grantType: import_effect.Schema.String
68
+ });
69
+ var ApiAuthorization = import_effect.Schema.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
70
+ var ServiceInterfaceFunction = import_effect.Schema.Struct({
71
+ kind: import_effect.Schema.Literal("function"),
72
+ fn: (0, import_echo_schema2.Ref)(import_functions.FunctionType)
73
+ });
74
+ var ServiceInterfaceWorkflow = import_effect.Schema.Struct({
75
+ kind: import_effect.Schema.Literal("workflow"),
76
+ workflow: (0, import_echo_schema2.Ref)(import_conductor.ComputeGraph)
77
+ });
78
+ var ServiceInterfaceApi = import_effect.Schema.Struct({
79
+ kind: import_effect.Schema.Literal("api"),
80
+ /**
81
+ * URL to fetch the openapi schema.
82
+ */
83
+ schemaUrl: import_effect.Schema.optional(import_effect.Schema.String),
84
+ /**
85
+ * Inlined openapi schema.
86
+ */
87
+ schema: import_effect.Schema.optional(import_effect.Schema.Any),
88
+ /**
89
+ * Authorization configuration if required.
90
+ */
91
+ authorization: import_effect.Schema.optional(ApiAuthorization)
92
+ });
93
+ var ServiceInterface = import_effect.Schema.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
94
+ var ServiceType = class extends (0, import_echo_schema2.TypedObject)({
95
+ typename: "dxos.org/type/ServiceType",
96
+ version: "0.1.0"
97
+ })({
98
+ serviceId: import_effect.Schema.String,
99
+ name: import_effect.Schema.optional(import_effect.Schema.String),
100
+ description: import_effect.Schema.optional(import_effect.Schema.String),
101
+ category: import_effect.Schema.optional(import_effect.Schema.String),
102
+ enabled: import_effect.Schema.optional(import_effect.Schema.Boolean),
103
+ /**
104
+ * Entries exposed: functions, workflows, and APIs.
105
+ */
106
+ interfaces: import_effect.Schema.optional(import_effect.Schema.Array(ServiceInterface))
107
+ }) {
108
+ };
109
+ var categoryIcons = {
110
+ finance: "ph--bank--regular",
111
+ health: "ph--heart--regular",
112
+ geolocation: "ph--globe-simple--regular",
113
+ education: "ph--books--regular",
114
+ entertainment: "ph--music-notes--regular",
115
+ shopping: "ph--shopping-cart--regular",
116
+ travel: "ph--airplane-takeoff--regular",
117
+ utilities: "ph--lightning--regular",
118
+ weather: "ph--cloud-rain--regular"
119
+ };
120
+ var TemplateInputType;
121
+ (function(TemplateInputType2) {
122
+ TemplateInputType2[TemplateInputType2["VALUE"] = 0] = "VALUE";
123
+ TemplateInputType2[TemplateInputType2["PASS_THROUGH"] = 1] = "PASS_THROUGH";
124
+ TemplateInputType2[TemplateInputType2["RETRIEVER"] = 2] = "RETRIEVER";
125
+ TemplateInputType2[TemplateInputType2["FUNCTION"] = 3] = "FUNCTION";
126
+ TemplateInputType2[TemplateInputType2["QUERY"] = 4] = "QUERY";
127
+ TemplateInputType2[TemplateInputType2["RESOLVER"] = 5] = "RESOLVER";
128
+ TemplateInputType2[TemplateInputType2["CONTEXT"] = 6] = "CONTEXT";
129
+ TemplateInputType2[TemplateInputType2["SCHEMA"] = 7] = "SCHEMA";
130
+ })(TemplateInputType || (TemplateInputType = {}));
131
+ var TemplateInputSchema = import_effect2.Schema.mutable(import_effect2.Schema.Struct({
132
+ name: import_effect2.Schema.String,
133
+ type: import_effect2.Schema.optional(import_effect2.Schema.Enums(TemplateInputType)),
134
+ value: import_effect2.Schema.optional(import_effect2.Schema.String)
135
+ }));
136
+ var TemplateKinds = [
137
+ "always",
138
+ "schema-matching",
139
+ "automatically",
140
+ "manual"
141
+ ];
142
+ var TemplateKindSchema = import_effect2.Schema.Union(import_effect2.Schema.Struct({
143
+ include: import_effect2.Schema.Literal("always")
144
+ }), import_effect2.Schema.Struct({
145
+ include: import_effect2.Schema.Literal("schema-matching"),
146
+ typename: import_effect2.Schema.String
147
+ }), import_effect2.Schema.Struct({
148
+ include: import_effect2.Schema.Literal("automatically"),
149
+ description: import_effect2.Schema.String
150
+ }), import_effect2.Schema.Struct({
151
+ include: import_effect2.Schema.Literal("manual")
152
+ }));
153
+ var TemplateType = class extends (0, import_echo_schema3.TypedObject)({
154
+ typename: "dxos.org/type/Template",
155
+ version: "0.1.0"
156
+ })({
157
+ name: import_effect2.Schema.optional(import_effect2.Schema.String),
158
+ kind: import_effect2.Schema.mutable(TemplateKindSchema),
159
+ source: import_effect2.Schema.String,
160
+ inputs: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(TemplateInputSchema))),
161
+ command: import_effect2.Schema.optional(import_effect2.Schema.String)
162
+ }) {
163
+ };
164
+ var AssistantAction;
165
+ (function(AssistantAction2) {
166
+ const ASSISTANT_ACTION = `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/action`;
167
+ class CreateChat extends import_effect3.Schema.TaggedClass()(`${ASSISTANT_ACTION}/create-chat`, {
168
+ input: import_effect3.Schema.Struct({
169
+ spaceId: import_effect3.Schema.optional(import_effect3.Schema.String),
170
+ name: import_effect3.Schema.optional(import_effect3.Schema.String)
171
+ }),
172
+ output: import_effect3.Schema.Struct({
173
+ object: AIChatType
174
+ })
175
+ }) {
176
+ }
177
+ AssistantAction2.CreateChat = CreateChat;
178
+ class CreateTemplate extends import_effect3.Schema.TaggedClass()(`${ASSISTANT_ACTION}/create-template`, {
179
+ input: import_effect3.Schema.Struct({
180
+ name: import_effect3.Schema.optional(import_effect3.Schema.String)
181
+ }),
182
+ output: import_effect3.Schema.Struct({
183
+ object: TemplateType
184
+ })
185
+ }) {
186
+ }
187
+ AssistantAction2.CreateTemplate = CreateTemplate;
188
+ })(AssistantAction || (AssistantAction = {}));
189
+ var LLM_PROVIDERS = [
190
+ "edge",
191
+ "ollama",
192
+ "lmstudio"
193
+ ];
194
+ var AssistantSettingsSchema = import_effect3.Schema.mutable(import_effect3.Schema.Struct({
195
+ llmProvider: import_effect3.Schema.optional(import_effect3.Schema.Literal(...LLM_PROVIDERS)),
196
+ edgeModel: import_effect3.Schema.optional(import_effect3.Schema.String),
197
+ ollamaModel: import_effect3.Schema.optional(import_effect3.Schema.String),
198
+ lmstudioModel: import_effect3.Schema.optional(import_effect3.Schema.String),
199
+ customPrompts: import_effect3.Schema.optional(import_effect3.Schema.Boolean)
200
+ }));
201
+ // Annotate the CommonJS export names for ESM import in node:
202
+ 0 && (module.exports = {
203
+ AIChatType,
204
+ ApiAuthorization,
205
+ AssistantAction,
206
+ AssistantSettingsSchema,
207
+ LLM_PROVIDERS,
208
+ ServiceType,
209
+ TemplateInputSchema,
210
+ TemplateInputType,
211
+ TemplateKindSchema,
212
+ TemplateKinds,
213
+ TemplateType,
214
+ categoryIcons
215
+ });
216
+ //# sourceMappingURL=chunk-VG2UQY4S.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/chat.ts", "../../../src/types/service.ts", "../../../src/types/template.ts", "../../../src/types/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, Ref, TypedObject } from '@dxos/echo-schema';\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n // TODO(wittjosiah): Should be a ref to a Queue.\n assistantChatQueue: Ref(Expando),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Ref, TypedObject, type Ref$ } from '@dxos/echo-schema';\nimport { FunctionType } from '@dxos/functions';\n\nconst ApiAuthorizationKey = Schema.Struct({\n type: Schema.Literal('api-key'),\n key: Schema.String,\n placement: Schema.Union(\n Schema.Struct({\n type: Schema.Literal('authorization-header'),\n }),\n Schema.Struct({\n type: Schema.Literal('query'),\n name: Schema.String,\n }),\n ),\n});\n\nconst ApiAuthorizationOauth = Schema.Struct({\n type: Schema.Literal('oauth'),\n clientId: Schema.String,\n clientSecret: Schema.String,\n tokenUrl: Schema.String,\n grantType: Schema.String,\n});\n\nexport const ApiAuthorization = Schema.Union(ApiAuthorizationKey, ApiAuthorizationOauth);\nexport type ApiAuthorization = Schema.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = Schema.Struct({\n kind: Schema.Literal('function'),\n fn: Ref(FunctionType) as Ref$<FunctionType>,\n});\n\nconst ServiceInterfaceWorkflow = Schema.Struct({\n kind: Schema.Literal('workflow'),\n workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,\n});\n\nconst ServiceInterfaceApi = Schema.Struct({\n kind: Schema.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: Schema.optional(Schema.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: Schema.optional(Schema.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: Schema.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = Schema.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);\nexport type ServiceInterface = Schema.Schema.Type<typeof ServiceInterface>;\n\nexport class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({\n serviceId: Schema.String,\n name: Schema.optional(Schema.String),\n description: Schema.optional(Schema.String),\n category: Schema.optional(Schema.String),\n enabled: Schema.optional(Schema.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: Schema.optional(Schema.Array(ServiceInterface)),\n}) {}\n\n//\n// Service Registry\n//\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 { Schema } from 'effect';\n\nimport { TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Change to Schema.Literal (and discriminated union).\nexport enum TemplateInputType {\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 TemplateInputSchema = Schema.mutable(\n Schema.Struct({\n name: Schema.String,\n type: Schema.optional(Schema.Enums(TemplateInputType)),\n value: Schema.optional(Schema.String),\n }),\n);\n\nexport type TemplateInput = Schema.Schema.Type<typeof TemplateInputSchema>;\n\nexport const TemplateKinds = ['always', 'schema-matching', 'automatically', 'manual'] as const;\nexport type TemplateKind = (typeof TemplateKinds)[number];\n\nexport const TemplateKindSchema = Schema.Union(\n Schema.Struct({\n include: Schema.Literal('always'),\n }),\n Schema.Struct({\n include: Schema.Literal('schema-matching'),\n typename: Schema.String,\n }),\n Schema.Struct({\n include: Schema.Literal('automatically'),\n description: Schema.String,\n }),\n Schema.Struct({\n include: Schema.Literal('manual'),\n }),\n);\n\nexport type TemplateKindType = Schema.Schema.Type<typeof TemplateKindSchema>;\nexport class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({\n name: Schema.optional(Schema.String),\n kind: Schema.mutable(TemplateKindSchema),\n source: Schema.String,\n inputs: Schema.optional(Schema.mutable(Schema.Array(TemplateInputSchema))),\n command: Schema.optional(Schema.String),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { AIChatType } from './chat';\nimport { TemplateType } from './template';\nimport { ASSISTANT_PLUGIN } from '../meta';\n\nexport namespace AssistantAction {\n const ASSISTANT_ACTION = `${ASSISTANT_PLUGIN}/action`;\n\n export class CreateChat extends Schema.TaggedClass<CreateChat>()(`${ASSISTANT_ACTION}/create-chat`, {\n input: Schema.Struct({\n spaceId: Schema.optional(Schema.String),\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: AIChatType,\n }),\n }) {}\n\n export class CreateTemplate extends Schema.TaggedClass<CreateTemplate>()(`${ASSISTANT_ACTION}/create-template`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: TemplateType,\n }),\n }) {}\n}\n\nexport const LLM_PROVIDERS = ['edge', 'ollama', 'lmstudio'] as const;\n\nexport const AssistantSettingsSchema = Schema.mutable(\n Schema.Struct({\n llmProvider: Schema.optional(Schema.Literal(...LLM_PROVIDERS)),\n edgeModel: Schema.optional(Schema.String),\n ollamaModel: Schema.optional(Schema.String),\n lmstudioModel: Schema.optional(Schema.String),\n customPrompts: Schema.optional(Schema.Boolean),\n }),\n);\n\nexport type AssistantSettingsProps = Schema.Schema.Type<typeof AssistantSettingsSchema>;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA0C;ACA1C,oBAAuB;AAEvB,u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IACrC,CAAA;IACA6D,QAAQlE,eAAAA,OAAOC,OAAO;MACpBkE,QAAQZ;IACV,CAAA;EACF,CAAA,EAAA;EAAI;mBAPSa,iBAAAA;AAQf,GArBiBT,oBAAAA,kBAAAA,CAAAA,EAAAA;AAuBV,IAAMU,gBAAgB;EAAC;EAAQ;EAAU;;AAEzC,IAAMC,0BAA0BtE,eAAAA,OAAOiD,QAC5CjD,eAAAA,OAAOC,OAAO;EACZsE,aAAavE,eAAAA,OAAOwB,SAASxB,eAAAA,OAAOG,QAAO,GAAIkE,aAAAA,CAAAA;EAC/CG,WAAWxE,eAAAA,OAAOwB,SAASxB,eAAAA,OAAOK,MAAM;EACxCoE,aAAazE,eAAAA,OAAOwB,SAASxB,eAAAA,OAAOK,MAAM;EAC1CqE,eAAe1E,eAAAA,OAAOwB,SAASxB,eAAAA,OAAOK,MAAM;EAC5CsE,eAAe3E,eAAAA,OAAOwB,SAASxB,eAAAA,OAAOkC,OAAO;AAC/C,CAAA,CAAA;",
6
+ "names": ["import_echo_schema", "import_effect", "AIChatType", "TypedObject", "typename", "version", "assistantChatQueue", "Ref", "Expando", "ApiAuthorizationKey", "Schema", "Struct", "type", "Literal", "key", "String", "placement", "Union", "name", "ApiAuthorizationOauth", "clientId", "clientSecret", "tokenUrl", "grantType", "ApiAuthorization", "ServiceInterfaceFunction", "kind", "fn", "FunctionType", "ServiceInterfaceWorkflow", "workflow", "ComputeGraph", "ServiceInterfaceApi", "schemaUrl", "optional", "schema", "Any", "authorization", "ServiceInterface", "ServiceType", "serviceId", "description", "category", "enabled", "Boolean", "interfaces", "Array", "categoryIcons", "finance", "health", "geolocation", "education", "entertainment", "shopping", "travel", "utilities", "weather", "TemplateInputType", "TemplateInputSchema", "mutable", "Enums", "value", "TemplateKinds", "TemplateKindSchema", "include", "TemplateType", "source", "inputs", "command", "AssistantAction", "ASSISTANT_ACTION", "ASSISTANT_PLUGIN", "CreateChat", "TaggedClass", "input", "spaceId", "output", "object", "CreateTemplate", "LLM_PROVIDERS", "AssistantSettingsSchema", "llmProvider", "edgeModel", "ollamaModel", "lmstudioModel", "customPrompts"]
7
+ }