Skip to content

Expose terminal state through Stdio - #7090

Merged
tim-smart merged 2 commits into
mainfrom
agent/codex-engineer/aca78b52
Aug 6, 2026
Merged

Expose terminal state through Stdio#7090
tim-smart merged 2 commits into
mainfrom
agent/codex-engineer/aca78b52

Conversation

@tim-smart

Copy link
Copy Markdown
Contributor

Summary

  • add lazy stdin/stdout terminal-state effects to the public Stdio service
  • implement Node/Bun and Deno runtime detection without leaking runtime globals across the abstraction
  • provide backwards-compatible Stdio.make defaults and deterministic layerTest overrides
  • cover defaults, overrides, and lazy runtime evaluation

Validation

  • pnpm check
  • pnpm lint
  • pnpm vitest run --project effect packages/effect/test/Stdio.test.ts
  • pnpm vitest run --project @effect/platform-node-shared
  • deno task test run --project @effect/platform-deno

Closes EFF-532

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b22ed7f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
effect Patch
@effect/platform-node-shared Patch
@effect/platform-deno Patch
@effect/ai-anthropic Patch
@effect/ai-openai Patch
@effect/ai-openai-compat Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/vitest Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-slopcop effect-slopcop Bot added 4.0 enhancement New feature or request labels Aug 6, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This PR adds new public API surface to Stdio but does not include a changeset, which is required for exported API changes in this repo.

Reviewed changes

  • Added stdinIsTerminal and stdoutIsTerminal effects to the public Stdio service interface and made them optional in Stdio.make with false defaults.
  • Implemented lazy terminal detection for Node/Bun (process.std*.isTTY) and Deno (Deno.std*.isTerminal()).
  • Added tests for defaults, overrides, and lazy runtime evaluation across effect, platform-node-shared, and platform-deno.

⚠️ Missing changeset

Exported type/API changes require a changeset in .changeset/. Add one covering effect, @effect/platform-node-shared, and @effect/platform-deno (or the relevant fixed group) describing the new terminal-state effects.

Technical details
# Missing changeset for Stdio terminal state

## Affected sites
- `packages/effect/src/Stdio.ts` — new `stdinIsTerminal`/`stdoutIsTerminal` interface fields
- `packages/platform-node-shared/src/NodeStdio.ts` — Node/Bun implementation
- `packages/platform-deno/src/DenoStdio.ts` — Deno implementation

## Required outcome
- A changeset is added under `.changeset/` (existing pre-release changesets live in `.changeset/pre/`) describing the new public API and bumping the affected packages.
- The changeset follows the format used by recent pre-release changesets such as `.changeset/pre/eff-143-deno-stdio.md`.

## Suggested approach (optional)
Example `.changeset/pre/eff-532-stdio-terminal.md`:
```md
---
"effect": patch
"@effect/platform-node-shared": patch
"@effect/platform-deno": patch
---

Expose `stdinIsTerminal` and `stdoutIsTerminal` effects through the `Stdio` service.
```

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
basic.ts 6.92 KB 6.92 KB 0.00 KB (0.00%)
batching.ts 9.72 KB 9.72 KB 0.00 KB (0.00%)
brand.ts 6.40 KB 6.40 KB 0.00 KB (0.00%)
cache.ts 10.59 KB 10.59 KB 0.00 KB (0.00%)
config.ts 20.62 KB 20.62 KB 0.00 KB (0.00%)
differ.ts 20.21 KB 20.21 KB 0.00 KB (0.00%)
http-client.ts 21.50 KB 21.50 KB 0.00 KB (0.00%)
logger.ts 10.81 KB 10.81 KB 0.00 KB (0.00%)
metric.ts 8.86 KB 8.86 KB 0.00 KB (0.00%)
optic.ts 7.25 KB 7.25 KB 0.00 KB (0.00%)
pubsub.ts 14.86 KB 14.86 KB 0.00 KB (0.00%)
queue.ts 11.54 KB 11.54 KB 0.00 KB (0.00%)
schedule.ts 10.71 KB 10.71 KB 0.00 KB (0.00%)
schema-class.ts 19.14 KB 19.14 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 28.98 KB 28.98 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 25.28 KB 25.28 KB 0.00 KB (0.00%)
schema-string-transformation.ts 13.31 KB 13.31 KB 0.00 KB (0.00%)
schema-string.ts 10.85 KB 10.85 KB 0.00 KB (0.00%)
schema-template-literal.ts 15.08 KB 15.08 KB 0.00 KB (0.00%)
schema-toArbitraryLazy.ts 21.93 KB 21.93 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 24.33 KB 24.33 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 19.17 KB 19.17 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 18.98 KB 18.98 KB 0.00 KB (0.00%)
schema-toFormatter.ts 18.86 KB 18.86 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 22.58 KB 22.58 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 19.48 KB 19.48 KB 0.00 KB (0.00%)
schema.ts 18.40 KB 18.40 KB 0.00 KB (0.00%)
stm.ts 12.59 KB 12.59 KB 0.00 KB (0.00%)
stream.ts 9.67 KB 9.67 KB 0.00 KB (0.00%)

@tim-smart
tim-smart merged commit b206fa5 into main Aug 6, 2026
1 check passed
@tim-smart
tim-smart deleted the agent/codex-engineer/aca78b52 branch August 6, 2026 21:17

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Added .changeset/eff-532-stdio-terminal.md covering effect, @effect/platform-node-shared, and @effect/platform-deno at patch level, addressing the missing-changeset feedback from the prior review.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

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

Labels

4.0 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant