@dxos/assistant 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d

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 (152) hide show
  1. package/dist/lib/browser/chunk-6WRGDEMH.mjs +89 -0
  2. package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-NZGGCEF3.mjs +341 -0
  4. package/dist/lib/browser/chunk-NZGGCEF3.mjs.map +7 -0
  5. package/dist/lib/browser/extraction/index.mjs +269 -0
  6. package/dist/lib/browser/extraction/index.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +306 -2110
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/named-entity-recognition-O46UTCLR.mjs +13 -0
  11. package/dist/lib/browser/named-entity-recognition-O46UTCLR.mjs.map +7 -0
  12. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs +91 -0
  13. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +7 -0
  14. package/dist/lib/node-esm/chunk-XOOPGSGW.mjs +343 -0
  15. package/dist/lib/node-esm/chunk-XOOPGSGW.mjs.map +7 -0
  16. package/dist/lib/node-esm/extraction/index.mjs +270 -0
  17. package/dist/lib/node-esm/extraction/index.mjs.map +7 -0
  18. package/dist/lib/node-esm/index.mjs +305 -2110
  19. package/dist/lib/node-esm/index.mjs.map +4 -4
  20. package/dist/lib/node-esm/meta.json +1 -1
  21. package/dist/lib/node-esm/named-entity-recognition-W4VMRCH6.mjs +14 -0
  22. package/dist/lib/node-esm/named-entity-recognition-W4VMRCH6.mjs.map +7 -0
  23. package/dist/types/src/conversation/context.d.ts +90 -0
  24. package/dist/types/src/conversation/context.d.ts.map +1 -0
  25. package/dist/types/src/conversation/conversation.d.ts +50 -0
  26. package/dist/types/src/conversation/conversation.d.ts.map +1 -0
  27. package/dist/types/src/conversation/index.d.ts +3 -0
  28. package/dist/types/src/conversation/index.d.ts.map +1 -0
  29. package/dist/types/src/errors.d.ts +39 -0
  30. package/dist/types/src/errors.d.ts.map +1 -0
  31. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  32. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +151 -53
  33. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  34. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts +1 -1
  35. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  36. package/dist/types/src/extraction/extraction.d.ts +106 -44
  37. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  38. package/dist/types/src/functions/index.d.ts +2 -0
  39. package/dist/types/src/functions/index.d.ts.map +1 -0
  40. package/dist/types/src/functions/services.d.ts +7 -0
  41. package/dist/types/src/functions/services.d.ts.map +1 -0
  42. package/dist/types/src/index.d.ts +4 -3
  43. package/dist/types/src/index.d.ts.map +1 -1
  44. package/dist/types/src/session/artifact-diff.d.ts +27 -0
  45. package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
  46. package/dist/types/src/session/format.d.ts +168 -0
  47. package/dist/types/src/session/format.d.ts.map +1 -0
  48. package/dist/types/src/session/format.test.d.ts +2 -0
  49. package/dist/types/src/session/format.test.d.ts.map +1 -0
  50. package/dist/types/src/session/index.d.ts +1 -0
  51. package/dist/types/src/session/index.d.ts.map +1 -1
  52. package/dist/types/src/session/session.d.ts +125 -219
  53. package/dist/types/src/session/session.d.ts.map +1 -1
  54. package/dist/types/src/session/version-pin.d.ts +4 -4
  55. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  56. package/dist/types/src/templates/index.d.ts +2 -0
  57. package/dist/types/src/templates/index.d.ts.map +1 -0
  58. package/dist/types/src/templates/system.d.ts +22 -0
  59. package/dist/types/src/templates/system.d.ts.map +1 -0
  60. package/dist/types/src/types.d.ts +13 -0
  61. package/dist/types/src/types.d.ts.map +1 -1
  62. package/dist/types/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +46 -31
  64. package/src/conversation/context.ts +133 -0
  65. package/src/conversation/conversation.ts +125 -0
  66. package/src/conversation/index.ts +6 -0
  67. package/src/errors.ts +10 -0
  68. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +7 -18
  69. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +23 -17
  70. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +4 -3
  71. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +7 -4
  72. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +2 -2
  73. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +1 -1
  74. package/src/extraction/quotes.test.ts +1 -1
  75. package/src/extraction/quotes.ts +1 -1
  76. package/src/functions/index.ts +5 -0
  77. package/src/functions/services.ts +114 -0
  78. package/src/index.ts +4 -3
  79. package/src/session/__snapshots__/session.test.ts.snap +32 -0
  80. package/src/session/artifact-diff.ts +37 -0
  81. package/src/session/format.test.ts +60 -0
  82. package/src/session/format.ts +139 -0
  83. package/src/session/index.ts +1 -0
  84. package/src/session/session.test.ts +95 -19
  85. package/src/session/session.ts +224 -494
  86. package/src/session/version-pin.test.ts +2 -21
  87. package/src/session/version-pin.ts +9 -9
  88. package/src/summarization/summarization.test.ts +82 -106
  89. package/src/templates/format.tpl +55 -0
  90. package/src/templates/index.ts +5 -0
  91. package/src/templates/system.tpl +47 -0
  92. package/src/templates/system.ts +32 -0
  93. package/src/types.ts +45 -1
  94. package/src/typings.d.ts +5 -0
  95. package/dist/lib/node/index.cjs +0 -2178
  96. package/dist/lib/node/index.cjs.map +0 -7
  97. package/dist/lib/node/meta.json +0 -1
  98. package/dist/types/bin/chat.d.ts +0 -2
  99. package/dist/types/bin/chat.d.ts.map +0 -1
  100. package/dist/types/src/blueprint/ai.test.d.ts +0 -2
  101. package/dist/types/src/blueprint/ai.test.d.ts.map +0 -1
  102. package/dist/types/src/blueprint/blueprint.d.ts +0 -55
  103. package/dist/types/src/blueprint/blueprint.d.ts.map +0 -1
  104. package/dist/types/src/blueprint/blueprint.test.d.ts +0 -2
  105. package/dist/types/src/blueprint/blueprint.test.d.ts.map +0 -1
  106. package/dist/types/src/blueprint/index.d.ts +0 -4
  107. package/dist/types/src/blueprint/index.d.ts.map +0 -1
  108. package/dist/types/src/blueprint/logger.d.ts +0 -25
  109. package/dist/types/src/blueprint/logger.d.ts.map +0 -1
  110. package/dist/types/src/blueprint/machine.d.ts +0 -143
  111. package/dist/types/src/blueprint/machine.d.ts.map +0 -1
  112. package/dist/types/src/blueprint/test-data.d.ts +0 -3
  113. package/dist/types/src/blueprint/test-data.d.ts.map +0 -1
  114. package/dist/types/src/research/exa.d.ts +0 -7
  115. package/dist/types/src/research/exa.d.ts.map +0 -1
  116. package/dist/types/src/research/graph.d.ts +0 -41
  117. package/dist/types/src/research/graph.d.ts.map +0 -1
  118. package/dist/types/src/research/graph.test.d.ts +0 -2
  119. package/dist/types/src/research/graph.test.d.ts.map +0 -1
  120. package/dist/types/src/research/index.d.ts +0 -4
  121. package/dist/types/src/research/index.d.ts.map +0 -1
  122. package/dist/types/src/research/research.d.ts +0 -10
  123. package/dist/types/src/research/research.d.ts.map +0 -1
  124. package/dist/types/src/research/research.test.d.ts +0 -2
  125. package/dist/types/src/research/research.test.d.ts.map +0 -1
  126. package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
  127. package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
  128. package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
  129. package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
  130. package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
  131. package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
  132. package/dist/types/src/testing/index.d.ts +0 -3
  133. package/dist/types/src/testing/index.d.ts.map +0 -1
  134. package/src/blueprint/ai.test.ts +0 -156
  135. package/src/blueprint/blueprint.test.ts +0 -151
  136. package/src/blueprint/blueprint.ts +0 -75
  137. package/src/blueprint/index.ts +0 -7
  138. package/src/blueprint/logger.ts +0 -155
  139. package/src/blueprint/machine.ts +0 -251
  140. package/src/blueprint/test-data.ts +0 -55
  141. package/src/research/exa.ts +0 -100
  142. package/src/research/graph.test.ts +0 -15
  143. package/src/research/graph.ts +0 -337
  144. package/src/research/index.ts +0 -7
  145. package/src/research/instructions-research.tpl +0 -97
  146. package/src/research/research.test.ts +0 -190
  147. package/src/research/research.ts +0 -89
  148. package/src/testing/exa-search-1748337321991.ts +0 -131
  149. package/src/testing/exa-search-1748337331526.ts +0 -144
  150. package/src/testing/exa-search-1748337344119.ts +0 -133
  151. package/src/testing/index.ts +0 -11
  152. package/src/typedefs.d.ts +0 -8
