@remnic/core 1.1.23 → 1.1.25
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 +2 -2
- package/dist/access-http.js +5 -5
- package/dist/access-mcp.js +4 -4
- package/dist/access-schema.js +2 -2
- package/dist/access-service.js +2 -2
- package/dist/{chunk-RA73CTVY.js → chunk-2DM72JF3.js} +4 -4
- package/dist/{chunk-FHXVW3L4.js → chunk-6CB4E7ZV.js} +3 -3
- package/dist/{chunk-JKXFF3NT.js → chunk-AMVN77EU.js} +5 -1
- package/dist/chunk-AMVN77EU.js.map +1 -0
- package/dist/{chunk-HWF42K6J.js → chunk-JUYT2J3K.js} +11 -15
- package/dist/chunk-JUYT2J3K.js.map +1 -0
- package/dist/{chunk-MM5EBZVW.js → chunk-LCTP7YRU.js} +2 -2
- package/dist/{chunk-7E7SZRPP.js → chunk-NW7JW5GA.js} +2 -2
- package/dist/cli.js +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/offline-sync.d.ts +3 -1
- package/dist/offline-sync.js +5 -1
- package/dist/schemas.d.ts +22 -22
- package/dist/transfer/types.d.ts +12 -12
- package/package.json +1 -1
- package/src/access-http.test.ts +66 -3
- package/src/access-http.ts +16 -11
- package/src/index.ts +2 -0
- package/src/offline-sync.ts +2 -0
- package/dist/chunk-HWF42K6J.js.map +0 -1
- package/dist/chunk-JKXFF3NT.js.map +0 -1
- /package/dist/{chunk-RA73CTVY.js.map → chunk-2DM72JF3.js.map} +0 -0
- /package/dist/{chunk-FHXVW3L4.js.map → chunk-6CB4E7ZV.js.map} +0 -0
- /package/dist/{chunk-MM5EBZVW.js.map → chunk-LCTP7YRU.js.map} +0 -0
- /package/dist/{chunk-7E7SZRPP.js.map → chunk-NW7JW5GA.js.map} +0 -0
package/dist/offline-sync.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ declare const OFFLINE_SYNC_SNAPSHOT_FORMAT = "remnic.offline-sync.snapshot.v1";
|
|
|
2
2
|
declare const OFFLINE_SYNC_CHANGESET_FORMAT = "remnic.offline-sync.changeset.v1";
|
|
3
3
|
declare const OFFLINE_SYNC_STATE_VERSION = 1;
|
|
4
4
|
declare const OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES: number;
|
|
5
|
+
declare const OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES: number;
|
|
6
|
+
declare const OFFLINE_SYNC_APPLY_MAX_BODY_BYTES: number;
|
|
5
7
|
interface OfflineSyncFileState {
|
|
6
8
|
path: string;
|
|
7
9
|
sha256: string;
|
|
@@ -200,4 +202,4 @@ declare function offlineSyncStateFromSnapshot(options: {
|
|
|
200
202
|
declare function normalizeOfflineSyncState(input: unknown): OfflineSyncState;
|
|
201
203
|
declare function fileStatesFromSnapshot(snapshot: OfflineSyncSnapshot): OfflineSyncFileState[];
|
|
202
204
|
|
|
203
|
-
export { OFFLINE_SYNC_CHANGESET_FORMAT, OFFLINE_SYNC_FILE_CONTENT_MAX_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 };
|
|
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 };
|
package/dist/offline-sync.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
2
3
|
OFFLINE_SYNC_CHANGESET_FORMAT,
|
|
3
4
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
5
|
+
OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES,
|
|
4
6
|
OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
5
7
|
OFFLINE_SYNC_STATE_VERSION,
|
|
6
8
|
applyOfflineSyncChangeset,
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
summarizeOfflineSyncChangeset,
|
|
21
23
|
summarizeOfflineSyncPendingChanges,
|
|
22
24
|
writeOfflineSyncState
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-AMVN77EU.js";
|
|
24
26
|
import "./chunk-I6K5FBRQ.js";
|
|
25
27
|
import "./chunk-AGZQD76C.js";
|
|
26
28
|
import "./chunk-MXFBBHJU.js";
|
|
@@ -28,8 +30,10 @@ import "./chunk-A6XUJE5D.js";
|
|
|
28
30
|
import "./chunk-P7FMDTKL.js";
|
|
29
31
|
import "./chunk-PZ5AY32C.js";
|
|
30
32
|
export {
|
|
33
|
+
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
31
34
|
OFFLINE_SYNC_CHANGESET_FORMAT,
|
|
32
35
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
36
|
+
OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES,
|
|
33
37
|
OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
34
38
|
OFFLINE_SYNC_STATE_VERSION,
|
|
35
39
|
applyOfflineSyncChangeset,
|
package/dist/schemas.d.ts
CHANGED
|
@@ -217,12 +217,12 @@ declare const EntityMentionSchema: z.ZodObject<{
|
|
|
217
217
|
title: z.ZodString;
|
|
218
218
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
219
219
|
}, "strip", z.ZodTypeAny, {
|
|
220
|
-
key: string;
|
|
221
220
|
title: string;
|
|
221
|
+
key: string;
|
|
222
222
|
facts: string[];
|
|
223
223
|
}, {
|
|
224
|
-
key: string;
|
|
225
224
|
title: string;
|
|
225
|
+
key: string;
|
|
226
226
|
facts: string[];
|
|
227
227
|
}>, "many">>>;
|
|
228
228
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -230,8 +230,8 @@ declare const EntityMentionSchema: z.ZodObject<{
|
|
|
230
230
|
name: string;
|
|
231
231
|
facts: string[];
|
|
232
232
|
structuredSections?: {
|
|
233
|
-
key: string;
|
|
234
233
|
title: string;
|
|
234
|
+
key: string;
|
|
235
235
|
facts: string[];
|
|
236
236
|
}[] | null | undefined;
|
|
237
237
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -240,8 +240,8 @@ declare const EntityMentionSchema: z.ZodObject<{
|
|
|
240
240
|
name: string;
|
|
241
241
|
facts: string[];
|
|
242
242
|
structuredSections?: {
|
|
243
|
-
key: string;
|
|
244
243
|
title: string;
|
|
244
|
+
key: string;
|
|
245
245
|
facts: string[];
|
|
246
246
|
}[] | null | undefined;
|
|
247
247
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -468,12 +468,12 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
468
468
|
title: z.ZodString;
|
|
469
469
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
470
470
|
}, "strip", z.ZodTypeAny, {
|
|
471
|
-
key: string;
|
|
472
471
|
title: string;
|
|
472
|
+
key: string;
|
|
473
473
|
facts: string[];
|
|
474
474
|
}, {
|
|
475
|
-
key: string;
|
|
476
475
|
title: string;
|
|
476
|
+
key: string;
|
|
477
477
|
facts: string[];
|
|
478
478
|
}>, "many">>>;
|
|
479
479
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -481,8 +481,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
481
481
|
name: string;
|
|
482
482
|
facts: string[];
|
|
483
483
|
structuredSections?: {
|
|
484
|
-
key: string;
|
|
485
484
|
title: string;
|
|
485
|
+
key: string;
|
|
486
486
|
facts: string[];
|
|
487
487
|
}[] | null | undefined;
|
|
488
488
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -491,8 +491,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
491
491
|
name: string;
|
|
492
492
|
facts: string[];
|
|
493
493
|
structuredSections?: {
|
|
494
|
-
key: string;
|
|
495
494
|
title: string;
|
|
495
|
+
key: string;
|
|
496
496
|
facts: string[];
|
|
497
497
|
}[] | null | undefined;
|
|
498
498
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -549,8 +549,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
549
549
|
name: string;
|
|
550
550
|
facts: string[];
|
|
551
551
|
structuredSections?: {
|
|
552
|
-
key: string;
|
|
553
552
|
title: string;
|
|
553
|
+
key: string;
|
|
554
554
|
facts: string[];
|
|
555
555
|
}[] | null | undefined;
|
|
556
556
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -598,8 +598,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
|
|
|
598
598
|
name: string;
|
|
599
599
|
facts: string[];
|
|
600
600
|
structuredSections?: {
|
|
601
|
-
key: string;
|
|
602
601
|
title: string;
|
|
602
|
+
key: string;
|
|
603
603
|
facts: string[];
|
|
604
604
|
}[] | null | undefined;
|
|
605
605
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -778,12 +778,12 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
778
778
|
title: z.ZodString;
|
|
779
779
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
780
780
|
}, "strip", z.ZodTypeAny, {
|
|
781
|
-
key: string;
|
|
782
781
|
title: string;
|
|
782
|
+
key: string;
|
|
783
783
|
facts: string[];
|
|
784
784
|
}, {
|
|
785
|
-
key: string;
|
|
786
785
|
title: string;
|
|
786
|
+
key: string;
|
|
787
787
|
facts: string[];
|
|
788
788
|
}>, "many">>>;
|
|
789
789
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -791,8 +791,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
791
791
|
name: string;
|
|
792
792
|
facts: string[];
|
|
793
793
|
structuredSections?: {
|
|
794
|
-
key: string;
|
|
795
794
|
title: string;
|
|
795
|
+
key: string;
|
|
796
796
|
facts: string[];
|
|
797
797
|
}[] | null | undefined;
|
|
798
798
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -801,8 +801,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
801
801
|
name: string;
|
|
802
802
|
facts: string[];
|
|
803
803
|
structuredSections?: {
|
|
804
|
-
key: string;
|
|
805
804
|
title: string;
|
|
805
|
+
key: string;
|
|
806
806
|
facts: string[];
|
|
807
807
|
}[] | null | undefined;
|
|
808
808
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -873,8 +873,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
873
873
|
name: string;
|
|
874
874
|
facts: string[];
|
|
875
875
|
structuredSections?: {
|
|
876
|
-
key: string;
|
|
877
876
|
title: string;
|
|
877
|
+
key: string;
|
|
878
878
|
facts: string[];
|
|
879
879
|
}[] | null | undefined;
|
|
880
880
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -928,8 +928,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
|
|
|
928
928
|
name: string;
|
|
929
929
|
facts: string[];
|
|
930
930
|
structuredSections?: {
|
|
931
|
-
key: string;
|
|
932
931
|
title: string;
|
|
932
|
+
key: string;
|
|
933
933
|
facts: string[];
|
|
934
934
|
}[] | null | undefined;
|
|
935
935
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -998,12 +998,12 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
998
998
|
title: z.ZodString;
|
|
999
999
|
facts: z.ZodArray<z.ZodString, "many">;
|
|
1000
1000
|
}, "strip", z.ZodTypeAny, {
|
|
1001
|
-
key: string;
|
|
1002
1001
|
title: string;
|
|
1002
|
+
key: string;
|
|
1003
1003
|
facts: string[];
|
|
1004
1004
|
}, {
|
|
1005
|
-
key: string;
|
|
1006
1005
|
title: string;
|
|
1006
|
+
key: string;
|
|
1007
1007
|
facts: string[];
|
|
1008
1008
|
}>, "many">>>;
|
|
1009
1009
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1011,8 +1011,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1011
1011
|
name: string;
|
|
1012
1012
|
facts: string[];
|
|
1013
1013
|
structuredSections?: {
|
|
1014
|
-
key: string;
|
|
1015
1014
|
title: string;
|
|
1015
|
+
key: string;
|
|
1016
1016
|
facts: string[];
|
|
1017
1017
|
}[] | null | undefined;
|
|
1018
1018
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -1021,8 +1021,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1021
1021
|
name: string;
|
|
1022
1022
|
facts: string[];
|
|
1023
1023
|
structuredSections?: {
|
|
1024
|
-
key: string;
|
|
1025
1024
|
title: string;
|
|
1025
|
+
key: string;
|
|
1026
1026
|
facts: string[];
|
|
1027
1027
|
}[] | null | undefined;
|
|
1028
1028
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -1041,8 +1041,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1041
1041
|
name: string;
|
|
1042
1042
|
facts: string[];
|
|
1043
1043
|
structuredSections?: {
|
|
1044
|
-
key: string;
|
|
1045
1044
|
title: string;
|
|
1045
|
+
key: string;
|
|
1046
1046
|
facts: string[];
|
|
1047
1047
|
}[] | null | undefined;
|
|
1048
1048
|
promptedByQuestion?: string | null | undefined;
|
|
@@ -1061,8 +1061,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
|
|
|
1061
1061
|
name: string;
|
|
1062
1062
|
facts: string[];
|
|
1063
1063
|
structuredSections?: {
|
|
1064
|
-
key: string;
|
|
1065
1064
|
title: string;
|
|
1065
|
+
key: string;
|
|
1066
1066
|
facts: string[];
|
|
1067
1067
|
}[] | null | undefined;
|
|
1068
1068
|
promptedByQuestion?: string | null | undefined;
|
package/dist/transfer/types.d.ts
CHANGED
|
@@ -313,13 +313,13 @@ declare const CapsuleBlockSchema: z.ZodObject<{
|
|
|
313
313
|
peerProfiles: boolean;
|
|
314
314
|
}>;
|
|
315
315
|
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
schemaVersion: string;
|
|
316
317
|
includes: {
|
|
317
318
|
procedural: boolean;
|
|
318
319
|
taxonomy: boolean;
|
|
319
320
|
identityAnchors: boolean;
|
|
320
321
|
peerProfiles: boolean;
|
|
321
322
|
};
|
|
322
|
-
schemaVersion: string;
|
|
323
323
|
id: string;
|
|
324
324
|
description: string;
|
|
325
325
|
version: string;
|
|
@@ -334,13 +334,13 @@ declare const CapsuleBlockSchema: z.ZodObject<{
|
|
|
334
334
|
directAnswerEnabled: boolean;
|
|
335
335
|
};
|
|
336
336
|
}, {
|
|
337
|
+
schemaVersion: string;
|
|
337
338
|
includes: {
|
|
338
339
|
procedural: boolean;
|
|
339
340
|
taxonomy: boolean;
|
|
340
341
|
identityAnchors: boolean;
|
|
341
342
|
peerProfiles: boolean;
|
|
342
343
|
};
|
|
343
|
-
schemaVersion: string;
|
|
344
344
|
id: string;
|
|
345
345
|
description: string;
|
|
346
346
|
version: string;
|
|
@@ -464,13 +464,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
464
464
|
peerProfiles: boolean;
|
|
465
465
|
}>;
|
|
466
466
|
}, "strip", z.ZodTypeAny, {
|
|
467
|
+
schemaVersion: string;
|
|
467
468
|
includes: {
|
|
468
469
|
procedural: boolean;
|
|
469
470
|
taxonomy: boolean;
|
|
470
471
|
identityAnchors: boolean;
|
|
471
472
|
peerProfiles: boolean;
|
|
472
473
|
};
|
|
473
|
-
schemaVersion: string;
|
|
474
474
|
id: string;
|
|
475
475
|
description: string;
|
|
476
476
|
version: string;
|
|
@@ -485,13 +485,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
485
485
|
directAnswerEnabled: boolean;
|
|
486
486
|
};
|
|
487
487
|
}, {
|
|
488
|
+
schemaVersion: string;
|
|
488
489
|
includes: {
|
|
489
490
|
procedural: boolean;
|
|
490
491
|
taxonomy: boolean;
|
|
491
492
|
identityAnchors: boolean;
|
|
492
493
|
peerProfiles: boolean;
|
|
493
494
|
};
|
|
494
|
-
schemaVersion: string;
|
|
495
495
|
id: string;
|
|
496
496
|
description: string;
|
|
497
497
|
version: string;
|
|
@@ -518,13 +518,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
518
518
|
pluginVersion: string;
|
|
519
519
|
includesTranscripts: boolean;
|
|
520
520
|
capsule: {
|
|
521
|
+
schemaVersion: string;
|
|
521
522
|
includes: {
|
|
522
523
|
procedural: boolean;
|
|
523
524
|
taxonomy: boolean;
|
|
524
525
|
identityAnchors: boolean;
|
|
525
526
|
peerProfiles: boolean;
|
|
526
527
|
};
|
|
527
|
-
schemaVersion: string;
|
|
528
528
|
id: string;
|
|
529
529
|
description: string;
|
|
530
530
|
version: string;
|
|
@@ -551,13 +551,13 @@ declare const ExportManifestV2Schema: z.ZodObject<{
|
|
|
551
551
|
pluginVersion: string;
|
|
552
552
|
includesTranscripts: boolean;
|
|
553
553
|
capsule: {
|
|
554
|
+
schemaVersion: string;
|
|
554
555
|
includes: {
|
|
555
556
|
procedural: boolean;
|
|
556
557
|
taxonomy: boolean;
|
|
557
558
|
identityAnchors: boolean;
|
|
558
559
|
peerProfiles: boolean;
|
|
559
560
|
};
|
|
560
|
-
schemaVersion: string;
|
|
561
561
|
id: string;
|
|
562
562
|
description: string;
|
|
563
563
|
version: string;
|
|
@@ -683,13 +683,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
683
683
|
peerProfiles: boolean;
|
|
684
684
|
}>;
|
|
685
685
|
}, "strip", z.ZodTypeAny, {
|
|
686
|
+
schemaVersion: string;
|
|
686
687
|
includes: {
|
|
687
688
|
procedural: boolean;
|
|
688
689
|
taxonomy: boolean;
|
|
689
690
|
identityAnchors: boolean;
|
|
690
691
|
peerProfiles: boolean;
|
|
691
692
|
};
|
|
692
|
-
schemaVersion: string;
|
|
693
693
|
id: string;
|
|
694
694
|
description: string;
|
|
695
695
|
version: string;
|
|
@@ -704,13 +704,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
704
704
|
directAnswerEnabled: boolean;
|
|
705
705
|
};
|
|
706
706
|
}, {
|
|
707
|
+
schemaVersion: string;
|
|
707
708
|
includes: {
|
|
708
709
|
procedural: boolean;
|
|
709
710
|
taxonomy: boolean;
|
|
710
711
|
identityAnchors: boolean;
|
|
711
712
|
peerProfiles: boolean;
|
|
712
713
|
};
|
|
713
|
-
schemaVersion: string;
|
|
714
714
|
id: string;
|
|
715
715
|
description: string;
|
|
716
716
|
version: string;
|
|
@@ -737,13 +737,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
737
737
|
pluginVersion: string;
|
|
738
738
|
includesTranscripts: boolean;
|
|
739
739
|
capsule: {
|
|
740
|
+
schemaVersion: string;
|
|
740
741
|
includes: {
|
|
741
742
|
procedural: boolean;
|
|
742
743
|
taxonomy: boolean;
|
|
743
744
|
identityAnchors: boolean;
|
|
744
745
|
peerProfiles: boolean;
|
|
745
746
|
};
|
|
746
|
-
schemaVersion: string;
|
|
747
747
|
id: string;
|
|
748
748
|
description: string;
|
|
749
749
|
version: string;
|
|
@@ -770,13 +770,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
770
770
|
pluginVersion: string;
|
|
771
771
|
includesTranscripts: boolean;
|
|
772
772
|
capsule: {
|
|
773
|
+
schemaVersion: string;
|
|
773
774
|
includes: {
|
|
774
775
|
procedural: boolean;
|
|
775
776
|
taxonomy: boolean;
|
|
776
777
|
identityAnchors: boolean;
|
|
777
778
|
peerProfiles: boolean;
|
|
778
779
|
};
|
|
779
|
-
schemaVersion: string;
|
|
780
780
|
id: string;
|
|
781
781
|
description: string;
|
|
782
782
|
version: string;
|
|
@@ -815,13 +815,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
815
815
|
pluginVersion: string;
|
|
816
816
|
includesTranscripts: boolean;
|
|
817
817
|
capsule: {
|
|
818
|
+
schemaVersion: string;
|
|
818
819
|
includes: {
|
|
819
820
|
procedural: boolean;
|
|
820
821
|
taxonomy: boolean;
|
|
821
822
|
identityAnchors: boolean;
|
|
822
823
|
peerProfiles: boolean;
|
|
823
824
|
};
|
|
824
|
-
schemaVersion: string;
|
|
825
825
|
id: string;
|
|
826
826
|
description: string;
|
|
827
827
|
version: string;
|
|
@@ -854,13 +854,13 @@ declare const ExportBundleV2Schema: z.ZodObject<{
|
|
|
854
854
|
pluginVersion: string;
|
|
855
855
|
includesTranscripts: boolean;
|
|
856
856
|
capsule: {
|
|
857
|
+
schemaVersion: string;
|
|
857
858
|
includes: {
|
|
858
859
|
procedural: boolean;
|
|
859
860
|
taxonomy: boolean;
|
|
860
861
|
identityAnchors: boolean;
|
|
861
862
|
peerProfiles: boolean;
|
|
862
863
|
};
|
|
863
|
-
schemaVersion: string;
|
|
864
864
|
id: string;
|
|
865
865
|
description: string;
|
|
866
866
|
version: string;
|
package/package.json
CHANGED
package/src/access-http.test.ts
CHANGED
|
@@ -557,7 +557,7 @@ test("HTTP offline apply-file-content forwards binary chunks and metadata", asyn
|
|
|
557
557
|
}
|
|
558
558
|
});
|
|
559
559
|
|
|
560
|
-
test("HTTP offline apply-file-content
|
|
560
|
+
test("HTTP offline apply-file-content allows bulk sync chunks outside the generic write throttle", async () => {
|
|
561
561
|
let calls = 0;
|
|
562
562
|
const service = {
|
|
563
563
|
offlineSyncApplyFileContent: async (options: {
|
|
@@ -618,8 +618,8 @@ test("HTTP offline apply-file-content rate limits accepted chunks", async () =>
|
|
|
618
618
|
await response.arrayBuffer();
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
-
assert.equal(lastStatus,
|
|
622
|
-
assert.equal(calls,
|
|
621
|
+
assert.equal(lastStatus, 200);
|
|
622
|
+
assert.equal(calls, 31);
|
|
623
623
|
} finally {
|
|
624
624
|
await server.stop();
|
|
625
625
|
}
|
|
@@ -726,6 +726,69 @@ test("HTTP offline apply validates and forwards changesets", async () => {
|
|
|
726
726
|
}
|
|
727
727
|
});
|
|
728
728
|
|
|
729
|
+
test("HTTP offline apply accepts bulk changesets above the generic JSON body limit", async () => {
|
|
730
|
+
let calls = 0;
|
|
731
|
+
const largeContent = Buffer.alloc(256 * 1024, 7).toString("base64");
|
|
732
|
+
const changeset = {
|
|
733
|
+
format: "remnic.offline-sync.changeset.v1",
|
|
734
|
+
schemaVersion: 1,
|
|
735
|
+
createdAt: new Date("2026-05-21T00:00:00Z").toISOString(),
|
|
736
|
+
sourceId: "laptop:test",
|
|
737
|
+
includeTranscripts: true,
|
|
738
|
+
changes: [{
|
|
739
|
+
type: "upsert",
|
|
740
|
+
path: "facts/large.md",
|
|
741
|
+
file: {
|
|
742
|
+
path: "facts/large.md",
|
|
743
|
+
sha256: "b".repeat(64),
|
|
744
|
+
bytes: 256 * 1024,
|
|
745
|
+
mtimeMs: 1,
|
|
746
|
+
contentBase64: largeContent,
|
|
747
|
+
},
|
|
748
|
+
}],
|
|
749
|
+
};
|
|
750
|
+
const service = {
|
|
751
|
+
offlineSyncApply: async () => {
|
|
752
|
+
calls += 1;
|
|
753
|
+
return {
|
|
754
|
+
namespace: "team",
|
|
755
|
+
appliedUpserts: 1,
|
|
756
|
+
appliedDeletes: 0,
|
|
757
|
+
skipped: 0,
|
|
758
|
+
conflicts: [],
|
|
759
|
+
currentFiles: [],
|
|
760
|
+
};
|
|
761
|
+
},
|
|
762
|
+
} as unknown as EngramAccessService;
|
|
763
|
+
const server = new EngramAccessHttpServer({
|
|
764
|
+
service,
|
|
765
|
+
port: 0,
|
|
766
|
+
authToken: "test-token",
|
|
767
|
+
principal: "writer",
|
|
768
|
+
maxBodyBytes: 1024,
|
|
769
|
+
adminConsoleEnabled: false,
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
const status = await server.start();
|
|
773
|
+
try {
|
|
774
|
+
const response = await fetch(`http://127.0.0.1:${status.port}/remnic/v1/offline-sync/apply`, {
|
|
775
|
+
method: "POST",
|
|
776
|
+
headers: {
|
|
777
|
+
authorization: "Bearer test-token",
|
|
778
|
+
"content-type": "application/json",
|
|
779
|
+
},
|
|
780
|
+
body: JSON.stringify({ namespace: "team", changeset }),
|
|
781
|
+
});
|
|
782
|
+
const body = await response.json() as { appliedUpserts?: number };
|
|
783
|
+
|
|
784
|
+
assert.equal(response.status, 200);
|
|
785
|
+
assert.equal(body.appliedUpserts, 1);
|
|
786
|
+
assert.equal(calls, 1);
|
|
787
|
+
} finally {
|
|
788
|
+
await server.stop();
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
|
|
729
792
|
test("HTTP offline apply requires a changeset", async () => {
|
|
730
793
|
let calls = 0;
|
|
731
794
|
const service = {
|
package/src/access-http.ts
CHANGED
|
@@ -9,7 +9,10 @@ import { log } from "./logger.js";
|
|
|
9
9
|
import { EngramAccessInputError, type EngramAccessService } from "./access-service.js";
|
|
10
10
|
import { EngramMcpServer } from "./access-mcp.js";
|
|
11
11
|
import { validateRequest, type SchemaName, type SchemaTypeFor } from "./access-schema.js";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
14
|
+
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
15
|
+
} from "./offline-sync.js";
|
|
13
16
|
import type { RecallDisclosure, RecallPlanMode } from "./types.js";
|
|
14
17
|
import { isRecallDisclosure } from "./types.js";
|
|
15
18
|
import { isTrustZoneName, type TrustZoneName, type TrustZoneRecordKind, type TrustZoneSourceClass } from "./trust-zones.js";
|
|
@@ -680,8 +683,6 @@ export class EngramAccessHttpServer {
|
|
|
680
683
|
const namespaceParam = parsed.searchParams.get("namespace");
|
|
681
684
|
const bytes = this.readRequiredIntegerHeader(req, "x-remnic-file-bytes");
|
|
682
685
|
const offset = this.readOptionalIntegerHeader(req, "x-remnic-chunk-offset") ?? 0;
|
|
683
|
-
const startsUpload = offset === 0;
|
|
684
|
-
if (startsUpload) this.ensureWriteRateLimitAvailable();
|
|
685
686
|
const content = await this.readBinaryBody(req, OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES);
|
|
686
687
|
const result = await this.service.offlineSyncApplyFileContent({
|
|
687
688
|
namespace: this.resolveNamespace(
|
|
@@ -703,7 +704,6 @@ export class EngramAccessHttpServer {
|
|
|
703
704
|
baseSha256: this.readOptionalHeader(req, "x-remnic-base-sha256"),
|
|
704
705
|
content,
|
|
705
706
|
});
|
|
706
|
-
if (startsUpload) this.recordWriteRateLimitHit();
|
|
707
707
|
this.respondJson(res, 200, result);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
@@ -712,14 +712,12 @@ export class EngramAccessHttpServer {
|
|
|
712
712
|
req.method === "POST" &&
|
|
713
713
|
(pathname === "/engram/v1/offline-sync/apply" || pathname === "/remnic/v1/offline-sync/apply")
|
|
714
714
|
) {
|
|
715
|
-
const body = await this.readValidatedBody(req, "offlineSyncApply");
|
|
716
|
-
this.ensureWriteRateLimitAvailable();
|
|
715
|
+
const body = await this.readValidatedBody(req, "offlineSyncApply", OFFLINE_SYNC_APPLY_MAX_BODY_BYTES);
|
|
717
716
|
const result = await this.service.offlineSyncApply({
|
|
718
717
|
namespace: this.resolveNamespace(req, body.namespace),
|
|
719
718
|
principal: this.resolveRequestPrincipal(req),
|
|
720
719
|
changeset: body.changeset,
|
|
721
720
|
});
|
|
722
|
-
this.recordWriteRateLimitHit();
|
|
723
721
|
this.respondJson(res, 200, result);
|
|
724
722
|
return;
|
|
725
723
|
}
|
|
@@ -1924,13 +1922,16 @@ export class EngramAccessHttpServer {
|
|
|
1924
1922
|
}
|
|
1925
1923
|
}
|
|
1926
1924
|
|
|
1927
|
-
private async readJsonBody(
|
|
1925
|
+
private async readJsonBody(
|
|
1926
|
+
req: IncomingMessage,
|
|
1927
|
+
maxBodyBytes = this.maxBodyBytes,
|
|
1928
|
+
): Promise<Record<string, unknown>> {
|
|
1928
1929
|
const chunks: Buffer[] = [];
|
|
1929
1930
|
let total = 0;
|
|
1930
1931
|
for await (const chunk of req) {
|
|
1931
1932
|
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
1932
1933
|
total += buffer.length;
|
|
1933
|
-
if (total >
|
|
1934
|
+
if (total > maxBodyBytes) {
|
|
1934
1935
|
throw new HttpError(413, "request_body_too_large", "request_body_too_large");
|
|
1935
1936
|
}
|
|
1936
1937
|
chunks.push(buffer);
|
|
@@ -2027,8 +2028,12 @@ export class EngramAccessHttpServer {
|
|
|
2027
2028
|
throw new EngramAccessInputError(`${name} header must be one of: true, false`);
|
|
2028
2029
|
}
|
|
2029
2030
|
|
|
2030
|
-
private async readValidatedBody<S extends SchemaName>(
|
|
2031
|
-
|
|
2031
|
+
private async readValidatedBody<S extends SchemaName>(
|
|
2032
|
+
req: IncomingMessage,
|
|
2033
|
+
schemaName: S,
|
|
2034
|
+
maxBodyBytes?: number,
|
|
2035
|
+
): Promise<SchemaTypeFor<S>> {
|
|
2036
|
+
const raw = await this.readJsonBody(req, maxBodyBytes);
|
|
2032
2037
|
const result = validateRequest(schemaName, raw);
|
|
2033
2038
|
if (!result.success) {
|
|
2034
2039
|
throw new HttpError(400, result.error.error, "validation_error", result.error.details);
|
package/src/index.ts
CHANGED
|
@@ -679,8 +679,10 @@ export {
|
|
|
679
679
|
// ---------------------------------------------------------------------------
|
|
680
680
|
|
|
681
681
|
export {
|
|
682
|
+
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
682
683
|
OFFLINE_SYNC_CHANGESET_FORMAT,
|
|
683
684
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
685
|
+
OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES,
|
|
684
686
|
OFFLINE_SYNC_SNAPSHOT_FORMAT,
|
|
685
687
|
OFFLINE_SYNC_STATE_VERSION,
|
|
686
688
|
applyOfflineSyncFileContentChunk,
|
package/src/offline-sync.ts
CHANGED
|
@@ -29,6 +29,8 @@ export const OFFLINE_SYNC_SNAPSHOT_FORMAT = "remnic.offline-sync.snapshot.v1";
|
|
|
29
29
|
export const OFFLINE_SYNC_CHANGESET_FORMAT = "remnic.offline-sync.changeset.v1";
|
|
30
30
|
export const OFFLINE_SYNC_STATE_VERSION = 1;
|
|
31
31
|
export const OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
|
|
32
|
+
export const OFFLINE_SYNC_FILE_CONTENT_TRANSFER_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
33
|
+
export const OFFLINE_SYNC_APPLY_MAX_BODY_BYTES = 16 * 1024 * 1024;
|
|
32
34
|
|
|
33
35
|
export interface OfflineSyncFileState {
|
|
34
36
|
path: string;
|