@cyanheads/mcp-ts-core 0.13.4 → 0.13.5
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/AGENTS.md +4 -4
- package/CLAUDE.md +4 -4
- package/README.md +1 -1
- package/changelog/0.13.x/0.13.5.md +41 -0
- package/dist/linter/rules/error-contract-rules.d.ts +65 -3
- package/dist/linter/rules/error-contract-rules.d.ts.map +1 -1
- package/dist/linter/rules/error-contract-rules.js +138 -3
- package/dist/linter/rules/error-contract-rules.js.map +1 -1
- package/dist/linter/rules/index.d.ts +1 -1
- package/dist/linter/rules/index.d.ts.map +1 -1
- package/dist/linter/rules/index.js +1 -1
- package/dist/linter/rules/index.js.map +1 -1
- package/dist/linter/rules/resource-rules.d.ts.map +1 -1
- package/dist/linter/rules/resource-rules.js +4 -2
- package/dist/linter/rules/resource-rules.js.map +1 -1
- package/dist/linter/rules/tool-rules.d.ts.map +1 -1
- package/dist/linter/rules/tool-rules.js +4 -2
- package/dist/linter/rules/tool-rules.js.map +1 -1
- package/dist/mcp-server/handlerContext.d.ts +5 -2
- package/dist/mcp-server/handlerContext.d.ts.map +1 -1
- package/dist/mcp-server/handlerContext.js +6 -4
- package/dist/mcp-server/handlerContext.js.map +1 -1
- package/dist/mcp-server/inputRequired.d.ts +35 -2
- package/dist/mcp-server/inputRequired.d.ts.map +1 -1
- package/dist/mcp-server/inputRequired.js +116 -2
- package/dist/mcp-server/inputRequired.js.map +1 -1
- package/dist/mcp-server/resources/resource-registration.d.ts +2 -1
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +4 -4
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +2 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +5 -2
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +11 -2
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts +2 -1
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +4 -4
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +14 -4
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +83 -9
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/services/canvas/core/CanvasInstance.d.ts +4 -1
- package/dist/services/canvas/core/CanvasInstance.d.ts.map +1 -1
- package/dist/services/canvas/core/CanvasInstance.js +5 -0
- package/dist/services/canvas/core/CanvasInstance.js.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.d.ts +52 -1
- package/dist/services/canvas/core/CanvasRegistry.d.ts.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.js +79 -3
- package/dist/services/canvas/core/CanvasRegistry.js.map +1 -1
- package/dist/services/canvas/index.d.ts +1 -1
- package/dist/services/canvas/index.d.ts.map +1 -1
- package/dist/services/canvas/index.js +1 -1
- package/dist/services/canvas/index.js.map +1 -1
- package/dist/types-global/errors.d.ts +30 -0
- package/dist/types-global/errors.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.js +13 -3
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
- package/dist/utils/internal/error-handler/mappings.d.ts +14 -1
- package/dist/utils/internal/error-handler/mappings.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/mappings.js +19 -1
- package/dist/utils/internal/error-handler/mappings.js.map +1 -1
- package/dist/utils/internal/error-handler/types.d.ts +12 -1
- package/dist/utils/internal/error-handler/types.d.ts.map +1 -1
- package/dist/utils/internal/performance.d.ts.map +1 -1
- package/dist/utils/internal/performance.js +4 -1
- package/dist/utils/internal/performance.js.map +1 -1
- package/dist/utils/network/fetchWithTimeout.d.ts +24 -4
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +10 -6
- package/dist/utils/network/fetchWithTimeout.js.map +1 -1
- package/dist/utils/network/httpError.d.ts +43 -4
- package/dist/utils/network/httpError.d.ts.map +1 -1
- package/dist/utils/network/httpError.js +53 -6
- package/dist/utils/network/httpError.js.map +1 -1
- package/dist/utils/telemetry/attributes.d.ts +8 -0
- package/dist/utils/telemetry/attributes.d.ts.map +1 -1
- package/dist/utils/telemetry/attributes.js +8 -0
- package/dist/utils/telemetry/attributes.js.map +1 -1
- package/framework-skills/add-tool/SKILL.md +7 -4
- package/framework-skills/api-canvas/SKILL.md +31 -14
- package/framework-skills/api-context/SKILL.md +4 -2
- package/framework-skills/api-errors/SKILL.md +35 -7
- package/framework-skills/api-linter/SKILL.md +45 -3
- package/framework-skills/api-telemetry/SKILL.md +18 -3
- package/framework-skills/api-utils/SKILL.md +4 -4
- package/framework-skills/design-mcp-server/SKILL.md +4 -2
- package/framework-skills/field-test/SKILL.md +2 -2
- package/package.json +1 -1
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Package:** `@cyanheads/mcp-ts-core`
|
|
4
|
-
**Version:** 0.13.
|
|
4
|
+
**Version:** 0.13.5
|
|
5
5
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
6
6
|
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
|
|
7
7
|
**Zod:** ^4.6.5
|
|
@@ -378,7 +378,7 @@ See `api-context` skill for full details.
|
|
|
378
378
|
|
|
379
379
|
## Error Handling
|
|
380
380
|
|
|
381
|
-
**Recommended path: declare a typed error contract.** Add `errors: [{ reason, code, when, recovery, retryable? }]` to `tool()` / `resource()`. Handler gets `ctx.fail(reason, msg?, data?)` typed against the reason union — typos fail at compile time. Runtime auto-populates `data.reason` for observability; linter enforces conformance against the handler body. `recovery` is required (≥5 words, lint-validated) — the single source of truth for the wire hint. Spread `ctx.recoveryFor('reason')` into `data` to opt the contract recovery onto the wire (framework mirrors `data.recovery.hint` into `content[]` text); override with explicit `{ recovery: { hint: '...' } }` when runtime context matters.
|
|
381
|
+
**Recommended path: declare a typed error contract.** Add `errors: [{ reason, code, when, recovery, retryable?, severity? }]` to `tool()` / `resource()`. Handler gets `ctx.fail(reason, msg?, data?)` typed against the reason union — typos fail at compile time. Runtime auto-populates `data.reason` for observability; linter enforces conformance against the handler body. `recovery` is required (≥5 words, lint-validated) — the single source of truth for the wire hint. Spread `ctx.recoveryFor('reason')` into `data` to opt the contract recovery onto the wire (framework mirrors `data.recovery.hint` into `content[]` text); override with explicit `{ recovery: { hint: '...' } }` when runtime context matters. Optional `severity` (`debug`/`info`/`notice`/`warning`) logs a modeled outcome below `error` — tools only, logging only: the wire envelope, the span status, and the `mcp.tool.*` metrics are untouched.
|
|
382
382
|
|
|
383
383
|
```ts
|
|
384
384
|
errors: [
|
|
@@ -418,9 +418,9 @@ For HTTP responses from upstream APIs, use `httpErrorFromResponse(response, { se
|
|
|
418
418
|
|
|
419
419
|
**Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: request signal already aborted (→ `RequestCancelled`, outranking the thrown value's own code, `McpError` included) → `McpError` code (preserved as-is) → SDK `ConnectionClosed` (→ `RequestCancelled`) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name (→ `Timeout`) → `InternalError` fallback.
|
|
420
420
|
|
|
421
|
-
**Error-path parity.** Tool errors: `content[]` carries
|
|
421
|
+
**Error-path parity.** Tool errors: `content[]` carries `Error: <message>`, then `Recovery: <hint>` when the hint says something the message does not already contain, then a closing `(reason … · not retryable)` for whichever of `data.reason` / `data.retryable` is present; the numeric code and `data.issues` stay JSON-only. `structuredContent.error` carries `{ code, message, data? }`. No `_meta.error`. Resources re-throw via JSON-RPC error envelope. An argument rejection is one of them: `-32602` with `data.issues`, plus `data.reason: 'invalid_arguments'` and a hint synthesized from the issues and the root schema — never a tool-declared `reason`, since the handler never ran. `client_capability_missing` is the second framework-owned reason: a `ctx.requestInput` return a 2025-era connection cannot serve is refused before any wire traffic as `-32600` carrying that reason and a hint naming the capability.
|
|
422
422
|
|
|
423
|
-
**Lint rules** (all warnings, surfaced in `devcheck`): `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, `error-contract-conformance`, `error-contract-prefer-fail
|
|
423
|
+
**Lint rules** (all warnings, surfaced in `devcheck`): `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, `error-contract-conformance`, `error-contract-prefer-fail`, `error-contract-unthrown` (a declared reason no literal `ctx.fail`/`ctx.recoveryFor` in the handler names). See `api-linter` skill.
|
|
424
424
|
|
|
425
425
|
See `api-errors` skill for the full pattern-matching table, error code reference, and detailed examples.
|
|
426
426
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Package:** `@cyanheads/mcp-ts-core`
|
|
4
|
-
**Version:** 0.13.
|
|
4
|
+
**Version:** 0.13.5
|
|
5
5
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
6
6
|
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
|
|
7
7
|
**Zod:** ^4.6.5
|
|
@@ -378,7 +378,7 @@ See `api-context` skill for full details.
|
|
|
378
378
|
|
|
379
379
|
## Error Handling
|
|
380
380
|
|
|
381
|
-
**Recommended path: declare a typed error contract.** Add `errors: [{ reason, code, when, recovery, retryable? }]` to `tool()` / `resource()`. Handler gets `ctx.fail(reason, msg?, data?)` typed against the reason union — typos fail at compile time. Runtime auto-populates `data.reason` for observability; linter enforces conformance against the handler body. `recovery` is required (≥5 words, lint-validated) — the single source of truth for the wire hint. Spread `ctx.recoveryFor('reason')` into `data` to opt the contract recovery onto the wire (framework mirrors `data.recovery.hint` into `content[]` text); override with explicit `{ recovery: { hint: '...' } }` when runtime context matters.
|
|
381
|
+
**Recommended path: declare a typed error contract.** Add `errors: [{ reason, code, when, recovery, retryable?, severity? }]` to `tool()` / `resource()`. Handler gets `ctx.fail(reason, msg?, data?)` typed against the reason union — typos fail at compile time. Runtime auto-populates `data.reason` for observability; linter enforces conformance against the handler body. `recovery` is required (≥5 words, lint-validated) — the single source of truth for the wire hint. Spread `ctx.recoveryFor('reason')` into `data` to opt the contract recovery onto the wire (framework mirrors `data.recovery.hint` into `content[]` text); override with explicit `{ recovery: { hint: '...' } }` when runtime context matters. Optional `severity` (`debug`/`info`/`notice`/`warning`) logs a modeled outcome below `error` — tools only, logging only: the wire envelope, the span status, and the `mcp.tool.*` metrics are untouched.
|
|
382
382
|
|
|
383
383
|
```ts
|
|
384
384
|
errors: [
|
|
@@ -418,9 +418,9 @@ For HTTP responses from upstream APIs, use `httpErrorFromResponse(response, { se
|
|
|
418
418
|
|
|
419
419
|
**Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: request signal already aborted (→ `RequestCancelled`, outranking the thrown value's own code, `McpError` included) → `McpError` code (preserved as-is) → SDK `ConnectionClosed` (→ `RequestCancelled`) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name (→ `Timeout`) → `InternalError` fallback.
|
|
420
420
|
|
|
421
|
-
**Error-path parity.** Tool errors: `content[]` carries
|
|
421
|
+
**Error-path parity.** Tool errors: `content[]` carries `Error: <message>`, then `Recovery: <hint>` when the hint says something the message does not already contain, then a closing `(reason … · not retryable)` for whichever of `data.reason` / `data.retryable` is present; the numeric code and `data.issues` stay JSON-only. `structuredContent.error` carries `{ code, message, data? }`. No `_meta.error`. Resources re-throw via JSON-RPC error envelope. An argument rejection is one of them: `-32602` with `data.issues`, plus `data.reason: 'invalid_arguments'` and a hint synthesized from the issues and the root schema — never a tool-declared `reason`, since the handler never ran. `client_capability_missing` is the second framework-owned reason: a `ctx.requestInput` return a 2025-era connection cannot serve is refused before any wire traffic as `-32600` carrying that reason and a hint naming the capability.
|
|
422
422
|
|
|
423
|
-
**Lint rules** (all warnings, surfaced in `devcheck`): `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, `error-contract-conformance`, `error-contract-prefer-fail
|
|
423
|
+
**Lint rules** (all warnings, surfaced in `devcheck`): `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, `error-contract-conformance`, `error-contract-prefer-fail`, `error-contract-unthrown` (a declared reason no literal `ctx.fail`/`ctx.recoveryFor` in the handler names). See `api-linter` skill.
|
|
424
424
|
|
|
425
425
|
See `api-errors` skill for the full pattern-matching table, error code reference, and detailed examples.
|
|
426
426
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
8
8
|
|
|
9
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://modelcontextprotocol.io/specification/2026-07-28)
|
|
10
10
|
|
|
11
11
|
[](https://modelcontextprotocol.io/) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
12
12
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Tool error text closes with the reason and retryable terms a caller branches on, a ctx.requestInput no 2025-era client capability can serve is refused with a real error envelope, an errors[] entry can declare a log severity below error, and a malformed canvas_id is an input error rather than an expired canvas."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
agent-notes: |
|
|
6
|
+
Three adoption steps for a consumer upgrading from 0.13.4.
|
|
7
|
+
|
|
8
|
+
1. A test pinning `content[0].text` exactly moves for any tool error whose
|
|
9
|
+
`data` carries a `reason` or a boolean `retryable` — the text now closes
|
|
10
|
+
with `(reason <reason> · not retryable)`. Assert containment instead.
|
|
11
|
+
`toolContractSuite`'s `^Error:` assertion is unaffected.
|
|
12
|
+
2. Declare a tool's `canvas_id` *input* field with `CanvasIdSchema` from
|
|
13
|
+
`@cyanheads/mcp-ts-core/canvas` (add your own `.describe()` naming the
|
|
14
|
+
producing tool). The *output* `canvas_id` stays a plain `z.string()`.
|
|
15
|
+
3. `error-contract-unthrown` is new and fires on the next `devcheck`: a
|
|
16
|
+
declared `errors[]` reason no literal `ctx.fail('<reason>'` in the handler
|
|
17
|
+
names. Wire the throw, or drop the entry.
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# 0.13.5 — 2026-09-18
|
|
21
|
+
|
|
22
|
+
## Added
|
|
23
|
+
|
|
24
|
+
- **`severity` on an `errors[]` entry** ([#380](https://github.com/cyanheads/mcp-ts-core/issues/380)) — `debug`, `info`, `notice`, or `warning`, resolved against the thrown error's `data.reason`. It moves that one log record's level and adds `mcp.error.severity` to `mcp.errors.classified`; the wire envelope, the span status, and the `mcp.tool.*` counters are untouched. Tools only.
|
|
25
|
+
- **`CanvasIdSchema`** from `/canvas` ([#327](https://github.com/cyanheads/mcp-ts-core/issues/327)) — the minted `^[A-Za-z0-9_-]{10}$` shape, for a tool's `canvas_id` *input* field so the constraint reaches `inputSchema` and an impossible value is rejected at argument validation.
|
|
26
|
+
- **`errorHeaders` on `fetchWithTimeout` and `httpErrorFromResponse`** ([#302](https://github.com/cyanheads/mcp-ts-core/issues/302)) — an allowlist of response headers copied onto `error.data.headers` under lowercase keys on a non-2xx. Every selected value reaches the client, so never name a credential-bearing header; `set-cookie` is never captured.
|
|
27
|
+
- **Lint rules `error-contract-unthrown` (warning) and `error-contract-severity-unknown` (error)** ([#290](https://github.com/cyanheads/mcp-ts-core/issues/290), [#380](https://github.com/cyanheads/mcp-ts-core/issues/380)) — a declared reason no literal `ctx.fail` / `ctx.recoveryFor` in the handler names, and a `severity` outside the four levels.
|
|
28
|
+
|
|
29
|
+
## Changed
|
|
30
|
+
|
|
31
|
+
- **Tool error `content[]` closes with `(reason … · not retryable)`** ([#458](https://github.com/cyanheads/mcp-ts-core/issues/458)) whenever `data.reason` is a non-empty string or `data.retryable` a boolean. The numeric code and `data.issues` stay JSON-only, and `structuredContent` is byte-identical to before.
|
|
32
|
+
- **The `Recovery:` line is dropped when the trimmed message already contains the hint verbatim** ([#459](https://github.com/cyanheads/mcp-ts-core/issues/459)) — the case a constraint or refinement rejection produces, whose synthesized hint is the issue's own message. `structuredContent.error.data.recovery.hint` stays populated.
|
|
33
|
+
- **The canvas tenant-cap refusal keeps `RateLimited` and names itself** ([#275](https://github.com/cyanheads/mcp-ts-core/issues/275)) — `data.reason: 'canvas_capacity_exhausted'`, `retryable: true`, and a hint leading with reusing a held `canvas_id`. `getErrorCategory` reads the error data alongside the code, so `mcp.tool.error_category` files it as `server` rather than `upstream`.
|
|
34
|
+
- Skill versions: `add-tool` 2.27 → 2.28, `api-canvas` 2.2 → 2.3, `api-context` 2.4 → 2.5, `api-errors` 1.13 → 1.14, `api-linter` 1.15 → 1.16, `api-telemetry` 1.11 → 1.12, `api-utils` 2.10 → 2.11, `design-mcp-server` 2.27 → 2.28, `field-test` 2.15 → 2.16.
|
|
35
|
+
|
|
36
|
+
## Fixed
|
|
37
|
+
|
|
38
|
+
- **A `ctx.requestInput` the connection cannot serve fails with an error envelope** ([#379](https://github.com/cyanheads/mcp-ts-core/issues/379)) — on a 2025-era connection declaring no matching capability, `ctx.requestInput` throws `InvalidRequest` (`-32600`) with `data.reason: 'client_capability_missing'` and a hint naming `elicitation.form`, `elicitation.url`, `sampling.tools`, or `roots`, in place of the bare `isError` text block. A resource read gets the same code, reason, and hint instead of `-32603`. Still refused before any wire traffic; the 2026-07-28 leg is unchanged.
|
|
39
|
+
- **The advertised `error.data.reason` description terminates each contract entry's `when`** ([#389](https://github.com/cyanheads/mcp-ts-core/issues/389)), so entries no longer run into each other or into the trailing sentence. Authored text is untouched — a `when` already ending in `.`, `?`, or `!` takes no second terminator.
|
|
40
|
+
- **A malformed `canvas_id` is a `ValidationError`, not an expired canvas** ([#327](https://github.com/cyanheads/mcp-ts-core/issues/327)) — `data.reason: 'canvas_id_malformed'` before any registry lookup, on `acquire`, `drop` (which previously reported a silent `false`), and `importFrom`'s source id. A well-formed id that is missing, expired, or another tenant's keeps `canvas_not_found`.
|
|
41
|
+
- **A 3xx maps to `InvalidRequest` rather than `InternalError`** ([#460](https://github.com/cyanheads/mcp-ts-core/issues/460)) — reachable under `redirect: 'manual'`, where `httpStatusToErrorCode` previously fell through to a code meaning *this* server failed. Outside `withRetry`'s transient set, since re-issuing returns the same redirect.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Lint rules for the declarative `errors[]` contract on tool and
|
|
3
|
-
* resource definitions. Validates structure (codes, reasons
|
|
4
|
-
* and
|
|
5
|
-
* codes
|
|
3
|
+
* resource definitions. Validates structure (codes, reasons, severity),
|
|
4
|
+
* uniqueness, and — when a contract is present — cross-checks the handler body
|
|
5
|
+
* in both directions: codes thrown but not declared, and reasons declared but
|
|
6
|
+
* never thrown.
|
|
6
7
|
* @module src/linter/rules/error-contract-rules
|
|
7
8
|
*/
|
|
8
9
|
import type { LintDefinitionType, LintDiagnostic } from '../types.js';
|
|
@@ -16,6 +17,7 @@ import type { LintDefinitionType, LintDiagnostic } from '../types.js';
|
|
|
16
17
|
* - `recovery` is non-empty and ≥ 5 words (forcing function for thoughtful
|
|
17
18
|
* agent guidance — placeholders like "Try again." get flagged)
|
|
18
19
|
* - `retryable` (when present) is a boolean
|
|
20
|
+
* - `severity` (when present) is one of the four levels below `error`
|
|
19
21
|
*/
|
|
20
22
|
export declare function lintErrorContract(errors: unknown, definitionType: LintDefinitionType, definitionName: string): LintDiagnostic[];
|
|
21
23
|
/**
|
|
@@ -46,4 +48,64 @@ export declare function lintErrorContractConformance(def: {
|
|
|
46
48
|
handler?: unknown;
|
|
47
49
|
errors?: unknown;
|
|
48
50
|
}, definitionType: LintDefinitionType, definitionName: string): LintDiagnostic[];
|
|
51
|
+
/** One literal `ctx.fail('<reason>', …)` (or `ctx.recoveryFor`) call site. */
|
|
52
|
+
export interface ReasonCallSite {
|
|
53
|
+
/** Source offset just past the site's closing `)`. */
|
|
54
|
+
end: number;
|
|
55
|
+
/** The reason named by the site's first argument, read from the raw source. */
|
|
56
|
+
reason: string;
|
|
57
|
+
/** Source offset of the site's opening `(`. */
|
|
58
|
+
start: number;
|
|
59
|
+
}
|
|
60
|
+
/** What {@link scanReasonCalls} found for one callee in a handler's source. */
|
|
61
|
+
export interface ReasonCallScan {
|
|
62
|
+
/**
|
|
63
|
+
* True when some call site took a non-literal first argument — a variable, a
|
|
64
|
+
* template literal, a map lookup. The set of reasons in play is then unknown.
|
|
65
|
+
*/
|
|
66
|
+
indeterminate: boolean;
|
|
67
|
+
/** Every literal call site found, in source order. */
|
|
68
|
+
sites: ReasonCallSite[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Finds every `<callee>('<literal>', …)` site in a handler's source, one record
|
|
72
|
+
* per site.
|
|
73
|
+
*
|
|
74
|
+
* Matching runs over the comment- and string-stripped text, which already
|
|
75
|
+
* excludes a call written inside a comment or nested in another literal. That
|
|
76
|
+
* transform blanks literal *contents* and keeps the quotes, so the reason
|
|
77
|
+
* survives only in the raw source — and it is length-preserving, so the same
|
|
78
|
+
* offsets address both. `tests/unit/linter/source-text.test.ts` asserts that
|
|
79
|
+
* alignment directly, since this rule depends on it.
|
|
80
|
+
*
|
|
81
|
+
* The span is carried so a rule that needs a site's arguments — not just which
|
|
82
|
+
* reason it names — can read them without rescanning.
|
|
83
|
+
*/
|
|
84
|
+
export declare function scanReasonCalls(source: string, callee: string): ReasonCallScan;
|
|
85
|
+
/**
|
|
86
|
+
* Flags a declared `errors[]` reason that no code path in the handler can
|
|
87
|
+
* produce — the inverse of {@link lintErrorContractConformance}, which only
|
|
88
|
+
* catches codes thrown but not declared.
|
|
89
|
+
*
|
|
90
|
+
* A dead entry compiles, lints clean, and stays in the contract indefinitely;
|
|
91
|
+
* the typed `ctx.fail` union accepts the reason, so nothing downstream objects.
|
|
92
|
+
* The cost lands on the client, which plans for a failure mode the tool cannot
|
|
93
|
+
* produce while the mode it does produce goes undocumented.
|
|
94
|
+
*
|
|
95
|
+
* **Trigger.** Only when the handler holds at least one literal `ctx.fail(`. A
|
|
96
|
+
* handler with none produces its reasons somewhere the scan cannot reach, and
|
|
97
|
+
* firing there would warn on every service-layer definition. A `ctx.fail(` whose
|
|
98
|
+
* first argument is not a string literal makes the thrown set unknowable, so the
|
|
99
|
+
* whole definition is skipped rather than guessed at.
|
|
100
|
+
*
|
|
101
|
+
* **Warning, never error.** A reason produced outside the handler closure is
|
|
102
|
+
* invisible to any `toString()` scan, so the rule can never prove absence.
|
|
103
|
+
* Silent blind spots under the trigger above: a service that throws a factory
|
|
104
|
+
* error carrying `data: { reason }`, a `createFail(errors)` resolver built
|
|
105
|
+
* outside the handler, and an aliased `const fail = ctx.fail`.
|
|
106
|
+
*/
|
|
107
|
+
export declare function lintErrorContractUnthrown(def: {
|
|
108
|
+
handler?: unknown;
|
|
109
|
+
errors?: unknown;
|
|
110
|
+
}, definitionType: LintDefinitionType, definitionName: string): LintDiagnostic[];
|
|
49
111
|
//# sourceMappingURL=error-contract-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-contract-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/error-contract-rules.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"error-contract-rules.d.ts","sourceRoot":"","sources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
2
2
|
* @fileoverview Lint rules for the declarative `errors[]` contract on tool and
|
|
3
|
-
* resource definitions. Validates structure (codes, reasons
|
|
4
|
-
* and
|
|
5
|
-
* codes
|
|
3
|
+
* resource definitions. Validates structure (codes, reasons, severity),
|
|
4
|
+
* uniqueness, and — when a contract is present — cross-checks the handler body
|
|
5
|
+
* in both directions: codes thrown but not declared, and reasons declared but
|
|
6
|
+
* never thrown.
|
|
6
7
|
* @module src/linter/rules/error-contract-rules
|
|
7
8
|
*/
|
|
8
9
|
import { JsonRpcErrorCode } from '../../types-global/errors.js';
|
|
@@ -14,6 +15,13 @@ import { stripCommentsAndStrings } from './source-text.js';
|
|
|
14
15
|
const VALID_CODES = new Set(Object.values(JsonRpcErrorCode).filter((v) => typeof v === 'number'));
|
|
15
16
|
const REASON_RE = /^[a-z][a-z0-9_]*$/;
|
|
16
17
|
const RECOVERY_MIN_WORDS = 5;
|
|
18
|
+
/**
|
|
19
|
+
* Levels a contract entry's `severity` may declare, mirroring the
|
|
20
|
+
* `ErrorContractSeverity` union. `error` is the default and is expressed by
|
|
21
|
+
* omitting the field, so declaring it is a no-op the author probably did not
|
|
22
|
+
* mean.
|
|
23
|
+
*/
|
|
24
|
+
const VALID_SEVERITIES = new Set(['debug', 'info', 'notice', 'warning']);
|
|
17
25
|
/**
|
|
18
26
|
* Validates the `errors[]` contract on a tool/resource definition.
|
|
19
27
|
* Checks:
|
|
@@ -24,6 +32,7 @@ const RECOVERY_MIN_WORDS = 5;
|
|
|
24
32
|
* - `recovery` is non-empty and ≥ 5 words (forcing function for thoughtful
|
|
25
33
|
* agent guidance — placeholders like "Try again." get flagged)
|
|
26
34
|
* - `retryable` (when present) is a boolean
|
|
35
|
+
* - `severity` (when present) is one of the four levels below `error`
|
|
27
36
|
*/
|
|
28
37
|
export function lintErrorContract(errors, definitionType, definitionName) {
|
|
29
38
|
const diagnostics = [];
|
|
@@ -188,6 +197,19 @@ export function lintErrorContract(errors, definitionType, definitionName) {
|
|
|
188
197
|
definitionName,
|
|
189
198
|
});
|
|
190
199
|
}
|
|
200
|
+
// severity (optional) — selects a logger method at runtime, so an
|
|
201
|
+
// unrecognized value is a hard failure rather than inert metadata.
|
|
202
|
+
if (e.severity !== undefined && !VALID_SEVERITIES.has(e.severity)) {
|
|
203
|
+
diagnostics.push({
|
|
204
|
+
rule: 'error-contract-severity-unknown',
|
|
205
|
+
severity: 'error',
|
|
206
|
+
message: `${definitionType} '${definitionName}' ${path}.severity is ${JSON.stringify(e.severity)}. ` +
|
|
207
|
+
`Use one of: ${[...VALID_SEVERITIES].join(', ')}. ` +
|
|
208
|
+
'Omit the field for the default `error` level.',
|
|
209
|
+
definitionType,
|
|
210
|
+
definitionName,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
191
213
|
}
|
|
192
214
|
return diagnostics;
|
|
193
215
|
}
|
|
@@ -354,6 +376,119 @@ export function lintErrorContractConformance(def, definitionType, definitionName
|
|
|
354
376
|
}
|
|
355
377
|
return diagnostics;
|
|
356
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Finds every `<callee>('<literal>', …)` site in a handler's source, one record
|
|
381
|
+
* per site.
|
|
382
|
+
*
|
|
383
|
+
* Matching runs over the comment- and string-stripped text, which already
|
|
384
|
+
* excludes a call written inside a comment or nested in another literal. That
|
|
385
|
+
* transform blanks literal *contents* and keeps the quotes, so the reason
|
|
386
|
+
* survives only in the raw source — and it is length-preserving, so the same
|
|
387
|
+
* offsets address both. `tests/unit/linter/source-text.test.ts` asserts that
|
|
388
|
+
* alignment directly, since this rule depends on it.
|
|
389
|
+
*
|
|
390
|
+
* The span is carried so a rule that needs a site's arguments — not just which
|
|
391
|
+
* reason it names — can read them without rescanning.
|
|
392
|
+
*/
|
|
393
|
+
export function scanReasonCalls(source, callee) {
|
|
394
|
+
const cleaned = stripCommentsAndStrings(source);
|
|
395
|
+
const calleeRe = new RegExp(String.raw `\b${callee.replaceAll('.', '\\.')}\s*\(`, 'g');
|
|
396
|
+
const sites = [];
|
|
397
|
+
let indeterminate = false;
|
|
398
|
+
for (const match of cleaned.matchAll(calleeRe)) {
|
|
399
|
+
const open = match.index + match[0].length - 1;
|
|
400
|
+
let cursor = open + 1;
|
|
401
|
+
while (cursor < cleaned.length && /\s/.test(cleaned[cursor]))
|
|
402
|
+
cursor += 1;
|
|
403
|
+
const quote = cleaned[cursor];
|
|
404
|
+
if (quote !== "'" && quote !== '"') {
|
|
405
|
+
indeterminate = true;
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
const closingQuote = cleaned.indexOf(quote, cursor + 1);
|
|
409
|
+
const end = matchingParen(cleaned, open);
|
|
410
|
+
if (closingQuote < 0 || end < 0) {
|
|
411
|
+
indeterminate = true;
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
sites.push({ reason: source.slice(cursor + 1, closingQuote), start: open, end });
|
|
415
|
+
}
|
|
416
|
+
return { indeterminate, sites };
|
|
417
|
+
}
|
|
418
|
+
/** Offset just past the `)` matching the `(` at `open`, or `-1` when unbalanced. */
|
|
419
|
+
function matchingParen(cleaned, open) {
|
|
420
|
+
let depth = 0;
|
|
421
|
+
for (let i = open; i < cleaned.length; i += 1) {
|
|
422
|
+
if (cleaned[i] === '(')
|
|
423
|
+
depth += 1;
|
|
424
|
+
else if (cleaned[i] === ')') {
|
|
425
|
+
depth -= 1;
|
|
426
|
+
if (depth === 0)
|
|
427
|
+
return i + 1;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return -1;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Flags a declared `errors[]` reason that no code path in the handler can
|
|
434
|
+
* produce — the inverse of {@link lintErrorContractConformance}, which only
|
|
435
|
+
* catches codes thrown but not declared.
|
|
436
|
+
*
|
|
437
|
+
* A dead entry compiles, lints clean, and stays in the contract indefinitely;
|
|
438
|
+
* the typed `ctx.fail` union accepts the reason, so nothing downstream objects.
|
|
439
|
+
* The cost lands on the client, which plans for a failure mode the tool cannot
|
|
440
|
+
* produce while the mode it does produce goes undocumented.
|
|
441
|
+
*
|
|
442
|
+
* **Trigger.** Only when the handler holds at least one literal `ctx.fail(`. A
|
|
443
|
+
* handler with none produces its reasons somewhere the scan cannot reach, and
|
|
444
|
+
* firing there would warn on every service-layer definition. A `ctx.fail(` whose
|
|
445
|
+
* first argument is not a string literal makes the thrown set unknowable, so the
|
|
446
|
+
* whole definition is skipped rather than guessed at.
|
|
447
|
+
*
|
|
448
|
+
* **Warning, never error.** A reason produced outside the handler closure is
|
|
449
|
+
* invisible to any `toString()` scan, so the rule can never prove absence.
|
|
450
|
+
* Silent blind spots under the trigger above: a service that throws a factory
|
|
451
|
+
* error carrying `data: { reason }`, a `createFail(errors)` resolver built
|
|
452
|
+
* outside the handler, and an aliased `const fail = ctx.fail`.
|
|
453
|
+
*/
|
|
454
|
+
export function lintErrorContractUnthrown(def, definitionType, definitionName) {
|
|
455
|
+
if (!Array.isArray(def.errors) || def.errors.length === 0)
|
|
456
|
+
return [];
|
|
457
|
+
if (typeof def.handler !== 'function')
|
|
458
|
+
return [];
|
|
459
|
+
let source;
|
|
460
|
+
try {
|
|
461
|
+
source = def.handler.toString();
|
|
462
|
+
}
|
|
463
|
+
catch {
|
|
464
|
+
return [];
|
|
465
|
+
}
|
|
466
|
+
const failScan = scanReasonCalls(source, 'ctx.fail');
|
|
467
|
+
if (failScan.indeterminate || failScan.sites.length === 0)
|
|
468
|
+
return [];
|
|
469
|
+
// `ctx.recoveryFor('<reason>')` counts too: it is how a handler opts a
|
|
470
|
+
// service-thrown reason onto the wire, and naming it there is all the scan
|
|
471
|
+
// can ask for.
|
|
472
|
+
const named = new Set(failScan.sites.map((site) => site.reason));
|
|
473
|
+
for (const site of scanReasonCalls(source, 'ctx.recoveryFor').sites)
|
|
474
|
+
named.add(site.reason);
|
|
475
|
+
const diagnostics = [];
|
|
476
|
+
for (const entry of def.errors) {
|
|
477
|
+
const reason = entry?.reason;
|
|
478
|
+
if (typeof reason !== 'string' || reason.length === 0 || named.has(reason))
|
|
479
|
+
continue;
|
|
480
|
+
diagnostics.push({
|
|
481
|
+
rule: 'error-contract-unthrown',
|
|
482
|
+
severity: 'warning',
|
|
483
|
+
message: `${definitionType} '${definitionName}' declares reason '${reason}' in errors[], but no ` +
|
|
484
|
+
`ctx.fail('${reason}', …) appears in the handler. Wire the throw, or drop the entry — ` +
|
|
485
|
+
'clients plan around the advertised failure surface.',
|
|
486
|
+
definitionType,
|
|
487
|
+
definitionName,
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
return diagnostics;
|
|
491
|
+
}
|
|
357
492
|
/**
|
|
358
493
|
* Returns the enum name for a `JsonRpcErrorCode` value, or `String(code)` when
|
|
359
494
|
* the value is not a known member.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-contract-rules.js","sourceRoot":"","sources":["../../../src/linter/rules/error-contract-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,GAAwB,IAAI,GAAG,CAC9C,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAClF,CAAC;AAEF,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAEtC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAe,EACf,cAAkC,EAClC,cAAsB;IAEtB,MAAM,WAAW,GAAqB,EAAE,CAAC;IAEzC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAE7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,WAAW,CAAC,IAAI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|
3
3
|
* @module src/linter/rules/index
|
|
4
4
|
*/
|
|
5
5
|
export { lintCappedListTruncation, lintEnrichmentContract } from './enrichment-rules.js';
|
|
6
|
-
export { lintErrorContract, lintErrorContractConformance } from './error-contract-rules.js';
|
|
6
|
+
export { lintErrorContract, lintErrorContractConformance, lintErrorContractUnthrown, } from './error-contract-rules.js';
|
|
7
7
|
export { lintHandlerBody } from './handler-body-rules.js';
|
|
8
8
|
export { checkDuplicateNames, checkNameRequired, checkToolNameFormat } from './name-rules.js';
|
|
9
9
|
export { DEFAULT_FORMAT_ALLOWLIST, lintSchemaPortability, type PortabilityOptions, } from './portability-rules.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,kBAAkB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,0BAA0B,EAC1B,cAAc,EACd,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module src/linter/rules/index
|
|
4
4
|
*/
|
|
5
5
|
export { lintCappedListTruncation, lintEnrichmentContract } from './enrichment-rules.js';
|
|
6
|
-
export { lintErrorContract, lintErrorContractConformance } from './error-contract-rules.js';
|
|
6
|
+
export { lintErrorContract, lintErrorContractConformance, lintErrorContractUnthrown, } from './error-contract-rules.js';
|
|
7
7
|
export { lintHandlerBody } from './handler-body-rules.js';
|
|
8
8
|
export { checkDuplicateNames, checkNameRequired, checkToolNameFormat } from './name-rules.js';
|
|
9
9
|
export { DEFAULT_FORMAT_ALLOWLIST, lintSchemaPortability, } from './portability-rules.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/linter/rules/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/linter/rules/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EACL,wBAAwB,EACxB,qBAAqB,GAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,0BAA0B,EAC1B,cAAc,EACd,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/resource-rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"resource-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/resource-rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AASlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,WAAW,CAAC,EAAE,kBAAkB,GAC/B,cAAc,EAAE,CAoGlB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module src/linter/rules/resource-rules
|
|
5
5
|
*/
|
|
6
6
|
import { invalidDefinitionEntry, isDefinitionObject } from './definition-rules.js';
|
|
7
|
-
import { lintErrorContract, lintErrorContractConformance } from './error-contract-rules.js';
|
|
7
|
+
import { lintErrorContract, lintErrorContractConformance, lintErrorContractUnthrown, } from './error-contract-rules.js';
|
|
8
8
|
import { lintHandlerBody } from './handler-body-rules.js';
|
|
9
9
|
import { checkNameRequired } from './name-rules.js';
|
|
10
10
|
import { lintSchemaRoot } from './schema-rules.js';
|
|
@@ -96,8 +96,10 @@ export function lintResourceDefinition(def, portability) {
|
|
|
96
96
|
diagnostics.push(...lintHandlerBody(d, 'resource'));
|
|
97
97
|
// Declarative error contract validation
|
|
98
98
|
if (d?.errors !== undefined) {
|
|
99
|
+
const contractDef = d;
|
|
99
100
|
diagnostics.push(...lintErrorContract(d.errors, 'resource', displayName));
|
|
100
|
-
diagnostics.push(...lintErrorContractConformance(
|
|
101
|
+
diagnostics.push(...lintErrorContractConformance(contractDef, 'resource', displayName));
|
|
102
|
+
diagnostics.push(...lintErrorContractUnthrown(contractDef, 'resource', displayName));
|
|
101
103
|
}
|
|
102
104
|
return diagnostics;
|
|
103
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-rules.js","sourceRoot":"","sources":["../../../src/linter/rules/resource-rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,
|
|
1
|
+
{"version":3,"file":"resource-rules.js","sourceRoot":"","sources":["../../../src/linter/rules/resource-rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,GAAY,EACZ,WAAgC;IAEhC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC;QAAE,OAAO,C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C,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,IAAI,KAAK,GAAG;YAAE,KAAK,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,GAAG;YAAE,KAAK,EAAE,CAAC;QAC1B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,OAAO;gBACL,IAAI,EAAE,oBAAoB;gBAC1B,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,aAAa,IAAI,wDAAwD,QAAQ,IAAI;gBAC9F,cAAc,EAAE,UAAU;gBAC1B,cAAc,EAAE,IAAI;aACrB,CAAC;QACJ,CAAC;IACH,CAAC;IACD,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,aAAa,IAAI,qDAAqD,QAAQ,IAAI;YAC3F,cAAc,EAAE,UAAU;YAC1B,cAAc,EAAE,IAAI;SACrB,CAAC;IACJ,CAAC;IAED,yCAAyC;IACzC,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,aAAa,IAAI,0DAA0D,QAAQ,IAAI;YAChG,cAAc,EAAE,UAAU;YAC1B,cAAc,EAAE,IAAI;SACrB,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/tool-rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/tool-rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAWlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQjE;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,WAAW,CAAC,EAAE,kBAAkB,GAC/B,cAAc,EAAE,CAwGlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CA0GlB;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,EAChD,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CA8BlB;AAgDD,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CACjD;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EAAE,EAChB,OAAO,CAAC,EAAE,aAAa,GACtB,cAAc,EAAE,CA0ClB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EAAE,EAChB,SAAS,EAAE,OAAO,EAAE,GACnB,cAAc,EAAE,CA6ClB"}
|
|
@@ -7,7 +7,7 @@ import { foldArgumentKey } from '../../mcp-server/tools/utils/inputPrevalidation
|
|
|
7
7
|
import { inputVariants } from '../../mcp-server/tools/utils/schemaShape.js';
|
|
8
8
|
import { invalidDefinitionEntry, isDefinitionObject } from './definition-rules.js';
|
|
9
9
|
import { lintEnrichmentContract } from './enrichment-rules.js';
|
|
10
|
-
import { lintErrorContract, lintErrorContractConformance } from './error-contract-rules.js';
|
|
10
|
+
import { lintErrorContract, lintErrorContractConformance, lintErrorContractUnthrown, } from './error-contract-rules.js';
|
|
11
11
|
import { lintFormatParity } from './format-parity-rules.js';
|
|
12
12
|
import { lintHandlerBody } from './handler-body-rules.js';
|
|
13
13
|
import { checkNameRequired, checkToolNameFormat } from './name-rules.js';
|
|
@@ -97,8 +97,10 @@ export function lintToolDefinition(def, portability) {
|
|
|
97
97
|
diagnostics.push(...lintHandlerBody(d, 'tool'));
|
|
98
98
|
// Declarative error contract validation
|
|
99
99
|
if (d?.errors !== undefined) {
|
|
100
|
+
const contractDef = d;
|
|
100
101
|
diagnostics.push(...lintErrorContract(d.errors, 'tool', displayName));
|
|
101
|
-
diagnostics.push(...lintErrorContractConformance(
|
|
102
|
+
diagnostics.push(...lintErrorContractConformance(contractDef, 'tool', displayName));
|
|
103
|
+
diagnostics.push(...lintErrorContractUnthrown(contractDef, 'tool', displayName));
|
|
102
104
|
}
|
|
103
105
|
return diagnostics;
|
|
104
106
|
}
|