@@ -1,251 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Match, Schema } from 'effect';
6
-
7
- import {
8
- createTool,
9
- type AiServiceClient,
10
- Message,
11
- type MessageContentBlock,
12
- ToolResult,
13
- type ToolUseContentBlock,
14
- type ToolRegistry,
15
- } from '@dxos/ai';
16
- import { Event } from '@dxos/async';
17
- import { Key, Obj } from '@dxos/echo';
18
- import { type ObjectId } from '@dxos/keys';
19
- import { log } from '@dxos/log';
20
- import { isNonNullable } from '@dxos/util';
21
-
22
- import type { Blueprint, BlueprintStep } from './blueprint';
23
- import { AISession } from '../session';
24
-
25
- const SYSTEM_PROMPT = `
26
- You are a smart Rule-Following Agent.
27
- Rule-Following Agent executes the command that the user sent in the last message.
28
- After doing the work, the Rule-Following Agent calls report tool.
29
- If the Rule-Following agent believes that no action is needed, it calls the report tool with "skipped" status.
30
- If the Rule-Following Agent is unable to perform the task, it calls the report tool with "bail" status.
31
- Rule-Following Agent explains the reason it is unable to perform the task before bailing.
32
- The Rule-Following Agent can express creativity and imagination in the way it performs the task.
33
- The Rule-Following Agent precisely follows the instructions.
34
- `;
35
-
36
- export type BlueprintTraceStep = {
37
- status: 'done' | 'bailed' | 'skipped';
38
- stepId: ObjectId;
39
- comment: string;
40
- };
41
-
42
- export type BlueprintMachineState = {
43
- history: Message[];
44
- trace: BlueprintTraceStep[];
45
- state: 'working' | 'bail' | 'done';
46
- };
47
-
48
- const INITIAL_STATE: BlueprintMachineState = {
49
- state: 'working',
50
- history: [],
51
- trace: [],
52
- };
53
-
54
- type ExecutionOptions = {
55
- aiClient: AiServiceClient;
56
-
57
- /**
58
- * Input to the blueprint.
59
- */
60
- input?: unknown;
61
- };
62
-
63
- export type BlueprintEvent =
64
- | { type: 'begin'; invocationId: string }
65
- | { type: 'end'; invocationId: string }
66
- | { type: 'step-start'; invocationId: string; step: BlueprintStep }
67
- | { type: 'step-complete'; invocationId: string; step: BlueprintStep }
68
- | { type: 'message'; invocationId: string; message: Message }
69
- | { type: 'block'; invocationId: string; block: MessageContentBlock };
70
-
71
- export interface BlueprintLogger {
72
- log(event: BlueprintEvent): void;
73
- }
74
-
75
- /**
76
- * Blueprint state machine.
77
- */
78
- export class BlueprintMachine {
79
- public readonly begin = new Event<void>();
80
- public readonly end = new Event<void>();
81
- public readonly stepStart = new Event<BlueprintStep>();
82
- public readonly stepComplete = new Event<BlueprintStep>();
83
- public readonly message = new Event<Message>();
84
- public readonly block = new Event<MessageContentBlock>();
85
-
86
- // TODO(burdon): Replace events with logger?
87
- private logger?: BlueprintLogger;
88
-
89
- private _state: BlueprintMachineState = structuredClone(INITIAL_STATE);
90
-
91
- constructor(
92
- readonly registry: ToolRegistry,
93
- readonly blueprint: Blueprint,
94
- ) {}
95
-
96
- get state(): BlueprintMachineState {
97
- return this._state;
98
- }
99
-
100
- setLogger(logger: BlueprintLogger): this {
101
- this.logger = logger;
102
- return this;
103
- }
104
-
105
- async runToCompletion(options: ExecutionOptions): Promise<void> {
106
- const invocationId = Key.ObjectId.random();
107
- log.info('runToCompletion', { invocationId, options });
108
-
109
- this.begin.emit();
110
- this.logger?.log({ type: 'begin', invocationId });
111
-
112
- let firstStep = true;
113
- while (this._state.state !== 'done') {
114
- const input = firstStep ? options.input : undefined;
115
- firstStep = false;
116
-
117
- this._state = await this._execStep(invocationId, this._state, { input, aiClient: options.aiClient });
118
-
119
- const step = this.blueprint.steps.find((step) => step.id === this._state.trace.at(-1)?.stepId)!;
120
- this.stepComplete.emit(step);
121
- this.logger?.log({ type: 'step-complete', invocationId, step });
122
-
123
- if (this._state.state === 'bail') {
124
- throw new Error('Agent unable to follow the blueprint');
125
- }
126
- }
127
-
128
- this.end.emit();
129
- this.logger?.log({ type: 'end', invocationId });
130
- }
131
-
132
- private async _execStep(
133
- invocationId: string,
134
- state: BlueprintMachineState,
135
- options: ExecutionOptions,
136
- ): Promise<BlueprintMachineState> {
137
- const prevStep = this.blueprint.steps.findIndex((step) => step.id === this._state.trace.at(-1)?.stepId);
138
- if (prevStep === this.blueprint.steps.length - 1) {
139
- throw new Error('Done execution blueprint');
140
- }
141
-
142
- const nextStep = this.blueprint.steps[prevStep + 1];
143
- const onLastStep = prevStep === this.blueprint.steps.length - 2;
144
-
145
- this.stepStart.emit(nextStep);
146
- this.logger?.log({ type: 'step-start', invocationId, step: nextStep });
147
-
148
- const ReportSchema = Schema.Struct({
149
- status: Schema.Literal('done', 'bailed', 'skipped').annotations({
150
- description: 'The status of the task completion',
151
- }),
152
- comment: Schema.String.annotations({
153
- description:
154
- 'A comment about the task completion. If you bailed, you must explain why in detail (min couple of sentences).',
155
- }),
156
- });
157
-
158
- const report = createTool('system', {
159
- name: 'report',
160
- description: 'This tool reports that the agent has completed the task or is unable to do so.',
161
- schema: ReportSchema,
162
- execute: async (input) => ToolResult.Break(input),
163
- });
164
-
165
- const session = new AISession({
166
- operationModel: 'configured',
167
- });
168
-
169
- session.userMessage.pipeInto(this.message);
170
- session.message.pipeInto(this.message);
171
- session.block.pipeInto(this.block);
172
-
173
- const inputMessages = options.input
174
- ? [
175
- Obj.make(Message, {
176
- role: 'user',
177
- content: [taggedDataBlock('input', options.input)],
178
- }),
179
- ]
180
- : [];
181
- inputMessages.forEach((message) => {
182
- this.message.emit(message);
183
- this.logger?.log({ type: 'message', invocationId, message });
184
- });
185
-
186
- // TODO(wittjosiah): Warn if tool is not found.
187
- const tools = nextStep.tools?.map((tool) => this.registry.get(tool)).filter(isNonNullable) ?? [];
188
- const messages = await session.run({
189
- systemPrompt: SYSTEM_PROMPT,
190
- history: [...state.history, ...inputMessages],
191
- tools: [...tools, report],
192
- artifacts: [],
193
- client: options.aiClient,
194
- prompt: nextStep.instructions,
195
- });
196
-
197
- const { messages: trimmedHistory, call: lastBlock } = popLastToolCall(messages);
198
- if (!lastBlock) {
199
- // TODO(dmaretskyi): Handle this with grace.
200
- throw new Error('Agent did not call the report tool');
201
- }
202
-
203
- const { status, comment } = ReportSchema.pipe(Schema.decodeUnknownSync)(lastBlock.input);
204
-
205
- return {
206
- history: [...state.history, ...inputMessages, ...trimmedHistory],
207
- trace: [
208
- ...state.trace,
209
- {
210
- stepId: nextStep.id,
211
- status,
212
- comment,
213
- },
214
- ],
215
- state: Match.value(status).pipe(
216
- Match.withReturnType<BlueprintMachineState['state']>(),
217
- Match.when('done', () => (onLastStep ? 'done' : 'working')),
218
- Match.when('skipped', () => (onLastStep ? 'done' : 'working')),
219
- Match.when('bailed', () => 'bail'),
220
- Match.exhaustive,
221
- ),
222
- };
223
- }
224
- }
225
-
226
- const taggedDataBlock = (tag: string, data: unknown): MessageContentBlock => {
227
- return {
228
- type: 'text',
229
- text: `<${tag}>\n${JSON.stringify(data, null, 2)}\n</${tag}>`,
230
- } satisfies MessageContentBlock;
231
- };
232
-
233
- const popLastToolCall = (messages: Message[]): { messages: Message[]; call?: ToolUseContentBlock } => {
234
- const lastBlock = messages.at(-1)?.content.at(-1);
235
- if (lastBlock?.type !== 'tool_use') {
236
- return { messages };
237
- }
238
-
239
- const trimmedHistory = [
240
- ...messages.slice(0, -1),
241
- {
242
- ...messages.at(-1)!,
243
- content: [...messages.at(-1)!.content.slice(0, -1)],
244
- } satisfies Message,
245
- ];
246
-
247
- return {
248
- messages: trimmedHistory,
249
- call: lastBlock,
250
- };
251
- };
@@ -1,55 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Obj } from '@dxos/echo';
6
- import { DataType } from '@dxos/schema';
7
-
8
- // TODO(burdon): Convert to queue.
9
- export const TEST_EMAILS: DataType.Message[] = [
10
- Obj.make(DataType.Message, {
11
- properties: {
12
- subject: 'Introduction email',
13
- },
14
- sender: {
15
- email: 'alice@example.com',
16
- },
17
- blocks: [
18
- {
19
- type: 'text',
20
- text: "Hi there! I came across your work and would love to connect. I'm working on some interesting projects in the decentralized space and think there could be good collaboration opportunities.",
21
- },
22
- ],
23
- created: new Date().toISOString(),
24
- }),
25
- Obj.make(DataType.Message, {
26
- properties: {
27
- subject: 'Question about integration',
28
- },
29
- sender: {
30
- email: 'bob@example.com',
31
- },
32
- blocks: [
33
- {
34
- type: 'text',
35
- text: "Hello, I was wondering if your system supports integration with external APIs? We have some custom services we'd like to connect. Could you explain the process?",
36
- },
37
- ],
38
- created: new Date().toISOString(),
39
- }),
40
- Obj.make(DataType.Message, {
41
- properties: {
42
- subject: 'MAKE MONEY FAST!!!',
43
- },
44
- sender: {
45
- email: 'spammer123@sketchy.com',
46
- },
47
- blocks: [
48
- {
49
- type: 'text',
50
- text: 'CONGRATULATIONS!!! You have been selected to receive $10 MILLION dollars! Just send us your bank details and social security number to claim your prize NOW!!!',
51
- },
52
- ],
53
- created: new Date().toISOString(),
54
- }),
55
- ];
@@ -1,100 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
- import Exa from 'exa-js';
7
-
8
- import { createTool, ToolResult } from '@dxos/ai';
9
- import { log } from '@dxos/log';
10
-
11
- import { SEARCH_RESULTS } from '../testing';
12
-
13
- type CreateExaToolOptions = {
14
- apiKey: string;
15
- };
16
-
17
- export const createExaTool = ({ apiKey }: CreateExaToolOptions) => {
18
- const exa = new Exa(apiKey);
19
-
20
- return createTool('search', {
21
- name: 'web_search',
22
- description: 'Search the web for information',
23
- schema: Schema.Struct({
24
- query: Schema.String.annotations({ description: 'The query to search for' }),
25
- }),
26
- execute: async ({ query }) => {
27
- const context = await exa.searchAndContents(query, {
28
- type: 'auto',
29
- text: {
30
- maxCharacters: 3_000,
31
- },
32
- livecrawl: 'always',
33
- });
34
-
35
- log.info('exa search', { query, costDollars: context.costDollars });
36
-
37
- return ToolResult.Success(context);
38
- },
39
- });
40
- };
41
-
42
- export const createMockExaTool = () => {
43
- return createTool('search', {
44
- name: 'web_search',
45
- description: 'Search the web for information',
46
- schema: Schema.Struct({
47
- query: Schema.String.annotations({ description: 'The query to search for' }),
48
- }),
49
- execute: async ({ query }) => {
50
- // Find result with closest matching autoprompt using weighted Levenshtein distance
51
- const result = SEARCH_RESULTS.reduce(
52
- (closest, current) => {
53
- if (!current.autopromptString) {
54
- return closest;
55
- }
56
- if (!closest) {
57
- return current;
58
- }
59
-
60
- // Calculate Levenshtein distance
61
- const dist1 = levenshteinDistance(query, current.autopromptString);
62
- const dist2 = levenshteinDistance(query, closest.autopromptString || '');
63
-
64
- // Weight by length of the longer string to normalize
65
- const weight1 = dist1 / Math.max(query.length, current.autopromptString.length);
66
- const weight2 = dist2 / Math.max(query.length, closest.autopromptString?.length || 0);
67
-
68
- return weight1 < weight2 ? current : closest;
69
- },
70
- null as (typeof SEARCH_RESULTS)[0] | null,
71
- );
72
-
73
- return ToolResult.Success(result);
74
- },
75
- });
76
- };
77
-
78
- const levenshteinDistance = (str1: string, str2: string): number => {
79
- const m = str1.length;
80
- const n = str2.length;
81
- const dp: number[][] = Array(m + 1)
82
- .fill(null)
83
- .map(() => Array(n + 1).fill(0));
84
-
85
- for (let i = 0; i <= m; i++) {
86
- dp[i][0] = i;
87
- }
88
- for (let j = 0; j <= n; j++) {
89
- dp[0][j] = j;
90
- }
91
-
92
- for (let i = 1; i <= m; i++) {
93
- for (let j = 1; j <= n; j++) {
94
- dp[i][j] =
95
- str1[i - 1] === str2[j - 1] ? dp[i - 1][j - 1] : Math.min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1]) + 1;
96
- }
97
- }
98
-
99
- return dp[m][n];
100
- };
@@ -1,15 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { describe } from 'vitest';
6
-
7
- // import { type EchoTestBuilder } from '@dxos/echo-db/testing';
8
-
9
- describe('graph', () => {
10
- // let builder: EchoTestBuilder;
11
- // test('findRelatedSchema', async () => {
12
- // const db = await createEchoDatabase();
13
- // const relatedSchemas = await findRelatedSchema(db, Schema.Struct({}));
14
- // });
15
- });