hippo-memory 1.24.0 → 1.24.1
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/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -2
- package/dist/cli.js.map +1 -1
- package/dist/src/cli.js +16 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
- package/extensions/openclaw-plugin/package.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ import { MemoryEntry } from './memory.js';
|
|
|
29
29
|
import * as api from './api.js';
|
|
30
30
|
/** Test-only: reset the module-level recall-history Map. Call from beforeEach. */
|
|
31
31
|
export declare function __resetSessionRecallHistoryCli(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Scan for Claude Code MEMORY.md files and import new entries into hippo.
|
|
34
|
+
* Looks in ~/.claude/projects/<project>/memory/ for .md files with YAML frontmatter.
|
|
35
|
+
*/
|
|
36
|
+
export declare function learnFromMemoryMd(hippoRoot: string, homeDir?: string): number;
|
|
32
37
|
/**
|
|
33
38
|
* Render an api.sleep result as console output, byte-identical to the
|
|
34
39
|
* pre-extraction inline implementation in cmdSleepCore.
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAyBH,OAAO,EASL,WAAW,EAEZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAyBH,OAAO,EASL,WAAW,EAEZ,MAAM,aAAa,CAAC;AAsGrB,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AA4ChC,kFAAkF;AAClF,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAguED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,MAAqB,GAAG,MAAM,CAyE3F;AAyGD;;;GAGG;AACH,oHAAoH;AACpH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAkD/D;AA8vFD,oHAAoH;AACpH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,EACtF,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,MAAkB,GAC1B,IAAI,CA6BN"}
|
package/dist/cli.js
CHANGED
|
@@ -34,6 +34,7 @@ import { execFileSync, execSync, spawn } from 'child_process';
|
|
|
34
34
|
import { installJsonHooks, uninstallJsonHooks, resolveJsonHookPaths, detectInstalledTools, defaultSleepLogPath, ensureCodexWrapperInstalled, installCodexWrapper, uninstallCodexWrapper, resolveCodexSessionTranscript, resolveCodexWrapperPaths, installOpencodePlugin, uninstallOpencodePlugin, resolveOpencodePluginPath, } from './hooks.js';
|
|
35
35
|
import { createMemory, calculateStrength, calculateRewardFactor, deriveHalfLife, resolveConfidence, computeSchemaFit, Layer, } from './memory.js';
|
|
36
36
|
import { resolveProjectIdentity } from './project-identity.js';
|
|
37
|
+
import { detectSecret } from './secret-detect.js';
|
|
37
38
|
import { getHippoRoot, isInitialized, initStore, writeEntry, readEntry, deleteEntry, loadAllEntries, loadSearchEntries, loadIndex, saveIndex, loadStats, updateStats, saveActiveTaskSnapshot, loadActiveTaskSnapshot, clearActiveTaskSnapshot, appendSessionEvent, listSessionEvents, listMemoryConflicts, resolveConflict, saveSessionHandoff, loadLatestHandoff, loadHandoffById, RECALL_DEFAULT_DENY_SCOPES, } from './store.js';
|
|
38
39
|
import { markRetrieved, hybridSearch, physicsSearch, explainMatch, textOverlap } from './search.js';
|
|
39
40
|
import { renderTraceContent, parseSteps } from './trace.js';
|
|
@@ -2224,8 +2225,8 @@ async function cmdRefine(hippoRoot, flags) {
|
|
|
2224
2225
|
* Scan for Claude Code MEMORY.md files and import new entries into hippo.
|
|
2225
2226
|
* Looks in ~/.claude/projects/<project>/memory/ for .md files with YAML frontmatter.
|
|
2226
2227
|
*/
|
|
2227
|
-
function learnFromMemoryMd(hippoRoot) {
|
|
2228
|
-
const home =
|
|
2228
|
+
export function learnFromMemoryMd(hippoRoot, homeDir = os.homedir()) {
|
|
2229
|
+
const home = homeDir;
|
|
2229
2230
|
const memoryDirs = [];
|
|
2230
2231
|
// Claude Code project memories
|
|
2231
2232
|
const claudeProjectsDir = path.join(home, '.claude', 'projects');
|
|
@@ -2243,6 +2244,7 @@ function learnFromMemoryMd(hippoRoot) {
|
|
|
2243
2244
|
return 0;
|
|
2244
2245
|
const existing = loadAllEntries(hippoRoot);
|
|
2245
2246
|
let imported = 0;
|
|
2247
|
+
let skippedSecret = 0;
|
|
2246
2248
|
for (const memDir of memoryDirs) {
|
|
2247
2249
|
try {
|
|
2248
2250
|
const files = fs.readdirSync(memDir).filter(f => f.endsWith('.md') && f !== 'MEMORY.md');
|
|
@@ -2257,6 +2259,15 @@ function learnFromMemoryMd(hippoRoot) {
|
|
|
2257
2259
|
continue;
|
|
2258
2260
|
// Truncate to reasonable size
|
|
2259
2261
|
const content = body.length > 1500 ? body.slice(0, 1500) + ' [truncated]' : body;
|
|
2262
|
+
// Never ingest secret-bearing memory files. Some Claude Code memory
|
|
2263
|
+
// files exist purely to hold a live credential (e.g. an API-key
|
|
2264
|
+
// reference). The scope-isolation secret veto (v1.24.0) gated
|
|
2265
|
+
// share/promote/sync/ambient but missed this import path, so a live
|
|
2266
|
+
// key could land in the store here. Veto it at ingest. (v1.24.1)
|
|
2267
|
+
if (detectSecret({ content, tags: ['claude-code-memory'] }).flagged) {
|
|
2268
|
+
skippedSecret++;
|
|
2269
|
+
continue;
|
|
2270
|
+
}
|
|
2260
2271
|
// Dedup: check if substantially similar content already exists
|
|
2261
2272
|
const isDup = existing.some(e => {
|
|
2262
2273
|
const overlap = textOverlap(content.slice(0, 200), e.content.slice(0, 200));
|
|
@@ -2277,6 +2288,9 @@ function learnFromMemoryMd(hippoRoot) {
|
|
|
2277
2288
|
}
|
|
2278
2289
|
catch { /* skip broken dirs */ }
|
|
2279
2290
|
}
|
|
2291
|
+
if (skippedSecret > 0) {
|
|
2292
|
+
console.log(`Skipped ${skippedSecret} secret-bearing memory file${skippedSecret === 1 ? '' : 's'} (not ingested).`);
|
|
2293
|
+
}
|
|
2280
2294
|
return imported;
|
|
2281
2295
|
}
|
|
2282
2296
|
function cmdDedup(hippoRoot, flags) {
|