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/token-ledger.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ import type { DatabaseSyncLike } from './db.js';
|
|
|
7
7
|
* - `context`, `recall`: the CLI commands.
|
|
8
8
|
* - `mcp_recall`, `mcp_context`: the MCP tools.
|
|
9
9
|
* - `http_recall`, `http_context`, `http_assemble`: the HTTP API.
|
|
10
|
+
* - `pilot`: the session's pilot arm row (src/pilot-arm.ts); not a send, so it is in no surface list.
|
|
10
11
|
*/
|
|
11
|
-
export type TokenSurface = 'hook' | 'hook_recall' | 'compact_resume' | 'context' | 'recall' | 'mcp_recall' | 'mcp_context' | 'http_recall' | 'http_context' | 'http_assemble';
|
|
12
|
+
export type TokenSurface = 'hook' | 'hook_recall' | 'compact_resume' | 'context' | 'recall' | 'mcp_recall' | 'mcp_context' | 'http_recall' | 'http_context' | 'http_assemble' | 'pilot';
|
|
12
13
|
/** All surfaces, in report order. */
|
|
13
14
|
export declare const TOKEN_SURFACES: readonly TokenSurface[];
|
|
14
15
|
/** Surfaces whose re-reads are counted: only a hook payload tells a sub-agent's block from its parent's, as both carry one session id. */
|
|
@@ -19,8 +20,9 @@ export declare const REREAD_SURFACES: readonly TokenSurface[];
|
|
|
19
20
|
* - `skip`: identical to the session's last injected block, so not sent again.
|
|
20
21
|
* - `reset`: the host compacted its context, so the next block must be sent.
|
|
21
22
|
* - `reread`: tokens later calls read again, booked at session end as one row per session, hook surface and UTC day of the calls.
|
|
23
|
+
* - `arm`: the pilot assignment; `block_hash` is `hippo` or `holdout`, `items` the holdout rate in basis points.
|
|
22
24
|
*/
|
|
23
|
-
export type TokenEvent = 'inject' | 'skip' | 'reset' | 'reread';
|
|
25
|
+
export type TokenEvent = 'inject' | 'skip' | 'reset' | 'reread' | 'arm';
|
|
24
26
|
/** Rows older than this are pruned on write. */
|
|
25
27
|
export declare const TOKEN_LEDGER_RETENTION_DAYS = 90;
|
|
26
28
|
/**
|
package/dist/token-ledger.js
CHANGED
|
@@ -125,7 +125,7 @@ export function summarizeTokenUse(db, tenantId, sinceIso) {
|
|
|
125
125
|
COUNT(DISTINCT CASE WHEN event = 'reread' THEN session_id END) AS reread_sessions,
|
|
126
126
|
SUM(CASE WHEN event = 'inject' THEN tokens ELSE 0 END) AS tokens
|
|
127
127
|
FROM token_ledger
|
|
128
|
-
WHERE tenant_id = ? AND ts >= ? AND session_id IS NOT NULL`).get(...REREAD_SURFACES, tenantId, sinceIso);
|
|
128
|
+
WHERE tenant_id = ? AND ts >= ? AND session_id IS NOT NULL AND event <> 'arm'`).get(...REREAD_SURFACES, tenantId, sinceIso);
|
|
129
129
|
const sessionCount = Number(perSession?.sessions ?? 0);
|
|
130
130
|
const sessionTokens = Number(perSession?.tokens ?? 0);
|
|
131
131
|
return {
|
|
@@ -197,7 +197,7 @@ export function tokensBySession(db, tenantId, sinceIso) {
|
|
|
197
197
|
SUM(CASE WHEN event = 'skip' THEN tokens ELSE 0 END) AS skipped,
|
|
198
198
|
SUM(CASE WHEN event = 'inject' THEN 1 ELSE 0 END) AS injections
|
|
199
199
|
FROM token_ledger
|
|
200
|
-
WHERE tenant_id = ? AND ts >= ? AND session_id IS NOT NULL
|
|
200
|
+
WHERE tenant_id = ? AND ts >= ? AND session_id IS NOT NULL AND event <> 'arm'
|
|
201
201
|
GROUP BY session_id`).all(tenantId, sinceIso);
|
|
202
202
|
return rows.map((r) => ({
|
|
203
203
|
sessionId: r.session_id,
|
package/dist/tokenize.js
ADDED
package/dist/version.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* an ESM `import` can resolve cleanly, and a hardcoded constant survives
|
|
17
17
|
* any packager that drops .json files.
|
|
18
18
|
*/
|
|
19
|
-
export declare const PACKAGE_VERSION = "1.
|
|
19
|
+
export declare const PACKAGE_VERSION = "1.58.0";
|
|
20
20
|
/** Compares plain x.y.z versions, positive if a > b; tags throw so the rollback guard never misfires silently. */
|
|
21
21
|
export declare function compareSemver(a: string, b: string): number;
|
|
22
22
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* an ESM `import` can resolve cleanly, and a hardcoded constant survives
|
|
17
17
|
* any packager that drops .json files.
|
|
18
18
|
*/
|
|
19
|
-
export const PACKAGE_VERSION = '1.
|
|
19
|
+
export const PACKAGE_VERSION = '1.58.0';
|
|
20
20
|
/** Compares plain x.y.z versions, positive if a > b; tags throw so the rollback guard never misfires silently. */
|
|
21
21
|
export function compareSemver(a, b) {
|
|
22
22
|
const parse = (v) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "hippo-memory",
|
|
3
3
|
"name": "Hippo Memory",
|
|
4
4
|
"description": "Memory for AI agents that learns what is wrong and ranks it down. Injects context at session start and captures errors.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.58.0",
|
|
6
6
|
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "hippo-memory",
|
|
3
3
|
"name": "Hippo Memory",
|
|
4
4
|
"description": "Memory for AI agents that learns what is wrong and ranks it down. Injects context at session start and captures errors.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.58.0",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hippo-memory",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"description": "Memory for AI agents that learns what is wrong and ranks it down. MCP server, hooks for Claude Code, OpenCode and Codex, AGENTS.md instructions for Codex, Cursor, OpenClaw and Pi. SQLite, zero runtime deps.",
|
|
5
5
|
"mcpName": "io.github.kitfunso/hippo-memory",
|
|
6
6
|
"type": "module",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface RetryOpts {
|
|
2
|
-
url: string;
|
|
3
|
-
init?: RequestInit;
|
|
4
|
-
fetchImpl?: typeof fetch;
|
|
5
|
-
sleep?: (ms: number) => Promise<void>;
|
|
6
|
-
maxRetries?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function fetchWithRetry(opts: RetryOpts): Promise<Response>;
|
|
9
|
-
//# sourceMappingURL=ratelimit.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export async function fetchWithRetry(opts) {
|
|
2
|
-
const f = opts.fetchImpl ?? fetch;
|
|
3
|
-
const sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
4
|
-
const max = opts.maxRetries ?? 3;
|
|
5
|
-
let attempt = 0;
|
|
6
|
-
while (true) {
|
|
7
|
-
const r = await f(opts.url, opts.init);
|
|
8
|
-
if (r.status !== 429)
|
|
9
|
-
return r;
|
|
10
|
-
if (attempt >= max)
|
|
11
|
-
throw new Error(`rate-limited after ${attempt + 1} attempts: ${opts.url}`);
|
|
12
|
-
const ra = r.headers.get('retry-after');
|
|
13
|
-
const delaySec = ra ? Number(ra) : Math.pow(2, attempt);
|
|
14
|
-
await sleep(Math.max(0, delaySec) * 1000);
|
|
15
|
-
attempt++;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ratelimit.js.map
|