3 Commits
Author SHA1 Message Date
yetone 81c7db0869 agnes-code: the README's link to the agnes package is relative to its own folder
packages/agnes-code/README.md linked [agnes](packages/agnes), which from
that folder points at packages/agnes-code/packages/agnes. Now ../agnes.
README only; no version bump.
2026-11-03 15:36:42 +08:00
Pursuit806 a48f39692a astudio 0.1.3, agnes-code 0.1.2: the desktop sign-in links the official site and waits instead of showing a key box (#658)
The desktop sign-in of astudio and agnes-code is now an oauth method, so
magpie shows no empty key box. When the desktop session is on disk it
finishes at once; when it isn't, it links the official site and polls
every 2s for up to 5 minutes, ending on cancel (the host's signal).
Missing, unreadable (with the reason, read errors other than ENOENT
kept), expired and banned are told apart; banned and non-Windows
agnes-code throw so the host shows the reason. agnes-code decrypts the
DPAPI master key once per sign-in (re-decrypted if the session frame no
longer opens with it) and kills a PowerShell stuck past 15s. agnes-code's
README and registry summary say how it differs from the `agnes` entry.

By jinyue806. Reviewed at 3a6bb97 (base 17e5ef7; main since then only
changed packages/workbuddy).

Run at 3a6bb97:
- mote, bun 1.4.2, HOME=$(mktemp -d) bun test: 4921 pass, 0 fail
  (374 files); bun scripts/check.mjs ok; node --test on both packages
  62 pass.
- xiaomi-gpu (Windows 11, node 22): node --test on both packages 62 pass.
- Raw bytes of astudio/index.test.mjs: 0 single-backslash "D:\a", 22
  "D:\\astudio".
- magpie's plugin host (host.js from magpie origin/main e41ef6288,
  run by bun on mote, sandbox HOME): astudio authorize with nothing on
  disk gave the official URL and method auto; writing a session file 3s
  into the callback finished it in 4.0s and saved key + metadata to
  auth.json; with the file present the url was empty; banned came back
  as the error message; an aborted callback was dropped; agnes-code on
  macOS came back with "仅支持 Windows" and no poll.
- Broken by hand: dropping the master-key cache's set reds "decrypted
  once per sign-in"; dropping the banned throw reds "refuses banned
  accounts".

Not tried: a real DPAPI decrypt (Protect over ssh is "Access is
denied", no interactive logon there), real AStudio or Agnes Code
desktops. Left for a follow-up the author offered: a DPAPI failure
itself is not remembered, so each 2s poll can spawn PowerShell again
(bounded by the 5-minute wait).
2026-11-03 15:36:30 +08:00
Pursuit806 684e4757ad astudio, agnes-code 0.1.0: AStudio and Agnes Code desktop provider plugins (#595, jinyue806)
Adds two unofficial provider packages by jinyue806:

- packages/astudio (@magpie-community/opencode-astudio-auth 0.1.0, provider `astudio`): iFLYTEK AStudio (Astron Studio) desktop's saved session or a pasted model token; OpenAI Responses at astronstudio-api-volces-prod.xf-yun.com, live catalog, points balance and an observed daily-login check-in from agent.xfyun.cn.
- packages/agnes-code (@magpie-community/opencode-agnes-code-auth 0.1.0, provider `agnes-code`): Agnes Code desktop's safeStorage session (Windows, DPAPI via PowerShell) or a pasted JWT; chat completions at api-agnes-code.agnes-ai.com, live catalog, credits balance from api.agnes-ai.com.
- README rows and two registry.json entries.

Answers the 11-01 review at 36dd528: tests added with injected fetch/fs/DPAPI, registry kept in its style, folders renamed, README ids fixed, paste methods store their inputs, check-in says inactive (not done) when nothing was observed, usage keeps signIn expired, injected homedir honoured, platform checked before any read on Agnes.

Run at the reviewed head 9aaff0d on mote:
- node --test: astudio 24 pass, agnes-code 17 pass
- bun scripts/check.mjs astudio / agnes-code: ok
- full bun test with HOME=$(mktemp -d): 4548 pass, 9 skip, 0 fail
- Broken by hand, each red then restored: fallback paths ignoring homedir (1 fail), usage swallowing expired (1 fail), Agnes check-in back to "done" (1 fail)
- Unauthenticated probe of each host: model-manager 401, Agnes /v1/models and credits-balance 401 "Login expired", agent.xfyun.cn 200 with code 80000 (all map to signIn expired in the code)

Hosts: only the vendors' own (xf-yun.com, xfyun.cn, agnes-ai.com). No dependencies, no install scripts.

Not tried: a real AStudio or Agnes Code account (no install on our machines), the Windows registry and DPAPI paths on a real Windows desktop. Not on npm yet: served from the dist branch until first published by hand.
2026-11-02 03:33:26 +08:00