@dudousxd/nestjs-agent 1.13.0 → 1.14.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/dist/durable/index.cjs +25 -10
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +26 -11
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +25 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +26 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/durable/index.cjs
CHANGED
|
@@ -3384,19 +3384,34 @@ var ToolsController = class {
|
|
|
3384
3384
|
this.agents = agents;
|
|
3385
3385
|
}
|
|
3386
3386
|
async list(req, agent) {
|
|
3387
|
-
if (agent !== void 0 && this.agents.get(agent) === void 0) {
|
|
3387
|
+
if (agent !== void 0 && agent !== import_nestjs_agent_core20.ALL_AGENTS && this.agents.get(agent) === void 0) {
|
|
3388
3388
|
throw new import_common19.NotFoundException(`No agent named "${agent}"`);
|
|
3389
3389
|
}
|
|
3390
3390
|
const actor = await this.actorResolver.resolve(req);
|
|
3391
|
-
const
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3391
|
+
const names = agent === import_nestjs_agent_core20.ALL_AGENTS ? [
|
|
3392
|
+
void 0,
|
|
3393
|
+
...this.agents.list().map((definition) => definition.name)
|
|
3394
|
+
] : [
|
|
3395
|
+
agent
|
|
3396
|
+
];
|
|
3397
|
+
const entries = /* @__PURE__ */ new Map();
|
|
3398
|
+
for (const name of names) {
|
|
3399
|
+
const deps = this.depsFactory.forAgent(name);
|
|
3400
|
+
const specs = await deps.registry.visibleSpecs(actor, deps.rolesPolicy, deps.toolAllowList);
|
|
3401
|
+
for (const spec of specs) {
|
|
3402
|
+
if (entries.has(spec.name)) continue;
|
|
3403
|
+
entries.set(spec.name, {
|
|
3404
|
+
name: spec.name,
|
|
3405
|
+
kind: spec.kind,
|
|
3406
|
+
...spec.presentation !== void 0 ? {
|
|
3407
|
+
presentation: spec.presentation
|
|
3408
|
+
} : {}
|
|
3409
|
+
});
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
return [
|
|
3413
|
+
...entries.values()
|
|
3414
|
+
];
|
|
3400
3415
|
}
|
|
3401
3416
|
};
|
|
3402
3417
|
_ts_decorate19([
|