@comput/pi-intercom 0.1.1 → 0.1.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
@@ -119,7 +119,7 @@ Tests use temporary directories, local test-only HTTP servers, and mocked Pi hos
119
119
  ### Not live-tested / remaining limitations
120
120
 
121
121
  - Actual Pi extension loading, idle/steering queue delivery, busy snapshots, session-name persistence, trust UI and session replacement/reload lifecycle with live Pi hosts.
122
- - Herdr tab creation, agent readiness, JSON response shapes, current-pane association and tab rename with live workers. Launcher CLI syntax was checked against installed help only. Herdr's temporary launcher alias is not Intercom/Pi identity and is not saved in config.
122
+ - Complete Herdr create/register/configure/rename flow still needs end-to-end validation. The Windows launch path uses `herdr pane run` on the returned pane ID to invoke `pi.ps1` through explicitly encoded PowerShell, avoiding Herdr's failing `Start-Process pi` wrapper. Command submission is not agent readiness. This command path was live-tested in the previously failed tab: Pi started and registered successfully. No Herdr agent alias is needed.
123
123
  - Windows visible terminal/Pi process startup. Success only proves terminal creation, **not Pi readiness**; startup failures remain visible in that terminal. No live readiness handshake was added.
124
124
  - Actual persisted-session lookup and resumed worker startup; never-used session failure.
125
125
  - Cross-process/network-drive atomicity and Windows ACL/sharing failures (same-process temp-filesystem races are tested).
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/mbundgaard/PiIntercom/issues"
14
14
  },
15
- "version": "0.1.1",
15
+ "version": "0.1.2",
16
16
  "description": "Explicit local communication between Pi sessions; Pi orchestrates.",
17
17
  "type": "module",
18
18
  "keywords": [
package/src/launcher.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { execFile } from 'node:child_process';
2
- import { randomBytes } from 'node:crypto';
3
2
  import { promisify } from 'node:util';
4
3
  import { fail } from './config.js';
5
4
  import type { LaunchRequest } from './runtime.js';
@@ -31,12 +30,15 @@ export function launchers(options: LauncherOptions) {
31
30
  catch (e) { fail(`Herdr tab launch failed: ${String(e)}; no fallback or cleanup`); }
32
31
  const pane = created.result?.root_pane?.pane_id, tab = created.result?.tab?.tab_id;
33
32
  if (!pane || !tab) fail('Herdr creation response missing returned pane/tab IDs; no guessed targeting or cleanup');
34
- // Herdr requires a unique lowercase launcher alias. This is not Pi identity,
35
- // is never stored in Intercom config/wire, and assigns no responsibility.
36
- const alias = `intercom-${randomBytes(6).toString('hex')}`;
37
- try { await exec('herdr', ['agent', 'start', alias, '--kind', 'pi', '--pane', pane, '--timeout', '30000', '--', ...args]); }
38
- catch (e) { fail(`Herdr agent launch failed in tab ${tab}, pane ${pane}: ${String(e)}. Tab/process may remain; no automatic cleanup/retry/replacement`); }
39
- return { launched: true, tab, pane, registrationAwaited: false };
33
+ // Herdr's Windows agent-start wrapper uses Start-Process on `pi`, which
34
+ // can resolve to a PowerShell shim and fail with invalid Win32 application.
35
+ // Run an explicit PowerShell command in the returned shell pane instead.
36
+ // This acknowledges command submission only, not Pi readiness/registration.
37
+ const script = `$ErrorActionPreference='Stop'; Set-Location -LiteralPath ${psQuote(request.cwd)}; & (Get-Command pi.ps1 -ErrorAction Stop).Source ${args.map(psQuote).join(' ')}; if ($LASTEXITCODE -ne 0) { Write-Error ('Pi exited with code ' + $LASTEXITCODE) }`;
38
+ const command = `powershell.exe -NoProfile -ExecutionPolicy Bypass -EncodedCommand ${encoded(script)}`;
39
+ try { await exec('herdr', ['pane', 'run', pane, command]); }
40
+ catch (e) { fail(`Herdr Pi command submission failed in tab ${tab}, pane ${pane}: ${String(e)}. Tab/process may remain; no automatic cleanup/retry/replacement`); }
41
+ return { commandSubmitted: true, tab, pane, piReadiness: 'not observed; inspect pane for startup failures', registrationAwaited: false };
40
42
  }
41
43
  if (request.multiplexer !== 'none') fail('unsupported multiplexer');
42
44
  // Use encoded PowerShell rather than constructing cmd.exe command strings.