@comput/pi-intercom 0.5.2 → 0.8.1

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 (52) hide show
  1. package/README.md +109 -15
  2. package/dist/config.d.ts +18 -1
  3. package/dist/config.js +141 -27
  4. package/dist/config.js.map +1 -1
  5. package/dist/handoff.d.ts +87 -0
  6. package/dist/handoff.js +327 -0
  7. package/dist/handoff.js.map +1 -0
  8. package/dist/index.js +92 -17
  9. package/dist/index.js.map +1 -1
  10. package/dist/launcher.js +11 -1
  11. package/dist/launcher.js.map +1 -1
  12. package/dist/monitor-view.d.ts +1 -1
  13. package/dist/monitor-view.js +31 -2
  14. package/dist/monitor-view.js.map +1 -1
  15. package/dist/observability.d.ts +1 -1
  16. package/dist/observability.js +1 -1
  17. package/dist/observability.js.map +1 -1
  18. package/dist/pane-close.d.ts +22 -0
  19. package/dist/pane-close.js +166 -0
  20. package/dist/pane-close.js.map +1 -0
  21. package/dist/reminders.d.ts +28 -0
  22. package/dist/reminders.js +81 -0
  23. package/dist/reminders.js.map +1 -0
  24. package/dist/runtime.d.ts +19 -2
  25. package/dist/runtime.js +163 -16
  26. package/dist/runtime.js.map +1 -1
  27. package/dist/snapshot.d.ts +9 -0
  28. package/dist/snapshot.js +23 -1
  29. package/dist/snapshot.js.map +1 -1
  30. package/dist/transport.d.ts +2 -1
  31. package/dist/transport.js +4 -1
  32. package/dist/transport.js.map +1 -1
  33. package/dist/worker-status.d.ts +1 -1
  34. package/dist/worker-status.js +9 -1
  35. package/dist/worker-status.js.map +1 -1
  36. package/package.json +12 -6
  37. package/references/implementation-blocker.md +1 -1
  38. package/references/observability.md +13 -3
  39. package/references/releasing.md +90 -0
  40. package/references/v1-specification.md +4 -4
  41. package/src/config.ts +107 -19
  42. package/src/handoff.ts +280 -0
  43. package/src/index.ts +75 -15
  44. package/src/launcher.ts +9 -1
  45. package/src/monitor-view.ts +30 -3
  46. package/src/observability.ts +1 -1
  47. package/src/pane-close.ts +138 -0
  48. package/src/reminders.ts +69 -0
  49. package/src/runtime.ts +138 -18
  50. package/src/snapshot.ts +22 -1
  51. package/src/transport.ts +4 -2
  52. package/src/worker-status.ts +9 -2
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAWpC,MAAM,UAAU,aAAa,CAAC,OAAgC;IAC5D,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAgB,CAAC;QAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAClI,MAAM,MAAM,GAAG,OAAO,CAAC,MAAsB,CAAC;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IACtC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,OAAO,KAAK,EAAE,CAAC;QAAE,IAAI,CAAC,mFAAmF,CAAC,CAAC;IACzO,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AACD,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,MAAM,CAAC,GAAG,KAAiB,CAAC;IAC5B,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,cAAc,E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,CAAC,MAAM,CAAC,CAAC,QAAQ,KAAK,IAAI;wBAAE,IAAI,CAAC,qBAAqB,GAAG,CAAC,UAAU,MAAM,MAAM,EAAE,CAAC,CAAC;oBAC5H,OAAO,EAAE,CAAC;gBACZ,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACpI,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ObservationSnapshot } from './snapshot.js';
1
+ import { type ObservationSnapshot } from './snapshot.js';
2
2
  export declare function workerObservation(snapshot: ObservationSnapshot, sessionId: string, now?: number): {
3
3
  observedStatus: string;
4
4
  lastActivity: string;
@@ -1,3 +1,4 @@
1
+ import { publicCloseMetadata } from './snapshot.js';
1
2
  import { currentConnection, sortWorkersByConnection } from './connections.js';
2
3
  const labels = {
3
4
  processing: 'Processing', thinking: 'Thinking', responding: 'Writing response',
@@ -54,14 +55,21 @@ export function workerStatusPage(snapshot, options = {}, now = Date.now()) {
54
55
  }
55
56
  const workers = [];
56
57
  const result = { version: 1, source: 'local-observations', generatedAt: new Date(now).toISOString(),
57
- statusMeaning: 'Activity is last observed, not task completion. Connectivity is a separate endpoint check, never proof of termination. Reports are self-reported, not approval.',
58
+ statusMeaning: 'Activity is last observed, not task completion. Connectivity is a separate endpoint check, never proof of termination. Reports are self-reported, not approval. Handoff is saved public context, not task completion; closeJob is workflow state, never proof that all child processes terminated.',
58
59
  truncated: snapshot.truncated, errors: snapshot.errors, totalInSnapshot: roster.length, offset,
59
60
  nextOffset: null, workers };
60
61
  for (const agent of roster.slice(offset, offset + limit)) {
61
62
  const report = snapshot.reports?.find(r => r.sessionId === agent.sessionId && r.status !== 'clear');
62
63
  const reportAge = report ? now - Date.parse(report.updatedAt) : NaN;
64
+ const saved = publicCloseMetadata(agent);
65
+ const ageSeconds = (timestamp) => {
66
+ const age = now - Date.parse(timestamp);
67
+ return Number.isFinite(age) && age >= 0 ? Math.floor(age / 1000) : null;
68
+ };
63
69
  const entry = { sessionId: agent.sessionId, name: agent.name, ...workerObservation(snapshot, agent.sessionId, now),
64
70
  connection: currentConnection(agent.sessionId, snapshot.connections, now),
71
+ handoff: saved.handoff ? { ...saved.handoff, ageSeconds: ageSeconds(saved.handoff.updatedAt), selfReported: true } : null,
72
+ closeJob: saved.closeJob ? { ...saved.closeJob, ageSeconds: ageSeconds(saved.closeJob.updatedAt) } : null,
65
73
  report: report ? { status: report.status, summary: report.summary, updatedAt: report.updatedAt,
66
74
  ageSeconds: Number.isFinite(reportAge) && reportAge >= 0 ? Math.floor(reportAge / 1000) : null,
67
75
  selfReported: true } : null };
@@ -1 +1 @@
1
- {"version":3,"file":"worker-status.js","sourceRoot":"","sources":["../src/worker-status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,MAAM,MAAM,GAA2B;IACrC,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB;IAC9E,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB;IAClG,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,wBAAwB,EAAE,OAAO,EAAE,cAAc;CAC9F,CAAC;AACF,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AE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;YAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YAAC,MAAM;QAAC,CAAC;IAC3F,CAAC;IACD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM;QAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IACzF,gGAAgG;IAChG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,uBAAuB,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;IAClG,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -6,13 +6,13 @@
6
6
  },
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/comput-sh/pi-intercom.git"
9
+ "url": "git+https://github.com/mbundgaard/pi-intercom.git"
10
10
  },
11
- "homepage": "https://github.com/comput-sh/pi-intercom#readme",
11
+ "homepage": "https://github.com/mbundgaard/pi-intercom#readme",
12
12
  "bugs": {
13
- "url": "https://github.com/comput-sh/pi-intercom/issues"
13
+ "url": "https://github.com/mbundgaard/pi-intercom/issues"
14
14
  },
15
- "version": "0.5.2",
15
+ "version": "0.8.1",
16
16
  "description": "A coordinator-led workspace for Pi. Delegate to workers with separate contexts, evaluate their reports, and keep the main conversation focused—with the team visible alongside it.",
17
17
  "type": "module",
18
18
  "keywords": [
@@ -28,6 +28,7 @@
28
28
  "dist",
29
29
  "README.md",
30
30
  "references/observability.md",
31
+ "references/releasing.md",
31
32
  "references/roadmap.md",
32
33
  "references/v1-specification.md",
33
34
  "references/implementation-blocker.md"
@@ -40,7 +41,7 @@
40
41
  "typebox": "*"
41
42
  },
42
43
  "devDependencies": {
43
- "@earendil-works/pi-coding-agent": "0.84.4",
44
+ "@earendil-works/pi-coding-agent": "1.4.0",
44
45
  "@types/node": "^22.0.0",
45
46
  "typebox": "1.3.7",
46
47
  "typescript": "^5.9.3"
@@ -49,12 +50,17 @@
49
50
  "build": "node -e \"require('node:fs').rmSync('dist', {recursive:true, force:true})\" && tsc",
50
51
  "prepack": "npm run build",
51
52
  "typecheck": "tsc --noEmit",
52
- "test": "npm run build && node --test tests/core.test.mjs tests/integration.test.mjs tests/launcher.test.mjs tests/linux-launcher.test.mjs tests/activity.test.mjs tests/reports.test.mjs tests/worker-status.test.mjs tests/connections.test.mjs tests/version.test.mjs tests/monitor.test.mjs tests/monitor-view.test.mjs tests/monitor-launcher.test.mjs tests/extension.test.mjs tests/runtime-http.test.mjs tests/resume-storage.test.mjs tests/observability.test.mjs tests/snapshot.test.mjs tests/snapshot-security.test.mjs tests/observability-integration.test.mjs",
53
+ "test": "npm run build && node --test tests/release.test.mjs tests/release-workflow.test.mjs tests/published-release.test.mjs tests/core.test.mjs tests/root-isolation.test.mjs tests/integration.test.mjs tests/launcher.test.mjs tests/linux-launcher.test.mjs tests/activity.test.mjs tests/reports.test.mjs tests/worker-status.test.mjs tests/connections.test.mjs tests/reminders.test.mjs tests/handoff.test.mjs tests/pane-close.test.mjs tests/version.test.mjs tests/monitor.test.mjs tests/monitor-view.test.mjs tests/monitor-launcher.test.mjs tests/extension.test.mjs tests/runtime-http.test.mjs tests/resume-storage.test.mjs tests/observability.test.mjs tests/snapshot.test.mjs tests/snapshot-security.test.mjs tests/observability-integration.test.mjs",
53
54
  "test:host": "node --test tests/pi-cancellation-probe.test.mjs",
54
55
  "test:package": "node --test tests/packaged-monitor.test.mjs",
55
56
  "check:package": "npm run build && npm pack --dry-run --ignore-scripts && npm run test:package"
56
57
  },
57
58
  "dependencies": {
58
59
  "pi-intercom-tui": "npm:@earendil-works/pi-tui@0.84.4"
60
+ },
61
+ "overrides": {
62
+ "@earendil-works/pi-coding-agent@1.4.0": {
63
+ "undici": "8.12.2"
64
+ }
59
65
  }
60
66
  }
@@ -1,6 +1,6 @@
1
1
  # V1 cancellation capability blocked: Pi cancellation contract
2
2
 
3
- > **Current status:** The user subsequently approved implementing independent features. The supported core now exists; see the [historical implementation snapshot](https://github.com/comput-sh/pi-intercom/blob/main/references/implementation-progress.md) and [current README](../README.md). Stop/close remain disabled, failing before cancellation/shutdown; README also records the separate manual-compaction input-acceptance gap. The historical feasibility report below is preserved as evidence; its statements that no implementation exists describe the earlier run, not current project status.
3
+ > **Current status:** The user subsequently approved implementing independent features. The supported core now exists; see the [historical implementation snapshot](https://github.com/comput-sh/pi-intercom/blob/main/references/implementation-progress.md) and [current README](../README.md). Graceful stop and legacy close controls remain disabled, failing before cancellation/shutdown; README also records the separate manual-compaction input-acceptance gap. A subsequent explicit user decision authorizes a different Linux Herdr close workflow in npm 0.6.1: save a public handoff, await final turn settlement, verify the owned pane and attempt external pane closure. This does not call or repair Pi's abort/shutdown APIs. It has separate best-effort identity/process guarantees, documented in README; it does not guarantee all descendants terminate or atomic host quiescence. The historical feasibility report below is preserved as evidence; its statements that no implementation exists describe the earlier run, not current project status.
4
4
 
5
5
  ## Historical outcome
6
6
 
@@ -4,7 +4,7 @@ Intercom's terminal monitor is a standalone Node/pi-tui process above the coordi
4
4
 
5
5
  ## Terminal-first monitoring
6
6
 
7
- Coordinator startup checks its saved monitor ownership and either preserves the existing pane or creates one above the coordinator. Workers do not create monitors. The pane is named `Intercom monitor`; its generic label alone is not proof of ownership. Machine-local `monitor-*.json` files record the coordinator/workspace/pane identities and partial-launch state. Uncertain operations are fenced rather than blindly repeated.
7
+ Coordinator startup checks its saved monitor ownership only when the roster contains a worker, and either preserves the existing pane or creates one above the coordinator. An empty roster skips monitor setup; configuring the first worker triggers setup, and retained disconnected workers count. Existing monitor panes are not automatically closed when the roster becomes empty. Worker sessions do not create monitors. Coordinator Pi/Herdr names are preserved rather than overwritten with the internal Coordinator role. The pane is named `Intercom monitor`; its generic label alone is not proof of ownership. Machine-local `monitor-*.json` files record the coordinator/workspace/pane identities and partial-launch state. Uncertain operations are fenced rather than blindly repeated.
8
8
 
9
9
  The monitor refreshes from disk and performs bounded loopback identity checks, then schedules the next pass approximately three seconds after completion. It never launches model turns or resends messages. Probes do not write config or observation logs; cancelling the monitor aborts in-flight probes. Arrow keys select a worker; Enter toggles its details; Escape closes details before quitting, while q/Ctrl+C always quit the monitor only. Selection follows the worker's session ID across roster reorder. Details show configured responsibility, observations and explicit public worker reports, not inferred task state or approval controls.
10
10
 
@@ -58,7 +58,17 @@ Activity phases are `working`, `thinking`, `responding`, `tool`, `idle`. Details
58
58
 
59
59
  Checks expire to unknown after 30 seconds. Monitor batches rotate to avoid starvation; skipped checks may retain previous unexpired evidence. Saved-port changes/removal invalidate cached checks. Shared classification/sorting preserves config order within connected-or-unknown and disconnected groups. UI selection follows session ID across these order changes.
60
60
 
61
- Closing a worker does not remove config. Explicit resume uses the saved session ID, name and responsibility and requires user-confirmed closure (`confirmClosed:true`). A live matching health endpoint rejects duplicate resume. In-flight/uncertain submissions are fenced within this coordinator runtime until a later configured status announcement; preflight announcements do not qualify, and uncertain launch errors preserve the fence. Config/identity/lifecycle are rechecked before launch. These safeguards do not guarantee cross-process uniqueness, survive coordinator restart or certify OS process death. No automatic close, retry, restart or work assignment occurs.
61
+ Closing a worker does not remove config. Explicit resume uses the saved session ID, name and responsibility and requires user-confirmed closure (`confirmClosed:true`). A live matching health endpoint rejects duplicate resume. In-flight/uncertain submissions are fenced within this coordinator runtime until a later configured status announcement; preflight announcements do not qualify, and uncertain launch errors preserve the fence. Config/identity/lifecycle are rechecked before launch. These safeguards do not guarantee cross-process uniqueness, survive coordinator restart or certify OS process death. Connectivity monitoring never automatically closes, retries, restarts or assigns work. An explicit close request (0.6.1) may separately initiate the handoff workflow described below.
62
+
63
+ ## Public handoff and background pane-close jobs (0.6.1)
64
+
65
+ `Agent.handoff` saves only `{version, jobId, summary, updatedAt}`; the summary is explicitly public worker-authored context, at most 4000 characters. `Agent.closeJob` stores bounded workflow ID/state/timestamps and a fixed reason. Both remain alongside registration after a close. No PID, private session path, terminal ID or readiness nonce is saved in these public config fields. Config validation rejects extra metadata fields; snapshot/status views explicitly project supported fields. Old saved handoffs may precede a newer failed close job; they are not merged or treated as current acceptance.
66
+
67
+ Explicit `close_worker` returns acceptance while the coordinator extension continues in the background. It requests a correlated handoff, awaits atomic config-save acknowledgment, then requires a successful exact report tool-result ID in the current branch plus final `agent_settled`. The adapter reads only tool-result metadata (role, toolCallId, isError), never arguments, results or reasoning content. New input/agent starts invalidate readiness. No model polling on the coordinator is required.
68
+
69
+ Closing intent is durable before mutation. After final Linux Herdr pane/session/PID/start-identity checks, a nonce-bound worker commit is checked immediately before one pane-close command. No summary alone, timeout, save failure or busy/stale worker permits a close. Job deadlines are checked again at config publication and before pane mutation. Failed/uncertain outcomes preserve registration/handoff. Interrupted jobs are not replayed after reload; closing intent recovers as uncertain.
70
+
71
+ The monitor and JSON status expose public handoff age and close workflow separately from connectivity/activity/reports. `closed` means this workflow verified pane absence and original worker-process exit; it does not certify all descendants terminated. The workflow is available in npm 0.6.1 for Linux Herdr only. See README for retained race/flush limits and operator recovery requirements.
62
72
 
63
73
  ## Read-only JSON status
64
74
 
@@ -81,7 +91,7 @@ Readers consider only configured workers, at most 256 IDs and 8 KiB per file. Un
81
91
  - `agent_settled` supplies the idle boundary, not `agent_end`. Activity observations are not availability guarantees or assignment states.
82
92
  - `status.received` describes the reporting peer, not the event writer's own activity. It is not used as the writer's status.
83
93
  - Launch submission does not establish readiness. A correlation ID is not deduplication or a reply promise.
84
- - Stop/close remain disabled. Monitoring adds no cancellation, recovery, retries, commit or rollback.
94
+ - Graceful stop remains disabled. The explicit handoff-and-pane-close workflow is separate from monitoring; monitoring adds no cancellation, recovery, retries, commit or rollback.
85
95
 
86
96
  ## Storage bounds and failure behavior
87
97
 
@@ -0,0 +1,90 @@
1
+ # Tag-only npm releases
2
+
3
+ ## Authorization and scope
4
+
5
+ Obtain explicit authorization before committing, pushing, tagging or publishing. Preparing files or validating locally is not permission to release. Publishing does not install the extension or reload any Pi session; those require separate authorization.
6
+
7
+ This procedure applies to **new tags containing the tag-only workflow**. Historical tags retain their original workflow files. Never move an existing tag or rerun a legacy publisher to adopt this flow. Choose a new, unused version when the owner authorizes a release.
8
+
9
+ ## Automatic workflow
10
+
11
+ `.github/workflows/publish.yml` responds only to pushed `v*` tags. There are no GitHub Release or manual-dispatch triggers. Branch commits cannot publish; ordinary main/PR CI remains separate.
12
+
13
+ Both jobs check out the triggering `github.sha`, not latest main. The workflow requires an annotated tag and checks that its peeled commit, the event SHA's peeled commit and checked-out HEAD match. `scripts/verify-release.mjs` requires canonical stable `vX.Y.Z` with safe-integer components: no leading zeros, prereleases, build metadata or suffixes. The tag must match all three fields exactly:
14
+
15
+ - `package.json.version`
16
+ - `package-lock.json.version`
17
+ - `package-lock.json.packages[""].version`
18
+
19
+ Package names must also be `@comput/pi-intercom`. Missing or malformed fields fail closed, before dependency installation.
20
+
21
+ Windows and Linux run `npm ci`, typecheck, tests, **full-tree `npm audit --audit-level=low`**, and isolated package-content/install checks. Ordinary main/PR CI has the same audit gate so known findings can be caught before creating an immutable release tag. Any reported vulnerability blocks publication; do not omit development dependencies or lower the threshold to get a release through. Dependency remediation is separate reviewed work.
22
+
23
+ After successful validation, the Ubuntu publisher performs another clean install, audit and package check/build from the same commit. Tracked source modifications are rejected. It packs once into a runner-temporary directory, checks the pack metadata and SHA-512/SHA-1, retains that archive as a workflow artifact, then publishes **that exact archive**, with lifecycle scripts disabled and transport retries disabled for the publish command.
24
+
25
+ The workflow grants `contents: read`; only the publishing job also has `id-token: write`. It uses GitHub-hosted runners, Node 24 and npm 11 with Trusted Publishing and provenance. No stored npm token, token secret, token-bearing npmrc or token-based setup-node registry configuration is used.
26
+
27
+ ## npm Trusted Publisher
28
+
29
+ Configure/check this on the **`@comput/pi-intercom` package**, not just the npm account:
30
+
31
+ - Provider: GitHub Actions
32
+ - Organization/user: `mbundgaard`
33
+ - Repository: `pi-intercom`
34
+ - Workflow filename: `publish.yml` (not the full path)
35
+ - Environment: empty; this workflow does not declare one
36
+ - Allowed actions: direct `npm publish` must be permitted, not only staged publishing
37
+
38
+ The existing mapping may already match. Do not replace credentials, add a token fallback or change permissions without authorization. Provenance signing alone does not prove npm publishing authorization. Package repository metadata must match `https://github.com/mbundgaard/pi-intercom`.
39
+
40
+ ## Release procedure
41
+
42
+ The commands below are examples for a shell with Git/Node/npm. Substitute the reviewed version and exact commit. Do not execute the mutation steps without explicit owner authorization.
43
+
44
+ 1. Review the working tree, including new files, and the proposed release scope. Exclude `.pi-intercom/`, local credentials and machine state. Resolve security-audit blockers first.
45
+ 2. Choose a stable unused version. Successfully query npm's public version list and inspect previous release workflow outcomes; a network/authentication error is **not** evidence that a version is unused. Check both local tags and remote refs. If any earlier publication outcome is uncertain, stop and inspect it first; registry visibility may lag.
46
+ 3. Update `package.json` and both lockfile version fields together, for example `npm version X.Y.Z --no-git-tag-version`. Update the changelog in README's release-history section and relevant compatibility/upgrade notes. This does not create a tag.
47
+ 4. Run local validation:
48
+
49
+ ```sh
50
+ RELEASE_TAG=vX.Y.Z node scripts/verify-release.mjs
51
+ npm ci
52
+ npm run typecheck
53
+ npm test
54
+ npm audit --audit-level=low
55
+ npm run check:package
56
+ git diff --check
57
+ ```
58
+
59
+ On PowerShell, set `$env:RELEASE_TAG = 'vX.Y.Z'` before invoking the validator. Use the actual version, not literal placeholders.
60
+ 5. Confirm the proposed npm version and Git tag remain unused immediately before release. Example read-only checks:
61
+
62
+ ```sh
63
+ npm view @comput/pi-intercom versions --json --prefer-online
64
+ git tag --list vX.Y.Z
65
+ git ls-remote --tags origin refs/tags/vX.Y.Z 'refs/tags/vX.Y.Z^{}'
66
+ ```
67
+
68
+ Require successful network queries and inspect their output; do not interpret command failures as absence. Do not reuse an existing local or remote tag.
69
+ 6. With explicit authorization, stage only reviewed files, commit and push that release commit to main. Confirm main CI passes for **that exact SHA**, not an earlier green run. Do not publish yet if any required check fails.
70
+ 7. Create an annotated tag pointing to the reviewed release commit, then push only that tag:
71
+
72
+ ```sh
73
+ git tag -a vX.Y.Z <release-commit> -m "Release vX.Y.Z"
74
+ git push origin refs/tags/vX.Y.Z
75
+ ```
76
+
77
+ Never use a blanket `git push --tags`, move a release tag, or tag an unreviewed newer HEAD. The tag push itself starts publication. **Do not manually trigger a second run.** Complete one release before starting another; GitHub concurrency is not an unlimited release queue.
78
+ 8. Inspect the tag-triggered workflow, npm version metadata, downloaded artifact and provenance linkage as described below. A GitHub Release page can be added afterward for release notes; it is not the publishing trigger.
79
+
80
+ ## Verification and uncertainty
81
+
82
+ `scripts/verify-published.mjs` performs read-only verification after npm accepts the publish command. It compares the public archive byte-for-byte and by SHA-512 with the retained local archive built from the exact tag checkout, verifies registry integrity metadata (and SHA-1 when supplied), and checks decoded SLSA provenance linkage: archive subject digest, repository, source commit, workflow path, tag ref, and GitHub run/attempt URL.
83
+
84
+ The script accepts `--archive`, `--version`, `--commit`, `--repo`, `--workflow`, `--run-id` and `--run-attempt` for later verification against the retained artifact. The workflow supplies these values from its verified checkout and GitHub event. It does not run npm publish or any mutation command. Downloads are restricted to the expected HTTPS npm registry endpoints, without redirects or credentials, and have size/time limits.
85
+
86
+ Read-only polling for transient errors/visibility lag is bounded to 15 minutes and at most 31 attempts. A mismatch fails immediately. A timeout or missing verification evidence is **not proof that publication failed**. Preserve the workflow artifact and inspect the publish step, registry version and provenance before deciding what to do. Do not rerun a publishing job merely because its later verification step failed. Never blindly retry publication, move the tag or reuse a published version.
87
+
88
+ This is **artifact equality and decoded provenance-linkage verification**, not independent cryptographic verification of the DSSE signature, certificate chain or transparency-log inclusion. Do not describe it as such. The retained CI-built archive is the reference artifact; reproducing an archive locally with different npm/toolchain versions may yield different gzip bytes and is not an equivalent reference.
89
+
90
+ Report success only after workflow publication and the required artifact/linkage checks succeed. State any remaining verification limitation plainly. Installation and `/reload` remain separate actions.
@@ -19,13 +19,13 @@ This is the consolidated **target design**, authoritative over conflicting wordi
19
19
 
20
20
  Location: `<coordinator-root>/.pi-intercom/config.json`.
21
21
 
22
- - Discover by searching upward from the Pi working directory.
23
- - When genuinely absent, become coordinator and create it under the current working directory, which becomes the coordinator root. Do not infer a Git or solution root.
22
+ - Root-isolation revision (0.8.0): select only the config in the session working directory. Never search ancestors or infer a Git/home root. `--intercom-root` is a same-directory assertion: its canonical path must equal cwd before its config is read. It cannot authorize reading a parent config.
23
+ - Without an explicit workspace root, when the exact local config is genuinely absent, become coordinator and create it under the current working directory. Explicit workspace mode requires an existing valid config and never creates a replacement coordinator. Do not infer a Git or solution root.
24
24
  - Initial creation is atomic: only one session targeting the same path becomes coordinator. Other contenders wait for usable config and register as workers.
25
25
  - Invalid or unreadable config is an error, not absence. Leave it untouched.
26
26
  - The configuration is checked into source control. It includes session IDs and ports; do not split these into a separate runtime configuration.
27
27
  - Only coordinator extension code may write it. Workers read only. No attempt to restrict ordinary Pi shell/file tools.
28
- - Worker directories must be the coordinator root or descendants, stored relative to that root.
28
+ - Saved worker directories remain root-relative. Shared-roster worker create/resume requires the coordinator root itself; descendant launches are rejected before side effects. Old descendant entries/history are retained, not silently relocated.
29
29
  - Entries survive process closure. Saved Pi session paths are not stored; resume uses session ID and project directory.
30
30
 
31
31
  Required configuration information:
@@ -55,7 +55,7 @@ A known session restores its configured role. Any unknown session ID with existi
55
55
  ### Anonymous worker
56
56
 
57
57
  1. Coordinator launches a new Pi session in its project directory with this extension loaded.
58
- 2. Worker discovers shared config and starts a localhost endpoint using an OS-selected port.
58
+ 2. Worker verifies its explicit root equals its working directory, validates only that directory's config, then starts a localhost endpoint using an OS-selected port.
59
59
  3. Worker reports session ID, port, and project directory to the configured coordinator.
60
60
  4. Coordinator extension notifies its agent using normal prompt delivery if idle, steering if busy.
61
61
  5. Worker remains anonymous and waits. Registration does not create a placeholder config entry or authorize work.
package/src/config.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { mkdir, readFile, realpath, rename, unlink, open, link, stat } from 'node:fs/promises';
1
+ import { mkdir, readFile, realpath, rename, unlink, open, link, stat, lstat } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { randomUUID } from 'node:crypto';
4
+ import { fencedClose, validateHandoff, validateCloseJob, type Handoff, type CloseJob } from './handoff.js';
4
5
 
5
6
  export interface Agent {
6
7
  sessionId: string;
@@ -11,6 +12,8 @@ export interface Agent {
11
12
  /** Legacy browser dashboard field, accepted for migration only; removed at coordinator startup. */
12
13
  dashboardPort?: number;
13
14
  projectDirectory: string;
15
+ handoff?: Handoff;
16
+ closeJob?: CloseJob;
14
17
  }
15
18
  export interface Config { version: 1; multiplexer: 'herdr' | 'none'; agents: Agent[] }
16
19
  export const DEFAULT_DESCRIPTION = 'Coordinate workers, delegate work, and manage shared configuration.';
@@ -35,6 +38,8 @@ export function validateConfig(value: unknown): Config {
35
38
  text(a.sessionId, 'sessionId', 256); text(a.name, 'name', 128); text(a.description, 'description');
36
39
  if (a.name !== a.name.trim() || /[\r\n\x00-\x1f]/.test(a.name)) fail('invalid name');
37
40
  port(a.port); relativeDirectory(a.projectDirectory);
41
+ if (a.handoff !== undefined) { if (a.coordinator) fail('handoff is worker-only'); validateHandoff(a.handoff); }
42
+ if (a.closeJob !== undefined) { if (a.coordinator) fail('closeJob is worker-only'); validateCloseJob(a.closeJob); }
38
43
  if (a.dashboardPort !== undefined) {
39
44
  if (!a.coordinator) fail('dashboardPort is coordinator-only');
40
45
  port(a.dashboardPort);
@@ -63,27 +68,79 @@ export async function directory(root: string, requested: string): Promise<string
63
68
  if (!(await stat(target)).isDirectory()) fail('projectDirectory is not a directory');
64
69
  return rel.split(path.sep).join('/') || '.';
65
70
  }
71
+ export interface ConfigStoreOptions {
72
+ /** Publication seams for deterministic platform/race tests. */
73
+ platform?: NodeJS.Platform;
74
+ rename?: (from: string, to: string) => Promise<void>;
75
+ delay?: (milliseconds: number) => Promise<void>;
76
+ now?: () => number;
77
+ }
78
+ const RENAME_DELAYS = [10, 20, 40, 80] as const;
79
+ const RENAME_BUDGET_MS = 250;
66
80
  export class ConfigStore {
67
81
  readonly file: string;
68
82
  private tail: Promise<unknown> = Promise.resolve();
69
- constructor(readonly root: string) { this.file = path.join(root, '.pi-intercom', 'config.json'); }
83
+ private canonicalRoot?: string;
84
+ constructor(readonly root: string, private readonly options: ConfigStoreOptions = {}) { this.file = path.join(root, '.pi-intercom', 'config.json'); }
85
+ private async assertLocalPaths(): Promise<void> {
86
+ const root = await realpath(this.root);
87
+ if (this.canonicalRoot === undefined) this.canonicalRoot = root;
88
+ else if (root !== this.canonicalRoot) fail('config root canonical location changed');
89
+ // Reject existing escaping links/junctions before following them for any
90
+ // config access. These path checks are best effort, not TOCTOU protection.
91
+ for (const [location, directory] of [[path.dirname(this.file), true], [this.file, false]] as const) {
92
+ try { await lstat(location); }
93
+ catch (error) { if ((error as NodeJS.ErrnoException).code === 'ENOENT') continue; throw error; }
94
+ let resolved: string;
95
+ try { resolved = await realpath(location); }
96
+ catch { fail('local config path cannot be resolved safely'); }
97
+ const relative = path.relative(root, resolved);
98
+ if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) fail('local config path escapes session root');
99
+ const metadata = await stat(resolved);
100
+ if (directory ? !metadata.isDirectory() : !metadata.isFile()) fail('invalid local config path type');
101
+ }
102
+ }
103
+ async validateRoot(expectedCanonicalRoot: string): Promise<void> {
104
+ await this.assertLocalPaths();
105
+ if (this.canonicalRoot !== expectedCanonicalRoot) fail('config root canonical location changed');
106
+ }
70
107
  async read(): Promise<Config> {
71
- // Missing, malformed and unreadable files propagate; never overwrite them.
108
+ // Missing, malformed and unreadable local files propagate; no fallback.
109
+ await this.assertLocalPaths();
72
110
  return validateConfig(JSON.parse(await readFile(this.file, 'utf8')));
73
111
  }
74
112
  static async discover(cwd: string): Promise<ConfigStore | undefined> {
75
- let at = path.resolve(cwd);
76
- for (;;) {
77
- const store = new ConfigStore(at);
78
- try { await store.read(); return store; }
79
- catch (error) { if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error; }
80
- const parent = path.dirname(at); if (parent === at) return undefined; at = parent;
81
- }
113
+ const store = new ConfigStore(await realpath(cwd));
114
+ try { await store.read(); return store; }
115
+ catch (error) { if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error; return undefined; }
116
+ }
117
+ static async workspace(cwd: string, workspaceRoot: string): Promise<ConfigStore> {
118
+ text(workspaceRoot, 'workspaceRoot');
119
+ if (!path.isAbsolute(workspaceRoot)) fail('workspaceRoot must be absolute');
120
+ const root = await realpath(workspaceRoot);
121
+ if (!(await stat(root)).isDirectory()) fail('workspaceRoot is not a directory');
122
+ const current = await realpath(cwd);
123
+ if (path.relative(root, current) !== '') fail('workspaceRoot must equal the session working directory; parent configs are forbidden');
124
+ const store = new ConfigStore(root);
125
+ await store.read(); // Explicit worker mode must never create a replacement coordinator.
126
+ return store;
82
127
  }
83
128
  protected openTemporary(file: string) { return open(file, 'wx'); }
129
+ private async cleanupTemporary(temp: string): Promise<void> {
130
+ // A moved root may leave an unpublished temp behind. Never follow a
131
+ // replacement parent outside the pinned root just to clean up. This guard
132
+ // is independent of lifecycle/deadline expiry so ordinary failures clean up.
133
+ await this.assertLocalPaths();
134
+ const resolved = await realpath(temp);
135
+ const relative = path.relative(this.canonicalRoot!, resolved);
136
+ if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) fail('temporary config path escapes session root');
137
+ await unlink(temp);
138
+ }
84
139
  private async temporary(config: Config): Promise<string> {
85
140
  validateConfig(config);
141
+ await this.assertLocalPaths();
86
142
  await mkdir(path.dirname(this.file), { recursive: true });
143
+ await this.assertLocalPaths();
87
144
  const temp = `${this.file}.${randomUUID()}.tmp`;
88
145
  const handle = await this.openTemporary(temp);
89
146
  try {
@@ -94,7 +151,7 @@ export class ConfigStore {
94
151
  } catch (error) {
95
152
  // Cleanup failures must not replace the original write/sync/close error.
96
153
  await handle.close().catch(() => {});
97
- await unlink(temp).catch(() => {});
154
+ await this.cleanupTemporary(temp).catch(() => {});
98
155
  throw error;
99
156
  }
100
157
  }
@@ -104,14 +161,37 @@ export class ConfigStore {
104
161
  assertValid();
105
162
  const temp = await this.temporary({ version: 1, multiplexer: 'herdr', agents: [{ sessionId: id, name: 'Coordinator', coordinator: true, description: DEFAULT_DESCRIPTION, port: boundPort, projectDirectory: '.' }] });
106
163
  try {
107
- assertValid();
164
+ await this.assertLocalPaths(); assertValid();
108
165
  try { await link(temp, this.file); }
109
166
  catch (e) {
110
167
  if ((e as NodeJS.ErrnoException).code !== 'EEXIST') throw e;
111
- await this.read(); await unlink(temp); return false;
168
+ await this.read(); await this.cleanupTemporary(temp); return false;
169
+ }
170
+ await this.cleanupTemporary(temp); return true;
171
+ } catch (error) { await this.cleanupTemporary(temp).catch(() => {}); throw error; }
172
+ }
173
+ private async publish(temp: string, assertValid: () => void): Promise<void> {
174
+ const replace = this.options.rename ?? rename;
175
+ const now = this.options.now ?? (() => performance.now());
176
+ const delay = this.options.delay ?? (milliseconds => new Promise<void>(resolve => setTimeout(resolve, milliseconds)));
177
+ const started = now();
178
+ let originalError: unknown;
179
+ for (let attempt = 0; ; attempt++) {
180
+ // Windows readers can briefly deny replace-rename. Retry only publication
181
+ // of this already synced/closed temp, never the mutation or any OS action
182
+ // outside config persistence. The elapsed budget bounds retry initiation,
183
+ // not the duration of an already-submitted OS rename.
184
+ await this.assertLocalPaths(); assertValid();
185
+ if (attempt > 0 && now() - started >= RENAME_BUDGET_MS) throw originalError;
186
+ try { await replace(temp, this.file); return; }
187
+ catch (error) {
188
+ if ((this.options.platform ?? process.platform) !== 'win32' || (error as NodeJS.ErrnoException).code !== 'EPERM') throw error;
189
+ originalError ??= error;
190
+ const backoff = RENAME_DELAYS[attempt];
191
+ if (backoff === undefined || now() - started + backoff >= RENAME_BUDGET_MS) throw originalError;
192
+ await delay(backoff);
112
193
  }
113
- await unlink(temp); return true;
114
- } catch (error) { await unlink(temp).catch(() => {}); throw error; }
194
+ }
115
195
  }
116
196
  async update(id: string, mutate: (config: Config) => void | Promise<void>, assertValid: () => void = () => {}): Promise<Config> {
117
197
  const operation = this.tail.then(async () => {
@@ -120,9 +200,10 @@ export class ConfigStore {
120
200
  await mutate(c); assertValid(); validateConfig(c);
121
201
  const temp = await this.temporary(c);
122
202
  try {
123
- // Last check before publication; an already submitted OS rename cannot be undone.
124
- assertValid(); await rename(temp, this.file);
125
- } catch (error) { await unlink(temp).catch(() => {}); throw error; }
203
+ // Every publication attempt checks the lifecycle/deadline guard; an
204
+ // already submitted OS rename still cannot be undone.
205
+ await this.publish(temp, assertValid);
206
+ } catch (error) { await this.cleanupTemporary(temp).catch(() => {}); throw error; }
126
207
  return c;
127
208
  });
128
209
  this.tail = operation.catch(() => {}); return operation;
@@ -133,7 +214,14 @@ export class ConfigStore {
133
214
  const projectDirectory = await directory(this.root, values.projectDirectory);
134
215
  const a: Agent = { sessionId: values.sessionId, name: values.name, description: values.description, port: values.port, projectDirectory, coordinator: false };
135
216
  const index = c.agents.findIndex(old => old.sessionId === a.sessionId);
136
- if (index < 0) c.agents.push(a); else c.agents[index] = a;
217
+ if (index < 0) c.agents.push(a);
218
+ else {
219
+ const old = c.agents[index];
220
+ if (fencedClose(old.closeJob)) fail('worker close is active or uncertain; configuration is fenced');
221
+ if (old.handoff) a.handoff = old.handoff;
222
+ if (old.closeJob) a.closeJob = old.closeJob;
223
+ c.agents[index] = a;
224
+ }
137
225
  }, assertValid);
138
226
  }
139
227
  }