mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-10-15 12:15:32 +00:00
fix: 修复 ESM 模块导入路径,添加 .js 后缀兼容 Node.js ESM 加载
- 所有内部模块导入添加 .js 后缀 - types.ts 添加 __types 导出标记 - 确保运行时模块能被正确加载
This commit is contained in:
@ -2,7 +2,7 @@ import Database from 'better-sqlite3';
|
|||||||
import type {
|
import type {
|
||||||
Entity, Relation, RecallParams, CommitParams, PurgeParams,
|
Entity, Relation, RecallParams, CommitParams, PurgeParams,
|
||||||
RecallResult, CommitResult, PurgeResult, MemoryStats
|
RecallResult, CommitResult, PurgeResult, MemoryStats
|
||||||
} from './types';
|
} from './types.js';
|
||||||
|
|
||||||
export class GraphDatabase {
|
export class GraphDatabase {
|
||||||
private db: Database.Database;
|
private db: Database.Database;
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
export * from './types';
|
export * from './types.js';
|
||||||
export * from './graph_database';
|
export * from './graph_database.js';
|
||||||
export { MemoryService } from './memory_service';
|
export { MemoryService } from './memory_service.js';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { GraphDatabase } from './graph_database';
|
import { GraphDatabase } from './graph_database.js';
|
||||||
import { TaskNodeStore } from './task_node_store';
|
import { TaskNodeStore } from './task_node_store.js';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import type {
|
import type {
|
||||||
@ -8,7 +8,7 @@ import type {
|
|||||||
ContextRewriteParams, ContextRewriteResult,
|
ContextRewriteParams, ContextRewriteResult,
|
||||||
WorkingMemoryChainParams, WorkingMemoryChainResult,
|
WorkingMemoryChainParams, WorkingMemoryChainResult,
|
||||||
TaskNodeCreateParams, TaskNodeChainResult
|
TaskNodeCreateParams, TaskNodeChainResult
|
||||||
} from './types';
|
} from './types.js';
|
||||||
|
|
||||||
export class MemoryService {
|
export class MemoryService {
|
||||||
private db: GraphDatabase;
|
private db: GraphDatabase;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Database from 'better-sqlite3';
|
import Database from 'better-sqlite3';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import type { TaskNodeData } from './types';
|
import type { TaskNodeData } from './types.js';
|
||||||
|
|
||||||
export { TaskNodeData as TaskNode };
|
export { TaskNodeData as TaskNode };
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,8 @@ export interface Entity {
|
|||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const __types = true;
|
||||||
|
|
||||||
export type RelationStatus = 'active' | 'deleted' | 'archived' | 'superseded';
|
export type RelationStatus = 'active' | 'deleted' | 'archived' | 'superseded';
|
||||||
|
|
||||||
export interface Relation {
|
export interface Relation {
|
||||||
|
|||||||
Reference in New Issue
Block a user