@anuma/sdk 6.7.3 → 6.8.1
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/{react/chunk-5GBYOWRY.mjs → expo/chunk-CJ32HO6Q.mjs} +14 -1
- package/dist/expo/{chunk-ITRFWFNS.mjs → chunk-OUFITMDL.mjs} +1 -1
- package/dist/expo/{chunk-37VWRZTL.mjs → chunk-YO5UXOC4.mjs} +3 -2
- package/dist/{react/consolidate-FNFIDL37.mjs → expo/consolidate-4BMNVOL4.mjs} +3 -2
- package/dist/expo/index.cjs +34 -2
- package/dist/expo/index.d.mts +38 -0
- package/dist/expo/index.d.ts +38 -0
- package/dist/expo/index.mjs +16 -5
- package/dist/expo/{recall-FZ7JC4AX.mjs → recall-IEKVX4JL.mjs} +2 -2
- package/dist/index.cjs +10 -0
- package/dist/index.d.mts +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.mjs +8 -0
- package/dist/{expo/chunk-5GBYOWRY.mjs → react/chunk-CJ32HO6Q.mjs} +14 -1
- package/dist/react/{chunk-ZZDMEEHO.mjs → chunk-DY5VGC6K.mjs} +1 -1
- package/dist/react/{chunk-NC7BZEEF.mjs → chunk-POCLKALT.mjs} +3 -2
- package/dist/{expo/consolidate-H6YD36XI.mjs → react/consolidate-5TP3J6BY.mjs} +3 -2
- package/dist/react/index.cjs +34 -2
- package/dist/react/index.d.mts +38 -0
- package/dist/react/index.d.ts +38 -0
- package/dist/react/index.mjs +16 -5
- package/dist/react/{recall-546HTUPK.mjs → recall-B2AIAPCM.mjs} +2 -2
- package/dist/server/{chunk-G6IH6QTZ.mjs → chunk-FS6DNUNT.mjs} +3 -2
- package/dist/server/{chunk-I2U35Z3O.mjs → chunk-KF5OU4IN.mjs} +14 -1
- package/dist/server/{chunk-5KIUGHQZ.mjs → chunk-MEQ2PAEX.mjs} +1 -1
- package/dist/server/{consolidate-S7QZ7V6T.mjs → consolidate-QDWEYFTZ.mjs} +3 -2
- package/dist/server/index.cjs +34 -2
- package/dist/server/index.d.mts +38 -0
- package/dist/server/index.d.ts +38 -0
- package/dist/server/index.mjs +16 -5
- package/dist/server/{recall-BIPVQMG4.mjs → recall-2GAPE2XH.mjs} +2 -2
- package/package.json +1 -1
|
@@ -40,6 +40,12 @@ function withInternalFlowMarker(systemPrompt) {
|
|
|
40
40
|
${systemPrompt}`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
// src/lib/taskType.ts
|
|
44
|
+
var TASK_TYPE_HEADER = "X-Anuma-Task-Type";
|
|
45
|
+
function taskTypeHeader(taskType) {
|
|
46
|
+
return taskType ? { [TASK_TYPE_HEADER]: taskType } : {};
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
// src/lib/memory/portalLlm.ts
|
|
44
50
|
function defaultBaseUrl() {
|
|
45
51
|
return typeof process !== "undefined" && process.env?.ANUMA_PORTAL_BASE_URL || BASE_URL;
|
|
@@ -182,7 +188,13 @@ async function attemptPortalJson(req, endpoint) {
|
|
|
182
188
|
try {
|
|
183
189
|
response = await fetchImpl(`${baseUrl}${endpoint}`, {
|
|
184
190
|
method: "POST",
|
|
185
|
-
|
|
191
|
+
// Attached HERE, at the one transport every background memory op shares, so
|
|
192
|
+
// a new flow gets the provenance by construction rather than by remembering.
|
|
193
|
+
headers: {
|
|
194
|
+
...authHeaders,
|
|
195
|
+
...taskTypeHeader(req.taskType),
|
|
196
|
+
"Content-Type": "application/json"
|
|
197
|
+
},
|
|
186
198
|
body: JSON.stringify(requestBody),
|
|
187
199
|
signal: controller.signal
|
|
188
200
|
});
|
|
@@ -326,6 +338,7 @@ export {
|
|
|
326
338
|
getLogger,
|
|
327
339
|
INTERNAL_FLOW_MARKER,
|
|
328
340
|
withInternalFlowMarker,
|
|
341
|
+
taskTypeHeader,
|
|
329
342
|
validateEndpointOverride,
|
|
330
343
|
supportsResponseFormat,
|
|
331
344
|
resolvePortalAuthHeaders,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notifyConsolidationFallback,
|
|
3
3
|
resolvePiiRedactor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MEQ2PAEX.mjs";
|
|
5
5
|
import {
|
|
6
6
|
callPortalJsonCompletion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KF5OU4IN.mjs";
|
|
8
8
|
import "./chunk-3RPGXXPZ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/lib/memory/consolidate.ts
|
|
@@ -77,6 +77,7 @@ ${candidateText}`;
|
|
|
77
77
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
78
78
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
79
79
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
80
|
+
taskType: "memory_consolidate",
|
|
80
81
|
model: options.model ?? DEFAULT_CONSOLIDATION_MODEL,
|
|
81
82
|
systemPrompt: SYSTEM_PROMPT,
|
|
82
83
|
userMessage,
|
package/dist/server/index.cjs
CHANGED
|
@@ -17132,6 +17132,18 @@ var init_internalFlowMarker = __esm({
|
|
|
17132
17132
|
}
|
|
17133
17133
|
});
|
|
17134
17134
|
|
|
17135
|
+
// src/lib/taskType.ts
|
|
17136
|
+
function taskTypeHeader(taskType) {
|
|
17137
|
+
return taskType ? { [TASK_TYPE_HEADER]: taskType } : {};
|
|
17138
|
+
}
|
|
17139
|
+
var TASK_TYPE_HEADER;
|
|
17140
|
+
var init_taskType = __esm({
|
|
17141
|
+
"src/lib/taskType.ts"() {
|
|
17142
|
+
"use strict";
|
|
17143
|
+
TASK_TYPE_HEADER = "X-Anuma-Task-Type";
|
|
17144
|
+
}
|
|
17145
|
+
});
|
|
17146
|
+
|
|
17135
17147
|
// src/lib/db/entities/types.ts
|
|
17136
17148
|
function normalizeEntityName(name) {
|
|
17137
17149
|
return name.trim().toLowerCase();
|
|
@@ -20697,7 +20709,13 @@ async function attemptPortalJson(req, endpoint) {
|
|
|
20697
20709
|
try {
|
|
20698
20710
|
response = await fetchImpl(`${baseUrl}${endpoint}`, {
|
|
20699
20711
|
method: "POST",
|
|
20700
|
-
|
|
20712
|
+
// Attached HERE, at the one transport every background memory op shares, so
|
|
20713
|
+
// a new flow gets the provenance by construction rather than by remembering.
|
|
20714
|
+
headers: {
|
|
20715
|
+
...authHeaders,
|
|
20716
|
+
...taskTypeHeader(req.taskType),
|
|
20717
|
+
"Content-Type": "application/json"
|
|
20718
|
+
},
|
|
20701
20719
|
body: JSON.stringify(requestBody),
|
|
20702
20720
|
signal: controller.signal
|
|
20703
20721
|
});
|
|
@@ -20844,6 +20862,7 @@ var init_portalLlm = __esm({
|
|
|
20844
20862
|
init_endpointOverride();
|
|
20845
20863
|
init_internalFlowMarker();
|
|
20846
20864
|
init_logger();
|
|
20865
|
+
init_taskType();
|
|
20847
20866
|
RESPONSE_FORMAT_OK = /* @__PURE__ */ new Set(["openai", "inclusionai", "deepseek"]);
|
|
20848
20867
|
RESPONSE_SCHEMA_OK = /* @__PURE__ */ new Set(["openai"]);
|
|
20849
20868
|
RETRYABLE_HTTP = /* @__PURE__ */ new Set([408, 409, 425, 429]);
|
|
@@ -21177,6 +21196,7 @@ Output strict JSON, no prose: { "expand": [<entity names to expand, verbatim fro
|
|
|
21177
21196
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
21178
21197
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
21179
21198
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
21199
|
+
taskType: "memory_graph",
|
|
21180
21200
|
model: options.model ?? DEFAULT_REFINER_MODEL,
|
|
21181
21201
|
systemPrompt,
|
|
21182
21202
|
userMessage: `Question: ${query}
|
|
@@ -23912,6 +23932,7 @@ ${candidateText}`;
|
|
|
23912
23932
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
23913
23933
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
23914
23934
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
23935
|
+
taskType: "memory_consolidate",
|
|
23915
23936
|
model: options.model ?? DEFAULT_CONSOLIDATION_MODEL,
|
|
23916
23937
|
systemPrompt: SYSTEM_PROMPT3,
|
|
23917
23938
|
userMessage,
|
|
@@ -26786,6 +26807,7 @@ init_types2();
|
|
|
26786
26807
|
init_clientConfig();
|
|
26787
26808
|
init_internalFlowMarker();
|
|
26788
26809
|
init_logger();
|
|
26810
|
+
init_taskType();
|
|
26789
26811
|
var DEFAULT_SUMMARY_TOKEN_THRESHOLD = 4e3;
|
|
26790
26812
|
var DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES = 4;
|
|
26791
26813
|
var DEFAULT_SUMMARY_MODEL = "cerebras/qwen-3-235b-a22b-instruct-2507";
|
|
@@ -26972,7 +26994,12 @@ async function callSummarizationLlm(prompt, model, token, baseUrl) {
|
|
|
26972
26994
|
method: "POST",
|
|
26973
26995
|
headers: {
|
|
26974
26996
|
"Content-Type": "application/json",
|
|
26975
|
-
Authorization: `Bearer ${token}
|
|
26997
|
+
Authorization: `Bearer ${token}`,
|
|
26998
|
+
// Names the task so the portal can own this prompt server-side instead of
|
|
26999
|
+
// trusting the one we build. Summarization is the archetypal Class-B flow:
|
|
27000
|
+
// one fixed purpose, no conversation, and today its instructions are ours
|
|
27001
|
+
// to reword.
|
|
27002
|
+
...taskTypeHeader("summarize")
|
|
26976
27003
|
},
|
|
26977
27004
|
body: JSON.stringify({
|
|
26978
27005
|
model,
|
|
@@ -28815,6 +28842,7 @@ async function classifyInjectionCandidates(candidates, options) {
|
|
|
28815
28842
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
28816
28843
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
28817
28844
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
28845
|
+
taskType: "memory_injection_check",
|
|
28818
28846
|
model: options.model ?? DEFAULT_MODEL2,
|
|
28819
28847
|
systemPrompt: SYSTEM_PROMPT2,
|
|
28820
28848
|
userMessage: `Candidate facts:
|
|
@@ -29524,6 +29552,7 @@ async function extractFacts(messages, options) {
|
|
|
29524
29552
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
29525
29553
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
29526
29554
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
29555
|
+
taskType: "memory_extract",
|
|
29527
29556
|
...options.endpointOverride !== void 0 && {
|
|
29528
29557
|
endpointOverride: options.endpointOverride
|
|
29529
29558
|
},
|
|
@@ -30092,6 +30121,7 @@ function createLlmDecayClassifier(options) {
|
|
|
30092
30121
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
30093
30122
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
30094
30123
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
30124
|
+
taskType: "memory_decay",
|
|
30095
30125
|
model: options.model ?? DEFAULT_MODEL3,
|
|
30096
30126
|
systemPrompt: SYSTEM_PROMPT5,
|
|
30097
30127
|
userMessage: `Memory content:
|
|
@@ -31249,6 +31279,7 @@ When a memory refers to one of these, reuse the EXACT existing name (same spelli
|
|
|
31249
31279
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
31250
31280
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
31251
31281
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
31282
|
+
taskType: "memory_topic",
|
|
31252
31283
|
...options.endpointOverride !== void 0 && {
|
|
31253
31284
|
endpointOverride: options.endpointOverride
|
|
31254
31285
|
},
|
|
@@ -31442,6 +31473,7 @@ ${evidence}`);
|
|
|
31442
31473
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
31443
31474
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
31444
31475
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
31476
|
+
taskType: "memory_verify_support",
|
|
31445
31477
|
model: options.model ?? DEFAULT_MODEL5,
|
|
31446
31478
|
systemPrompt: SYSTEM_PROMPT7,
|
|
31447
31479
|
userMessage: `Stored facts and their sources:
|
package/dist/server/index.d.mts
CHANGED
|
@@ -4680,6 +4680,44 @@ interface EntityOperationsContext {
|
|
|
4680
4680
|
allowUnscopedRows?: boolean;
|
|
4681
4681
|
}
|
|
4682
4682
|
|
|
4683
|
+
/**
|
|
4684
|
+
* Shared portal LLM call for the memory pipeline.
|
|
4685
|
+
*
|
|
4686
|
+
* The three LLM-driven steps (`extractFacts`, `consolidateMemory`,
|
|
4687
|
+
* `decomposeQuery`) share the same shape: POST to `/api/v1/chat/completions`
|
|
4688
|
+
* with a system+user prompt and `response_format: json_object`, parse
|
|
4689
|
+
* `choices[0].message.content` as JSON, validate, return null on any failure.
|
|
4690
|
+
* This helper owns the fetch+timeout+parse+log boilerplate so each caller
|
|
4691
|
+
* stays focused on its prompt and validator.
|
|
4692
|
+
*
|
|
4693
|
+
* PROMPT CACHING. The portal inserts explicit prompt-cache breakpoints only for
|
|
4694
|
+
* `anthropic/` models. Its request schema does carry OpenAI's
|
|
4695
|
+
* `prompt_cache_key`, but that is a routing hint for OpenAI's own implicit
|
|
4696
|
+
* cache rather than a switch that enables caching, and we deliberately don't
|
|
4697
|
+
* send it: the memory pipeline runs open-weights models by default (gpt-oss for
|
|
4698
|
+
* extraction/topics, ling for consolidation), and this module already has one
|
|
4699
|
+
* hard lesson about OpenAI-standard fields a non-OpenAI provider hard-400s on
|
|
4700
|
+
* (`response_format`, below). Revisit only with a verified per-provider gate.
|
|
4701
|
+
*
|
|
4702
|
+
* So on the models this pipeline actually uses, the only cache that can hit is
|
|
4703
|
+
* the provider's own implicit prefix cache — which makes prefix stability the
|
|
4704
|
+
* one lever a caller controls. Messages are assembled system-first (below), so
|
|
4705
|
+
* every caller must pass a CONSTANT `systemPrompt` and keep all per-call
|
|
4706
|
+
* material in `userMessage`: a single interpolated timestamp, id, or count in a
|
|
4707
|
+
* system prompt shifts every byte after it and misses the cache on every
|
|
4708
|
+
* request thereafter. The memory callers are regression-gated on that property
|
|
4709
|
+
* in `promptPrefixStability.test.ts`.
|
|
4710
|
+
*
|
|
4711
|
+
* Whether those implicit caches hit is observable: each successful response
|
|
4712
|
+
* logs the portal's reported token counts at debug level, including
|
|
4713
|
+
* `portal.cached_tokens` (the prompt tokens the provider served from cache —
|
|
4714
|
+
* the portal omits the field when there was no hit). See {@link logPortalUsage}.
|
|
4715
|
+
*
|
|
4716
|
+
* There is no batch/async-bulk route on the portal, so a backfill or reindex
|
|
4717
|
+
* has no discounted-throughput path either; its only levers are the same stable
|
|
4718
|
+
* prefix and caller-side batching (e.g. topicExtract's 10-memories-per-call).
|
|
4719
|
+
*/
|
|
4720
|
+
|
|
4683
4721
|
/**
|
|
4684
4722
|
* Auth for portal LLM calls (extraction, consolidation, decomposition,
|
|
4685
4723
|
* reflection). Mirrors `memoryEngine`'s `EmbeddingOptions` dual-auth:
|
package/dist/server/index.d.ts
CHANGED
|
@@ -4680,6 +4680,44 @@ interface EntityOperationsContext {
|
|
|
4680
4680
|
allowUnscopedRows?: boolean;
|
|
4681
4681
|
}
|
|
4682
4682
|
|
|
4683
|
+
/**
|
|
4684
|
+
* Shared portal LLM call for the memory pipeline.
|
|
4685
|
+
*
|
|
4686
|
+
* The three LLM-driven steps (`extractFacts`, `consolidateMemory`,
|
|
4687
|
+
* `decomposeQuery`) share the same shape: POST to `/api/v1/chat/completions`
|
|
4688
|
+
* with a system+user prompt and `response_format: json_object`, parse
|
|
4689
|
+
* `choices[0].message.content` as JSON, validate, return null on any failure.
|
|
4690
|
+
* This helper owns the fetch+timeout+parse+log boilerplate so each caller
|
|
4691
|
+
* stays focused on its prompt and validator.
|
|
4692
|
+
*
|
|
4693
|
+
* PROMPT CACHING. The portal inserts explicit prompt-cache breakpoints only for
|
|
4694
|
+
* `anthropic/` models. Its request schema does carry OpenAI's
|
|
4695
|
+
* `prompt_cache_key`, but that is a routing hint for OpenAI's own implicit
|
|
4696
|
+
* cache rather than a switch that enables caching, and we deliberately don't
|
|
4697
|
+
* send it: the memory pipeline runs open-weights models by default (gpt-oss for
|
|
4698
|
+
* extraction/topics, ling for consolidation), and this module already has one
|
|
4699
|
+
* hard lesson about OpenAI-standard fields a non-OpenAI provider hard-400s on
|
|
4700
|
+
* (`response_format`, below). Revisit only with a verified per-provider gate.
|
|
4701
|
+
*
|
|
4702
|
+
* So on the models this pipeline actually uses, the only cache that can hit is
|
|
4703
|
+
* the provider's own implicit prefix cache — which makes prefix stability the
|
|
4704
|
+
* one lever a caller controls. Messages are assembled system-first (below), so
|
|
4705
|
+
* every caller must pass a CONSTANT `systemPrompt` and keep all per-call
|
|
4706
|
+
* material in `userMessage`: a single interpolated timestamp, id, or count in a
|
|
4707
|
+
* system prompt shifts every byte after it and misses the cache on every
|
|
4708
|
+
* request thereafter. The memory callers are regression-gated on that property
|
|
4709
|
+
* in `promptPrefixStability.test.ts`.
|
|
4710
|
+
*
|
|
4711
|
+
* Whether those implicit caches hit is observable: each successful response
|
|
4712
|
+
* logs the portal's reported token counts at debug level, including
|
|
4713
|
+
* `portal.cached_tokens` (the prompt tokens the provider served from cache —
|
|
4714
|
+
* the portal omits the field when there was no hit). See {@link logPortalUsage}.
|
|
4715
|
+
*
|
|
4716
|
+
* There is no batch/async-bulk route on the portal, so a backfill or reindex
|
|
4717
|
+
* has no discounted-throughput path either; its only levers are the same stable
|
|
4718
|
+
* prefix and caller-side batching (e.g. topicExtract's 10-memories-per-call).
|
|
4719
|
+
*/
|
|
4720
|
+
|
|
4683
4721
|
/**
|
|
4684
4722
|
* Auth for portal LLM calls (extraction, consolidation, decomposition,
|
|
4685
4723
|
* reflection). Mirrors `memoryEngine`'s `EmbeddingOptions` dual-auth:
|
package/dist/server/index.mjs
CHANGED
|
@@ -141,12 +141,12 @@ import {
|
|
|
141
141
|
updateVaultMemoryOp,
|
|
142
142
|
upsertMessageOp,
|
|
143
143
|
vaultMemoryToStored
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-FS6DNUNT.mjs";
|
|
145
145
|
import {
|
|
146
146
|
createStreamingDeAnonymizer,
|
|
147
147
|
notifyConsolidationFallback,
|
|
148
148
|
resolvePiiRedactor
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-MEQ2PAEX.mjs";
|
|
150
150
|
import {
|
|
151
151
|
INTERNAL_FLOW_MARKER,
|
|
152
152
|
callPortalJsonCompletion,
|
|
@@ -154,9 +154,10 @@ import {
|
|
|
154
154
|
getLogger,
|
|
155
155
|
resolvePortalAuthHeaders,
|
|
156
156
|
supportsResponseFormat,
|
|
157
|
+
taskTypeHeader,
|
|
157
158
|
validateEndpointOverride,
|
|
158
159
|
withInternalFlowMarker
|
|
159
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-KF5OU4IN.mjs";
|
|
160
161
|
import {
|
|
161
162
|
BASE_URL,
|
|
162
163
|
__commonJS,
|
|
@@ -3408,7 +3409,12 @@ async function callSummarizationLlm(prompt, model, token, baseUrl) {
|
|
|
3408
3409
|
method: "POST",
|
|
3409
3410
|
headers: {
|
|
3410
3411
|
"Content-Type": "application/json",
|
|
3411
|
-
Authorization: `Bearer ${token}
|
|
3412
|
+
Authorization: `Bearer ${token}`,
|
|
3413
|
+
// Names the task so the portal can own this prompt server-side instead of
|
|
3414
|
+
// trusting the one we build. Summarization is the archetypal Class-B flow:
|
|
3415
|
+
// one fixed purpose, no conversation, and today its instructions are ours
|
|
3416
|
+
// to reword.
|
|
3417
|
+
...taskTypeHeader("summarize")
|
|
3412
3418
|
},
|
|
3413
3419
|
body: JSON.stringify({
|
|
3414
3420
|
model,
|
|
@@ -5219,6 +5225,7 @@ async function classifyInjectionCandidates(candidates, options) {
|
|
|
5219
5225
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
5220
5226
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
5221
5227
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
5228
|
+
taskType: "memory_injection_check",
|
|
5222
5229
|
model: options.model ?? DEFAULT_MODEL,
|
|
5223
5230
|
systemPrompt: SYSTEM_PROMPT,
|
|
5224
5231
|
userMessage: `Candidate facts:
|
|
@@ -5693,7 +5700,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
5693
5700
|
content: m.content,
|
|
5694
5701
|
similarity: m.similarity
|
|
5695
5702
|
}));
|
|
5696
|
-
const { consolidateMemory: doConsolidate } = await import("./consolidate-
|
|
5703
|
+
const { consolidateMemory: doConsolidate } = await import("./consolidate-QDWEYFTZ.mjs");
|
|
5697
5704
|
const decision = await doConsolidate(trimmed, candidates, consolidateOptions);
|
|
5698
5705
|
if (decision.action === "create") return null;
|
|
5699
5706
|
if (decision.action === "supersede" && decision.content) {
|
|
@@ -5918,6 +5925,7 @@ async function extractFacts(messages, options) {
|
|
|
5918
5925
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
5919
5926
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
5920
5927
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
5928
|
+
taskType: "memory_extract",
|
|
5921
5929
|
...options.endpointOverride !== void 0 && {
|
|
5922
5930
|
endpointOverride: options.endpointOverride
|
|
5923
5931
|
},
|
|
@@ -6480,6 +6488,7 @@ function createLlmDecayClassifier(options) {
|
|
|
6480
6488
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
6481
6489
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
6482
6490
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
6491
|
+
taskType: "memory_decay",
|
|
6483
6492
|
model: options.model ?? DEFAULT_MODEL2,
|
|
6484
6493
|
systemPrompt: SYSTEM_PROMPT3,
|
|
6485
6494
|
userMessage: `Memory content:
|
|
@@ -7603,6 +7612,7 @@ When a memory refers to one of these, reuse the EXACT existing name (same spelli
|
|
|
7603
7612
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
7604
7613
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
7605
7614
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
7615
|
+
taskType: "memory_topic",
|
|
7606
7616
|
...options.endpointOverride !== void 0 && {
|
|
7607
7617
|
endpointOverride: options.endpointOverride
|
|
7608
7618
|
},
|
|
@@ -7792,6 +7802,7 @@ ${evidence}`);
|
|
|
7792
7802
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
7793
7803
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
7794
7804
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
7805
|
+
taskType: "memory_verify_support",
|
|
7795
7806
|
model: options.model ?? DEFAULT_MODEL4,
|
|
7796
7807
|
systemPrompt: SYSTEM_PROMPT5,
|
|
7797
7808
|
userMessage: `Stored facts and their sources:
|