@dudousxd/nestjs-agent 1.1.2 → 1.2.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 +29 -0
- package/dist/durable/index.cjs +220 -135
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +149 -64
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +226 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -2
- package/dist/index.d.ts +42 -2
- package/dist/index.js +150 -64
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -41,6 +41,35 @@ The module mounts SSE + REST endpoints under `/agent` (`POST /agent/chat`, tool-
|
|
|
41
41
|
threads, quota). Add `durable: true` + `AgentDurableModule` for the durable runner;
|
|
42
42
|
`AgentModule.forFeature([…])` for multi-agent orchestration.
|
|
43
43
|
|
|
44
|
+
### How a chat talks about a tool
|
|
45
|
+
|
|
46
|
+
A tool's name is an identifier, not copy. Declare how a person-facing surface narrates it beside its
|
|
47
|
+
input schema, so whoever renames an input field is the one who re-words the sentence that mentions
|
|
48
|
+
it:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
@AiTool({
|
|
52
|
+
name: 'purgeCache',
|
|
53
|
+
kind: 'action',
|
|
54
|
+
description: 'Purge a cache key.',
|
|
55
|
+
input: z.object({ key: z.string() }),
|
|
56
|
+
presentation: {
|
|
57
|
+
label: 'Cache purge',
|
|
58
|
+
running: 'Purging {key}', // templates over the call's INPUT
|
|
59
|
+
done: 'Purged {key}',
|
|
60
|
+
icon: 'cache', // a key into the client's own glyph map
|
|
61
|
+
tone: 'destructive',
|
|
62
|
+
confirm: { title: 'Purge {key}?', verb: 'Purge' },
|
|
63
|
+
result: { kind: 'metrics', fields: [{ path: 'evicted', label: 'Evicted' }] }, // over the OUTPUT
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`GET /agent/tools?agent=<name>` returns `ToolCatalogEntry[]` — `{ name, kind, presentation? }` for the
|
|
69
|
+
tools THIS actor can reach through that agent (the default agent when omitted; `404` for an unknown
|
|
70
|
+
one), built by `ToolRegistry.visibleSpecs`, the same gates the model is offered tools through. The
|
|
71
|
+
React package's `useToolCatalog` reads it. The model never sees `presentation`.
|
|
72
|
+
|
|
44
73
|
### Message attachments
|
|
45
74
|
|
|
46
75
|
A chat turn attaches a file by **`mediaId` only**:
|