@cyanheads/mcp-ts-core 0.13.9 → 0.13.11
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 +41 -15
- package/CLAUDE.md +41 -15
- package/README.md +37 -11
- package/biome.json +1 -1
- package/changelog/0.13.x/0.13.10.md +118 -0
- package/changelog/0.13.x/0.13.11.md +113 -0
- package/dist/cli/app-render.d.ts +11 -0
- package/dist/cli/app-render.d.ts.map +1 -0
- package/dist/cli/app-render.js +150 -0
- package/dist/cli/app-render.js.map +1 -0
- package/dist/cli/init.d.ts +2 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +10 -2
- package/dist/cli/init.js.map +1 -1
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +11 -0
- package/dist/config/index.js.map +1 -1
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +15 -1
- package/dist/core/app.js.map +1 -1
- package/dist/core/context.d.ts +92 -22
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +65 -16
- package/dist/core/context.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/worker.d.ts +6 -0
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +1 -0
- package/dist/core/worker.js.map +1 -1
- package/dist/linter/rules/error-contract-rules.d.ts +3 -44
- package/dist/linter/rules/error-contract-rules.d.ts.map +1 -1
- package/dist/linter/rules/error-contract-rules.js +8 -144
- 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 +1 -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 +1 -2
- package/dist/linter/rules/tool-rules.js.map +1 -1
- package/dist/mcp-server/handlerContext.d.ts +26 -13
- package/dist/mcp-server/handlerContext.d.ts.map +1 -1
- package/dist/mcp-server/handlerContext.js +32 -17
- package/dist/mcp-server/handlerContext.js.map +1 -1
- package/dist/mcp-server/inputRequired.d.ts +120 -8
- package/dist/mcp-server/inputRequired.d.ts.map +1 -1
- package/dist/mcp-server/inputRequired.js +177 -12
- package/dist/mcp-server/inputRequired.js.map +1 -1
- package/dist/mcp-server/prompts/prompt-registration.d.ts +10 -2
- package/dist/mcp-server/prompts/prompt-registration.d.ts.map +1 -1
- package/dist/mcp-server/prompts/prompt-registration.js +49 -11
- package/dist/mcp-server/prompts/prompt-registration.js.map +1 -1
- package/dist/mcp-server/resources/resource-registration.d.ts +4 -2
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +6 -4
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +4 -3
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +60 -21
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/server.d.ts +9 -0
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +14 -13
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts +7 -3
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +9 -5
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +17 -9
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +91 -50
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js +7 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -1
- package/dist/services/mirror/sqlite/handle.d.ts +11 -5
- package/dist/services/mirror/sqlite/handle.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/handle.js +46 -8
- package/dist/services/mirror/sqlite/handle.js.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +6 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
- package/dist/testing/apps/browser.d.ts +27 -0
- package/dist/testing/apps/browser.d.ts.map +1 -0
- package/dist/testing/apps/browser.js +162 -0
- package/dist/testing/apps/browser.js.map +1 -0
- package/dist/testing/apps/cdp-pipe.d.ts +79 -0
- package/dist/testing/apps/cdp-pipe.d.ts.map +1 -0
- package/dist/testing/apps/cdp-pipe.js +200 -0
- package/dist/testing/apps/cdp-pipe.js.map +1 -0
- package/dist/testing/apps/csp.d.ts +17 -0
- package/dist/testing/apps/csp.d.ts.map +1 -0
- package/dist/testing/apps/csp.js +50 -0
- package/dist/testing/apps/csp.js.map +1 -0
- package/dist/testing/apps/host-pages.d.ts +47 -0
- package/dist/testing/apps/host-pages.d.ts.map +1 -0
- package/dist/testing/apps/host-pages.js +138 -0
- package/dist/testing/apps/host-pages.js.map +1 -0
- package/dist/testing/apps/index.d.ts +167 -0
- package/dist/testing/apps/index.d.ts.map +1 -0
- package/dist/testing/apps/index.js +36 -0
- package/dist/testing/apps/index.js.map +1 -0
- package/dist/testing/apps/partial-json.d.ts +14 -0
- package/dist/testing/apps/partial-json.d.ts.map +1 -0
- package/dist/testing/apps/partial-json.js +71 -0
- package/dist/testing/apps/partial-json.js.map +1 -0
- package/dist/testing/apps/run.d.ts +13 -0
- package/dist/testing/apps/run.d.ts.map +1 -0
- package/dist/testing/apps/run.js +659 -0
- package/dist/testing/apps/run.js.map +1 -0
- package/dist/testing/index.d.ts +17 -2
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +21 -7
- package/dist/testing/index.js.map +1 -1
- package/dist/types-global/errors.d.ts +18 -15
- package/dist/types-global/errors.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts +5 -4
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.js +9 -7
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
- package/dist/utils/internal/error-handler/types.d.ts +3 -1
- package/dist/utils/internal/error-handler/types.d.ts.map +1 -1
- package/dist/utils/internal/logger.d.ts +21 -1
- package/dist/utils/internal/logger.d.ts.map +1 -1
- package/dist/utils/internal/logger.js +31 -14
- package/dist/utils/internal/logger.js.map +1 -1
- package/dist/utils/internal/performance.d.ts +7 -3
- package/dist/utils/internal/performance.d.ts.map +1 -1
- package/dist/utils/internal/performance.js +16 -9
- package/dist/utils/internal/performance.js.map +1 -1
- package/dist/utils/internal/telemetryMessages.d.ts +0 -1
- package/dist/utils/internal/telemetryMessages.d.ts.map +1 -1
- package/dist/utils/internal/telemetryMessages.js +0 -1
- package/dist/utils/internal/telemetryMessages.js.map +1 -1
- package/dist/utils/security/sanitization.d.ts +16 -13
- package/dist/utils/security/sanitization.d.ts.map +1 -1
- package/dist/utils/security/sanitization.js +74 -33
- package/dist/utils/security/sanitization.js.map +1 -1
- package/dist/utils/telemetry/attributes.d.ts +12 -5
- package/dist/utils/telemetry/attributes.d.ts.map +1 -1
- package/dist/utils/telemetry/attributes.js +12 -5
- package/dist/utils/telemetry/attributes.js.map +1 -1
- package/framework-skills/add-app-tool/SKILL.md +2 -1
- package/framework-skills/add-service/SKILL.md +3 -12
- package/framework-skills/add-test/SKILL.md +20 -17
- package/framework-skills/add-tool/SKILL.md +30 -34
- package/framework-skills/api-config/SKILL.md +12 -2
- package/framework-skills/api-context/SKILL.md +156 -41
- package/framework-skills/api-errors/SKILL.md +43 -47
- package/framework-skills/api-linter/SKILL.md +5 -29
- package/framework-skills/api-mirror/SKILL.md +4 -3
- package/framework-skills/api-telemetry/SKILL.md +16 -10
- package/framework-skills/api-testing/SKILL.md +47 -11
- package/framework-skills/api-utils/SKILL.md +3 -3
- package/framework-skills/api-workers/SKILL.md +3 -1
- package/framework-skills/code-simplifier/SKILL.md +2 -2
- package/framework-skills/design-mcp-server/SKILL.md +5 -5
- package/framework-skills/field-test/SKILL.md +53 -8
- package/framework-skills/git-wrapup/SKILL.md +2 -2
- package/framework-skills/orchestrations/SKILL.md +1 -1
- package/framework-skills/orchestrations/workflows/greenfield-build.md +2 -2
- package/framework-skills/polish-docs-meta/SKILL.md +4 -3
- package/framework-skills/polish-docs-meta/references/server-json.md +24 -26
- package/framework-skills/release-and-publish/SKILL.md +3 -3
- package/framework-skills/release-pr-review/SKILL.md +6 -6
- package/framework-skills/security-pass/SKILL.md +8 -7
- package/framework-skills/setup/SKILL.md +2 -2
- package/package.json +38 -22
- package/scripts/devcheck.ts +43 -21
- package/scripts/install-otel.ts +84 -0
- package/scripts/lint-packaging.ts +279 -28
- package/scripts/prune-musl-packages.ts +146 -0
- package/templates/.env.example +2 -0
- package/templates/.github/workflows/codeql.yml +10 -1
- package/templates/AGENTS.md +5 -4
- package/templates/CLAUDE.md +5 -4
- package/templates/Dockerfile +76 -50
- package/templates/_.dockerignore +3 -5
- package/templates/_.gitignore +4 -4
- package/templates/package.json +4 -4
- package/templates/server.json +7 -21
- package/templates/src/mcp-server/tools/definitions/echo.tool.ts +3 -8
package/templates/Dockerfile
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
#
|
|
7
7
|
# Pinned to $BUILDPLATFORM rather than the target platform: `bun run build` emits
|
|
8
|
-
# JavaScript, and only `dist/` crosses into the production stage
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
8
|
+
# JavaScript, and only `dist/` crosses into the production stage. Built for the
|
|
9
|
+
# target instead, the non-native leg of a `--platform linux/amd64,linux/arm64`
|
|
10
|
+
# build runs under QEMU, where bun >= 1.4 aborts with a JavaScriptCore allocator
|
|
11
|
+
# assertion and fails the multi-arch push.
|
|
12
12
|
#
|
|
13
13
|
# The constraint this assumes: the build stage produces platform-independent
|
|
14
14
|
# output. A stage that compiles a native addon needs the target-arch toolchain
|
|
@@ -34,80 +34,106 @@ RUN bun run build
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
# ==============================================================================
|
|
37
|
-
# Production Stage
|
|
37
|
+
# Production Dependencies Stage
|
|
38
38
|
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
39
|
+
# Installs the production dependency tree for the target platform. Every step
|
|
40
|
+
# here can run JavaScript — bunfig.toml's security scanner runs as a Bun
|
|
41
|
+
# program, and so do the OTel and musl-prune scripts — so the stage runs on
|
|
42
|
+
# $BUILDPLATFORM and cross-installs with `--os`/`--cpu`, which pick each
|
|
43
|
+
# platform-specific optional dependency (native bindings such as DuckDB's) for
|
|
44
|
+
# the target. Only `node_modules` leaves this stage.
|
|
45
|
+
#
|
|
46
|
+
# A clean image rather than `FROM build`: the build stage's node_modules holds
|
|
47
|
+
# devDependencies.
|
|
42
48
|
# ==============================================================================
|
|
43
|
-
FROM oven/bun:1.4.2
|
|
49
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 AS deps
|
|
44
50
|
|
|
45
51
|
WORKDIR /usr/src/app
|
|
46
52
|
|
|
47
|
-
# Set the environment to production for performance and to ensure only
|
|
48
|
-
# production dependencies are installed.
|
|
49
|
-
ENV NODE_ENV=production
|
|
50
|
-
|
|
51
|
-
# OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
|
|
52
|
-
ARG APP_VERSION
|
|
53
|
-
LABEL org.opencontainers.image.title="{{PACKAGE_NAME}}"
|
|
54
|
-
LABEL org.opencontainers.image.description=""
|
|
55
|
-
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
|
56
|
-
LABEL org.opencontainers.image.version="${APP_VERSION}"
|
|
57
|
-
LABEL org.opencontainers.image.source=""
|
|
58
|
-
|
|
59
53
|
# Copy dependency manifests. `bunfig.toml` rides along so every install below
|
|
60
54
|
# passes its release-age gate and security scanner, as a local install does.
|
|
61
55
|
COPY package.json bun.lock bunfig.toml ./
|
|
62
56
|
|
|
63
57
|
# The scanner bunfig.toml names is a devDependency, and Bun installs a missing
|
|
64
58
|
# scanner through the same production-filtered install, which omits it and
|
|
65
|
-
# aborts. Seed it from the build stage's full install instead. Remove this line
|
|
66
|
-
#
|
|
59
|
+
# aborts. Seed it from the build stage's full install instead. Remove this line,
|
|
60
|
+
# and the `rm` at the end of this stage, if bunfig.toml stops naming a scanner.
|
|
67
61
|
COPY --from=build /usr/src/app/node_modules/@socketsecurity/bun-security-scanner ./node_modules/@socketsecurity/bun-security-scanner
|
|
68
62
|
|
|
63
|
+
# Docker names the target architecture `amd64`/`arm64`; Bun's `--cpu` takes
|
|
64
|
+
# `x64`/`arm64`. Mapped once here, read by both installs below. `oven/bun`
|
|
65
|
+
# publishes only these two architectures, so any other target fails here.
|
|
66
|
+
ARG TARGETOS
|
|
67
|
+
ARG TARGETARCH
|
|
68
|
+
RUN case "$TARGETARCH" in \
|
|
69
|
+
amd64) echo x64 ;; \
|
|
70
|
+
arm64) echo arm64 ;; \
|
|
71
|
+
*) echo "Unsupported TARGETARCH '$TARGETARCH': expected amd64 or arm64" >&2; exit 1 ;; \
|
|
72
|
+
esac > .bun-cpu
|
|
73
|
+
|
|
69
74
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
70
75
|
# that are not needed in the final production image.
|
|
71
76
|
# `--omit=peer` drops the framework's optional peer tiers (test runner, service
|
|
72
77
|
# SDKs, parsers) that Bun would otherwise auto-install. Anything this server
|
|
73
78
|
# actually imports belongs in its own `dependencies`, so nothing needed at
|
|
74
|
-
# runtime is lost.
|
|
75
|
-
# install re-resolves the graph and pulls every optional peer back in.
|
|
79
|
+
# runtime is lost.
|
|
76
80
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
77
|
-
bun install --production --omit=peer --frozen-lockfile --ignore-scripts
|
|
81
|
+
bun install --production --omit=peer --frozen-lockfile --ignore-scripts \
|
|
82
|
+
--os="$TARGETOS" --cpu="$(cat .bun-cpu)"
|
|
78
83
|
|
|
79
84
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
80
85
|
# Installed by default. Omit them for a leaner image at build time
|
|
81
86
|
# with: docker build --build-arg OTEL_ENABLED=false
|
|
82
|
-
#
|
|
83
|
-
# `peerDependencies
|
|
84
|
-
|
|
87
|
+
# The script reads the list and each range from the installed framework's
|
|
88
|
+
# `peerDependencies` and passes the target flags on to its `bun install`.
|
|
89
|
+
COPY scripts/install-otel.ts ./scripts/
|
|
85
90
|
ARG OTEL_ENABLED=true
|
|
86
91
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
87
92
|
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
88
|
-
|
|
89
|
-
const { peerDependencies: peers } = await Bun.file("node_modules/@cyanheads/mcp-ts-core/package.json").json(); \
|
|
90
|
-
const names = process.argv.slice(1); \
|
|
91
|
-
const missing = names.filter((name) => !peers?.[name]); \
|
|
92
|
-
if (missing.length > 0) throw new Error(`no peerDependencies range for ${missing.join(", ")}`); \
|
|
93
|
-
console.log(names.map((name) => `${name}@${peers[name]}`).join(" ")); \
|
|
94
|
-
' \
|
|
95
|
-
@hono/otel \
|
|
96
|
-
@opentelemetry/api-logs \
|
|
97
|
-
@opentelemetry/exporter-logs-otlp-http \
|
|
98
|
-
@opentelemetry/exporter-metrics-otlp-http \
|
|
99
|
-
@opentelemetry/exporter-trace-otlp-http \
|
|
100
|
-
@opentelemetry/instrumentation-http \
|
|
101
|
-
@opentelemetry/instrumentation-pino \
|
|
102
|
-
@opentelemetry/resources \
|
|
103
|
-
@opentelemetry/sdk-logs \
|
|
104
|
-
@opentelemetry/sdk-metrics \
|
|
105
|
-
@opentelemetry/sdk-node \
|
|
106
|
-
@opentelemetry/sdk-trace-node \
|
|
107
|
-
@opentelemetry/semantic-conventions) \
|
|
108
|
-
&& bun add --omit=dev --omit=peer --ignore-scripts $specs; \
|
|
93
|
+
bun scripts/install-otel.ts --os="$TARGETOS" --cpu="$(cat .bun-cpu)"; \
|
|
109
94
|
fi
|
|
110
95
|
|
|
96
|
+
# `--os`/`--cpu` have no libc counterpart, so a native dependency published in
|
|
97
|
+
# glibc and musl variants (DuckDB's bindings, for one) installs both. The
|
|
98
|
+
# runtime image is Debian (glibc) and never loads the musl copy; the script
|
|
99
|
+
# deletes every package whose own `libc` admits only musl. It follows every
|
|
100
|
+
# install, since a later `bun install` restores what it removes. A server on a
|
|
101
|
+
# musl (Alpine) runtime image drops these two lines.
|
|
102
|
+
COPY scripts/prune-musl-packages.ts ./scripts/
|
|
103
|
+
RUN bun scripts/prune-musl-packages.ts
|
|
104
|
+
|
|
105
|
+
# The seeded scanner served only the installs above; keep it out of the image.
|
|
106
|
+
RUN rm -rf node_modules/@socketsecurity/bun-security-scanner
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# ==============================================================================
|
|
110
|
+
# Production Stage
|
|
111
|
+
#
|
|
112
|
+
# This stage creates a minimal, optimized, and secure image for running the
|
|
113
|
+
# application. It uses a slim base image and only includes production
|
|
114
|
+
# dependencies and build artifacts. Its only Bun invocations are HEALTHCHECK
|
|
115
|
+
# and CMD, which run on the real target at container start.
|
|
116
|
+
# ==============================================================================
|
|
117
|
+
FROM oven/bun:1.4.2-slim AS production
|
|
118
|
+
|
|
119
|
+
WORKDIR /usr/src/app
|
|
120
|
+
|
|
121
|
+
# Set the environment to production for performance.
|
|
122
|
+
ENV NODE_ENV=production
|
|
123
|
+
|
|
124
|
+
# OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
|
|
125
|
+
ARG APP_VERSION
|
|
126
|
+
LABEL org.opencontainers.image.title="{{PACKAGE_NAME}}"
|
|
127
|
+
LABEL org.opencontainers.image.description=""
|
|
128
|
+
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
|
129
|
+
LABEL org.opencontainers.image.version="${APP_VERSION}"
|
|
130
|
+
LABEL org.opencontainers.image.source=""
|
|
131
|
+
|
|
132
|
+
# The manifest comes from the build context: the deps stage's copy was rewritten
|
|
133
|
+
# by the OTel install, and the runtime reads only its name, version, and type.
|
|
134
|
+
COPY package.json ./
|
|
135
|
+
COPY --from=deps /usr/src/app/node_modules ./node_modules
|
|
136
|
+
|
|
111
137
|
# Copy the compiled application code from the build stage
|
|
112
138
|
COPY --from=build /usr/src/app/dist ./dist
|
|
113
139
|
|
package/templates/_.dockerignore
CHANGED
|
@@ -164,11 +164,9 @@ coverage/
|
|
|
164
164
|
# =============================================================================
|
|
165
165
|
# ENVIRONMENT & CONFIGURATION
|
|
166
166
|
# =============================================================================
|
|
167
|
-
.env
|
|
168
|
-
.
|
|
169
|
-
.
|
|
170
|
-
.env.test.local
|
|
171
|
-
.env.production.local
|
|
167
|
+
.env*
|
|
168
|
+
.mcpregistry_github_token
|
|
169
|
+
.mcpregistry_registry_token
|
|
172
170
|
.sample-env
|
|
173
171
|
sample.*
|
|
174
172
|
!sample.template.*
|
package/templates/_.gitignore
CHANGED
|
@@ -40,7 +40,6 @@ dist/
|
|
|
40
40
|
# TESTING & COVERAGE
|
|
41
41
|
# =============================================================================
|
|
42
42
|
coverage/
|
|
43
|
-
!coverage/coverage-final.json
|
|
44
43
|
|
|
45
44
|
# =============================================================================
|
|
46
45
|
# LOGS & DATABASES
|
|
@@ -59,9 +58,10 @@ logs/
|
|
|
59
58
|
# =============================================================================
|
|
60
59
|
# ENVIRONMENT & CONFIGURATION
|
|
61
60
|
# =============================================================================
|
|
62
|
-
.env
|
|
63
|
-
|
|
64
|
-
.
|
|
61
|
+
.env*
|
|
62
|
+
!.env.example
|
|
63
|
+
!.env.template
|
|
64
|
+
!.env.sample
|
|
65
65
|
.wrangler
|
|
66
66
|
worker-configuration.d.ts
|
|
67
67
|
|
package/templates/package.json
CHANGED
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"zod": "{{ZOD_VERSION}}"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@biomejs/biome": "2.5.
|
|
70
|
+
"@biomejs/biome": "2.5.15",
|
|
71
71
|
"@socketsecurity/bun-security-scanner": "^1.1.3",
|
|
72
|
-
"@types/node": "26.6.
|
|
72
|
+
"@types/node": "26.6.3",
|
|
73
73
|
"@vitest/coverage-istanbul": "4.1.11",
|
|
74
74
|
"depcheck": "^1.4.7",
|
|
75
75
|
"fast-check": "^4.9.0",
|
|
76
|
-
"ignore": "^7.0.
|
|
77
|
-
"tsc-alias": "^1.9.
|
|
76
|
+
"ignore": "^7.0.11",
|
|
77
|
+
"tsc-alias": "^1.9.7",
|
|
78
78
|
"typescript": "^7.0.2",
|
|
79
79
|
"vitest": "^4.1.11"
|
|
80
80
|
}
|
package/templates/server.json
CHANGED
|
@@ -12,18 +12,8 @@
|
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "{{PACKAGE_NAME}}",
|
|
15
|
-
"runtimeHint": "
|
|
15
|
+
"runtimeHint": "npx",
|
|
16
16
|
"version": "0.1.0",
|
|
17
|
-
"packageArguments": [
|
|
18
|
-
{
|
|
19
|
-
"type": "positional",
|
|
20
|
-
"value": "run"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"type": "positional",
|
|
24
|
-
"value": "start:stdio"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
17
|
"environmentVariables": [
|
|
28
18
|
{
|
|
29
19
|
"name": "MCP_LOG_LEVEL",
|
|
@@ -41,19 +31,15 @@
|
|
|
41
31
|
"registryType": "npm",
|
|
42
32
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
43
33
|
"identifier": "{{PACKAGE_NAME}}",
|
|
44
|
-
"runtimeHint": "
|
|
34
|
+
"runtimeHint": "npx",
|
|
45
35
|
"version": "0.1.0",
|
|
46
|
-
"
|
|
36
|
+
"environmentVariables": [
|
|
47
37
|
{
|
|
48
|
-
"
|
|
49
|
-
"
|
|
38
|
+
"name": "MCP_TRANSPORT_TYPE",
|
|
39
|
+
"description": "Selects the HTTP transport.",
|
|
40
|
+
"format": "string",
|
|
41
|
+
"value": "http"
|
|
50
42
|
},
|
|
51
|
-
{
|
|
52
|
-
"type": "positional",
|
|
53
|
-
"value": "start:http"
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"environmentVariables": [
|
|
57
43
|
{
|
|
58
44
|
"name": "MCP_HTTP_HOST",
|
|
59
45
|
"description": "The hostname for the HTTP server.",
|
|
@@ -27,7 +27,8 @@ export const echoTool = tool('template_echo_message', {
|
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
// Declare each domain failure mode the agent should plan around. The framework
|
|
30
|
-
// types `ctx.fail(reason, …)` against the declared union
|
|
30
|
+
// types `ctx.fail(reason, …)` against the declared union and puts the entry's
|
|
31
|
+
// `recovery` on both client surfaces when the throw carries none. Baseline codes
|
|
31
32
|
// (InternalError, ServiceUnavailable, Timeout, ValidationError,
|
|
32
33
|
// SerializationError) bubble freely — only declare domain-specific reasons.
|
|
33
34
|
// Delete this block if no domain-specific failures apply to your tool.
|
|
@@ -42,13 +43,7 @@ export const echoTool = tool('template_echo_message', {
|
|
|
42
43
|
|
|
43
44
|
handler(input, ctx) {
|
|
44
45
|
if (input.message.trim().length === 0) {
|
|
45
|
-
|
|
46
|
-
// it the hint reaches neither structuredContent nor content[].
|
|
47
|
-
throw ctx.fail(
|
|
48
|
-
'empty_message',
|
|
49
|
-
'Message must contain at least one non-whitespace character.',
|
|
50
|
-
{ ...ctx.recoveryFor('empty_message') },
|
|
51
|
-
);
|
|
46
|
+
throw ctx.fail('empty_message', 'Message must contain at least one non-whitespace character.');
|
|
52
47
|
}
|
|
53
48
|
// Reaches both client surfaces with no format() plumbing.
|
|
54
49
|
ctx.enrich({ characterCount: input.message.length });
|