@agentpro/mixer
v0.36.1
Published
MIXER — observable signed OTA, privacy-safe support reports, Account Registry v5, and verified multi-model execution. Zero-dep.
Readme
MIXER — bàn điều khiển AI-CLI
Nhiều engine (claude · codex · grok · antigravity · ollama) vào một bàn điều khiển: resolve đúng binary (né PATH trap), ghim version, auth, provider-authoritative quota pre-flight, circuit breaker, typed error kèm fix.action máy đọc được, dọn process mồ côi. Local observed usage và local safety budget được tách riêng khỏi quota provider; unknown không được hiểu là còn dư hay đã hết.
Zero dependency. Node ≥ 20.
Nhờ nó, đứng ở Claude vẫn với sang ChatGPT tạo ảnh, sang Grok tạo ảnh/video + thoại Việt lip-sync — và ngược lại. Exec v2 băm cả media input lẫn artifact output; từ 0.33.0 có thêm media bridge per-job dùng chung cho subscription CLI. Từ 0.34.0, Account Registry v5 hợp nhất email trùng, hỗ trợ CRUD có archive/restore nội bộ, preset model/effort/speed và lệnh semantic $swap <email> [model] [effort] [speed]. Từ 0.34.1, Account Swap dùng danh sách gọn cho 5–10 tài khoản; thao tác archive được diễn đạt với user là “Gỡ khỏi MIXER” và luôn có thể khôi phục. Từ 0.35.0, người dùng mới cài bằng một lệnh npm; 0.35.1 làm lệnh này hiện tiến trình, chặn treo và bảo đảm OTA chuẩn bị Codex settings component trước khi thay runtime. Từ 0.36.0, trang Hệ thống hiện tiến trình OTA theo bước thật, tự nối lại sau khi dịch vụ thay phiên bản, và tạo bản báo lỗi đã lọc dữ liệu nhạy cảm để user xem trước rồi tự gửi; 0.36.1 làm checksum release portable, không còn nhúng đường dẫn máy build. Antigravity đã nhận catalog Gemini 3.8 Flash nhưng video vẫn fail-closed tới khi có 2 live receipt liên tiếp PASS; Grok video trên account Zero Data Retention cần output storage S3-compatible do user cấu hình.
Cài một lệnh
Yêu cầu Node.js 20 trở lên trên macOS hoặc Linux:
npx --yes --no-audit @agentpro/mixer@latest setupLệnh này hiện tiến trình ngay trên màn hình; kiểm tra chữ ký release, buộc version npm và artifact trùng nhau, kiểm tra SHA-256, chuẩn bị Codex settings component có timeout rồi mới chạy installer archive-before-replace. Tài khoản, token và lịch sử quota không nằm trong gói npm.
⚠️ NGUỒN SỰ THẬT
| | |
|---|---|
| Canonical | repo này — github.com/LeHungViet/mixer (local ~/Dev/mixer) |
| Bản đang chạy | ~/.mixer/mcp/engine — cài từ bundle, không sửa trực tiếp ở đó |
| DragonOS/packages/mixer | SUPERSEDED từ 2026-08-07. Còn nằm đó cho apps/foresee build được; cấm sửa. Xem _SUPERSEDED.md trong thư mục đó. |
Tách khỏi monorepo DragonOS ngày 2026-08-07 (giữ nguyên 24 commit lịch sử qua git subtree split). Lý do: mixer là hạ tầng dùng chéo — Cowork plugin, Codex, các CLI, máy khác — không phải một app của DragonOS. Ở chung khiến mỗi ca sửa mixer phải clone cả monorepo và bị kéo theo trục trặc của nó.
Dùng
MCP tools (qua plugin, trong Cowork / Claude Code / Codex): mixer_status · mixer_exec_start · mixer_exec_status · mixer_exec_cancel · mixer_doctor · mixer_checkauth · mixer_reauth_plan · mixer_reap.
App API (không mở thêm tool cho agent): chat(engine, options, onEvent) cho phiên chat stream/resume và meter.usage() · billing() · auth() · quotaState() · models() · cliVersion() · pricing(). Xem docs/MIXER-CHAT-METER-V1.md.
CLI:
node bin/mixer.js status --pretty
node bin/mixer.js status --json
node bin/mixer.js exec --request /absolute/path/request.json
node bin/mixer.js exec --request - < request.json
node bin/mixer.js doctor --fix
node bin/mixer.js conformance codex --deepAccount Registry v5 cho Codex giữ nhiều phiên đăng nhập tách biệt và chỉ đổi khi
người dùng ra lệnh. Email là định danh chính; profile nội bộ có home riêng tại
~/.mixer/profiles/codex/<name>. MIXER không sao chép auth và không tự đổi tài khoản
khi hết quota.
Trong Composer, $swap là lệnh chính và nhận trực tiếp email, model, effort, speed;
$swap-account tiếp tục hoạt động như alias tương thích. Không có tham số thì skill
liệt kê toàn bộ account ngay trong chat, đồng thời có lựa chọn LOCALHOST để mở trang
Account Swap và ADD để thêm tài khoản.
MIXER tự mở đăng nhập Codex trong trình duyệt, tự đặt tên profile, xác minh email
và nạp toàn bộ catalog model/effort; người dùng không phải mở Terminal. Lệnh này
đổi account cấp quota cho cuộc chat Codex hiện tại, MIXER, TeamCode và QA; Codex
reload để nhận credential mới nhưng giữ nguyên harness, context, session và skill.
$swap-harness là thao tác riêng để đổi toàn bộ giao diện, context, session và skill.
node bin/mixer.js controller onboard
node bin/mixer.js controller add codexT
node bin/mixer.js controller login codexT
node bin/mixer.js controller select codexT
node bin/mixer.js controller current
node bin/mixer.js controller list
node bin/mixer.js controller swap [email protected]
node bin/mixer.js controller swap [email protected] sol medium fast
node bin/mixer.js controller preset [email protected] sol medium fast
node bin/mixer.js controller refresh [email protected]
node bin/mixer.js controller reauth [email protected]
node bin/mixer.js controller archive [email protected]
node bin/mixer.js controller archives
node bin/mixer.js controller restore <archive-id>
node bin/mixer.js controller harness [email protected]Trong chat có skill mixer-use, dùng $mixer-use controller codexT. Task đang chạy
được ghim vào profile lúc bắt đầu; task kế tiếp mới nhận lựa chọn mới. Chi tiết và
acceptance: docs/changes/CS1-CONTROLLER-SWAP-CODEX.md.
Preset model/effort/speed là tùy chọn theo tài khoản. Model mà caller ghi rõ cho một
task vẫn được ưu tiên và không bị preset ghi đè.
mixer exec là cửa thực thi duy nhất từ 0.23.0: live auth bằng đúng binary/profile,
JSONL event tức thời, timeout tách bạch, cancel cả cây process, resume khóa provenance
và receipt bền vững. Request không nhận raw argv/env/tool/permission flag. Schema và
error taxonomy: docs/MIXER-EXEC-V1.md.
Cây thư mục
lib/ core + hai lane độc lập: chat · meter
bin/mixer.js CLI universal
manifests/ 1 file/engine — version pin, auth flow, run template, error signatures, quota
plugin/ payload chung: Claude/Codex manifests + MCP + mixer-use + swap + swap-account + swap-harness
tools/ sign-manifest · autobump · build plugin/friend release · ota-pack
test/ acceptance · runtime · regression · mutation, chạy bằng `npm test`
dist/ artefact build (gitignored)Tự cập nhật engine
tools/autobump.mjs chạy nền hằng tuần (LaunchAgent tech.agentpro.mixer-autobump, thứ Hai 09:30):
dò bản mới → bump known_good → ký OTA → provision → conformance --deep
├─ PASS: giữ
└─ FAIL: rollback + notify- Chạy tay:
node tools/autobump.mjs [--check-only] [--engine <id>] - Kill-switch:
touch ~/.mixer/AUTOBUMP-OFF(hoặcMIXER_AUTOUPDATE=off) - Budget cap: 4 engine/lượt
- Log:
~/.mixer/logs/mixer-autobump.log(JSONL)
⇒ Thấy version_drift trong mixer_status thì đừng tự hạ cấp CLI — để autobump xử.
Publish
Hai kênh, đừng lẫn.
1. Engine manifest (known_good + config từng engine) — mọi runtime MIXER poll về:
node tools/sign-manifest.mjs # → dist/ota/engines-manifest.json + .sigCần private key ~/.mixer/keys/engine-ota-private.pem (đường cũ ~/.dragon/keys/engine-ota-private.pem chỉ là fallback tương thích; public key ghim cứng trong lib/ota.js).
Artifact ký được tạo hoàn toàn trong repo MIXER và phát hành cạnh runtime tại kênh mixer-releases; runtime mới không phụ thuộc domain của sản phẩm khác.
2. Runtime tgz:
bash tools/ota-pack.sh # → dist/ota/mixer-<ver>.tgz + manifest.json3. Plugin chia sẻ cho Claude và Codex:
bash tools/build-friend-release.sh
# → dist/mixer-claude.plugin
# → dist/mixer-codex.zipmixer-claude.plugin cài qua Cowork Settings → Plugins hoặc Claude Code /plugin.
mixer-codex.zip là local marketplace cho ChatGPT/Codex desktop; giải nén và làm
theo INSTALL.md bên trong. Cả hai gói đều tự mang runtime và các skill $swap,
$swap-account, $swap-harness.
Khi runtime plugin khởi động, trang quản lý account ở http://localhost:48124 tự
chạy trên loopback. Picker đọc toàn bộ model của account được chọn rồi nạp toàn bộ
effort hợp lệ của model đó; không khóa theo model mặc định của bản phát hành.
Build chỉ phát hành từ checkout Git sạch và nhúng SOURCE.json cùng
MANIFEST.sha256 để khóa version, commit và byte parity.
4. Release OTA cho máy người dùng:
bash tools/build-release-ota.sh
# → dist/release/install.sh
# → dist/release/release-manifest.json + .sig
# → dist/release/mixer-<version>.tgz
# → dist/release/engines-manifest.json + .sigKênh release tách khỏi OTA engine-manifest hiện có. Trang Account Swap chỉ báo có bản mới sau khi manifest ký Ed25519 hợp lệ và chỉ cài artifact khớp SHA-256. Bản cũ được archive trước khi installer đồng bộ runtime, plugin Codex và skills. Kênh public artifact chỉ được publish khi có grant Production riêng.
5. Bootstrap npm:
npm run pack:check
npm pack --ignore-scriptsPackage @agentpro/mixer chỉ mang CLI/runtime public đã allowlist. Việc npm publish là Production action riêng; source checkout, runtime đang chạy và release public là ba trạng thái độc lập.
Test
npm testnode --test, không cần dependency ngoài. Acceptance mixer-exec/v1 gồm A01–A26;
Chat/Meter gồm C01–C13 + M01–M12; Controller Swap gồm CS01–CS09 và mutation
CSM01–CSM08; các mutation runner phải giết toàn bộ mutant tương ứng.
