@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.mjs
CHANGED
|
@@ -3023,7 +3023,7 @@ var Knowledge = class {
|
|
|
3023
3023
|
/**
|
|
3024
3024
|
* Search knowledge
|
|
3025
3025
|
*
|
|
3026
|
-
* Searches across documents and
|
|
3026
|
+
* 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.
|
|
3027
3027
|
*/
|
|
3028
3028
|
static searchKnowledge(options) {
|
|
3029
3029
|
return (options.client ?? client).post({
|
|
@@ -3040,7 +3040,7 @@ var Memories = class {
|
|
|
3040
3040
|
/**
|
|
3041
3041
|
* List memories
|
|
3042
3042
|
*
|
|
3043
|
-
* Returns
|
|
3043
|
+
* Returns all memories in a memory store
|
|
3044
3044
|
*/
|
|
3045
3045
|
static listMemories(options) {
|
|
3046
3046
|
return (options.client ?? client).get({
|
|
@@ -3051,7 +3051,7 @@ var Memories = class {
|
|
|
3051
3051
|
/**
|
|
3052
3052
|
* Create a memory
|
|
3053
3053
|
*
|
|
3054
|
-
*
|
|
3054
|
+
* 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.
|
|
3055
3055
|
*/
|
|
3056
3056
|
static createMemory(options) {
|
|
3057
3057
|
return (options.client ?? client).post({
|
|
@@ -3066,7 +3066,7 @@ var Memories = class {
|
|
|
3066
3066
|
/**
|
|
3067
3067
|
* Delete a memory
|
|
3068
3068
|
*
|
|
3069
|
-
* Deletes a memory
|
|
3069
|
+
* Deletes a memory
|
|
3070
3070
|
*/
|
|
3071
3071
|
static deleteMemory(options) {
|
|
3072
3072
|
return (options.client ?? client).delete({
|
|
@@ -3077,7 +3077,7 @@ var Memories = class {
|
|
|
3077
3077
|
/**
|
|
3078
3078
|
* Get a memory
|
|
3079
3079
|
*
|
|
3080
|
-
* Returns a single memory
|
|
3080
|
+
* Returns a single memory by ID
|
|
3081
3081
|
*/
|
|
3082
3082
|
static getMemory(options) {
|
|
3083
3083
|
return (options.client ?? client).get({
|
|
@@ -3088,7 +3088,7 @@ var Memories = class {
|
|
|
3088
3088
|
/**
|
|
3089
3089
|
* Update a memory
|
|
3090
3090
|
*
|
|
3091
|
-
* Updates an existing memory
|
|
3091
|
+
* Updates an existing memory. Regenerates the embedding if content changes.
|
|
3092
3092
|
*/
|
|
3093
3093
|
static updateMemory(options) {
|
|
3094
3094
|
return (options.client ?? client).put({
|
|
@@ -3101,6 +3101,17 @@ var Memories = class {
|
|
|
3101
3101
|
});
|
|
3102
3102
|
}
|
|
3103
3103
|
/**
|
|
3104
|
+
* List a memory's assertions
|
|
3105
|
+
*
|
|
3106
|
+
* 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.
|
|
3107
|
+
*/
|
|
3108
|
+
static listMemoryAssertions(options) {
|
|
3109
|
+
return (options.client ?? client).get({
|
|
3110
|
+
url: "/v1/projects/{project_id}/memories/{memory_id}/assertions",
|
|
3111
|
+
...options
|
|
3112
|
+
});
|
|
3113
|
+
}
|
|
3114
|
+
/**
|
|
3104
3115
|
* Get memory tags
|
|
3105
3116
|
*
|
|
3106
3117
|
* Returns all tags attached to the memory
|
|
@@ -3142,26 +3153,26 @@ var Memories = class {
|
|
|
3142
3153
|
});
|
|
3143
3154
|
}
|
|
3144
3155
|
};
|
|
3145
|
-
var
|
|
3156
|
+
var MemoryStores = class {
|
|
3146
3157
|
/**
|
|
3147
|
-
* List memory
|
|
3158
|
+
* List memory stores
|
|
3148
3159
|
*
|
|
3149
|
-
* Returns
|
|
3160
|
+
* Returns a list of memory store configurations for a project
|
|
3150
3161
|
*/
|
|
3151
|
-
static
|
|
3162
|
+
static listMemoryStores(options) {
|
|
3152
3163
|
return (options.client ?? client).get({
|
|
3153
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3164
|
+
url: "/v1/projects/{project_id}/memory-stores",
|
|
3154
3165
|
...options
|
|
3155
3166
|
});
|
|
3156
3167
|
}
|
|
3157
3168
|
/**
|
|
3158
|
-
* Create a memory
|
|
3169
|
+
* Create a memory store
|
|
3159
3170
|
*
|
|
3160
|
-
* Creates a new
|
|
3171
|
+
* Creates a new memory store configuration in a project
|
|
3161
3172
|
*/
|
|
3162
|
-
static
|
|
3173
|
+
static createMemoryStore(options) {
|
|
3163
3174
|
return (options.client ?? client).post({
|
|
3164
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3175
|
+
url: "/v1/projects/{project_id}/memory-stores",
|
|
3165
3176
|
...options,
|
|
3166
3177
|
headers: {
|
|
3167
3178
|
"Content-Type": "application/json",
|
|
@@ -3170,35 +3181,35 @@ var MemoryEntries = class {
|
|
|
3170
3181
|
});
|
|
3171
3182
|
}
|
|
3172
3183
|
/**
|
|
3173
|
-
* Delete a memory
|
|
3184
|
+
* Delete a memory store
|
|
3174
3185
|
*
|
|
3175
|
-
* Deletes a memory
|
|
3186
|
+
* Deletes a memory store configuration
|
|
3176
3187
|
*/
|
|
3177
|
-
static
|
|
3188
|
+
static deleteMemoryStore(options) {
|
|
3178
3189
|
return (options.client ?? client).delete({
|
|
3179
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3190
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}",
|
|
3180
3191
|
...options
|
|
3181
3192
|
});
|
|
3182
3193
|
}
|
|
3183
3194
|
/**
|
|
3184
|
-
* Get a memory
|
|
3195
|
+
* Get a memory store
|
|
3185
3196
|
*
|
|
3186
|
-
* Returns a single memory
|
|
3197
|
+
* Returns a single memory store configuration by ID
|
|
3187
3198
|
*/
|
|
3188
|
-
static
|
|
3199
|
+
static getMemoryStore(options) {
|
|
3189
3200
|
return (options.client ?? client).get({
|
|
3190
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3201
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}",
|
|
3191
3202
|
...options
|
|
3192
3203
|
});
|
|
3193
3204
|
}
|
|
3194
3205
|
/**
|
|
3195
|
-
* Update a memory
|
|
3206
|
+
* Update a memory store
|
|
3196
3207
|
*
|
|
3197
|
-
* Updates an existing memory
|
|
3208
|
+
* Updates an existing memory store configuration
|
|
3198
3209
|
*/
|
|
3199
|
-
static
|
|
3210
|
+
static updateMemoryStore(options) {
|
|
3200
3211
|
return (options.client ?? client).put({
|
|
3201
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3212
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}",
|
|
3202
3213
|
...options,
|
|
3203
3214
|
headers: {
|
|
3204
3215
|
"Content-Type": "application/json",
|
|
@@ -3207,24 +3218,35 @@ var MemoryEntries = class {
|
|
|
3207
3218
|
});
|
|
3208
3219
|
}
|
|
3209
3220
|
/**
|
|
3210
|
-
*
|
|
3221
|
+
* List a memory store's write assertions
|
|
3222
|
+
*
|
|
3223
|
+
* 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.
|
|
3224
|
+
*/
|
|
3225
|
+
static listMemoryStoreAssertions(options) {
|
|
3226
|
+
return (options.client ?? client).get({
|
|
3227
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/assertions",
|
|
3228
|
+
...options
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
/**
|
|
3232
|
+
* Get memory store tags
|
|
3211
3233
|
*
|
|
3212
|
-
* Returns all tags attached to the memory
|
|
3234
|
+
* Returns all tags attached to the memory store
|
|
3213
3235
|
*/
|
|
3214
|
-
static
|
|
3236
|
+
static getMemoryStoreTags(options) {
|
|
3215
3237
|
return (options.client ?? client).get({
|
|
3216
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3238
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/tags",
|
|
3217
3239
|
...options
|
|
3218
3240
|
});
|
|
3219
3241
|
}
|
|
3220
3242
|
/**
|
|
3221
|
-
* Merge memory
|
|
3243
|
+
* Merge memory store tags
|
|
3222
3244
|
*
|
|
3223
|
-
* Merges provided tags into the memory
|
|
3245
|
+
* Merges provided tags into the memory store's existing tags (existing tags are preserved unless overridden)
|
|
3224
3246
|
*/
|
|
3225
|
-
static
|
|
3247
|
+
static mergeMemoryStoreTags(options) {
|
|
3226
3248
|
return (options.client ?? client).patch({
|
|
3227
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3249
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/tags",
|
|
3228
3250
|
...options,
|
|
3229
3251
|
headers: {
|
|
3230
3252
|
"Content-Type": "application/json",
|
|
@@ -3233,13 +3255,13 @@ var MemoryEntries = class {
|
|
|
3233
3255
|
});
|
|
3234
3256
|
}
|
|
3235
3257
|
/**
|
|
3236
|
-
* Replace memory
|
|
3258
|
+
* Replace memory store tags
|
|
3237
3259
|
*
|
|
3238
|
-
* Replaces all tags on the memory
|
|
3260
|
+
* Replaces all tags on the memory store with the provided tags (not merged)
|
|
3239
3261
|
*/
|
|
3240
|
-
static
|
|
3262
|
+
static replaceMemoryStoreTags(options) {
|
|
3241
3263
|
return (options.client ?? client).put({
|
|
3242
|
-
url: "/v1/projects/{project_id}/memory-
|
|
3264
|
+
url: "/v1/projects/{project_id}/memory-stores/{memory_store_id}/tags",
|
|
3243
3265
|
...options,
|
|
3244
3266
|
headers: {
|
|
3245
3267
|
"Content-Type": "application/json",
|
|
@@ -3826,7 +3848,7 @@ var Quotas = class {
|
|
|
3826
3848
|
*
|
|
3827
3849
|
* 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.
|
|
3828
3850
|
*
|
|
3829
|
-
* `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
|
|
3851
|
+
* `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.
|
|
3830
3852
|
*/
|
|
3831
3853
|
static createQuota(options) {
|
|
3832
3854
|
return (options.client ?? client).post({
|
|
@@ -4882,7 +4904,7 @@ var NaturaliClient = class {
|
|
|
4882
4904
|
ingestionRules;
|
|
4883
4905
|
knowledge;
|
|
4884
4906
|
memories;
|
|
4885
|
-
|
|
4907
|
+
memoryStores;
|
|
4886
4908
|
modelRoutes;
|
|
4887
4909
|
quotas;
|
|
4888
4910
|
models;
|
|
@@ -4932,7 +4954,7 @@ var NaturaliClient = class {
|
|
|
4932
4954
|
this.ingestionRules = bindResource(IngestionRules, this.http);
|
|
4933
4955
|
this.knowledge = bindResource(Knowledge, this.http);
|
|
4934
4956
|
this.memories = bindResource(Memories, this.http);
|
|
4935
|
-
this.
|
|
4957
|
+
this.memoryStores = bindResource(MemoryStores, this.http);
|
|
4936
4958
|
this.modelRoutes = bindResource(ModelRoutes, this.http);
|
|
4937
4959
|
this.quotas = bindResource(Quotas, this.http);
|
|
4938
4960
|
this.models = bindResource(Models, this.http);
|
|
@@ -4950,4 +4972,4 @@ var NaturaliClient = class {
|
|
|
4950
4972
|
}
|
|
4951
4973
|
};
|
|
4952
4974
|
//#endregion
|
|
4953
|
-
export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories,
|
|
4975
|
+
export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryStores, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
34
|
-
"@naturali/api": "0.
|
|
34
|
+
"@naturali/api": "0.129.0",
|
|
35
35
|
"@ttoss/openapi-codegen": "^0.3.0",
|
|
36
36
|
"@types/node": "^26.5.1",
|
|
37
37
|
"tsdown": "^0.23.0",
|