@remnic/core 1.1.29 → 1.1.30
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 +13 -13
- package/dist/access-http.d.ts +1 -1
- package/dist/access-http.js +8 -8
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.js +7 -7
- package/dist/access-schema.d.ts +55 -5
- package/dist/access-schema.js +4 -2
- package/dist/{access-service-CEyV8XJ5.d.ts → access-service-B5hgZPCN.d.ts} +4 -1
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +5 -5
- package/dist/briefing.js +2 -2
- package/dist/causal-consolidation.js +3 -3
- package/dist/{chunk-25YQM6XW.js → chunk-2IWUMAES.js} +3 -3
- package/dist/{chunk-JUYT2J3K.js → chunk-3OWUCDKH.js} +39 -7
- package/dist/chunk-3OWUCDKH.js.map +1 -0
- package/dist/{chunk-QYHQ2JHL.js → chunk-43PJZYGL.js} +2 -2
- package/dist/{chunk-YITUHONZ.js → chunk-4KGVTPGD.js} +2 -2
- package/dist/{chunk-TR4DK5OH.js → chunk-76FLAAUC.js} +2 -2
- package/dist/{chunk-6BFAEWQS.js → chunk-77H5NU3M.js} +2 -2
- package/dist/{chunk-IANK6Y5W.js → chunk-A6KTB5R6.js} +2 -2
- package/dist/{chunk-7D6O46PF.js → chunk-BVF3AGJP.js} +2 -2
- package/dist/{chunk-4H6DURG6.js → chunk-JA3AK3PT.js} +2 -2
- package/dist/{chunk-WDSIV3AK.js → chunk-KRBK4BQH.js} +12 -12
- package/dist/{chunk-AMVN77EU.js → chunk-MG7NA5H3.js} +365 -90
- package/dist/chunk-MG7NA5H3.js.map +1 -0
- package/dist/{chunk-RCZRL5BE.js → chunk-MRILGULB.js} +2 -2
- package/dist/{chunk-NW7JW5GA.js → chunk-OC7KHOOX.js} +41 -6
- package/dist/chunk-OC7KHOOX.js.map +1 -0
- package/dist/{chunk-LCTP7YRU.js → chunk-QKZGQIPJ.js} +16 -7
- package/dist/chunk-QKZGQIPJ.js.map +1 -0
- package/dist/{chunk-CWWDIQZB.js → chunk-QLLBRHAT.js} +8 -8
- package/dist/{chunk-2WIPXV3Y.js → chunk-RR2PKP3I.js} +2 -2
- package/dist/{chunk-3F24QTRI.js → chunk-SAZS2QZB.js} +2 -2
- package/dist/{chunk-VYU7PXUS.js → chunk-SIC6U3GZ.js} +2 -2
- package/dist/{chunk-6CB4E7ZV.js → chunk-UL2NNBUL.js} +4 -4
- package/dist/{chunk-F33CJ5CH.js → chunk-VBJ7V5SK.js} +40 -8
- package/dist/chunk-VBJ7V5SK.js.map +1 -0
- package/dist/{chunk-6WV2HYTZ.js → chunk-W6AQJ2PY.js} +4 -4
- package/dist/{chunk-PUXCIHRL.js → chunk-XSZEP4SF.js} +2 -2
- package/dist/{cli-BguVmIwO.d.ts → cli-CJKI2JIe.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +17 -17
- package/dist/compounding/engine.js +2 -2
- package/dist/connectors/codex-materialize-runner.js +2 -2
- package/dist/connectors/index.js +2 -2
- package/dist/entity-retrieval.js +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +32 -22
- package/dist/index.js.map +1 -1
- package/dist/maintenance/memory-governance.js +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/namespaces/migrate.js +3 -3
- package/dist/namespaces/storage.js +2 -2
- package/dist/offline-sync.d.ts +49 -1
- package/dist/offline-sync.js +13 -1
- package/dist/operator-toolkit.js +5 -5
- package/dist/orchestrator.js +9 -9
- package/dist/semantic-consolidation.js +3 -3
- package/dist/semantic-rule-promotion.js +2 -2
- package/dist/semantic-rule-verifier.js +2 -2
- package/dist/storage.d.ts +5 -0
- package/dist/storage.js +1 -1
- package/dist/verified-recall.js +2 -2
- package/package.json +1 -1
- package/src/access-http.test.ts +184 -0
- package/src/access-http.ts +37 -0
- package/src/access-schema.ts +58 -3
- package/src/access-service-namespace.test.ts +56 -1
- package/src/access-service-offline-file-content.test.ts +17 -0
- package/src/access-service.ts +16 -1
- package/src/index.ts +6 -0
- package/src/offline-sync.test.ts +1055 -1
- package/src/offline-sync.ts +453 -96
- package/src/storage.ts +36 -2
- package/dist/chunk-AMVN77EU.js.map +0 -1
- package/dist/chunk-F33CJ5CH.js.map +0 -1
- package/dist/chunk-JUYT2J3K.js.map +0 -1
- package/dist/chunk-LCTP7YRU.js.map +0 -1
- package/dist/chunk-NW7JW5GA.js.map +0 -1
- /package/dist/{chunk-25YQM6XW.js.map → chunk-2IWUMAES.js.map} +0 -0
- /package/dist/{chunk-QYHQ2JHL.js.map → chunk-43PJZYGL.js.map} +0 -0
- /package/dist/{chunk-YITUHONZ.js.map → chunk-4KGVTPGD.js.map} +0 -0
- /package/dist/{chunk-TR4DK5OH.js.map → chunk-76FLAAUC.js.map} +0 -0
- /package/dist/{chunk-6BFAEWQS.js.map → chunk-77H5NU3M.js.map} +0 -0
- /package/dist/{chunk-IANK6Y5W.js.map → chunk-A6KTB5R6.js.map} +0 -0
- /package/dist/{chunk-7D6O46PF.js.map → chunk-BVF3AGJP.js.map} +0 -0
- /package/dist/{chunk-4H6DURG6.js.map → chunk-JA3AK3PT.js.map} +0 -0
- /package/dist/{chunk-WDSIV3AK.js.map → chunk-KRBK4BQH.js.map} +0 -0
- /package/dist/{chunk-RCZRL5BE.js.map → chunk-MRILGULB.js.map} +0 -0
- /package/dist/{chunk-CWWDIQZB.js.map → chunk-QLLBRHAT.js.map} +0 -0
- /package/dist/{chunk-2WIPXV3Y.js.map → chunk-RR2PKP3I.js.map} +0 -0
- /package/dist/{chunk-3F24QTRI.js.map → chunk-SAZS2QZB.js.map} +0 -0
- /package/dist/{chunk-VYU7PXUS.js.map → chunk-SIC6U3GZ.js.map} +0 -0
- /package/dist/{chunk-6CB4E7ZV.js.map → chunk-UL2NNBUL.js.map} +0 -0
- /package/dist/{chunk-6WV2HYTZ.js.map → chunk-W6AQJ2PY.js.map} +0 -0
- /package/dist/{chunk-PUXCIHRL.js.map → chunk-XSZEP4SF.js.map} +0 -0
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
readMemoryGovernanceRunArtifact,
|
|
7
7
|
restoreMemoryGovernanceRun,
|
|
8
8
|
runMemoryGovernance
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-76FLAAUC.js";
|
|
10
|
+
import "../chunk-VBJ7V5SK.js";
|
|
11
11
|
import "../chunk-5UZXUTVO.js";
|
|
12
12
|
import "../chunk-NN2DKE4T.js";
|
|
13
13
|
import "../chunk-Q7P4WJDP.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rebuildMemoryLifecycleLedger
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-BVF3AGJP.js";
|
|
4
4
|
import "../chunk-KJTKLXTH.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-VBJ7V5SK.js";
|
|
6
6
|
import "../chunk-5UZXUTVO.js";
|
|
7
7
|
import "../chunk-NN2DKE4T.js";
|
|
8
8
|
import "../chunk-Q7P4WJDP.js";
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
rebuildMemoryProjection,
|
|
3
3
|
repairMemoryProjection,
|
|
4
4
|
verifyMemoryProjection
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-2IWUMAES.js";
|
|
6
6
|
import "../chunk-KJTKLXTH.js";
|
|
7
7
|
import "../chunk-7SEAZFFB.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-76FLAAUC.js";
|
|
9
|
+
import "../chunk-VBJ7V5SK.js";
|
|
10
10
|
import "../chunk-5UZXUTVO.js";
|
|
11
11
|
import "../chunk-NN2DKE4T.js";
|
|
12
12
|
import "../chunk-Q7P4WJDP.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EngramAccessRecallResponse } from './access-service-
|
|
1
|
+
import { a as EngramAccessRecallResponse } from './access-service-B5hgZPCN.js';
|
|
2
2
|
import { ActionConfidenceRequest } from './access-schema.js';
|
|
3
3
|
import { RecallXraySnapshot } from './recall-xray.js';
|
|
4
4
|
import { ActionConfidenceResult } from './action-confidence.js';
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
listNamespaces,
|
|
3
3
|
runNamespaceMigration,
|
|
4
4
|
verifyNamespaces
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-77H5NU3M.js";
|
|
6
|
+
import "../chunk-RR2PKP3I.js";
|
|
7
7
|
import "../chunk-575RMLWN.js";
|
|
8
8
|
import "../chunk-I5GLV3VE.js";
|
|
9
9
|
import "../chunk-NJ3MJQZX.js";
|
|
@@ -21,7 +21,7 @@ import "../chunk-3TNBOMQT.js";
|
|
|
21
21
|
import "../chunk-PVGDJXVK.js";
|
|
22
22
|
import "../chunk-NNVTUXEB.js";
|
|
23
23
|
import "../chunk-U3PN77QT.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-VBJ7V5SK.js";
|
|
25
25
|
import "../chunk-5UZXUTVO.js";
|
|
26
26
|
import "../chunk-NN2DKE4T.js";
|
|
27
27
|
import "../chunk-Q7P4WJDP.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NamespaceStorageRouter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-RR2PKP3I.js";
|
|
4
4
|
import "../chunk-U3PN77QT.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-VBJ7V5SK.js";
|
|
6
6
|
import "../chunk-5UZXUTVO.js";
|
|
7
7
|
import "../chunk-NN2DKE4T.js";
|
|
8
8
|
import "../chunk-Q7P4WJDP.js";
|
package/dist/offline-sync.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ declare const OFFLINE_SYNC_STATE_VERSION = 1;
|
|
|
4
4
|
declare const OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES: number;
|
|
5
5
|
declare const OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES: number;
|
|
6
6
|
declare const OFFLINE_SYNC_APPLY_MAX_BODY_BYTES: number;
|
|
7
|
+
declare const OFFLINE_SYNC_SNAPSHOT_BASE_MAX_BODY_BYTES: number;
|
|
8
|
+
declare const OFFLINE_SYNC_MAX_MTIME_MS = 8640000000000000;
|
|
7
9
|
interface OfflineSyncFileState {
|
|
8
10
|
path: string;
|
|
9
11
|
sha256: string;
|
|
@@ -14,6 +16,10 @@ interface OfflineSyncFileState {
|
|
|
14
16
|
interface OfflineSyncFileRecord extends OfflineSyncFileState {
|
|
15
17
|
contentBase64?: string;
|
|
16
18
|
}
|
|
19
|
+
interface OfflineSyncFileDigest {
|
|
20
|
+
sha256: string;
|
|
21
|
+
bytes: number;
|
|
22
|
+
}
|
|
17
23
|
interface OfflineSyncSnapshot {
|
|
18
24
|
format: typeof OFFLINE_SYNC_SNAPSHOT_FORMAT;
|
|
19
25
|
schemaVersion: 1;
|
|
@@ -72,6 +78,7 @@ interface OfflineSyncApplyChangesetResult {
|
|
|
72
78
|
skipped: number;
|
|
73
79
|
conflicts: OfflineSyncConflict[];
|
|
74
80
|
currentFiles: OfflineSyncFileState[];
|
|
81
|
+
currentFilesComplete?: boolean;
|
|
75
82
|
}
|
|
76
83
|
interface OfflineSyncChangesetSummary {
|
|
77
84
|
upserts: number;
|
|
@@ -114,6 +121,7 @@ declare function normalizeOfflineSyncSnapshot(input: unknown, options?: {
|
|
|
114
121
|
requireContent?: boolean;
|
|
115
122
|
}): OfflineSyncSnapshot;
|
|
116
123
|
declare function normalizeOfflineSyncChangeset(input: unknown): OfflineSyncChangeset;
|
|
124
|
+
declare function shouldPreferIncomingOfflineRuntimeFile(relPosix: string): boolean;
|
|
117
125
|
declare function buildOfflineSyncSnapshot(options: {
|
|
118
126
|
root: string;
|
|
119
127
|
sourceId: string;
|
|
@@ -121,6 +129,18 @@ declare function buildOfflineSyncSnapshot(options: {
|
|
|
121
129
|
includeTranscripts?: boolean;
|
|
122
130
|
now?: Date;
|
|
123
131
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
132
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
133
|
+
}): Promise<OfflineSyncSnapshot>;
|
|
134
|
+
declare function buildOfflineSyncSnapshotFromBase(options: {
|
|
135
|
+
root: string;
|
|
136
|
+
sourceId: string;
|
|
137
|
+
baseFiles?: readonly OfflineSyncFileState[];
|
|
138
|
+
baseCapturedAt?: Date;
|
|
139
|
+
includeContent?: boolean;
|
|
140
|
+
includeTranscripts?: boolean;
|
|
141
|
+
now?: Date;
|
|
142
|
+
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
143
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
124
144
|
}): Promise<OfflineSyncSnapshot>;
|
|
125
145
|
declare function buildOfflineSyncSnapshotForPaths(options: {
|
|
126
146
|
root: string;
|
|
@@ -130,6 +150,7 @@ declare function buildOfflineSyncSnapshotForPaths(options: {
|
|
|
130
150
|
includeTranscripts?: boolean;
|
|
131
151
|
now?: Date;
|
|
132
152
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
153
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
133
154
|
}): Promise<OfflineSyncSnapshot>;
|
|
134
155
|
declare function readOfflineSyncFileContentChunk(options: {
|
|
135
156
|
root: string;
|
|
@@ -143,6 +164,18 @@ declare function buildOfflineSyncChangeset(options: {
|
|
|
143
164
|
root: string;
|
|
144
165
|
sourceId: string;
|
|
145
166
|
baseFiles?: readonly OfflineSyncFileState[];
|
|
167
|
+
baseCapturedAt?: Date;
|
|
168
|
+
excludePaths?: readonly string[];
|
|
169
|
+
includeTranscripts?: boolean;
|
|
170
|
+
now?: Date;
|
|
171
|
+
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
172
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
173
|
+
}): Promise<OfflineSyncChangeset>;
|
|
174
|
+
declare function buildOfflineSyncChangesetFromSnapshot(options: {
|
|
175
|
+
root: string;
|
|
176
|
+
sourceId: string;
|
|
177
|
+
currentFiles: readonly OfflineSyncFileState[];
|
|
178
|
+
baseFiles?: readonly OfflineSyncFileState[];
|
|
146
179
|
excludePaths?: readonly string[];
|
|
147
180
|
includeTranscripts?: boolean;
|
|
148
181
|
now?: Date;
|
|
@@ -153,24 +186,38 @@ declare function summarizeOfflineSyncPendingChanges(options: {
|
|
|
153
186
|
root: string;
|
|
154
187
|
sourceId: string;
|
|
155
188
|
baseFiles?: readonly OfflineSyncFileState[];
|
|
189
|
+
baseCapturedAt?: Date;
|
|
156
190
|
includeTranscripts?: boolean;
|
|
157
191
|
now?: Date;
|
|
158
192
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
193
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
159
194
|
}): Promise<OfflineSyncChangesetSummary>;
|
|
195
|
+
declare function summarizeOfflineSyncPendingFiles(options: {
|
|
196
|
+
baseFiles?: readonly OfflineSyncFileState[];
|
|
197
|
+
currentFiles: readonly OfflineSyncFileState[];
|
|
198
|
+
includeTranscripts?: boolean;
|
|
199
|
+
}): OfflineSyncChangesetSummary;
|
|
160
200
|
declare function applyOfflineSyncSnapshot(options: {
|
|
161
201
|
root: string;
|
|
162
202
|
snapshot: unknown;
|
|
163
203
|
baseFiles?: readonly OfflineSyncFileState[];
|
|
204
|
+
currentFiles?: readonly OfflineSyncFileState[];
|
|
205
|
+
deferredPaths?: readonly string[];
|
|
206
|
+
allowMissingConflictContent?: boolean;
|
|
164
207
|
writeConflictCopies?: boolean;
|
|
165
208
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
209
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
166
210
|
writeFile?: (target: OfflineSyncFileWriteTarget) => Promise<void>;
|
|
167
211
|
deleteFile?: (target: OfflineSyncFileTarget) => Promise<void>;
|
|
168
212
|
}): Promise<OfflineSyncApplySnapshotResult>;
|
|
169
213
|
declare function applyOfflineSyncChangeset(options: {
|
|
170
214
|
root: string;
|
|
171
215
|
changeset: unknown;
|
|
216
|
+
currentFiles?: readonly OfflineSyncFileState[];
|
|
217
|
+
returnCurrentFiles?: boolean;
|
|
172
218
|
writeConflictCopies?: boolean;
|
|
173
219
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
220
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
174
221
|
writeFile?: (target: OfflineSyncFileWriteTarget) => Promise<void>;
|
|
175
222
|
deleteFile?: (target: OfflineSyncFileTarget) => Promise<void>;
|
|
176
223
|
}): Promise<OfflineSyncApplyChangesetResult>;
|
|
@@ -186,6 +233,7 @@ declare function applyOfflineSyncFileContentChunk(options: {
|
|
|
186
233
|
baseSha256?: string;
|
|
187
234
|
includeTranscripts?: boolean;
|
|
188
235
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
236
|
+
readFileDigest?: (target: OfflineSyncFileTarget) => Promise<OfflineSyncFileDigest>;
|
|
189
237
|
writeFile?: (target: OfflineSyncFileWriteTarget) => Promise<void>;
|
|
190
238
|
writeStagingFile?: (target: OfflineSyncFileStagingWriteTarget) => Promise<void>;
|
|
191
239
|
writeFileChunks?: (target: OfflineSyncFileWriteChunksTarget) => Promise<void>;
|
|
@@ -202,4 +250,4 @@ declare function offlineSyncStateFromSnapshot(options: {
|
|
|
202
250
|
declare function normalizeOfflineSyncState(input: unknown): OfflineSyncState;
|
|
203
251
|
declare function fileStatesFromSnapshot(snapshot: OfflineSyncSnapshot): OfflineSyncFileState[];
|
|
204
252
|
|
|
205
|
-
export { OFFLINE_SYNC_APPLY_MAX_BODY_BYTES, OFFLINE_SYNC_CHANGESET_FORMAT, OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES, OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES, OFFLINE_SYNC_SNAPSHOT_FORMAT, OFFLINE_SYNC_STATE_VERSION, type OfflineSyncApplyChangesetResult, type OfflineSyncApplyFileContentChunkResult, type OfflineSyncApplySnapshotResult, type OfflineSyncChange, type OfflineSyncChangeset, type OfflineSyncChangesetSummary, type OfflineSyncConflict, type OfflineSyncFileContentChunk, type OfflineSyncFileRecord, type OfflineSyncFileStagingWriteTarget, type OfflineSyncFileState, type OfflineSyncFileTarget, type OfflineSyncFileWriteChunksTarget, type OfflineSyncFileWriteTarget, type OfflineSyncSnapshot, type OfflineSyncState, applyOfflineSyncChangeset, applyOfflineSyncFileContentChunk, applyOfflineSyncSnapshot, buildOfflineSyncChangeset, buildOfflineSyncSnapshot, buildOfflineSyncSnapshotForPaths, defaultOfflineSyncStatePath, fileStatesFromSnapshot, normalizeOfflineSyncChangeset, normalizeOfflineSyncSnapshot, normalizeOfflineSyncState, offlineSyncStateFromSnapshot, readOfflineSyncFileContentChunk, readOfflineSyncState, summarizeOfflineSyncChangeset, summarizeOfflineSyncPendingChanges, writeOfflineSyncState };
|
|
253
|
+
export { OFFLINE_SYNC_APPLY_MAX_BODY_BYTES, OFFLINE_SYNC_CHANGESET_FORMAT, OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES, OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES, OFFLINE_SYNC_MAX_MTIME_MS, OFFLINE_SYNC_SNAPSHOT_BASE_MAX_BODY_BYTES, OFFLINE_SYNC_SNAPSHOT_FORMAT, OFFLINE_SYNC_STATE_VERSION, type OfflineSyncApplyChangesetResult, type OfflineSyncApplyFileContentChunkResult, type OfflineSyncApplySnapshotResult, type OfflineSyncChange, type OfflineSyncChangeset, type OfflineSyncChangesetSummary, type OfflineSyncConflict, type OfflineSyncFileContentChunk, type OfflineSyncFileDigest, type OfflineSyncFileRecord, type OfflineSyncFileStagingWriteTarget, type OfflineSyncFileState, type OfflineSyncFileTarget, type OfflineSyncFileWriteChunksTarget, type OfflineSyncFileWriteTarget, type OfflineSyncSnapshot, type OfflineSyncState, applyOfflineSyncChangeset, applyOfflineSyncFileContentChunk, applyOfflineSyncSnapshot, buildOfflineSyncChangeset, buildOfflineSyncChangesetFromSnapshot, buildOfflineSyncSnapshot, buildOfflineSyncSnapshotForPaths, buildOfflineSyncSnapshotFromBase, defaultOfflineSyncStatePath, fileStatesFromSnapshot, normalizeOfflineSyncChangeset, normalizeOfflineSyncSnapshot, normalizeOfflineSyncState, offlineSyncStateFromSnapshot, readOfflineSyncFileContentChunk, readOfflineSyncState, shouldPreferIncomingOfflineRuntimeFile, summarizeOfflineSyncChangeset, summarizeOfflineSyncPendingChanges, summarizeOfflineSyncPendingFiles, writeOfflineSyncState };
|
package/dist/offline-sync.js
CHANGED
|
@@ -3,14 +3,18 @@ import {
|
|
|
3
3
|
OFFLINE_SYNC_CHANGESET_FORMAT,
|
|
4
4
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
5
5
|
OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES,
|
|
6
|
+
OFFLINE_SYNC_MAX_MTIME_MS,
|
|
7
|
+
OFFLINE_SYNC_SNAPSHOT_BASE_MAX_BODY_BYTES,
|
|
6
8
|
OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
7
9
|
OFFLINE_SYNC_STATE_VERSION,
|
|
8
10
|
applyOfflineSyncChangeset,
|
|
9
11
|
applyOfflineSyncFileContentChunk,
|
|
10
12
|
applyOfflineSyncSnapshot,
|
|
11
13
|
buildOfflineSyncChangeset,
|
|
14
|
+
buildOfflineSyncChangesetFromSnapshot,
|
|
12
15
|
buildOfflineSyncSnapshot,
|
|
13
16
|
buildOfflineSyncSnapshotForPaths,
|
|
17
|
+
buildOfflineSyncSnapshotFromBase,
|
|
14
18
|
defaultOfflineSyncStatePath,
|
|
15
19
|
fileStatesFromSnapshot,
|
|
16
20
|
normalizeOfflineSyncChangeset,
|
|
@@ -19,10 +23,12 @@ import {
|
|
|
19
23
|
offlineSyncStateFromSnapshot,
|
|
20
24
|
readOfflineSyncFileContentChunk,
|
|
21
25
|
readOfflineSyncState,
|
|
26
|
+
shouldPreferIncomingOfflineRuntimeFile,
|
|
22
27
|
summarizeOfflineSyncChangeset,
|
|
23
28
|
summarizeOfflineSyncPendingChanges,
|
|
29
|
+
summarizeOfflineSyncPendingFiles,
|
|
24
30
|
writeOfflineSyncState
|
|
25
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MG7NA5H3.js";
|
|
26
32
|
import "./chunk-I6K5FBRQ.js";
|
|
27
33
|
import "./chunk-AGZQD76C.js";
|
|
28
34
|
import "./chunk-MXFBBHJU.js";
|
|
@@ -34,14 +40,18 @@ export {
|
|
|
34
40
|
OFFLINE_SYNC_CHANGESET_FORMAT,
|
|
35
41
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
36
42
|
OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES,
|
|
43
|
+
OFFLINE_SYNC_MAX_MTIME_MS,
|
|
44
|
+
OFFLINE_SYNC_SNAPSHOT_BASE_MAX_BODY_BYTES,
|
|
37
45
|
OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
38
46
|
OFFLINE_SYNC_STATE_VERSION,
|
|
39
47
|
applyOfflineSyncChangeset,
|
|
40
48
|
applyOfflineSyncFileContentChunk,
|
|
41
49
|
applyOfflineSyncSnapshot,
|
|
42
50
|
buildOfflineSyncChangeset,
|
|
51
|
+
buildOfflineSyncChangesetFromSnapshot,
|
|
43
52
|
buildOfflineSyncSnapshot,
|
|
44
53
|
buildOfflineSyncSnapshotForPaths,
|
|
54
|
+
buildOfflineSyncSnapshotFromBase,
|
|
45
55
|
defaultOfflineSyncStatePath,
|
|
46
56
|
fileStatesFromSnapshot,
|
|
47
57
|
normalizeOfflineSyncChangeset,
|
|
@@ -50,8 +60,10 @@ export {
|
|
|
50
60
|
offlineSyncStateFromSnapshot,
|
|
51
61
|
readOfflineSyncFileContentChunk,
|
|
52
62
|
readOfflineSyncState,
|
|
63
|
+
shouldPreferIncomingOfflineRuntimeFile,
|
|
53
64
|
summarizeOfflineSyncChangeset,
|
|
54
65
|
summarizeOfflineSyncPendingChanges,
|
|
66
|
+
summarizeOfflineSyncPendingFiles,
|
|
55
67
|
writeOfflineSyncState
|
|
56
68
|
};
|
|
57
69
|
//# sourceMappingURL=offline-sync.js.map
|
package/dist/operator-toolkit.js
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
summarizeMemoryWorthLegacyCounters,
|
|
12
12
|
summarizeObservationThroughput,
|
|
13
13
|
summarizeTierDistribution
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-W6AQJ2PY.js";
|
|
15
|
+
import "./chunk-77H5NU3M.js";
|
|
16
16
|
import "./chunk-5HRY2WRF.js";
|
|
17
17
|
import "./chunk-YBPYIAA5.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RR2PKP3I.js";
|
|
19
19
|
import "./chunk-575RMLWN.js";
|
|
20
20
|
import "./chunk-I5GLV3VE.js";
|
|
21
21
|
import "./chunk-NJ3MJQZX.js";
|
|
@@ -39,13 +39,13 @@ import "./chunk-MZH6EHNR.js";
|
|
|
39
39
|
import "./chunk-PHK3HARR.js";
|
|
40
40
|
import "./chunk-Z5LAYHGJ.js";
|
|
41
41
|
import "./chunk-PVGDJXVK.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-76FLAAUC.js";
|
|
43
43
|
import "./chunk-NNVTUXEB.js";
|
|
44
44
|
import "./chunk-U3PN77QT.js";
|
|
45
45
|
import "./chunk-RK2Y4XOM.js";
|
|
46
46
|
import "./chunk-2LSZVONP.js";
|
|
47
47
|
import "./chunk-WIICJPET.js";
|
|
48
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-VBJ7V5SK.js";
|
|
49
49
|
import "./chunk-5UZXUTVO.js";
|
|
50
50
|
import "./chunk-NN2DKE4T.js";
|
|
51
51
|
import "./chunk-Q7P4WJDP.js";
|
package/dist/orchestrator.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
sanitizeSessionKeyForFilename,
|
|
27
27
|
shouldFilterLifecycleRecallCandidate,
|
|
28
28
|
summarizeGraphShadowComparison
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-QLLBRHAT.js";
|
|
30
30
|
import "./chunk-WNARATI3.js";
|
|
31
31
|
import "./chunk-KOSORCJG.js";
|
|
32
32
|
import "./chunk-BFBF3XEF.js";
|
|
@@ -41,7 +41,7 @@ import "./chunk-TPDBFYEG.js";
|
|
|
41
41
|
import "./chunk-ZTFCYYEZ.js";
|
|
42
42
|
import "./chunk-TECVW3JP.js";
|
|
43
43
|
import "./chunk-RYED3SPJ.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-A6KTB5R6.js";
|
|
45
45
|
import "./chunk-U4SCL7B7.js";
|
|
46
46
|
import "./chunk-UHGBNIOS.js";
|
|
47
47
|
import "./chunk-FSFEQI74.js";
|
|
@@ -82,7 +82,7 @@ import "./chunk-54V4BZWP.js";
|
|
|
82
82
|
import "./chunk-QR3C7BKQ.js";
|
|
83
83
|
import "./chunk-EDTHC6UD.js";
|
|
84
84
|
import "./chunk-DB5A3NHS.js";
|
|
85
|
-
import "./chunk-
|
|
85
|
+
import "./chunk-43PJZYGL.js";
|
|
86
86
|
import "./chunk-6NKAQ74D.js";
|
|
87
87
|
import "./chunk-OAZ5MFUB.js";
|
|
88
88
|
import "./chunk-PYPOFEMK.js";
|
|
@@ -93,22 +93,22 @@ import "./chunk-Y4FHOFJ2.js";
|
|
|
93
93
|
import "./chunk-NMZY542O.js";
|
|
94
94
|
import "./chunk-3PG3H5TD.js";
|
|
95
95
|
import "./chunk-2NMMFZ5T.js";
|
|
96
|
-
import "./chunk-
|
|
97
|
-
import "./chunk-
|
|
96
|
+
import "./chunk-XSZEP4SF.js";
|
|
97
|
+
import "./chunk-4KGVTPGD.js";
|
|
98
98
|
import "./chunk-RHY3HH7P.js";
|
|
99
99
|
import "./chunk-EJI5XIBB.js";
|
|
100
100
|
import "./chunk-2PRQG7PV.js";
|
|
101
101
|
import "./chunk-LUDTDZLK.js";
|
|
102
|
-
import "./chunk-
|
|
102
|
+
import "./chunk-JA3AK3PT.js";
|
|
103
103
|
import "./chunk-PYXS46O7.js";
|
|
104
104
|
import "./chunk-3QKK7QOS.js";
|
|
105
105
|
import "./chunk-W4RVMTHR.js";
|
|
106
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-SAZS2QZB.js";
|
|
107
107
|
import "./chunk-CULXMQJH.js";
|
|
108
108
|
import "./chunk-5375UYTQ.js";
|
|
109
109
|
import "./chunk-FF4KLI5W.js";
|
|
110
110
|
import "./chunk-EABGC2TL.js";
|
|
111
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-RR2PKP3I.js";
|
|
112
112
|
import "./chunk-575RMLWN.js";
|
|
113
113
|
import "./chunk-I5GLV3VE.js";
|
|
114
114
|
import "./chunk-NJ3MJQZX.js";
|
|
@@ -166,7 +166,7 @@ import "./chunk-U3PN77QT.js";
|
|
|
166
166
|
import "./chunk-RK2Y4XOM.js";
|
|
167
167
|
import "./chunk-2LSZVONP.js";
|
|
168
168
|
import "./chunk-WIICJPET.js";
|
|
169
|
-
import "./chunk-
|
|
169
|
+
import "./chunk-VBJ7V5SK.js";
|
|
170
170
|
import "./chunk-5UZXUTVO.js";
|
|
171
171
|
import "./chunk-NN2DKE4T.js";
|
|
172
172
|
import "./chunk-Q7P4WJDP.js";
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
materializeAfterSemanticConsolidation,
|
|
8
8
|
parseConsolidationResponse,
|
|
9
9
|
parseOperatorAwareConsolidationResponse
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-XSZEP4SF.js";
|
|
11
|
+
import "./chunk-4KGVTPGD.js";
|
|
12
12
|
import "./chunk-RHY3HH7P.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveExtensionsRoot
|
|
15
15
|
} from "./chunk-EJI5XIBB.js";
|
|
16
16
|
import "./chunk-3UXOZBHV.js";
|
|
17
17
|
import "./chunk-U3PN77QT.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-VBJ7V5SK.js";
|
|
19
19
|
import "./chunk-5UZXUTVO.js";
|
|
20
20
|
import "./chunk-NN2DKE4T.js";
|
|
21
21
|
import "./chunk-Q7P4WJDP.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
promoteSemanticRuleFromMemory
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-MRILGULB.js";
|
|
4
|
+
import "./chunk-VBJ7V5SK.js";
|
|
5
5
|
import "./chunk-5UZXUTVO.js";
|
|
6
6
|
import "./chunk-NN2DKE4T.js";
|
|
7
7
|
import "./chunk-Q7P4WJDP.js";
|
package/dist/storage.d.ts
CHANGED
|
@@ -234,6 +234,11 @@ declare class StorageManager {
|
|
|
234
234
|
private writeStorageSecureFile;
|
|
235
235
|
private assertManagedStoragePath;
|
|
236
236
|
readOfflineSyncFile(filePath: string): Promise<Buffer>;
|
|
237
|
+
digestOfflineSyncFile(filePath: string): Promise<{
|
|
238
|
+
sha256: string;
|
|
239
|
+
bytes: number;
|
|
240
|
+
}>;
|
|
241
|
+
private offlineSyncFileIsEncrypted;
|
|
237
242
|
writeOfflineSyncFile(filePath: string, content: Buffer): Promise<void>;
|
|
238
243
|
writeOfflineSyncStagingFile(filePath: string, content: Buffer): Promise<void>;
|
|
239
244
|
writeOfflineSyncFileChunks(filePath: string, chunks: AsyncIterable<Buffer>): Promise<void>;
|
package/dist/storage.js
CHANGED
package/dist/verified-recall.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
searchVerifiedEpisodes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JA3AK3PT.js";
|
|
4
4
|
import "./chunk-NZL6GGQE.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-VBJ7V5SK.js";
|
|
6
6
|
import "./chunk-5UZXUTVO.js";
|
|
7
7
|
import "./chunk-NN2DKE4T.js";
|
|
8
8
|
import "./chunk-Q7P4WJDP.js";
|
package/package.json
CHANGED
package/src/access-http.test.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { EngramAccessHttpServer } from "./access-http.js";
|
|
|
8
8
|
import { EngramAccessInputError, type EngramAccessService } from "./access-service.js";
|
|
9
9
|
import { parseConfig } from "./config.js";
|
|
10
10
|
import { readPair, writePair } from "./contradiction/contradiction-review.js";
|
|
11
|
+
import { OFFLINE_SYNC_MAX_MTIME_MS } from "./offline-sync.js";
|
|
11
12
|
import type { StorageManager } from "./storage.js";
|
|
12
13
|
|
|
13
14
|
test("HTTP server rejects invalid constructor ports", () => {
|
|
@@ -625,6 +626,189 @@ test("HTTP offline apply-file-content allows bulk sync chunks outside the generi
|
|
|
625
626
|
}
|
|
626
627
|
});
|
|
627
628
|
|
|
629
|
+
test("HTTP offline snapshot accepts baseline metadata for fast sync", async () => {
|
|
630
|
+
const calls: Array<{
|
|
631
|
+
namespace: string | undefined;
|
|
632
|
+
principal: string | undefined;
|
|
633
|
+
includeTranscripts: boolean | undefined;
|
|
634
|
+
includeContent: boolean | undefined;
|
|
635
|
+
baseCapturedAt: string | undefined;
|
|
636
|
+
baseFileCount: number;
|
|
637
|
+
}> = [];
|
|
638
|
+
const service = {
|
|
639
|
+
offlineSyncSnapshot: async (options: {
|
|
640
|
+
namespace?: string;
|
|
641
|
+
principal?: string;
|
|
642
|
+
includeTranscripts?: boolean;
|
|
643
|
+
includeContent?: boolean;
|
|
644
|
+
baseCapturedAt?: Date;
|
|
645
|
+
baseFiles?: Array<{ path: string; sha256: string; bytes: number; mtimeMs: number }>;
|
|
646
|
+
}) => {
|
|
647
|
+
calls.push({
|
|
648
|
+
namespace: options.namespace,
|
|
649
|
+
principal: options.principal,
|
|
650
|
+
includeTranscripts: options.includeTranscripts,
|
|
651
|
+
includeContent: options.includeContent,
|
|
652
|
+
baseCapturedAt: options.baseCapturedAt?.toISOString(),
|
|
653
|
+
baseFileCount: options.baseFiles?.length ?? 0,
|
|
654
|
+
});
|
|
655
|
+
return {
|
|
656
|
+
namespace: options.namespace ?? "default",
|
|
657
|
+
format: "remnic.offline-sync.snapshot.v1",
|
|
658
|
+
schemaVersion: 1,
|
|
659
|
+
createdAt: new Date("2026-05-21T00:00:00Z").toISOString(),
|
|
660
|
+
sourceId: "remote:test",
|
|
661
|
+
includeTranscripts: options.includeTranscripts !== false,
|
|
662
|
+
files: options.baseFiles ?? [],
|
|
663
|
+
};
|
|
664
|
+
},
|
|
665
|
+
} as unknown as EngramAccessService;
|
|
666
|
+
const server = new EngramAccessHttpServer({
|
|
667
|
+
service,
|
|
668
|
+
port: 0,
|
|
669
|
+
authToken: "test-token",
|
|
670
|
+
principal: "reader",
|
|
671
|
+
adminConsoleEnabled: false,
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
const status = await server.start();
|
|
675
|
+
try {
|
|
676
|
+
const response = await fetch(
|
|
677
|
+
`http://127.0.0.1:${status.port}/remnic/v1/offline-sync/snapshot`,
|
|
678
|
+
{
|
|
679
|
+
method: "POST",
|
|
680
|
+
headers: {
|
|
681
|
+
authorization: "Bearer test-token",
|
|
682
|
+
"content-type": "application/json",
|
|
683
|
+
},
|
|
684
|
+
body: JSON.stringify({
|
|
685
|
+
namespace: "team",
|
|
686
|
+
includeTranscripts: false,
|
|
687
|
+
includeContent: false,
|
|
688
|
+
baseCapturedAt: "2026-05-31T17:30:08.350Z",
|
|
689
|
+
baseFiles: [{
|
|
690
|
+
path: "facts/a.md",
|
|
691
|
+
sha256: "a".repeat(64),
|
|
692
|
+
bytes: 12,
|
|
693
|
+
mtimeMs: 1234,
|
|
694
|
+
}],
|
|
695
|
+
}),
|
|
696
|
+
},
|
|
697
|
+
);
|
|
698
|
+
const body = await response.json() as { namespace?: string; files?: unknown[] };
|
|
699
|
+
|
|
700
|
+
assert.equal(response.status, 200);
|
|
701
|
+
assert.equal(body.namespace, "team");
|
|
702
|
+
assert.equal(body.files?.length, 1);
|
|
703
|
+
assert.deepEqual(calls, [{
|
|
704
|
+
namespace: "team",
|
|
705
|
+
principal: "reader",
|
|
706
|
+
includeTranscripts: false,
|
|
707
|
+
includeContent: false,
|
|
708
|
+
baseCapturedAt: "2026-05-31T17:30:08.350Z",
|
|
709
|
+
baseFileCount: 1,
|
|
710
|
+
}]);
|
|
711
|
+
} finally {
|
|
712
|
+
await server.stop();
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
test("HTTP offline snapshot rejects unsafe baseline paths as validation errors", async () => {
|
|
717
|
+
let calls = 0;
|
|
718
|
+
const service = {
|
|
719
|
+
offlineSyncSnapshot: async () => {
|
|
720
|
+
calls += 1;
|
|
721
|
+
return {};
|
|
722
|
+
},
|
|
723
|
+
} as unknown as EngramAccessService;
|
|
724
|
+
const server = new EngramAccessHttpServer({
|
|
725
|
+
service,
|
|
726
|
+
port: 0,
|
|
727
|
+
authToken: "test-token",
|
|
728
|
+
principal: "reader",
|
|
729
|
+
adminConsoleEnabled: false,
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
const status = await server.start();
|
|
733
|
+
try {
|
|
734
|
+
const response = await fetch(
|
|
735
|
+
`http://127.0.0.1:${status.port}/remnic/v1/offline-sync/snapshot`,
|
|
736
|
+
{
|
|
737
|
+
method: "POST",
|
|
738
|
+
headers: {
|
|
739
|
+
authorization: "Bearer test-token",
|
|
740
|
+
"content-type": "application/json",
|
|
741
|
+
},
|
|
742
|
+
body: JSON.stringify({
|
|
743
|
+
baseFiles: [{
|
|
744
|
+
path: "../outside.md",
|
|
745
|
+
sha256: "a".repeat(64),
|
|
746
|
+
bytes: 12,
|
|
747
|
+
mtimeMs: 1234,
|
|
748
|
+
}],
|
|
749
|
+
}),
|
|
750
|
+
},
|
|
751
|
+
);
|
|
752
|
+
const body = await response.json() as { code?: string; details?: Array<{ field?: string; message?: string }> };
|
|
753
|
+
|
|
754
|
+
assert.equal(response.status, 400);
|
|
755
|
+
assert.equal(body.code, "validation_error");
|
|
756
|
+
assert.equal(body.details?.[0]?.field, "baseFiles.0.path");
|
|
757
|
+
assert.match(body.details?.[0]?.message ?? "", /POSIX relative path/);
|
|
758
|
+
assert.equal(calls, 0);
|
|
759
|
+
} finally {
|
|
760
|
+
await server.stop();
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
test("HTTP offline snapshot rejects out-of-range baseline mtimes as validation errors", async () => {
|
|
765
|
+
let calls = 0;
|
|
766
|
+
const service = {
|
|
767
|
+
offlineSyncSnapshot: async () => {
|
|
768
|
+
calls += 1;
|
|
769
|
+
return {};
|
|
770
|
+
},
|
|
771
|
+
} as unknown as EngramAccessService;
|
|
772
|
+
const server = new EngramAccessHttpServer({
|
|
773
|
+
service,
|
|
774
|
+
port: 0,
|
|
775
|
+
authToken: "test-token",
|
|
776
|
+
principal: "reader",
|
|
777
|
+
adminConsoleEnabled: false,
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
const status = await server.start();
|
|
781
|
+
try {
|
|
782
|
+
const response = await fetch(
|
|
783
|
+
`http://127.0.0.1:${status.port}/remnic/v1/offline-sync/snapshot`,
|
|
784
|
+
{
|
|
785
|
+
method: "POST",
|
|
786
|
+
headers: {
|
|
787
|
+
authorization: "Bearer test-token",
|
|
788
|
+
"content-type": "application/json",
|
|
789
|
+
},
|
|
790
|
+
body: JSON.stringify({
|
|
791
|
+
baseFiles: [{
|
|
792
|
+
path: "facts/a.md",
|
|
793
|
+
sha256: "a".repeat(64),
|
|
794
|
+
bytes: 12,
|
|
795
|
+
mtimeMs: OFFLINE_SYNC_MAX_MTIME_MS + 1,
|
|
796
|
+
}],
|
|
797
|
+
}),
|
|
798
|
+
},
|
|
799
|
+
);
|
|
800
|
+
const body = await response.json() as { code?: string; details?: Array<{ field?: string; message?: string }> };
|
|
801
|
+
|
|
802
|
+
assert.equal(response.status, 400);
|
|
803
|
+
assert.equal(body.code, "validation_error");
|
|
804
|
+
assert.equal(body.details?.[0]?.field, "baseFiles.0.mtimeMs");
|
|
805
|
+
assert.match(body.details?.[0]?.message ?? "", /less than or equal/);
|
|
806
|
+
assert.equal(calls, 0);
|
|
807
|
+
} finally {
|
|
808
|
+
await server.stop();
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
|
|
628
812
|
test("HTTP offline snapshot rejects invalid boolean query values", async () => {
|
|
629
813
|
let calls = 0;
|
|
630
814
|
const service = {
|