@timurproko/a1 0.1.8-dev.287 → 0.1.8-dev.289

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.
Files changed (30) hide show
  1. package/dist/contracts/owned-ui/image-attachments.d.ts +9 -0
  2. package/dist/contracts/owned-ui/image-attachments.js +19 -1
  3. package/dist/integrations/pi/components/owned-editor-ux.d.ts +6 -0
  4. package/dist/integrations/pi/components/owned-editor-ux.js +71 -0
  5. package/dist/integrations/pi/components/shell-editor-autocomplete.js +2 -0
  6. package/dist/integrations/pi/components/shell-shared-facade.d.ts +6 -1
  7. package/dist/integrations/pi/session-ui/clipboard-image.d.ts +2 -2
  8. package/dist/integrations/pi/session-ui/clipboard-image.js +10 -5
  9. package/dist/integrations/pi/session-ui/image-preparation-client.d.ts +20 -0
  10. package/dist/integrations/pi/session-ui/image-preparation-client.js +145 -0
  11. package/dist/integrations/pi/session-ui/image-preparation.d.ts +18 -0
  12. package/dist/integrations/pi/session-ui/image-preparation.js +126 -0
  13. package/dist/integrations/pi/session-ui/image-source.d.ts +13 -0
  14. package/dist/integrations/pi/session-ui/image-source.js +171 -0
  15. package/dist/integrations/pi/session-ui/image-worker.d.ts +17 -0
  16. package/dist/integrations/pi/session-ui/image-worker.js +23 -0
  17. package/dist/integrations/pi/session-ui/prompt-chips.d.ts +10 -1
  18. package/dist/integrations/pi/session-ui/prompt-chips.js +111 -4
  19. package/dist/integrations/pi/session-ui/session-shell-root.d.ts +7 -3
  20. package/dist/integrations/pi/session-ui/session-shell-root.js +18 -1
  21. package/dist/integrations/pi/session-ui/session-shell.js +67 -22
  22. package/dist/integrations/pi/session-ui/system-clipboard.d.ts +2 -2
  23. package/dist/integrations/pi/session-ui/system-clipboard.js +16 -14
  24. package/dist/native/darwin-arm64/manifest.json +1 -1
  25. package/dist/native/linux-x64/manifest.json +3 -3
  26. package/dist/native/linux-x64/process-guardian +0 -0
  27. package/dist/native/win32-x64/manifest.json +2 -2
  28. package/dist/native/win32-x64/process-guardian.exe +0 -0
  29. package/dist/runtime-payload-inventory.json +22 -18
  30. package/package.json +2 -1
@@ -1,6 +1,7 @@
1
1
  import { execFile } from "node:child_process";
2
2
  import { canonicalizeClipboardImage } from "./clipboard-image.js";
3
- import { ImageAttachmentError, MAX_IMAGE_DATA_BYTES } from "../../../contracts/owned-ui/index.js";
3
+ import { ImageAttachmentError } from "../../../contracts/owned-ui/index.js";
4
+ import { assertSourceBytes } from "./image-source.js";
4
5
  const MAX_CLIPBOARD_BYTES = 16 * 1024 * 1024;
5
6
  let nativeClipboardPromise;
6
7
  let pendingClipboardWrite = Promise.resolve();
