Add 10 new tasks under tasks/architecture/ for Phase 0a (ADR writing): - 9 ADR tasks (026-034) with dependency-ordered structure - 1 review checkpoint task before Phase 0b spec writing ADR dependency graph (3 generations): Gen 1 (parallel): 026, 029, 030, 031, 032, 034 Gen 2 (depends on 029): 027, 028 Gen 3 (depends on 027+028): 033 Gen 4: review checkpoint Also mark all 34 prior implementation tasks as completed — they were finished but still showing as pending in the taskgraph.
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 | completed |
|
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