@absolutejs/handoff

中文文档
0.1.0发布于 2026/07/30MITTypeScriptES Module近 30 天下载 4431

Correlation, evidence, reconciliation, and visibility primitives for work handed to external systems.

原始使用文档
文档目录6 节
  1. Install
  2. Correlation
  3. Evidence and reconciliation
  4. Recording
  5. Package boundaries
  6. License

@absolutejs/handoff

Storage-neutral correlation and evidence for work that leaves your application.

A handoff starts in your code, continues in an external system, and may return through a callback, reconciliation, or a customer report. @absolutejs/handoff keeps those observations joined without pretending your application can inspect an external page directly.

Install

bun add @absolutejs/handoff

Correlation

import {
  handoffCorrelationFrom,
  withHandoffCorrelation,
} from "@absolutejs/handoff";

const metadata = withHandoffCorrelation(
  { campaign: "summer" },
  crypto.randomUUID(),
);

// Services with fixed metadata slots can name the slot explicitly.
const gatewayFields = withHandoffCorrelation(
  { field_1: "campaign" },
  crypto.randomUUID(),
  "field_20",
);

const correlationId = handoffCorrelationFrom(gatewayFields, "field_20");

Evidence and reconciliation

import { summarizeHandoff } from "@absolutejs/handoff";

const summary = summarizeHandoff([
  {
    at: Date.now(),
    correlationId: "invoice-123",
    operation: "invoice_payment",
    outcome: "succeeded",
    service: "gateway",
    source: "callback",
  },
  {
    at: Date.now() + 1,
    correlationId: "invoice-123",
    message: "The hosted page displayed an error",
    operation: "invoice_payment",
    outcome: "failed",
    service: "gateway",
    source: "external_surface_report",
  },
]);

// The callback remains authoritative while the customer-visible contradiction
// remains actionable.
console.log(summary.status); // "succeeded"
console.log(summary.contradiction); // true

external_api, callback, and reconciliation evidence is authoritative. external_surface_report evidence records what a customer or operator saw without silently overriding external-system truth.

Recording

createHandoffRecorder() accepts optional storage and observer contracts. Recording returns per-sink delivery state instead of throwing when an observability sink fails, so visibility cannot break the business operation. The recorder also exposes low-cardinality counters by source and outcome.

Messages and references redact payment-number-shaped text and bearer credentials. Applications must still keep raw callbacks, credentials, payment details, and customer data in their own protected stores.

Package boundaries

@absolutejs/handoff owns the shared protocol. Domain packages keep their own meaning and adapters:

  • Commerce decides what paid, declined, and settled mean.
  • Dispatch decides what sent, bounced, and complained mean.
  • CRM decides what synchronized or conflicted means.
  • Voice and Meeting decide what joined, recorded, and transcribed mean.

Those packages translate external-system evidence into this neutral vocabulary.

License

MIT

版本与发布记录

@absolutejs/handoff 共发布 1 个版本,首次发布于 2026/07/30;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.0latest2026/07/303 个月前

关于 @absolutejs/handoff 的常见问题

@absolutejs/handoff 是什么?

Correlation, evidence, reconciliation, and visibility primitives for work handed to external systems.

如何安装 @absolutejs/handoff?

在项目目录运行 npm install @absolutejs/handoff,或使用 pnpm add / yarn add / bun add。

@absolutejs/handoff 支持 TypeScript 吗?

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

@absolutejs/handoff 支持 ESM 还是 CommonJS?

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

@absolutejs/handoff 可以商用吗?

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

@absolutejs/handoff 的下载量有多少?

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

@absolutejs/handoff 还在维护吗?

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