npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tetherline/core

v0.1.1

Published

牵星 Tetherline 核心:SPI、领域模型、出站渲染管道与 contract test kits

Downloads

432

Readme

@tetherline/core

SPI 与领域模型:SessionKey、UnifiedMessage、ImChannel、OutboundIntent、AgentBackend/AgentSession、存储 SPI,以及 channel/backend 两套 contract test kits。冻结区:WS-0 出口后只许增量扩展(见 ../../CONTRIBUTING.md §1)。

入口

  • @tetherline/core:类型/SPI + 纯函数管线(chunkMarkdown / convertMarkdown / downgradeIntents)。零运行时依赖。
  • @tetherline/core/testing:defineChannelContractTests / defineBackendContractTests + 内存版 FakeChannel / FakeBackend。仅在测试中使用,vitest 声明为 optional peer。

与 docs/architecture.md §4 基线的差异(已同步回文档)

  • SendReceipt 基线未定义字段,实现为 { messageIds: string[] }(分片时一片一个 id)。
  • ImChannel.send 实现为 send(target: SessionKey, intent: ResolvedIntent):基线只有 intent,而一个 channel 同时服务多个会话,channel 只能从流状态或上一条消息推断目标,多会话下会发错地方。2026-08-30 经人类批准做此冻结区签名扩展(docs/open-items.md 第 3 条)。契约同时要求:target.channel 与 channel.id 不符必须 fail loud。
  • ResolvedIntent 实现为 text | stream-open/append/close | approval-card;方言转换统一在 downgradeIntents 完成,channel 收到的 markdown 已是目标方言,不再各自转换。
  • BackendCapabilities 定义为 { approvals; streaming; questions };StartSessionRequest 定义为 { key; cwd; resumeSessionId? }。
  • SessionBinding / PendingApproval 字段按 §6 表结构补全。
  • contract kit 签名扩展为 makeSubject() 返回被测对象或带测试钩子的 harness(channel 的 injectInbound、backend 的 approvalTrigger/echoExpectation),入站/审批类断言在钩子缺省时显式跳过。
  • 编号审批文本协议:无按钮渠道回复纯数字 n,channel 解析为 action(actionId = options[n-1].actionId),详见 downgradeIntents JSDoc。

现状 / 已完成 / 下一步

  • 现状:WS-0 完成,pnpm -r build && pnpm test && pnpm -r typecheck 全绿(core 63 用例:60 pass / 3 skip,skip 均为 harness 钩子缺省的显式跳过)。
  • 已完成:§4.1–4.5 全部 SPI;chunkMarkdown(段落/代码块边界分片,超长代码块补全围栏);convertMarkdown(feishu 子集 + plain,wecom/dingtalk 暂映射 feishu);downgradeIntents(buttons/streaming 矩阵 + 分片);两套 contract kit 及 Fake 自测。
  • 下一步:wecom/dingtalk 方言差异由对应 channel 工作流细化 convertMarkdown;后续冻结区改动仍须人类批准并同步全部工作流。