@@ -14,13 +15,13 @@ export function preloadSystemClipboard() {
14
15
  * private clipboard module. Failures are deliberately non-fatal: a denied or
15
16
  * unavailable clipboard simply makes the paste action a no-op.
16
17
  */
17
- export async function readSystemClipboardContent() {
18
+ export async function readSystemClipboardContent(signal) {
18
19
  await pendingClipboardWrite;
19
20
  const native = await nativeClipboard();
20
21
  if (native !== null) {
21
22
  try {
22
23
  if (process.platform === "win32" && native.availableFormats().some(isFileDropFormat)) {
23
- const files = await readSystemClipboardText();
24
+ const files = await readSystemClipboardText(signal);
24
25
  if (files !== null)
25
26
  return { kind: "text", text: files };
26
27
  }
@@ -34,7 +35,7 @@ export async function readSystemClipboardContent() {
34
35
  // Compatibility: fall through to text and platform readers.
35
36
  }
36
37
  }
37
- const text = await readSystemClipboardText();
38
+ const text = await readSystemClipboardText(signal);
38
39
  return text === null ? null : { kind: "text", text };
39
40
  }
40
41
  export async function readSystemClipboardImage(reader) {
@@ -43,13 +44,13 @@ export async function readSystemClipboardImage(reader) {
43
44
  if (reader.getImageBinary !== undefined) {
44
45
  try {
45
46
  const bytes = await reader.getImageBinary();
46
- if (Math.ceil(bytes.length / 3) * 4 > MAX_IMAGE_DATA_BYTES)
47
- throw new ImageAttachmentError("image-size");
47
+ if (bytes.length > 0)
48
+ assertSourceBytes(bytes.length);
48
49
  if (bytes.length > 0 && bytes.every(byte => Number.isInteger(byte) && byte >= 0 && byte <= 255)) {
49
50
  return canonicalizeClipboardImage({
50
51
  data: Buffer.from(bytes).toString("base64"),
51
52
  mimeType: "image/png",
52
- });
53
+ }, true);
53
54
  }
54
55
  }
55
56
  catch (error) {
@@ -63,7 +64,7 @@ export async function readSystemClipboardImage(reader) {
63
64
  return canonicalizeClipboardImage({
64
65
  data: await reader.getImageBase64(),
65
66
  mimeType: "image/png",
66
- });
67
+ }, true);
67
68
  }
68
69
  catch (error) {
69
70
  if (error instanceof ImageAttachmentError)
@@ -73,7 +74,7 @@ export async function readSystemClipboardImage(reader) {
73
74
  }
74
75
  return null;
75
76
  }
76
- export async function readSystemClipboardText() {
77
+ export async function readSystemClipboardText(signal) {
77
78
  // Concurrency: Ctrl+C/Ctrl+X and Ctrl+V can arrive in adjacent input turns. Serialize the
78
79
  // read behind our native write so paste never observes the previous value.
79
80
  await pendingClipboardWrite;
@@ -96,12 +97,12 @@ export async function readSystemClipboardText() {
96
97
  "$t=Get-Clipboard -Raw -ErrorAction SilentlyContinue",
97
98
  "if ($null -ne $t -and $t.Length -gt 0) {[Console]::Out.Write($t)} else {$f=Get-Clipboard -Format FileDropList -ErrorAction SilentlyContinue; if ($f) {[Console]::Out.Write(($f | ForEach-Object {$_.FullName}) -join [Environment]::NewLine)}}",
98
99
  ].join("; ");
99
- return execClipboard("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script]);
100
+ return execClipboard("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], signal);
100
101
  }
101
102
  if (process.platform === "darwin")
102
- return execClipboard("pbpaste", []);
103
- return (await execClipboard("wl-paste", ["--no-newline", "--type", "text"]))
104
- ?? execClipboard("xclip", ["-selection", "clipboard", "-o"]);
103
+ return execClipboard("pbpaste", [], signal);
104
+ return (await execClipboard("wl-paste", ["--no-newline", "--type", "text"], signal))
105
+ ?? execClipboard("xclip", ["-selection", "clipboard", "-o"], signal);
105
106
  }
106
107
  export function writeSystemClipboardText(text) {
107
108
  const write = async () => {
@@ -127,13 +128,14 @@ function nativeClipboard() {
127
128
  function isFileDropFormat(format) {
128
129
  return /(?:filedrop|hdrop|shell idlist)/iu.test(format);
129
130
  }
130
- function execClipboard(command, args) {
131
+ function execClipboard(command, args, signal) {
131
132
  return new Promise(resolve => {
132
133
  execFile(command, args, {
133
134
  encoding: "utf8",
134
135
  maxBuffer: MAX_CLIPBOARD_BYTES,
135
136
  timeout: 5_000,
136
137
  windowsHide: true,
138
+ ...(signal === undefined ? {} : { signal }),
137
139
  }, (error, stdout) => resolve(error || stdout.length === 0 ? null : stdout));
138
140
  });
139
141
  }
@@ -5,7 +5,7 @@
5
5
  "platform": "darwin",
6
6
  "architecture": "arm64",
7
7
  "capability": "supported",
8
- "builtAt": "2026-09-09T13:32:45.025Z",
8
+ "builtAt": "2026-09-10T06:03:25.250Z",
9
9
  "artifact": {
10
10
  "filename": "process-guardian",
11
11
  "sha256": "dc03605e5780e2aeebb4ecafd62868dc673e22ddd38b024a369aff704ff136dc",
@@ -5,11 +5,11 @@
5
5
  "platform": "linux",
6
6
  "architecture": "x64",
7
7
  "capability": "supported",
8
- "builtAt": "2026-09-09T13:32:36.719Z",
8
+ "builtAt": "2026-09-10T06:03:35.868Z",
9
9
  "artifact": {
10
10
  "filename": "process-guardian",
11
- "sha256": "ee8a00eaaf79c707459bbbfb52518e9739314967049fbe5fa625f36ce33db9ee",
12
- "size": 414568
11
+ "sha256": "d8cda6b0c7cb36c0cc41e90802aceebf6c02eaebbc08a83d7d963d2e918dbd7a",
12
+ "size": 414536
13
13
  },
14
14
  "provenance": {
15
15
  "language": "Rust",
@@ -5,10 +5,10 @@
5
5
  "platform": "win32",
6
6
  "architecture": "x64",
7
7
  "capability": "supported",
8
- "builtAt": "2026-09-09T13:34:58.223Z",
8
+ "builtAt": "2026-09-10T06:04:05.737Z",
9
9
  "artifact": {
10
10
  "filename": "process-guardian.exe",
11
- "sha256": "ed500da6662711b12a26dd40d4b2d659a201a0d9e43fd8d521d8a16e04889f4b",
11
+ "sha256": "d46f6641ceb7ef4fe2ab74d123f639f9ca6d5192a595d0660536ebc1e2237533",
12
12
  "size": 177664
13
13
  },
14
14
  "provenance": {
@@ -171,9 +171,6 @@
171
171
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/pool/package.json",
172
172
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/utf8/LICENSE",
173
173
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/utf8/package.json",
174
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/LICENSE.md",
175
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/package.json",
176
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm",
177
174
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/core/LICENSE",
178
175
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/core/package.json",
179
176
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/credential-provider-imds/LICENSE",
@@ -495,6 +492,9 @@
495
492
  "node_modules/@mariozechner/clipboard-win32-x64-msvc/clipboard.win32-x64-msvc.node",
496
493
  "node_modules/@mariozechner/clipboard-win32-x64-msvc/package.json",
497
494
  "node_modules/@mariozechner/clipboard/package.json",
495
+ "node_modules/@silvia-odwyer/photon-node/LICENSE.md",
496
+ "node_modules/@silvia-odwyer/photon-node/package.json",
497
+ "node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm",
498
498
  "node_modules/chalk/license",
499
499
  "node_modules/chalk/package.json",
500
500
  "node_modules/cross-spawn/LICENSE",
@@ -2693,12 +2693,6 @@
2693
2693
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt",
2694
2694
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/utf8/tests/data/utf8.txt",
2695
2695
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/utf8/tests/index.js",
2696
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/LICENSE.md",
2697
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/README.md",
2698
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/package.json",
2699
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/photon_rs.js",
2700
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js",
2701
- "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm",
2702
2696
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/core/LICENSE",
2703
2697
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/core/README.md",
2704
2698
  "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/core/cbor.js",
@@ -6455,6 +6449,11 @@
6455
6449
  "node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs",
6456
6450
  "node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs",
6457
6451
  "node_modules/@mariozechner/clipboard/src/lib.rs",
6452
+ "node_modules/@silvia-odwyer/photon-node/LICENSE.md",
6453
+ "node_modules/@silvia-odwyer/photon-node/README.md",
6454
+ "node_modules/@silvia-odwyer/photon-node/package.json",
6455
+ "node_modules/@silvia-odwyer/photon-node/photon_rs.js",
6456
+ "node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm",
6458
6457
  "node_modules/chalk/license",
6459
6458
  "node_modules/chalk/package.json",
6460
6459
  "node_modules/chalk/readme.md",
@@ -43342,7 +43341,8 @@
43342
43341
  "packageName": "@silvia-odwyer/photon-node",
43343
43342
  "packageVersion": "0.3.4",
43344
43343
  "packagePath": "photon_rs_bg.js",
43345
- "disposition": "include"
43344
+ "disposition": "exclude",
43345
+ "reason": "unreachable-development"
43346
43346
  },
43347
43347
  {
43348
43348
  "packageName": "@silvia-odwyer/photon-node",
@@ -93110,10 +93110,10 @@
93110
93110
  ],
93111
93111
  "inventory": {
93112
93112
  "schema": "a1-runtime-payload-v1",
93113
- "includedFiles": 6209,
93114
- "includedBytes": 44433595,
93115
- "excludedFiles": 7302,
93116
- "excludedBytes": 55378954,
93113
+ "includedFiles": 6208,
93114
+ "includedBytes": 44309189,
93115
+ "excludedFiles": 7303,
93116
+ "excludedBytes": 55503360,
93117
93117
  "uncertaintyRetainedFiles": 1082,
93118
93118
  "exclusions": [
93119
93119
  {
@@ -106564,10 +106564,6 @@
106564
106564
  "path": "node_modules/@earendil-works/pi-coding-agent/node_modules/@protobufjs/utf8/index.d.ts",
106565
106565
  "reason": "type-declaration"
106566
106566
  },
106567
- {
106568
- "path": "node_modules/@earendil-works/pi-coding-agent/node_modules/@silvia-odwyer/photon-node/photon_rs.d.ts",
106569
- "reason": "type-declaration"
106570
- },
106571
106567
  {
106572
106568
  "path": "node_modules/@earendil-works/pi-coding-agent/node_modules/@smithy/core/cbor.d.ts",
106573
106569
  "reason": "type-declaration"
@@ -121836,6 +121832,14 @@
121836
121832
  "path": "node_modules/@mariozechner/clipboard/index.d.ts",
121837
121833
  "reason": "type-declaration"
121838
121834
  },
121835
+ {
121836
+ "path": "node_modules/@silvia-odwyer/photon-node/photon_rs.d.ts",
121837
+ "reason": "type-declaration"
121838
+ },
121839
+ {
121840
+ "path": "node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js",
121841
+ "reason": "unreachable-development"
121842
+ },
121839
121843
  {
121840
121844
  "path": "node_modules/chalk/source/index.d.ts",
121841
121845
  "reason": "type-declaration"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timurproko/a1",
3
- "version": "0.1.8-dev.287",
3
+ "version": "0.1.8-dev.289",
4
4
  "description": "Standalone terminal workspace for supervised native and managed agents",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.13.0",
@@ -62,6 +62,7 @@
62
62
  "dependencies": {
63
63
  "@earendil-works/pi-coding-agent": "0.84.2",
64
64
  "@earendil-works/pi-tui": "0.84.2",
65
+ "@silvia-odwyer/photon-node": "0.3.4",
65
66
  "chalk": "5.6.2",
66
67
  "cross-spawn": "7.0.6",
67
68
  "grok-mermaid": "0.2.2",