@remnic/cli 10.0.84 → 10.0.86

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 +56 -27
  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,
@@ -531,6 +531,7 @@ import {
531
531
  rollbackFromEngramMigration,
532
532
  buildBriefing,
533
533
  withBriefingDeadline,
534
+ BriefingTimeoutError,
534
535
  parseBriefingWindow,
535
536
  parseBriefingFocus,
536
537
  validateBriefingFormat,
@@ -840,6 +841,22 @@ async function runLocationBinaryCommand(rest) {
840
841
  }
841
842
  }
842
843
 
844
+ // src/cli-logger.ts
845
+ import { initLogger } from "@remnic/core";
846
+ var STDERR_LOGGER = {
847
+ info: (msg, ...args) => console.error(msg, ...args),
848
+ warn: (msg, ...args) => console.error(msg, ...args),
849
+ error: (msg, ...args) => console.error(msg, ...args),
850
+ debug: (msg, ...args) => console.error(msg, ...args)
851
+ };
852
+ function initCliLogger(jsonMode = false) {
853
+ if (jsonMode) {
854
+ initLogger(STDERR_LOGGER);
855
+ return;
856
+ }
857
+ initLogger();
858
+ }
859
+
843
860
  // src/commands/okf.ts
844
861
  import fs6 from "fs";
845
862
  import { Orchestrator as Orchestrator3, parseConfig as parseConfig5, resolveRemnicConfigRecord as resolveRemnicConfigRecord5, runOkfCliCommand } from "@remnic/core";
@@ -1951,13 +1968,13 @@ import {
1951
1968
  StorageManager as StorageManager2,
1952
1969
  computeProcedureStats,
1953
1970
  formatProcedureStatsText,
1954
- initLogger,
1971
+ initLogger as initLogger2,
1955
1972
  parseConfig as parseConfig11,
1956
1973
  resolveRemnicConfigRecord as resolveRemnicConfigRecord11,
1957
1974
  runProcedureLibraryMaintenance
1958
1975
  } from "@remnic/core";
