@jaypie/mcp 0.8.12 → 0.8.14

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.12#5f690a10"
12
+ const BUILD_VERSION_STRING = "@jaypie/mcp@0.8.14#03cb149b"
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.12",
3
+ "version": "0.8.14",
4
4
  "description": "Jaypie MCP",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,11 @@
1
+ ---
2
+ version: 0.4.3
3
+ date: 2026-04-04
4
+ summary: Widen StorableEntity type to accept state and extra properties
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added `state?: Record<string, unknown>` to `StorableEntity` for application-specific state flags
10
+ - Added index signature `[key: string]: unknown` so downstream entity extensions type-check without casts
11
+ - Fixes #270: TS2353 when passing `state` to `putEntity`, TS2739 when spreading partial updates to `updateEntity`
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.30
3
+ date: 2026-04-04
4
+ summary: Bump @jaypie/logger to 1.2.11
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Updated `@jaypie/logger` dependency to `^1.2.11` for LOG_LEVEL_FIELD support
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 1.2.23
3
+ date: 2026-04-02
4
+ summary: Deduplicate ALL.COMBINED model list
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Fix: `ALL.COMBINED` now deduplicates models using `Set` spread, preventing duplicate entries when provider tiers share the same model ID (e.g., Anthropic DEFAULT = SMALL)
@@ -0,0 +1,14 @@
1
+ ---
2
+ version: 1.2.11
3
+ date: 2026-04-04
4
+ summary: Add LOG_LEVEL_FIELD env var for optional level key in JSON output
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added `LOG_LEVEL_FIELD` environment variable to optionally include log level in JSON output
10
+ - `true` or `1`: adds `"level": "debug"` (etc.) to JSON
11
+ - Custom string (e.g., `"status"`): adds that key with the level value
12
+ - `false`, `0`, or unset: omit level from output (default, no breaking change)
13
+ - Added `levelField` option to `Logger` constructor for programmatic control
14
+ - Applies to both regular log output and `.var()` output
@@ -0,0 +1,12 @@
1
+ ---
2
+ version: 0.8.14
3
+ date: 2026-04-04
4
+ summary: Add force skill, update logs/dynamodb/variables skills
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added `force` skill documenting type coercion utilities
10
+ - Updated `logs` skill with LOG_LEVEL_FIELD documentation
11
+ - Updated `dynamodb` skill with StorableEntity extensibility (state, index signature)
12
+ - Updated `variables` skill with LOG_LEVEL_FIELD
package/skills/agents.md CHANGED
@@ -34,7 +34,7 @@ Complete stack styles, techniques, and traditions.
34
34
 
35
35
  Contents: index, releasenotes
36
36
  Development: apikey, documentation, errors, llm, logs, mocks, monorepo, style, subpackages, tests, tools
37
- Infrastructure: aws, cdk, cicd, datadog, dns, dynamodb, express, lambda, migrations, secrets, streaming, variables, websockets
37
+ Infrastructure: aws, cdk, cicd, datadog, dns, dynamodb, express, lambda, migrations, secrets, sqs, streaming, variables, websockets
38
38
  Patterns: api, fabric, handlers, models, services, vocabulary
39
39
  Recipes: recipe-api-server
40
40
  Meta: issues, jaypie, mcp, skills
@@ -125,6 +125,10 @@ interface StorableEntity {
125
125
  updatedAt: string;
126
126
  archivedAt?: string;
127
127
  deletedAt?: string;
128
+
129
+ // Extensible
130
+ state?: Record<string, unknown>; // Application-specific state flags
131
+ [key: string]: unknown; // Additional properties allowed
128
132
  }
