@cleocode/cleo 2026.5.2 → 2026.5.3
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/cli/index.js +73 -45
- package/dist/cli/index.js.map +3 -3
- package/package.json +12 -9
package/dist/cli/index.js
CHANGED
|
@@ -21134,12 +21134,12 @@ async function orchestrateRejectOp(params) {
|
|
|
21134
21134
|
async function orchestrateClassify(request, context, projectRoot) {
|
|
21135
21135
|
try {
|
|
21136
21136
|
const { getCleoCantWorkflowsDir } = await import("@cleocode/core/internal");
|
|
21137
|
-
const { readFileSync: readFileSync14, readdirSync: readdirSync3, existsSync:
|
|
21137
|
+
const { readFileSync: readFileSync14, readdirSync: readdirSync3, existsSync: existsSync12 } = await import("node:fs");
|
|
21138
21138
|
const { join: join20 } = await import("node:path");
|
|
21139
21139
|
const workflowsDir = getCleoCantWorkflowsDir();
|
|
21140
21140
|
const combined = `${request} ${context ?? ""}`.toLowerCase();
|
|
21141
21141
|
const matches = [];
|
|
21142
|
-
if (
|
|
21142
|
+
if (existsSync12(workflowsDir)) {
|
|
21143
21143
|
const files = readdirSync3(workflowsDir).filter((f) => f.endsWith(".cant"));
|
|
21144
21144
|
for (const file of files) {
|
|
21145
21145
|
try {
|
|
@@ -21159,7 +21159,7 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
21159
21159
|
}
|
|
21160
21160
|
}
|
|
21161
21161
|
const localCantDir = join20(projectRoot, CLEO_DIR_NAME, WORKFLOWS_SUBDIR);
|
|
21162
|
-
if (
|
|
21162
|
+
if (existsSync12(localCantDir)) {
|
|
21163
21163
|
const files = readdirSync3(localCantDir).filter((f) => f.endsWith(".cant"));
|
|
21164
21164
|
for (const file of files) {
|
|
21165
21165
|
try {
|
|
@@ -27659,12 +27659,12 @@ var registerCommand = defineCommand({
|
|
|
27659
27659
|
transportConfig: {},
|
|
27660
27660
|
isActive: true
|
|
27661
27661
|
});
|
|
27662
|
-
const { existsSync:
|
|
27662
|
+
const { existsSync: existsSync12, mkdirSync: mkdirSync5, writeFileSync: writeFileSync5 } = await import("node:fs");
|
|
27663
27663
|
const { join: join20 } = await import("node:path");
|
|
27664
27664
|
const cantDir = join20(CLEO_DIR_NAME, AGENTS_SUBDIR);
|
|
27665
27665
|
const cantPath = join20(cantDir, `${agentId}.cant`);
|
|
27666
27666
|
let cantScaffolded = false;
|
|
27667
|
-
if (!
|
|
27667
|
+
if (!existsSync12(cantPath)) {
|
|
27668
27668
|
mkdirSync5(cantDir, { recursive: true });
|
|
27669
27669
|
const role = classification ?? "specialist";
|
|
27670
27670
|
const cantContent = `---
|
|
@@ -27724,7 +27724,7 @@ agent ${agentId}:
|
|
|
27724
27724
|
data: {
|
|
27725
27725
|
agentId: credential.agentId,
|
|
27726
27726
|
displayName: credential.displayName,
|
|
27727
|
-
cantFile: cantScaffolded ? cantPath :
|
|
27727
|
+
cantFile: cantScaffolded ? cantPath : existsSync12(cantPath) ? cantPath : null,
|
|
27728
27728
|
cantScaffolded
|
|
27729
27729
|
}
|
|
27730
27730
|
},
|
|
@@ -27843,7 +27843,7 @@ var startCommand = defineCommand({
|
|
|
27843
27843
|
try {
|
|
27844
27844
|
const { AgentRegistryAccessor, getDb: getDb3 } = await import("@cleocode/core/internal");
|
|
27845
27845
|
const { createRuntime } = await import("@cleocode/runtime");
|
|
27846
|
-
const { existsSync:
|
|
27846
|
+
const { existsSync: existsSync12, readFileSync: readFileSync14 } = await import("node:fs");
|
|
27847
27847
|
const { join: join20 } = await import("node:path");
|
|
27848
27848
|
await getDb3();
|
|
27849
27849
|
const registry = new AgentRegistryAccessor(process.cwd());
|
|
@@ -27865,7 +27865,7 @@ var startCommand = defineCommand({
|
|
|
27865
27865
|
let profile = null;
|
|
27866
27866
|
let cantValidation = null;
|
|
27867
27867
|
const cantPath = args.cant ?? join20(CLEO_DIR_NAME, AGENTS_SUBDIR, `${args.agentId}.cant`);
|
|
27868
|
-
if (
|
|
27868
|
+
if (existsSync12(cantPath)) {
|
|
27869
27869
|
profile = readFileSync14(cantPath, "utf-8");
|
|
27870
27870
|
try {
|
|
27871
27871
|
const cantModule = await import("@cleocode/cant");
|
|
@@ -28389,7 +28389,7 @@ var workCommand = defineCommand({
|
|
|
28389
28389
|
try {
|
|
28390
28390
|
const { AgentRegistryAccessor, getDb: getDb3 } = await import("@cleocode/core/internal");
|
|
28391
28391
|
const { createRuntime } = await import("@cleocode/runtime");
|
|
28392
|
-
const { existsSync:
|
|
28392
|
+
const { existsSync: existsSync12 } = await import("node:fs");
|
|
28393
28393
|
const { join: join20 } = await import("node:path");
|
|
28394
28394
|
const { execFile: execFile2 } = await import("node:child_process");
|
|
28395
28395
|
const { promisify: promisify2 } = await import("node:util");
|
|
@@ -28411,7 +28411,7 @@ var workCommand = defineCommand({
|
|
|
28411
28411
|
await registry.update(args.agentId, { isActive: true });
|
|
28412
28412
|
await registry.markUsed(args.agentId);
|
|
28413
28413
|
const cantPath = join20(CLEO_DIR_NAME, AGENTS_SUBDIR, `${args.agentId}.cant`);
|
|
28414
|
-
const hasProfile =
|
|
28414
|
+
const hasProfile = existsSync12(cantPath);
|
|
28415
28415
|
const runtime = await createRuntime(registry, {
|
|
28416
28416
|
agentId: args.agentId,
|
|
28417
28417
|
pollIntervalMs: 5e3,
|
|
@@ -29261,11 +29261,11 @@ var installCommand = defineCommand({
|
|
|
29261
29261
|
async run({ args }) {
|
|
29262
29262
|
let tempDir = null;
|
|
29263
29263
|
try {
|
|
29264
|
-
const { existsSync:
|
|
29264
|
+
const { existsSync: existsSync12, mkdirSync: mkdirSync5, statSync, readdirSync: readdirSync3, copyFileSync } = await import("node:fs");
|
|
29265
29265
|
const { join: join20, basename, resolve: resolve5, extname } = await import("node:path");
|
|
29266
29266
|
const { tmpdir } = await import("node:os");
|
|
29267
29267
|
const resolvedPath = resolve5(args.path);
|
|
29268
|
-
if (!
|
|
29268
|
+
if (!existsSync12(resolvedPath)) {
|
|
29269
29269
|
cliOutput(
|
|
29270
29270
|
{
|
|
29271
29271
|
success: false,
|
|
@@ -29326,7 +29326,7 @@ var installCommand = defineCommand({
|
|
|
29326
29326
|
}
|
|
29327
29327
|
const agentName = topLevel[0];
|
|
29328
29328
|
const personaPath = join20(tempDir, agentName, "persona.cant");
|
|
29329
|
-
if (!
|
|
29329
|
+
if (!existsSync12(personaPath)) {
|
|
29330
29330
|
cliOutput(
|
|
29331
29331
|
{
|
|
29332
29332
|
success: false,
|
|
@@ -29345,7 +29345,7 @@ var installCommand = defineCommand({
|
|
|
29345
29345
|
} else if (stat2.isDirectory()) {
|
|
29346
29346
|
const agentName = basename(resolvedPath);
|
|
29347
29347
|
const personaPath = join20(resolvedPath, "persona.cant");
|
|
29348
|
-
if (!
|
|
29348
|
+
if (!existsSync12(personaPath)) {
|
|
29349
29349
|
cliOutput(
|
|
29350
29350
|
{
|
|
29351
29351
|
success: false,
|
|
@@ -29488,11 +29488,11 @@ var packCommand = defineCommand({
|
|
|
29488
29488
|
},
|
|
29489
29489
|
async run({ args }) {
|
|
29490
29490
|
try {
|
|
29491
|
-
const { existsSync:
|
|
29491
|
+
const { existsSync: existsSync12, statSync } = await import("node:fs");
|
|
29492
29492
|
const { resolve: resolve5, basename, dirname: dirname10 } = await import("node:path");
|
|
29493
29493
|
const { execFileSync: execFileSync5 } = await import("node:child_process");
|
|
29494
29494
|
const resolvedDir = resolve5(args.dir);
|
|
29495
|
-
if (!
|
|
29495
|
+
if (!existsSync12(resolvedDir) || !statSync(resolvedDir).isDirectory()) {
|
|
29496
29496
|
cliOutput(
|
|
29497
29497
|
{
|
|
29498
29498
|
success: false,
|
|
@@ -29508,7 +29508,7 @@ var packCommand = defineCommand({
|
|
|
29508
29508
|
}
|
|
29509
29509
|
const { join: join20 } = await import("node:path");
|
|
29510
29510
|
const personaPath = join20(resolvedDir, "persona.cant");
|
|
29511
|
-
if (!
|
|
29511
|
+
if (!existsSync12(personaPath)) {
|
|
29512
29512
|
cliOutput(
|
|
29513
29513
|
{
|
|
29514
29514
|
success: false,
|
|
@@ -29624,7 +29624,7 @@ var createCommand = defineCommand({
|
|
|
29624
29624
|
},
|
|
29625
29625
|
async run({ args }) {
|
|
29626
29626
|
try {
|
|
29627
|
-
const { existsSync:
|
|
29627
|
+
const { existsSync: existsSync12, mkdirSync: mkdirSync5, writeFileSync: writeFileSync5 } = await import("node:fs");
|
|
29628
29628
|
const { join: join20 } = await import("node:path");
|
|
29629
29629
|
const { homedir: homedir6 } = await import("node:os");
|
|
29630
29630
|
const name = args.name;
|
|
@@ -29691,7 +29691,7 @@ var createCommand = defineCommand({
|
|
|
29691
29691
|
targetRoot = join20(process.cwd(), CLEO_DIR_NAME, CANT_AGENTS_SUBDIR);
|
|
29692
29692
|
}
|
|
29693
29693
|
const agentDir = join20(targetRoot, name);
|
|
29694
|
-
if (
|
|
29694
|
+
if (existsSync12(agentDir)) {
|
|
29695
29695
|
cliOutput(
|
|
29696
29696
|
{
|
|
29697
29697
|
success: false,
|
|
@@ -29835,10 +29835,10 @@ var mintCommand = defineCommand({
|
|
|
29835
29835
|
},
|
|
29836
29836
|
async run({ args }) {
|
|
29837
29837
|
try {
|
|
29838
|
-
const { existsSync:
|
|
29838
|
+
const { existsSync: existsSync12, readFileSync: readFileSync14, mkdirSync: mkdirSync5 } = await import("node:fs");
|
|
29839
29839
|
const { resolve: resolve5, join: join20 } = await import("node:path");
|
|
29840
29840
|
const specPath = resolve5(args.spec);
|
|
29841
|
-
if (!
|
|
29841
|
+
if (!existsSync12(specPath)) {
|
|
29842
29842
|
const errEnv = {
|
|
29843
29843
|
success: false,
|
|
29844
29844
|
error: { code: "E_NOT_FOUND", message: `spec file not found: ${specPath}` },
|
|
@@ -34024,6 +34024,7 @@ var currentCommand = defineCommand({
|
|
|
34024
34024
|
});
|
|
34025
34025
|
|
|
34026
34026
|
// packages/cleo/src/cli/commands/daemon.ts
|
|
34027
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
34027
34028
|
import { homedir as homedir2 } from "node:os";
|
|
34028
34029
|
import { join as join9 } from "node:path";
|
|
34029
34030
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -34044,11 +34045,15 @@ async function showDaemonStatus(cleoDir, projectRoot, json2) {
|
|
|
34044
34045
|
duplicateEpicGroups: 0,
|
|
34045
34046
|
worktreesPruned: 0
|
|
34046
34047
|
};
|
|
34048
|
+
let supervisesStudio = null;
|
|
34049
|
+
let studioStatus = null;
|
|
34047
34050
|
try {
|
|
34048
34051
|
const sentientStatus = await getSentientDaemonStatus(projectRoot);
|
|
34049
34052
|
hygieneLastRunAt = sentientStatus.hygieneLastRunAt;
|
|
34050
34053
|
hygieneSummary = sentientStatus.hygieneSummary;
|
|
34051
34054
|
hygieneStats = sentientStatus.hygieneStats;
|
|
34055
|
+
supervisesStudio = sentientStatus.supervisesStudio;
|
|
34056
|
+
studioStatus = sentientStatus.studioStatus;
|
|
34052
34057
|
} catch {
|
|
34053
34058
|
}
|
|
34054
34059
|
const result = {
|
|
@@ -34059,6 +34064,10 @@ async function showDaemonStatus(cleoDir, projectRoot, json2) {
|
|
|
34059
34064
|
lastRunAt: hygieneLastRunAt,
|
|
34060
34065
|
summary: hygieneSummary,
|
|
34061
34066
|
stats: hygieneStats
|
|
34067
|
+
},
|
|
34068
|
+
studio: {
|
|
34069
|
+
supervises: supervisesStudio,
|
|
34070
|
+
status: studioStatus
|
|
34062
34071
|
}
|
|
34063
34072
|
}
|
|
34064
34073
|
};
|
|
@@ -34082,6 +34091,15 @@ WARNING: Disk threshold breached. Run 'cleo gc run' to reclaim space.
|
|
|
34082
34091
|
`
|
|
34083
34092
|
);
|
|
34084
34093
|
}
|
|
34094
|
+
if (supervisesStudio !== null) {
|
|
34095
|
+
process.stdout.write(`
|
|
34096
|
+
Studio Supervision:
|
|
34097
|
+
`);
|
|
34098
|
+
process.stdout.write(` Enabled: ${supervisesStudio ? "yes" : "no"}
|
|
34099
|
+
`);
|
|
34100
|
+
process.stdout.write(` Status: ${studioStatus ?? "unknown"}
|
|
34101
|
+
`);
|
|
34102
|
+
}
|
|
34085
34103
|
process.stdout.write(`
|
|
34086
34104
|
Hygiene Loop (cross-project):
|
|
34087
34105
|
`);
|
|
@@ -34128,9 +34146,19 @@ Hygiene Loop (cross-project):
|
|
|
34128
34146
|
}
|
|
34129
34147
|
}
|
|
34130
34148
|
function resolveDaemonInstallerScript() {
|
|
34131
|
-
const
|
|
34132
|
-
const
|
|
34133
|
-
|
|
34149
|
+
const filePath = fileURLToPath3(import.meta.url);
|
|
34150
|
+
const candidate1 = join9(filePath, "..", "..", "..", "scripts", "install-daemon-service.mjs");
|
|
34151
|
+
if (existsSync8(candidate1)) return candidate1;
|
|
34152
|
+
const candidate2 = join9(
|
|
34153
|
+
filePath,
|
|
34154
|
+
"..",
|
|
34155
|
+
"..",
|
|
34156
|
+
"..",
|
|
34157
|
+
"..",
|
|
34158
|
+
"scripts",
|
|
34159
|
+
"install-daemon-service.mjs"
|
|
34160
|
+
);
|
|
34161
|
+
return candidate2;
|
|
34134
34162
|
}
|
|
34135
34163
|
var startCommand3 = defineCommand({
|
|
34136
34164
|
meta: { name: "start", description: "Spawn the GC daemon as a detached background process" },
|
|
@@ -34733,14 +34761,14 @@ var detectCommand2 = defineCommand({
|
|
|
34733
34761
|
|
|
34734
34762
|
// packages/cleo/src/cli/commands/detect-drift.ts
|
|
34735
34763
|
init_src();
|
|
34736
|
-
import { existsSync as
|
|
34764
|
+
import { existsSync as existsSync9, readdirSync, readFileSync as readFileSync9 } from "node:fs";
|
|
34737
34765
|
import { dirname as dirname6, join as join10 } from "node:path";
|
|
34738
34766
|
init_paths();
|
|
34739
34767
|
init_renderers();
|
|
34740
34768
|
function findProjectRoot() {
|
|
34741
34769
|
let currentDir = process.cwd();
|
|
34742
34770
|
while (currentDir !== "/") {
|
|
34743
|
-
if (
|
|
34771
|
+
if (existsSync9(join10(currentDir, "package.json"))) {
|
|
34744
34772
|
return currentDir;
|
|
34745
34773
|
}
|
|
34746
34774
|
const parent = dirname6(currentDir);
|
|
@@ -34756,7 +34784,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34756
34784
|
},
|
|
34757
34785
|
async run() {
|
|
34758
34786
|
const projectRoot = findProjectRoot();
|
|
34759
|
-
const isCleoRepo =
|
|
34787
|
+
const isCleoRepo = existsSync9(join10(projectRoot, "packages", "cleo", "src"));
|
|
34760
34788
|
const cleoSrcRoot = isCleoRepo ? join10(projectRoot, "packages", "cleo", "src") : join10(projectRoot, "src");
|
|
34761
34789
|
const safeRead = (filePath) => {
|
|
34762
34790
|
try {
|
|
@@ -34772,7 +34800,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34772
34800
|
recommendations: []
|
|
34773
34801
|
};
|
|
34774
34802
|
const injPath = join10(projectRoot, CLEO_DIR_NAME, TEMPLATES_SUBDIR, CLEO_INJECTION_MD);
|
|
34775
|
-
if (
|
|
34803
|
+
if (existsSync9(injPath)) {
|
|
34776
34804
|
const content = safeRead(injPath);
|
|
34777
34805
|
userResult.checks.push({
|
|
34778
34806
|
name: "Agent injection",
|
|
@@ -34826,7 +34854,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34826
34854
|
const specPath = join10(projectRoot, "docs", "specs", "CLEO-OPERATION-CONSTITUTION.md");
|
|
34827
34855
|
const registryPath = join10(cleoSrcRoot, "dispatch", "registry.ts");
|
|
34828
34856
|
const dispatchDomainsDir = join10(cleoSrcRoot, "dispatch", "domains");
|
|
34829
|
-
if (!
|
|
34857
|
+
if (!existsSync9(specPath)) {
|
|
34830
34858
|
addCheck("Gateway-to-spec sync", "fail", "CLEO-OPERATION-CONSTITUTION.md missing", [
|
|
34831
34859
|
{
|
|
34832
34860
|
severity: "error",
|
|
@@ -34836,7 +34864,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34836
34864
|
recommendation: "Create docs/specs/CLEO-OPERATION-CONSTITUTION.md with canonical operation definitions"
|
|
34837
34865
|
}
|
|
34838
34866
|
]);
|
|
34839
|
-
} else if (!
|
|
34867
|
+
} else if (!existsSync9(registryPath) || !existsSync9(dispatchDomainsDir)) {
|
|
34840
34868
|
addCheck("Gateway-to-spec sync", "fail", "Dispatch registry or domains missing", [
|
|
34841
34869
|
{
|
|
34842
34870
|
severity: "error",
|
|
@@ -34896,7 +34924,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34896
34924
|
try {
|
|
34897
34925
|
const cliDir = join10(cleoSrcRoot, "cli", "commands");
|
|
34898
34926
|
const coreDir = isCleoRepo ? join10(projectRoot, "packages", "core", "src") : join10(projectRoot, "src", "core");
|
|
34899
|
-
if (!
|
|
34927
|
+
if (!existsSync9(cliDir)) {
|
|
34900
34928
|
addCheck("CLI-to-core sync", "fail", "CLI commands directory missing", [
|
|
34901
34929
|
{
|
|
34902
34930
|
severity: "error",
|
|
@@ -34905,7 +34933,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34905
34933
|
recommendation: "Verify TypeScript source structure is intact"
|
|
34906
34934
|
}
|
|
34907
34935
|
]);
|
|
34908
|
-
} else if (!
|
|
34936
|
+
} else if (!existsSync9(coreDir)) {
|
|
34909
34937
|
addCheck("CLI-to-core sync", "fail", "Core directory missing", [
|
|
34910
34938
|
{
|
|
34911
34939
|
severity: "error",
|
|
@@ -34923,7 +34951,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34923
34951
|
}
|
|
34924
34952
|
try {
|
|
34925
34953
|
const domainsDir = join10(cleoSrcRoot, "dispatch", "domains");
|
|
34926
|
-
if (!
|
|
34954
|
+
if (!existsSync9(domainsDir)) {
|
|
34927
34955
|
addCheck("Domain handler coverage", "fail", "Dispatch domains directory missing", [
|
|
34928
34956
|
{
|
|
34929
34957
|
severity: "error",
|
|
@@ -34941,7 +34969,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34941
34969
|
}
|
|
34942
34970
|
try {
|
|
34943
34971
|
const matrixPath = join10(cleoSrcRoot, "dispatch", "lib", "capability-matrix.ts");
|
|
34944
|
-
if (!
|
|
34972
|
+
if (!existsSync9(matrixPath)) {
|
|
34945
34973
|
addCheck("Capability matrix", "fail", "Capability matrix missing", [
|
|
34946
34974
|
{
|
|
34947
34975
|
severity: "error",
|
|
@@ -34958,7 +34986,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34958
34986
|
}
|
|
34959
34987
|
try {
|
|
34960
34988
|
const schemaPath = join10(projectRoot, "src", "store", "schema.ts");
|
|
34961
|
-
if (!
|
|
34989
|
+
if (!existsSync9(schemaPath)) {
|
|
34962
34990
|
addCheck("Schema validation", "fail", "Schema definition missing", [
|
|
34963
34991
|
{
|
|
34964
34992
|
severity: "error",
|
|
@@ -34995,7 +35023,7 @@ var detectDriftCommand = defineCommand({
|
|
|
34995
35023
|
const visionPath = join10(projectRoot, "docs", "concepts", "CLEO-VISION.md");
|
|
34996
35024
|
const specPath = join10(projectRoot, "docs", "specs", "CLEO-PORTABLE-PROJECT-BRAIN-SPEC.md");
|
|
34997
35025
|
const issues = [];
|
|
34998
|
-
if (!
|
|
35026
|
+
if (!existsSync9(visionPath)) {
|
|
34999
35027
|
issues.push({
|
|
35000
35028
|
severity: "error",
|
|
35001
35029
|
category: "vision",
|
|
@@ -35004,7 +35032,7 @@ var detectDriftCommand = defineCommand({
|
|
|
35004
35032
|
recommendation: "Create docs/concepts/CLEO-VISION.md with project vision"
|
|
35005
35033
|
});
|
|
35006
35034
|
}
|
|
35007
|
-
if (!
|
|
35035
|
+
if (!existsSync9(specPath)) {
|
|
35008
35036
|
issues.push({
|
|
35009
35037
|
severity: "error",
|
|
35010
35038
|
category: "spec",
|
|
@@ -35049,7 +35077,7 @@ var detectDriftCommand = defineCommand({
|
|
|
35049
35077
|
}
|
|
35050
35078
|
try {
|
|
35051
35079
|
const injectionPath = join10(projectRoot, CLEO_DIR_NAME, TEMPLATES_SUBDIR, CLEO_INJECTION_MD);
|
|
35052
|
-
if (!
|
|
35080
|
+
if (!existsSync9(injectionPath)) {
|
|
35053
35081
|
addCheck("Agent injection", "fail", "Agent injection template missing", [
|
|
35054
35082
|
{
|
|
35055
35083
|
severity: "error",
|
|
@@ -35079,7 +35107,7 @@ var detectDriftCommand = defineCommand({
|
|
|
35079
35107
|
}
|
|
35080
35108
|
try {
|
|
35081
35109
|
const exitCodesPath = join10(cleoSrcRoot, "dispatch", "lib", "exit-codes.ts");
|
|
35082
|
-
if (!
|
|
35110
|
+
if (!existsSync9(exitCodesPath)) {
|
|
35083
35111
|
addCheck("Exit codes", "fail", "Exit codes definition missing", [
|
|
35084
35112
|
{
|
|
35085
35113
|
severity: "error",
|
|
@@ -36776,7 +36804,7 @@ var gcCommand = defineCommand({
|
|
|
36776
36804
|
// packages/cleo/src/cli/commands/generate-changelog.ts
|
|
36777
36805
|
init_src();
|
|
36778
36806
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
36779
|
-
import { existsSync as
|
|
36807
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync3, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "node:fs";
|
|
36780
36808
|
import { dirname as dirname8, join as join13 } from "node:path";
|
|
36781
36809
|
import { CleoError as CleoError4, formatError as formatError6, getConfigPath as getConfigPath2, getProjectRoot as getProjectRoot23 } from "@cleocode/core";
|
|
36782
36810
|
init_renderers();
|
|
@@ -36937,7 +36965,7 @@ var generateChangelogCommand = defineCommand({
|
|
|
36937
36965
|
const dryRun = args["dry-run"] === true;
|
|
36938
36966
|
const sourceFile = getChangelogSource();
|
|
36939
36967
|
const sourcePath = join13(getProjectRoot23(), sourceFile);
|
|
36940
|
-
if (!
|
|
36968
|
+
if (!existsSync10(sourcePath)) {
|
|
36941
36969
|
throw new CleoError4(4 /* NOT_FOUND */, `Changelog source not found: ${sourcePath}`);
|
|
36942
36970
|
}
|
|
36943
36971
|
const sourceContent = readFileSync10(sourcePath, "utf-8");
|
|
@@ -38388,7 +38416,7 @@ var mapCommand = defineCommand({
|
|
|
38388
38416
|
|
|
38389
38417
|
// packages/cleo/src/cli/commands/memory.ts
|
|
38390
38418
|
import { createHash as createHash2 } from "node:crypto";
|
|
38391
|
-
import { existsSync as
|
|
38419
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync4, readdirSync as readdirSync2, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "node:fs";
|
|
38392
38420
|
import { homedir as homedir4 } from "node:os";
|
|
38393
38421
|
import { join as join14 } from "node:path";
|
|
38394
38422
|
import {
|
|
@@ -38433,7 +38461,7 @@ ${body}`).digest("hex").slice(0, 16);
|
|
|
38433
38461
|
}
|
|
38434
38462
|
function loadImportHashes(stateFile) {
|
|
38435
38463
|
try {
|
|
38436
|
-
if (!
|
|
38464
|
+
if (!existsSync11(stateFile)) return /* @__PURE__ */ new Set();
|
|
38437
38465
|
const raw = readFileSync11(stateFile, "utf-8");
|
|
38438
38466
|
const parsed = JSON.parse(raw);
|
|
38439
38467
|
return new Set(parsed.hashes);
|
|
@@ -38443,7 +38471,7 @@ function loadImportHashes(stateFile) {
|
|
|
38443
38471
|
}
|
|
38444
38472
|
function saveImportHashes(stateFile, hashes) {
|
|
38445
38473
|
const dir = stateFile.slice(0, stateFile.lastIndexOf("/"));
|
|
38446
|
-
if (!
|
|
38474
|
+
if (!existsSync11(dir)) mkdirSync4(dir, { recursive: true });
|
|
38447
38475
|
writeFileSync4(stateFile, JSON.stringify({ hashes: [...hashes] }, null, 2), "utf-8");
|
|
38448
38476
|
}
|
|
38449
38477
|
var storeCommand = defineCommand({
|
|
@@ -39693,7 +39721,7 @@ var importCommand3 = defineCommand({
|
|
|
39693
39721
|
const isJson = !!args.json;
|
|
39694
39722
|
const projectRoot = getProjectRoot24();
|
|
39695
39723
|
const stateFile = join14(projectRoot, CLEO_DIR_NAME, MIGRATE_MEMORY_HASHES_JSON);
|
|
39696
|
-
if (!
|
|
39724
|
+
if (!existsSync11(sourceDir)) {
|
|
39697
39725
|
const msg = `Source directory not found: ${sourceDir}`;
|
|
39698
39726
|
if (isJson) {
|
|
39699
39727
|
console.log(JSON.stringify({ success: false, error: msg }));
|