@remnic/core 1.1.15 → 1.1.16
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.d.ts +1 -1
- package/dist/access-http.js +5 -5
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.js +4 -4
- package/dist/access-schema.d.ts +17 -3
- package/dist/access-schema.js +3 -1
- package/dist/{access-service-BCMine1s.d.ts → access-service-DZXc7qwR.d.ts} +11 -1
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +2 -2
- package/dist/{chunk-GSP6ZKOY.js → chunk-2OZ6GP27.js} +81 -18
- package/dist/chunk-2OZ6GP27.js.map +1 -0
- package/dist/{chunk-VWFIQOTJ.js → chunk-66H2DZYB.js} +8 -1
- package/dist/chunk-66H2DZYB.js.map +1 -0
- package/dist/{chunk-ZYRMKWVW.js → chunk-HJILHQOR.js} +4 -4
- package/dist/{chunk-HJ2WMBFB.js → chunk-MTYLGYOQ.js} +15 -4
- package/dist/chunk-MTYLGYOQ.js.map +1 -0
- package/dist/{chunk-BNATB54A.js → chunk-SK42SSAN.js} +3 -3
- package/dist/{chunk-5D2G67ZQ.js → chunk-Y2YBRCEF.js} +29 -3
- package/dist/chunk-Y2YBRCEF.js.map +1 -0
- package/dist/{cli-B71zQ6XK.d.ts → cli-kVwab1_L.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +6 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/offline-sync.d.ts +10 -1
- package/dist/offline-sync.js +3 -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 +73 -0
- package/src/access-http.ts +15 -0
- package/src/access-schema.ts +12 -0
- package/src/access-service-namespace.test.ts +64 -1
- package/src/access-service.ts +44 -0
- package/src/index.ts +1 -0
- package/src/offline-sync.test.ts +125 -0
- package/src/offline-sync.ts +107 -18
- package/dist/chunk-5D2G67ZQ.js.map +0 -1
- package/dist/chunk-GSP6ZKOY.js.map +0 -1
- package/dist/chunk-HJ2WMBFB.js.map +0 -1
- package/dist/chunk-VWFIQOTJ.js.map +0 -1
- /package/dist/{chunk-ZYRMKWVW.js.map → chunk-HJILHQOR.js.map} +0 -0
- /package/dist/{chunk-BNATB54A.js.map → chunk-SK42SSAN.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EngramAccessRecallResponse } from './access-service-
|
|
1
|
+
import { a as EngramAccessRecallResponse } from './access-service-DZXc7qwR.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';
|
package/dist/offline-sync.d.ts
CHANGED
|
@@ -95,6 +95,15 @@ declare function buildOfflineSyncSnapshot(options: {
|
|
|
95
95
|
now?: Date;
|
|
96
96
|
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
97
97
|
}): Promise<OfflineSyncSnapshot>;
|
|
98
|
+
declare function buildOfflineSyncSnapshotForPaths(options: {
|
|
99
|
+
root: string;
|
|
100
|
+
sourceId: string;
|
|
101
|
+
paths: readonly string[];
|
|
102
|
+
includeContent?: boolean;
|
|
103
|
+
includeTranscripts?: boolean;
|
|
104
|
+
now?: Date;
|
|
105
|
+
readFile?: (target: OfflineSyncFileTarget) => Promise<Buffer>;
|
|
106
|
+
}): Promise<OfflineSyncSnapshot>;
|
|
98
107
|
declare function buildOfflineSyncChangeset(options: {
|
|
99
108
|
root: string;
|
|
100
109
|
sourceId: string;
|
|
@@ -133,4 +142,4 @@ declare function offlineSyncStateFromSnapshot(options: {
|
|
|
133
142
|
declare function normalizeOfflineSyncState(input: unknown): OfflineSyncState;
|
|
134
143
|
declare function fileStatesFromSnapshot(snapshot: OfflineSyncSnapshot): OfflineSyncFileState[];
|
|
135
144
|
|
|
136
|
-
export { OFFLINE_SYNC_CHANGESET_FORMAT, OFFLINE_SYNC_SNAPSHOT_FORMAT, OFFLINE_SYNC_STATE_VERSION, type OfflineSyncApplyChangesetResult, type OfflineSyncApplySnapshotResult, type OfflineSyncChange, type OfflineSyncChangeset, type OfflineSyncChangesetSummary, type OfflineSyncConflict, type OfflineSyncFileRecord, type OfflineSyncFileState, type OfflineSyncFileTarget, type OfflineSyncFileWriteTarget, type OfflineSyncSnapshot, type OfflineSyncState, applyOfflineSyncChangeset, applyOfflineSyncSnapshot, buildOfflineSyncChangeset, buildOfflineSyncSnapshot, defaultOfflineSyncStatePath, fileStatesFromSnapshot, normalizeOfflineSyncChangeset, normalizeOfflineSyncSnapshot, normalizeOfflineSyncState, offlineSyncStateFromSnapshot, readOfflineSyncState, summarizeOfflineSyncChangeset, writeOfflineSyncState };
|
|
145
|
+
export { OFFLINE_SYNC_CHANGESET_FORMAT, OFFLINE_SYNC_SNAPSHOT_FORMAT, OFFLINE_SYNC_STATE_VERSION, type OfflineSyncApplyChangesetResult, type OfflineSyncApplySnapshotResult, type OfflineSyncChange, type OfflineSyncChangeset, type OfflineSyncChangesetSummary, type OfflineSyncConflict, type OfflineSyncFileRecord, type OfflineSyncFileState, type OfflineSyncFileTarget, type OfflineSyncFileWriteTarget, type OfflineSyncSnapshot, type OfflineSyncState, applyOfflineSyncChangeset, applyOfflineSyncSnapshot, buildOfflineSyncChangeset, buildOfflineSyncSnapshot, buildOfflineSyncSnapshotForPaths, defaultOfflineSyncStatePath, fileStatesFromSnapshot, normalizeOfflineSyncChangeset, normalizeOfflineSyncSnapshot, normalizeOfflineSyncState, offlineSyncStateFromSnapshot, readOfflineSyncState, summarizeOfflineSyncChangeset, writeOfflineSyncState };
|
package/dist/offline-sync.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
applyOfflineSyncSnapshot,
|
|
7
7
|
buildOfflineSyncChangeset,
|
|
8
8
|
buildOfflineSyncSnapshot,
|
|
9
|
+
buildOfflineSyncSnapshotForPaths,
|
|
9
10
|
defaultOfflineSyncStatePath,
|
|
10
11
|
fileStatesFromSnapshot,
|
|
11
12
|
normalizeOfflineSyncChangeset,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
readOfflineSyncState,
|
|
16
17
|
summarizeOfflineSyncChangeset,
|
|
17
18
|
writeOfflineSyncState
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2OZ6GP27.js";
|
|
19
20
|
import "./chunk-P7FMDTKL.js";
|
|
20
21
|
import "./chunk-I6K5FBRQ.js";
|
|
21
22
|
import "./chunk-AGZQD76C.js";
|
|
@@ -28,6 +29,7 @@ export {
|
|
|
28
29
|
applyOfflineSyncSnapshot,
|
|
29
30
|
buildOfflineSyncChangeset,
|
|
30
31
|
buildOfflineSyncSnapshot,
|
|
32
|
+
buildOfflineSyncSnapshotForPaths,
|
|
31
33
|
defaultOfflineSyncStatePath,
|
|
32
34
|
fileStatesFromSnapshot,
|
|
33
35
|
normalizeOfflineSyncChangeset,
|
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
|
-
title: string;
|
|
221
220
|
key: string;
|
|
221
|
+
title: string;
|
|
222
222
|
facts: string[];
|
|
223
223
|
}, {
|
|
224
|
-
title: string;
|
|
225
224
|
key: string;
|
|
225
|
+
title: 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
|
-
title: string;
|
|
234
233
|
key: string;
|
|
234
|
+
title: 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
|
-
title: string;
|
|
244
243
|
key: string;
|
|
244
|
+
title: 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
|
-
title: string;
|
|
472
471
|
key: string;
|
|
472
|
+
title: string;
|
|
473
473
|
facts: string[];
|
|
474
474
|
}, {
|
|
475
|
-
title: string;
|
|
476
475
|
key: string;
|
|
476
|
+
title: 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
|
-
title: string;
|
|
485
484
|
key: string;
|
|
485
|
+
title: 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
|
-
title: string;
|
|
495
494
|
key: string;
|
|
495
|
+
title: 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
|
-
title: string;
|
|
553
552
|
key: string;
|
|
553
|
+
title: 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
|
-
title: string;
|
|
602
601
|
key: string;
|
|
602
|
+
title: 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
|
-
title: string;
|
|
782
781
|
key: string;
|
|
782
|
+
title: string;
|
|
783
783
|
facts: string[];
|
|
784
784
|
}, {
|
|
785
|
-
title: string;
|
|
786
785
|
key: string;
|
|
786
|
+
title: 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
|
-
title: string;
|
|
795
794
|
key: string;
|
|
795
|
+
title: 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
|
-
title: string;
|
|
805
804
|
key: string;
|
|
805
|
+
title: 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
|
-
title: string;
|
|
877
876
|
key: string;
|
|
877
|
+
title: 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
|
-
title: string;
|
|
932
931
|
key: string;
|
|
932
|
+
title: 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
|
-
title: string;
|
|
1002
1001
|
key: string;
|
|
1002
|
+
title: string;
|
|
1003
1003
|
facts: string[];
|
|
1004
1004
|
}, {
|
|
1005
|
-
title: string;
|
|
1006
1005
|
key: string;
|
|
1006
|
+
title: 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
|
-
title: string;
|
|
1015
1014
|
key: string;
|
|
1015
|
+
title: 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
|
-
title: string;
|
|
1025
1024
|
key: string;
|
|
1025
|
+
title: 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
|
-
title: string;
|
|
1045
1044
|
key: string;
|
|
1045
|
+
title: 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
|
-
title: string;
|
|
1065
1064
|
key: string;
|
|
1065
|
+
title: 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;
|
|
317
316
|
includes: {
|
|
318
317
|
procedural: boolean;
|
|
319
318
|
taxonomy: boolean;
|
|
320
319
|
identityAnchors: boolean;
|
|
321
320
|
peerProfiles: boolean;
|
|
322
321
|
};
|
|
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;
|
|
338
337
|
includes: {
|
|
339
338
|
procedural: boolean;
|
|
340
339
|
taxonomy: boolean;
|
|
341
340
|
identityAnchors: boolean;
|
|
342
341
|
peerProfiles: boolean;
|
|
343
342
|
};
|
|
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;
|
|
468
467
|
includes: {
|
|
469
468
|
procedural: boolean;
|
|
470
469
|
taxonomy: boolean;
|
|
471
470
|
identityAnchors: boolean;
|
|
472
471
|
peerProfiles: boolean;
|
|
473
472
|
};
|
|
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;
|
|
489
488
|
includes: {
|
|
490
489
|
procedural: boolean;
|
|
491
490
|
taxonomy: boolean;
|
|
492
491
|
identityAnchors: boolean;
|
|
493
492
|
peerProfiles: boolean;
|
|
494
493
|
};
|
|
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;
|
|
522
521
|
includes: {
|
|
523
522
|
procedural: boolean;
|
|
524
523
|
taxonomy: boolean;
|
|
525
524
|
identityAnchors: boolean;
|
|
526
525
|
peerProfiles: boolean;
|
|
527
526
|
};
|
|
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;
|
|
555
554
|
includes: {
|
|
556
555
|
procedural: boolean;
|
|
557
556
|
taxonomy: boolean;
|
|
558
557
|
identityAnchors: boolean;
|
|
559
558
|
peerProfiles: boolean;
|
|
560
559
|
};
|
|
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;
|
|
687
686
|
includes: {
|
|
688
687
|
procedural: boolean;
|
|
689
688
|
taxonomy: boolean;
|
|
690
689
|
identityAnchors: boolean;
|
|
691
690
|
peerProfiles: boolean;
|
|
692
691
|
};
|
|
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;
|
|
708
707
|
includes: {
|
|
709
708
|
procedural: boolean;
|
|
710
709
|
taxonomy: boolean;
|
|
711
710
|
identityAnchors: boolean;
|
|
712
711
|
peerProfiles: boolean;
|
|
713
712
|
};
|
|
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;
|
|
741
740
|
includes: {
|
|
742
741
|
procedural: boolean;
|
|
743
742
|
taxonomy: boolean;
|
|
744
743
|
identityAnchors: boolean;
|
|
745
744
|
peerProfiles: boolean;
|
|
746
745
|
};
|
|
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;
|
|
774
773
|
includes: {
|
|
775
774
|
procedural: boolean;
|
|
776
775
|
taxonomy: boolean;
|
|
777
776
|
identityAnchors: boolean;
|
|
778
777
|
peerProfiles: boolean;
|
|
779
778
|
};
|
|
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;
|
|
819
818
|
includes: {
|
|
820
819
|
procedural: boolean;
|
|
821
820
|
taxonomy: boolean;
|
|
822
821
|
identityAnchors: boolean;
|
|
823
822
|
peerProfiles: boolean;
|
|
824
823
|
};
|
|
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;
|
|
858
857
|
includes: {
|
|
859
858
|
procedural: boolean;
|
|
860
859
|
taxonomy: boolean;
|
|
861
860
|
identityAnchors: boolean;
|
|
862
861
|
peerProfiles: boolean;
|
|
863
862
|
};
|
|
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
|
@@ -286,6 +286,79 @@ test("HTTP offline snapshot forwards namespace and transfer options", async () =
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
|
|
289
|
+
test("HTTP offline files forwards namespace and requested paths", async () => {
|
|
290
|
+
const calls: Array<{
|
|
291
|
+
namespace: string | undefined;
|
|
292
|
+
principal: string | undefined;
|
|
293
|
+
includeTranscripts: boolean | undefined;
|
|
294
|
+
paths: string[];
|
|
295
|
+
}> = [];
|
|
296
|
+
const service = {
|
|
297
|
+
offlineSyncFiles: async (options: {
|
|
298
|
+
namespace?: string;
|
|
299
|
+
principal?: string;
|
|
300
|
+
includeTranscripts?: boolean;
|
|
301
|
+
paths: string[];
|
|
302
|
+
}) => {
|
|
303
|
+
calls.push({
|
|
304
|
+
namespace: options.namespace,
|
|
305
|
+
principal: options.principal,
|
|
306
|
+
includeTranscripts: options.includeTranscripts,
|
|
307
|
+
paths: options.paths,
|
|
308
|
+
});
|
|
309
|
+
return {
|
|
310
|
+
namespace: options.namespace ?? "default",
|
|
311
|
+
format: "remnic.offline-sync.snapshot.v1",
|
|
312
|
+
schemaVersion: 1,
|
|
313
|
+
createdAt: new Date("2026-05-21T00:00:00Z").toISOString(),
|
|
314
|
+
sourceId: "remote:test",
|
|
315
|
+
includeTranscripts: options.includeTranscripts !== false,
|
|
316
|
+
files: [],
|
|
317
|
+
};
|
|
318
|
+
},
|
|
319
|
+
} as unknown as EngramAccessService;
|
|
320
|
+
const server = new EngramAccessHttpServer({
|
|
321
|
+
service,
|
|
322
|
+
port: 0,
|
|
323
|
+
authToken: "test-token",
|
|
324
|
+
principal: "reader",
|
|
325
|
+
adminConsoleEnabled: false,
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
const status = await server.start();
|
|
329
|
+
try {
|
|
330
|
+
const response = await fetch(
|
|
331
|
+
`http://127.0.0.1:${status.port}/remnic/v1/offline-sync/files`,
|
|
332
|
+
{
|
|
333
|
+
method: "POST",
|
|
334
|
+
headers: {
|
|
335
|
+
authorization: "Bearer test-token",
|
|
336
|
+
"content-type": "application/json",
|
|
337
|
+
},
|
|
338
|
+
body: JSON.stringify({
|
|
339
|
+
namespace: "team",
|
|
340
|
+
includeTranscripts: false,
|
|
341
|
+
paths: ["facts/a.md"],
|
|
342
|
+
}),
|
|
343
|
+
},
|
|
344
|
+
);
|
|
345
|
+
const body = await response.json() as { namespace?: string; includeTranscripts?: boolean; files?: unknown[] };
|
|
346
|
+
|
|
347
|
+
assert.equal(response.status, 200);
|
|
348
|
+
assert.equal(body.namespace, "team");
|
|
349
|
+
assert.equal(body.includeTranscripts, false);
|
|
350
|
+
assert.deepEqual(body.files, []);
|
|
351
|
+
assert.deepEqual(calls, [{
|
|
352
|
+
namespace: "team",
|
|
353
|
+
principal: "reader",
|
|
354
|
+
includeTranscripts: false,
|
|
355
|
+
paths: ["facts/a.md"],
|
|
356
|
+
}]);
|
|
357
|
+
} finally {
|
|
358
|
+
await server.stop();
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
|
|
289
362
|
test("HTTP offline snapshot rejects invalid boolean query values", async () => {
|
|
290
363
|
let calls = 0;
|
|
291
364
|
const service = {
|
package/src/access-http.ts
CHANGED
|
@@ -626,6 +626,21 @@ export class EngramAccessHttpServer {
|
|
|
626
626
|
return;
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
+
if (
|
|
630
|
+
req.method === "POST" &&
|
|
631
|
+
(pathname === "/engram/v1/offline-sync/files" || pathname === "/remnic/v1/offline-sync/files")
|
|
632
|
+
) {
|
|
633
|
+
const body = await this.readValidatedBody(req, "offlineSyncFiles");
|
|
634
|
+
const result = await this.service.offlineSyncFiles({
|
|
635
|
+
namespace: this.resolveNamespace(req, body.namespace),
|
|
636
|
+
principal: this.resolveRequestPrincipal(req),
|
|
637
|
+
includeTranscripts: body.includeTranscripts,
|
|
638
|
+
paths: body.paths,
|
|
639
|
+
});
|
|
640
|
+
this.respondJson(res, 200, result);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
|
|
629
644
|
if (
|
|
630
645
|
req.method === "POST" &&
|
|
631
646
|
(pathname === "/engram/v1/offline-sync/apply" || pathname === "/remnic/v1/offline-sync/apply")
|
package/src/access-schema.ts
CHANGED
|
@@ -378,6 +378,14 @@ export const offlineSyncApplyRequestSchema = z
|
|
|
378
378
|
path: ["changeset"],
|
|
379
379
|
});
|
|
380
380
|
|
|
381
|
+
export const offlineSyncFilesRequestSchema = z.object({
|
|
382
|
+
namespace: namespaceSchema,
|
|
383
|
+
includeTranscripts: z.boolean().optional(),
|
|
384
|
+
paths: z
|
|
385
|
+
.array(z.string().trim().min(1, "path must be non-empty").max(4096))
|
|
386
|
+
.max(5000, "paths must contain 5000 or fewer entries"),
|
|
387
|
+
});
|
|
388
|
+
|
|
381
389
|
// ---------------------------------------------------------------------------
|
|
382
390
|
// Action confidence
|
|
383
391
|
// ---------------------------------------------------------------------------
|
|
@@ -444,6 +452,7 @@ export type CapsuleExportRequest = z.infer<typeof capsuleExportRequestSchema>;
|
|
|
444
452
|
export type CapsuleImportRequest = z.infer<typeof capsuleImportRequestSchema>;
|
|
445
453
|
export type CapsuleListRequest = z.infer<typeof capsuleListRequestSchema>;
|
|
446
454
|
export type OfflineSyncApplyRequest = z.infer<typeof offlineSyncApplyRequestSchema>;
|
|
455
|
+
export type OfflineSyncFilesRequest = z.infer<typeof offlineSyncFilesRequestSchema>;
|
|
447
456
|
export type ActionConfidenceRequest = z.infer<typeof actionConfidenceRequestSchema>;
|
|
448
457
|
|
|
449
458
|
// ---------------------------------------------------------------------------
|
|
@@ -467,6 +476,7 @@ export type SchemaName =
|
|
|
467
476
|
| "capsuleExport"
|
|
468
477
|
| "capsuleImport"
|
|
469
478
|
| "capsuleList"
|
|
479
|
+
| "offlineSyncFiles"
|
|
470
480
|
| "offlineSyncApply"
|
|
471
481
|
| "actionConfidence";
|
|
472
482
|
|
|
@@ -487,6 +497,7 @@ export type SchemaTypeFor<N extends SchemaName> =
|
|
|
487
497
|
: N extends "capsuleExport" ? CapsuleExportRequest
|
|
488
498
|
: N extends "capsuleImport" ? CapsuleImportRequest
|
|
489
499
|
: N extends "capsuleList" ? CapsuleListRequest
|
|
500
|
+
: N extends "offlineSyncFiles" ? OfflineSyncFilesRequest
|
|
490
501
|
: N extends "offlineSyncApply" ? OfflineSyncApplyRequest
|
|
491
502
|
: N extends "actionConfidence" ? ActionConfidenceRequest
|
|
492
503
|
: never;
|
|
@@ -508,6 +519,7 @@ const schemas: Record<SchemaName, z.ZodTypeAny> = {
|
|
|
508
519
|
capsuleExport: capsuleExportRequestSchema,
|
|
509
520
|
capsuleImport: capsuleImportRequestSchema,
|
|
510
521
|
capsuleList: capsuleListRequestSchema,
|
|
522
|
+
offlineSyncFiles: offlineSyncFilesRequestSchema,
|
|
511
523
|
offlineSyncApply: offlineSyncApplyRequestSchema,
|
|
512
524
|
actionConfidence: actionConfidenceRequestSchema,
|
|
513
525
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdtemp, rm, symlink } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
2
5
|
import test from "node:test";
|
|
3
6
|
|
|
4
|
-
import { EngramAccessService } from "./access-service.js";
|
|
7
|
+
import { EngramAccessInputError, EngramAccessService } from "./access-service.js";
|
|
5
8
|
import type { StorageManager } from "./storage.js";
|
|
6
9
|
import type { PluginConfig } from "./types.js";
|
|
7
10
|
|
|
@@ -121,3 +124,63 @@ test("memoryBrowse resolves namespace storage for read principals", async () =>
|
|
|
121
124
|
assert.equal(result.count, 0);
|
|
122
125
|
assert.deepEqual(getStorageCalls, ["team"]);
|
|
123
126
|
});
|
|
127
|
+
|
|
128
|
+
test("offlineSyncFiles reports invalid requested paths as input errors", async () => {
|
|
129
|
+
const { service } = makeService();
|
|
130
|
+
(service as unknown as {
|
|
131
|
+
orchestrator: {
|
|
132
|
+
config: PluginConfig;
|
|
133
|
+
getStorage(namespace: string): Promise<StorageManager>;
|
|
134
|
+
};
|
|
135
|
+
}).orchestrator.getStorage = async () => ({
|
|
136
|
+
dir: os.tmpdir(),
|
|
137
|
+
async readOfflineSyncFile() {
|
|
138
|
+
throw new Error("should not read invalid paths");
|
|
139
|
+
},
|
|
140
|
+
} as unknown as StorageManager);
|
|
141
|
+
|
|
142
|
+
await assert.rejects(
|
|
143
|
+
() =>
|
|
144
|
+
service.offlineSyncFiles({
|
|
145
|
+
namespace: "team",
|
|
146
|
+
principal: "reader",
|
|
147
|
+
paths: ["../escape"],
|
|
148
|
+
}),
|
|
149
|
+
(error: unknown) =>
|
|
150
|
+
error instanceof EngramAccessInputError &&
|
|
151
|
+
/paths\[\]: record path contains unsafe segments/.test(error.message),
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
test("offlineSyncFiles reports symlink requested paths as input errors", async () => {
|
|
156
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-offline-files-symlink-"));
|
|
157
|
+
try {
|
|
158
|
+
await symlink("/tmp", path.join(root, "linked"));
|
|
159
|
+
const { service } = makeService();
|
|
160
|
+
(service as unknown as {
|
|
161
|
+
orchestrator: {
|
|
162
|
+
config: PluginConfig;
|
|
163
|
+
getStorage(namespace: string): Promise<StorageManager>;
|
|
164
|
+
};
|
|
165
|
+
}).orchestrator.getStorage = async () => ({
|
|
166
|
+
dir: root,
|
|
167
|
+
async readOfflineSyncFile() {
|
|
168
|
+
throw new Error("should not read symlink paths");
|
|
169
|
+
},
|
|
170
|
+
} as unknown as StorageManager);
|
|
171
|
+
|
|
172
|
+
await assert.rejects(
|
|
173
|
+
() =>
|
|
174
|
+
service.offlineSyncFiles({
|
|
175
|
+
namespace: "team",
|
|
176
|
+
principal: "reader",
|
|
177
|
+
paths: ["linked"],
|
|
178
|
+
}),
|
|
179
|
+
(error: unknown) =>
|
|
180
|
+
error instanceof EngramAccessInputError &&
|
|
181
|
+
/buildOfflineSyncSnapshotForPaths: record path targets a symlink/.test(error.message),
|
|
182
|
+
);
|
|
183
|
+
} finally {
|
|
184
|
+
await rm(root, { recursive: true, force: true });
|
|
185
|
+
}
|
|
186
|
+
});
|