@remnic/core 9.6.28 → 9.6.29
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-admin-ops-surface.d.ts +2 -2
- package/dist/access-admin-ops-surface.js +1 -1
- package/dist/access-boundary.d.ts +2 -2
- package/dist/access-boundary.js +2 -2
- package/dist/access-cli.js +8 -8
- package/dist/access-http.d.ts +2 -2
- package/dist/access-http.js +6 -6
- package/dist/access-identity-continuity-surface.d.ts +1 -1
- package/dist/access-identity-continuity-surface.js +1 -1
- package/dist/access-lcm-surface.d.ts +2 -2
- package/dist/access-lcm-surface.js +1 -1
- package/dist/access-mcp.d.ts +2 -2
- package/dist/access-mcp.js +5 -5
- package/dist/access-observe-write-surface.d.ts +2 -2
- package/dist/access-observe-write-surface.js +1 -1
- package/dist/access-operations-batch.js +3 -3
- package/dist/access-operations.d.ts +2 -2
- package/dist/access-operations.js +4 -4
- package/dist/access-recall-surface.d.ts +4 -3
- package/dist/access-recall-surface.js +1 -1
- package/dist/{access-service-DK7s3wMj.d.ts → access-service-BofDzaPT.d.ts} +3 -2
- package/dist/access-service.d.ts +2 -2
- package/dist/access-service.js +1 -1
- package/dist/access-surface-catalog.d.ts +2 -2
- package/dist/bootstrap.d.ts +1 -1
- package/dist/{chunk-43VNWTBB.js → chunk-3RROR5KV.js} +4 -4
- package/dist/chunk-3RROR5KV.js.map +1 -0
- package/dist/{chunk-YDF4HL3W.js → chunk-5BHIGBHQ.js} +30 -37
- package/dist/chunk-5BHIGBHQ.js.map +1 -0
- package/dist/{chunk-4273YO6I.js → chunk-5WJ4LBFR.js} +106 -6
- package/dist/chunk-5WJ4LBFR.js.map +1 -0
- package/dist/{chunk-N6VIXDT7.js → chunk-C2SEH754.js} +4 -4
- package/dist/{chunk-MRQN5Q3I.js → chunk-EAREADWV.js} +2 -2
- package/dist/{chunk-GXLFDLX2.js → chunk-IF7THCGJ.js} +3 -3
- package/dist/{chunk-ARDRBJHD.js → chunk-SGYTQKC2.js} +3 -3
- package/dist/{chunk-QLYLTKUG.js → chunk-XA4PWKBW.js} +3 -3
- package/dist/{cli-CLSdmOVU.d.ts → cli-3_x5sJTL.d.ts} +2 -2
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +7 -7
- package/dist/explicit-capture.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -8
- package/dist/mcp-memory-inspector-app.d.ts +2 -2
- package/dist/{orchestrator-BzXGNHco.d.ts → orchestrator-CAH5-PKN.d.ts} +20 -3
- package/dist/orchestrator.d.ts +1 -1
- package/dist/orchestrator.js +8 -8
- package/package.json +2 -2
- package/src/access-recall-surface.ts +46 -49
- package/src/access-service.ts +2 -7
- package/src/cli.ts +4 -10
- package/src/orchestration/xray-capture-queue.test.ts +42 -0
- package/src/orchestration/xray-capture-queue.ts +78 -0
- package/src/orchestrator-xray-capture.test.ts +319 -0
- package/src/orchestrator.ts +76 -8
- package/dist/chunk-4273YO6I.js.map +0 -1
- package/dist/chunk-43VNWTBB.js.map +0 -1
- package/dist/chunk-YDF4HL3W.js.map +0 -1
- /package/dist/{chunk-N6VIXDT7.js.map → chunk-C2SEH754.js.map} +0 -0
- /package/dist/{chunk-MRQN5Q3I.js.map → chunk-EAREADWV.js.map} +0 -0
- /package/dist/{chunk-GXLFDLX2.js.map → chunk-IF7THCGJ.js.map} +0 -0
- /package/dist/{chunk-ARDRBJHD.js.map → chunk-SGYTQKC2.js.map} +0 -0
- /package/dist/{chunk-QLYLTKUG.js.map → chunk-XA4PWKBW.js.map} +0 -0
|
@@ -323,7 +323,7 @@ import {
|
|
|
323
323
|
createCorrectionService,
|
|
324
324
|
detectPassiveCorrections,
|
|
325
325
|
qmdCollectionPathParts
|
|
326
|
-
} from "./chunk-
|
|
326
|
+
} from "./chunk-5BHIGBHQ.js";
|
|
327
327
|
import {
|
|
328
328
|
importCapsule
|
|
329
329
|
} from "./chunk-M5QKGHCR.js";
|
|
@@ -15511,6 +15511,61 @@ async function drainRecallWrites(owner) {
|
|
|
15511
15511
|
}
|
|
15512
15512
|
}
|
|
15513
15513
|
|
|
15514
|
+
// src/orchestration/xray-capture-queue.ts
|
|
15515
|
+
var XrayCaptureQueue = class {
|
|
15516
|
+
tail = Promise.resolve();
|
|
15517
|
+
async run(operation, state, signal) {
|
|
15518
|
+
throwIfAborted(signal, "x-ray capture aborted before queueing");
|
|
15519
|
+
const previous = this.tail;
|
|
15520
|
+
let release = () => {
|
|
15521
|
+
};
|
|
15522
|
+
this.tail = new Promise((resolve) => {
|
|
15523
|
+
release = resolve;
|
|
15524
|
+
});
|
|
15525
|
+
try {
|
|
15526
|
+
await this.waitForTurn(previous, signal);
|
|
15527
|
+
} catch (error) {
|
|
15528
|
+
void previous.then(release, release);
|
|
15529
|
+
throw error;
|
|
15530
|
+
}
|
|
15531
|
+
let previousSnapshot = null;
|
|
15532
|
+
let didReadPreviousSnapshot = false;
|
|
15533
|
+
try {
|
|
15534
|
+
previousSnapshot = state.read();
|
|
15535
|
+
didReadPreviousSnapshot = true;
|
|
15536
|
+
const recallStartedAt = Date.now();
|
|
15537
|
+
state.clear();
|
|
15538
|
+
const result = await operation();
|
|
15539
|
+
const snapshot = state.read();
|
|
15540
|
+
if (!snapshot) state.restore(previousSnapshot);
|
|
15541
|
+
return { result, snapshot, recallStartedAt };
|
|
15542
|
+
} catch (error) {
|
|
15543
|
+
if (didReadPreviousSnapshot) state.restore(previousSnapshot);
|
|
15544
|
+
throw error;
|
|
15545
|
+
} finally {
|
|
15546
|
+
release();
|
|
15547
|
+
}
|
|
15548
|
+
}
|
|
15549
|
+
async waitForTurn(previous, signal) {
|
|
15550
|
+
throwIfAborted(signal, "x-ray capture aborted while queued");
|
|
15551
|
+
if (!signal) {
|
|
15552
|
+
await previous;
|
|
15553
|
+
return;
|
|
15554
|
+
}
|
|
15555
|
+
let onAbort;
|
|
15556
|
+
const aborted = new Promise((_resolve, reject) => {
|
|
15557
|
+
onAbort = () => reject(abortError("x-ray capture aborted while queued"));
|
|
15558
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
15559
|
+
});
|
|
15560
|
+
try {
|
|
15561
|
+
await Promise.race([previous, aborted]);
|
|
15562
|
+
throwIfAborted(signal, "x-ray capture aborted while queued");
|
|
15563
|
+
} finally {
|
|
15564
|
+
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
15565
|
+
}
|
|
15566
|
+
}
|
|
15567
|
+
};
|
|
15568
|
+
|
|
15514
15569
|
// src/orchestrator.ts
|
|
15515
15570
|
var Orchestrator = class {
|
|
15516
15571
|
storage;
|
|
@@ -15592,6 +15647,8 @@ var Orchestrator = class {
|
|
|
15592
15647
|
* capturing caller can still read their snapshot back.
|
|
15593
15648
|
*/
|
|
15594
15649
|
lastXraySnapshot = null;
|
|
15650
|
+
/** Per-instance ordering domain for every writer of `lastXraySnapshot`. */
|
|
15651
|
+
xrayCaptureQueue = new XrayCaptureQueue();
|
|
15595
15652
|
embeddingFallback;
|
|
15596
15653
|
conversationIndexDir;
|
|
15597
15654
|
extraction;
|
|
@@ -16751,7 +16808,7 @@ ${doc.content}` : doc.content,
|
|
|
16751
16808
|
async validateLocalLlmModel() {
|
|
16752
16809
|
return this.workspaceOpsCoordinator.validateLocalLlmModel();
|
|
16753
16810
|
}
|
|
16754
|
-
|
|
16811
|
+
invokeRecall(prompt, sessionKey, options = {}) {
|
|
16755
16812
|
return (this.recallEntryCoordinator ?? new RecallEntryCoordinator(
|
|
16756
16813
|
selfDeps(this)
|
|
16757
16814
|
)).recall(
|
|
@@ -16760,21 +16817,64 @@ ${doc.content}` : doc.content,
|
|
|
16760
16817
|
options
|
|
16761
16818
|
);
|
|
16762
16819
|
}
|
|
16820
|
+
async recall(prompt, sessionKey, options = {}) {
|
|
16821
|
+
if (options.xrayCapture === true) {
|
|
16822
|
+
const { result } = await this.runRecallWithXrayCapture(
|
|
16823
|
+
prompt,
|
|
16824
|
+
sessionKey,
|
|
16825
|
+
options
|
|
16826
|
+
);
|
|
16827
|
+
return result;
|
|
16828
|
+
}
|
|
16829
|
+
return this.invokeRecall(prompt, sessionKey, options);
|
|
16830
|
+
}
|
|
16763
16831
|
/**
|
|
16764
|
-
* Return the most recent X-ray snapshot captured during a
|
|
16765
|
-
* `recall()` call that passed `xrayCapture: true` (issue #570 PR 1).
|
|
16832
|
+
* Return the most recent X-ray snapshot captured during a recall.
|
|
16766
16833
|
* Returns `null` when no such capture has occurred on this
|
|
16767
16834
|
* orchestrator instance. Returned snapshot is a deep copy so
|
|
16768
16835
|
* caller mutation cannot tear the stored value.
|
|
16836
|
+
*
|
|
16837
|
+
* @deprecated Reading this after a separate `recall()` is not atomic. Use
|
|
16838
|
+
* `recallWithXrayCapture()` when the snapshot must belong to that call.
|
|
16769
16839
|
*/
|
|
16770
16840
|
getLastXraySnapshot() {
|
|
16771
16841
|
if (!this.lastXraySnapshot) return null;
|
|
16772
16842
|
return structuredClone(this.lastXraySnapshot);
|
|
16773
16843
|
}
|
|
16774
|
-
/**
|
|
16844
|
+
/**
|
|
16845
|
+
* Clear the captured X-ray snapshot. Exposed for tests / explicit reset.
|
|
16846
|
+
*
|
|
16847
|
+
* @deprecated A separate clear → recall → get sequence is not atomic. Use
|
|
16848
|
+
* `recallWithXrayCapture()` for capture operations.
|
|
16849
|
+
*/
|
|
16775
16850
|
clearLastXraySnapshot() {
|
|
16776
16851
|
this.lastXraySnapshot = null;
|
|
16777
16852
|
}
|
|
16853
|
+
/** Atomically run recall and return the cloned X-ray snapshot it published. */
|
|
16854
|
+
async recallWithXrayCapture(prompt, sessionKey, options = {}) {
|
|
16855
|
+
return this.runRecallWithXrayCapture(
|
|
16856
|
+
prompt,
|
|
16857
|
+
sessionKey,
|
|
16858
|
+
options,
|
|
16859
|
+
options.abortSignal
|
|
16860
|
+
);
|
|
16861
|
+
}
|
|
16862
|
+
async runRecallWithXrayCapture(prompt, sessionKey, options, queueAbortSignal) {
|
|
16863
|
+
return this.xrayCaptureQueue.run(
|
|
16864
|
+
() => this.invokeRecall(prompt, sessionKey, {
|
|
16865
|
+
...options,
|
|
16866
|
+
xrayCapture: true
|
|
16867
|
+
}),
|
|
16868
|
+
{
|
|
16869
|
+
read: () => this.getLastXraySnapshot(),
|
|
16870
|
+
clear: () => this.clearLastXraySnapshot(),
|
|
16871
|
+
restore: (snapshot) => {
|
|
16872
|
+
this.lastXraySnapshot = snapshot;
|
|
16873
|
+
}
|
|
16874
|
+
},
|
|
16875
|
+
queueAbortSignal
|
|
16876
|
+
);
|
|
16877
|
+
}
|
|
16778
16878
|
async waitForDirectAnswerObservationIdle(timeoutMs = 6e4) {
|
|
16779
16879
|
return this.recallIntrospection.waitForDirectAnswerObservationIdle(
|
|
16780
16880
|
timeoutMs
|
|
@@ -22992,4 +23092,4 @@ export {
|
|
|
22992
23092
|
blendGraphExpandedRecallScore,
|
|
22993
23093
|
Orchestrator
|
|
22994
23094
|
};
|
|
22995
|
-
//# sourceMappingURL=chunk-
|
|
23095
|
+
//# sourceMappingURL=chunk-5WJ4LBFR.js.map
|