This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Split exports by dependency tier for 0.6.0

Move PtyServer from ./client to ./server so client-only imports
stay free of native addon dependencies. Add ./keys export for
browser-safe key resolution. The export structure is now cleanly
tiered: browser-safe (./protocol, ./keys), Node-only (./client),
and native addon (./server, ./testing, ./tui).

Nathan Herald (Apr 12, 2026, 10:48 PM +0200) 8b1bb701 28812ef7

+36 -15
+11 -5
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 - ## Unreleased 3 + ## 0.6.0 4 + 5 + ### Breaking changes 6 + - **`PtyServer` moved from `@myobie/pty/client` to `@myobie/pty/server`** — this keeps `./client` free of native addon dependencies (`node-pty`). Update imports: `import { PtyServer } from "@myobie/pty/server"` 7 + - **`resolveKey` and `parseSeqValue` are still in `@myobie/pty/client`** but also available standalone via the new `@myobie/pty/keys` export (browser-safe, zero dependencies) 4 8 5 9 ### Features 6 - - Add session tags: `pty run --tag owner=forge --tag env=dev -- command` sets key-value metadata on sessions, visible in `pty list --json` and persisted across exits. Tags are available in `SpawnDaemonOptions`, `ServerOptions`, and `SessionMetadata` for programmatic use (#12) 10 + - Add session tags: `pty run --tag owner=forge --tag env=dev -- command` sets key-value metadata on sessions, visible in `pty list --json` and persisted across exits and restarts. Tags are available in `SpawnDaemonOptions`, `ServerOptions`, and `SessionMetadata` for programmatic use (#12) 11 + 12 + ### Exports 13 + - Add `@myobie/pty/server` subpath export for `PtyServer` and `ServerOptions` (requires `node-pty` native addon) 14 + - Add `@myobie/pty/keys` subpath export for browser-safe key resolution (`resolveKey`, `parseSeqValue` — zero dependencies) 15 + - Add `@myobie/pty/protocol` subpath export for browser-safe wire protocol types (`PacketReader`, `MessageType`, encode/decode helpers) (#11, thanks @schickling) 7 16 8 17 ### Fixes 9 18 - Fix `resolveKey` silently dropping shift modifier for non-letter keys: `shift+return` now correctly produces CSI u encoding (`\x1b[13;2u`), `shift+up` produces `\x1b[1;2A`, etc. All modifier combinations (ctrl+shift, alt+shift, ctrl+alt+shift) now work for arrows, navigation keys, and control chars (#13, #14, thanks @schickling) 10 19 - Validate session `cwd` before spawning and surface explicit errors (`Working directory does not exist`, `Working directory is not a directory`, `Working directory is not searchable`) instead of failing silently with exit code 1 or misleading `posix_spawnp failed` messages (#9, #10, thanks @schickling) 11 20 - Lazy-load the interactive TUI module so non-interactive CLI commands like `pty list` don't crash with `uv_cwd` when launched from a deleted directory (#9, #10) 12 21 - Clarify the `posix_spawnp` error message to mention the actual PTY shell and cwd context instead of blaming the wrapped command 13 - 14 - ### Exports 15 - - Add `@myobie/pty/protocol` subpath export for browser-safe access to the wire protocol types (`PacketReader`, `MessageType`, encode/decode helpers) without pulling in Node-only dependencies (#11, thanks @schickling) 16 22 17 23 ## 0.5.0 18 24
+3 -1
README.md
··· 139 139 spawnDaemon, listSessions, getSession, 140 140 SessionConnection, sendData, peekScreen, queryStats, 141 141 EventFollower, readRecentEvents, 142 - resolveKey, 143 142 } from "@myobie/pty/client"; 143 + import { PtyServer } from "@myobie/pty/server"; // native addon (node-pty) 144 + import { resolveKey } from "@myobie/pty/keys"; // browser-safe 145 + import { PacketReader, MessageType } from "@myobie/pty/protocol"; // browser-safe 144 146 ``` 145 147 146 148 ### Managing sessions
+10 -4
docs/client.md
··· 4 4 5 5 ```typescript 6 6 import { SessionConnection, spawnDaemon, listSessions } from "@myobie/pty/client"; 7 + import { PtyServer } from "@myobie/pty/server"; 8 + import { resolveKey } from "@myobie/pty/keys"; 9 + import { PacketReader, MessageType } from "@myobie/pty/protocol"; 7 10 ``` 8 11 9 12 ## Session Management ··· 97 100 98 101 Wait for a session's Unix socket to appear on disk. 99 102 100 - ### `PtyServer` 103 + ### `PtyServer` (from `@myobie/pty/server`) 101 104 102 - The server class itself, for embedding a pty server directly (without the daemon process): 105 + The server class itself, for embedding a pty server directly (without the daemon process). 106 + This is a separate export because it requires `node-pty` (a native C++ addon): 103 107 104 108 ```typescript 105 - import { PtyServer } from "@myobie/pty/client"; 109 + import { PtyServer } from "@myobie/pty/server"; 106 110 107 111 const server = new PtyServer({ 108 112 name: "embedded", ··· 280 284 `NotificationEvent` adds `title?`, `body?`, `source?: "osc9" | "osc99" | "osc777"`. 281 285 `TitleChangeEvent` adds `value: string`. 282 286 283 - ## Keys 287 + ## Keys (also available via `@myobie/pty/keys`) 288 + 289 + These functions are also available as a standalone browser-safe import via `@myobie/pty/keys` (zero dependencies). 284 290 285 291 ### `resolveKey(spec: string): string` 286 292
+1 -1
flake.nix
··· 29 29 30 30 # Generated from package-lock.json. 31 31 # Regenerate with: nix run nixpkgs#prefetch-npm-deps -- package-lock.json 32 - npmDepsHash = "sha256-GURZuKFC4cuaI+RKJ3s4vLL/G1/1UrZXN9yhgGj7d2A="; 32 + npmDepsHash = "sha256-G+w8aIHp1GsNJb1tZwuyY638L6F5Hlp0neN8UwBMTLs="; 33 33 34 34 # node-pty has native code that needs these at build time 35 35 nativeBuildInputs = with pkgs; [ python3 pkg-config ];
+2 -2
package-lock.json
··· 1 1 { 2 2 "name": "@myobie/pty", 3 - "version": "0.5.0", 3 + "version": "0.6.0", 4 4 "lockfileVersion": 3, 5 5 "requires": true, 6 6 "packages": { 7 7 "": { 8 8 "name": "@myobie/pty", 9 - "version": "0.5.0", 9 + "version": "0.6.0", 10 10 "hasInstallScript": true, 11 11 "license": "MIT", 12 12 "dependencies": {
+9 -1
package.json
··· 1 1 { 2 2 "name": "@myobie/pty", 3 - "version": "0.5.0", 3 + "version": "0.6.0", 4 4 "description": "Persistent terminal sessions with detach/attach, plus a Playwright-style testing library for TUI apps", 5 5 "type": "module", 6 6 "license": "MIT", ··· 42 42 "types": "./dist/client-api.d.ts", 43 43 "default": "./dist/client-api.js" 44 44 }, 45 + "./server": { 46 + "types": "./dist/server.d.ts", 47 + "default": "./dist/server.js" 48 + }, 45 49 "./protocol": { 46 50 "types": "./dist/protocol.d.ts", 47 51 "default": "./dist/protocol.js" 52 + }, 53 + "./keys": { 54 + "types": "./dist/keys.d.ts", 55 + "default": "./dist/keys.js" 48 56 } 49 57 }, 50 58 "scripts": {
-1
src/client-api.ts
··· 11 11 12 12 // Session creation 13 13 export { spawnDaemon, resolveCommand, waitForSocket, type SpawnDaemonOptions } from "./spawn.ts"; 14 - export { PtyServer, type ServerOptions } from "./server.ts"; 15 14 16 15 // Session interaction (programmatic — no process.exit, no stdin/stdout) 17 16 export {