@remnic/core 9.3.676 → 9.3.678
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/access-cli.js +21 -21
- package/dist/access-http.js +16 -16
- package/dist/access-mcp.js +15 -15
- package/dist/access-schema.js +3 -3
- package/dist/access-service.js +13 -13
- package/dist/capabilities.d.ts +29 -1
- package/dist/capabilities.js +5 -3
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +2 -2
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +1 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-SDLJ2W7S.js → chunk-2AP4QJX5.js} +4 -4
- package/dist/{chunk-Y56J7CXW.js → chunk-2LDBXPLB.js} +10 -5
- package/dist/chunk-2LDBXPLB.js.map +1 -0
- package/dist/{chunk-ZLINDOBG.js → chunk-4PPMUNV5.js} +5 -5
- package/dist/{chunk-Q5ZU3RNY.js → chunk-57ME5VSI.js} +4 -4
- package/dist/{chunk-R37A3BEW.js → chunk-7AAKSHDG.js} +147 -122
- package/dist/chunk-7AAKSHDG.js.map +1 -0
- package/dist/{chunk-T2AOOHDA.js → chunk-ACYX37IM.js} +2 -2
- package/dist/{chunk-DOCTITOP.js → chunk-DGEZKYVI.js} +4 -4
- package/dist/{chunk-Q6MIDQEL.js → chunk-EQYP3HA6.js} +2 -2
- package/dist/{chunk-52LZ42LI.js → chunk-ERA5RSMZ.js} +1 -1
- package/dist/{chunk-SF45RQDX.js → chunk-K2JYO6QV.js} +4 -4
- package/dist/{chunk-IPLYGWQF.js → chunk-KQAFEZQX.js} +5 -5
- package/dist/{chunk-RI5XBIZ6.js → chunk-PBH4JUAB.js} +14 -2
- package/dist/{chunk-RI5XBIZ6.js.map → chunk-PBH4JUAB.js.map} +1 -1
- package/dist/{chunk-XVVEKF5I.js → chunk-PCGCQTU6.js} +22 -22
- package/dist/{chunk-B6IUW76R.js → chunk-Q2H5U37U.js} +1 -1
- package/dist/{chunk-WXGTC424.js → chunk-RC3AFF6Z.js} +1 -1
- package/dist/{chunk-HQCGRSRU.js → chunk-SECQS4G4.js} +2 -2
- package/dist/{chunk-QLRYXOAD.js → chunk-UDJLF3BO.js} +2 -2
- package/dist/{chunk-OG7A6AZX.js → chunk-UNZLU2MX.js} +4 -4
- package/dist/{chunk-B55KFEGS.js → chunk-YJ4J2JJ2.js} +10 -10
- package/dist/{chunk-NE566K4E.js → chunk-YXWAILM4.js} +2 -2
- package/dist/{chunk-OUWAQVDJ.js → chunk-Z6SEG36L.js} +4 -4
- package/dist/cli.js +25 -25
- package/dist/{coding-graph-types-Dd2tGrnm.d.ts → coding/coding-graph-types.d.ts} +1 -1
- package/dist/coding/coding-graph-types.js +10 -0
- package/dist/coding/coding-graph-types.js.map +1 -0
- package/dist/coding/optional-coding-graph.d.ts +2 -2
- package/dist/coding/optional-coding-graph.js +1 -1
- package/dist/compounding/engine.js +1 -1
- package/dist/contradiction/index.js +4 -4
- package/dist/{graph-edge-decay-PUFNHOBS.js → graph-edge-decay-KSVJGCZW.js} +2 -2
- package/dist/graph-snapshot.js +2 -2
- package/dist/graph.d.ts +11 -0
- package/dist/graph.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +38 -38
- package/dist/lcm/index.js +3 -3
- package/dist/namespaces/migrate.js +8 -8
- package/dist/namespaces/search.js +7 -7
- package/dist/operator-toolkit.js +10 -10
- package/dist/orchestrator.js +17 -17
- package/dist/search/factory.js +6 -6
- package/dist/search/index.js +11 -11
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/orama-backend.js +2 -2
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/package.json +7 -2
- package/src/capabilities.test.ts +173 -0
- package/src/capabilities.ts +61 -0
- package/src/graph.ts +20 -4
- package/src/orchestrator.ts +85 -208
- package/src/scopes/scope-plan.test.ts +360 -0
- package/src/scopes/scope-plan.ts +320 -0
- package/dist/chunk-R37A3BEW.js.map +0 -1
- package/dist/chunk-Y56J7CXW.js.map +0 -1
- /package/dist/{chunk-SDLJ2W7S.js.map → chunk-2AP4QJX5.js.map} +0 -0
- /package/dist/{chunk-ZLINDOBG.js.map → chunk-4PPMUNV5.js.map} +0 -0
- /package/dist/{chunk-Q5ZU3RNY.js.map → chunk-57ME5VSI.js.map} +0 -0
- /package/dist/{chunk-T2AOOHDA.js.map → chunk-ACYX37IM.js.map} +0 -0
- /package/dist/{chunk-DOCTITOP.js.map → chunk-DGEZKYVI.js.map} +0 -0
- /package/dist/{chunk-Q6MIDQEL.js.map → chunk-EQYP3HA6.js.map} +0 -0
- /package/dist/{chunk-52LZ42LI.js.map → chunk-ERA5RSMZ.js.map} +0 -0
- /package/dist/{chunk-SF45RQDX.js.map → chunk-K2JYO6QV.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-XVVEKF5I.js.map → chunk-PCGCQTU6.js.map} +0 -0
- /package/dist/{chunk-B6IUW76R.js.map → chunk-Q2H5U37U.js.map} +0 -0
- /package/dist/{chunk-WXGTC424.js.map → chunk-RC3AFF6Z.js.map} +0 -0
- /package/dist/{chunk-HQCGRSRU.js.map → chunk-SECQS4G4.js.map} +0 -0
- /package/dist/{chunk-QLRYXOAD.js.map → chunk-UDJLF3BO.js.map} +0 -0
- /package/dist/{chunk-OG7A6AZX.js.map → chunk-UNZLU2MX.js.map} +0 -0
- /package/dist/{chunk-B55KFEGS.js.map → chunk-YJ4J2JJ2.js.map} +0 -0
- /package/dist/{chunk-NE566K4E.js.map → chunk-YXWAILM4.js.map} +0 -0
- /package/dist/{chunk-OUWAQVDJ.js.map → chunk-Z6SEG36L.js.map} +0 -0
- /package/dist/{graph-edge-decay-PUFNHOBS.js.map → graph-edge-decay-KSVJGCZW.js.map} +0 -0
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
syncWearableSource,
|
|
6
6
|
wearableSourceLabel
|
|
7
7
|
} from "./chunk-4SKKVWLQ.js";
|
|
8
|
+
import {
|
|
9
|
+
migrateFromEngram
|
|
10
|
+
} from "./chunk-7HYPN2GC.js";
|
|
8
11
|
import {
|
|
9
12
|
ensureContradictionScanCron,
|
|
10
13
|
ensureDaySummaryCron,
|
|
@@ -14,25 +17,22 @@ import {
|
|
|
14
17
|
ensureProceduralMiningCron,
|
|
15
18
|
graphEdgeDecayCadenceToCronExpr
|
|
16
19
|
} from "./chunk-666A3MOW.js";
|
|
17
|
-
import {
|
|
18
|
-
migrateFromEngram
|
|
19
|
-
} from "./chunk-7HYPN2GC.js";
|
|
20
20
|
import {
|
|
21
21
|
LcmEngine
|
|
22
22
|
} from "./chunk-3IE22DJ2.js";
|
|
23
|
-
import {
|
|
24
|
-
chunkTranscriptEntries
|
|
25
|
-
} from "./chunk-TECVW3JP.js";
|
|
26
23
|
import {
|
|
27
24
|
cleanupConversationChunks
|
|
28
25
|
} from "./chunk-T2PO5MUF.js";
|
|
29
26
|
import {
|
|
30
27
|
CompoundingEngine,
|
|
31
28
|
defaultTierMigrationCycleBudget
|
|
32
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Q2H5U37U.js";
|
|
33
30
|
import {
|
|
34
31
|
SharedContextManager
|
|
35
32
|
} from "./chunk-DRD2Q7HQ.js";
|
|
33
|
+
import {
|
|
34
|
+
chunkTranscriptEntries
|
|
35
|
+
} from "./chunk-TECVW3JP.js";
|
|
36
36
|
import {
|
|
37
37
|
extractTopics
|
|
38
38
|
} from "./chunk-UHGBNIOS.js";
|
|
@@ -206,12 +206,12 @@ import {
|
|
|
206
206
|
parseConsolidationResponse,
|
|
207
207
|
parseOperatorAwareConsolidationResponse
|
|
208
208
|
} from "./chunk-V4ZHKCGA.js";
|
|
209
|
-
import {
|
|
210
|
-
RoutingRulesStore
|
|
211
|
-
} from "./chunk-X6IRLNOO.js";
|
|
212
209
|
import {
|
|
213
210
|
normalizeReplaySessionKey
|
|
214
211
|
} from "./chunk-2PRQG7PV.js";
|
|
212
|
+
import {
|
|
213
|
+
RoutingRulesStore
|
|
214
|
+
} from "./chunk-X6IRLNOO.js";
|
|
215
215
|
import {
|
|
216
216
|
compareVerifiedEpisodeResults,
|
|
217
217
|
searchVerifiedEpisodes
|
|
@@ -274,8 +274,9 @@ import {
|
|
|
274
274
|
gatewayTaskChainOptions
|
|
275
275
|
} from "./chunk-LCC5EZTT.js";
|
|
276
276
|
import {
|
|
277
|
-
resolveCapabilities
|
|
278
|
-
|
|
277
|
+
resolveCapabilities,
|
|
278
|
+
resolveGraphConstructionCapabilities
|
|
279
|
+
} from "./chunk-PBH4JUAB.js";
|
|
279
280
|
import {
|
|
280
281
|
compileCorrectionRule,
|
|
281
282
|
correctionsFilePath,
|
|
@@ -322,11 +323,11 @@ import {
|
|
|
322
323
|
} from "./chunk-6VP3YUCS.js";
|
|
323
324
|
import {
|
|
324
325
|
NamespaceSearchRouter
|
|
325
|
-
} from "./chunk-
|
|
326
|
+
} from "./chunk-EQYP3HA6.js";
|
|
326
327
|
import {
|
|
327
328
|
createConversationIndexRuntime,
|
|
328
329
|
createSearchBackend
|
|
329
|
-
} from "./chunk-
|
|
330
|
+
} from "./chunk-YJ4J2JJ2.js";
|
|
330
331
|
import {
|
|
331
332
|
NoopSearchBackend
|
|
332
333
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -356,7 +357,7 @@ import {
|
|
|
356
357
|
} from "./chunk-GKKAXVAJ.js";
|
|
357
358
|
import {
|
|
358
359
|
GraphIndex
|
|
359
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-2LDBXPLB.js";
|
|
360
361
|
import {
|
|
361
362
|
buildChainFollowupGenerator
|
|
362
363
|
} from "./chunk-ATRB6Q25.js";
|
|
@@ -408,7 +409,7 @@ import {
|
|
|
408
409
|
} from "./chunk-FVQJYWH7.js";
|
|
409
410
|
import {
|
|
410
411
|
searchCausalTrajectories
|
|
411
|
-
} from "./chunk-
|
|
412
|
+
} from "./chunk-RC3AFF6Z.js";
|
|
412
413
|
import {
|
|
413
414
|
canReadNamespace,
|
|
414
415
|
defaultNamespaceForPrincipal,
|
|
@@ -3488,6 +3489,81 @@ function itemCountForNamespace(result, namespace) {
|
|
|
3488
3489
|
return result?.itemCount;
|
|
3489
3490
|
}
|
|
3490
3491
|
|
|
3492
|
+
// src/scopes/scope-plan.ts
|
|
3493
|
+
function resolveScopePlan(options) {
|
|
3494
|
+
const { config, sessionKey } = options;
|
|
3495
|
+
const namespaceOverride = options.namespace?.trim() || void 0;
|
|
3496
|
+
const principal = typeof options.principalOverride === "string" && options.principalOverride.length > 0 ? options.principalOverride : resolvePrincipal(sessionKey, config);
|
|
3497
|
+
const namespaceOverrideReadable = namespaceOverride !== void 0 && canReadNamespace(principal, namespaceOverride, config);
|
|
3498
|
+
const readableRecallNamespaces = recallNamespacesForPrincipal(principal, config);
|
|
3499
|
+
const namespacesEnabled = options.namespacesEnabled;
|
|
3500
|
+
const codingOverlay = namespaceOverrideReadable || !namespacesEnabled ? null : resolveCodingNamespaceOverlay(
|
|
3501
|
+
options.codingContext ?? null,
|
|
3502
|
+
config.codingMode,
|
|
3503
|
+
config.defaultNamespace
|
|
3504
|
+
);
|
|
3505
|
+
const principalSelfNamespace = defaultNamespaceForPrincipal(principal, config);
|
|
3506
|
+
const codingSelfNamespace = codingOverlay ? combineNamespaces(principalSelfNamespace, codingOverlay.namespace) : null;
|
|
3507
|
+
const scopeProfilePlan = namespaceOverrideReadable ? null : resolveScopeProfilePlan({
|
|
3508
|
+
config,
|
|
3509
|
+
principal,
|
|
3510
|
+
codingContext: options.codingContext ?? null,
|
|
3511
|
+
codingOverlay
|
|
3512
|
+
});
|
|
3513
|
+
const profileEffectiveNamespace = scopeProfilePlan?.writeNamespace || scopeProfilePlan?.readNamespaces[0];
|
|
3514
|
+
const baseNamespace = namespaceOverrideReadable ? namespaceOverride : profileEffectiveNamespace ?? codingSelfNamespace ?? principalSelfNamespace;
|
|
3515
|
+
let readNamespaces;
|
|
3516
|
+
if (namespaceOverrideReadable) {
|
|
3517
|
+
readNamespaces = [namespaceOverride];
|
|
3518
|
+
} else if (scopeProfilePlan) {
|
|
3519
|
+
readNamespaces = expandScopeProfileReadNamespaces({
|
|
3520
|
+
profilePlan: scopeProfilePlan,
|
|
3521
|
+
principalSelfNamespace: scopeProfilePlan.baseNamespace,
|
|
3522
|
+
config,
|
|
3523
|
+
principal,
|
|
3524
|
+
codingOverlay,
|
|
3525
|
+
legacyRecallNamespaces: readableRecallNamespaces
|
|
3526
|
+
});
|
|
3527
|
+
} else if (codingOverlay && codingSelfNamespace) {
|
|
3528
|
+
const mapped = readableRecallNamespaces.map(
|
|
3529
|
+
(ns) => ns === principalSelfNamespace ? codingSelfNamespace : ns
|
|
3530
|
+
);
|
|
3531
|
+
const fallbackNs = codingOverlay.readFallbacks.map(
|
|
3532
|
+
(fallback) => combineNamespaces(principalSelfNamespace, fallback)
|
|
3533
|
+
);
|
|
3534
|
+
readNamespaces = Array.from(/* @__PURE__ */ new Set([...mapped, ...fallbackNs]));
|
|
3535
|
+
} else {
|
|
3536
|
+
readNamespaces = readableRecallNamespaces;
|
|
3537
|
+
}
|
|
3538
|
+
const readFallbacks = codingOverlay ? codingOverlay.readFallbacks.map((fb) => combineNamespaces(principalSelfNamespace, fb)) : [];
|
|
3539
|
+
const codingOverlaySelfReadable = codingOverlay !== null && (scopeProfilePlan ? scopeProfilePlan.layers.some((layer) => layer.id === "userProject" && layer.readable) : readableRecallNamespaces.includes(principalSelfNamespace));
|
|
3540
|
+
let lcmReadNamespaces;
|
|
3541
|
+
if (namespaceOverrideReadable) {
|
|
3542
|
+
lcmReadNamespaces = [namespaceOverride];
|
|
3543
|
+
} else if (scopeProfilePlan) {
|
|
3544
|
+
lcmReadNamespaces = readNamespaces;
|
|
3545
|
+
} else if (codingOverlay && codingSelfNamespace && codingOverlaySelfReadable) {
|
|
3546
|
+
const fallbackNs = codingOverlay.readFallbacks.map(
|
|
3547
|
+
(fallback) => combineNamespaces(principalSelfNamespace, fallback)
|
|
3548
|
+
);
|
|
3549
|
+
lcmReadNamespaces = [codingSelfNamespace, ...fallbackNs];
|
|
3550
|
+
} else {
|
|
3551
|
+
lcmReadNamespaces = [config.defaultNamespace];
|
|
3552
|
+
}
|
|
3553
|
+
const lcmReadSessionIds = scopeProfilePlan && !sessionKey ? [] : lcmReadSessionIdsForNamespaces(lcmReadNamespaces, sessionKey, config.defaultNamespace);
|
|
3554
|
+
return {
|
|
3555
|
+
principal,
|
|
3556
|
+
namespaceOverride: namespaceOverrideReadable ? namespaceOverride : void 0,
|
|
3557
|
+
baseNamespace,
|
|
3558
|
+
readNamespaces,
|
|
3559
|
+
readFallbacks,
|
|
3560
|
+
lcmReadNamespaces,
|
|
3561
|
+
lcmReadSessionIds,
|
|
3562
|
+
codingOverlay: codingOverlay ? { namespace: codingOverlay.namespace, readFallbacks: codingOverlay.readFallbacks } : null,
|
|
3563
|
+
scopeProfilePlan
|
|
3564
|
+
};
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3491
3567
|
// src/orchestrator.ts
|
|
3492
3568
|
var BulkImportBatchPartialFailureError = class extends Error {
|
|
3493
3569
|
partialResult;
|
|
@@ -7087,6 +7163,7 @@ ${r.snippet.trim()}
|
|
|
7087
7163
|
}
|
|
7088
7164
|
async recall(prompt, sessionKey, options = {}) {
|
|
7089
7165
|
const caps = resolveCapabilities(this.config);
|
|
7166
|
+
const graphCaps = resolveGraphConstructionCapabilities(this.config);
|
|
7090
7167
|
const abortController = new AbortController();
|
|
7091
7168
|
const onAbort = () => {
|
|
7092
7169
|
abortController.abort();
|
|
@@ -7097,7 +7174,8 @@ ${r.snippet.trim()}
|
|
|
7097
7174
|
options.abortSignal?.addEventListener("abort", onAbort, { once: true });
|
|
7098
7175
|
}
|
|
7099
7176
|
const principal = typeof options.principalOverride === "string" && options.principalOverride.length > 0 ? options.principalOverride : resolvePrincipal(sessionKey, this.config);
|
|
7100
|
-
|
|
7177
|
+
const namespacesEnabled = this.config.namespacesEnabled;
|
|
7178
|
+
if (namespacesEnabled && !principal) {
|
|
7101
7179
|
throw new Error("authentication required: namespaces are enabled and no principal was supplied");
|
|
7102
7180
|
}
|
|
7103
7181
|
let initGateTimeoutHandle = null;
|
|
@@ -7140,7 +7218,7 @@ ${r.snippet.trim()}
|
|
|
7140
7218
|
const recallPromise = this.recallInternal(prompt, sessionKey, {
|
|
7141
7219
|
...options,
|
|
7142
7220
|
abortSignal: abortController.signal
|
|
7143
|
-
}, caps);
|
|
7221
|
+
}, caps, graphCaps);
|
|
7144
7222
|
const RECALL_TIMEOUT_MS = this.config.recallOuterTimeoutMs ?? 75e3;
|
|
7145
7223
|
if (RECALL_TIMEOUT_MS <= 0) {
|
|
7146
7224
|
return await recallPromise;
|
|
@@ -7165,7 +7243,8 @@ ${r.snippet.trim()}
|
|
|
7165
7243
|
sessionKey,
|
|
7166
7244
|
options.namespace?.trim() || void 0,
|
|
7167
7245
|
options.principalOverride,
|
|
7168
|
-
caps
|
|
7246
|
+
caps,
|
|
7247
|
+
namespacesEnabled
|
|
7169
7248
|
);
|
|
7170
7249
|
} catch (err) {
|
|
7171
7250
|
log.debug(`direct-answer observation setup failed: ${err}`);
|
|
@@ -7220,44 +7299,19 @@ ${r.snippet.trim()}
|
|
|
7220
7299
|
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
7221
7300
|
}
|
|
7222
7301
|
}
|
|
7223
|
-
enqueueDirectAnswerObservation(prompt, sessionKey, namespaceOverride, principalOverride, caps) {
|
|
7302
|
+
enqueueDirectAnswerObservation(prompt, sessionKey, namespaceOverride, principalOverride, caps, namespacesEnabled) {
|
|
7224
7303
|
const expectedSnapshot = this.lastRecall.get(sessionKey);
|
|
7225
7304
|
if (expectedSnapshot === null) return;
|
|
7226
7305
|
if (expectedSnapshot.plannerMode === "no_recall") return;
|
|
7227
|
-
const
|
|
7228
|
-
const observationCodingOverlay = namespaceOverride && canReadNamespace(principal, namespaceOverride, this.config) ? null : this.applyCodingRecallOverlay(sessionKey);
|
|
7229
|
-
const observationPrincipalSelf = defaultNamespaceForPrincipal(principal, this.config);
|
|
7230
|
-
const observationCodingSelf = observationCodingOverlay ? combineNamespaces(observationPrincipalSelf, observationCodingOverlay.namespace) : null;
|
|
7231
|
-
const observationScopeProfilePlan = namespaceOverride && canReadNamespace(principal, namespaceOverride, this.config) ? null : resolveScopeProfilePlan({
|
|
7306
|
+
const observationScopePlan = resolveScopePlan({
|
|
7232
7307
|
config: this.config,
|
|
7233
|
-
|
|
7308
|
+
sessionKey,
|
|
7309
|
+
namespace: namespaceOverride,
|
|
7310
|
+
principalOverride,
|
|
7234
7311
|
codingContext: sessionKey ? this.getCodingContextForSession(sessionKey) : null,
|
|
7235
|
-
|
|
7312
|
+
namespacesEnabled
|
|
7236
7313
|
});
|
|
7237
|
-
|
|
7238
|
-
if (namespaceOverride && canReadNamespace(principal, namespaceOverride, this.config)) {
|
|
7239
|
-
observationNamespaces = [namespaceOverride];
|
|
7240
|
-
} else if (observationScopeProfilePlan) {
|
|
7241
|
-
observationNamespaces = expandScopeProfileReadNamespaces({
|
|
7242
|
-
profilePlan: observationScopeProfilePlan,
|
|
7243
|
-
principalSelfNamespace: observationScopeProfilePlan.baseNamespace,
|
|
7244
|
-
config: this.config,
|
|
7245
|
-
principal,
|
|
7246
|
-
codingOverlay: observationCodingOverlay,
|
|
7247
|
-
legacyRecallNamespaces: recallNamespacesForPrincipal(principal, this.config)
|
|
7248
|
-
});
|
|
7249
|
-
} else if (observationCodingOverlay && observationCodingSelf) {
|
|
7250
|
-
const base = recallNamespacesForPrincipal(principal, this.config);
|
|
7251
|
-
const mapped = base.map(
|
|
7252
|
-
(ns) => ns === observationPrincipalSelf ? observationCodingSelf : ns
|
|
7253
|
-
);
|
|
7254
|
-
const fallbackNs = observationCodingOverlay.readFallbacks.map(
|
|
7255
|
-
(fallback) => combineNamespaces(observationPrincipalSelf, fallback)
|
|
7256
|
-
);
|
|
7257
|
-
observationNamespaces = Array.from(/* @__PURE__ */ new Set([...mapped, ...fallbackNs]));
|
|
7258
|
-
} else {
|
|
7259
|
-
observationNamespaces = recallNamespacesForPrincipal(principal, this.config);
|
|
7260
|
-
}
|
|
7314
|
+
const observationNamespaces = observationScopePlan.readNamespaces;
|
|
7261
7315
|
const observationQueryPolicy = buildRecallQueryPolicy(prompt, sessionKey, {
|
|
7262
7316
|
cronRecallPolicyEnabled: this.config.cronRecallPolicyEnabled,
|
|
7263
7317
|
cronRecallNormalizedQueryMaxChars: this.config.cronRecallNormalizedQueryMaxChars,
|
|
@@ -8222,7 +8276,7 @@ ${r.snippet.trim()}
|
|
|
8222
8276
|
recallAssemblyClockMs() {
|
|
8223
8277
|
return Date.now();
|
|
8224
8278
|
}
|
|
8225
|
-
async recallInternal(prompt, sessionKey, options = {}, caps = resolveCapabilities(this.config)) {
|
|
8279
|
+
async recallInternal(prompt, sessionKey, options = {}, caps = resolveCapabilities(this.config), graphCaps = resolveGraphConstructionCapabilities(this.config)) {
|
|
8226
8280
|
const recallStart = Date.now();
|
|
8227
8281
|
const backendDegradations = [];
|
|
8228
8282
|
let asOfMs;
|
|
@@ -8320,7 +8374,7 @@ ${r.snippet.trim()}
|
|
|
8320
8374
|
const recallModeDecisionOptions = {
|
|
8321
8375
|
plannerEnabled: caps.recallPlanner,
|
|
8322
8376
|
graphRecallEnabled: caps.graphRecall,
|
|
8323
|
-
multiGraphMemoryEnabled:
|
|
8377
|
+
multiGraphMemoryEnabled: graphCaps.multiGraphMemory,
|
|
8324
8378
|
graphExpandedIntentEnabled: caps.graphExpandedIntent,
|
|
8325
8379
|
prompt
|
|
8326
8380
|
};
|
|
@@ -8385,72 +8439,30 @@ ${r.snippet.trim()}
|
|
|
8385
8439
|
);
|
|
8386
8440
|
const embeddingFetchLimit = computedFetchLimit;
|
|
8387
8441
|
const principal = typeof options.principalOverride === "string" && options.principalOverride.length > 0 ? options.principalOverride : resolvePrincipal(sessionKey, this.config);
|
|
8388
|
-
|
|
8442
|
+
const namespacesEnabled = this.config.namespacesEnabled;
|
|
8443
|
+
if (namespacesEnabled && !principal) {
|
|
8389
8444
|
throw new Error("authentication required: namespaces are enabled and no principal was supplied");
|
|
8390
8445
|
}
|
|
8391
8446
|
const namespaceOverride = options.namespace?.trim() || void 0;
|
|
8392
|
-
const readableRecallNamespaces = recallNamespacesForPrincipal(
|
|
8393
|
-
principal,
|
|
8394
|
-
this.config
|
|
8395
|
-
);
|
|
8396
8447
|
if (namespaceOverride && !canReadNamespace(principal, namespaceOverride, this.config)) {
|
|
8397
8448
|
throw new Error(
|
|
8398
8449
|
`namespace override is not readable: ${namespaceOverride}`
|
|
8399
8450
|
);
|
|
8400
8451
|
}
|
|
8401
|
-
const
|
|
8402
|
-
const principalSelfNamespace = defaultNamespaceForPrincipal(principal, this.config);
|
|
8403
|
-
const codingSelfNamespace = codingOverlay ? combineNamespaces(principalSelfNamespace, codingOverlay.namespace) : null;
|
|
8404
|
-
const scopeProfilePlan = namespaceOverride ? null : resolveScopeProfilePlan({
|
|
8452
|
+
const scopePlan = resolveScopePlan({
|
|
8405
8453
|
config: this.config,
|
|
8406
|
-
|
|
8454
|
+
sessionKey,
|
|
8455
|
+
namespace: options.namespace,
|
|
8456
|
+
principalOverride: typeof options.principalOverride === "string" && options.principalOverride.length > 0 ? options.principalOverride : void 0,
|
|
8407
8457
|
codingContext: sessionKey ? this.getCodingContextForSession(sessionKey) : null,
|
|
8408
|
-
|
|
8458
|
+
namespacesEnabled
|
|
8409
8459
|
});
|
|
8410
|
-
const
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
}
|
|
8416
|
-
recallNamespaces = expandScopeProfileReadNamespaces({
|
|
8417
|
-
profilePlan: scopeProfilePlan,
|
|
8418
|
-
principalSelfNamespace: scopeProfilePlan.baseNamespace,
|
|
8419
|
-
config: this.config,
|
|
8420
|
-
principal,
|
|
8421
|
-
codingOverlay,
|
|
8422
|
-
legacyRecallNamespaces: readableRecallNamespaces
|
|
8423
|
-
});
|
|
8424
|
-
} else if (codingOverlay && codingSelfNamespace) {
|
|
8425
|
-
const mapped = readableRecallNamespaces.map(
|
|
8426
|
-
(ns) => ns === principalSelfNamespace ? codingSelfNamespace : ns
|
|
8427
|
-
);
|
|
8428
|
-
const fallbackNs = codingOverlay.readFallbacks.map(
|
|
8429
|
-
(fallback) => combineNamespaces(principalSelfNamespace, fallback)
|
|
8430
|
-
);
|
|
8431
|
-
recallNamespaces = Array.from(/* @__PURE__ */ new Set([...mapped, ...fallbackNs]));
|
|
8432
|
-
} else {
|
|
8433
|
-
recallNamespaces = readableRecallNamespaces;
|
|
8434
|
-
}
|
|
8435
|
-
const codingOverlaySelfReadable = codingOverlay !== null && (scopeProfilePlan ? scopeProfilePlan.layers.some((layer) => layer.id === "userProject" && layer.readable) : readableRecallNamespaces.includes(principalSelfNamespace));
|
|
8436
|
-
let lcmReadNamespaces;
|
|
8437
|
-
if (namespaceOverride) {
|
|
8438
|
-
lcmReadNamespaces = [namespaceOverride];
|
|
8439
|
-
} else if (scopeProfilePlan) {
|
|
8440
|
-
lcmReadNamespaces = recallNamespaces;
|
|
8441
|
-
} else if (codingOverlay && codingSelfNamespace && codingOverlaySelfReadable) {
|
|
8442
|
-
const fallbackNs = codingOverlay.readFallbacks.map(
|
|
8443
|
-
(fallback) => combineNamespaces(principalSelfNamespace, fallback)
|
|
8444
|
-
);
|
|
8445
|
-
lcmReadNamespaces = [codingSelfNamespace, ...fallbackNs];
|
|
8446
|
-
} else {
|
|
8447
|
-
lcmReadNamespaces = [this.config.defaultNamespace];
|
|
8448
|
-
}
|
|
8449
|
-
const lcmReadSessionIds = scopeProfilePlan && !sessionKey ? [] : lcmReadSessionIdsForNamespaces(
|
|
8450
|
-
lcmReadNamespaces,
|
|
8451
|
-
sessionKey,
|
|
8452
|
-
this.config.defaultNamespace
|
|
8453
|
-
);
|
|
8460
|
+
const {
|
|
8461
|
+
readNamespaces: recallNamespaces,
|
|
8462
|
+
baseNamespace: selfNamespace,
|
|
8463
|
+
scopeProfilePlan,
|
|
8464
|
+
lcmReadSessionIds
|
|
8465
|
+
} = scopePlan;
|
|
8454
8466
|
const firstNonEmptyLcmRead = async (read, isEmpty, empty) => {
|
|
8455
8467
|
for (const lcmSessionId of lcmReadSessionIds) {
|
|
8456
8468
|
const value = await read(lcmSessionId);
|
|
@@ -8500,7 +8512,7 @@ ${r.snippet.trim()}
|
|
|
8500
8512
|
shadowMode: graphDecisionShadowMode,
|
|
8501
8513
|
qmdAvailable,
|
|
8502
8514
|
graphRecallEnabled: caps.graphRecall,
|
|
8503
|
-
multiGraphMemoryEnabled:
|
|
8515
|
+
multiGraphMemoryEnabled: graphCaps.multiGraphMemory
|
|
8504
8516
|
}
|
|
8505
8517
|
});
|
|
8506
8518
|
if (recallMode === "no_recall") {
|
|
@@ -10994,7 +11006,7 @@ ${tmtNode.summary}`
|
|
|
10994
11006
|
memoryResults = memoryResults.filter(
|
|
10995
11007
|
(r) => !isArtifactMemoryPath(r.path)
|
|
10996
11008
|
);
|
|
10997
|
-
const isFullModeGraphAssist =
|
|
11009
|
+
const isFullModeGraphAssist = graphCaps.multiGraphMemory && caps.graphAssistInFullMode && recallMode === "full" && memoryResults.length >= Math.max(1, this.config.graphAssistMinSeedResults ?? 3);
|
|
10998
11010
|
const shouldRunGraphExpansion = recallMode === "graph_mode" || isFullModeGraphAssist;
|
|
10999
11011
|
const graphShadowEvalEnabled = isFullModeGraphAssist && this.config.graphAssistShadowEvalEnabled === true;
|
|
11000
11012
|
if (shouldRunGraphExpansion) {
|
|
@@ -11324,6 +11336,7 @@ ${tmtNode.summary}`
|
|
|
11324
11336
|
recallResultLimit,
|
|
11325
11337
|
recallMode,
|
|
11326
11338
|
caps,
|
|
11339
|
+
graphCaps,
|
|
11327
11340
|
queryAwarePrefilter,
|
|
11328
11341
|
abortSignal: options.abortSignal,
|
|
11329
11342
|
onDegradation: (degradation) => {
|
|
@@ -11497,6 +11510,7 @@ ${tmtNode.summary}`
|
|
|
11497
11510
|
recallResultLimit,
|
|
11498
11511
|
recallMode,
|
|
11499
11512
|
caps,
|
|
11513
|
+
graphCaps,
|
|
11500
11514
|
queryAwarePrefilter,
|
|
11501
11515
|
abortSignal: options.abortSignal,
|
|
11502
11516
|
onDegradation: (degradation) => {
|
|
@@ -11598,6 +11612,7 @@ ${tmtNode.summary}`
|
|
|
11598
11612
|
recallResultLimit,
|
|
11599
11613
|
recallMode,
|
|
11600
11614
|
caps,
|
|
11615
|
+
graphCaps,
|
|
11601
11616
|
queryAwarePrefilter,
|
|
11602
11617
|
abortSignal: options.abortSignal,
|
|
11603
11618
|
onDegradation: (degradation) => {
|
|
@@ -11643,6 +11658,7 @@ ${tmtNode.summary}`
|
|
|
11643
11658
|
recallResultLimit,
|
|
11644
11659
|
recallMode,
|
|
11645
11660
|
caps,
|
|
11661
|
+
graphCaps,
|
|
11646
11662
|
queryAwarePrefilter,
|
|
11647
11663
|
abortSignal: options.abortSignal,
|
|
11648
11664
|
onDegradation: (degradation) => {
|
|
@@ -13276,7 +13292,7 @@ ${normalized}`).digest("hex");
|
|
|
13276
13292
|
}
|
|
13277
13293
|
}
|
|
13278
13294
|
}
|
|
13279
|
-
async persistExtraction(result, storage, threadIdForExtraction, sourceContext, baseNamespace, scopeProfileWritePlan) {
|
|
13295
|
+
async persistExtraction(result, storage, threadIdForExtraction, sourceContext, baseNamespace, scopeProfileWritePlan, graphCaps = resolveGraphConstructionCapabilities(this.config)) {
|
|
13280
13296
|
const citationEnabled = this.config.inlineSourceAttributionEnabled === true;
|
|
13281
13297
|
const citationTemplate = this.config.inlineSourceAttributionFormat;
|
|
13282
13298
|
const citationContextBase = citationEnabled ? {
|
|
@@ -13623,7 +13639,7 @@ ${normalized}`).digest("hex");
|
|
|
13623
13639
|
allMemsForGraph: null,
|
|
13624
13640
|
memoryPathById: /* @__PURE__ */ new Map()
|
|
13625
13641
|
};
|
|
13626
|
-
if (
|
|
13642
|
+
if (graphCaps.multiGraphMemory) {
|
|
13627
13643
|
try {
|
|
13628
13644
|
created.allMemsForGraph = await targetStorage.readAllMemories();
|
|
13629
13645
|
for (const [id, relPath] of buildMemoryPathById(
|
|
@@ -13639,7 +13655,7 @@ ${normalized}`).digest("hex");
|
|
|
13639
13655
|
return created;
|
|
13640
13656
|
};
|
|
13641
13657
|
let threadEpisodeIdsForGraph;
|
|
13642
|
-
if (
|
|
13658
|
+
if (graphCaps.multiGraphMemory && threadIdForExtraction) {
|
|
13643
13659
|
try {
|
|
13644
13660
|
const thread = await this.threading.loadThread(threadIdForExtraction);
|
|
13645
13661
|
threadEpisodeIdsForGraph = thread?.episodeIds ? [...thread.episodeIds] : [];
|
|
@@ -14137,7 +14153,7 @@ ${normalized}`).digest("hex");
|
|
|
14137
14153
|
intentEntityTypes: inferredIntent?.entityTypes
|
|
14138
14154
|
});
|
|
14139
14155
|
}
|
|
14140
|
-
if (
|
|
14156
|
+
if (graphCaps.multiGraphMemory) {
|
|
14141
14157
|
try {
|
|
14142
14158
|
const graphContext = await ensureGraphContext(targetStorage);
|
|
14143
14159
|
const entityRef = typeof fact.entityRef === "string" ? fact.entityRef : void 0;
|
|
@@ -14166,7 +14182,8 @@ ${normalized}`).digest("hex");
|
|
|
14166
14182
|
graphContext.memoryPathById,
|
|
14167
14183
|
threadIdForExtraction ?? void 0,
|
|
14168
14184
|
threadEpisodeIdsForGraph,
|
|
14169
|
-
graphContext.previousPersistedRelPath
|
|
14185
|
+
graphContext.previousPersistedRelPath,
|
|
14186
|
+
graphCaps
|
|
14170
14187
|
);
|
|
14171
14188
|
graphContext.previousPersistedRelPath = parentRelPath;
|
|
14172
14189
|
} catch {
|
|
@@ -14275,7 +14292,7 @@ ${normalized}`).digest("hex");
|
|
|
14275
14292
|
validAt: sourceContext?.validAt,
|
|
14276
14293
|
source: extractionWriteSource
|
|
14277
14294
|
});
|
|
14278
|
-
if (
|
|
14295
|
+
if (graphCaps.multiGraphMemory) {
|
|
14279
14296
|
try {
|
|
14280
14297
|
const graphContext = await ensureGraphContext(targetStorage);
|
|
14281
14298
|
const entityRef = typeof fact.entityRef === "string" ? fact.entityRef : void 0;
|
|
@@ -14304,7 +14321,8 @@ ${normalized}`).digest("hex");
|
|
|
14304
14321
|
graphContext.memoryPathById,
|
|
14305
14322
|
threadIdForExtraction ?? void 0,
|
|
14306
14323
|
threadEpisodeIdsForGraph,
|
|
14307
|
-
graphContext.previousPersistedRelPath
|
|
14324
|
+
graphContext.previousPersistedRelPath,
|
|
14325
|
+
graphCaps
|
|
14308
14326
|
);
|
|
14309
14327
|
graphContext.previousPersistedRelPath = memoryRelPath;
|
|
14310
14328
|
} catch {
|
|
@@ -14476,7 +14494,7 @@ ${normalized}`).digest("hex");
|
|
|
14476
14494
|
* Shared helper used by both the chunked and non-chunked write paths to avoid duplication.
|
|
14477
14495
|
* Fail-open: caller wraps in try/catch.
|
|
14478
14496
|
*/
|
|
14479
|
-
async buildGraphEdge(storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor) {
|
|
14497
|
+
async buildGraphEdge(storage, memoryRelPath, entityRef, memoryId, factContent, allMemsForGraph, memoryPathById, threadIdForEdge, threadEpisodeIdsForGraph, fallbackCausalPredecessor, graphCaps = resolveGraphConstructionCapabilities(this.config)) {
|
|
14480
14498
|
const entitySiblings = [];
|
|
14481
14499
|
if (entityRef) {
|
|
14482
14500
|
try {
|
|
@@ -14506,7 +14524,7 @@ ${normalized}`).digest("hex");
|
|
|
14506
14524
|
} catch {
|
|
14507
14525
|
}
|
|
14508
14526
|
}
|
|
14509
|
-
if (recentInThread.length === 0 &&
|
|
14527
|
+
if (recentInThread.length === 0 && graphCaps.graphWriteSessionAdjacency && fallbackCausalPredecessor && fallbackCausalPredecessor !== memoryRelPath) {
|
|
14510
14528
|
recentInThread.push(fallbackCausalPredecessor);
|
|
14511
14529
|
}
|
|
14512
14530
|
const causalPredecessor = recentInThread[recentInThread.length - 1] ?? fallbackCausalPredecessor;
|
|
@@ -14518,7 +14536,13 @@ ${normalized}`).digest("hex");
|
|
|
14518
14536
|
threadId: threadIdForEdge,
|
|
14519
14537
|
recentInThread,
|
|
14520
14538
|
entitySiblings,
|
|
14521
|
-
causalPredecessor
|
|
14539
|
+
causalPredecessor,
|
|
14540
|
+
graphCapsOverride: {
|
|
14541
|
+
entityGraph: graphCaps.entityGraph,
|
|
14542
|
+
timeGraph: graphCaps.timeGraph,
|
|
14543
|
+
causalGraph: graphCaps.causalGraph,
|
|
14544
|
+
multiGraphMemory: graphCaps.multiGraphMemory
|
|
14545
|
+
}
|
|
14522
14546
|
});
|
|
14523
14547
|
}
|
|
14524
14548
|
graphIndexFor(storage) {
|
|
@@ -16357,6 +16381,7 @@ ${lines.join("\n\n")}`;
|
|
|
16357
16381
|
}
|
|
16358
16382
|
async applyColdFallbackPipeline(options) {
|
|
16359
16383
|
const caps = options.caps ?? resolveCapabilities(this.config);
|
|
16384
|
+
const graphCaps = options.graphCaps ?? resolveGraphConstructionCapabilities(this.config);
|
|
16360
16385
|
if (options.queryAwarePrefilter?.candidatePaths?.size === 0) {
|
|
16361
16386
|
if (options.xrayPoolSizeSink) options.xrayPoolSizeSink.size = 0;
|
|
16362
16387
|
return [];
|
|
@@ -16530,7 +16555,7 @@ ${lines.join("\n\n")}`;
|
|
|
16530
16555
|
}
|
|
16531
16556
|
results = results.filter((r) => !isArtifactMemoryPath(r.path));
|
|
16532
16557
|
if (results.length === 0) return [];
|
|
16533
|
-
const isFullModeGraphAssist = this.config.qmdTierParityGraphEnabled &&
|
|
16558
|
+
const isFullModeGraphAssist = this.config.qmdTierParityGraphEnabled && graphCaps.multiGraphMemory && caps.graphAssistInFullMode && options.recallMode === "full" && results.length >= Math.max(1, this.config.graphAssistMinSeedResults ?? 3);
|
|
16534
16559
|
const shouldRunGraphExpansion = this.config.qmdTierParityGraphEnabled && (options.recallMode === "graph_mode" || isFullModeGraphAssist);
|
|
16535
16560
|
if (shouldRunGraphExpansion) {
|
|
16536
16561
|
const { merged } = await this.expandResultsViaGraph({
|
|
@@ -17387,4 +17412,4 @@ export {
|
|
|
17387
17412
|
resolvePersistedMemoryRelativePath,
|
|
17388
17413
|
Orchestrator
|
|
17389
17414
|
};
|
|
17390
|
-
//# sourceMappingURL=chunk-
|
|
17415
|
+
//# sourceMappingURL=chunk-7AAKSHDG.js.map
|