1959
1976
  async function runProceduralBinaryCommand(rest) {
1960
- initLogger();
1977
+ initLogger2();
1961
1978
  const subcommand = rest[0];
1962
1979
  if (!subcommand || subcommand === "--help" || subcommand === "-h") {
1963
1980
  console.log(`remnic procedural \u2014 Procedural memory operations (issue #567)
@@ -2067,13 +2084,13 @@ function formatProcedureMaintenanceText(report) {
2067
2084
  import fs15 from "fs";
2068
2085
  import {
2069
2086
  Orchestrator as Orchestrator8,
2070
- initLogger as initLogger2,
2087
+ initLogger as initLogger3,
2071
2088
  parseConfig as parseConfig12,
2072
2089
  resolveRemnicConfigRecord as resolveRemnicConfigRecord12,
2073
2090
  runPreferenceDriftScan
2074
2091
  } from "@remnic/core";
2075
2092
  async function runDriftBinaryCommand(rest) {
2076
- initLogger2();
2093
+ initLogger3();
2077
2094
  const subcommand = rest[0];
2078
2095
  if (!subcommand || subcommand === "--help" || subcommand === "-h") {
2079
2096
  console.log(`remnic drift \u2014 Preference drift detection (issue #2371)
@@ -5664,7 +5681,7 @@ function renderReplayResult(result, targetNamespace, format) {
5664
5681
 
5665
5682
  // src/quarantine-replay.ts
5666
5683
  import * as fs22 from "fs";
5667
- import { EngramAccessService, Orchestrator as Orchestrator9, initLogger as initLogger3, parseConfig as parseConfig14, resolveRemnicConfigRecord as resolveRemnicConfigRecord13 } from "@remnic/core";
5684
+ import { EngramAccessService, Orchestrator as Orchestrator9, initLogger as initLogger4, parseConfig as parseConfig14, resolveRemnicConfigRecord as resolveRemnicConfigRecord13 } from "@remnic/core";
5668
5685
  import { WriteQuarantineStore } from "@remnic/core/write-quarantine.js";
5669
5686
  function valueFlag(args, flag) {
5670
5687
  const occurrences = args.filter((a) => a === flag).length;
@@ -5708,7 +5725,7 @@ async function runQuarantineReplay(rest, format, resolveConfigPath2) {
5708
5725
  process.exitCode = 2;
5709
5726
  return;
5710
5727
  }
5711
- initLogger3();
5728
+ initLogger4();
5712
5729
  let orchestrator;
5713
5730
  try {
5714
5731
  const configPath = resolveConfigPath2();
@@ -6195,7 +6212,7 @@ import fs24 from "fs";
6195
6212
  import {
6196
6213
  Orchestrator as Orchestrator10,
6197
6214
  parseConfig as parseConfig16,
6198
- initLogger as initLogger4,
6215
+ initLogger as initLogger5,
6199
6216
  resolveRemnicConfigRecord as resolveRemnicConfigRecord15,
6200
6217
  runAuditMemoryCliCommand,
6201
6218
  formatAuditMemoryReport,
@@ -6210,7 +6227,7 @@ async function cmdSecurity(rest) {
6210
6227
  process.exitCode = 1;
6211
6228
  return;
6212
6229
  }
6213
- initLogger4();
6230
+ initLogger5();
6214
6231
  const configPath = resolveConfigPath();
6215
6232
  const raw = fs24.existsSync(configPath) ? JSON.parse(fs24.readFileSync(configPath, "utf8")) : {};
6216
6233
  const config = parseConfig16(resolveRemnicConfigRecord15(raw));
@@ -14250,7 +14267,7 @@ function buildQueryRecallRequest(queryText) {
14250
14267
  sessionKey: `remnic-cli:query:${process.pid}`
14251
14268
  };
14252
14269
  }
14253
- async function cmdQuery(queryText, json, explain) {
14270
+ async function cmdQuery(queryText, json, explain, abortSignal) {
14254
14271
  if (!queryText) {
14255
14272
  console.error("Usage: remnic query <text>");
14256
14273
  process.exit(1);
@@ -14266,13 +14283,14 @@ async function cmdQuery(queryText, json, explain) {
14266
14283
  printQueryResult(result, json);
14267
14284
  return;
14268
14285
  }
14269
- initLogger5();
14286
+ initCliLogger(json);
14270
14287
  const configPath = resolveConfigPath();
14271
14288
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14272
14289
  const remnicCfg = resolveRemnicConfigRecord16(raw);
14273
14290
  const config = parseConfig17(remnicCfg);
14274
14291
  const orchestrator = new Orchestrator11(config);
14275
14292
  await orchestrator.initialize();
14293
+ abortSignal?.throwIfAborted();
14276
14294
  const service = new EngramAccessService2(orchestrator);
14277
14295
  const recallRequest = buildQueryRecallRequest(queryText);
14278
14296
  try {
@@ -14446,7 +14464,7 @@ async function cmdXray(rest) {
14446
14464
  await runXrayCommand(rest, xrayCliIo((request) => remoteRecallXray(remote, request)));
14447
14465
  return;
14448
14466
  }
14449
- initLogger5();
14467
+ initLogger6();
14450
14468
  const configPath = resolveConfigPath();
14451
14469
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14452
14470
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14523,7 +14541,7 @@ async function cmdWhy(rest) {
14523
14541
  await runWhyCommand(rest, whyCliIo((request) => remoteRecallWhy(remote, request)));
14524
14542
  return;
14525
14543
  }
14526
- initLogger5();
14544
+ initLogger6();
14527
14545
  const configPath = resolveConfigPath();
14528
14546
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14529
14547
  const config = parseConfig17(resolveRemnicConfigRecord16(raw));
@@ -14554,8 +14572,8 @@ async function runWhoKnowsCommand(rest, io) {
14554
14572
  });
14555
14573
  io.stdout(renderWhoKnows(result, parsed.json));
14556
14574
  }
14557
- async function withLocalService(fn) {
14558
- initLogger5();
14575
+ async function withLocalService(fn, jsonMode = false) {
14576
+ initCliLogger(jsonMode);
14559
14577
  const configPath = resolveConfigPath();
14560
14578
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14561
14579
  const orchestrator = new Orchestrator11(parseConfig17(resolveRemnicConfigRecord16(raw)));
@@ -14571,24 +14589,24 @@ async function withLocalService(fn) {
14571
14589
  }
14572
14590
  async function cmdWhoKnows(rest) {
14573
14591
  const { topic, options } = extractWhoKnowsRawArgs(rest);
14574
- parseWhoKnowsCliOptions(topic, options);
14592
+ const parsed = parseWhoKnowsCliOptions(topic, options);
14575
14593
  if (resolveRemoteDaemon(resolveConfigPath())) {
14576
14594
  throw new Error("who-knows: remote daemon mode is not supported yet; run with a local config");
14577
14595
  }
14578
14596
  await withLocalService((service) => runWhoKnowsCommand(rest, {
14579
14597
  whoKnows: (request) => service.whoKnows(request),
14580
14598
  stdout: (line) => console.log(line)
14581
- }));
14599
+ }), parsed.json);
14582
14600
  }
14583
14601
  async function cmdPromotionCandidates(rest) {
14584
14602
  if (resolveRemoteDaemon(resolveConfigPath())) throw new Error("promotion-candidates: remote daemon mode is not supported yet; run with a local config");
14585
14603
  await withLocalService((service) => runPromotionCandidatesCommand(rest, {
14586
14604
  promotionCandidates: (request) => service.promotionCandidates(request),
14587
14605
  stdout: (line) => console.log(line)
14588
- }));
14606
+ }), rest.includes("--json"));
14589
14607
  }
14590
14608
  async function cmdVersions(rest) {
14591
- initLogger5();
14609
+ initCliLogger(rest.includes("--json"));
14592
14610
  const configPath = resolveConfigPath();
14593
14611
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14594
14612
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14704,7 +14722,7 @@ Options:
14704
14722
  }
14705
14723
  }
14706
14724
  async function cmdEnrich(rest) {
14707
- initLogger5();
14725
+ initLogger6();
14708
14726
  const configPath = resolveConfigPath();
14709
14727
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14710
14728
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14898,7 +14916,7 @@ Registered providers:`);
14898
14916
  }
14899
14917
  }
14900
14918
  async function cmdExtensions(action, rest) {
14901
- initLogger5();
14919
+ initLogger6();
14902
14920
  const configPath = resolveConfigPath();
14903
14921
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14904
14922
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -14992,7 +15010,8 @@ Root: ${root}`);
14992
15010
  }
14993
15011
  }
14994
15012
  async function cmdBriefing(rest, abortSignal) {
14995
- initLogger5();
15013
+ const requestsJson = rest.includes("--json") || resolveFlag(rest, "--format") === "json";
15014
+ initCliLogger(requestsJson);
14996
15015
  const configPath = resolveConfigPath();
14997
15016
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
14998
15017
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -15050,6 +15069,7 @@ async function cmdBriefing(rest, abortSignal) {
15050
15069
  process.exit(1);
15051
15070
  }
15052
15071
  const format = effectiveFormatFlag === "json" ? "json" : effectiveFormatFlag === "markdown" ? "markdown" : config.briefing.defaultFormat;
15072
+ if (format === "json" && !requestsJson) initCliLogger(true);
15053
15073
  const orchestrator = new Orchestrator11(config);
15054
15074
  await orchestrator.initialize();
15055
15075
  abortSignal.throwIfAborted();
@@ -18116,7 +18136,7 @@ async function cmdConnectors(action, rest, json) {
18116
18136
  process.exitCode = 2;
18117
18137
  return;
18118
18138
  }
18119
- initLogger5();
18139
+ initCliLogger(format === "json");
18120
18140
  const configPath = resolveConfigPath();
18121
18141
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
18122
18142
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -18472,7 +18492,7 @@ async function cmdSpace(action, rest, json) {
18472
18492
  }
18473
18493
  }
18474
18494
  async function cmdLegacyBenchmark(action, rest, json) {
18475
- initLogger5();
18495
+ initCliLogger(json);
18476
18496
  const configPath = resolveConfigPath();
18477
18497
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
18478
18498
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -19395,7 +19415,7 @@ async function promptYesNo(question, defaultYes = true) {
19395
19415
  });
19396
19416
  }
19397
19417
  async function cmdBinary(rest) {
19398
- initLogger5();
19418
+ initLogger6();
19399
19419
  const configPath = resolveConfigPath();
19400
19420
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
19401
19421
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -19880,7 +19900,7 @@ function createOpenclawUpgradeBackupDir() {
19880
19900
  return fs32.mkdtempSync(path24.join(backupsRoot, `remnic-openclaw-upgrade-${formatOpenclawUpgradeStamp()}-`));
19881
19901
  }
19882
19902
  async function cmdTaxonomy(rest) {
19883
- initLogger5();
19903
+ initCliLogger(rest.includes("--json"));
19884
19904
  const configPath = resolveConfigPath();
19885
19905
  const raw = fs32.existsSync(configPath) ? JSON.parse(fs32.readFileSync(configPath, "utf8")) : {};
19886
19906
  const remnicCfg = resolveRemnicConfigRecord16(raw);
@@ -20323,7 +20343,16 @@ async function main(argv = process.argv.slice(2)) {
20323
20343
  const json = rest.includes("--json");
20324
20344
  const explain = rest.includes("--explain");
20325
20345
  const queryText = rest.filter((a) => !a.startsWith("--")).join(" ");
20326
- await cmdQuery(queryText, json, explain);
20346
+ try {
20347
+ await withBriefingDeadline((signal) => cmdQuery(queryText, json, explain, signal), void 0, "query");
20348
+ } catch (err) {
20349
+ if (json && err instanceof BriefingTimeoutError) {
20350
+ process.stderr.write(`${JSON.stringify({ error: err.message })}
20351
+ `);
20352
+ process.exit(1);
20353
+ }
20354
+ throw err;
20355
+ }
20327
20356
  break;
20328
20357
  }
20329
20358
  case "recall":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/cli",
3
- "version": "10.0.84",
3
+ "version": "10.0.86",
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.86",
30
+ "@remnic/server": "^10.0.86",
31
+ "@remnic/core": "^10.0.86"
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.86",
35
+ "@remnic/plugin-openclaw": "^10.0.86",
36
+ "@remnic/export-weclone": "^10.0.86",
37
+ "@remnic/import-weclone": "^10.0.86",
38
+ "@remnic/import-chatgpt": "^10.0.86",
39
+ "@remnic/import-claude": "^10.0.86",
40
+ "@remnic/import-gemini": "^10.0.86",
41
+ "@remnic/import-lossless-claw": "^10.0.86",
42
+ "@remnic/import-mem0": "^10.0.86",
43
+ "@remnic/import-supermemory": "^10.0.86",
44
+ "@remnic/import-okf": "^10.0.86",
45
+ "@remnic/connector-limitless": "^10.0.86",
46
+ "@remnic/connector-bee": "^10.0.86",
47
+ "@remnic/connector-omi": "^10.0.86",
48
+ "@remnic/capture-audio": "^10.0.86"
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/plugin-openclaw": "10.0.86",
101
+ "@remnic/bench": "10.0.86",
102
+ "@remnic/export-weclone": "10.0.86",
103
+ "@remnic/import-weclone": "10.0.86",
104
+ "@remnic/import-claude": "10.0.86",
105
+ "@remnic/import-lossless-claw": "10.0.86",
106
+ "@remnic/import-mem0": "10.0.86",
107
+ "@remnic/import-chatgpt": "10.0.86",
108
+ "@remnic/import-supermemory": "10.0.86",
109
+ "@remnic/connector-limitless": "10.0.86",
110
+ "@remnic/import-gemini": "10.0.86",
111
+ "@remnic/connector-bee": "10.0.86",
112
+ "@remnic/connector-omi": "10.0.86"
113
113
  },
114
114
  "license": "MIT",
115
115
  "repository": {