@adhd/apigen-errors 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @adhd/apigen-errors
2
+
3
+ Canonical error model for apigen — one set of error codes mapped to each transport's status
4
+ convention (HTTP, gRPC, CLI exit, MCP), plus streaming-error phase helpers. Pure TypeScript
5
+ (**platform: shared**).
6
+
7
+ Part of [apigen](../README.md).
8
+
9
+ ## Public API
10
+
11
+ ```ts
12
+ import {
13
+ ERROR_CODES, HTTP_STATUS, GRPC_CODE, CLI_EXIT_CODE, MCP_ERROR_KIND, statusMaps,
14
+ ApiError, toStreamingError, isBeforeFirstChunk, isAfterFirstChunk,
15
+ } from '@adhd/apigen-errors'
16
+ ```
17
+
18
+ - **`ERROR_CODES` / `ApiErrorCode`** — the canonical code set.
19
+ - **`HTTP_STATUS` / `GRPC_CODE` / `CLI_EXIT_CODE` / `MCP_ERROR_KIND` / `statusMaps`** —
20
+ per-transport mappings so every surface reports the same error consistently.
21
+ - **`ApiError`** — the error carrier; the **streaming helpers** classify before/after-first-chunk
22
+ errors for correct mid-stream reporting.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhd/apigen-errors",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "typings": "./index.d.ts",