renor-engine 1.2.0 → 1.3.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 +21 -1
- package/THIRD-PARTY-NOTICES +2661 -0
- package/dist/BUILD.json +6 -0
- package/dist/cli.js +1656 -516
- package/package.json +16 -80
- package/dist/.tsbuildinfo +0 -1
- package/dist/api/apiAuth.js +0 -43
- package/dist/api/server.js +0 -174
- package/dist/buildIdentity.js +0 -149
- package/dist/callPhases.js +0 -82
- package/dist/cli-extractors.js +0 -46
- package/dist/config.js +0 -65
- package/dist/context/composer.js +0 -320
- package/dist/context/readHonesty.js +0 -478
- package/dist/context/rowStore.js +0 -238
- package/dist/conversation/formatter.js +0 -81
- package/dist/conversation/parser.js +0 -193
- package/dist/conversation/types.js +0 -2
- package/dist/conversation/writer.js +0 -42
- package/dist/db/client.js +0 -149
- package/dist/db/handoffTable.js +0 -31
- package/dist/db/indexSalvage.js +0 -101
- package/dist/db/migrations.js +0 -670
- package/dist/db/readCache.js +0 -109
- package/dist/db/schema.js +0 -5
- package/dist/db/sqlite.js +0 -396
- package/dist/db/statements.js +0 -89
- package/dist/digests/digestCache.js +0 -146
- package/dist/digests/digests.js +0 -597
- package/dist/digests/worker.js +0 -350
- package/dist/embeddings/caching.js +0 -337
- package/dist/embeddings/coalescing.js +0 -177
- package/dist/embeddings/interactive.js +0 -103
- package/dist/embeddings/local.js +0 -70
- package/dist/embeddings/openai.js +0 -106
- package/dist/embeddings/rebuild.js +0 -166
- package/dist/embeddings/simdScan.js +0 -260
- package/dist/embeddings/space.js +0 -21
- package/dist/embeddings/types.js +0 -14
- package/dist/embeddings/vectorIndex.js +0 -674
- package/dist/embeddings/vertex.js +0 -334
- package/dist/eval/artifacts.js +0 -42
- package/dist/eval/cacheReport.js +0 -146
- package/dist/eval/comparison.js +0 -182
- package/dist/eval/context700-candidate.js +0 -145
- package/dist/eval/evalCache.js +0 -568
- package/dist/eval/hashEmbedding.js +0 -35
- package/dist/eval/indexSnapshots.js +0 -549
- package/dist/eval/longmemeval.js +0 -56
- package/dist/eval/metrics.js +0 -181
- package/dist/eval/pageDump.js +0 -67
- package/dist/eval/renorbenchBaseline.js +0 -486
- package/dist/eval/renorbenchDocuments.js +0 -134
- package/dist/eval/renorbenchProduct.js +0 -182
- package/dist/eval/runLedger.js +0 -279
- package/dist/eval/runManifest.js +0 -485
- package/dist/eval/scoring.js +0 -197
- package/dist/eval/textTokens.js +0 -17
- package/dist/evidence/attach.js +0 -264
- package/dist/evidence/background.js +0 -147
- package/dist/evidence/evidenceCache.js +0 -182
- package/dist/evidence/gate.js +0 -37
- package/dist/evidence/keyPool.js +0 -85
- package/dist/evidence/ollamaChat.js +0 -84
- package/dist/evidence/optin.js +0 -165
- package/dist/evidence/options.js +0 -151
- package/dist/evidence/secondPass.js +0 -294
- package/dist/extraction/classifyCapture.js +0 -34
- package/dist/extraction/decision-model.js +0 -174
- package/dist/extraction/eventExtractor.js +0 -113
- package/dist/extraction/extractionClient.js +0 -122
- package/dist/extraction/factExtractor.js +0 -46
- package/dist/extraction/factsWritePath.js +0 -179
- package/dist/extraction/jevDecisionModel.js +0 -307
- package/dist/extraction/preferenceExtractor.js +0 -150
- package/dist/extraction/secretGuard.js +0 -180
- package/dist/extraction/secretScanner.js +0 -665
- package/dist/extraction/typedFacts.js +0 -224
- package/dist/extraction/writePathAdjudication.js +0 -110
- package/dist/importing/apply.js +0 -672
- package/dist/importing/bundle-write.js +0 -80
- package/dist/importing/cli.js +0 -408
- package/dist/importing/existing.js +0 -51
- package/dist/importing/facts.js +0 -121
- package/dist/importing/forgetImported.js +0 -79
- package/dist/importing/hosted.js +0 -467
- package/dist/importing/journalLog.js +0 -96
- package/dist/importing/markdown.js +0 -98
- package/dist/importing/plan.js +0 -201
- package/dist/importing/secretScreen.js +0 -113
- package/dist/importing/serialize.js +0 -188
- package/dist/importing/source.js +0 -463
- package/dist/importing/types.js +0 -6
- package/dist/indexer/chunker.js +0 -319
- package/dist/indexer/dailyEntries.js +0 -63
- package/dist/indexer/hasher.js +0 -10
- package/dist/indexer/laneRuns.js +0 -48
- package/dist/indexer/o200k.js +0 -481
- package/dist/indexer/outsideRoot.js +0 -77
- package/dist/indexer/parser.js +0 -170
- package/dist/indexer/pipeline.js +0 -988
- package/dist/indexer/staleness.js +0 -201
- package/dist/indexer/tokenizer.js +0 -77
- package/dist/indexer/walker.js +0 -170
- package/dist/learning/cli.js +0 -113
- package/dist/learning/schema.js +0 -144
- package/dist/learning/settings.js +0 -45
- package/dist/learning/store.js +0 -267
- package/dist/learning/tap.js +0 -401
- package/dist/mcp/hive.js +0 -88
- package/dist/mcp/requestErrors.js +0 -47
- package/dist/mcp/server.js +0 -426
- package/dist/memory/agentLease.js +0 -43
- package/dist/memory/confinedWrite.js +0 -315
- package/dist/memory/controls.js +0 -73
- package/dist/memory/dailyNote.js +0 -265
- package/dist/memory/dreamer/adjudicate.js +0 -215
- package/dist/memory/dreamer/apply.js +0 -120
- package/dist/memory/dreamer/budget.js +0 -64
- package/dist/memory/dreamer/candidates.js +0 -149
- package/dist/memory/dreamer/collection.js +0 -104
- package/dist/memory/dreamer/dreamer.js +0 -352
- package/dist/memory/dreamer/review.js +0 -111
- package/dist/memory/durableAppend.js +0 -57
- package/dist/memory/factConflicts.js +0 -205
- package/dist/memory/factTerms.js +0 -321
- package/dist/memory/handoff.js +0 -363
- package/dist/memory/hiveNameHeader.cjs +0 -10
- package/dist/memory/inventory.js +0 -55
- package/dist/memory/invisibleText.js +0 -20
- package/dist/memory/lifecycle.js +0 -2014
- package/dist/memory/limits.js +0 -13
- package/dist/memory/requests.js +0 -183
- package/dist/memory/sourceName.js +0 -276
- package/dist/memory/statusFacts.js +0 -61
- package/dist/memory/whatsNew.js +0 -158
- package/dist/memory/writer.js +0 -176
- package/dist/memory/writerConflicts.js +0 -85
- package/dist/memorymap/memoryMap.js +0 -1594
- package/dist/memorymap/replacedJournal.js +0 -58
- package/dist/memorymap/replacements.js +0 -410
- package/dist/mvp/activity.js +0 -86
- package/dist/mvp/agentMemory.js +0 -1803
- package/dist/mvp/answerCheck.js +0 -211
- package/dist/mvp/auth.js +0 -531
- package/dist/mvp/cli.js +0 -86
- package/dist/mvp/client-store.js +0 -462
- package/dist/mvp/compileCache.js +0 -242
- package/dist/mvp/compileSeed.js +0 -33
- package/dist/mvp/config.js +0 -292
- package/dist/mvp/connectionStatus.js +0 -80
- package/dist/mvp/contextDistinct.js +0 -53
- package/dist/mvp/contextProfile.js +0 -87
- package/dist/mvp/contextRelevance.js +0 -413
- package/dist/mvp/directorySurface.js +0 -68
- package/dist/mvp/engine.js +0 -1078
- package/dist/mvp/exportAll.js +0 -393
- package/dist/mvp/factLanePack.js +0 -77
- package/dist/mvp/factMarkers.js +0 -65
- package/dist/mvp/factsLane.js +0 -203
- package/dist/mvp/hiddenSpans.js +0 -585
- package/dist/mvp/history.js +0 -414
- package/dist/mvp/hitDates.js +0 -31
- package/dist/mvp/hitFloor.js +0 -36
- package/dist/mvp/identity.js +0 -18
- package/dist/mvp/idle.js +0 -113
- package/dist/mvp/log.js +0 -118
- package/dist/mvp/memoryDir.js +0 -98
- package/dist/mvp/posthogMcp.js +0 -210
- package/dist/mvp/readScope.js +0 -104
- package/dist/mvp/readUsefulness.js +0 -222
- package/dist/mvp/sanitize.js +0 -48
- package/dist/mvp/schemaRejections.js +0 -91
- package/dist/mvp/scope.js +0 -127
- package/dist/mvp/server.js +0 -2712
- package/dist/mvp/serverCard.js +0 -38
- package/dist/mvp/storedSize.js +0 -139
- package/dist/mvp/telemetry.js +0 -474
- package/dist/net/poolFetch.js +0 -174
- package/dist/recall/actionRecall.js +0 -282
- package/dist/recall/autoRecall.js +0 -447
- package/dist/recall/searchRecall.js +0 -189
- package/dist/retrieval/adviceLines.js +0 -195
- package/dist/retrieval/adviceQuestion.js +0 -44
- package/dist/retrieval/conversationShape.js +0 -44
- package/dist/retrieval/dailyEntryTime.js +0 -55
- package/dist/retrieval/entityLookup.js +0 -162
- package/dist/retrieval/factsFirst.js +0 -188
- package/dist/retrieval/keyword.js +0 -84
- package/dist/retrieval/ledgerEventTime.js +0 -51
- package/dist/retrieval/ledgerLiveness.js +0 -83
- package/dist/retrieval/ledgerPresentation.js +0 -161
- package/dist/retrieval/noteIdentity.js +0 -57
- package/dist/retrieval/orchestrator.js +0 -1224
- package/dist/retrieval/plainWording.js +0 -236
- package/dist/retrieval/queryHelpers.js +0 -142
- package/dist/retrieval/questionSpan.js +0 -475
- package/dist/retrieval/rankingTrace.js +0 -184
- package/dist/retrieval/readerEvents.js +0 -690
- package/dist/retrieval/readerLayout.js +0 -422
- package/dist/retrieval/relativeTimeHints.js +0 -113
- package/dist/retrieval/semantic.js +0 -67
- package/dist/router/routerCache.js +0 -106
- package/dist/router/sessionRouter.js +0 -726
- package/dist/sharing/cli.js +0 -181
- package/dist/sharing/examples.js +0 -136
- package/dist/sharing/fields.js +0 -225
- package/dist/sharing/loop.js +0 -80
- package/dist/sharing/project.js +0 -327
- package/dist/sharing/send.js +0 -466
- package/dist/sharing/state.js +0 -222
- package/dist/sharing/wording.js +0 -48
- package/dist/toolRefusal.js +0 -120
- package/dist/watcher/watcher.js +0 -77
- /package/dist/{indexer/o200k.json → o200k.json} +0 -0
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RouterCache = exports.ROUTER_CACHE_SCHEMA_VERSION = void 0;
|
|
7
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const sqlite_1 = __importDefault(require("../db/sqlite"));
|
|
11
|
-
/**
|
|
12
|
-
* Content-addressed cache for the session router (RENOR_SESSION_ROUTER, src/router/sessionRouter.ts): the
|
|
13
|
-
* per-note summaries the router reads, and the router's own answers.
|
|
14
|
-
*
|
|
15
|
-
* summary key = sha256(schema \0 'summary' \0 model \0 sha256(summary prompt template) \0 note_hash)
|
|
16
|
-
* route key = sha256(schema \0 'route' \0 model \0 exact rendered routing prompt)
|
|
17
|
-
*
|
|
18
|
-
* A note's summary is keyed by the hash of the note's file (the index's `note_hash`), so an edited note gets a new
|
|
19
|
-
* summary and an unchanged one is never paid for twice; a changed prompt template invalidates every summary.
|
|
20
|
-
* A routing answer is keyed by the exact prompt, which already holds the question and every node it was shown.
|
|
21
|
-
* Only answers that parsed are stored (as in the evidence cache, a malformed response is never cached), so a
|
|
22
|
-
* replay is always a usable answer.
|
|
23
|
-
*
|
|
24
|
-
* Design follows src/evidence/evidenceCache.ts: SQLite + WAL + busy_timeout=10000 + INSERT OR IGNORE.
|
|
25
|
-
*/
|
|
26
|
-
exports.ROUTER_CACHE_SCHEMA_VERSION = 'session-router-v1';
|
|
27
|
-
const sha256 = (text) => node_crypto_1.default.createHash('sha256').update(text).digest('hex');
|
|
28
|
-
class RouterCache {
|
|
29
|
-
db;
|
|
30
|
-
getSummaryStmt;
|
|
31
|
-
putSummaryStmt;
|
|
32
|
-
getRouteStmt;
|
|
33
|
-
putRouteStmt;
|
|
34
|
-
touchRouteStmt;
|
|
35
|
-
constructor(dbPath) {
|
|
36
|
-
node_fs_1.default.mkdirSync(node_path_1.default.dirname(dbPath), { recursive: true });
|
|
37
|
-
this.db = new sqlite_1.default(dbPath);
|
|
38
|
-
this.db.pragma('journal_mode = WAL');
|
|
39
|
-
this.db.pragma('busy_timeout = 10000');
|
|
40
|
-
this.db.exec(`
|
|
41
|
-
CREATE TABLE IF NOT EXISTS note_summaries (
|
|
42
|
-
cache_key TEXT PRIMARY KEY,
|
|
43
|
-
schema_version TEXT NOT NULL,
|
|
44
|
-
model TEXT NOT NULL,
|
|
45
|
-
note_hash TEXT NOT NULL,
|
|
46
|
-
title TEXT NOT NULL,
|
|
47
|
-
summary TEXT NOT NULL,
|
|
48
|
-
created_at TEXT NOT NULL
|
|
49
|
-
);
|
|
50
|
-
CREATE TABLE IF NOT EXISTS router_answers (
|
|
51
|
-
cache_key TEXT PRIMARY KEY,
|
|
52
|
-
schema_version TEXT NOT NULL,
|
|
53
|
-
model TEXT NOT NULL,
|
|
54
|
-
node_ids_json TEXT NOT NULL,
|
|
55
|
-
thinking TEXT NOT NULL,
|
|
56
|
-
prompt_tokens INTEGER NOT NULL DEFAULT 0,
|
|
57
|
-
completion_tokens INTEGER NOT NULL DEFAULT 0,
|
|
58
|
-
latency_ms INTEGER NOT NULL DEFAULT 0,
|
|
59
|
-
created_at TEXT NOT NULL,
|
|
60
|
-
hits INTEGER NOT NULL DEFAULT 0
|
|
61
|
-
);
|
|
62
|
-
`);
|
|
63
|
-
this.getSummaryStmt = this.db.prepare('SELECT title, summary, model FROM note_summaries WHERE cache_key = ?');
|
|
64
|
-
this.putSummaryStmt = this.db.prepare(`INSERT OR IGNORE INTO note_summaries (cache_key, schema_version, model, note_hash, title, summary, created_at)
|
|
65
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`);
|
|
66
|
-
this.getRouteStmt = this.db.prepare('SELECT node_ids_json, thinking, model, prompt_tokens, completion_tokens, latency_ms FROM router_answers WHERE cache_key = ?');
|
|
67
|
-
this.putRouteStmt = this.db.prepare(`INSERT OR IGNORE INTO router_answers
|
|
68
|
-
(cache_key, schema_version, model, node_ids_json, thinking, prompt_tokens, completion_tokens, latency_ms, created_at, hits)
|
|
69
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 0)`);
|
|
70
|
-
this.touchRouteStmt = this.db.prepare('UPDATE router_answers SET hits = hits + 1 WHERE cache_key = ?');
|
|
71
|
-
}
|
|
72
|
-
static summaryKey(model, promptTemplate, noteHash) {
|
|
73
|
-
return sha256(`${exports.ROUTER_CACHE_SCHEMA_VERSION}\0summary\0${model}\0${sha256(promptTemplate)}\0${noteHash}`);
|
|
74
|
-
}
|
|
75
|
-
static routeKey(model, prompt) {
|
|
76
|
-
return sha256(`${exports.ROUTER_CACHE_SCHEMA_VERSION}\0route\0${model}\0${prompt}`);
|
|
77
|
-
}
|
|
78
|
-
getSummary(key) {
|
|
79
|
-
const row = this.getSummaryStmt.get(key);
|
|
80
|
-
return row ?? null;
|
|
81
|
-
}
|
|
82
|
-
putSummary(key, noteHash, entry) {
|
|
83
|
-
this.putSummaryStmt.run(key, exports.ROUTER_CACHE_SCHEMA_VERSION, entry.model, noteHash, entry.title, entry.summary, new Date().toISOString());
|
|
84
|
-
}
|
|
85
|
-
getRoute(key) {
|
|
86
|
-
const row = this.getRouteStmt.get(key);
|
|
87
|
-
if (!row)
|
|
88
|
-
return null;
|
|
89
|
-
this.touchRouteStmt.run(key);
|
|
90
|
-
return {
|
|
91
|
-
nodeIds: JSON.parse(row.node_ids_json),
|
|
92
|
-
thinking: row.thinking,
|
|
93
|
-
model: row.model,
|
|
94
|
-
promptTokens: row.prompt_tokens,
|
|
95
|
-
completionTokens: row.completion_tokens,
|
|
96
|
-
latencyMs: row.latency_ms,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
putRoute(key, entry) {
|
|
100
|
-
this.putRouteStmt.run(key, exports.ROUTER_CACHE_SCHEMA_VERSION, entry.model, JSON.stringify(entry.nodeIds), entry.thinking, entry.promptTokens, entry.completionTokens, entry.latencyMs, new Date().toISOString());
|
|
101
|
-
}
|
|
102
|
-
close() {
|
|
103
|
-
this.db.close();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.RouterCache = RouterCache;
|