@remnic/cli 10.0.84 → 10.0.85

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.
Files changed (2) hide show
  1. package/dist/index.js +43 -25
  2. package/package.json +32 -32
package/dist/index.js CHANGED
@@ -500,7 +500,7 @@ import {
500
500
  resolveRemnicConfigRecord as resolveRemnicConfigRecord16,
501
501
  Orchestrator as Orchestrator11,
502
502
  EngramAccessService as EngramAccessService2,
503
- initLogger as initLogger5,
503
+ initLogger as initLogger6,
504
504
  onboard,
505
505
  curate,
506
506
  listReviewItems,
@@ -840,6 +840,22 @@ async function runLocationBinaryCommand(rest) {
840
840
  }
841
841
  }
842
842
 
843
+ // src/cli-logger.ts
844
+ import { initLogger } from "@remnic/core";
845
+ var STDERR_LOGGER = {
846
+ info: (msg, ...args) => console.error(msg, ...args),
847
+ warn: (msg, ...args) => console.error(msg, ...args),
848
+ error: (msg, ...args) => console.error(msg, ...args),
849
+ debug: (msg, ...args) => console.error(msg, ...args)
850
+ };
851
+ function initCliLogger(jsonMode = false) {
852
+ if (jsonMode) {
853
+ initLogger(STDERR_LOGGER);
854
+ return;
855
+ }
856
+ initLogger();
857
+ }
858
+
843
859
  // src/commands/okf.ts
844
860
  import fs6 from "fs";
845
861
  import { Orchestrator as Orchestrator3, parseConfig as parseConfig5, resolveRemnicConfigRecord as resolveRemnicConfigRecord5, runOkfCliCommand } from "@remnic/core";
@@ -1951,13 +1967,13 @@ import {
1951
1967
  StorageManager as StorageManager2,
1952
1968
  computeProcedureStats,
1953
1969
  formatProcedureStatsText,
1954
- initLogger,
1970
+ initLogger as initLogger2,
1955
1971
  parseConfig as parseConfig11,
1956
1972
  resolveRemnicConfigRecord as resolveRemnicConfigRecord11,
1957
1973
  runProcedureLibraryMaintenance
1958
1974
  } from "@remnic/core";
