@cyanheads/hn-mcp-server 0.1.1

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.
Files changed (38) hide show
  1. package/CLAUDE.md +236 -0
  2. package/Dockerfile +99 -0
  3. package/LICENSE +191 -0
  4. package/README.md +189 -0
  5. package/dist/config/server-config.d.ts +8 -0
  6. package/dist/config/server-config.d.ts.map +1 -0
  7. package/dist/config/server-config.js +21 -0
  8. package/dist/config/server-config.js.map +1 -0
  9. package/dist/index.d.ts +7 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +18 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts +34 -0
  14. package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts.map +1 -0
  15. package/dist/mcp-server/tools/definitions/get-stories.tool.js +91 -0
  16. package/dist/mcp-server/tools/definitions/get-stories.tool.js.map +1 -0
  17. package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts +34 -0
  18. package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts.map +1 -0
  19. package/dist/mcp-server/tools/definitions/get-thread.tool.js +149 -0
  20. package/dist/mcp-server/tools/definitions/get-thread.tool.js.map +1 -0
  21. package/dist/mcp-server/tools/definitions/get-user.tool.d.ts +29 -0
  22. package/dist/mcp-server/tools/definitions/get-user.tool.d.ts.map +1 -0
  23. package/dist/mcp-server/tools/definitions/get-user.tool.js +99 -0
  24. package/dist/mcp-server/tools/definitions/get-user.tool.js.map +1 -0
  25. package/dist/mcp-server/tools/definitions/search-hn.tool.d.ts +45 -0
  26. package/dist/mcp-server/tools/definitions/search-hn.tool.d.ts.map +1 -0
  27. package/dist/mcp-server/tools/definitions/search-hn.tool.js +132 -0
  28. package/dist/mcp-server/tools/definitions/search-hn.tool.js.map +1 -0
  29. package/dist/services/hn/hn-service.d.ts +42 -0
  30. package/dist/services/hn/hn-service.d.ts.map +1 -0
  31. package/dist/services/hn/hn-service.js +159 -0
  32. package/dist/services/hn/hn-service.js.map +1 -0
  33. package/dist/services/hn/types.d.ts +58 -0
  34. package/dist/services/hn/types.d.ts.map +1 -0
  35. package/dist/services/hn/types.js +6 -0
  36. package/dist/services/hn/types.js.map +1 -0
  37. package/package.json +68 -0
  38. package/server.json +113 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,236 @@
