@dudousxd/nestjs-agent 1.6.0 → 1.7.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/README.md +35 -0
- package/dist/{agent-deps.factory-CUyVPsa1.d.cts → agent-deps.factory-CiC5Va9J.d.cts} +7 -1
- package/dist/{agent-deps.factory-CUyVPsa1.d.ts → agent-deps.factory-CiC5Va9J.d.ts} +7 -1
- package/dist/durable/index.cjs +466 -309
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +1 -1
- package/dist/durable/index.d.ts +1 -1
- package/dist/durable/index.js +366 -209
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +468 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -5
- package/dist/index.d.ts +40 -5
- package/dist/index.js +363 -208
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/durable/index.js
CHANGED
|
@@ -92,7 +92,10 @@ var AgentRunSteps = class {
|
|
|
92
92
|
system: input.system,
|
|
93
93
|
messages: input.messages,
|
|
94
94
|
tools,
|
|
95
|
-
sink: frames.writer
|
|
95
|
+
sink: frames.writer,
|
|
96
|
+
...input.model !== void 0 ? {
|
|
97
|
+
model: input.model
|
|
98
|
+
} : {}
|
|
96
99
|
})), frames.summary());
|
|
97
100
|
const stamped = stampToolKinds(turn, deps);
|
|
98
101
|
return buffer === void 0 ? stamped : {
|
|
@@ -790,7 +793,7 @@ AgentDurableModule = _ts_decorate4([
|
|
|
790
793
|
], AgentDurableModule);
|
|
791
794
|
|
|
792
795
|
// src/agent.module.ts
|
|
793
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
796
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER11, AGENT_APPROVAL_PORT, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY7, AGENT_DURABLE_RUNNER as AGENT_DURABLE_RUNNER2, AGENT_MEMORY as AGENT_MEMORY3, AGENT_MODEL as AGENT_MODEL2, AGENT_MODEL_CATALOG as AGENT_MODEL_CATALOG2, AGENT_OPTIONS as AGENT_OPTIONS4, AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS3, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE3, AGENT_REGISTRY as AGENT_REGISTRY6, AGENT_ROLES_POLICY as AGENT_ROLES_POLICY2, AGENT_RUNNER as AGENT_RUNNER2, AGENT_SINK as AGENT_SINK3, AGENT_SKILLS as AGENT_SKILLS3, AGENT_SKILL_SOURCES as AGENT_SKILL_SOURCES2, AGENT_STORE as AGENT_STORE6, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry6, DefaultRolesPolicy, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
|
|
794
797
|
import { Global as Global2, Module as Module2 } from "@nestjs/common";
|
|
795
798
|
import { DiscoveryModule, RouterModule } from "@nestjs/core";
|
|
796
799
|
|
|
@@ -1060,7 +1063,7 @@ AgentDepsFactory2 = _ts_decorate5([
|
|
|
1060
1063
|
], AgentDepsFactory2);
|
|
1061
1064
|
|
|
1062
1065
|
// src/agent.service.ts
|
|
1063
|
-
import { AGENT_ATTACHMENT_STAGING, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY3, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE4, REQUESTER_APPROVER, mayDecideApproval, readElicitationQuestions, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
|
|
1066
|
+
import { AGENT_ATTACHMENT_STAGING, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY3, AGENT_MODEL_CATALOG, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE4, REQUESTER_APPROVER, findCatalogModel, mayDecideApproval, readElicitationQuestions, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
|
|
1064
1067
|
import { BadRequestException, ForbiddenException, GoneException, Inject as Inject5, Injectable as Injectable5, NotFoundException, NotImplementedException, Optional as Optional3 } from "@nestjs/common";
|
|
1065
1068
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
1066
1069
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1097,15 +1100,72 @@ var AgentService = class {
|
|
|
1097
1100
|
deps;
|
|
1098
1101
|
quota;
|
|
1099
1102
|
staging;
|
|
1100
|
-
|
|
1103
|
+
models;
|
|
1104
|
+
constructor(runner, store, deps, quota, staging, models) {
|
|
1101
1105
|
this.runner = runner;
|
|
1102
1106
|
this.store = store;
|
|
1103
1107
|
this.deps = deps;
|
|
1104
1108
|
this.quota = quota;
|
|
1105
1109
|
this.staging = staging;
|
|
1110
|
+
this.models = models;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* The models `actor` may pick for `agent` (`GET <base>/models`). An empty catalog when none is
|
|
1114
|
+
* bound, so a picker simply has nothing to offer.
|
|
1115
|
+
*/
|
|
1116
|
+
async listModels(actor, agent) {
|
|
1117
|
+
if (this.models === void 0) {
|
|
1118
|
+
return {
|
|
1119
|
+
providers: [],
|
|
1120
|
+
default: null
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
return this.models.list({
|
|
1124
|
+
actor,
|
|
1125
|
+
...agent !== void 0 ? {
|
|
1126
|
+
agent
|
|
1127
|
+
} : {}
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* `model` if the catalog offers it to this actor and agent right now, else a 400 naming why. The
|
|
1132
|
+
* one gate every model choice passes — a send's own, and a thread's pinned one at the moment it is
|
|
1133
|
+
* pinned and again at every turn that runs on it (availability can change in between).
|
|
1134
|
+
*/
|
|
1135
|
+
async assertModelAllowed(actor, agent, model) {
|
|
1136
|
+
if (this.models === void 0) {
|
|
1137
|
+
throw new BadRequestException(`model "${model}" cannot be selected: no ModelCatalog is configured (AgentModule.forRoot({ models }))`);
|
|
1138
|
+
}
|
|
1139
|
+
const entry = findCatalogModel(await this.models.list({
|
|
1140
|
+
actor,
|
|
1141
|
+
agent
|
|
1142
|
+
}), model);
|
|
1143
|
+
if (entry === void 0) {
|
|
1144
|
+
throw new BadRequestException(`model "${model}" is not offered`);
|
|
1145
|
+
}
|
|
1146
|
+
if (!entry.available) {
|
|
1147
|
+
throw new BadRequestException(`model "${model}" is not available${entry.unavailableReason ? `: ${entry.unavailableReason}` : ""}`);
|
|
1148
|
+
}
|
|
1149
|
+
return entry.id;
|
|
1150
|
+
}
|
|
1151
|
+
/** The model a turn runs on: the send's own, else the thread's pinned one, else none. */
|
|
1152
|
+
async resolveModel(actor, agent, requested, threadId) {
|
|
1153
|
+
const model = requested ?? (threadId !== void 0 ? await this.threadModel(threadId) : null);
|
|
1154
|
+
if (model === null || model === void 0) {
|
|
1155
|
+
return void 0;
|
|
1156
|
+
}
|
|
1157
|
+
return this.assertModelAllowed(actor, agent, model);
|
|
1158
|
+
}
|
|
1159
|
+
async threadModel(threadId) {
|
|
1160
|
+
const projecting = this.store;
|
|
1161
|
+
if (typeof projecting.modelForThread === "function") {
|
|
1162
|
+
return projecting.modelForThread(threadId);
|
|
1163
|
+
}
|
|
1164
|
+
return (await this.store.getThread(threadId))?.model ?? null;
|
|
1106
1165
|
}
|
|
1107
1166
|
async chat(params) {
|
|
1108
1167
|
const agentName = await this.resolveAgentName(params.agentName, params.threadId);
|
|
1168
|
+
const model = await this.resolveModel(params.actor, agentName, params.model, params.threadId);
|
|
1109
1169
|
const attachments = await this.resolveAttachments(params.actor, params.attachments ?? []);
|
|
1110
1170
|
let threadId = params.threadId;
|
|
1111
1171
|
if (threadId === void 0) {
|
|
@@ -1136,6 +1196,9 @@ var AgentService = class {
|
|
|
1136
1196
|
} : {},
|
|
1137
1197
|
...params.pageContext !== void 0 ? {
|
|
1138
1198
|
pageContext: params.pageContext
|
|
1199
|
+
} : {},
|
|
1200
|
+
...model !== void 0 ? {
|
|
1201
|
+
model
|
|
1139
1202
|
} : {}
|
|
1140
1203
|
};
|
|
1141
1204
|
const { runId } = await this.runner.start(input);
|
|
@@ -1306,20 +1369,26 @@ var AgentService = class {
|
|
|
1306
1369
|
async updateThread(actor, threadId, patch) {
|
|
1307
1370
|
const title = patch.title !== void 0 ? this.validateTitle(patch.title) : void 0;
|
|
1308
1371
|
await this.assertOwnsThread(actor, threadId);
|
|
1309
|
-
if (patch.defaultAgent === void 0) {
|
|
1372
|
+
if (patch.defaultAgent === void 0 && patch.model === void 0) {
|
|
1310
1373
|
if (title !== void 0) {
|
|
1311
1374
|
await this.store.setTitle(threadId, title);
|
|
1312
1375
|
}
|
|
1313
1376
|
return;
|
|
1314
1377
|
}
|
|
1315
1378
|
if (this.store.updateThread === void 0) {
|
|
1316
|
-
throw new NotImplementedException("Setting a thread's defaultAgent requires an AgentStore that implements updateThread(); the bound store does not support it.");
|
|
1379
|
+
throw new NotImplementedException("Setting a thread's defaultAgent or model requires an AgentStore that implements updateThread(); the bound store does not support it.");
|
|
1317
1380
|
}
|
|
1381
|
+
const model = patch.model === void 0 || patch.model === null ? patch.model : await this.assertModelAllowed(actor, patch.defaultAgent ?? await this.resolveAgentName(void 0, threadId), patch.model);
|
|
1318
1382
|
await this.store.updateThread(threadId, {
|
|
1319
1383
|
...title !== void 0 ? {
|
|
1320
1384
|
title
|
|
1321
1385
|
} : {},
|
|
1322
|
-
|
|
1386
|
+
...patch.defaultAgent !== void 0 ? {
|
|
1387
|
+
defaultAgent: patch.defaultAgent
|
|
1388
|
+
} : {},
|
|
1389
|
+
...model !== void 0 ? {
|
|
1390
|
+
model
|
|
1391
|
+
} : {}
|
|
1323
1392
|
});
|
|
1324
1393
|
}
|
|
1325
1394
|
validateTitle(title) {
|
|
@@ -1366,6 +1435,7 @@ var AgentService = class {
|
|
|
1366
1435
|
return {
|
|
1367
1436
|
...thread,
|
|
1368
1437
|
defaultAgent: thread.defaultAgent ?? null,
|
|
1438
|
+
model: thread.model ?? null,
|
|
1369
1439
|
activeRunId: await this.store.activeRunForThread?.(thread.id) ?? null
|
|
1370
1440
|
};
|
|
1371
1441
|
}
|
|
@@ -1633,13 +1703,16 @@ AgentService = _ts_decorate6([
|
|
|
1633
1703
|
_ts_param5(3, Inject5(AGENT_QUOTA_STORE2)),
|
|
1634
1704
|
_ts_param5(4, Optional3()),
|
|
1635
1705
|
_ts_param5(4, Inject5(AGENT_ATTACHMENT_STAGING)),
|
|
1706
|
+
_ts_param5(5, Optional3()),
|
|
1707
|
+
_ts_param5(5, Inject5(AGENT_MODEL_CATALOG)),
|
|
1636
1708
|
_ts_metadata5("design:type", Function),
|
|
1637
1709
|
_ts_metadata5("design:paramtypes", [
|
|
1638
1710
|
typeof AgentRunner === "undefined" ? Object : AgentRunner,
|
|
1639
1711
|
typeof AgentStore === "undefined" ? Object : AgentStore,
|
|
1640
1712
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
1641
1713
|
Object,
|
|
1642
|
-
typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore
|
|
1714
|
+
typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore,
|
|
1715
|
+
typeof ModelCatalog === "undefined" ? Object : ModelCatalog
|
|
1643
1716
|
])
|
|
1644
1717
|
], AgentService);
|
|
1645
1718
|
|
|
@@ -2011,6 +2084,9 @@ var ChatController = class {
|
|
|
2011
2084
|
} : {},
|
|
2012
2085
|
...body.transient === true ? {
|
|
2013
2086
|
transient: true
|
|
2087
|
+
} : {},
|
|
2088
|
+
...typeof body.model === "string" && body.model.length > 0 ? {
|
|
2089
|
+
model: body.model
|
|
2014
2090
|
} : {}
|
|
2015
2091
|
});
|
|
2016
2092
|
await this.pipe(res, runId, this.agent.subscribe(runId), threadId);
|
|
@@ -2375,9 +2451,9 @@ MessagesController = _ts_decorate12([
|
|
|
2375
2451
|
])
|
|
2376
2452
|
], MessagesController);
|
|
2377
2453
|
|
|
2378
|
-
// src/controller/
|
|
2454
|
+
// src/controller/models.controller.ts
|
|
2379
2455
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5 } from "@dudousxd/nestjs-agent-core";
|
|
2380
|
-
import { Controller as Controller6, Get as Get5, Inject as Inject11, Req as Req5 } from "@nestjs/common";
|
|
2456
|
+
import { Controller as Controller6, Get as Get5, Inject as Inject11, Query as Query3, Req as Req5 } from "@nestjs/common";
|
|
2381
2457
|
function _ts_decorate13(decorators, target, key, desc) {
|
|
2382
2458
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2383
2459
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2404,9 +2480,9 @@ function _ts_param11(paramIndex, decorator) {
|
|
|
2404
2480
|
};
|
|
2405
2481
|
}
|
|
2406
2482
|
__name(_ts_param11, "_ts_param");
|
|
2407
|
-
var
|
|
2483
|
+
var ModelsController = class {
|
|
2408
2484
|
static {
|
|
2409
|
-
__name(this, "
|
|
2485
|
+
__name(this, "ModelsController");
|
|
2410
2486
|
}
|
|
2411
2487
|
agent;
|
|
2412
2488
|
actorResolver;
|
|
@@ -2414,33 +2490,39 @@ var QuotaController = class {
|
|
|
2414
2490
|
this.agent = agent;
|
|
2415
2491
|
this.actorResolver = actorResolver;
|
|
2416
2492
|
}
|
|
2417
|
-
|
|
2493
|
+
/**
|
|
2494
|
+
* The models the caller may pick for `agent` (the default agent when omitted), grouped by
|
|
2495
|
+
* provider, with badges and availability — the bound `ModelCatalog`'s answer, or an empty one.
|
|
2496
|
+
*/
|
|
2497
|
+
async list(req, agent) {
|
|
2418
2498
|
const actor = await this.actorResolver.resolve(req);
|
|
2419
|
-
return this.agent.
|
|
2499
|
+
return this.agent.listModels(actor, agent);
|
|
2420
2500
|
}
|
|
2421
2501
|
};
|
|
2422
2502
|
_ts_decorate13([
|
|
2423
|
-
Get5(
|
|
2503
|
+
Get5(),
|
|
2424
2504
|
_ts_param11(0, Req5()),
|
|
2505
|
+
_ts_param11(1, Query3("agent")),
|
|
2425
2506
|
_ts_metadata12("design:type", Function),
|
|
2426
2507
|
_ts_metadata12("design:paramtypes", [
|
|
2427
|
-
typeof Request === "undefined" ? Object : Request
|
|
2508
|
+
typeof Request === "undefined" ? Object : Request,
|
|
2509
|
+
String
|
|
2428
2510
|
]),
|
|
2429
2511
|
_ts_metadata12("design:returntype", Promise)
|
|
2430
|
-
],
|
|
2431
|
-
|
|
2432
|
-
Controller6("
|
|
2512
|
+
], ModelsController.prototype, "list", null);
|
|
2513
|
+
ModelsController = _ts_decorate13([
|
|
2514
|
+
Controller6("models"),
|
|
2433
2515
|
_ts_param11(1, Inject11(AGENT_ACTOR_RESOLVER5)),
|
|
2434
2516
|
_ts_metadata12("design:type", Function),
|
|
2435
2517
|
_ts_metadata12("design:paramtypes", [
|
|
2436
2518
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2437
2519
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2438
2520
|
])
|
|
2439
|
-
],
|
|
2521
|
+
], ModelsController);
|
|
2440
2522
|
|
|
2441
|
-
// src/controller/
|
|
2442
|
-
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER6
|
|
2443
|
-
import { Controller as Controller7, Get as Get6, Inject as Inject12,
|
|
2523
|
+
// src/controller/quota.controller.ts
|
|
2524
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER6 } from "@dudousxd/nestjs-agent-core";
|
|
2525
|
+
import { Controller as Controller7, Get as Get6, Inject as Inject12, Req as Req6 } from "@nestjs/common";
|
|
2444
2526
|
function _ts_decorate14(decorators, target, key, desc) {
|
|
2445
2527
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2446
2528
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2467,6 +2549,69 @@ function _ts_param12(paramIndex, decorator) {
|
|
|
2467
2549
|
};
|
|
2468
2550
|
}
|
|
2469
2551
|
__name(_ts_param12, "_ts_param");
|
|
2552
|
+
var QuotaController = class {
|
|
2553
|
+
static {
|
|
2554
|
+
__name(this, "QuotaController");
|
|
2555
|
+
}
|
|
2556
|
+
agent;
|
|
2557
|
+
actorResolver;
|
|
2558
|
+
constructor(agent, actorResolver) {
|
|
2559
|
+
this.agent = agent;
|
|
2560
|
+
this.actorResolver = actorResolver;
|
|
2561
|
+
}
|
|
2562
|
+
async today(req) {
|
|
2563
|
+
const actor = await this.actorResolver.resolve(req);
|
|
2564
|
+
return this.agent.quotaToday(actor.id);
|
|
2565
|
+
}
|
|
2566
|
+
};
|
|
2567
|
+
_ts_decorate14([
|
|
2568
|
+
Get6("today"),
|
|
2569
|
+
_ts_param12(0, Req6()),
|
|
2570
|
+
_ts_metadata13("design:type", Function),
|
|
2571
|
+
_ts_metadata13("design:paramtypes", [
|
|
2572
|
+
typeof Request === "undefined" ? Object : Request
|
|
2573
|
+
]),
|
|
2574
|
+
_ts_metadata13("design:returntype", Promise)
|
|
2575
|
+
], QuotaController.prototype, "today", null);
|
|
2576
|
+
QuotaController = _ts_decorate14([
|
|
2577
|
+
Controller7("quota"),
|
|
2578
|
+
_ts_param12(1, Inject12(AGENT_ACTOR_RESOLVER6)),
|
|
2579
|
+
_ts_metadata13("design:type", Function),
|
|
2580
|
+
_ts_metadata13("design:paramtypes", [
|
|
2581
|
+
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2582
|
+
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2583
|
+
])
|
|
2584
|
+
], QuotaController);
|
|
2585
|
+
|
|
2586
|
+
// src/controller/skills.controller.ts
|
|
2587
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER7, AGENT_SKILLS as AGENT_SKILLS2, offerSkills } from "@dudousxd/nestjs-agent-core";
|
|
2588
|
+
import { Controller as Controller8, Get as Get7, Inject as Inject13, Optional as Optional6, Query as Query4, Req as Req7 } from "@nestjs/common";
|
|
2589
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
2590
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2591
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2592
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2593
|
+
} else {
|
|
2594
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2595
|
+
if (d = decorators[i]) {
|
|
2596
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2601
|
+
}
|
|
2602
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
2603
|
+
function _ts_metadata14(metadataKey, metadataValue) {
|
|
2604
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2605
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
2609
|
+
function _ts_param13(paramIndex, decorator) {
|
|
2610
|
+
return function(target, key) {
|
|
2611
|
+
decorator(target, key, paramIndex);
|
|
2612
|
+
};
|
|
2613
|
+
}
|
|
2614
|
+
__name(_ts_param13, "_ts_param");
|
|
2470
2615
|
var SkillsController = class {
|
|
2471
2616
|
static {
|
|
2472
2617
|
__name(this, "SkillsController");
|
|
@@ -2489,33 +2634,33 @@ var SkillsController = class {
|
|
|
2489
2634
|
return offer.entries;
|
|
2490
2635
|
}
|
|
2491
2636
|
};
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2637
|
+
_ts_decorate15([
|
|
2638
|
+
Get7(),
|
|
2639
|
+
_ts_param13(0, Req7()),
|
|
2640
|
+
_ts_param13(1, Query4("threadId")),
|
|
2641
|
+
_ts_metadata14("design:type", Function),
|
|
2642
|
+
_ts_metadata14("design:paramtypes", [
|
|
2498
2643
|
typeof Request === "undefined" ? Object : Request,
|
|
2499
2644
|
String
|
|
2500
2645
|
]),
|
|
2501
|
-
|
|
2646
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2502
2647
|
], SkillsController.prototype, "list", null);
|
|
2503
|
-
SkillsController =
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2648
|
+
SkillsController = _ts_decorate15([
|
|
2649
|
+
Controller8("skills"),
|
|
2650
|
+
_ts_param13(0, Inject13(AGENT_ACTOR_RESOLVER7)),
|
|
2651
|
+
_ts_param13(1, Optional6()),
|
|
2652
|
+
_ts_param13(1, Inject13(AGENT_SKILLS2)),
|
|
2653
|
+
_ts_metadata14("design:type", Function),
|
|
2654
|
+
_ts_metadata14("design:paramtypes", [
|
|
2510
2655
|
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2511
2656
|
Object
|
|
2512
2657
|
])
|
|
2513
2658
|
], SkillsController);
|
|
2514
2659
|
|
|
2515
2660
|
// src/controller/threads.controller.ts
|
|
2516
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2517
|
-
import { Body as Body3, Controller as
|
|
2518
|
-
function
|
|
2661
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER8 } from "@dudousxd/nestjs-agent-core";
|
|
2662
|
+
import { Body as Body3, Controller as Controller9, Delete as Delete2, Get as Get8, Inject as Inject14, Param as Param4, Patch, Post as Post4, Req as Req8 } from "@nestjs/common";
|
|
2663
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
2519
2664
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2520
2665
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2521
2666
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2528,19 +2673,19 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
2528
2673
|
}
|
|
2529
2674
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2530
2675
|
}
|
|
2531
|
-
__name(
|
|
2532
|
-
function
|
|
2676
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
2677
|
+
function _ts_metadata15(metadataKey, metadataValue) {
|
|
2533
2678
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2534
2679
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2535
2680
|
}
|
|
2536
2681
|
}
|
|
2537
|
-
__name(
|
|
2538
|
-
function
|
|
2682
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
2683
|
+
function _ts_param14(paramIndex, decorator) {
|
|
2539
2684
|
return function(target, key) {
|
|
2540
2685
|
decorator(target, key, paramIndex);
|
|
2541
2686
|
};
|
|
2542
2687
|
}
|
|
2543
|
-
__name(
|
|
2688
|
+
__name(_ts_param14, "_ts_param");
|
|
2544
2689
|
var ThreadsController = class {
|
|
2545
2690
|
static {
|
|
2546
2691
|
__name(this, "ThreadsController");
|
|
@@ -2583,6 +2728,9 @@ var ThreadsController = class {
|
|
|
2583
2728
|
} : {},
|
|
2584
2729
|
..."defaultAgent" in body ? {
|
|
2585
2730
|
defaultAgent: body.defaultAgent ?? null
|
|
2731
|
+
} : {},
|
|
2732
|
+
..."model" in body ? {
|
|
2733
|
+
model: body.model ?? null
|
|
2586
2734
|
} : {}
|
|
2587
2735
|
});
|
|
2588
2736
|
return {
|
|
@@ -2604,101 +2752,101 @@ var ThreadsController = class {
|
|
|
2604
2752
|
};
|
|
2605
2753
|
}
|
|
2606
2754
|
};
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2755
|
+
_ts_decorate16([
|
|
2756
|
+
Get8(),
|
|
2757
|
+
_ts_param14(0, Req8()),
|
|
2758
|
+
_ts_metadata15("design:type", Function),
|
|
2759
|
+
_ts_metadata15("design:paramtypes", [
|
|
2612
2760
|
typeof Request === "undefined" ? Object : Request
|
|
2613
2761
|
]),
|
|
2614
|
-
|
|
2762
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2615
2763
|
], ThreadsController.prototype, "list", null);
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2764
|
+
_ts_decorate16([
|
|
2765
|
+
Get8(":id"),
|
|
2766
|
+
_ts_param14(0, Req8()),
|
|
2767
|
+
_ts_param14(1, Param4("id")),
|
|
2768
|
+
_ts_metadata15("design:type", Function),
|
|
2769
|
+
_ts_metadata15("design:paramtypes", [
|
|
2622
2770
|
typeof Request === "undefined" ? Object : Request,
|
|
2623
2771
|
String
|
|
2624
2772
|
]),
|
|
2625
|
-
|
|
2773
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2626
2774
|
], ThreadsController.prototype, "detail", null);
|
|
2627
|
-
|
|
2775
|
+
_ts_decorate16([
|
|
2628
2776
|
Delete2(":id"),
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2777
|
+
_ts_param14(0, Req8()),
|
|
2778
|
+
_ts_param14(1, Param4("id")),
|
|
2779
|
+
_ts_metadata15("design:type", Function),
|
|
2780
|
+
_ts_metadata15("design:paramtypes", [
|
|
2633
2781
|
typeof Request === "undefined" ? Object : Request,
|
|
2634
2782
|
String
|
|
2635
2783
|
]),
|
|
2636
|
-
|
|
2784
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2637
2785
|
], ThreadsController.prototype, "remove", null);
|
|
2638
|
-
|
|
2786
|
+
_ts_decorate16([
|
|
2639
2787
|
Post4(":id/fork-from/:messageId"),
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2788
|
+
_ts_param14(0, Req8()),
|
|
2789
|
+
_ts_param14(1, Param4("id")),
|
|
2790
|
+
_ts_param14(2, Param4("messageId")),
|
|
2791
|
+
_ts_metadata15("design:type", Function),
|
|
2792
|
+
_ts_metadata15("design:paramtypes", [
|
|
2645
2793
|
typeof Request === "undefined" ? Object : Request,
|
|
2646
2794
|
String,
|
|
2647
2795
|
String
|
|
2648
2796
|
]),
|
|
2649
|
-
|
|
2797
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2650
2798
|
], ThreadsController.prototype, "fork", null);
|
|
2651
|
-
|
|
2799
|
+
_ts_decorate16([
|
|
2652
2800
|
Patch(":id"),
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2801
|
+
_ts_param14(0, Req8()),
|
|
2802
|
+
_ts_param14(1, Param4("id")),
|
|
2803
|
+
_ts_param14(2, Body3()),
|
|
2804
|
+
_ts_metadata15("design:type", Function),
|
|
2805
|
+
_ts_metadata15("design:paramtypes", [
|
|
2658
2806
|
typeof Request === "undefined" ? Object : Request,
|
|
2659
2807
|
String,
|
|
2660
2808
|
typeof UpdateThreadBody === "undefined" ? Object : UpdateThreadBody
|
|
2661
2809
|
]),
|
|
2662
|
-
|
|
2810
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2663
2811
|
], ThreadsController.prototype, "update", null);
|
|
2664
|
-
|
|
2812
|
+
_ts_decorate16([
|
|
2665
2813
|
Post4(":id/promote"),
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2814
|
+
_ts_param14(0, Req8()),
|
|
2815
|
+
_ts_param14(1, Param4("id")),
|
|
2816
|
+
_ts_metadata15("design:type", Function),
|
|
2817
|
+
_ts_metadata15("design:paramtypes", [
|
|
2670
2818
|
typeof Request === "undefined" ? Object : Request,
|
|
2671
2819
|
String
|
|
2672
2820
|
]),
|
|
2673
|
-
|
|
2821
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2674
2822
|
], ThreadsController.prototype, "promote", null);
|
|
2675
|
-
|
|
2823
|
+
_ts_decorate16([
|
|
2676
2824
|
Delete2(":id/from/:messageId"),
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2825
|
+
_ts_param14(0, Req8()),
|
|
2826
|
+
_ts_param14(1, Param4("id")),
|
|
2827
|
+
_ts_param14(2, Param4("messageId")),
|
|
2828
|
+
_ts_metadata15("design:type", Function),
|
|
2829
|
+
_ts_metadata15("design:paramtypes", [
|
|
2682
2830
|
typeof Request === "undefined" ? Object : Request,
|
|
2683
2831
|
String,
|
|
2684
2832
|
String
|
|
2685
2833
|
]),
|
|
2686
|
-
|
|
2834
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2687
2835
|
], ThreadsController.prototype, "truncateFrom", null);
|
|
2688
|
-
ThreadsController =
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2836
|
+
ThreadsController = _ts_decorate16([
|
|
2837
|
+
Controller9("threads"),
|
|
2838
|
+
_ts_param14(1, Inject14(AGENT_ACTOR_RESOLVER8)),
|
|
2839
|
+
_ts_metadata15("design:type", Function),
|
|
2840
|
+
_ts_metadata15("design:paramtypes", [
|
|
2693
2841
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2694
2842
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2695
2843
|
])
|
|
2696
2844
|
], ThreadsController);
|
|
2697
2845
|
|
|
2698
2846
|
// src/controller/tool-call.controller.ts
|
|
2699
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2700
|
-
import { BadRequestException as BadRequestException4, Body as Body4, Controller as
|
|
2701
|
-
function
|
|
2847
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER9 } from "@dudousxd/nestjs-agent-core";
|
|
2848
|
+
import { BadRequestException as BadRequestException4, Body as Body4, Controller as Controller10, Inject as Inject15, Post as Post5, Req as Req9 } from "@nestjs/common";
|
|
2849
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
2702
2850
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2703
2851
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2704
2852
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2711,19 +2859,19 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
2711
2859
|
}
|
|
2712
2860
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2713
2861
|
}
|
|
2714
|
-
__name(
|
|
2715
|
-
function
|
|
2862
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
2863
|
+
function _ts_metadata16(metadataKey, metadataValue) {
|
|
2716
2864
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2717
2865
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2718
2866
|
}
|
|
2719
2867
|
}
|
|
2720
|
-
__name(
|
|
2721
|
-
function
|
|
2868
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
2869
|
+
function _ts_param15(paramIndex, decorator) {
|
|
2722
2870
|
return function(target, key) {
|
|
2723
2871
|
decorator(target, key, paramIndex);
|
|
2724
2872
|
};
|
|
2725
2873
|
}
|
|
2726
|
-
__name(
|
|
2874
|
+
__name(_ts_param15, "_ts_param");
|
|
2727
2875
|
var MAX_ANSWERED_QUESTIONS = 100;
|
|
2728
2876
|
var MAX_VALUES_PER_QUESTION = 100;
|
|
2729
2877
|
var MAX_ANSWER_VALUE_LENGTH = 4096;
|
|
@@ -2852,64 +3000,64 @@ var ToolCallController = class {
|
|
|
2852
3000
|
};
|
|
2853
3001
|
}
|
|
2854
3002
|
};
|
|
2855
|
-
|
|
3003
|
+
_ts_decorate17([
|
|
2856
3004
|
Post5("approve"),
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
3005
|
+
_ts_param15(0, Req9()),
|
|
3006
|
+
_ts_param15(1, Body4()),
|
|
3007
|
+
_ts_metadata16("design:type", Function),
|
|
3008
|
+
_ts_metadata16("design:paramtypes", [
|
|
2861
3009
|
typeof Request === "undefined" ? Object : Request,
|
|
2862
3010
|
typeof ApproveBody === "undefined" ? Object : ApproveBody
|
|
2863
3011
|
]),
|
|
2864
|
-
|
|
3012
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2865
3013
|
], ToolCallController.prototype, "approve", null);
|
|
2866
|
-
|
|
3014
|
+
_ts_decorate17([
|
|
2867
3015
|
Post5("reject"),
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
3016
|
+
_ts_param15(0, Req9()),
|
|
3017
|
+
_ts_param15(1, Body4()),
|
|
3018
|
+
_ts_metadata16("design:type", Function),
|
|
3019
|
+
_ts_metadata16("design:paramtypes", [
|
|
2872
3020
|
typeof Request === "undefined" ? Object : Request,
|
|
2873
3021
|
typeof RejectBody === "undefined" ? Object : RejectBody
|
|
2874
3022
|
]),
|
|
2875
|
-
|
|
3023
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2876
3024
|
], ToolCallController.prototype, "reject", null);
|
|
2877
|
-
|
|
3025
|
+
_ts_decorate17([
|
|
2878
3026
|
Post5("answer"),
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
3027
|
+
_ts_param15(0, Req9()),
|
|
3028
|
+
_ts_param15(1, Body4()),
|
|
3029
|
+
_ts_metadata16("design:type", Function),
|
|
3030
|
+
_ts_metadata16("design:paramtypes", [
|
|
2883
3031
|
typeof Request === "undefined" ? Object : Request,
|
|
2884
3032
|
typeof AnswerBody === "undefined" ? Object : AnswerBody
|
|
2885
3033
|
]),
|
|
2886
|
-
|
|
3034
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2887
3035
|
], ToolCallController.prototype, "answer", null);
|
|
2888
|
-
|
|
3036
|
+
_ts_decorate17([
|
|
2889
3037
|
Post5("skip"),
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
3038
|
+
_ts_param15(0, Req9()),
|
|
3039
|
+
_ts_param15(1, Body4()),
|
|
3040
|
+
_ts_metadata16("design:type", Function),
|
|
3041
|
+
_ts_metadata16("design:paramtypes", [
|
|
2894
3042
|
typeof Request === "undefined" ? Object : Request,
|
|
2895
3043
|
Object
|
|
2896
3044
|
]),
|
|
2897
|
-
|
|
3045
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2898
3046
|
], ToolCallController.prototype, "skip", null);
|
|
2899
|
-
ToolCallController =
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
3047
|
+
ToolCallController = _ts_decorate17([
|
|
3048
|
+
Controller10("tool-call"),
|
|
3049
|
+
_ts_param15(1, Inject15(AGENT_ACTOR_RESOLVER9)),
|
|
3050
|
+
_ts_metadata16("design:type", Function),
|
|
3051
|
+
_ts_metadata16("design:paramtypes", [
|
|
2904
3052
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2905
3053
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2906
3054
|
])
|
|
2907
3055
|
], ToolCallController);
|
|
2908
3056
|
|
|
2909
3057
|
// src/controller/tools.controller.ts
|
|
2910
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2911
|
-
import { Controller as
|
|
2912
|
-
function
|
|
3058
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER10, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY5, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
|
|
3059
|
+
import { Controller as Controller11, Get as Get9, Inject as Inject16, NotFoundException as NotFoundException3, Query as Query5, Req as Req10 } from "@nestjs/common";
|
|
3060
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2913
3061
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2914
3062
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2915
3063
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2922,19 +3070,19 @@ function _ts_decorate17(decorators, target, key, desc) {
|
|
|
2922
3070
|
}
|
|
2923
3071
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2924
3072
|
}
|
|
2925
|
-
__name(
|
|
2926
|
-
function
|
|
3073
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
3074
|
+
function _ts_metadata17(metadataKey, metadataValue) {
|
|
2927
3075
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2928
3076
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2929
3077
|
}
|
|
2930
3078
|
}
|
|
2931
|
-
__name(
|
|
2932
|
-
function
|
|
3079
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
3080
|
+
function _ts_param16(paramIndex, decorator) {
|
|
2933
3081
|
return function(target, key) {
|
|
2934
3082
|
decorator(target, key, paramIndex);
|
|
2935
3083
|
};
|
|
2936
3084
|
}
|
|
2937
|
-
__name(
|
|
3085
|
+
__name(_ts_param16, "_ts_param");
|
|
2938
3086
|
var ToolsController = class {
|
|
2939
3087
|
static {
|
|
2940
3088
|
__name(this, "ToolsController");
|
|
@@ -2963,24 +3111,24 @@ var ToolsController = class {
|
|
|
2963
3111
|
}));
|
|
2964
3112
|
}
|
|
2965
3113
|
};
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
3114
|
+
_ts_decorate18([
|
|
3115
|
+
Get9(),
|
|
3116
|
+
_ts_param16(0, Req10()),
|
|
3117
|
+
_ts_param16(1, Query5("agent")),
|
|
3118
|
+
_ts_metadata17("design:type", Function),
|
|
3119
|
+
_ts_metadata17("design:paramtypes", [
|
|
2972
3120
|
typeof Request === "undefined" ? Object : Request,
|
|
2973
3121
|
String
|
|
2974
3122
|
]),
|
|
2975
|
-
|
|
3123
|
+
_ts_metadata17("design:returntype", Promise)
|
|
2976
3124
|
], ToolsController.prototype, "list", null);
|
|
2977
|
-
ToolsController =
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
3125
|
+
ToolsController = _ts_decorate18([
|
|
3126
|
+
Controller11("tools"),
|
|
3127
|
+
_ts_param16(0, Inject16(AGENT_ACTOR_RESOLVER10)),
|
|
3128
|
+
_ts_param16(1, Inject16(AGENT_DEPS_FACTORY5)),
|
|
3129
|
+
_ts_param16(2, Inject16(AGENT_REGISTRY3)),
|
|
3130
|
+
_ts_metadata17("design:type", Function),
|
|
3131
|
+
_ts_metadata17("design:paramtypes", [
|
|
2984
3132
|
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2985
3133
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
2986
3134
|
typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4
|
|
@@ -2989,7 +3137,7 @@ ToolsController = _ts_decorate17([
|
|
|
2989
3137
|
|
|
2990
3138
|
// src/discovery/agent-discovery.service.ts
|
|
2991
3139
|
import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as AGENT_REGISTRY4, AgentRegistry as AgentRegistry5 } from "@dudousxd/nestjs-agent-core";
|
|
2992
|
-
import { Inject as
|
|
3140
|
+
import { Inject as Inject17, Injectable as Injectable7, Logger as Logger2 } from "@nestjs/common";
|
|
2993
3141
|
import { DiscoveryService, MetadataScanner } from "@nestjs/core";
|
|
2994
3142
|
|
|
2995
3143
|
// src/decorator/agent.decorator.ts
|
|
@@ -3006,7 +3154,7 @@ var SYSTEM_PROMPT_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:
|
|
|
3006
3154
|
var SYSTEM_PROMPT_CONTRIBUTOR_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:system-prompt-contributor");
|
|
3007
3155
|
|
|
3008
3156
|
// src/discovery/agent-discovery.service.ts
|
|
3009
|
-
function
|
|
3157
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
3010
3158
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3011
3159
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3012
3160
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3019,19 +3167,19 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
3019
3167
|
}
|
|
3020
3168
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3021
3169
|
}
|
|
3022
|
-
__name(
|
|
3023
|
-
function
|
|
3170
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3171
|
+
function _ts_metadata18(metadataKey, metadataValue) {
|
|
3024
3172
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3025
3173
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3026
3174
|
}
|
|
3027
3175
|
}
|
|
3028
|
-
__name(
|
|
3029
|
-
function
|
|
3176
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3177
|
+
function _ts_param17(paramIndex, decorator) {
|
|
3030
3178
|
return function(target, key) {
|
|
3031
3179
|
decorator(target, key, paramIndex);
|
|
3032
3180
|
};
|
|
3033
3181
|
}
|
|
3034
|
-
__name(
|
|
3182
|
+
__name(_ts_param17, "_ts_param");
|
|
3035
3183
|
var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
3036
3184
|
static {
|
|
3037
3185
|
__name(this, "AgentDiscoveryService");
|
|
@@ -3158,12 +3306,12 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
3158
3306
|
return (ctx) => candidate.call(instance, ctx);
|
|
3159
3307
|
}
|
|
3160
3308
|
};
|
|
3161
|
-
AgentDiscoveryService =
|
|
3309
|
+
AgentDiscoveryService = _ts_decorate19([
|
|
3162
3310
|
Injectable7(),
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3311
|
+
_ts_param17(2, Inject17(AGENT_REGISTRY4)),
|
|
3312
|
+
_ts_param17(3, Inject17(AGENT_PROMPT_CONTRIBUTORS2)),
|
|
3313
|
+
_ts_metadata18("design:type", Function),
|
|
3314
|
+
_ts_metadata18("design:paramtypes", [
|
|
3167
3315
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
3168
3316
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
3169
3317
|
typeof AgentRegistry5 === "undefined" ? Object : AgentRegistry5,
|
|
@@ -3173,7 +3321,7 @@ AgentDiscoveryService = _ts_decorate18([
|
|
|
3173
3321
|
|
|
3174
3322
|
// src/discovery/ai-tool-discovery.service.ts
|
|
3175
3323
|
import { AGENT_OPTIONS as AGENT_OPTIONS3, AGENT_REGISTRY as AGENT_REGISTRY5, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY2, normalizeDelegation as normalizeDelegation2 } from "@dudousxd/nestjs-agent-core";
|
|
3176
|
-
import { Inject as
|
|
3324
|
+
import { Inject as Inject18, Injectable as Injectable8, Logger as Logger3 } from "@nestjs/common";
|
|
3177
3325
|
import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
|
|
3178
3326
|
import { z } from "zod";
|
|
3179
3327
|
|
|
@@ -3193,7 +3341,7 @@ function isBrandedFunctionalTool(value) {
|
|
|
3193
3341
|
__name(isBrandedFunctionalTool, "isBrandedFunctionalTool");
|
|
3194
3342
|
|
|
3195
3343
|
// src/discovery/ai-tool-discovery.service.ts
|
|
3196
|
-
function
|
|
3344
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
3197
3345
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3198
3346
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3199
3347
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3206,19 +3354,19 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
3206
3354
|
}
|
|
3207
3355
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3208
3356
|
}
|
|
3209
|
-
__name(
|
|
3210
|
-
function
|
|
3357
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3358
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
3211
3359
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3212
3360
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3213
3361
|
}
|
|
3214
3362
|
}
|
|
3215
|
-
__name(
|
|
3216
|
-
function
|
|
3363
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
3364
|
+
function _ts_param18(paramIndex, decorator) {
|
|
3217
3365
|
return function(target, key) {
|
|
3218
3366
|
decorator(target, key, paramIndex);
|
|
3219
3367
|
};
|
|
3220
3368
|
}
|
|
3221
|
-
__name(
|
|
3369
|
+
__name(_ts_param18, "_ts_param");
|
|
3222
3370
|
var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
3223
3371
|
static {
|
|
3224
3372
|
__name(this, "AiToolDiscoveryService");
|
|
@@ -3351,13 +3499,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
3351
3499
|
return true;
|
|
3352
3500
|
}
|
|
3353
3501
|
};
|
|
3354
|
-
AiToolDiscoveryService =
|
|
3502
|
+
AiToolDiscoveryService = _ts_decorate20([
|
|
3355
3503
|
Injectable8(),
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3504
|
+
_ts_param18(1, Inject18(AGENT_TOOL_REGISTRY2)),
|
|
3505
|
+
_ts_param18(2, Inject18(AGENT_REGISTRY5)),
|
|
3506
|
+
_ts_param18(3, Inject18(AGENT_OPTIONS3)),
|
|
3507
|
+
_ts_metadata19("design:type", Function),
|
|
3508
|
+
_ts_metadata19("design:paramtypes", [
|
|
3361
3509
|
typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
|
|
3362
3510
|
typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
|
|
3363
3511
|
typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
|
|
@@ -3367,7 +3515,7 @@ AiToolDiscoveryService = _ts_decorate19([
|
|
|
3367
3515
|
|
|
3368
3516
|
// src/discovery/skill-discovery.service.ts
|
|
3369
3517
|
import { AGENT_SKILL_SOURCES } from "@dudousxd/nestjs-agent-core";
|
|
3370
|
-
import { Inject as
|
|
3518
|
+
import { Inject as Inject19, Injectable as Injectable9, Logger as Logger4 } from "@nestjs/common";
|
|
3371
3519
|
import { DiscoveryService as DiscoveryService3 } from "@nestjs/core";
|
|
3372
3520
|
|
|
3373
3521
|
// src/decorator/skill.decorator.ts
|
|
@@ -3384,7 +3532,7 @@ function skillScope(options) {
|
|
|
3384
3532
|
__name(skillScope, "skillScope");
|
|
3385
3533
|
|
|
3386
3534
|
// src/discovery/skill-discovery.service.ts
|
|
3387
|
-
function
|
|
3535
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
3388
3536
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3389
3537
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3390
3538
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3397,19 +3545,19 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
3397
3545
|
}
|
|
3398
3546
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3399
3547
|
}
|
|
3400
|
-
__name(
|
|
3401
|
-
function
|
|
3548
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3549
|
+
function _ts_metadata20(metadataKey, metadataValue) {
|
|
3402
3550
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3403
3551
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3404
3552
|
}
|
|
3405
3553
|
}
|
|
3406
|
-
__name(
|
|
3407
|
-
function
|
|
3554
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
3555
|
+
function _ts_param19(paramIndex, decorator) {
|
|
3408
3556
|
return function(target, key) {
|
|
3409
3557
|
decorator(target, key, paramIndex);
|
|
3410
3558
|
};
|
|
3411
3559
|
}
|
|
3412
|
-
__name(
|
|
3560
|
+
__name(_ts_param19, "_ts_param");
|
|
3413
3561
|
var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
3414
3562
|
static {
|
|
3415
3563
|
__name(this, "SkillDiscoveryService");
|
|
@@ -3453,11 +3601,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
|
3453
3601
|
return flat === void 0 ? void 0 : () => flat;
|
|
3454
3602
|
}
|
|
3455
3603
|
};
|
|
3456
|
-
SkillDiscoveryService =
|
|
3604
|
+
SkillDiscoveryService = _ts_decorate21([
|
|
3457
3605
|
Injectable9(),
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3606
|
+
_ts_param19(1, Inject19(AGENT_SKILL_SOURCES)),
|
|
3607
|
+
_ts_metadata20("design:type", Function),
|
|
3608
|
+
_ts_metadata20("design:paramtypes", [
|
|
3461
3609
|
typeof DiscoveryService3 === "undefined" ? Object : DiscoveryService3,
|
|
3462
3610
|
Array
|
|
3463
3611
|
])
|
|
@@ -3488,8 +3636,8 @@ var LedgerQuotaStore = class {
|
|
|
3488
3636
|
|
|
3489
3637
|
// src/runner/inline-agent-runner.ts
|
|
3490
3638
|
import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY6, AGENT_STORE as AGENT_STORE5, RunCancelledError as RunCancelledError2, agentFailureCode as agentFailureCode2, encodeStreamEvent as encodeStreamEvent3, publishAgentRunFailed as publishAgentRunFailed2, runAgentLoop as runAgentLoop2, settleAll as settleAll2, settleUnsettledDelegation as settleUnsettledDelegation2 } from "@dudousxd/nestjs-agent-core";
|
|
3491
|
-
import { Inject as
|
|
3492
|
-
function
|
|
3639
|
+
import { Inject as Inject20, Injectable as Injectable10, Logger as Logger5 } from "@nestjs/common";
|
|
3640
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
3493
3641
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3494
3642
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3495
3643
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3502,19 +3650,19 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
3502
3650
|
}
|
|
3503
3651
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3504
3652
|
}
|
|
3505
|
-
__name(
|
|
3506
|
-
function
|
|
3653
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
3654
|
+
function _ts_metadata21(metadataKey, metadataValue) {
|
|
3507
3655
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3508
3656
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3509
3657
|
}
|
|
3510
3658
|
}
|
|
3511
|
-
__name(
|
|
3512
|
-
function
|
|
3659
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
3660
|
+
function _ts_param20(paramIndex, decorator) {
|
|
3513
3661
|
return function(target, key) {
|
|
3514
3662
|
decorator(target, key, paramIndex);
|
|
3515
3663
|
};
|
|
3516
3664
|
}
|
|
3517
|
-
__name(
|
|
3665
|
+
__name(_ts_param20, "_ts_param");
|
|
3518
3666
|
var InlineAgentRunner = class _InlineAgentRunner {
|
|
3519
3667
|
static {
|
|
3520
3668
|
__name(this, "InlineAgentRunner");
|
|
@@ -3895,12 +4043,12 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3895
4043
|
}
|
|
3896
4044
|
}
|
|
3897
4045
|
};
|
|
3898
|
-
InlineAgentRunner =
|
|
4046
|
+
InlineAgentRunner = _ts_decorate22([
|
|
3899
4047
|
Injectable10(),
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
4048
|
+
_ts_param20(0, Inject20(AGENT_DEPS_FACTORY6)),
|
|
4049
|
+
_ts_param20(1, Inject20(AGENT_STORE5)),
|
|
4050
|
+
_ts_metadata21("design:type", Function),
|
|
4051
|
+
_ts_metadata21("design:paramtypes", [
|
|
3904
4052
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
3905
4053
|
typeof AgentStore === "undefined" ? Object : AgentStore
|
|
3906
4054
|
])
|
|
@@ -3945,7 +4093,7 @@ function resolveSkillsConfig(options, declared) {
|
|
|
3945
4093
|
__name(resolveSkillsConfig, "resolveSkillsConfig");
|
|
3946
4094
|
|
|
3947
4095
|
// src/agent.module.ts
|
|
3948
|
-
function
|
|
4096
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
3949
4097
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3950
4098
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3951
4099
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3958,7 +4106,7 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
3958
4106
|
}
|
|
3959
4107
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3960
4108
|
}
|
|
3961
|
-
__name(
|
|
4109
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
3962
4110
|
var DEFAULT_PATH = "agent";
|
|
3963
4111
|
function sharedProviders(durable, includeStore) {
|
|
3964
4112
|
const providers = [
|
|
@@ -4017,7 +4165,7 @@ function sharedProviders(durable, includeStore) {
|
|
|
4017
4165
|
]
|
|
4018
4166
|
},
|
|
4019
4167
|
{
|
|
4020
|
-
provide:
|
|
4168
|
+
provide: AGENT_ACTOR_RESOLVER11,
|
|
4021
4169
|
useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
|
|
4022
4170
|
inject: [
|
|
4023
4171
|
AGENT_OPTIONS4
|
|
@@ -4041,6 +4189,13 @@ function sharedProviders(durable, includeStore) {
|
|
|
4041
4189
|
AGENT_STORE6
|
|
4042
4190
|
]
|
|
4043
4191
|
},
|
|
4192
|
+
{
|
|
4193
|
+
provide: AGENT_MODEL_CATALOG2,
|
|
4194
|
+
useFactory: /* @__PURE__ */ __name((o) => o.models, "useFactory"),
|
|
4195
|
+
inject: [
|
|
4196
|
+
AGENT_OPTIONS4
|
|
4197
|
+
]
|
|
4198
|
+
},
|
|
4044
4199
|
AgentDepsFactory2,
|
|
4045
4200
|
{
|
|
4046
4201
|
provide: AGENT_DEPS_FACTORY7,
|
|
@@ -4102,12 +4257,13 @@ function exportsFor(includeStore) {
|
|
|
4102
4257
|
AGENT_REGISTRY6,
|
|
4103
4258
|
AGENT_SINK3,
|
|
4104
4259
|
AGENT_ROLES_POLICY2,
|
|
4105
|
-
|
|
4260
|
+
AGENT_ACTOR_RESOLVER11,
|
|
4106
4261
|
AGENT_MODEL2,
|
|
4107
4262
|
...includeStore ? [
|
|
4108
4263
|
AGENT_STORE6
|
|
4109
4264
|
] : [],
|
|
4110
4265
|
AGENT_QUOTA_STORE3,
|
|
4266
|
+
AGENT_MODEL_CATALOG2,
|
|
4111
4267
|
AGENT_PROMPT_CONTRIBUTORS3,
|
|
4112
4268
|
AGENT_SKILLS3,
|
|
4113
4269
|
AGENT_MEMORY3,
|
|
@@ -4128,7 +4284,8 @@ var BASE_CONTROLLERS = [
|
|
|
4128
4284
|
SkillsController,
|
|
4129
4285
|
MemoriesController,
|
|
4130
4286
|
ToolsController,
|
|
4131
|
-
MessagesController
|
|
4287
|
+
MessagesController,
|
|
4288
|
+
ModelsController
|
|
4132
4289
|
];
|
|
4133
4290
|
var GUARDABLE_CONTROLLERS = [
|
|
4134
4291
|
...BASE_CONTROLLERS,
|
|
@@ -4231,7 +4388,7 @@ var AgentModule = class _AgentModule {
|
|
|
4231
4388
|
};
|
|
4232
4389
|
}
|
|
4233
4390
|
};
|
|
4234
|
-
AgentModule =
|
|
4391
|
+
AgentModule = _ts_decorate23([
|
|
4235
4392
|
Global2(),
|
|
4236
4393
|
Module2({})
|
|
4237
4394
|
], AgentModule);
|