paseo-plugin-secure-input 0.2.2 → 0.3.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/OVERVIEW.md CHANGED
@@ -21,8 +21,14 @@ The agent has four tools, which Paseo serves beside its own: `request_secret` to
21
21
 
22
22
  ## When the files go
23
23
 
24
- The plugin writes directories of mode 0700 with files of mode 0600, one per key you filled in. It tries to delete them when the agent releases the set, at the end of the agent's turn that its message starts, 15 minutes after the write, and at every start and stop of the plugin. A crash or a failed removal can leave files behind until a later attempt succeeds. Deletion does not overwrite their content.
24
+ The plugin writes directories of mode 0700 with files of mode 0600, one per key you filled in. It tries to delete them when the agent releases the set, at the end of the agent's turn that its message starts, when the agent is archived, 15 minutes after the write, and at every start and stop of the plugin. A crash or a failed removal can leave files behind until a later attempt succeeds. Deletion does not overwrite their content.
25
25
 
26
26
  ## What it does not protect against
27
27
 
28
28
  While a file exists, any process of your OS user can read it, the agent included, and on Paseo 0.14.0-beta.1 a local process with access to the daemon can impersonate an agent. What keeps a value out of the model is the skill's rule and the plugin leaving values out of its outputs. [SECURITY.md](https://github.com/dutchakdev/paseo-plugin-secure-input/blob/main/SECURITY.md) describes the threat model and known limitations.
