@xyo-network/event-kit-cli

中文文档
2.3.4发布于 2026/11/03LGPL-3.0-onlyTypeScriptES Module

Node 26+ CLI for Event Kit handshakes and a persistent source-aware event publisher

原始使用文档
文档目录4 节
  1. Commands
  2. Network and state
  3. Resident runtime
  4. Prepared Best Effort 2.0.0

@xyo-network/event-kit-cli

Requires Node 26 or newer; the repository pins Node 26.9.0.

The installed binary composes the public Node handshake clients over pinned XL1 Gateway sessions, finalized Statement Graph replay, and the selected public datalake.

Commands

event-kit publisher service publish|show|rotate-key|retire
event-kit publisher key show
event-kit publisher subscription show|challenge|accept
event-kit subscriber service show
event-kit subscriber subscription subscribe|show|revoke
event-kit publisher run --config publisher.json

Discovery commands require --publisher. Exact subscription discovery and the publisher challenge/accept flow also require independent --subscriber and --subscription selectors. Reads do not require a seed.

--replay-floor-block <n> selects an explicit trusted authorization bootstrap boundary and is embedded in durable replay identity. The default is genesis. With a nonzero floor, the first service publication must set validFromBlock at or after that floor; this mode does not claim complete pre-floor history.

Writes require --seed-file <path> and optionally --account-index <n>. The seed file must be a regular, non-symlink file with no group or other permission bits. Publisher writes require the derived signer to be the publisher Claim source; subscriber writes require it to be the subscriber Claim source.

Generated writes (service publish, service rotate-key, and subscription subscribe) also require --operation-id <32-lowercase-hex>. Generate a fresh random operation ID for each new logical mutation and retain it for every retry. Reusing the same ID with changed semantic input fails closed; an exact retry returns intentDisposition: "resumed" and republishes or reconciles the same canonical objects and signed XL1 transaction. Acceptance uses its challenge hash as the operation ID, while retirement and revocation use the target object hash, so those commands do not accept a separate flag.

Service publication reads a strict public JSON object:

{
  "deliveryMode": "durable",
  "sources": [{ "kind": "xl1-finalized", "chainId": "<40 lowercase hex source chain ID>" }],
  "maxPositionsPerWake": 32,
  "maxSubscriptionLifetimeBlocks": 100000
}

Subscription publication reads a strict, permission-restricted JSON object. The endpoint, audience, and challengeSecret values are encrypted by the public client and are never returned by the CLI:

{
  "deliveryMode": "durable",
  "audience": "my-indexer",
  "challengeSecret": "<32-byte unpadded base64url>",
  "deploymentId": "my-indexer",
  "endpoint": "https://subscriber.example/event-kit/wake",
  "source": { "kind": "xl1-finalized", "chainId": "<40 lowercase hex source chain ID>" },
  "fromPosition": 0,
  "maxPositionsPerWake": 32,
  "expiresAtBlock": 100000
}

publisher subscription challenge validates/decrypts the selected finalized tuple and durably begins its one permitted challenge attempt. It prints only the public challenge and selector hashes: it performs no HTTP request and never prints the decrypted target. Convey that challenge to the subscriber through the operator's chosen private channel. publisher subscription accept then requires --input <response.json> containing the endpoint proof:

{
  "schema": "network.xyo.event.wake.challenge.response",
  "challenge": "<challenge object hash>",
  "proof": "<32-byte unpadded base64url>"
}

Network and state

Use --network local|sequence|mainnet to choose a read profile. Write commands delegate to the XL1 publication boundary. Local commands require an explicit --chain-id; Sequence and Mainnet identities come from the released SDK. --rpc-url and --datalake-url replace endpoints, never chain identity. Every session is checked against the selected chain before and after replay.

Mainnet reads are available. Mainnet writes are rejected by the XL1 boundary before the CLI reads a seed file or constructs a signer/datalake writer; there is no bypass flag. publisher run --network mainnet only delivers (D-008). It reads the seed to sign wakes, opens no signer, datalake writer or publication, and leaves challenges and acceptance to the Phase 7 host.

