Files
LEOLI 8765cf8f9c atomcode 0.3.0: AtomGit CodingPlan provider plugin (LILEOO, #716)
Adds packages/atomcode (@magpie-community/opencode-atomcode-auth 0.3.0), an AtomGit CodingPlan provider: browser OAuth and AtomCode CLI sign-in (~/.atomcode/auth.toml), signed requests to AtomGit's own gateway, per-account models and quota, daily claim, a loopback-only diagnostics page, and OpenCode 1.x/2.x entries. Registry and README entries added. By LILEOO.

Reviewed at c57b099fff4689c0198c1c6414f04b27614b4092. The last blocking point (an inline TOML comment on a known line went into the uid and was written back) is fixed: values end at an unquoted #, quoted/escaped/literal strings keep their #, and a rewritten line keeps its comment.

Run on a separate test machine (Bun 1.4.2, sandbox HOME):
- PR head merged onto origin/main 24da52b8: bun scripts/check.mjs exit 0 (atomcode ok); whole-repo bun test 6103 pass, 0 fail. origin/main alone: 5942 pass, 0 fail.
- packages/atomcode at the head: bun test 161 pass; node --test test/*.test.mjs 161 pass.
- The new auth-file test against 55ff272's auth-file.mjs: red (1 fail), green at the head.
- Probe: the review's file (id = "123456" # c) parses to uid 123456 and renders back as id = "123456" # c; also #c with no space, CRLF with a tab before #, "1#2", and a literal-string id all round-trip to the same uid. At 55ff272 each gave a uid with the comment in it.

Not tried: a real AtomGit account. A [user] header with a trailing comment is refused ("no user id"), not corrupted; the CLI never writes one. First npm version needs an owner publish; until then magpie installs it from the dist branch.
2026-11-05 16:54:02 +08:00

27 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# NOTICE / 署名
本插件的实现依据(只参考事实与算法,不复制代码):
- **[Atom2Api](https://github.com/cnluminous/Atom2Api)** — MIT License, © 2026 Atom2Api contributors。
`atomcode-signing-v1` 签名算法(HKDF 派生与 HMAC 正则结构)、OAuth broker 端点形状、
CodingPlan REST 用法与 `planTier` 判定均取自该 MIT 项目的源码事实;
版本自动追踪依据其 `ua.go`(raw.atomgit.com 的 Cargo.toml URL 与 manifest 解析同源),
登录后按 Max→Pro→Lite 幂等领取依据其 `codingplan.go` 的 `claim()` 与 `oauth.go` 的
ClaimAndSync 触发点;
其 `core_test.go` 的独立签名测试向量被 `test/sign.test.mjs` 作为对照基准原样使用。
依据 MIT 许可证使用,特此署名。
- **[atomgit-opencode-bridge](https://github.com/zhuguang-ZFG/atomgit-opencode-bridge)** — 无许可证。
仅参考其公开文档记录的协议事实(如 `403 ATOMCODE_UA_REQUIRED`、UA 必须 `atomcode/<版本>`),
未复制其任何代码。
- **[AtomCode](https://atomgit.com/atomgit_atomcode/atomcode)** — MIT,版本 5.2.3。
仅用作 UA / 签名 `X-AtomCode-Ver` 的版本号锚点;本插件不是它的官方组件。
- **[magpie-sensenova](https://github.com/aqiu817/magpie-sensenova) / [magpie-kilo-gateway](https://github.com/aqiu817/magpie-kilo-gateway)** — MIT, aqiu817。
同作者的 magpie 插件工程范式(单函数入口、i18n 表、quota 缓存策略)参考对象。
## 免责声明
本插件是非官方的兼容实现,不隶属于 AtomGit / AtomCode,也未获其认可。
上游协议(签名密钥、OAuth、CodingPlan 接口)可能随时变化导致不可用;
使用方式也可能违反服务条款,存在账号受限或封禁的风险。
请仅凭自己的账号、在了解风险的前提下使用。