129
133
  ```
130
134
 
@@ -0,0 +1,115 @@
1
+ ---
2
+ description: Type coercion utilities for safe value conversion
3
+ related: style, errors, variables
4
+ ---
5
+
6
+ # Force
7
+
8
+ Coerce values to expected types without throwing. Returns sensible defaults for invalid input.
9
+
10
+ ## Import
11
+
12
+ ```typescript
13
+ import { force } from "@jaypie/kit";
14
+ // or
15
+ import { force } from "jaypie";
16
+ ```
17
+
18
+ ## Convenience Methods
19
+
20
+ ### force.array(value)
21
+
22
+ Wraps non-array values in an array. Arrays pass through.
23
+
24
+ ```typescript
25
+ force.array("hello"); // ["hello"]
26
+ force.array([1, 2]); // [1, 2]
27
+ force.array(undefined); // [undefined]
28
+ ```
29
+
30
+ ### force.boolean(value)
31
+
32
+ Parses boolean with string awareness. Falsy strings: `""`, `"0"`, `"f"`, `"false"`, `"n"`, `"no"` (case-insensitive).
33
+
34
+ ```typescript
35
+ force.boolean("false"); // false
36
+ force.boolean("no"); // false
37
+ force.boolean("0"); // false
38
+ force.boolean(""); // false
39
+ force.boolean("yes"); // true
40
+ force.boolean("anything"); // true
41
+ force.boolean(0); // false
42
+ force.boolean(1); // true
43
+ force.boolean(null); // false
44
+ ```
45
+
46
+ ### force.number(value)
47
+
48
+ Converts to number. Returns `0` for non-numeric input.
49
+
50
+ ```typescript
51
+ force.number("42"); // 42
52
+ force.number("abc"); // 0
53
+ force.number(null); // 0
54
+ force.number(undefined); // 0
55
+ ```
56
+
57
+ ### force.positive(value)
58
+
59
+ Like `force.number` but clamps to minimum `0`.
60
+
61
+ ```typescript
62
+ force.positive(-5); // 0
63
+ force.positive("10"); // 10
64
+ force.positive("abc"); // 0
65
+ ```
66
+
67
+ ### force.string(value, default?)
68
+
69
+ Converts to string. Second argument is default for `undefined`.
70
+
71
+ ```typescript
72
+ force.string(42); // "42"
73
+ force.string(null); // "null"
74
+ force.string(undefined); // ""
75
+ force.string(undefined, "fallback"); // "fallback"
76
+ force.string({ a: 1 }); // '{"a":1}'
77
+ ```
78
+
79
+ ### force.object(value, key?)
80
+
81
+ Ensures object. Wraps scalars as `{ [key]: value }` (default key: `"value"`). Parses JSON strings.
82
+
83
+ ```typescript
84
+ force.object({ a: 1 }); // { a: 1 }
85
+ force.object(42); // { value: 42 }
86
+ force.object(42, "count"); // { count: 42 }
87
+ force.object('{"a":1}'); // { a: 1 }
88
+ force.object("hello"); // { value: "hello" }
89
+ ```
90
+
91
+ ## Advanced: force(value, type, options?)
92
+
93
+ The base function accepts a type constructor and options:
94
+
95
+ ```typescript
96
+ force(value, Number, { minimum: 0, maximum: 100 });
97
+ force(value, Number, { nan: true }); // allow NaN instead of returning 0
98
+ force(value, String, "default"); // default for undefined
99
+ force(value, Object, "keyName"); // wrap key name
100
+ ```
101
+
102
+ ### Options
103
+
104
+ | Option | Type | Description |
105
+ |--------|------|-------------|
106
+ | `minimum` | `number` | Clamp number to minimum |
107
+ | `maximum` | `number` | Clamp number to maximum |
108
+ | `nan` | `boolean` | If `true`, return `NaN` instead of `0` for non-numeric input |
109
+ | `key` | `string` | Key name when wrapping scalar in object (default: `"value"`) |
110
+
111
+ If `minimum > maximum`, clamping is skipped.
112
+
113
+ ## Testing
114
+
115
+ Mocked automatically via `@jaypie/testkit/mock` when mocking `jaypie` or `@jaypie/kit`.
package/skills/logs.md CHANGED
@@ -72,6 +72,25 @@ LOG_LEVEL=debug npm run dev
72
72
  LOG_LEVEL=trace MODULE_LOG_LEVEL=warn npm test
73
73
  ```
74
74
 
75
+ ## Including Level in JSON Output
76
+
77
+ By default, the log level is not included in JSON output (Lambda determines level from the console method). To include it:
78
+
79
+ ```bash
80
+ LOG_LEVEL_FIELD=true # Adds "level": "debug" (etc.)
81
+ LOG_LEVEL_FIELD=status # Adds "status": "debug" (etc.)
82
+ LOG_LEVEL_FIELD=false # Omit (default)
83
+ ```
84
+
85
+ Or via constructor option:
86
+
87
+ ```typescript
88
+ import { Logger } from "@jaypie/logger";
89
+
90
+ const logger = new Logger({ format: "json", level: "debug", levelField: "status" });
91
+ logger.info("test"); // { "message": "test", "status": "info" }
92
+ ```
93
+
75
94
  ## Lambda Logging
76
95
 
77
96
  Lambda handlers automatically add context:
package/skills/skills.md CHANGED
@@ -17,7 +17,7 @@ Look up skills by alias: `mcp__jaypie__skill(alias)`
17
17
  |----------|--------|
18
18
  | contents | index, releasenotes |
19
19
  | development | apikey, documentation, errors, llm, logs, mocks, monorepo, style, subpackages, tests, tools |
20
- | infrastructure | aws, cdk, cicd, datadog, dns, dynamodb, express, lambda, migrations, secrets, streaming, variables, websockets |
20
+ | infrastructure | aws, cdk, cicd, datadog, dns, dynamodb, express, lambda, migrations, secrets, sqs, streaming, variables, websockets |
21
21
  | patterns | api, fabric, handlers, models, services, vocabulary |
22
22
  | recipes | recipe-api-server |
23
23
  | meta | issues, jaypie, mcp, skills |
