xmemory 3.21.0 → 3.21.2
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 +5 -11
- package/dist/cjs/instance.d.ts +3 -9
- package/dist/cjs/types.d.ts +3 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/instance.d.ts +3 -9
- package/dist/esm/types.d.ts +3 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -194,7 +194,7 @@ Every data operation — `read`, `write`, `writeAsync`, `writeStatus`, `extract`
|
|
|
194
194
|
`console_url`, the deep link to that call's trace. It is per operation rather than per
|
|
195
195
|
record, and `null` when the server has no console configured.
|
|
196
196
|
|
|
197
|
-
Options: `{ extractionLogic?,
|
|
197
|
+
Options: `{ extractionLogic?, scope?, timeoutMs? }` — `extractionLogic`
|
|
198
198
|
defaults to `"fast"`; see [Scoped writes](#scoped-writes) for `scope` and its `mode`.
|
|
199
199
|
|
|
200
200
|
Or pass a `WriteMutation[]` for **structured writes** — deterministic, LLM-free
|
|
@@ -313,11 +313,7 @@ next_steps:
|
|
|
313
313
|
every fact.
|
|
314
314
|
- If a merge cannot be made, the new value is appended, even past the cap, and
|
|
315
315
|
nothing stored is cut.
|
|
316
|
-
- Only text writes merge
|
|
317
|
-
runs without it on such a schema — `diffEngine: false`, or a connection whose
|
|
318
|
-
default is off — is refused with a 400 `VALIDATION_ERROR`; through
|
|
319
|
-
`writeAsync` it is queued and fails, which `writeStatus` reports.
|
|
320
|
-
`WriteMutation[]` writes replace the value as given.
|
|
316
|
+
- Only text writes merge. `WriteMutation[]` writes replace the value as given.
|
|
321
317
|
- Adding, changing or removing a `merge` is a metadata-only schema change.
|
|
322
318
|
|
|
323
319
|
Where a merge that changed the field found the new value contradicting the
|
|
@@ -512,7 +508,7 @@ level in the shape it always had: `depth`, `omitted_objects` and the catalog
|
|
|
512
508
|
entries' `distance`, `related` and `omitted_related` are then absent. A value
|
|
513
509
|
outside 1 to 3 is a 422 whose `code` is `VALIDATION_ERROR`. Asking for related
|
|
514
510
|
types needs the
|
|
515
|
-
`instance.
|
|
511
|
+
`instance.get` permission on the API key, the same one the schema
|
|
516
512
|
endpoints need, on top of `data.read`: a key without it gets a 403 whose
|
|
517
513
|
message names the permission, and the plain read is unaffected.
|
|
518
514
|
|
|
@@ -614,8 +610,6 @@ Things to know before reaching for it:
|
|
|
614
610
|
scope names records by that key, so a type declared `primary_key: []` has
|
|
615
611
|
nothing to name its records by — and `"drop"` never creates a record of such a
|
|
616
612
|
type, for the same reason.
|
|
617
|
-
- `"drop"` is computed by the server's **diff engine**, so asking for it with
|
|
618
|
-
`diffEngine: false` is refused with a 400. `"reject"` has no such requirement.
|
|
619
613
|
- The server caps the number of scoped objects per write, and can have scoped
|
|
620
614
|
writes disabled entirely. Both are server-side rules, so they surface as an
|
|
621
615
|
`XmemoryAPIError`.
|
|
@@ -882,7 +876,7 @@ different things:
|
|
|
882
876
|
| 402 | `QUOTA_EXCEEDED` | Tenant exhausted its plan/usage allowance (a daily or monthly token quota). | **No.** Wait for the window to reset. |
|
|
883
877
|
| 429 | `RATE_LIMITED` | Genuine velocity / rate limit. | **Yes**, with backoff. |
|
|
884
878
|
| 422 | `INVALID_INPUT` | A read that answered nothing: in `"raw-tables"` / `"xresponse"` mode every sub-query's SQL failed, or the model provider declined the input. See [What comes back](#what-comes-back). | **No.** Same input, same answer. |
|
|
885
|
-
| 403 | `FORBIDDEN` | The API key lacks a permission the call needs — for a read with `includeRelatedTypes: "types"`, `instance.get_own
|
|
879
|
+
| 403 | `FORBIDDEN` | The API key lacks a permission the call needs — for a read with `includeRelatedTypes: "types"`, `instance.get` (servers from before the permission rename call it `instance.get_own`); the message names it. See [Related types](#related-types). | **No.** Repeat without the option, or use a key that holds it. |
|
|
886
880
|
|
|
887
881
|
For `QUOTA_EXCEEDED`, `details` carries `kind`
|
|
888
882
|
(`"daily_quota_exceeded"` | `"monthly_quota_exceeded"`) and
|
|
@@ -996,7 +990,7 @@ new file mode 100644
|
|
|
996
990
|
+ id: 'xmemory',
|
|
997
991
|
+ servers: {
|
|
998
992
|
+ xmemory: {
|
|
999
|
-
+ url: new URL('https://
|
|
993
|
+
+ url: new URL('https://mcp.xmemory.ai'),
|
|
1000
994
|
+ requestInit: {
|
|
1001
995
|
+ headers: {
|
|
1002
996
|
+ Authorization: `Bearer ${process.env.XMEM_MCP_BEARER_TOKEN}`,
|
package/dist/cjs/instance.d.ts
CHANGED
|
@@ -67,8 +67,8 @@ export declare class InstanceHandle {
|
|
|
67
67
|
* or a `WriteMutation[]` to apply deterministic, LLM-free create / update /
|
|
68
68
|
* delete edits (applied in array order; later mutations may reference
|
|
69
69
|
* objects created earlier in the batch, and a `null` value in a mutation's
|
|
70
|
-
* `values` clears that field). `extractionLogic`
|
|
71
|
-
*
|
|
70
|
+
* `values` clears that field). `extractionLogic` only applies to the text
|
|
71
|
+
* form.
|
|
72
72
|
*
|
|
73
73
|
* Pass `scope` — a `WriteScope` of concrete objects, each named by its
|
|
74
74
|
* user-defined primary key — to anchor a text write to them. The write is
|
|
@@ -82,13 +82,7 @@ export declare class InstanceHandle {
|
|
|
82
82
|
* fails, and nothing applies. Under `"drop"` that change is skipped — along
|
|
83
83
|
* with anything that depended on it — the rest applies, and what was left out
|
|
84
84
|
* comes back on `result.changes.skipped_out_of_scope`. `"drop"` also lets the
|
|
85
|
-
* write create a scoped record that is not stored yet
|
|
86
|
-
* diff engine, so passing `diffEngine: false` with it is a 400.
|
|
87
|
-
*
|
|
88
|
-
* A text write on a schema with a `merge` field also needs the diff engine:
|
|
89
|
-
* with the engine off, by `diffEngine: false` or by the connection's default,
|
|
90
|
-
* it is refused with a 400 `VALIDATION_ERROR`; a {@link writeAsync} one is
|
|
91
|
-
* queued and fails, which {@link writeStatus} reports.
|
|
85
|
+
* write create a scoped record that is not stored yet.
|
|
92
86
|
*
|
|
93
87
|
* A scoped write additionally requires read permission on the instance: the
|
|
94
88
|
* response carries the previous value of every field the write changed,
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type ReadMode = "single-answer" | "raw-tables" | "xresponse";
|
|
|
11
11
|
/**
|
|
12
12
|
* What a read says about the schema around its answer. `"types"` adds
|
|
13
13
|
* {@link ReadResult.related_types} to the result; `"none"` (the server default)
|
|
14
|
-
* leaves it out. Asking for it needs the `instance.
|
|
14
|
+
* leaves it out. Asking for it needs the `instance.get` permission on the
|
|
15
15
|
* API key, the same one the schema endpoints need, on top of `data.read`: a key
|
|
16
16
|
* without it gets a 403 whose message names the permission, and the plain read
|
|
17
17
|
* is unaffected.
|
|
@@ -64,8 +64,7 @@ export interface ReadScope {
|
|
|
64
64
|
* is what makes "create or update exactly this record" expressible, while
|
|
65
65
|
* `"reject"` requires every scoped record to exist already. And a type that
|
|
66
66
|
* declares no user-defined primary key is never created under `"drop"`, since
|
|
67
|
-
* a scope has no way to name such a record.
|
|
68
|
-
* server's diff engine, so pairing it with `diffEngine: false` is a 400.
|
|
67
|
+
* a scope has no way to name such a record.
|
|
69
68
|
*/
|
|
70
69
|
export type WriteScopeMode = "reject" | "drop";
|
|
71
70
|
/**
|
|
@@ -981,7 +980,7 @@ export interface ReadOptions {
|
|
|
981
980
|
* `"types"` asks for {@link ReadResult.related_types}: the object types the read
|
|
982
981
|
* touched, the fields it did not return, and the object types a declared
|
|
983
982
|
* relation links them to. Left unset, nothing is sent and the server default
|
|
984
|
-
* (`"none"`) applies. Needs `instance.
|
|
983
|
+
* (`"none"`) applies. Needs `instance.get` on the API key; see
|
|
985
984
|
* {@link RelatedTypesMode}.
|
|
986
985
|
*/
|
|
987
986
|
includeRelatedTypes?: RelatedTypesMode;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Package version. Kept in sync with `package.json` — a test asserts they match. */
|
|
2
|
-
export declare const VERSION = "3.21.
|
|
2
|
+
export declare const VERSION = "3.21.2";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/instance.d.ts
CHANGED
|
@@ -67,8 +67,8 @@ export declare class InstanceHandle {
|
|
|
67
67
|
* or a `WriteMutation[]` to apply deterministic, LLM-free create / update /
|
|
68
68
|
* delete edits (applied in array order; later mutations may reference
|
|
69
69
|
* objects created earlier in the batch, and a `null` value in a mutation's
|
|
70
|
-
* `values` clears that field). `extractionLogic`
|
|
71
|
-
*
|
|
70
|
+
* `values` clears that field). `extractionLogic` only applies to the text
|
|
71
|
+
* form.
|
|
72
72
|
*
|
|
73
73
|
* Pass `scope` — a `WriteScope` of concrete objects, each named by its
|
|
74
74
|
* user-defined primary key — to anchor a text write to them. The write is
|
|
@@ -82,13 +82,7 @@ export declare class InstanceHandle {
|
|
|
82
82
|
* fails, and nothing applies. Under `"drop"` that change is skipped — along
|
|
83
83
|
* with anything that depended on it — the rest applies, and what was left out
|
|
84
84
|
* comes back on `result.changes.skipped_out_of_scope`. `"drop"` also lets the
|
|
85
|
-
* write create a scoped record that is not stored yet
|
|
86
|
-
* diff engine, so passing `diffEngine: false` with it is a 400.
|
|
87
|
-
*
|
|
88
|
-
* A text write on a schema with a `merge` field also needs the diff engine:
|
|
89
|
-
* with the engine off, by `diffEngine: false` or by the connection's default,
|
|
90
|
-
* it is refused with a 400 `VALIDATION_ERROR`; a {@link writeAsync} one is
|
|
91
|
-
* queued and fails, which {@link writeStatus} reports.
|
|
85
|
+
* write create a scoped record that is not stored yet.
|
|
92
86
|
*
|
|
93
87
|
* A scoped write additionally requires read permission on the instance: the
|
|
94
88
|
* response carries the previous value of every field the write changed,
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type ReadMode = "single-answer" | "raw-tables" | "xresponse";
|
|
|
11
11
|
/**
|
|
12
12
|
* What a read says about the schema around its answer. `"types"` adds
|
|
13
13
|
* {@link ReadResult.related_types} to the result; `"none"` (the server default)
|
|
14
|
-
* leaves it out. Asking for it needs the `instance.
|
|
14
|
+
* leaves it out. Asking for it needs the `instance.get` permission on the
|
|
15
15
|
* API key, the same one the schema endpoints need, on top of `data.read`: a key
|
|
16
16
|
* without it gets a 403 whose message names the permission, and the plain read
|
|
17
17
|
* is unaffected.
|
|
@@ -64,8 +64,7 @@ export interface ReadScope {
|
|
|
64
64
|
* is what makes "create or update exactly this record" expressible, while
|
|
65
65
|
* `"reject"` requires every scoped record to exist already. And a type that
|
|
66
66
|
* declares no user-defined primary key is never created under `"drop"`, since
|
|
67
|
-
* a scope has no way to name such a record.
|
|
68
|
-
* server's diff engine, so pairing it with `diffEngine: false` is a 400.
|
|
67
|
+
* a scope has no way to name such a record.
|
|
69
68
|
*/
|
|
70
69
|
export type WriteScopeMode = "reject" | "drop";
|
|
71
70
|
/**
|
|
@@ -981,7 +980,7 @@ export interface ReadOptions {
|
|
|
981
980
|
* `"types"` asks for {@link ReadResult.related_types}: the object types the read
|
|
982
981
|
* touched, the fields it did not return, and the object types a declared
|
|
983
982
|
* relation links them to. Left unset, nothing is sent and the server default
|
|
984
|
-
* (`"none"`) applies. Needs `instance.
|
|
983
|
+
* (`"none"`) applies. Needs `instance.get` on the API key; see
|
|
985
984
|
* {@link RelatedTypesMode}.
|
|
986
985
|
*/
|
|
987
986
|
includeRelatedTypes?: RelatedTypesMode;
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Package version. Kept in sync with `package.json` — a test asserts they match. */
|
|
2
|
-
export declare const VERSION = "3.21.
|
|
2
|
+
export declare const VERSION = "3.21.2";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Package version. Kept in sync with `package.json` — a test asserts they match. */
|
|
2
|
-
export const VERSION = "3.21.
|
|
2
|
+
export const VERSION = "3.21.2";
|