@jaypie/mcp 0.8.37 → 0.8.39

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.
@@ -9,7 +9,7 @@ import { gt } from 'semver';
9
9
  /**
10
10
  * Docs Suite - Documentation services (skill, version, release_notes)
11
11
  */
12
- const BUILD_VERSION_STRING = "@jaypie/mcp@0.8.37#983a3ea2"
12
+ const BUILD_VERSION_STRING = "@jaypie/mcp@0.8.39#c0557d46"
13
13
  ;
14
14
  const __filename$1 = fileURLToPath(import.meta.url);
15
15
  const __dirname$1 = path.dirname(__filename$1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/mcp",
3
- "version": "0.8.37",
3
+ "version": "0.8.39",
4
4
  "description": "Jaypie MCP",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.8
3
+ date: 2026-04-17
4
+ summary: Fix getTextractJob termination for non-success job states
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `getTextractJob` now actually exits the fetch loop on `IN_PROGRESS`, `FAILED`, and unknown job statuses. Previously the terminal cases set `doneFetching = true`, only to have it overwritten by the unconditional `doneFetching = !response.NextToken` assignment at the end of the loop body. Terminal cases now `continue` so the `while (!doneFetching)` check exits cleanly.
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.47
3
+ date: 2026-04-17
4
+ summary: Remove dead post-increment in JaypieDistribution WAF rule priority
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Removed a useless `priority++` on the last use of the `priority` counter when building WAF rules in `JaypieDistribution`. No behavior change.
@@ -0,0 +1,17 @@
1
+ ---
2
+ version: 1.2.48
3
+ date: 2026-04-17
4
+ summary: Add managedRuleScopeDowns to JaypieWafConfig
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `JaypieDistribution` WAF config now accepts `managedRuleScopeDowns?: Record<string, CfnWebACL.StatementProperty>`, allowing any managed rule group to be narrowed to a specific URL pattern (or any other WAFv2 statement shape).
10
+ - Keyed by managed rule group name, parallel to `managedRuleOverrides`.
11
+ - Use case: scope `AWSManagedRulesCommonRuleSet` away from `/chat` paths so large chat request bodies don't collide with `SizeRestrictions_BODY` without weakening protection globally.
12
+
13
+ ## Skills
14
+
15
+ - ~cdk — WAF section adds a `managedRuleScopeDowns` example alongside the existing `managedRuleOverrides` one.
16
+
17
+ Closes #306.
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.2
3
+ date: 2026-04-17
4
+ summary: Remove dead initializer in deprecated validate()
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Dropped an unused `let valid = false` initializer in the deprecated `validate()` function. No behavior change.
@@ -0,0 +1,17 @@
1
+ ---
2
+ version: 1.2.3
3
+ date: 2026-04-17
4
+ summary: Support ESLint 10 in addition to ESLint 9
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Peer dependency widened to `eslint: "^9.0.0 || ^10.0.0"`
10
+ - Bumped `@eslint/js` to `^10.0.0` (strict major peer)
11
+ - Bumped supporting plugins: `typescript-eslint` 8.58, `@vitest/eslint-plugin` 1.6, `eslint-plugin-import-x` 4.16, `eslint-plugin-prettier` 5.5, `eslint-config-prettier` 10.1, `eslint-import-resolver-typescript` 4.4, `globals` 17
12
+
13
+ ## Notes
14
+
15
+ ESLint 10's `@eslint/js` recommended config adds `no-useless-assignment`, `no-unassigned-vars`, and `preserve-caught-error`. Existing code that relies on the v9 rule set may surface new errors on upgrade.
16
+
17
+ Node engines: ESLint 10 requires `^20.19.0 || ^22.13.0 || >=24`.
@@ -0,0 +1,25 @@
1
+ ---
2
+ version: 1.2.22
3
+ date: 2026-04-17
4
+ summary: Add fabricApiResponse helper and expressHandler fabric option
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - New export `fabricApiResponse(value)` wraps a value in the canonical Jaypie API envelope:
10
+ - `null` / `undefined` → `{ data: null }`
11
+ - `{ data }` with exactly one key → passthrough
12
+ - `{ errors }` with exactly one key → passthrough
13
+ - anything else (including `{ data, other }`) → `{ data: value }`
14
+ - New `expressHandler` option `{ fabric: true }` applies `fabricApiResponse` to the handler's return value before `res.json()`, removing the `apiResponse(await service())` boilerplate.
15
+
16
+ ## Why
17
+
18
+ The `skill("api")` envelope contract says a response contains either `data` or `errors`, never both, and no other top-level keys. The helper and handler option make conforming to that contract the easy path.
19
+
20
+ ## Skills
21
+
22
+ - ~express — Handler Options block documents the new `fabric` flag; new "fabricApiResponse and `{ fabric: true }`" section covers the helper and wrap rules.
23
+ - ~handlers — Express handler example now shows `{ fabric: true }` as the recommended envelope path.
24
+
25
+ Closes #309.
@@ -0,0 +1,23 @@
1
+ ---
2
+ version: 0.3.2
3
+ date: 2026-04-17
4
+ summary: fabricExpress integrates expressHandler lifecycle
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `FabricExpressConfig` now accepts the full set of `expressHandler` lifecycle options: `chaos`, `locals`, `name`, `secrets`, `setup`, `teardown`, `unavailable`, `validate`.
10
+ - `fabricExpress` wraps the inner middleware with `expressHandler` so per-request lifecycle (secrets loading, setup/teardown, validate, unavailable, locals, observability) runs automatically — matching `fabricLambda` / `fabricWebSocket` adapter patterns.
11
+ - Inner middleware still calls `res.json` / `res.status` / `res.send` directly; `expressHandler` captures these as illegal calls and replays them after postprocess, preserving existing envelope and 405/204 behavior.
12
+
13
+ ## Peer dependencies
14
+
15
+ - Adds `@jaypie/express` as an optional peer dependency (alongside `@jaypie/lambda`).
16
+
17
+ ## Why
18
+
19
+ Previously `fabricExpress` was a plain middleware — an asymmetry with `fabricLambda` (wraps `lambdaHandler`) and `fabricWebSocket` (wraps `websocketHandler`). Consumers had to stack `expressHandler(fabricExpress(...))` themselves to get lifecycle, defeating convenience. This change makes lifecycle the default.
20
+
21
+ ## Skills
22
+
23
+ - ~fabric — Adapters section adds an Express Middleware example covering `fabricHttp` + `fabricExpress` + `FabricRouter`, including lifecycle pass-through.
@@ -0,0 +1,12 @@
1
+ ---
2
+ version: 1.2.39
3
+ date: 2026-04-17
4
+ summary: Bump @jaypie/aws, @jaypie/core, @jaypie/llm deps
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Dependency bumps:
10
+ - `@jaypie/aws` ^1.2.7 → ^1.2.8
11
+ - `@jaypie/core` ^1.2.1 → ^1.2.2
12
+ - `@jaypie/llm` ^1.2.27 → ^1.2.28 (peer)
@@ -0,0 +1,11 @@
1
+ ---
2
+ version: 1.2.40
3
+ date: 2026-04-17
4
+ summary: Bump @jaypie/express and @jaypie/llm deps
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Dependency bumps:
10
+ - `@jaypie/express` ^1.2.21 → ^1.2.22 (`fabricApiResponse` helper, `{ fabric: true }` handler option)
11
+ - `@jaypie/llm` ^1.2.28 → ^1.2.29 (peer; xAI retries transient ingest-bytes 400s)
@@ -0,0 +1,12 @@
1
+ ---
2
+ version: 1.2.28
3
+ date: 2026-04-17
4
+ summary: Internal cleanups surfaced by ESLint 10
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `GeminiAdapter` stream path: replaced a `let`+null-reset pattern with a block-scoped `const` for the in-flight function call. No behavior change.
10
+ - `providers/gemini/utils.ts`: removed an always-`undefined` `let systemInstruction` declaration; the return shape still exposes `systemInstruction: undefined` for callers that destructure it.
11
+ - `tools/weather`: preserves existing vanilla-`Error` throws with an inline eslint-disable — the package targets ES2020 and `Error`'s `cause` option requires ES2022.
12
+ - Test fixtures (`test/document.ts`, `test/structured.ts`): dropped dead `success = false` initializers.
@@ -0,0 +1,16 @@
1
+ ---
2
+ version: 1.2.29
3
+ date: 2026-04-17
4
+ summary: xAI adapter retries transient "failed to ingest inline file bytes" 400s
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `XaiAdapter` now overrides `classifyError` to mark HTTP 400 responses whose message contains `"failed to ingest inline file bytes"` as retryable. The existing exponential-backoff retry loop then retries them (same pattern as transient-network retries).
10
+ - Unrelated `BadRequestError`s remain non-retryable — they fall through to the parent OpenAI-compatible classifier.
11
+
12
+ ## Why
13
+
14
+ xAI's media-ingest service enters a bad state after ~12 consecutive file-bearing calls and self-clears after a short pause. Previously these 400s were terminal, losing all downstream work in a batch; they're now transparently retried.
15
+
16
+ Closes #301.
@@ -0,0 +1,17 @@
1
+ ---
2
+ version: 0.8.38
3
+ date: 2026-04-17
4
+ summary: Add release notes for the ESLint 10 upgrade batch
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ Added release notes for the packages bumped during the ESLint 10 upgrade branch:
10
+
11
+ - `@jaypie/aws@1.2.8`
12
+ - `@jaypie/constructs@1.2.47`
13
+ - `@jaypie/core@1.2.2`
14
+ - `@jaypie/eslint@1.2.3`
15
+ - `@jaypie/llm@1.2.28`
16
+ - `@jaypie/testkit@1.2.34`
17
+ - `jaypie@1.2.39`
@@ -0,0 +1,23 @@
1
+ ---
2
+ version: 0.8.39
3
+ date: 2026-04-17
4
+ summary: Add release notes for the #301/#306/#309 + fabricExpress lifecycle batch
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ Added release notes for:
10
+
11
+ - `@jaypie/constructs@1.2.48` (#306 — WAF scopeDownStatement)
12
+ - `@jaypie/express@1.2.22` (#309 — fabricApiResponse + fabric option)
13
+ - `@jaypie/fabric@0.3.2` (fabricExpress wraps expressHandler)
14
+ - `@jaypie/llm@1.2.29` (#301 — xAI ingest-bytes retry)
15
+ - `@jaypie/testkit@1.2.35` (mock fabricApiResponse)
16
+ - `jaypie@1.2.40` (dependency bumps)
17
+
18
+ ## Skills updated
19
+
20
+ - ~cdk — WAF section adds `managedRuleScopeDowns` example.
21
+ - ~express — documents `fabric` option and `fabricApiResponse` helper.
22
+ - ~fabric — Adapters section adds Express Middleware / FabricRouter example with lifecycle pass-through.
23
+ - ~handlers — Express handler example uses `{ fabric: true }`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.34
3
+ date: 2026-04-17
4
+ summary: Remove dead assignments in lambda/websocket mock handlers
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Cleaned up dead `props = temp` assignments in `lambdaStreamHandler` and `websocketHandler` swap branches — no behavior change, surfaced by ESLint 10's new `no-useless-assignment` rule.
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.35
3
+ date: 2026-04-17
4
+ summary: Mock fabricApiResponse from @jaypie/express
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added a mock for `fabricApiResponse` (new export in `@jaypie/express@1.2.22`) so consumers get a wrapped mock via `@jaypie/testkit/mock` alongside `cors`, `expressHandler`, etc.
package/skills/cdk.md CHANGED
@@ -359,6 +359,31 @@ new JaypieDistribution(this, "Dist", {
359
359
  },
360
360
  },
361
361
  });
362
+
363
+ // Scope a managed rule group to (or away from) specific URL patterns
364
+ new JaypieDistribution(this, "Dist", {
365
+ handler,
366
+ waf: {
367
+ name: "api",
368
+ managedRuleScopeDowns: {
369
+ // Only run the CommonRuleSet for paths OTHER than /chat — lets /chat
370
+ // handle large AI-generated request bodies without weakening protection
371
+ // elsewhere.
372
+ AWSManagedRulesCommonRuleSet: {
373
+ notStatement: {
374
+ statement: {
375
+ byteMatchStatement: {
376
+ fieldToMatch: { uriPath: {} },
377
+ positionalConstraint: "STARTS_WITH",
378
+ searchString: "/chat",
379
+ textTransformations: [{ priority: 0, type: "NONE" }],
380
+ },
381
+ },
382
+ },
383
+ },
384
+ },
385
+ },
386
+ });
362
387
  ```
363
388
 
364
389
  Cost: $5/month per WebACL + $1/month per rule + $0.60 per million requests. Use `waf: false` to opt out.
package/skills/express.md CHANGED
@@ -46,8 +46,10 @@ app.get("/api/users", expressHandler(async (req, res) => {
46
46
 
47
47
  ```typescript
48
48
  expressHandler(handler, {
49
+ fabric: false, // Wrap return with fabricApiResponse before res.json (default false)
49
50
  locals: {}, // Values passed to res.locals
50
51
  name: "handler", // Handler name for logging
52
+ secrets: [], // AWS Secrets names to load into process.env
51
53
  setup: async (req, res) => {}, // Pre-handler setup
52
54
  teardown: async (req, res) => {}, // Post-handler cleanup
53
55
  unavailable: false, // Return 503 immediately if true
@@ -55,6 +57,29 @@ expressHandler(handler, {
55
57
  });
56
58
  ```
57
59
 
60
+ ### fabricApiResponse and `{ fabric: true }`
61
+
62
+ Return plain domain objects and opt into the canonical Jaypie API envelope:
63
+
64
+ ```typescript
65
+ import { expressHandler, fabricApiResponse } from "jaypie";
66
+
67
+ // Handler option — wraps the return value automatically
68
+ app.get(
69
+ "/ping",
70
+ expressHandler(async (req) => ping(req.query), { fabric: true }),
71
+ );
72
+
73
+ // Standalone helper — same rules as `{ fabric: true }`
74
+ fabricApiResponse({ id: "1" }); // { data: { id: "1" } }
75
+ fabricApiResponse([{ id: "1" }]); // { data: [{ id: "1" }] }
76
+ fabricApiResponse({ data: {...} }); // passthrough
77
+ fabricApiResponse({ errors: [...] }); // passthrough
78
+ fabricApiResponse(null); // { data: null }
79
+ ```
80
+
81
+ Wrap rules: only `{ data }` alone or `{ errors }` alone pass through. Anything else (including `{ data, other }`) gets wrapped as `{ data: value }`.
82
+
58
83
  ## Lambda Adapter
59
84
 
60
85
  Convert Express apps to Lambda handlers:
package/skills/fabric.md CHANGED
@@ -77,6 +77,37 @@ const tools = [fabricLlmTool(greetService)];
77
77
  // Available to LLM as function call
78
78
  ```
79
79
 
80
+ ### Express Middleware
81
+
82
+ ```typescript
83
+ import { fabricHttp } from "@jaypie/fabric/http";
84
+ import { fabricExpress, FabricRouter } from "@jaypie/fabric/express";
85
+
86
+ // Wrap service with fabricHttp first (HTTP context + default input transform)
87
+ const greetHttp = fabricHttp({ service: greetService });
88
+
89
+ // Single-route middleware — alias becomes default path ("/greet")
90
+ app.get("/greet", fabricExpress({ service: greetHttp }));
91
+
92
+ // Lifecycle pass-through (forwarded to expressHandler): secrets, setup,
93
+ // teardown, validate, unavailable, locals, name, chaos
94
+ app.post(
95
+ "/records",
96
+ fabricExpress({
97
+ service: recordsHttp,
98
+ secrets: ["MONGODB_URI"],
99
+ setup: async (req) => { /* ... */ },
100
+ }),
101
+ );
102
+
103
+ // Multi-service router — alias-derived paths under a prefix
104
+ app.use(FabricRouter({ services: [greetHttp, searchHttp], prefix: "/api" }));
105
+ ```
106
+
107
+ `fabricExpress` wraps the middleware with `expressHandler` internally, so
108
+ per-route lifecycle and observability come along for the ride (parallel to
109
+ `fabricLambda` → `lambdaHandler` and `fabricWebSocket` → `websocketHandler`).
110
+
80
111
  ## Service Suites
81
112
 
82
113
  Group related services:
@@ -90,6 +90,13 @@ app.get("/api/users", expressHandler(async (req, res) => {
90
90
  return { users: [] };
91
91
  }));
92
92
 
93
+ // Return plain domain objects and let `{ fabric: true }` apply the
94
+ // canonical Jaypie `{ data }` envelope automatically.
95
+ app.get(
96
+ "/ping",
97
+ expressHandler(async (req) => ping(req.query), { fabric: true }),
98
+ );
99
+
93
100
  // Convert Express app to Lambda
94
101
  export const handler = createLambdaHandler(app);
95
102
  ```
@@ -9,7 +9,7 @@ Initialize a new monorepo using Jaypie conventions and utilities.
9
9
 
10
10
  ## Overview
11
11
 
12
- - ESLint 9+ flat config with @jaypie/eslint
12
+ - ESLint 9 or 10 flat config with @jaypie/eslint
13
13
  - NPM with Workspaces ("monorepo")
14
14
  - TypeScript with ESM modules
15
15
  - Vite for building, Vitest for testing