@remnic/cli 9.66.2 → 9.66.3
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/index.js +93 -2
- package/package.json +32 -32
package/dist/index.js
CHANGED
|
@@ -777,10 +777,98 @@ async function runActivityPrivacyBinaryCommand(rest) {
|
|
|
777
777
|
if (code !== 0) process.exitCode = code;
|
|
778
778
|
}
|
|
779
779
|
|
|
780
|
+
// src/commands/activity-export.ts
|
|
781
|
+
import { observationsForExport, parseActivityPrivacy, parseFlexibleIsoTimestamp as parseFlexibleIsoTimestamp2 } from "@remnic/core";
|
|
782
|
+
var defaultIo3 = {
|
|
783
|
+
stdout: (line) => {
|
|
784
|
+
process.stdout.write(`${line}
|
|
785
|
+
`);
|
|
786
|
+
},
|
|
787
|
+
stderr: (line) => {
|
|
788
|
+
process.stderr.write(`${line}
|
|
789
|
+
`);
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
function activityExportHelp() {
|
|
793
|
+
return `Usage: remnic activity-export --from <iso> [--to <iso>] [--format json] [--enabled <true|false>]
|
|
794
|
+
|
|
795
|
+
Print a JSON array of {id, capturedAt} in the half-open [from, to) window.
|
|
796
|
+
`;
|
|
797
|
+
}
|
|
798
|
+
function parseEnabled2(rest, io) {
|
|
799
|
+
const raw = resolveFlag(rest, "--enabled");
|
|
800
|
+
if (raw === void 0) {
|
|
801
|
+
if (hasFlag(rest, "--enabled")) {
|
|
802
|
+
io.stderr("activity-export: --enabled requires true or false");
|
|
803
|
+
return void 0;
|
|
804
|
+
}
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
if (raw === "true") return true;
|
|
808
|
+
if (raw === "false") return false;
|
|
809
|
+
io.stderr("activity-export: --enabled must be true or false");
|
|
810
|
+
return void 0;
|
|
811
|
+
}
|
|
812
|
+
function runActivityExportCommand(rest, io = defaultIo3, items = [], nowMs = Date.now()) {
|
|
813
|
+
if (rest.length === 0 || rest[0] === "--help" || rest[0] === "-h" || rest[0] === "help") {
|
|
814
|
+
io.stdout(activityExportHelp().trimEnd());
|
|
815
|
+
return 0;
|
|
816
|
+
}
|
|
817
|
+
const fromRaw = resolveFlag(rest, "--from");
|
|
818
|
+
if (fromRaw === void 0) {
|
|
819
|
+
io.stderr("activity-export: --from <iso> is required");
|
|
820
|
+
return 1;
|
|
821
|
+
}
|
|
822
|
+
const fromMs = parseFlexibleIsoTimestamp2(fromRaw);
|
|
823
|
+
if (fromMs === null) {
|
|
824
|
+
io.stderr("activity-export: --from must be an ISO timestamp");
|
|
825
|
+
return 1;
|
|
826
|
+
}
|
|
827
|
+
const toRaw = resolveFlag(rest, "--to");
|
|
828
|
+
let toMs;
|
|
829
|
+
if (toRaw === void 0) {
|
|
830
|
+
if (hasFlag(rest, "--to")) {
|
|
831
|
+
io.stderr("activity-export: --to requires an ISO timestamp");
|
|
832
|
+
return 1;
|
|
833
|
+
}
|
|
834
|
+
toMs = nowMs;
|
|
835
|
+
} else {
|
|
836
|
+
const parsed = parseFlexibleIsoTimestamp2(toRaw);
|
|
837
|
+
if (parsed === null) {
|
|
838
|
+
io.stderr("activity-export: --to must be an ISO timestamp");
|
|
839
|
+
return 1;
|
|
840
|
+
}
|
|
841
|
+
toMs = parsed;
|
|
842
|
+
}
|
|
843
|
+
const format = resolveFlag(rest, "--format");
|
|
844
|
+
if (format === void 0) {
|
|
845
|
+
if (hasFlag(rest, "--format")) {
|
|
846
|
+
io.stderr("activity-export: --format requires json");
|
|
847
|
+
return 1;
|
|
848
|
+
}
|
|
849
|
+
} else if (format !== "json") {
|
|
850
|
+
io.stderr("activity-export: --format must be json");
|
|
851
|
+
return 1;
|
|
852
|
+
}
|
|
853
|
+
const enabled = parseEnabled2(rest, io);
|
|
854
|
+
if (enabled === void 0) return 1;
|
|
855
|
+
const policy = parseActivityPrivacy({ enabled, exportIncludeObservations: true });
|
|
856
|
+
const exported = observationsForExport(items, policy).filter((item) => {
|
|
857
|
+
const at = parseFlexibleIsoTimestamp2(item.capturedAt);
|
|
858
|
+
return at !== null && at >= fromMs && at < toMs;
|
|
859
|
+
}).map((item) => ({ id: item.id, capturedAt: item.capturedAt }));
|
|
860
|
+
io.stdout(JSON.stringify(exported));
|
|
861
|
+
return 0;
|
|
862
|
+
}
|
|
863
|
+
async function runActivityExportBinaryCommand(rest) {
|
|
864
|
+
const code = runActivityExportCommand(rest);
|
|
865
|
+
if (code !== 0) process.exitCode = code;
|
|
866
|
+
}
|
|
867
|
+
|
|
780
868
|
// src/commands/vault-publish.ts
|
|
781
869
|
import fs11 from "fs";
|
|
782
870
|
import { applyManagedRegion } from "@remnic/core";
|
|
783
|
-
var
|
|
871
|
+
var defaultIo4 = {
|
|
784
872
|
stdout: (line) => {
|
|
785
873
|
process.stdout.write(`${line}
|
|
786
874
|
`);
|
|
@@ -796,7 +884,7 @@ function vaultPublishHelp() {
|
|
|
796
884
|
apply Replace the marked region. Missing markers print no_marker.
|
|
797
885
|
`;
|
|
798
886
|
}
|
|
799
|
-
function runVaultPublishCommand(rest, io =
|
|
887
|
+
function runVaultPublishCommand(rest, io = defaultIo4) {
|
|
800
888
|
if (rest.length === 0 || rest[0] === "--help" || rest[0] === "-h" || rest[0] === "help") {
|
|
801
889
|
io.stdout(vaultPublishHelp().trimEnd());
|
|
802
890
|
return 0;
|
|
@@ -17393,6 +17481,9 @@ Other:
|
|
|
17393
17481
|
case "activity-privacy":
|
|
17394
17482
|
await runActivityPrivacyBinaryCommand(rest);
|
|
17395
17483
|
break;
|
|
17484
|
+
case "activity-export":
|
|
17485
|
+
await runActivityExportBinaryCommand(rest);
|
|
17486
|
+
break;
|
|
17396
17487
|
case "vault-publish":
|
|
17397
17488
|
await runVaultPublishBinaryCommand(rest);
|
|
17398
17489
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/cli",
|
|
3
|
-
"version": "9.66.
|
|
3
|
+
"version": "9.66.3",
|
|
4
4
|
"description": "CLI for Remnic memory — init, query, doctor, daemon management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,26 +26,26 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"yaml": "^2.4.2",
|
|
29
|
-
"@remnic/plugin-pi": "^9.66.
|
|
30
|
-
"@remnic/
|
|
31
|
-
"@remnic/
|
|
29
|
+
"@remnic/plugin-pi": "^9.66.3",
|
|
30
|
+
"@remnic/server": "^9.66.3",
|
|
31
|
+
"@remnic/core": "^9.66.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@remnic/bench": "^9.66.
|
|
35
|
-
"@remnic/plugin-openclaw": "^9.66.
|
|
36
|
-
"@remnic/export-weclone": "^9.66.
|
|
37
|
-
"@remnic/import-weclone": "^9.66.
|
|
38
|
-
"@remnic/import-chatgpt": "^9.66.
|
|
39
|
-
"@remnic/import-claude": "^9.66.
|
|
40
|
-
"@remnic/import-gemini": "^9.66.
|
|
41
|
-
"@remnic/import-lossless-claw": "^9.66.
|
|
42
|
-
"@remnic/import-mem0": "^9.66.
|
|
43
|
-
"@remnic/import-supermemory": "^9.66.
|
|
44
|
-
"@remnic/import-okf": "^9.66.
|
|
45
|
-
"@remnic/connector-limitless": "^9.66.
|
|
46
|
-
"@remnic/connector-bee": "^9.66.
|
|
47
|
-
"@remnic/connector-omi": "^9.66.
|
|
48
|
-
"@remnic/capture-audio": "^9.66.
|
|
34
|
+
"@remnic/bench": "^9.66.3",
|
|
35
|
+
"@remnic/plugin-openclaw": "^9.66.3",
|
|
36
|
+
"@remnic/export-weclone": "^9.66.3",
|
|
37
|
+
"@remnic/import-weclone": "^9.66.3",
|
|
38
|
+
"@remnic/import-chatgpt": "^9.66.3",
|
|
39
|
+
"@remnic/import-claude": "^9.66.3",
|
|
40
|
+
"@remnic/import-gemini": "^9.66.3",
|
|
41
|
+
"@remnic/import-lossless-claw": "^9.66.3",
|
|
42
|
+
"@remnic/import-mem0": "^9.66.3",
|
|
43
|
+
"@remnic/import-supermemory": "^9.66.3",
|
|
44
|
+
"@remnic/import-okf": "^9.66.3",
|
|
45
|
+
"@remnic/connector-limitless": "^9.66.3",
|
|
46
|
+
"@remnic/connector-bee": "^9.66.3",
|
|
47
|
+
"@remnic/connector-omi": "^9.66.3",
|
|
48
|
+
"@remnic/capture-audio": "^9.66.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@remnic/bench": {
|
|
@@ -97,19 +97,19 @@
|
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"tsup": "^8.5.1",
|
|
99
99
|
"typescript": "^5.9.3",
|
|
100
|
-
"@remnic/bench": "9.66.
|
|
101
|
-
"@remnic/plugin-openclaw": "9.66.
|
|
102
|
-
"@remnic/export-weclone": "9.66.
|
|
103
|
-
"@remnic/import-
|
|
104
|
-
"@remnic/import-chatgpt": "9.66.
|
|
105
|
-
"@remnic/import-
|
|
106
|
-
"@remnic/import-
|
|
107
|
-
"@remnic/import-
|
|
108
|
-
"@remnic/
|
|
109
|
-
"@remnic/
|
|
110
|
-
"@remnic/
|
|
111
|
-
"@remnic/connector-
|
|
112
|
-
"@remnic/
|
|
100
|
+
"@remnic/bench": "9.66.3",
|
|
101
|
+
"@remnic/plugin-openclaw": "9.66.3",
|
|
102
|
+
"@remnic/export-weclone": "9.66.3",
|
|
103
|
+
"@remnic/import-weclone": "9.66.3",
|
|
104
|
+
"@remnic/import-chatgpt": "9.66.3",
|
|
105
|
+
"@remnic/import-gemini": "9.66.3",
|
|
106
|
+
"@remnic/import-claude": "9.66.3",
|
|
107
|
+
"@remnic/import-lossless-claw": "9.66.3",
|
|
108
|
+
"@remnic/connector-limitless": "9.66.3",
|
|
109
|
+
"@remnic/import-supermemory": "9.66.3",
|
|
110
|
+
"@remnic/import-mem0": "9.66.3",
|
|
111
|
+
"@remnic/connector-bee": "9.66.3",
|
|
112
|
+
"@remnic/connector-omi": "9.66.3"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
115
|
"repository": {
|