@kybernesis/brain-contracts 0.8.2 → 0.8.3
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 +46 -0
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kybernesis
|
|
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,46 @@
|
|
|
1
|
+
# @kybernesis/brain-contracts
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@kybernesis/brain-contracts)
|
|
4
|
+
|
|
5
|
+
The **seam definitions** for the [Cortex](../../README.md) brain library: Zod schemas,
|
|
6
|
+
provider interfaces, and shared constants. Everything else in the family depends on this
|
|
7
|
+
package; it depends on nothing else.
|
|
8
|
+
|
|
9
|
+
This is the package to read if you want to **implement your own provider** — the interfaces
|
|
10
|
+
here are the contract your implementation must satisfy.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @kybernesis/brain-contracts
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What's in it
|
|
19
|
+
|
|
20
|
+
- **Provider interfaces** — `StorageProvider` (and its repositories: timeline, entity-graph,
|
|
21
|
+
fact, sleep, vector), plus the shapes the kernel injects. The seams a backend must satisfy.
|
|
22
|
+
- **Zod schemas + types** — `TimelineEvent`, `Entity`, `Fact`, sleep types, etc. Canonical
|
|
23
|
+
field shapes (snake_case to match the wire format), with a guard test enforcing it.
|
|
24
|
+
- **`TenantContext` + `pathsFor`** — the per-brain context describing where its SQLite files
|
|
25
|
+
live. Build one per agent/workspace.
|
|
26
|
+
- **Constants** — `EMBEDDING_MODEL` (`text-embedding-3-small`), `EMBEDDING_DIM` (1536),
|
|
27
|
+
`EMBEDDING_INPUT_CAP` (8192), `CLAUDE_MODEL_ALIASES`.
|
|
28
|
+
|
|
29
|
+
## Subpath exports
|
|
30
|
+
|
|
31
|
+
Import the whole surface from the root, or cherry-pick for tree-shaking:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { pathsFor, type TenantContext } from '@kybernesis/brain-contracts';
|
|
35
|
+
import { EMBEDDING_DIM } from '@kybernesis/brain-contracts/constants';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Available subpaths: `./tenant`, `./constants`, `./timeline`, `./entity`, `./fact`,
|
|
39
|
+
`./sleep`, `./logger`.
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- ESM-only, TypeScript strict. No runtime dependencies beyond `zod`.
|
|
44
|
+
- Implementing a provider against these interfaces? Validate it with
|
|
45
|
+
[`@kybernesis/brain-testkit`](../brain-testkit)'s `runParityHarness` / conformance cases.
|
|
46
|
+
- Part of [Cortex](../../README.md) — `@kybernesis/brain-*`.
|
package/package.json
CHANGED