Skip to content

Expose ./client subpath in package exports map (SessionConnection, spawnDaemon, peekScreen, queryStats, EventFollower) #6

Description

@schickling-assistant

Summary

The published @myobie/pty@0.4.1 exports map only lists ./testing and ./tui. The richer client API documented in docs/client.md (SessionConnection, spawnDaemon, peekScreen, queryStats, EventFollower, plus the MessageType/PacketReader/TERMINAL_SANITIZE protocol primitives) is not reachable from a consumer.

Repro

```ts
import { SessionConnection } from '@myobie/pty/client'
// ^ ERR_PACKAGE_PATH_NOT_EXPORTED
```

`dist/client.d.ts` exists in the published tarball but only re-exports the CLI-flavored helpers (`peek`, `send`, `queryStats`, `attach`) — not the programmatic `SessionConnection` class described in the docs. `dist/spawn.js`, `dist/sessions.js`, `dist/server.js`, `dist/protocol.js`, and `dist/keys.js` are also present in the tarball but not exposed via `exports`.

Why this matters

I'm building @overeng/pty-effect, an Effect-native wrapper around @myobie/pty. The ./testing Session API works great as a v0 surface, but the persistent-session model (named daemons, attach/detach, scrollback replay, peek/stats/events) is the part of @myobie/pty that fundamentally differs from node-pty and is the reason to depend on this library at all. Without exports map entries, downstream consumers can either (a) deep-import past the exports map (fragile and forbidden by pnpm/Node.js's exact-exports enforcement), or (b) wait.

Proposed fix

Add to package.json:

```json
"exports": {
"./testing": { "types": "./dist/testing/index.d.ts", "default": "./dist/testing/index.js" },
"./tui": { "types": "./dist/tui/index.d.ts", "default": "./dist/tui/index.js" },
"./client": { "types": "./dist/client.d.ts", "default": "./dist/client.js" },
"./protocol": { "types": "./dist/protocol.d.ts", "default": "./dist/protocol.js" },
"./keys": { "types": "./dist/keys.d.ts", "default": "./dist/keys.js" }
}
```

If the docs in docs/client.md are aspirational (i.e. SessionConnection/spawnDaemon/EventFollower haven't been written yet), it would be helpful to either (a) ship them alongside the exports change, or (b) flag in the README which client APIs are landed vs. planned. Happy to help with the wrapper-side validation.

Related

  • Tracking issue for EventFollower specifically: filed separately.

Filed on behalf of @schickling while building @overeng/pty-effect.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions