@ai-setting/roy-agent-core 1.5.4 → 1.5.6
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/dist/config/index.d.ts +1250 -0
- package/dist/env/agent/index.d.ts +2279 -0
- package/dist/env/agent/index.js +7 -7
- package/dist/env/commands/index.d.ts +1131 -0
- package/dist/env/commands/index.js +4 -4
- package/dist/env/debug/formatters/index.d.ts +236 -0
- package/dist/env/debug/index.d.ts +1652 -0
- package/dist/env/debug/index.js +1 -1
- package/dist/env/hook/index.d.ts +279 -0
- package/dist/env/index.d.ts +3460 -0
- package/dist/env/index.js +18 -18
- package/dist/env/llm/index.d.ts +1760 -0
- package/dist/env/llm/index.js +5 -5
- package/dist/env/log-trace/index.d.ts +1574 -0
- package/dist/env/log-trace/index.js +5 -5
- package/dist/env/mcp/index.d.ts +1331 -0
- package/dist/env/mcp/index.js +5 -5
- package/dist/env/mcp/tool/index.d.ts +183 -0
- package/dist/env/mcp/tool/index.js +4 -4
- package/dist/env/memory/built-in/index.d.ts +232 -0
- package/dist/env/memory/index.d.ts +1799 -0
- package/dist/env/memory/index.js +5 -5
- package/dist/env/memory/plugin/index.d.ts +747 -0
- package/dist/env/memory/plugin/index.js +4 -4
- package/dist/env/prompt/index.d.ts +1164 -0
- package/dist/env/prompt/index.js +4 -4
- package/dist/env/session/index.d.ts +1908 -0
- package/dist/env/session/index.js +8 -8
- package/dist/env/session/storage/index.d.ts +564 -0
- package/dist/env/session/storage/index.js +6 -6
- package/dist/env/skill/index.d.ts +1266 -0
- package/dist/env/skill/index.js +4 -4
- package/dist/env/skill/tool/index.d.ts +193 -0
- package/dist/env/task/delegate/index.d.ts +1622 -0
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/hooks/index.d.ts +607 -0
- package/dist/env/task/index.d.ts +1415 -0
- package/dist/env/task/index.js +6 -6
- package/dist/env/task/plugins/index.d.ts +462 -0
- package/dist/env/task/plugins/index.js +4 -4
- package/dist/env/task/storage/index.d.ts +224 -0
- package/dist/env/task/storage/index.js +4 -4
- package/dist/env/task/tools/index.d.ts +1464 -0
- package/dist/env/task/tools/operation/index.d.ts +1463 -0
- package/dist/env/tool/built-in/index.d.ts +218 -0
- package/dist/env/tool/built-in/index.js +3 -3
- package/dist/env/tool/index.d.ts +1396 -0
- package/dist/env/tool/index.js +5 -5
- package/dist/env/workflow/decorators/index.d.ts +2161 -0
- package/dist/env/workflow/engine/index.d.ts +3453 -0
- package/dist/env/workflow/engine/index.js +8 -8
- package/dist/env/workflow/index.d.ts +3546 -0
- package/dist/env/workflow/index.js +13 -9
- package/dist/env/workflow/nodes/index.d.ts +2092 -0
- package/dist/env/workflow/nodes/index.js +1 -1
- package/dist/env/workflow/service/index.d.ts +227 -0
- package/dist/env/workflow/storage/index.d.ts +165 -0
- package/dist/env/workflow/storage/index.js +5 -5
- package/dist/env/workflow/tools/index.d.ts +416 -0
- package/dist/env/workflow/tools/index.js +3 -3
- package/dist/env/workflow/types/index.d.ts +2255 -0
- package/dist/env/workflow/types/index.js +5 -1
- package/dist/env/workflow/utils/index.d.ts +2031 -0
- package/dist/env/workflow/utils/index.js +4 -4
- package/dist/index.d.ts +7837 -0
- package/dist/index.js +31 -31
- package/dist/shared/@ai-setting/{roy-agent-core-6a72jfdy.js → roy-agent-core-1akcqxj9.js} +50 -4
- package/dist/shared/@ai-setting/{roy-agent-core-12zkpda2.js → roy-agent-core-3jywqmdd.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-7n436rb4.js → roy-agent-core-3rr5k71j.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zfbxb999.js → roy-agent-core-3xwneva0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j3wc4465.js → roy-agent-core-44hnfb02.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-cv890rg5.js → roy-agent-core-4txzpsbt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rzp9kxne.js → roy-agent-core-5x94xmt6.js} +14 -5
- package/dist/shared/@ai-setting/{roy-agent-core-pc9g3962.js → roy-agent-core-69jskqjg.js} +41 -66
- package/dist/shared/@ai-setting/{roy-agent-core-qya7seh6.js → roy-agent-core-6kvtahqv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kv5nkf8j.js → roy-agent-core-81w1963m.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-zqjdy75r.js → roy-agent-core-93zfb3r1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fsvb6bwe.js → roy-agent-core-b0x5dda6.js} +5 -5
- package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +14 -0
- package/dist/shared/@ai-setting/{roy-agent-core-2x0m2p66.js → roy-agent-core-d7cyjkf7.js} +24 -3
- package/dist/shared/@ai-setting/{roy-agent-core-r973kbm7.js → roy-agent-core-dc497hmk.js} +9 -8
- package/dist/shared/@ai-setting/{roy-agent-core-z2t8hse8.js → roy-agent-core-dh9d7a3m.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j3bbr2n0.js → roy-agent-core-eajcvp4e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-m61m1vqf.js → roy-agent-core-f7q2x5z6.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8a96qnjv.js → roy-agent-core-g99pxzn5.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-5v9bh6wz.js → roy-agent-core-gbqcyegm.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qw0ebh1d.js → roy-agent-core-gq20wsgv.js} +49 -17
- package/dist/shared/@ai-setting/{roy-agent-core-2kg2wma8.js → roy-agent-core-htwpckw9.js} +24 -3
- package/dist/shared/@ai-setting/{roy-agent-core-e62e2a5a.js → roy-agent-core-jfh9q2qh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3agad0d9.js → roy-agent-core-jvatggbb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j8q93v21.js → roy-agent-core-n2cvdgd6.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-nga1gqft.js → roy-agent-core-pjr12nnd.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-bncgx3gb.js → roy-agent-core-psv4v63c.js} +24 -2
- package/dist/shared/@ai-setting/{roy-agent-core-p4xv133t.js → roy-agent-core-qqceba6k.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e5jcp24a.js → roy-agent-core-r9ezzemr.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ewrj1c4k.js → roy-agent-core-satmq6sh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7f303ffd.js → roy-agent-core-sx7wsvnn.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-q779wnwm.js → roy-agent-core-wft9ra24.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-fdb6m4e4.js → roy-agent-core-wrcy0h6z.js} +134 -182
- package/dist/shared/@ai-setting/{roy-agent-core-8y8tw6ns.js → roy-agent-core-xq8hhqb8.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-fv32jaa8.js → roy-agent-core-xs5rsgat.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-t2nc5acr.js → roy-agent-core-z62zee1e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-72zpazpc.js → roy-agent-core-zbkpc41z.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-35x0wrtt.js → roy-agent-core-zgypchmt.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-37e4tep3.js → roy-agent-core-zpn0bqa8.js} +24 -3
- package/package.json +5 -2
- package/dist/shared/@ai-setting/roy-agent-core-rft3fmp0.js +0 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionMessageConverter
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-jfh9q2qh.js";
|
|
4
4
|
import {
|
|
5
5
|
__require
|
|
6
6
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -349,6 +349,28 @@ class MemorySessionStore {
|
|
|
349
349
|
// src/env/session/storage/sqlite.ts
|
|
350
350
|
import { join } from "path";
|
|
351
351
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
352
|
+
function getDatabaseClass() {
|
|
353
|
+
if (typeof Bun !== "undefined") {
|
|
354
|
+
const { Database } = __require("bun:sqlite");
|
|
355
|
+
return Database;
|
|
356
|
+
} else {
|
|
357
|
+
return __require("better-sqlite3");
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function createCompatibleDatabase(path) {
|
|
361
|
+
const Database = getDatabaseClass();
|
|
362
|
+
const db = new Database(path);
|
|
363
|
+
if (typeof db.run !== "function") {
|
|
364
|
+
db.run = function(sql, ...params) {
|
|
365
|
+
if (params.length > 0) {
|
|
366
|
+
return this.prepare(sql).run(...params);
|
|
367
|
+
} else {
|
|
368
|
+
return this.exec(sql);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
return db;
|
|
373
|
+
}
|
|
352
374
|
function generateSessionId2() {
|
|
353
375
|
return `session_${randomUUID2()}`;
|
|
354
376
|
}
|
|
@@ -377,7 +399,6 @@ class SQLiteSessionStore {
|
|
|
377
399
|
async initialize() {
|
|
378
400
|
if (this.initialized)
|
|
379
401
|
return;
|
|
380
|
-
const { Database } = __require("bun:sqlite");
|
|
381
402
|
if (this.dbPath !== ":memory:") {
|
|
382
403
|
const fs = __require("fs");
|
|
383
404
|
const path = __require("path");
|
|
@@ -386,7 +407,7 @@ class SQLiteSessionStore {
|
|
|
386
407
|
fs.mkdirSync(dir, { recursive: true });
|
|
387
408
|
}
|
|
388
409
|
}
|
|
389
|
-
this.db =
|
|
410
|
+
this.db = createCompatibleDatabase(this.dbPath);
|
|
390
411
|
this.db.run(`
|
|
391
412
|
CREATE TABLE IF NOT EXISTS session (
|
|
392
413
|
id TEXT PRIMARY KEY,
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
WorkflowEngine,
|
|
13
13
|
exports_engine,
|
|
14
14
|
init_engine
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-wrcy0h6z.js";
|
|
16
16
|
import {
|
|
17
17
|
BaseComponent
|
|
18
18
|
} from "./roy-agent-core-kkbwepqb.js";
|
|
19
19
|
import {
|
|
20
20
|
createLogger,
|
|
21
21
|
init_logger
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-44hnfb02.js";
|
|
23
23
|
import {
|
|
24
24
|
__require,
|
|
25
25
|
__toCommonJS
|
|
@@ -134,14 +134,15 @@ class WorkflowComponent extends BaseComponent {
|
|
|
134
134
|
if (!agentRunner && this._workflowEnv) {
|
|
135
135
|
const agentComponent = this._workflowEnv.getComponent("agent");
|
|
136
136
|
if (agentComponent) {
|
|
137
|
-
const { AgentComponentAdapter } = await import("./roy-agent-core-
|
|
138
|
-
agentRunner = new AgentComponentAdapter(agentComponent);
|
|
137
|
+
const { AgentComponentAdapter } = await import("./roy-agent-core-dh9d7a3m.js");
|
|
138
|
+
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
const registry = new NodeRegistry({
|
|
142
142
|
toolRegistry: toolComponent,
|
|
143
143
|
skillRegistry: skillComponent,
|
|
144
|
-
agentRunner
|
|
144
|
+
agentRunner,
|
|
145
|
+
sessionComponent: this.sessionComponent
|
|
145
146
|
});
|
|
146
147
|
registerDecoratorNodeType2(registry);
|
|
147
148
|
const engine = new WorkflowEngine(registry);
|
|
@@ -155,7 +156,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
155
156
|
if (this.workflowService) {
|
|
156
157
|
this.workflowService = null;
|
|
157
158
|
try {
|
|
158
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
159
|
+
const { closeDatabase } = await import("./roy-agent-core-wft9ra24.js");
|
|
159
160
|
closeDatabase();
|
|
160
161
|
componentLogger.info("[WorkflowComponent] SQLite database closed");
|
|
161
162
|
} catch (error) {
|
|
@@ -192,8 +193,8 @@ class WorkflowComponent extends BaseComponent {
|
|
|
192
193
|
}
|
|
193
194
|
async initSqliteService() {
|
|
194
195
|
try {
|
|
195
|
-
const { getDatabase, initializeTables } = await import("./roy-agent-core-
|
|
196
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
196
|
+
const { getDatabase, initializeTables } = await import("./roy-agent-core-wft9ra24.js");
|
|
197
|
+
const { WorkflowRepository } = await import("./roy-agent-core-bcbqy27c.js");
|
|
197
198
|
const db = getDatabase();
|
|
198
199
|
initializeTables();
|
|
199
200
|
const workflowRepository = new WorkflowRepository(db);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TracedAs,
|
|
3
3
|
init_decorator
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-zgypchmt.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-44hnfb02.js";
|
|
9
9
|
import {
|
|
10
10
|
__legacyDecorateClassTS
|
|
11
11
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -141,7 +141,7 @@ class SpanDbReader {
|
|
|
141
141
|
}
|
|
142
142
|
async initSqliteStorage() {
|
|
143
143
|
try {
|
|
144
|
-
const { SQLiteSpanStorage } = await import("./roy-agent-core-
|
|
144
|
+
const { SQLiteSpanStorage } = await import("./roy-agent-core-r9ezzemr.js");
|
|
145
145
|
this.storage = new SQLiteSpanStorage(this.dbPath);
|
|
146
146
|
await this.storage.initialize();
|
|
147
147
|
} catch (error) {
|
|
@@ -590,7 +590,7 @@ class DebugComponent extends BaseComponent {
|
|
|
590
590
|
}
|
|
591
591
|
async getLiveTrace(traceId) {
|
|
592
592
|
try {
|
|
593
|
-
const { getTracerProvider } = await import("./roy-agent-core-
|
|
593
|
+
const { getTracerProvider } = await import("./roy-agent-core-sx7wsvnn.js");
|
|
594
594
|
const provider = getTracerProvider();
|
|
595
595
|
if (!provider.isInitialized()) {
|
|
596
596
|
await provider.initialize();
|
|
@@ -635,7 +635,7 @@ class DebugComponent extends BaseComponent {
|
|
|
635
635
|
}
|
|
636
636
|
async listLiveTraces(limit = 20) {
|
|
637
637
|
try {
|
|
638
|
-
const { getTracerProvider } = await import("./roy-agent-core-
|
|
638
|
+
const { getTracerProvider } = await import("./roy-agent-core-sx7wsvnn.js");
|
|
639
639
|
const provider = getTracerProvider();
|
|
640
640
|
if (!provider.isInitialized()) {
|
|
641
641
|
await provider.initialize();
|
|
@@ -653,7 +653,7 @@ class DebugComponent extends BaseComponent {
|
|
|
653
653
|
}
|
|
654
654
|
async formatLiveTrace(traceId) {
|
|
655
655
|
try {
|
|
656
|
-
const { getTracerProvider } = await import("./roy-agent-core-
|
|
656
|
+
const { getTracerProvider } = await import("./roy-agent-core-sx7wsvnn.js");
|
|
657
657
|
const provider = getTracerProvider();
|
|
658
658
|
if (!provider.isInitialized()) {
|
|
659
659
|
await provider.initialize();
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
TracedAs,
|
|
13
13
|
init_decorator
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-zgypchmt.js";
|
|
15
15
|
import {
|
|
16
16
|
createLogger,
|
|
17
17
|
init_logger
|
|
18
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-44hnfb02.js";
|
|
19
19
|
import {
|
|
20
20
|
__legacyDecorateClassTS,
|
|
21
21
|
__require
|
|
@@ -10,7 +10,7 @@ function inferNextNode(messages, definition) {
|
|
|
10
10
|
const lastMessage = messages[messages.length - 1];
|
|
11
11
|
const metadata = lastMessage.metadata;
|
|
12
12
|
switch (metadata?.type) {
|
|
13
|
-
case "workflow.node.
|
|
13
|
+
case "workflow.node.start":
|
|
14
14
|
return {
|
|
15
15
|
type: "resume_node",
|
|
16
16
|
nodeId: metadata.workflowNodeId,
|
|
@@ -22,16 +22,16 @@ function inferNextNode(messages, definition) {
|
|
|
22
22
|
nodeId: metadata.workflowNodeId,
|
|
23
23
|
agentSessionId: metadata.agentSessionId
|
|
24
24
|
};
|
|
25
|
-
case "workflow.node.
|
|
25
|
+
case "workflow.node.end":
|
|
26
26
|
return getNextNodes(metadata.workflowNodeId, definition);
|
|
27
27
|
default:
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
28
|
+
const lastStart = findLastStartMessage(messages);
|
|
29
|
+
if (lastStart) {
|
|
30
|
+
const startMetadata = lastStart.metadata;
|
|
31
31
|
return {
|
|
32
32
|
type: "resume_node",
|
|
33
|
-
nodeId:
|
|
34
|
-
agentSessionId:
|
|
33
|
+
nodeId: startMetadata.workflowNodeId,
|
|
34
|
+
agentSessionId: startMetadata.agentSessionId
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
return { type: "entry_node", nodeId: definition.entryNode };
|
|
@@ -53,10 +53,10 @@ function findLastInterruptMessage(messages) {
|
|
|
53
53
|
}
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function findLastStartMessage(messages) {
|
|
57
57
|
for (let i = messages.length - 1;i >= 0; i--) {
|
|
58
58
|
const msg = messages[i];
|
|
59
|
-
if (msg.metadata?.type === "workflow.node.
|
|
59
|
+
if (msg.metadata?.type === "workflow.node.start") {
|
|
60
60
|
return msg;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -64,18 +64,18 @@ function findLastCallMessage(messages) {
|
|
|
64
64
|
}
|
|
65
65
|
function parseNodeOutputs(messages) {
|
|
66
66
|
const outputs = new Map;
|
|
67
|
-
let
|
|
67
|
+
let lastStartNodeId = null;
|
|
68
68
|
for (const msg of messages) {
|
|
69
69
|
const metadata = msg.metadata;
|
|
70
|
-
if (metadata?.type === "workflow.node.
|
|
71
|
-
|
|
72
|
-
} else if (metadata?.type === "workflow.node.
|
|
70
|
+
if (metadata?.type === "workflow.node.start") {
|
|
71
|
+
lastStartNodeId = metadata.workflowNodeId;
|
|
72
|
+
} else if (metadata?.type === "workflow.node.end" && lastStartNodeId) {
|
|
73
73
|
try {
|
|
74
|
-
outputs.set(
|
|
74
|
+
outputs.set(lastStartNodeId, JSON.parse(msg.content));
|
|
75
75
|
} catch {
|
|
76
|
-
outputs.set(
|
|
76
|
+
outputs.set(lastStartNodeId, msg.content);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
lastStartNodeId = null;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
return outputs;
|
|
@@ -94,6 +94,37 @@ function getAgentSessionIdFromInterrupt(messages) {
|
|
|
94
94
|
const metadata = lastInterrupt.metadata;
|
|
95
95
|
return metadata?.agentSessionId || null;
|
|
96
96
|
}
|
|
97
|
+
function extractResumeInfo(messages) {
|
|
98
|
+
const nodeOutputs = parseNodeOutputs(messages);
|
|
99
|
+
let pendingNodeId;
|
|
100
|
+
let agentSessionId;
|
|
101
|
+
let hasInterrupt = false;
|
|
102
|
+
let lastInterruptQuery;
|
|
103
|
+
for (const msg of messages) {
|
|
104
|
+
const metadata = msg.metadata;
|
|
105
|
+
if (metadata?.type === "workflow.node.start") {
|
|
106
|
+
pendingNodeId = metadata.workflowNodeId;
|
|
107
|
+
if (metadata?.agentSessionId && !agentSessionId) {
|
|
108
|
+
agentSessionId = metadata.agentSessionId;
|
|
109
|
+
}
|
|
110
|
+
} else if (metadata?.type === "workflow.node.end") {
|
|
111
|
+
pendingNodeId = undefined;
|
|
112
|
+
agentSessionId = undefined;
|
|
113
|
+
} else if (metadata?.type === "workflow.node.interrupt") {
|
|
114
|
+
pendingNodeId = metadata.workflowNodeId;
|
|
115
|
+
agentSessionId = metadata.agentSessionId;
|
|
116
|
+
hasInterrupt = true;
|
|
117
|
+
lastInterruptQuery = msg.content;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
pendingNodeId,
|
|
122
|
+
agentSessionId,
|
|
123
|
+
hasInterrupt,
|
|
124
|
+
nodeOutputs,
|
|
125
|
+
lastInterruptQuery
|
|
126
|
+
};
|
|
127
|
+
}
|
|
97
128
|
var init_session_recovery = () => {};
|
|
98
129
|
init_session_recovery();
|
|
99
130
|
|
|
@@ -102,6 +133,7 @@ export {
|
|
|
102
133
|
inferNextNode,
|
|
103
134
|
hasPendingAskUser,
|
|
104
135
|
getAgentSessionIdFromInterrupt,
|
|
136
|
+
findLastStartMessage,
|
|
105
137
|
findLastInterruptMessage,
|
|
106
|
-
|
|
138
|
+
extractResumeInfo
|
|
107
139
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLogger,
|
|
3
3
|
init_logger
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-44hnfb02.js";
|
|
5
5
|
import {
|
|
6
6
|
__require
|
|
7
7
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -9,6 +9,28 @@ import {
|
|
|
9
9
|
// src/env/task/storage/sqlite-task-store.ts
|
|
10
10
|
init_logger();
|
|
11
11
|
import { join } from "path";
|
|
12
|
+
function getDatabaseClass() {
|
|
13
|
+
if (typeof Bun !== "undefined") {
|
|
14
|
+
const { Database } = __require("bun:sqlite");
|
|
15
|
+
return Database;
|
|
16
|
+
} else {
|
|
17
|
+
return __require("better-sqlite3");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function createCompatibleDatabase(path) {
|
|
21
|
+
const Database = getDatabaseClass();
|
|
22
|
+
const db = new Database(path);
|
|
23
|
+
if (typeof db.run !== "function") {
|
|
24
|
+
db.run = function(sql, ...params) {
|
|
25
|
+
if (params.length > 0) {
|
|
26
|
+
return this.prepare(sql).run(...params);
|
|
27
|
+
} else {
|
|
28
|
+
return this.exec(sql);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return db;
|
|
33
|
+
}
|
|
12
34
|
var logger = createLogger("task:store");
|
|
13
35
|
function getDefaultDataDir() {
|
|
14
36
|
const home = process.env.HOME || process.env.USERPROFILE || "/tmp";
|
|
@@ -30,7 +52,6 @@ class SQLiteTaskStore {
|
|
|
30
52
|
async initialize() {
|
|
31
53
|
if (this.initialized)
|
|
32
54
|
return;
|
|
33
|
-
const { Database } = __require("bun:sqlite");
|
|
34
55
|
if (this.dbPath !== ":memory:") {
|
|
35
56
|
const fs = __require("fs");
|
|
36
57
|
const path = __require("path");
|
|
@@ -39,7 +60,7 @@ class SQLiteTaskStore {
|
|
|
39
60
|
fs.mkdirSync(dir, { recursive: true });
|
|
40
61
|
}
|
|
41
62
|
}
|
|
42
|
-
this.db =
|
|
63
|
+
this.db = createCompatibleDatabase(this.dbPath);
|
|
43
64
|
this.db.run(`
|
|
44
65
|
CREATE TABLE IF NOT EXISTS task (
|
|
45
66
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -49,7 +49,7 @@ class ToolNode {
|
|
|
49
49
|
input = { message: resolvedMessage };
|
|
50
50
|
console.log(`[ToolNode] message input: ${resolvedMessage}`);
|
|
51
51
|
} else {
|
|
52
|
-
input = this.definition.config?.input ?? this.definition.config?.args ?? {};
|
|
52
|
+
input = this.definition.config?.input ?? this.definition.config?.inputs ?? this.definition.config?.args ?? {};
|
|
53
53
|
input = this.resolveTemplateReferences(input, context.previousOutputs, context.input);
|
|
54
54
|
}
|
|
55
55
|
let output;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SQLiteTaskStore,
|
|
3
3
|
getDefaultTaskDbPath
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-htwpckw9.js";
|
|
5
5
|
import {
|
|
6
6
|
completeTaskTool,
|
|
7
7
|
createTaskTool,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
BackgroundTaskManager,
|
|
22
22
|
createDelegateTool,
|
|
23
23
|
createStopTool
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-z62zee1e.js";
|
|
25
25
|
import {
|
|
26
26
|
TaskHookPoints
|
|
27
27
|
} from "./roy-agent-core-92z6t4he.js";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
import {
|
|
38
38
|
createLogger,
|
|
39
39
|
init_logger
|
|
40
|
-
} from "./roy-agent-core-
|
|
40
|
+
} from "./roy-agent-core-44hnfb02.js";
|
|
41
41
|
|
|
42
42
|
// src/env/task/task-component.ts
|
|
43
43
|
init_logger();
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./roy-agent-core-ctdhjv68.js";
|
|
5
5
|
import {
|
|
6
6
|
adaptMcpTool
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-1akcqxj9.js";
|
|
8
8
|
import {
|
|
9
9
|
toEnvKey
|
|
10
10
|
} from "./roy-agent-core-qxhq8ven.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
createLogger,
|
|
16
16
|
init_logger
|
|
17
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-44hnfb02.js";
|
|
18
18
|
|
|
19
19
|
// src/env/mcp/types.ts
|
|
20
20
|
import { z } from "zod";
|
|
@@ -4,6 +4,29 @@ import {
|
|
|
4
4
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
5
5
|
|
|
6
6
|
// src/env/log-trace/span-storage.ts
|
|
7
|
+
function getDatabaseClass() {
|
|
8
|
+
if (typeof Bun !== "undefined") {
|
|
9
|
+
const { Database } = __require("bun:sqlite");
|
|
10
|
+
return Database;
|
|
11
|
+
} else {
|
|
12
|
+
return __require("better-sqlite3");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function createCompatibleDatabase(path) {
|
|
16
|
+
const Database = getDatabaseClass();
|
|
17
|
+
const db = new Database(path);
|
|
18
|
+
if (typeof db.run !== "function") {
|
|
19
|
+
db.run = function(sql, ...params) {
|
|
20
|
+
if (params.length > 0) {
|
|
21
|
+
return this.prepare(sql).run(...params);
|
|
22
|
+
} else {
|
|
23
|
+
return this.exec(sql);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return db;
|
|
28
|
+
}
|
|
29
|
+
|
|
7
30
|
class SQLiteSpanStorage {
|
|
8
31
|
db = null;
|
|
9
32
|
dbPath;
|
|
@@ -20,14 +43,13 @@ class SQLiteSpanStorage {
|
|
|
20
43
|
async initialize() {
|
|
21
44
|
if (this.initialized)
|
|
22
45
|
return;
|
|
23
|
-
const { Database } = __require("bun:sqlite");
|
|
24
46
|
const fs = __require("fs");
|
|
25
47
|
const path = __require("path");
|
|
26
48
|
const dir = path.dirname(this.dbPath);
|
|
27
49
|
if (!fs.existsSync(dir)) {
|
|
28
50
|
fs.mkdirSync(dir, { recursive: true });
|
|
29
51
|
}
|
|
30
|
-
this.db =
|
|
52
|
+
this.db = createCompatibleDatabase(this.dbPath);
|
|
31
53
|
this.db.run("PRAGMA journal_mode=WAL");
|
|
32
54
|
this.db.run("PRAGMA busy_timeout=5000");
|
|
33
55
|
this.db.run("PRAGMA synchronous=NORMAL");
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
getTracerProvider,
|
|
4
4
|
init_tracer_provider,
|
|
5
5
|
resetTracerProvider
|
|
6
|
-
} from "./roy-agent-core-
|
|
7
|
-
import"./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-xs5rsgat.js";
|
|
7
|
+
import"./roy-agent-core-psv4v63c.js";
|
|
8
8
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
9
9
|
init_tracer_provider();
|
|
10
10
|
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
initDatabase,
|
|
6
6
|
initializeTables,
|
|
7
7
|
resetDatabase
|
|
8
|
-
} from "./roy-agent-core-
|
|
9
|
-
import"./roy-agent-core-
|
|
10
|
-
import"./roy-agent-core-
|
|
11
|
-
import"./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-zpn0bqa8.js";
|
|
9
|
+
import"./roy-agent-core-44hnfb02.js";
|
|
10
|
+
import"./roy-agent-core-xs5rsgat.js";
|
|
11
|
+
import"./roy-agent-core-psv4v63c.js";
|
|
12
12
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
13
13
|
export {
|
|
14
14
|
resetDatabase,
|