@dxos/assistant 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446

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 (175) hide show
  1. package/dist/lib/browser/{chunk-B4HAWUFW.mjs → chunk-PND5VR6D.mjs} +286 -757
  2. package/dist/lib/browser/chunk-PND5VR6D.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +324 -7
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +102 -139
  7. package/dist/lib/browser/testing/index.mjs.map +4 -4
  8. package/dist/lib/node/{chunk-NOB7CIIC.cjs → chunk-IBOBRBDF.cjs} +303 -768
  9. package/dist/lib/node/chunk-IBOBRBDF.cjs.map +7 -0
  10. package/dist/lib/node/index.cjs +353 -36
  11. package/dist/lib/node/index.cjs.map +4 -4
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/testing/index.cjs +93 -128
  14. package/dist/lib/node/testing/index.cjs.map +4 -4
  15. package/dist/lib/node-esm/{chunk-SAWYU3V5.mjs → chunk-DCQJOLSR.mjs} +286 -757
  16. package/dist/lib/node-esm/chunk-DCQJOLSR.mjs.map +7 -0
  17. package/dist/lib/node-esm/index.mjs +324 -7
  18. package/dist/lib/node-esm/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/meta.json +1 -1
  20. package/dist/lib/node-esm/testing/index.mjs +102 -139
  21. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  22. package/dist/types/src/ai-service/edge-client.d.ts +5 -4
  23. package/dist/types/src/ai-service/edge-client.d.ts.map +1 -1
  24. package/dist/types/src/ai-service/message-collector.d.ts +6 -0
  25. package/dist/types/src/ai-service/message-collector.d.ts.map +1 -1
  26. package/dist/types/src/ai-service/ollama-client.d.ts +2 -6
  27. package/dist/types/src/ai-service/ollama-client.d.ts.map +1 -1
  28. package/dist/types/src/ai-service/parser.d.ts +3 -0
  29. package/dist/types/src/ai-service/parser.d.ts.map +1 -1
  30. package/dist/types/src/ai-service/service.d.ts +2 -18
  31. package/dist/types/src/ai-service/service.d.ts.map +1 -1
  32. package/dist/types/src/ai-service/stream.d.ts.map +1 -1
  33. package/dist/types/src/ai-service/testing/mock.d.ts +2 -6
  34. package/dist/types/src/ai-service/testing/mock.d.ts.map +1 -1
  35. package/dist/types/src/ai-service/testing/test-stream.d.ts.map +1 -1
  36. package/dist/types/src/ai-service/types.d.ts +101 -144
  37. package/dist/types/src/ai-service/types.d.ts.map +1 -1
  38. package/dist/types/src/ai-service/util/sse.d.ts.map +1 -1
  39. package/dist/types/src/{experimental/conversation → conversation}/conversation.d.ts +21 -2
  40. package/dist/types/src/conversation/conversation.d.ts.map +1 -0
  41. package/dist/types/src/conversation/conversation.test.d.ts.map +1 -0
  42. package/dist/types/src/conversation/index.d.ts.map +1 -0
  43. package/dist/types/src/{experimental/conversation → conversation}/types.d.ts +12 -11
  44. package/dist/types/src/conversation/types.d.ts.map +1 -0
  45. package/dist/types/src/cypher/ast.d.ts.map +1 -0
  46. package/dist/types/src/cypher/combinators.d.ts.map +1 -0
  47. package/dist/types/src/cypher/combinators.test.d.ts.map +1 -0
  48. package/dist/types/src/cypher/echo-data-source.d.ts.map +1 -0
  49. package/dist/types/src/cypher/execution-plan.d.ts.map +1 -0
  50. package/dist/types/src/cypher/execution-plan.test.d.ts.map +1 -0
  51. package/dist/types/src/cypher/index.d.ts.map +1 -0
  52. package/dist/types/src/cypher/parjs.d.ts.map +1 -0
  53. package/dist/types/src/cypher/parser.d.ts.map +1 -0
  54. package/dist/types/src/cypher/query-executor.d.ts.map +1 -0
  55. package/dist/types/src/cypher/query-executor.test.d.ts.map +1 -0
  56. package/dist/types/src/cypher/schema.d.ts.map +1 -0
  57. package/dist/types/src/cypher/schema.test.d.ts.map +1 -0
  58. package/dist/types/src/index.d.ts +2 -1
  59. package/dist/types/src/index.d.ts.map +1 -1
  60. package/dist/types/src/session/index.d.ts +0 -2
  61. package/dist/types/src/session/index.d.ts.map +1 -1
  62. package/dist/types/src/session/session.d.ts +13 -33
  63. package/dist/types/src/session/session.d.ts.map +1 -1
  64. package/dist/types/src/testing/index.d.ts +0 -1
  65. package/dist/types/src/testing/index.d.ts.map +1 -1
  66. package/dist/types/src/testing/logger.d.ts +1 -1
  67. package/dist/types/src/testing/logger.d.ts.map +1 -1
  68. package/dist/types/src/testing/ollama.d.ts.map +1 -1
  69. package/dist/types/src/testing/query-promts.d.ts +4 -4
  70. package/dist/types/src/testing/query-promts.d.ts.map +1 -1
  71. package/dist/types/src/testing/test-data.d.ts +5 -5
  72. package/dist/types/src/testing/test-data.d.ts.map +1 -1
  73. package/dist/types/src/testing/test-schema.d.ts +23 -25
  74. package/dist/types/src/testing/test-schema.d.ts.map +1 -1
  75. package/dist/types/src/util/trim.d.ts.map +1 -1
  76. package/dist/types/tsconfig.tsbuildinfo +1 -1
  77. package/package.json +14 -20
  78. package/src/ai-service/client.test.ts +73 -55
  79. package/src/ai-service/edge-client.ts +20 -13
  80. package/src/ai-service/ollama-client.ts +10 -17
  81. package/src/ai-service/parser.ts +2 -13
  82. package/src/ai-service/service.ts +3 -19
  83. package/src/ai-service/testing/mock.ts +1 -9
  84. package/src/ai-service/types.ts +15 -24
  85. package/src/bin/chat.ts +4 -4
  86. package/src/{experimental/conversation → conversation}/conversation.test.ts +5 -5
  87. package/src/{experimental/conversation → conversation}/conversation.ts +119 -4
  88. package/src/{experimental/conversation → conversation}/types.ts +14 -11
  89. package/src/{experimental/cypher → cypher}/combinators.test.ts +4 -4
  90. package/src/{experimental/cypher → cypher}/echo-data-source.ts +11 -11
  91. package/src/{experimental/cypher → cypher}/execution-plan.test.ts +1 -1
  92. package/src/{experimental/cypher → cypher}/query-executor.test.ts +2 -2
  93. package/src/{experimental/cypher → cypher}/schema.test.ts +3 -3
  94. package/src/{experimental/cypher → cypher}/schema.ts +1 -1
  95. package/src/index.ts +2 -3
  96. package/src/session/index.ts +0 -2
  97. package/src/session/session.test.ts +63 -35
  98. package/src/session/session.ts +151 -297
  99. package/src/testing/artifacts.test.ts +22 -22
  100. package/src/testing/index.ts +0 -1
  101. package/src/testing/logger.ts +1 -1
  102. package/src/testing/query-promts.ts +6 -6
  103. package/src/testing/query.test.ts +21 -18
  104. package/src/testing/test-data.ts +72 -79
  105. package/src/testing/test-schema.ts +29 -28
  106. package/dist/lib/browser/chunk-B4HAWUFW.mjs.map +0 -7
  107. package/dist/lib/node/chunk-NOB7CIIC.cjs.map +0 -7
  108. package/dist/lib/node-esm/chunk-SAWYU3V5.mjs.map +0 -7
  109. package/dist/types/src/experimental/conversation/conversation.d.ts.map +0 -1
  110. package/dist/types/src/experimental/conversation/conversation.test.d.ts.map +0 -1
  111. package/dist/types/src/experimental/conversation/index.d.ts.map +0 -1
  112. package/dist/types/src/experimental/conversation/types.d.ts.map +0 -1
  113. package/dist/types/src/experimental/cypher/ast.d.ts.map +0 -1
  114. package/dist/types/src/experimental/cypher/combinators.d.ts.map +0 -1
  115. package/dist/types/src/experimental/cypher/combinators.test.d.ts.map +0 -1
  116. package/dist/types/src/experimental/cypher/echo-data-source.d.ts.map +0 -1
  117. package/dist/types/src/experimental/cypher/execution-plan.d.ts.map +0 -1
  118. package/dist/types/src/experimental/cypher/execution-plan.test.d.ts.map +0 -1
  119. package/dist/types/src/experimental/cypher/index.d.ts.map +0 -1
  120. package/dist/types/src/experimental/cypher/parjs.d.ts.map +0 -1
  121. package/dist/types/src/experimental/cypher/parser.d.ts.map +0 -1
  122. package/dist/types/src/experimental/cypher/query-executor.d.ts.map +0 -1
  123. package/dist/types/src/experimental/cypher/query-executor.test.d.ts.map +0 -1
  124. package/dist/types/src/experimental/cypher/schema.d.ts.map +0 -1
  125. package/dist/types/src/experimental/cypher/schema.test.d.ts.map +0 -1
  126. package/dist/types/src/experimental/index.d.ts +0 -3
  127. package/dist/types/src/experimental/index.d.ts.map +0 -1
  128. package/dist/types/src/experimental/ner/ner.test.d.ts +0 -2
  129. package/dist/types/src/experimental/ner/ner.test.d.ts.map +0 -1
  130. package/dist/types/src/experimental/research/exa.d.ts +0 -6
  131. package/dist/types/src/experimental/research/exa.d.ts.map +0 -1
  132. package/dist/types/src/experimental/research/research.test.d.ts +0 -2
  133. package/dist/types/src/experimental/research/research.test.d.ts.map +0 -1
  134. package/dist/types/src/session/tools.d.ts +0 -18
  135. package/dist/types/src/session/tools.d.ts.map +0 -1
  136. package/dist/types/src/session/version-pin.d.ts +0 -22
  137. package/dist/types/src/session/version-pin.d.ts.map +0 -1
  138. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  139. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  140. package/dist/types/src/testing/printer.d.ts +0 -6
  141. package/dist/types/src/testing/printer.d.ts.map +0 -1
  142. package/src/experimental/index.ts +0 -6
  143. package/src/experimental/ner/ner.test.ts +0 -163
  144. package/src/experimental/research/exa.ts +0 -38
  145. package/src/experimental/research/instructions.tpl +0 -64
  146. package/src/experimental/research/research.test.ts +0 -263
  147. package/src/session/tools.ts +0 -117
  148. package/src/session/version-pin.test.ts +0 -26
  149. package/src/session/version-pin.ts +0 -49
  150. package/src/testing/printer.ts +0 -41
  151. package/src/typedefs.d.ts +0 -8
  152. /package/dist/types/src/{experimental/conversation → conversation}/conversation.test.d.ts +0 -0
  153. /package/dist/types/src/{experimental/conversation → conversation}/index.d.ts +0 -0
  154. /package/dist/types/src/{experimental/cypher → cypher}/ast.d.ts +0 -0
  155. /package/dist/types/src/{experimental/cypher → cypher}/combinators.d.ts +0 -0
  156. /package/dist/types/src/{experimental/cypher → cypher}/combinators.test.d.ts +0 -0
  157. /package/dist/types/src/{experimental/cypher → cypher}/echo-data-source.d.ts +0 -0
  158. /package/dist/types/src/{experimental/cypher → cypher}/execution-plan.d.ts +0 -0
  159. /package/dist/types/src/{experimental/cypher → cypher}/execution-plan.test.d.ts +0 -0
  160. /package/dist/types/src/{experimental/cypher → cypher}/index.d.ts +0 -0
  161. /package/dist/types/src/{experimental/cypher → cypher}/parjs.d.ts +0 -0
  162. /package/dist/types/src/{experimental/cypher → cypher}/parser.d.ts +0 -0
  163. /package/dist/types/src/{experimental/cypher → cypher}/query-executor.d.ts +0 -0
  164. /package/dist/types/src/{experimental/cypher → cypher}/query-executor.test.d.ts +0 -0
  165. /package/dist/types/src/{experimental/cypher → cypher}/schema.d.ts +0 -0
  166. /package/dist/types/src/{experimental/cypher → cypher}/schema.test.d.ts +0 -0
  167. /package/src/{experimental/conversation → conversation}/index.ts +0 -0
  168. /package/src/{experimental/cypher → cypher}/ast.ts +0 -0
  169. /package/src/{experimental/cypher → cypher}/combinators.ts +0 -0
  170. /package/src/{experimental/cypher → cypher}/execution-plan.ts +0 -0
  171. /package/src/{experimental/cypher → cypher}/index.ts +0 -0
  172. /package/src/{experimental/cypher → cypher}/parjs-shims.d.ts +0 -0
  173. /package/src/{experimental/cypher → cypher}/parjs.ts +0 -0
  174. /package/src/{experimental/cypher → cypher}/parser.ts +0 -0
  175. /package/src/{experimental/cypher → cypher}/query-executor.ts +0 -0
