Skip to content

feat(sdk): extract openshell-sdk crate#1862

Open
maxdubrinsky wants to merge 1 commit into
mainfrom
md/openshell-sdk-crate
Open

feat(sdk): extract openshell-sdk crate#1862
maxdubrinsky wants to merge 1 commit into
mainfrom
md/openshell-sdk-crate

Conversation

@maxdubrinsky

Copy link
Copy Markdown
Collaborator

Summary

Extracts a new openshell-sdk Rust crate from the gRPC client plumbing that lived in openshell-cli, and refactors the CLI and TUI to consume it. This is RFC 0005, Phase 1 — the shared client core — with no TypeScript; the napi binding (@openshell/sdk), examples, and CI follow in a separate PR.

The SDK owns gRPC channel construction, TLS material handling, request interceptors, OIDC token refresh (single-flight), and the Cloudflare Access tunnel. openshell-cli/src/{tls.rs,oidc_auth.rs} shrink to thin wrappers over the SDK, and openshell-core/src/auth.rs moves into it. CLI and TUI user-facing behavior is unchanged.

Related Issue

Changes

  • New crates/openshell-sdk/: typed gRPC client (OpenShellClient), TLS resolver, OidcRefresher with single-flight semantics, edge-tunnel dialer, a raw escape hatch, error taxonomy, and curated types. Crate README.md included.
  • openshell-cli: consumes the SDK; tls.rs / oidc_auth.rs become thin wrappers.
  • openshell-tui: consumes the SDK.
  • openshell-core: auth.rs moves into the SDK.
  • AGENTS.md: architecture-table row for the new crate.

Testing

  • mise run pre-commit passes (clippy -D warnings, fmt, full test suite, markdown lint, license headers)
  • Unit tests added/updated — 3 unit + 10 mock-gateway integration tests in openshell-sdk
  • E2E tests added/updated (if applicable) — N/A; client-side refactor, CLI/TUI behavior unchanged. Per the RFC's Phase 1 exit criteria, the existing CLI/TUI test suite is the regression surface.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable) — new crate README.md + AGENTS.md architecture table

Per RFC 0005, lift the gRPC client, TLS, OIDC, edge-tunnel, and refresh
plumbing out of openshell-cli into a new openshell-sdk crate. CLI and
TUI now consume the SDK; openshell-cli/src/{tls.rs,oidc_auth.rs} shrink
to thin wrappers over the SDK's transport and OIDC modules.

- New crate openshell-sdk exposes a typed gRPC client, TLS resolver,
  OidcRefresher with single-flight semantics, edge-tunnel dialer, and a
  Sandbox-API surface that mirrors the existing CLI behavior.
- crates/openshell-core/src/auth.rs moves into the SDK as auth.rs.
- crates/openshell-cli/src/edge_tunnel.rs moves into the SDK as
  edge_tunnel.rs.

Tests: 3 unit + 10 mock-gateway integration tests in openshell-sdk.
Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
@maxdubrinsky maxdubrinsky requested review from a team, derekwaynecarr and mrunalp as code owners June 10, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant