# @appport/protocol

> AppPort wire protocol types, envelopes, error codes and manifest contracts.

Latest version **1.0.1** (published 2026-09-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @appport/protocol
pnpm add @appport/protocol
yarn add @appport/protocol
bun add @appport/protocol
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-09-24 |
| First published | 2026-09-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 142.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rkendel |

## Links

- npm: https://www.npmjs.com/package/@appport/protocol
- Repository: https://github.com/rkendel1/appport
- Homepage: https://github.com/rkendel1/appport#readme
- Issues: https://github.com/rkendel1/appport/issues
- npm.io page: https://npm.io/package/@appport/protocol

## Recent versions

- 1.0.1 (latest) — 2026-09-24
- 1.0.0 — 2026-09-21

## README

# @appport/protocol

The AppPort wire contract: envelope types, error codes, naming rules, manifest
shapes, structural validation and compatibility analysis.

This package is pure. It has no runtime dependencies and knows nothing about
transports, servers or clients — which is what makes it safe to depend on from
a browser bundle, an Electron preload script or a CLI.

```ts
import { createRequest, parseClientEnvelope, PROTOCOL_ID } from "@appport/protocol";

const request = createRequest({
  requestId: "req_01J...",
  capability: { name: "documents.save", version: 1 },
  input: { documentId: "doc_1", content: "hello" }
});

parseClientEnvelope(request); // throws AppPortError on a malformed envelope
```

## What is here

| Module           | Contents                                                        |
| ---------------- | --------------------------------------------------------------- |
| `version`        | `appport/1`, conformance levels                                  |
| `envelopes`      | request, response, event, subscribe, stream envelopes and guards |
| `validate`       | protocol-level structural validation, decode and encode          |
| `errors`         | the standard error codes and `AppPortError`                      |
| `names`          | capability, event, permission and application-id grammar         |
| `ids`            | ULID-based identifier helpers                                    |
| `manifest`       | manifest, discovery and transport descriptor types               |
| `jsonschema`     | the JSON Schema subset published in manifests                    |
| `session`        | `Principal` and `Session`                                        |
| `operations`     | long-running operation records                                   |
| `blob`           | binary references                                                |
| `compatibility`  | breaking vs non-breaking manifest diffing                        |

Names are checked, not merely typed: `electron.documents.save` and
`ipc.saveDocument` are rejected, because a capability name that encodes a
transport breaks the protocol's central invariant.

---
_Source: https://npm.io/package/@appport/protocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
