@dxos/plugin-assistant 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0

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 (166) hide show
  1. package/dist/lib/browser/{AssistantDialog-I47GUXWR.mjs → AssistantDialog-DTWVEQBB.mjs} +3 -3
  2. package/dist/lib/browser/{ChatContainer-GAYN3FEF.mjs → ChatContainer-ZNKENYKZ.mjs} +3 -3
  3. package/dist/lib/browser/{ai-client-OK5SMYJC.mjs → ai-client-5PRCXI7N.mjs} +3 -3
  4. package/dist/lib/browser/ai-client-5PRCXI7N.mjs.map +7 -0
  5. package/dist/lib/browser/{app-graph-builder-ZXKGE3H5.mjs → app-graph-builder-HTK3HFGM.mjs} +71 -61
  6. package/dist/lib/browser/app-graph-builder-HTK3HFGM.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-5P7U35RJ.mjs +192 -0
  8. package/dist/lib/browser/chunk-5P7U35RJ.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-BGMQ2YYP.mjs → chunk-7VDZP5WX.mjs} +4 -4
  10. package/dist/lib/browser/{chunk-BGMQ2YYP.mjs.map → chunk-7VDZP5WX.mjs.map} +2 -2
  11. package/dist/lib/browser/{chunk-7CAHKTZQ.mjs → chunk-OWZHLWW5.mjs} +66 -91
  12. package/dist/lib/browser/chunk-OWZHLWW5.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +3 -3
  14. package/dist/lib/browser/{intent-resolver-W6XREK5F.mjs → intent-resolver-QV5AAVJZ.mjs} +4 -9
  15. package/dist/lib/browser/intent-resolver-QV5AAVJZ.mjs.map +7 -0
  16. package/dist/lib/browser/meta.json +1 -1
  17. package/dist/lib/browser/{react-surface-QMI5KG4H.mjs → react-surface-JJPYWEIN.mjs} +9 -9
  18. package/dist/lib/browser/react-surface-JJPYWEIN.mjs.map +7 -0
  19. package/dist/lib/browser/{settings-LAJZQI4H.mjs → settings-OZX7J65A.mjs} +2 -2
  20. package/dist/lib/browser/types/index.mjs +1 -1
  21. package/dist/lib/node/{AssistantDialog-SDS2TE5L.cjs → AssistantDialog-RJJHZI63.cjs} +7 -7
  22. package/dist/lib/node/{ChatContainer-U6AVMAHY.cjs → ChatContainer-WVAAOEOH.cjs} +7 -7
  23. package/dist/lib/node/{ai-client-3EVTLXTT.cjs → ai-client-OUPSRQT7.cjs} +6 -6
  24. package/dist/lib/node/ai-client-OUPSRQT7.cjs.map +7 -0
  25. package/dist/lib/node/{app-graph-builder-TXHPXIIC.cjs → app-graph-builder-LEO63CZZ.cjs} +74 -64
  26. package/dist/lib/node/app-graph-builder-LEO63CZZ.cjs.map +7 -0
  27. package/dist/lib/node/{chunk-XBJO453B.cjs → chunk-GQ3XS5FZ.cjs} +9 -9
  28. package/dist/lib/node/{chunk-XBJO453B.cjs.map → chunk-GQ3XS5FZ.cjs.map} +2 -2
  29. package/dist/lib/node/{chunk-CWHFK36A.cjs → chunk-OOHFSPWR.cjs} +72 -91
  30. package/dist/lib/node/chunk-OOHFSPWR.cjs.map +7 -0
  31. package/dist/lib/node/{chunk-5UELRDHQ.cjs → chunk-VG2UQY4S.cjs} +74 -72
  32. package/dist/lib/node/chunk-VG2UQY4S.cjs.map +7 -0
  33. package/dist/lib/node/index.cjs +39 -39
  34. package/dist/lib/node/{intent-resolver-MUJMV7II.cjs → intent-resolver-QDGZMWLY.cjs} +10 -15
  35. package/dist/lib/node/intent-resolver-QDGZMWLY.cjs.map +7 -0
  36. package/dist/lib/node/meta.json +1 -1
  37. package/dist/lib/node/{react-surface-SAJF4XBB.cjs → react-surface-XNEIJJYJ.cjs} +22 -22
  38. package/dist/lib/node/react-surface-XNEIJJYJ.cjs.map +7 -0
  39. package/dist/lib/node/{settings-NPXTE6ND.cjs → settings-WLTC7XO5.cjs} +6 -6
  40. package/dist/lib/node/types/index.cjs +13 -13
  41. package/dist/lib/node/types/index.cjs.map +1 -1
  42. package/dist/lib/node-esm/{AssistantDialog-KGA5HBFO.mjs → AssistantDialog-D33WZUGR.mjs} +3 -3
  43. package/dist/lib/node-esm/{ChatContainer-XPNXNPSW.mjs → ChatContainer-FAYGNMQW.mjs} +3 -3
  44. package/dist/lib/node-esm/{ai-client-LYCBXZI7.mjs → ai-client-RZQWEDUX.mjs} +3 -3
  45. package/dist/lib/node-esm/ai-client-RZQWEDUX.mjs.map +7 -0
  46. package/dist/lib/node-esm/{app-graph-builder-SV4WC2E2.mjs → app-graph-builder-WXJNZDYB.mjs} +71 -61
  47. package/dist/lib/node-esm/app-graph-builder-WXJNZDYB.mjs.map +7 -0
  48. package/dist/lib/node-esm/{chunk-R7Q3OHWG.mjs → chunk-74GFINWJ.mjs} +4 -4
  49. package/dist/lib/node-esm/{chunk-R7Q3OHWG.mjs.map → chunk-74GFINWJ.mjs.map} +2 -2
  50. package/dist/lib/node-esm/{chunk-XFUXN5QU.mjs → chunk-ED55ZE4G.mjs} +66 -91
  51. package/dist/lib/node-esm/chunk-ED55ZE4G.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-UZWYXNR5.mjs +193 -0
  53. package/dist/lib/node-esm/chunk-UZWYXNR5.mjs.map +7 -0
  54. package/dist/lib/node-esm/index.mjs +3 -3
  55. package/dist/lib/node-esm/{intent-resolver-DZY2O2DG.mjs → intent-resolver-Q3I6S6HN.mjs} +4 -9
  56. package/dist/lib/node-esm/intent-resolver-Q3I6S6HN.mjs.map +7 -0
  57. package/dist/lib/node-esm/meta.json +1 -1
  58. package/dist/lib/node-esm/{react-surface-R43NHNMC.mjs → react-surface-RI3JONQY.mjs} +9 -9
  59. package/dist/lib/node-esm/react-surface-RI3JONQY.mjs.map +7 -0
  60. package/dist/lib/node-esm/{settings-K3JDH2I5.mjs → settings-CLE57WEP.mjs} +2 -2
  61. package/dist/lib/node-esm/types/index.mjs +1 -1
  62. package/dist/types/src/capabilities/ai-client.d.ts +2 -2
  63. package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
  64. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
  65. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  66. package/dist/types/src/capabilities/index.d.ts +2 -178
  67. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  69. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -1
  70. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  71. package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -1
  72. package/dist/types/src/components/Prompt/autocomplete.d.ts.map +1 -1
  73. package/dist/types/src/components/Prompt/references.d.ts.map +1 -1
  74. package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
  75. package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
  76. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  77. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  78. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -2
  79. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  80. package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
  81. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -1
  82. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +2 -2
  83. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
  84. package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +1 -1
  85. package/dist/types/src/components/Toolbox/Toolbox.d.ts +1 -1
  86. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  87. package/dist/types/src/hooks/index.d.ts +0 -1
  88. package/dist/types/src/hooks/index.d.ts.map +1 -1
  89. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  90. package/dist/types/src/hooks/useContextProvider.d.ts +1 -1
  91. package/dist/types/src/hooks/useContextProvider.d.ts.map +1 -1
  92. package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -1
  93. package/dist/types/src/hooks/useServices.d.ts.map +1 -1
  94. package/dist/types/src/hooks/useTextInputEvents.d.ts.map +1 -1
  95. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  96. package/dist/types/src/tools/function.d.ts +2 -2
  97. package/dist/types/src/tools/function.d.ts.map +1 -1
  98. package/dist/types/src/tools/openapi.d.ts.map +1 -1
  99. package/dist/types/src/translations.d.ts +6 -60
  100. package/dist/types/src/translations.d.ts.map +1 -1
  101. package/dist/types/src/types/service.d.ts +96 -95
  102. package/dist/types/src/types/service.d.ts.map +1 -1
  103. package/dist/types/src/types/template.d.ts +52 -52
  104. package/dist/types/src/types/template.d.ts.map +1 -1
  105. package/dist/types/src/types/types.d.ts +19 -19
  106. package/dist/types/src/types/types.d.ts.map +1 -1
  107. package/dist/types/tsconfig.tsbuildinfo +1 -1
  108. package/package.json +64 -58
  109. package/src/capabilities/ai-client.ts +4 -4
  110. package/src/capabilities/app-graph-builder.ts +166 -106
  111. package/src/capabilities/intent-resolver.ts +2 -5
  112. package/src/capabilities/react-surface.tsx +5 -5
  113. package/src/components/AmbientDialog/AmbientDialog.stories.tsx +1 -1
  114. package/src/components/Prompt/Prompt.stories.tsx +1 -1
  115. package/src/components/Prompt/PromptBar.tsx +4 -12
  116. package/src/components/PromptSettings.tsx +2 -2
  117. package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
  118. package/src/components/Thread/Thread.stories.tsx +12 -15
  119. package/src/components/Thread/ThreadContainer.stories.tsx +7 -7
  120. package/src/components/Thread/ThreadMessage.tsx +1 -1
  121. package/src/components/Toolbox/Toolbox.stories.tsx +2 -2
  122. package/src/components/Toolbox/Toolbox.tsx +3 -3
  123. package/src/hooks/index.ts +0 -1
  124. package/src/hooks/useChatProcessor.tsx +5 -5
  125. package/src/hooks/useContextProvider.ts +20 -16
  126. package/src/hooks/useMessageQueue.ts +2 -2
  127. package/src/tools/function.ts +4 -6
  128. package/src/tools/openapi.ts +4 -3
  129. package/src/types/service.ts +39 -37
  130. package/src/types/template.ts +27 -25
  131. package/src/types/types.ts +18 -18
  132. package/dist/lib/browser/ai-client-OK5SMYJC.mjs.map +0 -7
  133. package/dist/lib/browser/app-graph-builder-ZXKGE3H5.mjs.map +0 -7
  134. package/dist/lib/browser/chunk-7CAHKTZQ.mjs.map +0 -7
  135. package/dist/lib/browser/chunk-E7BN4QKP.mjs +0 -190
  136. package/dist/lib/browser/chunk-E7BN4QKP.mjs.map +0 -7
  137. package/dist/lib/browser/intent-resolver-W6XREK5F.mjs.map +0 -7
  138. package/dist/lib/browser/react-surface-QMI5KG4H.mjs.map +0 -7
  139. package/dist/lib/node/ai-client-3EVTLXTT.cjs.map +0 -7
  140. package/dist/lib/node/app-graph-builder-TXHPXIIC.cjs.map +0 -7
  141. package/dist/lib/node/chunk-5UELRDHQ.cjs.map +0 -7
  142. package/dist/lib/node/chunk-CWHFK36A.cjs.map +0 -7
  143. package/dist/lib/node/intent-resolver-MUJMV7II.cjs.map +0 -7
  144. package/dist/lib/node/react-surface-SAJF4XBB.cjs.map +0 -7
  145. package/dist/lib/node-esm/ai-client-LYCBXZI7.mjs.map +0 -7
  146. package/dist/lib/node-esm/app-graph-builder-SV4WC2E2.mjs.map +0 -7
  147. package/dist/lib/node-esm/chunk-ECYNZYEG.mjs +0 -191
  148. package/dist/lib/node-esm/chunk-ECYNZYEG.mjs.map +0 -7
  149. package/dist/lib/node-esm/chunk-XFUXN5QU.mjs.map +0 -7
  150. package/dist/lib/node-esm/intent-resolver-DZY2O2DG.mjs.map +0 -7
  151. package/dist/lib/node-esm/react-surface-R43NHNMC.mjs.map +0 -7
  152. package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
  153. package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
  154. package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
  155. package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
  156. package/src/hooks/invocation-handler.ts +0 -107
  157. package/src/hooks/useLocalTriggerManager.ts +0 -82
  158. /package/dist/lib/browser/{AssistantDialog-I47GUXWR.mjs.map → AssistantDialog-DTWVEQBB.mjs.map} +0 -0
  159. /package/dist/lib/browser/{ChatContainer-GAYN3FEF.mjs.map → ChatContainer-ZNKENYKZ.mjs.map} +0 -0
  160. /package/dist/lib/browser/{settings-LAJZQI4H.mjs.map → settings-OZX7J65A.mjs.map} +0 -0
  161. /package/dist/lib/node/{AssistantDialog-SDS2TE5L.cjs.map → AssistantDialog-RJJHZI63.cjs.map} +0 -0
  162. /package/dist/lib/node/{ChatContainer-U6AVMAHY.cjs.map → ChatContainer-WVAAOEOH.cjs.map} +0 -0
  163. /package/dist/lib/node/{settings-NPXTE6ND.cjs.map → settings-WLTC7XO5.cjs.map} +0 -0
  164. /package/dist/lib/node-esm/{AssistantDialog-KGA5HBFO.mjs.map → AssistantDialog-D33WZUGR.mjs.map} +0 -0
  165. /package/dist/lib/node-esm/{ChatContainer-XPNXNPSW.mjs.map → ChatContainer-FAYGNMQW.mjs.map} +0 -0
  166. /package/dist/lib/node-esm/{settings-K3JDH2I5.mjs.map → settings-CLE57WEP.mjs.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type Schema as S } from 'effect';
