Skip to content

Commit 1f0d11d

Browse files
dwivnaclaude
andcommitted
Resync lockfile version; document global registries; refresh metadata
- package-lock.json: root version field was stale (1.2.0) from sed-based version bumps that skipped npm install. Resynced to 2.8.0. (npm ci still passed — it tolerates the root version field as long as the dependency tree matches, which it did — so CI was not red; this is a cleanliness fix.) - Docs: disclose that @secret field names are matched process-globally by redact(), and that @tool names are a process-global unique registry (duplicates overwrite). README + JSDoc + llms.txt. - package.json: description + keywords now cover resilience, observability, redaction, and AI tools for discoverability. 105 main + 2 dist green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent 3ad6ec3 commit 1f0d11d

5 files changed

Lines changed: 30 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ request.
105105
> sensitive. It cannot mask a secret passed as a positional **primitive**
106106
> (e.g. `login(rawToken)`) or one embedded in an error message/stack. Pass
107107
> secrets as named object fields, and don't put them in error messages.
108+
>
109+
> `@Secret` field names are registered **process-globally**, so `redact()` masks
110+
> that field name everywhere — pick distinctive secret field names (`jwtSecret`,
111+
> not `id`) to avoid over-masking unrelated fields.
108112
109113
```ts
110114
import { redact, redactFormat } from '@master4n/decorators';
@@ -246,6 +250,10 @@ const result = invokeTool(new WeatherService(), call.name, call.arguments);
246250
`parameters` is an **explicit** JSON Schema — TypeScript parameter types are
247251
erased at runtime, so the library does not (and cannot honestly) infer it.
248252

253+
> Tool names live in a **process-global** registry and must be unique — a
254+
> duplicate name overwrites the earlier one (so `invokeTool` would target the
255+
> wrong method). Give colliding tools an explicit unique `name`.
256+
249257
## Observability (method decorators)
250258

251259
| Decorator | Description |

llms.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class AppConfig {
133133
(OpenAI `tools`/`parameters`, Anthropic `input_schema`).
134134
- `invokeTool(instance, name, args)` — dispatch a model tool call to the method on `instance`.
135135
- `clearTools()` — clear the registry (tests). Types: `ToolOptions`, `ToolManifest`, `ToolParameters`.
136+
- Tool names are process-global and must be unique (a duplicate overwrites the earlier entry).
136137

137138
## Observability (method decorators)
138139

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@master4n/decorators",
33
"version": "2.8.0",
4-
"description": "AI-friendly TypeScript decorators for Node/backend apps — Spring-style config & value injection (@Value/@Env/@Config), validation, and boilerplate-reducing utilities. One decorator replaces a block of code.",
4+
"description": "AI-friendly TypeScript decorators for Node/backend apps: config & value injection, validation & transforms, resilience (retry, timeout, circuit breaker, rate limit, cache), observability (trace, audit), secret redaction, and LLM @Tool registration. One decorator replaces a block of code.",
55
"main": "./dist/commonjs/index.cjs",
66
"module": "./dist/esm/index.js",
77
"types": "./dist/index.d.ts",
@@ -38,6 +38,19 @@
3838
"dotenv",
3939
"yaml",
4040
"validation",
41+
"transform",
42+
"retry",
43+
"timeout",
44+
"circuit-breaker",
45+
"rate-limit",
46+
"cache",
47+
"memoize",
48+
"debounce",
49+
"observability",
50+
"redaction",
51+
"llm",
52+
"tools",
53+
"agent",
4154
"ai-agents",
4255
"ai-friendly",
4356
"boilerplate"

src/services/ai.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ const tools = new Map<string, ToolEntry>();
4343
*
4444
* The method should accept a single arguments object matching `parameters`.
4545
*
46+
* Tool names are registered in a **process-global** registry and must be unique:
47+
* a duplicate name (including two classes relying on the same default method
48+
* name) overwrites the earlier entry, so `invokeTool` would dispatch to the
49+
* last-registered method. Give colliding tools explicit, unique `name`s.
50+
*
4651
* @example
4752
* class Weather {
4853
* \@Tool({

0 commit comments

Comments
 (0)