@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/index.cjs
CHANGED
|
@@ -2648,19 +2648,34 @@ var ToolsController = class {
|
|
|
2648
2648
|
this.agents = agents;
|
|
2649
2649
|
}
|
|
2650
2650
|
async list(req, agent) {
|
|
2651
|
-
if (agent !== void 0 && this.agents.get(agent) === void 0) {
|
|
2651
|
+
if (agent !== void 0 && agent !== import_nestjs_agent_core15.ALL_AGENTS && this.agents.get(agent) === void 0) {
|
|
2652
2652
|
throw new import_common15.NotFoundException(`No agent named "${agent}"`);
|
|
2653
2653
|
}
|
|
2654
2654
|
const actor = await this.actorResolver.resolve(req);
|
|
2655
|
-
const
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2655
|
+
const names = agent === import_nestjs_agent_core15.ALL_AGENTS ? [
|
|
2656
|
+
void 0,
|
|
2657
|
+
...this.agents.list().map((definition) => definition.name)
|
|
2658
|
+
] : [
|
|
2659
|
+
agent
|
|
2660
|
+
];
|
|
2661
|
+
const entries = /* @__PURE__ */ new Map();
|
|
2662
|
+
for (const name of names) {
|
|
2663
|
+
const deps = this.depsFactory.forAgent(name);
|
|
2664
|
+
const specs = await deps.registry.visibleSpecs(actor, deps.rolesPolicy, deps.toolAllowList);
|
|
2665
|
+
for (const spec of specs) {
|
|
2666
|
+
if (entries.has(spec.name)) continue;
|
|
2667
|
+
entries.set(spec.name, {
|
|
2668
|
+
name: spec.name,
|
|
2669
|
+
kind: spec.kind,
|
|
2670
|
+
...spec.presentation !== void 0 ? {
|
|
2671
|
+
presentation: spec.presentation
|
|
2672
|
+
} : {}
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
return [
|
|
2677
|
+
...entries.values()
|
|
2678
|
+
];
|
|
2664
2679
|
}
|
|
2665
2680
|
};
|
|
2666
2681
|
_ts_decorate15([
|