hippo-memory 1.56.0 → 1.58.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 +11 -0
- package/dist/agent-memories/claude-code.js +1 -1
- package/dist/agent-memories/gemini.js +1 -1
- package/dist/api-errors.d.ts +27 -0
- package/dist/api-errors.js +37 -0
- package/dist/api.d.ts +21 -14
- package/dist/api.js +97 -71
- package/dist/audit.d.ts +4 -0
- package/dist/audit.js +11 -0
- package/dist/autolearn.d.ts +1 -1
- package/dist/autolearn.js +7 -5
- package/dist/capture-contract.d.ts +47 -0
- package/dist/capture-contract.js +49 -0
- package/dist/capture-error.js +2 -1
- package/dist/capture.d.ts +0 -13
- package/dist/capture.js +5 -66
- package/dist/card-detail.d.ts +1 -1
- package/dist/card-detail.js +1 -1
- package/dist/cli/shared.d.ts +137 -0
- package/dist/cli/shared.js +834 -0
- package/dist/cli/sleep.d.ts +10 -0
- package/dist/cli/sleep.js +171 -0
- package/dist/cli.d.ts +0 -7
- package/dist/cli.js +322 -1827
- package/dist/client.js +9 -0
- package/dist/codex-patch.js +1 -1
- package/dist/compaction-record.d.ts +1 -1
- package/dist/compaction-record.js +3 -2
- package/dist/config.d.ts +5 -0
- package/dist/config.js +17 -0
- package/dist/connectors/github/dlq.js +5 -2
- package/dist/connectors/github/octokit-client.js +4 -2
- package/dist/connectors/github/webhook.d.ts +19 -0
- package/dist/connectors/github/webhook.js +313 -0
- package/dist/connectors/slack/dlq.js +6 -2
- package/dist/connectors/slack/web-client.js +7 -5
- package/dist/connectors/slack/webhook.d.ts +22 -0
- package/dist/connectors/slack/webhook.js +203 -0
- package/dist/consolidate.d.ts +10 -0
- package/dist/consolidate.js +38 -35
- package/dist/context-auto.d.ts +3 -0
- package/dist/context-auto.js +34 -0
- package/dist/customer-notes.js +16 -14
- package/dist/dag.js +3 -2
- package/dist/dashboard.js +3 -2
- package/dist/db.d.ts +12 -0
- package/dist/db.js +62 -1
- package/dist/decisions.js +11 -9
- package/dist/doctor.js +5 -0
- package/dist/embedding-provider.js +3 -3
- package/dist/embeddings.d.ts +4 -4
- package/dist/embeddings.js +72 -16
- package/dist/eval-stats.d.ts +58 -0
- package/dist/eval-stats.js +111 -0
- package/dist/extract.js +3 -2
- package/dist/goals.d.ts +49 -25
- package/dist/goals.js +39 -22
- package/dist/graph-extract.js +1 -1
- package/dist/graph-recall.d.ts +1 -1
- package/dist/graph-recall.js +1 -1
- package/dist/graph.js +1 -1
- package/dist/hooks.d.ts +1 -3
- package/dist/hooks.js +2 -4
- package/dist/http-retry.d.ts +21 -0
- package/dist/http-retry.js +50 -0
- package/dist/http-util.d.ts +39 -0
- package/dist/http-util.js +56 -0
- package/dist/importers.d.ts +2 -0
- package/dist/importers.js +16 -5
- package/dist/incidents.js +13 -11
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5 -2
- package/dist/judgment.js +10 -17
- package/dist/log.d.ts +25 -0
- package/dist/log.js +48 -0
- package/dist/mcp/server.js +224 -308
- package/dist/mcp/tool-args.d.ts +21 -0
- package/dist/mcp/tool-args.js +80 -0
- package/dist/memory.d.ts +19 -0
- package/dist/memory.js +41 -2
- package/dist/overlap-index.d.ts +7 -0
- package/dist/overlap-index.js +38 -0
- package/dist/pilot-arm.d.ts +9 -0
- package/dist/pilot-arm.js +47 -0
- package/dist/policies.js +14 -12
- package/dist/predictions.js +11 -9
- package/dist/processes.js +16 -14
- package/dist/project-briefs.js +19 -16
- package/dist/project-identity.d.ts +1 -1
- package/dist/project-identity.js +25 -1
- package/dist/prompt-recall.js +1 -1
- package/dist/raw-archive.js +7 -6
- package/dist/recall-history.d.ts +5 -0
- package/dist/recall-history.js +9 -0
- package/dist/recall-pipeline.d.ts +101 -0
- package/dist/recall-pipeline.js +313 -0
- package/dist/recall-scope.d.ts +24 -1
- package/dist/recall-scope.js +29 -2
- package/dist/refine-llm.js +3 -2
- package/dist/reject-flow.js +6 -9
- package/dist/rejection.d.ts +2 -1
- package/dist/rejection.js +2 -1
- package/dist/search.d.ts +0 -20
- package/dist/search.js +16 -51
- package/dist/secret-detect.d.ts +13 -1
- package/dist/secret-detect.js +33 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +1854 -2566
- package/dist/session-digest.js +2 -1
- package/dist/shared.js +7 -6
- package/dist/skills.js +17 -15
- package/dist/store-cards.d.ts +53 -0
- package/dist/store-cards.js +512 -0
- package/dist/store.d.ts +2 -89
- package/dist/store.js +10 -566
- package/dist/tenant.d.ts +22 -0
- package/dist/tenant.js +26 -0
- package/dist/token-ledger.d.ts +4 -2
- package/dist/token-ledger.js +2 -2
- package/dist/tokenize.d.ts +2 -0
- package/dist/tokenize.js +8 -0
- 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/connectors/slack/ratelimit.d.ts +0 -9
- package/dist/connectors/slack/ratelimit.js +0 -18
package/dist/index.js
CHANGED
|
@@ -7,10 +7,13 @@ export { Layer, calculateStrength, resolveConfidence, confidenceFacets, applyOut
|
|
|
7
7
|
export function createMemory(content, options = {}) {
|
|
8
8
|
return createStoreMemory(content, { ...options, baseHalfLifeDays: options.baseHalfLifeDays ?? DEFAULT_HALF_LIFE_DAYS });
|
|
9
9
|
}
|
|
10
|
-
export { search, hybridSearch, physicsSearch,
|
|
10
|
+
export { search, hybridSearch, physicsSearch, estimateTokens, textOverlap, explainMatch, detectTemporalDirection, temporalBoost, computeTemporalRange } from './search.js';
|
|
11
|
+
export { tokenize } from './tokenize.js';
|
|
12
|
+
export { markRetrieved } from './memory.js';
|
|
11
13
|
export { multihopSearch } from './multihop.js';
|
|
12
14
|
export { graphExpandRecall, MAX_HOPS, DEFAULT_MAX_NEIGHBORS } from './graph-recall.js';
|
|
13
|
-
export { initStore, loadAllEntries, loadSearchEntries, loadRecallSearchEntries, writeEntry, readEntry, deleteEntry, loadIndex, rebuildIndex, saveActiveTaskSnapshot, loadActiveTaskSnapshot, loadFreshActiveTaskSnapshot, SNAPSHOT_AMBIENT_MAX_AGE_MS, closeTaskSnapshotsForSession, clearActiveTaskSnapshot, appendSessionEvent, listSessionEvents, listMemoryConflicts, replaceDetectedConflicts, resolveConflict, saveSessionHandoff, loadLatestHandoff, loadHandoffById, stampHandoffOutcome, writeSessionEndHandoff, loadSessionDecayContext,
|
|
15
|
+
export { initStore, loadAllEntries, loadSearchEntries, loadRecallSearchEntries, writeEntry, readEntry, deleteEntry, loadIndex, rebuildIndex, saveActiveTaskSnapshot, loadActiveTaskSnapshot, loadFreshActiveTaskSnapshot, SNAPSHOT_AMBIENT_MAX_AGE_MS, closeTaskSnapshotsForSession, clearActiveTaskSnapshot, appendSessionEvent, listSessionEvents, listMemoryConflicts, replaceDetectedConflicts, resolveConflict, saveSessionHandoff, loadLatestHandoff, loadHandoffById, stampHandoffOutcome, writeSessionEndHandoff, loadSessionDecayContext, } from './store.js';
|
|
16
|
+
export { createCard, loadCard, listCards, loadCardDeps, loadCardRuns, loadCardComments, claimCard, heartbeatCard, blockCard, reviewCard, completeCard, reclaimExpiredCards, addCardComment, loadLatestHandoffForCard, } from './store-cards.js';
|
|
14
17
|
// Feature 5: Session handoff
|
|
15
18
|
export { isHandoffOutcome } from './handoff.js';
|
|
16
19
|
// W2a: work-queue cards
|
package/dist/judgment.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** Typed judgment over capture candidates via TypeSafe's Jev (System One).
|
|
2
2
|
* Regex picks WHAT is a candidate; it cannot say what is worth keeping, so
|
|
3
3
|
* every captured memory currently lands on a flat schema_fit of 0.5. */
|
|
4
|
+
import { fetchWithRetry } from './http-retry.js';
|
|
4
5
|
const ENDPOINT = 'https://api.typesafe.ai/v1/systemone';
|
|
5
6
|
const DEFAULT_MODEL = 'jev-1.13.0';
|
|
6
7
|
const MAX_CONCURRENCY = 8;
|
|
7
|
-
const RETRY_STATUS = new Set([429, 529]);
|
|
8
8
|
const QUESTIONS = {
|
|
9
9
|
durable: {
|
|
10
10
|
type: 'noul',
|
|
@@ -48,11 +48,12 @@ function toConfidenceTier(kindConfidence) {
|
|
|
48
48
|
return 'observed';
|
|
49
49
|
return 'inferred';
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/** Capture-time judging must not hold a write for long: one budget per attempt, shorter than the LLM calls. */
|
|
52
|
+
const JUDGE_TIMEOUT_MS = 15_000;
|
|
53
|
+
async function post(content, opts) {
|
|
53
54
|
let res;
|
|
54
55
|
try {
|
|
55
|
-
res = await
|
|
56
|
+
res = await fetchWithRetry(ENDPOINT, {
|
|
56
57
|
method: 'POST',
|
|
57
58
|
headers: {
|
|
58
59
|
'content-type': 'application/json',
|
|
@@ -63,16 +64,12 @@ async function postOnce(content, opts) {
|
|
|
63
64
|
model: opts.model ?? DEFAULT_MODEL,
|
|
64
65
|
questions: QUESTIONS,
|
|
65
66
|
}),
|
|
66
|
-
});
|
|
67
|
+
}, { timeoutMs: JUDGE_TIMEOUT_MS, fetchFn: opts.fetcher });
|
|
67
68
|
}
|
|
68
69
|
catch {
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
-
return { retryable: true };
|
|
73
|
-
if (!res.ok)
|
|
74
|
-
return null;
|
|
75
|
-
return { res };
|
|
72
|
+
return res.ok ? res : null;
|
|
76
73
|
}
|
|
77
74
|
/** `null` on any failure, so a Jev outage degrades capture to today's
|
|
78
75
|
* behaviour instead of blocking the write. */
|
|
@@ -80,19 +77,15 @@ export async function judge(content, opts) {
|
|
|
80
77
|
const trimmed = content.trim();
|
|
81
78
|
if (trimmed.length < 3)
|
|
82
79
|
return null;
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
86
|
-
attempt = await postOnce(trimmed, opts);
|
|
87
|
-
}
|
|
88
|
-
if (!attempt || 'retryable' in attempt)
|
|
80
|
+
const res = await post(trimmed, opts);
|
|
81
|
+
if (!res)
|
|
89
82
|
return null;
|
|
90
83
|
let data;
|
|
91
84
|
try {
|
|
92
85
|
// SAFETY: the documented Jev response is `{ answers: { <name>: Answer } }`
|
|
93
86
|
// keyed by the question names posted above; every field read below is
|
|
94
87
|
// optional-chained and range-checked before use, so a lie here returns null.
|
|
95
|
-
data = await
|
|
88
|
+
data = await res.json();
|
|
96
89
|
}
|
|
97
90
|
catch {
|
|
98
91
|
return null;
|
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Leveled stderr logger. `HIPPO_LOG` picks the threshold (error, warn, info, debug); unset or unknown means warn. */
|
|
2
|
+
export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
|
|
3
|
+
/** Extra key=value pairs appended to the line; `requestId` ties a line to one HTTP request. */
|
|
4
|
+
export interface LogFields {
|
|
5
|
+
requestId?: string;
|
|
6
|
+
[key: string]: string | number | boolean | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** The active threshold, read on every call so a test or a long-lived server can change it without a restart. */
|
|
9
|
+
export declare function logThreshold(): LogLevel;
|
|
10
|
+
export declare function isLevelEnabled(level: LogLevel): boolean;
|
|
11
|
+
/** Same `[hippo] ` prefix the existing stderr lines use, so default-level output reads as before. */
|
|
12
|
+
export declare function formatLogLine(level: LogLevel, message: string, fields?: LogFields): string;
|
|
13
|
+
/** Write `message` at `level` the first time `key` is seen in this process; later calls are dropped. */
|
|
14
|
+
declare function once(key: string, level: LogLevel, message: string, fields?: LogFields): void;
|
|
15
|
+
export declare const log: {
|
|
16
|
+
readonly error: (message: string, fields?: LogFields) => void;
|
|
17
|
+
readonly warn: (message: string, fields?: LogFields) => void;
|
|
18
|
+
readonly info: (message: string, fields?: LogFields) => void;
|
|
19
|
+
readonly debug: (message: string, fields?: LogFields) => void;
|
|
20
|
+
readonly once: typeof once;
|
|
21
|
+
};
|
|
22
|
+
/** Test hook: forget which once-keys have fired. */
|
|
23
|
+
export declare function resetLogOnce(): void;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=log.d.ts.map
|
package/dist/log.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Leveled stderr logger. `HIPPO_LOG` picks the threshold (error, warn, info, debug); unset or unknown means warn. */
|
|
2
|
+
const RANK = { error: 0, warn: 1, info: 2, debug: 3 };
|
|
3
|
+
function isLogLevel(value) {
|
|
4
|
+
return Object.hasOwn(RANK, value);
|
|
5
|
+
}
|
|
6
|
+
/** The active threshold, read on every call so a test or a long-lived server can change it without a restart. */
|
|
7
|
+
export function logThreshold() {
|
|
8
|
+
const raw = process.env.HIPPO_LOG?.trim().toLowerCase() ?? '';
|
|
9
|
+
return isLogLevel(raw) ? raw : 'warn';
|
|
10
|
+
}
|
|
11
|
+
export function isLevelEnabled(level) {
|
|
12
|
+
return RANK[level] <= RANK[logThreshold()];
|
|
13
|
+
}
|
|
14
|
+
// A field value is caller data; flattening newlines keeps one event on one line.
|
|
15
|
+
const oneLine = (value) => value.replace(/[\r\n]+/g, ' ');
|
|
16
|
+
/** Same `[hippo] ` prefix the existing stderr lines use, so default-level output reads as before. */
|
|
17
|
+
export function formatLogLine(level, message, fields = {}) {
|
|
18
|
+
const extras = Object.entries(fields)
|
|
19
|
+
.filter(([, v]) => v !== undefined)
|
|
20
|
+
.map(([k, v]) => ` ${k}=${oneLine(String(v))}`)
|
|
21
|
+
.join('');
|
|
22
|
+
return `[hippo] ${level}: ${oneLine(message)}${extras}`;
|
|
23
|
+
}
|
|
24
|
+
function write(level, message, fields) {
|
|
25
|
+
if (!isLevelEnabled(level))
|
|
26
|
+
return;
|
|
27
|
+
process.stderr.write(`${formatLogLine(level, message, fields)}\n`);
|
|
28
|
+
}
|
|
29
|
+
const onceKeys = new Set();
|
|
30
|
+
/** Write `message` at `level` the first time `key` is seen in this process; later calls are dropped. */
|
|
31
|
+
function once(key, level, message, fields) {
|
|
32
|
+
if (onceKeys.has(key))
|
|
33
|
+
return;
|
|
34
|
+
onceKeys.add(key);
|
|
35
|
+
write(level, message, fields);
|
|
36
|
+
}
|
|
37
|
+
export const log = {
|
|
38
|
+
error: (message, fields) => write('error', message, fields),
|
|
39
|
+
warn: (message, fields) => write('warn', message, fields),
|
|
40
|
+
info: (message, fields) => write('info', message, fields),
|
|
41
|
+
debug: (message, fields) => write('debug', message, fields),
|
|
42
|
+
once,
|
|
43
|
+
};
|
|
44
|
+
/** Test hook: forget which once-keys have fired. */
|
|
45
|
+
export function resetLogOnce() {
|
|
46
|
+
onceKeys.clear();
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=log.js.map
|