agentseed-mcp 0.3.0

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 (76) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/LICENSE +202 -0
  3. package/README.ja.md +320 -0
  4. package/README.md +318 -0
  5. package/README.zh.md +306 -0
  6. package/bin/cli.js +37 -0
  7. package/mcp.json +12 -0
  8. package/package.json +30 -0
  9. package/plugin.json +22 -0
  10. package/server/.agentseed/verification-log.jsonl +2 -0
  11. package/server/__pycache__/guard_cli.cpython-313.pyc +0 -0
  12. package/server/__pycache__/guard_engine.cpython-313.pyc +0 -0
  13. package/server/__pycache__/test_cli.cpython-313-pytest-9.1.1.pyc +0 -0
  14. package/server/__pycache__/test_cli.cpython-313.pyc +0 -0
  15. package/server/__pycache__/test_features.cpython-313-pytest-9.1.1.pyc +0 -0
  16. package/server/__pycache__/test_features.cpython-313.pyc +0 -0
  17. package/server/__pycache__/test_guard.cpython-313-pytest-9.1.1.pyc +0 -0
  18. package/server/__pycache__/test_guard.cpython-313.pyc +0 -0
  19. package/server/__pycache__/test_hook.cpython-313-pytest-9.1.1.pyc +0 -0
  20. package/server/__pycache__/test_hook.cpython-313.pyc +0 -0
  21. package/server/__pycache__/test_manifests.cpython-313-pytest-9.1.1.pyc +0 -0
  22. package/server/__pycache__/test_manifests.cpython-313.pyc +0 -0
  23. package/server/__pycache__/test_server.cpython-313-pytest-9.1.1.pyc +0 -0
  24. package/server/__pycache__/test_server.cpython-313.pyc +0 -0
  25. package/server/engine/__init__.py +64 -0
  26. package/server/engine/__pycache__/__init__.cpython-313.pyc +0 -0
  27. package/server/engine/__pycache__/audit.cpython-313.pyc +0 -0
  28. package/server/engine/__pycache__/config.cpython-313.pyc +0 -0
  29. package/server/engine/__pycache__/hallucination.cpython-313.pyc +0 -0
  30. package/server/engine/__pycache__/imports.cpython-313.pyc +0 -0
  31. package/server/engine/__pycache__/plugin.cpython-313.pyc +0 -0
  32. package/server/engine/__pycache__/sandbox.cpython-313.pyc +0 -0
  33. package/server/engine/__pycache__/schema.cpython-313.pyc +0 -0
  34. package/server/engine/__pycache__/symbols.cpython-313.pyc +0 -0
  35. package/server/engine/__pycache__/version.cpython-313.pyc +0 -0
  36. package/server/engine/audit.py +84 -0
  37. package/server/engine/config.py +131 -0
  38. package/server/engine/hallucination.py +254 -0
  39. package/server/engine/imports.py +136 -0
  40. package/server/engine/plugin.py +367 -0
  41. package/server/engine/sandbox.py +287 -0
  42. package/server/engine/schema.py +193 -0
  43. package/server/engine/symbols.py +984 -0
  44. package/server/engine/version.py +17 -0
  45. package/server/guard_cli.py +455 -0
  46. package/server/guard_engine.py +111 -0
  47. package/server/guard_hook.py +404 -0
  48. package/server/guard_server.py +472 -0
  49. package/server/requirements.txt +7 -0
  50. package/server/test_cli.py +132 -0
  51. package/server/test_features.py +426 -0
  52. package/server/test_guard.py +828 -0
  53. package/server/test_hook.py +331 -0
  54. package/server/test_manifests.py +70 -0
  55. package/server/test_server.py +247 -0
  56. package/skills/verify-before-code/SKILL.ja.md +116 -0
  57. package/skills/verify-before-code/SKILL.md +140 -0
  58. package/skills/verify-before-code/SKILL.zh.md +117 -0
  59. package/skills/verify-before-code/references/DEFAULT-NORMS.md +52 -0
  60. package/skills/verify-before-code/references/HALLUCINATION-PATTERNS.ja.md +121 -0
  61. package/skills/verify-before-code/references/HALLUCINATION-PATTERNS.md +166 -0
  62. package/skills/verify-before-code/references/HALLUCINATION-PATTERNS.zh.md +145 -0
  63. package/skills/verify-before-code/references/PROMPT-POOL.ja.md +248 -0
  64. package/skills/verify-before-code/references/PROMPT-POOL.md +282 -0
  65. package/skills/verify-before-code/references/PROMPT-POOL.zh.md +252 -0
  66. package/skills/verify-before-code/references/SDD-CONTRACT.ja.md +61 -0
  67. package/skills/verify-before-code/references/SDD-CONTRACT.md +66 -0
  68. package/skills/verify-before-code/references/SDD-CONTRACT.zh.md +58 -0
  69. package/skills/verify-before-code/references/VENDOR-SOLUTIONS.ja.md +62 -0
  70. package/skills/verify-before-code/references/VENDOR-SOLUTIONS.md +62 -0
  71. package/skills/verify-before-code/references/VENDOR-SOLUTIONS.zh.md +54 -0
  72. package/skills/verify-before-code/references/VERIFICATION-CHECKLIST.ja.md +68 -0
  73. package/skills/verify-before-code/references/VERIFICATION-CHECKLIST.md +73 -0
  74. package/skills/verify-before-code/references/VERIFICATION-CHECKLIST.zh.md +68 -0
  75. package/skills/verify-before-code/scripts/check.ps1 +52 -0
  76. package/skills/verify-before-code/scripts/check.sh +44 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,178 @@
