hippo-memory 1.52.8 → 1.53.0
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/README.md +185 -101
- package/dist/agent-memories/apply.d.ts +47 -0
- package/dist/agent-memories/apply.js +253 -0
- package/dist/agent-memories/claude-code.d.ts +11 -0
- package/dist/agent-memories/claude-code.js +113 -0
- package/dist/agent-memories/codex.d.ts +3 -0
- package/dist/agent-memories/codex.js +47 -0
- package/dist/agent-memories/copilot.d.ts +3 -0
- package/dist/agent-memories/copilot.js +125 -0
- package/dist/agent-memories/files.d.ts +37 -0
- package/dist/agent-memories/files.js +77 -0
- package/dist/agent-memories/folder-store.d.ts +17 -0
- package/dist/agent-memories/folder-store.js +44 -0
- package/dist/agent-memories/gemini.d.ts +3 -0
- package/dist/agent-memories/gemini.js +103 -0
- package/dist/agent-memories/git.d.ts +8 -0
- package/dist/agent-memories/git.js +11 -0
- package/dist/agent-memories/keys.d.ts +9 -0
- package/dist/agent-memories/keys.js +20 -0
- package/dist/agent-memories/legacy.d.ts +17 -0
- package/dist/agent-memories/legacy.js +45 -0
- package/dist/agent-memories/markdown.d.ts +13 -0
- package/dist/agent-memories/markdown.js +123 -0
- package/dist/agent-memories/openclaw.d.ts +3 -0
- package/dist/agent-memories/openclaw.js +42 -0
- package/dist/agent-memories/plan.d.ts +78 -0
- package/dist/agent-memories/plan.js +123 -0
- package/dist/agent-memories/qwen-code.d.ts +5 -0
- package/dist/agent-memories/qwen-code.js +50 -0
- package/dist/agent-memories/report.d.ts +52 -0
- package/dist/agent-memories/report.js +88 -0
- package/dist/agent-memories/source.d.ts +16 -0
- package/dist/agent-memories/source.js +32 -0
- package/dist/agent-memories/sync.d.ts +33 -0
- package/dist/agent-memories/sync.js +336 -0
- package/dist/agent-memories/tools.d.ts +33 -0
- package/dist/agent-memories/tools.js +19 -0
- package/dist/agent-memories/types.d.ts +42 -0
- package/dist/agent-memories/types.js +2 -0
- package/dist/api.d.ts +53 -20
- package/dist/api.js +141 -97
- package/dist/audit.d.ts +2 -1
- package/dist/audit.js +68 -2
- package/dist/capture.d.ts +48 -22
- package/dist/capture.js +186 -161
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +750 -797
- package/dist/codex-patch.d.ts +12 -0
- package/dist/codex-patch.js +71 -0
- package/dist/compaction-items.d.ts +18 -0
- package/dist/compaction-items.js +60 -0
- package/dist/compaction-record.d.ts +94 -0
- package/dist/compaction-record.js +546 -0
- package/dist/config.d.ts +4 -1
- package/dist/config.js +13 -4
- package/dist/connectors/slack/types.d.ts +0 -1
- package/dist/consolidate.js +87 -34
- package/dist/context-render.d.ts +36 -0
- package/dist/context-render.js +154 -0
- package/dist/dag.js +3 -2
- package/dist/db.d.ts +5 -1
- package/dist/db.js +46 -14
- package/dist/dedupe.d.ts +6 -6
- package/dist/dedupe.js +10 -9
- package/dist/doctor.d.ts +1 -1
- package/dist/doctor.js +69 -4
- package/dist/dormant.d.ts +9 -3
- package/dist/dormant.js +26 -2
- package/dist/embedding-provider.d.ts +2 -1
- package/dist/embedding-provider.js +2 -1
- package/dist/embeddings.js +23 -3
- package/dist/extract.js +5 -1
- package/dist/forward-claim-detector.d.ts +1 -1
- package/dist/forward-claim-detector.js +1 -1
- package/dist/gated-write.d.ts +9 -0
- package/dist/gated-write.js +24 -0
- package/dist/graph-recall.d.ts +3 -1
- package/dist/graph-recall.js +5 -3
- package/dist/hooks.d.ts +18 -2
- package/dist/hooks.js +128 -32
- package/dist/importers.js +5 -12
- package/dist/judgment.d.ts +30 -0
- package/dist/judgment.js +122 -0
- package/dist/mcp/server.js +171 -210
- package/dist/memory.d.ts +19 -2
- package/dist/memory.js +35 -3
- package/dist/merged-row.d.ts +6 -0
- package/dist/merged-row.js +35 -0
- package/dist/multihop.d.ts +2 -1
- package/dist/multihop.js +7 -4
- package/dist/physics-state.d.ts +0 -4
- package/dist/physics-state.js +0 -6
- package/dist/predictions.d.ts +2 -17
- package/dist/predictions.js +2 -15
- package/dist/reject-flow.d.ts +7 -5
- package/dist/reject-flow.js +41 -12
- package/dist/salience.js +12 -5
- package/dist/same-text.d.ts +17 -0
- package/dist/same-text.js +38 -0
- package/dist/scheduler.d.ts +4 -0
- package/dist/scheduler.js +8 -0
- package/dist/search.d.ts +7 -0
- package/dist/search.js +16 -32
- package/dist/secret-detect.d.ts +2 -0
- package/dist/secret-detect.js +6 -0
- package/dist/server-detect.js +9 -33
- package/dist/server.js +6 -62
- package/dist/session-digest.d.ts +79 -0
- package/dist/session-digest.js +528 -0
- package/dist/shared.d.ts +10 -2
- package/dist/shared.js +44 -36
- package/dist/store.d.ts +9 -2
- package/dist/store.js +25 -2
- package/dist/token-ledger.d.ts +46 -8
- package/dist/token-ledger.js +140 -21
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/extensions/openclaw-plugin/README.md +4 -4
- package/extensions/openclaw-plugin/openclaw.plugin.json +2 -2
- package/extensions/openclaw-plugin/package.json +1 -1
- package/openclaw.plugin.json +2 -2
- package/package.json +2 -2
package/dist/capture.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface ExtractedItem {
|
|
|
14
14
|
category: string;
|
|
15
15
|
tags: string[];
|
|
16
16
|
}
|
|
17
|
+
export declare function splitSentences(text: string): string[];
|
|
17
18
|
/**
|
|
18
19
|
* Main extraction function. Scans text for actionable items using heuristics.
|
|
19
20
|
*/
|
|
@@ -28,6 +29,7 @@ export interface CaptureOptions {
|
|
|
28
29
|
* `stdinTimedOut` marks an empty read "unknown", not "no payload". */
|
|
29
30
|
stdinText?: string;
|
|
30
31
|
stdinTimedOut?: boolean;
|
|
32
|
+
sessionTurns?: readonly SessionTurn[];
|
|
31
33
|
/**
|
|
32
34
|
* Tee stdout/stderr to this log file while capture runs. Mirrors the
|
|
33
35
|
* pattern used by `hippo sleep --log-file` so the SessionEnd hook output
|
|
@@ -45,7 +47,41 @@ export interface CaptureOptions {
|
|
|
45
47
|
* behaviour. Ignored when `global: true` (global captures are host-wide).
|
|
46
48
|
*/
|
|
47
49
|
tenantId?: string;
|
|
50
|
+
originProject?: string;
|
|
48
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Runtime shape guards used throughout this file wherever a value arrives
|
|
54
|
+
* unparsed (JSONL transcript records, stdout/stderr write() chunks). Generic
|
|
55
|
+
* over the input so the parameter is never annotated `unknown` directly — TS
|
|
56
|
+
* infers it from the call site — while the check itself avoids `typeof` by
|
|
57
|
+
* testing identity against the coercion (`String(x) === x`) /
|
|
58
|
+
* prototype-chain (`instanceof Object`) instead. Behaviourally equivalent to
|
|
59
|
+
* `typeof x === 'string'` / a truthy `typeof x === 'object'` check for
|
|
60
|
+
* anything `JSON.parse` can produce (the only divergence is boxed
|
|
61
|
+
* primitives, which JSON.parse never yields).
|
|
62
|
+
*/
|
|
63
|
+
export declare function isStringValue<T>(value: T): value is T & string;
|
|
64
|
+
export declare function isObjectLike<T>(value: T): value is T & object;
|
|
65
|
+
/** Message for a caught value of unknown shape. `cause` names the sanctioned unknown-input case (error-cause enrichment). */
|
|
66
|
+
export declare function errorMessage(cause: unknown): string;
|
|
67
|
+
/** Transcript-line flags isNonHumanUserLine reads (any may be absent); `promptSource: 'system'` marks Claude Code's own notices. */
|
|
68
|
+
interface TranscriptLineFlags {
|
|
69
|
+
type?: unknown;
|
|
70
|
+
isMeta?: unknown;
|
|
71
|
+
isSidechain?: unknown;
|
|
72
|
+
isCompactSummary?: unknown;
|
|
73
|
+
promptSource?: unknown;
|
|
74
|
+
}
|
|
75
|
+
export interface SessionTurn {
|
|
76
|
+
role: 'user' | 'assistant';
|
|
77
|
+
text: string;
|
|
78
|
+
}
|
|
79
|
+
export interface TranscriptRecord extends TranscriptLineFlags {
|
|
80
|
+
message?: unknown;
|
|
81
|
+
payload?: unknown;
|
|
82
|
+
cwd?: unknown;
|
|
83
|
+
}
|
|
84
|
+
export declare function collectSessionTurns(jsonl: string, visit?: (record: TranscriptRecord) => void): SessionTurn[];
|
|
49
85
|
export declare function summariseTranscript(jsonl: string): string;
|
|
50
86
|
/**
|
|
51
87
|
* Resolve a transcript path for `--last-session`.
|
|
@@ -53,11 +89,13 @@ export declare function summariseTranscript(jsonl: string): string;
|
|
|
53
89
|
* Priority, where the first source present is the only one tried:
|
|
54
90
|
* 1. Explicit `transcriptPath` option (from `--transcript <path>`)
|
|
55
91
|
* 2. Stdin JSON payload (Claude Code / OpenCode SessionEnd hook shape)
|
|
56
|
-
* 3. Most recent `.jsonl` under `~/.claude/projects/<any>/`, only
|
|
92
|
+
* 3. Most recent `.jsonl` under `~/.claude/projects/<any>/`, only when the caller passes `mayScan` (only the caller knows it is not a hook) and there is no path and no stdin text, because this scan spans every project on the box
|
|
57
93
|
*
|
|
58
94
|
* Returns null when nothing resolves, a named transcript or payload whose file is missing included. Never throws.
|
|
59
95
|
*/
|
|
60
|
-
export declare function resolveLastSessionTranscript(explicit: string | undefined, stdinText: string | undefined,
|
|
96
|
+
export declare function resolveLastSessionTranscript(explicit: string | undefined, stdinText: string | undefined, opts: {
|
|
97
|
+
mayScan: boolean;
|
|
98
|
+
}): string | null;
|
|
61
99
|
export declare function cmdCapture(hippoRoot: string, options: CaptureOptions): void;
|
|
62
100
|
/** Never read the whole transcript — PreCompact fires exactly when it's largest. */
|
|
63
101
|
export declare const PRE_COMPACT_TAIL_BYTES: number;
|
|
@@ -104,19 +142,6 @@ export declare function readTranscriptTail(transcriptPath: string, capBytes?: nu
|
|
|
104
142
|
* guard, not per-file copies.
|
|
105
143
|
*/
|
|
106
144
|
export declare function sanitizeLogMessage(message: string): string;
|
|
107
|
-
/** What one pre-compact run saved, reported to the user after compaction. */
|
|
108
|
-
export interface PreCompactReport {
|
|
109
|
-
snapshotSaved: boolean;
|
|
110
|
-
/** Claude Code session the run belonged to, when the payload named one. */
|
|
111
|
-
sessionId: string | null;
|
|
112
|
-
}
|
|
113
|
-
/** Line shown after compaction, or null when nothing was saved (Claude Code's own generic message is the fallback). */
|
|
114
|
-
export declare function preCompactMessage(report: Pick<PreCompactReport, 'snapshotSaved'>): string | null;
|
|
115
|
-
/**
|
|
116
|
-
* Where pre-compact leaves its report for `hippo post-compact`: next to the
|
|
117
|
-
* pre-compact log, so both hooks find it from the same `--log-file`.
|
|
118
|
-
*/
|
|
119
|
-
export declare function preCompactReportPath(logFile: string): string;
|
|
120
145
|
/** A session's task, summary and next step from its transcript tail, secrets scrubbed and capped, '' where none; null with a logged reason when nothing is derivable. */
|
|
121
146
|
export declare function transcriptWorkingState(transcriptPath: string, log: (message: string) => void): Pick<TaskSnapshot, 'task' | 'summary' | 'next_step'> | null;
|
|
122
147
|
export interface PreCompactOptions {
|
|
@@ -132,11 +157,12 @@ export interface PreCompactOptions {
|
|
|
132
157
|
* could turn a caught-and-logged failure back into a non-zero exit.
|
|
133
158
|
*/
|
|
134
159
|
export declare function cmdPreCompact(hippoRoot: string, options: PreCompactOptions): Promise<void>;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
*/
|
|
141
|
-
export declare function
|
|
160
|
+
export interface PostCompactOptions {
|
|
161
|
+
stdinText?: string;
|
|
162
|
+
logFile?: string;
|
|
163
|
+
afterSave?: (transcriptPath: string, originProject: string, log: (message: string) => void) => void;
|
|
164
|
+
}
|
|
165
|
+
/** PostCompact entry point: saves the summary and its items, replays earlier leftovers, returns the one line to show. Never throws, so the hook exits 0. */
|
|
166
|
+
export declare function cmdPostCompact(hippoRoot: string, options: PostCompactOptions): string | null;
|
|
167
|
+
export {};
|
|
142
168
|
//# sourceMappingURL=capture.d.ts.map
|