1959
1975
  async function runProceduralBinaryCommand(rest) {
1960
- initLogger();
1976
+ initLogger2();
1961
1977
  const subcommand = rest[0];
1962
1978
  if (!subcommand || subcommand === "--help" || subcommand === "-h") {
1963
1979
  console.log(`remnic procedural \u2014 Procedural memory operations (issue #567)
@@ -2067,13 +2083,13 @@ function formatProcedureMaintenanceText(report) {
2067
2083
  import fs15 from "fs";
2068
2084
  import {
2069
2085
  Orchestrator as Orchestrator8,
2070
- initLogger as initLogger2,
2086
+ initLogger as initLogger3,
2071
2087
  parseConfig as parseConfig12,
2072
2088
  resolveRemnicConfigRecord as resolveRemnicConfigRecord12,
2073
2089
  runPreferenceDriftScan
2074
2090
  } from "@remnic/core";
2075
2091
  async function runDriftBinaryCommand(rest) {
2076
- initLogger2();
2092
+ initLogger3();
2077
2093
  const subcommand = rest[0];
2078
2094
  if (!subcommand || subcommand === "--help" || subcommand === "-h") {
2079
2095
  console.log(`remnic drift \u2014 Preference drift detection (issue #2371)
@@ -5664,7 +5680,7 @@ function renderReplayResult(result, targetNamespace, format) {
5664
5680
 
5665
5681
  // src/quarantine-replay.ts
5666
5682
  import * as fs22 from "fs";
5667
- import { EngramAccessService, Orchestrator as Orchestrator9, initLogger as initLogger3, parseConfig as parseConfig14, resolveRemnicConfigRecord as resolveRemnicConfigRecord13 } from "@remnic/core";
5683
+ import { EngramAccessService, Orchestrator as Orchestrator9, initLogger as initLogger4, parseConfig as parseConfig14, resolveRemnicConfigRecord as resolveRemnicConfigRecord13 } from "@remnic/core";
5668
5684
  import { WriteQuarantineStore } from "@remnic/core/write-quarantine.js";
5669
5685
  function valueFlag(args, flag) {
5670
5686
  const occurrences = args.filter((a) => a === flag).length;
@@ -5708,7 +5724,7 @@ async function runQuarantineReplay(rest, format, resolveConfigPath2) {
5708
5724
  process.exitCode = 2;
5709
5725
  return;
5710
5726
  }
5711
- initLogger3();
5727
+ initLogger4();
5712
5728
  let orchestrator;
5713
5729
  try {
5714
5730
  const configPath = resolveConfigPath2();
@@ -6195,7 +6211,7 @@ import fs24 from "fs";
6195
6211
  import {
6196
6212
  Orchestrator as Orchestrator10,
6197
6213
  parseConfig as parseConfig16,
6198
- initLogger as initLogger4,
6214
+ initLogger as initLogger5,
6199
6215
  resolveRemnicConfigRecord as resolveRemnicConfigRecord15,
6200
6216
  runAuditMemoryCliCommand,
6201
6217
  formatAuditMemoryReport,
@@ -6210,7 +6226,7 @@ async function cmdSecurity(rest) {
6210
6226
  process.exitCode = 1;
6211
6227
  return;
6212
6228
  }
6213
- initLogger4();
6229
+ initLogger5();
6214
6230
  const configPath = resolveConfigPath();
6215
6231
  const raw = fs24.existsSync(configPath) ? JSON.parse(fs24.readFileSync(configPath, "utf8")) : {};
6216
6232
  const config = parseConfig16(resolveRemnicConfigRecord15(raw));
@@ -14266,7 +14282,7 @@ async function cmdQuery(queryText, json, explain) {
14266
14282
  printQueryResult(result, json);
14267
14283
  return;
14268
14284
  }
14269
- initLogger5();
14285
+ initCliLogger(json);
14270
14286
  const configPath = resolveConfigPath();
14271
14287
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14272
14288
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14446,7 +14462,7 @@ async function cmdXray(rest) {
14446
14462
  await runXrayCommand(rest, xrayCliIo((request) => remoteRecallXray(remote, request)));
14447
14463
  return;
14448
14464
  }
14449
- initLogger5();
14465
+ initLogger6();
14450
14466
  const configPath = resolveConfigPath();
14451
14467
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14452
14468
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14523,7 +14539,7 @@ async function cmdWhy(rest) {
14523
14539
  await runWhyCommand(rest, whyCliIo((request) => remoteRecallWhy(remote, request)));
14524
14540
  return;
14525
14541
  }
14526
- initLogger5();
14542
+ initLogger6();
14527
14543
  const configPath = resolveConfigPath();
14528
14544
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14529
14545
  const config = parseConfig17(resolveRemnicConfigRecord16(raw));
@@ -14554,8 +14570,8 @@ async function runWhoKnowsCommand(rest, io) {
14554
14570
  });
14555
14571
  io.stdout(renderWhoKnows(result, parsed.json));
14556
14572
  }
14557
- async function withLocalService(fn) {
14558
- initLogger5();
14573
+ async function withLocalService(fn, jsonMode = false) {
14574
+ initCliLogger(jsonMode);
14559
14575
  const configPath = resolveConfigPath();
14560
14576
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14561
14577
  const orchestrator = new Orchestrator11(parseConfig17(resolveRemnicConfigRecord16(raw)));
@@ -14571,24 +14587,24 @@ async function withLocalService(fn) {
14571
14587
  }
14572
14588
  async function cmdWhoKnows(rest) {
14573
14589
  const { topic, options } = extractWhoKnowsRawArgs(rest);
14574
- parseWhoKnowsCliOptions(topic, options);
14590
+ const parsed = parseWhoKnowsCliOptions(topic, options);
14575
14591
  if (resolveRemoteDaemon(resolveConfigPath())) {
14576
14592
  throw new Error("who-knows: remote daemon mode is not supported yet; run with a local config");
14577
14593
  }
14578
14594
  await withLocalService((service) => runWhoKnowsCommand(rest, {
14579
14595
  whoKnows: (request) => service.whoKnows(request),
14580
14596
  stdout: (line) => console.log(line)
14581
- }));
14597
+ }), parsed.json);
14582
14598
  }
14583
14599
  async function cmdPromotionCandidates(rest) {
14584
14600
  if (resolveRemoteDaemon(resolveConfigPath())) throw new Error("promotion-candidates: remote daemon mode is not supported yet; run with a local config");
14585
14601
  await withLocalService((service) => runPromotionCandidatesCommand(rest, {
14586
14602
  promotionCandidates: (request) => service.promotionCandidates(request),
14587
14603
  stdout: (line) => console.log(line)
14588
- }));
14604
+ }), rest.includes("--json"));
14589
14605
  }
14590
14606
  async function cmdVersions(rest) {
14591
- initLogger5();
14607
+ initCliLogger(rest.includes("--json"));
14592
14608
  const configPath = resolveConfigPath();
14593
14609
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14594
14610
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14704,7 +14720,7 @@ Options:
14704
14720
  }
14705
14721
  }
14706
14722
  async function cmdEnrich(rest) {
14707
- initLogger5();
14723
+ initLogger6();
14708
14724
  const configPath = resolveConfigPath();
14709
14725
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14710
14726
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14898,7 +14914,7 @@ Registered providers:`);
14898
14914
  }
14899
14915
  }
14900
14916
  async function cmdExtensions(action, rest) {
14901
- initLogger5();
14917
+ initLogger6();
14902
14918
  const configPath = resolveConfigPath();
14903
14919
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14904
14920
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14992,7 +15008,8 @@ Root: ${root}`);
14992
15008
  }
