@nebula-ai/sdk 1.4.0 → 1.6.0-rc.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/README.md +29 -13
- package/dist/index.cjs +75 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -353
- package/dist/index.d.ts +112 -353
- package/dist/index.js +75 -198
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -7,11 +7,20 @@ health.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
+
# Stable
|
|
10
11
|
npm install @nebula-ai/sdk
|
|
11
|
-
#
|
|
12
|
-
|
|
12
|
+
# Preview (next iteration, RC versions)
|
|
13
|
+
npm install @nebula-ai/sdk@next
|
|
13
14
|
```
|
|
14
15
|
|
|
16
|
+
> **Pre-launch:** The public surface is still being shaped. Plain
|
|
17
|
+
> semver releases (`1.6.0`, `1.7.0`, …) are stable and published to
|
|
18
|
+
> the `latest` dist-tag. Iteration happens on the `next` dist-tag
|
|
19
|
+
> as pre-release versions (`1.6.0-rc.1`, `-rc.2`, …). Caret ranges
|
|
20
|
+
> like `^1.6.0` never auto-pick pre-releases — semver excludes them
|
|
21
|
+
> unless you explicitly opt in. Stable consumers are insulated from
|
|
22
|
+
> the iteration channel by default.
|
|
23
|
+
|
|
15
24
|
## Quick start
|
|
16
25
|
|
|
17
26
|
```ts
|
|
@@ -22,26 +31,33 @@ const client = new Nebula({
|
|
|
22
31
|
// or: bearerToken: process.env.NEBULA_BEARER_TOKEN,
|
|
23
32
|
});
|
|
24
33
|
|
|
25
|
-
const
|
|
34
|
+
const result = await client.memories.create({
|
|
26
35
|
collection_id: "01234567-...",
|
|
27
36
|
raw_text: "hello, world",
|
|
28
37
|
});
|
|
29
38
|
|
|
30
|
-
const results = await client.search({ query: "hello" });
|
|
39
|
+
const results = await client.memories.search({ query: "hello" });
|
|
31
40
|
```
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`
|
|
42
|
+
Resource methods (`client.memories.*`, `client.collections.*`,
|
|
43
|
+
`client.connectors.*`, `client.snapshots.*`) are generated directly from
|
|
44
|
+
the OpenAPI spec. A small DX layer at `src/lib/dx.ts` adds polymorphic
|
|
45
|
+
helpers like `storeMemory` (dispatches create-vs-append based on whether
|
|
46
|
+
a `memory_id` is present); prefer the resource methods for everything else.
|
|
38
47
|
|
|
39
48
|
## Auth
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
Pass either `apiKey` (for Nebula API keys) or `bearerToken` (for JWTs)
|
|
51
|
+
when constructing the client. If you pass an opaque-looking token via
|
|
52
|
+
`apiKey` (one that isn't prefixed with `key_` or `neb_`), the DX layer
|
|
53
|
+
automatically routes it through the `Authorization: Bearer` header
|
|
54
|
+
instead — handy when your app exchanges a workspace token for the SDK
|
|
55
|
+
and doesn't want to think about which header to use.
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
new Nebula({ apiKey: process.env.NEBULA_API_KEY });
|
|
59
|
+
new Nebula({ bearerToken: process.env.NEBULA_BEARER_TOKEN });
|
|
60
|
+
```
|
|
45
61
|
|
|
46
62
|
## Errors
|
|
47
63
|
|