pi-robot-hand 0.3.0 → 0.3.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-robot-hand",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "The lazy kit for pi: no IDE, no copy-paste, safety net still on. The agent hands you commands (prompt, clipboard, or a Herdr pane that reports back), answers your ! commands, and takes secrets through a masked dialog it never sees",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,8 @@ Secrets reach files and commands through the `secret_drop` tool, so the value ne
|
|
|
10
10
|
## Writing a secret
|
|
11
11
|
|
|
12
12
|
1. Pick the destination the consuming program expects. For a `regex` placement in a file that is not yet protected, read its structure first.
|
|
13
|
-
2.
|
|
13
|
+
2. When the value is created or revealed on a web page and you can drive the user's own browser, where they are signed in, first ask the user whether you should prepare that page. When they agree, open it, fill in every field (name, scope, permissions, expiration), and stop at the button that creates or reveals the value; your `instructions` then say which button to press in which tab and what to copy. Once that button is pressed the value is on screen, so leave the tab alone (no snapshot, screenshot, or page text) until `secret_drop` reports the value applied, then close it. When the user declines or no browser is available, write the full steps for them to follow.
|
|
14
|
+
3. Call `secret_drop` with a `label` naming exactly what to enter (service, account, environment), `instructions` the user can follow without asking (the exact page or menu path, every field to fill in such as name, scope, permissions, and expiration, and what to copy), the page as `url` when there is one, both in the user's language, and one format:
|
|
14
15
|
- `key` + `destination` (format `env`): sets `KEY=value`, replacing existing `KEY` / `export KEY` lines or appending one. Other lines and trailing comments stay. For a file read by `docker --env-file`, pass `quote: "none"`, since Docker keeps quotes as part of the value.
|
|
15
16
|
- `format: "regex"` + `destination` + `regex`: replaces capture group 1, or the whole match, in an existing file. Make the group cover only the value, e.g. `password: "([^"]*)"`.
|
|
16
17
|
- `format: "file"` + `destination`: the whole file is the secret, for key files and single-value files. An existing destination is refused unless `overwrite: true` is passed; pass it only to rotate a single-value file, never for a multi-value file such as `.env`.
|
|
@@ -18,7 +19,7 @@ Secrets reach files and commands through the `secret_drop` tool, so the value ne
|
|
|
18
19
|
- `ansible-vault encrypt_string --vault-password-file .vault-pass --stdin-name db_password < {secret} >> group_vars/prod/vault.yml`
|
|
19
20
|
- `gh secret set DEPLOY_TOKEN < {secret}`
|
|
20
21
|
- `kubectl create secret generic app-tls --from-file=tls.key={secret}`
|
|
21
|
-
|
|
22
|
+
4. Call it once per secret and wait for the result:
|
|
22
23
|
- **Applied**: the report states the change and `length check passed (N chars)`. That report is the verification; the value is in place.
|
|
23
24
|
- **Question**: the user pressed Tab and asked instead; nothing was staged. Answer it, then call `secret_drop` again.
|
|
24
25
|
- **Cancelled or aborted**: nothing was applied. Ask the user how to proceed.
|
package/src/secret-drop/index.ts
CHANGED
|
@@ -197,6 +197,7 @@ export default function secretDrop(pi: ExtensionAPI) {
|
|
|
197
197
|
"Use secret_drop whenever a password, token, key, or other credential must land in a file or be fed to a command; never ask the user to paste secrets into chat.",
|
|
198
198
|
"Files that hold secrets are consumed by programs, never read or printed by the agent.",
|
|
199
199
|
"Give secret_drop instructions the user can follow without asking: the exact page or menu, every field to fill in, and what to copy; write them and the label in the user's language.",
|
|
200
|
+
"When the secret is created or revealed on a web page and you can drive the user's signed-in browser, first ask whether to prepare that page up to its final create or reveal button, so the user only presses it and copies the value; after that press, leave the tab unread until the value is applied.",
|
|
200
201
|
"When secret_drop returns a question from the user, answer it, then call secret_drop again.",
|
|
201
202
|
],
|
|
202
203
|
parameters: Params,
|