From 33a2b8c7492be0f53f839a9b397ea9aed2aa80ac Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Apr 2026 16:02:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20ESM=20=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AF=BC=E5=85=A5=E8=B7=AF=E5=BE=84=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20.js=20=E5=90=8E=E7=BC=80=E5=85=BC=E5=AE=B9=20Node.j?= =?UTF-8?q?s=20ESM=20=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 所有内部模块导入添加 .js 后缀 - types.ts 添加 __types 导出标记 - 确保运行时模块能被正确加载 --- ts/src/runtime/core/graph_memory/graph_database.ts | 2 +- ts/src/runtime/core/graph_memory/index.ts | 6 +++--- ts/src/runtime/core/graph_memory/memory_service.ts | 6 +++--- ts/src/runtime/core/graph_memory/task_node_store.ts | 2 +- ts/src/runtime/core/graph_memory/types.ts | 2 ++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ts/src/runtime/core/graph_memory/graph_database.ts b/ts/src/runtime/core/graph_memory/graph_database.ts index 4bc6d79..fc81c29 100644 --- a/ts/src/runtime/core/graph_memory/graph_database.ts +++ b/ts/src/runtime/core/graph_memory/graph_database.ts @@ -2,7 +2,7 @@ import Database from 'better-sqlite3'; import type { Entity, Relation, RecallParams, CommitParams, PurgeParams, RecallResult, CommitResult, PurgeResult, MemoryStats -} from './types'; +} from './types.js'; export class GraphDatabase { private db: Database.Database; diff --git a/ts/src/runtime/core/graph_memory/index.ts b/ts/src/runtime/core/graph_memory/index.ts index 770ece9..7fd6fd8 100644 --- a/ts/src/runtime/core/graph_memory/index.ts +++ b/ts/src/runtime/core/graph_memory/index.ts @@ -1,3 +1,3 @@ -export * from './types'; -export * from './graph_database'; -export { MemoryService } from './memory_service'; +export * from './types.js'; +export * from './graph_database.js'; +export { MemoryService } from './memory_service.js'; diff --git a/ts/src/runtime/core/graph_memory/memory_service.ts b/ts/src/runtime/core/graph_memory/memory_service.ts index 8d5d26d..bfba4e0 100644 --- a/ts/src/runtime/core/graph_memory/memory_service.ts +++ b/ts/src/runtime/core/graph_memory/memory_service.ts @@ -1,5 +1,5 @@ -import { GraphDatabase } from './graph_database'; -import { TaskNodeStore } from './task_node_store'; +import { GraphDatabase } from './graph_database.js'; +import { TaskNodeStore } from './task_node_store.js'; import * as fs from 'fs'; import * as path from 'path'; import type { @@ -8,7 +8,7 @@ import type { ContextRewriteParams, ContextRewriteResult, WorkingMemoryChainParams, WorkingMemoryChainResult, TaskNodeCreateParams, TaskNodeChainResult -} from './types'; +} from './types.js'; export class MemoryService { private db: GraphDatabase; diff --git a/ts/src/runtime/core/graph_memory/task_node_store.ts b/ts/src/runtime/core/graph_memory/task_node_store.ts index 952979f..d51119c 100644 --- a/ts/src/runtime/core/graph_memory/task_node_store.ts +++ b/ts/src/runtime/core/graph_memory/task_node_store.ts @@ -1,7 +1,7 @@ import Database from 'better-sqlite3'; import * as fs from 'fs'; import * as path from 'path'; -import type { TaskNodeData } from './types'; +import type { TaskNodeData } from './types.js'; export { TaskNodeData as TaskNode }; diff --git a/ts/src/runtime/core/graph_memory/types.ts b/ts/src/runtime/core/graph_memory/types.ts index ec4ae2c..63de215 100644 --- a/ts/src/runtime/core/graph_memory/types.ts +++ b/ts/src/runtime/core/graph_memory/types.ts @@ -7,6 +7,8 @@ export interface Entity { updatedAt: Date; } +export const __types = true; + export type RelationStatus = 'active' | 'deleted' | 'archived' | 'superseded'; export interface Relation {