@naturali/sdk 0.127.11 → 0.129.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/dist/index.cjs +65 -43
- package/dist/index.d.cts +494 -258
- package/dist/index.d.mts +494 -258
- package/dist/index.mjs +65 -43
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3024,7 +3024,7 @@ var Knowledge = class {
|
|
|
3024
3024
|
/**
|
|
3025
3025
|
* Search knowledge
|
|
3026
3026
|
*
|
|
3027
|
-
* Searches across documents and
|
|
3027
|
+
* Searches across documents and memories using hybrid retrieval — a vector query and a full-text query per source, fused by reciprocal rank — or by file paths, document IDs, memory store IDs, or tags. At least one of `query`, `tags`, `document_paths`, `document_ids`, or `memory_store_ids` must be provided.
|
|
3028
3028
|
*/
|
|
3029
3029
|
static searchKnowledge(options) {
|
|
3030
3030
|
return (options.client ?? client).post({
|
|
@@ -3041,7 +3041,7 @@ var Memories = class {
|
|
|
3041
3041
|
/**
|
|
3042
3042
|
* List memories
|
|
3043
3043
|
*
|
|
3044
|
-
* Returns
|
|
3044
|
+
* Returns all memories in a memory store
|
|
3045
3045
|
*/
|
|
3046
3046
|
static listMemories(options) {
|
|
3047
3047
|
return (options.client ?? client).get({
|
|
@@ -3052,7 +3052,7 @@ var Memories = class {
|
|
|
3052
3052
|
/**
|
|
3053
3053
|
* Create a memory
|
|
3054
3054
|
*
|
|
3055
|
-
*
|
|
3055
|
+
* Writes a fact to the specified memory store through the standard write algorithm: the content is embedded (or matched to text the store already holds), compared against the most similar currently-valid memory, and resolved to exactly one of three outcomes — `skipped` at or above `duplicate_threshold`, `superseded` at or above `supersede_threshold`, `created` below it. Every call records one assertion, whatever the outcome.
|
|
3056
3056
|
*/
|
|
3057
3057
|
static createMemory(options) {
|
|
3058
3058
|
return (options.client ?? client).post({
|
|
@@ -3067,7 +3067,7 @@ var Memories = class {
|
|
|
3067
3067
|
/**
|
|
3068
3068
|
* Delete a memory
|
|
3069
3069
|
*
|
|
3070
|
-
* Deletes a memory
|
|
3070
|
+
* Deletes a memory
|
|
3071
3071
|
*/
|
|
3072
3072
|
static deleteMemory(options) {
|
|
3073
3073
|
return (options.client ?? client).delete({
|
|
@@ -3078,7 +3078,7 @@ var Memories = class {
|
|
|
3078
3078
|
/**
|
|
3079
3079
|
* Get a memory
|
|
3080
3080
|
*
|
|
3081
|
-
* Returns a single memory
|
|
3081
|
+
* Returns a single memory by ID
|
|
3082
3082
|
*/
|
|
3083
3083
|
static getMemory(options) {
|
|
3084
3084
|
return (options.client ?? client).get({
|
|
@@ -3089,7 +3089,7 @@ var Memories = class {
|
|
|
3089
3089
|
/**
|
|
3090
3090
|
* Update a memory
|
|
3091
3091
|
*
|
|
3092
|
-
* Updates an existing memory
|
|
3092
|
+
* Updates an existing memory. Regenerates the embedding if content changes.
|
|
3093
3093
|
*/
|
|
3094
3094
|
static updateMemory(options) {
|
|
3095
3095
|
return (options.client ?? client).put({
|
|
@@ -3102,6 +3102,17 @@ var Memories = class {
|
|
|
3102
3102
|
});
|
|
3103
3103
|
}
|
|
3104
3104
|
/**
|
|
3105
|
+
* List a memory's assertions
|
|
3106
|
+
*
|
|
3107
|
+
* Returns every write that resolved into this memory, oldest first: the one that created it, the duplicates it absorbed, and the assertion that superseded another memory in its favour. A superseded memory keeps its own assertions, so the chain can be walked in both directions.
|
|
3108
|
+
*/
|
|
3109
|
+
static listMemoryAssertions(options) {
|
|
3110
|
+
return (options.client ?? client).get({
|
|
3111
|
+
url: "/v1/projects/{project_id}/memories/{memory_id}/assertions",
|
|
3112
|
+
...options
|
|
3113
|
+
});
|
|
3114
|
+
}
|
|
3115
|
+
/**
|
|
3105
3116
|
* Get memory tags
|
|
3106
3117
|
*
|
|
3107
3118
|
* Returns all tags attached to the memory
|
|
@@ -3143,26 +3154,26 @@ var Memories = class {
|
|
|
3143
3154
|
});
|
|
3144
3155
|
}
|
|
3145
3156
|
};
|
|
3146
|
-
var
|
|
3157
|
+
var MemoryStores = class {
|
|
3147
3158
|
/**
|
|
3148
|
-
* List memory
|
|
3159
|
+
* List memory stores
|
|
3149
3160
|
*
|
|
3150
|
-
* Returns
|
|
3161
|
+
* Returns a list of memory store configurations for a project
|
|
3151
3162
|
*/
|
|
3152
|
-
static
|
|
3163
|
+
static listMemoryStores(options) {
|
|
3153
3164
|
return (options.client ?? client).get({
|
|
3154
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3165
|
+
url: "/v1/projects/{project_id}/memory-stores",
|
|
3155
3166
|
...options
|
|
3156
3167
|
});
|
|
3157
3168
|
}
|
|
3158
3169
|
/**
|
|
3159
|
-
* Create a memory
|
|
3170
|
+
* Create a memory store
|
|
3160
3171
|
*
|
|
3161
|
-
* Creates a new
|
|
3172
|
+
* Creates a new memory store configuration in a project
|
|
3162
3173
|
*/
|
|
3163
|
-
static
|
|
3174
|
+
static createMemoryStore(options) {
|
|
3164
3175
|
return (options.client ?? client).post({
|
|
3165
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3176
|
+
url: "/v1/projects/{project_id}/memory-stores",
|
|
3166
3177
|
...options,
|
|
3167
3178
|
headers: {
|
|
3168
3179
|
"Content-Type": "application/json",
|
|
@@ -3171,35 +3182,35 @@ var MemoryEntries = class {
|
|
|
3171
3182
|
});
|
|
3172
3183
|
}
|
|
3173
3184
|
/**
|
|
3174
|
-
* Delete a memory
|
|
3185
|
+
* Delete a memory store
|
|
3175
3186
|
*
|
|
3176
|
-
* Deletes a memory
|
|
3187
|
+
* Deletes a memory store configuration
|
|
3177
3188
|
*/
|
|
3178
|
-
static
|
|
3189
|
+
static deleteMemoryStore(options) {
|
|
3179
3190
|
return (options.client ?? client).delete({
|
|
3180
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3191
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}",
|
|
3181
3192
|
...options
|
|
3182
3193
|
});
|
|
3183
3194
|
}
|
|
3184
3195
|
/**
|
|
3185
|
-
* Get a memory
|
|
3196
|
+
* Get a memory store
|
|
3186
3197
|
*
|
|
3187
|
-
* Returns a single memory
|
|
3198
|
+
* Returns a single memory store configuration by ID
|
|
3188
3199
|
*/
|
|
3189
|
-
static
|
|
3200
|
+
static getMemoryStore(options) {
|
|
3190
3201
|
return (options.client ?? client).get({
|
|
3191
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3202
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}",
|
|
3192
3203
|
...options
|
|
3193
3204
|
});
|
|
3194
3205
|
}
|
|
3195
3206
|
/**
|
|
3196
|
-
* Update a memory
|
|
3207
|
+
* Update a memory store
|
|
3197
3208
|
*
|
|
3198
|
-
* Updates an existing memory
|
|
3209
|
+
* Updates an existing memory store configuration
|
|
3199
3210
|
*/
|
|
3200
|
-
static
|
|
3211
|
+
static updateMemoryStore(options) {
|
|
3201
3212
|
return (options.client ?? client).put({
|
|
3202
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3213
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}",
|
|
3203
3214
|
...options,
|
|
3204
3215
|
headers: {
|
|
3205
3216
|
"Content-Type": "application/json",
|
|
@@ -3208,24 +3219,35 @@ var MemoryEntries = class {
|
|
|
3208
3219
|
});
|
|
3209
3220
|
}
|
|
3210
3221
|
/**
|
|
3211
|
-
*
|
|
3222
|
+
* List a memory store's write assertions
|
|
3223
|
+
*
|
|
3224
|
+
* Returns the store's write ledger, newest first: one row per write attempt, skips included. This is how "which write path is filling this store?" is asked — a question no column on a memory row could answer, because a skipped write produced no memory at all.
|
|
3225
|
+
*/
|
|
3226
|
+
static listMemoryStoreAssertions(options) {
|
|
3227
|
+
return (options.client ?? client).get({
|
|
3228
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/assertions",
|
|
3229
|
+
...options
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
3232
|
+
/**
|
|
3233
|
+
* Get memory store tags
|
|
3212
3234
|
*
|
|
3213
|
-
* Returns all tags attached to the memory
|
|
3235
|
+
* Returns all tags attached to the memory store
|
|
3214
3236
|
*/
|
|
3215
|
-
static
|
|
3237
|
+
static getMemoryStoreTags(options) {
|
|
3216
3238
|
return (options.client ?? client).get({
|
|
3217
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3239
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/tags",
|
|
3218
3240
|
...options
|
|
3219
3241
|
});
|
|
3220
3242
|
}
|
|
3221
3243
|
/**
|
|
3222
|
-
* Merge memory
|
|
3244
|
+
* Merge memory store tags
|
|
3223
3245
|
*
|
|
3224
|
-
* Merges provided tags into the memory
|
|
3246
|
+
* Merges provided tags into the memory store's existing tags (existing tags are preserved unless overridden)
|
|
3225
3247
|
*/
|
|
3226
|
-
static
|
|
3248
|
+
static mergeMemoryStoreTags(options) {
|
|
3227
3249
|
return (options.client ?? client).patch({
|
|
3228
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3250
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/tags",
|
|
3229
3251
|
...options,
|
|
3230
3252
|
headers: {
|
|
3231
3253
|
"Content-Type": "application/json",
|
|
@@ -3234,13 +3256,13 @@ var MemoryEntries = class {
|
|
|
3234
3256
|
});
|
|
3235
3257
|
}
|
|
3236
3258
|
/**
|
|
3237
|
-
* Replace memory
|
|
3259
|
+
* Replace memory store tags
|
|
3238
3260
|
*
|
|
3239
|
-
* Replaces all tags on the memory
|
|
3261
|
+
* Replaces all tags on the memory store with the provided tags (not merged)
|
|
3240
3262
|
*/
|
|
3241
|
-
static
|
|
3263
|
+
static replaceMemoryStoreTags(options) {
|
|
3242
3264
|
return (options.client ?? client).put({
|
|
3243
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3265
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/tags",
|
|
3244
3266
|
...options,
|
|
3245
3267
|
headers: {
|
|
3246
3268
|
"Content-Type": "application/json",
|
|
@@ -3827,7 +3849,7 @@ var Quotas = class {
|
|
|
3827
3849
|
*
|
|
3828
3850
|
* Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`; `storage_bytes` is valid for `scope: project` only. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
|
|
3829
3851
|
*
|
|
3830
|
-
* `storage_bytes` caps a stored total rather than a windowed one, so it takes `window: current` and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory
|
|
3852
|
+
* `storage_bytes` caps a stored total rather than a windowed one, so it takes `window: current` and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory create — with `409 QUOTA_STORAGE_EXCEEDED` and no `Retry-After`, since no window reset clears a footprint.
|
|
3831
3853
|
*/
|
|
3832
3854
|
static createQuota(options) {
|
|
3833
3855
|
return (options.client ?? client).post({
|
|
@@ -4883,7 +4905,7 @@ var NaturaliClient = class {
|
|
|
4883
4905
|
ingestionRules;
|
|
4884
4906
|
knowledge;
|
|
4885
4907
|
memories;
|
|
4886
|
-
|
|
4908
|
+
memoryStores;
|
|
4887
4909
|
modelRoutes;
|
|
4888
4910
|
quotas;
|
|
4889
4911
|
models;
|
|
@@ -4933,7 +4955,7 @@ var NaturaliClient = class {
|
|
|
4933
4955
|
this.ingestionRules = bindResource(IngestionRules, this.http);
|
|
4934
4956
|
this.knowledge = bindResource(Knowledge, this.http);
|
|
4935
4957
|
this.memories = bindResource(Memories, this.http);
|
|
4936
|
-
this.
|
|
4958
|
+
this.memoryStores = bindResource(MemoryStores, this.http);
|
|
4937
4959
|
this.modelRoutes = bindResource(ModelRoutes, this.http);
|
|
4938
4960
|
this.quotas = bindResource(Quotas, this.http);
|
|
4939
4961
|
this.models = bindResource(Models, this.http);
|
|
@@ -4976,7 +4998,7 @@ exports.Guardrails = Guardrails;
|
|
|
4976
4998
|
exports.IngestionRules = IngestionRules;
|
|
4977
4999
|
exports.Knowledge = Knowledge;
|
|
4978
5000
|
exports.Memories = Memories;
|
|
4979
|
-
exports.
|
|
5001
|
+
exports.MemoryStores = MemoryStores;
|
|
4980
5002
|
exports.ModelRoutes = ModelRoutes;
|
|
4981
5003
|
exports.Models = Models;
|
|
4982
5004
|
exports.NaturaliClient = NaturaliClient;
|