@cleocode/cleo 2026.4.144 → 2026.4.146
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 +212 -38
- package/dist/cli/index.js.map +4 -4
- package/package.json +9 -9
package/dist/cli/index.js
CHANGED
|
@@ -1291,12 +1291,61 @@ var init_task_evidence = __esm({
|
|
|
1291
1291
|
}
|
|
1292
1292
|
});
|
|
1293
1293
|
|
|
1294
|
+
// packages/contracts/src/tasks/archive.ts
|
|
1295
|
+
import { z as z6 } from "zod";
|
|
1296
|
+
function isArchiveTombstoneAllowed() {
|
|
1297
|
+
const env = globalThis?.process?.env;
|
|
1298
|
+
return env?.[ARCHIVE_REASON_TOMBSTONE_ENV] === "1";
|
|
1299
|
+
}
|
|
1300
|
+
function assertArchiveReason(reason, taskId) {
|
|
1301
|
+
const parsed = ArchiveReason.parse(reason);
|
|
1302
|
+
if (parsed === ARCHIVE_REASON_TOMBSTONE && !isArchiveTombstoneAllowed()) {
|
|
1303
|
+
throw new ArchiveReasonTombstoneError(taskId);
|
|
1304
|
+
}
|
|
1305
|
+
return parsed;
|
|
1306
|
+
}
|
|
1307
|
+
var ArchiveReason, ArchiveReasonSchema, ARCHIVE_REASON_VALUES, ARCHIVE_REASON_TOMBSTONE, ArchiveReasonTombstoneError, ARCHIVE_REASON_TOMBSTONE_ENV;
|
|
1308
|
+
var init_archive = __esm({
|
|
1309
|
+
"packages/contracts/src/tasks/archive.ts"() {
|
|
1310
|
+
"use strict";
|
|
1311
|
+
ArchiveReason = z6.enum([
|
|
1312
|
+
"verified",
|
|
1313
|
+
"reconciled",
|
|
1314
|
+
"superseded",
|
|
1315
|
+
"shadowed",
|
|
1316
|
+
"cancelled",
|
|
1317
|
+
"completed-unverified"
|
|
1318
|
+
]);
|
|
1319
|
+
ArchiveReasonSchema = ArchiveReason;
|
|
1320
|
+
ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
1321
|
+
ARCHIVE_REASON_TOMBSTONE = "completed-unverified";
|
|
1322
|
+
ArchiveReasonTombstoneError = class extends Error {
|
|
1323
|
+
code = "E_ARCHIVE_REASON_TOMBSTONE";
|
|
1324
|
+
taskId;
|
|
1325
|
+
constructor(taskId) {
|
|
1326
|
+
super(
|
|
1327
|
+
taskId ? `archiveReason='completed-unverified' is a tombstone \u2014 only migration backfill may write it (taskId=${taskId})` : "archiveReason='completed-unverified' is a tombstone \u2014 only migration backfill may write it"
|
|
1328
|
+
);
|
|
1329
|
+
this.name = "ArchiveReasonTombstoneError";
|
|
1330
|
+
this.taskId = taskId;
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
ARCHIVE_REASON_TOMBSTONE_ENV = "CLEO_ARCHIVE_ALLOW_TOMBSTONE";
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
|
|
1294
1337
|
// packages/contracts/src/index.ts
|
|
1295
1338
|
var src_exports = {};
|
|
1296
1339
|
__export(src_exports, {
|
|
1297
1340
|
ADR_STATUSES: () => ADR_STATUSES,
|
|
1298
1341
|
AGENT_INSTANCE_STATUSES: () => AGENT_INSTANCE_STATUSES,
|
|
1299
1342
|
AGENT_TYPES: () => AGENT_TYPES,
|
|
1343
|
+
ARCHIVE_REASON_TOMBSTONE: () => ARCHIVE_REASON_TOMBSTONE,
|
|
1344
|
+
ARCHIVE_REASON_TOMBSTONE_ENV: () => ARCHIVE_REASON_TOMBSTONE_ENV,
|
|
1345
|
+
ARCHIVE_REASON_VALUES: () => ARCHIVE_REASON_VALUES,
|
|
1346
|
+
ArchiveReason: () => ArchiveReason,
|
|
1347
|
+
ArchiveReasonSchema: () => ArchiveReasonSchema,
|
|
1348
|
+
ArchiveReasonTombstoneError: () => ArchiveReasonTombstoneError,
|
|
1300
1349
|
BRAIN_OBSERVATION_TYPES: () => BRAIN_OBSERVATION_TYPES,
|
|
1301
1350
|
BRANCH_LOCK_ERROR_CODES: () => BRANCH_LOCK_ERROR_CODES,
|
|
1302
1351
|
ClassifierUnregisteredAgentError: () => ClassifierUnregisteredAgentError,
|
|
@@ -1323,6 +1372,7 @@ __export(src_exports, {
|
|
|
1323
1372
|
acceptanceGateResultSchema: () => acceptanceGateResultSchema,
|
|
1324
1373
|
acceptanceGateSchema: () => acceptanceGateSchema,
|
|
1325
1374
|
acceptanceItemSchema: () => acceptanceItemSchema,
|
|
1375
|
+
assertArchiveReason: () => assertArchiveReason,
|
|
1326
1376
|
assertPeerIdentity: () => assertPeerIdentity,
|
|
1327
1377
|
attachmentMetadataSchema: () => attachmentMetadataSchema,
|
|
1328
1378
|
attachmentRefSchema: () => attachmentRefSchema,
|
|
@@ -1345,6 +1395,7 @@ __export(src_exports, {
|
|
|
1345
1395
|
getExitCodeName: () => getExitCodeName,
|
|
1346
1396
|
httpGateSchema: () => httpGateSchema,
|
|
1347
1397
|
implDiffRecordSchema: () => implDiffRecordSchema,
|
|
1398
|
+
isArchiveTombstoneAllowed: () => isArchiveTombstoneAllowed,
|
|
1348
1399
|
isErrorCode: () => isErrorCode,
|
|
1349
1400
|
isErrorResult: () => isErrorResult,
|
|
1350
1401
|
isErrorType: () => isErrorType,
|
|
@@ -1394,6 +1445,7 @@ var init_src = __esm({
|
|
|
1394
1445
|
init_session_journal();
|
|
1395
1446
|
init_status_registry();
|
|
1396
1447
|
init_task_evidence();
|
|
1448
|
+
init_archive();
|
|
1397
1449
|
}
|
|
1398
1450
|
});
|
|
1399
1451
|
|
|
@@ -11514,8 +11566,8 @@ async function releaseIvtrAutoSuggest(taskId, projectRoot) {
|
|
|
11514
11566
|
const cwd = projectRoot ?? resolveProjectRoot2();
|
|
11515
11567
|
try {
|
|
11516
11568
|
const accessor = await getAccessor4(cwd);
|
|
11517
|
-
const
|
|
11518
|
-
const taskRecord =
|
|
11569
|
+
const tasks = await accessor.loadTasks([taskId]);
|
|
11570
|
+
const taskRecord = tasks[0];
|
|
11519
11571
|
if (!taskRecord) {
|
|
11520
11572
|
return engineError("E_NOT_FOUND", `Task ${taskId} not found`);
|
|
11521
11573
|
}
|
|
@@ -16710,7 +16762,7 @@ var init_admin = __esm({
|
|
|
16710
16762
|
try {
|
|
16711
16763
|
const envelope = await typedDispatch(_adminTypedHandler, mutateKey(operation), params ?? {});
|
|
16712
16764
|
if (operation === "adr.sync") {
|
|
16713
|
-
const data = envelope.data;
|
|
16765
|
+
const data = envelope.success ? envelope.data : void 0;
|
|
16714
16766
|
if (data && "valid" in data && !data.valid) {
|
|
16715
16767
|
const errors = Array.isArray(data.errors) ? data.errors : [];
|
|
16716
16768
|
return {
|
|
@@ -17513,7 +17565,6 @@ var init_check = __esm({
|
|
|
17513
17565
|
return lafsSuccess(result.data ?? {}, "archive.stats");
|
|
17514
17566
|
},
|
|
17515
17567
|
"chain.validate": async (params) => {
|
|
17516
|
-
const _projectRoot = getProjectRoot3();
|
|
17517
17568
|
if (!params.chain) {
|
|
17518
17569
|
return lafsError("E_INVALID_INPUT", "chain is required", "chain.validate");
|
|
17519
17570
|
}
|
|
@@ -17603,6 +17654,21 @@ var init_check = __esm({
|
|
|
17603
17654
|
"test.run"
|
|
17604
17655
|
);
|
|
17605
17656
|
},
|
|
17657
|
+
"test.coverage": async (_params) => {
|
|
17658
|
+
const projectRoot = getProjectRoot3();
|
|
17659
|
+
const result = validateTestCoverage(projectRoot);
|
|
17660
|
+
if (!result.success) {
|
|
17661
|
+
return lafsError(
|
|
17662
|
+
String(result.error?.code ?? "E_INTERNAL"),
|
|
17663
|
+
result.error?.message ?? "Unknown error",
|
|
17664
|
+
"test.coverage"
|
|
17665
|
+
);
|
|
17666
|
+
}
|
|
17667
|
+
return lafsSuccess(
|
|
17668
|
+
result.data ?? { lineCoverage: 0, branchCoverage: 0, functionCoverage: 0, threshold: 0 },
|
|
17669
|
+
"test.coverage"
|
|
17670
|
+
);
|
|
17671
|
+
},
|
|
17606
17672
|
"compliance.sync": async (params) => {
|
|
17607
17673
|
const projectRoot = getProjectRoot3();
|
|
17608
17674
|
const { syncComplianceMetrics } = await import("@cleocode/core/internal");
|
|
@@ -17652,11 +17718,20 @@ var init_check = __esm({
|
|
|
17652
17718
|
async query(operation, params) {
|
|
17653
17719
|
const startTime = Date.now();
|
|
17654
17720
|
try {
|
|
17655
|
-
const envelope = await typedDispatch(
|
|
17721
|
+
const envelope = await typedDispatch(
|
|
17722
|
+
_checkTypedHandler,
|
|
17723
|
+
operation,
|
|
17724
|
+
params ?? {}
|
|
17725
|
+
);
|
|
17656
17726
|
return {
|
|
17657
17727
|
meta: dispatchMeta("query", "check", operation, startTime),
|
|
17658
17728
|
success: envelope.success,
|
|
17659
|
-
...envelope.success ? { data: envelope.data } : {
|
|
17729
|
+
...envelope.success ? { data: envelope.data } : {
|
|
17730
|
+
error: {
|
|
17731
|
+
code: envelope.error?.code !== void 0 ? String(envelope.error.code) : "E_INTERNAL",
|
|
17732
|
+
message: envelope.error?.message ?? "Unknown error"
|
|
17733
|
+
}
|
|
17734
|
+
}
|
|
17660
17735
|
};
|
|
17661
17736
|
} catch (error) {
|
|
17662
17737
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -17670,11 +17745,20 @@ var init_check = __esm({
|
|
|
17670
17745
|
async mutate(operation, params) {
|
|
17671
17746
|
const startTime = Date.now();
|
|
17672
17747
|
try {
|
|
17673
|
-
const envelope = await typedDispatch(
|
|
17748
|
+
const envelope = await typedDispatch(
|
|
17749
|
+
_checkTypedHandler,
|
|
17750
|
+
operation,
|
|
17751
|
+
params ?? {}
|
|
17752
|
+
);
|
|
17674
17753
|
return {
|
|
17675
17754
|
meta: dispatchMeta("mutate", "check", operation, startTime),
|
|
17676
17755
|
success: envelope.success,
|
|
17677
|
-
...envelope.success ? { data: envelope.data } : {
|
|
17756
|
+
...envelope.success ? { data: envelope.data } : {
|
|
17757
|
+
error: {
|
|
17758
|
+
code: envelope.error?.code !== void 0 ? String(envelope.error.code) : "E_INTERNAL",
|
|
17759
|
+
message: envelope.error?.message ?? "Unknown error"
|
|
17760
|
+
}
|
|
17761
|
+
}
|
|
17678
17762
|
};
|
|
17679
17763
|
} catch (error) {
|
|
17680
17764
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -17720,13 +17804,25 @@ function envelopeToEngineResult2(envelope) {
|
|
|
17720
17804
|
return {
|
|
17721
17805
|
success: false,
|
|
17722
17806
|
error: {
|
|
17723
|
-
code: envelope.error?.code
|
|
17807
|
+
code: envelope.error?.code !== void 0 ? String(envelope.error.code) : "E_INTERNAL",
|
|
17724
17808
|
message: envelope.error?.message ?? "Unknown error"
|
|
17725
17809
|
}
|
|
17726
17810
|
};
|
|
17727
17811
|
}
|
|
17812
|
+
async function _resolveCredential(agentId) {
|
|
17813
|
+
const { AgentRegistryAccessor, getDb: getDb3 } = await import("@cleocode/core/internal");
|
|
17814
|
+
await getDb3();
|
|
17815
|
+
const registry = new AgentRegistryAccessor(process.cwd());
|
|
17816
|
+
const credential = agentId ? await registry.get(agentId) : await registry.getActive();
|
|
17817
|
+
if (!credential) {
|
|
17818
|
+
throw new Error(
|
|
17819
|
+
"No agent credential found. Run: cleo agent register --id <id> --api-key <key>"
|
|
17820
|
+
);
|
|
17821
|
+
}
|
|
17822
|
+
return credential;
|
|
17823
|
+
}
|
|
17728
17824
|
async function getStatusImpl(agentId) {
|
|
17729
|
-
const credential = await
|
|
17825
|
+
const credential = await _resolveCredential(agentId);
|
|
17730
17826
|
const pollerRunning = activePoller !== null && activeAgentId === credential.agentId;
|
|
17731
17827
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
17732
17828
|
if (LocalTransport.isAvailable(process.cwd())) {
|
|
@@ -17785,7 +17881,7 @@ async function getStatusImpl(agentId) {
|
|
|
17785
17881
|
};
|
|
17786
17882
|
}
|
|
17787
17883
|
async function peekImpl(agentId, limit) {
|
|
17788
|
-
const credential = await
|
|
17884
|
+
const credential = await _resolveCredential(agentId);
|
|
17789
17885
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
17790
17886
|
if (LocalTransport.isAvailable(process.cwd())) {
|
|
17791
17887
|
const transport = new LocalTransport();
|
|
@@ -17854,7 +17950,7 @@ async function startPollingImpl(agentId, pollIntervalMs, groupConversationIds) {
|
|
|
17854
17950
|
}
|
|
17855
17951
|
};
|
|
17856
17952
|
}
|
|
17857
|
-
const credential = await
|
|
17953
|
+
const credential = await _resolveCredential(agentId);
|
|
17858
17954
|
const { AgentPoller } = await import("@cleocode/runtime");
|
|
17859
17955
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
17860
17956
|
let transport;
|
|
@@ -17916,7 +18012,7 @@ async function subscribeTopicImpl(topicName, agentId, _filter) {
|
|
|
17916
18012
|
error: { code: "E_ARGS", message: 'Must specify "topicName"' }
|
|
17917
18013
|
};
|
|
17918
18014
|
}
|
|
17919
|
-
const credential = await
|
|
18015
|
+
const credential = await _resolveCredential(agentId);
|
|
17920
18016
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
17921
18017
|
if (!LocalTransport.isAvailable(process.cwd())) {
|
|
17922
18018
|
return {
|
|
@@ -17957,7 +18053,7 @@ async function publishToTopicImpl(topicName, content, kind, payload, agentId) {
|
|
|
17957
18053
|
error: { code: "E_ARGS", message: 'Must specify "content"' }
|
|
17958
18054
|
};
|
|
17959
18055
|
}
|
|
17960
|
-
const credential = await
|
|
18056
|
+
const credential = await _resolveCredential(agentId);
|
|
17961
18057
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
17962
18058
|
if (!LocalTransport.isAvailable(process.cwd())) {
|
|
17963
18059
|
return {
|
|
@@ -17995,7 +18091,7 @@ async function listenTopicImpl(topicName, agentId, limit, since) {
|
|
|
17995
18091
|
};
|
|
17996
18092
|
}
|
|
17997
18093
|
const startMs = Date.now();
|
|
17998
|
-
const credential = await
|
|
18094
|
+
const credential = await _resolveCredential(agentId);
|
|
17999
18095
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
18000
18096
|
if (!LocalTransport.isAvailable(process.cwd())) {
|
|
18001
18097
|
return {
|
|
@@ -18040,7 +18136,7 @@ async function sendMessageImpl(content, to, conversationId, agentId) {
|
|
|
18040
18136
|
error: { code: "E_ARGS", message: 'Must specify "to" (agent ID) or "conversationId"' }
|
|
18041
18137
|
};
|
|
18042
18138
|
}
|
|
18043
|
-
const credential = await
|
|
18139
|
+
const credential = await _resolveCredential(agentId);
|
|
18044
18140
|
const { LocalTransport } = await import("@cleocode/core/conduit");
|
|
18045
18141
|
if (LocalTransport.isAvailable(process.cwd())) {
|
|
18046
18142
|
const transport = new LocalTransport();
|
|
@@ -19243,7 +19339,8 @@ import {
|
|
|
19243
19339
|
getBrainDb,
|
|
19244
19340
|
getBrainNativeDb,
|
|
19245
19341
|
resolveAnthropicApiKey,
|
|
19246
|
-
resolveAnthropicApiKeySource
|
|
19342
|
+
resolveAnthropicApiKeySource,
|
|
19343
|
+
typedAll
|
|
19247
19344
|
} from "@cleocode/core/internal";
|
|
19248
19345
|
import {
|
|
19249
19346
|
approveBackfillRun,
|
|
@@ -20226,29 +20323,29 @@ var init_memory2 = __esm({
|
|
|
20226
20323
|
}
|
|
20227
20324
|
let stdpWeights = [];
|
|
20228
20325
|
try {
|
|
20229
|
-
const
|
|
20326
|
+
const stmt = nativeDb.prepare(
|
|
20230
20327
|
`SELECT from_id, to_id, edge_type, weight,
|
|
20328
|
+
COALESCE(reinforcement_count, 0) AS reinforcement_count,
|
|
20329
|
+
last_reinforced_at
|
|
20330
|
+
FROM brain_page_edges
|
|
20331
|
+
WHERE (from_id = ? OR to_id = ?)
|
|
20332
|
+
AND plasticity_class IN ('hebbian', 'stdp')
|
|
20333
|
+
ORDER BY weight DESC
|
|
20334
|
+
LIMIT 20`
|
|
20335
|
+
);
|
|
20336
|
+
stdpWeights = typedAll(stmt, entryId, entryId);
|
|
20337
|
+
} catch {
|
|
20338
|
+
try {
|
|
20339
|
+
const stmt = nativeDb.prepare(
|
|
20340
|
+
`SELECT from_id, to_id, edge_type, weight,
|
|
20231
20341
|
COALESCE(reinforcement_count, 0) AS reinforcement_count,
|
|
20232
20342
|
last_reinforced_at
|
|
20233
20343
|
FROM brain_page_edges
|
|
20234
|
-
WHERE
|
|
20235
|
-
AND plasticity_class IN ('hebbian', 'stdp')
|
|
20344
|
+
WHERE from_id = ? OR to_id = ?
|
|
20236
20345
|
ORDER BY weight DESC
|
|
20237
20346
|
LIMIT 20`
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
} catch {
|
|
20241
|
-
try {
|
|
20242
|
-
const edgeRows = nativeDb.prepare(
|
|
20243
|
-
`SELECT from_id, to_id, edge_type, weight,
|
|
20244
|
-
COALESCE(reinforcement_count, 0) AS reinforcement_count,
|
|
20245
|
-
last_reinforced_at
|
|
20246
|
-
FROM brain_page_edges
|
|
20247
|
-
WHERE from_id = ? OR to_id = ?
|
|
20248
|
-
ORDER BY weight DESC
|
|
20249
|
-
LIMIT 20`
|
|
20250
|
-
).all(entryId, entryId);
|
|
20251
|
-
stdpWeights = edgeRows;
|
|
20347
|
+
);
|
|
20348
|
+
stdpWeights = typedAll(stmt, entryId, entryId);
|
|
20252
20349
|
} catch {
|
|
20253
20350
|
}
|
|
20254
20351
|
}
|
|
@@ -21634,7 +21731,15 @@ async function nexusProfileUpsert(trait) {
|
|
|
21634
21731
|
try {
|
|
21635
21732
|
const nexusDb = await getNexusDb();
|
|
21636
21733
|
const existing = await getUserProfileTrait(nexusDb, trait.traitKey);
|
|
21637
|
-
|
|
21734
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
21735
|
+
const fullTrait = {
|
|
21736
|
+
...trait,
|
|
21737
|
+
firstObservedAt: existing?.firstObservedAt ?? now,
|
|
21738
|
+
lastReinforcedAt: now,
|
|
21739
|
+
reinforcementCount: existing ? existing.reinforcementCount + 1 : 1,
|
|
21740
|
+
supersededBy: existing?.supersededBy ?? null
|
|
21741
|
+
};
|
|
21742
|
+
await upsertUserProfileTrait(nexusDb, fullTrait);
|
|
21638
21743
|
return engineSuccess({ created: existing === null });
|
|
21639
21744
|
} catch (error) {
|
|
21640
21745
|
return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
|
|
@@ -30430,7 +30535,7 @@ function envelopeToEngineResult3(envelope) {
|
|
|
30430
30535
|
return {
|
|
30431
30536
|
success: false,
|
|
30432
30537
|
error: {
|
|
30433
|
-
code: envelope.error?.code
|
|
30538
|
+
code: envelope.error?.code !== void 0 ? String(envelope.error.code) : "E_INTERNAL",
|
|
30434
30539
|
message: envelope.error?.message ?? "Unknown error"
|
|
30435
30540
|
}
|
|
30436
30541
|
};
|
|
@@ -55613,6 +55718,74 @@ var reasonCommand = defineCommand({
|
|
|
55613
55718
|
}
|
|
55614
55719
|
});
|
|
55615
55720
|
|
|
55721
|
+
// packages/cleo/src/cli/commands/reconcile.ts
|
|
55722
|
+
import { release } from "@cleocode/core";
|
|
55723
|
+
var releaseSubcommand = defineCommand({
|
|
55724
|
+
meta: {
|
|
55725
|
+
name: "release",
|
|
55726
|
+
description: "Run post-release invariants for a release tag"
|
|
55727
|
+
},
|
|
55728
|
+
args: {
|
|
55729
|
+
tag: {
|
|
55730
|
+
type: "string",
|
|
55731
|
+
description: "Release tag to reconcile (e.g. v2026.4.145)",
|
|
55732
|
+
required: true
|
|
55733
|
+
},
|
|
55734
|
+
"dry-run": {
|
|
55735
|
+
type: "boolean",
|
|
55736
|
+
description: "Preview mutations without writing to tasks.db or audit log",
|
|
55737
|
+
default: false
|
|
55738
|
+
},
|
|
55739
|
+
json: {
|
|
55740
|
+
type: "boolean",
|
|
55741
|
+
description: "Emit raw JSON instead of human-readable summary",
|
|
55742
|
+
default: false
|
|
55743
|
+
}
|
|
55744
|
+
},
|
|
55745
|
+
async run({ args }) {
|
|
55746
|
+
const dryRun = args["dry-run"] === true;
|
|
55747
|
+
const report = await release.runInvariants(args.tag, {
|
|
55748
|
+
dryRun,
|
|
55749
|
+
cwd: process.cwd()
|
|
55750
|
+
});
|
|
55751
|
+
if (args.json) {
|
|
55752
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}
|
|
55753
|
+
`);
|
|
55754
|
+
} else {
|
|
55755
|
+
const lines = [];
|
|
55756
|
+
lines.push(`reconcile release ${report.tag}${dryRun ? " (dry-run)" : ""}`);
|
|
55757
|
+
lines.push(
|
|
55758
|
+
` total: processed=${report.processed} reconciled=${report.reconciled} unreconciled=${report.unreconciled} errors=${report.errors}`
|
|
55759
|
+
);
|
|
55760
|
+
for (const r of report.results) {
|
|
55761
|
+
lines.push(` [${r.severity}] ${r.id}: ${r.message}`);
|
|
55762
|
+
}
|
|
55763
|
+
process.stdout.write(`${lines.join("\n")}
|
|
55764
|
+
`);
|
|
55765
|
+
}
|
|
55766
|
+
if (report.errors > 0) {
|
|
55767
|
+
process.exit(1);
|
|
55768
|
+
}
|
|
55769
|
+
if (report.unreconciled > 0) {
|
|
55770
|
+
process.exit(2);
|
|
55771
|
+
}
|
|
55772
|
+
}
|
|
55773
|
+
});
|
|
55774
|
+
var reconcileCommand2 = defineCommand({
|
|
55775
|
+
meta: {
|
|
55776
|
+
name: "reconcile",
|
|
55777
|
+
description: "Reconcile state against external sources (release tags, schema, etc.)"
|
|
55778
|
+
},
|
|
55779
|
+
subCommands: {
|
|
55780
|
+
release: releaseSubcommand
|
|
55781
|
+
},
|
|
55782
|
+
async run({ cmd, rawArgs }) {
|
|
55783
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
55784
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
55785
|
+
await showUsage(cmd);
|
|
55786
|
+
}
|
|
55787
|
+
});
|
|
55788
|
+
|
|
55616
55789
|
// packages/cleo/src/cli/commands/refresh-memory.ts
|
|
55617
55790
|
import { getProjectRoot as getProjectRoot27 } from "@cleocode/core";
|
|
55618
55791
|
var refreshMemoryCommand = defineCommand({
|
|
@@ -60041,7 +60214,7 @@ var linksCommand2 = defineCommand({
|
|
|
60041
60214
|
);
|
|
60042
60215
|
}
|
|
60043
60216
|
});
|
|
60044
|
-
var
|
|
60217
|
+
var reconcileCommand3 = defineCommand({
|
|
60045
60218
|
meta: {
|
|
60046
60219
|
name: "reconcile",
|
|
60047
60220
|
description: "Reconcile external tasks from a JSON file against CLEO tasks"
|
|
@@ -60094,7 +60267,7 @@ var syncCommand5 = defineCommand({
|
|
|
60094
60267
|
meta: { name: "sync", description: "External task synchronisation management" },
|
|
60095
60268
|
subCommands: {
|
|
60096
60269
|
links: linksCommand2,
|
|
60097
|
-
reconcile:
|
|
60270
|
+
reconcile: reconcileCommand3
|
|
60098
60271
|
},
|
|
60099
60272
|
async run({ cmd, rawArgs }) {
|
|
60100
60273
|
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
@@ -61708,6 +61881,7 @@ subCommands["playbook"] = playbookCommand;
|
|
|
61708
61881
|
subCommands["promote"] = promoteCommand;
|
|
61709
61882
|
subCommands["provider"] = providerCommand;
|
|
61710
61883
|
subCommands["reason"] = reasonCommand;
|
|
61884
|
+
subCommands["reconcile"] = reconcileCommand2;
|
|
61711
61885
|
subCommands["refresh-memory"] = refreshMemoryCommand;
|
|
61712
61886
|
subCommands["relates"] = relatesCommand;
|
|
61713
61887
|
subCommands["release"] = releaseCommand;
|