@celljs/ta-secrets 0.0.0-stage → 4.18.0
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.
- package/README.en.md +22 -0
- package/README.md +22 -2
- package/extension/index.mjs +742 -0
- package/host/index.mjs +1388 -0
- package/package.json +65 -4
- package/web/index.js +593 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Cell - Ta Secrets
|
|
2
|
+
|
|
3
|
+
A pi package that comes with Ta (on by default, off in Settings → Extensions): the vault. Tokens, passwords, keys and personal details go to Ta to use, not to the model. Design in `docs/design/ta-secrets.md`.
|
|
4
|
+
|
|
5
|
+
- **Kept**: values in the login keychain of macOS (service `Ta secrets`); elsewhere, or with `TA_SECRETS_STORE=file`, in `secrets/vault.json` of the agent directory, which only you read.
|
|
6
|
+
- **Names**: each has one (`GITHUB_TOKEN`); the model sees `$TA_SECRET_GITHUB_TOKEN`.
|
|
7
|
+
- **Keep secrets I send**: tokens, private keys, passwords of URLs and `password=…` in a message go into the vault before the model reads it, the message holding their names (off in Settings → Vault).
|
|
8
|
+
- **Personal details**: phone numbers, emails, ID numbers and bank cards (told by their check digits) go into the vault too, the model seeing a name and a masked hint (`138****5678`); where a tool's arguments (a file written, a form, a message) name one, Ta puts the detail in as it runs. Off in Settings → Vault.
|
|
9
|
+
- **Asked for**: Ta calls `request_secret({ name, purpose })` for a missing one; you type it in a dialog, not the conversation.
|
|
10
|
+
- **Used**: a bash command writes `"$TA_SECRET_GITHUB_TOKEN"`, and only that command gets the value, sourced from a file only you read, removed as it starts; the conversation keeps the command as written.
|
|
11
|
+
- **Only to its hosts**: a secret bound to hosts (tokens of GitHub, GitLab and Gitee are by default) is a placeholder in the command, whose HTTPS goes through Ta's proxy on this computer, which puts the value in (headers and URL) for those hosts alone; commands running git get tokens so too. Needs `openssl`.
|
|
12
|
+
- **SSH**: private keys are held by an ssh-agent of each command that may connect (ssh, scp, rsync, git), never a variable, ended with it.
|
|
13
|
+
- **Lately used**: which secrets each command was given, how, the command and the conversation, in Settings → Vault.
|
|
14
|
+
- **Wiped**: values in tool results and in what goes to the model (as written, base64, URL-encoded) become their names.
|
|
15
|
+
|
|
16
|
+
## Data and calls
|
|
17
|
+
|
|
18
|
+
Package data (`@celljs/ta-secrets`): `entries` (`{ name, kind, note?, source, createdAt, usedAt?, uses? }[]`, no values), `capture` (`false`: what you send is not taken), `personal` (`false`: personal details are not taken), `uses` (the latest 100 uses, no values).
|
|
19
|
+
|
|
20
|
+
Methods of the host (`pi.host`), called by the web extension with `callHost`, none giving a value: `info()`, `list()`, `add({ name, value, kind?, note? })`, `remove(name)`, `capturing()`, `setCapturing(on)`, `capturingPersonal()`, `setCapturingPersonal(on)`, `uses()`.
|
|
21
|
+
|
|
22
|
+
Not yet: commands in a folder of a remote host (`ssh://`) do not get values.
|
package/README.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cell - Ta Secrets
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):保险箱。Token、密码、密钥、手机号这类信息交给 Ta 用,但不交给模型。设计见 `docs/design/ta-secrets.md`。
|
|
4
|
+
|
|
5
|
+
- **存**:值在 macOS 的登录钥匙串里(服务名 `Ta secrets`);别的系统,或设了 `TA_SECRETS_STORE=file`,在 agent 目录的 `secrets/vault.json`(只有你能读)。
|
|
6
|
+
- **名字**:每条一个名字(`GITHUB_TOKEN`),模型看到的是 `$TA_SECRET_GITHUB_TOKEN`。
|
|
7
|
+
- **收起你发出的密钥**:消息里的 token、私钥、URL 里的密码、`password=…` 在模型读到之前收进保险箱,消息里换成名字(设置 → 保险箱 可关)。
|
|
8
|
+
- **个人信息**:手机号、邮箱、身份证号、银行卡(按校验位识别)也先收进保险箱,模型只看到名字和打码后的样子(`138****5678`);Ta 写文件、填表、发消息等任何工具的参数里用到名字时,执行那一刻填回真值。设置 → 保险箱 可关。
|
|
9
|
+
- **向你要**:缺一个时 Ta 调 `request_secret({ name, purpose })`,弹框让你输入,值不进对话。
|
|
10
|
+
- **用**:bash 命令里写 `"$TA_SECRET_GITHUB_TOKEN"`,Ta 只给这一条命令值(从只有你能读、随即删除的临时文件里读入);会话里存的是原命令。
|
|
11
|
+
- **只发往绑定的主机**:给密钥绑定主机后(GitHub、GitLab、Gitee 的 token 默认绑定),命令里拿到的只是占位,它的 HTTPS 经 Ta 本机的代理出去,代理只对这些主机把占位换成真值(请求头和 URL);运行 git 的命令也这样自动拿到 token。需要本机有 `openssl`。
|
|
12
|
+
- **SSH**:私钥由每条可能连 SSH 的命令(ssh、scp、rsync、git)自己的 ssh-agent 持有,不进环境变量,命令结束 agent 就关掉。
|
|
13
|
+
- **最近使用**:每次给出密钥都记下哪些、怎么给的、命令和对话,设置 → 保险箱 里能看到。
|
|
14
|
+
- **Ta 自己用的登录**:远程桌面的账号密码由 Ta 服务经 `TaExtensionHost.credentials` 存取(类型 `sign-in`),列在保险箱里可删;不告诉模型,命令里点名会被拒,页面也建不了这一类。
|
|
15
|
+
- **擦**:工具结果和发给模型的内容里出现的值(原文、base64、URL 编码)都换成名字。
|
|
16
|
+
|
|
17
|
+
## 数据与调用
|
|
18
|
+
|
|
19
|
+
包数据(`@celljs/ta-secrets`):`entries`(`{ name, kind, note?, source, createdAt, usedAt?, uses? }[]`,不含值)、`capture`(`false` 时不收起发出的密钥)、`personal`(`false` 时不收起个人信息)、`uses`(最近 100 次使用,不含值)。
|
|
20
|
+
|
|
21
|
+
包宿主(`pi.host`)的方法,Web 扩展经 `callHost` 调用,都不返回值:`info()`、`list()`、`add({ name, value, kind?, note? })`、`remove(name)`、`capturing()`、`setCapturing(on)`、`capturingPersonal()`、`setCapturingPersonal(on)`、`uses()`。
|
|
22
|
+
|
|
23
|
+
暂不支持:远程主机(`ssh://`)目录里的命令拿不到值。
|