# NOTICE dsh-intercom is derived in part from [pi-intercom](https://github.com/nicobailon/pi-intercom), Copyright (c) 2026 Nico Bailon, licensed under the MIT License. The following files are vendored (copied and adapted) from pi-intercom: - `broker/` — the intercom broker, client, framing, protocol, spawn, paths, extension-state and runtime-claim modules, including their tests (`broker/ask-timeout.ts` replaces the upstream `config.ts` ask-timeout helper) - `types.ts`, `cwd.ts` (and `cwd.test.ts`) — shared protocol types and the same-directory helper The following files are ported (rewritten against the dsh/Cordis host) from pi-intercom: - `src/config.ts` — from upstream `config.ts`; malformed config fails closed (`inboundTrigger: "never"`) instead of throwing, and `confirmSend` is a documented no-op (dsh's host-level tool-approval flow is the equivalent) - `src/reply-tracker.ts` — from upstream `reply-tracker.ts`; `activateTurnContext` is a dsh addition driven by `agent/inbox/claimed` - `tests/reply-tracker.test.ts`, `tests/config.test.ts`, `tests/intercom.integration.test.ts` — from the corresponding upstream tests; integration parts exercising non-vendored pi modules (pi extension harness, subagent supervisor, tmux, TUI overlays, extension bus) are dropped Adaptations relative to upstream: - Environment variables renamed: `PI_CODING_AGENT_DIR` → `DSH_HOME`, `PI_INTERCOM_*` → `DSH_INTERCOM_*` - State directory default changed from `~/.pi/agent` to `~/.dsh` - Windows named-pipe prefix `pi-intercom-` → `dsh-intercom-`; protocol name `"pi-intercom"` → `"dsh-intercom"` - Broker launch no longer resolves tsx/npx: the default launch is `node lib/broker/broker.js` via `process.execPath` (custom `brokerCommand`/`brokerArgs` overrides are preserved) - `extension-state.ts`: temp state file is opened `r+` instead of `r` so the durability `fsync` works on Windows (upstream opened it read-only, which fails with EPERM there) - `broker/extension.test.ts`, `broker/abuse.test.ts`: the broker under test is spawned as a direct child via `node --import tsx` instead of the tsx CLI wrapper, and broker teardown escalates SIGTERM to SIGKILL after 2s — the wrapper could swallow SIGTERM on unix and orphan the broker, which hung CI - `broker/abuse.test.ts`: raw probe sockets record `error` events (e.g. ECONNRESET when the broker destroys an abusive connection) instead of letting the unhandled event crash the test - `broker/spawn.test.ts`: the fake-broker cleanup retries `rmSync` on EBUSY/ENOTEMPTY because the just-exited process can still hold the directory on Windows The full MIT license text is in `LICENSE`.