@outerlayer/cli 0.15.0 → 0.16.1

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{agent-setup-CN2HUBEJ.js → agent-setup-K3ABU5NL.js} +8 -7
  3. package/dist/build-info.json +1 -1
  4. package/dist/{check-2JSSXCKJ.js → check-CNTMSGOG.js} +19 -16
  5. package/dist/{chunk-HFKKFTXU.js → chunk-2MNPHL23.js} +19 -11
  6. package/dist/{chunk-FOJGZYFC.js → chunk-42ZI52JW.js} +1 -1
  7. package/dist/{chunk-SXWS25JC.js → chunk-5FEK6PNE.js} +6 -6
  8. package/dist/{chunk-PQUM37BK.js → chunk-6JNURGOA.js} +1 -1
  9. package/dist/{chunk-JR6ERP3M.js → chunk-6QRMLNH3.js} +1 -1
  10. package/dist/chunk-C5Y5ZJJZ.js +88 -0
  11. package/dist/{chunk-HXLMZOKU.js → chunk-CA3XMYFN.js} +3 -3
  12. package/dist/{chunk-NXUH742G.js → chunk-EHAAPRWY.js} +9 -7
  13. package/dist/{chunk-UUDDPNRJ.js → chunk-EWORLJMO.js} +19 -5
  14. package/dist/{chunk-F7GBYX2P.js → chunk-FWX735W7.js} +18 -4
  15. package/dist/{chunk-3NLOVYJQ.js → chunk-JEHRUE3F.js} +47 -22
  16. package/dist/{chunk-MTF3PHVZ.js → chunk-NBGDBTO2.js} +3 -3
  17. package/dist/{chunk-2M63GG56.js → chunk-OHVJA253.js} +1 -1
  18. package/dist/{chunk-KFRM23WD.js → chunk-ONRCEE6D.js} +2 -2
  19. package/dist/{chunk-T5VPP6H7.js → chunk-OZGHL5Y5.js} +1 -1
  20. package/dist/{chunk-ZA5CHAFY.js → chunk-POJMEEJJ.js} +21 -4
  21. package/dist/{chunk-ASOSIKA4.js → chunk-R4ZQQ7U2.js} +28 -6
  22. package/dist/{chunk-Z3NOIFDR.js → chunk-RSPXEVDX.js} +1 -1
  23. package/dist/{chunk-MSASO5O4.js → chunk-U3HXXRTY.js} +1 -1
  24. package/dist/{chunk-QLTYTPYU.js → chunk-W3EKCZSQ.js} +12 -5
  25. package/dist/{chunk-LCEXHCHD.js → chunk-WTE3MQML.js} +1 -1
  26. package/dist/{cli-RGGXQTWI.js → cli-AEWH62UE.js} +61 -58
  27. package/dist/{command-ETUAEXP2.js → command-HHPBR6CS.js} +8 -7
  28. package/dist/{context-adopt-PJUMW2EZ.js → context-adopt-VMMGFRUZ.js} +5 -4
  29. package/dist/{context-materialize-FDHYKNDT.js → context-materialize-2WXTS4CW.js} +5 -4
  30. package/dist/{doctor-CORFPYY6.js → doctor-N6Y7HKK3.js} +11 -10
  31. package/dist/{emit-artifact-cmd-FOGNJXVR.js → emit-artifact-cmd-H5MH3AOP.js} +2 -2
  32. package/dist/{emit-cmd-ZEYWLC2C.js → emit-cmd-IJ3GVRFD.js} +4 -3
  33. package/dist/{emit-finding-cmd-DLI4MKMN.js → emit-finding-cmd-ZXDRL6PG.js} +158 -45
  34. package/dist/{emit-result-cmd-MUSL7GQA.js → emit-result-cmd-RFKALS5Z.js} +2 -2
  35. package/dist/{hook-fast-WYQD6D7T.js → hook-fast-D7HV4IXG.js} +1 -1
  36. package/dist/{import-capture-cmd-6QVCOIHK.js → import-capture-cmd-EQ35EARA.js} +3 -3
  37. package/dist/{import-ruler-cmd-KLRGRBCP.js → import-ruler-cmd-BGAZXCQM.js} +1 -1
  38. package/dist/index.js +3 -3
  39. package/dist/{init-MIC37V6J.js → init-FBCA4DRA.js} +10 -9
  40. package/dist/{init-OPB7HHXO.js → init-MYX7YMIH.js} +10 -9
  41. package/dist/{init-cmd-JR3RKNFB.js → init-cmd-CAG572UE.js} +9 -8
  42. package/dist/{init-update-O5YYFGF4.js → init-update-VDFF4K3B.js} +9 -8
  43. package/dist/{loop-QNSM5GXS.js → loop-75J4YXLZ.js} +16 -15
  44. package/dist/{machine-IT6GG7FF.js → machine-A6ZCTUGS.js} +8 -7
  45. package/dist/{runner-env-XTC53CHN.js → runner-env-EN7YE7QX.js} +1 -1
  46. package/dist/{runner-key-7SSNMUBQ.js → runner-key-W25ISHI3.js} +10 -9
  47. package/dist/{session-sender-4M247XSV.js → session-sender-24L5EW25.js} +3 -3
  48. package/dist/{starter-pack-IB4UUIX3.js → starter-pack-KF66HGZR.js} +3 -3
  49. package/dist/{status-7ZX57OFJ.js → status-XHSGEYO5.js} +11 -10
  50. package/dist/{sync-cmd-UWD5JOFU.js → sync-cmd-5G5EIEHD.js} +2 -2
  51. package/dist/{watch-DBNB7R6X.js → watch-UTOXO4SE.js} +2 -2
  52. package/dist/{work-claim-cmd-A6IS6CQ7.js → work-claim-cmd-RKHYFE5Y.js} +3 -3
  53. package/dist/{work-cmd-EQSW5DTD.js → work-cmd-DJQJEZVB.js} +1 -1
  54. package/dist/{work-comment-cmd-7VLKI7FN.js → work-comment-cmd-A55CUSYE.js} +1 -1
  55. package/dist/{work-open-pr-cmd-JEVD4HMQ.js → work-open-pr-cmd-E6O53IJD.js} +1 -1
  56. package/package.json +1 -1
  57. package/skill-pack/maintained/{amend → outerlayer-amend}/SKILL.md +2 -2
  58. package/skill-pack/maintained/{outerlayer → outerlayer-cli}/SKILL.md +3 -3
  59. package/skill-pack/maintained/{emitting-evidence → outerlayer-evidence}/SKILL.md +1 -1
  60. package/skill-pack/maintained/{reporting-findings → outerlayer-findings}/SKILL.md +24 -30
  61. package/skill-pack/shipped.json +10 -1
  62. package/skill-pack/template/build/SKILL.md +5 -1
  63. package/skill-pack/template/build/references/agent-briefs.md +7 -1
  64. package/skill-pack/template/build/references/evidence.md +1 -1
  65. package/skill-pack/template/build/references/release.md +1 -1
  66. package/skill-pack/template/build/references/review-briefs.md +6 -0
  67. package/skill-pack/template/writing-specs/SKILL.md +1 -1
  68. /package/skill-pack/maintained/{outerlayer → outerlayer-cli}/references/open-pull-request.md +0 -0
  69. /package/skill-pack/maintained/{emitting-evidence → outerlayer-evidence}/references/agents-snippet.md +0 -0
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readPin, pinExists, readBuildHold, readContextManifest, manifestFilesPresent, writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, SOURCE_CACHE_TTL_SUCCESS_MS, isLastCheckFresh, readDegraded, touchLastCheck, clearDegraded, writeContextManifest, writePinIfChanged, readSourceCache, isSourceCacheFresh } from './chunk-LCEXHCHD.js';
3
+ import { readPin, pinExists, readBuildHold, readContextManifest, manifestFilesPresent, writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, SOURCE_CACHE_TTL_SUCCESS_MS, isLastCheckFresh, readDegraded, touchLastCheck, clearDegraded, writeContextManifest, writePinIfChanged, readSourceCache, isSourceCacheFresh } from './chunk-WTE3MQML.js';
4
+ import { removeRetiredSkills } from './chunk-C5Y5ZJJZ.js';
4
5
  import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
