Files
mnote/skills/mnote-vault/SKILL.md
T
Agent Board bc6f8488ee feat: vault core/CLI/workbench, vaultd token path, filetree view-state cleanup
Land password-vault dedicated workbench and mnote-vault-core/CLI, agent token
read path design, vault transport split, and retire obsolete filetree smokes.
Ignore local vault reimport scripts that trip secret scanners.
2026-07-24 11:36:06 +08:00

67 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: mnote-vault
description: >
MNote AI 密码本(多 agent 唯一策略)。读密与 login/sessionmnote-vault CLI + capability token(不依赖 mnote-web)。
禁扫 .mnote/vault 文件。
---
# MNote 密码箱 / AI 密码本
**SSOT**`/home/lix/.agent-infra/vault-policy.md`
**设计**`design/12-vault/process/12-2-vaultd-local-token-agent-read-path-v1.md`
## 读密稳态(P0 · 不依赖 mnote-web
二进制:`rust/target/debug/mnote-vault`(或 `cargo run -p mnote-vault --`)。
```bash
# 一次(人 / 安装):签发 token
cargo run -q -p mnote-vault --manifest-path rust/Cargo.toml -- issue-token --agent paseo --ttl 90d
# Agent 每次(已知 id
export MNOTE_VAULT_TOKEN_FILE="${MNOTE_VAULT_TOKEN_FILE:-$HOME/.config/mnote/vault-tokens/default.token}"
mnote-vault list
mnote-vault resolve --id <id> --field password
# 管道只要明文:
mnote-vault resolve --id <id> --field password --raw
```
| 命令 | 用途 |
|------|------|
| `doctor` | workspace / token / hmac 状态(无明文) |
| `issue-token` | 签发 capability token**不是** master key |
| `whoami` | 当前 token claims |
| `list` / `get` | L0 选型;无密码明文 |
| `resolve` | **唯一取密**;审计无 value |
| `login` | 复用未过期 session,或 api_first 出站登录并写回 session |
| `session` | 浏览器/人机验证后回写 Cookie(不启 3000 |
| `serve` | 可选 UDS vaultdCLI 默认 sock→内嵌 fallback |
**禁止**:为读密 / login / session 去 `auth-e2e` / 起 3000 / 用 cookie 调 `/api/vault/ai/*`
`scripts/mnote-vault-cli.js` 的 web 路径仅调试 UI。
## 登录稳态(P1d · 同样不依赖 mnote-web
需要外站 cookie 时:
```bash
# 优先复用已有 session(无 HTTP 出站)
mnote-vault login --id <id>
# human_required / CFchrome-bridge 登录后回写
mnote-vault session --id <id> --cookie-header 'name=value; …' --source human_bridge
# 强制重新 api_first 登录(忽略未过期 session
mnote-vault login --id <id> --force-refresh
```
- `resolve` / `session` 写盘:本地 `.mnote/vault/**`core)。
- `login``api_first` 仅对目标站出站 HTTP**不**经 mnote-web。
- Cloudflare / captcha → `mode=human_required` + `humanInstructions.cli`,完成后 `session` 回写。
## 硬规则
1. 禁 file 扫 `.mnote/vault/**`
2. 聊天不贴 password / cookie / token
3. Token `0600`;故障先 `issue-token`,不要默认起 3000