package/skills/sqs.md ADDED
@@ -0,0 +1,133 @@
1
+ ---
2
+ description: SQS messaging patterns, queue constructs, and event parsing
3
+ related: aws, cdk, lambda, variables
4
+ ---
5
+
6
+ # SQS Messaging
7
+
8
+ Jaypie provides SQS utilities through `@jaypie/aws` and CDK constructs through `@jaypie/constructs`.
9
+
10
+ ## Sending Messages
11
+
12
+ ```typescript
13
+ import { sendMessage, sendBatchMessages } from "@jaypie/aws";
14
+
15
+ // Simple usage with default queue (CDK_ENV_QUEUE_URL)
16
+ await sendMessage({ action: "process", documentId: "doc-123" });
17
+
18
+ // With explicit queue URL and options
19
+ await sendMessage(
20
+ { action: "process" },
21
+ {
22
+ delaySeconds: 30,
23
+ messageAttributes: { Priority: { DataType: "String", StringValue: "high" } },
24
+ queueUrl: "https://sqs...",
25
+ }
26
+ );
27
+
28
+ // Batch send (automatically batched in groups of 10)
29
+ const messages = items.map((item) => ({ action: "process", id: item.id }));
30
+ await sendBatchMessages({ messages });
31
+ ```
32
+
33
+ ## Receiving Messages
34
+
35
+ Parse incoming SQS/SNS events in Lambda handlers:
36
+
37
+ ```typescript
38
+ import { getMessages, getSingletonMessage } from "@jaypie/aws";
39
+
40
+ // Get all messages from event
41
+ const messages = getMessages(event); // Returns array of parsed bodies
42
+
43
+ // Get exactly one message or throw BadGatewayError
44
+ const message = getSingletonMessage(event);
45
+ ```
46
+
47
+ ## CDK: JaypieQueue
48
+
49
+ SQS queue with DLQ and Lambda trigger:
50
+
51
+ ```typescript
52
+ import { JaypieQueue } from "@jaypie/constructs";
53
+
54
+ const queue = new JaypieQueue(this, "ProcessQueue", {
55
+ visibilityTimeout: Duration.seconds(60),
56
+ retentionPeriod: Duration.days(7),
57
+ });
58
+
59
+ // Connect to Lambda
60
+ queue.addEventSource(handler);
61
+ ```
62
+
63
+ ### Wiring Queue URL to Lambda
64
+
65
+ ```typescript
66
+ import { JaypieLambda, JaypieQueue } from "@jaypie/constructs";
67
+
68
+ const queue = new JaypieQueue(this, "ProcessQueue");
69
+
70
+ const handler = new JaypieLambda(this, "Handler", {
71
+ entry: "src/handler.ts",
72
+ environment: {
73
+ CDK_ENV_QUEUE_URL: queue.queueUrl,
74
+ },
75
+ });
76
+
77
+ queue.grantSendMessages(handler);
78
+ ```
79
+
80
+ ### Resource Naming
81
+
82
+ Queue names are account-global. Always include `PROJECT_ENV` and `PROJECT_NONCE` to avoid collisions:
83
+
84
+ ```typescript
85
+ // Bad
86
+ queueName: `${prefix}-process`
87
+
88
+ // Good
89
+ queueName: `${prefix}-process-${PROJECT_ENV}-${PROJECT_NONCE}`
90
+ ```
91
+
92
+ ## Environment Variables
93
+
94
+ | Variable | Description |
95
+ |----------|-------------|
96
+ | `CDK_ENV_QUEUE_URL` | Default SQS queue URL |
97
+ | `PROJECT_KEY` | Used for FIFO queue message group ID |
98
+
99
+ ## Testing
100
+
101
+ ```typescript
102
+ import { sendMessage } from "@jaypie/testkit/mock";
103
+ import { vi } from "vitest";
104
+
105
+ vi.mock("@jaypie/aws");
106
+
107
+ it("sends message to queue", async () => {
108
+ vi.mocked(sendMessage).mockResolvedValue({ MessageId: "123" });
109
+
110
+ await handler({ documentId: "doc-123" });
111
+
112
+ expect(sendMessage).toHaveBeenCalledWith(
113
+ expect.objectContaining({ documentId: "doc-123" })
114
+ );
115
+ });
116
+ ```
117
+
118
+ ## Debugging
119
+
120
+ ```bash
121
+ # Check queue depth
122
+ aws_sqs_get_queue_attributes --queueUrl "https://..."
123
+
124
+ # Peek at messages
125
+ aws_sqs_receive_message --queueUrl "https://..." --maxNumberOfMessages 5
126
+ ```
127
+
128
+ ## See Also
129
+
130
+ - **`skill("aws")`** - Full AWS integration reference
131
+ - **`skill("cdk")`** - CDK constructs and deployment patterns
132
+ - **`skill("lambda")`** - Lambda handler wrappers and lifecycle
133
+ - **`skill("variables")`** - Environment variables reference
@@ -37,6 +37,7 @@ log.info("Starting", { env, project: key });
37
37
  |----------|-------------|--------|
38
38
  | `NODE_ENV` | Node.js environment | development, production, test |
39
39
  | `LOG_LEVEL` | Logging verbosity | trace, debug, info, warn, error |
40
+ | `LOG_LEVEL_FIELD` | Include level in JSON output | `true` (adds `level` key), custom string, or `false` (default) |
40
41
 
41
42
  ### Log Level in Development
42
43