@ai-ecoverse/wasi-slicc

中文文档
1.61.14发布于 2026/11/06Apache-2.0零依赖构建来源已验证近 30 天下载 2万

slicc's prompt, watch and abort for seven's kernel: slicc.wasm (WASI preview1) and its host module

原始使用文档

@ai-ecoverse/wasi-slicc

slicc for seven's kernel, built from ai-ecoverse/slicc-cli at the same version.

slicc also runs inside seven's kernel, so that one seven's agent or user can prompt, watch and abort another seven's agent, and see and manage this seven's own tray. That build is slicc.wasm, slicc-cli's client commands compiled with GOOS=wasip1 GOARCH=wasm and CGO_ENABLED=0, and it ships as the npm package @ai-ecoverse/wasi-slicc, at slicc-cli's own version. seven's page holds the WebRTC link; slicc only reaches the page's link facade.

slicc <join-url> prompt [--allsettled <quiet>] [--steer | --reject] [--thinking] [--json] [--plain] <text>|@file|-
slicc <join-url> watch [--thinking] [--json] [--plain] [--since <entry-id>]
slicc <join-url> wait [--allsettled <quiet>] [--timeout <limit>] [--json]
slicc <join-url> abort
slicc tray [--json]
slicc tray url
slicc tray rotate
slicc tray unlink <device>
slicc tray retry
slicc --version
slicc --help
  • Commands: prompt, watch, wait and abort with a join URL behave as in Remote control: the same flags, output, styling, --json events, resuming and exit codes, from the same code. The differences:
    • Ctrl-C ends slicc with 130 (the kernel's default for SIGINT), watch included, and a running prompt goes on in the other seven. --abort-on-interrupt isn't offered.
    • Exit 3 covers the facade's own refusals too. When the facade gives a message (unlock the vault to continue, or the other seven's refusal), slicc prints it instead of the Linked devices hint.
    • A terminal is a standard stream that is a character device. Styling then follows TERM, NO_COLOR and --plain as usual.
  • slicc tray: this seven's tray, the leader's view (SLICC six's host). It asks the facade with the tray kind (§5.16), so it takes no join URL.
    • slicc tray prints the tray's state (off, connecting, ready, reconnecting or failed) and its hub origin, the current exit when it is a device or a tailnet node, and one line per device: DEVICE (its fingerprint, as 3fa9…c210), NAME, HOST (<label>.slicc.internal), MODE, STATE (connecting, connected or offline) and OFFERS (exit when the device offers to be the exit). --json prints seven's answer as one line of JSON.
    • slicc tray url prints the join URL and nothing else, so slicc tray url > /dev/clipboard copies it. It is the one deliberate exception to "the join URL is never printed": nothing else prints it, slicc tray and --json included, so it reaches a transcript only when asked for. It prints only an answer that is a valid join URL without control characters, and exits 1 otherwise.
    • Whatever seven answers, slicc doesn't trust it to keep the rule. slicc tray, --json and the error messages replace any join URL in the answer with <join-url>, and strip control characters and terminal escapes from names and messages. --json also drops url, join, joinUrl, joinCommand, followUrl and webhookUrl keys, wherever they are, and prints one line.
    • slicc tray rotate makes a new join URL; the old one stops working (SLICC six's host reset). It prints nothing on stdout, and made a new join URL; … on stderr. unlink and retry also confirm on stderr.
    • slicc tray unlink <device> drops one device, as Linked devices' Unlink does. <device> is a fingerprint, a unique prefix of one (colons and case ignored), or exactly the short form slicc tray shows (3fa9…c210, or 3fa9...c210). slicc asks for the status first and matches there, then sends the full id. No match or more than one exits 1.
    • slicc tray retry reconnects the tray's links, as the Reconnect button does.
    • Not here: choosing the exit (that's routing, not tray state), and SLICC six's host join and host leave: a seven follower runs no kernel or agent of its own, so following stays with #follow= and the UI's Leave.
    • Exit status: 0, 1 on failure (ENOTCONN when the tray isn't connected, a facade that doesn't answer within 1 minute, or 5 minutes for rotate and unlink, which seven may ask you to approve), 2 for bad usage, 3 when seven refuses (EACCES).
  • Everything else exits 2 with slicc: <command> isn't available inside seven: follow, attach, open, browsers, the default flow, update, install, and prompt, watch, wait or abort without a join URL. --help lists only what works there.
  • What the build leaves out (build constraints): pion and the link, CDP, SSH, mounts, the kernel listener, the policy, browser discovery, telemetry and updates.

The link facade. slicc reads its address from SLICC_LINK_URL only, as tcp://127.0.0.1:<port> on the kernel's loopback (any 127.x address, or localhost). Without it, or with another shape, slicc exits 1. Each agent stream (see agent) is one connection, carrying records of a u8 type, a u32 big-endian length and the payload, both ways:

  • 1, control: JSON, at most 64 KiB.
    • slicc's first record is { "v": 1, "join": "<join-url>", "open": { "kind": "agent", "op": … } }, where open is the stream's OPEN, length for long prompts included. The join URL goes only there, never in an address, a log or an error.
    • For slicc tray, it is { "v": 1, "open": { "kind": "tray", "op": … } }, without join. The page answers with one control record, { "opened": <result> } or a reset, and slicc closes the connection (see §5.16).
    • The page answers { "opened": { … } } (the OPENED) or { "reset": "ERRNO: message" }. A reset may also come later, as the stream's RESET.
    • Without an answer within 1 minute, slicc gives up: seven's link facade didn't answer within 1m0s, exit 1 (watch reconnects). slicc tray rotate and unlink wait 5 minutes, since seven may ask for approval first.
  • 2, data: the stream's DATA: a long prompt's bytes up, and NDJSON events down. slicc sends records of at most 64 KiB, and takes records of up to 16 MiB; record boundaries carry no meaning.
  • 3, end: that side's END. slicc closes the connection after both ends or a reset.
  • Errors: an unknown type, a control record over 64 KiB, any record over 16 MiB, a control record that isn't JSON, or a later control record that isn't a reset makes slicc send { "reset": "EPROTO" } and fail the stream. ENOTCONN (the tray can't be reached) fails prompt and abort with exit 1; watch says lost the link to seven; reconnecting and retries with its usual backoff, as it does when a connection drops.

The host module. Go on wasip1 can't open sockets, so the package's host/slicc-host.mjs gives slicc.wasm the slicc_host imports, on the kernel's loopback, through the imports-module API's ctx.net.connect and ctx.net.ready and the fd-read, fd-write, fd-select and fd-close calls (slicc-kernel 1.92.0 or later, the package's engines.slicc-kernel): probe, connect(host, port) (loopback only, non-blocking; localhost is connected as 127.0.0.1, never by name, so /etc/hosts can't point it elsewhere), connected(fd, timeout), read(fd, buffer, timeout), write(fd, buffer, timeout) (non-blocking) and close(fd). Connects, reads and writes wait at most 100 ms at a time, so signals, timeouts and a reset that arrives while a long prompt uploads get through. Without the module, slicc exits 1 with this runtime has no slicc_host module. On a kernel older than 1.92.0, which has no ctx.net, connect answers ENOSYS, so slicc exits 1 with can't reach seven's link facade.

The package. @ai-ecoverse/wasi-slicc holds bin/slicc.wasm, host/slicc-host.mjs, this section as its README, and the LICENSE. Its package.json has "slicc": { "abi": "wasi", "commands": { "slicc": { "wasm": "bin/slicc.wasm", "imports": "host/slicc-host.mjs" } } } and engines.slicc-kernel. The release attaches slicc.wasm as slicc-wasip1-wasm.wasm, in SHA256SUMS and its attestation (see Releases).

Tests. test/integration/wasi_test.go builds slicc.wasm, stages the package with npm-stage.mjs --wasi-only, and runs it in @ai-ecoverse/slicc-kernel's Node kernel (an exact-pinned devDependency, so npm ci first) against a fake facade, a kernel JS program in testdata/wasi/fakefacade/. One case writes /etc/hosts as root to map localhost to 203.0.113.5 and connects to tcp://localhost:<port>; testdata/wasi/hostmodule.mjs also loads the staged host/slicc-host.mjs with a ctx.net that records the host it is asked for. wasi_realfacade_test.go runs it against the kernel's own link facade (createNodeKernel({ facades: { link } })), served by a test page hook, testdata/wasi/page.mjs, that implements §5.16: it checks the stamp the hook receives (root and a cone in sudo pass, a scoop gets EACCES) and that the kernel sets SLICC_LINK_URL. wasi_tray_test.go runs slicc tray against both, and checks that its openings carry no join URL. cmd/slicc builds for both: a file there that needs a native-only package carries //go:build !wasip1, and wasi_test.go fails when the wasip1 build breaks or links one of the left-out packages.

版本与发布记录

@ai-ecoverse/wasi-slicc 共发布 113 个版本,首次发布于 2026/10/15;过去 12 个月发布了 113 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.61.14latest2026/11/06今天
1.61.132026/11/06今天
1.61.122026/11/06今天
1.61.112026/11/05今天
1.61.102026/11/051 天前
1.61.92026/11/041 天前

关于 @ai-ecoverse/wasi-slicc 的常见问题

@ai-ecoverse/wasi-slicc 是什么?

slicc's prompt, watch and abort for seven's kernel: slicc.wasm (WASI preview1) and its host module

如何安装 @ai-ecoverse/wasi-slicc?

在项目目录运行 npm install @ai-ecoverse/wasi-slicc,或使用 pnpm add / yarn add / bun add。

@ai-ecoverse/wasi-slicc 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ai-ecoverse__wasi-slicc 是否存在。

@ai-ecoverse/wasi-slicc 可以商用吗?

@ai-ecoverse/wasi-slicc 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ai-ecoverse/wasi-slicc 的下载量有多少?

根据 npm 官方下载统计,@ai-ecoverse/wasi-slicc 在 2026/10/05 – 2026/11/03 这 30 天内被下载 20,268 次,日均约 676 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-ecoverse/wasi-slicc 还在维护吗?

最新版本 1.61.14 发布于 2026/11/06(今天);至今共发布 113 个版本,其中过去 12 个月发布了 113 个;首次发布于 2026/10/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。