5
6
  import { defaultFetch } from './chunk-YO4PSLVB.js';
6
7
  import { withTokenHeader } from './chunk-BYT5O5RV.js';
7
- import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-ZA5CHAFY.js';
8
- import { normalizeRepoName, parseGoverns, CONTEXT_SOURCE_CONFIG_PATH, parseOuterlayerConfig, classifyTree, emitTree } from './chunk-2M63GG56.js';
8
+ import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-POJMEEJJ.js';
9
+ import { normalizeRepoName, parseGoverns, CONTEXT_SOURCE_CONFIG_PATH, parseOuterlayerConfig, classifyTree, emitTree } from './chunk-OHVJA253.js';
9
10
  import { resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
10
11
  import { ensureContextExcludes, ensurePreCommitGuardHook } from './chunk-XCCLFVXM.js';
11
12
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -187,7 +188,7 @@ async function materializeContext(deps) {
187
188
  if (ownRepoName === void 0) {
188
189
  return selfOutcome();
189
190
  }
190
- const designation = await resolveDesignation({ git, fetchImpl, home, cloud: deps.cloud, now, gitCommonDir, ownRepoName, repoRoot });
191
+ const designation = await resolveDesignation({ git, fetchImpl, home, cloud: deps.cloud, now, gitCommonDir, ownRepoName, repoRoot, lookup: deps.designationLookup ?? { timeoutMs: 2e3, attempts: 1 } });
191
192
  const answered = { designation: "answered" };
192
193
  if (designation.status === "self") {
193
194
  return { ...selfOutcome(), ...answered };
@@ -203,7 +204,7 @@ async function materializeContext(deps) {
203
204
  writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "designation-unverified", message });
204
205
  }
205
206
  writeSourceCache(gitCommonDir, { checkedAt: new Date(now()).toISOString(), status: "self", ttlMs: SOURCE_CACHE_TTL_RETRY_MS });
206
- return { status: "self", sha: null, verification: "none", designation: "unknown", ...designation.authRejected ? { authRejected: true } : {} };
207
+ return { status: "self", sha: null, verification: "none", designation: "unknown", ...designation.authRejected ? { authRejected: true } : {}, lookupFailure: designation.lookupFailure };
207
208
  }