14993
15009
  }
14994
15010
  async function cmdBriefing(rest, abortSignal) {
14995
- initLogger5();
15011
+ const requestsJson = rest.includes("--json") || resolveFlag(rest, "--format") === "json";
15012
+ initCliLogger(requestsJson);
14996
15013
  const configPath = resolveConfigPath();
14997
15014
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14998
15015
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -15050,6 +15067,7 @@ async function cmdBriefing(rest, abortSignal) {
15050
15067
  process.exit(1);
15051
15068
  }
15052
15069
  const format = effectiveFormatFlag === "json" ? "json" : effectiveFormatFlag === "markdown" ? "markdown" : config.briefing.defaultFormat;
15070
+ if (format === "json" && !requestsJson) initCliLogger(true);
15053
15071
  const orchestrator = new Orchestrator11(config);
15054
15072
  await orchestrator.initialize();
15055
15073
  abortSignal.throwIfAborted();
@@ -18116,7 +18134,7 @@ async function cmdConnectors(action, rest, json) {
18116
18134
  process.exitCode = 2;
18117
18135
  return;
18118
18136
  }
18119
- initLogger5();
18137
+ initCliLogger(format === "json");
18120
18138
  const configPath = resolveConfigPath();
18121
18139
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
18122
18140
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -18472,7 +18490,7 @@ async function cmdSpace(action, rest, json) {
18472
18490
  }
18473
18491
  }
18474
18492
  async function cmdLegacyBenchmark(action, rest, json) {
18475
- initLogger5();
18493
+ initCliLogger(json);
18476
18494
  const configPath = resolveConfigPath();
18477
18495
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
18478
18496
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -19395,7 +19413,7 @@ async function promptYesNo(question, defaultYes = true) {
19395
19413
  });
19396
19414
  }
