@cleocode/caamp 2026.11.1-canary.6 → 2026.11.1-canary.8

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.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "schema": 2,
3
- "sourceHash": "d5311709e1d1e199f6de31d18a2876b56dba877f1fe6b648346be8d39af8b0fa"
3
+ "sourceHash": "7e1c07202385e618d29e5fc776de3932aaaa1895d01249f3f90e86b90561f957"
4
4
  }
@@ -12,7 +12,7 @@ import {
12
12
  reconcile,
13
13
  resolveGlobalInstructionPath,
14
14
  resolveInstructionDelivery
15
- } from "./chunk-2RZGY4XT.js";
15
+ } from "./chunk-SM53FT2Y.js";
16
16
  import {
17
17
  withFileLock
18
18
  } from "./chunk-D6CWC4BX.js";
@@ -4247,7 +4247,9 @@ async function syncGlobalInstructions(options = {}) {
4247
4247
  for (const [path, ids] of targets) {
4248
4248
  const entry = { path, providers: ids, action: "intact" };
4249
4249
  try {
4250
- if (await stripLegacyCleoBlock(path)) result.legacyStripped.push(path);
4250
+ if (options.keepLegacyBlocks !== true && await stripLegacyCleoBlock(path)) {
4251
+ result.legacyStripped.push(path);
4252
+ }
4251
4253
  entry.action = await inject(path, delivery.content);
4252
4254
  } catch (err) {
4253
4255
  entry.action = "failed";
@@ -4257,6 +4259,9 @@ async function syncGlobalInstructions(options = {}) {
4257
4259
  }
4258
4260
  return result;
4259
4261
  }
4262
+ function sha256(text) {
4263
+ return createHash("sha256").update(text).digest("hex");
4264
+ }
4260
4265
  async function snapshotSource(path) {
4261
4266
  try {
4262
4267
  const bytes = await readFile7(path);
@@ -4281,13 +4286,20 @@ async function checkGlobalInstructionStaleness(options = {}) {
4281
4286
  const sources = /* @__PURE__ */ new Map();
4282
4287
  const outsideByFile = /* @__PURE__ */ new Map();
4283
4288
  const files = [];
4289
+ const delivery = await resolveInstructionDelivery(
4290
+ options.hubReference ?? GLOBAL_INSTRUCTION_HUB_REFERENCE,
4291
+ options.baseDir ?? homedir4()
4292
+ );
4293
+ const expectedSha256 = delivery.findings.some((f) => f.kind !== "duplicate") ? null : sha256(delivery.content.trim());
4284
4294
  for (const [path, ids] of targets) {
4285
4295
  const status = {
4286
4296
  path,
4287
4297
  providers: ids,
4288
4298
  state: "current",
4289
4299
  staleSources: [],
4290
- duplicateLines: 0
4300
+ duplicateLines: 0,
4301
+ blockSha256: null,
4302
+ expectedSha256
4291
4303
  };
4292
4304
  files.push(status);
4293
4305
  let content;
@@ -4303,6 +4315,7 @@ async function checkGlobalInstructionStaleness(options = {}) {
4303
4315
  continue;
4304
4316
  }
4305
4317
  outsideByFile.set(path, content.replace(blockPattern(), ""));
4318
+ status.blockSha256 = sha256(blocks.map((block) => block.content).join("\n"));
4306
4319
  const stamps = blocks.flatMap((block) => [
4307
4320
  ...block.content.matchAll(new RegExp(CAAMP_SOURCE_STAMP_PATTERN_SOURCE, "gm"))
4308
4321
  ]);
@@ -4330,6 +4343,8 @@ async function checkGlobalInstructionStaleness(options = {}) {
4330
4343
  }
4331
4344
  }
4332
4345
  if (status.staleSources.length > 0) status.state = "stale";
4346
+ else if (expectedSha256 !== null && status.blockSha256 !== expectedSha256)
4347
+ status.state = "stale";
4333
4348
  }
4334
4349
  const managedLines = /* @__PURE__ */ new Set();
4335
4350
  for (const snapshot of sources.values()) {
@@ -5521,4 +5536,4 @@ export {
5521
5536
  recommendSkills2 as recommendSkills,
5522
5537
  validateSkill
5523
5538
  };
5524
- //# sourceMappingURL=chunk-I22NHDGG.js.map
5539
+ //# sourceMappingURL=chunk-273JW7EU.js.map