--state-dir defaults to ./event-kit-state. Replay checkpoints, publication journals, mutation intents, publisher encryption-key custody, and challenge records are isolated under the selected network, exact chain ID, and publisher address in a private SQLite authority. The CLI rejects legacy filesystem state rather than silently abandoning encryption custody or publication recovery. Mutation intents are immutable private records. Publisher service/key intents retain the generated encryption private key for recovery; subscriber intents retain the exact grant and ciphertext plus a private-input fingerprint, never the endpoint or challenge-secret plaintext. Protect and back up this directory as secret operational state.

Use --json for one machine-readable result containing only selected public hashes, identities, finalized blocks, and lifecycle evidence.

Resident runtime

publisher run --config publisher.json now composes persistent SQLite state, real account signing, finalized D-005 discovery/challenge/acceptance/revocation, bounded HTTPS delivery, and loopback health probes. The source contract supports finalized XL1, finalized Ethereum, and completed fixed UTC intervals. See the resident publisher runbook for configuration, the handshake commands, Vercel Preview credentials, recovery, and the remaining credentialed qualification gates.

There is one unversioned wire contract. --event-kind, version-suffixed schemas, and maxBlocksPerWake are rejected; use explicit sources and source positions. XL1 acceptance height establishes authorization eligibility, while the subscription's fromPosition establishes where source catch-up begins.

Prepared Best Effort 2.0.0

Service and subscription JSON require deliveryMode: "best-effort", matching bestEffort: {"refreshIntervalSeconds":30,"maxHintAgeSeconds":300,"maxAttempts":3} and maxPositionsPerWake: 1. The native existing publish/subscribe commands continue to use --input, required fresh --operation-id, pinned network and private --seed-file; mode/policy are exact strict JSON fields, not new wire IDs.

To use a newly reviewed authorization projection while preserving the same SQLite owner/custody directory, all handshake commands support:

--replay-namespace ces-best-effort-v2 --replay-floor-block <H+1>
--replay-start-anchor-block <H> --replay-start-anchor-hash <rootH>

The native reader verifies exact finalized H/rootH, starts empty at H, and reads authority from H+1. New service/key/grant/subscription/acceptance claims must finalize after H. Use a new service ID and revision 1, with no legacy supersedes link or implicit old authority. The corresponding runtime config fields are authorizationReplayNamespace, authorizationFloorBlock, and authorizationStartAnchor: {"block":H,"hash":"rootH"}. Keep publisher identity, seed, state directory and historic keys/checkpoints/intents unchanged.

Best Effort HTTP success returns bounded admissionId, eventHash, wakeId, acceptedAt, expiresAt; it never claims a durable receiptId. Receiver source verification and application progress must be observed independently.

版本与发布记录

@xyo-network/event-kit-cli 共发布 22 个版本,首次发布于 2026/08/21;过去 12 个月发布了 22 个版本。

版本发布日期距今
2.3.4latest2026/11/03今天
2.3.32026/11/03今天
2.3.22026/10/313 天前
2.3.12026/10/303 天前
2.3.02026/10/295 天前
2.2.32026/10/286 天前

关于 @xyo-network/event-kit-cli 的常见问题

@xyo-network/event-kit-cli 是什么?

Node 26+ CLI用于事件Kit握手和持久的源感知事件发布者

如何安装 @xyo-network/event-kit-cli?

在项目目录运行 npm install @xyo-network/event-kit-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 event-kit,可以用 npx event-kit 直接运行。

@xyo-network/event-kit-cli 支持 TypeScript 吗?

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

@xyo-network/event-kit-cli 支持 ESM 还是 CommonJS?

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

@xyo-network/event-kit-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=26。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@xyo-network/event-kit-cli 可以商用吗?

@xyo-network/event-kit-cli 使用 LGPL-3.0-only 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@xyo-network/event-kit-cli 还在维护吗?

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