Shared runtime core for cli command modules.
| Previous API | 0.9.0 migration |
|---|---|
| cli catalog functions, capability and command-contract types | Import cli/core/contracts; cli/core/cli retains argument parsing and diagnostics. |
| checksum.run, checksum.run_cksum | Import cli/core/checksum/cli; checksum owns digest algorithms and digest_reader. |
| gzipops.help, gzipops.run | Import cli/core/gzipops/cli; codec entrypoints remain in gzipops. |
| netops.fetch*, FetchOptions, FeedbackMode, NetOpError | Use transfer, transfer_options and typed TransferError; callers own command feedback and exit-status policy. |
| process.pipe, redirect_from_file, redirect_to_file | Use the released moonbitlang/async/process APIs directly. |
| Redundant platform capability probes and stream-specific terminal wrappers | Use the applicable released filesystem/process APIs and platform.is_terminal(StandardStream). is_terminal and terminal_output_enabled are synchronous; terminal discovery remains unavailable. |
| Exposed LineScanner storage fields | Construct with LineScanner::new and consume with next; the scanner now wraps RecordReader. |
| Package/API | Contract | Current consumers |
|---|---|---|
| contracts | Capability types and command catalog, separate from argument parsing. | Workspace validation runner. |
| fswalk | Directory-handle ownership and explicit kind/size observations; no implicit pruning, sorting or extra metadata queries. | rg, find, tree and grep. |
| checksum/cli, gzipops/cli | Command record formats, options, diagnostics and execution. Parent packages own algorithms and streams. | The five checksum commands and gzip/gunzip/zcat. |
| bytesearch | Allocation-free byte scans/counts and reusable literal filters over explicit ranges; callers keep pattern storage unchanged while a finder uses it. | rg search/regex/line buffers, wc line counting; stream.count_byte retains its immutable-view entrypoint. |
| stream.RecordReader / RecordBatch | At most 1 MiB per read; synchronous record visitation over immutable storage. Retained views keep their backing block alive. | cut, uniq, rev, column and other bulk readers. |
| stream.LineScanner | An owned-record facade over the same parser, retaining 64 KiB reads. Use it when records survive the current batch. | sort, join, comm, head, jq, nl, paste and existing scanner clients. |
| stream.BlockWriter | Fixed output capacity; private storage cannot be reused during an awaited write. Failure/cancellation consumes the pending queue and poisons further writes; a deferred flush cannot replay a partial prefix. | rg stdout, column snapshot streams, nl, paste and comm. |
| tempio.Directory | Exclusive creation, invocation-owned cleanup, idempotent close after success. Close files before the directory. Cleanup failures propagate; each command chooses error precedence. | tac, column and sort. |
| tempio.copy_range | Exact positional extent copy with caller-owned scratch storage, 64-bit file offsets and completion before buffer reuse. A short extent is an error. | tac reverse output. |