@comput/pi-intercom 0.1.0 → 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
@@ -96,7 +96,7 @@ Tool text output is bounded to 50 KiB/2000 lines. Full list data remains in the
96
96
  ## Development and validation
97
97
 
98
98
  ```sh
99
- npm install --ignore-scripts
99
+ npm ci
100
100
  npm run typecheck
101
101
  npm test
102
102
  npm run check:package
@@ -104,14 +104,22 @@ npm run check:package
104
104
  PI_INTERCOM_PI_ROOT='C:/path/to/pi-coding-agent' npm run test:host
105
105
  ```
106
106
 
107
- Production source runs through Pi's TypeScript loader; `npm run build` generates `dist` for tests. Pi core/typebox are peer dependencies, not bundled. This implementation run installed only cached development dependencies offline with `--legacy-peer-deps`, then used local ignored junctions to installed Pi/typebox for validation. No installed dependency, global setting or unrelated project was changed.
107
+ Production source runs through Pi's TypeScript loader; `npm run build` generates `dist` for tests. Pi core/typebox are peer dependencies, not bundled; pinned development copies are included in the lockfile for reproducible CI without local junctions.
108
+
109
+ ## Publishing
110
+
111
+ `.github/workflows/publish.yml` publishes through npm Trusted Publishing (GitHub OIDC), without an npm token secret. Configure the npm trusted publisher as owner `mbundgaard`, repository `PiIntercom`, workflow `publish.yml`, with no environment.
112
+
113
+ The workflow validates on Windows, then publishes with provenance from a GitHub-hosted Ubuntu runner. It runs when a GitHub release is published or when manually dispatched. Release tags must be `v<package.json version>`.
114
+
115
+ Version `0.1.0` is already published and cannot be republished. For the next release, bump package and lockfile versions, commit/push, then publish a matching GitHub release. Do not dispatch publishing for an already published version. CI validates pushes and pull requests separately without publishing.
108
116
 
109
117
  Tests use temporary directories, local test-only HTTP servers, and mocked Pi hosts/launch executors. They never start agents, tabs, terminals, contact models, services or bridges, or access credentials.
110
118
 
111
119
  ### Not live-tested / remaining limitations
112
120
 
113
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.
114
- - 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.
115
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.
116
124
  - Actual persisted-session lookup and resumed worker startup; never-used session failure.
117
125
  - Cross-process/network-drive atomicity and Windows ACL/sharing failures (same-process temp-filesystem races are tested).
package/package.json CHANGED
@@ -1,15 +1,47 @@
1
1
  {
2
2
  "name": "@comput/pi-intercom",
3
- "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
4
- "version": "0.1.0",
3
+ "publishConfig": {
4
+ "access": "public",
5
+ "registry": "https://registry.npmjs.org/"
6
+ },
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/mbundgaard/PiIntercom.git"
10
+ },
11
+ "homepage": "https://github.com/mbundgaard/PiIntercom#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/mbundgaard/PiIntercom/issues"
14
+ },
15
+ "version": "0.1.2",
5
16
  "description": "Explicit local communication between Pi sessions; Pi orchestrates.",
6
17
  "type": "module",
7
- "keywords": ["pi-package"],
8
- "pi": { "extensions": ["./src/index.ts"] },
9
- "files": ["src", "README.md", "references/v1-specification.md", "references/implementation-blocker.md"],
10
- "engines": { "node": ">=22" },
11
- "peerDependencies": { "@earendil-works/pi-coding-agent": "*", "typebox": "*" },
12
- "devDependencies": { "typescript": "^5.9.3", "@types/node": "^22.0.0" },
18
+ "keywords": [
19
+ "pi-package"
20
+ ],
21
+ "pi": {
22
+ "extensions": [
23
+ "./src/index.ts"
24
+ ]
25
+ },
26
+ "files": [
27
+ "src",
28
+ "README.md",
29
+ "references/v1-specification.md",
30
+ "references/implementation-blocker.md"
31
+ ],
32
+ "engines": {
33
+ "node": ">=22"
34
+ },
35
+ "peerDependencies": {
36
+ "@earendil-works/pi-coding-agent": "*",
37
+ "typebox": "*"
38
+ },
39
+ "devDependencies": {
40
+ "typescript": "^5.9.3",
41
+ "@types/node": "^22.0.0",
42
+ "@earendil-works/pi-coding-agent": "0.84.4",
43
+ "typebox": "1.3.7"
44
+ },
13
45
  "scripts": {
14
46
  "build": "tsc",
15
47
  "typecheck": "tsc --noEmit",
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.