easymagic 0.0.0-stage → 0.4.1

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.
@@ -0,0 +1,70 @@
1
+ # Supported agent configuration
2
+
3
+ The registry covers all **18** application IDs in the original CC Switch `AppType::ALL` at commit [`0afb1f26de6383f43d304bf3e7ac77c4ffc6d15f`](https://github.com/farion1231/cc-switch/tree/0afb1f26de6383f43d304bf3e7ac77c4ffc6d15f). CC Switch CLI is also a reference for the shared seven applications. These are native configuration adapters; the CLI does not embed CC Switch's local proxy or route unsupported protocols through an implicit translator.
4
+
5
+ | CLI target | Native files / directory | Protocols | Activation and notes |
6
+ | --- | --- | --- | --- |
7
+ | `claude-code` (`claude`, `cc`) | `.claude/settings.json` | Anthropic | Restart Claude; existing hooks/permissions retained |
8
+ | `claude-desktop` | `Claude/` and `Claude-3p/configLibrary/` | Anthropic | Restart Desktop; requires Claude role model IDs, no invented mapping proxy |
9
+ | `codex` | `.codex/config.toml`, `auth.json` | Responses | Restart; existing providers/MCP retained |
10
+ | `gemini` (`gemini-cli`) | `.gemini/settings.json`, `.env` | Gemini native | Restart; managed auth policy is respected |
11
+ | `grok-build` (`grok`, `grokbuild`) | `.grok/config.toml` | Chat, Responses, Anthropic | Model context window must be supplied if unknown |
12
+ | `opencode` | `.config/opencode/opencode.json[c]` | Chat, Responses, Anthropic, Gemini | Existing v1/v2 detected; empty config uses installed major version, otherwise released v1; override with `--variant v1` or `v2` |
13
+ | `openclaw` | `.openclaw/openclaw.json` | Chat, Responses, Anthropic, Gemini | JSON5 parsed safely; formatting/comments may be normalized |
14
+ | `hermes` | `.hermes/config.yaml` (Windows: local app data) | Chat, Responses, Anthropic | Existing YAML comments and other providers retained |
15
+ | `pi` | `.pi/agent/models.json`, `settings.json` | Chat, Responses, Anthropic, Gemini | Selects the managed provider/model |
16
+ | `minimax-code` (`mcode`, `minimax`) | `.minimax/config.yaml` | Chat, Responses, Anthropic | Uses native `custom_provider`, retains official account |
17
+ | `kimi-code` (`kimi`) | `.kimi-code/config.toml` | Chat, Responses, Anthropic, Gemini | Current TypeScript Kimi Code 2.x; context window required if unknown, not legacy Python Kimi CLI |
18
+ | `deepseek-harness` (`dsh`) | `.dsh/profiles/{web,desktop,...}/cordis.patch.yml`, `.credentials.yaml` | Chat, Responses, Anthropic | Adds provider to native profiles; select it in the client; home-level shadowing is rejected |
19
+ | `agy` (`antigravity`) | `.gemini/config/config.json` | Gemini native, Chat | Uses Enterprise Gateway settings; preserves other model entries |
20
+ | `oh-my-pi` (`omp`) | `.omp/agent/models.yml`, `config.yml` | Chat, Responses, Anthropic, Gemini | Respects native profile directories and model roles |
21
+ | `copilot` (`copilot-cli`) | `.copilot/providers.json`, `settings.json` | Chat, Responses, Anthropic | Uses native BYOK provider/model configuration |
22
+ | `workbuddy` | `.workbuddy/models.json` | Chat | Select the added EasyMagic model in the client; official account retained |
23
+ | `codebuddy` | `.codebuddy/models.json`, `settings.json` | Chat | Uses upstream model ID and native `openai-completions`; other unverified protocols deliberately excluded |
24
+ | `zcode` | `.zcode/v2/provider_config.json` | Chat, Responses, Anthropic | Select EasyMagic in the client; encrypted active-provider state retained |
25
+
26
+ `Chat` means OpenAI Chat Completions; `Responses` means OpenAI Responses. Protocol support depends on the selected site's groups and models too. A model using one protocol cannot be substituted into another client by changing a URL.
27
+
28
+ ## Commands
29
+
30
+ ```sh
31
+ easymagic setup list
32
+
33
+ easymagic setup opencode --key-id 123 --model your-model --dry-run
34
+ easymagic setup opencode --key-id 123 --model your-model
35
+
36
+ # Configure several already installed clients, or select explicit targets.
37
+ easymagic setup all --clients claude-code,codex,opencode --key-id 123 --dry-run
38
+ easymagic setup all --clients claude-code,codex,opencode --key-id 123 --yes
39
+
40
+ # Real, provider-documented context limits; never guess these numbers.
41
+ easymagic setup kimi-code --key-id 123 --model your-model --context-window YOUR_MODEL_CONTEXT
42
+
43
+ # Restore a prior write. Later manual edits cause refusal unless --force is explicit.
44
+ easymagic setup history
45
+ easymagic setup restore RESTORE_ID --dry-run
46
+ easymagic setup restore RESTORE_ID --yes
47
+
48
+ easymagic doctor --client opencode --key-id 123
49
+ easymagic doctor --client opencode --key-id 123 --check
50
+ ```
51
+
52
+ A fresh `--config-dir` always isolates a client configuration. For Claude Desktop this is the **common parent** of `Claude` and `Claude-3p`, not an individual JSON file. `setup all` only chooses installed/configured clients unless `--clients` is explicit; it reports per-client results, and successful targets stay applied if another target fails. Each target receives its own restore ID.
53
+
54
+ Claude Code and Codex use one active credential configuration in this CLI. Their `--provider` must remain `easymagic`; custom values are rejected before writes. Codex uses a global `auth.json` API key, so switching to another site requires configuring that site’s credential as well. Other providers’ entries are preserved, but this is not independent per-provider authentication.
55
+
56
+ Model capacities are read from existing configuration or explicit `--context-window` / `--max-output-tokens` values. Unknown values are not fabricated. Kimi/Grok can require a capacity before writing. Use `--protocol` when a multi-protocol client should use a non-default protocol. `--provider` names stay under `easymagic` / `easymagic-*` so another provider cannot be overwritten accidentally.
57
+
58
+ ## Source references
59
+
60
+ - [CC Switch native adapters](https://github.com/farion1231/cc-switch/tree/0afb1f26de6383f43d304bf3e7ac77c4ffc6d15f/src-tauri/src): app registry and native configuration contracts.
61
+ - [CC Switch CLI](https://github.com/SaladDay/cc-switch-cli): terminal provider management, native settings and backup concepts.
62
+ - [Gemini CLI](https://github.com/google-gemini/gemini-cli): `packages/core/src/core/contentGenerator.ts`, config/auth and environment handling.
63
+ - [Kimi Code](https://github.com/MoonshotAI/kimi-code): `docs/en/configuration/config-files.md` and providers schema.
64
+ - [OpenCode](https://github.com/anomalyco/opencode): released v1 configuration versus v2 development schema.
65
+ - [Pi](https://github.com/badlogic/pi-mono): model registry, provider definitions and credential precedence.
66
+ - [Grok Build](https://github.com/xai-org/grok-build), [MiniMax Code](https://github.com/MiniMax-AI/minimax-code): native custom provider and model schemas.
67
+
68
+ ## Verification scope
69
+
70
+ All 18 adapters have local configuration, preservation, protocol rejection, write/backup and restore checks. Native installed-client tests additionally cover Claude Code/Codex, Kimi Code 2.8.1, Gemini CLI 0.71.1, OpenCode and Pi where recorded by the test results. A local mock proves configuration is consumed and the expected protocol is emitted; it does not prove that every public model or every future client version works. Desktop-only applications have file-contract checks rather than a claimed desktop launch on a headless server.
package/AI_USAGE.md ADDED
@@ -0,0 +1,156 @@
1
+ # 给 AI 助手的 EasyMagic CLI 使用指南
2
+
3
+ 目标:用户在浏览器确认一次授权后,由 CLI 创建适合目标客户端的推理密钥并写入配置。AI 不需要复制 PAT、查看完整推理密钥或手工拼接客户端配置文件。
4
+
5
+ ## 1. 先读当前安装版本的接口
6
+
7
+ ```sh
8
+ easymagic --version
9
+ easymagic guide ai --json
10
+ easymagic schema --json
11
+ easymagic schema onboard --json
12
+ easymagic setup list --json
13
+ ```
14
+
15
+ `guide` 返回说明文档,`schema` 从当前 CLI 的实际命令树生成参数说明。优先依据当前输出执行,避免把其他版本或相似工具的参数套进来。完整机器交互规则见 [CLI_CONTRACT.md](CLI_CONTRACT.md),18 种客户端的原生配置边界见 [AGENT_SUPPORT.md](AGENT_SUPPORT.md)。
16
+
17
+ 安装包需要 Node.js 22 或更新版本。可通过 `npm install -g easymagic@0.4.1` 安装指定版本,或用 `npx --yes easymagic@0.4.1` 执行命令。仅有源码时需要先构建;调用前用 `easymagic --version` 确认实际版本。浏览器授权要求目标网站已部署配套 device-login API 和授权页面,见 [BACKEND_INTEGRATION.md](BACKEND_INTEGRATION.md)。旧网站仍可由用户提供 PAT,通过 `login --token-stdin` 登录;不要让用户把 PAT 发在聊天里。
18
+
19
+ ## 2. 推荐:一次发起,浏览器确认,恢复完成
20
+
21
+ 以下命令以 Claude Code 为例。把 `claude-code` 换成 `setup list --json` 返回的目标 ID,例如 `codex`、`opencode` 或 `pi`。
22
+
23
+ ```sh
24
+ easymagic onboard claude-code --start --no-browser --json
25
+ ```
26
+
27
+ 解析返回的 `status`,保留 `onboarding_id` 和 `next_command`。若为 `authorization_pending`,把返回的授权网址和用户校验码展示给用户,请其在自己的浏览器登录并确认;不要要求用户提供密码、验证码、Cookie、PAT 或完整 API key。
28
+
29
+ 用户确认后,执行返回的 `next_command`。也可以使用同一编号:
30
+
31
+ ```sh
32
+ easymagic onboard --resume ONBOARDING_ID --json
33
+ ```
34
+
35
+ 不需要持续占用进程时,每次恢复只检查一次状态;确需等待时使用:
36
+
37
+ ```sh
38
+ easymagic onboard --resume ONBOARDING_ID --wait --json
39
+ ```
40
+
41
+ 只能使用本次输出的 `ONBOARDING_ID`,不要把浏览器校验码、登录 `flow_id` 和配置操作编号混用。仍在等待授权时保留编号,稍后继续同一流程。完成后的恢复返回已保存的结果,不应创建第二把密钥。
42
+
43
+ `configured` 才代表 CLI 已完成自动创建密钥和写入客户端配置。向用户汇报目标客户端、选定模型、配置路径和恢复编号即可,不展示密钥值。需要重启或在客户端内选择模型时,照输出和客户端说明提示用户。
44
+
45
+ 人类直接在终端操作也可以用:
46
+
47
+ ```sh
48
+ easymagic onboard claude-code
49
+ ```
50
+
51
+ 这条交互路径会发起浏览器授权、等待确认,然后继续配置。AI 工具调用优先使用 `--start --json` / `--resume`,避免长时间阻塞。
52
+
53
+ ## 3. 根据真实状态继续,不猜测成功
54
+
55
+ | 返回状态 | AI 下一步 |
56
+ | --- | --- |
57
+ | `authorization_pending` | 展示本次授权链接/校验码;保留 `onboarding_id`;按 `next_command` 恢复 |
58
+ | `configured` | 读取 `setup` 结果并汇报配置完成;不要再执行一次新建流程 |
59
+ | `action_required` | 解释返回的具体原因,按提示处理权限、协议、模型容量或网站协议签署等问题;只有已确认失败且原因已解决时,才按返回指令重试同一流程 |
60
+ | `expired`、`denied`、`cancelled` | 本次流程不可当作成功;解释结果,仅在用户仍希望继续时重新发起 |
61
+
62
+ 网站账号权限、可用分组、钱包/订阅余额、模型限制和 API key 使用协议均由后端强制检查。CLI 无法绕过;不要通过修改本地配置、换请求路径或重复调用来规避拒绝。
63
+
64
+ `authorization_pending` 的退出码为 `0`;`action_required`、`expired`、`denied`、`cancelled` 的退出码为 `1`,但仍应读取结构化结果中的下一步。单独执行 `login` 时,登录成功状态为 `authenticated`,并不等同客户端已经配置。
65
+
66
+ 不要为配置器编造模型容量。Kimi/Grok 等客户端可能需要已知的 `--context-window` 或 `--max-output-tokens`;依据模型的正式说明或用户给出的值再执行。无法确认时保留 `action_required`,说明需要什么信息。
67
+
68
+ 补齐所缺参数后继续原流程,例如:
69
+
70
+ ```sh
71
+ easymagic onboard --resume ONBOARDING_ID --retry --context-window YOUR_MODEL_CONTEXT --json
72
+ ```
73
+
74
+ ## 4. 已登录账号的操作
75
+
76
+ ```sh
77
+ easymagic profile list --json
78
+ easymagic --profile work whoami --json
79
+ easymagic --profile work groups --json
80
+ easymagic --profile work models --json
81
+ easymagic --profile work onboard codex --start --json
82
+ ```
83
+
84
+ 账号 profile、站点和目标客户端是三件不同的事。恢复操作使用原始站点和账号,不要为了消除权限错误换 profile 重放。`logout` 只删除选中的本地登录;不会吊销服务端 PAT,也不会清除 shell 中的 `EASYMAGIC_TOKEN`。
85
+
86
+ 若用户指定复用已有推理密钥,可走手动配置入口;该入口不会自动创建新密钥:
87
+
88
+ ```sh
89
+ easymagic keys list --all --json
90
+ easymagic setup codex --key-id KEY_ID --dry-run --json
91
+ easymagic setup codex --key-id KEY_ID --json
92
+ ```
93
+
94
+ `KEY_ID` 使用列表返回的数字 ID。默认列表与详情隐藏完整 key;AI 配置流程不需要 `keys show --reveal`。
95
+
96
+ ## 5. 诊断与回退
97
+
98
+ 默认诊断可检查配置、账户、模型可见性和协议匹配;它不发送推理生成请求:
99
+
100
+ ```sh
101
+ easymagic doctor --client codex --json
102
+ easymagic setup history --json
103
+ easymagic setup restore RESTORE_ID --dry-run --json
104
+ ```
105
+
106
+ 用户要求实际验证推理时才加 `--check`,它可能消耗额度:
107
+
108
+ ```sh
109
+ easymagic doctor --client codex --check --json
110
+ ```
111
+
112
+ 确认需要恢复后执行:
113
+
114
+ ```sh
115
+ easymagic setup restore RESTORE_ID --yes --json
116
+ ```
117
+
118
+ 恢复会检测配置后的人工修改;默认拒绝覆盖这些修改。不要自动追加 `--force`。配置恢复也不等于删除服务端密钥或撤销已产生的费用。
119
+
120
+ ## 6. 写入超时:恢复同一操作,不重新创建
121
+
122
+ 创建密钥后连接中断,不能据此断言“没有创建成功”。从结果或错误提示中保留 `operation_id`,先检查和回查:
123
+
124
+ ```sh
125
+ easymagic operations show OPERATION_ID --json
126
+ easymagic operations reconcile OPERATION_ID --json
127
+ ```
128
+
129
+ | 操作条目状态 | 处理方式 |
130
+ | --- | --- |
131
+ | `succeeded` | 已确认,不能重放 |
132
+ | `failed` | 已确认失败;修正原因后可以 `operations retry OPERATION_ID --yes --json` |
133
+ | `pending` 且未尝试 | 可以 `operations resume OPERATION_ID --yes --json` |
134
+ | `unknown` 或尝试过但中断的 `pending` | 先回查;未知创建不会自动重放;必要时核对 `candidate_ids` |
135
+
136
+ 不要用“再执行一次 `keys create`/`setup --create-key`/新的 `onboard`”替代恢复。名称相同不代表同一把密钥;CLI 的回查使用创建前 ID 基线、属性和时间证据,仍可能无法唯一确定结果。这不是服务端幂等协议。
137
+
138
+ ## 7. 多客户端和批量操作
139
+
140
+ ```sh
141
+ easymagic setup all --clients claude-code,codex,opencode --key-id KEY_ID --dry-run --json
142
+ easymagic keys update --where-group cc --quota 20 --dry-run --json
143
+ easymagic keys export --all --file keys.json --json
144
+ ```
145
+
146
+ 执行多客户端配置、导入、删除或批量修改前,先检查预览范围,再使用相应的 `--yes`。多个客户端结果逐项报告,失败不会撤销已经成功的目标。一个 key 的协议和分组未必同时适合所有客户端,不要把“18 种配置适配器”解释成“一把 key 对全部客户端可用”。
147
+
148
+ 默认导出不包含完整 key;`--reveal` 是明确泄露秘密到输出文件的选择,正常 AI 配置流程不应使用。`api` 是低层逃生口,输出可能包含后端原始敏感字段;优先使用具名命令。
149
+
150
+ ## 8. 支持范围与行为约束
151
+
152
+ 18 个 ID:`claude-code`、`claude-desktop`、`codex`、`gemini`、`grok-build`、`opencode`、`openclaw`、`hermes`、`pi`、`minimax-code`、`kimi-code`、`deepseek-harness`、`agy`、`oh-my-pi`、`copilot`、`workbuddy`、`codebuddy`、`zcode`。安装版本的最终清单以 `setup list --json` 为准。
153
+
154
+ 所有适配器都有配置契约测试;只有 [COMPATIBILITY.md](COMPATIBILITY.md) 记录的具体客户端版本做过原生运行验证。部分桌面客户端仍需用户在应用内选择新 provider/model。CLI 不安装这些客户端,不修改其审批或沙盒策略,不内置协议转换代理,也不保证未来版本配置格式不变。
155
+
156
+ AI 只应汇报已观察到的结果:区分“授权尚未完成”“配置文件已写入”“客户端实际读取配置”“真实推理成功”。不要把任意一个阶段当成后续阶段已验证。
package/AUDIT.md ADDED
@@ -0,0 +1,43 @@
1
+ # 0.4.1 安全与流程复核
2
+
3
+ 复核日期:2026-12-01。本报告区分发布材料中的数据、运行时凭据处理与流程正确性。
4
+
5
+ ## 敏感数据检查
6
+
7
+ 复核起点覆盖 75 个 Git 跟踪文件、完整 Git 历史的 193 个对象(132 个 blob)、构建后的 CLI、0.1–0.4 四个安装包和忽略的浏览器验收产物。
8
+
9
+ - 人工检查与本地 Gitleaks 8.30.1 扫描均未发现真实 PAT、推理 API key、JWT、GitHub/npm token、云密钥或私钥。匹配到的短 token 是测试字面量或随机生成模板。
10
+ - 旧文档、旧安装包及其嵌入文档含开发机器绝对路径。这是内部环境信息,不是可用凭据;0.4.1 已移除发布文档中的这些路径,测试也不再默认读取某台机器上的 PAT 文件。
11
+ - 浏览器验收产物曾包含测试账户标签及临时配对码;不在 npm 包文件清单中。未发现密码、PAT 或推理密钥。
12
+ - `bun audit --json` 对当前锁定依赖返回空报告,退出码为 0。漏洞库结果仅对应本次检查时间。
13
+
14
+ 历史提交和旧包仍可能包含旧的非凭据路径信息;没有改写 Git 历史。分发时使用 0.4.1 或更新版本,不分发旧验收包。
15
+
16
+ ## 本次修复
17
+
18
+ | 问题 | 0.4.1 行为 |
19
+ | --- | --- |
20
+ | 配置失败后已删除的新密钥仍绑定在流程中,无法继续 | 记录确认完成的清理操作;用户修正问题并显式 `--retry` 后可创建替代密钥。普通 404 或未知删除结果不会触发重建 |
21
+ | 崩溃遗留文件锁阻塞 setup/restore;接管死进程锁可能竞争 | 配置、授权、onboarding、操作记录共用带接管保护的锁;活进程锁保持排他,释放时校验所有权 |
22
+ | setup 中途更换账号可能改变后续查询和密钥读取身份 | 整个配置过程绑定启动时验证的站点和凭据 |
23
+ | 多进程同时修改 profile 可能丢失更新 | 对读取、修改、持久化及旧凭据清理的完整事务加锁;并发修改明确返回忙碌 |
24
+ | 损坏配置触发登录或退出时可能覆盖、删除其他 profile | 保留原文件并拒绝修改,提示先备份和修复 |
25
+ | 服务端错误文本或错误 code 可回显请求凭据 | 在 API 边界移除当前请求凭据及可识别密钥,限制错误 code 格式 |
26
+ | `usage --json` 原样透传日志扩展字段 | 仅输出用量与调用元数据,移除 IP、原始正文、扩展对象和未知字段 |
27
+ | Claude Code/Codex 的自定义 provider 参数与实际隔离能力不符 | 对未支持的自定义 provider 明确拒绝,避免静默改动默认 provider |
28
+ | Codex 从命名 profile 启动时读取了根级模型 | 检查和配置使用实际活动 profile 的模型,再生成迁移计划 |
29
+ | 浏览器验收脚本在解析真实路径后检查符号链接 | 检查原始输入,用不跟随链接的文件描述符验证普通文件及私有权限 |
30
+
31
+ 这些修复有针对性回归,包括明确失败与未知结果、并发竞争、死进程接管、凭据切换、配置保留和输出脱敏。完整校验命令为 `bun run check`;安装包通过离线安装检查。
32
+
33
+ 0.4.1 本地验证结果:147 项测试、844 个断言通过,18 种客户端的配置、备份、重复写入及恢复流程通过,TypeScript 检查和离线安装检查通过。
34
+
35
+ ## 仍需了解的行为
36
+
37
+ - 正常运行时,CLI 必须保存管理凭据,目标 Agent 也需要读取推理凭据。它们属于用户授权的本地状态,不会被加入 npm 安装包。系统凭据存储不可用时,`auto` 可回退私有文件;若必须使用系统存储,选 `--credential-store keychain`。
38
+ - `keys ... --reveal` 和低层 `api` 是明确的敏感输出入口。普通 AI 配置流程无需使用它们。
39
+ - Codex 当前配置方式使用一个活动的全局 API 凭据,不能承诺多个 provider 各自独立认证。切换到另一个站点时应重新配置相应凭据;自定义 provider 参数会被拒绝。
40
+ - 自动创建的推理密钥默认无限额、不过期。可通过 `keys update` 设置额度和有效期;这与管理 PAT 的 30 天有效期不同。
41
+ - 无法唯一确认的远程写入继续保持 `unknown`,需要核对操作记录。恢复保护文件本身若在接管期间崩溃遗留,会要求检查;不能直接删除仍属于活进程的锁。
42
+
43
+ 扫描未发现凭据不等于对所有未来输入或依赖版本作出保证;发布新版本时应重复检查安装包与 Git 变更。
@@ -0,0 +1,79 @@
1
+ # 浏览器授权与多账户集成
2
+
3
+ ## 交付位置
4
+
5
+ - 后端补丁基于提交 `4ee7497aa`,开发分支为 `feat/cli-device-login`。
6
+ - `backend/device-login.patch`:适用于以上基础提交的功能补丁。
7
+ - `backend/device-login.current-worktree.patch`:根据集成时的主站既有工作区生成,只追加本功能,保留原有 gzip、日志及其它改动。
8
+ - 已将 current-worktree 补丁追加应用到当前主站源码,保留原有改动;尚未部署线上。用于其他检出版本时,先在目标目录运行 `git apply --check <补丁路径>`;检查通过后才应用,不能把隔离工作区整体覆盖到主站。
9
+
10
+ ## 端点和用户流程
11
+
12
+ | 端点 | 认证 | 用途 |
13
+ | --- | --- | --- |
14
+ | `GET /api/cli/device/capabilities` | 公开 | 检查服务端支持 |
15
+ | `POST /api/cli/device/start` | 公开、限流 | 创建 10 分钟授权请求,返回设备秘密和公开配对码 |
16
+ | `POST /api/cli/device/poll` | 请求体的设备秘密 | 5 秒最小间隔轮询,只返回一次 PAT |
17
+ | `POST /api/cli/device/cancel` | 请求体的设备秘密 | 取消未完成请求 |
18
+ | `GET /api/cli/device/info?user_code=...` | 已登录浏览器会话 | 查看请求名称和固定权限 |
19
+ | `POST /api/cli/device/approve` | 浏览器会话、同源、一次性安全证明 | 批准请求 |
20
+ | `POST /api/cli/device/deny` | 浏览器会话、同源 | 拒绝请求 |
21
+ | `GET /cli/authorize` | 页面公开,操作需要浏览器会话 | 后端内置的授权确认页面 |
22
+
23
+ `easymagic login` 默认发起浏览器授权,`--no-browser` 只打印链接和配对码;`--token-stdin` 保留为未部署新端点站点的登录方式。配对页面通过已有刷新 cookie 恢复短期浏览器 JWT;密码、TOTP 和 Passkey 使用现有安全验证端点,禁止将 PAT 当作浏览器会话批准。仅绑定第三方 OAuth 且没有上述验证方式的账户,页面会明确引导到原控制台创建 PAT,不降级认证要求。
24
+
25
+ 新增 PAT 固定授权为 `profile:read`、`api_key:read`、`api_key:write`、`api_key:reveal`、`usage:read`,有效期 30 天。授权页明确显示这些权限,用户主动确认,网页批准响应不含完整 PAT。
26
+
27
+ ## 安全控制
28
+
29
+ 复用已有 `auth_flows` 和 `user_access_tokens`,无新增表或列。设备秘密只保存 HMAC;配对码索引也只保存 HMAC。完整 PAT 仅在领取时从高熵设备秘密派生,在数据库保存指纹,不保存可用明文。领取和创建 PAT 在同一事务内完成;先锁定流程和用户,保证同一请求仅领取一次,并发请求不超过账户 PAT 数量上限。领取前重新验证原批准会话,撤销会话后不能继续领令牌。
30
+
31
+ 10 分钟过期、限流、最小轮询间隔、拒绝、取消和单次领取都由服务端执行。浏览器批准必须同时满足有效会话、可信 Origin 和与确切 scopes/expiry 绑定的一次性安全证明。确认页使用 nonce CSP、`frame-ancestors 'none'`、`Referrer-Policy: no-referrer`、`Cache-Control: no-store`。页面使用 `textContent` 输出设备名;设备码、公开配对码及 PAT 不写入访问日志,安全审计只记录名称、权限、有效期与结果。
32
+
33
+ 实现参考 OWASP Authentication、Session Management、OAuth2、CSRF Prevention Cheat Sheets 的传输、重验证、一次性令牌、同源验证和不记录秘密原则;不宣称安全认证。生产部署仍需配置 HTTPS 和可信浏览器来源,并沿用现有 cookie/代理设置。
34
+
35
+ ## Profile 与系统凭据
36
+
37
+ `profile list/use/delete` 和全局 `--profile` / `EASYMAGIC_PROFILE` 支持多个站点账户。旧单账号文件按需迁移,列表不返回凭据。每个保存动作使用独立秘密引用,成功提交配置后才清理旧秘密。
38
+
39
+ `--credential-store auto|file|keychain` 或 `EASYMAGIC_CREDENTIAL_STORE` 控制保存位置。auto 优先使用 macOS Keychain、Linux Secret Service(secret-tool)、Windows 当前用户 DPAPI;不可用时明确记录为 private file。keychain 模式失败不会静默降级。秘密经标准输入传递,不拼进 shell 或进程参数。文件保存仍为 POSIX 0600;Windows 采用目录 ACL 和当前用户 DPAPI。
40
+
41
+ ## 已执行验证
42
+
43
+ - TypeScript 检查;`bun test test/auth-profiles.test.ts`:6 项通过,覆盖旧文件迁移、profile 隔离、环境令牌绕过锁定钥匙串、坏引用拒绝、写盘失败不删除旧秘密、浏览器设备轮询和跨域授权链接拒绝。
44
+ - `go test ./model ./controller ./router -run 'TestCLIDevice|TestAccessTokenRoute' -count=1`:流程状态、控制器安全检查、路由权限声明。
45
+ - 三数据库模型矩阵:SQLite **3.50.4**、MySQL **8.4.13**、PostgreSQL **18.6**,全部通过。每次创建独立临时库,结束后删除。两次 AutoMigrate 检查重复启动;覆盖过期、拒绝、取消、轮询节流、会话撤销、同一请求并发领取、两个设备竞争最后一个 PAT 名额、数据库无秘密明文。
46
+ - 独立 HTTP 后端 + 实际 CLI:创建测试账户 → CLI 发起授权 → 浏览器身份进行安全验证并批准 → CLI 取得 PAT → 读取账户资料,全链路通过;确认页 CSP 和访问日志秘密检查通过。测试后端及账户与生产隔离。
47
+ - macOS/Windows 原生凭据写入、读取、删除由仓库 CI 的 `scripts/keychain-smoke.ts` 执行;仅根据对应 CI 的实际结果判断是否通过。
48
+
49
+ 重跑数据库矩阵时,为**专用空测试库**设置 `CLI_TEST_MYSQL_DSN` 和 `CLI_TEST_POSTGRES_DSN`,执行 `go test ./model -run TestCLIDeviceDatabaseMatrix -count=1 -v`。没有设置 DSN 时对应数据库会跳过,不能将跳过算作通过。
50
+
51
+ ## 本次集成与浏览器验收
52
+
53
+ 配套改动已通过增量补丁应用到主站源码,保留了既有工作区修改。在后端源码目录执行 `GOTOOLCHAIN=go1.27.4 go test ./model ./controller ./router -run 'TestCLIDevice|TestAccessTokenRoute' -count=1`,三个包全部通过。
54
+
55
+ Playwright 在隔离的 `http://127.0.0.1:18891` 测试服务完成了真实页面加载、现有登录态恢复、密码再验证、确认授权,以及等待中的实际 CLI 领取并保存 PAT。桌面和 390px 手机视口截图保存在 `output/playwright/`(本地验收产物,不打进 npm 包)。测试服务和测试账户均非生产。生产站点仍须部署含这些源代码的后端版本后,才能使用浏览器登录。
56
+
57
+ ## 0.4:可恢复的自动配置与首次协议确认
58
+
59
+ `onboard CLIENT` 把登录、创建客户端专用推理密钥和写入客户端配置连接起来。AI 使用 `onboard CLIENT --start --json` 获取授权链接与 `onboarding_id`,用户在浏览器确认后,调用 `onboard --resume ID --json` 继续。`login --start/--resume/--cancel` 也可独立使用。完成结果和恢复状态不返回 PAT 或完整推理 key;登录流程临时秘密仅保存在私有 `auth-flows/` 文件,完成后删除。
60
+
61
+ 首次创建 key 可能要求两份 API 密钥使用协议。授权页现在通过现有浏览器会话接口读取 `token-agreements` 状态,显示当前版本完整条款;只有用户分别勾选、挑战仍有效且签署成功,才继续身份再验证与设备授权。刷新或签署失败会清除勾选;拒绝授权不会签署协议。协议已经签署或站点未启用该要求时无需重复签署。仍由原服务端强制校验会话、挑战版本/期限、Origin 和安全证明,CLI 不代用户接受协议。
62
+
63
+ 新增的 `controller/cli_device_test.go` 覆盖页面安全响应头和实际内嵌脚本的同意状态:未勾选、只勾选一份、过期、版本变化、签署失败、已签署、拒绝以及更改配对码。测试与 HTML 已同步到主站源码,两份增量补丁同步更新,并通过各自工作区的 `git apply --reverse --check` 核对。
64
+
65
+ 本次安全复核参考 [OWASP ASVS 5.0](https://github.com/OWASP/ASVS/tree/v5.0.0) 的 V3(浏览器安全)、V6(认证)、V7(会话管理)章节,以及 [Authentication](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)、[Session Management](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html)、[CSRF Prevention](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html) 指引。验证范围是上述控制及回归用例,不代表获得安全认证。
66
+
67
+ 0.4 CLI 已通过本地完整检查:136 项测试、743 个断言、独立安装包验证及 18 个客户端配置/备份/恢复流程。对应提交 `3fc6143` 的 [跨平台 CI](https://github.com/XzlmTech/easymagic-cli/actions/runs/46566200923) 全部 9 项通过,包含 Linux/macOS/Windows 的 Node 22/24 测试和三个系统上的 Claude Code/Codex 原生检查。新增状态与调用契约见 [AI_USAGE.md](AI_USAGE.md) 和 [CLI_CONTRACT.md](CLI_CONTRACT.md)。
68
+
69
+ 新的 Playwright 验收使用独立 SQLite 副本和 `127.0.0.1:18894`:测试账户尚未签署协议,两个勾选框默认关闭;只勾选一份仍无法授权;用户动作勾选两份并通过密码再验证后,实际 CLI `onboard --resume` 自动创建专用 key 并完成 Claude Code 配置。再次恢复同一编号返回相同的完成结果。整个验收使用测试账户和临时客户端目录;生产站点与用户真实 Agent 配置不受影响。
70
+
71
+ 数据库确认只新增一把密钥,两份协议签署时间均已写入;重复恢复后密钥数量不变。完成后私有授权流程文件已删除,服务日志未发现密码、PAT 或推理密钥。可复现脚本已实际运行并以 0 退出,测试后端、浏览器会话、临时数据库与凭据已清理。
72
+
73
+ 开发环境可用 `e2e/onboard-browser.py` 重现,需要 Python 3、已构建的 CLI/后端、Playwright CLI wrapper、测试 SQLite 与该测试账户的私有 JSON 凭据文件(`username` / `password`,0600)。脚本只启动数字 loopback 服务,将源 SQLite 只读复制到临时目录,并在结束时清理测试服务和临时状态:
74
+
75
+ ```sh
76
+ python3 e2e/onboard-browser.py --backend-bin /path/to/test-backend \
77
+ --fixture-db /path/to/test-fixture.db --credential-file /private/test-login.json \
78
+ --playwright-wrapper /path/to/playwright_cli.sh --port 18894
79
+ ```
@@ -0,0 +1,158 @@
1
+ # EasyMagic CLI 机器交互契约
2
+
3
+ 本文面向调用 CLI 的 AI、脚本和集成程序。具体参数以本次安装的 `easymagic schema --json` 为准;本文说明状态处理、安全边界和恢复语义,不替代目标网站的 API 权限规则。
4
+
5
+ ## 接口发现
6
+
7
+ ```sh
8
+ easymagic guide --json
9
+ easymagic guide ai --json
10
+ easymagic guide contract --json
11
+ easymagic schema --json
12
+ easymagic schema onboard --json
13
+ easymagic schema keys update --json
14
+ ```
15
+
16
+ `guide [topic]` 支持 `quickstart`、`ai`、`contract`、`agents`、`backend`、`audit`,JSON 输出中包含 Markdown。`schema [command...]` 从 Commander 命令树读取参数、选项及子命令。不要将自然语言 help 文案作为稳定的状态标识,也不要假定未被 schema 列出的 flag 可用。
17
+
18
+ ## 输入、输出与退出码
19
+
20
+ - 使用全局 `--json` 获取机器输出;`--profile NAME` 固定管理账号/站点,`--lang en|zh` 控制界面语言。
21
+ - 成功及可处理的异步状态输出到 stdout;顶层参数、权限、网络等错误输出到 stderr。等待授权时 stderr 也可能包含逐行 JSON 进度事件,不能把整段 stderr 一律当成单个错误对象。应分别捕获两个流,读取退出码后解析 JSON。
22
+ - 批量部分失败仍在 stdout 返回逐项结果,并以非零退出码结束。不要只检查 stderr 是否为空。
23
+ - 退出码 `0` 表示命令本身成功,不必然代表授权或配置已完成;异步流程还必须检查 `status`。退出码 `1` 表示失败、部分失败或未确认的写入结果。
24
+ - 显式 `--help` 和 `--version` 是文本接口;不要将其当 JSON 解析。
25
+ - 各具名命令没有统一的顶层成功 envelope。`whoami`、`keys list`、`setup`、`operations` 的结果字段各不相同;直接 `api` 返回后端原始 JSON。
26
+
27
+ 常规错误形状如下;可选字段可能因 JSON 序列化被省略:
28
+
29
+ ```json
30
+ {"error":{"message":"可读错误说明","code":"CLI_ERROR","status":403}}
31
+ ```
32
+
33
+ 以 `code`、HTTP `status`、结构化条目状态和本次 schema 为判断依据,不硬编码某种语言的 `message`。遇到非 JSON 的运行环境错误、进程被杀死或只有部分输出,不能推断远端写入未发生。
34
+
35
+ ## 凭据分层
36
+
37
+ | 数据 | 用途 | 机器调用原则 |
38
+ | --- | --- | --- |
39
+ | PAT,形如 `nap_…` | 访问账户、管理密钥、读取用量 | 用户通过浏览器授权或安全 stdin/环境变量交付;不作为推理 key |
40
+ | 推理 API key | 目标 Agent 调用模型 | 默认不输出完整值;自动配置由 CLI 内部写入 |
41
+ | 登录 `flow_id` | 恢复浏览器登录 | 使用返回编号,不等同校验码或 onboarding 编号 |
42
+ | `onboarding_id` | 恢复登录到自动配置的完整工作流 | 完成后重复恢复返回缓存结果,不重复创建 key |
43
+ | `operation_id` | 追踪服务端密钥写入及未知结果 | 用 `operations` 检查、回查或按状态恢复 |
44
+ | `restore_id` | 恢复客户端配置文件 | 用 `setup restore`;不是服务端密钥操作的撤销编号 |
45
+
46
+ 本地 profile 保存账号/站点选择及凭据引用;`auto` 凭据存储优先使用系统存储,不可用时可回退本地私有文件。显式 `keychain` 不静默降级。POSIX 私有文件按 `0600`、日志目录按 `0700` 写入;Windows 依赖 ACL,系统存储使用当前用户 DPAPI。系统存储不等于目标 Agent 的配置文件也由 Keychain 管理。
47
+
48
+ 默认 `keys list/show` 隐藏完整 key,普通导出不包含 key。以下是显式敏感输出入口,应避免将输出发到聊天、公共日志或版本库:
49
+
50
+ ```sh
51
+ easymagic keys show KEY_ID --reveal --json
52
+ easymagic keys export --all --reveal --file private-keys.json --json
53
+ ```
54
+
55
+ `api` 返回任意同站点后端内容,不能保证敏感字段已经遮罩。`--token` 会把 PAT 放进 argv;交互登录优先 browser,自动化秘密优先 stdin 或受控环境变量。
56
+
57
+ ## 登录与自动配置状态机
58
+
59
+ 推荐新用户通过 `onboard` 完成登录、创建目标客户端专用 key 和写入配置:
60
+
61
+ ```sh
62
+ easymagic onboard codex --start --no-browser --json
63
+ easymagic onboard --resume ONBOARDING_ID --json
64
+ easymagic onboard --resume ONBOARDING_ID --wait --json
65
+ ```
66
+
67
+ `onboard [client]` 接受目标客户端配置选项,包括分组、模型、协议、配置目录及已知模型容量;它不接受手工推理 key。普通交互调用可以打开浏览器并等待。机器调用应优先 start/resume,保留返回的 `onboarding_id`,使用 `next_command` 继续。
68
+
69
+ 安全结果包含 `status`、`onboarding_id`、`next_command` 以及相应阶段的 `login` / `setup` 数据;并非所有字段在每个阶段都有值。
70
+
71
+ | `status` | 语义 |
72
+ | --- | --- |
73
+ | `authorization_pending` | 授权申请已建立或仍在等待用户确认;没有配置完成的含义 |
74
+ | `configured` | 自动配置已完成;使用 `setup` 结果确认文件和恢复编号 |
75
+ | `action_required` | 需要处理返回的问题或用户动作后继续,退出码 `1`,不能当作配置成功 |
76
+ | `expired` | 此授权流程已过期 |
77
+ | `denied` | 用户或服务端拒绝授权 |
78
+ | `cancelled` | 流程已取消 |
79
+
80
+ 完成后恢复同一个 `onboarding_id` 不应创建额外密钥。不要根据 stdout 有内容或退出码为 `0` 就跳过 `status` 检查。浏览器登录需要配套后端;服务端不支持时应明确回退到用户控制的 PAT 登录,而不是寻找密码登录的绕过接口。
81
+
82
+ `authorization_pending`、`authenticated`、`configured` 的退出码为 `0`;`cancelled`、`expired`、`denied`、`action_required` 为 `1`。`authenticated` 只表示单独的登录完成。`onboard --retry` 只用于已知失败或补齐参数后继续同一流程,不允许它重发结果未知的创建请求。
83
+
84
+ 独立登录支持非阻塞发起、检查/等待和取消:
85
+
86
+ ```sh
87
+ easymagic login --start --no-browser --json
88
+ easymagic login --resume FLOW_ID --json
89
+ easymagic login --resume FLOW_ID --wait --json
90
+ easymagic login --cancel FLOW_ID --json
91
+ ```
92
+
93
+ 只把安全授权链接、校验码和过期提示交给用户;设备秘密和获得的 PAT 留在 CLI 内部。用户应在网站完成登录、协议签署及确认,AI 不代填密码、恢复码或绕过验证。
94
+
95
+ 登录 pending 响应使用这些安全字段:`status`、`loggedIn`、`site`、`profile`、`flow_id`、`verification_url`、`user_code`、`expires_at`、`retry_after`、`next_command`。`expires_at` 是 ISO 时间,`retry_after` 单位是秒。认证成功返回 `authenticated`、`loggedIn: true`、站点/账号/凭据存储说明;不返回 PAT。取消/过期/拒绝结果没有可继续授权的 `next_command`。
96
+
97
+ ## 权限与后端限制
98
+
99
+ 以下是命令需要的主要权限,最终授权由网站后端决定:
100
+
101
+ | 操作 | 主要 PAT scope |
102
+ | --- | --- |
103
+ | 账户/分组信息、操作日志账号校验 | `profile:read` |
104
+ | 列表、详情、创建基线和写后回查 | `api_key:read` |
105
+ | 新建、修改、启停、删除 key | `api_key:write` |
106
+ | 查看完整 key、按 ID 自动写入 Agent 配置 | `api_key:reveal` |
107
+ | 用量和请求日志 | `usage:read` |
108
+
109
+ 完整自动配置通常需要前三项加 `api_key:reveal`。浏览器页面显示的请求权限应让用户核对。缺少 scope、账号类型受限、分组不可用、模型协议不匹配、未签 API key 协议、额度不足等,必须按后端拒绝处理。CLI 的预览不是授权保证。
110
+
111
+ 创建数量最多 `100`;导入最多 `1000` 条及 `5 MiB`。全量密钥查询最多 `100` 页;逐项批量结果不代表事务。额度输入按人民币,精确单位 `0.000002 CNY`,不能精确表达的数值会拒绝。
112
+
113
+ ## 服务端写入日志与重试
114
+
115
+ `keys` 写操作和自动配置创建/清理 key 使用本地操作日志。每次远端写入前,CLI 先落盘意图;日志保存站点、账户 ID、允许的策略字段和结果摘要,不保存 PAT 或完整推理 key。恢复时校验原始站点和账号。
116
+
117
+ | 条目 `state` | 含义 | 可用操作 |
118
+ | --- | --- | --- |
119
+ | `pending`、`attempts = 0` | 还未发送写请求 | `resume` 可以首次执行 |
120
+ | `pending`、`attempts > 0` | 尝试后进程可能中断 | 先按未知结果回查 |
121
+ | `succeeded` | 响应或回查证据确认成功 | 不重放 |
122
+ | `failed` | 明确拒绝或发送前失败 | 修正原因后可 `retry` |
123
+ | `unknown` | 已发起但结果不确定 | `reconcile`,禁止盲目创建重试 |
124
+
125
+ ```sh
126
+ easymagic operations show OPERATION_ID --json
127
+ easymagic operations reconcile OPERATION_ID --json
128
+ easymagic operations resume OPERATION_ID --dry-run --json
129
+ easymagic operations retry OPERATION_ID --dry-run --json
130
+ ```
131
+
132
+ 流程自行创建后又确认清理的密钥,允许在显式 `onboard --resume ID --retry` 后创建替代密钥;未知清理结果或普通 404 不会触发重建。
133
+
134
+ 真正 `resume`/`retry` 写入需要 `--yes`。`reconcile` 只读取服务端状态并更新本地日志。网络中断、写入超时或部分异常响应可能返回 `WRITE_OUTCOME_UNKNOWN`,此时不能直接重跑原始创建命令。
135
+
136
+ 创建回查会比较创建前同名 ID 基线、唯一新增候选、属性及时间证据;出现多个候选或缺少证据时维持 `unknown` 并提供候选 ID。服务端不支持幂等键,因此 CLI 不承诺 exactly-once,也不会自动重放未知创建。
137
+
138
+ 低层 `api POST/PUT/PATCH/DELETE` 虽要求 `--yes`,但不能依靠高层 `keys` 日志自动恢复;优先使用具名命令。日志恢复是继续或核对操作,不是撤销成功写入。
139
+
140
+ ## 客户端配置与验证边界
141
+
142
+ - `setup CLIENT --dry-run` 生成计划,不创建/揭示远端 key,不写客户端文件;仍可能查询账户、模型或密钥元信息。
143
+ - `setup CLIENT --create-key` / `onboard CLIENT` 可以创建服务端 key 并写配置;记录 `operation_id` 和 `restore_id`。
144
+ - 默认 setup 和 doctor 不发推理生成请求。显式 `--check` 才发最小推理,可能计费;不能与 dry-run 混用。
145
+ - `setup restore RESTORE_ID --yes` 恢复文件;检测到之后的人工修改会拒绝,只有显式 `--force` 才覆盖。恢复文件不会自动吊销 key。
146
+ - `setup all` 按客户端逐项完成,不提供跨客户端整体回滚;某项失败时保留其他成功项的结果和恢复编号。
147
+ - JSONC/YAML 尽量保留注释。完整 JSON5 可能规范化为 JSON,但原文保存在备份中。未知模型容量、价格或能力不应被杜撰成确定值。
148
+
149
+ 支持的 18 个 ID 和各自限制见 [AGENT_SUPPORT.md](AGENT_SUPPORT.md),当前机器检测见 `setup list --json`。适配器存在、文件契约测试通过、真实客户端能解析配置、真实服务推理成功是不同验证级别;只对已执行的级别作出结论。
150
+
151
+ ## 自动化调用必须遵循
152
+
153
+ 1. 从本次 schema 获取参数;从结果字段和退出码判断状态。
154
+ 2. 保留并使用原始 flow/onboarding/operation/restore 编号,不自行生成替代编号。
155
+ 3. 等待用户浏览器确认;不读取或绕过用户密码、MFA、Cookie 和协议确认。
156
+ 4. 未知写入先回查,重试只针对已确认失败项;不要以新创建命令掩盖不确定结果。
157
+ 5. 不把 `--json` 理解为秘密自动脱敏保证;显式 reveal 和低层 api 是敏感输出。
158
+ 6. 不把配置成功当成所有模型均可调用或计费测试已通过;报告验证范围及仍需用户执行的客户端内动作。
@@ -0,0 +1,38 @@
1
+ # Compatibility and validation
2
+
3
+ The package requires Node.js 22 or newer. The distribution is a bundled Node.js program; Bun is needed only to build or run the TypeScript test suite.
4
+
5
+ The CI matrix covers Node.js 22 and 24 on Linux, Windows, and macOS. Each job type-checks, runs offline regression tests, builds, installs the resulting npm tarball into a clean directory without network dependencies, and verifies its executable interface.
6
+
7
+ A separate client matrix runs installed Claude Code 2.1.332 and Codex CLI 0.172.0 against an isolated local HTTP/SSE fixture using temporary home/configuration directories. It checks that the real clients read the generated settings and actually send requests to that fixture. This verifies configuration and wire compatibility without production credentials. It does not claim that every model or older/newer client version is compatible.
8
+
9
+ On POSIX, configuration files, credential fallback files, exports, and operation journals use private permissions. Windows uses inherited ACLs for normal files and current-user DPAPI for the system credential mode. CI tests system keychain round-trips when the runner provides an available credential store. An unavailable store is reported separately from a successful round-trip.
10
+
11
+ The website device-login addition is tested independently against SQLite, MySQL, and PostgreSQL. See BACKEND_INTEGRATION.md for its exact revisions and verification results. The CLI retains manual PAT login for sites without that addition.
12
+
13
+ Actual CI run links and any remaining runner limitations are recorded in the delivery message. A configured workflow is not itself evidence that a platform has passed.
14
+
15
+ ## Observed validation for 0.2.0
16
+
17
+ - Linux x64: local Node.js 24, 70 regression tests and installed-client HTTP/SSE checks passed.
18
+ - CI Linux and Windows: Node.js 22 and 24 tests, credential-store checks and clean package install passed. Real installed Claude/Codex checks passed on both operating systems.
19
+ - CI macOS arm64: Node.js 22 on macOS 26 and Node.js 24 on macOS 15 passed tests, Keychain write/read/delete, and clean package install. Installed Claude/Codex passed on macOS 15. The supplementary standard-runner workflow completed the queued macOS coverage; redundant queued jobs were cancelled.
20
+ - Browser: real Chrome through Playwright approved a local device request and the waiting CLI saved the resulting PAT; desktop and mobile snapshots were captured.
21
+ - Backend: current source model/controller/router targeted tests and SQLite/MySQL/PostgreSQL transaction tests passed.
22
+
23
+ CI: https://github.com/XzlmTech/easymagic-cli/actions/runs/46471582237
24
+
25
+ Completed macOS supplementary run: https://github.com/XzlmTech/easymagic-cli/actions/runs/46472326890
26
+
27
+ The final local live-backend suite passed 20/20 checks, including forced response loss after a committed create, recovery without a duplicate, import/export, both inference protocols, and client configuration.
28
+
29
+
30
+ ## 0.3 agent configuration expansion
31
+
32
+ The 18-app registry and native configuration contracts are pinned to CC Switch 0afb1f26. All 18 configuration flows pass preview, protocol checks, initial write, repeat write with backups, and restoration in an isolated local fixture. The current regression suite has 113 passing tests.
33
+
34
+ Additional native Linux tests: Kimi Code 2.8.1 (Chat, Responses, Anthropic and Gemini), Gemini CLI 0.71.1 (Gemini), OpenCode 1.19.6 (all four protocols), and Pi 0.73.1 (all four protocols) read the generated configuration and returned local fixture output. These test scripts prevent production credential use and isolate client configuration directories. Unavailable desktop apps are validated by configuration contracts only.
35
+
36
+ Cross-platform 0.3 CI records are linked in the delivery, separately from the earlier 0.2 results above.
37
+
38
+ 0.3 platform verification: the main matrix passed all macOS/Linux jobs, Windows Node24, and installed Claude/Codex checks on all three systems: https://github.com/XzlmTech/easymagic-cli/actions/runs/46500583483 . Windows Node22 initially hit a cold-start timeout while opening the system credential store; after increasing that bounded Windows startup wait, the complete Windows Node22 regression/package/18-agent suite passed: https://github.com/XzlmTech/easymagic-cli/actions/runs/46500898004 .
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 EasyMagic contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.