5
+ import { type Schema } from 'effect';
6
6
  import React, { Fragment, useEffect } from 'react';
7
7
 
8
8
  import { Input, Select, useTranslation } from '@dxos/react-ui';
@@ -15,7 +15,7 @@ import { type TemplateInput, TemplateInputType, type TemplateType } from '../../
15
15
 
16
16
  export type TemplateFormProps = {
17
17
  template: TemplateType;
18
- schema?: S.Schema<any, any, any>;
18
+ schema?: Schema.Schema<any, any, any>;
19
19
  commandEditable?: boolean;
20
20
  };
21
21
 
@@ -10,7 +10,7 @@ import React, { useCallback, useEffect, useState } from 'react';
10
10
  import { IntentPlugin } from '@dxos/app-framework';
11
11
  import { withPluginManager } from '@dxos/app-framework/testing';
12
12
  import { type Message } from '@dxos/artifact';
13
- import { ObjectId } from '@dxos/echo-schema';
13
+ import { Type } from '@dxos/echo';
14
14
  import { faker } from '@dxos/random';
15
15
  import { withClientProvider } from '@dxos/react-client/testing';
16
16
  import { withLayout, withSignals, withTheme } from '@dxos/storybook-utils';
@@ -29,9 +29,9 @@ const DefaultStory = ({ messages: _messages, ...props }: ThreadProps) => {
29
29
 
30
30
  const handleSubmit = useCallback(
31
31
  (text: string) => {
32
- const request: Message = { id: ObjectId.random(), role: 'user', content: [{ type: 'text', text }] };
32
+ const request: Message = { id: Type.ObjectId.random(), role: 'user', content: [{ type: 'text', text }] };
33
33
  const response: Message = {
34
- id: ObjectId.random(),
34
+ id: Type.ObjectId.random(),
35
35
  role: 'assistant',
36
36
  content: [{ type: 'text', disposition: 'cot', pending: true, text: faker.lorem.paragraphs(1) }],
37
37
  };
@@ -44,7 +44,7 @@ const DefaultStory = ({ messages: _messages, ...props }: ThreadProps) => {
44
44
  request,
45
45
  response,
46
46
  {
47
- id: ObjectId.random(),
47
+ id: Type.ObjectId.random(),
48
48
  role: 'assistant',
49
49
  content: [{ type: 'text', text: faker.lorem.paragraphs(1) }],
50
50
  },
@@ -74,13 +74,10 @@ const meta: Meta<ThreadProps> = {
74
74
  component: Thread,
75
75
  decorators: [
76
76
  withSignals,
77
- withClientProvider({
78
- createIdentity: true,
79
- createSpace: true,
80
- }),
77
+ withClientProvider({ createIdentity: true, createSpace: true }),
81
78
  withPluginManager({ plugins: [IntentPlugin()] }),
82
79
  withTheme,
83
- withLayout({ fullscreen: true, tooltips: true, classNames: 'flex justify-center' }),
80
+ withLayout({ fullscreen: true, classNames: 'flex justify-center' }),
84
81
  ],
85
82
  parameters: {
86
83
  translations,
@@ -93,7 +90,7 @@ type Story = StoryObj<ThreadProps>;
93
90
 
94
91
  const TEST_MESSAGES: Message[] = [
95
92
  {
96
- id: ObjectId.random(),
93
+ id: Type.ObjectId.random(),
97
94
  role: 'user',
98
95
  content: [
99
96
  {
@@ -103,7 +100,7 @@ const TEST_MESSAGES: Message[] = [
103
100
  ],
104
101
  },
105
102
  {
106
- id: ObjectId.random(),
103
+ id: Type.ObjectId.random(),
107
104
  role: 'assistant',
108
105
  content: [
109
106
  {
@@ -128,7 +125,7 @@ const TEST_MESSAGES: Message[] = [
128
125
  ],
129
126
  },
130
127
  {
131
- id: ObjectId.random(),
128
+ id: Type.ObjectId.random(),
132
129
  role: 'user',
133
130
  content: [
134
131
  {
@@ -139,7 +136,7 @@ const TEST_MESSAGES: Message[] = [
139
136
  ],
140
137
  },
141
138
  {
142
- id: ObjectId.random(),
139
+ id: Type.ObjectId.random(),
143
140
  role: 'assistant',
144
141
  content: [
145
142
  {
@@ -151,7 +148,7 @@ const TEST_MESSAGES: Message[] = [
151
148
  ],
152
149
  },
153
150
  {
154
- id: ObjectId.random(),
151
+ id: Type.ObjectId.random(),
155
152
  role: 'user',
156
153
  content: [
157
154
  {
@@ -162,7 +159,7 @@ const TEST_MESSAGES: Message[] = [
162
159
  ],
163
160
  },
164
161
  {
165
- id: ObjectId.random(),
162
+ id: Type.ObjectId.random(),
166
163
  role: 'assistant',
167
164
  content: [
168
165
  {
@@ -18,11 +18,11 @@ import {
18
18
  } from '@dxos/app-framework';
19
19
  import { withPluginManager } from '@dxos/app-framework/testing';
20
20
  import { Message, type Tool } from '@dxos/artifact';
21
- import { genericTools, localServiceEndpoints, type IsObject } from '@dxos/artifact-testing';
21
+ import { genericTools, localServiceEndpoints } from '@dxos/artifact-testing';
22
22
  import { AIServiceEdgeClient } from '@dxos/assistant';
23
- import { create, ObjectId } from '@dxos/echo-schema';
23
+ import { DXN, Type } from '@dxos/echo';
24
+ import { createQueueDxn, create } from '@dxos/echo-schema';
24
25
  import { invariant } from '@dxos/invariant';
25
- import { DXN } from '@dxos/keys';
26
26
  import { ChessPlugin } from '@dxos/plugin-chess';
27
27
  import { ChessType } from '@dxos/plugin-chess/types';
28
28
  import { ClientPlugin } from '@dxos/plugin-client';
@@ -30,7 +30,7 @@ import { InboxPlugin } from '@dxos/plugin-inbox';
30
30
  import { MapPlugin } from '@dxos/plugin-map';
31
31
  import { SpacePlugin } from '@dxos/plugin-space';
32
32
  import { TablePlugin } from '@dxos/plugin-table';
33
- import { createQueueDxn, useQueue, useSpace } from '@dxos/react-client/echo';
33
+ import { useQueue, useSpace } from '@dxos/react-client/echo';
34
34
  import { IconButton, Input, Toolbar } from '@dxos/react-ui';
35
35
  import { mx } from '@dxos/react-ui-theme';
36
36
  import { withLayout, withTheme } from '@dxos/storybook-utils';
@@ -43,7 +43,7 @@ import translations from '../../translations';
43
43
  const endpoints = localServiceEndpoints;
44
44
 
45
45
  type RenderProps = {
46
- items?: IsObject[];
46
+ items?: Type.AnyObject[];
47
47
  prompts?: string[];
48
48
  } & Pick<ThreadProps, 'debug'>;
49
49
 
@@ -131,7 +131,7 @@ const DefaultStory = ({ items: _items, prompts = [], ...props }: RenderProps) =>
131
131
 
132
132
  const handleDelete = useCallback(
133
133
  (id: string) => {
134
- invariant(ObjectId.isValid(id), 'Invalid message id');
134
+ invariant(Type.ObjectId.isValid(id), 'Invalid message id');
135
135
  void queue?.delete([id]);
136
136
  },
137
137
  [queue],
@@ -224,7 +224,7 @@ const meta: Meta<typeof DefaultStory> = {
224
224
  fireEvents: [Events.SetupArtifactDefinition],
225
225
  }),
226
226
  withTheme,
227
- withLayout({ fullscreen: true, tooltips: true }),
227
+ withLayout({ fullscreen: true }),
228
228
  ],
229
229
  parameters: {
230
230
  translations,
@@ -21,7 +21,7 @@ import { ToolBlock, isToolMessage } from './ToolInvocations';
21
21
  import { ToolboxContainer } from '../Toolbox';
22
22
 
23
23
  const panelClassNames = 'flex flex-col w-full px-2 bg-groupSurface rounded-md';
24
- const userClassNames = 'bg-[--user-fill] text-inverse';
24
+ const userClassNames = 'bg-[--user-fill] text-accentSurfaceText';
25
25
 
26
26
  const ToggleContainer = (props: ToggleContainerProps) => {
27
27
  return <NativeToggleContainer {...props} classNames={mx(panelClassNames, props.classNames)} />;
@@ -54,11 +54,11 @@ const meta: Meta<typeof Toolbox> = {
54
54
  capabilities,
55
55
  }),
56
56
  withTheme,
57
- withLayout({ tooltips: true }),
57
+ withLayout(),
58
58
  ],
59
59
  parameters: {
60
- translations,
61
60
  layout: 'centered',
61
+ translations,
62
62
  },
63
63
  };
64
64
 
@@ -6,7 +6,7 @@ import React, { useState, useEffect, Fragment, type FC } from 'react';
6
6
 
7
7
  import { Capabilities, useCapabilities } from '@dxos/app-framework';
8
8
  import { parseToolName, type ArtifactDefinition, type Tool } from '@dxos/artifact';
9
- import { FunctionType } from '@dxos/functions/types';
9
+ import { FunctionType } from '@dxos/functions';
10
10
  import { log } from '@dxos/log';
11
11
  import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
12
12
  import { type ThemedClassName } from '@dxos/react-ui';
@@ -93,7 +93,7 @@ export const ToolboxContainer = ({ classNames, space }: ThemedClassName<{ space?
93
93
  const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
94
94
 
95
95
  // Registered services.
96
- const services = useQuery(space, Filter.schema(ServiceType));
96
+ const services = useQuery(space, Filter.type(ServiceType));
97
97
  const [serviceTools, setServiceTools] = useState<{ service: ServiceType; tools: Tool[] }[]>([]);
98
98
  useEffect(() => {
99
99
  log('creating service tools...', { services: services.length });
@@ -107,7 +107,7 @@ export const ToolboxContainer = ({ classNames, space }: ThemedClassName<{ space?
107
107
  }, [services]);
108
108
 
109
109
  // Deployed functions.
110
- const functions = useQuery(space, Filter.schema(FunctionType));
110
+ const functions = useQuery(space, Filter.type(FunctionType));
111
111
 
112
112
  return (
113
113
  <Toolbox classNames={classNames} artifacts={artifactDefinitions} services={serviceTools} functions={functions} />
@@ -5,7 +5,6 @@
5
5
  export * from './processor';
6
6
 
7
7
  export * from './useChatProcessor';
8
- export * from './useLocalTriggerManager';
9
8
  export * from './useMessageQueue';
10
9
  export * from './useServices';
11
10
  export * from './useTextInputEvents';
@@ -7,7 +7,7 @@ import { useEffect, useMemo, useState } from 'react';
7
7
  import { Capabilities, useCapabilities, useCapability, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { type AssociatedArtifact, createSystemPrompt, type Tool } from '@dxos/artifact';
9
9
  import { DEFAULT_EDGE_MODEL, DEFAULT_OLLAMA_MODEL } from '@dxos/assistant';
10
- import { FunctionType } from '@dxos/functions/types';
10
+ import { FunctionType } from '@dxos/functions';
11
11
  import { log } from '@dxos/log';
12
12
  import { useConfig } from '@dxos/react-client';
13
13
  import { Filter, fullyQualifiedId, type Space, useQuery } from '@dxos/react-client/echo';
@@ -15,7 +15,7 @@ import { isNonNullable } from '@dxos/util';
15
15
 
16
16
  import { AssistantCapabilities } from '../capabilities';
17
17
  import { ChatProcessor, type ChatProcessorOptions } from '../hooks';
18
- import { covertFunctionToTool, createToolsFromService } from '../tools';
18
+ import { convertFunctionToTool, createToolsFromService } from '../tools';
19
19
  import { type AIChatType, type AssistantSettingsProps, ServiceType } from '../types';
20
20
 
21
21
  type UseChatProcessorProps = {
@@ -43,7 +43,7 @@ export const useChatProcessor = ({
43
43
  const { dispatchPromise: dispatch } = useIntentDispatcher();
44
44
 
45
45
  // Services.
46
- const services = useQuery(space, Filter.schema(ServiceType));
46
+ const services = useQuery(space, Filter.type(ServiceType));
47
47
  const [serviceTools, setServiceTools] = useState<Tool[]>([]);
48
48
  useEffect(() => {
49
49
  log('creating service tools...');
@@ -55,7 +55,7 @@ export const useChatProcessor = ({
55
55
 
56
56
  // Tools and context.
57
57
  const config = useConfig();
58
- const functions = useQuery(space, Filter.schema(FunctionType));
58
+ const functions = useQuery(space, Filter.type(FunctionType));
59
59
  const chatId = useMemo(() => (chat ? fullyQualifiedId(chat) : undefined), [chat]);
60
60
  const [tools, extensions] = useMemo(() => {
61
61
  log('creating tools...');
@@ -63,7 +63,7 @@ export const useChatProcessor = ({
63
63
  ...globalTools.flat(),
64
64
  ...serviceTools,
65
65
  ...functions
66
- .map((fn) => covertFunctionToTool(fn, config.values.runtime?.services?.edge?.url ?? '', space?.id))
66
+ .map((fn) => convertFunctionToTool(fn, config.values.runtime?.services?.edge?.url ?? '', space?.id))
67
67
  .filter(isNonNullable),
68
68
  ];
69
69
  const extensions = { space, dispatch, pivotId: chatId, part };
@@ -2,13 +2,14 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import type { Schema } from 'effect';
5
6
  import { useMemo } from 'react';
6
7
 
7
8
  import { Capabilities, useCapabilities } from '@dxos/app-framework';
8
- import type { Space } from '@dxos/client/echo';
9
- import { getDXN, getLabel, getSchema } from '@dxos/echo-schema';
9
+ import { Filter, type Space } from '@dxos/client/echo';
10
+ import { Type } from '@dxos/echo';
11
+ import { type BaseEchoObject, getDXN, getLabel } from '@dxos/echo-schema';
10
12
  import { log } from '@dxos/log';
11
- import { Filter } from '@dxos/react-client/echo';
12
13
 
13
14
  export type ContextProvider = {
14
15
  query: (params: { query: string }) => Promise<Array<{ uri: string; label: string }>>;
@@ -29,25 +30,28 @@ export const useContextProvider = (space?: Space): ContextProvider | undefined =
29
30
  query: async ({ query }) => {
30
31
  const artifactSchemas = artifactDefinitions.map((artifact) => artifact.schema);
31
32
  const { objects } = await space.db
32
- .query(Filter.or(...artifactSchemas.map((schema) => Filter.schema(schema))))
33
+ .query(Filter.or(...artifactSchemas.map((schema) => Filter.type(schema as Schema.Schema<BaseEchoObject>))))
33
34
  .run();
34
- return objects
35
- .map((object) => {
36
- log.info('object', { object, label: getLabel(getSchema(object)!, object) });
37
- return object;
38
- })
39
- .filter((object) => stringMatch(query, getLabel(getSchema(object)!, object) ?? ''))
40
- .filter((object) => !!getDXN(object))
41
- .map((object) => ({
42
- uri: getDXN(object)!.toString(),
43
- label: getLabel(getSchema(object)!, object) ?? '',
44
- }));
35
+ return (
36
+ objects
37
+ .map((object) => {
38
+ log.info('object', { object, label: getLabel(Type.getSchema(object)!, object) });
39
+ return object;
40
+ })
41
+ .filter((object) => stringMatch(query, getLabel(Type.getSchema(object)!, object) ?? ''))
42
+ // TODO(dmaretskyi): `Type.getDXN` (at the point of writing) didn't work here as it was schema-only.
43
+ .filter((object) => !!getDXN(object))
44
+ .map((object) => ({
45
+ uri: getDXN(object as any)!.toString(),
46
+ label: getLabel(Type.getSchema(object)!, object) ?? '',
47
+ }))
48
+ );
45
49
  },
46
50
  resolveMetadata: async ({ uri }) => {
47
51
  const object = await space.db.query({ id: uri }).first();
48
52
  return {
49
53
  uri,
50
- label: getLabel(getSchema(object)!, object) ?? '',
54
+ label: getLabel(Type.getSchema(object)!, object) ?? '',
51
55
  };
52
56
  },
53
57
  };
@@ -5,7 +5,7 @@
5
5
  import { useMemo } from 'react';
6
6
 
7
7
  import { type Message } from '@dxos/artifact';
8
- import { DXN, QueueSubspaceTags } from '@dxos/keys';
8
+ import { createQueueDxn } from '@dxos/echo-schema';
9
9
  import { getSpace, useQueue } from '@dxos/react-client/echo';
10
10
 
11
11
  import { type AIChatType } from '../types';
@@ -14,7 +14,7 @@ export const useMessageQueue = (chat?: AIChatType) => {
14
14
  const space = getSpace(chat);
15
15
  const queueDxn = useMemo(() => {
16
16
  const dxn = space && chat?.assistantChatQueue.dxn;
17
- return dxn ? new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, space.id, dxn.parts.at(-1)!]) : undefined;
17
+ return dxn ? createQueueDxn(space.id) : undefined;
18
18
  }, [space, chat?.assistantChatQueue.dxn]);
19
19
 
20
20
  return useQueue<Message>(queueDxn);
@@ -5,13 +5,13 @@
5
5
  import { defineTool, ToolResult } from '@dxos/artifact';
6
6
  import type { Tool } from '@dxos/artifact';
7
7
  import { toEffectSchema } from '@dxos/echo-schema';
8
- import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions/types';
9
- import type { FunctionType } from '@dxos/functions/types';
8
+ import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
9
+ import type { FunctionType } from '@dxos/functions';
10
10
  import { log } from '@dxos/log';
11
11
  import type { SpaceId } from '@dxos/react-client/echo';
12
12
  import { getMeta } from '@dxos/react-client/echo';
13
13
 
14
- export const covertFunctionToTool = (
14
+ export const convertFunctionToTool = (
15
15
  fn: FunctionType,
16
16
  edgeUrl: string,
17
17
  spaceId?: SpaceId | undefined,
@@ -24,9 +24,7 @@ export const covertFunctionToTool = (
24
24
  if (!existingFunctionUrl) {
25
25
  return undefined;
26
26
  }
27
- const url = getInvocationUrl(existingFunctionUrl, edgeUrl, {
28
- spaceId,
29
- });
27
+ const url = getInvocationUrl(existingFunctionUrl, edgeUrl, { spaceId });
30
28
 
31
29
  return defineTool('user-function', {
32
30
  name: fn.name,
@@ -2,11 +2,12 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  import jsonpointer from 'jsonpointer';
6
7
  import { type OpenAPIV2, type OpenAPIV3_1 } from 'openapi-types';
7
8
 
8
9
  import { ToolResult, type Tool } from '@dxos/artifact';
9
- import { JsonSchemaType, normalizeSchema, S, toEffectSchema } from '@dxos/echo-schema';
10
+ import { JsonSchemaType, normalizeSchema, toEffectSchema } from '@dxos/echo-schema';
10
11
  import { invariant } from '@dxos/invariant';
11
12
  import { log } from '@dxos/log';
12
13
  import { deepMapValues } from '@dxos/util';
@@ -82,7 +83,7 @@ export const createToolsFromApi = async (url: string, options?: CreateToolsFromA
82
83
  }
83
84
 
84
85
  log('inputSchema', { inputSchema });
85
- S.validateSync(JsonSchemaType)(inputSchema);
86
+ Schema.validateSync(JsonSchemaType)(inputSchema);
86
87
 
87
88
  const description = methodItem.description ?? methodItem.summary;
88
89
  if (!description) {
@@ -200,7 +201,7 @@ const callApiEndpoint = async (endpoint: EndpointDescriptor, input: any) => {
200
201
 
201
202
  // Client-side validation
202
203
  const effectSchema = toEffectSchema(parameter.schema);
203
- S.validateSync(effectSchema)(value);
204
+ Schema.validateSync(effectSchema)(value);
204
205
 
205
206
  if (body) {
206
207
  throw new Error(`Duplicate body parameter: ${parameter.name}`);
@@ -2,78 +2,80 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
6
+
5
7
  import { ComputeGraph } from '@dxos/conductor';
6
- import { Ref, S, TypedObject, type Ref$ } from '@dxos/echo-schema';
7
- import { FunctionType } from '@dxos/functions/types';
8
-
9
- const ApiAuthorizationKey = S.Struct({
10
- type: S.Literal('api-key'),
11
- key: S.String,
12
- placement: S.Union(
13
- S.Struct({
14
- type: S.Literal('authorization-header'),
8
+ import { Ref, TypedObject, type Ref$ } from '@dxos/echo-schema';
9
+ import { FunctionType } from '@dxos/functions';
10
+
11
+ const ApiAuthorizationKey = Schema.Struct({
12
+ type: Schema.Literal('api-key'),
13
+ key: Schema.String,
14
+ placement: Schema.Union(
15
+ Schema.Struct({
16
+ type: Schema.Literal('authorization-header'),
15
17
  }),
16
- S.Struct({
17
- type: S.Literal('query'),
18
- name: S.String,
18
+ Schema.Struct({
19
+ type: Schema.Literal('query'),
20
+ name: Schema.String,
19
21
  }),
20
22
  ),
21
23
  });
22
24
 
23
- const ApiAuthorizationOauth = S.Struct({
24
- type: S.Literal('oauth'),
25
- clientId: S.String,
26
- clientSecret: S.String,
27
- tokenUrl: S.String,
28
- grantType: S.String,
25
+ const ApiAuthorizationOauth = Schema.Struct({
26
+ type: Schema.Literal('oauth'),
27
+ clientId: Schema.String,
28
+ clientSecret: Schema.String,
29
+ tokenUrl: Schema.String,
30
+ grantType: Schema.String,
29
31
  });
30
32
 
31
- export const ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
32
- export type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;
33
+ export const ApiAuthorization = Schema.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
34
+ export type ApiAuthorization = Schema.Schema.Type<typeof ApiAuthorization>;
33
35
 
34
- const ServiceInterfaceFunction = S.Struct({
35
- kind: S.Literal('function'),
36
+ const ServiceInterfaceFunction = Schema.Struct({
37
+ kind: Schema.Literal('function'),
36
38
  fn: Ref(FunctionType) as Ref$<FunctionType>,
37
39
  });
38
40
 
39
- const ServiceInterfaceWorkflow = S.Struct({
40
- kind: S.Literal('workflow'),
41
+ const ServiceInterfaceWorkflow = Schema.Struct({
42
+ kind: Schema.Literal('workflow'),
41
43
  workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,
42
44
  });
43
45
 
44
- const ServiceInterfaceApi = S.Struct({
45
- kind: S.Literal('api'),
46
+ const ServiceInterfaceApi = Schema.Struct({
47
+ kind: Schema.Literal('api'),
46
48
 
47
49
  /**
48
50
  * URL to fetch the openapi schema.
49
51
  */
50
- schemaUrl: S.optional(S.String),
52
+ schemaUrl: Schema.optional(Schema.String),
51
53
 
52
54
  /**
53
55
  * Inlined openapi schema.
54
56
  */
55
- schema: S.optional(S.Any),
57
+ schema: Schema.optional(Schema.Any),
56
58
 
57
59
  /**
58
60
  * Authorization configuration if required.
59
61
  */
60
- authorization: S.optional(ApiAuthorization),
62
+ authorization: Schema.optional(ApiAuthorization),
61
63
  });
62
64
 
63
- const ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
64
- export type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;
65
+ const ServiceInterface = Schema.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
66
+ export type ServiceInterface = Schema.Schema.Type<typeof ServiceInterface>;
65
67
 
66
68
  export class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({
67
- serviceId: S.String,
68
- name: S.optional(S.String),
69
- description: S.optional(S.String),
70
- category: S.optional(S.String),
71
- enabled: S.optional(S.Boolean),
69
+ serviceId: Schema.String,
70
+ name: Schema.optional(Schema.String),
71
+ description: Schema.optional(Schema.String),
72
+ category: Schema.optional(Schema.String),
73
+ enabled: Schema.optional(Schema.Boolean),
72
74
 
73
75
  /**
74
76
  * Entries exposed: functions, workflows, and APIs.
75
77
  */
76
- interfaces: S.optional(S.Array(ServiceInterface)),
78
+ interfaces: Schema.optional(Schema.Array(ServiceInterface)),
77
79
  }) {}
78
80
 
79
81
  //
@@ -2,9 +2,11 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { S, TypedObject } from '@dxos/echo-schema';
5
+ import { Schema } from 'effect';
6
6
 
7
- // TODO(burdon): Change to S.Literal (and discriminated union).
7
+ import { TypedObject } from '@dxos/echo-schema';
8
+
9
+ // TODO(burdon): Change to Schema.Literal (and discriminated union).
8
10
  export enum TemplateInputType {
9
11
  VALUE = 0,
10
12
  PASS_THROUGH = 1,
@@ -16,41 +18,41 @@ export enum TemplateInputType {
16
18
  SCHEMA = 7,
17
19
  }
18
20
 
19
- export const TemplateInputSchema = S.mutable(
20
- S.Struct({
21
- name: S.String,
22
- type: S.optional(S.Enums(TemplateInputType)),
23
- value: S.optional(S.String),
21
+ export const TemplateInputSchema = Schema.mutable(
22
+ Schema.Struct({
23
+ name: Schema.String,
24
+ type: Schema.optional(Schema.Enums(TemplateInputType)),
25
+ value: Schema.optional(Schema.String),
24
26
  }),
25
27
  );
26
28
 
27
- export type TemplateInput = S.Schema.Type<typeof TemplateInputSchema>;
29
+ export type TemplateInput = Schema.Schema.Type<typeof TemplateInputSchema>;
28
30
 
29
31
  export const TemplateKinds = ['always', 'schema-matching', 'automatically', 'manual'] as const;
30
32
  export type TemplateKind = (typeof TemplateKinds)[number];
31
33
 
32
- export const TemplateKindSchema = S.Union(
33
- S.Struct({
34
- include: S.Literal('always'),
34
+ export const TemplateKindSchema = Schema.Union(
35
+ Schema.Struct({
36
+ include: Schema.Literal('always'),
35
37
  }),
36
- S.Struct({
37
- include: S.Literal('schema-matching'),
38
- typename: S.String,
38
+ Schema.Struct({
39
+ include: Schema.Literal('schema-matching'),
40
+ typename: Schema.String,
39
41
  }),
40
- S.Struct({
41
- include: S.Literal('automatically'),
42
- description: S.String,
42
+ Schema.Struct({
43
+ include: Schema.Literal('automatically'),
44
+ description: Schema.String,
43
45
  }),
44
- S.Struct({
45
- include: S.Literal('manual'),
46
+ Schema.Struct({
47
+ include: Schema.Literal('manual'),
46
48
  }),
47
49
  );
48
50
 
49
- export type TemplateKindType = S.Schema.Type<typeof TemplateKindSchema>;
51
+ export type TemplateKindType = Schema.Schema.Type<typeof TemplateKindSchema>;
50
52
  export class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({
51
- name: S.optional(S.String),
52
- kind: S.mutable(TemplateKindSchema),
53
- source: S.String,
54
- inputs: S.optional(S.mutable(S.Array(TemplateInputSchema))),
55
- command: S.optional(S.String),
53
+ name: Schema.optional(Schema.String),
54
+ kind: Schema.mutable(TemplateKindSchema),
55
+ source: Schema.String,
56
+ inputs: Schema.optional(Schema.mutable(Schema.Array(TemplateInputSchema))),
57
+ command: Schema.optional(Schema.String),
56
58
  }) {}