@cyanheads/hn-mcp-server 0.5.11 → 0.5.13
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/CLAUDE.md +59 -12
- package/Dockerfile +11 -7
- package/LICENSE +1 -1
- package/README.md +7 -5
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +1 -0
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts +35 -5
- package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-stories.tool.js +39 -0
- package/dist/mcp-server/tools/definitions/get-stories.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts +29 -0
- package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-thread.tool.js +48 -3
- package/dist/mcp-server/tools/definitions/get-thread.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.d.ts +31 -0
- package/dist/mcp-server/tools/definitions/get-user.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-user.tool.js +72 -16
- package/dist/mcp-server/tools/definitions/get-user.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.d.ts +39 -5
- package/dist/mcp-server/tools/definitions/search-content.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-content.tool.js +69 -14
- package/dist/mcp-server/tools/definitions/search-content.tool.js.map +1 -1
- package/dist/services/hn/hn-service.d.ts +12 -1
- package/dist/services/hn/hn-service.d.ts.map +1 -1
- package/dist/services/hn/hn-service.js +101 -32
- package/dist/services/hn/hn-service.js.map +1 -1
- package/package.json +11 -10
- package/server.json +5 -5
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** hn-mcp-server
|
|
4
|
-
**Version:** 0.5.
|
|
4
|
+
**Version:** 0.5.13
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
6
6
|
|
|
7
7
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -14,7 +14,7 @@ When the user asks what to do next, what's left, or needs direction, suggest rel
|
|
|
14
14
|
|
|
15
15
|
1. **Re-run the `setup` skill** — ensures CLAUDE.md, skills, structure, and metadata are populated and up to date with the current codebase
|
|
16
16
|
2. **Run the `design-mcp-server` skill** — if the tool/resource surface hasn't been mapped yet, work through domain design
|
|
17
|
-
3. **Add tools/resources/prompts** — scaffold new definitions using the `add-tool`, `add-resource`, `add-prompt` skills
|
|
17
|
+
3. **Add tools/resources/prompts** — scaffold new definitions using the `add-tool`, `add-app-tool`, `add-resource`, `add-prompt` skills
|
|
18
18
|
4. **Add services** — scaffold domain service integrations using the `add-service` skill
|
|
19
19
|
5. **Add tests** — scaffold tests for existing definitions using the `add-test` skill
|
|
20
20
|
6. **Field-test definitions** — exercise tools/resources/prompts with real inputs using the `field-test` skill, get a report of issues and pain points
|
|
@@ -125,12 +125,14 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
125
125
|
| Property | Description |
|
|
126
126
|
|:---------|:------------|
|
|
127
127
|
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
128
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
128
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
129
129
|
| `ctx.elicit` | Ask user for structured input — form call `(message, schema)` or `.url(message, url)` for an external link. **Check for presence first:** `if (ctx.elicit) { ... }` |
|
|
130
|
+
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
131
|
+
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
130
132
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
131
133
|
| `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
|
|
132
134
|
| `ctx.requestId` | Unique request ID. |
|
|
133
|
-
| `ctx.tenantId` | Tenant ID from JWT
|
|
135
|
+
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
134
136
|
|
|
135
137
|
---
|
|
136
138
|
|
|
@@ -215,7 +217,7 @@ src/
|
|
|
215
217
|
|
|
216
218
|
## Skills
|
|
217
219
|
|
|
218
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
220
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
219
221
|
|
|
220
222
|
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). This makes skills available as context without needing to reference `skills/` paths manually. After framework updates, run the `maintenance` skill — it re-syncs the agent directory automatically (Phase B).
|
|
221
223
|
|
|
@@ -235,7 +237,6 @@ Available skills:
|
|
|
235
237
|
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
236
238
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
237
239
|
| `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
|
|
238
|
-
| `devcheck` | Lint, format, typecheck, audit |
|
|
239
240
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
240
241
|
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
241
242
|
| `release-and-publish` | Post-wrapup ship workflow: verification gate, push, publish to npm/MCP Registry/GHCR |
|
|
@@ -257,31 +258,75 @@ Available skills:
|
|
|
257
258
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
258
259
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
259
260
|
|
|
261
|
+
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
262
|
+
|
|
260
263
|
When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
|
|
261
264
|
|
|
262
265
|
---
|
|
263
266
|
|
|
264
267
|
## Commands
|
|
265
268
|
|
|
269
|
+
**Runtime:** Scripts use Bun's native TypeScript execution — `bun run <cmd>` is the standard invocation.
|
|
270
|
+
|
|
266
271
|
| Command | Purpose |
|
|
267
272
|
|:--------|:--------|
|
|
268
273
|
| `bun run build` | Compile TypeScript |
|
|
269
274
|
| `bun run rebuild` | Clean + build |
|
|
270
275
|
| `bun run clean` | Remove build artifacts |
|
|
271
|
-
| `bun run devcheck` | Lint + format + typecheck + security |
|
|
276
|
+
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
272
277
|
| `bun run tree` | Generate directory structure doc |
|
|
273
|
-
| `bun run format` | Auto-fix formatting |
|
|
278
|
+
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
279
|
+
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
274
280
|
| `bun run list-skills` | Print skills index from project `skills/` |
|
|
275
|
-
| `bun run lint:mcp` | Validate MCP tool/resource definitions |
|
|
281
|
+
| `bun run lint:mcp` | Validate MCP tool/resource definitions (rule catalog: `api-linter` skill) |
|
|
276
282
|
| `bun run lint:packaging` | Validate env-var alignment between `manifest.json` and `server.json` |
|
|
277
283
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
278
|
-
| `bun run
|
|
279
|
-
| `bun run
|
|
284
|
+
| `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
|
|
285
|
+
| `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
286
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-audit. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
287
|
+
| `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
|
|
280
288
|
| `bun run start:stdio` | Production mode (stdio) |
|
|
281
289
|
| `bun run start:http` | Production mode (HTTP) |
|
|
282
290
|
|
|
283
291
|
---
|
|
284
292
|
|
|
293
|
+
## Bundling
|
|
294
|
+
|
|
295
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP deployments are unaffected.
|
|
296
|
+
|
|
297
|
+
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
298
|
+
|
|
299
|
+
**README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Changelog
|
|
304
|
+
|
|
305
|
+
Directory-based, grouped by minor series via the `.x` semver-wildcard convention. Source of truth: `changelog/<major.minor>.x/<version>.md` — one file per release, shipped in the npm package. At release, author the per-version file with a concrete version and date, then run `bun run changelog:build` to regenerate the rollup. `changelog/template.md` is a **pristine format reference** — never edited or moved; read it for the frontmatter + section layout when scaffolding. `CHANGELOG.md` is a **navigation index** (header + link + summary per version), regenerated by `bun run changelog:build` — devcheck hard-fails on drift; never hand-edit it.
|
|
306
|
+
|
|
307
|
+
Each per-version file opens with YAML frontmatter:
|
|
308
|
+
|
|
309
|
+
```markdown
|
|
310
|
+
---
|
|
311
|
+
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
312
|
+
breaking: false # optional — true flags breaking changes
|
|
313
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
# 0.1.0 — YYYY-MM-DD
|
|
317
|
+
...
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`).
|
|
321
|
+
|
|
322
|
+
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content there won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
323
|
+
|
|
324
|
+
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
325
|
+
|
|
326
|
+
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `changelog/template.md` for the full format reference.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
285
330
|
## Imports
|
|
286
331
|
|
|
287
332
|
```ts
|
|
@@ -314,12 +359,14 @@ mcp-publisher publish
|
|
|
314
359
|
|
|
315
360
|
## Checklist
|
|
316
361
|
|
|
317
|
-
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types
|
|
362
|
+
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
|
|
363
|
+
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
|
|
318
364
|
- [ ] JSDoc `@fileoverview` + `@module` on every file
|
|
319
365
|
- [ ] `ctx.log` for logging — no `console` calls
|
|
320
366
|
- [ ] Handlers throw on failure — `ctx.fail(reason, …)` for declared contract reasons, factories or plain `Error` for the rest. No try/catch.
|
|
321
367
|
- [ ] Domain failure modes declared in `errors[]` with `recovery` strings (≥5 words, lint-validated); `ctx.recoveryFor('reason')` spread into throw `data` to mirror onto the wire
|
|
322
368
|
- [ ] Service-layer throws carry `data: { reason, recovery: { hint } }` so format()-only clients see the recovery hint
|
|
369
|
+
- [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
|
|
323
370
|
- [ ] Wrapping HN/Algolia: schemas reflect real upstream sparsity (HN omits fields freely); `format()` preserves uncertainty rather than fabricating from missing data
|
|
324
371
|
- [ ] Tests cover at least one sparse payload case per tool that wraps upstream items
|
|
325
372
|
- [ ] Tests use `createMockContext({ errors: tool.errors })` when the test exercises `ctx.fail`
|
package/Dockerfile
CHANGED
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
# ==============================================================================
|
|
7
|
-
FROM oven/bun:1.3 AS build
|
|
7
|
+
FROM oven/bun:1.3.14 AS build
|
|
8
8
|
|
|
9
9
|
WORKDIR /usr/src/app
|
|
10
10
|
|
|
11
11
|
# Copy dependency manifests for optimized layer caching
|
|
12
12
|
COPY package.json bun.lock ./
|
|
13
13
|
|
|
14
|
-
# Install all dependencies (including dev dependencies for building)
|
|
15
|
-
|
|
14
|
+
# Install all dependencies (including dev dependencies for building).
|
|
15
|
+
# The BuildKit cache mount persists Bun's global package cache across builds.
|
|
16
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
17
|
+
bun install --frozen-lockfile --ignore-scripts
|
|
16
18
|
|
|
17
19
|
# Copy the rest of the source code
|
|
18
20
|
COPY . .
|
|
@@ -28,7 +30,7 @@ RUN bun run build
|
|
|
28
30
|
# application. It uses a slim base image and only includes production
|
|
29
31
|
# dependencies and build artifacts.
|
|
30
32
|
# ==============================================================================
|
|
31
|
-
FROM oven/bun:1.3-slim AS production
|
|
33
|
+
FROM oven/bun:1.3.14-slim AS production
|
|
32
34
|
|
|
33
35
|
WORKDIR /usr/src/app
|
|
34
36
|
|
|
@@ -49,14 +51,16 @@ COPY package.json bun.lock ./
|
|
|
49
51
|
|
|
50
52
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
51
53
|
# that are not needed in the final production image.
|
|
52
|
-
RUN bun
|
|
54
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
55
|
+
bun install --production --frozen-lockfile --ignore-scripts
|
|
53
56
|
|
|
54
57
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
55
58
|
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
56
59
|
# with: docker build --build-arg OTEL_ENABLED=true
|
|
57
60
|
ARG OTEL_ENABLED=true
|
|
58
|
-
RUN
|
|
59
|
-
|
|
61
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
62
|
+
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
63
|
+
bun add --omit=dev --ignore-scripts @hono/otel \
|
|
60
64
|
@opentelemetry/instrumentation-http \
|
|
61
65
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
62
66
|
@opentelemetry/exporter-trace-otlp-http \
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/hn-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/hn-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -35,7 +35,7 @@ Four read-only tools for accessing Hacker News data:
|
|
|
35
35
|
|:----------|:------------|
|
|
36
36
|
| `hn_get_stories` | Fetch stories from an HN feed (top, new, best, ask, show, jobs) with pagination. |
|
|
37
37
|
| `hn_get_thread` | Get an item and its comment tree as a threaded discussion with depth/count controls. |
|
|
38
|
-
| `hn_get_user` | Fetch a user profile with karma, about, and optionally their
|
|
38
|
+
| `hn_get_user` | Fetch a user profile with karma, about, and optionally a page of their submissions. |
|
|
39
39
|
| `hn_search_content` | Search stories and comments via Algolia with type, author, date, and score filters. |
|
|
40
40
|
|
|
41
41
|
### `hn_get_stories`
|
|
@@ -61,10 +61,11 @@ Retrieve an item and its full comment tree via ranked breadth-first traversal.
|
|
|
61
61
|
|
|
62
62
|
### `hn_get_user`
|
|
63
63
|
|
|
64
|
-
Fetch a user profile with optional
|
|
64
|
+
Fetch a user profile with optional submission resolution.
|
|
65
65
|
|
|
66
66
|
- Profile includes karma, creation date, and about text (HTML stripped)
|
|
67
|
-
- Optionally resolves
|
|
67
|
+
- Optionally resolves submissions into full items, up to 50 per page
|
|
68
|
+
- `submissionOffset` pages through a long history; enrichment echoes the applied offset and the offset to request next
|
|
68
69
|
- Submission resolution filters out dead/deleted items
|
|
69
70
|
|
|
70
71
|
---
|
|
@@ -77,6 +78,7 @@ Full-text search via the Algolia HN Search API.
|
|
|
77
78
|
- Filter by author, date range (ISO 8601), and minimum points
|
|
78
79
|
- Sort by relevance or date
|
|
79
80
|
- Pagination with page/count controls
|
|
81
|
+
- `view: "compact"` drops the two body-text fields (`text`, `highlights.text`), which otherwise repeat a long comment twice per hit — pass a hit id to `hn_get_thread` to read the body
|
|
80
82
|
|
|
81
83
|
## Features
|
|
82
84
|
|
|
@@ -185,7 +187,7 @@ All configuration is via environment variables. No API keys required — HN APIs
|
|
|
185
187
|
|
|
186
188
|
| Variable | Description | Default |
|
|
187
189
|
|:---------|:------------|:--------|
|
|
188
|
-
| `HN_CONCURRENCY_LIMIT` | Max concurrent HTTP requests for batch item fetches (1–50). | `10` |
|
|
190
|
+
| `HN_CONCURRENCY_LIMIT` | Max concurrent HTTP requests for batch item fetches (integer, 1–50). | `10` |
|
|
189
191
|
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
190
192
|
| `MCP_HTTP_PORT` | HTTP server port. | `3010` |
|
|
191
193
|
| `MCP_HTTP_HOST` | HTTP server host. | `localhost` |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,wBAAgB,eAAe;;EAK9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM;SACvB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,sDAAsD,CAAC;CACpE,CAAC,CAAC;AAEH,IAAI,OAAuD,CAAC;AAE5D,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,kBAAkB,CAAC,KAAK,CAAC;QACnC,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB;KACnD,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM;SACvB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,sDAAsD,CAAC;CACpE,CAAC,CAAC;AAEH,IAAI,OAAuD,CAAC;AAE5D,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,kBAAkB,CAAC,KAAK,CAAC;QACnC,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB;KACnD,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/get-stories.tool
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
6
7
|
export declare const getStories: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
8
|
feed: z.ZodEnum<{
|
|
8
|
-
top: "top";
|
|
9
|
-
new: "new";
|
|
10
|
-
best: "best";
|
|
11
9
|
ask: "ask";
|
|
12
|
-
|
|
10
|
+
best: "best";
|
|
13
11
|
jobs: "jobs";
|
|
12
|
+
new: "new";
|
|
13
|
+
show: "show";
|
|
14
|
+
top: "top";
|
|
14
15
|
}>;
|
|
15
16
|
count: z.ZodDefault<z.ZodNumber>;
|
|
16
17
|
offset: z.ZodDefault<z.ZodNumber>;
|
|
@@ -28,7 +29,36 @@ export declare const getStories: import("@cyanheads/mcp-ts-core").ToolDefinition
|
|
|
28
29
|
text: z.ZodOptional<z.ZodString>;
|
|
29
30
|
}, z.core.$strip>>;
|
|
30
31
|
feed: z.ZodString;
|
|
31
|
-
}, z.core.$strip>,
|
|
32
|
+
}, z.core.$strip>, readonly [{
|
|
33
|
+
readonly reason: "upstream_rejected";
|
|
34
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
35
|
+
readonly when: "The HN API answered with a 4xx status other than 429 — it rejected the request as built.";
|
|
36
|
+
readonly recovery: "Check the input values against this schema; the same input fails identically.";
|
|
37
|
+
}, {
|
|
38
|
+
readonly reason: "upstream_rate_limited";
|
|
39
|
+
readonly code: JsonRpcErrorCode.RateLimited;
|
|
40
|
+
readonly when: "The HN API answered with HTTP 429.";
|
|
41
|
+
readonly recovery: "Wait several seconds before retrying, and call this tool less often.";
|
|
42
|
+
readonly retryable: true;
|
|
43
|
+
}, {
|
|
44
|
+
readonly reason: "upstream_unavailable";
|
|
45
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
46
|
+
readonly when: "The HN API answered with a 5xx status.";
|
|
47
|
+
readonly recovery: "Retry after a short delay; no input change helps while the upstream is down.";
|
|
48
|
+
readonly retryable: true;
|
|
49
|
+
}, {
|
|
50
|
+
readonly reason: "upstream_html";
|
|
51
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
52
|
+
readonly when: "The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance.";
|
|
53
|
+
readonly recovery: "Retry after a brief delay; the upstream is throttling or in maintenance.";
|
|
54
|
+
readonly retryable: true;
|
|
55
|
+
}, {
|
|
56
|
+
readonly reason: "upstream_malformed";
|
|
57
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
58
|
+
readonly when: "The HN API answered with a 200 status and a body that is not JSON.";
|
|
59
|
+
readonly recovery: "Retry after a brief delay; no input change helps while the upstream serves this.";
|
|
60
|
+
readonly retryable: true;
|
|
61
|
+
}], {
|
|
32
62
|
readonly total: z.ZodNumber;
|
|
33
63
|
readonly offset: z.ZodNumber;
|
|
34
64
|
readonly hasMore: z.ZodBoolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-stories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqNrB,CAAC"}
|
|
@@ -3,22 +3,61 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions/get-stories.tool
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
6
7
|
import { extractDomain, filterLiveItems, getHnService, normalizeUrl, stripHtml, } from '../../../services/hn/hn-service.js';
|
|
7
8
|
export const getStories = tool('hn_get_stories', {
|
|
8
9
|
description: 'Fetch stories from an HN feed (top, new, best, ask, show, jobs), with title, URL, score, author, and comment count for each story.',
|
|
9
10
|
annotations: { readOnlyHint: true },
|
|
11
|
+
errors: [
|
|
12
|
+
{
|
|
13
|
+
reason: 'upstream_rejected',
|
|
14
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
15
|
+
when: 'The HN API answered with a 4xx status other than 429 — it rejected the request as built.',
|
|
16
|
+
recovery: 'Check the input values against this schema; the same input fails identically.',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
reason: 'upstream_rate_limited',
|
|
20
|
+
code: JsonRpcErrorCode.RateLimited,
|
|
21
|
+
when: 'The HN API answered with HTTP 429.',
|
|
22
|
+
recovery: 'Wait several seconds before retrying, and call this tool less often.',
|
|
23
|
+
retryable: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
reason: 'upstream_unavailable',
|
|
27
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
28
|
+
when: 'The HN API answered with a 5xx status.',
|
|
29
|
+
recovery: 'Retry after a short delay; no input change helps while the upstream is down.',
|
|
30
|
+
retryable: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
reason: 'upstream_html',
|
|
34
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
35
|
+
when: 'The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance.',
|
|
36
|
+
recovery: 'Retry after a brief delay; the upstream is throttling or in maintenance.',
|
|
37
|
+
retryable: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
reason: 'upstream_malformed',
|
|
41
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
42
|
+
when: 'The HN API answered with a 200 status and a body that is not JSON.',
|
|
43
|
+
recovery: 'Retry after a brief delay; no input change helps while the upstream serves this.',
|
|
44
|
+
retryable: true,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
10
47
|
input: z.object({
|
|
11
48
|
feed: z
|
|
12
49
|
.enum(['top', 'new', 'best', 'ask', 'show', 'jobs'])
|
|
13
50
|
.describe('Which HN feed to fetch. "top" includes jobs. "ask" and "show" are Ask HN / Show HN posts.'),
|
|
14
51
|
count: z
|
|
15
52
|
.number()
|
|
53
|
+
.int()
|
|
16
54
|
.min(1)
|
|
17
55
|
.max(100)
|
|
18
56
|
.default(30)
|
|
19
57
|
.describe('Number of stories to return. Larger counts take longer.'),
|
|
20
58
|
offset: z
|
|
21
59
|
.number()
|
|
60
|
+
.int()
|
|
22
61
|
.min(0)
|
|
23
62
|
.default(0)
|
|
24
63
|
.describe('Number of stories to skip from the start of the feed. Use with count for pagination.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stories.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-stories.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE;IAC/C,WAAW,EACT,oIAAoI;IACtI,WAAW,EAAE,EAAE,YAAY,EAAE,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,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;YACvC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,OAAO,IAAI,IAAI,KAAK,KAAK,GAAG,MAAM,KAAK,IAAI,GAAG,GAAG,GAAG,IAAI,EAAE,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,UAAU,CAAC;QAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -35,6 +35,35 @@ export declare const getThread: import("@cyanheads/mcp-ts-core").ToolDefinition<
|
|
|
35
35
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
36
36
|
readonly when: "HN reports no item exists for the given itemId.";
|
|
37
37
|
readonly recovery: "Verify the itemId via hn_search_content or a feed listing from hn_get_stories.";
|
|
38
|
+
}, {
|
|
39
|
+
readonly reason: "upstream_rejected";
|
|
40
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
41
|
+
readonly when: "The HN API answered with a 4xx status other than 429 — it rejected the request as built.";
|
|
42
|
+
readonly recovery: "Check the input values against this schema; the same input fails identically.";
|
|
43
|
+
}, {
|
|
44
|
+
readonly reason: "upstream_rate_limited";
|
|
45
|
+
readonly code: JsonRpcErrorCode.RateLimited;
|
|
46
|
+
readonly when: "The HN API answered with HTTP 429.";
|
|
47
|
+
readonly recovery: "Wait several seconds before retrying, and call this tool less often.";
|
|
48
|
+
readonly retryable: true;
|
|
49
|
+
}, {
|
|
50
|
+
readonly reason: "upstream_unavailable";
|
|
51
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
52
|
+
readonly when: "The HN API answered with a 5xx status.";
|
|
53
|
+
readonly recovery: "Retry after a short delay; no input change helps while the upstream is down.";
|
|
54
|
+
readonly retryable: true;
|
|
55
|
+
}, {
|
|
56
|
+
readonly reason: "upstream_html";
|
|
57
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
58
|
+
readonly when: "The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance.";
|
|
59
|
+
readonly recovery: "Retry after a brief delay; the upstream is throttling or in maintenance.";
|
|
60
|
+
readonly retryable: true;
|
|
61
|
+
}, {
|
|
62
|
+
readonly reason: "upstream_malformed";
|
|
63
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
64
|
+
readonly when: "The HN API answered with a 200 status and a body that is not JSON.";
|
|
65
|
+
readonly recovery: "Retry after a brief delay; no input change helps while the upstream serves this.";
|
|
66
|
+
readonly retryable: true;
|
|
38
67
|
}], {
|
|
39
68
|
readonly totalLoaded: z.ZodNumber;
|
|
40
69
|
readonly totalAvailable: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"get-thread.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsTpB,CAAC"}
|
|
@@ -15,17 +15,53 @@ export const getThread = tool('hn_get_thread', {
|
|
|
15
15
|
when: 'HN reports no item exists for the given itemId.',
|
|
16
16
|
recovery: 'Verify the itemId via hn_search_content or a feed listing from hn_get_stories.',
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
reason: 'upstream_rejected',
|
|
20
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
21
|
+
when: 'The HN API answered with a 4xx status other than 429 — it rejected the request as built.',
|
|
22
|
+
recovery: 'Check the input values against this schema; the same input fails identically.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
reason: 'upstream_rate_limited',
|
|
26
|
+
code: JsonRpcErrorCode.RateLimited,
|
|
27
|
+
when: 'The HN API answered with HTTP 429.',
|
|
28
|
+
recovery: 'Wait several seconds before retrying, and call this tool less often.',
|
|
29
|
+
retryable: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
reason: 'upstream_unavailable',
|
|
33
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
34
|
+
when: 'The HN API answered with a 5xx status.',
|
|
35
|
+
recovery: 'Retry after a short delay; no input change helps while the upstream is down.',
|
|
36
|
+
retryable: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
reason: 'upstream_html',
|
|
40
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
41
|
+
when: 'The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance.',
|
|
42
|
+
recovery: 'Retry after a brief delay; the upstream is throttling or in maintenance.',
|
|
43
|
+
retryable: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
reason: 'upstream_malformed',
|
|
47
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
48
|
+
when: 'The HN API answered with a 200 status and a body that is not JSON.',
|
|
49
|
+
recovery: 'Retry after a brief delay; no input change helps while the upstream serves this.',
|
|
50
|
+
retryable: true,
|
|
51
|
+
},
|
|
18
52
|
],
|
|
19
53
|
input: z.object({
|
|
20
|
-
itemId: z.number().describe('ID of the story, comment, or poll to fetch the thread for.'),
|
|
54
|
+
itemId: z.number().int().describe('ID of the story, comment, or poll to fetch the thread for.'),
|
|
21
55
|
depth: z
|
|
22
56
|
.number()
|
|
57
|
+
.int()
|
|
23
58
|
.min(0)
|
|
24
59
|
.max(10)
|
|
25
60
|
.default(3)
|
|
26
61
|
.describe(`How many levels of replies to resolve. 0 = just the item, no comments. 1 = direct replies only. Popular stories often have more top-level comments than maxComments — to see nesting, raise maxComments together with depth, or call again with a specific comment's itemId to drill into a subtree.`),
|
|
27
62
|
maxComments: z
|
|
28
63
|
.number()
|
|
64
|
+
.int()
|
|
29
65
|
.min(1)
|
|
30
66
|
.max(200)
|
|
31
67
|
.default(50)
|
|
@@ -102,8 +138,17 @@ export const getThread = tool('hn_get_thread', {
|
|
|
102
138
|
score: root.score,
|
|
103
139
|
descendants: root.descendants,
|
|
104
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* `totalAvailable` is only keyed when HN actually reports `descendants` —
|
|
143
|
+
* comment and job roots omit it. Passing the key with an `undefined` value
|
|
144
|
+
* survives the optional schema and renders as a literal "undefined" in the
|
|
145
|
+
* framework's content[] trailer, diverging from structuredContent.
|
|
146
|
+
*/
|
|
105
147
|
if (input.depth === 0 || !root.kids?.length) {
|
|
106
|
-
ctx.enrich({
|
|
148
|
+
ctx.enrich({
|
|
149
|
+
totalLoaded: 0,
|
|
150
|
+
...(root.descendants != null && { totalAvailable: root.descendants }),
|
|
151
|
+
});
|
|
107
152
|
return {
|
|
108
153
|
item,
|
|
109
154
|
comments: [],
|
|
@@ -158,7 +203,7 @@ export const getThread = tool('hn_get_thread', {
|
|
|
158
203
|
ctx.log.info('Resolved thread', { itemId: input.itemId, comments: comments.length });
|
|
159
204
|
const totalLoaded = comments.length;
|
|
160
205
|
const totalAvailable = root.descendants;
|
|
161
|
-
ctx.enrich({ totalLoaded, totalAvailable });
|
|
206
|
+
ctx.enrich({ totalLoaded, ...(totalAvailable != null && { totalAvailable }) });
|
|
162
207
|
if (totalLoaded >= input.maxComments) {
|
|
163
208
|
ctx.enrich.truncated({ shown: totalLoaded, cap: input.maxComments });
|
|
164
209
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAEpF,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE;IAC7C,WAAW,EACT,2IAA2I;IAC7I,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,MAAM,EAAE;QACN;YACE,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,iDAAiD;YACvD,QAAQ,EAAE,gFAAgF;SAC3F;KACF;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;
|
|
1
|
+
{"version":3,"file":"get-thread.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-thread.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO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