@cleocode/core 2026.6.10 → 2026.6.11
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/docs/export-document.js +95 -10
- package/dist/docs/export-document.js.map +2 -2
- package/dist/llm/plugin-facade.js +74 -7
- package/dist/llm/plugin-facade.js.map +2 -2
- package/dist/store/agent-registry-store.d.ts.map +1 -1
- package/dist/store/agent-registry-store.js +4 -2
- package/dist/store/agent-registry-store.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +4 -2
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +56 -6
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/migration-manager.d.ts +26 -1
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +104 -4
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.js +4 -2
- package/dist/store/nexus-sqlite.js.map +1 -1
- package/dist/store/resolve-migrations-folder.d.ts +41 -0
- package/dist/store/resolve-migrations-folder.d.ts.map +1 -1
- package/dist/store/resolve-migrations-folder.js +53 -0
- package/dist/store/resolve-migrations-folder.js.map +1 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +5 -3
- package/dist/store/sqlite.js.map +1 -1
- package/package.json +12 -12
|
@@ -22820,7 +22820,26 @@ function probeAndMarkApplied(nativeDb, migration, logSubsystem, eliminatedTables
|
|
|
22820
22820
|
}
|
|
22821
22821
|
return false;
|
|
22822
22822
|
}
|
|
22823
|
-
function
|
|
22823
|
+
function readSiblingMigrationHashes(siblingFolder) {
|
|
22824
|
+
try {
|
|
22825
|
+
return new Set(readMigrationFiles({ migrationsFolder: siblingFolder }).map((m) => m.hash));
|
|
22826
|
+
} catch {
|
|
22827
|
+
return /* @__PURE__ */ new Set();
|
|
22828
|
+
}
|
|
22829
|
+
}
|
|
22830
|
+
function ensureJournalHashUnique(nativeDb) {
|
|
22831
|
+
if (!tableExists(nativeDb, "__drizzle_migrations")) return;
|
|
22832
|
+
try {
|
|
22833
|
+
nativeDb.exec(
|
|
22834
|
+
'DELETE FROM "__drizzle_migrations" WHERE id NOT IN (SELECT MIN(id) FROM "__drizzle_migrations" GROUP BY hash)'
|
|
22835
|
+
);
|
|
22836
|
+
nativeDb.exec(
|
|
22837
|
+
'CREATE UNIQUE INDEX IF NOT EXISTS "idx_drizzle_migrations_hash" ON "__drizzle_migrations" ("hash")'
|
|
22838
|
+
);
|
|
22839
|
+
} catch {
|
|
22840
|
+
}
|
|
22841
|
+
}
|
|
22842
|
+
function reconcileJournal(nativeDb, migrationsFolder, existenceTable2, logSubsystem, siblingMigrationsFolders = []) {
|
|
22824
22843
|
const eliminatedTables = computeEliminatedTables(readMigrationFiles({ migrationsFolder }));
|
|
22825
22844
|
const cutoverPrefix = resolveConsolidationCutoverPrefix(migrationsFolder);
|
|
22826
22845
|
if (tableExists(nativeDb, existenceTable2) && !tableExists(nativeDb, "__drizzle_migrations")) {
|
|
@@ -22839,11 +22858,19 @@ function reconcileJournal(nativeDb, migrationsFolder, existenceTable2, logSubsys
|
|
|
22839
22858
|
insertJournalEntry(nativeDb, baseline.hash, baseline.folderMillis, baseline.name ?? "");
|
|
22840
22859
|
}
|
|
22841
22860
|
}
|
|
22861
|
+
ensureJournalHashUnique(nativeDb);
|
|
22842
22862
|
if (tableExists(nativeDb, "__drizzle_migrations") && tableExists(nativeDb, existenceTable2)) {
|
|
22843
22863
|
const localMigrations = readMigrationFiles({ migrationsFolder });
|
|
22844
22864
|
const localHashes = new Set(localMigrations.map((m) => m.hash));
|
|
22865
|
+
const knownHashes = new Set(localHashes);
|
|
22866
|
+
for (const siblingFolder of siblingMigrationsFolders) {
|
|
22867
|
+
if (siblingFolder === migrationsFolder) continue;
|
|
22868
|
+
for (const m of readSiblingMigrationHashes(siblingFolder)) {
|
|
22869
|
+
knownHashes.add(m);
|
|
22870
|
+
}
|
|
22871
|
+
}
|
|
22845
22872
|
const dbEntries = nativeDb.prepare('SELECT id, hash FROM "__drizzle_migrations"').all();
|
|
22846
|
-
const orphanedEntries = dbEntries.filter((e) => !
|
|
22873
|
+
const orphanedEntries = dbEntries.filter((e) => !knownHashes.has(e.hash));
|
|
22847
22874
|
const hasOrphanedEntries = orphanedEntries.length > 0;
|
|
22848
22875
|
if (hasOrphanedEntries) {
|
|
22849
22876
|
const dbHashes = new Set(dbEntries.map((e) => e.hash));
|
|
@@ -23097,6 +23124,11 @@ import { fileURLToPath } from "node:url";
|
|
|
23097
23124
|
function coreRootFromEntry(entryPath) {
|
|
23098
23125
|
return dirname2(dirname2(entryPath));
|
|
23099
23126
|
}
|
|
23127
|
+
function resolveConsolidatedJournalSiblings(ownSetName) {
|
|
23128
|
+
return CONSOLIDATED_JOURNAL_LINEAGES.filter((name15) => name15 !== ownSetName).map(
|
|
23129
|
+
(name15) => resolveCorePackageMigrationsFolder(name15)
|
|
23130
|
+
);
|
|
23131
|
+
}
|
|
23100
23132
|
function resolveCorePackageMigrationsFolder(setName) {
|
|
23101
23133
|
try {
|
|
23102
23134
|
const resolved = import.meta.resolve("@cleocode/core", import.meta.url);
|
|
@@ -23114,9 +23146,21 @@ function resolveCorePackageMigrationsFolder(setName) {
|
|
|
23114
23146
|
);
|
|
23115
23147
|
}
|
|
23116
23148
|
}
|
|
23149
|
+
var CONSOLIDATED_JOURNAL_LINEAGES;
|
|
23117
23150
|
var init_resolve_migrations_folder = __esm({
|
|
23118
23151
|
"packages/core/src/store/resolve-migrations-folder.ts"() {
|
|
23119
23152
|
"use strict";
|
|
23153
|
+
CONSOLIDATED_JOURNAL_LINEAGES = [
|
|
23154
|
+
"drizzle-tasks",
|
|
23155
|
+
"drizzle-cleo-project",
|
|
23156
|
+
"drizzle-nexus",
|
|
23157
|
+
"drizzle-brain",
|
|
23158
|
+
"drizzle-conduit",
|
|
23159
|
+
"drizzle-cleo-global",
|
|
23160
|
+
"drizzle-agent-registry",
|
|
23161
|
+
"drizzle-skills",
|
|
23162
|
+
"drizzle-telemetry"
|
|
23163
|
+
];
|
|
23120
23164
|
}
|
|
23121
23165
|
});
|
|
23122
23166
|
|
|
@@ -34130,6 +34174,11 @@ async function loadGlobalSchema() {
|
|
|
34130
34174
|
function existenceTable(scope) {
|
|
34131
34175
|
return scope === "project" ? "tasks_tasks" : "nexus_project_registry";
|
|
34132
34176
|
}
|
|
34177
|
+
function memoryBoundedPragmaOverrides() {
|
|
34178
|
+
if (process.env.CLEO_SENTIENT_DAEMON === "1") return {};
|
|
34179
|
+
if (process.env.CLEO_DB_FULL_MEM === "1") return {};
|
|
34180
|
+
return { mmapSizeBytes: 0, cacheSizeKb: 8e3 };
|
|
34181
|
+
}
|
|
34133
34182
|
async function openDualScopeDb(scope, cwd) {
|
|
34134
34183
|
const dbPath = resolveDualScopeDbPath(scope, cwd);
|
|
34135
34184
|
return scope === "project" ? openDualScopeDbAtPath("project", dbPath, cwd) : openDualScopeDbAtPath("global", dbPath, cwd);
|
|
@@ -34142,12 +34191,18 @@ async function openDedicatedDualScopeDb(scope, dbPath, log7) {
|
|
|
34142
34191
|
}
|
|
34143
34192
|
const DatabaseSyncCtor = getDatabaseSyncCtor();
|
|
34144
34193
|
const nativeDb = new DatabaseSyncCtor(dbPath, { allowExtension: true });
|
|
34145
|
-
applyPerfPragmas(nativeDb);
|
|
34194
|
+
applyPerfPragmas(nativeDb, memoryBoundedPragmaOverrides());
|
|
34146
34195
|
const schema = scope === "project" ? await loadProjectSchema() : await loadGlobalSchema();
|
|
34147
34196
|
const drizzle2 = getDrizzle();
|
|
34148
34197
|
const db = drizzle2({ client: nativeDb, schema });
|
|
34149
34198
|
const migrationsFolder = resolveCorePackageMigrationsFolder(migrationsSetName(scope));
|
|
34150
|
-
reconcileJournal(
|
|
34199
|
+
reconcileJournal(
|
|
34200
|
+
nativeDb,
|
|
34201
|
+
migrationsFolder,
|
|
34202
|
+
existenceTable(scope),
|
|
34203
|
+
`dual-scope-db[${scope}]`,
|
|
34204
|
+
resolveConsolidatedJournalSiblings(migrationsSetName(scope))
|
|
34205
|
+
);
|
|
34151
34206
|
migrateWithRetry(
|
|
34152
34207
|
db,
|
|
34153
34208
|
migrationsFolder,
|
|
@@ -34192,12 +34247,18 @@ async function openDualScopeDbAtPath(scope, dbPath, exodusCwd, options) {
|
|
|
34192
34247
|
}
|
|
34193
34248
|
const DatabaseSyncCtor = getDatabaseSyncCtor();
|
|
34194
34249
|
const nativeDb = new DatabaseSyncCtor(dbPath, { allowExtension: true });
|
|
34195
|
-
applyPerfPragmas(nativeDb);
|
|
34250
|
+
applyPerfPragmas(nativeDb, memoryBoundedPragmaOverrides());
|
|
34196
34251
|
const schema = scope === "project" ? await loadProjectSchema() : await loadGlobalSchema();
|
|
34197
34252
|
const drizzle2 = getDrizzle();
|
|
34198
34253
|
const db = drizzle2({ client: nativeDb, schema });
|
|
34199
34254
|
const migrationsFolder = resolveCorePackageMigrationsFolder(migrationsSetName(scope));
|
|
34200
|
-
reconcileJournal(
|
|
34255
|
+
reconcileJournal(
|
|
34256
|
+
nativeDb,
|
|
34257
|
+
migrationsFolder,
|
|
34258
|
+
existenceTable(scope),
|
|
34259
|
+
`dual-scope-db[${scope}]`,
|
|
34260
|
+
resolveConsolidatedJournalSiblings(migrationsSetName(scope))
|
|
34261
|
+
);
|
|
34201
34262
|
migrateWithRetry(
|
|
34202
34263
|
db,
|
|
34203
34264
|
migrationsFolder,
|
|
@@ -35069,7 +35130,13 @@ function runNexusMigrations(nativeDb, db) {
|
|
|
35069
35130
|
}
|
|
35070
35131
|
}
|
|
35071
35132
|
}
|
|
35072
|
-
reconcileJournal(
|
|
35133
|
+
reconcileJournal(
|
|
35134
|
+
nativeDb,
|
|
35135
|
+
migrationsFolder,
|
|
35136
|
+
"_nexus_meta",
|
|
35137
|
+
"nexus",
|
|
35138
|
+
resolveConsolidatedJournalSiblings("drizzle-nexus")
|
|
35139
|
+
);
|
|
35073
35140
|
const MAX_RETRIES2 = 5;
|
|
35074
35141
|
const BASE_DELAY_MS = 100;
|
|
35075
35142
|
const MAX_DELAY_MS = 2e3;
|