@node-llm/orm 0.7.0 → 0.8.0
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.
- package/CHANGELOG.md +37 -0
- package/migrations/add_correction_rounds.sql +5 -0
- package/package.json +13 -10
- package/schema.prisma +8 -7
- package/src/BaseChat.ts +70 -1
- package/src/adapters/prisma/Chat.ts +36 -1
- package/test/AgentSession.test.ts +12 -4
- package/test/ToolChoiceAndSchema.test.ts +180 -0
- package/test/ToolExecutionOptions.test.ts +205 -0
- package/tsconfig.json +1 -1
- package/LICENSE +0 -21
- package/dist/BaseChat.d.ts +0 -86
- package/dist/BaseChat.d.ts.map +0 -1
- package/dist/BaseChat.js +0 -126
- package/dist/adapters/prisma/AgentSession.d.ts +0 -171
- package/dist/adapters/prisma/AgentSession.d.ts.map +0 -1
- package/dist/adapters/prisma/AgentSession.js +0 -410
- package/dist/adapters/prisma/Chat.d.ts +0 -71
- package/dist/adapters/prisma/Chat.d.ts.map +0 -1
- package/dist/adapters/prisma/Chat.js +0 -327
- package/dist/adapters/prisma/index.d.ts +0 -50
- package/dist/adapters/prisma/index.d.ts.map +0 -1
- package/dist/adapters/prisma/index.js +0 -49
- package/dist/index.d.ts +0 -59
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -59
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
2
|
+
import { createChat } from "../src/adapters/prisma/index.js";
|
|
3
|
+
import { ToolExecutionMode } from "@node-llm/core";
|
|
4
|
+
|
|
5
|
+
// Mock Prisma Client
|
|
6
|
+
const createMockPrisma = () => {
|
|
7
|
+
const messages: any[] = [];
|
|
8
|
+
const chats: any[] = [];
|
|
9
|
+
|
|
10
|
+
const tables: any = {
|
|
11
|
+
chat: {
|
|
12
|
+
create: vi.fn(async ({ data }) => {
|
|
13
|
+
const chat = { id: "chat-123", ...data, createdAt: new Date(), updatedAt: new Date() };
|
|
14
|
+
chats.push(chat);
|
|
15
|
+
return chat;
|
|
16
|
+
})
|
|
17
|
+
},
|
|
18
|
+
message: {
|
|
19
|
+
create: vi.fn(async ({ data }) => {
|
|
20
|
+
const message = { id: `msg-${messages.length}`, ...data, createdAt: new Date() };
|
|
21
|
+
messages.push(message);
|
|
22
|
+
return message;
|
|
23
|
+
}),
|
|
24
|
+
findMany: vi.fn(async ({ where }) => {
|
|
25
|
+
let filtered = messages.filter((m) => m.chatId === where.chatId);
|
|
26
|
+
if (where.id?.notIn) {
|
|
27
|
+
filtered = filtered.filter((m) => !where.id.notIn.includes(m.id));
|
|
28
|
+
}
|
|
29
|
+
return filtered;
|
|
30
|
+
}),
|
|
31
|
+
update: vi.fn(async ({ where, data }) => {
|
|
32
|
+
const message = messages.find((m) => m.id === where.id);
|
|
33
|
+
if (message) {
|
|
34
|
+
Object.assign(message, data);
|
|
35
|
+
}
|
|
36
|
+
return message;
|
|
37
|
+
}),
|
|
38
|
+
delete: vi.fn()
|
|
39
|
+
},
|
|
40
|
+
toolCall: {
|
|
41
|
+
create: vi.fn(),
|
|
42
|
+
update: vi.fn()
|
|
43
|
+
},
|
|
44
|
+
request: {
|
|
45
|
+
create: vi.fn()
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return new Proxy(tables, {
|
|
50
|
+
get(target, prop) {
|
|
51
|
+
if (prop in target) return target[prop];
|
|
52
|
+
if (typeof prop === "string") {
|
|
53
|
+
if (prop.toLowerCase().includes("chat")) return target.chat;
|
|
54
|
+
if (prop.toLowerCase().includes("message")) return target.message;
|
|
55
|
+
if (prop.toLowerCase().includes("toolcall")) return target.toolCall;
|
|
56
|
+
if (prop.toLowerCase().includes("request")) return target.request;
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Mock NodeLLM capturing everything passed/registered on the core chat
|
|
64
|
+
const createMockLLM = () => {
|
|
65
|
+
let capturedOptions: any;
|
|
66
|
+
let capturedErrorHandler: ((call: any, error: Error) => any) | undefined;
|
|
67
|
+
let capturedConfirmHandler: ((call: any) => any) | undefined;
|
|
68
|
+
|
|
69
|
+
const mockChat: any = {
|
|
70
|
+
withTools: vi.fn(() => mockChat),
|
|
71
|
+
onToolCallStart: vi.fn(() => mockChat),
|
|
72
|
+
onToolCallEnd: vi.fn(() => mockChat),
|
|
73
|
+
onToolCallError: vi.fn((handler) => {
|
|
74
|
+
capturedErrorHandler = handler;
|
|
75
|
+
return mockChat;
|
|
76
|
+
}),
|
|
77
|
+
onConfirmToolCall: vi.fn((handler) => {
|
|
78
|
+
capturedConfirmHandler = handler;
|
|
79
|
+
return mockChat;
|
|
80
|
+
}),
|
|
81
|
+
afterResponse: vi.fn(() => mockChat),
|
|
82
|
+
onNewMessage: vi.fn(() => mockChat),
|
|
83
|
+
onEndMessage: vi.fn(() => mockChat),
|
|
84
|
+
beforeRequest: vi.fn(() => mockChat),
|
|
85
|
+
ask: vi.fn(async () => ({
|
|
86
|
+
content: "Test response",
|
|
87
|
+
meta: {},
|
|
88
|
+
usage: { input_tokens: 10, output_tokens: 5, total_tokens: 15 },
|
|
89
|
+
model: "gpt-4o-mini",
|
|
90
|
+
provider: "openai"
|
|
91
|
+
}))
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const llm: any = {
|
|
95
|
+
chat: vi.fn((_model, options) => {
|
|
96
|
+
capturedOptions = options;
|
|
97
|
+
return mockChat;
|
|
98
|
+
}),
|
|
99
|
+
withProvider: vi.fn(() => llm),
|
|
100
|
+
getCapturedOptions: () => capturedOptions,
|
|
101
|
+
getErrorHandler: () => capturedErrorHandler,
|
|
102
|
+
getConfirmHandler: () => capturedConfirmHandler
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
return llm;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
describe("ORM tool execution options", () => {
|
|
109
|
+
let mockPrisma: any;
|
|
110
|
+
let mockLLM: any;
|
|
111
|
+
|
|
112
|
+
beforeEach(() => {
|
|
113
|
+
mockPrisma = createMockPrisma();
|
|
114
|
+
mockLLM = createMockLLM();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it("forwards toolConcurrency to the underlying core chat", async () => {
|
|
118
|
+
const chat = await createChat(mockPrisma, mockLLM, {
|
|
119
|
+
model: "gpt-4o-mini",
|
|
120
|
+
toolConcurrency: true
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
await chat.ask("Hello");
|
|
124
|
+
|
|
125
|
+
expect(mockLLM.getCapturedOptions()).toEqual(
|
|
126
|
+
expect.objectContaining({ toolConcurrency: true })
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("forwards toolExecution mode to the underlying core chat", async () => {
|
|
131
|
+
const chat = await createChat(mockPrisma, mockLLM, {
|
|
132
|
+
model: "gpt-4o-mini",
|
|
133
|
+
toolExecution: ToolExecutionMode.CONFIRM
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
await chat.ask("Hello");
|
|
137
|
+
|
|
138
|
+
expect(mockLLM.getCapturedOptions()).toEqual(
|
|
139
|
+
expect.objectContaining({ toolExecution: ToolExecutionMode.CONFIRM })
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("supports withToolConcurrency/withToolExecution fluent methods", async () => {
|
|
144
|
+
const chat = await createChat(mockPrisma, mockLLM, { model: "gpt-4o-mini" });
|
|
145
|
+
chat.withToolConcurrency(true).withToolExecution(ToolExecutionMode.DRY_RUN);
|
|
146
|
+
|
|
147
|
+
await chat.ask("Hello");
|
|
148
|
+
|
|
149
|
+
expect(mockLLM.getCapturedOptions()).toEqual(
|
|
150
|
+
expect.objectContaining({
|
|
151
|
+
toolConcurrency: true,
|
|
152
|
+
toolExecution: ToolExecutionMode.DRY_RUN
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it("does not register onToolCallError/onConfirmToolCall on the core chat when no hooks are set", async () => {
|
|
158
|
+
const chat = await createChat(mockPrisma, mockLLM, { model: "gpt-4o-mini" });
|
|
159
|
+
await chat.ask("Hello");
|
|
160
|
+
|
|
161
|
+
const mockChat = mockLLM.chat.mock.results[0].value;
|
|
162
|
+
expect(mockChat.onToolCallError).not.toHaveBeenCalled();
|
|
163
|
+
expect(mockChat.onConfirmToolCall).not.toHaveBeenCalled();
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("wires onToolCallError so the first directive returned wins across all handlers", async () => {
|
|
167
|
+
const chat = await createChat(mockPrisma, mockLLM, { model: "gpt-4o-mini" });
|
|
168
|
+
const calls: string[] = [];
|
|
169
|
+
|
|
170
|
+
chat.onToolCallError(() => {
|
|
171
|
+
calls.push("first");
|
|
172
|
+
return "RETRY";
|
|
173
|
+
});
|
|
174
|
+
chat.onToolCallError(() => {
|
|
175
|
+
calls.push("second");
|
|
176
|
+
return "STOP";
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
await chat.ask("Hello");
|
|
180
|
+
|
|
181
|
+
const directive = await mockLLM.getErrorHandler()({ id: "call_1" }, new Error("boom"));
|
|
182
|
+
expect(calls).toEqual(["first", "second"]);
|
|
183
|
+
expect(directive).toBe("RETRY");
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it("wires onConfirmToolCall so every handler must approve", async () => {
|
|
187
|
+
const chat = await createChat(mockPrisma, mockLLM, { model: "gpt-4o-mini" });
|
|
188
|
+
const calls: string[] = [];
|
|
189
|
+
|
|
190
|
+
chat.onConfirmToolCall(() => {
|
|
191
|
+
calls.push("approver");
|
|
192
|
+
return true;
|
|
193
|
+
});
|
|
194
|
+
chat.onConfirmToolCall(() => {
|
|
195
|
+
calls.push("vetoer");
|
|
196
|
+
return false;
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
await chat.ask("Hello");
|
|
200
|
+
|
|
201
|
+
const approved = await mockLLM.getConfirmHandler()({ id: "call_1" });
|
|
202
|
+
expect(calls).toEqual(["approver", "vetoer"]);
|
|
203
|
+
expect(approved).toBe(false);
|
|
204
|
+
});
|
|
205
|
+
});
|
package/tsconfig.json
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 NodeLLM contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/BaseChat.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { Usage, Middleware } from "@node-llm/core";
|
|
2
|
-
export interface ChatRecord {
|
|
3
|
-
id: string;
|
|
4
|
-
model?: string | null;
|
|
5
|
-
provider?: string | null;
|
|
6
|
-
instructions?: string | null;
|
|
7
|
-
metadata?: string | null;
|
|
8
|
-
createdAt: Date;
|
|
9
|
-
updatedAt: Date;
|
|
10
|
-
}
|
|
11
|
-
export interface ChatOptions {
|
|
12
|
-
model?: string;
|
|
13
|
-
provider?: string;
|
|
14
|
-
instructions?: string;
|
|
15
|
-
metadata?: Record<string, any>;
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
persistence?: {
|
|
18
|
-
toolCalls?: boolean;
|
|
19
|
-
requests?: boolean;
|
|
20
|
-
};
|
|
21
|
-
thinking?: {
|
|
22
|
-
effort?: "low" | "medium" | "high" | "none";
|
|
23
|
-
budget?: number;
|
|
24
|
-
};
|
|
25
|
-
temperature?: number;
|
|
26
|
-
maxTokens?: number;
|
|
27
|
-
headers?: Record<string, string>;
|
|
28
|
-
maxToolCalls?: number;
|
|
29
|
-
requestTimeout?: number;
|
|
30
|
-
params?: Record<string, any>;
|
|
31
|
-
middlewares?: Middleware[];
|
|
32
|
-
}
|
|
33
|
-
export interface UserHooks {
|
|
34
|
-
onToolCallStart: ((call: any) => void | Promise<void>)[];
|
|
35
|
-
onToolCallEnd: ((call: any, result: any) => void | Promise<void>)[];
|
|
36
|
-
afterResponse: ((resp: any) => any | Promise<any>)[];
|
|
37
|
-
onNewMessage: (() => void | Promise<void>)[];
|
|
38
|
-
onEndMessage: ((message: any) => void | Promise<void>)[];
|
|
39
|
-
onBeforeRequest: ((messages: any[]) => any | Promise<any>)[];
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* BaseChat - A generic base class for ORM chat implementations.
|
|
43
|
-
*/
|
|
44
|
-
export declare abstract class BaseChat<R extends ChatRecord = ChatRecord, O extends ChatOptions = ChatOptions> {
|
|
45
|
-
record: R;
|
|
46
|
-
options: O;
|
|
47
|
-
id: string;
|
|
48
|
-
protected localOptions: any;
|
|
49
|
-
protected customTools: any[];
|
|
50
|
-
protected customMiddlewares: Middleware[];
|
|
51
|
-
protected userHooks: UserHooks;
|
|
52
|
-
constructor(record: R, options?: O);
|
|
53
|
-
protected log(...args: any[]): void;
|
|
54
|
-
withInstructions(instruction: string, options?: {
|
|
55
|
-
replace?: boolean;
|
|
56
|
-
}): this;
|
|
57
|
-
system(instruction: string, options?: {
|
|
58
|
-
replace?: boolean;
|
|
59
|
-
}): this;
|
|
60
|
-
withTemperature(temp: number): this;
|
|
61
|
-
withModel(model: string): this;
|
|
62
|
-
withProvider(provider: string): this;
|
|
63
|
-
withTools(tools: any[]): this;
|
|
64
|
-
withTool(tool: any): this;
|
|
65
|
-
use(tool: any): this;
|
|
66
|
-
withSchema(schema: any): this;
|
|
67
|
-
withParams(params: Record<string, any>): this;
|
|
68
|
-
withThinking(thinking: {
|
|
69
|
-
effort?: "low" | "medium" | "high" | "none";
|
|
70
|
-
budget?: number;
|
|
71
|
-
}): this;
|
|
72
|
-
withEffort(effort: "low" | "medium" | "high" | "none"): this;
|
|
73
|
-
onToolCallStart(callback: (call: any) => void | Promise<void>): this;
|
|
74
|
-
onToolCall(callback: (call: any) => void | Promise<void>): this;
|
|
75
|
-
onToolCallEnd(callback: (call: any, result: any) => void | Promise<void>): this;
|
|
76
|
-
onToolResult(callback: (result: any) => void | Promise<void>): this;
|
|
77
|
-
afterResponse(callback: (resp: any) => any | Promise<any>): this;
|
|
78
|
-
onBeforeRequest(callback: (messages: any[]) => any | Promise<any>): this;
|
|
79
|
-
onNewMessage(callback: () => void | Promise<void>): this;
|
|
80
|
-
onEndMessage(callback: (message: any) => void | Promise<void>): this;
|
|
81
|
-
/**
|
|
82
|
-
* Returns a usage summary for this chat session.
|
|
83
|
-
*/
|
|
84
|
-
abstract stats(): Promise<Usage>;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=BaseChat.d.ts.map
|
package/dist/BaseChat.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseChat.d.ts","sourceRoot":"","sources":["../src/BaseChat.ts"],"names":[],"mappings":"AACA,OAA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IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAInE,aAAa,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;IAKhE,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;IAKxE,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAKxD,YAAY,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAKpE;;OAEG;IACH,QAAQ,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;CACjC"}
|
package/dist/BaseChat.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BaseChat - A generic base class for ORM chat implementations.
|
|
3
|
-
*/
|
|
4
|
-
export class BaseChat {
|
|
5
|
-
record;
|
|
6
|
-
options;
|
|
7
|
-
id;
|
|
8
|
-
localOptions = {};
|
|
9
|
-
customTools = [];
|
|
10
|
-
customMiddlewares = [];
|
|
11
|
-
userHooks = {
|
|
12
|
-
onToolCallStart: [],
|
|
13
|
-
onToolCallEnd: [],
|
|
14
|
-
afterResponse: [],
|
|
15
|
-
onNewMessage: [],
|
|
16
|
-
onEndMessage: [],
|
|
17
|
-
onBeforeRequest: []
|
|
18
|
-
};
|
|
19
|
-
constructor(record, options = {}) {
|
|
20
|
-
this.record = record;
|
|
21
|
-
this.options = options;
|
|
22
|
-
this.id = record.id;
|
|
23
|
-
// Initialize local options from record/options
|
|
24
|
-
this.localOptions.instructions = options.instructions || record.instructions;
|
|
25
|
-
this.localOptions.model = options.model || record.model;
|
|
26
|
-
this.localOptions.provider = options.provider || record.provider;
|
|
27
|
-
this.localOptions.thinking = options.thinking;
|
|
28
|
-
this.localOptions.temperature = options.temperature;
|
|
29
|
-
this.localOptions.maxTokens = options.maxTokens;
|
|
30
|
-
this.localOptions.headers = options.headers;
|
|
31
|
-
this.localOptions.maxToolCalls = options.maxToolCalls;
|
|
32
|
-
this.localOptions.requestTimeout = options.requestTimeout;
|
|
33
|
-
this.localOptions.params = options.params;
|
|
34
|
-
// Initialize middlewares
|
|
35
|
-
if (options.middlewares) {
|
|
36
|
-
this.customMiddlewares = options.middlewares;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
log(...args) {
|
|
40
|
-
if (this.options?.debug) {
|
|
41
|
-
console.log(`[@node-llm/orm]`, ...args);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// --- Fluent Configuration Methods ---
|
|
45
|
-
withInstructions(instruction, options) {
|
|
46
|
-
if (options?.replace) {
|
|
47
|
-
this.localOptions.instructions = instruction;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.localOptions.instructions = (this.localOptions.instructions || "") + "\n" + instruction;
|
|
51
|
-
}
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
system(instruction, options) {
|
|
55
|
-
return this.withInstructions(instruction, options);
|
|
56
|
-
}
|
|
57
|
-
withTemperature(temp) {
|
|
58
|
-
this.localOptions.temperature = temp;
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
withModel(model) {
|
|
62
|
-
this.localOptions.model = model;
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
withProvider(provider) {
|
|
66
|
-
this.localOptions.provider = provider;
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
withTools(tools) {
|
|
70
|
-
this.customTools.push(...tools);
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
withTool(tool) {
|
|
74
|
-
this.customTools.push(tool);
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
use(tool) {
|
|
78
|
-
return this.withTool(tool);
|
|
79
|
-
}
|
|
80
|
-
withSchema(schema) {
|
|
81
|
-
this.localOptions.schema = schema;
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
withParams(params) {
|
|
85
|
-
this.localOptions.params = { ...(this.localOptions.params || {}), ...params };
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
withThinking(thinking) {
|
|
89
|
-
this.localOptions.thinking = { ...(this.localOptions.thinking || {}), ...thinking };
|
|
90
|
-
return this;
|
|
91
|
-
}
|
|
92
|
-
withEffort(effort) {
|
|
93
|
-
return this.withThinking({ effort });
|
|
94
|
-
}
|
|
95
|
-
// --- Hook Registration ---
|
|
96
|
-
onToolCallStart(callback) {
|
|
97
|
-
this.userHooks.onToolCallStart.push(callback);
|
|
98
|
-
return this;
|
|
99
|
-
}
|
|
100
|
-
onToolCall(callback) {
|
|
101
|
-
return this.onToolCallStart(callback);
|
|
102
|
-
}
|
|
103
|
-
onToolCallEnd(callback) {
|
|
104
|
-
this.userHooks.onToolCallEnd.push(callback);
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
onToolResult(callback) {
|
|
108
|
-
return this.onToolCallEnd((_call, result) => callback(result));
|
|
109
|
-
}
|
|
110
|
-
afterResponse(callback) {
|
|
111
|
-
this.userHooks.afterResponse.push(callback);
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
onBeforeRequest(callback) {
|
|
115
|
-
this.userHooks.onBeforeRequest.push(callback);
|
|
116
|
-
return this;
|
|
117
|
-
}
|
|
118
|
-
onNewMessage(callback) {
|
|
119
|
-
this.userHooks.onNewMessage.push(callback);
|
|
120
|
-
return this;
|
|
121
|
-
}
|
|
122
|
-
onEndMessage(callback) {
|
|
123
|
-
this.userHooks.onEndMessage.push(callback);
|
|
124
|
-
return this;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { ChatOptions, AskOptions, NodeLLMCore, Agent, AgentConfig, Message, ChatChunk, Usage } from "@node-llm/core";
|
|
2
|
-
/**
|
|
3
|
-
* Record structure for the LLM Agent Session table.
|
|
4
|
-
*/
|
|
5
|
-
export interface AgentSessionRecord {
|
|
6
|
-
id: string;
|
|
7
|
-
agentClass: string;
|
|
8
|
-
chatId: string;
|
|
9
|
-
metadata?: Record<string, unknown> | null;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
updatedAt: Date;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Record structure for the LLM Message table.
|
|
15
|
-
*/
|
|
16
|
-
export interface MessageRecord {
|
|
17
|
-
id: string;
|
|
18
|
-
chatId: string;
|
|
19
|
-
role: string;
|
|
20
|
-
content: string | null;
|
|
21
|
-
contentRaw?: string | null;
|
|
22
|
-
thinkingText?: string | null;
|
|
23
|
-
thinkingSignature?: string | null;
|
|
24
|
-
thinkingTokens?: number | null;
|
|
25
|
-
inputTokens?: number | null;
|
|
26
|
-
outputTokens?: number | null;
|
|
27
|
-
modelId?: string | null;
|
|
28
|
-
provider?: string | null;
|
|
29
|
-
createdAt: Date;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Table name customization.
|
|
33
|
-
*/
|
|
34
|
-
export interface TableNames {
|
|
35
|
-
agentSession?: string;
|
|
36
|
-
chat?: string;
|
|
37
|
-
message?: string;
|
|
38
|
-
toolCall?: string;
|
|
39
|
-
request?: string;
|
|
40
|
-
}
|
|
41
|
-
type AgentClass<T extends Agent<any, any> = Agent<any, any>> = (new (overrides?: Partial<AgentConfig<any> & ChatOptions>) => T) & {
|
|
42
|
-
name: string;
|
|
43
|
-
model?: string;
|
|
44
|
-
instructions?: unknown;
|
|
45
|
-
tools?: unknown;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* AgentSession - Wraps an Agent instance with persistence capabilities.
|
|
49
|
-
*
|
|
50
|
-
* Follows "Code Wins" sovereignty:
|
|
51
|
-
* - Model, Tools, Instructions come from the Agent class (code)
|
|
52
|
-
* - Message history comes from the database
|
|
53
|
-
* - Metadata from DB is injected as 'inputs' for dynamic resolution
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* // Create a new session
|
|
58
|
-
* const session = await createAgentSession(prisma, llm, SupportAgent, {
|
|
59
|
-
* metadata: { userId: "123" }
|
|
60
|
-
* });
|
|
61
|
-
*
|
|
62
|
-
* // Resume a session
|
|
63
|
-
* const session = await loadAgentSession(prisma, llm, SupportAgent, "sess_abc");
|
|
64
|
-
*
|
|
65
|
-
* // Agent behavior is always defined in code
|
|
66
|
-
* const result = await session.ask("Hello");
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare class AgentSession<I extends Record<string, any> = Record<string, any>, T extends Agent<I, any> = Agent<I, any>> {
|
|
70
|
-
private prisma;
|
|
71
|
-
private llm;
|
|
72
|
-
private AgentClass;
|
|
73
|
-
private record;
|
|
74
|
-
private agent;
|
|
75
|
-
private currentMessageId;
|
|
76
|
-
private tableNames;
|
|
77
|
-
private debug;
|
|
78
|
-
constructor(prisma: any, llm: NodeLLMCore, AgentClass: AgentClass<T>, record: AgentSessionRecord, tableNames?: TableNames, agent?: T, debug?: boolean);
|
|
79
|
-
private log;
|
|
80
|
-
/** Agent instance (for direct access if needed) */
|
|
81
|
-
get instance(): T;
|
|
82
|
-
/** Session ID for persistence */
|
|
83
|
-
get id(): string;
|
|
84
|
-
/** Underlying chat ID */
|
|
85
|
-
get chatId(): string;
|
|
86
|
-
/** Session metadata */
|
|
87
|
-
get metadata(): I | null | undefined;
|
|
88
|
-
/** Agent class name */
|
|
89
|
-
get agentClass(): string;
|
|
90
|
-
/** Model ID used by the agent */
|
|
91
|
-
get modelId(): string;
|
|
92
|
-
/** Cumulative usage for this session (from agent memory) */
|
|
93
|
-
get totalUsage(): Usage;
|
|
94
|
-
/** Current in-memory message history */
|
|
95
|
-
get history(): readonly Message[];
|
|
96
|
-
/**
|
|
97
|
-
* Helper to get a typed Prisma model by its dynamic name.
|
|
98
|
-
*/
|
|
99
|
-
private getModel;
|
|
100
|
-
/**
|
|
101
|
-
* Register persistence hooks on the agent.
|
|
102
|
-
*/
|
|
103
|
-
private registerHooks;
|
|
104
|
-
/**
|
|
105
|
-
* Send a message and persist the conversation.
|
|
106
|
-
*/
|
|
107
|
-
ask(message: string, options?: AskOptions & {
|
|
108
|
-
inputs?: I;
|
|
109
|
-
}): Promise<MessageRecord>;
|
|
110
|
-
/**
|
|
111
|
-
* Stream a response and persist the conversation.
|
|
112
|
-
*/
|
|
113
|
-
askStream(message: string, options?: AskOptions & {
|
|
114
|
-
inputs?: I;
|
|
115
|
-
}): AsyncGenerator<ChatChunk, MessageRecord, undefined>;
|
|
116
|
-
/**
|
|
117
|
-
* Returns a usage summary for this chat session.
|
|
118
|
-
*/
|
|
119
|
-
stats(): Promise<Usage>;
|
|
120
|
-
/**
|
|
121
|
-
* Add a tool to the session (turn-level).
|
|
122
|
-
*/
|
|
123
|
-
withTool(tool: any): this;
|
|
124
|
-
/**
|
|
125
|
-
* Add instructions to the session (turn-level).
|
|
126
|
-
*/
|
|
127
|
-
withInstructions(instructions: string, options?: {
|
|
128
|
-
replace?: boolean;
|
|
129
|
-
}): this;
|
|
130
|
-
/**
|
|
131
|
-
* Returns the current full message history for this session.
|
|
132
|
-
*/
|
|
133
|
-
messages(): Promise<MessageRecord[]>;
|
|
134
|
-
/**
|
|
135
|
-
* Delete the entire session and its history.
|
|
136
|
-
*/
|
|
137
|
-
delete(): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Update session metadata and re-resolve agent configuration.
|
|
140
|
-
*/
|
|
141
|
-
updateMetadata(metadata: Partial<I>): Promise<void>;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Options for creating a new agent session.
|
|
145
|
-
*/
|
|
146
|
-
export interface CreateAgentSessionOptions<I = any> {
|
|
147
|
-
metadata?: I;
|
|
148
|
-
tableNames?: TableNames;
|
|
149
|
-
debug?: boolean;
|
|
150
|
-
model?: string;
|
|
151
|
-
provider?: string;
|
|
152
|
-
instructions?: string;
|
|
153
|
-
maxToolCalls?: number;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Creates a new agent session and its persistent chat record.
|
|
157
|
-
*/
|
|
158
|
-
export declare function createAgentSession<I extends Record<string, any>, T extends Agent<I, any>>(prisma: any, llm: NodeLLMCore, AgentClass: AgentClass<T>, options?: CreateAgentSessionOptions<I>): Promise<AgentSession<I, T>>;
|
|
159
|
-
/**
|
|
160
|
-
* Options for loading an existing agent session.
|
|
161
|
-
*/
|
|
162
|
-
export interface LoadAgentSessionOptions {
|
|
163
|
-
tableNames?: TableNames;
|
|
164
|
-
debug?: boolean;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Loads an existing agent session and re-instantiates the agent with history.
|
|
168
|
-
*/
|
|
169
|
-
export declare function loadAgentSession<I extends Record<string, any>, T extends Agent<I, any>>(prisma: any, llm: NodeLLMCore, AgentClass: AgentClass<T>, sessionId: string, options?: LoadAgentSessionOptions): Promise<AgentSession<I, T> | null>;
|
|
170
|
-
export {};
|
|
171
|
-
//# sourceMappingURL=AgentSession.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentSession.d.ts","sourceRoot":"","sources":["../../../src/adapters/prisma/AgentSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,KAAK,EAEN,MAAM,gBAAgB,CAAC;AASxB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,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