29
+
30
+ ## Other plugins by dutchakdev
31
+
32
+ - [Account Switcher](https://paseo.sh/plugins/dutchakdev/account-switcher): several Claude and ChatGPT/Codex subscription accounts in Paseo, with an account per agent, switching of an existing chat, and every account's limits.
33
+ - [Machine Status](https://paseo.sh/plugins/dutchakdev/machine-status): load, memory, disk, the ports and processes your agents started, and Docker on the daemon's Mac, with dev-cache cleanup and confirmed process stops.
34
+ - [Mermaid](https://paseo.sh/plugins/dutchakdev/mermaid): draws Mermaid flowcharts and sequence diagrams from chat messages and `.mmd` files, on desktop and mobile.
package/README.md CHANGED
@@ -75,6 +75,7 @@ Each delivery is `<data>/drop/si-secret-<requestId>/` with a file per key you fi
75
75
 
76
76
  - The agent calls `release_secret`, or deletes the directory itself.
77
77
  - The end, with any outcome, of the agent's turn that its delivery message starts.
78
+ - The agent is archived.
78
79
  - 15 minutes after the write; on a machine that slept through that, within a minute of waking.
79
80
  - The plugin starts, and sweeps `drop/`.
80
81
  - The plugin stops, and tries to sweep `drop/`.
@@ -101,6 +102,12 @@ What you enter leaves the app only sealed to a one-time key of the request. The
101
102
 
102
103
  Running from a checkout, the tests, the documents they hold to the code, and releases: [CONTRIBUTING.md](CONTRIBUTING.md). [CHANGELOG.md](CHANGELOG.md) lists what each release changed.
103
104
 
105
+ ## Other plugins by dutchakdev
106
+
107
+ - [Account Switcher](https://paseo.sh/plugins/dutchakdev/account-switcher) ([source](https://github.com/dutchakdev/paseo-plugin-account-switcher)): several Claude and ChatGPT/Codex subscription accounts in Paseo, with an account per agent, switching of an existing chat, and every account's limits.
108
+ - [Machine Status](https://paseo.sh/plugins/dutchakdev/machine-status) ([source](https://github.com/dutchakdev/paseo-plugin-machine-status)): load, memory, disk, the ports and processes your agents started, and Docker on the daemon's Mac, with dev-cache cleanup and confirmed process stops.
109
+ - [Mermaid](https://paseo.sh/plugins/dutchakdev/mermaid) ([source](https://github.com/dutchakdev/paseo-plugin-mermaid)): draws Mermaid flowcharts and sequence diagrams from chat messages and `.mmd` files, on desktop and mobile.
110
+
104
111
  ## License
105
112
 
106
113
  MIT, see [LICENSE](LICENSE).
package/SECURITY.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Over the relay or Tailscale, with an honest but careless agent:
6
6
 
7
7
  - **On its way, a value is sealed.** What you type, pick, drop or paste leaves the app only as ciphertext, sealed to a one-time key of the request (X25519, HKDF-SHA256, ChaCha20-Poly1305) and bound to the request's id and to a digest of the keys it declared and whether each is optional. A file travels as base64url inside the same sealed payload. If sealing fails, nothing is sent.
8
- - **On the daemon, a value is a short-lived file.** On disk it exists in the clear only under `drop/`: as `<data>/drop/si-secret-<requestId>/<KEY>`, a file of mode `0600` in a directory of mode `0700`, or, after a failed write, under a temporary name there. The plugin deletes a set 15 minutes after the write at the latest while the machine is awake, and within a minute of waking when it slept through that; earlier when the agent releases it, at the end of the turn its delivery message starts, and at every start and stop of the plugin. A crash, a stalled disk or a failed removal can keep it longer ([below](#crashes-stops-and-restarts)).
8
+ - **On the daemon, a value is a short-lived file.** On disk it exists in the clear only under `drop/`: as `<data>/drop/si-secret-<requestId>/<KEY>`, a file of mode `0600` in a directory of mode `0700`, or, after a failed write, under a temporary name there. The plugin deletes a set 15 minutes after the write at the latest while the machine is awake, and within a minute of waking when it slept through that; earlier when the agent releases it, at the end of the turn its delivery message starts, when the agent is archived, and at every start and stop of the plugin. A crash, a stalled disk or a failed removal can keep it longer ([below](#crashes-stops-and-restarts)).
9
9
  - **Outputs and metadata.** No tool result, message to the agent, pill, status, RPC answer, log line, error, `requests.json` or `outbox.json` holds a value; the agent is given paths. Plaintext also exists for a while in app and daemon memory (below).
10
10
  - **The daemon names who asks.** A request belongs to the agent identity Paseo supplies with the tool call; nothing the call itself says is read. Of the four tools, status, cancel and release answer any other agent, its parent included, as if the request did not exist. On Paseo 0.14.0-beta.1 a local process with access to the daemon can impersonate an agent ([below](#a-hostile-process-that-runs-as-you)); the plugin cannot verify that the named agent made the call.
11
11
 
@@ -55,7 +55,7 @@ An agent with a shell runs as your OS user, controls its workspace, and can read
55
55
  | A disk that stalls holds up the plugin's work queue | Every deletion but the stop's sweep waits in that queue, the deadline's included, so for as long as the disk stalls a set can outlive its deadline. A tool call waits there for its turn for at most 10 seconds and is then refused, `the plugin is busy; retry in a few seconds`; what it asked for is not done later. An operation that has begun is waited for to the end |
56
56
  | The plugin restarts while a request waits for you | The request becomes `expired`, because the key to open it lived in memory only. The agent is told that the restart ended it, as soon as a hook runs or the app reconnects |
57
57
  | The plugin restarts while a set exists | The start's sweep removes it, and the request reads `released` (`restart`). A delivery message that still waits becomes the message that the files went when the plugin restarted; one already sent is not sent again. A set the sweep cannot remove keeps its request `delivered`, and «Секрети на сервері» red, until it goes; a delivery message that goes out meanwhile gives the paths of the files that are still there |
58
- | A message to the agent is late or lost | A message for a busy agent waits for the agent to become idle, within the bounds below; a failed or unanswered idle check leaves it waiting. The plugin checks that the agent is idle and then sends, so a turn that starts between the two can be interrupted. Each send is attempted at most once; a message can be lost when the plugin dies before it was saved, or dies or is stopped between taking it out of `outbox.json` and the end of the send; when the send fails or is not answered in time; when it waited past the queue's age or count limit, or the clock was set back while it waited; when the agent is archived; when the plugin no longer has the request it is about (`requests.json` unreadable at a start, or the request evicted from the history); when a stop ran out of its time before the change of state was saved; or when `outbox.json` was replaced by something the plugin did not write. A message about delivered files is not sent at all when the agent released those files first. The agent may then need a nudge from you |
58
+ | A message to the agent is late or lost | A message for a busy agent waits for the agent to become idle, within the bounds below; a failed or unanswered idle check leaves it waiting. The plugin checks that the agent is idle and then sends, so a turn can start between the two. The message then joins that turn where the agent's provider can steer it, and replaces that turn where it cannot. Files named by a message that joined a turn go at the end of the agent's next turn rather than that one, or at their deadline. Each send is attempted at most once; a message can be lost when the plugin dies before it was saved, or dies or is stopped between taking it out of `outbox.json` and the end of the send; when the send fails or is not answered in time; when it waited past the queue's age or count limit, or the clock was set back while it waited; when the agent is archived; when the plugin no longer has the request it is about (`requests.json` unreadable at a start, or the request evicted from the history); when a stop ran out of its time before the change of state was saved; or when `outbox.json` was replaced by something the plugin did not write. A message about delivered files is not sent at all when the agent released those files first. After a send that the daemon refused, a later turn does not delete the files: they stay until their deadline, and `request_status` gives their paths. A send left unanswered counts as delivered, and the end of the agent's next turn deletes them. The agent may then need a nudge from you |
59
59
  | The plugin is stopped while messages or pills wait | No further pill is put on a timeline, and no agent is asked whether it is idle. A message that was not sent stays in `outbox.json` for the next start. A change of state whose save was still under way when the stop ran out of its time is saved and announced by nobody: no message for it, and the pill goes on showing the state before it. The form behind the pill shows the true state |
60
60
  | A pill cannot be put on the agent's timeline | The pill is the only way to the form, so it is tried again once a minute and whenever the daemon next calls the plugin, until it lands, and only once in five minutes while the daemon has left three appends of it unanswered. Until then nobody can answer the request |
61
61
  | The plugin is removed, or never starts again | What the next start would have swept stays in `drop/`: the sets of a run that was killed, and what a failed write left. Nothing else of the plugin's holds a value |
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "paseo-plugin-secure-input",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "paseo-plugin-secure-input",
9
- "version": "0.2.2",
9
+ "version": "0.3.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@noble/ciphers": "2.4.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paseo-plugin-secure-input",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Secure secret input for Paseo agents: a typed value or a whole file travels sealed to the daemon and lands in a short-lived file; the agent gets its path, never the value",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -103,6 +103,8 @@ export interface OutboxOptions {
103
103
  * with changes nothing here: the send is attempted all the same.
104
104
  */
105
105
  onSend?(item: OutboxItem): void;
106
+ /** Told of an item whose send was refused within its bound; not of one that went unanswered. What it does, throws or rejects with changes nothing here. */
107
+ onSendFailed?(item: OutboxItem): void;
106
108
  }
107
109
 
108
110
  const ItemSchema = z
@@ -224,6 +226,7 @@ export class Outbox {
224
226
  private readonly portTimeoutMs: number;
225
227
  private readonly flushBudgetMs: number;
226
228
  private readonly onSend: ((item: OutboxItem) => void) | undefined;
229
+ private readonly onSendFailed: ((item: OutboxItem) => void) | undefined;
227
230
 
228
231
  constructor(
229
232
  private readonly file: string,
@@ -234,6 +237,7 @@ export class Outbox {
234
237
  this.portTimeoutMs = options.portTimeoutMs ?? PORT_TIMEOUT_MS;
235
238
  this.flushBudgetMs = options.flushBudgetMs ?? FLUSH_BUDGET_MS;
236
239
  this.onSend = options.onSend;
240
+ this.onSendFailed = options.onSendFailed;
237
241
  }
238
242
 
239
243
  private serial<T>(task: () => Promise<T>): Promise<T> {
@@ -402,6 +406,16 @@ export class Outbox {
402
406
  }
403
407
  }
404
408
 
409
+ /** Tells `onSendFailed` of an item whose send failed. Never throws, and leaves no rejection of an async one unhandled. */
410
+ private tellSendFailed(item: OutboxItem): void {
411
+ try {
412
+ const result: unknown = this.onSendFailed?.({ agentId: item.agentId, requestId: item.requestId, kind: item.kind });
413
+ if (typeof (result as PromiseLike<unknown> | undefined)?.then === "function") (result as PromiseLike<unknown>).then(undefined, () => undefined);
414
+ } catch {
415
+ // What whoever is told does with it changes nothing: the message is not sent again either way.
416
+ }
417
+ }
418
+
405
419
  /** The text for an item, or null: no record, nothing to say, another agent's record, or a resolver that fails. */
406
420
  private text(item: OutboxItem): string | null {
407
421
  try {
@@ -547,6 +561,7 @@ export class Outbox {
547
561
  await this.ask(() => port.send(item.agentId, text));
548
562
  } catch {
549
563
  // The send failed. Whether the agent got the message is not known, and it is not sent again.
564
+ this.tellSendFailed(item);
550
565
  }
551
566
  // No answer in time is an unknown outcome: the item is already out, and is not sent again either.
552
567
  return;
@@ -36,11 +36,12 @@ export type ExpiredBy = (typeof EXPIRED_BY)[number];
36
36
 
37
37
  /**
38
38
  * How the files of a delivered request came to be gone, and so the request `released`: the agent released them or took
39
- * the set away itself (`agent`), the turn the delivery message started ended (`turn`), their time was up (`time`), the
40
- * plugin started again (`restart`) or stopped (`stop`), or the human deleted every set (`human`). A delivery message
41
- * that still waits says the files are gone for the last four, and is dropped for the first two (see `continuationText`).
39
+ * the set away itself (`agent`), the turn the delivery message started ended (`turn`), the agent was archived (`archived`),
40
+ * their time was up (`time`), the plugin started again (`restart`) or stopped (`stop`), or the human deleted every set
41
+ * (`human`). A delivery message that still waits says the files are gone for the last four, and is dropped for the first
42
+ * three (see `continuationText`).
42
43
  */
43
- export const RELEASED_BY = ["agent", "turn", "time", "restart", "stop", "human"] as const;
44
+ export const RELEASED_BY = ["agent", "turn", "archived", "time", "restart", "stop", "human"] as const;
44
45
  export type ReleasedBy = (typeof RELEASED_BY)[number];
45
46
 
46
47
  /** The keys a set was written with, in the order they were written: valid keys, of which no two name one file. */
@@ -777,6 +777,16 @@ export class Registry {
777
777
  this.turns.set(requestId, "sent");
778
778
  }
779
779
 
780
+ /**
781
+ * The send `messageSent` announced failed, so no turn is known to be the one the message starts, and a later turn of the
782
+ * agent must not take a set it was never told of. The mark goes, armed or not, and the set stays for the agent to ask
783
+ * after (`request_status`) until its deadline. A request that is no longer delivered, and an unknown one, are left alone.
784
+ */
785
+ messageSendFailed(requestId: string): void {
786
+ if (this.records.get(requestId)?.state !== "delivered") return;
787
+ this.turns.delete(requestId);
788
+ }
789
+
780
790
  /**
781
791
  * A turn of the agent began. Each of its requests whose message was handed over before this is armed: the end of this
782
792
  * turn takes its set. A request whose message is handed over later waits for a turn that begins after that, so a late
@@ -792,7 +802,8 @@ export class Registry {
792
802
  * A turn of the agent ended, with whatever outcome. The requests of that agent that are armed are taken now, as the
793
803
  * turn ends, and their sets are released in the queue as `turn` (as whoever took it, `takenBy`, for a set that is gone
794
804
  * by then), each that is still delivered. Taken now, and not when the queue comes to it: a request armed while this
795
- * waits in the queue was armed by a turn that began after this one, and its set is that turn's. A set that is stuck
805
+ * waits in the queue was armed by a turn that began after this one, and its set is that turn's; a set whose send was
806
+ * refused meanwhile has lost its mark and stays (`messageSendFailed`). A set that is stuck
796
807
  * keeps its mark, and the end of the next turn tries again. Once shutdown has begun no further set is released here
797
808
  * (the stop takes them); a removal that was already under way then reads a set its sweep took as the stop's.
798
809
  */
@@ -803,7 +814,24 @@ export class Registry {
803
814
  // For each request, as the tick does: the stop can begin while one of them is removed.
804
815
  if (this.stopped) return;
805
816
  const record = this.records.get(id);
806
- if (record?.state === "delivered") await this.releaseSet(record, "turn");
817
+ // A send refused while this waited took the mark away (`messageSendFailed`): the agent was never told of the set.
818
+ if (record?.state === "delivered" && this.turns.get(id) === "armed") await this.releaseSet(record, "turn");
819
+ }
820
+ });
821
+ }
822
+
823
+ /**
824
+ * The agent was archived. Its pending requests close as `cancelled`, which wipes their keys, and its delivered sets are
825
+ * released as `archived`, with no message for either. A set that cannot be removed stays delivered and is tried again
826
+ * like any other. Once shutdown has begun nothing further is closed here: the stop takes it.
827
+ */
828
+ agentArchived(agentId: string): Promise<void> {
829
+ return this.serial(async () => {
830
+ for (const record of [...this.records.values()]) {
831
+ if (this.stopped) return;
832
+ if (record.agentId !== agentId) continue;
833
+ if (record.state === "pending") await this.closePending(record.id, "cancelled");
834
+ else if (record.state === "delivered") await this.releaseSet(record, "archived");
807
835
  }
808
836
  });
809
837
  }
@@ -8,9 +8,9 @@ import { TOOL_NAMES } from "./tools";
8
8
  export type SessionOpenRequest = PluginBeforeRequests["agent.session_open"];
9
9
 
10
10
  /**
11
- * How long the handler of a turn's end waits at most for the sets that turn releases (`Registry.turnEnded`). Removing a
12
- * set is a few system calls; the bound is for a disk that stalls, and it ends the wait, not the removal, which goes on
13
- * in the registry's queue. Five seconds keeps an event handler that the daemon waits for from being held for longer.
11
+ * How long the handler of a turn's end, or of an agent's archiving, waits at most for what it closes (`Registry.turnEnded`,
12
+ * `Registry.agentArchived`). Removing a set is a few system calls; the bound is for a disk that stalls, and it ends the
13
+ * wait, not the removal, which goes on in the registry's queue. Five seconds keeps an event handler that the daemon waits for from being held for longer.
14
14
  */
15
15
  export const RELEASE_WAIT_MS = 5_000;
16
16
 
@@ -29,8 +29,8 @@ export function withTools(request: SessionOpenRequest, tools: readonly AgentTool
29
29
 
30
30
  export interface HookDeps {
31
31
  runtime: Pick<Runtime, "attach" | "turnEnded" | "agentArchived">;
32
- /** What a turn's start and end do to the sets of the agent's delivered requests: they arm the deletion, and fire it. */
33
- turns: Pick<Registry, "turnStarted" | "turnEnded">;
32
+ /** What a turn's start and end do to the sets of the agent's delivered requests (they arm the deletion, and fire it), and what its archiving does to its open requests. */
33
+ turns: Pick<Registry, "turnStarted" | "turnEnded" | "agentArchived">;
34
34
  /** The plugin's tools, built for the session that opens. One that cannot be built is a failure of the hook. */
35
35
  tools(): AgentToolDefinition[];
36
36
  /** Remembers, for the diagnostics, that a hook or an event handler failed. A code, never a message. */
@@ -50,7 +50,7 @@ export function failureCode(error: unknown): string {
50
50
  * reject, and the session-open hook waits for nothing: it builds the tools and hands them over, and a call waits for the
51
51
  * start-up itself (`agentTools`). Any failure of the hook (tools that cannot be built, a payload that is not what the SDK
52
52
  * declares) is remembered as a code, and the request goes on as it came. The handlers of events are held to the same
53
- * rule, which the daemon only logs for; the one handler that waits, a turn's end for the sets it releases, waits within
53
+ * rule, which the daemon only logs for; the two handlers that wait, a turn's end and an agent's archiving, wait within
54
54
  * `RELEASE_WAIT_MS`.
55
55
  */
56
56
  export function registerHooks(host: Pick<PluginServerContext, "before" | "on">, deps: HookDeps): void {
@@ -93,12 +93,18 @@ export function registerHooks(host: Pick<PluginServerContext, "before" | "on">,
93
93
  }
94
94
  });
95
95
 
96
- // An archived agent is gone for good, so what waits for it is dropped. `agent.closed` is deliberately not used for
97
- // this: what "closed" means for an agent that can be opened again could not be established.
98
- host.on("agent.archived", ({ agent }, { paseo }) => {
96
+ // An archived agent has no use for what it asked for, so its requests close and what waits for it is dropped. `agent.closed`
97
+ // is deliberately not used for this: what "closed" means for an agent that can be opened again could not be established.
98
+ host.on("agent.archived", async (event, { paseo }) => {
99
99
  try {
100
100
  deps.runtime.attach(paseo);
101
- deps.runtime.agentArchived(agent.id);
101
+ const agentId = event.agent.id;
102
+ try {
103
+ await within(deps.releaseWaitMs ?? RELEASE_WAIT_MS, () => deps.turns.agentArchived(agentId));
104
+ } catch (error) {
105
+ deps.failed("agent.archived", failureCode(error));
106
+ }
107
+ deps.runtime.agentArchived(agentId);
102
108
  } catch (error) {
103
109
  deps.failed("agent.archived", failureCode(error));
104
110
  }
@@ -171,6 +171,9 @@ export function assemble(options: PluginOptions): Parts {
171
171
  onSend: (item) => {
172
172
  if (item.kind === "continuation") registry.messageSent(item.requestId);
173
173
  },
174
+ onSendFailed: (item) => {
175
+ if (item.kind === "continuation") registry.messageSendFailed(item.requestId);
176
+ },
174
177
  });
175
178
  const runtime: Runtime = new Runtime(outbox, { callTimeoutMs: options.daemonCallTimeoutMs, report });
176
179
  const registry: Registry = new Registry({
@@ -50,7 +50,7 @@ const NOT_ATTACHED = "the plugin is not attached to the daemon yet; retry in a f
50
50
  export interface DaemonAgent {
51
51
  readonly status: string | null;
52
52
  refresh(): Promise<unknown>;
53
- send(text: string): Promise<void>;
53
+ send(text: string, options: { activeTurnBehavior: "steer" }): Promise<void>;
54
54
  readonly timeline: { append(item: TimelineItem): Promise<unknown> };
55
55
  }
56
56
 
@@ -230,7 +230,8 @@ export class Runtime implements AgentPort {
230
230
  }
231
231
 
232
232
  async send(agentId: string, text: string): Promise<void> {
233
- await this.api().agents.ref(agentId).send(text);
233
+ // A turn can begin after the idle check. Unasked, the daemon replaces it; a provider that can steer takes the message into it.
234
+ await this.api().agents.ref(agentId).send(text, { activeTurnBehavior: "steer" });
234
235
  }
235
236
 
236
237
  /**
package/shared/limits.ts CHANGED
@@ -26,7 +26,7 @@ export const LIMITS = {
26
26
  export const DROP_TTL_MS = 900_000;
27
27
 
28
28
  /** The version of the plugin, as the settings screen says it. `tests/mirrored-constants.test.ts` holds it equal to the version in `package.json`. */
29
- export const PLUGIN_VERSION = "0.2.2";
29
+ export const PLUGIN_VERSION = "0.3.0";
30
30
 
31
31
  /** The release of Paseo the plugin needs, as the settings screen says it. The same test holds it to the requirement in `paseo-plugin.json`. */
32
32
  export const PASEO_SINCE = "Paseo 0.14+";
@@ -12,6 +12,7 @@ When you need a secret, make a request instead of asking in chat. The user fills
12
12
  - **Never ask for a secret in chat.** Not "paste it here", not "export it and tell me", not "put it in `.env` yourself". Make a request.
13
13
  - **Never let a `si-secret-` file's content reach you.** Never read, print, open, compare, hash, measure or log a file or directory whose name starts with `si-secret-`, and never pass its content as an argument: no `cat PATH`, `head`, `less`, `grep`, `diff`, `wc`, `xxd`, `base64`, no editor or file viewer, and no `ls -l` of its files. Such a path may stand in a command only after `<`, as the source of `cp`, or after `rm -r`: a value moves by redirection or by copy, and a command that reads it from its stdin into its destination, `cat` included, moves it blind.
14
14
  - **Move, then delete or release.** Move every value in the turn the message starts. Then delete the directory, as the message shows, or call `release_secret`. At the end of that turn the plugin deletes the files anyway.
15
+ - **Keep a delegated move inside your turn.** The files go when your turn ends, even while a subagent you started is still working. Move the value yourself, or wait for the subagent before you end the turn. Your requests are not its requests: `request_status` and `release_secret` answer it as if they did not exist. A subagent that needs a value after your turn makes a request of its own.
15
16
  - **Do not poll.** A request answers `End your turn now. You will receive a message when the user has submitted. Do not poll.` Do that. Call `request_status` once, and only when the user says they submitted and no message came, or that no form appeared.
16
17
  - **Say the reason yourself.** The form shows neither your reason nor your labels. In your own message, tell the user what you need, why, and that the form opens from the pill in this chat.
17
18
  - **A plugin that is down is no reason to take a secret in chat.** When the tool is missing, or keeps answering `service_unavailable`, tell the user and stop.
@@ -135,7 +136,7 @@ ssh HOST 'umask 077; mkdir -p ~/.config/app && touch ~/.config/app/token && chmo
135
136
 
136
137
  `request_status` gives `state`, `keys`, `written`, `tamper` and `errorCode`, and while the files exist, `files` (key → path) and `deleteBy`. Never a value. If it says `delivered`, move the files at those paths as you would from the message, each quoted for the shell first. If it says `pending`, the form is still waiting: the user has not submitted, or the form refused what they sent and shows why. Either way the pill in this chat opens it; do not cancel and ask again, or the user types everything twice.
137
138
 
138
- Nothing comes when the files go the ordinary way: when you delete them or call `release_secret`, or at the end of your turn. A request you cancel ends without a message.
139
+ Nothing comes when the files go the ordinary way: when you delete them or call `release_secret`, or at the end of your turn. A request you cancel ends without a message. When you are archived, your open requests close and their files go, also without a message; if you are brought back, make a new request.
139
140
 
140
141
  ## When a request is refused at once
141
142