208
209
  let repository;
209
210
  let ref;
@@ -409,13 +410,15 @@ async function materializeContext(deps) {
409
410
  return partialWrite();
410
411
  }
411
412
  let overlayPaths = [];
413
+ let retiredPaths = /* @__PURE__ */ new Set();
412
414
  let overlayFailed = false;
413
415
  try {
416
+ retiredPaths = new Set(removeRetiredSkills(repoRoot, (rel) => hasSymlinkComponent(repoRoot, rel)));
414
417
  overlayPaths = overlayMaintainedSkills(repoRoot, (rel) => hasSymlinkComponent(repoRoot, rel));
415
418
  } catch {
416
419
  overlayFailed = true;
417
420
  }
418
- const writtenPaths = [.../* @__PURE__ */ new Set([...writeResult.writtenPaths, ...overlayPaths])];
421
+ const writtenPaths = [.../* @__PURE__ */ new Set([...writeResult.writtenPaths, ...overlayPaths])].filter((path) => !retiredPaths.has(path));
419
422
  const deleteResult = manifest ? deleteRemovedFiles(repoRoot, manifest.files, writtenPaths) : { skipped: [] };
420
423
  if (overlayFailed && deleteResult.skipped.length === 0) {
421
424
  writeContextManifest(gitCommonDir, { schemaVersion: 1, sha, files: writtenPaths, materializedAt: new Date(now()).toISOString() });
@@ -458,14 +461,18 @@ async function materializeContext(deps) {
458
461
  }
459
462
  function recordMaintainedOverlay(repoRoot, gitCommonDir, manifest) {
460
463
  let overlayPaths;
464
+ let retired;
461
465
  try {
466
+ retired = new Set(removeRetiredSkills(repoRoot, (rel) => hasSymlinkComponent(repoRoot, rel)));
462
467
  overlayPaths = overlayMaintainedSkills(repoRoot, (rel) => hasSymlinkComponent(repoRoot, rel));
463
468
  } catch {
464
469
  return;
465
470
  }
466
471
  const known = new Set(manifest.files);
467
472
  const added = overlayPaths.filter((path) => !known.has(path));
468
- if (added.length > 0) writeContextManifest(gitCommonDir, { ...manifest, files: [...manifest.files, ...added] });
473
+ if (added.length > 0 || retired.size > 0) {
474
+ writeContextManifest(gitCommonDir, { ...manifest, files: [...manifest.files.filter((path) => !retired.has(path)), ...added] });
475
+ }
469
476
  }
470
477
  async function resolveDesignation(ctx) {
471
478
  const cache = readSourceCache(ctx.gitCommonDir);
@@ -473,6 +480,7 @@ async function resolveDesignation(ctx) {
473
480
  return cache.status === "governed" && cache.repository && cache.ref ? { status: "governed", repository: cache.repository, ref: cache.ref } : { status: "self" };
474
481
  }
475
482
  let authRejected;
483
+ let lookupFailure;
476
484
  const destination = resolveGatewayCredentials({
477
485
  home: ctx.home,
478
486
  env: {},
@@ -480,15 +488,16 @@ async function resolveDesignation(ctx) {
480
488
  ...ctx.cloud === void 0 ? {} : { url: ctx.cloud.url, apiKey: ctx.cloud.apiKey, appId: ctx.cloud.appId }
481
489
  });
482
490
  if (destination.ok) {
483
- const sources = await fetchContextSource(
491
+ const lookup = await fetchContextSource(
484
492
  { url: destination.url, apiKey: destination.credential, appId: destination.appId },
485
493
  ctx.ownRepoName,
486
494
  ctx.fetchImpl,
487
- () => {
488
- authRejected = designationAuthRejectedMessage(destination.credential);
489
- }
495
+ ctx.lookup
490
496
  );
491
- if (sources !== void 0) {
497
+ if (lookup.kind === "rejected") authRejected = designationAuthRejectedMessage(destination.credential);
498
+ if (lookup.kind === "failed") lookupFailure = lookup.failure;
499
+ if (lookup.kind === "answered") {
500
+ const sources = lookup.sources;
492
501
  if (sources.length === 0) {
493
502
  writeSourceCache(ctx.gitCommonDir, {
494
503
  checkedAt: new Date(ctx.now()).toISOString(),
@@ -503,26 +512,42 @@ async function resolveDesignation(ctx) {
503
512
  if (cache) {
504
513
  return cache.status === "governed" && cache.repository && cache.ref ? { status: "governed", repository: cache.repository, ref: cache.ref, unverifiedIdentity: true } : { status: "self" };
505
514
  }
506
- return { status: "unknown", authRejected };
515
+ return { status: "unknown", authRejected, lookupFailure };
516
+ }
517
+ async function fetchContextSource(config, ownRepoName, fetchImpl, lookup) {
518
+ const url = `${config.url.replace(/\/$/, "")}/v1/context/source?repo=${encodeURIComponent(ownRepoName)}`;
519
+ for (let attempt = 1; ; attempt++) {
520
+ const outcome = await askContextSource(url, config, fetchImpl, lookup.timeoutMs);
521
+ if (outcome.kind !== "failed" || !isRetryable(outcome.failure) || attempt >= lookup.attempts) return outcome;
522
+ }
523
+ }
524
+ function isRetryable(failure) {
525
+ return failure.kind !== "status" || failure.status >= 500;
507
526
  }
508
- async function fetchContextSource(config, ownRepoName, fetchImpl, onAuthRejected) {
527
+ async function askContextSource(url, config, fetchImpl, timeoutMs) {
509
528
  const controller = new AbortController();
510
- const timer = setTimeout(() => controller.abort(), 2e3);
529
+ let timedOut = false;
530
+ const timer = setTimeout(() => {
531
+ timedOut = true;
532
+ controller.abort();
533
+ }, timeoutMs);
511
534
  try {
512
- const url = `${config.url.replace(/\/$/, "")}/v1/context/source?repo=${encodeURIComponent(ownRepoName)}`;
513
535
  const res = await fetchImpl(url, {
514
536
  headers: { Authorization: `Bearer ${config.apiKey}`, "x-outerlayer-app-id": config.appId },
515
537
  signal: controller.signal
516
538
  });
517
539
  if (res.status === 401 || res.status === 403) {
518
- onAuthRejected();
519
- return void 0;
540
+ return { kind: "rejected" };
520
541
  }
521
- if (!res.ok) return void 0;
542
+ if (!res.ok) return { kind: "failed", failure: { kind: "status", status: res.status } };
522
543
  const body = await res.json();
523
- return body.data?.sources;
524
- } catch {
525
- return void 0;
544
+ if (body.data?.sources === void 0) return { kind: "failed", failure: { kind: "network", message: "the answer named no sources" } };
545
+ return { kind: "answered", sources: body.data.sources };
546
+ } catch (err) {
547
+ return {
548
+ kind: "failed",
549
+ failure: timedOut ? { kind: "timeout", timeoutMs } : { kind: "network", message: err instanceof Error ? err.message : String(err) }
550
+ };
526
551
  } finally {
527
552
  clearTimeout(timer);
528
553
  }
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-XCK2YAY5.js';
4
- import { POLICY_CONTENT, VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH } from './chunk-FOJGZYFC.js';
5
- import { pinExists, readContextManifest } from './chunk-LCEXHCHD.js';
6
- import { resolvePackRoot, loadTemplateFiles, skillDir } from './chunk-ZA5CHAFY.js';
4
+ import { POLICY_CONTENT, VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH } from './chunk-42ZI52JW.js';
5
+ import { pinExists, readContextManifest } from './chunk-WTE3MQML.js';
6
+ import { resolvePackRoot, loadTemplateFiles, skillDir } from './chunk-POJMEEJJ.js';
7
7
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
8
8
  import { createHash } from 'crypto';
9
9
  import { existsSync, readFileSync } from 'fs';
@@ -8685,4 +8685,4 @@ function sessionsToTimeline(sessions) {
8685
8685
  return out;
8686
8686
  }
8687
8687
 
8688
- export { CONTEXT_PIN_FILENAME, CONTEXT_PIN_SCHEMA_VERSION, CONTEXT_SOURCE_CONFIG_PATH, classifyTree, emitTree, extractFacts, generatedHeaderSource, normalizePath, normalizeRepoName, orderSessions, parseGoverns, parseOuterlayerConfig, parsePolicy, sessionsToTimeline, splitRawFile };
8688
+ export { ALL_TARGET_IDS, CONTEXT_PIN_FILENAME, CONTEXT_PIN_SCHEMA_VERSION, CONTEXT_SOURCE_CONFIG_PATH, classifyTree, emitTree, extractFacts, generatedHeaderSource, normalizePath, normalizeRepoName, orderSessions, parseGoverns, parseOuterlayerConfig, parsePolicy, sessionsToTimeline, splitRawFile };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { LiveUploader } from './chunk-MSASO5O4.js';
3
+ import { LiveUploader } from './chunk-U3HXXRTY.js';
4
4
  import { CaptureDaemon } from './chunk-JXYVA45C.js';
5
5
  import { parseWorkItemEnv } from './chunk-GQD22KKN.js';
6
- import { spoolDir } from './chunk-PQUM37BK.js';
6
+ import { spoolDir } from './chunk-6JNURGOA.js';
7
7
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
8
  import { mkdirSync, writeFileSync, rmSync } from 'fs';
9
9
  import { join } from 'path';
@@ -10,7 +10,7 @@ createRequire(import.meta.url);
10
10
  var AGENT_COMMANDS = {
11
11
  claude: {
12
12
  implement: 'claude -p "/build" --permission-mode bypassPermissions',
13
- amend: 'claude -p "/amend" --permission-mode bypassPermissions'
13
+ amend: 'claude -p "/outerlayer-amend" --permission-mode bypassPermissions'
14
14
  }
15
15
  };
16
16
  function isAgentName(name) {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { splitRawFile } from './chunk-2M63GG56.js';
3
+ import { splitRawFile } from './chunk-OHVJA253.js';
4
4
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
5
5
  import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'fs';
6
6
  import { join, dirname } from 'path';
@@ -8,7 +8,7 @@ import { fileURLToPath } from 'url';
8
8
 
9
9
  createRequire(import.meta.url);
10
10
  var TEMPLATE_SKILLS = ["spec", "writing-specs", "writing-tests", "build"];
11
- var MAINTAINED_SKILLS = ["emitting-evidence", "amend", "reporting-findings", "outerlayer"];
11
+ var MAINTAINED_SKILLS = ["outerlayer-evidence", "outerlayer-amend", "outerlayer-findings", "outerlayer-cli"];
12
12
  var TEMPLATE_CLASS_LINE = "<!-- yours to edit. Copied once from the default template by outerlayer init; never overwritten. -->";
13
13
  function maintainedClassLine(version) {
14
14
  return `<!-- maintained by OuterLayer ${version}. Edits are overwritten on the next outerlayer context emit. -->`;
@@ -77,7 +77,24 @@ function writeMaintainedFiles(repoRoot, files) {
77
77
  return { created, rewritten };
78
78
  }
79
79
  function maintainedFilesForExistingSkills(repoRoot, files) {
80
- return files.filter((file) => existsSync(join(repoRoot, skillDir(file.skill))));
80
+ return files.filter((file) => existsSync(join(repoRoot, skillDir(file.skill))) || formerNameExists(repoRoot, file.skill));
81
+ }
82
+ var FORMER_MAINTAINED_NAMES = {
83
+ amend: "outerlayer-amend",
84
+ "emitting-evidence": "outerlayer-evidence",
85
+ "reporting-findings": "outerlayer-findings",
86
+ outerlayer: "outerlayer-cli"
87
+ };
88
+ var MAINTAINED_LINE = /^<!-- maintained by OuterLayer \S+?\. /m;
89
+ function isMaintainedCopy(repoRoot, skill) {
90
+ try {
91
+ return MAINTAINED_LINE.test(readFileSync(join(repoRoot, skillDir(skill), "SKILL.md"), "utf8"));
92
+ } catch {
93
+ return false;
94
+ }
95
+ }
96
+ function formerNameExists(repoRoot, skill) {
97
+ return Object.entries(FORMER_MAINTAINED_NAMES).some(([former, current]) => current === skill && isMaintainedCopy(repoRoot, former));
81
98
  }
82
99
 
83
- export { MAINTAINED_SKILLS, TEMPLATE_SKILLS, loadMaintainedFiles, loadTemplateFiles, maintainedFilesForExistingSkills, resolvePackRoot, skillDir, writeMaintainedFiles };
100
+ export { FORMER_MAINTAINED_NAMES, MAINTAINED_SKILLS, TEMPLATE_SKILLS, isMaintainedCopy, loadMaintainedFiles, loadTemplateFiles, maintainedFilesForExistingSkills, resolvePackRoot, skillDir, writeMaintainedFiles };
@@ -2,13 +2,13 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { writeJobFile, readJobFile } from './chunk-RMWLBUCJ.js';
4
4
  import { DOCKERD_LOG } from './chunk-HYZRY4KZ.js';
5
- import { senderPidfile } from './chunk-KFRM23WD.js';
6
- import { installScrubContext } from './chunk-MSASO5O4.js';
7
- import { AssetError, describeCallFailure, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createBuildDisk, machineConfig, refusalCode, resolveAgentUser, AgentUserError, runBuildSteps, removeStagedContext, stageGovernedContext, shellQuote, createRunnerLog, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, formatDuration, retrySend, formatClock, containerSenderCommand, syncInContainer, copyTranscriptsFromContainer, GH_CONFIG_YML, ghHostsYml, ADDED_USER, isLiteralAddress, signalInContainer, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript } from './chunk-UUDDPNRJ.js';
5
+ import { senderPidfile } from './chunk-ONRCEE6D.js';
6
+ import { installScrubContext } from './chunk-U3HXXRTY.js';
7
+ import { AssetError, describeCallFailure, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createBuildDisk, machineConfig, refusalCode, resolveAgentUser, AgentUserError, runBuildSteps, removeStagedContext, stageGovernedContext, shellQuote, createRunnerLog, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, formatDuration, retrySend, formatClock, containerSenderCommand, syncInContainer, copyTranscriptsFromContainer, GH_CONFIG_YML, ghHostsYml, ADDED_USER, isLiteralAddress, signalInContainer, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript } from './chunk-EWORLJMO.js';
8
8
  import { childEnvironment } from './chunk-KMDLFI4P.js';
9
9
  import { waitForAgent, vmExecArgs } from './chunk-QKFB4K7X.js';
10
10
  import { socketPathProblem, vsockLinks, linkVsockSockets } from './chunk-RSNSZ2LJ.js';
11
- import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-JR6ERP3M.js';
11
+ import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-6QRMLNH3.js';
12
12
  import { isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-22RMZBGW.js';
13
13
  import { readBranchHead, diffBetween, fetchCommit } from './chunk-R7PF5OOU.js';
14
14
  import { isSameProcess, startTimeOf } from './chunk-N5FOE5PS.js';
@@ -18,7 +18,7 @@ import { CLAUDE_CODE_VERSION } from './chunk-CX22S5BA.js';
18
18
  import { planArtifactUpload } from './chunk-WUYTWNMA.js';
19
19
  import { scrubText } from './chunk-JXYVA45C.js';
20
20
  import { withHooksPath, authorEnvironment, commitIdentityRecord } from './chunk-BYT5O5RV.js';
21
- import { parsePolicy } from './chunk-2M63GG56.js';
21
+ import { parsePolicy } from './chunk-OHVJA253.js';
22
22
  import { readCloudConfig } from './chunk-EABW6AJQ.js';
23
23
  import { resolveVersion } from './chunk-RA3O54FC.js';
24
24
  import { signerFor } from './chunk-V7NIVOFD.js';
@@ -2062,6 +2062,8 @@ async function recoverLostJobs(jobsDirPath, config, deps) {
2062
2062
  // src/runner/sender.ts
2063
2063
  var STOP_WAIT_MS = 3e4;
2064
2064
  var POLL_MS = 200;
2065
+ var EXIT_REPORT_WAIT_MS = 2e3;
2066
+ var exitsLogged = /* @__PURE__ */ new Map();
2065
2067
  var BUILD_HOME = "/build/home";
2066
2068
  async function startSender(input) {
2067
2069
  const { config, job, jobDir, deps } = input;
@@ -2075,9 +2077,16 @@ async function startSender(input) {
2075
2077
  try {
2076
2078
  const child = spawnFn(launch.command, launch.args, { env: launch.env, cwd: launch.cwd, detached: true, stdio: ["ignore", fd, fd] });
2077
2079
  child.on("error", (err) => deps.log.error(`${tag} session sender failed: ${describeCallFailure(err)}`));
2078
- child.on("exit", (code, signal) => deps.log.line(`${tag} session sender exited \xB7 ${signal ?? `code ${code}`} \xB7 see sender.log`));
2080
+ const exitLogged = new Promise((resolve) => {
2081
+ child.on("exit", (code, signal) => {
2082
+ deps.log.line(`${tag} session sender exited \xB7 ${signal ?? `code ${code}`} \xB7 see sender.log`);
2083
+ if (pid !== void 0) exitsLogged.delete(pid);
2084
+ resolve();
2085
+ });
2086
+ });
2079
2087
  child.unref?.();
2080
2088
  pid = child.pid;
2089
+ if (pid !== void 0) exitsLogged.set(pid, exitLogged);
2081
2090
  } finally {
2082
2091
  closeSync(fd);
2083
2092
  }
@@ -2137,6 +2146,18 @@ async function signalInGuest(runtime, state, pidfile, signal) {
2137
2146
  env: { PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }
2138
2147
  });
2139
2148
  }
2149
+ async function exitReported(pid) {
2150
+ const logged = exitsLogged.get(pid);
2151
+ if (logged === void 0) return;
2152
+ let timer;
2153
+ const bound = new Promise((resolve) => {
2154
+ timer = setTimeout(resolve, EXIT_REPORT_WAIT_MS);
2155
+ timer.unref?.();
2156
+ });
2157
+ await Promise.race([logged, bound]);
2158
+ clearTimeout(timer);
2159
+ exitsLogged.delete(pid);
2160
+ }
2140
2161
  async function stopSender(input) {
2141
2162
  const { job, deps } = input;
2142
2163
  const sender = job.sender;
@@ -2159,6 +2180,7 @@ async function stopSender(input) {
2159
2180
  await signalInside("KILL");
2160
2181
  signalHost(sender, "SIGKILL");
2161
2182
  }
2183
+ await exitReported(sender.pid);
2162
2184
  } catch (err) {
2163
2185
  deps.log.error(`${tag} stopping the session sender failed: ${describeCallFailure(err)} \xB7 continuing`);
2164
2186
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { MIN_ENGINE_MAJOR } from './chunk-UUDDPNRJ.js';
3
+ import { MIN_ENGINE_MAJOR } from './chunk-EWORLJMO.js';
4
4
  import { firecrackerArch, MICROVM_ARCHES, guestAssetsPinned } from './chunk-CX22S5BA.js';
5
5
  import { spawnSync } from 'child_process';
6
6
  import { existsSync, accessSync, constants, statSync, readFileSync } from 'fs';
@@ -14,7 +14,7 @@ import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-PLMTLGYH
14
14
  import { CAPTURE_TIERS, inferArtifactKind, bannedPathsForTier, downconvertSession, isHumanUserTurn, turnCountBound, EVENT_TYPES } from './chunk-J5M7BSJQ.js';
15
15
  import { readCloudConfig, cloudConfigPath, writeCloudConfig } from './chunk-EABW6AJQ.js';
16
16
  import { signerFor, signRunnerRequest } from './chunk-V7NIVOFD.js';
17
- import { writeSyncStatus, spoolDir } from './chunk-PQUM37BK.js';
17
+ import { writeSyncStatus, spoolDir } from './chunk-6JNURGOA.js';
18
18
  import { removeJournalHooks } from './chunk-XCCLFVXM.js';
19
19
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
20
20
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -1,18 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { checkStarterFiles } from './chunk-MTF3PHVZ.js';
4
- import { resolveCredentials, getJson, WorkCommandError } from './chunk-JR6ERP3M.js';
3
+ import { checkStarterFiles, contextIsGoverned } from './chunk-NBGDBTO2.js';
4
+ import { resolveCredentials, getJson, WorkCommandError } from './chunk-6QRMLNH3.js';
5
5
  import { readStatuslineState, STATE_FRESH_MS } from './chunk-F47JBIAW.js';
6
6
  import { isLinkedRepository } from './chunk-YDSMROTB.js';
7
7
  import { sanitizeTerminal } from './chunk-WUYTWNMA.js';
8
8
  import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-JXYVA45C.js';
9
9
  import { C } from './chunk-YRYMNBGQ.js';
10
10
  import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-5QRP3MVS.js';
11
- import { readPin, readContextManifest, readDegraded, readSourceCache } from './chunk-LCEXHCHD.js';
11
+ import { readPin, readContextManifest, readDegraded, readSourceCache } from './chunk-WTE3MQML.js';
12
+ import { checkFormerSkillNames } from './chunk-C5Y5ZJJZ.js';
12
13
  import { defaultFetch } from './chunk-YO4PSLVB.js';
13
14
  import { resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
14
15
  import { readCloudConfig } from './chunk-EABW6AJQ.js';
15
- import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-PQUM37BK.js';
16
+ import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-6JNURGOA.js';
16
17
  import { deadHooksState, preparePackageManagerCommand, contextExcludesPresent } from './chunk-XCCLFVXM.js';
17
18
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
18
19
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -189,11 +190,17 @@ function runDoctor(env = {}) {
189
190
  ...laptop ? checkStatusline(home, now, env.cwd) : [],
190
191
  ...checkInstalls(env),
191
192
  ...starter?.checks ?? [],
193
+ ...laptop ? checkRenamedSkills(env.cwd) : [],
192
194
  ...starter !== void 0 && !starter.mcpOutdated ? checkMcpCommand(env.cwd, env.processEnv) : [],
193
195
  ...checkContextSource(home, env.cwd),
194
196
  ...checkInstalledCli(home, env.cwd ?? process.cwd())
195
197
  ];
196
198
  }
199
+ function checkRenamedSkills(cwd) {
200
+ const dirs = findGitDirs(cwd ?? process.cwd());
201
+ if (dirs === void 0 || contextIsGoverned(dirs.repoRoot, dirs.gitCommonDir)) return [];
202
+ return checkFormerSkillNames(dirs.repoRoot);
203
+ }
197
204
  function checkInstalledCli(home, cwd) {
198
205
  const name = "Installed CLI";
199
206
  const result = checkInstalledCliStaleness({ home, cwd });
@@ -1095,7 +1102,7 @@ async function gatherDoctorChecks() {
1095
1102
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1096
1103
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1097
1104
  } else if (hasRunnerBlock(configPath)) {
1098
- const { runnerHostChecks } = await import('./doctor-CORFPYY6.js');
1105
+ const { runnerHostChecks } = await import('./doctor-N6Y7HKK3.js');
1099
1106
  const hooks = (() => {
1100
1107
  try {
1101
1108
  return loadRunnerConfig(configPath).hooks;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { CONTEXT_PIN_SCHEMA_VERSION, CONTEXT_PIN_FILENAME } from './chunk-2M63GG56.js';
3
+ import { CONTEXT_PIN_SCHEMA_VERSION, CONTEXT_PIN_FILENAME } from './chunk-OHVJA253.js';
4
4
  import { readFileSync, existsSync, writeFileSync, mkdirSync, utimesSync, statSync, unlinkSync } from 'fs';
5
5
  import { join, dirname } from 'path';
6
6