Skip to content

Add Deno terminal support - #6715

Merged
tim-smart merged 1 commit into
mainfrom
agent/codex-engineer/0f7c4c9c
Jul 28, 2026
Merged

Add Deno terminal support#6715
tim-smart merged 1 commit into
mainfrom
agent/codex-engineer/0f7c4c9c

Conversation

@tim-smart

@tim-smart tim-smart commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add DenoTerminal backed by the shared Node terminal implementation
  • keep NodeTerminal.readInput alive until stdin ends under Deno
  • port the seven terminal cases and add DenoStdio interoperability coverage

Testing

  • pnpm lint
  • pnpm check
  • deno check .
  • deno task test --run test/DenoTerminal.test.ts
  • pnpm vitest run --root packages/platform-node-shared test/NodeTerminal.test.ts
  • bun run vitest run --root packages/platform-node-shared test/NodeTerminal.test.ts

Closes EFF-142

Summary by CodeRabbit

  • New Features

    • Added terminal support for Deno, including prompts, key input, and line reading.
    • Exported the Deno terminal functionality for use by applications.
    • Added interoperability between Deno standard input and terminal operations.
  • Bug Fixes

    • Improved handling of closed or exhausted standard input to prevent terminal reads from hanging.
    • Ensured buffered input is delivered and terminal resources are released correctly.

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 28, 2026
@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 334815f

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

This PR includes changesets to release 29 packages
Name Type
@effect/platform-deno Patch
@effect/platform-node-shared Patch
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue 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/docgen Patch
@effect/openapi-generator 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 Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Deno-specific terminal module backed by NodeTerminal, exposes it through platform-deno, adjusts stdin reader lifetime handling, and adds process-based tests for input, EOF, disposal, buffering, and stdio interoperability.

Changes

Deno terminal support

Layer / File(s) Summary
Shared stdin lifecycle handling
packages/platform-node-shared/src/NodeTerminal.ts
Keeps active input readers alive until stdin ends, then clears the keep-alive interval and closes the queue; finalization also clears the interval.
Deno terminal module and package wiring
packages/platform-deno/src/DenoTerminal.ts, packages/platform-deno/src/index.ts, packages/platform-deno/package.json, packages/platform-deno/tsconfig.json, .changeset/eff-142-deno-terminal.md
Adds the Deno terminal constructor and layer, exports the module, adds the shared package reference, and records patch releases.
Deno terminal behavior validation
packages/platform-deno/test/DenoTerminal.test.ts, packages/platform-deno/test/fixtures/deno-terminal.ts
Tests prompts, buffered input, EOF and QuitError behavior, readline disposal, sequential reads, and DenoStdio interoperability through a Deno fixture.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DenoTerminalFixture
  participant DenoTerminal
  participant NodeTerminal
  participant Stdin
  DenoTerminalFixture->>DenoTerminal: Request terminal input
  DenoTerminal->>NodeTerminal: Create scoped reader
  NodeTerminal->>Stdin: Read input and monitor EOF
  Stdin-->>NodeTerminal: Data or end event
  NodeTerminal-->>DenoTerminalFixture: Input value or QuitError
Loading

Possibly related PRs

  • Effect-TS/effect#6676: Introduces shared NodeTerminal stdin-end handling exercised by the Deno terminal tests.
  • Effect-TS/effect#6679: Contains related NodeTerminal changes for preserving buffered input across sequential reads.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/platform-deno/test/DenoTerminal.test.ts`:
- Around line 76-78: Update the readInput test around the terminal.readInput
fixture to use a readiness handshake: wait for the fixture to emit READY after
acquiring readInput, then send the keypresses, and keep stdin open until the
result is emitted. Replace the spawnSync-based input flow so the test exercises
delayed input on an open pipe and can detect premature Deno exit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8190701-4869-46be-922e-aa9a2785a2ea

📥 Commits

Reviewing files that changed from the base of the PR and between 6eba7ec and 334815f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/eff-142-deno-terminal.md
  • packages/platform-deno/package.json
  • packages/platform-deno/src/DenoTerminal.ts
  • packages/platform-deno/src/index.ts
  • packages/platform-deno/test/DenoTerminal.test.ts
  • packages/platform-deno/test/fixtures/deno-terminal.ts
  • packages/platform-deno/tsconfig.json
  • packages/platform-node-shared/src/NodeTerminal.ts

Comment thread packages/platform-deno/test/DenoTerminal.test.ts
@github-project-automation github-project-automation Bot moved this from Discussion Ongoing to Waiting on Author in PR Backlog Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

File Name Current Size Previous Size Difference
basic.ts 6.63 KB 6.63 KB 0.00 KB (0.00%)
batching.ts 9.42 KB 9.42 KB 0.00 KB (0.00%)
brand.ts 6.31 KB 6.31 KB 0.00 KB (0.00%)
cache.ts 10.12 KB 10.12 KB 0.00 KB (0.00%)
config.ts 19.90 KB 19.90 KB 0.00 KB (0.00%)
differ.ts 20.03 KB 20.03 KB 0.00 KB (0.00%)
http-client.ts 20.94 KB 20.94 KB 0.00 KB (0.00%)
logger.ts 10.28 KB 10.28 KB 0.00 KB (0.00%)
metric.ts 8.55 KB 8.55 KB 0.00 KB (0.00%)
optic.ts 7.46 KB 7.46 KB 0.00 KB (0.00%)
pubsub.ts 14.26 KB 14.26 KB 0.00 KB (0.00%)
queue.ts 11.09 KB 11.09 KB 0.00 KB (0.00%)
schedule.ts 10.27 KB 10.27 KB 0.00 KB (0.00%)
schema-class.ts 18.86 KB 18.86 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 28.78 KB 28.78 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 25.09 KB 25.09 KB 0.00 KB (0.00%)
schema-string-transformation.ts 12.95 KB 12.95 KB 0.00 KB (0.00%)
schema-string.ts 10.65 KB 10.65 KB 0.00 KB (0.00%)
schema-template-literal.ts 14.85 KB 14.85 KB 0.00 KB (0.00%)
schema-toArbitraryLazy.ts 21.66 KB 21.66 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 24.10 KB 24.10 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 19.00 KB 19.00 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 18.73 KB 18.73 KB 0.00 KB (0.00%)
schema-toFormatter.ts 18.59 KB 18.59 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 22.23 KB 22.23 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 19.27 KB 19.27 KB 0.00 KB (0.00%)
schema.ts 18.12 KB 18.12 KB 0.00 KB (0.00%)
stm.ts 12.05 KB 12.05 KB 0.00 KB (0.00%)
stream.ts 9.37 KB 9.37 KB 0.00 KB (0.00%)

@tim-smart
tim-smart merged commit 75f340e into main Jul 28, 2026
26 of 27 checks passed
@tim-smart
tim-smart deleted the agent/codex-engineer/0f7c4c9c branch July 28, 2026 21:30
@github-project-automation github-project-automation Bot moved this from Waiting on Author to Done in PR Backlog Jul 28, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant