@anchrd/intel-contract 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.
- package/README.md +24 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
# @anchrd/intel-contract
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The shared wire contract for [`@anchrd/intel`](https://www.npmjs.com/package/@anchrd/intel): Zod
|
|
4
|
+
schemas that describe every payload crossing Intel's HTTP, MCP and browser surfaces.
|
|
5
|
+
|
|
6
|
+
You rarely install this directly — the server and the UI both depend on it. Reach for it when you
|
|
7
|
+
write your own client against the Intel HTTP API and want the same types and validation the server
|
|
8
|
+
uses.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @anchrd/intel-contract
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Use
|
|
4
17
|
|
|
5
18
|
```ts
|
|
6
|
-
import { CreateKnowledgeNodeInput } from "@anchrd/intel-contract";
|
|
19
|
+
import { CreateKnowledgeNodeInput, KnowledgeNode } from "@anchrd/intel-contract";
|
|
7
20
|
|
|
8
21
|
const input = CreateKnowledgeNodeInput.parse(payload);
|
|
22
|
+
const node = KnowledgeNode.parse(await response.json());
|
|
9
23
|
```
|
|
10
24
|
|
|
11
|
-
Mutation inputs are strict: unknown
|
|
25
|
+
Mutation inputs are strict: an unknown field is rejected rather than silently dropped, so a typo in
|
|
26
|
+
a client never becomes a value that quietly fails to apply. Types are inferred from the schemas, so
|
|
27
|
+
`z.infer` gives you the same shape the server validates against.
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
Proprietary. Published publicly for installation convenience; this is not an open-source license and
|
|
32
|
+
grants no right to use, copy, modify or redistribute the software. Contact Anchrd for licensing.
|