pi-robot-hand 0.3.0 → 0.3.2

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.0",
3
+ "version": "0.3.2",
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. 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:
13
+ 2. When the value is newly created on a web page and a browser session on the user's signed-in profile is already open to you, ask the user with your question tool whether you should prepare that page; starting a browser only to qualify does not count. When they agree, open it, fill in every field (name, scope, permissions, expiration), and stop at the button that creates the value. From then on make no browser tool call in that session, whatever `secret_drop` returns, until the user has closed that tab: browser tools return page content, and the value is on that page once the button is pressed. Learn that the tab is closed from the user, through your question tool, rather than from a browser call. A page that shows an existing secret already holds the value in its DOM, so give its `url` and steps instead of opening it. When the user declines or no such session is open, write the full steps.
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; for a prepared page, the tab, the button to press, what to copy, and closing the tab afterwards), 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,10 +19,10 @@ 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
- 3. Call it once per secret and wait for the result:
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
- - **Cancelled or aborted**: nothing was applied. Ask the user how to proceed.
25
+ - **Cancelled or aborted**: nothing was applied. Ask the user how to proceed; have the user revoke a token created on a prepared page that was not applied.
25
26
  - **Apply failed**: the staged value was discarded. Fix the parameters from the error (a regex that does not match, a failing command) and call again.
26
27
 
27
28
  When the user offers to paste a secret into chat, call `secret_drop` instead.
@@ -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 newly created on a web page and a browser session on the user's signed-in profile is already open to you, ask with your question tool whether to prepare that page up to its final create button, so the user only presses it and copies the value; then make no browser call in that session until the user tells you, when you ask, that the tab is closed, whatever secret_drop returns. Give the URL and steps instead of opening a page that shows an existing secret, and full steps when the user declines.",
200
201
  "When secret_drop returns a question from the user, answer it, then call secret_drop again.",
201
202
  ],
202
203
  parameters: Params,