@cleocode/cleo 2026.9.25 → 2026.9.26
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 +300 -155
- package/package.json +13 -13
- package/studio-dist/client/_app/immutable/chunks/B2oT_qgu.js +3 -0
- package/studio-dist/client/_app/immutable/chunks/B7RPHy-R.js +1 -0
- package/studio-dist/client/_app/immutable/chunks/{CcEmirN4.js → BhOwHRY9.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/{Dj9Ite4c.js → CobI0XAU.js} +1 -1
- package/studio-dist/client/_app/immutable/entry/{app.tPQyYZoK.js → app.DaDdqQTe.js} +2 -2
- package/studio-dist/client/_app/immutable/entry/start.BjuNqpl1.js +1 -0
- package/studio-dist/client/_app/immutable/nodes/{0.BVYdqJjU.js → 0.CKHiZeuP.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{1.DJbQn5Aq.js → 1.CmaYPYrk.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{15.DFLciLwG.js → 15.D23qtyoz.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{16.BgshH5yX.js → 16.Dtt6exbd.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{17.BQZJRQ5A.js → 17.CPZ22rBo.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{18.B_YK1P9Z.js → 18.Qm_fekS5.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{20.Dls8MCe1.js → 20.DjGgB4KD.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{24.IXvinnru.js → 24.CgMoobl_.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{25.BEebPQVq.js → 25.DkFAoI4l.js} +2 -2
- package/studio-dist/client/_app/immutable/nodes/{26.B7CS0G5p.js → 26.C1oRqB1b.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{3.CdayxXUQ.js → 3.Cy4T6zbv.js} +1 -1
- package/studio-dist/client/_app/version.json +1 -1
- package/studio-dist/server/chunks/{0-AF3xrUkn.js → 0-G8NhADpo.js} +3 -3
- package/studio-dist/server/chunks/1-CfXNxnLm.js +9 -0
- package/studio-dist/server/chunks/{15-D0fpXhAY.js → 15-o63WM4MZ.js} +3 -3
- package/studio-dist/server/chunks/{16-DvOEuR2L.js → 16-7h8G4VoG.js} +3 -3
- package/studio-dist/server/chunks/{17-B0jymkfA.js → 17-DcShICKv.js} +3 -3
- package/studio-dist/server/chunks/{18-s4VnOMua.js → 18-BER3ZYEh.js} +3 -3
- package/studio-dist/server/chunks/{20-B1I-AIgl.js → 20-DErTM2qU.js} +3 -3
- package/studio-dist/server/chunks/{24-Cd9TIy6S.js → 24-BZh7ZC1u.js} +3 -3
- package/studio-dist/server/chunks/{25-CqxPBOK6.js → 25-qqsEYb5C.js} +4 -4
- package/studio-dist/server/chunks/{26-CSVz9wrd.js → 26-C424QBHc.js} +3 -3
- package/studio-dist/server/chunks/{3-CnvKWYCF.js → 3-DDisSHuV.js} +3 -3
- package/studio-dist/server/chunks/{_layout.svelte-DHaVs7sR.js → _layout.svelte-DcfphVWO.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-Birr_Gmr.js → _page.svelte-B4hg1b3p.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-B4hpnUVn.js → _page.svelte-BjX_VPfv.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-C2xIuyWy.js → _page.svelte-C8Ybsn2v.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-Do5ujrFm.js → _page.svelte-CPdHIklX.js} +5 -5
- package/studio-dist/server/chunks/{_page.svelte-CW--O2H7.js → _page.svelte-CWNRWa2L.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-3f1I0RBM.js → _page.svelte-DBbdqQsp.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-CHQ7E1xk.js → _page.svelte-DdaHffLO.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-DHso8H-7.js → _page.svelte-DuD1vdhl.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-BQ3d309E.js → _page.svelte-EPu-M4nY.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-BF8dYynr.js → _server.ts-BGuhOntH.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-DvaFTJ0E.js → _server.ts-BjIJy4O3.js} +2 -2
- package/studio-dist/server/chunks/{_server.ts-10Z9UtEP.js → _server.ts-C4WHkBZ_.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-BNaQ_u-J.js → _server.ts-CmiJfYD5.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-DrRXPeYo.js → _server.ts-wZKCwtFH.js} +3 -3
- package/studio-dist/server/chunks/{client-CPa0CHb-.js → client-ARinjJG0.js} +2 -2
- package/studio-dist/server/chunks/{dist-b2dqLZbk.js → dist-CLTFgJWk.js} +10 -1
- package/studio-dist/server/chunks/{error.svelte-B4-aI-CN.js → error.svelte-m5N9iUFN.js} +3 -3
- package/studio-dist/server/chunks/{http-C8NM9yzE.js → http-DKP1pqq1.js} +2 -2
- package/studio-dist/server/chunks/{internal-Ba4D4YGm.js → internal-BF6KxfEH.js} +2 -2
- package/studio-dist/server/chunks/{stores-DsgjOOHe.js → stores-UvZbmzhQ.js} +2 -2
- package/studio-dist/server/index.js +1 -1
- package/studio-dist/server/manifest.js +17 -17
- package/studio-dist/client/_app/immutable/chunks/BeqrF76J.js +0 -3
- package/studio-dist/client/_app/immutable/chunks/DRFhIGr1.js +0 -1
- package/studio-dist/client/_app/immutable/entry/start.TCOC0qnN.js +0 -1
- package/studio-dist/server/chunks/1-DcpAzosv.js +0 -9
package/dist/cli/index.js
CHANGED
|
@@ -395,6 +395,16 @@ function resolveFieldContext(opts) {
|
|
|
395
395
|
};
|
|
396
396
|
return resolveFieldExtraction(input2);
|
|
397
397
|
}
|
|
398
|
+
async function withoutOutputPointer(step) {
|
|
399
|
+
const saved = currentContext;
|
|
400
|
+
const { field: _field, ...rest } = saved;
|
|
401
|
+
currentContext = rest;
|
|
402
|
+
try {
|
|
403
|
+
return await step();
|
|
404
|
+
} finally {
|
|
405
|
+
currentContext = saved;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
398
408
|
var currentContext;
|
|
399
409
|
var init_field_context = __esm({
|
|
400
410
|
"packages/cleo/src/cli/field-context.ts"() {
|
|
@@ -1234,7 +1244,6 @@ var init_tree = __esm({
|
|
|
1234
1244
|
// packages/animations/src/render/index.ts
|
|
1235
1245
|
var init_render = __esm({
|
|
1236
1246
|
"packages/animations/src/render/index.ts"() {
|
|
1237
|
-
"use strict";
|
|
1238
1247
|
init_legend();
|
|
1239
1248
|
init_tree();
|
|
1240
1249
|
}
|
|
@@ -1352,6 +1361,7 @@ var init_spinner_handle = __esm({
|
|
|
1352
1361
|
var init_src = __esm({
|
|
1353
1362
|
"packages/animations/src/index.ts"() {
|
|
1354
1363
|
init_animate_context();
|
|
1364
|
+
init_render();
|
|
1355
1365
|
init_spinner_handle();
|
|
1356
1366
|
}
|
|
1357
1367
|
});
|
|
@@ -4968,7 +4978,7 @@ var init_output_contracts_data = __esm({
|
|
|
4968
4978
|
// T12503: the optimistic-concurrency version agents pass to --if-match.
|
|
4969
4979
|
updatedAt: {
|
|
4970
4980
|
type: ["string", "null"],
|
|
4971
|
-
description: "Task version for optimistic concurrency: pass it to `cleo update|complete --if-match`."
|
|
4981
|
+
description: "Task version for optimistic concurrency: pass it to `cleo update|complete --if-match`. A stale version fails with E_CONFLICT (23); E_TASK_RENAMED (26) when sync re-numbered the task you read (details.expected is its new id)."
|
|
4972
4982
|
},
|
|
4973
4983
|
// T12502: the human assignee and the agent claim lease are separate.
|
|
4974
4984
|
assignee: {
|
|
@@ -16454,6 +16464,7 @@ var init_exit_codes = __esm({
|
|
|
16454
16464
|
ExitCode2[ExitCode2["VERSION_CONFLICT"] = 23] = "VERSION_CONFLICT";
|
|
16455
16465
|
ExitCode2[ExitCode2["SESSION_UNBOUND"] = 24] = "SESSION_UNBOUND";
|
|
16456
16466
|
ExitCode2[ExitCode2["WORKTREE_LOCKED"] = 25] = "WORKTREE_LOCKED";
|
|
16467
|
+
ExitCode2[ExitCode2["TASK_RENAMED"] = 26] = "TASK_RENAMED";
|
|
16457
16468
|
ExitCode2[ExitCode2["SESSION_EXISTS"] = 30] = "SESSION_EXISTS";
|
|
16458
16469
|
ExitCode2[ExitCode2["SESSION_NOT_FOUND"] = 31] = "SESSION_NOT_FOUND";
|
|
16459
16470
|
ExitCode2[ExitCode2["SCOPE_CONFLICT"] = 32] = "SCOPE_CONFLICT";
|
|
@@ -22728,7 +22739,28 @@ var init_nexus_account = __esm({
|
|
|
22728
22739
|
"E_NEXUS_REVOKE_FAILED",
|
|
22729
22740
|
"E_NEXUS_REQUEST_FAILED",
|
|
22730
22741
|
"E_NEXUS_NOT_A_PROJECT",
|
|
22731
|
-
"E_NEXUS_INVALID_LABEL"
|
|
22742
|
+
"E_NEXUS_INVALID_LABEL",
|
|
22743
|
+
// Device credentials (cleo-nexus device contract §3.3, §4.0.4; T12868).
|
|
22744
|
+
/** No answer from the API (network error or timeout). */
|
|
22745
|
+
"E_NEXUS_UNREACHABLE",
|
|
22746
|
+
/** `cleo login nexus` while a revoke of this device is unconfirmed (§3.3, v2.9). */
|
|
22747
|
+
"E_NEXUS_REVOKE_PENDING",
|
|
22748
|
+
/** The device was signed out (E9, E11): 401 `device-signed-out`. */
|
|
22749
|
+
"E_NEXUS_DEVICE_SIGNED_OUT",
|
|
22750
|
+
/** The device was revoked (E10, E12): 401 `device-revoked`. */
|
|
22751
|
+
"E_NEXUS_DEVICE_REVOKED",
|
|
22752
|
+
/** A credential replaced or revoked elsewhere, or a `rotation-conflict` (R2). */
|
|
22753
|
+
"E_NEXUS_CREDENTIAL_COMPROMISED",
|
|
22754
|
+
/** The device credential lacks the scope (a read-only device): 403 `insufficient-scope`. */
|
|
22755
|
+
"E_NEXUS_INSUFFICIENT_SCOPE",
|
|
22756
|
+
/** A replica attach from a second device: 409 `replica-copied`. */
|
|
22757
|
+
"E_NEXUS_REPLICA_COPIED",
|
|
22758
|
+
/** Another cleo process holds the device file or an upgrade in flight; retry. */
|
|
22759
|
+
"E_NEXUS_BUSY",
|
|
22760
|
+
/** Several accounts hold a device credential on one origin and none was named. */
|
|
22761
|
+
"E_NEXUS_ACCOUNT_AMBIGUOUS",
|
|
22762
|
+
/** An option that needs device credentials (`--read-only`) without `CLEO_NEXUS_DEVICE=1`. */
|
|
22763
|
+
"E_NEXUS_DEVICE_REQUIRED"
|
|
22732
22764
|
];
|
|
22733
22765
|
nexusAccountUserSchema = z25.object({
|
|
22734
22766
|
id: z25.string(),
|
|
@@ -37997,8 +38029,8 @@ async function loadPlaybookByName(name) {
|
|
|
37997
38029
|
return null;
|
|
37998
38030
|
}
|
|
37999
38031
|
try {
|
|
38000
|
-
const { getProjectRoot:
|
|
38001
|
-
const projectRoot = __playbookRuntimeOverrides.projectRoot ??
|
|
38032
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core/internal");
|
|
38033
|
+
const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot75();
|
|
38002
38034
|
const resolved = resolvePlaybook(name, {
|
|
38003
38035
|
projectRoot,
|
|
38004
38036
|
globalPlaybooksDir: __playbookRuntimeOverrides.globalPlaybooksDir,
|
|
@@ -38043,7 +38075,7 @@ async function buildDefaultDispatcher() {
|
|
|
38043
38075
|
if (__playbookRuntimeOverrides.dispatcher) return __playbookRuntimeOverrides.dispatcher;
|
|
38044
38076
|
const { orchestrateSpawnExecute: orchestrateSpawnExecute2 } = await import("@cleocode/runtime/gateway");
|
|
38045
38077
|
const {
|
|
38046
|
-
getProjectRoot:
|
|
38078
|
+
getProjectRoot: getProjectRoot75,
|
|
38047
38079
|
createToolGuard,
|
|
38048
38080
|
runSkillNodeOrSpawn,
|
|
38049
38081
|
maybeCreatePiRunner,
|
|
@@ -38051,7 +38083,7 @@ async function buildDefaultDispatcher() {
|
|
|
38051
38083
|
hasCantbookProfilePin,
|
|
38052
38084
|
DEFAULT_DETERMINISTIC_DENIED_COMMANDS
|
|
38053
38085
|
} = await import("@cleocode/core/internal");
|
|
38054
|
-
const projectRoot =
|
|
38086
|
+
const projectRoot = getProjectRoot75();
|
|
38055
38087
|
const tools = createToolGuard({
|
|
38056
38088
|
allowedRoots: [projectRoot],
|
|
38057
38089
|
deniedCommands: DEFAULT_DETERMINISTIC_DENIED_COMMANDS,
|
|
@@ -38144,12 +38176,12 @@ async function buildDefaultDeterministicRunner() {
|
|
|
38144
38176
|
return void 0;
|
|
38145
38177
|
}
|
|
38146
38178
|
const {
|
|
38147
|
-
getProjectRoot:
|
|
38179
|
+
getProjectRoot: getProjectRoot75,
|
|
38148
38180
|
createToolGuard,
|
|
38149
38181
|
createGuardedDeterministicRunner,
|
|
38150
38182
|
DEFAULT_DETERMINISTIC_DENIED_COMMANDS
|
|
38151
38183
|
} = await import("@cleocode/core/internal");
|
|
38152
|
-
const projectRoot =
|
|
38184
|
+
const projectRoot = getProjectRoot75();
|
|
38153
38185
|
const tools = createToolGuard({
|
|
38154
38186
|
allowedRoots: [projectRoot],
|
|
38155
38187
|
deniedCommands: DEFAULT_DETERMINISTIC_DENIED_COMMANDS,
|
|
@@ -38307,8 +38339,8 @@ var init_playbook2 = __esm({
|
|
|
38307
38339
|
projectRoot = __playbookRuntimeOverrides.projectRoot;
|
|
38308
38340
|
} else {
|
|
38309
38341
|
try {
|
|
38310
|
-
const { getProjectRoot:
|
|
38311
|
-
projectRoot =
|
|
38342
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core/internal");
|
|
38343
|
+
projectRoot = getProjectRoot75();
|
|
38312
38344
|
} catch {
|
|
38313
38345
|
projectRoot = void 0;
|
|
38314
38346
|
}
|
|
@@ -38373,14 +38405,14 @@ var init_playbook2 = __esm({
|
|
|
38373
38405
|
const deterministicRunner = await buildDefaultDeterministicRunner();
|
|
38374
38406
|
let result;
|
|
38375
38407
|
try {
|
|
38376
|
-
const { getProjectRoot:
|
|
38408
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core/internal");
|
|
38377
38409
|
const opts = {
|
|
38378
38410
|
db,
|
|
38379
38411
|
playbook: parsed.definition,
|
|
38380
38412
|
playbookHash: parsed.sourceHash,
|
|
38381
38413
|
initialContext,
|
|
38382
38414
|
dispatcher,
|
|
38383
|
-
projectRoot:
|
|
38415
|
+
projectRoot: getProjectRoot75()
|
|
38384
38416
|
};
|
|
38385
38417
|
if (deterministicRunner !== void 0) opts.deterministicRunner = deterministicRunner;
|
|
38386
38418
|
if (__playbookRuntimeOverrides.approvalSecret !== void 0) {
|
|
@@ -38739,6 +38771,7 @@ async function orchestratePivotOp(params) {
|
|
|
38739
38771
|
else if (code === 38) errorCode = "E_NOT_ACTIVE";
|
|
38740
38772
|
else if (code === 35) errorCode = "E_TASK_CLAIMED";
|
|
38741
38773
|
else if (code === 24) errorCode = "E_SESSION_UNBOUND";
|
|
38774
|
+
else if (code === 26) errorCode = "E_TASK_RENAMED";
|
|
38742
38775
|
const cleo = err instanceof CleoError ? err : void 0;
|
|
38743
38776
|
return {
|
|
38744
38777
|
success: false,
|
|
@@ -45718,11 +45751,11 @@ var init_security = __esm({
|
|
|
45718
45751
|
});
|
|
45719
45752
|
|
|
45720
45753
|
// packages/cleo/src/dispatch/middleware/sanitizer.ts
|
|
45721
|
-
function createSanitizer(
|
|
45754
|
+
function createSanitizer(getProjectRoot75) {
|
|
45722
45755
|
return async (req, next) => {
|
|
45723
45756
|
if (req.params) {
|
|
45724
45757
|
try {
|
|
45725
|
-
const root =
|
|
45758
|
+
const root = getProjectRoot75 ? getProjectRoot75() : void 0;
|
|
45726
45759
|
req.params = sanitizeParams(req.params, root, {
|
|
45727
45760
|
domain: req.domain,
|
|
45728
45761
|
operation: req.operation
|
|
@@ -45824,14 +45857,14 @@ var init_session_resolver = __esm({
|
|
|
45824
45857
|
});
|
|
45825
45858
|
|
|
45826
45859
|
// packages/cleo/src/dispatch/middleware/store-write-guard.ts
|
|
45827
|
-
function createStoreWriteGuard(
|
|
45860
|
+
function createStoreWriteGuard(getProjectRoot75) {
|
|
45828
45861
|
return async (req, next) => {
|
|
45829
45862
|
if (req.gateway !== "mutate" || ALLOWED_WHILE_READ_ONLY.has(`${req.domain}.${req.operation}`)) {
|
|
45830
45863
|
return next();
|
|
45831
45864
|
}
|
|
45832
45865
|
let projectRoot;
|
|
45833
45866
|
try {
|
|
45834
|
-
projectRoot =
|
|
45867
|
+
projectRoot = getProjectRoot75();
|
|
45835
45868
|
} catch {
|
|
45836
45869
|
return next();
|
|
45837
45870
|
}
|
|
@@ -46258,6 +46291,7 @@ var init_cli = __esm({
|
|
|
46258
46291
|
E_CONFLICT: 23,
|
|
46259
46292
|
E_SESSION_UNBOUND: 24,
|
|
46260
46293
|
E_WORKTREE_LOCKED: 25,
|
|
46294
|
+
E_TASK_RENAMED: 26,
|
|
46261
46295
|
E_TWIN_COLLAPSE_FAILED: 55,
|
|
46262
46296
|
E_SESSION_EXISTS: 30,
|
|
46263
46297
|
E_SESSION_NOT_FOUND: 31,
|
|
@@ -50613,7 +50647,7 @@ function nexusApiUrlArg(args) {
|
|
|
50613
50647
|
function failNexus(err, operation) {
|
|
50614
50648
|
const code = err instanceof Error && "code" in err && typeof err.code === "string" ? err.code : void 0;
|
|
50615
50649
|
const fix = err instanceof Error && "fix" in err && typeof err.fix === "string" ? err.fix : void 0;
|
|
50616
|
-
const exitCode = code === "E_NEXUS_INVALID_API_URL" || code === "E_NEXUS_INVALID_LABEL" ? 6 : 1;
|
|
50650
|
+
const exitCode = code === "E_NEXUS_INVALID_API_URL" || code === "E_NEXUS_INVALID_LABEL" || code === "E_NEXUS_DEVICE_REQUIRED" ? 6 : 1;
|
|
50617
50651
|
cliError(
|
|
50618
50652
|
err instanceof Error ? err.message : String(err),
|
|
50619
50653
|
exitCode,
|
|
@@ -50631,16 +50665,52 @@ async function runNexusLogin(args, openBrowser2) {
|
|
|
50631
50665
|
/* webpackIgnore: true */
|
|
50632
50666
|
"@cleocode/core/cloud/nexus-auth.js"
|
|
50633
50667
|
);
|
|
50668
|
+
const { isNexusDeviceEnabled } = await import(
|
|
50669
|
+
/* webpackIgnore: true */
|
|
50670
|
+
"@cleocode/core/cloud/nexus-device.js"
|
|
50671
|
+
);
|
|
50634
50672
|
const noBrowser = negatedFlag(args, "browser");
|
|
50673
|
+
const hooks2 = {
|
|
50674
|
+
apiUrl: nexusApiUrlArg(args),
|
|
50675
|
+
onCode: (code) => {
|
|
50676
|
+
writeDeviceCodePrompt(code, SERVICE_NAME);
|
|
50677
|
+
if (!noBrowser) openBrowser2(code.verificationUriComplete ?? code.verificationUri);
|
|
50678
|
+
},
|
|
50679
|
+
onPending: writeDeviceCodePending
|
|
50680
|
+
};
|
|
50681
|
+
const readOnly = args["read-only"] === true;
|
|
50682
|
+
const name = typeof args["name"] === "string" && args["name"] !== "" ? args["name"] : void 0;
|
|
50683
|
+
if (readOnly && !isNexusDeviceEnabled()) {
|
|
50684
|
+
throw Object.assign(
|
|
50685
|
+
new Error(
|
|
50686
|
+
"--read-only needs device credentials, which are not enabled; nothing was signed in"
|
|
50687
|
+
),
|
|
50688
|
+
{
|
|
50689
|
+
code: "E_NEXUS_DEVICE_REQUIRED",
|
|
50690
|
+
fix: "set CLEO_NEXUS_DEVICE=1 to enrol a read-only device, or log in without --read-only"
|
|
50691
|
+
}
|
|
50692
|
+
);
|
|
50693
|
+
}
|
|
50635
50694
|
try {
|
|
50636
|
-
|
|
50637
|
-
|
|
50638
|
-
|
|
50639
|
-
|
|
50640
|
-
|
|
50641
|
-
|
|
50642
|
-
|
|
50643
|
-
|
|
50695
|
+
let result;
|
|
50696
|
+
if (isNexusDeviceEnabled()) {
|
|
50697
|
+
const { loginToNexusDevice } = await import(
|
|
50698
|
+
/* webpackIgnore: true */
|
|
50699
|
+
"@cleocode/core/cloud/nexus-enrol.js"
|
|
50700
|
+
);
|
|
50701
|
+
result = await loginToNexusDevice({
|
|
50702
|
+
...hooks2,
|
|
50703
|
+
readOnly,
|
|
50704
|
+
...name !== void 0 ? { name } : {}
|
|
50705
|
+
});
|
|
50706
|
+
} else {
|
|
50707
|
+
if (name !== void 0) {
|
|
50708
|
+
process.stderr.write(
|
|
50709
|
+
"warning: --name needs device credentials (CLEO_NEXUS_DEVICE=1); ignored\n"
|
|
50710
|
+
);
|
|
50711
|
+
}
|
|
50712
|
+
result = await loginToNexus(hooks2);
|
|
50713
|
+
}
|
|
50644
50714
|
writeDeviceCodeApproved(SERVICE_NAME);
|
|
50645
50715
|
for (const warning of result.warnings) process.stderr.write(`warning: ${warning}
|
|
50646
50716
|
`);
|
|
@@ -50653,7 +50723,8 @@ async function runNexusLogin(args, openBrowser2) {
|
|
|
50653
50723
|
function nexusLoginSummary(r) {
|
|
50654
50724
|
const who = r.user?.email ?? "your account";
|
|
50655
50725
|
const org = r.organization ? ` (${r.organization.name})` : "";
|
|
50656
|
-
|
|
50726
|
+
const device = r.device ? ` This machine is device ${r.device.deviceId}${r.device.name ? ` (${r.device.name})` : ""}, profile ${r.device.profile ?? "unknown"}.` : "";
|
|
50727
|
+
return `Signed in to ${r.apiUrl} as ${who}${org}.${device}`;
|
|
50657
50728
|
}
|
|
50658
50729
|
var SERVICE_NAME, NEXUS_API_URL_ARG;
|
|
50659
50730
|
var init_nexus_account_cli = __esm({
|
|
@@ -51542,6 +51613,14 @@ var init_login = __esm({
|
|
|
51542
51613
|
description: "Open the verification URL in a browser (nexus). --no-browser only prints it (SSH, containers).",
|
|
51543
51614
|
default: true
|
|
51544
51615
|
},
|
|
51616
|
+
"read-only": {
|
|
51617
|
+
type: "boolean",
|
|
51618
|
+
description: "nexus with CLEO_NEXUS_DEVICE=1: enrol this machine with the read-only device profile (account, devices and project reads only). Refused without CLEO_NEXUS_DEVICE=1."
|
|
51619
|
+
},
|
|
51620
|
+
name: {
|
|
51621
|
+
type: "string",
|
|
51622
|
+
description: "nexus with CLEO_NEXUS_DEVICE=1: device name shown on cleocode.dev (default: OS, arch and a short id; never the hostname)."
|
|
51623
|
+
},
|
|
51545
51624
|
auth: {
|
|
51546
51625
|
type: "string",
|
|
51547
51626
|
description: "Auth method: 'oauth' (browser) or 'api_key'. Inferred from the provider when omitted."
|
|
@@ -52846,14 +52925,14 @@ var init_backup = __esm({
|
|
|
52846
52925
|
return;
|
|
52847
52926
|
}
|
|
52848
52927
|
const { exportPortableBundle, PortableBundleError } = await import("@cleocode/core/store/portable-bundle.js");
|
|
52849
|
-
const { getProjectRoot:
|
|
52928
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core");
|
|
52850
52929
|
const passphrase = args.encrypt === true ? await resolvePassphrase() : void 0;
|
|
52851
52930
|
if (args.encrypt === true && passphrase === void 0) return;
|
|
52852
52931
|
const encSuffix = args.encrypt === true ? "enc." : "";
|
|
52853
52932
|
try {
|
|
52854
52933
|
const result = await exportPortableBundle({
|
|
52855
52934
|
scope,
|
|
52856
|
-
projectRoot: scope === "project" || scope === "all" ?
|
|
52935
|
+
projectRoot: scope === "project" || scope === "all" ? getProjectRoot75() : void 0,
|
|
52857
52936
|
outputPath: args.out ?? `./${args.name}.${encSuffix}cleobundle.tar.gz`,
|
|
52858
52937
|
encrypt: args.encrypt === true,
|
|
52859
52938
|
passphrase,
|
|
@@ -52910,12 +52989,12 @@ var init_backup = __esm({
|
|
|
52910
52989
|
);
|
|
52911
52990
|
return;
|
|
52912
52991
|
}
|
|
52913
|
-
const { getProjectRoot:
|
|
52992
|
+
const { getProjectRoot: getProjectRoot75, getCleoHome: getCleoHome8, getCleoVersion } = await import("@cleocode/core");
|
|
52914
52993
|
const { BundleError, cleanupStaging, unpackBundle } = await import("@cleocode/core/store/backup-unpack.js");
|
|
52915
52994
|
const { regenerateConfigJson, regenerateProjectContextJson, regenerateProjectInfoJson } = await import("@cleocode/core/store/regenerators.js");
|
|
52916
52995
|
const { regenerateAndCompare } = await import("@cleocode/core/store/restore-json-merge.js");
|
|
52917
52996
|
const { buildConflictReport, writeConflictReport } = await import("@cleocode/core/store/restore-conflict-report.js");
|
|
52918
|
-
const projectRoot =
|
|
52997
|
+
const projectRoot = getProjectRoot75();
|
|
52919
52998
|
const { assertOwnerStoreRewriteConfirmed } = await import("@cleocode/core/store/worktree-isolation-guard.js");
|
|
52920
52999
|
try {
|
|
52921
53000
|
assertOwnerStoreRewriteConfirmed("backup import", path2.join(projectRoot, ".cleo"), {
|
|
@@ -63477,6 +63556,40 @@ var init_doctor_db_substrate = __esm({
|
|
|
63477
63556
|
}
|
|
63478
63557
|
});
|
|
63479
63558
|
|
|
63559
|
+
// packages/cleo/src/cli/commands/doctor-dep-cycles.ts
|
|
63560
|
+
var doctor_dep_cycles_exports = {};
|
|
63561
|
+
__export(doctor_dep_cycles_exports, {
|
|
63562
|
+
doctorDepCyclesCommand: () => doctorDepCyclesCommand
|
|
63563
|
+
});
|
|
63564
|
+
import { scanDependencyCycles } from "@cleocode/core/doctor/dependency-cycles.js";
|
|
63565
|
+
import { getProjectRoot as getProjectRoot45 } from "@cleocode/core/paths.js";
|
|
63566
|
+
var doctorDepCyclesCommand;
|
|
63567
|
+
var init_doctor_dep_cycles = __esm({
|
|
63568
|
+
"packages/cleo/src/cli/commands/doctor-dep-cycles.ts"() {
|
|
63569
|
+
"use strict";
|
|
63570
|
+
init_define_cli_command();
|
|
63571
|
+
init_renderers();
|
|
63572
|
+
doctorDepCyclesCommand = defineCommand({
|
|
63573
|
+
meta: {
|
|
63574
|
+
name: "dep-cycles",
|
|
63575
|
+
description: "Report task dependency cycles already stored (edges written before the T12886 cycle guard) with a repair plan: the edges whose removal breaks every cycle, each with its `cleo update <id> --remove-depends <dep>` command. Read-only; never removes an edge."
|
|
63576
|
+
},
|
|
63577
|
+
args: {
|
|
63578
|
+
json: { type: "boolean", description: "Output as JSON" },
|
|
63579
|
+
human: { type: "boolean", description: "Force human-readable output" },
|
|
63580
|
+
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
63581
|
+
},
|
|
63582
|
+
async run() {
|
|
63583
|
+
const report = await scanDependencyCycles(getProjectRoot45());
|
|
63584
|
+
cliOutput(report, { command: "doctor", operation: "doctor.dep-cycles.run" });
|
|
63585
|
+
if (report.cycleCount > 0 && (process.exitCode === void 0 || process.exitCode === 0)) {
|
|
63586
|
+
process.exitCode = 2;
|
|
63587
|
+
}
|
|
63588
|
+
}
|
|
63589
|
+
});
|
|
63590
|
+
}
|
|
63591
|
+
});
|
|
63592
|
+
|
|
63480
63593
|
// packages/cleo/src/cli/commands/doctor-exodus-residue.ts
|
|
63481
63594
|
var doctor_exodus_residue_exports = {};
|
|
63482
63595
|
__export(doctor_exodus_residue_exports, {
|
|
@@ -63794,7 +63907,7 @@ var doctor_legacy_backups_exports = {};
|
|
|
63794
63907
|
__export(doctor_legacy_backups_exports, {
|
|
63795
63908
|
doctorLegacyBackupsCommand: () => doctorLegacyBackupsCommand
|
|
63796
63909
|
});
|
|
63797
|
-
import { getProjectRoot as
|
|
63910
|
+
import { getProjectRoot as getProjectRoot46 } from "@cleocode/core";
|
|
63798
63911
|
import { pruneLegacyBackups, scanLegacyBackups } from "@cleocode/core/doctor/legacy-backups.js";
|
|
63799
63912
|
function parsePositiveInt(raw, fallback) {
|
|
63800
63913
|
if (raw === void 0 || raw === null) return fallback;
|
|
@@ -63838,7 +63951,7 @@ var init_doctor_legacy_backups = __esm({
|
|
|
63838
63951
|
async run({ args }) {
|
|
63839
63952
|
const softRetentionDays = parsePositiveInt(args["soft-retention-days"], 30);
|
|
63840
63953
|
const hardRetentionDays = parsePositiveInt(args["hard-retention-days"], 90);
|
|
63841
|
-
const projectRoot =
|
|
63954
|
+
const projectRoot = getProjectRoot46();
|
|
63842
63955
|
let result;
|
|
63843
63956
|
if (args.prune === true) {
|
|
63844
63957
|
const dryRun = args["dry-run"] !== false;
|
|
@@ -63904,7 +64017,7 @@ var doctor_malformed_ids_exports = {};
|
|
|
63904
64017
|
__export(doctor_malformed_ids_exports, {
|
|
63905
64018
|
doctorMalformedIdsCommand: () => doctorMalformedIdsCommand
|
|
63906
64019
|
});
|
|
63907
|
-
import { getProjectRoot as
|
|
64020
|
+
import { getProjectRoot as getProjectRoot47 } from "@cleocode/core";
|
|
63908
64021
|
import { scanMalformedTaskIds } from "@cleocode/core/doctor/malformed-task-ids.js";
|
|
63909
64022
|
var doctorMalformedIdsCommand;
|
|
63910
64023
|
var init_doctor_malformed_ids = __esm({
|
|
@@ -63927,7 +64040,7 @@ var init_doctor_malformed_ids = __esm({
|
|
|
63927
64040
|
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
63928
64041
|
},
|
|
63929
64042
|
async run({ args }) {
|
|
63930
|
-
const report = await scanMalformedTaskIds(
|
|
64043
|
+
const report = await scanMalformedTaskIds(getProjectRoot47(), { fix: args.fix === true });
|
|
63931
64044
|
cliOutput(report, {
|
|
63932
64045
|
command: "doctor",
|
|
63933
64046
|
operation: "doctor.malformed-ids.run"
|
|
@@ -63954,7 +64067,7 @@ import {
|
|
|
63954
64067
|
repairMalformedManifestRows,
|
|
63955
64068
|
rollbackManifestRepair
|
|
63956
64069
|
} from "@cleocode/core/memory/pipeline-manifest-sqlite.js";
|
|
63957
|
-
import { getProjectRoot as
|
|
64070
|
+
import { getProjectRoot as getProjectRoot48 } from "@cleocode/core/paths.js";
|
|
63958
64071
|
var doctorManifestRowsCommand;
|
|
63959
64072
|
var init_doctor_manifest_rows = __esm({
|
|
63960
64073
|
"packages/cleo/src/cli/commands/doctor-manifest-rows.ts"() {
|
|
@@ -63985,7 +64098,7 @@ var init_doctor_manifest_rows = __esm({
|
|
|
63985
64098
|
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
63986
64099
|
},
|
|
63987
64100
|
async run({ args }) {
|
|
63988
|
-
const projectRoot =
|
|
64101
|
+
const projectRoot = getProjectRoot48();
|
|
63989
64102
|
if (typeof args.rollback === "string" && args.rollback !== "") {
|
|
63990
64103
|
const result = await rollbackManifestRepair(args.rollback, projectRoot);
|
|
63991
64104
|
cliOutput(result, { command: "doctor", operation: "doctor.manifest-rows.rollback" });
|
|
@@ -64087,7 +64200,7 @@ var doctor_nexus_residency_exports = {};
|
|
|
64087
64200
|
__export(doctor_nexus_residency_exports, {
|
|
64088
64201
|
doctorNexusResidencyCommand: () => doctorNexusResidencyCommand
|
|
64089
64202
|
});
|
|
64090
|
-
import { getCleoHome as getCleoHome6, getProjectRoot as
|
|
64203
|
+
import { getCleoHome as getCleoHome6, getProjectRoot as getProjectRoot49 } from "@cleocode/core";
|
|
64091
64204
|
import { scanNexusSchemaResidency } from "@cleocode/core/doctor/nexus-schema-residency.js";
|
|
64092
64205
|
var doctorNexusResidencyCommand;
|
|
64093
64206
|
var init_doctor_nexus_residency = __esm({
|
|
@@ -64106,7 +64219,7 @@ var init_doctor_nexus_residency = __esm({
|
|
|
64106
64219
|
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
64107
64220
|
},
|
|
64108
64221
|
async run() {
|
|
64109
|
-
const result = scanNexusSchemaResidency(
|
|
64222
|
+
const result = scanNexusSchemaResidency(getProjectRoot49(), getCleoHome6());
|
|
64110
64223
|
cliOutput(result, {
|
|
64111
64224
|
command: "doctor",
|
|
64112
64225
|
operation: "doctor.nexus-residency.run"
|
|
@@ -64124,7 +64237,7 @@ var doctor_project_identity_exports = {};
|
|
|
64124
64237
|
__export(doctor_project_identity_exports, {
|
|
64125
64238
|
doctorProjectIdentityCommand: () => doctorProjectIdentityCommand
|
|
64126
64239
|
});
|
|
64127
|
-
import { getProjectRoot as
|
|
64240
|
+
import { getProjectRoot as getProjectRoot50 } from "@cleocode/core";
|
|
64128
64241
|
import {
|
|
64129
64242
|
inspectProjectIdentity,
|
|
64130
64243
|
inspectProjectNameDrift,
|
|
@@ -64149,7 +64262,7 @@ var init_doctor_project_identity = __esm({
|
|
|
64149
64262
|
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
64150
64263
|
},
|
|
64151
64264
|
async run({ args }) {
|
|
64152
|
-
const projectRoot =
|
|
64265
|
+
const projectRoot = getProjectRoot50();
|
|
64153
64266
|
if (!args.resolve) {
|
|
64154
64267
|
const report = inspectProjectIdentity(projectRoot);
|
|
64155
64268
|
const nameDrift = await inspectProjectNameDrift(projectRoot);
|
|
@@ -64688,7 +64801,7 @@ var doctor_repair_exports = {};
|
|
|
64688
64801
|
__export(doctor_repair_exports, {
|
|
64689
64802
|
doctorRepairCommand: () => doctorRepairCommand
|
|
64690
64803
|
});
|
|
64691
|
-
import { getLogger as getLogger21, getProjectRoot as
|
|
64804
|
+
import { getLogger as getLogger21, getProjectRoot as getProjectRoot51 } from "@cleocode/core";
|
|
64692
64805
|
import { repairMalformedDbs } from "@cleocode/core/store/repair-malformed-dbs.js";
|
|
64693
64806
|
var doctorRepairCommand;
|
|
64694
64807
|
var init_doctor_repair = __esm({
|
|
@@ -64737,7 +64850,7 @@ var init_doctor_repair = __esm({
|
|
|
64737
64850
|
return;
|
|
64738
64851
|
}
|
|
64739
64852
|
const result = repairMalformedDbs({
|
|
64740
|
-
projectRoot:
|
|
64853
|
+
projectRoot: getProjectRoot51(),
|
|
64741
64854
|
roles: roleArg.length > 0 ? [roleArg] : void 0,
|
|
64742
64855
|
dryRun,
|
|
64743
64856
|
logger: getLogger21("doctor-repair"),
|
|
@@ -64939,7 +65052,7 @@ var doctor_superseded_store_exports = {};
|
|
|
64939
65052
|
__export(doctor_superseded_store_exports, {
|
|
64940
65053
|
doctorSupersededStoreCommand: () => doctorSupersededStoreCommand
|
|
64941
65054
|
});
|
|
64942
|
-
import { getProjectRoot as
|
|
65055
|
+
import { getProjectRoot as getProjectRoot52 } from "@cleocode/core";
|
|
64943
65056
|
import { scanSupersededStores } from "@cleocode/core/doctor/superseded-store.js";
|
|
64944
65057
|
import { reconcileSupersededStores } from "@cleocode/core/store/exodus/index.js";
|
|
64945
65058
|
var doctorSupersededStoreCommand;
|
|
@@ -64972,7 +65085,7 @@ var init_doctor_superseded_store = __esm({
|
|
|
64972
65085
|
},
|
|
64973
65086
|
async run({ args }) {
|
|
64974
65087
|
if (args.reconcile === true) {
|
|
64975
|
-
const receipt = await reconcileSupersededStores(
|
|
65088
|
+
const receipt = await reconcileSupersededStores(getProjectRoot52(), {
|
|
64976
65089
|
dryRun: args["dry-run"] === true,
|
|
64977
65090
|
additive: args.additive === true
|
|
64978
65091
|
});
|
|
@@ -64994,7 +65107,7 @@ var init_doctor_superseded_store = __esm({
|
|
|
64994
65107
|
);
|
|
64995
65108
|
return;
|
|
64996
65109
|
}
|
|
64997
|
-
const result = scanSupersededStores(
|
|
65110
|
+
const result = scanSupersededStores(getProjectRoot52());
|
|
64998
65111
|
cliOutput(result, {
|
|
64999
65112
|
command: "doctor",
|
|
65000
65113
|
operation: "doctor.superseded-store.run"
|
|
@@ -65095,7 +65208,7 @@ import {
|
|
|
65095
65208
|
rollbackTwinCollapse
|
|
65096
65209
|
} from "@cleocode/core/doctor/twin-collapse.js";
|
|
65097
65210
|
import { CleoError as CleoError8 } from "@cleocode/core/errors";
|
|
65098
|
-
import { getProjectRoot as
|
|
65211
|
+
import { getProjectRoot as getProjectRoot53 } from "@cleocode/core/paths.js";
|
|
65099
65212
|
function reportTwinCollapseError(error, retry) {
|
|
65100
65213
|
if (retry && !(error instanceof CleoError8)) throw error;
|
|
65101
65214
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -65166,7 +65279,7 @@ var init_doctor_twin_collapse = __esm({
|
|
|
65166
65279
|
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
65167
65280
|
},
|
|
65168
65281
|
async run({ args }) {
|
|
65169
|
-
const projectRoot =
|
|
65282
|
+
const projectRoot = getProjectRoot53();
|
|
65170
65283
|
const guard = { cwd: process.cwd(), confirmOwnerStore: args["confirm-owner-store"] === true };
|
|
65171
65284
|
const actions = twinCollapseActions(args);
|
|
65172
65285
|
if (actions.length > 1) {
|
|
@@ -65244,7 +65357,7 @@ __export(doctor_worktree_stores_exports, {
|
|
|
65244
65357
|
doctorWorktreeStoresCommand: () => doctorWorktreeStoresCommand
|
|
65245
65358
|
});
|
|
65246
65359
|
import { scanWorktreeStores } from "@cleocode/core/doctor/worktree-stores.js";
|
|
65247
|
-
import { getProjectRoot as
|
|
65360
|
+
import { getProjectRoot as getProjectRoot54, resolveStoreOwnerRoot } from "@cleocode/core/paths.js";
|
|
65248
65361
|
var doctorWorktreeStoresCommand;
|
|
65249
65362
|
var init_doctor_worktree_stores = __esm({
|
|
65250
65363
|
"packages/cleo/src/cli/commands/doctor-worktree-stores.ts"() {
|
|
@@ -65266,7 +65379,7 @@ var init_doctor_worktree_stores = __esm({
|
|
|
65266
65379
|
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
65267
65380
|
},
|
|
65268
65381
|
async run({ args }) {
|
|
65269
|
-
const projectRoot = resolveStoreOwnerRoot(
|
|
65382
|
+
const projectRoot = resolveStoreOwnerRoot(getProjectRoot54());
|
|
65270
65383
|
const result = scanWorktreeStores(projectRoot, { skipCompare: args["skip-compare"] === true });
|
|
65271
65384
|
cliOutput(result, {
|
|
65272
65385
|
command: "doctor",
|
|
@@ -65418,7 +65531,7 @@ import {
|
|
|
65418
65531
|
resumePreparedKnowledgeRepair,
|
|
65419
65532
|
runKnowledgeDoctor as runKnowledgeDoctor2
|
|
65420
65533
|
} from "@cleocode/core/doctor/knowledge.js";
|
|
65421
|
-
import { getProjectRoot as
|
|
65534
|
+
import { getProjectRoot as getProjectRoot55 } from "@cleocode/core/paths.js";
|
|
65422
65535
|
var doctorKnowledgeSubcommand;
|
|
65423
65536
|
var init_doctor_knowledge = __esm({
|
|
65424
65537
|
"packages/cleo/src/cli/commands/doctor-knowledge.ts"() {
|
|
@@ -65493,7 +65606,7 @@ var init_doctor_knowledge = __esm({
|
|
|
65493
65606
|
},
|
|
65494
65607
|
async run({ args }) {
|
|
65495
65608
|
const startedAt = Date.now();
|
|
65496
|
-
const root =
|
|
65609
|
+
const root = getProjectRoot55();
|
|
65497
65610
|
let context;
|
|
65498
65611
|
let pending;
|
|
65499
65612
|
try {
|
|
@@ -65661,7 +65774,7 @@ import { join as join24 } from "node:path";
|
|
|
65661
65774
|
import {
|
|
65662
65775
|
ensureGlobalAgentRegistryDb,
|
|
65663
65776
|
getGlobalAgentRegistryNativeDb,
|
|
65664
|
-
getProjectRoot as
|
|
65777
|
+
getProjectRoot as getProjectRoot56,
|
|
65665
65778
|
installAgentFromCant
|
|
65666
65779
|
} from "@cleocode/core/internal";
|
|
65667
65780
|
function sha256Hex(bytes) {
|
|
@@ -65849,7 +65962,7 @@ var init_migrate_agents_v2 = __esm({
|
|
|
65849
65962
|
}
|
|
65850
65963
|
},
|
|
65851
65964
|
async run({ args }) {
|
|
65852
|
-
const projectRoot =
|
|
65965
|
+
const projectRoot = getProjectRoot56();
|
|
65853
65966
|
const verbose = args.quiet !== true;
|
|
65854
65967
|
if (verbose) {
|
|
65855
65968
|
humanInfo("Scanning .cleo/cant/agents/ and .cleo/agents/ for unregistered agents...");
|
|
@@ -65893,7 +66006,7 @@ __export(doctor_exports, {
|
|
|
65893
66006
|
});
|
|
65894
66007
|
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
65895
66008
|
import { join as join25 } from "node:path";
|
|
65896
|
-
import { getProjectRoot as
|
|
66009
|
+
import { getProjectRoot as getProjectRoot57, pushWarning as pushWarning5 } from "@cleocode/core";
|
|
65897
66010
|
import { renderInvariantAuditLines } from "@cleocode/core/doctor/invariant-audit-render.js";
|
|
65898
66011
|
import {
|
|
65899
66012
|
quarantineRogueCleoDir,
|
|
@@ -66013,6 +66126,7 @@ var init_doctor = __esm({
|
|
|
66013
66126
|
init_doctor_acceptance_drift();
|
|
66014
66127
|
init_doctor_credentials();
|
|
66015
66128
|
init_doctor_db_substrate();
|
|
66129
|
+
init_doctor_dep_cycles();
|
|
66016
66130
|
init_doctor_exodus();
|
|
66017
66131
|
init_doctor_exodus_residue();
|
|
66018
66132
|
init_doctor_fk_check();
|
|
@@ -66079,6 +66193,8 @@ var init_doctor = __esm({
|
|
|
66079
66193
|
"acceptance-drift": doctorAcceptanceDriftCommand,
|
|
66080
66194
|
// T12790 — evidence bindings whose AC row is gone (no FK): report + --fix (audited)
|
|
66081
66195
|
"ac-bindings": doctorAcBindingsCommand,
|
|
66196
|
+
// T12886 — stored task dependency cycles + repair plan (read-only)
|
|
66197
|
+
"dep-cycles": doctorDepCyclesCommand,
|
|
66082
66198
|
// T12158 — tables nexus resolves by bare name must actually live where it assumes
|
|
66083
66199
|
"nexus-residency": doctorNexusResidencyCommand,
|
|
66084
66200
|
// T12113 (gh#1222) — evidence-tool semaphore holders + orphan reaping
|
|
@@ -66297,7 +66413,7 @@ var init_doctor = __esm({
|
|
|
66297
66413
|
const { join: pathJoin } = await import("node:path");
|
|
66298
66414
|
const { existsSync: existsSync22 } = await import("node:fs");
|
|
66299
66415
|
const { detectAndHealCoreWorktreeLeak } = await import("@cleocode/worktree");
|
|
66300
|
-
const projectRoot =
|
|
66416
|
+
const projectRoot = getProjectRoot57();
|
|
66301
66417
|
let gitRoot = projectRoot;
|
|
66302
66418
|
try {
|
|
66303
66419
|
gitRoot = execFile2("git", ["rev-parse", "--show-toplevel"], {
|
|
@@ -66349,7 +66465,7 @@ var init_doctor = __esm({
|
|
|
66349
66465
|
}
|
|
66350
66466
|
if (args.brain) {
|
|
66351
66467
|
const { computeBrainHealthDashboard } = await import("@cleocode/core/memory/brain-health-dashboard.js");
|
|
66352
|
-
const projectRoot =
|
|
66468
|
+
const projectRoot = getProjectRoot57();
|
|
66353
66469
|
const dashboard = await computeBrainHealthDashboard(projectRoot);
|
|
66354
66470
|
cliOutput(dashboard, { command: "doctor", operation: "doctor.brain" });
|
|
66355
66471
|
if (dashboard.hasP0Failure) {
|
|
@@ -66358,7 +66474,7 @@ var init_doctor = __esm({
|
|
|
66358
66474
|
return;
|
|
66359
66475
|
}
|
|
66360
66476
|
if (args["scan-test-fixtures-in-prod"]) {
|
|
66361
|
-
const projectRoot =
|
|
66477
|
+
const projectRoot = getProjectRoot57();
|
|
66362
66478
|
const matches = await scanTestFixturesInProd(projectRoot);
|
|
66363
66479
|
const dryRun = args["dry-run"] !== false && args.quarantine !== true;
|
|
66364
66480
|
const quarantined = !dryRun && matches.length > 0 ? await quarantineTestFixtures(projectRoot, matches) : void 0;
|
|
@@ -66446,7 +66562,7 @@ var init_doctor = __esm({
|
|
|
66446
66562
|
progress.complete("Comprehensive diagnostics complete");
|
|
66447
66563
|
} else if (args["scan-rogue-cleo-dirs"]) {
|
|
66448
66564
|
progress.step(0, "Scanning for rogue .cleo/ directories");
|
|
66449
|
-
const projectRoot =
|
|
66565
|
+
const projectRoot = getProjectRoot57();
|
|
66450
66566
|
const reports = scanRogueCleoDirs(projectRoot);
|
|
66451
66567
|
progress.complete(
|
|
66452
66568
|
`Found ${reports.length} rogue .cleo/ director${reports.length === 1 ? "y" : "ies"}`
|
|
@@ -66455,7 +66571,7 @@ var init_doctor = __esm({
|
|
|
66455
66571
|
} else if (args["quarantine-rogue-cleo-dirs"]) {
|
|
66456
66572
|
const isDryRun = args["dry-run"] === true;
|
|
66457
66573
|
progress.step(0, `${isDryRun ? "[DRY RUN] " : ""}Scanning for rogue .cleo/ directories`);
|
|
66458
|
-
const projectRoot =
|
|
66574
|
+
const projectRoot = getProjectRoot57();
|
|
66459
66575
|
const reports = scanRogueCleoDirs(projectRoot);
|
|
66460
66576
|
if (reports.length === 0) {
|
|
66461
66577
|
progress.complete("No rogue .cleo/ directories found \u2014 nothing to quarantine");
|
|
@@ -66509,7 +66625,7 @@ var init_doctor = __esm({
|
|
|
66509
66625
|
const { detectAndRemoveLegacyGlobalFiles, detectAndRemoveStrayProjectNexus } = await import("@cleocode/core/store/cleanup-legacy.js");
|
|
66510
66626
|
const { getCleoHome: getCleoHome8 } = await import("@cleocode/core");
|
|
66511
66627
|
const cleoHome = getCleoHome8();
|
|
66512
|
-
const projectRoot =
|
|
66628
|
+
const projectRoot = getProjectRoot57();
|
|
66513
66629
|
const legacyResult = detectAndRemoveLegacyGlobalFiles(cleoHome);
|
|
66514
66630
|
const strayResult = detectAndRemoveStrayProjectNexus(projectRoot);
|
|
66515
66631
|
const isDryRun = args["dry-run"] === true;
|
|
@@ -66542,7 +66658,7 @@ var init_doctor = __esm({
|
|
|
66542
66658
|
} else if (args["audit-worktree-orphans"]) {
|
|
66543
66659
|
progress.step(0, "Comprehensive worktree anomaly audit (T9808 / council D009)");
|
|
66544
66660
|
const { auditWorktreeOrphansComprehensive, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
|
|
66545
|
-
const projectRoot =
|
|
66661
|
+
const projectRoot = getProjectRoot57();
|
|
66546
66662
|
const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
|
|
66547
66663
|
const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
|
|
66548
66664
|
const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
|
|
@@ -66599,7 +66715,7 @@ var init_doctor = __esm({
|
|
|
66599
66715
|
`${isDryRun ? "[DRY RUN] " : ""}Scanning + pruning worktree-orphan .cleo/ directories`
|
|
66600
66716
|
);
|
|
66601
66717
|
const { pruneWorktreeOrphans, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
|
|
66602
|
-
const projectRoot =
|
|
66718
|
+
const projectRoot = getProjectRoot57();
|
|
66603
66719
|
const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
|
|
66604
66720
|
const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
|
|
66605
66721
|
const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
|
|
@@ -66678,7 +66794,7 @@ var init_doctor = __esm({
|
|
|
66678
66794
|
`${isDryRun ? "[DRY RUN] " : ""}Migrating .cleo/worktree-include \u2192 .worktreeinclude`
|
|
66679
66795
|
);
|
|
66680
66796
|
const { migrateWorktreeIncludeFile } = await import("@cleocode/core");
|
|
66681
|
-
const projectRoot =
|
|
66797
|
+
const projectRoot = getProjectRoot57();
|
|
66682
66798
|
const result = await migrateWorktreeIncludeFile(projectRoot, { dryRun: isDryRun });
|
|
66683
66799
|
progress.complete(`Migration ${result.action}`);
|
|
66684
66800
|
cliOutput(result, { command: "doctor", operation: "doctor.migrate-worktree-include" });
|
|
@@ -66697,7 +66813,7 @@ var init_doctor = __esm({
|
|
|
66697
66813
|
const stepLabel = isFocusedAlias ? "Auditing Saga hierarchy for ADR-073 invariants" : "Walking central INVARIANTS_REGISTRY";
|
|
66698
66814
|
progress.step(0, stepLabel);
|
|
66699
66815
|
const { auditInvariantRegistry } = await import("@cleocode/core/doctor/invariant-audit.js");
|
|
66700
|
-
const projectRoot =
|
|
66816
|
+
const projectRoot = getProjectRoot57();
|
|
66701
66817
|
const result = await auditInvariantRegistry(projectRoot, { adrFilter });
|
|
66702
66818
|
const operation = isFocusedAlias ? "doctor.audit-sagas" : "doctor.audit-invariants";
|
|
66703
66819
|
const summary = `Invariant audit complete \u2014 ${result.totalCount} entries walked, ${result.errorCount} error / ${result.warningCount} warning / ${result.infoCount} info violation(s), ${result.notApplicableCount} not-applicable, ${result.documentedCount} documented`;
|
|
@@ -66719,7 +66835,7 @@ var init_doctor = __esm({
|
|
|
66719
66835
|
{ command: "doctor", operation: "admin.health" }
|
|
66720
66836
|
);
|
|
66721
66837
|
try {
|
|
66722
|
-
const projectRoot =
|
|
66838
|
+
const projectRoot = getProjectRoot57();
|
|
66723
66839
|
const conflicts = readMigrationConflicts(projectRoot);
|
|
66724
66840
|
if (conflicts.length > 0) {
|
|
66725
66841
|
progress.complete(
|
|
@@ -66750,7 +66866,7 @@ var init_doctor = __esm({
|
|
|
66750
66866
|
progress.complete("Health check complete");
|
|
66751
66867
|
}
|
|
66752
66868
|
try {
|
|
66753
|
-
const projectRoot =
|
|
66869
|
+
const projectRoot = getProjectRoot57();
|
|
66754
66870
|
const { auditSagaHierarchy } = await import("@cleocode/core/doctor/saga-audit.js");
|
|
66755
66871
|
const sagaAudit = await auditSagaHierarchy(projectRoot);
|
|
66756
66872
|
if (sagaAudit.sagas.length === 0) {
|
|
@@ -66777,6 +66893,26 @@ Saga Hierarchy (${sagaAudit.sagas.length} saga(s), ${sagaAudit.count} violation(
|
|
|
66777
66893
|
humanLine(`
|
|
66778
66894
|
Saga Hierarchy: audit skipped (${msg})`);
|
|
66779
66895
|
}
|
|
66896
|
+
try {
|
|
66897
|
+
const { scanDependencyCycles: scanDependencyCycles2 } = await import("@cleocode/core/doctor/dependency-cycles.js");
|
|
66898
|
+
const cycles = await scanDependencyCycles2(getProjectRoot57());
|
|
66899
|
+
humanLine(
|
|
66900
|
+
`
|
|
66901
|
+
Dependency cycles: ${cycles.cycleCount} (${cycles.edgeCount} edge(s) checked)`
|
|
66902
|
+
);
|
|
66903
|
+
for (const c of cycles.components) humanLine(` ${c.cycle.join(" \u2192 ")}`);
|
|
66904
|
+
if (cycles.repairPlan.length > 0) {
|
|
66905
|
+
humanLine(" Repair plan (review first; `cleo doctor dep-cycles` for JSON):");
|
|
66906
|
+
for (const r of cycles.repairPlan) humanLine(` ${r.command}`);
|
|
66907
|
+
}
|
|
66908
|
+
if (cycles.cycleCount > 0 && (process.exitCode === void 0 || process.exitCode === 0)) {
|
|
66909
|
+
process.exitCode = 2;
|
|
66910
|
+
}
|
|
66911
|
+
} catch (err) {
|
|
66912
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
66913
|
+
humanLine(`
|
|
66914
|
+
Dependency cycles: check skipped (${msg})`);
|
|
66915
|
+
}
|
|
66780
66916
|
}
|
|
66781
66917
|
} catch (err) {
|
|
66782
66918
|
progress.error("Health check failed");
|
|
@@ -66798,7 +66934,7 @@ async function batchEntry(taskId, result, args) {
|
|
|
66798
66934
|
return { taskId, completed: false, error: code, message, next: fix };
|
|
66799
66935
|
}
|
|
66800
66936
|
const params = completeDispatchParams({ ...args, taskId, "if-match": void 0 });
|
|
66801
|
-
const done = await dispatchRaw("mutate", "tasks", "complete", params);
|
|
66937
|
+
const done = await withoutOutputPointer(() => dispatchRaw("mutate", "tasks", "complete", params));
|
|
66802
66938
|
const recordedGates = result.data.recordedGates;
|
|
66803
66939
|
if (done.success) return { taskId, recordedGates, completed: true };
|
|
66804
66940
|
const failure = { error: "E_DONE_BLOCKED", message: done.error?.message, next: done.error?.fix };
|
|
@@ -66834,6 +66970,7 @@ var init_done = __esm({
|
|
|
66834
66970
|
"packages/cleo/src/cli/commands/done.ts"() {
|
|
66835
66971
|
"use strict";
|
|
66836
66972
|
init_cli();
|
|
66973
|
+
init_field_context();
|
|
66837
66974
|
init_define_cli_command();
|
|
66838
66975
|
init_renderers();
|
|
66839
66976
|
init_complete();
|
|
@@ -66869,8 +67006,8 @@ var init_done = __esm({
|
|
|
66869
67006
|
process.exitCode = 2;
|
|
66870
67007
|
return;
|
|
66871
67008
|
}
|
|
66872
|
-
const { getProjectRoot:
|
|
66873
|
-
const options = { projectRoot:
|
|
67009
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core/paths.js");
|
|
67010
|
+
const options = { projectRoot: getProjectRoot75(), ...parsed.options };
|
|
66874
67011
|
const requested = [
|
|
66875
67012
|
...new Set([args.taskId, ...args._ ?? []].map(String))
|
|
66876
67013
|
];
|
|
@@ -66920,11 +67057,13 @@ var init_done = __esm({
|
|
|
66920
67057
|
process.exitCode = recorded.error.exitCode ?? 1;
|
|
66921
67058
|
return;
|
|
66922
67059
|
}
|
|
66923
|
-
const completed = await
|
|
66924
|
-
|
|
66925
|
-
|
|
66926
|
-
|
|
66927
|
-
|
|
67060
|
+
const completed = await withoutOutputPointer(
|
|
67061
|
+
() => dispatchRaw(
|
|
67062
|
+
"mutate",
|
|
67063
|
+
"tasks",
|
|
67064
|
+
"complete",
|
|
67065
|
+
completeDispatchParams({ ...args, "if-match": void 0 })
|
|
67066
|
+
)
|
|
66928
67067
|
);
|
|
66929
67068
|
if (!completed.success) {
|
|
66930
67069
|
const details = {
|
|
@@ -68230,7 +68369,7 @@ __export(gateway_exports, {
|
|
|
68230
68369
|
gatewayOpenapiSubCommand: () => gatewayOpenapiSubCommand
|
|
68231
68370
|
});
|
|
68232
68371
|
import { resolve as resolve8 } from "node:path";
|
|
68233
|
-
import { generateOpenApi, getProjectRoot as
|
|
68372
|
+
import { generateOpenApi, getProjectRoot as getProjectRoot58 } from "@cleocode/core";
|
|
68234
68373
|
var gatewayOpenapiSubCommand, gatewayCommand;
|
|
68235
68374
|
var init_gateway = __esm({
|
|
68236
68375
|
"packages/cleo/src/cli/commands/gateway.ts"() {
|
|
@@ -68262,7 +68401,7 @@ var init_gateway = __esm({
|
|
|
68262
68401
|
const pathCount = Object.keys(doc.paths).length;
|
|
68263
68402
|
if (typeof args.out === "string" && args.out.length > 0) {
|
|
68264
68403
|
const { writeFileSync: writeFileSync8 } = await import("node:fs");
|
|
68265
|
-
const target = resolve8(
|
|
68404
|
+
const target = resolve8(getProjectRoot58(), args.out);
|
|
68266
68405
|
writeFileSync8(target, json2, "utf8");
|
|
68267
68406
|
cliOutput(
|
|
68268
68407
|
{ out: target, pathCount, version: doc.info.version, openapi: doc.openapi },
|
|
@@ -68723,7 +68862,7 @@ var go_exports = {};
|
|
|
68723
68862
|
__export(go_exports, {
|
|
68724
68863
|
goCommand: () => goCommand
|
|
68725
68864
|
});
|
|
68726
|
-
import { getProjectRoot as
|
|
68865
|
+
import { getProjectRoot as getProjectRoot59, go } from "@cleocode/core";
|
|
68727
68866
|
var goCommand;
|
|
68728
68867
|
var init_go = __esm({
|
|
68729
68868
|
"packages/cleo/src/cli/commands/go.ts"() {
|
|
@@ -68749,7 +68888,7 @@ var init_go = __esm({
|
|
|
68749
68888
|
}
|
|
68750
68889
|
},
|
|
68751
68890
|
async run({ args }) {
|
|
68752
|
-
const projectRoot =
|
|
68891
|
+
const projectRoot = getProjectRoot59();
|
|
68753
68892
|
const { getCurrentSessionId, resolveBoundSessionId } = await import("@cleocode/core/internal");
|
|
68754
68893
|
let sessionId = getCurrentSessionId(projectRoot) ?? void 0;
|
|
68755
68894
|
if (sessionId === void 0) {
|
|
@@ -68777,7 +68916,7 @@ var goal_exports = {};
|
|
|
68777
68916
|
__export(goal_exports, {
|
|
68778
68917
|
goalCommand: () => goalCommand
|
|
68779
68918
|
});
|
|
68780
|
-
import { getProjectRoot as
|
|
68919
|
+
import { getProjectRoot as getProjectRoot60, goal } from "@cleocode/core";
|
|
68781
68920
|
function resolveGoalKind(task) {
|
|
68782
68921
|
if (typeof task === "string" && task.length > 0) {
|
|
68783
68922
|
if (!isValidGoalTargetTaskId(task)) {
|
|
@@ -68824,7 +68963,7 @@ var init_goal2 = __esm({
|
|
|
68824
68963
|
}
|
|
68825
68964
|
const record = await goal.createGoal(
|
|
68826
68965
|
{ goalKind: kindResult.kind, intent, turnBudget: resolveTurnBudget(args.turns) },
|
|
68827
|
-
|
|
68966
|
+
getProjectRoot60()
|
|
68828
68967
|
);
|
|
68829
68968
|
cliOutput(record, { command: "goal set", operation: "goal.set" });
|
|
68830
68969
|
}
|
|
@@ -68835,7 +68974,7 @@ var init_goal2 = __esm({
|
|
|
68835
68974
|
description: "Show the current agent's active goal (per-agent scoped)."
|
|
68836
68975
|
},
|
|
68837
68976
|
async run() {
|
|
68838
|
-
const record = await goal.getActiveGoal(
|
|
68977
|
+
const record = await goal.getActiveGoal(getProjectRoot60());
|
|
68839
68978
|
cliOutput(record ?? { active: null }, { command: "goal status", operation: "goal.status" });
|
|
68840
68979
|
}
|
|
68841
68980
|
});
|
|
@@ -68857,7 +68996,7 @@ var init_goal2 = __esm({
|
|
|
68857
68996
|
});
|
|
68858
68997
|
return;
|
|
68859
68998
|
}
|
|
68860
|
-
const cwd =
|
|
68999
|
+
const cwd = getProjectRoot60();
|
|
68861
69000
|
const parent = await goal.getActiveGoal(cwd);
|
|
68862
69001
|
if (!parent) {
|
|
68863
69002
|
cliError(
|
|
@@ -68905,7 +69044,7 @@ var init_goal2 = __esm({
|
|
|
68905
69044
|
});
|
|
68906
69045
|
return;
|
|
68907
69046
|
}
|
|
68908
|
-
const cwd =
|
|
69047
|
+
const cwd = getProjectRoot60();
|
|
68909
69048
|
const result = await goal.advanceGoalWithPersist(goalId, { cwd });
|
|
68910
69049
|
if (!result) {
|
|
68911
69050
|
cliError(`Goal '${goalId}' not found.`, 4 /* NOT_FOUND */, { name: "E_NOT_FOUND" });
|
|
@@ -68930,7 +69069,7 @@ var init_goal2 = __esm({
|
|
|
68930
69069
|
});
|
|
68931
69070
|
return;
|
|
68932
69071
|
}
|
|
68933
|
-
const cwd =
|
|
69072
|
+
const cwd = getProjectRoot60();
|
|
68934
69073
|
const active = await goal.getActiveGoal(cwd);
|
|
68935
69074
|
if (!active) {
|
|
68936
69075
|
cliError(
|
|
@@ -69977,7 +70116,7 @@ var hygiene_exports = {};
|
|
|
69977
70116
|
__export(hygiene_exports, {
|
|
69978
70117
|
hygieneCommand: () => hygieneCommand
|
|
69979
70118
|
});
|
|
69980
|
-
import { getProjectRoot as
|
|
70119
|
+
import { getProjectRoot as getProjectRoot61 } from "@cleocode/core";
|
|
69981
70120
|
import { runSpawnReadinessHygieneCli } from "@cleocode/core/hygiene/validate-spawn-readiness.js";
|
|
69982
70121
|
var hygieneCommand;
|
|
69983
70122
|
var init_hygiene = __esm({
|
|
@@ -70006,7 +70145,7 @@ var init_hygiene = __esm({
|
|
|
70006
70145
|
}
|
|
70007
70146
|
},
|
|
70008
70147
|
async run({ args }) {
|
|
70009
|
-
const projectRoot = args["project-root"] ||
|
|
70148
|
+
const projectRoot = args["project-root"] || getProjectRoot61() || process.cwd();
|
|
70010
70149
|
const worktreePath = args["worktree-path"];
|
|
70011
70150
|
await runSpawnReadinessHygieneCli(projectRoot, worktreePath);
|
|
70012
70151
|
}
|
|
@@ -71349,7 +71488,7 @@ var llm_cost_exports = {};
|
|
|
71349
71488
|
__export(llm_cost_exports, {
|
|
71350
71489
|
costCommand: () => costCommand
|
|
71351
71490
|
});
|
|
71352
|
-
import { getProjectRoot as
|
|
71491
|
+
import { getProjectRoot as getProjectRoot62 } from "@cleocode/core/internal";
|
|
71353
71492
|
import { computeCost } from "@cleocode/core/llm/usage-pricing";
|
|
71354
71493
|
function resolveSessionId(raw) {
|
|
71355
71494
|
if (raw === "current") {
|
|
@@ -71422,7 +71561,7 @@ var init_llm_cost = __esm({
|
|
|
71422
71561
|
process.exit(6);
|
|
71423
71562
|
}
|
|
71424
71563
|
const sessionId = resolveSessionId(rawSessionId);
|
|
71425
|
-
const projectRoot =
|
|
71564
|
+
const projectRoot = getProjectRoot62(process.cwd());
|
|
71426
71565
|
let breakdown;
|
|
71427
71566
|
try {
|
|
71428
71567
|
breakdown = await loadSessionCostBreakdown(projectRoot, sessionId);
|
|
@@ -72811,7 +72950,7 @@ var memory_exports = {};
|
|
|
72811
72950
|
__export(memory_exports, {
|
|
72812
72951
|
memoryCommand: () => memoryCommand
|
|
72813
72952
|
});
|
|
72814
|
-
import { getProjectRoot as
|
|
72953
|
+
import { getProjectRoot as getProjectRoot63 } from "@cleocode/core";
|
|
72815
72954
|
import {
|
|
72816
72955
|
getBrainDb as getBrainDb2,
|
|
72817
72956
|
getDreamStatus,
|
|
@@ -73769,7 +73908,7 @@ var init_memory3 = __esm({
|
|
|
73769
73908
|
},
|
|
73770
73909
|
args: {},
|
|
73771
73910
|
async run() {
|
|
73772
|
-
const root =
|
|
73911
|
+
const root = getProjectRoot63();
|
|
73773
73912
|
try {
|
|
73774
73913
|
const result = await runConsolidation(root);
|
|
73775
73914
|
cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
|
|
@@ -73793,7 +73932,7 @@ var init_memory3 = __esm({
|
|
|
73793
73932
|
}
|
|
73794
73933
|
},
|
|
73795
73934
|
async run({ args }) {
|
|
73796
|
-
const root =
|
|
73935
|
+
const root = getProjectRoot63();
|
|
73797
73936
|
if (args.status) {
|
|
73798
73937
|
try {
|
|
73799
73938
|
const status = await getDreamStatus(root);
|
|
@@ -73830,7 +73969,7 @@ var init_memory3 = __esm({
|
|
|
73830
73969
|
}
|
|
73831
73970
|
},
|
|
73832
73971
|
async run({ args }) {
|
|
73833
|
-
const root =
|
|
73972
|
+
const root = getProjectRoot63();
|
|
73834
73973
|
try {
|
|
73835
73974
|
const { runObserver, runReflector } = await import("@cleocode/core/memory");
|
|
73836
73975
|
const observerResult = await runObserver(root, args.session, {
|
|
@@ -73870,7 +74009,7 @@ var init_memory3 = __esm({
|
|
|
73870
74009
|
}
|
|
73871
74010
|
},
|
|
73872
74011
|
async run({ args }) {
|
|
73873
|
-
const root =
|
|
74012
|
+
const root = getProjectRoot63();
|
|
73874
74013
|
await getBrainDb2(root);
|
|
73875
74014
|
const { getBrainNativeDb: getBrainNativeDb3 } = await import("@cleocode/core/internal");
|
|
73876
74015
|
const nativeDb = getBrainNativeDb3();
|
|
@@ -73908,7 +74047,7 @@ var init_memory3 = __esm({
|
|
|
73908
74047
|
},
|
|
73909
74048
|
async run({ args }) {
|
|
73910
74049
|
const core2 = await import("@cleocode/core/internal");
|
|
73911
|
-
const nexusDb = await core2.getNexusDb(
|
|
74050
|
+
const nexusDb = await core2.getNexusDb(getProjectRoot63());
|
|
73912
74051
|
const result = args.restore ? await core2.restorePrunedTraits(
|
|
73913
74052
|
nexusDb,
|
|
73914
74053
|
String(args.restore),
|
|
@@ -73938,7 +74077,7 @@ var init_memory3 = __esm({
|
|
|
73938
74077
|
return;
|
|
73939
74078
|
}
|
|
73940
74079
|
const core2 = await import("@cleocode/core/internal");
|
|
73941
|
-
const nexusDb = await core2.getNexusDb(
|
|
74080
|
+
const nexusDb = await core2.getNexusDb(getProjectRoot63());
|
|
73942
74081
|
const previous = await core2.setUserProfileTraitScope(nexusDb, String(args.key), scope);
|
|
73943
74082
|
if (previous === null) {
|
|
73944
74083
|
cliError(`No user-profile trait "${args.key}"`, "E_NOT_FOUND", { name: "E_NOT_FOUND" });
|
|
@@ -73962,7 +74101,7 @@ var init_memory3 = __esm({
|
|
|
73962
74101
|
}
|
|
73963
74102
|
},
|
|
73964
74103
|
async run({ args }) {
|
|
73965
|
-
const root =
|
|
74104
|
+
const root = getProjectRoot63();
|
|
73966
74105
|
try {
|
|
73967
74106
|
await getBrainDb2(root);
|
|
73968
74107
|
const { totalDuplicateRows, groups } = await scanDuplicateEntries();
|
|
@@ -74008,7 +74147,7 @@ var init_memory3 = __esm({
|
|
|
74008
74147
|
async run({ args }) {
|
|
74009
74148
|
const sourceDir = args.from;
|
|
74010
74149
|
const isDryRun = !!args["dry-run"];
|
|
74011
|
-
const projectRoot =
|
|
74150
|
+
const projectRoot = getProjectRoot63();
|
|
74012
74151
|
try {
|
|
74013
74152
|
const result = await importMemoryFiles({
|
|
74014
74153
|
sourceDir,
|
|
@@ -74159,7 +74298,7 @@ var init_memory3 = __esm({
|
|
|
74159
74298
|
},
|
|
74160
74299
|
args: {},
|
|
74161
74300
|
async run() {
|
|
74162
|
-
const root =
|
|
74301
|
+
const root = getProjectRoot63();
|
|
74163
74302
|
try {
|
|
74164
74303
|
await getBrainDb2(root);
|
|
74165
74304
|
const result = await getTierStats(root);
|
|
@@ -74202,7 +74341,7 @@ var init_memory3 = __esm({
|
|
|
74202
74341
|
}
|
|
74203
74342
|
},
|
|
74204
74343
|
async run({ args }) {
|
|
74205
|
-
const root =
|
|
74344
|
+
const root = getProjectRoot63();
|
|
74206
74345
|
const targetTier = args.to;
|
|
74207
74346
|
const reason = args.reason;
|
|
74208
74347
|
const validTiers = ["medium", "long"];
|
|
@@ -74268,7 +74407,7 @@ var init_memory3 = __esm({
|
|
|
74268
74407
|
}
|
|
74269
74408
|
},
|
|
74270
74409
|
async run({ args }) {
|
|
74271
|
-
const root =
|
|
74410
|
+
const root = getProjectRoot63();
|
|
74272
74411
|
const targetTier = args.to;
|
|
74273
74412
|
const reason = args.reason;
|
|
74274
74413
|
const validTiers = ["short", "medium"];
|
|
@@ -74741,7 +74880,7 @@ var migrate_claude_mem_exports = {};
|
|
|
74741
74880
|
__export(migrate_claude_mem_exports, {
|
|
74742
74881
|
migrateClaudeMemCommand: () => migrateClaudeMemCommand
|
|
74743
74882
|
});
|
|
74744
|
-
import { getProjectRoot as
|
|
74883
|
+
import { getProjectRoot as getProjectRoot64, migrateClaudeMem } from "@cleocode/core/internal";
|
|
74745
74884
|
import { ingestLooseAgentOutputs, ingestRcasdDirectories } from "@cleocode/core/memory";
|
|
74746
74885
|
import { getDb as getDb2 } from "@cleocode/core/store/sqlite";
|
|
74747
74886
|
var storageCommand, claudeMemCommand, manifestIngestCommand, migrateClaudeMemCommand;
|
|
@@ -74804,7 +74943,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
74804
74943
|
}
|
|
74805
74944
|
},
|
|
74806
74945
|
async run({ args }) {
|
|
74807
|
-
const root =
|
|
74946
|
+
const root = getProjectRoot64();
|
|
74808
74947
|
try {
|
|
74809
74948
|
const result = await migrateClaudeMem(root, {
|
|
74810
74949
|
sourcePath: args.source,
|
|
@@ -74853,7 +74992,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
74853
74992
|
}
|
|
74854
74993
|
},
|
|
74855
74994
|
async run({ args }) {
|
|
74856
|
-
const projectRoot =
|
|
74995
|
+
const projectRoot = getProjectRoot64();
|
|
74857
74996
|
try {
|
|
74858
74997
|
const db = await getDb2(projectRoot);
|
|
74859
74998
|
const rcasdFlag = Boolean(args.rcasd);
|
|
@@ -74971,7 +75110,7 @@ __export(nexus_exports, {
|
|
|
74971
75110
|
import { statSync as statSync2 } from "node:fs";
|
|
74972
75111
|
import { appendFile as appendFile2, mkdir as mkdir5 } from "node:fs/promises";
|
|
74973
75112
|
import path4 from "node:path";
|
|
74974
|
-
import { getProjectRoot as
|
|
75113
|
+
import { getProjectRoot as getProjectRoot65 } from "@cleocode/core";
|
|
74975
75114
|
import { getSymbolImpact } from "@cleocode/core/nexus";
|
|
74976
75115
|
import { runNexusAnalysis } from "@cleocode/core/nexus/analyze-orchestrator.js";
|
|
74977
75116
|
import {
|
|
@@ -75142,7 +75281,7 @@ var init_nexus3 = __esm({
|
|
|
75142
75281
|
async run({ args }) {
|
|
75143
75282
|
applyJsonFlag2(args.json);
|
|
75144
75283
|
const projectIdOverride = args["project-id"];
|
|
75145
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
75284
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
75146
75285
|
const startTime = Date.now();
|
|
75147
75286
|
if (args.path) {
|
|
75148
75287
|
let isDir = false;
|
|
@@ -75202,7 +75341,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648), so the coun
|
|
|
75202
75341
|
process.exitCode = 2 /* INVALID_INPUT */;
|
|
75203
75342
|
return;
|
|
75204
75343
|
}
|
|
75205
|
-
const currentRoot =
|
|
75344
|
+
const currentRoot = getProjectRoot65();
|
|
75206
75345
|
if (args.path && path4.resolve(repoPath) !== path4.resolve(currentRoot)) {
|
|
75207
75346
|
cliError(
|
|
75208
75347
|
`nexus status cannot report on '${repoPath}' from this project.
|
|
@@ -75756,7 +75895,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
75756
75895
|
applyJsonFlag2(args.json);
|
|
75757
75896
|
const startTime = Date.now();
|
|
75758
75897
|
const projectIdOverride = args["project-id"];
|
|
75759
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
75898
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
75760
75899
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
75761
75900
|
const response = await dispatchRaw("query", "nexus", "clusters", { projectId, repoPath });
|
|
75762
75901
|
const durationMs = Date.now() - startTime;
|
|
@@ -75800,7 +75939,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
75800
75939
|
applyJsonFlag2(args.json);
|
|
75801
75940
|
const startTime = Date.now();
|
|
75802
75941
|
const projectIdOverride = args["project-id"];
|
|
75803
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
75942
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
75804
75943
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
75805
75944
|
const response = await dispatchRaw("query", "nexus", "flows", { projectId, repoPath });
|
|
75806
75945
|
const durationMs = Date.now() - startTime;
|
|
@@ -75843,7 +75982,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
75843
75982
|
void appendDeprecationTelemetry("nexus.context", "cleo graph context");
|
|
75844
75983
|
const startTime = Date.now();
|
|
75845
75984
|
const projectIdOverride = args["project-id"];
|
|
75846
|
-
const repoPath =
|
|
75985
|
+
const repoPath = getProjectRoot65();
|
|
75847
75986
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
75848
75987
|
const limit = parseInt(args.limit, 10);
|
|
75849
75988
|
const symbolName = args.symbol;
|
|
@@ -75906,7 +76045,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
75906
76045
|
const startTime = Date.now();
|
|
75907
76046
|
const whyFlag = !!args.why;
|
|
75908
76047
|
const projectIdOverride = args["project-id"];
|
|
75909
|
-
const repoPath =
|
|
76048
|
+
const repoPath = getProjectRoot65();
|
|
75910
76049
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
75911
76050
|
const maxDepth = Math.min(parseInt(args.depth, 10), 5);
|
|
75912
76051
|
const symbolName = args.symbol;
|
|
@@ -76010,7 +76149,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
76010
76149
|
const projectIdOverride = args["project-id"];
|
|
76011
76150
|
const full = !!args.full;
|
|
76012
76151
|
const ctx = getFormatContext();
|
|
76013
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
76152
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
76014
76153
|
if (args.incremental)
|
|
76015
76154
|
humanWarn(
|
|
76016
76155
|
"[nexus] --incremental is deprecated and has no effect: incremental is the default."
|
|
@@ -76140,7 +76279,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
76140
76279
|
async run({ args }) {
|
|
76141
76280
|
applyJsonFlag2(args.json);
|
|
76142
76281
|
const startTime = Date.now();
|
|
76143
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
76282
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
76144
76283
|
const name = args.name;
|
|
76145
76284
|
const response = await dispatchRaw("mutate", "nexus", "projects.register", {
|
|
76146
76285
|
path: repoPath,
|
|
@@ -76659,7 +76798,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
76659
76798
|
applyJsonFlag2(args.json);
|
|
76660
76799
|
const startTime = Date.now();
|
|
76661
76800
|
const projectIdOverride = args["project-id"];
|
|
76662
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
76801
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
76663
76802
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
76664
76803
|
const response = await dispatchRaw("mutate", "nexus", "refresh-bridge", {
|
|
76665
76804
|
repoPath,
|
|
@@ -76765,7 +76904,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
76765
76904
|
async run({ args }) {
|
|
76766
76905
|
applyJsonFlag2(args.json);
|
|
76767
76906
|
const startTime = Date.now();
|
|
76768
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
76907
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
76769
76908
|
const projectIdOverride = args["project-id"];
|
|
76770
76909
|
const beforeRef = args.before ?? "HEAD~1";
|
|
76771
76910
|
const afterRef = args.after ?? "HEAD";
|
|
@@ -76883,7 +77022,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
76883
77022
|
applyJsonFlag2(args.json);
|
|
76884
77023
|
const startTime = Date.now();
|
|
76885
77024
|
const projectIdOverride = args["project-id"];
|
|
76886
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
77025
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
76887
77026
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
76888
77027
|
const response = await dispatchRaw("query", "nexus", "route-map", { projectId });
|
|
76889
77028
|
const durationMs = Date.now() - startTime;
|
|
@@ -76939,7 +77078,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
76939
77078
|
const startTime = Date.now();
|
|
76940
77079
|
const routeSymbol = args.routeSymbol;
|
|
76941
77080
|
const projectIdOverride = args["project-id"];
|
|
76942
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
77081
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
76943
77082
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
76944
77083
|
const response = await dispatchRaw("query", "nexus", "shape-check", { routeSymbol, projectId });
|
|
76945
77084
|
const durationMs = Date.now() - startTime;
|
|
@@ -77335,7 +77474,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
77335
77474
|
async run({ args }) {
|
|
77336
77475
|
applyJsonFlag2(args.json);
|
|
77337
77476
|
const startTime = Date.now();
|
|
77338
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
77477
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
77339
77478
|
const projectIdOverride = args["project-id"];
|
|
77340
77479
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
77341
77480
|
const response = await dispatchRaw("mutate", "nexus", "contracts-sync", {
|
|
@@ -77445,7 +77584,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
77445
77584
|
async run({ args }) {
|
|
77446
77585
|
applyJsonFlag2(args.json);
|
|
77447
77586
|
const startTime = Date.now();
|
|
77448
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
77587
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot65();
|
|
77449
77588
|
const projectId = Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
77450
77589
|
const response = await dispatchRaw("mutate", "nexus", "contracts-link-tasks", {
|
|
77451
77590
|
projectId,
|
|
@@ -77529,7 +77668,7 @@ The code-intelligence graph is project-scoped (ADR-090 \xB7 T11648): one store p
|
|
|
77529
77668
|
const isIncremental = !!args.incremental;
|
|
77530
77669
|
try {
|
|
77531
77670
|
const result = await runNexusWiki({
|
|
77532
|
-
projectRoot:
|
|
77671
|
+
projectRoot: getProjectRoot65(),
|
|
77533
77672
|
outputDir,
|
|
77534
77673
|
communityFilter,
|
|
77535
77674
|
incremental: isIncremental
|
|
@@ -77879,7 +78018,7 @@ __export(orchestrate_exports, {
|
|
|
77879
78018
|
});
|
|
77880
78019
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
77881
78020
|
import { orchestration } from "@cleocode/core";
|
|
77882
|
-
import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as
|
|
78021
|
+
import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as getProjectRoot66 } from "@cleocode/core/internal";
|
|
77883
78022
|
function formatRollupTable(rollup) {
|
|
77884
78023
|
const waves = "waves" in rollup ? rollup.waves : [rollup];
|
|
77885
78024
|
const lines = [];
|
|
@@ -78022,7 +78161,7 @@ var init_orchestrate3 = __esm({
|
|
|
78022
78161
|
},
|
|
78023
78162
|
async run({ args }) {
|
|
78024
78163
|
const rateWindowHours = args.window !== void 0 ? Number.parseFloat(String(args.window)) : void 0;
|
|
78025
|
-
const metrics = await orchestration.collectOrchestrateDashboard(
|
|
78164
|
+
const metrics = await orchestration.collectOrchestrateDashboard(getProjectRoot66(), {
|
|
78026
78165
|
...rateWindowHours !== void 0 && Number.isFinite(rateWindowHours) && rateWindowHours > 0 ? { rateWindowHours } : {}
|
|
78027
78166
|
});
|
|
78028
78167
|
cliOutput(metrics, {
|
|
@@ -79482,7 +79621,7 @@ __export(project_exports, {
|
|
|
79482
79621
|
import { resolve as resolve9 } from "node:path";
|
|
79483
79622
|
import {
|
|
79484
79623
|
CleoError as CleoError11,
|
|
79485
|
-
getProjectRoot as
|
|
79624
|
+
getProjectRoot as getProjectRoot67,
|
|
79486
79625
|
moveProject,
|
|
79487
79626
|
projectLifecycle,
|
|
79488
79627
|
renameProject,
|
|
@@ -79504,7 +79643,7 @@ function emitEngineFailure(error, operation) {
|
|
|
79504
79643
|
}
|
|
79505
79644
|
function resolveRootOrFail(operation) {
|
|
79506
79645
|
try {
|
|
79507
|
-
return
|
|
79646
|
+
return getProjectRoot67();
|
|
79508
79647
|
} catch (err) {
|
|
79509
79648
|
const code = err instanceof CleoError11 && typeof err.details?.["code"] === "string" ? err.details["code"] : "E_NOT_CLEO_PROJECT";
|
|
79510
79649
|
emitEngineFailure(
|
|
@@ -80332,7 +80471,7 @@ var refresh_memory_exports = {};
|
|
|
80332
80471
|
__export(refresh_memory_exports, {
|
|
80333
80472
|
refreshMemoryCommand: () => refreshMemoryCommand
|
|
80334
80473
|
});
|
|
80335
|
-
import { getProjectRoot as
|
|
80474
|
+
import { getProjectRoot as getProjectRoot68 } from "@cleocode/core";
|
|
80336
80475
|
var refreshMemoryCommand;
|
|
80337
80476
|
var init_refresh_memory = __esm({
|
|
80338
80477
|
"packages/cleo/src/cli/commands/refresh-memory.ts"() {
|
|
@@ -80345,7 +80484,7 @@ var init_refresh_memory = __esm({
|
|
|
80345
80484
|
description: "Regenerate .cleo/memory-bridge.md from brain.db"
|
|
80346
80485
|
},
|
|
80347
80486
|
async run() {
|
|
80348
|
-
const projectDir =
|
|
80487
|
+
const projectDir = getProjectRoot68();
|
|
80349
80488
|
const { writeMemoryBridge } = await import("@cleocode/core/internal");
|
|
80350
80489
|
const result = await writeMemoryBridge(projectDir);
|
|
80351
80490
|
if (result.written) {
|
|
@@ -81931,7 +82070,7 @@ import fs3 from "node:fs";
|
|
|
81931
82070
|
import path5 from "node:path";
|
|
81932
82071
|
import {
|
|
81933
82072
|
CleoError as CleoError13,
|
|
81934
|
-
getProjectRoot as
|
|
82073
|
+
getProjectRoot as getProjectRoot69,
|
|
81935
82074
|
getTaskAccessor as getTaskAccessor3,
|
|
81936
82075
|
parseConflictReport,
|
|
81937
82076
|
setAtPath
|
|
@@ -81952,7 +82091,7 @@ var init_restore = __esm({
|
|
|
81952
82091
|
description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
|
|
81953
82092
|
},
|
|
81954
82093
|
async run() {
|
|
81955
|
-
const projectRoot =
|
|
82094
|
+
const projectRoot = getProjectRoot69();
|
|
81956
82095
|
const reportPath = path5.join(projectRoot, CLEO_DIR_NAME3, RESTORE_CONFLICTS_MD);
|
|
81957
82096
|
if (!fs3.existsSync(reportPath)) {
|
|
81958
82097
|
humanLine("No pending restore conflicts. Nothing to finalize.");
|
|
@@ -82881,8 +83020,8 @@ var init_saga = __esm({
|
|
|
82881
83020
|
}
|
|
82882
83021
|
},
|
|
82883
83022
|
async run({ args }) {
|
|
82884
|
-
const { sagas: sagas2, getProjectRoot:
|
|
82885
|
-
const projectRoot =
|
|
83023
|
+
const { sagas: sagas2, getProjectRoot: getProjectRoot75 } = await import("@cleocode/core");
|
|
83024
|
+
const projectRoot = getProjectRoot75();
|
|
82886
83025
|
const sagaId = typeof args.sagaId === "string" && args.sagaId.length > 0 ? args.sagaId : void 0;
|
|
82887
83026
|
const result = await sagas2.sagaNext(projectRoot, { sagaId });
|
|
82888
83027
|
cliOutput(result.success ? result.data : result, { command: "saga", operation: "saga.next" });
|
|
@@ -84713,7 +84852,7 @@ var sequence_exports = {};
|
|
|
84713
84852
|
__export(sequence_exports, {
|
|
84714
84853
|
sequenceCommand: () => sequenceCommand
|
|
84715
84854
|
});
|
|
84716
|
-
import { getProjectRoot as
|
|
84855
|
+
import { getProjectRoot as getProjectRoot70 } from "@cleocode/core/internal";
|
|
84717
84856
|
var showCommand12, checkCommand7, repairCommand3, sequenceCommand;
|
|
84718
84857
|
var init_sequence = __esm({
|
|
84719
84858
|
"packages/cleo/src/cli/commands/sequence.ts"() {
|
|
@@ -84749,7 +84888,7 @@ var init_sequence = __esm({
|
|
|
84749
84888
|
meta: { name: "repair", description: "Reset counter to max + 1 if behind" },
|
|
84750
84889
|
async run() {
|
|
84751
84890
|
const { repairSequence } = await import("@cleocode/core/internal");
|
|
84752
|
-
const projectRoot =
|
|
84891
|
+
const projectRoot = getProjectRoot70();
|
|
84753
84892
|
const repair = await repairSequence(projectRoot);
|
|
84754
84893
|
const result = {
|
|
84755
84894
|
repaired: repair.repaired,
|
|
@@ -85346,8 +85485,8 @@ var init_session4 = __esm({
|
|
|
85346
85485
|
"audit-scope": { type: "string", description: "Audit log scope (global|local)" }
|
|
85347
85486
|
},
|
|
85348
85487
|
async run({ args }) {
|
|
85349
|
-
const { detectSessionDrift, getProjectRoot:
|
|
85350
|
-
const projectRoot = await
|
|
85488
|
+
const { detectSessionDrift, getProjectRoot: getProjectRoot75 } = await import("@cleocode/core");
|
|
85489
|
+
const projectRoot = await getProjectRoot75();
|
|
85351
85490
|
const scope = args["audit-scope"] === "local" ? "local" : "global";
|
|
85352
85491
|
const report = await detectSessionDrift({ projectRoot, auditScope: scope });
|
|
85353
85492
|
cliOutput(report, { command: "session drift", operation: "session.drift" });
|
|
@@ -88048,13 +88187,13 @@ var init_telemetry2 = __esm({
|
|
|
88048
88187
|
// packages/cleo/src/cli/commands/templates/lib.ts
|
|
88049
88188
|
import { readFileSync as readFileSync13 } from "node:fs";
|
|
88050
88189
|
import { isAbsolute as isAbsolute3, resolve as resolve10 } from "node:path";
|
|
88051
|
-
import { getProjectRoot as
|
|
88190
|
+
import { getProjectRoot as getProjectRoot71 } from "@cleocode/core";
|
|
88052
88191
|
import { resolveSourcePathAbsolute } from "@cleocode/core/templates/registry";
|
|
88053
88192
|
function resolveProjectRoot6(raw) {
|
|
88054
88193
|
if (typeof raw === "string" && raw.length > 0) {
|
|
88055
88194
|
return isAbsolute3(raw) ? raw : resolve10(process.cwd(), raw);
|
|
88056
88195
|
}
|
|
88057
|
-
return
|
|
88196
|
+
return getProjectRoot71();
|
|
88058
88197
|
}
|
|
88059
88198
|
function readTemplateSource(entry) {
|
|
88060
88199
|
const sourceAbsolute = resolveSourcePathAbsolute(entry);
|
|
@@ -88838,7 +88977,7 @@ __export(token_exports, {
|
|
|
88838
88977
|
tokenCommand: () => tokenCommand
|
|
88839
88978
|
});
|
|
88840
88979
|
import { readFileSync as readFileSync17 } from "node:fs";
|
|
88841
|
-
import { getProjectRoot as
|
|
88980
|
+
import { getProjectRoot as getProjectRoot72, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
|
|
88842
88981
|
function readPayload(args, textKey, fileKey) {
|
|
88843
88982
|
const text = args[textKey];
|
|
88844
88983
|
const file = args[fileKey];
|
|
@@ -89002,7 +89141,7 @@ var init_token = __esm({
|
|
|
89002
89141
|
domain: args.domain,
|
|
89003
89142
|
operation: args.operation
|
|
89004
89143
|
};
|
|
89005
|
-
const result = args.record ? await recordTokenExchange2(
|
|
89144
|
+
const result = args.record ? await recordTokenExchange2(getProjectRoot72(), input2) : await measureTokenExchange(input2);
|
|
89006
89145
|
cliOutput(result, {
|
|
89007
89146
|
command: "token",
|
|
89008
89147
|
operation: args.record ? "admin.token.record" : "token.estimate"
|
|
@@ -89038,7 +89177,7 @@ __export(transcript_exports, {
|
|
|
89038
89177
|
});
|
|
89039
89178
|
import { homedir as homedir3 } from "node:os";
|
|
89040
89179
|
import { join as join35 } from "node:path";
|
|
89041
|
-
import { getProjectRoot as
|
|
89180
|
+
import { getProjectRoot as getProjectRoot73 } from "@cleocode/core";
|
|
89042
89181
|
import {
|
|
89043
89182
|
parseDurationMs,
|
|
89044
89183
|
pruneTranscripts,
|
|
@@ -89068,7 +89207,7 @@ var init_transcript = __esm({
|
|
|
89068
89207
|
async run({ args }) {
|
|
89069
89208
|
if (args.pending) {
|
|
89070
89209
|
try {
|
|
89071
|
-
const projectRoot =
|
|
89210
|
+
const projectRoot = getProjectRoot73();
|
|
89072
89211
|
const { scanPendingTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
89073
89212
|
const pending = await scanPendingTranscripts(projectRoot);
|
|
89074
89213
|
cliOutput(
|
|
@@ -89165,7 +89304,7 @@ var init_transcript = __esm({
|
|
|
89165
89304
|
async run({ args }) {
|
|
89166
89305
|
const tier = args.tier ?? "warm";
|
|
89167
89306
|
const dryRun = args["dry-run"] ?? false;
|
|
89168
|
-
const projectRoot =
|
|
89307
|
+
const projectRoot = getProjectRoot73();
|
|
89169
89308
|
try {
|
|
89170
89309
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
89171
89310
|
const { findSessionTranscriptPath, listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -89281,7 +89420,7 @@ var init_transcript = __esm({
|
|
|
89281
89420
|
const dryRun = args["dry-run"] ?? false;
|
|
89282
89421
|
const olderThanHours = args["older-than-hours"] ? Number.parseInt(args["older-than-hours"], 10) : 24;
|
|
89283
89422
|
const limit = args.limit ? Number.parseInt(args.limit, 10) : void 0;
|
|
89284
|
-
const projectRoot =
|
|
89423
|
+
const projectRoot = getProjectRoot73();
|
|
89285
89424
|
try {
|
|
89286
89425
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
89287
89426
|
const { listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -91219,9 +91358,9 @@ var init_verify = __esm({
|
|
|
91219
91358
|
return;
|
|
91220
91359
|
}
|
|
91221
91360
|
const { recordTaskDone } = await import("@cleocode/core/tasks/done-record.js");
|
|
91222
|
-
const { getProjectRoot:
|
|
91361
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core/paths.js");
|
|
91223
91362
|
const r = await recordTaskDone(args.taskId, {
|
|
91224
|
-
projectRoot:
|
|
91363
|
+
projectRoot: getProjectRoot75(),
|
|
91225
91364
|
...parsed.options,
|
|
91226
91365
|
...args.agent ? { agent: args.agent } : {}
|
|
91227
91366
|
});
|
|
@@ -91644,9 +91783,9 @@ var init_workgraph2 = __esm({
|
|
|
91644
91783
|
},
|
|
91645
91784
|
async run({ args }) {
|
|
91646
91785
|
const { generatePlanningDoc } = await import("@cleocode/core/workgraph");
|
|
91647
|
-
const { getProjectRoot:
|
|
91786
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core");
|
|
91648
91787
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
91649
|
-
const projectRoot =
|
|
91788
|
+
const projectRoot = getProjectRoot75();
|
|
91650
91789
|
const audience = String(args.audience) === "agent" ? "agent" : "maintainer";
|
|
91651
91790
|
const result = await generatePlanningDoc(projectRoot, {
|
|
91652
91791
|
sagaId: String(args.sagaId),
|
|
@@ -91663,9 +91802,9 @@ var init_workgraph2 = __esm({
|
|
|
91663
91802
|
async run() {
|
|
91664
91803
|
const { validateWorkGraphStructure } = await import("@cleocode/core/workgraph");
|
|
91665
91804
|
const { taskList: taskList2 } = await import("@cleocode/core/internal");
|
|
91666
|
-
const { getProjectRoot:
|
|
91805
|
+
const { getProjectRoot: getProjectRoot75 } = await import("@cleocode/core");
|
|
91667
91806
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
91668
|
-
const projectRoot =
|
|
91807
|
+
const projectRoot = getProjectRoot75();
|
|
91669
91808
|
const listResult = await taskList2(projectRoot, { limit: 5e3 });
|
|
91670
91809
|
const tasks = listResult.success ? listResult.data?.tasks ?? [] : [];
|
|
91671
91810
|
const nodes = tasks.map((t) => ({
|
|
@@ -91684,9 +91823,9 @@ var init_workgraph2 = __esm({
|
|
|
91684
91823
|
description: "One-shot saga-to-saga workgraph dashboard (tracking checklist)"
|
|
91685
91824
|
},
|
|
91686
91825
|
async run() {
|
|
91687
|
-
const { sagas: sagas2, getProjectRoot:
|
|
91826
|
+
const { sagas: sagas2, getProjectRoot: getProjectRoot75 } = await import("@cleocode/core");
|
|
91688
91827
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
91689
|
-
const projectRoot =
|
|
91828
|
+
const projectRoot = getProjectRoot75();
|
|
91690
91829
|
const listResult = await sagas2.sagaList(projectRoot);
|
|
91691
91830
|
if (!listResult.success) {
|
|
91692
91831
|
cliOutput2(listResult, { command: "workgraph", operation: "workgraph.status" });
|
|
@@ -91752,7 +91891,7 @@ __export(worktree_exports, {
|
|
|
91752
91891
|
worktreeCommand: () => worktreeCommand
|
|
91753
91892
|
});
|
|
91754
91893
|
import readline4 from "node:readline";
|
|
91755
|
-
import { getProjectRoot as
|
|
91894
|
+
import { getProjectRoot as getProjectRoot74, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
|
|
91756
91895
|
async function promptYesNo2(question) {
|
|
91757
91896
|
return new Promise((resolve13) => {
|
|
91758
91897
|
const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -91857,7 +91996,7 @@ var init_worktree3 = __esm({
|
|
|
91857
91996
|
const staleDays = staleDaysRaw !== void 0 ? Number.parseInt(staleDaysRaw, 10) : void 0;
|
|
91858
91997
|
const idleDaysRaw = typeof args["idle-days"] === "string" ? args["idle-days"] : void 0;
|
|
91859
91998
|
const idleDays = idleDaysRaw !== void 0 ? Number.parseInt(idleDaysRaw, 10) : void 0;
|
|
91860
|
-
const projectRoot =
|
|
91999
|
+
const projectRoot = getProjectRoot74();
|
|
91861
92000
|
const listResult = await listWorktrees2({
|
|
91862
92001
|
projectRoot,
|
|
91863
92002
|
...staleDays !== void 0 && !Number.isNaN(staleDays) ? { staleDays } : {}
|
|
@@ -92475,6 +92614,12 @@ var COMMAND_MANIFEST = [
|
|
|
92475
92614
|
description: "Walk every DB in the inventory + report integrity, row counts, orphan dirs. ",
|
|
92476
92615
|
load: async () => (await Promise.resolve().then(() => (init_doctor_db_substrate(), doctor_db_substrate_exports))).doctorDbSubstrateCommand
|
|
92477
92616
|
},
|
|
92617
|
+
{
|
|
92618
|
+
exportName: "doctorDepCyclesCommand",
|
|
92619
|
+
name: "dep-cycles",
|
|
92620
|
+
description: "Report task dependency cycles already stored (edges written before the T12886 cycle ",
|
|
92621
|
+
load: async () => (await Promise.resolve().then(() => (init_doctor_dep_cycles(), doctor_dep_cycles_exports))).doctorDepCyclesCommand
|
|
92622
|
+
},
|
|
92478
92623
|
{
|
|
92479
92624
|
exportName: "doctorExodusResidueCommand",
|
|
92480
92625
|
name: "exodus-residue",
|
|
@@ -93823,7 +93968,7 @@ async function runStartupMaintenance() {
|
|
|
93823
93968
|
detectAndRemoveStrayProjectNexus,
|
|
93824
93969
|
getGlobalSalt,
|
|
93825
93970
|
getLogger: getLogger22,
|
|
93826
|
-
getProjectRoot:
|
|
93971
|
+
getProjectRoot: getProjectRoot75,
|
|
93827
93972
|
isCleanupMarkerSet,
|
|
93828
93973
|
isMissingProjectError,
|
|
93829
93974
|
migrateSignaldockToConduit,
|
|
@@ -93833,7 +93978,7 @@ async function runStartupMaintenance() {
|
|
|
93833
93978
|
} = await import("@cleocode/core/internal");
|
|
93834
93979
|
let projectRootForCleanup = "";
|
|
93835
93980
|
try {
|
|
93836
|
-
projectRootForCleanup =
|
|
93981
|
+
projectRootForCleanup = getProjectRoot75();
|
|
93837
93982
|
} catch {
|
|
93838
93983
|
}
|
|
93839
93984
|
if (!isCleanupMarkerSet(CLI_VERSION, projectRootForCleanup)) {
|
|
@@ -93853,7 +93998,7 @@ async function runStartupMaintenance() {
|
|
|
93853
93998
|
const isInitInvocation = process.argv.slice(2).some((a) => a === "init");
|
|
93854
93999
|
if (!isInitInvocation) {
|
|
93855
94000
|
try {
|
|
93856
|
-
const _projectRootForMigration =
|
|
94001
|
+
const _projectRootForMigration = getProjectRoot75();
|
|
93857
94002
|
if (needsSignaldockToConduitMigration(_projectRootForMigration)) {
|
|
93858
94003
|
const migrationResult = await migrateSignaldockToConduit(_projectRootForMigration);
|
|
93859
94004
|
if (migrationResult.status === "failed") {
|