omnius 1.0.704 → 1.0.705
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/dist/index.js +14 -8
- package/dist/memory-maintenance-worker.js +12 -6
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -83355,6 +83355,10 @@ var init_metabolism = __esm({
|
|
|
83355
83355
|
// packages/memory/dist/maintenance.js
|
|
83356
83356
|
import { appendFileSync as appendFileSync2, closeSync as closeSync2, existsSync as existsSync32, mkdirSync as mkdirSync25, openSync as openSync2, readFileSync as readFileSync27, readSync, readdirSync as readdirSync11, renameSync as renameSync10, statSync as statSync13, unlinkSync as unlinkSync9, writeFileSync as writeFileSync24 } from "node:fs";
|
|
83357
83357
|
import { dirname as dirname15, join as join32 } from "node:path";
|
|
83358
|
+
function envInt(name10, fallback) {
|
|
83359
|
+
const raw = Number.parseInt(process.env[name10] ?? "", 10);
|
|
83360
|
+
return Number.isFinite(raw) && raw >= 0 ? raw : fallback;
|
|
83361
|
+
}
|
|
83358
83362
|
function runMemoryMaintenance(options2) {
|
|
83359
83363
|
const started = Date.now();
|
|
83360
83364
|
const result = emptyResult(options2, started);
|
|
@@ -83793,7 +83797,7 @@ function maintainGraph(dbPath, options2, shouldStop) {
|
|
|
83793
83797
|
stats.edgesDeduped = dedupeGraphEdges(db, options2.maxGraphDeletes ?? 2e3, !!options2.dryRun);
|
|
83794
83798
|
}
|
|
83795
83799
|
if (!shouldStop()) {
|
|
83796
|
-
stats.inactiveEdgesDeleted = pruneInactiveEdges(db, options2.
|
|
83800
|
+
stats.inactiveEdgesDeleted = pruneInactiveEdges(db, options2.maxInactiveEdgeDeletes ?? envInt("OMNIUS_KG_MAX_INACTIVE_EDGE_DELETES", 5e4), !!options2.dryRun, options2.supersededRetentionMs ?? envInt("OMNIUS_KG_SUPERSEDED_RETENTION_DAYS", 30) * DAY);
|
|
83797
83801
|
}
|
|
83798
83802
|
if (!shouldStop()) {
|
|
83799
83803
|
stats.orphanNodesDeleted = pruneOrphanNodes(db, options2.maxGraphDeletes ?? 2e3, !!options2.dryRun);
|
|
@@ -83915,17 +83919,19 @@ function dedupeGraphEdges(db, limit2, dryRun) {
|
|
|
83915
83919
|
return ids.length;
|
|
83916
83920
|
return deleteById(db, "kg_edges", ids);
|
|
83917
83921
|
}
|
|
83918
|
-
function pruneInactiveEdges(db, limit2, dryRun) {
|
|
83919
|
-
const
|
|
83922
|
+
function pruneInactiveEdges(db, limit2, dryRun, supersededRetentionMs = 30 * DAY) {
|
|
83923
|
+
const now2 = Date.now();
|
|
83924
|
+
const lowConfidenceCutoff = now2 - 14 * DAY;
|
|
83925
|
+
const supersededCutoff = supersededRetentionMs > 0 ? now2 - supersededRetentionMs : null;
|
|
83920
83926
|
let ids = [];
|
|
83921
83927
|
try {
|
|
83922
83928
|
ids = db.prepare(`SELECT id
|
|
83923
83929
|
FROM kg_edges
|
|
83924
83930
|
WHERE valid_until IS NOT NULL
|
|
83925
|
-
AND valid_until < ?
|
|
83926
|
-
|
|
83931
|
+
AND ( (valid_until < ? AND COALESCE(confidence, 1) < 0.55)
|
|
83932
|
+
OR (? IS NOT NULL AND valid_until < ?) )
|
|
83927
83933
|
ORDER BY valid_until ASC
|
|
83928
|
-
LIMIT ?`).all(
|
|
83934
|
+
LIMIT ?`).all(lowConfidenceCutoff, supersededCutoff, supersededCutoff, Math.max(1, limit2)).map((row2) => row2.id);
|
|
83929
83935
|
} catch {
|
|
83930
83936
|
return 0;
|
|
83931
83937
|
}
|
|
@@ -636053,7 +636059,7 @@ function renderTerminalTaskReport(report2, options2 = {}) {
|
|
|
636053
636059
|
return `${outcome}${exit}${primary}${check.freshness !== "current" ? `; ${check.freshness}` : ""}: ${check.command}.`;
|
|
636054
636060
|
}), omitted: report2.omitted.checks, weight: 0.23 },
|
|
636055
636061
|
{ label: "Files changed:", rows: report2.changes.map((change) => change.path), omitted: report2.omitted.changes, weight: 0.19 },
|
|
636056
|
-
{ label: "Observed work:", rows: report2.observations.map((observation) => `${observation.toolName}${observation.paths.length ? `: ${observation.paths.join(", ")}` : " completed"}.`), omitted: report2.omitted.observations, weight: 0.08 }
|
|
636062
|
+
{ label: "Observed work:", rows: (options2.includeToolTelemetry === true ? report2.observations : report2.observations.filter((observation) => observation.paths.length > 0)).map((observation) => `${observation.toolName}${observation.paths.length ? `: ${observation.paths.join(", ")}` : " completed"}.`), omitted: report2.omitted.observations, weight: 0.08 }
|
|
636057
636063
|
].filter((item) => item.rows.length || item.omitted);
|
|
636058
636064
|
const totalWeight = sections.reduce((sum2, item) => sum2 + item.weight, 0);
|
|
636059
636065
|
const available = maxChars - headline.length - 30;
|
|
@@ -797559,7 +797565,7 @@ function telegramCommittedTerminalMaterial(result, owner, modelReply) {
|
|
|
797559
797565
|
readinessHash: result.completionReadiness?.readinessHash
|
|
797560
797566
|
}) ? result.terminalReport : void 0;
|
|
797561
797567
|
const report2 = validReport ? renderTerminalTaskReport(validReport) : "";
|
|
797562
|
-
const reportEvidence = validReport ? renderTerminalTaskReport(validReport, { maxChars: 24e3 }) : "";
|
|
797568
|
+
const reportEvidence = validReport ? renderTerminalTaskReport(validReport, { maxChars: 24e3, includeToolTelemetry: true }) : "";
|
|
797563
797569
|
if (!result.completed || result.status !== "completed") return { ...empty2, report: report2, reportEvidence };
|
|
797564
797570
|
const accepted = result.acceptedUserReply;
|
|
797565
797571
|
const acceptedReply = accepted && accepted.runId === owner.runId && accepted.taskEpoch === owner.taskEpoch && accepted.terminalReceiptId === result.terminalReceiptId && typeof accepted.toolCallId === "string" && accepted.toolCallId.trim() && typeof accepted.text === "string" ? accepted.text : "";
|
|
@@ -2919,6 +2919,10 @@ import { appendFileSync, closeSync, existsSync as existsSync2, mkdirSync as mkdi
|
|
|
2919
2919
|
import { dirname, join as join2 } from "node:path";
|
|
2920
2920
|
var HOUR = 36e5;
|
|
2921
2921
|
var DAY = 24 * HOUR;
|
|
2922
|
+
function envInt(name, fallback) {
|
|
2923
|
+
const raw = Number.parseInt(process.env[name] ?? "", 10);
|
|
2924
|
+
return Number.isFinite(raw) && raw >= 0 ? raw : fallback;
|
|
2925
|
+
}
|
|
2922
2926
|
var DECAY_TAU2 = {
|
|
2923
2927
|
session: HOUR,
|
|
2924
2928
|
daily: DAY,
|
|
@@ -3363,7 +3367,7 @@ function maintainGraph(dbPath, options, shouldStop) {
|
|
|
3363
3367
|
stats.edgesDeduped = dedupeGraphEdges(db, options.maxGraphDeletes ?? 2e3, !!options.dryRun);
|
|
3364
3368
|
}
|
|
3365
3369
|
if (!shouldStop()) {
|
|
3366
|
-
stats.inactiveEdgesDeleted = pruneInactiveEdges(db, options.
|
|
3370
|
+
stats.inactiveEdgesDeleted = pruneInactiveEdges(db, options.maxInactiveEdgeDeletes ?? envInt("OMNIUS_KG_MAX_INACTIVE_EDGE_DELETES", 5e4), !!options.dryRun, options.supersededRetentionMs ?? envInt("OMNIUS_KG_SUPERSEDED_RETENTION_DAYS", 30) * DAY);
|
|
3367
3371
|
}
|
|
3368
3372
|
if (!shouldStop()) {
|
|
3369
3373
|
stats.orphanNodesDeleted = pruneOrphanNodes(db, options.maxGraphDeletes ?? 2e3, !!options.dryRun);
|
|
@@ -3485,17 +3489,19 @@ function dedupeGraphEdges(db, limit, dryRun) {
|
|
|
3485
3489
|
return ids.length;
|
|
3486
3490
|
return deleteById(db, "kg_edges", ids);
|
|
3487
3491
|
}
|
|
3488
|
-
function pruneInactiveEdges(db, limit, dryRun) {
|
|
3489
|
-
const
|
|
3492
|
+
function pruneInactiveEdges(db, limit, dryRun, supersededRetentionMs = 30 * DAY) {
|
|
3493
|
+
const now = Date.now();
|
|
3494
|
+
const lowConfidenceCutoff = now - 14 * DAY;
|
|
3495
|
+
const supersededCutoff = supersededRetentionMs > 0 ? now - supersededRetentionMs : null;
|
|
3490
3496
|
let ids = [];
|
|
3491
3497
|
try {
|
|
3492
3498
|
ids = db.prepare(`SELECT id
|
|
3493
3499
|
FROM kg_edges
|
|
3494
3500
|
WHERE valid_until IS NOT NULL
|
|
3495
|
-
AND valid_until < ?
|
|
3496
|
-
|
|
3501
|
+
AND ( (valid_until < ? AND COALESCE(confidence, 1) < 0.55)
|
|
3502
|
+
OR (? IS NOT NULL AND valid_until < ?) )
|
|
3497
3503
|
ORDER BY valid_until ASC
|
|
3498
|
-
LIMIT ?`).all(
|
|
3504
|
+
LIMIT ?`).all(lowConfidenceCutoff, supersededCutoff, supersededCutoff, Math.max(1, limit)).map((row) => row.id);
|
|
3499
3505
|
} catch {
|
|
3500
3506
|
return 0;
|
|
3501
3507
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.705",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.705",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
|
@@ -4432,9 +4432,9 @@
|
|
|
4432
4432
|
"license": "BSD-3-Clause"
|
|
4433
4433
|
},
|
|
4434
4434
|
"node_modules/ignore": {
|
|
4435
|
-
"version": "7.0.
|
|
4436
|
-
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.
|
|
4437
|
-
"integrity": "sha512-
|
|
4435
|
+
"version": "7.0.9",
|
|
4436
|
+
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.9.tgz",
|
|
4437
|
+
"integrity": "sha512-brTTsvFRt5C1gGHtPst/281UjPD5t9fBqbgoMPlVWy11ZLTPfu7HxK4ZYqO9H7o/yC9rSTCI85EaQ4OoY12qYw==",
|
|
4438
4438
|
"license": "MIT",
|
|
4439
4439
|
"engines": {
|
|
4440
4440
|
"node": ">= 4"
|
package/package.json
CHANGED