prior-cli 1.3.10 → 1.3.11

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 (2) hide show
  1. package/bin/prior.js +17 -12
  2. package/package.json +1 -1
package/bin/prior.js CHANGED
@@ -653,7 +653,7 @@ async function startChat(opts = {}) {
653
653
 
654
654
  // Image indicator — always first, persists across backspace/typing
655
655
  if (_pendingImageBase64) {
656
- process.stdout.write(`\x1b[B\r\x1b[2K ${c.brand('◈')} ${c.dim('[Image] attached · alt+v to replace · type your prompt and press enter')}`);
656
+ process.stdout.write(`\x1b[B\r\x1b[2K ${c.brand('◈')} ${c.dim('[Image] attached · alt+v to remove')}`);
657
657
  rows++;
658
658
  }
659
659
 
@@ -690,19 +690,24 @@ async function startChat(opts = {}) {
690
690
  return;
691
691
  }
692
692
 
693
- // Alt+V — grab image from Windows clipboard
693
+ // Alt+V — grab image from clipboard, or remove if already attached
694
694
  if (key.meta && key.name === 'v') {
695
- try {
696
- const ps = `Add-Type -AssemblyName System.Windows.Forms; $img = [System.Windows.Forms.Clipboard]::GetImage(); if ($img) { $ms = New-Object System.IO.MemoryStream; $img.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png); [Convert]::ToBase64String($ms.ToArray()) } else { '' }`;
697
- const b64 = execSync(`powershell -NoProfile -Command "${ps}"`, { timeout: 5000 }).toString().trim();
698
- if (b64) {
699
- _pendingImageBase64 = b64;
700
- renderSubRows(rl.line || ''); // immediate redraw with indicator
701
- } else {
702
- flashSubRow(c.muted('✗ No image found in clipboard'));
695
+ if (_pendingImageBase64) {
696
+ _pendingImageBase64 = null;
697
+ renderSubRows(rl.line || '');
698
+ } else {
699
+ try {
700
+ const ps = `Add-Type -AssemblyName System.Windows.Forms; $img = [System.Windows.Forms.Clipboard]::GetImage(); if ($img) { $ms = New-Object System.IO.MemoryStream; $img.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png); [Convert]::ToBase64String($ms.ToArray()) } else { '' }`;
701
+ const b64 = execSync(`powershell -NoProfile -Command "${ps}"`, { timeout: 5000 }).toString().trim();
702
+ if (b64) {
703
+ _pendingImageBase64 = b64;
704
+ renderSubRows(rl.line || '');
705
+ } else {
706
+ flashSubRow(c.muted('✗ No image found in clipboard'));
707
+ }
708
+ } catch {
709
+ flashSubRow(c.muted('✗ Could not read clipboard'));
703
710
  }
704
- } catch {
705
- flashSubRow(c.muted('✗ Could not read clipboard'));
706
711
  }
707
712
  return;
708
713
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prior-cli",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "Prior Network AI — command-line interface",
5
5
  "bin": {
6
6
  "prior": "bin/prior.js"