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.
93 lines
2.4 KiB
JSON
93 lines
2.4 KiB
JSON
{
|
|
"name": "@magpie-community/opencode-atomcode-auth",
|
|
"version": "0.3.0",
|
|
"description": "AtomCode (AtomGit CodingPlan) for Magpie and OpenCode: browser OAuth or local CLI sign-in, signed requests, persistent diagnostics, native plan claim, live models and quota windows",
|
|
"type": "module",
|
|
"main": "./opencode.mjs",
|
|
"exports": {
|
|
".": "./opencode2.mjs"
|
|
},
|
|
"files": [
|
|
"index.mjs",
|
|
"opencode.mjs",
|
|
"opencode2.mjs",
|
|
"internal.mjs",
|
|
"auth-file.mjs",
|
|
"request-body.mjs",
|
|
"sign.mjs",
|
|
"oauth.mjs",
|
|
"codingplan.mjs",
|
|
"quota.mjs",
|
|
"models.mjs",
|
|
"errors.mjs",
|
|
"state.mjs",
|
|
"diagnostics.mjs",
|
|
"page/index.html",
|
|
"page/boot.js",
|
|
"page/diagnostics.html",
|
|
"page/app.css",
|
|
"page/app.js",
|
|
"page/icon.svg",
|
|
"i18n.mjs",
|
|
"version.mjs",
|
|
"assets/",
|
|
"README.md",
|
|
"README.zh-CN.md",
|
|
"CHANGELOG.md",
|
|
"NOTICE.md",
|
|
"SECURITY.md",
|
|
"LICENSE"
|
|
],
|
|
"keywords": [
|
|
"magpie",
|
|
"magpie-plugin",
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"opencode-auth",
|
|
"opencode-provider",
|
|
"atomcode",
|
|
"atomgit",
|
|
"codingplan",
|
|
"openai-compatible"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/magpie-community/plugins",
|
|
"directory": "packages/atomcode"
|
|
},
|
|
"homepage": "https://github.com/magpie-community/plugins/tree/main/packages/atomcode#readme",
|
|
"bugs": {
|
|
"url": "https://github.com/magpie-community/plugins/issues"
|
|
},
|
|
"engines": {
|
|
"node": ">=20",
|
|
"magpie": ">=0.1.2629"
|
|
},
|
|
"scripts": {
|
|
"test": "bun test",
|
|
"test:coverage": "node --experimental-test-coverage --test test/*.test.mjs",
|
|
"test:coverage:enforce": "node --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=80 --test-coverage-functions=85 --test test/*.test.mjs",
|
|
"test:live": "node scripts/live-smoke.mjs",
|
|
"pack:check": "npm pack --dry-run --json"
|
|
},
|
|
"magpie": {
|
|
"icon": "https://atomgit.com/favicon.ico",
|
|
"maxConcurrency": 8,
|
|
"options": {
|
|
"locale": "auto",
|
|
"clientVersion": "5.2.3",
|
|
"quotaTtlMs": 60000,
|
|
"maxOutputTokens": 32768,
|
|
"diagnosticsPort": 3478
|
|
},
|
|
"page": {
|
|
"title": "AtomCode diagnostics",
|
|
"titles": { "zh": "AtomCode 诊断" },
|
|
"file": "page/index.html",
|
|
"icon": "page/icon.svg",
|
|
"service": { "port": 3478, "option": "diagnosticsPort" }
|
|
}
|
|
}
|
|
}
|