@dudousxd/nestjs-agent 1.5.0 → 1.6.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 +14 -0
- package/dist/durable/index.cjs +459 -313
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +363 -217
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +465 -317
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -2
- package/dist/index.d.ts +29 -2
- package/dist/index.js +364 -217
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/durable/index.js
CHANGED
|
@@ -790,7 +790,7 @@ AgentDurableModule = _ts_decorate4([
|
|
|
790
790
|
], AgentDurableModule);
|
|
791
791
|
|
|
792
792
|
// src/agent.module.ts
|
|
793
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
793
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER10, 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_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
794
|
import { Global as Global2, Module as Module2 } from "@nestjs/common";
|
|
795
795
|
import { DiscoveryModule, RouterModule } from "@nestjs/core";
|
|
796
796
|
|
|
@@ -1393,6 +1393,40 @@ var AgentService = class {
|
|
|
1393
1393
|
return this.store.truncateFrom(threadId, messageId);
|
|
1394
1394
|
}
|
|
1395
1395
|
/**
|
|
1396
|
+
* Rate a message in one of `actor`'s threads: `'up'`/`'down'` with an optional comment, or `null`
|
|
1397
|
+
* to clear the rating. Answers `404` for an unknown message, `403` for another actor's, and `501`
|
|
1398
|
+
* on a store without `threadOfMessage` + `setMessageFeedback`.
|
|
1399
|
+
*/
|
|
1400
|
+
async setMessageFeedback(actor, messageId, input) {
|
|
1401
|
+
if (input.value !== null && input.value !== "up" && input.value !== "down") {
|
|
1402
|
+
throw new BadRequestException("value must be 'up', 'down' or null");
|
|
1403
|
+
}
|
|
1404
|
+
if (input.comment !== void 0 && typeof input.comment !== "string") {
|
|
1405
|
+
throw new BadRequestException("comment must be a string");
|
|
1406
|
+
}
|
|
1407
|
+
const comment = input.comment?.trim();
|
|
1408
|
+
if (comment !== void 0 && comment.length > 2e3) {
|
|
1409
|
+
throw new BadRequestException("comment must be at most 2000 characters");
|
|
1410
|
+
}
|
|
1411
|
+
if (this.store.threadOfMessage === void 0 || this.store.setMessageFeedback === void 0) {
|
|
1412
|
+
throw new NotImplementedException("Message feedback requires an AgentStore that implements threadOfMessage() and setMessageFeedback(); the bound store does not support it.");
|
|
1413
|
+
}
|
|
1414
|
+
const threadId = await this.store.threadOfMessage(messageId);
|
|
1415
|
+
if (threadId === null) {
|
|
1416
|
+
throw new NotFoundException(`message ${messageId} not found`);
|
|
1417
|
+
}
|
|
1418
|
+
await this.assertOwnsThread(actor, threadId);
|
|
1419
|
+
const feedback = input.value === null ? null : {
|
|
1420
|
+
value: input.value,
|
|
1421
|
+
...comment !== void 0 && comment.length > 0 ? {
|
|
1422
|
+
comment
|
|
1423
|
+
} : {},
|
|
1424
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1425
|
+
};
|
|
1426
|
+
await this.store.setMessageFeedback(messageId, feedback);
|
|
1427
|
+
return feedback;
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1396
1430
|
* Every file this actor has staged, newest first — across threads, including uploads that were
|
|
1397
1431
|
* never sent, which nothing else on this surface can see.
|
|
1398
1432
|
*
|
|
@@ -1892,7 +1926,7 @@ AttachmentsController = _ts_decorate9([
|
|
|
1892
1926
|
|
|
1893
1927
|
// src/controller/chat.controller.ts
|
|
1894
1928
|
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";
|
|
1929
|
+
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
1930
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
1897
1931
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1898
1932
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -1981,9 +2015,15 @@ var ChatController = class {
|
|
|
1981
2015
|
});
|
|
1982
2016
|
await this.pipe(res, runId, this.agent.subscribe(runId), threadId);
|
|
1983
2017
|
}
|
|
1984
|
-
|
|
2018
|
+
/**
|
|
2019
|
+
* Attach to a run's stream: every buffered frame, then live ones. `?after=<seq>` (or the SSE
|
|
2020
|
+
* `Last-Event-ID` header a browser `EventSource` sends on its own) skips the frames a reconnecting
|
|
2021
|
+
* client already has — see {@link pipe} for how frames are numbered.
|
|
2022
|
+
*/
|
|
2023
|
+
async stream(req, runId, res, after) {
|
|
1985
2024
|
const actor = await this.actorResolver.resolve(req);
|
|
1986
|
-
|
|
2025
|
+
const cursor = parseCursor(after) ?? parseCursor(req.headers["last-event-id"]) ?? 0;
|
|
2026
|
+
await this.pipe(res, runId, await this.agent.subscribeAs(actor, runId), void 0, cursor);
|
|
1987
2027
|
}
|
|
1988
2028
|
async cancel(req, runId) {
|
|
1989
2029
|
const actor = await this.actorResolver.resolve(req);
|
|
@@ -1992,7 +2032,15 @@ var ChatController = class {
|
|
|
1992
2032
|
aborted: true
|
|
1993
2033
|
};
|
|
1994
2034
|
}
|
|
1995
|
-
|
|
2035
|
+
/**
|
|
2036
|
+
* Every `data:` frame carries an SSE `id:` — its 1-based sequence number within the run. The
|
|
2037
|
+
* number is a pure function of the run's buffered stream (every sink replays a run from its first
|
|
2038
|
+
* chunk, in write order), so the same frame gets the same number on the POST that started the run
|
|
2039
|
+
* and on any later `GET …/stream`, whichever replica serves it. A reconnecting client passes the
|
|
2040
|
+
* last one it saw as `?after=`; frames at or below it are read off the sink but not re-sent.
|
|
2041
|
+
* `meta`, `done` and `error` carry no id: `meta` is re-sent on every attach, the terminals once.
|
|
2042
|
+
*/
|
|
2043
|
+
async pipe(res, runId, events, threadId, after = 0) {
|
|
1996
2044
|
res.setHeader("Content-Type", "text/event-stream");
|
|
1997
2045
|
res.setHeader("Cache-Control", "no-cache");
|
|
1998
2046
|
res.setHeader("Connection", "keep-alive");
|
|
@@ -2009,6 +2057,16 @@ data: ${JSON.stringify({
|
|
|
2009
2057
|
`);
|
|
2010
2058
|
const decoder = new TextDecoder();
|
|
2011
2059
|
let buffer = "";
|
|
2060
|
+
let seq = 0;
|
|
2061
|
+
const forward = /* @__PURE__ */ __name((line) => {
|
|
2062
|
+
seq += 1;
|
|
2063
|
+
if (seq > after) {
|
|
2064
|
+
res.write(`id: ${seq}
|
|
2065
|
+
data: ${line}
|
|
2066
|
+
|
|
2067
|
+
`);
|
|
2068
|
+
}
|
|
2069
|
+
}, "forward");
|
|
2012
2070
|
try {
|
|
2013
2071
|
for await (const chunk of events) {
|
|
2014
2072
|
buffer += decoder.decode(chunk, {
|
|
@@ -2019,17 +2077,13 @@ data: ${JSON.stringify({
|
|
|
2019
2077
|
const line = buffer.slice(0, newline);
|
|
2020
2078
|
buffer = buffer.slice(newline + 1);
|
|
2021
2079
|
if (line.length > 0) {
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
`);
|
|
2080
|
+
forward(line);
|
|
2025
2081
|
}
|
|
2026
2082
|
newline = buffer.indexOf("\n");
|
|
2027
2083
|
}
|
|
2028
2084
|
}
|
|
2029
2085
|
if (buffer.length > 0) {
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
`);
|
|
2086
|
+
forward(buffer);
|
|
2033
2087
|
}
|
|
2034
2088
|
res.write("event: done\ndata: {}\n\n");
|
|
2035
2089
|
} catch (error) {
|
|
@@ -2066,11 +2120,13 @@ _ts_decorate10([
|
|
|
2066
2120
|
_ts_param8(0, Req2()),
|
|
2067
2121
|
_ts_param8(1, Param("runId")),
|
|
2068
2122
|
_ts_param8(2, Res()),
|
|
2123
|
+
_ts_param8(3, Query("after")),
|
|
2069
2124
|
_ts_metadata9("design:type", Function),
|
|
2070
2125
|
_ts_metadata9("design:paramtypes", [
|
|
2071
2126
|
typeof Request === "undefined" ? Object : Request,
|
|
2072
2127
|
String,
|
|
2073
|
-
typeof Response === "undefined" ? Object : Response
|
|
2128
|
+
typeof Response === "undefined" ? Object : Response,
|
|
2129
|
+
String
|
|
2074
2130
|
]),
|
|
2075
2131
|
_ts_metadata9("design:returntype", Promise)
|
|
2076
2132
|
], ChatController.prototype, "stream", null);
|
|
@@ -2094,10 +2150,19 @@ ChatController = _ts_decorate10([
|
|
|
2094
2150
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2095
2151
|
])
|
|
2096
2152
|
], ChatController);
|
|
2153
|
+
function parseCursor(raw) {
|
|
2154
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
2155
|
+
if (typeof value !== "string" || !/^\d+$/.test(value.trim())) {
|
|
2156
|
+
return void 0;
|
|
2157
|
+
}
|
|
2158
|
+
const parsed = Number(value.trim());
|
|
2159
|
+
return Number.isSafeInteger(parsed) ? parsed : void 0;
|
|
2160
|
+
}
|
|
2161
|
+
__name(parseCursor, "parseCursor");
|
|
2097
2162
|
|
|
2098
2163
|
// src/controller/memories.controller.ts
|
|
2099
2164
|
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";
|
|
2165
|
+
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
2166
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
2102
2167
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2103
2168
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2199,7 +2264,7 @@ var MemoriesController = class {
|
|
|
2199
2264
|
_ts_decorate11([
|
|
2200
2265
|
Get4(),
|
|
2201
2266
|
_ts_param9(0, Req3()),
|
|
2202
|
-
_ts_param9(1,
|
|
2267
|
+
_ts_param9(1, Query2("threadId")),
|
|
2203
2268
|
_ts_metadata10("design:type", Function),
|
|
2204
2269
|
_ts_metadata10("design:paramtypes", [
|
|
2205
2270
|
typeof Request === "undefined" ? Object : Request,
|
|
@@ -2230,9 +2295,9 @@ MemoriesController = _ts_decorate11([
|
|
|
2230
2295
|
])
|
|
2231
2296
|
], MemoriesController);
|
|
2232
2297
|
|
|
2233
|
-
// src/controller/
|
|
2298
|
+
// src/controller/messages.controller.ts
|
|
2234
2299
|
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER4 } from "@dudousxd/nestjs-agent-core";
|
|
2235
|
-
import {
|
|
2300
|
+
import { Body as Body2, Controller as Controller5, HttpCode, Inject as Inject10, Param as Param3, Post as Post3, Req as Req4 } from "@nestjs/common";
|
|
2236
2301
|
function _ts_decorate12(decorators, target, key, desc) {
|
|
2237
2302
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2238
2303
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2259,9 +2324,9 @@ function _ts_param10(paramIndex, decorator) {
|
|
|
2259
2324
|
};
|
|
2260
2325
|
}
|
|
2261
2326
|
__name(_ts_param10, "_ts_param");
|
|
2262
|
-
var
|
|
2327
|
+
var MessagesController = class {
|
|
2263
2328
|
static {
|
|
2264
|
-
__name(this, "
|
|
2329
|
+
__name(this, "MessagesController");
|
|
2265
2330
|
}
|
|
2266
2331
|
agent;
|
|
2267
2332
|
actorResolver;
|
|
@@ -2269,33 +2334,50 @@ var QuotaController = class {
|
|
|
2269
2334
|
this.agent = agent;
|
|
2270
2335
|
this.actorResolver = actorResolver;
|
|
2271
2336
|
}
|
|
2272
|
-
|
|
2337
|
+
/**
|
|
2338
|
+
* Rate a message: `{ value: 'up' | 'down' | null, comment? }`. Answers the stored rating
|
|
2339
|
+
* (`{ feedback: null }` once cleared). Only the thread's owner may rate its messages.
|
|
2340
|
+
*/
|
|
2341
|
+
async feedback(req, id, body) {
|
|
2273
2342
|
const actor = await this.actorResolver.resolve(req);
|
|
2274
|
-
|
|
2343
|
+
const feedback = await this.agent.setMessageFeedback(actor, id, {
|
|
2344
|
+
value: body?.value ?? null,
|
|
2345
|
+
...body?.comment !== void 0 ? {
|
|
2346
|
+
comment: body.comment
|
|
2347
|
+
} : {}
|
|
2348
|
+
});
|
|
2349
|
+
return {
|
|
2350
|
+
feedback
|
|
2351
|
+
};
|
|
2275
2352
|
}
|
|
2276
2353
|
};
|
|
2277
2354
|
_ts_decorate12([
|
|
2278
|
-
|
|
2355
|
+
Post3(":id/feedback"),
|
|
2356
|
+
HttpCode(200),
|
|
2279
2357
|
_ts_param10(0, Req4()),
|
|
2358
|
+
_ts_param10(1, Param3("id")),
|
|
2359
|
+
_ts_param10(2, Body2()),
|
|
2280
2360
|
_ts_metadata11("design:type", Function),
|
|
2281
2361
|
_ts_metadata11("design:paramtypes", [
|
|
2282
|
-
typeof Request === "undefined" ? Object : Request
|
|
2362
|
+
typeof Request === "undefined" ? Object : Request,
|
|
2363
|
+
String,
|
|
2364
|
+
typeof FeedbackBody === "undefined" ? Object : FeedbackBody
|
|
2283
2365
|
]),
|
|
2284
2366
|
_ts_metadata11("design:returntype", Promise)
|
|
2285
|
-
],
|
|
2286
|
-
|
|
2287
|
-
Controller5("
|
|
2367
|
+
], MessagesController.prototype, "feedback", null);
|
|
2368
|
+
MessagesController = _ts_decorate12([
|
|
2369
|
+
Controller5("messages"),
|
|
2288
2370
|
_ts_param10(1, Inject10(AGENT_ACTOR_RESOLVER4)),
|
|
2289
2371
|
_ts_metadata11("design:type", Function),
|
|
2290
2372
|
_ts_metadata11("design:paramtypes", [
|
|
2291
2373
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2292
2374
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2293
2375
|
])
|
|
2294
|
-
],
|
|
2376
|
+
], MessagesController);
|
|
2295
2377
|
|
|
2296
|
-
// src/controller/
|
|
2297
|
-
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5
|
|
2298
|
-
import { Controller as Controller6, Get as
|
|
2378
|
+
// src/controller/quota.controller.ts
|
|
2379
|
+
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";
|
|
2299
2381
|
function _ts_decorate13(decorators, target, key, desc) {
|
|
2300
2382
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2301
2383
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -2322,6 +2404,69 @@ function _ts_param11(paramIndex, decorator) {
|
|
|
2322
2404
|
};
|
|
2323
2405
|
}
|
|
2324
2406
|
__name(_ts_param11, "_ts_param");
|
|
2407
|
+
var QuotaController = class {
|
|
2408
|
+
static {
|
|
2409
|
+
__name(this, "QuotaController");
|
|
2410
|
+
}
|
|
2411
|
+
agent;
|
|
2412
|
+
actorResolver;
|
|
2413
|
+
constructor(agent, actorResolver) {
|
|
2414
|
+
this.agent = agent;
|
|
2415
|
+
this.actorResolver = actorResolver;
|
|
2416
|
+
}
|
|
2417
|
+
async today(req) {
|
|
2418
|
+
const actor = await this.actorResolver.resolve(req);
|
|
2419
|
+
return this.agent.quotaToday(actor.id);
|
|
2420
|
+
}
|
|
2421
|
+
};
|
|
2422
|
+
_ts_decorate13([
|
|
2423
|
+
Get5("today"),
|
|
2424
|
+
_ts_param11(0, Req5()),
|
|
2425
|
+
_ts_metadata12("design:type", Function),
|
|
2426
|
+
_ts_metadata12("design:paramtypes", [
|
|
2427
|
+
typeof Request === "undefined" ? Object : Request
|
|
2428
|
+
]),
|
|
2429
|
+
_ts_metadata12("design:returntype", Promise)
|
|
2430
|
+
], QuotaController.prototype, "today", null);
|
|
2431
|
+
QuotaController = _ts_decorate13([
|
|
2432
|
+
Controller6("quota"),
|
|
2433
|
+
_ts_param11(1, Inject11(AGENT_ACTOR_RESOLVER5)),
|
|
2434
|
+
_ts_metadata12("design:type", Function),
|
|
2435
|
+
_ts_metadata12("design:paramtypes", [
|
|
2436
|
+
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2437
|
+
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2438
|
+
])
|
|
2439
|
+
], QuotaController);
|
|
2440
|
+
|
|
2441
|
+
// src/controller/skills.controller.ts
|
|
2442
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER6, AGENT_SKILLS as AGENT_SKILLS2, offerSkills } from "@dudousxd/nestjs-agent-core";
|
|
2443
|
+
import { Controller as Controller7, Get as Get6, Inject as Inject12, Optional as Optional6, Query as Query3, Req as Req6 } from "@nestjs/common";
|
|
2444
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
2445
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2446
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2447
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2448
|
+
} else {
|
|
2449
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2450
|
+
if (d = decorators[i]) {
|
|
2451
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2456
|
+
}
|
|
2457
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
2458
|
+
function _ts_metadata13(metadataKey, metadataValue) {
|
|
2459
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2460
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
2464
|
+
function _ts_param12(paramIndex, decorator) {
|
|
2465
|
+
return function(target, key) {
|
|
2466
|
+
decorator(target, key, paramIndex);
|
|
2467
|
+
};
|
|
2468
|
+
}
|
|
2469
|
+
__name(_ts_param12, "_ts_param");
|
|
2325
2470
|
var SkillsController = class {
|
|
2326
2471
|
static {
|
|
2327
2472
|
__name(this, "SkillsController");
|
|
@@ -2344,33 +2489,33 @@ var SkillsController = class {
|
|
|
2344
2489
|
return offer.entries;
|
|
2345
2490
|
}
|
|
2346
2491
|
};
|
|
2347
|
-
|
|
2492
|
+
_ts_decorate14([
|
|
2348
2493
|
Get6(),
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2494
|
+
_ts_param12(0, Req6()),
|
|
2495
|
+
_ts_param12(1, Query3("threadId")),
|
|
2496
|
+
_ts_metadata13("design:type", Function),
|
|
2497
|
+
_ts_metadata13("design:paramtypes", [
|
|
2353
2498
|
typeof Request === "undefined" ? Object : Request,
|
|
2354
2499
|
String
|
|
2355
2500
|
]),
|
|
2356
|
-
|
|
2501
|
+
_ts_metadata13("design:returntype", Promise)
|
|
2357
2502
|
], SkillsController.prototype, "list", null);
|
|
2358
|
-
SkillsController =
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2503
|
+
SkillsController = _ts_decorate14([
|
|
2504
|
+
Controller7("skills"),
|
|
2505
|
+
_ts_param12(0, Inject12(AGENT_ACTOR_RESOLVER6)),
|
|
2506
|
+
_ts_param12(1, Optional6()),
|
|
2507
|
+
_ts_param12(1, Inject12(AGENT_SKILLS2)),
|
|
2508
|
+
_ts_metadata13("design:type", Function),
|
|
2509
|
+
_ts_metadata13("design:paramtypes", [
|
|
2365
2510
|
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2366
2511
|
Object
|
|
2367
2512
|
])
|
|
2368
2513
|
], SkillsController);
|
|
2369
2514
|
|
|
2370
2515
|
// src/controller/threads.controller.ts
|
|
2371
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2372
|
-
import { Body as
|
|
2373
|
-
function
|
|
2516
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER7 } from "@dudousxd/nestjs-agent-core";
|
|
2517
|
+
import { Body as Body3, Controller as Controller8, Delete as Delete2, Get as Get7, Inject as Inject13, Param as Param4, Patch, Post as Post4, Req as Req7 } from "@nestjs/common";
|
|
2518
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
2374
2519
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2375
2520
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2376
2521
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2383,19 +2528,19 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
2383
2528
|
}
|
|
2384
2529
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2385
2530
|
}
|
|
2386
|
-
__name(
|
|
2387
|
-
function
|
|
2531
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
2532
|
+
function _ts_metadata14(metadataKey, metadataValue) {
|
|
2388
2533
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2389
2534
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2390
2535
|
}
|
|
2391
2536
|
}
|
|
2392
|
-
__name(
|
|
2393
|
-
function
|
|
2537
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
2538
|
+
function _ts_param13(paramIndex, decorator) {
|
|
2394
2539
|
return function(target, key) {
|
|
2395
2540
|
decorator(target, key, paramIndex);
|
|
2396
2541
|
};
|
|
2397
2542
|
}
|
|
2398
|
-
__name(
|
|
2543
|
+
__name(_ts_param13, "_ts_param");
|
|
2399
2544
|
var ThreadsController = class {
|
|
2400
2545
|
static {
|
|
2401
2546
|
__name(this, "ThreadsController");
|
|
@@ -2459,101 +2604,101 @@ var ThreadsController = class {
|
|
|
2459
2604
|
};
|
|
2460
2605
|
}
|
|
2461
2606
|
};
|
|
2462
|
-
|
|
2607
|
+
_ts_decorate15([
|
|
2463
2608
|
Get7(),
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2609
|
+
_ts_param13(0, Req7()),
|
|
2610
|
+
_ts_metadata14("design:type", Function),
|
|
2611
|
+
_ts_metadata14("design:paramtypes", [
|
|
2467
2612
|
typeof Request === "undefined" ? Object : Request
|
|
2468
2613
|
]),
|
|
2469
|
-
|
|
2614
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2470
2615
|
], ThreadsController.prototype, "list", null);
|
|
2471
|
-
|
|
2616
|
+
_ts_decorate15([
|
|
2472
2617
|
Get7(":id"),
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2618
|
+
_ts_param13(0, Req7()),
|
|
2619
|
+
_ts_param13(1, Param4("id")),
|
|
2620
|
+
_ts_metadata14("design:type", Function),
|
|
2621
|
+
_ts_metadata14("design:paramtypes", [
|
|
2477
2622
|
typeof Request === "undefined" ? Object : Request,
|
|
2478
2623
|
String
|
|
2479
2624
|
]),
|
|
2480
|
-
|
|
2625
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2481
2626
|
], ThreadsController.prototype, "detail", null);
|
|
2482
|
-
|
|
2627
|
+
_ts_decorate15([
|
|
2483
2628
|
Delete2(":id"),
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2629
|
+
_ts_param13(0, Req7()),
|
|
2630
|
+
_ts_param13(1, Param4("id")),
|
|
2631
|
+
_ts_metadata14("design:type", Function),
|
|
2632
|
+
_ts_metadata14("design:paramtypes", [
|
|
2488
2633
|
typeof Request === "undefined" ? Object : Request,
|
|
2489
2634
|
String
|
|
2490
2635
|
]),
|
|
2491
|
-
|
|
2636
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2492
2637
|
], ThreadsController.prototype, "remove", null);
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2638
|
+
_ts_decorate15([
|
|
2639
|
+
Post4(":id/fork-from/:messageId"),
|
|
2640
|
+
_ts_param13(0, Req7()),
|
|
2641
|
+
_ts_param13(1, Param4("id")),
|
|
2642
|
+
_ts_param13(2, Param4("messageId")),
|
|
2643
|
+
_ts_metadata14("design:type", Function),
|
|
2644
|
+
_ts_metadata14("design:paramtypes", [
|
|
2500
2645
|
typeof Request === "undefined" ? Object : Request,
|
|
2501
2646
|
String,
|
|
2502
2647
|
String
|
|
2503
2648
|
]),
|
|
2504
|
-
|
|
2649
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2505
2650
|
], ThreadsController.prototype, "fork", null);
|
|
2506
|
-
|
|
2651
|
+
_ts_decorate15([
|
|
2507
2652
|
Patch(":id"),
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2653
|
+
_ts_param13(0, Req7()),
|
|
2654
|
+
_ts_param13(1, Param4("id")),
|
|
2655
|
+
_ts_param13(2, Body3()),
|
|
2656
|
+
_ts_metadata14("design:type", Function),
|
|
2657
|
+
_ts_metadata14("design:paramtypes", [
|
|
2513
2658
|
typeof Request === "undefined" ? Object : Request,
|
|
2514
2659
|
String,
|
|
2515
2660
|
typeof UpdateThreadBody === "undefined" ? Object : UpdateThreadBody
|
|
2516
2661
|
]),
|
|
2517
|
-
|
|
2662
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2518
2663
|
], ThreadsController.prototype, "update", null);
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2664
|
+
_ts_decorate15([
|
|
2665
|
+
Post4(":id/promote"),
|
|
2666
|
+
_ts_param13(0, Req7()),
|
|
2667
|
+
_ts_param13(1, Param4("id")),
|
|
2668
|
+
_ts_metadata14("design:type", Function),
|
|
2669
|
+
_ts_metadata14("design:paramtypes", [
|
|
2525
2670
|
typeof Request === "undefined" ? Object : Request,
|
|
2526
2671
|
String
|
|
2527
2672
|
]),
|
|
2528
|
-
|
|
2673
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2529
2674
|
], ThreadsController.prototype, "promote", null);
|
|
2530
|
-
|
|
2675
|
+
_ts_decorate15([
|
|
2531
2676
|
Delete2(":id/from/:messageId"),
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2677
|
+
_ts_param13(0, Req7()),
|
|
2678
|
+
_ts_param13(1, Param4("id")),
|
|
2679
|
+
_ts_param13(2, Param4("messageId")),
|
|
2680
|
+
_ts_metadata14("design:type", Function),
|
|
2681
|
+
_ts_metadata14("design:paramtypes", [
|
|
2537
2682
|
typeof Request === "undefined" ? Object : Request,
|
|
2538
2683
|
String,
|
|
2539
2684
|
String
|
|
2540
2685
|
]),
|
|
2541
|
-
|
|
2686
|
+
_ts_metadata14("design:returntype", Promise)
|
|
2542
2687
|
], ThreadsController.prototype, "truncateFrom", null);
|
|
2543
|
-
ThreadsController =
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2688
|
+
ThreadsController = _ts_decorate15([
|
|
2689
|
+
Controller8("threads"),
|
|
2690
|
+
_ts_param13(1, Inject13(AGENT_ACTOR_RESOLVER7)),
|
|
2691
|
+
_ts_metadata14("design:type", Function),
|
|
2692
|
+
_ts_metadata14("design:paramtypes", [
|
|
2548
2693
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2549
2694
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2550
2695
|
])
|
|
2551
2696
|
], ThreadsController);
|
|
2552
2697
|
|
|
2553
2698
|
// src/controller/tool-call.controller.ts
|
|
2554
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2555
|
-
import { BadRequestException as BadRequestException4, Body as
|
|
2556
|
-
function
|
|
2699
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER8 } from "@dudousxd/nestjs-agent-core";
|
|
2700
|
+
import { BadRequestException as BadRequestException4, Body as Body4, Controller as Controller9, Inject as Inject14, Post as Post5, Req as Req8 } from "@nestjs/common";
|
|
2701
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
2557
2702
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2558
2703
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2559
2704
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2566,19 +2711,19 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
2566
2711
|
}
|
|
2567
2712
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2568
2713
|
}
|
|
2569
|
-
__name(
|
|
2570
|
-
function
|
|
2714
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
2715
|
+
function _ts_metadata15(metadataKey, metadataValue) {
|
|
2571
2716
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2572
2717
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2573
2718
|
}
|
|
2574
2719
|
}
|
|
2575
|
-
__name(
|
|
2576
|
-
function
|
|
2720
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
2721
|
+
function _ts_param14(paramIndex, decorator) {
|
|
2577
2722
|
return function(target, key) {
|
|
2578
2723
|
decorator(target, key, paramIndex);
|
|
2579
2724
|
};
|
|
2580
2725
|
}
|
|
2581
|
-
__name(
|
|
2726
|
+
__name(_ts_param14, "_ts_param");
|
|
2582
2727
|
var MAX_ANSWERED_QUESTIONS = 100;
|
|
2583
2728
|
var MAX_VALUES_PER_QUESTION = 100;
|
|
2584
2729
|
var MAX_ANSWER_VALUE_LENGTH = 4096;
|
|
@@ -2707,64 +2852,64 @@ var ToolCallController = class {
|
|
|
2707
2852
|
};
|
|
2708
2853
|
}
|
|
2709
2854
|
};
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2855
|
+
_ts_decorate16([
|
|
2856
|
+
Post5("approve"),
|
|
2857
|
+
_ts_param14(0, Req8()),
|
|
2858
|
+
_ts_param14(1, Body4()),
|
|
2859
|
+
_ts_metadata15("design:type", Function),
|
|
2860
|
+
_ts_metadata15("design:paramtypes", [
|
|
2716
2861
|
typeof Request === "undefined" ? Object : Request,
|
|
2717
2862
|
typeof ApproveBody === "undefined" ? Object : ApproveBody
|
|
2718
2863
|
]),
|
|
2719
|
-
|
|
2864
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2720
2865
|
], ToolCallController.prototype, "approve", null);
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2866
|
+
_ts_decorate16([
|
|
2867
|
+
Post5("reject"),
|
|
2868
|
+
_ts_param14(0, Req8()),
|
|
2869
|
+
_ts_param14(1, Body4()),
|
|
2870
|
+
_ts_metadata15("design:type", Function),
|
|
2871
|
+
_ts_metadata15("design:paramtypes", [
|
|
2727
2872
|
typeof Request === "undefined" ? Object : Request,
|
|
2728
2873
|
typeof RejectBody === "undefined" ? Object : RejectBody
|
|
2729
2874
|
]),
|
|
2730
|
-
|
|
2875
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2731
2876
|
], ToolCallController.prototype, "reject", null);
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2877
|
+
_ts_decorate16([
|
|
2878
|
+
Post5("answer"),
|
|
2879
|
+
_ts_param14(0, Req8()),
|
|
2880
|
+
_ts_param14(1, Body4()),
|
|
2881
|
+
_ts_metadata15("design:type", Function),
|
|
2882
|
+
_ts_metadata15("design:paramtypes", [
|
|
2738
2883
|
typeof Request === "undefined" ? Object : Request,
|
|
2739
2884
|
typeof AnswerBody === "undefined" ? Object : AnswerBody
|
|
2740
2885
|
]),
|
|
2741
|
-
|
|
2886
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2742
2887
|
], ToolCallController.prototype, "answer", null);
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2888
|
+
_ts_decorate16([
|
|
2889
|
+
Post5("skip"),
|
|
2890
|
+
_ts_param14(0, Req8()),
|
|
2891
|
+
_ts_param14(1, Body4()),
|
|
2892
|
+
_ts_metadata15("design:type", Function),
|
|
2893
|
+
_ts_metadata15("design:paramtypes", [
|
|
2749
2894
|
typeof Request === "undefined" ? Object : Request,
|
|
2750
2895
|
Object
|
|
2751
2896
|
]),
|
|
2752
|
-
|
|
2897
|
+
_ts_metadata15("design:returntype", Promise)
|
|
2753
2898
|
], ToolCallController.prototype, "skip", null);
|
|
2754
|
-
ToolCallController =
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2899
|
+
ToolCallController = _ts_decorate16([
|
|
2900
|
+
Controller9("tool-call"),
|
|
2901
|
+
_ts_param14(1, Inject14(AGENT_ACTOR_RESOLVER8)),
|
|
2902
|
+
_ts_metadata15("design:type", Function),
|
|
2903
|
+
_ts_metadata15("design:paramtypes", [
|
|
2759
2904
|
typeof AgentService === "undefined" ? Object : AgentService,
|
|
2760
2905
|
typeof ActorResolver === "undefined" ? Object : ActorResolver
|
|
2761
2906
|
])
|
|
2762
2907
|
], ToolCallController);
|
|
2763
2908
|
|
|
2764
2909
|
// src/controller/tools.controller.ts
|
|
2765
|
-
import { AGENT_ACTOR_RESOLVER as
|
|
2766
|
-
import { Controller as
|
|
2767
|
-
function
|
|
2910
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER9, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY5, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
|
|
2911
|
+
import { Controller as Controller10, Get as Get8, Inject as Inject15, NotFoundException as NotFoundException3, Query as Query4, Req as Req9 } from "@nestjs/common";
|
|
2912
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
2768
2913
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2769
2914
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2770
2915
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2777,19 +2922,19 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
2777
2922
|
}
|
|
2778
2923
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2779
2924
|
}
|
|
2780
|
-
__name(
|
|
2781
|
-
function
|
|
2925
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
2926
|
+
function _ts_metadata16(metadataKey, metadataValue) {
|
|
2782
2927
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2783
2928
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2784
2929
|
}
|
|
2785
2930
|
}
|
|
2786
|
-
__name(
|
|
2787
|
-
function
|
|
2931
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
2932
|
+
function _ts_param15(paramIndex, decorator) {
|
|
2788
2933
|
return function(target, key) {
|
|
2789
2934
|
decorator(target, key, paramIndex);
|
|
2790
2935
|
};
|
|
2791
2936
|
}
|
|
2792
|
-
__name(
|
|
2937
|
+
__name(_ts_param15, "_ts_param");
|
|
2793
2938
|
var ToolsController = class {
|
|
2794
2939
|
static {
|
|
2795
2940
|
__name(this, "ToolsController");
|
|
@@ -2818,24 +2963,24 @@ var ToolsController = class {
|
|
|
2818
2963
|
}));
|
|
2819
2964
|
}
|
|
2820
2965
|
};
|
|
2821
|
-
|
|
2966
|
+
_ts_decorate17([
|
|
2822
2967
|
Get8(),
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2968
|
+
_ts_param15(0, Req9()),
|
|
2969
|
+
_ts_param15(1, Query4("agent")),
|
|
2970
|
+
_ts_metadata16("design:type", Function),
|
|
2971
|
+
_ts_metadata16("design:paramtypes", [
|
|
2827
2972
|
typeof Request === "undefined" ? Object : Request,
|
|
2828
2973
|
String
|
|
2829
2974
|
]),
|
|
2830
|
-
|
|
2975
|
+
_ts_metadata16("design:returntype", Promise)
|
|
2831
2976
|
], ToolsController.prototype, "list", null);
|
|
2832
|
-
ToolsController =
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2977
|
+
ToolsController = _ts_decorate17([
|
|
2978
|
+
Controller10("tools"),
|
|
2979
|
+
_ts_param15(0, Inject15(AGENT_ACTOR_RESOLVER9)),
|
|
2980
|
+
_ts_param15(1, Inject15(AGENT_DEPS_FACTORY5)),
|
|
2981
|
+
_ts_param15(2, Inject15(AGENT_REGISTRY3)),
|
|
2982
|
+
_ts_metadata16("design:type", Function),
|
|
2983
|
+
_ts_metadata16("design:paramtypes", [
|
|
2839
2984
|
typeof ActorResolver === "undefined" ? Object : ActorResolver,
|
|
2840
2985
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
2841
2986
|
typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4
|
|
@@ -2844,7 +2989,7 @@ ToolsController = _ts_decorate16([
|
|
|
2844
2989
|
|
|
2845
2990
|
// src/discovery/agent-discovery.service.ts
|
|
2846
2991
|
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
|
|
2992
|
+
import { Inject as Inject16, Injectable as Injectable7, Logger as Logger2 } from "@nestjs/common";
|
|
2848
2993
|
import { DiscoveryService, MetadataScanner } from "@nestjs/core";
|
|
2849
2994
|
|
|
2850
2995
|
// src/decorator/agent.decorator.ts
|
|
@@ -2861,7 +3006,7 @@ var SYSTEM_PROMPT_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:
|
|
|
2861
3006
|
var SYSTEM_PROMPT_CONTRIBUTOR_METADATA = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:system-prompt-contributor");
|
|
2862
3007
|
|
|
2863
3008
|
// src/discovery/agent-discovery.service.ts
|
|
2864
|
-
function
|
|
3009
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2865
3010
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2866
3011
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2867
3012
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2874,19 +3019,19 @@ function _ts_decorate17(decorators, target, key, desc) {
|
|
|
2874
3019
|
}
|
|
2875
3020
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2876
3021
|
}
|
|
2877
|
-
__name(
|
|
2878
|
-
function
|
|
3022
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
3023
|
+
function _ts_metadata17(metadataKey, metadataValue) {
|
|
2879
3024
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2880
3025
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
2881
3026
|
}
|
|
2882
3027
|
}
|
|
2883
|
-
__name(
|
|
2884
|
-
function
|
|
3028
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
3029
|
+
function _ts_param16(paramIndex, decorator) {
|
|
2885
3030
|
return function(target, key) {
|
|
2886
3031
|
decorator(target, key, paramIndex);
|
|
2887
3032
|
};
|
|
2888
3033
|
}
|
|
2889
|
-
__name(
|
|
3034
|
+
__name(_ts_param16, "_ts_param");
|
|
2890
3035
|
var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
2891
3036
|
static {
|
|
2892
3037
|
__name(this, "AgentDiscoveryService");
|
|
@@ -3013,12 +3158,12 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
|
|
|
3013
3158
|
return (ctx) => candidate.call(instance, ctx);
|
|
3014
3159
|
}
|
|
3015
3160
|
};
|
|
3016
|
-
AgentDiscoveryService =
|
|
3161
|
+
AgentDiscoveryService = _ts_decorate18([
|
|
3017
3162
|
Injectable7(),
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3163
|
+
_ts_param16(2, Inject16(AGENT_REGISTRY4)),
|
|
3164
|
+
_ts_param16(3, Inject16(AGENT_PROMPT_CONTRIBUTORS2)),
|
|
3165
|
+
_ts_metadata17("design:type", Function),
|
|
3166
|
+
_ts_metadata17("design:paramtypes", [
|
|
3022
3167
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
3023
3168
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
3024
3169
|
typeof AgentRegistry5 === "undefined" ? Object : AgentRegistry5,
|
|
@@ -3028,7 +3173,7 @@ AgentDiscoveryService = _ts_decorate17([
|
|
|
3028
3173
|
|
|
3029
3174
|
// src/discovery/ai-tool-discovery.service.ts
|
|
3030
3175
|
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
|
|
3176
|
+
import { Inject as Inject17, Injectable as Injectable8, Logger as Logger3 } from "@nestjs/common";
|
|
3032
3177
|
import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
|
|
3033
3178
|
import { z } from "zod";
|
|
3034
3179
|
|
|
@@ -3048,7 +3193,7 @@ function isBrandedFunctionalTool(value) {
|
|
|
3048
3193
|
__name(isBrandedFunctionalTool, "isBrandedFunctionalTool");
|
|
3049
3194
|
|
|
3050
3195
|
// src/discovery/ai-tool-discovery.service.ts
|
|
3051
|
-
function
|
|
3196
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
3052
3197
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3053
3198
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3054
3199
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3061,19 +3206,19 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
3061
3206
|
}
|
|
3062
3207
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3063
3208
|
}
|
|
3064
|
-
__name(
|
|
3065
|
-
function
|
|
3209
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3210
|
+
function _ts_metadata18(metadataKey, metadataValue) {
|
|
3066
3211
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3067
3212
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3068
3213
|
}
|
|
3069
3214
|
}
|
|
3070
|
-
__name(
|
|
3071
|
-
function
|
|
3215
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3216
|
+
function _ts_param17(paramIndex, decorator) {
|
|
3072
3217
|
return function(target, key) {
|
|
3073
3218
|
decorator(target, key, paramIndex);
|
|
3074
3219
|
};
|
|
3075
3220
|
}
|
|
3076
|
-
__name(
|
|
3221
|
+
__name(_ts_param17, "_ts_param");
|
|
3077
3222
|
var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
3078
3223
|
static {
|
|
3079
3224
|
__name(this, "AiToolDiscoveryService");
|
|
@@ -3206,13 +3351,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
|
|
|
3206
3351
|
return true;
|
|
3207
3352
|
}
|
|
3208
3353
|
};
|
|
3209
|
-
AiToolDiscoveryService =
|
|
3354
|
+
AiToolDiscoveryService = _ts_decorate19([
|
|
3210
3355
|
Injectable8(),
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3356
|
+
_ts_param17(1, Inject17(AGENT_TOOL_REGISTRY2)),
|
|
3357
|
+
_ts_param17(2, Inject17(AGENT_REGISTRY5)),
|
|
3358
|
+
_ts_param17(3, Inject17(AGENT_OPTIONS3)),
|
|
3359
|
+
_ts_metadata18("design:type", Function),
|
|
3360
|
+
_ts_metadata18("design:paramtypes", [
|
|
3216
3361
|
typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
|
|
3217
3362
|
typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
|
|
3218
3363
|
typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
|
|
@@ -3222,7 +3367,7 @@ AiToolDiscoveryService = _ts_decorate18([
|
|
|
3222
3367
|
|
|
3223
3368
|
// src/discovery/skill-discovery.service.ts
|
|
3224
3369
|
import { AGENT_SKILL_SOURCES } from "@dudousxd/nestjs-agent-core";
|
|
3225
|
-
import { Inject as
|
|
3370
|
+
import { Inject as Inject18, Injectable as Injectable9, Logger as Logger4 } from "@nestjs/common";
|
|
3226
3371
|
import { DiscoveryService as DiscoveryService3 } from "@nestjs/core";
|
|
3227
3372
|
|
|
3228
3373
|
// src/decorator/skill.decorator.ts
|
|
@@ -3239,7 +3384,7 @@ function skillScope(options) {
|
|
|
3239
3384
|
__name(skillScope, "skillScope");
|
|
3240
3385
|
|
|
3241
3386
|
// src/discovery/skill-discovery.service.ts
|
|
3242
|
-
function
|
|
3387
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
3243
3388
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3244
3389
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3245
3390
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3252,19 +3397,19 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
3252
3397
|
}
|
|
3253
3398
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3254
3399
|
}
|
|
3255
|
-
__name(
|
|
3256
|
-
function
|
|
3400
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3401
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
3257
3402
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3258
3403
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3259
3404
|
}
|
|
3260
3405
|
}
|
|
3261
|
-
__name(
|
|
3262
|
-
function
|
|
3406
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
3407
|
+
function _ts_param18(paramIndex, decorator) {
|
|
3263
3408
|
return function(target, key) {
|
|
3264
3409
|
decorator(target, key, paramIndex);
|
|
3265
3410
|
};
|
|
3266
3411
|
}
|
|
3267
|
-
__name(
|
|
3412
|
+
__name(_ts_param18, "_ts_param");
|
|
3268
3413
|
var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
3269
3414
|
static {
|
|
3270
3415
|
__name(this, "SkillDiscoveryService");
|
|
@@ -3308,11 +3453,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
|
|
|
3308
3453
|
return flat === void 0 ? void 0 : () => flat;
|
|
3309
3454
|
}
|
|
3310
3455
|
};
|
|
3311
|
-
SkillDiscoveryService =
|
|
3456
|
+
SkillDiscoveryService = _ts_decorate20([
|
|
3312
3457
|
Injectable9(),
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3458
|
+
_ts_param18(1, Inject18(AGENT_SKILL_SOURCES)),
|
|
3459
|
+
_ts_metadata19("design:type", Function),
|
|
3460
|
+
_ts_metadata19("design:paramtypes", [
|
|
3316
3461
|
typeof DiscoveryService3 === "undefined" ? Object : DiscoveryService3,
|
|
3317
3462
|
Array
|
|
3318
3463
|
])
|
|
@@ -3343,8 +3488,8 @@ var LedgerQuotaStore = class {
|
|
|
3343
3488
|
|
|
3344
3489
|
// src/runner/inline-agent-runner.ts
|
|
3345
3490
|
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
|
|
3491
|
+
import { Inject as Inject19, Injectable as Injectable10, Logger as Logger5 } from "@nestjs/common";
|
|
3492
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
3348
3493
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3349
3494
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3350
3495
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3357,19 +3502,19 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
3357
3502
|
}
|
|
3358
3503
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3359
3504
|
}
|
|
3360
|
-
__name(
|
|
3361
|
-
function
|
|
3505
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3506
|
+
function _ts_metadata20(metadataKey, metadataValue) {
|
|
3362
3507
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3363
3508
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3364
3509
|
}
|
|
3365
3510
|
}
|
|
3366
|
-
__name(
|
|
3367
|
-
function
|
|
3511
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
3512
|
+
function _ts_param19(paramIndex, decorator) {
|
|
3368
3513
|
return function(target, key) {
|
|
3369
3514
|
decorator(target, key, paramIndex);
|
|
3370
3515
|
};
|
|
3371
3516
|
}
|
|
3372
|
-
__name(
|
|
3517
|
+
__name(_ts_param19, "_ts_param");
|
|
3373
3518
|
var InlineAgentRunner = class _InlineAgentRunner {
|
|
3374
3519
|
static {
|
|
3375
3520
|
__name(this, "InlineAgentRunner");
|
|
@@ -3750,12 +3895,12 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
3750
3895
|
}
|
|
3751
3896
|
}
|
|
3752
3897
|
};
|
|
3753
|
-
InlineAgentRunner =
|
|
3898
|
+
InlineAgentRunner = _ts_decorate21([
|
|
3754
3899
|
Injectable10(),
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3900
|
+
_ts_param19(0, Inject19(AGENT_DEPS_FACTORY6)),
|
|
3901
|
+
_ts_param19(1, Inject19(AGENT_STORE5)),
|
|
3902
|
+
_ts_metadata20("design:type", Function),
|
|
3903
|
+
_ts_metadata20("design:paramtypes", [
|
|
3759
3904
|
typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
|
|
3760
3905
|
typeof AgentStore === "undefined" ? Object : AgentStore
|
|
3761
3906
|
])
|
|
@@ -3800,7 +3945,7 @@ function resolveSkillsConfig(options, declared) {
|
|
|
3800
3945
|
__name(resolveSkillsConfig, "resolveSkillsConfig");
|
|
3801
3946
|
|
|
3802
3947
|
// src/agent.module.ts
|
|
3803
|
-
function
|
|
3948
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
3804
3949
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3805
3950
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3806
3951
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3813,7 +3958,7 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
3813
3958
|
}
|
|
3814
3959
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3815
3960
|
}
|
|
3816
|
-
__name(
|
|
3961
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
3817
3962
|
var DEFAULT_PATH = "agent";
|
|
3818
3963
|
function sharedProviders(durable, includeStore) {
|
|
3819
3964
|
const providers = [
|
|
@@ -3872,7 +4017,7 @@ function sharedProviders(durable, includeStore) {
|
|
|
3872
4017
|
]
|
|
3873
4018
|
},
|
|
3874
4019
|
{
|
|
3875
|
-
provide:
|
|
4020
|
+
provide: AGENT_ACTOR_RESOLVER10,
|
|
3876
4021
|
useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
|
|
3877
4022
|
inject: [
|
|
3878
4023
|
AGENT_OPTIONS4
|
|
@@ -3957,7 +4102,7 @@ function exportsFor(includeStore) {
|
|
|
3957
4102
|
AGENT_REGISTRY6,
|
|
3958
4103
|
AGENT_SINK3,
|
|
3959
4104
|
AGENT_ROLES_POLICY2,
|
|
3960
|
-
|
|
4105
|
+
AGENT_ACTOR_RESOLVER10,
|
|
3961
4106
|
AGENT_MODEL2,
|
|
3962
4107
|
...includeStore ? [
|
|
3963
4108
|
AGENT_STORE6
|
|
@@ -3982,7 +4127,8 @@ var BASE_CONTROLLERS = [
|
|
|
3982
4127
|
AgentsController,
|
|
3983
4128
|
SkillsController,
|
|
3984
4129
|
MemoriesController,
|
|
3985
|
-
ToolsController
|
|
4130
|
+
ToolsController,
|
|
4131
|
+
MessagesController
|
|
3986
4132
|
];
|
|
3987
4133
|
var GUARDABLE_CONTROLLERS = [
|
|
3988
4134
|
...BASE_CONTROLLERS,
|
|
@@ -4085,7 +4231,7 @@ var AgentModule = class _AgentModule {
|
|
|
4085
4231
|
};
|
|
4086
4232
|
}
|
|
4087
4233
|
};
|
|
4088
|
-
AgentModule =
|
|
4234
|
+
AgentModule = _ts_decorate22([
|
|
4089
4235
|
Global2(),
|
|
4090
4236
|
Module2({})
|
|
4091
4237
|
], AgentModule);
|