1
+ # Agent Protocol
2
+
3
+ **Server:** hn-mcp-server
4
+ **Version:** 0.1.1
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
6
+
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.
8
+
9
+ ---
10
+
11
+ ## What's Next?
12
+
13
+ When the user asks what to do next, what's left, or needs direction, suggest relevant options based on the current project state:
14
+
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
+ 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
18
+ 4. **Add services** — scaffold domain service integrations using the `add-service` skill
19
+ 5. **Add tests** — scaffold tests for existing definitions using the `add-test` skill
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
21
+ 7. **Run `devcheck`** — lint, format, typecheck, and security audit
22
+ 8. **Run the `polish-docs-meta` skill** — finalize README, CHANGELOG, metadata, and agent protocol for shipping
23
+ 9. **Run the `maintenance` skill** — sync skills and dependencies after framework updates
24
+
25
+ Tailor suggestions to what's actually missing or stale — don't recite the full list every time.
26
+
27
+ ---
28
+
29
+ ## Core Rules
30
+
31
+ - **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
32
+ - **Use `ctx.log`** for request-scoped logging. No `console` calls.
33
+ - **Secrets in env vars only** — never hardcoded.
34
+
35
+ ---
36
+
37
+ ## Patterns
38
+
39
+ ### Tool
40
+
41
+ ```ts
42
+ import { tool, z } from '@cyanheads/mcp-ts-core';
43
+ import { getHnService, filterLiveItems, normalizeUrl, stripHtml } from '@/services/hn/hn-service.js';
44
+
45
+ export const getStories = tool('get_stories', {
46
+ description: 'Fetch stories from an HN feed (top, new, best, ask, show, jobs).',
47
+ annotations: { readOnlyHint: true },
48
+ input: z.object({
49
+ feed: z.enum(['top', 'new', 'best', 'ask', 'show', 'jobs']).describe('Which HN feed to fetch.'),
50
+ count: z.number().min(1).max(100).default(30).describe('Number of stories to return.'),
51
+ offset: z.number().min(0).default(0).describe('Number of stories to skip for pagination.'),
52
+ }),
53
+ output: z.object({
54
+ stories: z.array(z.object({
55
+ id: z.number().describe('Item ID.'),
56
+ title: z.string().describe('Story title.'),
57
+ // ...
58
+ })).describe('Stories from the feed.'),
59
+ feed: z.string().describe('Which feed was fetched.'),
60
+ total: z.number().describe('Total items in the feed.'),
61
+ }),
62
+
63
+ async handler(input, ctx) {
64
+ const hn = getHnService();
65
+ const feedIds = await hn.fetchFeed(input.feed);
66
+ const sliced = feedIds.slice(input.offset, input.offset + input.count);
67
+ const items = filterLiveItems(await hn.fetchItems(sliced));
68
+ ctx.log.info('Fetched stories', { feed: input.feed, count: items.length });
69
+ return { stories: items.map(/* ... */), feed: input.feed, total: feedIds.length };
70
+ },
71
+
72
+ format: (result) => [{ type: 'text', text: `${result.feed} stories (${result.stories.length})` }],
73
+ });
74
+ ```
75
+
76
+ ### Server config
77
+
78
+ ```ts
79
+ // src/config/server-config.ts — lazy-parsed, separate from framework config
80
+ const ServerConfigSchema = z.object({
81
+ concurrencyLimit: z.coerce.number().min(1).max(50).default(10)
82
+ .describe('Max concurrent HTTP requests for batch item fetches.'),
83
+ });
84
+ let _config: z.infer<typeof ServerConfigSchema> | undefined;
85
+ export function getServerConfig() {
86
+ _config ??= ServerConfigSchema.parse({
87
+ concurrencyLimit: process.env.HN_CONCURRENCY_LIMIT,
88
+ });
89
+ return _config;
90
+ }
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Context
96
+
97
+ Handlers receive a unified `ctx` object. Key properties:
98
+
99
+ | Property | Description |
100
+ |:---------|:------------|
101
+ | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
102
+ | `ctx.signal` | `AbortSignal` for cancellation. |
103
+ | `ctx.requestId` | Unique request ID. |
104
+
105
+ ---
106
+
107
+ ## Errors
108
+
109
+ Handlers throw — the framework catches, classifies, and formats. Three escalation levels:
110
+
111
+ ```ts
112
+ // 1. Plain Error — framework auto-classifies from message patterns
113
+ throw new Error('Item not found'); // → NotFound
114
+ throw new Error('Invalid query format'); // → ValidationError
115
+
116
+ // 2. Error factories — explicit code, concise
117
+ import { notFound, validationError, forbidden, serviceUnavailable } from '@cyanheads/mcp-ts-core/errors';
118
+ throw notFound('Item not found', { itemId });
119
+ throw serviceUnavailable('API unavailable', { url }, { cause: err });
120
+
121
+ // 3. McpError — full control over code and data
122
+ import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
123
+ throw new McpError(JsonRpcErrorCode.DatabaseError, 'Connection failed', { pool: 'primary' });
124
+ ```
125
+
126
+ Plain `Error` is fine for most cases. Use factories when the error code matters. See framework CLAUDE.md for the full auto-classification table and all available factories.
127
+
128
+ ---
129
+
130
+ ## Structure
131
+
132
+ ```text
133
+ src/
134
+ index.ts # createApp() entry point
135
+ config/
136
+ server-config.ts # Server-specific env vars (Zod schema)
137
+ services/
138
+ hn/
139
+ hn-service.ts # HN Firebase + Algolia API client
140
+ types.ts # HN domain types
141
+ mcp-server/
142
+ tools/definitions/
143
+ get-stories.tool.ts # Fetch stories from an HN feed
144
+ get-thread.tool.ts # Get item + comment tree
145
+ get-user.tool.ts # Fetch user profile + submissions
146
+ search-hn.tool.ts # Search via Algolia
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Naming
152
+
153
+ | What | Convention | Example |
154
+ |:-----|:-----------|:--------|
155
+ | Files | kebab-case with suffix | `search-docs.tool.ts` |
156
+ | Tool/resource/prompt names | snake_case | `search_docs` |
157
+ | Directories | kebab-case | `src/services/doc-search/` |
158
+ | Descriptions | Single string or template literal, no `+` concatenation | `'Search items by query and filter.'` |
159
+
160
+ ---
161
+
162
+ ## Skills
163
+
164
+ 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.
165
+
166
+ **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, re-copy to pick up changes.
167
+
168
+ Available skills:
169
+
170
+ | Skill | Purpose |
171
+ |:------|:--------|
172
+ | `setup` | Post-init project orientation |
173
+ | `design-mcp-server` | Design tool surface, resources, and services for a new server |
174
+ | `add-tool` | Scaffold a new tool definition |
175
+ | `add-resource` | Scaffold a new resource definition |
176
+ | `add-prompt` | Scaffold a new prompt definition |
177
+ | `add-service` | Scaffold a new service integration |
178
+ | `add-test` | Scaffold test file for a tool, resource, or service |
179
+ | `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
180
+ | `devcheck` | Lint, format, typecheck, audit |
181
+ | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
182
+ | `maintenance` | Sync skills and dependencies after updates |
183
+ | `api-auth` | Auth modes, scopes, JWT/OAuth |
184
+ | `api-config` | AppConfig, parseConfig, env vars |
185
+ | `api-context` | Context interface, logger, state, progress |
186
+ | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
187
+ | `api-services` | LLM, Speech, Graph services |
188
+ | `api-testing` | createMockContext, test patterns |
189
+ | `api-utils` | Formatting, parsing, security, pagination, scheduling |
190
+ | `api-workers` | Cloudflare Workers runtime |
191
+
192
+ When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
193
+
194
+ ---
195
+
196
+ ## Commands
197
+
198
+ | Command | Purpose |
199
+ |:--------|:--------|
200
+ | `bun run build` | Compile TypeScript |
201
+ | `bun run rebuild` | Clean + build |
202
+ | `bun run clean` | Remove build artifacts |
203
+ | `bun run devcheck` | Lint + format + typecheck + security |
204
+ | `bun run tree` | Generate directory structure doc |
205
+ | `bun run format` | Auto-fix formatting |
206
+ | `bun run lint:mcp` | Validate MCP tool/resource definitions |
207
+ | `bun run test` | Run tests |
208
+ | `bun run dev:stdio` | Dev mode (stdio) |
209
+ | `bun run dev:http` | Dev mode (HTTP) |
210
+ | `bun run start:stdio` | Production mode (stdio) |
211
+ | `bun run start:http` | Production mode (HTTP) |
212
+
213
+ ---
214
+
215
+ ## Imports
216
+
217
+ ```ts
218
+ // Framework — z is re-exported, no separate zod import needed
219
+ import { tool, z } from '@cyanheads/mcp-ts-core';
220
+ import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
221
+
222
+ // Server's own code — via path alias
223
+ import { getHnService } from '@/services/hn/hn-service.js';
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Checklist
229
+
230
+ - [ ] Zod schemas: all fields have `.describe()`
231
+ - [ ] JSDoc `@fileoverview` + `@module` on every file
232
+ - [ ] `ctx.log` for logging — no `console` calls
233
+ - [ ] Handlers throw on failure — plain `Error` or error factories, no try/catch
234
+ - [ ] Registered in `createApp()` tools array
235
+ - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
236
+ - [ ] `bun run devcheck` passes
package/Dockerfile ADDED
@@ -0,0 +1,99 @@
1
+ # ==============================================================================
2
+ # Build Stage
3
+ #
4
+ # This stage installs all dependencies (including dev), builds the TypeScript
5
+ # source code into JavaScript, and prepares the production assets.
6
+ # ==============================================================================
7
+ FROM oven/bun:1 AS build
8
+
9
+ WORKDIR /usr/src/app
10
+
11
+ # Copy dependency manifests for optimized layer caching
12
+ COPY package.json bun.lock ./
13
+
14
+ # Install all dependencies (including dev dependencies for building)
15
+ RUN bun install --frozen-lockfile
16
+
17
+ # Copy the rest of the source code
18
+ COPY . .
19
+
20
+ # Build the application
21
+ RUN bun run build
22
+
23
+
24
+ # ==============================================================================
25
+ # Production Stage
26
+ #
27
+ # This stage creates a minimal, optimized, and secure image for running the
28
+ # application. It uses a slim base image and only includes production
29
+ # dependencies and build artifacts.
30
+ # ==============================================================================
31
+ FROM oven/bun:1-slim AS production
32
+
33
+ WORKDIR /usr/src/app
34
+
35
+ # Set the environment to production for performance and to ensure only
36
+ # production dependencies are installed.
37
+ ENV NODE_ENV=production
38
+
39
+ # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
40
+ LABEL org.opencontainers.image.title="hn-mcp-server"
41
+ LABEL org.opencontainers.image.description="MCP server for Hacker News — feeds, threads, users, and search via Firebase and Algolia APIs"
42
+ LABEL org.opencontainers.image.source="https://github.com/cyanheads/hn-mcp-server"
43
+ LABEL org.opencontainers.image.licenses="Apache-2.0"
44
+
45
+ # Copy dependency manifests
46
+ COPY package.json bun.lock ./
47
+
48
+ # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
49
+ # that are not needed in the final production image.
50
+ RUN bun install --production --frozen-lockfile --ignore-scripts
51
+
52
+ # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
53
+ # These are not bundled by default to keep the base image lean. Enable at build time
54
+ # with: docker build --build-arg OTEL_ENABLED=true
55
+ ARG OTEL_ENABLED=true
56
+ RUN if [ "$OTEL_ENABLED" = "true" ]; then \
57
+ bun add @hono/otel \
58
+ @opentelemetry/instrumentation-http \
59
+ @opentelemetry/exporter-metrics-otlp-http \
60
+ @opentelemetry/exporter-trace-otlp-http \
61
+ @opentelemetry/instrumentation-pino \
62
+ @opentelemetry/resources \
63
+ @opentelemetry/sdk-metrics \
64
+ @opentelemetry/sdk-node \
65
+ @opentelemetry/sdk-trace-node \
66
+ @opentelemetry/semantic-conventions; \
67
+ fi
68
+
69
+ # Copy the compiled application code from the build stage
70
+ COPY --from=build /usr/src/app/dist ./dist
71
+
72
+ # The 'oven/bun' image already provides a non-root user named 'bun'.
73
+ # We will use this existing user for enhanced security.
74
+
75
+ # Create and set permissions for the log directory, assigning ownership to the 'bun' user.
76
+ RUN mkdir -p /var/log/hn-mcp-server && chown -R bun:bun /var/log/hn-mcp-server
77
+
78
+ # Switch to the non-root user
79
+ USER bun
80
+
81
+ # Define an argument for the port, allowing it to be overridden at build time.
82
+ # The `PORT` variable is often injected by cloud environments at runtime.
83
+ ARG PORT
84
+
85
+ # Set runtime environment variables
86
+ # Note: PORT is an automatic variable in many cloud environments (e.g., Cloud Run)
87
+ ENV MCP_HTTP_PORT=${PORT:-3010}
88
+ ENV MCP_HTTP_HOST="0.0.0.0"
89
+ ENV MCP_TRANSPORT_TYPE="http"
90
+ ENV MCP_SESSION_MODE="stateless"
91
+ ENV MCP_LOG_LEVEL="info"
92
+ ENV LOGS_DIR="/var/log/hn-mcp-server"
93
+ ENV MCP_FORCE_CONSOLE_LOGGING="true"
94
+
95
+ # Expose the port the server listens on
96
+ EXPOSE ${MCP_HTTP_PORT}
97
+
98
+ # The command to start the server
99
+ CMD ["bun", "run", "dist/index.js"]
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 cyanheads
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.