memhtml 0.2.2 → 0.2.4
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 +10 -6
- package/agent/channels/eve.ts +1 -1
- package/dist/{dist-DBdR0zt7.mjs → dist-Dj-MYf9q.mjs} +1 -1
- package/dist/{dist-0IU3R2cD.mjs → dist-dfrcDFad.mjs} +38 -38
- package/dist/dist-dfrcDFad.mjs.map +1 -0
- package/dist/{dist-CI2-0MRk.mjs → dist-t84Q_98w.mjs} +6 -6
- package/dist/dist-t84Q_98w.mjs.map +1 -0
- package/dist/memhtml-mcp.mjs +16 -16
- package/dist/memhtml-mcp.mjs.map +1 -1
- package/dist/memhtml.mjs +19 -19
- package/dist/memhtml.mjs.map +1 -1
- package/package.json +2 -1
- package/src/agent-build.ts +1 -1
- package/src/client.ts +2 -2
- package/src/contract.ts +2 -2
- package/src/mount.ts +1 -1
- package/dist/dist-0IU3R2cD.mjs.map +0 -1
- package/dist/dist-CI2-0MRk.mjs.map +0 -1
package/dist/memhtml.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as STATE_SIDECAR_PATH, A as makeIndexRecorder, B as makeGitPort, C as ModelClientLive, D as EMBED_DIM, E as EmbeddingsLive, F as reinforce, G as STATE_MIGRATIONS_DIR, H as DatabaseService, I as Indexer, J as expandRoot, K as STATE_SCHEMA, L as makeIndexer, M as readWatermark, N as Retrieval, O as EMBED_WATERMARK, P as makeRetrieval, Q as STATE_DB_PATH, R as readIndexState, S as ModelClient, T as Embeddings, U as makeDatabase, V as sanitizeFtsQuery, W as MIGRATIONS_DIR, X as INDEX_DB_PATH, Y as makeStore, _ as unlink, a as parseSidecar, at as commitSubject, b as discriminationGate, c as generateArtifacts, ct as isValidDatetime, d as danglingEdges, dt as REINFORCE_SIGNALS, et as attemptIo, f as publishRows, ft as frameKeyOf, g as meta, h as link, i as makeSleep, it as makeGit, j as persistScanned, k as IndexRecorder, l as accessRows, lt as closesFence, m as hrefFor, n as scanTraceRoot, nt as readFileOrNull, o as renderSidecar, ot as checkMemory, p as applyHeadEdits, q as Store, r as Sleep, rt as Git, s as archivedFormOf, st as setMeta, t as mergeTailExtract, tt as initRepo, u as allPaths, ut as fenceOpeningOf, v as SLEEP_PHASES, w as wrapAsData, x as runDiscrimination, y as isSleepPhase, z as IndexGit } from "./dist-
|
|
3
|
-
import { B as ModelUnavailable, G as MEMORY_RELS, H as StorageFailure, J as relClassFor, K as TASK_RELS, N as hasConsolidatorCredentials, Q as INBOX_DIR, R as InvalidMemory, gt as TASK_STATUSES, i as makeConsolidator, ot as normalizePath, q as isEdgeRel, tt as TASKS_SUBDIR, vt as WRITABLE_MEMORY_TYPES, yt as isTaskStatus } from "./dist-
|
|
2
|
+
import { $ as STATE_SIDECAR_PATH, A as makeIndexRecorder, B as makeGitPort, C as ModelClientLive, D as EMBED_DIM, E as EmbeddingsLive, F as reinforce, G as STATE_MIGRATIONS_DIR, H as DatabaseService, I as Indexer, J as expandRoot, K as STATE_SCHEMA, L as makeIndexer, M as readWatermark, N as Retrieval, O as EMBED_WATERMARK, P as makeRetrieval, Q as STATE_DB_PATH, R as readIndexState, S as ModelClient, T as Embeddings, U as makeDatabase, V as sanitizeFtsQuery, W as MIGRATIONS_DIR, X as INDEX_DB_PATH, Y as makeStore, _ as unlink, a as parseSidecar, at as commitSubject, b as discriminationGate, c as generateArtifacts, ct as isValidDatetime, d as danglingEdges, dt as REINFORCE_SIGNALS, et as attemptIo, f as publishRows, ft as frameKeyOf, g as meta, h as link, i as makeSleep, it as makeGit, j as persistScanned, k as IndexRecorder, l as accessRows, lt as closesFence, m as hrefFor, n as scanTraceRoot, nt as readFileOrNull, o as renderSidecar, ot as checkMemory, p as applyHeadEdits, q as Store, r as Sleep, rt as Git, s as archivedFormOf, st as setMeta, t as mergeTailExtract, tt as initRepo, u as allPaths, ut as fenceOpeningOf, v as SLEEP_PHASES, w as wrapAsData, x as runDiscrimination, y as isSleepPhase, z as IndexGit } from "./dist-dfrcDFad.mjs";
|
|
3
|
+
import { B as ModelUnavailable, G as MEMORY_RELS, H as StorageFailure, J as relClassFor, K as TASK_RELS, N as hasConsolidatorCredentials, Q as INBOX_DIR, R as InvalidMemory, gt as TASK_STATUSES, i as makeConsolidator, ot as normalizePath, q as isEdgeRel, tt as TASKS_SUBDIR, vt as WRITABLE_MEMORY_TYPES, yt as isTaskStatus } from "./dist-t84Q_98w.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { Config, Context, Effect, Layer, Logger } from "effect";
|
|
6
6
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -112,7 +112,7 @@ const CONFIG_VARS = [
|
|
|
112
112
|
* reads.
|
|
113
113
|
*/
|
|
114
114
|
name: MCP_BIN_VAR,
|
|
115
|
-
description: "An explicit path to the `memhtml-mcp` entry point, read only by the `memhtml serve mcp` supervisor. Absent means the sibling-path default. The two apps ship as one build, so `apps/cli/dist/serve.js` finds `apps/mcp/dist/bin.js` two directories over. An operator sets it for a split deployment that does not keep the apps side by side; it locates the server rather than configuring the store, so it changes no retrieval
|
|
115
|
+
description: "An explicit path to the `memhtml-mcp` entry point, read only by the `memhtml serve mcp` supervisor. Absent means the sibling-path default. The two apps ship as one build, so `apps/cli/dist/serve.js` finds `apps/mcp/dist/bin.js` two directories over. An operator sets it for a split deployment that does not keep the apps side by side; it locates the server rather than configuring the store, so it changes no retrieval behavior.",
|
|
116
116
|
fallback: null
|
|
117
117
|
}
|
|
118
118
|
];
|
|
@@ -208,7 +208,7 @@ const render = (payload, dense) => dense ? JSON.stringify(stripNulls(payload)) :
|
|
|
208
208
|
//#region apps/cli/src/extraction.ts
|
|
209
209
|
/**
|
|
210
210
|
* GPT-5.6 Luna, the fast high-volume model on the mantle endpoint. A constant rather than config
|
|
211
|
-
* because the schema below is tested against this model's strict-mode
|
|
211
|
+
* because the schema below is tested against this model's strict-mode behavior. Changing the model
|
|
212
212
|
* is a code change with a test run, not an env var.
|
|
213
213
|
*/
|
|
214
214
|
const EXTRACTION_MODEL_ID = "openai.gpt-5.6-luna";
|
|
@@ -517,7 +517,7 @@ const ConsolidatorPortService = Context.Service("memhtml/ConsolidatorPort");
|
|
|
517
517
|
* fails on every call and reports a degradation. CI has no credentials and must read as skipped rather
|
|
518
518
|
* than degraded.
|
|
519
519
|
*
|
|
520
|
-
* The check cannot be skipped in
|
|
520
|
+
* The check cannot be skipped in favor of the client's own, because the provider is lazy.
|
|
521
521
|
* `createAmazonBedrock` and `provider(modelId)` both succeed with zero credentials and nothing fails
|
|
522
522
|
* until the first request (verified in T-EVE-1's probe, recorded at
|
|
523
523
|
* `apps/consolidator/src/contract.ts:301-319`).
|
|
@@ -796,7 +796,7 @@ const recordLink = (path, linkKind, provenance, at) => Effect.gen(function* () {
|
|
|
796
796
|
/**
|
|
797
797
|
* Bring the index up to the commit a write just made.
|
|
798
798
|
*
|
|
799
|
-
* `indexer.update()` rather than `indexPaths([…])`, and the difference changes
|
|
799
|
+
* `indexer.update()` rather than `indexPaths([…])`, and the difference changes behavior twice:
|
|
800
800
|
*
|
|
801
801
|
* 1. **`indexPaths` cannot express a rename.** Every correction and every archive is a `git mv`, and
|
|
802
802
|
* an index that handled one as "index the destination" leaves the source row live. The archived
|
|
@@ -1441,25 +1441,25 @@ const reinforceMemories = (paths, signal) => Effect.gen(function* () {
|
|
|
1441
1441
|
*
|
|
1442
1442
|
* **Both directions, and `derived = 0 ∪ derived = 1`.** An edge is an assertion about a pair, and
|
|
1443
1443
|
* which file happens to hold the `<link>` is authorship rather than direction of meaning. A
|
|
1444
|
-
*
|
|
1444
|
+
* neighborhood that read only outbound edges would show a superseding memory its target and hide
|
|
1445
1445
|
* from the target that it had been superseded. Derived edges are included because lateral retrieval
|
|
1446
1446
|
* is what they are for. `derived` is still reported per node so a caller can tell a
|
|
1447
1447
|
* sleep-mined suspicion from an authored assertion.
|
|
1448
1448
|
*
|
|
1449
1449
|
* `edge_class = 'memory'` on every join. A person edge entering here would put
|
|
1450
|
-
* `resources/people/*` into a memory
|
|
1450
|
+
* `resources/people/*` into a memory neighborhood, and the class column exists to make that
|
|
1451
1451
|
* structurally impossible.
|
|
1452
1452
|
*/
|
|
1453
1453
|
const neighborsOf = (params) => Effect.gen(function* () {
|
|
1454
1454
|
const db = yield* DatabaseService;
|
|
1455
|
-
const
|
|
1455
|
+
const center = normalizePath(params.path);
|
|
1456
1456
|
const depth = Math.min(2, Math.max(1, Math.trunc(params.depth ?? 1)));
|
|
1457
1457
|
const rels = (params.rels ?? []).filter((rel) => isEdgeRel(rel) && relClassFor(rel) === "memory");
|
|
1458
1458
|
const relFilter = rels.length > 0 ? ` AND e.rel IN (${rels.map(() => "?").join(", ")})` : "";
|
|
1459
1459
|
const relFilter2 = rels.length > 0 ? ` AND e2.rel IN (${rels.map(() => "?").join(", ")})` : "";
|
|
1460
1460
|
/**
|
|
1461
|
-
* Hop 1 is the
|
|
1462
|
-
* node and excludes the
|
|
1461
|
+
* Hop 1 is the center's own edges, either direction. Hop 2 walks one further from each hop-1
|
|
1462
|
+
* node and excludes the center, so a two-cycle does not report the center as its own neighbor
|
|
1463
1463
|
* at distance 2.
|
|
1464
1464
|
*/
|
|
1465
1465
|
const hopOne = `
|
|
@@ -1488,7 +1488,7 @@ const neighborsOf = (params) => Effect.gen(function* () {
|
|
|
1488
1488
|
FROM (${walk}) w
|
|
1489
1489
|
JOIN files f ON f.path = w.path
|
|
1490
1490
|
GROUP BY w.path
|
|
1491
|
-
ORDER BY hop ASC, w.path ASC`, [
|
|
1491
|
+
ORDER BY hop ASC, w.path ASC`, [center, ...depth === 1 ? [...rels, ...rels] : [
|
|
1492
1492
|
...rels,
|
|
1493
1493
|
...rels,
|
|
1494
1494
|
...rels,
|
|
@@ -1502,7 +1502,7 @@ const neighborsOf = (params) => Effect.gen(function* () {
|
|
|
1502
1502
|
rel: row.rel
|
|
1503
1503
|
}));
|
|
1504
1504
|
return {
|
|
1505
|
-
|
|
1505
|
+
center,
|
|
1506
1506
|
depth,
|
|
1507
1507
|
nodes,
|
|
1508
1508
|
edges: nodes.length
|
|
@@ -2264,7 +2264,7 @@ const COMMANDS = [
|
|
|
2264
2264
|
summary: "The memory graph around one path, to a fixed depth of at most two hops.",
|
|
2265
2265
|
args: [{
|
|
2266
2266
|
name: "path",
|
|
2267
|
-
description: "The
|
|
2267
|
+
description: "The center of the neighborhood.",
|
|
2268
2268
|
required: true
|
|
2269
2269
|
}],
|
|
2270
2270
|
flags: [{
|
|
@@ -2884,7 +2884,7 @@ const GUIDE_TOPICS = GUIDE.map((block) => block.topic);
|
|
|
2884
2884
|
*/
|
|
2885
2885
|
const buildManifest = () => ({
|
|
2886
2886
|
name: "memhtml",
|
|
2887
|
-
version: "0.2.
|
|
2887
|
+
version: "0.2.4",
|
|
2888
2888
|
summary: "Read, write, and curate the git-backed memory repo.",
|
|
2889
2889
|
apiVersion: "1",
|
|
2890
2890
|
/**
|
|
@@ -3537,7 +3537,7 @@ const overdueTasks = (db, today) => db.all(`SELECT path, task_status, due_at FRO
|
|
|
3537
3537
|
* the blocked task waits on something that will never move. This is the one task-graph state no single
|
|
3538
3538
|
* file can reveal, since each file is individually valid and only the pair is wrong.
|
|
3539
3539
|
*
|
|
3540
|
-
* **The `archived` arm is the reachable one, and `missing` is
|
|
3540
|
+
* **The `archived` arm is the reachable one, and `missing` is defense in depth.** Probed and
|
|
3541
3541
|
* mutation-confirmed 2026-08-02: deleting a blocker's file makes `indexer.update` clear
|
|
3542
3542
|
* `edges WHERE src_path = ?` in the same batch, so an edge cannot outlive its source file and the
|
|
3543
3543
|
* `missing` branch has nothing to find. Removing that `DELETE` turns the branch on, and it stays for
|
|
@@ -3983,7 +3983,7 @@ const runExec = (input) => Effect.gen(function* () {
|
|
|
3983
3983
|
catch: (cause) => StorageFailure.make({ operation: `exec.sandbox-load: ${String(cause)}` })
|
|
3984
3984
|
});
|
|
3985
3985
|
const { mountReadOnlyRoots } = yield* Effect.tryPromise({
|
|
3986
|
-
try: () => import("./dist-
|
|
3986
|
+
try: () => import("./dist-Dj-MYf9q.mjs"),
|
|
3987
3987
|
catch: (cause) => StorageFailure.make({ operation: `exec.mount-load: ${String(cause)}` })
|
|
3988
3988
|
});
|
|
3989
3989
|
const helperSource = yield* Effect.tryPromise({
|
|
@@ -4109,7 +4109,7 @@ const readScript = async (file) => {
|
|
|
4109
4109
|
*
|
|
4110
4110
|
* The pin also makes an answer reproducible. `sha` rides back in the report, so the same
|
|
4111
4111
|
* traversal over the same tree is one `--sha` away, and an uncommitted edit is invisible. That is
|
|
4112
|
-
* the right
|
|
4112
|
+
* the right behavior for a command whose whole output is a claim about a corpus state.
|
|
4113
4113
|
*
|
|
4114
4114
|
* Cost measured: `git worktree add --detach` on the 305-file fixture is 31ms (three runs: 31/30/31),
|
|
4115
4115
|
* against a 640ms full-corpus parse. The pin is ~5% of the work it makes correct.
|
|
@@ -4128,7 +4128,7 @@ const execCommand = (input) => Effect.gen(function* () {
|
|
|
4128
4128
|
* would not cover.
|
|
4129
4129
|
*/
|
|
4130
4130
|
const { pinCorpusSnapshot } = yield* Effect.tryPromise({
|
|
4131
|
-
try: () => import("./dist-
|
|
4131
|
+
try: () => import("./dist-Dj-MYf9q.mjs"),
|
|
4132
4132
|
catch: (cause) => StorageFailure.make({ operation: `exec.mount-load: ${String(cause)}` })
|
|
4133
4133
|
});
|
|
4134
4134
|
const snapshot = yield* Effect.acquireRelease(Effect.tryPromise({
|