定制 artisan-build/hone-contracts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

artisan-build/hone-contracts

最新稳定版本:v1.1.0

Composer 安装命令:

composer require artisan-build/hone-contracts

包简介

The versioned wire envelope shared between hone-client and hone-server. The single place Hone's wire compatibility lives.

README 文档

README

The versioned wire envelope shared between hone-client (the send side) and hone-server (the receive side) of Hone.

This package is tiny and deliberately so. It is the single place Hone's wire compatibility lives — the DTOs that cross the network, their (de)serialization, and the ENVELOPE_VERSION constant. Both other packages depend on it with a version range.

Read-only mirror. This repository is a read-only split of the artisan-build/hone monorepo. Issues and pull requests are disabled here — please open them on the monorepo.

Why a separate package

Across N independently-deployed senders and one self-hosted receiver, version skew is the normal state, not an error. You cannot keep them in lockstep, so the wire protocol is built to tolerate skew, and the contract that defines it lives in exactly one place that both sides pin.

The compatibility rules

  1. The envelope carries its own version. Every payload includes ENVELOPE_VERSION.
  2. Additive within a major. New fields are optional and added; existing fields are never removed or repurposed. That one rule is what makes a newer server able to parse every older envelope, and an older server able to ignore fields it doesn't recognize.
  3. The inner records are opaque. The envelope wraps Nightwatch record bodies but never interprets them. Only the thin envelope (app id, deploy, batch metadata) is version-sensitive. A change in Nightwatch's payload shape is invisible to this contract.
  4. A major bump is a deliberate act. Crossing an envelope major can only happen through an explicit composer require, never a routine composer updatehone-client pins a caret constraint (^X) on this package.

The envelope (shape)

The envelope wraps a batch of opaque Nightwatch records with the minimum metadata the server needs to route, tag, and version-check them:

Field Meaning
envelope_version The ENVELOPE_VERSION the sender was built against.
app The source application id (one Hone environment may receive many apps).
deploy The deploy identifier — NIGHTWATCH_DEPLOY, typically the commit SHA.
sent_at When the batch was assembled.
records The opaque Nightwatch records; each carries its own type discriminator.

Installation

composer require artisan-build/hone-contracts

You usually don't install this directly — it arrives as a dependency of hone-client or hone-server.

License

MIT. See LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固