@cleocode/core 2026.4.52 → 2026.4.53
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 +127 -80
- package/dist/index.js.map +3 -3
- package/dist/init.d.ts.map +1 -1
- package/dist/internal.js +149 -89
- package/dist/internal.js.map +3 -3
- package/dist/scaffold.d.ts +30 -0
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/init.ts +15 -18
- package/src/scaffold.ts +152 -0
- package/src/system/health.ts +2 -0
- package/src/upgrade.ts +17 -0
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAgCH,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,oCAAoC;AACpC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC;QAClC,WAAW,EAAE,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G;AACH,wBAAsB,WAAW,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CA0a7E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC,CAiB/F;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAyBnF;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,IAAI,CAAC,CAmFf"}
|
package/dist/internal.js
CHANGED
|
@@ -11140,44 +11140,6 @@ var init_platform_paths = __esm({
|
|
|
11140
11140
|
});
|
|
11141
11141
|
|
|
11142
11142
|
// packages/core/src/paths.ts
|
|
11143
|
-
var paths_exports = {};
|
|
11144
|
-
__export(paths_exports, {
|
|
11145
|
-
getAgentOutputsAbsolute: () => getAgentOutputsAbsolute,
|
|
11146
|
-
getAgentOutputsDir: () => getAgentOutputsDir,
|
|
11147
|
-
getAgentsHome: () => getAgentsHome,
|
|
11148
|
-
getArchivePath: () => getArchivePath,
|
|
11149
|
-
getBackupDir: () => getBackupDir,
|
|
11150
|
-
getClaudeAgentsDir: () => getClaudeAgentsDir,
|
|
11151
|
-
getClaudeMemDbPath: () => getClaudeMemDbPath,
|
|
11152
|
-
getCleoCacheDir: () => getCleoCacheDir,
|
|
11153
|
-
getCleoCantWorkflowsDir: () => getCleoCantWorkflowsDir,
|
|
11154
|
-
getCleoConfigDir: () => getCleoConfigDir,
|
|
11155
|
-
getCleoDir: () => getCleoDir,
|
|
11156
|
-
getCleoDirAbsolute: () => getCleoDirAbsolute,
|
|
11157
|
-
getCleoDocsDir: () => getCleoDocsDir,
|
|
11158
|
-
getCleoGlobalAgentsDir: () => getCleoGlobalAgentsDir,
|
|
11159
|
-
getCleoGlobalJustfilePath: () => getCleoGlobalJustfilePath,
|
|
11160
|
-
getCleoGlobalRecipesDir: () => getCleoGlobalRecipesDir,
|
|
11161
|
-
getCleoHome: () => getCleoHome,
|
|
11162
|
-
getCleoLogDir: () => getCleoLogDir,
|
|
11163
|
-
getCleoPiExtensionsDir: () => getCleoPiExtensionsDir,
|
|
11164
|
-
getCleoSchemasDir: () => getCleoSchemasDir,
|
|
11165
|
-
getCleoTempDir: () => getCleoTempDir,
|
|
11166
|
-
getCleoTemplatesDir: () => getCleoTemplatesDir,
|
|
11167
|
-
getCleoTemplatesTildePath: () => getCleoTemplatesTildePath,
|
|
11168
|
-
getConfigPath: () => getConfigPath,
|
|
11169
|
-
getGlobalConfigPath: () => getGlobalConfigPath,
|
|
11170
|
-
getLogPath: () => getLogPath,
|
|
11171
|
-
getManifestArchivePath: () => getManifestArchivePath,
|
|
11172
|
-
getManifestPath: () => getManifestPath,
|
|
11173
|
-
getProjectRoot: () => getProjectRoot,
|
|
11174
|
-
getSessionsPath: () => getSessionsPath,
|
|
11175
|
-
getTaskPath: () => getTaskPath,
|
|
11176
|
-
isAbsolutePath: () => isAbsolutePath,
|
|
11177
|
-
isProjectInitialized: () => isProjectInitialized,
|
|
11178
|
-
resolveProjectPath: () => resolveProjectPath,
|
|
11179
|
-
worktreeScope: () => worktreeScope
|
|
11180
|
-
});
|
|
11181
11143
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11182
11144
|
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
11183
11145
|
import { homedir } from "node:os";
|
|
@@ -11196,9 +11158,6 @@ function getCleoTemplatesDir() {
|
|
|
11196
11158
|
function getCleoSchemasDir() {
|
|
11197
11159
|
return join4(getCleoHome(), "schemas");
|
|
11198
11160
|
}
|
|
11199
|
-
function getCleoDocsDir() {
|
|
11200
|
-
return join4(getCleoHome(), "docs");
|
|
11201
|
-
}
|
|
11202
11161
|
function getCleoDir(cwd) {
|
|
11203
11162
|
if (cwd) {
|
|
11204
11163
|
return getCleoDirAbsolute(cwd);
|
|
@@ -11270,15 +11229,6 @@ function getTaskPath(cwd) {
|
|
|
11270
11229
|
function getConfigPath(cwd) {
|
|
11271
11230
|
return join4(getCleoDirAbsolute(cwd), "config.json");
|
|
11272
11231
|
}
|
|
11273
|
-
function getSessionsPath(cwd) {
|
|
11274
|
-
return join4(getCleoDirAbsolute(cwd), "sessions.json");
|
|
11275
|
-
}
|
|
11276
|
-
function getArchivePath(cwd) {
|
|
11277
|
-
return join4(getCleoDirAbsolute(cwd), "tasks-archive.json");
|
|
11278
|
-
}
|
|
11279
|
-
function getLogPath(cwd) {
|
|
11280
|
-
return join4(getCleoDirAbsolute(cwd), "logs", "cleo.log");
|
|
11281
|
-
}
|
|
11282
11232
|
function getBackupDir(cwd) {
|
|
11283
11233
|
return join4(getCleoDirAbsolute(cwd), "backups", "operational");
|
|
11284
11234
|
}
|
|
@@ -14331,8 +14281,8 @@ async function cleanupMigrationArtifacts(backupPath) {
|
|
|
14331
14281
|
}
|
|
14332
14282
|
async function validateSqliteDatabase(dbPath) {
|
|
14333
14283
|
try {
|
|
14334
|
-
const { createRequire:
|
|
14335
|
-
const _req =
|
|
14284
|
+
const { createRequire: createRequire16 } = await import("node:module");
|
|
14285
|
+
const _req = createRequire16(import.meta.url);
|
|
14336
14286
|
const { DatabaseSync: DatabaseSync10 } = _req("node:sqlite");
|
|
14337
14287
|
const db = new DatabaseSync10(dbPath, { readOnly: true });
|
|
14338
14288
|
const integrityRow = db.prepare("PRAGMA integrity_check").get();
|
|
@@ -50708,6 +50658,7 @@ __export(scaffold_exports, {
|
|
|
50708
50658
|
checkConfig: () => checkConfig,
|
|
50709
50659
|
checkGitignore: () => checkGitignore,
|
|
50710
50660
|
checkGlobalHome: () => checkGlobalHome,
|
|
50661
|
+
checkGlobalIdentity: () => checkGlobalIdentity,
|
|
50711
50662
|
checkGlobalTemplates: () => checkGlobalTemplates,
|
|
50712
50663
|
checkLogDir: () => checkLogDir,
|
|
50713
50664
|
checkMemoryBridge: () => checkMemoryBridge,
|
|
@@ -50724,6 +50675,7 @@ __export(scaffold_exports, {
|
|
|
50724
50675
|
ensureContributorMcp: () => ensureContributorMcp,
|
|
50725
50676
|
ensureGitignore: () => ensureGitignore,
|
|
50726
50677
|
ensureGlobalHome: () => ensureGlobalHome,
|
|
50678
|
+
ensureGlobalIdentity: () => ensureGlobalIdentity,
|
|
50727
50679
|
ensureGlobalScaffold: () => ensureGlobalScaffold,
|
|
50728
50680
|
ensureGlobalTemplates: () => ensureGlobalTemplates,
|
|
50729
50681
|
ensureProjectContext: () => ensureProjectContext,
|
|
@@ -50741,6 +50693,7 @@ import { execFile as execFile3 } from "node:child_process";
|
|
|
50741
50693
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
50742
50694
|
import { existsSync as existsSync40, constants as fsConstants3, readFileSync as readFileSync23, statSync as statSync8 } from "node:fs";
|
|
50743
50695
|
import { access as access3, copyFile as copyFile2, mkdir as mkdir6, readdir as readdir2, readFile as readFile7, rm as rm2, writeFile as writeFile6 } from "node:fs/promises";
|
|
50696
|
+
import { createRequire as createRequire6 } from "node:module";
|
|
50744
50697
|
import { homedir as getHomedir } from "node:os";
|
|
50745
50698
|
import { dirname as dirname10, join as join41, resolve as resolve5 } from "node:path";
|
|
50746
50699
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
@@ -51596,6 +51549,102 @@ async function ensureCleoOsHub() {
|
|
|
51596
51549
|
details: `pi-extensions: ${piResult.copied} created/${piResult.kept} kept, global-recipes: ${recipesResult.copied} created/${recipesResult.kept} kept`
|
|
51597
51550
|
};
|
|
51598
51551
|
}
|
|
51552
|
+
function resolveIdentitySourcePath() {
|
|
51553
|
+
const monorepoPath = join41(
|
|
51554
|
+
process.cwd(),
|
|
51555
|
+
"packages",
|
|
51556
|
+
"cleo-os",
|
|
51557
|
+
"starter-bundle",
|
|
51558
|
+
"CLEOOS-IDENTITY.md"
|
|
51559
|
+
);
|
|
51560
|
+
if (existsSync40(monorepoPath)) return monorepoPath;
|
|
51561
|
+
try {
|
|
51562
|
+
const require2 = createRequire6(import.meta.url);
|
|
51563
|
+
const pkgJson = require2.resolve("@cleocode/cleo-os/package.json");
|
|
51564
|
+
const pkgDir = pkgJson.replace(/\/package\.json$/, "");
|
|
51565
|
+
const installedPath = join41(pkgDir, "starter-bundle", "CLEOOS-IDENTITY.md");
|
|
51566
|
+
if (existsSync40(installedPath)) return installedPath;
|
|
51567
|
+
} catch {
|
|
51568
|
+
}
|
|
51569
|
+
return null;
|
|
51570
|
+
}
|
|
51571
|
+
async function ensureGlobalIdentity(forceRefresh = false) {
|
|
51572
|
+
const sourcePath = resolveIdentitySourcePath();
|
|
51573
|
+
if (!sourcePath) {
|
|
51574
|
+
return {
|
|
51575
|
+
action: "skipped",
|
|
51576
|
+
path: "",
|
|
51577
|
+
details: "CLEOOS-IDENTITY.md source not found in monorepo or installed package"
|
|
51578
|
+
};
|
|
51579
|
+
}
|
|
51580
|
+
const cleoHome = getCleoHome();
|
|
51581
|
+
const dst = join41(cleoHome, "CLEOOS-IDENTITY.md");
|
|
51582
|
+
try {
|
|
51583
|
+
await mkdir6(cleoHome, { recursive: true });
|
|
51584
|
+
} catch (err) {
|
|
51585
|
+
return {
|
|
51586
|
+
action: "skipped",
|
|
51587
|
+
path: dst,
|
|
51588
|
+
details: `Failed to create global cleo home: ${err instanceof Error ? err.message : String(err)}`
|
|
51589
|
+
};
|
|
51590
|
+
}
|
|
51591
|
+
if (existsSync40(dst) && !forceRefresh) {
|
|
51592
|
+
return { action: "skipped", path: dst, details: "identity already present" };
|
|
51593
|
+
}
|
|
51594
|
+
const existedBefore = existsSync40(dst);
|
|
51595
|
+
try {
|
|
51596
|
+
const content = readFileSync23(sourcePath, "utf-8");
|
|
51597
|
+
await writeFile6(dst, content);
|
|
51598
|
+
return {
|
|
51599
|
+
action: existedBefore ? "repaired" : "created",
|
|
51600
|
+
path: dst,
|
|
51601
|
+
details: `from ${sourcePath}`
|
|
51602
|
+
};
|
|
51603
|
+
} catch (err) {
|
|
51604
|
+
return {
|
|
51605
|
+
action: "skipped",
|
|
51606
|
+
path: dst,
|
|
51607
|
+
details: `Failed to write identity: ${err instanceof Error ? err.message : String(err)}`
|
|
51608
|
+
};
|
|
51609
|
+
}
|
|
51610
|
+
}
|
|
51611
|
+
function checkGlobalIdentity() {
|
|
51612
|
+
const cleoHome = getCleoHome();
|
|
51613
|
+
const identityPath = join41(cleoHome, "CLEOOS-IDENTITY.md");
|
|
51614
|
+
if (!existsSync40(identityPath)) {
|
|
51615
|
+
return {
|
|
51616
|
+
id: "global_identity",
|
|
51617
|
+
category: "global",
|
|
51618
|
+
status: "failed",
|
|
51619
|
+
message: "Global CLEOOS-IDENTITY.md not found \u2014 orchestrator persona missing",
|
|
51620
|
+
details: { path: identityPath, exists: false },
|
|
51621
|
+
fix: "cleo upgrade (auto-deploys identity)"
|
|
51622
|
+
};
|
|
51623
|
+
}
|
|
51624
|
+
let size = 0;
|
|
51625
|
+
try {
|
|
51626
|
+
size = statSync8(identityPath).size;
|
|
51627
|
+
} catch {
|
|
51628
|
+
}
|
|
51629
|
+
if (size === 0) {
|
|
51630
|
+
return {
|
|
51631
|
+
id: "global_identity",
|
|
51632
|
+
category: "global",
|
|
51633
|
+
status: "failed",
|
|
51634
|
+
message: "Global CLEOOS-IDENTITY.md exists but is empty",
|
|
51635
|
+
details: { path: identityPath, exists: true, size: 0 },
|
|
51636
|
+
fix: "cleo upgrade --refresh-identity"
|
|
51637
|
+
};
|
|
51638
|
+
}
|
|
51639
|
+
return {
|
|
51640
|
+
id: "global_identity",
|
|
51641
|
+
category: "global",
|
|
51642
|
+
status: "passed",
|
|
51643
|
+
message: "Global CLEOOS-IDENTITY.md present",
|
|
51644
|
+
details: { path: identityPath, exists: true, size },
|
|
51645
|
+
fix: ""
|
|
51646
|
+
};
|
|
51647
|
+
}
|
|
51599
51648
|
function checkGlobalHome() {
|
|
51600
51649
|
const cleoHome = getCleoHome();
|
|
51601
51650
|
if (!existsSync40(cleoHome)) {
|
|
@@ -55695,7 +55744,7 @@ __export(parser_exports, {
|
|
|
55695
55744
|
parseFile: () => parseFile2
|
|
55696
55745
|
});
|
|
55697
55746
|
import { readFileSync as readFileSync64 } from "node:fs";
|
|
55698
|
-
import { createRequire as
|
|
55747
|
+
import { createRequire as createRequire8 } from "node:module";
|
|
55699
55748
|
import { relative as relative7 } from "node:path";
|
|
55700
55749
|
function tryRequire(id) {
|
|
55701
55750
|
try {
|
|
@@ -55896,7 +55945,7 @@ var init_parser3 = __esm({
|
|
|
55896
55945
|
"packages/core/src/code/parser.ts"() {
|
|
55897
55946
|
"use strict";
|
|
55898
55947
|
init_tree_sitter_languages();
|
|
55899
|
-
_require7 =
|
|
55948
|
+
_require7 = createRequire8(import.meta.url);
|
|
55900
55949
|
_ParserClass = null;
|
|
55901
55950
|
_QueryClass = null;
|
|
55902
55951
|
_parserInstance = null;
|
|
@@ -56002,7 +56051,7 @@ __export(dependencies_exports, {
|
|
|
56002
56051
|
getDependencySpecs: () => getDependencySpecs
|
|
56003
56052
|
});
|
|
56004
56053
|
import { execFileSync as execFileSync10 } from "node:child_process";
|
|
56005
|
-
import { createRequire as
|
|
56054
|
+
import { createRequire as createRequire9 } from "node:module";
|
|
56006
56055
|
import { dirname as dirname19 } from "node:path";
|
|
56007
56056
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
56008
56057
|
function tryExec(cmd, args, timeoutMs = 3e3) {
|
|
@@ -56275,7 +56324,7 @@ var init_dependencies = __esm({
|
|
|
56275
56324
|
"packages/core/src/system/dependencies.ts"() {
|
|
56276
56325
|
"use strict";
|
|
56277
56326
|
init_platform();
|
|
56278
|
-
_require8 =
|
|
56327
|
+
_require8 = createRequire9(import.meta.url);
|
|
56279
56328
|
_dirname = dirname19(fileURLToPath5(import.meta.url));
|
|
56280
56329
|
DEPENDENCY_SPECS = [
|
|
56281
56330
|
// ── Required ────────────────────────────────────────────────────────────
|
|
@@ -57578,8 +57627,8 @@ import { platform as platform4 } from "node:os";
|
|
|
57578
57627
|
import { basename as basename17, dirname as dirname23, join as join107 } from "node:path";
|
|
57579
57628
|
async function resolveSeedAgentsDir() {
|
|
57580
57629
|
try {
|
|
57581
|
-
const { createRequire:
|
|
57582
|
-
const req =
|
|
57630
|
+
const { createRequire: createRequire16 } = await import("node:module");
|
|
57631
|
+
const req = createRequire16(import.meta.url);
|
|
57583
57632
|
const agentsPkgMain = req.resolve("@cleocode/agents/package.json");
|
|
57584
57633
|
const agentsPkgRoot = dirname23(agentsPkgMain);
|
|
57585
57634
|
const candidate = join107(agentsPkgRoot, "seed-agents");
|
|
@@ -57606,8 +57655,8 @@ async function resolveSeedAgentsDir() {
|
|
|
57606
57655
|
async function initAgentDefinition(created, warnings) {
|
|
57607
57656
|
let agentSourceDir = null;
|
|
57608
57657
|
try {
|
|
57609
|
-
const { createRequire:
|
|
57610
|
-
const req =
|
|
57658
|
+
const { createRequire: createRequire16 } = await import("node:module");
|
|
57659
|
+
const req = createRequire16(import.meta.url);
|
|
57611
57660
|
const agentsPkgMain = req.resolve("@cleocode/agents/package.json");
|
|
57612
57661
|
const agentsPkgRoot = dirname23(agentsPkgMain);
|
|
57613
57662
|
const candidate = join107(agentsPkgRoot, "cleo-subagent");
|
|
@@ -57673,8 +57722,8 @@ async function initCoreSkills(created, warnings) {
|
|
|
57673
57722
|
const packageRoot = getPackageRoot();
|
|
57674
57723
|
let ctSkillsRoot = null;
|
|
57675
57724
|
try {
|
|
57676
|
-
const { createRequire:
|
|
57677
|
-
const req =
|
|
57725
|
+
const { createRequire: createRequire16 } = await import("node:module");
|
|
57726
|
+
const req = createRequire16(import.meta.url);
|
|
57678
57727
|
const skillsPkgMain = req.resolve("@cleocode/skills/package.json");
|
|
57679
57728
|
const skillsPkgRoot = dirname23(skillsPkgMain);
|
|
57680
57729
|
if (existsSync108(join107(skillsPkgRoot, "skills.json"))) {
|
|
@@ -58182,8 +58231,8 @@ async function deployStarterBundle(cleoDir, created, warnings) {
|
|
|
58182
58231
|
if (hasCantFiles) return;
|
|
58183
58232
|
let starterBundleSrc = null;
|
|
58184
58233
|
try {
|
|
58185
|
-
const { createRequire:
|
|
58186
|
-
const req =
|
|
58234
|
+
const { createRequire: createRequire16 } = await import("node:module");
|
|
58235
|
+
const req = createRequire16(import.meta.url);
|
|
58187
58236
|
const cleoOsPkgMain = req.resolve("@cleocode/cleo-os/package.json");
|
|
58188
58237
|
const cleoOsPkgRoot = dirname23(cleoOsPkgMain);
|
|
58189
58238
|
const candidate = join107(cleoOsPkgRoot, "starter-bundle");
|
|
@@ -58223,20 +58272,20 @@ async function deployStarterBundle(cleoDir, created, warnings) {
|
|
|
58223
58272
|
}
|
|
58224
58273
|
}
|
|
58225
58274
|
}
|
|
58226
|
-
const identitySrc = join107(starterBundleSrc, "CLEOOS-IDENTITY.md");
|
|
58227
|
-
const identityDst = join107(cleoDir, "CLEOOS-IDENTITY.md");
|
|
58228
|
-
if (existsSync108(identitySrc) && !existsSync108(identityDst)) {
|
|
58229
|
-
await copyFile4(identitySrc, identityDst);
|
|
58230
|
-
}
|
|
58231
58275
|
try {
|
|
58232
|
-
const {
|
|
58233
|
-
const
|
|
58234
|
-
if (
|
|
58235
|
-
|
|
58276
|
+
const { ensureGlobalIdentity: ensureGlobalIdentity2 } = await Promise.resolve().then(() => (init_scaffold(), scaffold_exports));
|
|
58277
|
+
const identityResult = await ensureGlobalIdentity2();
|
|
58278
|
+
if (identityResult.action === "created") {
|
|
58279
|
+
created.push(`identity: ${identityResult.path}`);
|
|
58280
|
+
} else if (identityResult.action === "skipped" && identityResult.details) {
|
|
58281
|
+
warnings.push(`identity skipped: ${identityResult.details}`);
|
|
58236
58282
|
}
|
|
58237
|
-
} catch {
|
|
58283
|
+
} catch (err) {
|
|
58284
|
+
warnings.push(`identity deploy failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
58238
58285
|
}
|
|
58239
|
-
created.push(
|
|
58286
|
+
created.push(
|
|
58287
|
+
"starter-bundle: team + agent .cant files deployed to .cleo/ (identity at global XDG)"
|
|
58288
|
+
);
|
|
58240
58289
|
}
|
|
58241
58290
|
var DIR_SYMLINK_TYPE2;
|
|
58242
58291
|
var init_init = __esm({
|
|
@@ -75836,8 +75885,8 @@ init_agent_outputs();
|
|
|
75836
75885
|
// packages/core/src/migration/checksum.ts
|
|
75837
75886
|
import { createHash as createHash8 } from "node:crypto";
|
|
75838
75887
|
import { readFileSync as readFileSync34 } from "node:fs";
|
|
75839
|
-
import { createRequire as
|
|
75840
|
-
var _require6 =
|
|
75888
|
+
import { createRequire as createRequire7 } from "node:module";
|
|
75889
|
+
var _require6 = createRequire7(import.meta.url);
|
|
75841
75890
|
var { DatabaseSync: DatabaseSync4 } = _require6("node:sqlite");
|
|
75842
75891
|
async function computeChecksum2(filePath) {
|
|
75843
75892
|
const content = readFileSync34(filePath);
|
|
@@ -88188,7 +88237,7 @@ init_schema_management();
|
|
|
88188
88237
|
init_data_accessor();
|
|
88189
88238
|
import { execFileSync as execFileSync11 } from "node:child_process";
|
|
88190
88239
|
import { existsSync as existsSync92, readFileSync as readFileSync65, statSync as statSync19 } from "node:fs";
|
|
88191
|
-
import { createRequire as
|
|
88240
|
+
import { createRequire as createRequire10 } from "node:module";
|
|
88192
88241
|
import { join as join93 } from "node:path";
|
|
88193
88242
|
|
|
88194
88243
|
// packages/core/src/validation/doctor/checks.ts
|
|
@@ -89002,7 +89051,7 @@ function calculateHealthStatus(checks) {
|
|
|
89002
89051
|
|
|
89003
89052
|
// packages/core/src/system/health.ts
|
|
89004
89053
|
init_dependencies();
|
|
89005
|
-
var _require9 =
|
|
89054
|
+
var _require9 = createRequire10(import.meta.url);
|
|
89006
89055
|
var databaseSyncCtor = (() => {
|
|
89007
89056
|
try {
|
|
89008
89057
|
return _require9("node:sqlite").DatabaseSync;
|
|
@@ -89550,6 +89599,7 @@ async function coreDoctorReport(projectRoot) {
|
|
|
89550
89599
|
});
|
|
89551
89600
|
checks.push(mapCheckResult(checkGlobalHome()));
|
|
89552
89601
|
checks.push(mapCheckResult(checkGlobalTemplates()));
|
|
89602
|
+
checks.push(mapCheckResult(checkGlobalIdentity()));
|
|
89553
89603
|
checks.push(mapSchemaCheckResult(checkGlobalSchemas()));
|
|
89554
89604
|
checks.push(mapCheckResult(checkLogDir(projectRoot)));
|
|
89555
89605
|
const hookResults = await checkGitHooks(projectRoot);
|
|
@@ -97816,11 +97866,11 @@ init_paths();
|
|
|
97816
97866
|
init_brain_sqlite();
|
|
97817
97867
|
init_brain_search();
|
|
97818
97868
|
import { existsSync as existsSync111 } from "node:fs";
|
|
97819
|
-
import { createRequire as
|
|
97869
|
+
import { createRequire as createRequire11 } from "node:module";
|
|
97820
97870
|
function typedAll3(db, sql16) {
|
|
97821
97871
|
return db.prepare(sql16).all();
|
|
97822
97872
|
}
|
|
97823
|
-
var _require10 =
|
|
97873
|
+
var _require10 = createRequire11(import.meta.url);
|
|
97824
97874
|
var { DatabaseSync: DatabaseSync5 } = _require10("node:sqlite");
|
|
97825
97875
|
var VALID_OBSERVATION_TYPES = /* @__PURE__ */ new Set([
|
|
97826
97876
|
"discovery",
|
|
@@ -100391,7 +100441,7 @@ init_backup();
|
|
|
100391
100441
|
// packages/core/src/store/backup-pack.ts
|
|
100392
100442
|
import crypto5 from "node:crypto";
|
|
100393
100443
|
import fs4 from "node:fs";
|
|
100394
|
-
import { createRequire as
|
|
100444
|
+
import { createRequire as createRequire12 } from "node:module";
|
|
100395
100445
|
import os2 from "node:os";
|
|
100396
100446
|
import path4 from "node:path";
|
|
100397
100447
|
|
|
@@ -103397,7 +103447,7 @@ function assertT310Ready(projectRoot) {
|
|
|
103397
103447
|
}
|
|
103398
103448
|
|
|
103399
103449
|
// packages/core/src/store/backup-pack.ts
|
|
103400
|
-
var _require11 =
|
|
103450
|
+
var _require11 = createRequire12(import.meta.url);
|
|
103401
103451
|
var { DatabaseSync: DatabaseSync6 } = _require11("node:sqlite");
|
|
103402
103452
|
function resolveContractsSchemasDir() {
|
|
103403
103453
|
const candidates = [
|
|
@@ -103896,9 +103946,9 @@ init_conduit_sqlite();
|
|
|
103896
103946
|
init_global_salt();
|
|
103897
103947
|
init_signaldock_sqlite();
|
|
103898
103948
|
import { existsSync as existsSync117, mkdirSync as mkdirSync27, renameSync as renameSync9, unlinkSync as unlinkSync9 } from "node:fs";
|
|
103899
|
-
import { createRequire as
|
|
103949
|
+
import { createRequire as createRequire13 } from "node:module";
|
|
103900
103950
|
import { join as join114 } from "node:path";
|
|
103901
|
-
var _require12 =
|
|
103951
|
+
var _require12 = createRequire13(import.meta.url);
|
|
103902
103952
|
var { DatabaseSync: DatabaseSync7 } = _require12("node:sqlite");
|
|
103903
103953
|
var PROJECT_TIER_TABLES = [
|
|
103904
103954
|
"messages",
|
|
@@ -106058,6 +106108,16 @@ async function runUpgrade(options = {}) {
|
|
|
106058
106108
|
}
|
|
106059
106109
|
} catch {
|
|
106060
106110
|
}
|
|
106111
|
+
try {
|
|
106112
|
+
const { ensureGlobalIdentity: ensureGlobalIdentity2 } = await Promise.resolve().then(() => (init_scaffold(), scaffold_exports));
|
|
106113
|
+
const identityResult = await ensureGlobalIdentity2();
|
|
106114
|
+
actions.push({
|
|
106115
|
+
action: "global_identity",
|
|
106116
|
+
status: identityResult.action === "created" || identityResult.action === "repaired" ? "applied" : "skipped",
|
|
106117
|
+
details: `${identityResult.path} (${identityResult.details ?? identityResult.action})`
|
|
106118
|
+
});
|
|
106119
|
+
} catch {
|
|
106120
|
+
}
|
|
106061
106121
|
try {
|
|
106062
106122
|
const skillsCreated = [];
|
|
106063
106123
|
const skillsWarnings = [];
|
|
@@ -108699,11 +108759,11 @@ init_tasks_schema();
|
|
|
108699
108759
|
var import__ = __toESM(require__(), 1);
|
|
108700
108760
|
import crypto6 from "node:crypto";
|
|
108701
108761
|
import fs6 from "node:fs";
|
|
108702
|
-
import { createRequire as
|
|
108762
|
+
import { createRequire as createRequire14 } from "node:module";
|
|
108703
108763
|
import os3 from "node:os";
|
|
108704
108764
|
import path6 from "node:path";
|
|
108705
108765
|
import { default as addFormatsImport2 } from "ajv-formats";
|
|
108706
|
-
var _require13 =
|
|
108766
|
+
var _require13 = createRequire14(import.meta.url);
|
|
108707
108767
|
var { DatabaseSync: DatabaseSync8 } = _require13("node:sqlite");
|
|
108708
108768
|
var ajv2020Mod = import__.default;
|
|
108709
108769
|
var Ajv2020 = typeof ajv2020Mod.default === "function" ? ajv2020Mod.default : import__.default;
|
|
@@ -110204,7 +110264,7 @@ async function decrypt(ciphertext, projectPath) {
|
|
|
110204
110264
|
init_paths();
|
|
110205
110265
|
import { randomBytes as randomBytes17 } from "node:crypto";
|
|
110206
110266
|
import { existsSync as existsSync127, mkdirSync as mkdirSync32, readFileSync as readFileSync93, statSync as statSync21, writeFileSync as writeFileSync23 } from "node:fs";
|
|
110207
|
-
import { createRequire as
|
|
110267
|
+
import { createRequire as createRequire15 } from "node:module";
|
|
110208
110268
|
import { join as join122 } from "node:path";
|
|
110209
110269
|
|
|
110210
110270
|
// packages/core/src/store/api-key-kdf.ts
|
|
@@ -110231,7 +110291,7 @@ function deriveApiKey(input) {
|
|
|
110231
110291
|
init_conduit_sqlite();
|
|
110232
110292
|
init_global_salt();
|
|
110233
110293
|
init_signaldock_sqlite();
|
|
110234
|
-
var _require14 =
|
|
110294
|
+
var _require14 = createRequire15(import.meta.url);
|
|
110235
110295
|
var { DatabaseSync: DatabaseSync9 } = _require14("node:sqlite");
|
|
110236
110296
|
var MACHINE_KEY_LENGTH = 32;
|
|
110237
110297
|
function readMachineKey() {
|