@antiphony/shared 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/cjs/api-codecs.cjs +971 -0
- package/dist/cjs/api-codecs.d.cts +542 -0
- package/dist/cjs/errors/index.cjs +56 -0
- package/dist/cjs/errors/index.d.cts +45 -0
- package/dist/cjs/index.cjs +1276 -0
- package/dist/cjs/index.d.cts +11 -0
- package/dist/cjs/nsid.cjs +37 -0
- package/dist/cjs/nsid.d.cts +42 -0
- package/dist/cjs/observability/index.cjs +58 -0
- package/dist/cjs/observability/index.d.cts +1 -0
- package/dist/cjs/observability/report-error.cjs +58 -0
- package/dist/cjs/observability/report-error.d.cts +48 -0
- package/dist/cjs/types/api.cjs +726 -0
- package/dist/cjs/types/api.d.cts +494 -0
- package/dist/cjs/types/audio.cjs +835 -0
- package/dist/cjs/types/audio.d.cts +1149 -0
- package/dist/cjs/types/blob.cjs +23 -0
- package/dist/cjs/types/blob.d.cts +45 -0
- package/dist/cjs/types/channels.cjs +170 -0
- package/dist/cjs/types/channels.d.cts +262 -0
- package/dist/cjs/types/records.cjs +407 -0
- package/dist/cjs/types/records.d.cts +840 -0
- package/dist/cjs/types/storage.cjs +414 -0
- package/dist/cjs/types/storage.d.cts +197 -0
- package/dist/cjs/types/views.cjs +820 -0
- package/dist/cjs/types/views.d.cts +9806 -0
- package/dist/cjs/utils/index.cjs +8 -0
- package/dist/cjs/utils/index.d.cts +7 -0
- package/dist/esm/api-codecs.d.ts +542 -0
- package/dist/esm/api-codecs.js +6 -0
- package/dist/esm/chunk-24KIXQZK.js +6 -0
- package/dist/esm/chunk-3WZJXJNU.js +378 -0
- package/dist/esm/chunk-5EHV73BA.js +20 -0
- package/dist/esm/chunk-72G3LBUQ.js +1 -0
- package/dist/esm/chunk-7LW2FHLD.js +48 -0
- package/dist/esm/chunk-7V44CPRR.js +132 -0
- package/dist/esm/chunk-BUNMR4ZO.js +127 -0
- package/dist/esm/chunk-EA4OONDV.js +380 -0
- package/dist/esm/chunk-F2CANZZ7.js +40 -0
- package/dist/esm/chunk-ORMEWXMH.js +33 -0
- package/dist/esm/chunk-TIZRJORN.js +24 -0
- package/dist/esm/chunk-XDBKR6LW.js +32 -0
- package/dist/esm/errors/index.d.ts +45 -0
- package/dist/esm/errors/index.js +2 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/nsid.d.ts +42 -0
- package/dist/esm/nsid.js +2 -0
- package/dist/esm/observability/index.d.ts +1 -0
- package/dist/esm/observability/index.js +3 -0
- package/dist/esm/observability/report-error.d.ts +48 -0
- package/dist/esm/observability/report-error.js +2 -0
- package/dist/esm/types/api.d.ts +494 -0
- package/dist/esm/types/api.js +5 -0
- package/dist/esm/types/audio.d.ts +1149 -0
- package/dist/esm/types/audio.js +5 -0
- package/dist/esm/types/blob.d.ts +45 -0
- package/dist/esm/types/blob.js +2 -0
- package/dist/esm/types/channels.d.ts +262 -0
- package/dist/esm/types/channels.js +162 -0
- package/dist/esm/types/records.d.ts +840 -0
- package/dist/esm/types/records.js +3 -0
- package/dist/esm/types/storage.d.ts +197 -0
- package/dist/esm/types/storage.js +26 -0
- package/dist/esm/types/views.d.ts +9806 -0
- package/dist/esm/types/views.js +4 -0
- package/dist/esm/utils/index.d.ts +7 -0
- package/dist/esm/utils/index.js +2 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Brad Thorson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @antiphony/shared
|
|
2
|
+
|
|
3
|
+
Shared types, Zod schemas, and request/response codecs for [Antiphony](https://github.com/bbthorson/antiphony) — open infrastructure and an AT Protocol lexicon for audio call-and-response.
|
|
4
|
+
|
|
5
|
+
This is the contract package: the same Zod schemas that validate the wire format in `apps/core-api`, mirror the `dev.antiphony.*` lexicons, and type any client built on the public API. If you're building against Antiphony, this is what you import.
|
|
6
|
+
|
|
7
|
+
Docs: **<https://docs.antiphony.dev>** — start with [the lexicons](https://docs.antiphony.dev/lexicons/overview/).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @antiphony/shared zod
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`zod` is the only runtime dependency and the peer of every validation schema.
|
|
16
|
+
|
|
17
|
+
## Dual ESM/CJS
|
|
18
|
+
|
|
19
|
+
Ships both ESM and CommonJS builds with correct type resolution under `node16`/`nodenext` and bundlers (verified with [`@arethetypeswrong/cli`](https://github.com/arethetypeswrong/arethetypeswrong.github.io)). `import` and `require` both resolve to the right artifact.
|
|
20
|
+
|
|
21
|
+
## Exports
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { AudioPostRecordSchema, AudioPostViewSchema } from '@antiphony/shared';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The root re-exports the most-used pieces (records, views, audio types, API types, codecs, NSIDs, errors, utils, observability). Granular subpaths are available too:
|
|
28
|
+
|
|
29
|
+
| Subpath | What's in it |
|
|
30
|
+
| :--- | :--- |
|
|
31
|
+
| `@antiphony/shared` | The common surface: records, views, audio + API types, `api-codecs`, `nsid`, `errors`, `utils`, `observability`. |
|
|
32
|
+
| `@antiphony/shared/api-codecs` | Request/response Zod codecs for the REST surface. |
|
|
33
|
+
| `@antiphony/shared/nsid` | The `dev.antiphony.*` NSID constants. |
|
|
34
|
+
| `@antiphony/shared/errors` | Shared error types and helpers. |
|
|
35
|
+
| `@antiphony/shared/utils` | Pure shared utilities (projection/date/sanitization helpers). |
|
|
36
|
+
| `@antiphony/shared/observability` | Logging/error-reporting helpers (`./observability/report-error` for just the reporter). |
|
|
37
|
+
| `@antiphony/shared/types/*` | Individual type modules: `records`, `views`, `audio`, `blob`, `api`, `channels`, `storage`. |
|
|
38
|
+
|
|
39
|
+
## The records this models
|
|
40
|
+
|
|
41
|
+
- **`dev.antiphony.audio.post`** — the single canonical content record. A post without a `reply` is a prompt; with a `reply` it's a reply.
|
|
42
|
+
- **`dev.antiphony.embed.audio`** — the audio attachment (stored record + hydrated view with a signed playback URL).
|
|
43
|
+
- **`dev.antiphony.audio.transcript`** — platform-enrichment transcript, lifted into the embed view at read time.
|
|
44
|
+
- **`dev.antiphony.actor.profile`** — the actor profile.
|
|
45
|
+
|
|
46
|
+
See the [lexicon reference](https://docs.antiphony.dev/lexicons/overview/) for the full contract.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|