New package @magpie-community/opencode-openai-decisions-auth (provider
openai-decisions, model gpt-6-luna) by genglintong: answers magpie's
System One (base /systemone through its fetch) with OpenAI's
POST /v1/decisions, converting choice/score/noul to choice/score/predicate
and back with probabilities, confidence and usage. Sign-in is a plain
OpenAI API key from the host's getAuth, read again per request.
The six points of the 11-05 review, checked at 613fc413a:
1. credentials.mjs, the saved-key reader and the keyless method are gone;
no read of providers.json, APPDATA or ~/.config/magpie anywhere.
2. A per-question {"type":"refusal"} is left out of answers; the others
and usage are kept (all refused gives answers {}). magpie's own
Decisions translation reads a missing answer as a refusal too.
3. Omitted, null or blank instructions get a non-empty default.
4. Registry entry on one line; merges cleanly with origin/main 9204c079.
5. Renamed; package.json magpie.icon and registry icon are an SVG data URI.
6. No test writes to disk; comments in English; the only repo link left is
this one (NOTICE, for the opencode2.mjs bridge, byte-identical to
scripts/opencode2.mjs at main).
Run at 613fc413a and at its merge with origin/main 9204c079, off the Mac:
- WSL magpie-desktop, fresh HOME: bun test packages/openai-decisions 23
pass 0 fail; bun scripts/check.mjs 56/56 (merged tree 57/57);
node 22.23.4 --test test/*.test.mjs 23/23 on the merged tree; full
bun test of the merged tree: 8111 pass, 19 skip, 0 fail.
- Windows xiaomi-gpu, fresh HOME and USERPROFILE, Bun 1.4.2: 23 pass 0
fail, check.mjs 56/56.
- Broken by hand, each red then restored: refusal thrown again (3 red),
blank instructions passed through (1 red), key captured at load instead
of per request (1 red), redirect:"error" dropped (1 red), URL check
dropped (1 red).
- Tests reach no network (fetch injected or globalThis.fetch stubbed).
npm pack --dry-run lists the 10 files; every runtime import is in files.
Not tried: a real OpenAI Decisions call (no credentials used), Windows or
Linux in a real magpie.
16 lines
1.4 KiB
JSON
16 lines
1.4 KiB
JSON
{
|
|
"name": "@magpie-community/opencode-openai-decisions-auth",
|
|
"version": "0.1.0",
|
|
"description": "Expose OpenAI Decisions through Magpie's native System One decision API.",
|
|
"type": "module",
|
|
"main": "./opencode.mjs",
|
|
"exports": {".": "./opencode2.mjs"},
|
|
"files": ["index.mjs", "adapter.mjs", "opencode.mjs", "opencode2.mjs", "README.md", "LICENSE", "NOTICE.md", "CHANGELOG.md", "VERIFICATION.md"],
|
|
"scripts": {"test": "node --test test/*.test.mjs"},
|
|
"magpie": {"name": "OpenAI Decisions", "icon": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23111827%22%2F%3E%3Cpath%20d%3D%22M20%2032h12V20h12M32%2032v12h12%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%225%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2232%22%20r%3D%225%22%20fill%3D%22white%22%2F%3E%3Ccircle%20cx%3D%2246%22%20cy%3D%2220%22%20r%3D%225%22%20fill%3D%22white%22%2F%3E%3Ccircle%20cx%3D%2246%22%20cy%3D%2244%22%20r%3D%225%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E"},
|
|
"engines": {"node": ">=20"},
|
|
"license": "MIT",
|
|
"keywords": ["opencode", "opencode-plugin", "magpie", "magpie-plugin", "openai", "decisions", "system-one"],
|
|
"repository": {"type": "git", "url": "https://github.com/magpie-community/plugins.git", "directory": "packages/openai-decisions"}
|
|
}
|