paseo-plugin-secure-input 0.2.1 → 0.2.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/README.md CHANGED
@@ -4,7 +4,7 @@ secure-input is a [Paseo](https://paseo.sh) plugin: an agent asks you for a pass
4
4
 
5
5
  ## Install
6
6
 
7
- Paseo **0.14.0-beta.1 or later** on the daemon and in every app you answer from: an older app shows no pill, and `paseo plugin ls` cannot tell you. Paseo 0.14.0-beta.1 is a pre-release: on 2026-10-28 npm had it under the Paseo CLI's `beta` dist-tag, and `latest` was 0.13.2. The daemon needs Node.js 22.12 or later; macOS and Linux are declared supported, and live validation has been on macOS. Check both versions:
7
+ Paseo **0.14.0-beta.1 or later** on the daemon and in every app you answer from: an older app shows no pill, and `paseo plugin ls` cannot tell you. Paseo 0.14.0-beta.1 is a pre-release. The daemon needs Node.js 22.12 or later; macOS and Linux are declared supported, and live validation has been on macOS. Check both versions:
8
8
 
9
9
  ```bash
10
10
  paseo daemon status # daemonVersion
package/SECURITY.md CHANGED
@@ -53,7 +53,7 @@ An agent with a shell runs as your OS user, controls its workspace, and can read
53
53
  | A write fails, and its clean-up cannot remove what it staged | The request is rejected (`write_failed`), and the half-written set stays in `drop/` under its temporary name, `si-secret-<requestId>.<random>.tmp`. «Секрети на сервері» turns red, and the entry is tried again once a minute until it goes; the stop, the next start and «Видалити всі файли секретів зараз» take it too. Nobody is given its path |
54
54
  | A removal fails | The request stays `delivered` and «Секрети на сервері» turns red. A delivered set is tried again at its deadline, and after that once a minute; the end of a later delivery turn of its agent tries sooner. What a start or a failed write left is tried again once a minute. «Видалити всі файли секретів зараз» tries again now; so does deleting `drop/` by hand |
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
- | 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 |
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
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 |
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 |
@@ -0,0 +1,53 @@
1
+ import type { PluginClientContext } from "@getpaseo/plugin/client";
2
+
3
+ /** How long after a failure the observation is asked for again; each failure in a row doubles it, up to the cap. */
4
+ export const RETRY_MS = 5_000;
5
+ export const RETRY_CAP_MS = 60_000;
6
+
7
+ /**
8
+ * Calls `ping` now and after every reconnect.
9
+ *
10
+ * The daemon half gets its API handle only inside a hook or an RPC, so after a daemon restart it can send nothing until
11
+ * something calls it. Paseo before 0.15 set the plugin up again on a reconnect, and setting up made that call. From 0.15
12
+ * an unchanged plugin stays installed and is not set up again, and the fresh snapshot of an owned observation is what
13
+ * marks the reconnect. One entry is enough for that: the agents themselves are of no interest here. Paseo gives up an
14
+ * observation whose request fails after a reconnect, so a failure asks for a new one. Returns the cleanup.
15
+ */
16
+ export function keepDaemonHalfAttached(paseo: PluginClientContext["paseo"], ping: () => void): () => void {
17
+ const lifetime = new AbortController();
18
+ let retry: ReturnType<typeof setTimeout> | undefined;
19
+ let failures = 0;
20
+
21
+ function observeAgain(): void {
22
+ if (lifetime.signal.aborted) return;
23
+ if (retry !== undefined) clearTimeout(retry);
24
+ retry = setTimeout(observe, Math.min(RETRY_CAP_MS, RETRY_MS * 2 ** failures));
25
+ failures += 1;
26
+ }
27
+
28
+ function observe(): void {
29
+ if (lifetime.signal.aborted) return;
30
+ void paseo.agents
31
+ .list({ subscribe: {}, page: { limit: 1 }, signal: lifetime.signal })
32
+ .then(({ subscription }) => {
33
+ subscription.subscribe({
34
+ snapshot() {
35
+ if (lifetime.signal.aborted) return;
36
+ failures = 0;
37
+ ping();
38
+ },
39
+ update() {},
40
+ error: observeAgain,
41
+ });
42
+ return undefined;
43
+ })
44
+ .catch(observeAgain);
45
+ }
46
+
47
+ ping();
48
+ observe();
49
+ return () => {
50
+ lifetime.abort();
51
+ if (retry !== undefined) clearTimeout(retry);
52
+ };
53
+ }
package/index.client.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { PluginClientContext } from "@getpaseo/plugin/client";
2
+ import { keepDaemonHalfAttached } from "./client/attach";
2
3
  import { RequestCard } from "./client/card";
3
4
  import { SettingsScreen } from "./client/settings";
4
5
  import { CARD_KIND, CARD_VERSION, CardDataSchema } from "./shared/card";
@@ -14,15 +15,18 @@ export default function contribute(client: PluginClientContext) {
14
15
  const removeSettings = client.addSettingsScreen({ id: "main", title: "Secure input", icon: "ShieldCheck", Component: SettingsScreen });
15
16
 
16
17
  // The daemon half only receives its API handle inside a hook or an RPC. One
17
- // harmless call when the app loads lets it publish cards that were waiting.
18
+ // harmless call lets it publish cards that were waiting.
18
19
  // A call that throws on the spot must not fail the whole contribution.
19
- try {
20
- void client.rpc(readDiagnostics, {}).catch(() => undefined);
21
- } catch {
22
- // nothing to do: the cards are published the next time the plugin is asked for anything
23
- }
20
+ const stopAttaching = keepDaemonHalfAttached(client.paseo, () => {
21
+ try {
22
+ void client.rpc(readDiagnostics, {}).catch(() => undefined);
23
+ } catch {
24
+ // nothing to do: the cards are published the next time the plugin is asked for anything
25
+ }
26
+ });
24
27
 
25
28
  return () => {
29
+ stopAttaching();
26
30
  removeRenderer();
27
31
  removeSettings();
28
32
  };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "paseo-plugin-secure-input",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "paseo-plugin-secure-input",
9
- "version": "0.2.1",
9
+ "version": "0.2.2",
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.1",
3
+ "version": "0.2.2",
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",
@@ -30,6 +30,7 @@
30
30
  "typecheck": "tsc -p tsconfig.server.json && tsc -p tsconfig.client.json && tsc -p tsconfig.client-tests.json",
31
31
  "test": "vitest run",
32
32
  "check": "npm run typecheck && npm test",
33
+ "test:paseo": "node scripts/paseo-compat.mjs",
33
34
  "prepack": "node scripts/shrinkwrap.mjs write",
34
35
  "postpack": "node scripts/shrinkwrap.mjs remove"
35
36
  },
@@ -43,16 +44,17 @@
43
44
  "@getpaseo/plugin": "0.14.0-beta.1",
44
45
  "@getpaseo/protocol": "0.14.0-beta.1",
45
46
  "@getpaseo/relay": "0.14.0-beta.1",
46
- "@modelcontextprotocol/sdk": "1.32.1",
47
- "@tanstack/react-query": "^5.90.11",
47
+ "@modelcontextprotocol/sdk": "1.32.2",
48
+ "@tanstack/react-query": "^5.105.0",
48
49
  "@types/node": "^22.0.0",
49
50
  "@types/react": "~19.2.0",
50
51
  "react": "19.1.0",
51
52
  "react-native": "0.81.5",
52
53
  "semver": "7.8.5",
53
- "typescript": "^5.9.3",
54
- "vitest": "^4.1.11",
55
- "zod": "^4.4.3"
54
+ "typescript": "^7.0.2",
55
+ "typescript-5": "npm:typescript@5.9.3",
56
+ "vitest": "^5.0.5",
57
+ "zod": "^4.6.7"
56
58
  },
57
59
  "files": [
58
60
  "paseo-plugin.json",
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.1";
29
+ export const PLUGIN_VERSION = "0.2.2";
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+";