@jaypie/mcp 0.8.158 → 0.8.160

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.
@@ -0,0 +1,50 @@
1
+ ---
2
+ version: 0.8.159
3
+ date: 2026-09-14
4
+ summary: PROJECT_NONCE is a required 8-hex environment variable in every skill
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - **`cicd-actions`** makes `project-nonce` `required: true` in
10
+ `setup-environment` and fails with `::error::` when it is empty. The branch
11
+ name and `prod` fallbacks are removed (#554).
12
+ - **`cicd-environments`** moves `PROJECT_NONCE` to Required Variables (8
13
+ lowercase hex, unique per environment, `openssl rand -hex 4`) and adds it to
14
+ the sandbox and production examples.
15
+ - **`cicd-deploy`** passes `project-nonce: ${{ vars.PROJECT_NONCE }}` in both
16
+ deploy jobs, replaces hand-rolled `api-${env}-${nonce}` naming with the
17
+ `JaypieStack` generated name, and adds One Install per Environment.
18
+ - **`variables`**, **`cdk`**, **`jaypie`**, **`recipe-api-server`**, and
19
+ **`debugging`** use hex nonces in place of `dev`, `staging`, and `prod`.
20
+ - **`cdk`** documents the `@jaypie/constructs:projectNonceFormat` synth
21
+ warning.
22
+ - **`github`** notes that `setup-environment` fails on an empty
23
+ `project-nonce` instead of falling back.
24
+ - **`@jaypie/mcp/assets`** exports `getMcpBuildInfo()`, which returns
25
+ `{ commit, version, versionString }` from the same build-time replacements the
26
+ `version` tool reports. A consumer syncing `skills/` and `release-notes/`
27
+ reads the build from the same package. The **`mcp`** skill documents it
28
+ (#555).
29
+ - **`tildeskill`** documents that layered `find` checks every layer for an
30
+ exact alias before plural/singular fallback (#558).
31
+ - **`tildeskill`** documents `createDynamoDbStore` from
32
+ `@jaypie/tildeskill/dynamodb`, `syncSkills`, and `delete` semantics for every
33
+ store. **`dynamodb`** notes that skills use `indexModelCategory` and that
34
+ `registerSkillModel()` declares it (#557).
35
+ - **`tildeskill`** documents that `createSkillService` throws `BadRequestError`
36
+ for an invalid alias and `NotFoundError` for a missing skill.
37
+ - **`release_notes("list")`** paginates. `limit` defaults to 50 and caps at
38
+ 200. Notes sort by package ascending, then version descending. A
39
+ `Next page: release_notes("list", { cursor: "..." })` footer appears only
40
+ when more notes exist, and its opaque cursor carries `package`,
41
+ `since_version`, and `limit`. Invalid cursors and filters that conflict with
42
+ the cursor return a bad request. The unfiltered first page drops from about
43
+ 61K to about 5.7K characters. The **`mcp`** and **`releasenotes`** skills
44
+ document it (#556).
45
+
46
+ ## Upgrade
47
+
48
+ - Projects built from the previous `cicd-actions` template may have deployed
49
+ branch-name nonces. Set `PROJECT_NONCE` on each GitHub environment. The new
50
+ value creates a new install, so tear down the old stacks and buckets.
@@ -0,0 +1,19 @@
1
+ ---
2
+ version: 0.8.160
3
+ date: 2026-09-15
4
+ summary: Document forwarder invoke permissions, hardened log buckets, origin access control, WAF redaction, and JaypieMigration log props
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - **`skill("JaypieDatadogForwarder")`** gains an "Invoke Permissions" section
10
+ covering token-ARN imports and the events-rule warning acknowledgement.
11
+ - **`skill("cdk")`** gains "Origin Access Control" and "Importing a Lambda by
12
+ Token ARN" sections, and the WAF summary lists the new config keys.
13
+ - **`skill("waf")`** documents the hardened log bucket, `waf.logRetention`, and
14
+ the merge semantics of `redactedHeaders` / `redactedFields`.
15
+ - **`skill("web")`** gains an "Origin Access Control" section and documents
16
+ `logRetention` and the hardened log buckets.
17
+ - **`skill("migrations")`** documents `logGroup`, `logRetention`, and
18
+ `reservedConcurrentExecutions`, including the inert-`logRetention` gap
19
+ deferred to 2.0 (#568) and the zero-concurrency throw.
@@ -0,0 +1,12 @@
1
+ ---
2
+ version: 1.2.74
3
+ date: 2026-09-14
4
+ summary: Tildeskill mocks cover the DynamoDB store, syncSkills, and SkillStore delete
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Mock stores implement `delete`, resolving `false` (#557).
10
+ - New tildeskill mocks: `createDynamoDbStore`, `hashSkill`,
11
+ `registerSkillModel`, `syncSkills` (resolves empty lists), and the
12
+ `SKILL_MODEL`, `SKILL_MODEL_NAME`, and `SKILL_NAMESPACE` constants (#557).
@@ -0,0 +1,34 @@
1
+ ---
2
+ version: 0.3.5
3
+ date: 2026-09-14
4
+ summary: DynamoDB skill store, syncSkills, and SkillStore delete; layered find prefers an exact alias in any layer
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `createLayeredStore().find` checks every layer for an exact alias before it
10
+ tries plural/singular fallback in any layer. With `studio:test` and
11
+ `jaypie:tests`, `find("tests")` returns `jaypie:tests` in place of
12
+ `studio:test`, so a local skill cannot shadow an existing Jaypie skill under
13
+ a different spelling (#558).
14
+ - `createSkillService` resolves through `find`, so `skill("tests")` follows the
15
+ same order. Namespace-qualified aliases still search only their own layer.
16
+ - `createDynamoDbStore({ category })` from the new `@jaypie/tildeskill/dynamodb`
17
+ subpath serves skills from `@jaypie/dynamodb` as `skill` entities with
18
+ deterministic ids (`uuidv5("<category>:<alias>", SKILL_NAMESPACE)`) and
19
+ `metadata.hash`. `@jaypie/dynamodb` is an optional peer dependency that the
20
+ main entry never imports. The store loads it with a dynamic import on first
21
+ use, so a CJS consumer shares the host's initialized client (#557).
22
+ - `syncSkills({ from, to })` puts added and changed records, leaves unchanged
23
+ records alone, deletes records missing from `from`, and returns
24
+ `{ added, removed, unchanged, updated }`. An empty `from` with a non-empty
25
+ `to` throws `ConfigurationError` unless `allowEmptySource: true` (#557).
26
+ - `SkillStore` gains `delete(alias)`. Memory removes the record, markdown
27
+ removes the file, layered requires a namespace-qualified alias, and DynamoDB
28
+ soft deletes (#557).
29
+ - New main exports: `hashSkill`, `registerSkillModel`, `SKILL_MODEL`,
30
+ `SKILL_MODEL_NAME`, `syncSkills`, and the `DynamoDbStoreOptions`,
31
+ `SyncSkillsOptions`, and `SyncSkillsResult` types.
32
+ - `createSkillService` throws `BadRequestError` for an invalid alias and
33
+ `NotFoundError` for a missing skill in place of a vanilla `Error`. Messages
34
+ are unchanged.
@@ -72,6 +72,21 @@ const forwarderFunction = resolveDatadogForwarderFunction(this);
72
72
 
73
73
  This imports the Lambda via `Fn.importValue("account-datadog-forwarder")` and caches per scope (WeakMap), so multiple calls in the same stack return the same reference.
74
74
 
75
+ ## Invoke Permissions
76
+
77
+ The forwarder ARN is always an unresolved token: a cross-stack export or a nested-stack output. `lambda.Function.fromFunctionArn` on a token ARN produces an import with an unknown environment, and `addPermission()` on such an import is a silent no-op that only emits an `UnclearLambdaEnvironment` warning. Every trigger wired to the forwarder then deploys with no invoke permission, and S3 rejects the notification configuration because it cannot validate the destination.
78
+
79
+ Both import sites use `lambda.Function.fromFunctionAttributes(scope, id, { functionArn, sameEnvironment: true })`. The flag is correct here because the forwarder is always in the same account and region as its consumers.
80
+
81
+ `JaypieDatadogForwarder` acknowledges `@aws-cdk/aws-events:ruleUnresolvedEnvironment` on its own `CloudFormationEventsRule`. Acknowledgements resolve by construct path, so a consumer creating a rule that targets `forwarder.forwarderFunction` sees that warning on their own rule and should acknowledge it with the same justification:
82
+
83
+ ```typescript
84
+ Annotations.of(rule).acknowledgeWarning(
85
+ "@aws-cdk/aws-events:ruleUnresolvedEnvironment",
86
+ "The Datadog forwarder is always in the same account and region",
87
+ );
88
+ ```
89
+
75
90
  ### For Log Subscription Filters
76
91
 
77
92
  Use `resolveDatadogLoggingDestination` to get a `LambdaDestination`:
package/skills/cdk.md CHANGED
@@ -153,6 +153,8 @@ Props extend `StackProps` with one addition:
153
153
 
154
154
  If you see `undefined` or `unknown` in a generated stack name or tag, an env var is missing — fix the environment rather than overriding `stackName`.
155
155
 
156
+ `JaypieStack` warns at synth (`@jaypie/constructs:projectNonceFormat`) when `CDK_DEFAULT_ACCOUNT` is set and `PROJECT_NONCE` is unset or is not lowercase hex of six or more characters. The warning fires before the first deploy makes a word or branch-name nonce permanent.
157
+
156
158
  #### `JaypieAppStack` / `JaypieInfrastructureStack`
157
159
 
158
160
  Thin convenience subclasses that pre-fill `key`:
@@ -206,12 +208,14 @@ See `skill("variables")` for the role of `PROJECT_ENV` and `PROJECT_NONCE`.
206
208
 
207
209
  ```bash
208
210
  # Deploy to sandbox
209
- PROJECT_ENV=sandbox PROJECT_NONCE=dev cdk deploy
211
+ PROJECT_ENV=sandbox PROJECT_NONCE=3f9c21ab cdk deploy
210
212
 
211
213
  # Deploy to production
212
- PROJECT_ENV=production PROJECT_NONCE=prod cdk deploy
214
+ PROJECT_ENV=production PROJECT_NONCE=ba342b91 cdk deploy
213
215
  ```
214
216
 
217
+ Deploys run in CI (see `skill("cicd-deploy")`). Each environment carries its own `PROJECT_NONCE`, 8 lowercase hex characters generated once with `openssl rand -hex 4`. See `skill("github")` for provisioning.
218
+
215
219
  ## Lambda with DynamoDB Tables
216
220
 
217
221
  Pass tables to `JaypieLambda` for automatic permissions and environment wiring:
@@ -436,8 +440,50 @@ KnownBadInputsRuleSet, IP rate limiting, and WAF logging to S3 with Datadog
436
440
  forwarding.
437
441
 
438
442
  See **`skill("waf")`** for configuration: `rateLimitPerIp`, `webAclArn`,
439
- `logBucket`, `managedRuleOverrides`, `managedRuleScopeDowns`, the `allow`
440
- path-scoped relaxation prop, and the rule-name ↔ label casing trap.
443
+ `logBucket`, `logRetention`, `managedRuleOverrides`, `managedRuleScopeDowns`,
444
+ `redactedFields`, `redactedHeaders`, the `allow` path-scoped relaxation prop,
445
+ and the rule-name ↔ label casing trap.
446
+
447
+ WAF logs always redact `authorization`, `cookie`, `x-amz-content-sha256`, and
448
+ `x-api-key`. A `redactedHeaders` list merges with that default rather than
449
+ replacing it, so adding a header can only ever redact more.
450
+
451
+ ## Origin Access Control
452
+
453
+ `JaypieDistribution` with an `IFunction` handler creates a Function URL with
454
+ `authType: NONE`, so the Lambda is invokable around CloudFront and the WAF.
455
+ `originAccessControl: true` makes CloudFront the only caller:
456
+
457
+ ```typescript
458
+ new JaypieDistribution(this, "Dist", {
459
+ handler,
460
+ originAccessControl: true,
461
+ });
462
+ ```
463
+
464
+ - The Function URL becomes `AWS_IAM`, the origin becomes
465
+ `origins.FunctionUrlOrigin.withOriginAccessControl(...)`, and the construct
466
+ adds the `lambda:InvokeFunction` permission that `withOriginAccessControl`
467
+ omits (Lambda requires both it and `lambda:InvokeFunctionUrl`).
468
+ - **Client requirement:** with OAC, Lambda rejects a POST or PUT unless the
469
+ client sends the body SHA-256 in `x-amz-content-sha256`. For a body carrying
470
+ low-entropy secrets, salt it with a nonce so the hash is not reversible. That
471
+ header is redacted from WAF logs by default.
472
+ - The prop applies only to the `IFunction` path. A caller-supplied
473
+ `IFunctionUrl` or `IOrigin` owns its own auth; setting the prop there warns
474
+ at synth (`@jaypie/constructs:originAccessControlIgnored`).
475
+ - `JaypieWebDeploymentBucket` has its own `originAccessControl` prop for the S3
476
+ case; see `skill("web")`.
477
+
478
+ ## Importing a Lambda by Token ARN
479
+
480
+ `lambda.Function.fromFunctionArn` on an ARN that is a token (`Fn.importValue`,
481
+ a nested-stack output) yields an import with an unresolved environment.
482
+ `addPermission()` on it is a silent no-op that only warns
483
+ (`UnclearLambdaEnvironment`), so every trigger deploys without invoke
484
+ permission. Use
485
+ `lambda.Function.fromFunctionAttributes(scope, id, { functionArn, sameEnvironment: true })`
486
+ whenever the function is known to be in the same account and region.
441
487
 
442
488
  ## Organization Trail Security Baseline
443
489
 
@@ -49,9 +49,8 @@ inputs:
49
49
  description: 'Sponsor segment of the generated stack name'
50
50
  required: true
51
51
  project-nonce:
52
- description: 'Unique resource identifier'
53
- required: false
54
- default: ''
52
+ description: '8 lowercase hex characters, unique per environment'
53
+ required: true
55
54
  log-level:
56
55
  description: 'Log level (trace, debug, info, warn, error)'
57
56
  required: false
@@ -92,14 +91,11 @@ runs:
92
91
  echo "PROJECT_KEY=${{ inputs.project-key }}" >> $GITHUB_ENV
93
92
  echo "PROJECT_SPONSOR=${{ inputs.project-sponsor }}" >> $GITHUB_ENV
94
93
 
95
- # Resolve PROJECT_NONCE (default: branch name or 'prod')
94
+ # Resolve PROJECT_NONCE (required, no fallback)
96
95
  NONCE="${{ inputs.project-nonce }}"
97
96
  if [ -z "$NONCE" ]; then
98
- if [ "$PROJECT_ENV" = "production" ]; then
99
- NONCE="prod"
100
- else
101
- NONCE="${GITHUB_REF_NAME//\//-}"
102
- fi
97
+ echo "::error::project-nonce is empty. Set PROJECT_NONCE on the GitHub environment (openssl rand -hex 4)"
98
+ exit 1
103
99
  fi
104
100
  echo "project-nonce=${NONCE}" >> $GITHUB_OUTPUT
105
101
  echo "PROJECT_NONCE=${NONCE}" >> $GITHUB_ENV
@@ -131,6 +127,8 @@ runs:
131
127
 
132
128
  `project-sponsor` is `required: true` on purpose. `PROJECT_SPONSOR` is the first segment of the generated stack name (`cdk-{PROJECT_SPONSOR}-{PROJECT_KEY}-{PROJECT_ENV}-{PROJECT_NONCE}`), and an optional input with an empty default deploys `cdk-undefined-...` silently. A stack name is immutable, so correcting it later means a stack replacement. See `skill("cdk")` for stack naming and `skill("variables")` for the full variable reference.
133
129
 
130
+ `project-nonce` is `required: true` with no fallback, and the step exits with `::error::` when it is empty because GitHub does not enforce `required` on composite action inputs. `PROJECT_NONCE` is 8 lowercase hex characters, generated once per environment (`openssl rand -hex 4`) and stored as a GitHub environment variable (see `skill("cicd-environments")`). It lands in globally unique names (S3 buckets), SSM parameter paths, and immutable stack names. A branch name or word such as `prod` repeats across projects and accounts, and changing the nonce later means a new install beside the old one.
131
+
134
132
  ## configure-aws/action.yml
135
133
 
136
134
  Configures AWS credentials via OIDC.
@@ -75,6 +75,7 @@ jobs:
75
75
  project-key: my-project
76
76
  project-sponsor: ${{ vars.PROJECT_SPONSOR }}
77
77
  project-env: sandbox
78
+ project-nonce: ${{ vars.PROJECT_NONCE }}
78
79
 
79
80
  - uses: ./.github/actions/configure-aws
80
81
  with:
@@ -163,6 +164,7 @@ jobs:
163
164
  project-key: my-project
164
165
  project-sponsor: ${{ vars.PROJECT_SPONSOR }}
165
166
  project-env: production
167
+ project-nonce: ${{ vars.PROJECT_NONCE }}
166
168
 
167
169
  - uses: ./.github/actions/configure-aws
168
170
  with:
@@ -271,27 +273,28 @@ Requirements:
271
273
 
272
274
  See `skill("cicd-actions")` for the `web-deploy` action body and `skill("web")` for the construct.
273
275
 
274
- ## Environment-Specific Stack Naming
276
+ ## Stack Naming
275
277
 
276
- Use consistent stack naming with environment and nonce:
278
+ `JaypieStack` names every stack `cdk-{PROJECT_SPONSOR}-{PROJECT_KEY}-{PROJECT_ENV}-{PROJECT_NONCE}[-{key}]` and resolves the account and region (see `skill("cdk")`). Do not compose stack names in `app.ts`:
277
279
 
278
280
  ```typescript
279
281
  // workspaces/cdk/src/app.ts
280
- const env = process.env.PROJECT_ENV || "sandbox";
281
- const nonce = process.env.PROJECT_NONCE || "dev";
282
-
283
- new ApiStack(app, `api-${env}-${nonce}`, {
284
- env: {
285
- account: process.env.CDK_DEFAULT_ACCOUNT,
286
- region: process.env.CDK_DEFAULT_REGION,
287
- },
288
- });
282
+ import { App } from "aws-cdk-lib";
283
+ import { JaypieAppStack } from "@jaypie/constructs";
284
+
285
+ const app = new App();
286
+ new JaypieAppStack(app, "AppStack");
289
287
  ```
290
288
 
291
- This produces stack names like:
292
- - `api-sandbox-feat-new-feature`
293
- - `api-sandbox-main`
294
- - `api-production-prod`
289
+ With `PROJECT_NONCE` set per environment (see `skill("cicd-environments")`), this produces:
290
+ - `cdk-finlaysonstudio-my-project-sandbox-3f9c21ab-app`
291
+ - `cdk-finlaysonstudio-my-project-production-ba342b91-app`
292
+
293
+ The `cdk-deploy` globs `*-sandbox-*` and `*-production-*` match these names.
294
+
295
+ ### One Install per Environment
296
+
297
+ The nonce belongs to the environment, so every branch that deploys to sandbox updates the same stacks. A project serving fixed hostnames (`api.sandbox.example.com`) holds one install per environment, because CloudFront aliases and Route53 records collide. Override `project-nonce` with a new hex value only for an intentional clean install beside an existing one. Stack and bucket names cannot be renamed, so recovering from a wrong nonce means that new install and a teardown of the old one.
295
298
 
296
299
  ## Deployment Flow
297
300
 
@@ -12,6 +12,9 @@ GitHub Environments provide deployment-specific variables for Jaypie CDK workflo
12
12
  | Variable | Description |
13
13
  |----------|-------------|
14
14
  | `AWS_ROLE_ARN` | OIDC role ARN for assuming AWS credentials |
15
+ | `PROJECT_NONCE` | 8 lowercase hex characters, unique per environment |
16
+
17
+ Generate `PROJECT_NONCE` once per environment with `openssl rand -hex 4`. It scopes stack names, S3 bucket names, and SSM paths, so a new value deploys a new install and strands the old one. `setup-environment` fails when it is missing (see `skill("cicd-actions")`).
15
18
 
16
19
  ## Optional Variables
17
20
 
@@ -21,7 +24,6 @@ GitHub Environments provide deployment-specific variables for Jaypie CDK workflo
21
24
  | `LOG_LEVEL` | `trace` (sandbox) / `info` (production) | Application log level |
22
25
  | `PROJECT_CHAOS` | `full` (sandbox) / `none` (production) | Chaos engineering mode |
23
26
  | `PROJECT_ENV` | Environment name | Environment identifier |
24
- | `PROJECT_NONCE` | Branch name or `prod` | Unique identifier for resources |
25
27
 
26
28
  ## Environment Setup
27
29
 
@@ -43,6 +45,7 @@ GitHub Environments provide deployment-specific variables for Jaypie CDK workflo
43
45
  AWS_ROLE_ARN = arn:aws:iam::123456789012:role/GitHubActions-Sandbox
44
46
  AWS_REGION = us-east-1
45
47
  PROJECT_ENV = sandbox
48
+ PROJECT_NONCE = 3f9c21ab
46
49
  LOG_LEVEL = trace
47
50
  PROJECT_CHAOS = full
48
51
  ```
@@ -53,6 +56,7 @@ PROJECT_CHAOS = full
53
56
  AWS_ROLE_ARN = arn:aws:iam::123456789012:role/GitHubActions-Production
54
57
  AWS_REGION = us-east-1
55
58
  PROJECT_ENV = production
59
+ PROJECT_NONCE = ba342b91
56
60
  LOG_LEVEL = info
57
61
  PROJECT_CHAOS = none
58
62
  ```
@@ -39,11 +39,15 @@ If you see `undefined` in a CDK stack name, a required variable is missing:
39
39
  // BAD: undefined if PROJECT_NONCE not set
40
40
  const stackName = `api-${process.env.PROJECT_NONCE}`;
41
41
 
42
- // GOOD: Provide default
42
+ // BAD: a word default repeats across projects and accounts
43
43
  const nonce = process.env.PROJECT_NONCE || "dev";
44
- const stackName = `api-${nonce}`;
44
+
45
+ // GOOD: JaypieStack names the stack from PROJECT_* variables
46
+ new JaypieAppStack(app, "AppStack");
45
47
  ```
46
48
 
49
+ Set the missing variable on the GitHub environment rather than adding a default (see `skill("cicd-environments")`).
50
+
47
51
  ### "unknown" in Logs
48
52
 
49
53
  `unknown` indicates a value was expected but fell back to a default:
@@ -366,6 +366,10 @@ const nextPage = await queryByScope({
366
366
 
367
367
  `storeExchange(envelope, { exchange?, scope? })` persists an `@jaypie/llm` exchange envelope (see `skill("llm")`) as an `exchange` entity. It registers the canonical exchange model (`registerExchangeModel()` from `@jaypie/fabric`), maps envelope fields onto reserved attributes (`input`, `content`, `data`, `llm`, `status`, `xid`), and owns 400KB item-limit safety (drops the history delta, then truncates long fields, marking `metadata.truncated`). It warns and returns `null` — never throws — when `initClient()` has not run or the write fails. `@jaypie/llm` calls it automatically when `LLM_EXCHANGE_ENABLED` is set; pass `exchange` (parent id) for turn chains and `scope` to nest under a parent entity.
368
368
 
369
+ ### Skill Storage
370
+
371
+ `@jaypie/tildeskill/dynamodb` stores skills as `skill` entities queried through `indexModelCategory` (see `skill("tildeskill")`). Call `registerSkillModel()` from `@jaypie/tildeskill` before `getAllRegisteredIndexes()` so CDK declares the index.
372
+
369
373
  ### TTL (Time to Live)
370
374
 
371
375
  DynamoDB expires items whose TTL attribute holds a past Unix epoch **in seconds**. Jaypie writes that attribute (`ttl` by default) and the `JaypieDynamoDb` construct enables TTL on it by default.
package/skills/github.md CHANGED
@@ -260,7 +260,7 @@ jobs:
260
260
 
261
261
  - Deploy jobs declare `permissions` with `contents: read` and `id-token: write`
262
262
  - Composite actions under `.github/actions` receive every value through `inputs` and never reference `vars.*` or `secrets.*`
263
- - `setup-environment` supplies fallback defaults when an input is empty
263
+ - `setup-environment` supplies fallback defaults when an input is empty, except `project-nonce`, which fails the job
264
264
  - The OIDC subject for an environment job is `repo:<org>/<repo>:environment:<env>` (see ~cicd-environments for the trust policy)
265
265
 
266
266
  ## Audit
package/skills/jaypie.md CHANGED
@@ -66,7 +66,7 @@ project/
66
66
  |----------|---------|
67
67
  | `PROJECT_ENV` | Environment: local, sandbox, production |
68
68
  | `PROJECT_KEY` | Project identifier for logging |
69
- | `PROJECT_NONCE` | Unique resource identifier |
69
+ | `PROJECT_NONCE` | 8 lowercase hex characters, unique per environment |
70
70
  | `LOG_LEVEL` | Log level: trace, debug, info, warn, error |
71
71
 
72
72
  ### Error Handling
package/skills/mcp.md CHANGED
@@ -27,11 +27,15 @@ skill("tests") # Testing patterns
27
27
 
28
28
  ```
29
29
  release_notes() # Show help
30
- release_notes("list") # List all release notes
30
+ release_notes("list") # First page of all release notes
31
+ release_notes("list", { limit: 20 }) # Smaller page (default 50, maximum 200)
31
32
  release_notes("list", { package: "mcp" }) # Filter by package
33
+ release_notes("list", { cursor: "..." }) # Next page, from the footer
32
34
  release_notes("read", { package: "mcp", version: "0.5.0" }) # Read specific note
33
35
  ```
34
36
 
37
+ `list` sorts by package ascending, then version descending. When more notes exist, the last line reads `Next page: release_notes("list", { cursor: "..." })`. The cursor carries `package`, `since_version`, and `limit`, so that call alone continues the listing.
38
+
35
39
  ## Datadog Tool
36
40
 
37
41
  Unified tool for logs, monitors, metrics, synthetics, and RUM.
@@ -134,6 +138,17 @@ Each directory resolves to the first match: its environment variable, the instal
134
138
  | `MCP_RELEASE_NOTES_PATH` | Release notes directory |
135
139
  | `MCP_SKILLS_PATH` | Client skills directory layered over the Jaypie skills (namespace `local`) |
136
140
 
141
+ `getMcpBuildInfo` from `@jaypie/mcp/assets` returns `{ commit, version, versionString }` of the build that packed the markdown, the same values the `version` tool reports. A consumer that syncs the copied directories reads it from the same package without a registry call.
142
+
143
+ ```typescript
144
+ import { getMcpBuildInfo } from "@jaypie/mcp/assets";
145
+
146
+ const { commit, version, versionString } = getMcpBuildInfo();
147
+ // versionString: "@jaypie/mcp@0.8.159#460f95c3"
148
+ ```
149
+
150
+ `commit` is the first 8 characters of `PROJECT_COMMIT` at build time and is empty when it was unset. Unbuilt source returns version `0.0.0`.
151
+
137
152
  ### SDK Transport (`mcpExpressHandler`)
138
153
 
139
154
  `mcpExpressHandler` from `@jaypie/mcp` wraps the SDK's `StreamableHTTPServerTransport` with optional sessions. It suits a long-running Express server, not Lambda.
@@ -35,7 +35,10 @@ new JaypieMigration(this, "SeedData", {
35
35
  | `dependencies` | `Construct[]` | `[]` | Constructs that must be created before the migration runs |
36
36
  | `environment` | `Record<string, string> \| (Record<string, string> \| string)[]` | - | Environment variables for the migration Lambda |
37
37
  | `handler` | `string` | `"index.handler"` | Lambda entry point |
38
+ | `logGroup` | `logs.ILogGroup` | - | Log group for the migration Lambda; forwarded to `JaypieLambda`. Supply one to control KMS encryption and retention |
39
+ | `logRetention` | `logs.RetentionDays \| number` | `90` days | Retention for the log group `JaypieLambda` creates. Ignored when `logGroup` is supplied |
38
40
  | `queryInterval` | `cdk.Duration` | `Duration.seconds(60)` | Polling interval between `isCompleteHandler` invocations |
41
+ | `reservedConcurrentExecutions` | `number` | - | Reserved concurrency for the migration Lambda. `0` throws at synth; `1` leaves no headroom if onEvent overlaps a waiter poll |
39
42
  | `secrets` | `SecretsArrayItem[]` | `[]` | Secrets to make available to the Lambda |
40
43
  | `tables` | `dynamodb.ITable[]` | `[]` | DynamoDB tables to grant read/write access |
41
44
  | `timeout` | `cdk.Duration` | `Duration.minutes(15)` | Per-invocation Lambda timeout |
@@ -45,6 +48,9 @@ new JaypieMigration(this, "SeedData", {
45
48
 
46
49
  - **Timeout**: 15 minutes per invocation (Lambda max); `totalTimeout` controls the end-to-end ceiling across all polling invocations (default 2 hours)
47
50
  - **Role**: Tagged as `CDK.ROLE.PROCESSING`
51
+ - **Logging**: `logGroup`, `logRetention`, and `reservedConcurrentExecutions` forward to the wrapped `JaypieLambda`. Pass `logGroup` when a compliance baseline requires a KMS-encrypted group or 12-month retention. The `cr.Provider` framework functions keep service-created log groups
52
+ - **`logRetention` is inert when `logGroup` is supplied.** `JaypieLambda` resolves `logGroup ?? new logs.LogGroup(..., { retention: logRetention })`, so passing both silently drops the retention value. Set retention on the group you pass. Jaypie 2.0 will throw on that combination (#568)
53
+ - **Concurrency**: the migration Lambda is both `onEventHandler` and `isCompleteHandler`. `reservedConcurrentExecutions: 0` blocks every invocation and throws `ConfigurationError` at synth
48
54
  - **Execution**: Uses `cr.Provider` with both `onEventHandler` and `isCompleteHandler` pointing to the same Lambda. The `onEventHandler` returns `PhysicalResourceId` immediately; the migration code runs in `isCompleteHandler` invocations, which are polled by Step Functions until `IsComplete: true`. `Delete` requests skip the migration entirely.
49
55
  - **Dependencies**: Use `dependencies` to ensure tables and other resources exist before the migration executes
50
56
  - **Permissions**: Tables passed via `tables` get data-plane (`grantReadWriteData`), `Query` and `Scan` on `${tableArn}/index/*`, plus `DescribeTable`, `DescribeTimeToLive`, and `DescribeContinuousBackups` scoped to the table ARN and its indexes. Migrations read and write data. They do not change table shape
@@ -178,7 +178,8 @@ See `skill("apikey")` for full key generation/validation/hashing documentation.
178
178
 
179
179
  ```bash
180
180
  # First deploy creates secrets and table
181
- PROJECT_ENV=sandbox PROJECT_NONCE=dev npx cdk deploy
181
+ # PROJECT_NONCE is the environment's 8-hex nonce (see skill("cicd-environments"))
182
+ PROJECT_ENV=sandbox PROJECT_NONCE=3f9c21ab npx cdk deploy
182
183
  ```
183
184
 
184
185
  No workflow secrets needed for generated values — CloudFormation creates them on first deploy and preserves them on subsequent deploys.
@@ -9,12 +9,15 @@ How to access and write release notes for Jaypie packages.
9
9
  ## MCP Tools
10
10
 
11
11
  ```
12
- mcp__jaypie__list_release_notes()
13
- mcp__jaypie__list_release_notes(package: "mcp")
14
- mcp__jaypie__list_release_notes(package: "jaypie", since_version: "1.0.0")
15
- mcp__jaypie__read_release_note(package: "mcp", version: "0.3.4")
12
+ release_notes("list")
13
+ release_notes("list", { package: "mcp" })
14
+ release_notes("list", { package: "jaypie", since_version: "1.0.0" })
15
+ release_notes("list", { cursor: "..." })
16
+ release_notes("read", { package: "mcp", version: "0.3.4" })
16
17
  ```
17
18
 
19
+ `list` returns 50 notes per page by default (`limit`, maximum 200). When more notes exist, the last line is a `Next page` footer with a `cursor` that continues the same listing.
20
+
18
21
  ## Directory Structure
19
22
 
20
23
  ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Skill/vocabulary storage with pluggable backends (pre-1.0)
3
- related: fabric, mcp
3
+ related: dynamodb, fabric, mcp
4
4
  ---
5
5
 
6
6
  # @jaypie/tildeskill
@@ -14,6 +14,8 @@ This package provides a storage abstraction for skill/vocabulary documents with
14
14
  - Loading skills from markdown files with YAML frontmatter
15
15
  - In-memory storage for testing
16
16
  - Layered composition of multiple stores with namespace prefixes
17
+ - DynamoDB storage through the `@jaypie/tildeskill/dynamodb` subpath
18
+ - Store-to-store sync with `syncSkills`
17
19
  - Consistent alias normalization and validation
18
20
  - Filtering by namespace and tags
19
21
  - Searching across alias, name, description, content, and tags
@@ -46,6 +48,7 @@ interface ListFilter {
46
48
  }
47
49
 
48
50
  interface SkillStore {
51
+ delete(alias: string): Promise<boolean>;
49
52
  find(alias: string): Promise<SkillRecord | null>;
50
53
  get(alias: string): Promise<SkillRecord | null>;
51
54
  getByNickname(nickname: string): Promise<SkillRecord[]>;
@@ -87,6 +90,71 @@ const store = createMemoryStore([
87
90
  const skill = await store.get("test");
88
91
  ```
89
92
 
93
+ ## DynamoDB Store
94
+
95
+ ```typescript
96
+ import { initClient } from "@jaypie/dynamodb";
97
+ import { createSkillService } from "@jaypie/tildeskill";
98
+ import { createDynamoDbStore } from "@jaypie/tildeskill/dynamodb";
99
+
100
+ initClient();
101
+ const store = createDynamoDbStore({ category: "jaypie" });
102
+ const skillService = createSkillService(store);
103
+ ```
104
+
105
+ `@jaypie/dynamodb` is an optional peer dependency. Only the
106
+ `@jaypie/tildeskill/dynamodb` subpath imports it, so markdown-only consumers
107
+ never load it. The store loads it with a dynamic import on first use, so a
108
+ CJS consumer shares the host's initialized client. Call `initClient()` before
109
+ using the store.
110
+
111
+ - Records are `skill` entities at APEX scope. `category` is the store
112
+ namespace; `alias` is unqualified.
113
+ - Ids are deterministic: `uuidv5("<category>:<alias>", SKILL_NAMESPACE)`.
114
+ `SKILL_NAMESPACE` is exported from the subpath and never changes.
115
+ - `metadata.hash` holds `hashSkill(record)` (sha256) for change detection.
116
+ - `includes`, `nicknames`, and `related` are stored in `metadata`, since
117
+ `related` is reserved for entity references.
118
+ - `list`, `getByNickname`, and `search` query `indexModelCategory`.
119
+ `createDynamoDbStore` calls `registerSkillModel()`; declare the index in CDK
120
+ by calling `registerSkillModel()` before `getAllRegisteredIndexes()`.
121
+ - `find` keeps the plural/singular fallback.
122
+ - `delete` soft deletes with `deleteEntity`. Reads skip archived and deleted
123
+ entities, and a later `put` restores the same id.
124
+
125
+ ## Syncing Stores
126
+
127
+ ```typescript
128
+ import { createMarkdownStore, syncSkills } from "@jaypie/tildeskill";
129
+
130
+ const result = await syncSkills({
131
+ from: createMarkdownStore({ path: "./skills" }),
132
+ to: store,
133
+ });
134
+ // { added: ["aws"], removed: ["retired"], unchanged: ["tests"], updated: [] }
135
+ ```
136
+
137
+ `syncSkills` makes `to` match `from`. It puts records missing from `to`
138
+ (`added`) or whose `hashSkill` differs (`updated`), skips records whose hash
139
+ matches (`unchanged`), and deletes records missing from `from` (`removed`).
140
+ Each list holds aliases sorted alphabetically. An empty `from` with a
141
+ non-empty `to` throws `ConfigurationError` before writing, since a markdown
142
+ store pointed at a missing directory lists nothing. Pass
143
+ `allowEmptySource: true` to empty `to` on purpose.
144
+
145
+ ## Deleting Records
146
+
147
+ Every store implements `delete(alias)`. It matches the exact alias (no
148
+ plural/singular fallback) and returns `true` when a record was removed and
149
+ `false` when none existed.
150
+
151
+ | Store | `delete` behavior |
152
+ |-------|-------------------|
153
+ | memory | Removes the record from the map |
154
+ | markdown | Removes `<alias>.md`; throws `BadRequestError` for an invalid alias |
155
+ | layered | Requires a namespace-qualified alias and delegates to that layer; throws `ConfigurationError` when unqualified |
156
+ | dynamodb | Soft deletes the entity; reads skip it and `put` restores it |
157
+
90
158
  ## Skill Service Factory
91
159
 
92
160
  ```typescript
@@ -102,6 +170,8 @@ const skillService = createSkillService(store);
102
170
  await skillService({ alias: "aws" }); // → skill content (with expandIncludes)
103
171
  await skillService({ alias: "index" }); // → formatted listing
104
172
  await skillService(); // → same as "index"
173
+ await skillService({ alias: "missing" }); // throws NotFoundError
174
+ await skillService({ alias: "../bad" }); // throws BadRequestError
105
175
 
106
176
  // Use with fabricTool for Llm.operate toolkits
107
177
  import { fabricTool } from "@jaypie/fabric/llm";
@@ -159,11 +229,16 @@ const layered = createLayeredStore({
159
229
 
160
230
  await layered.get("aws"); // → { alias: "local:aws", ... }
161
231
  await layered.get("jaypie:aws"); // → { alias: "jaypie:aws", ... }
162
- await layered.find("skills"); // per-layer plural fallback
232
+ await layered.find("skills"); // exact alias in any layer, then fallback
163
233
  await layered.list(); // prefixed aliases from every layer
164
234
  await layered.put({ alias: "local:new", content: "# New" }); // must be qualified
165
235
  ```
166
236
 
237
+ `find` checks every layer for an exact alias before it tries plural/singular
238
+ fallback in any layer. With `local:test` and `jaypie:tests`, `find("tests")`
239
+ returns `jaypie:tests`, so a local skill cannot shadow a Jaypie skill under a
240
+ different spelling. Namespace-qualified aliases search only their own layer.
241
+
167
242
  The MCP server itself uses `createLayeredStore` to place `MCP_SKILLS_PATH`
168
243
  (the client's local library, namespace `local`) over the bundled Jaypie
169
244
  skills (namespace `jaypie`). A bundled build finds the Jaypie base layer in
@@ -13,7 +13,7 @@ Configuration variables used in Jaypie applications.
13
13
  |----------|-------------|--------|
14
14
  | `PROJECT_ENV` | Environment identifier; scopes physical resource names | local, sandbox, kitchen, lab, studio, production |
15
15
  | `PROJECT_KEY` | Project name for logging | e.g., my-api |
16
- | `PROJECT_NONCE` | Unique resource suffix; scopes physical resource names | e.g., dev, staging, prod |
16
+ | `PROJECT_NONCE` | 8 lowercase hex characters, unique per environment; scopes physical resource names | e.g., ba342b91 |
17
17
  | `PROJECT_SPONSOR` | Sponsor segment of the generated stack name and the `sponsor` tag | e.g., finlaysonstudio |
18
18
  | `PROJECT_CHAOS` | Chaos engineering mode | none, partial, full |
19
19
  | `PROJECT_SALT` | Secret salt for HMAC hashing (API keys) | Generated by JaypieEnvSecret |
@@ -23,6 +23,8 @@ Configuration variables used in Jaypie applications.
23
23
 
24
24
  `PROJECT_ENV` and `PROJECT_NONCE` together scope physical AWS resource names to avoid collisions when multiple stacks deploy to the same account. Any explicitly named resource (ECR repos, log groups, ECS task families, EventBridge rules, etc.) must include both values. See `skill("cdk")` for the full naming convention.
25
25
 
26
+ Generate `PROJECT_NONCE` once per environment with `openssl rand -hex 4` and store it as a GitHub environment variable (see `skill("github")`). A word or branch name repeats across projects and accounts, and S3 bucket names are global.
27
+
26
28
  ### Stack Naming
27
29
 
28
30
  `JaypieStack` generates `cdk-{PROJECT_SPONSOR}-{PROJECT_KEY}-{PROJECT_ENV}-{PROJECT_NONCE}[-{key}]`. Every segment must be set in CI or the name contains `undefined`, and a stack name is immutable. `skill("cicd-actions")` sets all four in `setup-environment`.