1
+ # Changelog
2
+
3
+ All notable changes to AgentSeed are documented here.
4
+ Format based on [Keep a Changelog](https://keepachangelog.com); versioning follows [SemVer](https://semver.org).
5
+
6
+ ## [0.3.0] — 2026-08-27
7
+
8
+ ### Added
9
+ - **`verify_code` — config-driven multi-language engine**: a generic lexical
10
+ verifier backed by a language registry (`LangSpec`). Newly supported:
11
+ Go, Rust, Java, C, C++, C#, PHP, Ruby, Kotlin, Swift — on top of Python
12
+ (AST) and TypeScript/JavaScript (lexical). The same engine runs every
13
+ registered language (mask comments/strings → collect definitions/imports →
14
+ flag undefined bare calls and `new`); adding a language is a registry entry,
15
+ not an engine change. Ruby's paren-less calls are supported via `bare_calls`.
16
+ MCP `verify_code.language` and CLI `verify --language` accept all aliases;
17
+ unsupported languages now list the supported set in `note`.
18
+ - **`check_contract` — verify code against a written spec**: new MCP tool +
19
+ `guard_cli contract` subcommand. Contract is JSON
20
+ (`{"requires": [...], "prohibits": [...]}`); `requires` names must be
21
+ defined/imported by the source (via new public `defined_symbols`),
22
+ `prohibits` tokens must not appear. Exits 1 on violations.
23
+ - **`scripts/export_prompt_pool.py` — wire the prompt pool into per-client
24
+ configs**: parses `PROMPT-POOL.md` (23 entries) and renders identical
25
+ anti-hallucination prompts as `CLAUDE.md`, `AGENTS.md`, and Cursor
26
+ rules (`.cursor/rules/agentseed-guardrails.mdc`) so the gates apply outside
27
+ plugin-aware clients.
28
+ - **`check_imports` — package-hallucination (slopsquatting) guard**: new MCP
29
+ tool + `guard_cli imports` subcommand, motivated by "We Have a Package for
30
+ You!" (USENIX Security 2025, arXiv:2406.10279 — LLMs invent non-existent
31
+ package names in 5.2–21.7% of generated code, ~58% recur, attackers
32
+ pre-register them). Flags top-level imports that are neither Python stdlib
33
+ nor in the known-package set (stdlib via `sys.stdlib_module_names` +
34
+ curated common third-party list + config `known_packages`). Python only;
35
+ report, not a hard gate.
36
+ - **Hallucination pool expansion (research-driven)**: +15 English and
37
+ +10 CJK low-false-positive tokens across stub/oversold/fabricated groups
38
+ (e.g. `foolproof`, `bulletproof`, `cannot fail`, `fictitious`,
39
+ `nonexistent`, `凭空捏造`, `子虚乌有`); guardrail library supplemented with
40
+ 2025 code-hallucination taxonomy (arXiv:2504.20799), scaffolding
41
+ hallucination / phantom symbols (arXiv:2604.20202), and the
42
+ false-confidence finding (Perry et al., CCS 2023).
43
+ - **README: multi-language live-tested demo** — 11 languages each catch
44
+ their invented call; clean code zero false positives.
45
+
46
+ ### Changed
47
+ - **`sandbox_run` — streamed, bounded-memory output truncation**: output was
48
+ previously captured in full via `communicate()` then truncated, so a child
49
+ flooding output could balloon server memory. Two daemon reader threads now
50
+ drain stdout/stderr incrementally into tail ring buffers (8 KB / 4 KB caps),
51
+ so memory stays bounded while the last-output tail semantics are preserved.
52
+ - `tools/list` now exposes 8 tools (was 6).
53
+
54
+ ## [0.2.0] — 2026-08-26
55
+
56
+ ### Security
57
+ - **`sandbox_allowed_prefixes` bypass fixed (High)**: the old matcher compared
58
+ basenames and raw path prefixes, so on Windows a hostile `cwd` could plant
59
+ `python.exe` to impersonate an allowlisted basename, and prefix `C:\tools\safe`
60
+ matched `C:\tools\safe-evil\app.exe` (no separator boundary). Commands now
61
+ resolve through `PATH`/`abspath` BEFORE execution; bare-name entries match the
62
+ resolved basename (with `.exe` tolerance), path entries require a separator
63
+ boundary, unmatched/unresolvable commands are refused with exit -10 without
64
+ spawning, and allowed commands execute under their resolved absolute path.
65
+ Regression tests cover boundary matching, `.exe` tolerance and cwd-shadowing.
66
+
67
+ ### Changed
68
+ - **All `tools/call` requests now run in a worker thread** (previously only
69
+ `sandbox_run`): a slow `verify_code`/`check_plugin` can no longer stall the
70
+ stdio read loop. Cancellation semantics extend to every tool; responses stay
71
+ single-writer serialized.
72
+ - **Engine public API cleanup**: config helpers renamed to public names
73
+ (`config_str_list`, `config_severities`, `parse_timeout`,
74
+ `config_extra_tokens`); private internals (`_decode`, `_run_command`,
75
+ `_prefix_allowed`, `_GROUP_LABELS`, `_config_*`) are no longer re-exported
76
+ from the `engine` package.
77
+ - **server.json honesty**: the npm registry package entry was removed until
78
+ `agentseed-mcp` is actually published (the manifest previously advertised a
79
+ package that does not exist in the registry). The manifest-drift test now
80
+ accepts zero listed packages while enforcing version agreement for any that
81
+ appear.
82
+ - **Comparison table rewritten**: the "Anti-Hallucinate (mcpmarket)" competitor
83
+ could not be verified to exist; tables across READMEs/DESIGNs now compare
84
+ against verifiable categories (prompt-only guardrail skills such as
85
+ superpowers; static import linters).
86
+
87
+ ### Added
88
+ - **Client-enforcement hook** (`server/guard_hook.py`, installers `--hooks` /
89
+ `-Hooks`): registers as a Claude Code PreToolUse/PostToolUse hook so every
90
+ `Write`/`Edit`/`MultiEdit` is scanned at the client boundary — PreToolUse
91
+ checks the incoming `content`/`new_string` before anything lands on disk,
92
+ and error-severity findings return as exit code 2 with the reason on stderr
93
+ (the channel Claude Code feeds back to the model). Registration merges into
94
+ `~/.claude/settings.json` idempotently (stale agentseed entries replaced,
95
+ unrelated hooks preserved). Fail-open policy: infrastructure errors never
96
+ block edits; only positive scan findings do. Honored config keys:
97
+ `allowlist`, `severities`, `suppress_symbols`, `extra_tokens`. Covered by
98
+ 17 subprocess tests wired into both CI test jobs.
99
+ - **pyflakes enhancement is real**: `verify_code` now merges pyflakes F821
100
+ undefined-name findings into its AST walk when pyflakes is installed (catches
101
+ e.g. Del-context names the hand-rolled walk misses); previously the import
102
+ existed but was never called. Zero-dep behavior unchanged when absent.
103
+ - **Baseline scan mode** (`guard_cli scan <path> --baseline F [--update-baseline]`):
104
+ freezes a line-number-free fingerprint of known self-referential hits and
105
+ fails only on NEW signals — the repo now ships its own `baseline-scan.json`
106
+ (538 documented hits in tool descriptions/fixtures).
107
+ - **Composite hard gate** (`guard_cli gate --root .`): conformance linter +
108
+ undefined-symbol sweep over all Python sources + baseline scan, one exit
109
+ code; wired into CI as the `gate` job (ubuntu/windows). This is the hard
110
+ enforcement layer behind the soft skill.
111
+ - **Detection benchmark** (`scripts/bench_detection.py` + `docs/BENCHMARK.md`):
112
+ seeded synthetic corpus across five defect classes; current figures
113
+ precision=1.0 recall=1.0 (tp=100 fp=0 fn=0). Locked by a regression test.
114
+ - **Sandbox tree-kill + env scrubbing**: timeouts and cancellations now
115
+ terminate the whole process tree (POSIX process group / Windows
116
+ `taskkill /F /T`); new config `sandbox_env: "scrub"` drops credential-like
117
+ environment variables before spawn (opt-in best-effort denylist).
118
+ - **Input bounds**: MCP frames larger than 2 MB are rejected with -32600;
119
+ JSON-Schema patterns longer than 256 chars are refused by both validator
120
+ paths (defensive ReDoS bound).
121
+
122
+ ### Fixed
123
+ - Documentation truth sweep: CHANGELOG 0.1.1 claim scoped to the English README
124
+ only (zh/ja sync tracked below); CONTRIBUTING test count corrected;
125
+ `README.md` platform-table dead link replaced with a concrete pointer.
126
+
127
+ ## [0.1.1] — 2026-08-25
128
+
129
+ ### Fixed
130
+ - **Documentation drift**: READMEs (en/zh/ja) and DESIGN.zh now state **six** MCP tools — the previously-undocumented `record_verification` audit tool was shipped but never counted. `guard_engine.py` is no longer described as running "conformance + demos"; it now actually runs a dependency-free self-check (`python server/guard_engine.py`) exercising `verify_code` + `scan_hallucination`.
131
+ - **Test hygiene**: eliminated `ResourceWarning` leaks in `test_server.py` / `test_features.py` — the MCP-server subprocess and its stdio pipes are now reaped and closed in teardown, so the suite runs clean even under `-W error::ResourceWarning`.
132
+
133
+ ### Added
134
+ - **P0 infrastructure**: GitHub Actions CI (3 OS × Python 3.9–3.13 matrix with coverage, bare-env stdlib-only degradation job, ruff lint job, manifest-drift gate) and tag-triggered Release workflow (pack.py build → gh release upload → conditional npm publish). Community files: SECURITY.md (threat model incl. sandbox_run), bug/feature issue templates, PR template with mandatory verification evidence.
135
+ - **`record_verification` audit tool** (MCP + `guard_cli.py record`): appends JSONL entries to `${PLUGIN_DATA}/verification-log.jsonl`, giving the SDD contract's "completion report with evidence" a persistent trail. Exposed via MCP tools/list and protocol-tested.
136
+ - **Chinese/CJK hallucination tokens** in all three groups (占位/待实现/保证通过/万无一失/虚构…), matched as substrings since `\b` never fires between CJK chars; `extra_tokens` config key extends the pool at runtime per group.
137
+ - **`verify_code` line numbers**: new `suspects_detail: [{name, line}]` alongside the backward-compatible `suspects`.
138
+ - **`suppress_symbols` config / `--suppress` CLI flag**: exclude known false-positive symbol names from `verify_code`; suppressed names stay visible in the `suppressed` field.
139
+ - **`sandbox_allowed_prefixes` config key**: optional executable allowlist enforced engine-side AND in the async server path BEFORE spawning — non-matching commands are refused with exit code -10 and never executed.
140
+ - **Unknown-config-key warnings** on stderr for both the MCP server and the CLI (typo'd keys can no longer silently no-op).
141
+ - **Performance baseline** (`scripts/bench.py` + 1 MB <30 s regression gate): measured ~2.3 s total for verify+scan on a synthetic megabyte module.
142
+ - **Example fixtures** (`examples/plugins/good-plugin|broken-plugin`) exercised by tests as check_plugin conformance samples.
143
+ - **Hardened Dockerfile**: runs as unprivileged user `seed` (uid 10001) with an import-based HEALTHCHECK.
144
+ - README (en): honest language-coverage table, full configuration reference, explicit sandbox_run security warning. (zh/ja equivalents land in Unreleased.)
145
+
146
+ ### Changed
147
+ - **De-duplicated the sandbox execution core** (reduces reinventing the wheel): the entire spawn→communicate→timeout→error→truncate logic lived in two places (`engine.sandbox_run` and the async `_run_sandbox_async` worker), which is also how the Windows stdin deadlock shipped silently in one path only. It now lives once in `engine._run_command`; both callers delegate, and the async path registers the live process via a new `on_proc` callback for cancellation. The duplicate `_plugin_version()` (guard_server vs `engine/audit.py`) is now a single `engine.plugin_version()` shared module. `record_verification` also gained a `checks` default so the CLI is callable.
148
+
149
+ ### Fixed
150
+ - **Windows stdin-inheritance deadlock in sandbox execution** (found by the local E2E/bare-env simulation layer): children spawned while the MCP server's main thread blocked on a piped stdin inherited that handle and stalled at startup until timeout — async `sandbox_run` failed 100% of the time in this environment. Both sync (`engine.sandbox_run`) and async paths now spawn with `stdin=DEVNULL`, `close_fds=True` and `CREATE_NO_WINDOW`; regression test `test_async_sandbox_completes_normally` locks it in.
151
+ - **draft-07 tuple `items` no longer crashes either validator path**: the jsonschema route degrades to the builtin subset when Draft 2020-12 rejects a legacy schema, and the builtin subset now understands positional `items` arrays plus `additionalItems`.
152
+ - **initialize() negotiates protocolVersion**: echoes the client's requested version when supported (2024-11-05 / 2025-03-26 / 2025-06-18), otherwise falls back to 2024-11-05 instead of always replying with the baseline.
153
+ - **Python 3.9 compatibility restored for match-statement analysis**: ast.Match* node types are resolved via getattr guards (they only exist on 3.10+); regression test simulates their absence.
154
+ - **Async sandbox no longer double-executes allowed commands**: prefix policy is now a pure check (`engine._prefix_allowed`) shared by both sync and async paths instead of a probe run that actually launched the process.
155
+ - **Identity unified to the canonical home**: server.json repository.url → gitcode.com/badhope/AgentSeed; mcpName/server name → io.gitcode.badhope/agentseed. Installers gain `--forge gitcode` / `-Forge gitcode` to resolve releases natively from GitCode's v5 API.
156
+
157
+ ### Added
158
+ - **sandbox_run is cancellable**: long-running commands execute in a worker thread; MCP `notifications/cancelled` kills the child process and suppresses the result frame per spec, while the session stays responsive for other requests.
159
+
160
+ ### Fixed
161
+ - **CLI `sandbox` no longer exits 0 when the command never ran**: command-not-found (-2) and run-failure (-9) now exit 1, so CI gating cannot mistake an unexecuted check for a pass.
162
+ - **Version chaos resolved**: test_server.py now derives the expected version from plugin.json (the declared single source of truth) instead of a hard-coded 1.3.3; server.json npm package version synced to 0.1.0. The suite is green again.
163
+ - **check_plugin false positive on relative stdio commands**: `"./bin/run.sh"` was rejected because of a list-membership bug (`"./" in command.split("/")[0:1]`); validation now uses a proper prefix check, matching what its own error message promised.
164
+ - **License unified to Apache-2.0** in plugin.json and server.json (previously "MIT" there while LICENSE/package.json said Apache-2.0).
165
+ - **MCP server forces UTF-8 on stdin/stdout** (`reconfigure`), fixing session-killing UnicodeEncodeError on Windows ANSI code pages (e.g. cp936); sandbox subprocess output decodes with `errors="replace"` instead of degrading to `-9`.
166
+ - **JSON-RPC notification handling**: notifications (frames without `id`, e.g. `notifications/cancelled`) are never answered — previously unknown ones triggered a spec-violating error reply with `id: null`.
167
+
168
+ ### Added
169
+ - **Multi-platform release pipeline** (`scripts/pack.py` + `release.ps1`/`release.sh`): one command verifies plugin.json/package.json/server.json agree on version & license, builds a single deterministic zip from package.json `files`, and emits SHA256SUMS — the SAME artifact + hash goes to GitHub Releases, GitCode Releases and npm; users pin it via installer `--sha256`/`-Sha256`.
170
+ - `--check-only` mode (also enforced by new `server/test_manifests.py`) fails CI on any cross-platform manifest drift.
171
+ - Installers accept `--url ZIP_URL` / `-Url ZIP_URL` to install from any host (GitCode, self-hosted) and `--repo` / `-Repo` to override the release repo; default remains the canonical source.
172
+ - Installers accept `--sha256 HEX` / `-Sha256 HEX` to pin release-archive integrity; without it they print an explicit supply-chain warning (downloads were previously unverified).
173
+ - CLI `verify --strict`: a source file that cannot be parsed at all becomes exit 1 under strict gating.
174
+
175
+ ### Changed
176
+ - `check_plugin` now reports `skills/<dir>/ missing required SKILL.md` instead of silently skipping such directories.
177
+ - Schema fallback validator: `additionalProperties: false` also applies when the schema has no `properties` key (all keys unexpected).
178
+ - npm launcher defaults to `python` on Windows (where `python3` is normally absent); PYTHON override unchanged.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 badhope
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+