@cleocode/core 2026.9.10 → 2026.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/export-document.js +50 -11
- package/dist/docs/export-document.js.map +1 -1
- package/dist/llm/plugin-facade.js +50 -11
- package/dist/llm/plugin-facade.js.map +2 -2
- package/dist/paths.d.ts +8 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +57 -4
- package/dist/paths.js.map +1 -1
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +13 -1
- package/dist/release/open.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +50 -11
- package/dist/selfimprove/fix-gen.js.map +2 -2
- package/dist/shutdown-deadline.d.ts +3 -1
- package/dist/shutdown-deadline.d.ts.map +1 -1
- package/dist/shutdown-deadline.js +11 -1
- package/dist/shutdown-deadline.js.map +1 -1
- package/dist/shutdown.d.ts.map +1 -1
- package/dist/shutdown.js +10 -3
- package/dist/shutdown.js.map +1 -1
- package/dist/store/background-ops.d.ts +51 -5
- package/dist/store/background-ops.d.ts.map +1 -1
- package/dist/store/background-ops.js +72 -6
- package/dist/store/background-ops.js.map +1 -1
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
- package/dist/store/schema/cleo-project/runtime.d.ts +2 -2
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +1 -1
- package/dist/store/schema/cleo-shared/brain.d.ts +2 -2
- package/dist/store/schema/lifecycle.d.ts +2 -2
- package/dist/store/schema/memory-schema.d.ts +2 -2
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/tasks.d.ts +1 -1
- package/dist/store/validation-schemas.d.ts +12 -12
- package/package.json +13 -13
- package/templates/workflows/release-prepare.yml.tmpl +48 -2
|
@@ -18297,6 +18297,9 @@ var init_project_scope = __esm({
|
|
|
18297
18297
|
});
|
|
18298
18298
|
|
|
18299
18299
|
// packages/core/src/teardown-signal.ts
|
|
18300
|
+
function isShuttingDown() {
|
|
18301
|
+
return _shuttingDown;
|
|
18302
|
+
}
|
|
18300
18303
|
function registerTeardownAbort(controller) {
|
|
18301
18304
|
if (_shuttingDown) {
|
|
18302
18305
|
try {
|
|
@@ -18322,6 +18325,9 @@ var init_teardown_signal = __esm({
|
|
|
18322
18325
|
// packages/core/src/store/background-ops.ts
|
|
18323
18326
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
18324
18327
|
import { isAbsolute } from "node:path";
|
|
18328
|
+
function recordProducerOutcome(disposition) {
|
|
18329
|
+
producerLedger[disposition] += 1;
|
|
18330
|
+
}
|
|
18325
18331
|
async function withBackgroundOpCommitBoundary(native, commit, execution, schedule) {
|
|
18326
18332
|
const inherited = backgroundCommitBoundary.getStore();
|
|
18327
18333
|
const parent = inherited?.active && inherited.native === native ? inherited : void 0;
|
|
@@ -18356,8 +18362,14 @@ function trackBackgroundOp(op, execution) {
|
|
|
18356
18362
|
void tracked.then(() => inFlight.delete(tracked));
|
|
18357
18363
|
const settle = (work) => {
|
|
18358
18364
|
void work.then(
|
|
18359
|
-
() =>
|
|
18360
|
-
|
|
18365
|
+
() => {
|
|
18366
|
+
recordProducerOutcome("fulfilled");
|
|
18367
|
+
completion.resolve({ status: "fulfilled", value: void 0 });
|
|
18368
|
+
},
|
|
18369
|
+
(reason) => {
|
|
18370
|
+
recordProducerOutcome(isExpectedTeardownRejection(reason) ? "cancelled" : "failed");
|
|
18371
|
+
completion.resolve({ status: "rejected", reason });
|
|
18372
|
+
}
|
|
18361
18373
|
);
|
|
18362
18374
|
};
|
|
18363
18375
|
if (typeof op !== "function") {
|
|
@@ -18389,6 +18401,7 @@ function trackBackgroundOp(op, execution) {
|
|
|
18389
18401
|
discard(error) {
|
|
18390
18402
|
if (started) return;
|
|
18391
18403
|
started = true;
|
|
18404
|
+
recordProducerOutcome("discarded");
|
|
18392
18405
|
completion.resolve({ status: "rejected", reason: error });
|
|
18393
18406
|
}
|
|
18394
18407
|
};
|
|
@@ -18404,6 +18417,9 @@ function trackBackgroundOp(op, execution) {
|
|
|
18404
18417
|
else operation.start();
|
|
18405
18418
|
return tracked;
|
|
18406
18419
|
}
|
|
18420
|
+
function isExpectedTeardownRejection(reason) {
|
|
18421
|
+
return reason instanceof OperationExecutionError && (reason.code === "E_OPERATION_CANCELLED" || reason.code === "E_OPERATION_CLOSED" || reason.code === "E_OPERATION_DEADLINE");
|
|
18422
|
+
}
|
|
18407
18423
|
function createOperationExecutionContext(identity, options = {}) {
|
|
18408
18424
|
for (const key of ["projectId", "projectRoot", "actor", "operation", "idempotencyKey"]) {
|
|
18409
18425
|
const value = identity[key];
|
|
@@ -18543,12 +18559,18 @@ function observeOperation(context, work) {
|
|
|
18543
18559
|
if (context.signal.aborted) abort();
|
|
18544
18560
|
});
|
|
18545
18561
|
}
|
|
18546
|
-
var inFlight, backgroundCommitBoundary, OperationExecutionError;
|
|
18562
|
+
var inFlight, producerLedger, backgroundCommitBoundary, OperationExecutionError;
|
|
18547
18563
|
var init_background_ops = __esm({
|
|
18548
18564
|
"packages/core/src/store/background-ops.ts"() {
|
|
18549
18565
|
"use strict";
|
|
18550
18566
|
init_teardown_signal();
|
|
18551
18567
|
inFlight = /* @__PURE__ */ new Set();
|
|
18568
|
+
producerLedger = {
|
|
18569
|
+
fulfilled: 0,
|
|
18570
|
+
failed: 0,
|
|
18571
|
+
cancelled: 0,
|
|
18572
|
+
discarded: 0
|
|
18573
|
+
};
|
|
18552
18574
|
backgroundCommitBoundary = new AsyncLocalStorage2();
|
|
18553
18575
|
OperationExecutionError = class extends Error {
|
|
18554
18576
|
/** Machine-readable reason that a new stage was refused. */
|
|
@@ -32173,13 +32195,7 @@ function getCleoDirAbsolute(cwd, opts) {
|
|
|
32173
32195
|
const project = _pathsResolveProjectByCwd(cwd);
|
|
32174
32196
|
if (project !== null) {
|
|
32175
32197
|
if (process.env["CLEO_DISABLE_PROJECT_AUTOREGISTER"] !== "1") {
|
|
32176
|
-
|
|
32177
|
-
project.projectRoot,
|
|
32178
|
-
project.legacyUUID ?? project.projectId
|
|
32179
|
-
).catch((error) => {
|
|
32180
|
-
process.stderr.write(`[cleo] Project encounter registration failed: ${error.message}
|
|
32181
|
-
`);
|
|
32182
|
-
});
|
|
32198
|
+
scheduleProjectEncounter(project.projectRoot, project.legacyUUID ?? project.projectId);
|
|
32183
32199
|
}
|
|
32184
32200
|
try {
|
|
32185
32201
|
const projectRoot = getProjectRoot(cwd);
|
|
@@ -32353,6 +32369,26 @@ function _readProjectNameFromInfo(projectRoot) {
|
|
|
32353
32369
|
const data = JSON.parse(raw);
|
|
32354
32370
|
return typeof data.name === "string" && data.name.length > 0 ? data.name : void 0;
|
|
32355
32371
|
}
|
|
32372
|
+
function scheduleProjectEncounter(projectRoot, infoProjectId) {
|
|
32373
|
+
if (isShuttingDown()) return;
|
|
32374
|
+
const key = `${getCleoHome()}\0${infoProjectId}\0${projectRoot}`;
|
|
32375
|
+
const previous = _encountersScheduled.get(key);
|
|
32376
|
+
const now = Date.now();
|
|
32377
|
+
if (previous !== void 0 && now - previous < PROJECT_ENCOUNTER_REFRESH_MS) return;
|
|
32378
|
+
_encountersScheduled.set(key, now);
|
|
32379
|
+
registerProjectOnEncounter(projectRoot, infoProjectId).catch((error) => {
|
|
32380
|
+
if (isExpectedTeardownRejection(error)) {
|
|
32381
|
+
if (process.env["CLEO_DEBUG"])
|
|
32382
|
+
process.stderr.write(
|
|
32383
|
+
`[cleo][debug] Project encounter abandoned by teardown: ${error.message}
|
|
32384
|
+
`
|
|
32385
|
+
);
|
|
32386
|
+
return;
|
|
32387
|
+
}
|
|
32388
|
+
process.stderr.write(`[cleo] Project encounter registration failed: ${error.message}
|
|
32389
|
+
`);
|
|
32390
|
+
});
|
|
32391
|
+
}
|
|
32356
32392
|
async function registerProjectOnEncounter(projectRoot, infoProjectId) {
|
|
32357
32393
|
const scope = captureProjectScope(projectRoot, worktreeScope.getStore());
|
|
32358
32394
|
const capturedHome = getCleoHome();
|
|
@@ -32458,7 +32494,7 @@ async function registerProjectOnEncounter(projectRoot, infoProjectId) {
|
|
|
32458
32494
|
if (ownedExecution) execution.close();
|
|
32459
32495
|
}
|
|
32460
32496
|
}
|
|
32461
|
-
var _getCleoDirAbsoluteDeprecatedWarned;
|
|
32497
|
+
var _getCleoDirAbsoluteDeprecatedWarned, PROJECT_ENCOUNTER_REFRESH_MS, _encountersScheduled;
|
|
32462
32498
|
var init_paths = __esm({
|
|
32463
32499
|
"packages/core/src/paths.ts"() {
|
|
32464
32500
|
"use strict";
|
|
@@ -32468,7 +32504,10 @@ var init_paths = __esm({
|
|
|
32468
32504
|
init_project_scope();
|
|
32469
32505
|
init_background_ops();
|
|
32470
32506
|
init_platform_paths();
|
|
32507
|
+
init_teardown_signal();
|
|
32471
32508
|
_getCleoDirAbsoluteDeprecatedWarned = false;
|
|
32509
|
+
PROJECT_ENCOUNTER_REFRESH_MS = 5 * 6e4;
|
|
32510
|
+
_encountersScheduled = /* @__PURE__ */ new Map();
|
|
32472
32511
|
}
|
|
32473
32512
|
});
|
|
32474
32513
|
|