Rename all crates, CLI commands, constants, type names, doc comments, and documentation from wraith to alknet. Includes wire-protocol changes: ALPN wraith-ssh -> alknet-ssh, reserved destination prefix wraith- -> alknet-, SSH auth username wraith -> alknet.
2.1 KiB
2.1 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||
|---|---|---|---|---|---|---|---|---|---|
| napi/connect-function | Implement NAPI connect() — single SSH channel as Duplex stream | pending |
|
moderate | high | component | implementation |
Description
Implement the NAPI connect() function per ADR-007. This is fundamentally different from CLI alknet connect:
- NAPI
connect(): Opens a single SSH channel and returns it as a Node.jsDuplexstream. No SOCKS5 server, no port forwarding. The caller reads and writes bytes directly. - CLI
alknet connect: Full SSH client session with SOCKS5 server and port forwarding.
The function accepts AlknetConnectOptions and returns Promise<Duplex>. The NAPI layer handles transport selection, SSH authentication, and channel setup, then hands the caller a stream.
Acceptance Criteria
#[napi]functionconnect(options: AlknetConnectOptions) -> Result<DuplexStream>incrates/alknet-napi/src/connect.rsAlknetConnectOptionsstruct with napi fields:server,peer,transport,identity,tlsServerName,insecure,irohRelay,proxy- Transport creation from options (tcp, tls, iroh) — same logic as CLI but programmatic
- SSH client connection: create transport stream, authenticate, open single
direct_tcpipchannel - Channel returned as
napi::DuplexStreamfor JavaScript consumption - Key material:
identityfield accepts file path (string) orBuffer(in-memory data) per ADR-011 - Error marshalling: Rust errors become JavaScript exceptions with descriptive messages
- TypeScript type:
(options: AlknetConnectOptions) => Promise<Duplex> - Integration test from JS: connect to a test server, write/receive bytes through stream
References
- docs/architecture/napi-and-pubsub.md — NAPI connect() spec, TypeScript interfaces
- docs/architecture/decisions/007-napi-single-stream.md — single duplex stream rationale
- docs/architecture/decisions/016-napi-expose-connect-and-serve.md — both connect() and serve()
Notes
To be filled by implementation agent
Summary
To be filled on completion