19397
19415
  async function cmdBinary(rest) {
19398
- initLogger5();
19416
+ initLogger6();
19399
19417
  const configPath = resolveConfigPath();
19400
19418
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
19401
19419
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -19880,7 +19898,7 @@ function createOpenclawUpgradeBackupDir() {
19880
19898
  return fs32.mkdtempSync(path24.join(backupsRoot, `remnic-openclaw-upgrade-${formatOpenclawUpgradeStamp()}-`));
19881
19899
  }
19882
19900
  async function cmdTaxonomy(rest) {
19883
- initLogger5();
19901
+ initCliLogger(rest.includes("--json"));
19884
19902
  const configPath = resolveConfigPath();
19885
19903
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
19886
19904
  const remnicCfg = resolveRemnicConfigRecord16(raw);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/cli",
3
- "version": "10.0.84",
3
+ "version": "10.0.85",
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": "^10.0.84",
30
- "@remnic/core": "^10.0.84",
31
- "@remnic/server": "^10.0.84"
29
+ "@remnic/plugin-pi": "^10.0.85",
30
+ "@remnic/server": "^10.0.85",
31
+ "@remnic/core": "^10.0.85"
32
32
  },
33
33
  "peerDependencies": {
34
- "@remnic/bench": "^10.0.84",
35
- "@remnic/plugin-openclaw": "^10.0.84",
36
- "@remnic/export-weclone": "^10.0.84",
37
- "@remnic/import-weclone": "^10.0.84",
38
- "@remnic/import-chatgpt": "^10.0.84",
39
- "@remnic/import-claude": "^10.0.84",
40
- "@remnic/import-gemini": "^10.0.84",
41
- "@remnic/import-lossless-claw": "^10.0.84",
42
- "@remnic/import-mem0": "^10.0.84",
43
- "@remnic/import-supermemory": "^10.0.84",
44
- "@remnic/import-okf": "^10.0.84",
45
- "@remnic/connector-limitless": "^10.0.84",
46
- "@remnic/connector-bee": "^10.0.84",
47
- "@remnic/connector-omi": "^10.0.84",
48
- "@remnic/capture-audio": "^10.0.84"
34
+ "@remnic/bench": "^10.0.85",
35
+ "@remnic/plugin-openclaw": "^10.0.85",
36
+ "@remnic/export-weclone": "^10.0.85",
37
+ "@remnic/import-weclone": "^10.0.85",
38
+ "@remnic/import-chatgpt": "^10.0.85",
39
+ "@remnic/import-claude": "^10.0.85",
40
+ "@remnic/import-gemini": "^10.0.85",
41
+ "@remnic/import-lossless-claw": "^10.0.85",
42
+ "@remnic/import-mem0": "^10.0.85",
43
+ "@remnic/import-supermemory": "^10.0.85",
44
+ "@remnic/import-okf": "^10.0.85",
45
+ "@remnic/connector-limitless": "^10.0.85",
46
+ "@remnic/connector-bee": "^10.0.85",
47
+ "@remnic/connector-omi": "^10.0.85",
48
+ "@remnic/capture-audio": "^10.0.85"
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": "10.0.84",
101
- "@remnic/plugin-openclaw": "10.0.84",
102
- "@remnic/export-weclone": "10.0.84",
103
- "@remnic/import-weclone": "10.0.84",
104
- "@remnic/import-chatgpt": "10.0.84",
105
- "@remnic/import-gemini": "10.0.84",
106
- "@remnic/import-lossless-claw": "10.0.84",
107
- "@remnic/import-mem0": "10.0.84",
108
- "@remnic/import-claude": "10.0.84",
109
- "@remnic/import-supermemory": "10.0.84",
110
- "@remnic/connector-limitless": "10.0.84",
111
- "@remnic/connector-bee": "10.0.84",
112
- "@remnic/connector-omi": "10.0.84"
100
+ "@remnic/bench": "10.0.85",
101
+ "@remnic/plugin-openclaw": "10.0.85",
102
+ "@remnic/import-weclone": "10.0.85",
103
+ "@remnic/export-weclone": "10.0.85",
104
+ "@remnic/import-chatgpt": "10.0.85",
105
+ "@remnic/import-claude": "10.0.85",
106
+ "@remnic/import-gemini": "10.0.85",
107
+ "@remnic/import-mem0": "10.0.85",
108
+ "@remnic/import-lossless-claw": "10.0.85",
109
+ "@remnic/import-supermemory": "10.0.85",
110
+ "@remnic/connector-limitless": "10.0.85",
111
+ "@remnic/connector-bee": "10.0.85",
112
+ "@remnic/connector-omi": "10.0.85"
113
113
  },
114
114
  "license": "MIT",
115
115
  "repository": {