@memnexus-ai/cli 1.7.234 → 1.7.236
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/commands/memories.d.ts.map +1 -1
- package/dist/commands/memories.js +63 -11
- package/dist/commands/memories.js.map +1 -1
- package/dist/lib/renderable-retrieval.d.ts +54 -0
- package/dist/lib/renderable-retrieval.d.ts.map +1 -1
- package/dist/lib/renderable-retrieval.js +117 -4
- package/dist/lib/renderable-retrieval.js.map +1 -1
- package/hooks/capture-precompact.sh +258 -0
- package/hooks/capture-session-end.sh +256 -0
- package/package.json +3 -2
- package/hooks/capture-hooks.test.sh +0 -465
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memories.d.ts","sourceRoot":"","sources":["../../src/commands/memories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,KAAK,EAGN,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"memories.d.ts","sourceRoot":"","sources":["../../src/commands/memories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,KAAK,EAGN,MAAM,cAAc,CAAC;AAkCtB,qEAAqE;AACrE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,mDAAmD;AACnD,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,mDAAmD;AACnD,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAYlF;AAED;;;GAGG;AACH,wBAAgB,cAA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 +2519,15 @@ function registerMemoriesCommands(program) {
|
|
|
2519
2519
|
const search = renderable_retrieval_1.RenderableSearchResult.fromApiResponse(searchData);
|
|
2520
2520
|
// The headline is the first thing a caller reads and was unconditional:
|
|
2521
2521
|
// "Found N results" over an incomplete gather reads as a full answer.
|
|
2522
|
-
|
|
2523
|
-
|
|
2522
|
+
// (#5450) A suppressed result set is the same failure mode as a degraded
|
|
2523
|
+
// one from the caller's point of view — a short or empty answer that is
|
|
2524
|
+
// not evidence of absence — but it arrives with every branch healthy, so
|
|
2525
|
+
// it needs its own check. The headline is the first thing read, so it
|
|
2526
|
+
// carries the count of discarded results rather than a success glyph.
|
|
2527
|
+
if (search.health.degraded || search.suppression.suppressed) {
|
|
2528
|
+
spinner?.warn(`Found ${search.results.length} results` +
|
|
2529
|
+
`${(0, renderable_retrieval_1.degradationHeadlineSuffix)(search.health)}` +
|
|
2530
|
+
`${(0, renderable_retrieval_1.suppressionHeadlineSuffix)(search.suppression)}`);
|
|
2524
2531
|
}
|
|
2525
2532
|
else {
|
|
2526
2533
|
spinner?.succeed(`Found ${search.results.length} results`);
|
|
@@ -2532,15 +2539,32 @@ function registerMemoriesCommands(program) {
|
|
|
2532
2539
|
if (degradedLine) {
|
|
2533
2540
|
console.error(chalk_1.default.yellow(degradedLine));
|
|
2534
2541
|
}
|
|
2542
|
+
// Anchor-gate suppression marker (#5450) — stderr, same placement and
|
|
2543
|
+
// for the same reason: it must reach the caller in every output mode,
|
|
2544
|
+
// including --format json, where stdout has to stay byte-identical to
|
|
2545
|
+
// what a machine caller already parses.
|
|
2546
|
+
const suppressedLine = (0, renderable_retrieval_1.suppressionWarningLine)(search.suppression);
|
|
2547
|
+
if (suppressedLine) {
|
|
2548
|
+
console.error(chalk_1.default.yellow(suppressedLine));
|
|
2549
|
+
}
|
|
2535
2550
|
// v4.21 FR-7: gate the exit code so a scripted caller can tell "partial
|
|
2536
2551
|
// answer" (6) from a complete result (0), matching recall/digest/status.
|
|
2537
|
-
//
|
|
2538
|
-
//
|
|
2539
|
-
//
|
|
2540
|
-
//
|
|
2541
|
-
//
|
|
2542
|
-
//
|
|
2543
|
-
|
|
2552
|
+
// A zero-result-but-degraded search (the worst case: "nothing found" that
|
|
2553
|
+
// is actually incomplete) exits 6, while a zero-result COMPLETE search
|
|
2554
|
+
// stays 0. Set via process.exitCode (NOT process.exit) so the buffered
|
|
2555
|
+
// stdout/JSON of every output branch below flushes first. The stderr
|
|
2556
|
+
// warning, headline suffix, and --json/--yaml health shape are unchanged.
|
|
2557
|
+
//
|
|
2558
|
+
// (#5450) DELIBERATE CONTRACT CHANGE: this gate was keyed strictly on
|
|
2559
|
+
// health.degraded, so a suppressed empty exited 0 and a wrapper branching
|
|
2560
|
+
// on $? saw a clean pass — the pre-fix silence surviving through the one
|
|
2561
|
+
// channel the rest of this fix does not reach. A suppressed empty IS the
|
|
2562
|
+
// worst case this gate's own comment describes, arriving by a different
|
|
2563
|
+
// route, so the contract's stated intent already covers it. A caller
|
|
2564
|
+
// treating 6 as "retry" will now retry on a suppressed empty, which is
|
|
2565
|
+
// the correct response: re-running with different wording is the
|
|
2566
|
+
// documented remedy.
|
|
2567
|
+
if (search.health.degraded || search.suppression.suppressed) {
|
|
2544
2568
|
process.exitCode = EXIT_DEGRADED_RESULT;
|
|
2545
2569
|
}
|
|
2546
2570
|
// Surface extraction failures (#2862). Failed memories are invisible to
|
|
@@ -2606,6 +2630,10 @@ function registerMemoriesCommands(program) {
|
|
|
2606
2630
|
if (llmMarker) {
|
|
2607
2631
|
console.log(llmMarker);
|
|
2608
2632
|
}
|
|
2633
|
+
const llmSuppressed = (0, renderable_retrieval_1.suppressionSummaryLine)(search.suppression);
|
|
2634
|
+
if (llmSuppressed) {
|
|
2635
|
+
console.log(llmSuppressed);
|
|
2636
|
+
}
|
|
2609
2637
|
(0, formatters_1.printOutput)(llmData, 'llm', undefined, {
|
|
2610
2638
|
totalCount: search.total,
|
|
2611
2639
|
previewLength: Math.min(previewLength, 100), // Shorter preview for LLM
|
|
@@ -2626,6 +2654,10 @@ function registerMemoriesCommands(program) {
|
|
|
2626
2654
|
if (compactMarker) {
|
|
2627
2655
|
console.log(chalk_1.default.yellow(compactMarker));
|
|
2628
2656
|
}
|
|
2657
|
+
const compactSuppressed = (0, renderable_retrieval_1.suppressionSummaryLine)(search.suppression);
|
|
2658
|
+
if (compactSuppressed) {
|
|
2659
|
+
console.log(chalk_1.default.yellow(compactSuppressed));
|
|
2660
|
+
}
|
|
2629
2661
|
(0, formatters_1.printOutput)(compactData, 'compact');
|
|
2630
2662
|
}
|
|
2631
2663
|
else if (effectiveFormat === 'table' || !effectiveFormat) {
|
|
@@ -2683,6 +2715,10 @@ function registerMemoriesCommands(program) {
|
|
|
2683
2715
|
if (tableMarker) {
|
|
2684
2716
|
console.log(chalk_1.default.yellow(tableMarker));
|
|
2685
2717
|
}
|
|
2718
|
+
const tableSuppressed = (0, renderable_retrieval_1.suppressionSummaryLine)(search.suppression);
|
|
2719
|
+
if (tableSuppressed) {
|
|
2720
|
+
console.log(chalk_1.default.yellow(tableSuppressed));
|
|
2721
|
+
}
|
|
2686
2722
|
// Show temporal filters if applied
|
|
2687
2723
|
const temporal = search.temporalMetadata;
|
|
2688
2724
|
if (temporal?.temporalFieldsIncluded) {
|
|
@@ -3850,8 +3886,17 @@ function registerRecapCommand(memories) {
|
|
|
3850
3886
|
});
|
|
3851
3887
|
}
|
|
3852
3888
|
const truncated = results.length >= fetchLimit;
|
|
3853
|
-
|
|
3854
|
-
|
|
3889
|
+
// (#5450) recap calls the same searchMemoriesGet endpoint as `search`, so
|
|
3890
|
+
// it sits behind the same fulltext-anchor gate and can be handed `[]` with
|
|
3891
|
+
// every branch healthy. It read `health` only, so a suppressed empty
|
|
3892
|
+
// printed "No memories found in the last 24h" with no marker anywhere —
|
|
3893
|
+
// and recap is a command agents run for the prior-art gate this fix
|
|
3894
|
+
// protects. Mirrored from the `search` handler above.
|
|
3895
|
+
const recapSuppression = renderable.suppression;
|
|
3896
|
+
if (health.degraded || recapSuppression.suppressed) {
|
|
3897
|
+
spinner.warn(`Found ${results.length} memories` +
|
|
3898
|
+
`${(0, renderable_retrieval_1.degradationHeadlineSuffix)(health)}` +
|
|
3899
|
+
`${(0, renderable_retrieval_1.suppressionHeadlineSuffix)(recapSuppression)}`);
|
|
3855
3900
|
}
|
|
3856
3901
|
else {
|
|
3857
3902
|
spinner.succeed(`Found ${results.length} memories`);
|
|
@@ -3862,6 +3907,13 @@ function registerRecapCommand(memories) {
|
|
|
3862
3907
|
if (recapDegraded) {
|
|
3863
3908
|
console.error(chalk_1.default.yellow(recapDegraded));
|
|
3864
3909
|
}
|
|
3910
|
+
// Same placement and the same reason for the suppression marker: stderr,
|
|
3911
|
+
// BEFORE the zero-result return below, so it survives --format json and
|
|
3912
|
+
// the early exit that a suppressed empty takes.
|
|
3913
|
+
const recapSuppressed = (0, renderable_retrieval_1.suppressionWarningLine)(recapSuppression);
|
|
3914
|
+
if (recapSuppressed) {
|
|
3915
|
+
console.error(chalk_1.default.yellow(recapSuppressed));
|
|
3916
|
+
}
|
|
3865
3917
|
if (results.length === 0) {
|
|
3866
3918
|
console.log(chalk_1.default.yellow(`\nNo memories found in the last ${options.recent}.`));
|
|
3867
3919
|
return;
|