@ai-setting/roy-agent-core 1.7.85 → 1.7.89
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.js +7 -7
- package/dist/env/agent/agent-component.d.ts +1 -1
- package/dist/env/agent/agent-component.js +13 -12
- package/dist/env/agent/index.js +13 -12
- package/dist/env/agent/types.d.ts +14 -0
- package/dist/env/commands/index.js +7 -7
- package/dist/env/context/index.js +3 -3
- package/dist/env/debug/index.js +7 -7
- package/dist/env/error-reply.js +1 -1
- package/dist/env/event-source/event-source-handlers.d.ts +18 -2
- package/dist/env/event-source/event-source-handlers.js +26 -21
- package/dist/env/event-source/event-store.js +2 -2
- package/dist/env/event-source/index.js +25 -22
- package/dist/env/event-source/timer-handler.d.ts +98 -0
- package/dist/env/event-source/types.d.ts +53 -1
- package/dist/env/event-source/wecom-card-action-handler.d.ts +235 -3
- package/dist/env/event-source/wecom-card-builder.d.ts +207 -1
- package/dist/env/event-source/wecom-cli-handler.d.ts +25 -0
- package/dist/{shared/@ai-setting/roy-agent-core-vyr6svt6.js → env/event-source/wecom-respond-registry.js} +8 -6
- package/dist/env/event-source/wecom-session-card-sender.d.ts +135 -0
- package/dist/env/event-source/wecom-session-card-sender.js +153 -0
- package/dist/env/hook/index.js +5 -5
- package/dist/env/index.js +50 -45
- package/dist/env/llm/index.js +9 -8
- package/dist/env/log-trace/index.js +7 -7
- package/dist/env/log-trace/trace-filters.d.ts +6 -1
- package/dist/env/mcp/index.js +7 -7
- package/dist/env/memory/index.js +7 -7
- package/dist/env/plugin/index.js +7 -7
- package/dist/env/prompt/index.js +8 -8
- package/dist/env/prompt/prompts-index.d.ts +1 -1
- package/dist/env/session/group-session-link.d.ts +99 -0
- package/dist/env/session/index.js +11 -10
- package/dist/env/session/session-component.d.ts +89 -0
- package/dist/env/session/storage/index.js +5 -4
- package/dist/env/session/types.d.ts +10 -0
- package/dist/env/skill/index.js +7 -7
- package/dist/env/task/backend/index.d.ts +3 -0
- package/dist/env/task/backend/index.js +151 -3
- package/dist/env/task/backend/remote-task-port.d.ts +85 -0
- package/dist/env/task/backend/types.d.ts +5 -0
- package/dist/env/task/delegate/delegate-channel-hint.d.ts +39 -0
- package/dist/env/task/delegate/delegate-tool.d.ts +71 -6
- package/dist/env/task/delegate/delegate-tool.js +11 -9
- package/dist/env/task/delegate/index.js +8 -8
- package/dist/env/task/index.d.ts +1 -1
- package/dist/env/task/index.js +34 -18
- package/dist/env/task/mcp/index.js +4 -4
- package/dist/env/task/plugins/card-subject.d.ts +117 -0
- package/dist/env/task/plugins/index.js +19 -17
- package/dist/env/task/plugins/lark-card-action-handler.d.ts +261 -6
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +501 -0
- package/dist/env/task/plugins/lark-card-patch-notifier.js +12 -2
- package/dist/env/task/plugins/lark-card-state-store.d.ts +60 -0
- package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +45 -0
- package/dist/env/task/plugins/sub-session-activity.d.ts +415 -0
- package/dist/env/task/plugins/wecom-session-card-store.d.ts +134 -0
- package/dist/env/task/plugins/wecom-session-card-store.js +23 -0
- package/dist/env/task/plugins/wecom-task-notify-plugin.d.ts +40 -0
- package/dist/env/task/storage/index.d.ts +1 -0
- package/dist/env/task/storage/index.js +24 -4
- package/dist/env/task/storage/migrations/006_add_task_owner.d.ts +24 -0
- package/dist/env/task/storage/remote-task-store.d.ts +186 -0
- package/dist/env/task/task-component.d.ts +7 -0
- package/dist/env/task/tools/index.js +4 -4
- package/dist/env/task/tools/task-types.d.ts +7 -0
- package/dist/env/task/types.d.ts +17 -0
- package/dist/env/tool/built-in/index.js +6 -4
- package/dist/env/tool/index.js +14 -10
- package/dist/env/tool/types.d.ts +25 -0
- package/dist/env/tool/validator.d.ts +8 -0
- package/dist/env/workflow/engine/index.js +12 -12
- package/dist/env/workflow/hooks/index.js +7 -7
- package/dist/env/workflow/index.js +24 -23
- package/dist/env/workflow/nodes/index.js +2 -2
- package/dist/env/workflow/plugins/index.js +10 -8
- package/dist/env/workflow/service/index.js +2 -2
- package/dist/env/workflow/storage/index.js +3 -3
- package/dist/env/workflow/tools/index.js +16 -15
- package/dist/env/workflow/utils/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +71 -60
- package/dist/shared/@ai-setting/{roy-agent-core-q813vafd.js → roy-agent-core-05z35shp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dc9zq75z.js → roy-agent-core-0crmsc12.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-7dd0s3xb.js → roy-agent-core-0n1wwndq.js} +1027 -14
- package/dist/shared/@ai-setting/{roy-agent-core-cha0jc7n.js → roy-agent-core-0sbmdz8d.js} +137 -16
- package/dist/shared/@ai-setting/{roy-agent-core-87942bw4.js → roy-agent-core-1mhyh4c5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-v6vr6za7.js → roy-agent-core-1vv4fx15.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-nwbfepba.js → roy-agent-core-3e040tc5.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-418zc9ha.js +288 -0
- package/dist/shared/@ai-setting/{roy-agent-core-qk9hd89p.js → roy-agent-core-49qcpqwg.js} +54 -19
- package/dist/shared/@ai-setting/{roy-agent-core-xf6z96qy.js → roy-agent-core-4b38m749.js} +818 -346
- package/dist/shared/@ai-setting/{roy-agent-core-r5wt1h3c.js → roy-agent-core-4fkxy2gv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-na18zwj0.js → roy-agent-core-4t3yskp8.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-d1n4jbza.js → roy-agent-core-5dhvfgaw.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-5pr4zp88.js → roy-agent-core-5kzhaap1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qq96p0tj.js → roy-agent-core-5s2t8z00.js} +22 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6rh8k6ba.js → roy-agent-core-6gj1hc5z.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-g8htfwxj.js → roy-agent-core-7f10p7m2.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-h21gngxf.js → roy-agent-core-7yh5wps0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-efkjyh69.js → roy-agent-core-9710zwwz.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rykf7c04.js → roy-agent-core-9c565frx.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vffccgf6.js → roy-agent-core-9cen1jvg.js} +18 -7
- package/dist/shared/@ai-setting/{roy-agent-core-fghc2m8z.js → roy-agent-core-aa8kv18f.js} +34 -2
- package/dist/shared/@ai-setting/roy-agent-core-age3qseb.js +177 -0
- package/dist/shared/@ai-setting/{roy-agent-core-7bpj859q.js → roy-agent-core-azyz78ky.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-264qexac.js → roy-agent-core-b7h39vrc.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-dqxec05w.js → roy-agent-core-bjtc9d35.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-c4ec7k0p.js +426 -0
- package/dist/shared/@ai-setting/{roy-agent-core-ddyk1rc0.js → roy-agent-core-cre2y2ct.js} +160 -4
- package/dist/shared/@ai-setting/{roy-agent-core-tr3ep81v.js → roy-agent-core-d6zdbgtc.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0qyrk5k0.js → roy-agent-core-ds6qzmf8.js} +14 -5
- package/dist/shared/@ai-setting/{roy-agent-core-p6ks90tb.js → roy-agent-core-dvec4nn2.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-cgtq6427.js → roy-agent-core-e08bvpaq.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-12n08pg5.js → roy-agent-core-e69qxdyy.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xcp8vwax.js → roy-agent-core-fepm835e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6j02sbee.js → roy-agent-core-fhg03v43.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dvtg4sn0.js → roy-agent-core-g8yr733d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-m3vjepzz.js → roy-agent-core-h1e1fm9b.js} +38 -202
- package/dist/shared/@ai-setting/{roy-agent-core-c2gbt68e.js → roy-agent-core-h83zdsrq.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-tk98f92b.js → roy-agent-core-k3gcvybs.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-b31v3qpv.js → roy-agent-core-k3h8t4q1.js} +992 -212
- package/dist/shared/@ai-setting/{roy-agent-core-pgvcf91v.js → roy-agent-core-m39v7qpx.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ezvpreqz.js → roy-agent-core-m66ysky0.js} +54 -6
- package/dist/shared/@ai-setting/{roy-agent-core-begm7ytz.js → roy-agent-core-m7d1t3db.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-tm1mxttk.js → roy-agent-core-mf5p38yf.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-83bewqx8.js → roy-agent-core-mvh0td7p.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ze5cqpf2.js → roy-agent-core-mx855td4.js} +17 -38
- package/dist/shared/@ai-setting/{roy-agent-core-0dh8npnz.js → roy-agent-core-n197medr.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-cmprygrp.js → roy-agent-core-nqkfkpf4.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-7cbpmk4q.js → roy-agent-core-p31ftgq9.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-1v4g0d4x.js → roy-agent-core-rm7seqwb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ax9e9szb.js → roy-agent-core-smf94h73.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-acj8ag08.js → roy-agent-core-tjnabyvq.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qqaak24r.js → roy-agent-core-tkpp1ba0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dkrvmjsh.js → roy-agent-core-tpm1dd1g.js} +23 -15
- package/dist/shared/@ai-setting/{roy-agent-core-ed233k5z.js → roy-agent-core-v1n0106v.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zxz5fkwj.js → roy-agent-core-v6yshv0z.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mcy5apay.js → roy-agent-core-vf9sp6s3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xvt7kf7p.js → roy-agent-core-w9ryeg2p.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-es203w7p.js → roy-agent-core-wqs6yypq.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-wxrkcb17.js +56 -0
- package/dist/shared/@ai-setting/{roy-agent-core-0snm5hc5.js → roy-agent-core-y6shd91r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9vxh6f8h.js → roy-agent-core-y7fqtzk2.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-cpcd24n2.js → roy-agent-core-yet36q5k.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-3fh1f7s7.js → roy-agent-core-yfpnkc4z.js} +5 -5
- package/dist/shared/@ai-setting/roy-agent-core-zhwcje5a.js +352 -0
- package/package.json +9 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHook,
|
|
3
3
|
init_hook
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-smf94h73.js";
|
|
5
5
|
import {
|
|
6
6
|
HookManager
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
8
8
|
|
|
9
9
|
// src/env/component.ts
|
|
10
10
|
init_hook();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TracedAs,
|
|
3
3
|
init_decorator
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
@@ -208,6 +208,37 @@ var init_005_convert_blob_description_to_text = __esm(() => {
|
|
|
208
208
|
if (false) {}
|
|
209
209
|
});
|
|
210
210
|
|
|
211
|
+
// src/env/task/storage/migrations/006_add_task_owner.ts
|
|
212
|
+
var exports_006_add_task_owner = {};
|
|
213
|
+
__export(exports_006_add_task_owner, {
|
|
214
|
+
runMigration: () => runMigration6
|
|
215
|
+
});
|
|
216
|
+
function runMigration6(dbPath) {
|
|
217
|
+
logMigration(`[Migration 006] Starting migration for: ${dbPath}`);
|
|
218
|
+
const db = createCompatibleDatabase(dbPath);
|
|
219
|
+
try {
|
|
220
|
+
try {
|
|
221
|
+
db.run(`ALTER TABLE task ADD COLUMN owner TEXT`);
|
|
222
|
+
logMigration(`[Migration 006] Added owner column`);
|
|
223
|
+
} catch (e) {
|
|
224
|
+
if (e.message?.includes("duplicate column name")) {
|
|
225
|
+
logMigration(`[Migration 006] owner column already exists, skipping`);
|
|
226
|
+
} else {
|
|
227
|
+
throw e;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
db.run(`CREATE INDEX IF NOT EXISTS idx_task_owner ON task(owner)`);
|
|
231
|
+
logMigration(`[Migration 006] Migration completed successfully`);
|
|
232
|
+
} finally {
|
|
233
|
+
db.close();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
var init_006_add_task_owner = __esm(() => {
|
|
237
|
+
init_sqlite_task_store();
|
|
238
|
+
init_log_migration();
|
|
239
|
+
if (false) {}
|
|
240
|
+
});
|
|
241
|
+
|
|
211
242
|
// src/env/task/storage/sqlite-task-store.ts
|
|
212
243
|
import { join } from "path";
|
|
213
244
|
function getDatabaseClass() {
|
|
@@ -305,7 +336,8 @@ var init_sqlite_task_store = __esm(() => {
|
|
|
305
336
|
due_date TEXT,
|
|
306
337
|
tags TEXT,
|
|
307
338
|
project_path TEXT NOT NULL DEFAULT 'unknown',
|
|
308
|
-
context TEXT NOT NULL DEFAULT '{}'
|
|
339
|
+
context TEXT NOT NULL DEFAULT '{}',
|
|
340
|
+
owner TEXT
|
|
309
341
|
)
|
|
310
342
|
`);
|
|
311
343
|
this.db.run(`
|
|
@@ -375,6 +407,17 @@ var init_sqlite_task_store = __esm(() => {
|
|
|
375
407
|
} catch (e) {
|
|
376
408
|
logger.warn(`[Migration 005] Failed to run: ${e.message}`);
|
|
377
409
|
}
|
|
410
|
+
try {
|
|
411
|
+
const { runMigration: runMigration006 } = (init_006_add_task_owner(), __toCommonJS(exports_006_add_task_owner));
|
|
412
|
+
runMigration006(this.dbPath);
|
|
413
|
+
} catch (e) {
|
|
414
|
+
logger.warn(`[Migration 006] Failed to run: ${e.message}`);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
try {
|
|
418
|
+
this.db.run("CREATE INDEX IF NOT EXISTS idx_task_owner ON task(owner)");
|
|
419
|
+
} catch (e) {
|
|
420
|
+
logger.warn(`[TaskStore] idx_task_owner creation failed: ${e.message}`);
|
|
378
421
|
}
|
|
379
422
|
this.initialized = true;
|
|
380
423
|
logger.info(`TaskStore initialized at ${this.dbPath}`);
|
|
@@ -385,10 +428,10 @@ var init_sqlite_task_store = __esm(() => {
|
|
|
385
428
|
const stmt = this.db.prepare(`
|
|
386
429
|
INSERT INTO task (title, description, priority, type, parent_task_id,
|
|
387
430
|
goals_and_expected_deliverables, due_date, tags, status,
|
|
388
|
-
current_status, created_at, updated_at, project_path, context)
|
|
389
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'todo', '', ?, ?, ?, ?)
|
|
431
|
+
current_status, created_at, updated_at, project_path, context, owner)
|
|
432
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'todo', '', ?, ?, ?, ?, ?)
|
|
390
433
|
`);
|
|
391
|
-
const result = stmt.run(options.title, options.description || "", options.priority || "medium", options.type || "normal", options.parent_task_id || null, options.goals_and_expected_deliverables || "", options.due_date || null, options.tags ? JSON.stringify(options.tags) : null, now, now, options.project_path, options.context);
|
|
434
|
+
const result = stmt.run(options.title, options.description || "", options.priority || "medium", options.type || "normal", options.parent_task_id || null, options.goals_and_expected_deliverables || "", options.due_date || null, options.tags ? JSON.stringify(options.tags) : null, now, now, options.project_path, options.context, options.owner || null);
|
|
392
435
|
const task = await this.getTask(result.lastInsertRowid);
|
|
393
436
|
if (task) {
|
|
394
437
|
this.tasksCache.set(task.id, task);
|
|
@@ -468,6 +511,10 @@ var init_sqlite_task_store = __esm(() => {
|
|
|
468
511
|
updates.push("parent_task_id = ?");
|
|
469
512
|
values.push(options.parent_task_id);
|
|
470
513
|
}
|
|
514
|
+
if (options.owner !== undefined) {
|
|
515
|
+
updates.push("owner = ?");
|
|
516
|
+
values.push(options.owner || null);
|
|
517
|
+
}
|
|
471
518
|
if (updates.length === 0)
|
|
472
519
|
return task;
|
|
473
520
|
updates.push("updated_at = ?");
|
|
@@ -756,7 +803,8 @@ var init_sqlite_task_store = __esm(() => {
|
|
|
756
803
|
due_date: row.due_date ? String(row.due_date) : undefined,
|
|
757
804
|
tags: SQLiteTaskStore.parseTagsSafely(row.tags),
|
|
758
805
|
project_path: String(row.project_path ?? "unknown"),
|
|
759
|
-
context: row.context
|
|
806
|
+
context: row.context,
|
|
807
|
+
owner: row.owner === undefined || row.owner === null ? null : String(row.owner)
|
|
760
808
|
};
|
|
761
809
|
}
|
|
762
810
|
static parseTagsSafely(raw) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
builtInHandlers
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-4b38m749.js";
|
|
4
4
|
import {
|
|
5
5
|
appendAuditLog,
|
|
6
6
|
checkSourceCountDrop,
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
13
13
|
import {
|
|
14
14
|
BaseComponent
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
16
16
|
import {
|
|
17
17
|
TracedAs,
|
|
18
18
|
init_decorator
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
20
20
|
import {
|
|
21
21
|
createLogger,
|
|
22
22
|
init_logger
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseComponent
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
7
7
|
import {
|
|
8
8
|
init_decorator,
|
|
9
9
|
init_trace_filters
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
11
11
|
import {
|
|
12
12
|
createLogger,
|
|
13
13
|
getTracerProvider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TagRepository
|
|
3
|
-
} from "./roy-agent-core-
|
|
4
|
-
import"./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-vf9sp6s3.js";
|
|
4
|
+
import"./roy-agent-core-5s2t8z00.js";
|
|
5
5
|
import"./roy-agent-core-7f7t9wwp.js";
|
|
6
6
|
import"./roy-agent-core-85xyctnb.js";
|
|
7
7
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TempFileManager
|
|
3
3
|
} from "./roy-agent-core-jvv2h3d6.js";
|
|
4
|
+
import {
|
|
5
|
+
ToolValidator,
|
|
6
|
+
setToolReasonConfigComponent
|
|
7
|
+
} from "./roy-agent-core-wxrkcb17.js";
|
|
4
8
|
import {
|
|
5
9
|
AskUserError,
|
|
6
10
|
init_workflow_hil
|
|
@@ -11,23 +15,23 @@ import {
|
|
|
11
15
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
12
16
|
import {
|
|
13
17
|
BaseComponent
|
|
14
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
15
19
|
import {
|
|
16
20
|
ToolHookPoints,
|
|
17
21
|
globalHookManager,
|
|
18
22
|
init_global_hook_manager
|
|
19
|
-
} from "./roy-agent-core-
|
|
23
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
20
24
|
import {
|
|
21
25
|
getCurrentTaskId,
|
|
22
26
|
init_env_context
|
|
23
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-p31ftgq9.js";
|
|
24
28
|
import {
|
|
25
29
|
TracedAs,
|
|
26
30
|
init_decorator,
|
|
27
31
|
init_trace_filters,
|
|
28
32
|
toolExecResultFilter,
|
|
29
33
|
toolInvokeParamFilter
|
|
30
|
-
} from "./roy-agent-core-
|
|
34
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
31
35
|
import {
|
|
32
36
|
createLogger,
|
|
33
37
|
init_logger
|
|
@@ -131,36 +135,6 @@ class ToolRegistry {
|
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
137
|
|
|
134
|
-
// src/env/tool/validator.ts
|
|
135
|
-
import { ZodError } from "zod";
|
|
136
|
-
|
|
137
|
-
class ToolValidator {
|
|
138
|
-
async validate(tool, args) {
|
|
139
|
-
try {
|
|
140
|
-
const parsed = await tool.parameters.parseAsync(args);
|
|
141
|
-
return {
|
|
142
|
-
success: true,
|
|
143
|
-
data: parsed
|
|
144
|
-
};
|
|
145
|
-
} catch (error) {
|
|
146
|
-
if (error instanceof ZodError) {
|
|
147
|
-
const errorMessage = tool.formatValidationError ? tool.formatValidationError(error) : this.formatError(error);
|
|
148
|
-
return {
|
|
149
|
-
success: false,
|
|
150
|
-
error: `Invalid arguments for tool '${tool.name}': ${errorMessage}`
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
success: false,
|
|
155
|
-
error: `Validation error: ${error}`
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
formatError(error) {
|
|
160
|
-
return error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; ");
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
138
|
// src/env/constants.ts
|
|
165
139
|
var TOOL_UNAVAILABLE_ERROR_RE = /^Tool (?:not found|disabled):/;
|
|
166
140
|
function isToolUnavailableError(message) {
|
|
@@ -183,7 +157,8 @@ var TOOL_DEFAULTS = {
|
|
|
183
157
|
"tool.sandbox.type": "native",
|
|
184
158
|
"tool.execution.timeout": 30000,
|
|
185
159
|
"tool.execution.maxConcurrency": 5,
|
|
186
|
-
"tool.execution.maxOutputSize": 5120
|
|
160
|
+
"tool.execution.maxOutputSize": 5120,
|
|
161
|
+
"tool.reason.required": true
|
|
187
162
|
};
|
|
188
163
|
var TOOL_CONFIG_REGISTRATION = {
|
|
189
164
|
name: "tool",
|
|
@@ -198,7 +173,8 @@ var TOOL_CONFIG_REGISTRATION = {
|
|
|
198
173
|
{ key: "tool.sandbox.type", sources: ["env", "file"] },
|
|
199
174
|
{ key: "tool.execution.timeout", sources: ["env", "file"] },
|
|
200
175
|
{ key: "tool.execution.maxConcurrency", sources: ["env", "file"] },
|
|
201
|
-
{ key: "tool.execution.maxOutputSize", sources: ["env", "file"] }
|
|
176
|
+
{ key: "tool.execution.maxOutputSize", sources: ["env", "file"] },
|
|
177
|
+
{ key: "tool.reason.required", sources: ["env", "file"] }
|
|
202
178
|
]
|
|
203
179
|
};
|
|
204
180
|
|
|
@@ -307,6 +283,7 @@ class ToolComponent extends BaseComponent {
|
|
|
307
283
|
}
|
|
308
284
|
this.configComponent = options.configComponent;
|
|
309
285
|
setToolConfigComponent(options.configComponent);
|
|
286
|
+
setToolReasonConfigComponent(options.configComponent);
|
|
310
287
|
await this.registerConfig(options);
|
|
311
288
|
if (this.config?.builtInTools?.enabled !== false) {
|
|
312
289
|
await this.loadBuiltInTools();
|
|
@@ -338,7 +315,8 @@ class ToolComponent extends BaseComponent {
|
|
|
338
315
|
"tool.sandbox.type",
|
|
339
316
|
"tool.sandbox.defaultConfig",
|
|
340
317
|
"tool.execution.timeout",
|
|
341
|
-
"tool.execution.maxConcurrency"
|
|
318
|
+
"tool.execution.maxConcurrency",
|
|
319
|
+
"tool.reason.required"
|
|
342
320
|
];
|
|
343
321
|
for (const key of toolKeys) {
|
|
344
322
|
const envKey = toEnvKey(key, prefix);
|
|
@@ -417,6 +395,7 @@ class ToolComponent extends BaseComponent {
|
|
|
417
395
|
async onStop() {
|
|
418
396
|
this.configWatcher?.();
|
|
419
397
|
this.configWatcher = undefined;
|
|
398
|
+
setToolReasonConfigComponent(null);
|
|
420
399
|
this.setStatus("stopped");
|
|
421
400
|
}
|
|
422
401
|
register(tool, source = "dynamic") {
|
|
@@ -614,4 +593,4 @@ var ToolComponentConfigSchema = z.object({
|
|
|
614
593
|
}).default({})
|
|
615
594
|
});
|
|
616
595
|
|
|
617
|
-
export { ToolRegistry,
|
|
596
|
+
export { ToolRegistry, isToolUnavailableError, setToolConfigComponent, getMaxOutputSize, truncateOutputInline, ToolComponent };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exports_node_registry_helper,
|
|
3
3
|
init_node_registry_helper
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-wqs6yypq.js";
|
|
5
5
|
import {
|
|
6
6
|
askUserTool,
|
|
7
7
|
createRunWorkflowTool,
|
|
@@ -13,18 +13,18 @@ import {
|
|
|
13
13
|
createWorkflowSearchTool,
|
|
14
14
|
createWorkflowTagListTool,
|
|
15
15
|
createWorkflowValidateTool
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-azyz78ky.js";
|
|
17
17
|
import {
|
|
18
18
|
WorkflowService
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-e69qxdyy.js";
|
|
20
20
|
import {
|
|
21
21
|
WorkflowEngine,
|
|
22
22
|
exports_engine,
|
|
23
23
|
init_engine
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-6gj1hc5z.js";
|
|
25
25
|
import {
|
|
26
26
|
BaseComponent
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
28
28
|
import {
|
|
29
29
|
createLogger,
|
|
30
30
|
init_logger
|
|
@@ -104,7 +104,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
104
104
|
return;
|
|
105
105
|
try {
|
|
106
106
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
107
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
107
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-fepm835e.js");
|
|
108
108
|
this.nodeRegistry = new NodeRegistry;
|
|
109
109
|
registerDecoratorNodeType2(this.nodeRegistry);
|
|
110
110
|
this.decoratorsRegistered = true;
|
|
@@ -134,14 +134,14 @@ class WorkflowComponent extends BaseComponent {
|
|
|
134
134
|
}
|
|
135
135
|
async runWorkflow(definition, input, options) {
|
|
136
136
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
137
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
137
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-fepm835e.js");
|
|
138
138
|
const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
|
|
139
139
|
const skillComponent = this._workflowEnv?.getComponent("skill");
|
|
140
140
|
let agentRunner = this.agentRunner;
|
|
141
141
|
if (!agentRunner && this._workflowEnv) {
|
|
142
142
|
const agentComponent = this._workflowEnv.getComponent("agent");
|
|
143
143
|
if (agentComponent) {
|
|
144
|
-
const { AgentComponentAdapter } = await import("./roy-agent-core-
|
|
144
|
+
const { AgentComponentAdapter } = await import("./roy-agent-core-yfpnkc4z.js");
|
|
145
145
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -163,7 +163,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
163
163
|
if (this.workflowService) {
|
|
164
164
|
this.workflowService = null;
|
|
165
165
|
try {
|
|
166
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
166
|
+
const { closeDatabase } = await import("./roy-agent-core-0crmsc12.js");
|
|
167
167
|
closeDatabase();
|
|
168
168
|
componentLogger.info("[WorkflowComponent] SQLite database closed");
|
|
169
169
|
} catch (error) {
|
|
@@ -241,9 +241,9 @@ class WorkflowComponent extends BaseComponent {
|
|
|
241
241
|
}
|
|
242
242
|
async initSqliteService() {
|
|
243
243
|
try {
|
|
244
|
-
const { getDatabase, initializeTables } = await import("./roy-agent-core-
|
|
245
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
246
|
-
const { TagRepository } = await import("./roy-agent-core-
|
|
244
|
+
const { getDatabase, initializeTables } = await import("./roy-agent-core-0crmsc12.js");
|
|
245
|
+
const { WorkflowRepository } = await import("./roy-agent-core-w9ryeg2p.js");
|
|
246
|
+
const { TagRepository } = await import("./roy-agent-core-mvh0td7p.js");
|
|
247
247
|
const db = getDatabase();
|
|
248
248
|
initializeTables();
|
|
249
249
|
const workflowRepository = new WorkflowRepository(db);
|
|
@@ -309,7 +309,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
309
309
|
this.workflowService = null;
|
|
310
310
|
this.nodeRegistry = null;
|
|
311
311
|
try {
|
|
312
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
312
|
+
const { closeDatabase } = await import("./roy-agent-core-0crmsc12.js");
|
|
313
313
|
closeDatabase();
|
|
314
314
|
} catch {}
|
|
315
315
|
this._status = "stopped";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
builtInPrompts
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-y7fqtzk2.js";
|
|
4
4
|
import {
|
|
5
5
|
getXDGPath
|
|
6
6
|
} from "./roy-agent-core-qxnbvgwe.js";
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseComponent
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
14
14
|
import {
|
|
15
15
|
createHook
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-smf94h73.js";
|
|
17
17
|
import {
|
|
18
18
|
globalHookManager,
|
|
19
19
|
init_global_hook_manager
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
21
21
|
import {
|
|
22
22
|
createLogger,
|
|
23
23
|
init_logger
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isToolUnavailableError,
|
|
3
3
|
truncateOutputInline
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-mx855td4.js";
|
|
5
5
|
import {
|
|
6
6
|
AgentRegistry
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-v1n0106v.js";
|
|
8
8
|
import {
|
|
9
9
|
createTaskOpWatermarkPlugin,
|
|
10
10
|
enqueueToAddFakeUserMessage
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-7yh5wps0.js";
|
|
12
12
|
import {
|
|
13
13
|
SessionMessageConverter
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-y6shd91r.js";
|
|
15
15
|
import {
|
|
16
16
|
parseToolArgsStrict,
|
|
17
17
|
safeParseToolArgs,
|
|
18
18
|
withTimeout
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-aa8kv18f.js";
|
|
20
20
|
import {
|
|
21
21
|
getCurrentBgTaskId
|
|
22
22
|
} from "./roy-agent-core-c1v263jn.js";
|
|
@@ -32,20 +32,20 @@ import {
|
|
|
32
32
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
33
33
|
import {
|
|
34
34
|
BaseComponent
|
|
35
|
-
} from "./roy-agent-core-
|
|
35
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
36
36
|
import {
|
|
37
37
|
globalHookManager,
|
|
38
38
|
init_global_hook_manager
|
|
39
|
-
} from "./roy-agent-core-
|
|
39
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
40
40
|
import {
|
|
41
41
|
init_context
|
|
42
|
-
} from "./roy-agent-core-
|
|
42
|
+
} from "./roy-agent-core-tkpp1ba0.js";
|
|
43
43
|
import {
|
|
44
44
|
getCurrentTaskId,
|
|
45
45
|
getEnvContext,
|
|
46
46
|
resolveEnvParentTaskId,
|
|
47
47
|
runWithEnvContextAsync
|
|
48
|
-
} from "./roy-agent-core-
|
|
48
|
+
} from "./roy-agent-core-p31ftgq9.js";
|
|
49
49
|
import {
|
|
50
50
|
TracedAs,
|
|
51
51
|
agentRunParamFilter,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
recordSessionMessagesParamFilter,
|
|
58
58
|
toolExecParamFilter,
|
|
59
59
|
toolExecResultFilter
|
|
60
|
-
} from "./roy-agent-core-
|
|
60
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
61
61
|
import {
|
|
62
62
|
createLogger,
|
|
63
63
|
init_logger
|
|
@@ -554,10 +554,16 @@ var AgentInstanceSchema = z.object({
|
|
|
554
554
|
var AgentComponentConfigSchema = z.object({
|
|
555
555
|
defaultAgent: AgentInstanceSchema
|
|
556
556
|
});
|
|
557
|
-
function filterToolsByAgent(tools, agent) {
|
|
557
|
+
function filterToolsByAgent(tools, agent, extendTools) {
|
|
558
558
|
if (!tools?.length)
|
|
559
559
|
return tools ?? [];
|
|
560
560
|
return tools.filter((t) => {
|
|
561
|
+
if (t.metadata?.channelOnly === true) {
|
|
562
|
+
if (!extendTools || extendTools.length === 0)
|
|
563
|
+
return false;
|
|
564
|
+
if (!extendTools.includes(t.name))
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
561
567
|
const allowedList = t.metadata?.allowedAgentTypes;
|
|
562
568
|
if (!allowedList || allowedList.length === 0)
|
|
563
569
|
return true;
|
|
@@ -957,7 +963,8 @@ class AgentComponent extends BaseComponent {
|
|
|
957
963
|
this.defaultTools = tools;
|
|
958
964
|
}
|
|
959
965
|
getAvailableTools(agent, context) {
|
|
960
|
-
|
|
966
|
+
const extendTools = context?.extendTools;
|
|
967
|
+
let tools = filterToolsByAgent([...this.defaultTools], agent, extendTools);
|
|
961
968
|
logger2.debug(`[getAvailableTools] After defaultTools (filtered): ${tools.length} tools`, {
|
|
962
969
|
toolNames: tools.map((t) => t.name)
|
|
963
970
|
});
|
|
@@ -965,7 +972,7 @@ class AgentComponent extends BaseComponent {
|
|
|
965
972
|
const componentTools = this.toolComponent.listTools({
|
|
966
973
|
allowedAgent: agent.name
|
|
967
974
|
});
|
|
968
|
-
const filteredComponentTools = filterToolsByAgent(componentTools, agent);
|
|
975
|
+
const filteredComponentTools = filterToolsByAgent(componentTools, agent, extendTools);
|
|
969
976
|
tools = [...tools, ...filteredComponentTools];
|
|
970
977
|
logger2.debug(`[getAvailableTools] After adding componentTools: ${tools.length} tools`, {
|
|
971
978
|
componentToolNames: filteredComponentTools.map((t) => t.name)
|
|
@@ -987,7 +994,7 @@ class AgentComponent extends BaseComponent {
|
|
|
987
994
|
});
|
|
988
995
|
}
|
|
989
996
|
if (context?.extraTools?.length) {
|
|
990
|
-
const filteredExtraTools = filterToolsByAgent(context.extraTools, agent);
|
|
997
|
+
const filteredExtraTools = filterToolsByAgent(context.extraTools, agent, extendTools);
|
|
991
998
|
tools = [...tools, ...filteredExtraTools];
|
|
992
999
|
logger2.debug(`[getAvailableTools] After extraTools (filtered): ${tools.length} tools`, {
|
|
993
1000
|
extraToolNames: filteredExtraTools.map((t) => t.name)
|
|
@@ -1929,7 +1936,8 @@ class AgentComponent extends BaseComponent {
|
|
|
1929
1936
|
...ctx._runId ? { runId: ctx._runId } : {},
|
|
1930
1937
|
...ctx.context.sessionId ? { sessionId: ctx.context.sessionId } : {},
|
|
1931
1938
|
...ctx.context.agentType ? { agentType: ctx.context.agentType } : {},
|
|
1932
|
-
...ctx.agent?.name ? { agentName: ctx.agent.name } : {}
|
|
1939
|
+
...ctx.agent?.name ? { agentName: ctx.agent.name } : {},
|
|
1940
|
+
...ctx.context.extendTools?.length ? { extendTools: ctx.context.extendTools } : {}
|
|
1933
1941
|
}
|
|
1934
1942
|
};
|
|
1935
1943
|
const request = {
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
WorkflowRepository,
|
|
3
3
|
migrateEmptyTagsToDefault,
|
|
4
4
|
rowToWorkflow
|
|
5
|
-
} from "./roy-agent-core-
|
|
6
|
-
import"./roy-agent-core-
|
|
5
|
+
} from "./roy-agent-core-4fkxy2gv.js";
|
|
6
|
+
import"./roy-agent-core-vf9sp6s3.js";
|
|
7
7
|
import"./roy-agent-core-rvxg1wps.js";
|
|
8
|
-
import"./roy-agent-core-
|
|
8
|
+
import"./roy-agent-core-5s2t8z00.js";
|
|
9
9
|
import"./roy-agent-core-7f7t9wwp.js";
|
|
10
10
|
import"./roy-agent-core-85xyctnb.js";
|
|
11
11
|
import"./roy-agent-core-fs0mn2jk.js";
|