@ellipsis-dev/sdk

中文文档
0.49.0发布于 2026/11/10MITTypeScriptES Module零依赖近 30 天下载 2397

TypeScript SDK for the Ellipsis agents platform: /v1 REST types + client, the session stream WebSocket client, and the session transcript store.

原始使用文档
文档目录3 节
  1. Types are generated, never hand-written
  2. Stream
  3. Shared chat work sections

@ellipsis-dev/sdk

TypeScript SDK for the Ellipsis agents platform. Three subpath exports, all dependency-free at runtime:

  • @ellipsis-dev/sdk — generated /v1 REST types + EllipsisClient, a thin typed client over an injected fetchJson.
  • @ellipsis-dev/sdk/stream — the session stream WebSocket client (streamSession): heartbeat liveness, reconnect-with-backoff, and lossless resume via the after_seq record cursor. Transport is an injected openSocket, so the same machinery runs in a browser, a terminal, or a server.
  • @ellipsis-dev/sdk/store — SessionTranscriptStore (subscribe/getSnapshot, shaped for React's useSyncExternalStore but framework-free) plus the pure shaping helpers that turn raw session records into renderable transcript items and chat turns.

Types are generated, never hand-written

  • schema/frames.schema.json — JSON Schema of the WebSocket frames, produced from the server's frame models.
  • schema/openapi.v1.json — the OpenAPI document for the SDK's REST surface.

pnpm gen derives src/generated/ from those documents (json-schema-to-typescript + openapi-typescript). CI regenerates and diffs, and the server's own test suite pins the committed schema documents to its models, so types cannot drift from the deployed API in either direction.

test/fixtures/golden_stream.json is a frame sequence recorded from the real server stream loop (ids and timestamps normalized); the store's tests replay it, so client behavior is validated against real emissions, not hand-written examples.

Stream

The stream (frame taxonomy, delivery classes, resume/close-code contract) is documented at https://www.ellipsis.dev/docs. Clients ignore unknown frame types and unknown source/record_type/kind values.

Shared chat work sections

Web and CLI renderers can use splitLedger(groupRecordsToChatTurns(records)) and entryBody(entry, { live, now, liveText, liveSummary, harness }) from @ellipsis-dev/sdk/store. now is epoch milliseconds, and harness is harnessName(session). The returned items are the collapsed view: one isWorkFold(item) section for progress, thinking and tools, with final replies, turn outcome and closing notices kept visible. members.get(item.key) contains that section's rows; nested tool folds use the same map and isToolFold. Renderers own expansion state and can recursively display the members.

The work key stays stable as records stream in and after replay. The live label advances from Preparing environment to Starting Claude Code (the harness's name, or Starting agent without one) to Working as the platform and native turn events arrive. While the agent works, the heading from store.getSnapshot().liveSummary replaces Working when available. Pass the summary only to the entry being answered (loading: true, add a loading indicator in the renderer). The returned seconds uses platform turn start and completion timestamps, even before the first content item arrives. It is null before a turn starts; omit the clock then. entry.progress.phase identifies each message's activity independently of the latest message or session status. The settled label is Worked for 4m 43s. Only the work header is loading; partial text stays inside it. Codex message phases identify final answers; for records without phases, the final message of a settled turn stays outside the fold. No DOM, React, or terminal dependencies are required.

版本与发布记录

@ellipsis-dev/sdk 共发布 47 个版本,首次发布于 2026/07/22;过去 12 个月发布了 47 个版本。

版本发布日期距今
0.49.0latest2026/11/104 天前
0.48.02026/11/085 天前
0.47.02026/11/086 天前
0.46.02026/11/077 天前
0.45.02026/11/068 天前
0.44.02026/11/059 天前

关于 @ellipsis-dev/sdk 的常见问题

@ellipsis-dev/sdk 是什么?

TypeScript SDK for the Ellipsis agents platform: /v1 REST types + client, the session stream WebSocket client, and the session transcript store.

如何安装 @ellipsis-dev/sdk?

在项目目录运行 npm install @ellipsis-dev/sdk,或使用 pnpm add / yarn add / bun add。

@ellipsis-dev/sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ellipsis-dev/sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ellipsis-dev/sdk 可以商用吗?

@ellipsis-dev/sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ellipsis-dev/sdk 的下载量有多少?

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

@ellipsis-dev/sdk 还在维护吗?

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