@@ -1,26 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { pipe, Schema } from 'effect';
6
- import { describe, expect, test } from 'vitest';
7
-
8
- import { Expando } from '@dxos/echo-schema';
9
- import { invariant } from '@dxos/invariant';
10
- import { live } from '@dxos/live-object';
11
-
12
- import { VersionPin } from './version-pin';
13
-
14
- describe('VersionPin', () => {
15
- test('serialization', () => {
16
- const obj = live(Expando, {
17
- name: 'John Doe',
18
- });
19
- const block = VersionPin.createBlock(VersionPin.make({ objectId: obj.id, version: obj.version }));
20
- invariant(block.type === 'json' && block.disposition === VersionPin.DISPOSITION);
21
- const pin = pipe(JSON.parse(block.json), VersionPin.pipe(Schema.decodeSync));
22
- expect(pin).toBeDefined();
23
- expect(pin?.objectId).toBe(obj.id);
24
- expect(pin?.version).toBe(obj.version);
25
- });
26
- });
@@ -1,49 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import type { MessageContentBlock } from '@dxos/artifact';
8
- import type { ObjectVersion } from '@dxos/echo-db';
9
- import { getVersion } from '@dxos/echo-db';
10
- import { ObjectId, type BaseEchoObject } from '@dxos/echo-schema';
11
-
12
- // TODO(dmaretskyi): Extract.
13
- const ObjectVersionSchema = Schema.Unknown as Schema.Schema<ObjectVersion>;
14
-
15
- const VersionPinSchema = Schema.Struct({
16
- // TODO(dmaretskyi): Use Ref when those support encoding.
17
- objectId: ObjectId,
18
- // TODO(dmaretskyi): Could be opaque
19
- version: ObjectVersionSchema,
20
- });
21
-
22
- /**
23
- * Used to pin a specific version of an object during the course of a conversation.
24
- *
25
- * This allows us to detect when the object changes during the course of the conversation.
26
- */
27
- export interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema> {}
28
-
29
- export const VersionPin: typeof VersionPinSchema & {
30
- DISPOSITION: 'version-pin';
31
- fromObject: (object: BaseEchoObject) => VersionPin;
32
- createBlock: (pin: VersionPin) => MessageContentBlock;
33
- } = class extends VersionPinSchema {
34
- static readonly DISPOSITION = 'version-pin';
35
- static fromObject(object: BaseEchoObject): VersionPin {
36
- return VersionPin.make({
37
- objectId: object.id,
38
- version: getVersion(object),
39
- });
40
- }
41
-
42
- static createBlock(pin: VersionPin): MessageContentBlock {
43
- return {
44
- type: 'json',
45
- disposition: VersionPin.DISPOSITION,
46
- json: JSON.stringify(pin),
47
- };
48
- }
49
- };
@@ -1,41 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { inspect } from 'node:util';
6
-
7
- import type { Message, MessageContentBlock } from '@dxos/artifact';
8
-
9
- export class ConsolePrinter {
10
- printMessage = (message: Message) => {
11
- // eslint-disable-next-line no-console
12
- console.log(`${message.role.toUpperCase()}\n`);
13
- for (const content of message.content) {
14
- this.printContentBlock(content);
15
- }
16
- };
17
-
18
- printContentBlock = (content: MessageContentBlock) => {
19
- switch (content.type) {
20
- case 'text':
21
- // eslint-disable-next-line no-console
22
- console.log(content.text);
23
- break;
24
- case 'tool_use':
25
- // eslint-disable-next-line no-console
26
- console.log(`⚙️ [Tool Use] ${content.name} ${inspect(content.input, { depth: null, colors: true })}`);
27
- break;
28
- case 'tool_result': {
29
- let data: any;
30
- try {
31
- data = JSON.parse(content.content);
32
- } catch {
33
- data = content.content;
34
- }
35
- // eslint-disable-next-line no-console
36
- console.log(`⚙️ [Tool Result] ${content.toolUseId} ${inspect(data, { depth: null, colors: true })}`);
37
- break;
38
- }
39
- }
40
- };
41
- }
package/src/typedefs.d.ts DELETED
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- declare module '*?raw' {
6
- const content: string;
7
- export default content;
8
- }
File without changes
File without changes
File without changes
File without changes