@dudousxd/nestjs-agent 1.5.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 +49 -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 +622 -319
- 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 +531 -228
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +626 -322
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +67 -5
- package/dist/index.d.ts +67 -5
- package/dist/index.js +529 -227
- 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
|
}
|
|
@@ -1393,6 +1463,40 @@ var AgentService = class {
|
|
|
1393
1463
|
return this.store.truncateFrom(threadId, messageId);
|
|
1394
1464
|
}
|
|
1395
1465
|
/**
|
|
1466
|
+
* Rate a message in one of `actor`'s threads: `'up'`/`'down'` with an optional comment, or `null`
|
|
1467
|
+
* to clear the rating. Answers `404` for an unknown message, `403` for another actor's, and `501`
|
|
1468
|
+
* on a store without `threadOfMessage` + `setMessageFeedback`.
|
|
1469
|
+
*/
|
|
1470
|
+
async setMessageFeedback(actor, messageId, input) {
|
|
1471
|
+
if (input.value !== null && input.value !== "up" && input.value !== "down") {
|
|
1472
|
+
throw new BadRequestException("value must be 'up', 'down' or null");
|
|
1473
|
+
}
|
|
1474
|
+
if (input.comment !== void 0 && typeof input.comment !== "string") {
|
|
1475
|
+
throw new BadRequestException("comment must be a string");
|
|
1476
|
+
}
|
|
1477
|
+
const comment = input.comment?.trim();
|
|
1478
|
+
if (comment !== void 0 && comment.length > 2e3) {
|
|
1479
|
+
throw new BadRequestException("comment must be at most 2000 characters");
|
|
1480
|
+
}
|
|
1481
|
+
if (this.store.threadOfMessage === void 0 || this.store.setMessageFeedback === void 0) {
|
|
1482
|
+
throw new NotImplementedException("Message feedback requires an AgentStore that implements threadOfMessage() and setMessageFeedback(); the bound store does not support it.");
|
|
1483
|
+
}
|
|
1484
|
+
const threadId = await this.store.threadOfMessage(messageId);
|
|
1485
|
+
if (threadId === null) {
|
|
1486
|
+
throw new NotFoundException(`message ${messageId} not found`);
|
|
1487
|
+
}
|
|
1488
|
+
await this.assertOwnsThread(actor, threadId);
|
|
1489
|
+
const feedback = input.value === null ? null : {
|
|
1490
|
+
value: input.value,
|
|
1491
|
+
...comment !== void 0 && comment.length > 0 ? {
|
|
1492
|
+
comment
|
|
1493
|
+
} : {},
|
|
1494
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1495
|
+
};
|
|
1496
|
+
await this.store.setMessageFeedback(messageId, feedback);
|
|
1497
|
+
return feedback;
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1396
1500
|
* Every file this actor has staged, newest first — across threads, including uploads that were
|
|
1397
1501
|
* never sent, which nothing else on this surface can see.
|
|
1398
1502
|
*
|
|
@@ -1599,13 +1703,16 @@ AgentService = _ts_decorate6([
|
|
|
1599
1703
|
_ts_param5(3, Inject5(AGENT_QUOTA_STORE2)),
|
|
1600
1704
|
_ts_param5(4, Optional3()),
|
|
1601
1705
|
_ts_param5(4, Inject5(AGENT_ATTACHMENT_STAGING)),
|
|
1706
|
+
_ts_param5(5, Optional3()),
|
|
1707
|
+
_ts_param5(5, Inject5(AGENT_MODEL_CATALOG)),
|
|
1602
1708
|
_ts_metadata5("design:type", Function),
|
|
1603
1709
|
_ts_metadata5("design:paramtypes", [
|
|
1604
1710
|
typeof AgentRunner === "undefined" ? Object : AgentRunner,
|
|
1605
1711
|
typeof AgentStore === "undefined" ? Object : AgentStore,
|
|
1606
1712
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
1607
1713
|
Object,
|
|
1608
|
-
typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore
|
|
1714
|
+
typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore,
|
|
1715
|
+
typeof ModelCatalog === "undefined" ? Object : ModelCatalog
|
|
1609
1716
|
])
|
|
1610
1717
|
], AgentService);
|
|
1611
1718
|
|
|
@@ -1892,7 +1999,7 @@ AttachmentsController = _ts_decorate9([
|
|
|
1892
1999
|
|
|
1893
2000
|
// src/controller/chat.controller.ts
|
|
1894
2001
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER2, AgentStreamError as AgentStreamError2 } from "@dudousxd/nestjs-agent-core";
|
|
1895
|
-
import { BadRequestException as BadRequestException3, Body, Controller as Controller3, Get as Get3, Inject as Inject8, Param, Post as Post2, Req as Req2, Res } from "@nestjs/common";
|
|
2002
|
+
import { BadRequestException as BadRequestException3, Body, Controller as Controller3, Get as Get3, Inject as Inject8, Param, Post as Post2, Query, Req as Req2, Res } from "@nestjs/common";
|
|
1896
2003
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
1897
2004
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1898
2005
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -1977,13 +2084,22 @@ var ChatController = class {
|
|
|
1977
2084
|
} : {},
|
|
1978
2085
|
...body.transient === true ? {
|
|
1979
2086
|
transient: true
|
|
2087
|
+
} : {},
|
|
2088
|
+
...typeof body.model === "string" && body.model.length > 0 ? {
|
|
2089
|
+
model: body.model
|
|
1980
2090
|
} : {}
|
|
1981
2091
|
});
|
|
1982
2092
|
await this.pipe(res, runId, this.agent.subscribe(runId), threadId);
|
|
1983
2093
|
}
|
|
1984
|
-
|
|
2094
|
+
/**
|
|
2095
|
+
* Attach to a run's stream: every buffered frame, then live ones. `?after=<seq>` (or the SSE
|
|
2096
|
+
* `Last-Event-ID` header a browser `EventSource` sends on its own) skips the frames a reconnecting
|
|
2097
|
+
* client already has — see {@link pipe} for how frames are numbered.
|
|
2098
|
+
*/
|
|
2099
|
+
async stream(req, runId, res, after) {
|
|
1985
2100
|
const actor = await this.actorResolver.resolve(req);
|
|
1986
|
-
|
|
2101
|
+
const cursor = parseCursor(after) ?? parseCursor(req.headers["last-event-id"]) ?? 0;
|
|
2102
|
+
await this.pipe(res, runId, await this.agent.subscribeAs(actor, runId), void 0, cursor);
|
|
1987
2103
|
}
|
|
1988
2104
|
async cancel(req, runId) {
|
|
1989
2105
|
const actor = await this.actorResolver.resolve(req);
|
|
@@ -1992,7 +2108,15 @@ var ChatController = class {
|
|
|
1992
2108
|
aborted: true
|
|
1993
2109
|
};
|
|
1994
2110
|
}
|
|
1995
|
-
|
|
2111
|
+
/**
|
|
2112
|
+
* Every `data:` frame carries an SSE `id:` — its 1-based sequence number within the run. The
|
|
2113
|
+
* number is a pure function of the run's buffered stream (every sink replays a run from its first
|
|
2114
|
+
* chunk, in write order), so the same frame gets the same number on the POST that started the run
|
|
2115
|
+
* and on any later `GET …/stream`, whichever replica serves it. A reconnecting client passes the
|
|
2116
|
+
* last one it saw as `?after=`; frames at or below it are read off the sink but not re-sent.
|
|
2117
|
+
* `meta`, `done` and `error` carry no id: `meta` is re-sent on every attach, the terminals once.
|
|
2118
|
+
*/
|
|
2119
|
+
async pipe(res, runId, events, threadId, after = 0) {
|
|
1996
2120
|
res.setHeader("Content-Type", "text/event-stream");
|
|
1997
2121
|
res.setHeader("Cache-Control", "no-cache");
|
|
1998
2122
|
res.setHeader("Connection", "keep-alive");
|
|
@@ -2009,6 +2133,16 @@ data: ${JSON.stringify({
|
|
|
2009
2133
|
`);
|
|
2010
2134
|
const decoder = new TextDecoder();
|
|
2011
2135
|
let buffer = "";
|
|
2136
|
+
let seq = 0;
|
|
2137
|
+
const forward = /* @__PURE__ */ __name((line) => {
|
|
2138
|
+
seq += 1;
|
|
2139
|
+
if (seq > after) {
|
|
2140
|
+
res.write(`id: ${seq}
|
|
2141
|
+
data: ${line}
|
|
2142
|
+
|
|
2143
|
+
`);
|
|
2144
|
+
}
|
|
2145
|
+
}, "forward");
|
|
2012
2146
|
try {
|
|
2013
2147
|
for await (const chunk of events) {
|
|
2014
2148
|
buffer += decoder.decode(chunk, {
|
|
@@ -2019,17 +2153,13 @@ data: ${JSON.stringify({
|
|
|
2019
2153
|
const line = buffer.slice(0, newline);
|
|
2020
2154
|
buffer = buffer.slice(newline + 1);
|
|
2021
2155
|
if (line.length > 0) {
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
`);
|
|
2156
|
+
forward(line);
|
|
2025
2157
|
}
|
|
2026
2158
|
newline = buffer.indexOf("\n");
|
|
2027
2159
|
}
|
|
2028
2160
|
}
|
|
2029
2161
|
if (buffer.length > 0) {
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
`);
|
|
2162
|
+
forward(buffer);
|
|
2033
2163
|
}
|
|
2034
2164
|
res.write("event: done\ndata: {}\n\n");
|
|
2035
2165
|
} catch (error) {
|
|
@@ -2066,11 +2196,13 @@ _ts_decorate10([
|
|
|
2066
2196
|
_ts_param8(0, Req2()),
|
|
2067
2197
|
_ts_param8(1, Param("runId")),
|
|
2068
2198
|
_ts_param8(2, Res()),
|
|
2199
|
+
_ts_param8(3, Query("after")),
|
|
2069
2200
|
_ts_metadata9("design:type", Function),
|
|
2070
2201
|
_ts_metadata9("design:paramtypes", [
|
|
2071
2202
|
typeof Request === "undefined" ? Object : Request,
|
|
2072
2203
|
String,
|
|
2073
|
-
typeof Response === "undefined" ? Object : Response
|
|
2204
|
+
typeof Response === "undefined" ? Object : Response,
|
|
2205
|
+
String
|
|
2074
2206
|
]),
|
|
2075
2207
|
_ts_metadata9("design:returntype", Promise)
|
|
2076
2208
|
], ChatController.prototype, "stream", null);
|
|
@@ -2094,10 +2226,19 @@ ChatController = _ts_decorate10([
|
|
|
2094
2226
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2095
2227
|
])
|
|
2096
2228
|
], ChatController);
|
|
2229
|
+
function parseCursor(raw) {
|
|
2230
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
2231
|
+
if (typeof value !== "string" || !/^\d+$/.test(value.trim())) {
|
|
2232
|
+
return void 0;
|
|
2233
|
+
}
|
|
2234
|
+
const parsed = Number(value.trim());
|
|
2235
|
+
return Number.isSafeInteger(parsed) ? parsed : void 0;
|
|
2236
|
+
}
|
|
2237
|
+
__name(parseCursor, "parseCursor");
|
|
2097
2238
|
|
|
2098
2239
|
// src/controller/memories.controller.ts
|
|
2099
2240
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER3, AGENT_MEMORY as AGENT_MEMORY2, memoryForgetVerdict, offerMemories } from "@dudousxd/nestjs-agent-core";
|
|
2100
|
-
import { Controller as Controller4, Delete, ForbiddenException as ForbiddenException2, Get as Get4, Inject as Inject9, NotFoundException as NotFoundException2, Optional as Optional5, Param as Param2, Query, Req as Req3 } from "@nestjs/common";
|
|
2241
|
+
import { Controller as Controller4, Delete, ForbiddenException as ForbiddenException2, Get as Get4, Inject as Inject9, NotFoundException as NotFoundException2, Optional as Optional5, Param as Param2, Query as Query2, Req as Req3 } from "@nestjs/common";
|
|
2101
2242
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
2102
2243
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2103
2244
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2199,7 +2340,7 @@ var MemoriesController = class {
|
|
|
2199
2340
|
_ts_decorate11([
|
|
2200
2341
|
Get4(),
|
|
2201
2342
|
_ts_param9(0, Req3()),
|
|
2202
|
-
_ts_param9(1,
|
|
2343
|
+
_ts_param9(1, Query2("threadId")),
|
|
2203
2344
|
_ts_metadata10("design:type", Function),
|
|
2204
2345
|
_ts_metadata10("design:paramtypes", [
|
|
2205
2346
|
typeof Request === "undefined" ? Object : Request,
|
|
@@ -2230,9 +2371,9 @@ MemoriesController = _ts_decorate11([
|
|
|
2230
2371
|
])
|
|
2231
2372
|
], MemoriesController);
|
|
2232
2373
|
|
|
2233
|
-
// src/controller/
|
|
2374
|
+
// src/controller/messages.controller.ts
|
|
2234
2375
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER4 } from "@dudousxd/nestjs-agent-core";
|
|
2235
|
-
import {
|
|
2376
|
+
import { Body as Body2, Controller as Controller5, HttpCode, Inject as Inject10, Param as Param3, Post as Post3, Req as Req4 } from "@nestjs/common";
|
|
2236
2377
|
function _ts_decorate12(decorators, target, key, desc) {
|
|
2237
2378
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2238
2379
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2259,9 +2400,9 @@ function _ts_param10(paramIndex, decorator) {
|
|
|
2259
2400
|
};
|
|
2260
2401
|
}
|
|
2261
2402
|
__name(_ts_param10, "_ts_param");
|
|
2262
|
-
var
|
|
2403
|
+
var MessagesController = class {
|
|
2263
2404
|
static {
|
|
2264
|
-
__name(this, "
|
|
2405
|
+
__name(this, "MessagesController");
|
|
2265
2406
|
}
|
|
2266
2407
|
agent;
|
|
2267
2408
|
actorResolver;
|
|
@@ -2269,33 +2410,50 @@ var QuotaController = class {
|
|
|
2269
2410
|
this.agent = agent;
|
|
2270
2411
|
this.actorResolver = actorResolver;
|
|
2271
2412
|
}
|
|
2272
|
-
|
|
2413
|
+
/**
|
|
2414
|
+
* Rate a message: `{ value: 'up' | 'down' | null, comment? }`. Answers the stored rating
|
|
2415
|
+
* (`{ feedback: null }` once cleared). Only the thread's owner may rate its messages.
|
|
2416
|
+
*/
|
|
2417
|
+
async feedback(req, id, body) {
|
|
2273
2418
|
const actor = await this.actorResolver.resolve(req);
|
|
2274
|
-
|
|
2419
|
+
const feedback = await this.agent.setMessageFeedback(actor, id, {
|
|
2420
|
+
value: body?.value ?? null,
|
|
2421
|
+
...body?.comment !== void 0 ? {
|
|
2422
|
+
comment: body.comment
|
|
2423
|
+
} : {}
|
|
2424
|
+
});
|
|
2425
|
+
return {
|
|
2426
|
+
feedback
|
|
2427
|
+
};
|
|
2275
2428
|
}
|
|
2276
2429
|
};
|
|
2277
2430
|
_ts_decorate12([
|
|
2278
|
-
|
|
2431
|
+
Post3(":id/feedback"),
|
|
2432
|
+
HttpCode(200),
|
|
2279
2433
|
_ts_param10(0, Req4()),
|
|
2434
|
+
_ts_param10(1, Param3("id")),
|
|
2435
|
+
_ts_param10(2, Body2()),
|
|
2280
2436
|
_ts_metadata11("design:type", Function),
|
|
2281
2437
|
_ts_metadata11("design:paramtypes", [
|
|
2282
|
-
typeof Request === "undefined" ? Object : Request
|
|
2438
|
+
typeof Request === "undefined" ? Object : Request,
|
|
2439
|
+
String,
|
|
2440
|
+
typeof FeedbackBody === "undefined" ? Object : FeedbackBody
|
|
2283
2441
|
]),
|
|
2284
2442
|
_ts_metadata11("design:returntype", Promise)
|
|
2285
|
-
],
|
|
2286
|
-
|
|
2287
|
-
Controller5("
|
|
2443
|
+
], MessagesController.prototype, "feedback", null);
|
|
2444
|
+
MessagesController = _ts_decorate12([
|
|
2445
|
+
Controller5("messages"),
|
|
2288
2446
|
_ts_param10(1, Inject10(AGENT_ACTOR_RESOLVER4)),
|
|
2289
2447
|
_ts_metadata11("design:type", Function),
|
|
2290
2448
|
_ts_metadata11("design:paramtypes", [
|
|
2291
2449
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2292
2450
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2293
2451
|
])
|
|
2294
|
-
],
|
|
2452
|
+
], MessagesController);
|
|
2295
2453
|
|
|
2296
|
-
// src/controller/
|
|
2297
|
-
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5
|
|
2298
|
-
import { Controller as Controller6, Get as
|
|
2454
|
+
// src/controller/models.controller.ts
|
|
2455
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5 } from "@dudousxd/nestjs-agent-core";
|
|
2456
|
+
import { Controller as Controller6, Get as Get5, Inject as Inject11, Query as Query3, Req as Req5 } from "@nestjs/common";
|
|
2299
2457
|
function _ts_decorate13(decorators, target, key, desc) {
|
|
2300
2458
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2301
2459
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2322,6 +2480,138 @@ function _ts_param11(paramIndex, decorator) {
|
|
|
2322
2480
|
};
|
|
2323
2481
|
}
|
|
2324
2482
|
__name(_ts_param11, "_ts_param");
|
|
2483
|
+
var ModelsController = class {
|
|
2484
|
+
static {
|
|
2485
|
+
__name(this, "ModelsController");
|
|
2486
|
+
}
|
|
2487
|
+
agent;
|
|
2488
|
+
actorResolver;
|
|
2489
|
+
constructor(agent, actorResolver) {
|
|
2490
|
+
this.agent = agent;
|
|
2491
|
+
this.actorResolver = actorResolver;
|
|
2492
|
+
}
|
|
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) {
|
|
2498
|
+
const actor = await this.actorResolver.resolve(req);
|
|
2499
|
+
return this.agent.listModels(actor, agent);
|
|
2500
|
+
}
|
|
2501
|
+
};
|
|
2502
|
+
_ts_decorate13([
|
|
2503
|
+
Get5(),
|
|
2504
|
+
_ts_param11(0, Req5()),
|
|
2505
|
+
_ts_param11(1, Query3("agent")),
|
|
2506
|
+
_ts_metadata12("design:type", Function),
|
|
2507
|
+
_ts_metadata12("design:paramtypes", [
|
|
2508
|
+
typeof Request === "undefined" ? Object : Request,
|
|
2509
|
+
String
|
|
2510
|
+
]),
|
|
2511
|
+
_ts_metadata12("design:returntype", Promise)
|
|
2512
|
+
], ModelsController.prototype, "list", null);
|
|
2513
|
+
ModelsController = _ts_decorate13([
|
|
2514
|
+
Controller6("models"),
|
|
2515
|
+
_ts_param11(1, Inject11(AGENT_ACTOR_RESOLVER5)),
|
|
2516
|
+
_ts_metadata12("design:type", Function),
|
|
2517
|
+
_ts_metadata12("design:paramtypes", [
|
|
2518
|
+
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2519
|
+
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2520
|
+
])
|
|
2521
|
+
], ModelsController);
|
|
2522
|
+
|
|
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";
|
|
2526
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
2527
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2528
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2529
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2530
|
+
} else {
|
|
2531
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2532
|
+
if (d = decorators[i]) {
|
|
2533
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2538
|
+
}
|
|
2539
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
2540
|
+
function _ts_metadata13(metadataKey, metadataValue) {
|
|
2541
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2542
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
2546
|
+
function _ts_param12(paramIndex, decorator) {
|
|
2547
|
+
return function(target, key) {
|
|
2548
|
+
decorator(target, key, paramIndex);
|
|
2549
|
+
};
|
|
2550
|
+
}
|
|
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");
|
|
2325
2615
|
var SkillsController = class {
|
|
2326
2616
|
static {
|
|
2327
2617
|
__name(this, "SkillsController");
|
|
@@ -2344,33 +2634,33 @@ var SkillsController = class {
|
|
|
2344
2634
|
return offer.entries;
|
|
2345
2635
|
}
|
|
2346
2636
|
};
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
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", [
|
|
2353
2643
|
typeof Request === "undefined" ? Object : Request,
|
|
2354
2644
|
String
|
|
2355
2645
|
]),
|
|
2356
|
-
|
|
2646
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2357
2647
|
], SkillsController.prototype, "list", null);
|
|
2358
|
-
SkillsController =
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
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", [
|
|
2365
2655
|
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2366
2656
|
Object
|
|
2367
2657
|
])
|
|
2368
2658
|
], SkillsController);
|
|
2369
2659
|
|
|
2370
2660
|
// src/controller/threads.controller.ts
|
|
2371
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2372
|
-
import { Body as
|
|
2373
|
-
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) {
|
|
2374
2664
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2375
2665
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2376
2666
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2383,19 +2673,19 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
2383
2673
|
}
|
|
2384
2674
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2385
2675
|
}
|
|
2386
|
-
__name(
|
|
2387
|
-
function
|
|
2676
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
2677
|
+
function _ts_metadata15(metadataKey, metadataValue) {
|
|
2388
2678
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2389
2679
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2390
2680
|
}
|
|
2391
2681
|
}
|
|
2392
|
-
__name(
|
|
2393
|
-
function
|
|
2682
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
2683
|
+
function _ts_param14(paramIndex, decorator) {
|
|
2394
2684
|
return function(target, key) {
|
|
2395
2685
|
decorator(target, key, paramIndex);
|
|
2396
2686
|
};
|
|
2397
2687
|
}
|
|
2398
|
-
__name(
|
|
2688
|
+
__name(_ts_param14, "_ts_param");
|
|
2399
2689
|
var ThreadsController = class {
|
|
2400
2690
|
static {
|
|
2401
2691
|
__name(this, "ThreadsController");
|
|
@@ -2438,6 +2728,9 @@ var ThreadsController = class {
|
|
|
2438
2728
|
} : {},
|
|
2439
2729
|
..."defaultAgent" in body ? {
|
|
2440
2730
|
defaultAgent: body.defaultAgent ?? null
|
|
2731
|
+
} : {},
|
|
2732
|
+
..."model" in body ? {
|
|
2733
|
+
model: body.model ?? null
|
|
2441
2734
|
} : {}
|
|
2442
2735
|
});
|
|
2443
2736
|
return {
|
|
@@ -2459,101 +2752,101 @@ var ThreadsController = class {
|
|
|
2459
2752
|
};
|
|
2460
2753
|
}
|
|
2461
2754
|
};
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2755
|
+
_ts_decorate16([
|
|
2756
|
+
Get8(),
|
|
2757
|
+
_ts_param14(0, Req8()),
|
|
2758
|
+
_ts_metadata15("design:type", Function),
|
|
2759
|
+
_ts_metadata15("design:paramtypes", [
|
|
2467
2760
|
typeof Request === "undefined" ? Object : Request
|
|
2468
2761
|
]),
|
|
2469
|
-
|
|
2762
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2470
2763
|
], ThreadsController.prototype, "list", null);
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
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", [
|
|
2477
2770
|
typeof Request === "undefined" ? Object : Request,
|
|
2478
2771
|
String
|
|
2479
2772
|
]),
|
|
2480
|
-
|
|
2773
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2481
2774
|
], ThreadsController.prototype, "detail", null);
|
|
2482
|
-
|
|
2775
|
+
_ts_decorate16([
|
|
2483
2776
|
Delete2(":id"),
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2777
|
+
_ts_param14(0, Req8()),
|
|
2778
|
+
_ts_param14(1, Param4("id")),
|
|
2779
|
+
_ts_metadata15("design:type", Function),
|
|
2780
|
+
_ts_metadata15("design:paramtypes", [
|
|
2488
2781
|
typeof Request === "undefined" ? Object : Request,
|
|
2489
2782
|
String
|
|
2490
2783
|
]),
|
|
2491
|
-
|
|
2784
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2492
2785
|
], ThreadsController.prototype, "remove", null);
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2786
|
+
_ts_decorate16([
|
|
2787
|
+
Post4(":id/fork-from/:messageId"),
|
|
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", [
|
|
2500
2793
|
typeof Request === "undefined" ? Object : Request,
|
|
2501
2794
|
String,
|
|
2502
2795
|
String
|
|
2503
2796
|
]),
|
|
2504
|
-
|
|
2797
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2505
2798
|
], ThreadsController.prototype, "fork", null);
|
|
2506
|
-
|
|
2799
|
+
_ts_decorate16([
|
|
2507
2800
|
Patch(":id"),
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
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", [
|
|
2513
2806
|
typeof Request === "undefined" ? Object : Request,
|
|
2514
2807
|
String,
|
|
2515
2808
|
typeof UpdateThreadBody === "undefined" ? Object : UpdateThreadBody
|
|
2516
2809
|
]),
|
|
2517
|
-
|
|
2810
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2518
2811
|
], ThreadsController.prototype, "update", null);
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2812
|
+
_ts_decorate16([
|
|
2813
|
+
Post4(":id/promote"),
|
|
2814
|
+
_ts_param14(0, Req8()),
|
|
2815
|
+
_ts_param14(1, Param4("id")),
|
|
2816
|
+
_ts_metadata15("design:type", Function),
|
|
2817
|
+
_ts_metadata15("design:paramtypes", [
|
|
2525
2818
|
typeof Request === "undefined" ? Object : Request,
|
|
2526
2819
|
String
|
|
2527
2820
|
]),
|
|
2528
|
-
|
|
2821
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2529
2822
|
], ThreadsController.prototype, "promote", null);
|
|
2530
|
-
|
|
2823
|
+
_ts_decorate16([
|
|
2531
2824
|
Delete2(":id/from/:messageId"),
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
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", [
|
|
2537
2830
|
typeof Request === "undefined" ? Object : Request,
|
|
2538
2831
|
String,
|
|
2539
2832
|
String
|
|
2540
2833
|
]),
|
|
2541
|
-
|
|
2834
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2542
2835
|
], ThreadsController.prototype, "truncateFrom", null);
|
|
2543
|
-
ThreadsController =
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
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", [
|
|
2548
2841
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2549
2842
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2550
2843
|
])
|
|
2551
2844
|
], ThreadsController);
|
|
2552
2845
|
|
|
2553
2846
|
// src/controller/tool-call.controller.ts
|
|
2554
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2555
|
-
import { BadRequestException as BadRequestException4, Body as
|
|
2556
|
-
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) {
|
|
2557
2850
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2558
2851
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2559
2852
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2566,19 +2859,19 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
2566
2859
|
}
|
|
2567
2860
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2568
2861
|
}
|
|
2569
|
-
__name(
|
|
2570
|
-
function
|
|
2862
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
2863
|
+
function _ts_metadata16(metadataKey, metadataValue) {
|
|
2571
2864
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2572
2865
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2573
2866
|
}
|
|
2574
2867
|
}
|
|
2575
|
-
__name(
|
|
2576
|
-
function
|
|
2868
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
2869
|
+
function _ts_param15(paramIndex, decorator) {
|
|
2577
2870
|
return function(target, key) {
|
|
2578
2871
|
decorator(target, key, paramIndex);
|
|
2579
2872
|
};
|
|
2580
2873
|
}
|
|
2581
|
-
__name(
|
|
2874
|
+
__name(_ts_param15, "_ts_param");
|
|
2582
2875
|
var MAX_ANSWERED_QUESTIONS = 100;
|
|
2583
2876
|
var MAX_VALUES_PER_QUESTION = 100;
|
|
2584
2877
|
var MAX_ANSWER_VALUE_LENGTH = 4096;
|
|
@@ -2707,64 +3000,64 @@ var ToolCallController = class {
|
|
|
2707
3000
|
};
|
|
2708
3001
|
}
|
|
2709
3002
|
};
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
3003
|
+
_ts_decorate17([
|
|
3004
|
+
Post5("approve"),
|
|
3005
|
+
_ts_param15(0, Req9()),
|
|
3006
|
+
_ts_param15(1, Body4()),
|
|
3007
|
+
_ts_metadata16("design:type", Function),
|
|
3008
|
+
_ts_metadata16("design:paramtypes", [
|
|
2716
3009
|
typeof Request === "undefined" ? Object : Request,
|
|
2717
3010
|
typeof ApproveBody === "undefined" ? Object : ApproveBody
|
|
2718
3011
|
]),
|
|
2719
|
-
|
|
3012
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2720
3013
|
], ToolCallController.prototype, "approve", null);
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
3014
|
+
_ts_decorate17([
|
|
3015
|
+
Post5("reject"),
|
|
3016
|
+
_ts_param15(0, Req9()),
|
|
3017
|
+
_ts_param15(1, Body4()),
|
|
3018
|
+
_ts_metadata16("design:type", Function),
|
|
3019
|
+
_ts_metadata16("design:paramtypes", [
|
|
2727
3020
|
typeof Request === "undefined" ? Object : Request,
|
|
2728
3021
|
typeof RejectBody === "undefined" ? Object : RejectBody
|
|
2729
3022
|
]),
|
|
2730
|
-
|
|
3023
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2731
3024
|
], ToolCallController.prototype, "reject", null);
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
3025
|
+
_ts_decorate17([
|
|
3026
|
+
Post5("answer"),
|
|
3027
|
+
_ts_param15(0, Req9()),
|
|
3028
|
+
_ts_param15(1, Body4()),
|
|
3029
|
+
_ts_metadata16("design:type", Function),
|
|
3030
|
+
_ts_metadata16("design:paramtypes", [
|
|
2738
3031
|
typeof Request === "undefined" ? Object : Request,
|
|
2739
3032
|
typeof AnswerBody === "undefined" ? Object : AnswerBody
|
|
2740
3033
|
]),
|
|
2741
|
-
|
|
3034
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2742
3035
|
], ToolCallController.prototype, "answer", null);
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
3036
|
+
_ts_decorate17([
|
|
3037
|
+
Post5("skip"),
|
|
3038
|
+
_ts_param15(0, Req9()),
|
|
3039
|
+
_ts_param15(1, Body4()),
|
|
3040
|
+
_ts_metadata16("design:type", Function),
|
|
3041
|
+
_ts_metadata16("design:paramtypes", [
|
|
2749
3042
|
typeof Request === "undefined" ? Object : Request,
|
|
2750
3043
|
Object
|
|
2751
3044
|
]),
|
|
2752
|
-
|
|
3045
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2753
3046
|
], ToolCallController.prototype, "skip", null);
|
|
2754
|
-
ToolCallController =
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
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", [
|
|
2759
3052
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2760
3053
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2761
3054
|
])
|
|
2762
3055
|
], ToolCallController);
|
|
2763
3056
|
|
|
2764
3057
|
// src/controller/tools.controller.ts
|
|
2765
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2766
|
-
import { Controller as
|
|
2767
|
-
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) {
|
|
2768
3061
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2769
3062
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2770
3063
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2777,19 +3070,19 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
2777
3070
|
}
|
|
2778
3071
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2779
3072
|
}
|
|
2780
|
-
__name(
|
|
2781
|
-
function
|
|
3073
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
3074
|
+
function _ts_metadata17(metadataKey, metadataValue) {
|
|
2782
3075
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2783
3076
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2784
3077
|
}
|
|
2785
3078
|
}
|
|
2786
|
-
__name(
|
|
2787
|
-
function
|
|
3079
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
3080
|
+
function _ts_param16(paramIndex, decorator) {
|
|
2788
3081
|
return function(target, key) {
|
|
2789
3082
|
decorator(target, key, paramIndex);
|
|
2790
3083
|
};
|
|
2791
3084
|
}
|
|
2792
|
-
__name(
|
|
3085
|
+
__name(_ts_param16, "_ts_param");
|
|
2793
3086
|
var ToolsController = class {
|
|
2794
3087
|
static {
|
|
2795
3088
|
__name(this, "ToolsController");
|
|
@@ -2818,24 +3111,24 @@ var ToolsController = class {
|
|
|
2818
3111
|
}));
|
|
2819
3112
|
}
|
|
2820
3113
|
};
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
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", [
|
|
2827
3120
|
typeof Request === "undefined" ? Object : Request,
|
|
2828
3121
|
String
|
|
2829
3122
|
]),
|
|
2830
|
-
|
|
3123
|
+
_ts_metadata17("design:returntype", Promise)
|
|
2831
3124
|
], ToolsController.prototype, "list", null);
|
|
2832
|
-
ToolsController =
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
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", [
|
|
2839
3132
|
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2840
3133
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
2841
3134
|
typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4
|
|
@@ -2844,7 +3137,7 @@ ToolsController = _ts_decorate16([
|
|
|
2844
3137
|
|
|
2845
3138
|
// src/discovery/agent-discovery.service.ts
|
|
2846
3139
|
import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as AGENT_REGISTRY4, AgentRegistry as AgentRegistry5 } from "@dudousxd/nestjs-agent-core";
|
|
2847
|
-
import { Inject as
|
|
3140
|
+
import { Inject as Inject17, Injectable as Injectable7, Logger as Logger2 } from "@nestjs/common";
|
|
2848
3141
|
import { DiscoveryService, MetadataScanner } from "@nestjs/core";
|
|
2849
3142
|
|
|
2850
3143
|
// src/decorator/agent.decorator.ts
|
|
@@ -2861,7 +3154,7 @@ var SYSTEM_PROMPT_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:
|
|
|
2861
3154
|
var SYSTEM_PROMPT_CONTRIBUTOR_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:system-prompt-contributor");
|
|
2862
3155
|
|
|
2863
3156
|
// src/discovery/agent-discovery.service.ts
|
|
2864
|
-
function
|
|
3157
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
2865
3158
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2866
3159
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2867
3160
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2874,19 +3167,19 @@ function _ts_decorate17(decorators, target, key, desc) {
|
|
|
2874
3167
|
}
|
|
2875
3168
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2876
3169
|
}
|
|
2877
|
-
__name(
|
|
2878
|
-
function
|
|
3170
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3171
|
+
function _ts_metadata18(metadataKey, metadataValue) {
|
|
2879
3172
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2880
3173
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2881
3174
|
}
|
|
2882
3175
|
}
|
|
2883
|
-
__name(
|
|
2884
|
-
function
|
|
3176
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3177
|
+
function _ts_param17(paramIndex, decorator) {
|
|
2885
3178
|
return function(target, key) {
|
|
2886
3179
|
decorator(target, key, paramIndex);
|
|
2887
3180
|
};
|
|
2888
3181
|
}
|
|
2889
|
-
__name(
|
|
3182
|
+
__name(_ts_param17, "_ts_param");
|
|
2890
3183
|
var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
2891
3184
|
static {
|
|
2892
3185
|
__name(this, "AgentDiscoveryService");
|
|
@@ -3013,12 +3306,12 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
3013
3306
|
return (ctx) => candidate.call(instance, ctx);
|
|
3014
3307
|
}
|
|
3015
3308
|
};
|
|
3016
|
-
AgentDiscoveryService =
|
|
3309
|
+
AgentDiscoveryService = _ts_decorate19([
|
|
3017
3310
|
Injectable7(),
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
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", [
|
|
3022
3315
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
3023
3316
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
3024
3317
|
typeof AgentRegistry5 === "undefined" ? Object : AgentRegistry5,
|
|
@@ -3028,7 +3321,7 @@ AgentDiscoveryService = _ts_decorate17([
|
|
|
3028
3321
|
|
|
3029
3322
|
// src/discovery/ai-tool-discovery.service.ts
|
|
3030
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";
|
|
3031
|
-
import { Inject as
|
|
3324
|
+
import { Inject as Inject18, Injectable as Injectable8, Logger as Logger3 } from "@nestjs/common";
|
|
3032
3325
|
import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
|
|
3033
3326
|
import { z } from "zod";
|
|
3034
3327
|
|
|
@@ -3048,7 +3341,7 @@ function isBrandedFunctionalTool(value) {
|
|
|
3048
3341
|
__name(isBrandedFunctionalTool, "isBrandedFunctionalTool");
|
|
3049
3342
|
|
|
3050
3343
|
// src/discovery/ai-tool-discovery.service.ts
|
|
3051
|
-
function
|
|
3344
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
3052
3345
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3053
3346
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3054
3347
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3061,19 +3354,19 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
3061
3354
|
}
|
|
3062
3355
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3063
3356
|
}
|
|
3064
|
-
__name(
|
|
3065
|
-
function
|
|
3357
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3358
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
3066
3359
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3067
3360
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3068
3361
|
}
|
|
3069
3362
|
}
|
|
3070
|
-
__name(
|
|
3071
|
-
function
|
|
3363
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
3364
|
+
function _ts_param18(paramIndex, decorator) {
|
|
3072
3365
|
return function(target, key) {
|
|
3073
3366
|
decorator(target, key, paramIndex);
|
|
3074
3367
|
};
|
|
3075
3368
|
}
|
|
3076
|
-
__name(
|
|
3369
|
+
__name(_ts_param18, "_ts_param");
|
|
3077
3370
|
var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
3078
3371
|
static {
|
|
3079
3372
|
__name(this, "AiToolDiscoveryService");
|
|
@@ -3206,13 +3499,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
3206
3499
|
return true;
|
|
3207
3500
|
}
|
|
3208
3501
|
};
|
|
3209
|
-
AiToolDiscoveryService =
|
|
3502
|
+
AiToolDiscoveryService = _ts_decorate20([
|
|
3210
3503
|
Injectable8(),
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
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", [
|
|
3216
3509
|
typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
|
|
3217
3510
|
typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
|
|
3218
3511
|
typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
|
|
@@ -3222,7 +3515,7 @@ AiToolDiscoveryService = _ts_decorate18([
|
|
|
3222
3515
|
|
|
3223
3516
|
// src/discovery/skill-discovery.service.ts
|
|
3224
3517
|
import { AGENT_SKILL_SOURCES } from "@dudousxd/nestjs-agent-core";
|
|
3225
|
-
import { Inject as
|
|
3518
|
+
import { Inject as Inject19, Injectable as Injectable9, Logger as Logger4 } from "@nestjs/common";
|
|
3226
3519
|
import { DiscoveryService as DiscoveryService3 } from "@nestjs/core";
|
|
3227
3520
|
|
|
3228
3521
|
// src/decorator/skill.decorator.ts
|
|
@@ -3239,7 +3532,7 @@ function skillScope(options) {
|
|
|
3239
3532
|
__name(skillScope, "skillScope");
|
|
3240
3533
|
|
|
3241
3534
|
// src/discovery/skill-discovery.service.ts
|
|
3242
|
-
function
|
|
3535
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
3243
3536
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3244
3537
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3245
3538
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3252,19 +3545,19 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
3252
3545
|
}
|
|
3253
3546
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3254
3547
|
}
|
|
3255
|
-
__name(
|
|
3256
|
-
function
|
|
3548
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3549
|
+
function _ts_metadata20(metadataKey, metadataValue) {
|
|
3257
3550
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3258
3551
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3259
3552
|
}
|
|
3260
3553
|
}
|
|
3261
|
-
__name(
|
|
3262
|
-
function
|
|
3554
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
3555
|
+
function _ts_param19(paramIndex, decorator) {
|
|
3263
3556
|
return function(target, key) {
|
|
3264
3557
|
decorator(target, key, paramIndex);
|
|
3265
3558
|
};
|
|
3266
3559
|
}
|
|
3267
|
-
__name(
|
|
3560
|
+
__name(_ts_param19, "_ts_param");
|
|
3268
3561
|
var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
3269
3562
|
static {
|
|
3270
3563
|
__name(this, "SkillDiscoveryService");
|
|
@@ -3308,11 +3601,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
|
3308
3601
|
return flat === void 0 ? void 0 : () => flat;
|
|
3309
3602
|
}
|
|
3310
3603
|
};
|
|
3311
|
-
SkillDiscoveryService =
|
|
3604
|
+
SkillDiscoveryService = _ts_decorate21([
|
|
3312
3605
|
Injectable9(),
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3606
|
+
_ts_param19(1, Inject19(AGENT_SKILL_SOURCES)),
|
|
3607
|
+
_ts_metadata20("design:type", Function),
|
|
3608
|
+
_ts_metadata20("design:paramtypes", [
|
|
3316
3609
|
typeof DiscoveryService3 === "undefined" ? Object : DiscoveryService3,
|
|
3317
3610
|
Array
|
|
3318
3611
|
])
|
|
@@ -3343,8 +3636,8 @@ var LedgerQuotaStore = class {
|
|
|
3343
3636
|
|
|
3344
3637
|
// src/runner/inline-agent-runner.ts
|
|
3345
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";
|
|
3346
|
-
import { Inject as
|
|
3347
|
-
function
|
|
3639
|
+
import { Inject as Inject20, Injectable as Injectable10, Logger as Logger5 } from "@nestjs/common";
|
|
3640
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
3348
3641
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3349
3642
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3350
3643
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3357,19 +3650,19 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
3357
3650
|
}
|
|
3358
3651
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3359
3652
|
}
|
|
3360
|
-
__name(
|
|
3361
|
-
function
|
|
3653
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
3654
|
+
function _ts_metadata21(metadataKey, metadataValue) {
|
|
3362
3655
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3363
3656
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3364
3657
|
}
|
|
3365
3658
|
}
|
|
3366
|
-
__name(
|
|
3367
|
-
function
|
|
3659
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
3660
|
+
function _ts_param20(paramIndex, decorator) {
|
|
3368
3661
|
return function(target, key) {
|
|
3369
3662
|
decorator(target, key, paramIndex);
|
|
3370
3663
|
};
|
|
3371
3664
|
}
|
|
3372
|
-
__name(
|
|
3665
|
+
__name(_ts_param20, "_ts_param");
|
|
3373
3666
|
var InlineAgentRunner = class _InlineAgentRunner {
|
|
3374
3667
|
static {
|
|
3375
3668
|
__name(this, "InlineAgentRunner");
|
|
@@ -3750,12 +4043,12 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3750
4043
|
}
|
|
3751
4044
|
}
|
|
3752
4045
|
};
|
|
3753
|
-
InlineAgentRunner =
|
|
4046
|
+
InlineAgentRunner = _ts_decorate22([
|
|
3754
4047
|
Injectable10(),
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
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", [
|
|
3759
4052
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
3760
4053
|
typeof AgentStore === "undefined" ? Object : AgentStore
|
|
3761
4054
|
])
|
|
@@ -3800,7 +4093,7 @@ function resolveSkillsConfig(options, declared) {
|
|
|
3800
4093
|
__name(resolveSkillsConfig, "resolveSkillsConfig");
|
|
3801
4094
|
|
|
3802
4095
|
// src/agent.module.ts
|
|
3803
|
-
function
|
|
4096
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
3804
4097
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3805
4098
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3806
4099
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3813,7 +4106,7 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
3813
4106
|
}
|
|
3814
4107
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3815
4108
|
}
|
|
3816
|
-
__name(
|
|
4109
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
3817
4110
|
var DEFAULT_PATH = "agent";
|
|
3818
4111
|
function sharedProviders(durable, includeStore) {
|
|
3819
4112
|
const providers = [
|
|
@@ -3872,7 +4165,7 @@ function sharedProviders(durable, includeStore) {
|
|
|
3872
4165
|
]
|
|
3873
4166
|
},
|
|
3874
4167
|
{
|
|
3875
|
-
provide:
|
|
4168
|
+
provide: AGENT_ACTOR_RESOLVER11,
|
|
3876
4169
|
useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
|
|
3877
4170
|
inject: [
|
|
3878
4171
|
AGENT_OPTIONS4
|
|
@@ -3896,6 +4189,13 @@ function sharedProviders(durable, includeStore) {
|
|
|
3896
4189
|
AGENT_STORE6
|
|
3897
4190
|
]
|
|
3898
4191
|
},
|
|
4192
|
+
{
|
|
4193
|
+
provide: AGENT_MODEL_CATALOG2,
|
|
4194
|
+
useFactory: /* @__PURE__ */ __name((o) => o.models, "useFactory"),
|
|
4195
|
+
inject: [
|
|
4196
|
+
AGENT_OPTIONS4
|
|
4197
|
+
]
|
|
4198
|
+
},
|
|
3899
4199
|
AgentDepsFactory2,
|
|
3900
4200
|
{
|
|
3901
4201
|
provide: AGENT_DEPS_FACTORY7,
|
|
@@ -3957,12 +4257,13 @@ function exportsFor(includeStore) {
|
|
|
3957
4257
|
AGENT_REGISTRY6,
|
|
3958
4258
|
AGENT_SINK3,
|
|
3959
4259
|
AGENT_ROLES_POLICY2,
|
|
3960
|
-
|
|
4260
|
+
AGENT_ACTOR_RESOLVER11,
|
|
3961
4261
|
AGENT_MODEL2,
|
|
3962
4262
|
...includeStore ? [
|
|
3963
4263
|
AGENT_STORE6
|
|
3964
4264
|
] : [],
|
|
3965
4265
|
AGENT_QUOTA_STORE3,
|
|
4266
|
+
AGENT_MODEL_CATALOG2,
|
|
3966
4267
|
AGENT_PROMPT_CONTRIBUTORS3,
|
|
3967
4268
|
AGENT_SKILLS3,
|
|
3968
4269
|
AGENT_MEMORY3,
|
|
@@ -3982,7 +4283,9 @@ var BASE_CONTROLLERS = [
|
|
|
3982
4283
|
AgentsController,
|
|
3983
4284
|
SkillsController,
|
|
3984
4285
|
MemoriesController,
|
|
3985
|
-
ToolsController
|
|
4286
|
+
ToolsController,
|
|
4287
|
+
MessagesController,
|
|
4288
|
+
ModelsController
|
|
3986
4289
|
];
|
|
3987
4290
|
var GUARDABLE_CONTROLLERS = [
|
|
3988
4291
|
...BASE_CONTROLLERS,
|
|
@@ -4085,7 +4388,7 @@ var AgentModule = class _AgentModule {
|
|
|
4085
4388
|
};
|
|
4086
4389
|
}
|
|
4087
4390
|
};
|
|
4088
|
-
AgentModule =
|
|
4391
|
+
AgentModule = _ts_decorate23([
|
|
4089
4392
|
Global2(),
|
|
4090
4393
|
Module2({})
|
|
4091
4394
|
], AgentModule);
|