privateer-agent 0.6.9 → 0.6.10

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.
@@ -74,6 +74,17 @@ class SecretField {
74
74
  // are swallowed rather than inserted — the naive "strip control chars" approach
75
75
  // would leave "[A" behind from an up-arrow and silently corrupt the token.
76
76
  handleInput(data: string): boolean {
77
+ // A PASTE MUST BE UNWRAPPED FIRST. pi-tui's Terminal re-wraps pasted text in
78
+ // bracketed-paste markers and delivers it as ONE chunk (`\x1b[200~…\x1b[201~`,
79
+ // see pi-tui terminal.ts) — which starts with ESC, so the arrow-key guard below
80
+ // would otherwise swallow the entire token and leave the field empty.
81
+ const paste = /^\x1b\[200~([\s\S]*?)\x1b\[201~$/.exec(data);
82
+ if (paste) {
83
+ // Control chars (a trailing newline from the clipboard, most often) are stripped
84
+ // the same way typed input is — a token never legitimately contains one.
85
+ this.value += paste[1].replace(/[\x00-\x1f\x7f]/g, "");
86
+ return true;
87
+ }
77
88
  if (data.startsWith("\x1b")) return true;
78
89
  if (data === "\x7f" || data === "\b") {
79
90
  this.value = this.value.slice(0, -1);
@@ -84,7 +95,7 @@ class SecretField {
84
95
  this.value = "";
85
96
  return true;
86
97
  }
87
- // Everything printable, including a bracketed-paste chunk arriving at once.
98
+ // Ordinary typed input (pastes took the branch above).
88
99
  const printable = data.replace(/[\x00-\x1f\x7f]/g, "");
89
100
  if (!printable) return false;
90
101
  this.value += printable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "privateer-agent",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "Privateer — a provider-agnostic, safe-by-default terminal coding agent with TEE/Tinfoil attestation, rebuilt on the Pi toolkit. Bring your own model across 20 providers.",
5
5
  "type": "module",
6
6
  "license": "MIT",