@pourkit/cli 0.0.0-next-20260620182746 → 0.0.0-next-20260620201514

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.js CHANGED
@@ -58,20 +58,20 @@ function createLogger(name, filePath) {
58
58
  );
59
59
  },
60
60
  async close() {
61
- await new Promise((resolve6) => {
61
+ await new Promise((resolve5) => {
62
62
  if (!fileStream) {
63
- resolve6();
63
+ resolve5();
64
64
  return;
65
65
  }
66
66
  const timer = setTimeout(() => {
67
67
  if (!fileStream.destroyed) {
68
68
  fileStream.destroy();
69
69
  }
70
- resolve6();
70
+ resolve5();
71
71
  }, 2e3);
72
72
  fileStream.end(() => {
73
73
  clearTimeout(timer);
74
- resolve6();
74
+ resolve5();
75
75
  });
76
76
  });
77
77
  }
@@ -266,7 +266,7 @@ async function execJson(command, args, options = {}) {
266
266
  return JSON.parse(result.stdout);
267
267
  }
268
268
  function sleep(ms) {
269
- return new Promise((resolve6) => setTimeout(resolve6, ms));
269
+ return new Promise((resolve5) => setTimeout(resolve5, ms));
270
270
  }
271
271
  async function execCaptureWithRetry(command, args, options = {}) {
272
272
  const retries = options.retries ?? 3;
@@ -1136,7 +1136,7 @@ async function cleanupRepository(options) {
1136
1136
  // commands/artifact-validation.ts
1137
1137
  import { execSync } from "child_process";
1138
1138
  import { existsSync as existsSync7, readFileSync as readFileSync7 } from "fs";
1139
- import { isAbsolute as isAbsolute3, resolve as resolve3 } from "path";
1139
+ import { isAbsolute as isAbsolute2, resolve as resolve2 } from "path";
1140
1140
 
1141
1141
  // pr/review-verdict.ts
1142
1142
  var ReviewVerdictProtocolError = class extends Error {
@@ -1252,7 +1252,7 @@ function prepareArtifactPath(artifactPath) {
1252
1252
 
1253
1253
  // shared/run-context.ts
1254
1254
  import { existsSync as existsSync4, readFileSync as readFileSync4, readdirSync } from "fs";
1255
- import { isAbsolute as isAbsolute2, join as join5, relative, resolve as resolve2 } from "path";
1255
+ import { join as join5, relative } from "path";
1256
1256
 
1257
1257
  // commands/run-verification.ts
1258
1258
  init_common();
@@ -1420,20 +1420,19 @@ function buildRunContextMarkdown(options) {
1420
1420
  } = options;
1421
1421
  const parts = ["# Pourkit Run Context", ""];
1422
1422
  if (sections.includes("issue")) {
1423
+ const issueBody = stripIssueSections(issue.body, [
1424
+ "Parent",
1425
+ "Plan Documents"
1426
+ ]);
1423
1427
  parts.push(
1424
- "## Issue",
1425
- "",
1426
- `- Number: #${issue.number}`,
1427
- `- Title: ${issue.title}`,
1428
+ `## Issue #${issue.number}: ${issue.title}`,
1428
1429
  "",
1429
- "### Body",
1430
- "",
1431
- issue.body.trim() || "(empty issue body)",
1430
+ issueBody.trim() || "(empty issue body)",
1432
1431
  ""
1433
1432
  );
1434
1433
  }
1435
1434
  if (sections.includes("prd")) {
1436
- parts.push(...renderPlanningContext(issue, parentPrdIssue, repoRoot2));
1435
+ parts.push(...renderParentPrdContext(issue, parentPrdIssue, repoRoot2));
1437
1436
  }
1438
1437
  if (sections.includes("comments")) {
1439
1438
  parts.push("## Comments", "");
@@ -1504,98 +1503,63 @@ function renderCommandList(target, heading) {
1504
1503
  }
1505
1504
  return parts;
1506
1505
  }
1507
- function renderPlanningContext(issue, parentPrdIssue, repoRoot2) {
1506
+ function renderParentPrdContext(issue, parentPrdIssue, repoRoot2) {
1508
1507
  const parent = extractIssueSection(issue.body, "Parent");
1509
- const documents = extractIssueSection(issue.body, "Plan Documents");
1510
- const parentRef = parent?.match(/\bPRD-\d+\b/i)?.[0]?.toUpperCase();
1508
+ const parentRef = parent?.match(/\bPRD-\d+\b/i)?.[0]?.toUpperCase() ?? issue.title.match(/^\s*(PRD-\d+)\s*\/\s*I-\d+\b/i)?.[1]?.toUpperCase();
1511
1509
  const parentPlanWorkspace = parentRef && repoRoot2 ? findParentPlanWorkspace(repoRoot2, parentRef) : null;
1512
1510
  const parentPrdPath = parentPlanWorkspace?.prdPath ?? null;
1513
- const discoveredPlanPath = parentPlanWorkspace?.planPath ?? null;
1514
- const documentPaths = repoRoot2 ? extractRepoPaths(documents) : [];
1515
- const planDocumentPaths = new Set(documentPaths);
1516
- if (discoveredPlanPath && repoRoot2) {
1517
- planDocumentPaths.add(relative(repoRoot2, discoveredPlanPath));
1518
- }
1519
- if (!parent && !documents && planDocumentPaths.size === 0) {
1511
+ if (!parent && !parentPrdPath && !parentPrdIssue && !parentRef) {
1520
1512
  return [];
1521
1513
  }
1522
- const parts = ["## Planning Context", ""];
1514
+ const parts = ["---", "", "## Parent PRD", ""];
1523
1515
  if (parent) {
1524
- parts.push("### Parent", "");
1525
- parts.push(parent, "");
1526
- } else {
1527
- parts.push("### Parent", "");
1528
- parts.push("(not declared in issue body)", "");
1516
+ parts.push(...parent.split("\n").map((line) => `- ${line}`));
1517
+ } else if (parentRef) {
1518
+ parts.push(`- Parent: ${parentRef}`);
1529
1519
  }
1530
1520
  if (parentPrdPath && repoRoot2) {
1531
1521
  parts.push(
1532
- `### Parent PRD Content: \`${relative(repoRoot2, parentPrdPath)}\``,
1522
+ `- Source: \`${relative(repoRoot2, parentPrdPath)}\``,
1533
1523
  "",
1534
- "```markdown",
1535
1524
  readFileSync4(parentPrdPath, "utf-8").trimEnd(),
1536
- "```",
1537
1525
  ""
1538
1526
  );
1539
1527
  } else if (parentPrdIssue) {
1540
1528
  parts.push(
1541
- `### Parent PRD Content: #${parentPrdIssue.number} ${parentPrdIssue.title}`,
1529
+ `- Source: #${parentPrdIssue.number} ${parentPrdIssue.title}`,
1542
1530
  "",
1543
- "```markdown",
1544
1531
  parentPrdIssue.body.trimEnd() || "(empty PRD body)",
1545
- "```",
1546
- ""
1547
- );
1548
- }
1549
- parts.push("### Plan Documents", "");
1550
- if (documents) {
1551
- parts.push(documents, "");
1552
- } else if (planDocumentPaths.size > 0) {
1553
- parts.push(
1554
- ...Array.from(planDocumentPaths).map(
1555
- (documentPath) => `- \`${documentPath}\``
1556
- ),
1557
- ""
1558
- );
1559
- } else {
1560
- parts.push("(not declared in issue body)", "");
1561
- }
1562
- for (const documentPath of planDocumentPaths) {
1563
- const absolutePath = resolveRepoPath(repoRoot2, documentPath);
1564
- if (!absolutePath || !existsSync4(absolutePath)) continue;
1565
- parts.push(
1566
- `### Document Content: \`${documentPath}\``,
1567
- "",
1568
- "```markdown",
1569
- readFileSync4(absolutePath, "utf-8").trimEnd(),
1570
- "```",
1571
1532
  ""
1572
1533
  );
1534
+ } else if (parent || parentRef) {
1535
+ parts.push("", "(parent PRD body unavailable)", "");
1573
1536
  }
1574
1537
  return parts;
1575
1538
  }
1576
1539
  function extractIssueSection(body, heading) {
1577
1540
  const escapedHeading = heading.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1578
1541
  const section = body.match(
1579
- new RegExp(`^## ${escapedHeading}\\s*\\n([\\s\\S]*?)(?=\\n## |$)`, "im")
1542
+ new RegExp(
1543
+ `(?:^|\\n)## ${escapedHeading}\\s*\\n([\\s\\S]*?)(?=\\n## |$)`,
1544
+ "i"
1545
+ )
1580
1546
  )?.[1];
1581
1547
  const trimmed = section?.trim();
1582
1548
  return trimmed ? trimmed : null;
1583
1549
  }
1584
- function extractRepoPaths(section) {
1585
- if (!section) return [];
1586
- const paths = /* @__PURE__ */ new Set();
1587
- for (const match of section.matchAll(/`([^`]+)`/g)) {
1588
- const value = match[1]?.trim();
1589
- if (value) paths.add(value);
1550
+ function stripIssueSections(body, headings) {
1551
+ let stripped = body;
1552
+ for (const heading of headings) {
1553
+ const escapedHeading = heading.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1554
+ stripped = stripped.replace(
1555
+ new RegExp(
1556
+ `(?:^|\\n)## ${escapedHeading}\\s*\\n[\\s\\S]*?(?=\\n## |$)`,
1557
+ "gi"
1558
+ ),
1559
+ ""
1560
+ );
1590
1561
  }
1591
- return Array.from(paths);
1592
- }
1593
- function resolveRepoPath(repoRoot2, path9) {
1594
- if (isAbsolute2(path9) || path9.includes("\0")) return null;
1595
- const resolved = resolve2(repoRoot2, path9);
1596
- const repoRelative2 = relative(repoRoot2, resolved);
1597
- if (repoRelative2.startsWith("..") || isAbsolute2(repoRelative2)) return null;
1598
- return resolved;
1562
+ return stripped.trim();
1599
1563
  }
1600
1564
  function findParentPlanWorkspace(repoRoot2, parentRef) {
1601
1565
  const plansRoot = join5(repoRoot2, ".pourkit", "plans");
@@ -1609,11 +1573,9 @@ function findPlanWorkspaceInPlans(directory, parentRef) {
1609
1573
  const prdNumber = parentRef.match(/^PRD-(\d+)$/)?.[1];
1610
1574
  if (entry.name.startsWith(parentRef) || prdNumber && entry.name.startsWith(`${prdNumber}-`)) {
1611
1575
  const prdPath = join5(entryPath, "PRD.md");
1612
- const planPath = join5(entryPath, "PLAN.md");
1613
- if (existsSync4(prdPath) || existsSync4(planPath)) {
1576
+ if (existsSync4(prdPath)) {
1614
1577
  return {
1615
- prdPath: existsSync4(prdPath) ? prdPath : null,
1616
- planPath: existsSync4(planPath) ? planPath : null
1578
+ prdPath
1617
1579
  };
1618
1580
  }
1619
1581
  }
@@ -3244,7 +3206,7 @@ function validateRepoRelativePathField(pathValue, fieldName) {
3244
3206
  }
3245
3207
  const normalized = pathValue.replace(/\\/g, "/");
3246
3208
  const segments = normalized.split("/");
3247
- if (normalized.trim() === "" || normalized === "." || normalized === ".." || isAbsolute3(pathValue) || normalized.startsWith("/") || segments.some((segment) => segment === "..")) {
3209
+ if (normalized.trim() === "" || normalized === "." || normalized === ".." || isAbsolute2(pathValue) || normalized.startsWith("/") || segments.some((segment) => segment === "..")) {
3248
3210
  return {
3249
3211
  ok: false,
3250
3212
  reason: `${fieldName} must not contain absolute paths or path traversal: ${pathValue}`
@@ -3597,7 +3559,7 @@ function validateAgentArtifact(options) {
3597
3559
  if (options.checkConflictMarkers !== false && parsed.status === "resolved") {
3598
3560
  const base = options.worktreePath ?? process.cwd();
3599
3561
  const filesWithMarkers = parsed.files.filter((file) => {
3600
- const filePath = resolve3(base, file);
3562
+ const filePath = resolve2(base, file);
3601
3563
  try {
3602
3564
  return CONFLICT_MARKER_PATTERN.test(
3603
3565
  readFileSync7(filePath, "utf-8")
@@ -3664,8 +3626,8 @@ function validateAgentArtifact(options) {
3664
3626
  }
3665
3627
  }
3666
3628
  function runValidateArtifactCommand(options) {
3667
- const artifactPath = resolve3(options.repoRoot, options.artifactPath);
3668
- const latestReviewArtifactPath = options.latestReviewArtifactPath ? resolve3(options.repoRoot, options.latestReviewArtifactPath) : void 0;
3629
+ const artifactPath = resolve2(options.repoRoot, options.artifactPath);
3630
+ const latestReviewArtifactPath = options.latestReviewArtifactPath ? resolve2(options.repoRoot, options.latestReviewArtifactPath) : void 0;
3669
3631
  return validateAgentArtifact({
3670
3632
  ...options,
3671
3633
  artifactPath,
@@ -3711,7 +3673,7 @@ function shellQuote(value) {
3711
3673
 
3712
3674
  // commands/issue-run.ts
3713
3675
  import { existsSync as existsSync12, readFileSync as readFileSync14 } from "fs";
3714
- import { isAbsolute as isAbsolute5, join as join14 } from "path";
3676
+ import { isAbsolute as isAbsolute4, join as join14 } from "path";
3715
3677
 
3716
3678
  // pr/templates.ts
3717
3679
  init_common();
@@ -4266,7 +4228,7 @@ async function canReachMcp(url) {
4266
4228
  return true;
4267
4229
  } catch {
4268
4230
  if (attempt < 9) {
4269
- await new Promise((resolve6) => setTimeout(resolve6, 100));
4231
+ await new Promise((resolve5) => setTimeout(resolve5, 100));
4270
4232
  }
4271
4233
  }
4272
4234
  }
@@ -4959,7 +4921,7 @@ function extractClosingRefs(body) {
4959
4921
  // issues/github-issue-publication.ts
4960
4922
  init_common();
4961
4923
  import { existsSync as existsSync10, readFileSync as readFileSync12 } from "fs";
4962
- import { isAbsolute as isAbsolute4, join as join12 } from "path";
4924
+ import { isAbsolute as isAbsolute3, join as join12 } from "path";
4963
4925
 
4964
4926
  // issues/issue-transitions.ts
4965
4927
  function createIssueTransitions(deps, labels) {
@@ -5434,7 +5396,7 @@ function readIssueFinalReviewArtifact(worktreeState, worktreePath) {
5434
5396
  if (!configuredPath) {
5435
5397
  return null;
5436
5398
  }
5437
- const artifactPath = isAbsolute4(configuredPath) ? configuredPath : join12(worktreePath, configuredPath);
5399
+ const artifactPath = isAbsolute3(configuredPath) ? configuredPath : join12(worktreePath, configuredPath);
5438
5400
  if (!existsSync10(artifactPath)) return null;
5439
5401
  let parsed;
5440
5402
  try {
@@ -5929,7 +5891,7 @@ async function advanceIssueFinalReview(options) {
5929
5891
  "Issue Final Review state is incomplete: missing artifactPath"
5930
5892
  );
5931
5893
  }
5932
- const artifactPath = isAbsolute5(ifrFromState.artifactPath) ? ifrFromState.artifactPath : join14(worktreePath, ifrFromState.artifactPath);
5894
+ const artifactPath = isAbsolute4(ifrFromState.artifactPath) ? ifrFromState.artifactPath : join14(worktreePath, ifrFromState.artifactPath);
5933
5895
  const validation = validateAgentArtifact({
5934
5896
  kind: "issue-final-review",
5935
5897
  artifactPath,
@@ -9866,7 +9828,6 @@ var BASELINE_MANAGED_SKILLS = [
9866
9828
  "ship-current-changes",
9867
9829
  "tdd",
9868
9830
  "to-issues",
9869
- "to-plan",
9870
9831
  "to-prd",
9871
9832
  "triage",
9872
9833
  "write-a-skill",
@@ -10086,7 +10047,6 @@ var BASELINE_SKILL_NAMES = [
10086
10047
  "ship-current-changes",
10087
10048
  "tdd",
10088
10049
  "to-issues",
10089
- "to-plan",
10090
10050
  "to-prd",
10091
10051
  "triage",
10092
10052
  "write-a-skill",
@@ -12445,7 +12405,7 @@ async function runSerenaStatusCommand(options) {
12445
12405
  // commands/config-schema.ts
12446
12406
  import { readFileSync as readFileSync18, existsSync as existsSync17 } from "fs";
12447
12407
  import { mkdir as mkdir5, readFile as readFile5, writeFile as writeFile2, readdir as readdir2 } from "fs/promises";
12448
- import { resolve as resolve4, dirname as dirname5, relative as relative2 } from "path";
12408
+ import { resolve as resolve3, dirname as dirname5, relative as relative2 } from "path";
12449
12409
  import { fileURLToPath as fileURLToPath3 } from "url";
12450
12410
  import Ajv2 from "ajv";
12451
12411
  init_common();
@@ -12453,8 +12413,8 @@ var __filename3 = fileURLToPath3(import.meta.url);
12453
12413
  var __dirname3 = dirname5(__filename3);
12454
12414
  function resolvePackagedAssetPath2(fileName) {
12455
12415
  const candidates = [
12456
- resolve4(__dirname3, "schema", fileName),
12457
- resolve4(__dirname3, "../schema", fileName)
12416
+ resolve3(__dirname3, "schema", fileName),
12417
+ resolve3(__dirname3, "../schema", fileName)
12458
12418
  ];
12459
12419
  return candidates.find((candidate) => existsSync17(candidate)) ?? candidates[0];
12460
12420
  }
@@ -12481,12 +12441,12 @@ function readPackagedHash() {
12481
12441
  return readFileSync18(PACKAGED_HASH_PATH, "utf-8");
12482
12442
  }
12483
12443
  function localSchemaDir(repoRoot2) {
12484
- return resolve4(repoRoot2, ".pourkit/schema");
12444
+ return resolve3(repoRoot2, ".pourkit/schema");
12485
12445
  }
12486
12446
  var MANAGED_BLOCK_BEGIN2 = "<!-- BEGIN POURKIT MANAGED BLOCK -->\n";
12487
12447
  var OLD_DOCS_PATH_PATTERN = ".pourkit/docs/agents/";
12488
12448
  function resolvePackagedManagedPath(...segments) {
12489
- return resolve4(__dirname3, "..", "managed", ...segments);
12449
+ return resolve3(__dirname3, "..", "managed", ...segments);
12490
12450
  }
12491
12451
  function resolvePackagedManagedDocPath(docName) {
12492
12452
  return resolvePackagedManagedPath("docs", "agents", docName);
@@ -12516,7 +12476,7 @@ async function walkDir2(dir) {
12516
12476
  try {
12517
12477
  const entries = await readdir2(dir, { withFileTypes: true });
12518
12478
  for (const entry of entries) {
12519
- const full = resolve4(dir, entry.name);
12479
+ const full = resolve3(dir, entry.name);
12520
12480
  if (entry.isDirectory()) {
12521
12481
  files.push(...await walkDir2(full));
12522
12482
  } else {
@@ -12598,7 +12558,7 @@ async function validateWorkflowPack(cwd) {
12598
12558
  const catalog = getWorkflowPackCatalog();
12599
12559
  const baselineSkills = getBaselineManagedSkillNames();
12600
12560
  for (const docName of catalog.docs) {
12601
- const localPath = resolve4(cwd, `.pourkit/managed/docs/agents/${docName}`);
12561
+ const localPath = resolve3(cwd, `.pourkit/managed/docs/agents/${docName}`);
12602
12562
  if (!existsSync17(localPath)) {
12603
12563
  failures.push({
12604
12564
  severity: "failure",
@@ -12613,7 +12573,7 @@ async function validateWorkflowPack(cwd) {
12613
12573
  try {
12614
12574
  const localContent = await readFile5(localPath, "utf-8");
12615
12575
  if (localContent !== packagedContent) {
12616
- const overridePath = resolve4(
12576
+ const overridePath = resolve3(
12617
12577
  cwd,
12618
12578
  `.pourkit/overrides/docs/agents/${docName}`
12619
12579
  );
@@ -12639,7 +12599,7 @@ async function validateWorkflowPack(cwd) {
12639
12599
  }
12640
12600
  }
12641
12601
  for (const skillName of baselineSkills) {
12642
- const skillDir = resolve4(cwd, `.pourkit/managed/skills/${skillName}`);
12602
+ const skillDir = resolve3(cwd, `.pourkit/managed/skills/${skillName}`);
12643
12603
  if (!existsSync17(skillDir)) {
12644
12604
  failures.push({
12645
12605
  severity: "failure",
@@ -12648,7 +12608,7 @@ async function validateWorkflowPack(cwd) {
12648
12608
  message: `Missing managed skill: ${skillName}`
12649
12609
  });
12650
12610
  } else {
12651
- const skillSourcePath = resolve4(skillDir, "SKILL.md");
12611
+ const skillSourcePath = resolve3(skillDir, "SKILL.md");
12652
12612
  if (existsSync17(skillSourcePath)) {
12653
12613
  const packagedSkillPath = resolvePackagedManagedPath(
12654
12614
  "skills",
@@ -12660,7 +12620,7 @@ async function validateWorkflowPack(cwd) {
12660
12620
  try {
12661
12621
  const localContent = await readFile5(skillSourcePath, "utf-8");
12662
12622
  if (localContent !== packagedContent) {
12663
- const overridePath = resolve4(
12623
+ const overridePath = resolve3(
12664
12624
  cwd,
12665
12625
  `.pourkit/overrides/skills/${skillName}/SKILL.md`
12666
12626
  );
@@ -12687,7 +12647,7 @@ async function validateWorkflowPack(cwd) {
12687
12647
  }
12688
12648
  }
12689
12649
  for (const promptName of catalog.prompts) {
12690
- const promptPath = resolve4(cwd, `.pourkit/managed/prompts/${promptName}`);
12650
+ const promptPath = resolve3(cwd, `.pourkit/managed/prompts/${promptName}`);
12691
12651
  if (!existsSync17(promptPath)) {
12692
12652
  failures.push({
12693
12653
  severity: "failure",
@@ -12698,7 +12658,7 @@ async function validateWorkflowPack(cwd) {
12698
12658
  }
12699
12659
  }
12700
12660
  for (const skillName of baselineSkills) {
12701
- const projectionDir = resolve4(cwd, `.agents/skills/${skillName}`);
12661
+ const projectionDir = resolve3(cwd, `.agents/skills/${skillName}`);
12702
12662
  if (!existsSync17(projectionDir)) {
12703
12663
  warnings.push({
12704
12664
  severity: "warning",
@@ -12707,7 +12667,7 @@ async function validateWorkflowPack(cwd) {
12707
12667
  message: `Missing skill projection for ${skillName}. Run 'pourkit sync workflow-pack' to regenerate.`
12708
12668
  });
12709
12669
  } else {
12710
- const projectionPath = resolve4(projectionDir, "SKILL.md");
12670
+ const projectionPath = resolve3(projectionDir, "SKILL.md");
12711
12671
  if (existsSync17(projectionPath)) {
12712
12672
  const managedSourcePath = resolvePackagedManagedPath(
12713
12673
  "skills",
@@ -12736,7 +12696,7 @@ async function validateWorkflowPack(cwd) {
12736
12696
  }
12737
12697
  }
12738
12698
  }
12739
- const agentsPath = resolve4(cwd, "AGENTS.md");
12699
+ const agentsPath = resolve3(cwd, "AGENTS.md");
12740
12700
  if (existsSync17(agentsPath)) {
12741
12701
  try {
12742
12702
  const agentsContent = await readFile5(agentsPath, "utf-8");
@@ -12759,7 +12719,7 @@ async function validateWorkflowPack(cwd) {
12759
12719
  } catch {
12760
12720
  }
12761
12721
  }
12762
- const overridesDir = resolve4(cwd, ".pourkit/overrides");
12722
+ const overridesDir = resolve3(cwd, ".pourkit/overrides");
12763
12723
  if (existsSync17(overridesDir)) {
12764
12724
  const overrideFiles = await walkDir2(overridesDir);
12765
12725
  for (const file of overrideFiles) {
@@ -12774,7 +12734,7 @@ async function validateWorkflowPack(cwd) {
12774
12734
  }
12775
12735
  }
12776
12736
  }
12777
- const configPath = resolve4(cwd, ".pourkit/config.json");
12737
+ const configPath = resolve3(cwd, ".pourkit/config.json");
12778
12738
  if (existsSync17(configPath)) {
12779
12739
  try {
12780
12740
  const configContent = await readFile5(configPath, "utf-8");
@@ -12782,7 +12742,7 @@ async function validateWorkflowPack(cwd) {
12782
12742
  const releaseEnabled = parsed.releaseWorkflow?.enabled === true;
12783
12743
  if (releaseEnabled) {
12784
12744
  for (const skillName of catalog.releaseAddonSkills) {
12785
- const addonDir = resolve4(
12745
+ const addonDir = resolve3(
12786
12746
  cwd,
12787
12747
  `.pourkit/managed/addons/release/skills/${skillName}`
12788
12748
  );
@@ -12796,7 +12756,7 @@ async function validateWorkflowPack(cwd) {
12796
12756
  }
12797
12757
  }
12798
12758
  for (const docName of catalog.releaseAddonDocs) {
12799
- const addonDocPath = resolve4(
12759
+ const addonDocPath = resolve3(
12800
12760
  cwd,
12801
12761
  `.pourkit/managed/addons/release/docs/agents/${docName}`
12802
12762
  );
@@ -12841,7 +12801,7 @@ async function validateWorkflowPack(cwd) {
12841
12801
  }
12842
12802
  } else {
12843
12803
  for (const skillName of catalog.releaseAddonSkills) {
12844
- const addonDir = resolve4(
12804
+ const addonDir = resolve3(
12845
12805
  cwd,
12846
12806
  `.pourkit/managed/addons/release/skills/${skillName}`
12847
12807
  );
@@ -12855,7 +12815,7 @@ async function validateWorkflowPack(cwd) {
12855
12815
  }
12856
12816
  }
12857
12817
  for (const docName of catalog.releaseAddonDocs) {
12858
- const addonDocPath = resolve4(
12818
+ const addonDocPath = resolve3(
12859
12819
  cwd,
12860
12820
  `.pourkit/managed/addons/release/docs/agents/${docName}`
12861
12821
  );
@@ -12872,7 +12832,7 @@ async function validateWorkflowPack(cwd) {
12872
12832
  } catch {
12873
12833
  }
12874
12834
  }
12875
- const manifestPath = resolve4(cwd, ".pourkit/manifest.json");
12835
+ const manifestPath = resolve3(cwd, ".pourkit/manifest.json");
12876
12836
  if (existsSync17(manifestPath)) {
12877
12837
  try {
12878
12838
  const manifestContent = await readFile5(manifestPath, "utf-8");
@@ -12881,7 +12841,7 @@ async function validateWorkflowPack(cwd) {
12881
12841
  if (wp?.projections) {
12882
12842
  for (const proj of wp.projections) {
12883
12843
  if (proj.path) {
12884
- const resolved = resolve4(cwd, proj.path);
12844
+ const resolved = resolve3(cwd, proj.path);
12885
12845
  if (!isPathContained(cwd, resolved)) {
12886
12846
  failures.push({
12887
12847
  severity: "failure",
@@ -12895,7 +12855,7 @@ async function validateWorkflowPack(cwd) {
12895
12855
  } catch {
12896
12856
  }
12897
12857
  }
12898
- const pathEscapeOverrideDir = resolve4(cwd, ".pourkit/overrides");
12858
+ const pathEscapeOverrideDir = resolve3(cwd, ".pourkit/overrides");
12899
12859
  if (existsSync17(pathEscapeOverrideDir)) {
12900
12860
  const overrideFiles = await walkDir2(pathEscapeOverrideDir);
12901
12861
  for (const file of overrideFiles) {
@@ -12909,7 +12869,7 @@ async function validateWorkflowPack(cwd) {
12909
12869
  }
12910
12870
  }
12911
12871
  }
12912
- const managedDocsDir = resolve4(cwd, ".pourkit/managed/docs/agents");
12872
+ const managedDocsDir = resolve3(cwd, ".pourkit/managed/docs/agents");
12913
12873
  if (existsSync17(managedDocsDir)) {
12914
12874
  const docFiles = await walkDir2(managedDocsDir);
12915
12875
  for (const file of docFiles) {
@@ -12930,12 +12890,12 @@ async function validateWorkflowPack(cwd) {
12930
12890
  }
12931
12891
  }
12932
12892
  }
12933
- const managedSkillsDir = resolve4(cwd, ".pourkit/managed/skills");
12893
+ const managedSkillsDir = resolve3(cwd, ".pourkit/managed/skills");
12934
12894
  if (existsSync17(managedSkillsDir)) {
12935
12895
  const skillDirs = await readdir2(managedSkillsDir, { withFileTypes: true });
12936
12896
  for (const entry of skillDirs) {
12937
12897
  if (!entry.isDirectory()) continue;
12938
- const skillFile = resolve4(managedSkillsDir, entry.name, "SKILL.md");
12898
+ const skillFile = resolve3(managedSkillsDir, entry.name, "SKILL.md");
12939
12899
  if (!existsSync17(skillFile)) continue;
12940
12900
  try {
12941
12901
  const content = await readFile5(skillFile, "utf-8");
@@ -12953,10 +12913,10 @@ async function validateWorkflowPack(cwd) {
12953
12913
  }
12954
12914
  }
12955
12915
  }
12956
- const managedPromptsDir = resolve4(cwd, ".pourkit/managed/prompts");
12916
+ const managedPromptsDir = resolve3(cwd, ".pourkit/managed/prompts");
12957
12917
  if (existsSync17(managedPromptsDir)) {
12958
12918
  for (const promptName of catalog.prompts) {
12959
- const promptFile = resolve4(managedPromptsDir, promptName);
12919
+ const promptFile = resolve3(managedPromptsDir, promptName);
12960
12920
  if (!existsSync17(promptFile)) continue;
12961
12921
  try {
12962
12922
  const content = await readFile5(promptFile, "utf-8");
@@ -12975,7 +12935,7 @@ async function validateWorkflowPack(cwd) {
12975
12935
  }
12976
12936
  }
12977
12937
  for (const skillName of catalog.releaseAddonSkills) {
12978
- const addonSkillFile = resolve4(
12938
+ const addonSkillFile = resolve3(
12979
12939
  cwd,
12980
12940
  `.pourkit/managed/addons/release/skills/${skillName}/SKILL.md`
12981
12941
  );
@@ -12996,7 +12956,7 @@ async function validateWorkflowPack(cwd) {
12996
12956
  }
12997
12957
  }
12998
12958
  for (const docName of catalog.releaseAddonDocs) {
12999
- const addonDocFile = resolve4(
12959
+ const addonDocFile = resolve3(
13000
12960
  cwd,
13001
12961
  `.pourkit/managed/addons/release/docs/agents/${docName}`
13002
12962
  );
@@ -13033,7 +12993,7 @@ async function validateMemoryHealth(cwd, memoryConfig) {
13033
12993
  ok: icmPath !== null,
13034
12994
  detail: icmPath !== null ? icmPath : "icm not found on PATH"
13035
12995
  });
13036
- const gitignorePath = resolve4(cwd, ".gitignore");
12996
+ const gitignorePath = resolve3(cwd, ".gitignore");
13037
12997
  const gitignoreContent = existsSync17(gitignorePath) ? readFileSync18(gitignorePath, "utf-8") : "";
13038
12998
  const hasGitignoreEntry = gitignoreContent.includes(".pourkit/icm/");
13039
12999
  checks.push({
@@ -13059,8 +13019,8 @@ async function validateMemoryHealth(cwd, memoryConfig) {
13059
13019
  async function runDoctorCommand(options) {
13060
13020
  const repoRootPath = options.cwd ?? process.cwd();
13061
13021
  const schemaDir = localSchemaDir(repoRootPath);
13062
- const localSchemaPath = resolve4(schemaDir, "pourkit.schema.json");
13063
- const localHashPath = resolve4(schemaDir, "pourkit.schema.hash");
13022
+ const localSchemaPath = resolve3(schemaDir, "pourkit.schema.json");
13023
+ const localHashPath = resolve3(schemaDir, "pourkit.schema.hash");
13064
13024
  const localSchemaExists = existsSync17(localSchemaPath);
13065
13025
  const localHashExists = existsSync17(localHashPath);
13066
13026
  let packagedHash = null;
@@ -13078,7 +13038,7 @@ async function runDoctorCommand(options) {
13078
13038
  const schema = !localSchemaExists ? "missing" : !packagedHash || !localHashContent ? "missing" : localHashContent.trim() === packagedHash.trim() ? "fresh" : "stale";
13079
13039
  const hash = !localHashExists ? "missing" : !packagedHash ? "missing" : localHashContent && localHashContent.trim() === packagedHash.trim() ? "fresh" : "stale";
13080
13040
  const overall = schema === "fresh" && hash === "fresh" ? "fresh" : schema === "missing" || hash === "missing" ? "missing" : "stale";
13081
- const configPath = resolve4(repoRootPath, ".pourkit/config.json");
13041
+ const configPath = resolve3(repoRootPath, ".pourkit/config.json");
13082
13042
  let configValidation;
13083
13043
  let rawMemoryConfig;
13084
13044
  if (existsSync17(configPath)) {
@@ -13116,7 +13076,7 @@ async function runDoctorCommand(options) {
13116
13076
  "pourkit.config.mjs",
13117
13077
  "pourkit.config.js",
13118
13078
  "pourkit.json"
13119
- ].filter((p) => existsSync17(resolve4(repoRootPath, p)));
13079
+ ].filter((p) => existsSync17(resolve3(repoRootPath, p)));
13120
13080
  const workflowPack = await validateWorkflowPack(repoRootPath);
13121
13081
  const memory = await validateMemoryHealth(repoRootPath, rawMemoryConfig);
13122
13082
  let recommendation = null;
@@ -13162,8 +13122,8 @@ async function runConfigSyncSchemaCommand(options) {
13162
13122
  await mkdir5(schemaDir, { recursive: true });
13163
13123
  const packagedSchema = await readFile5(PACKAGED_SCHEMA_PATH, "utf-8");
13164
13124
  const packagedHash = await readFile5(PACKAGED_HASH_PATH, "utf-8");
13165
- const localSchemaPath = resolve4(schemaDir, "pourkit.schema.json");
13166
- const localHashPath = resolve4(schemaDir, "pourkit.schema.hash");
13125
+ const localSchemaPath = resolve3(schemaDir, "pourkit.schema.json");
13126
+ const localHashPath = resolve3(schemaDir, "pourkit.schema.hash");
13167
13127
  let schemaWritten = false;
13168
13128
  let hashWritten = false;
13169
13129
  if (existsSync17(localSchemaPath)) {
@@ -13196,7 +13156,7 @@ async function runConfigSyncSchemaCommand(options) {
13196
13156
  // commands/workflow-pack-sync.ts
13197
13157
  import { existsSync as existsSync18, readdirSync as readdirSync4 } from "fs";
13198
13158
  import { mkdir as mkdir6, readFile as readFile6, writeFile as writeFile3, readdir as readdir3 } from "fs/promises";
13199
- import { resolve as resolve5, dirname as dirname6, relative as relative3, normalize as normalize2 } from "path";
13159
+ import { resolve as resolve4, dirname as dirname6, relative as relative3, normalize as normalize2 } from "path";
13200
13160
  import { fileURLToPath as fileURLToPath4 } from "url";
13201
13161
  var __filename4 = fileURLToPath4(import.meta.url);
13202
13162
  var __dirname4 = dirname6(__filename4);
@@ -13210,7 +13170,7 @@ var OVERRIDES_DIR = ".pourkit/overrides";
13210
13170
  var MANAGED_BLOCK_BEGIN3 = "<!-- BEGIN POURKIT MANAGED BLOCK -->\n";
13211
13171
  var MANAGED_BLOCK_END2 = "\n<!-- END POURKIT MANAGED BLOCK -->";
13212
13172
  function resolvePackagedManagedPath2(...segments) {
13213
- const candidates = [resolve5(__dirname4, "..", "managed", ...segments)];
13173
+ const candidates = [resolve4(__dirname4, "..", "managed", ...segments)];
13214
13174
  return candidates[0];
13215
13175
  }
13216
13176
  function resolvePackagedManagedDocPath2(docName) {
@@ -13292,7 +13252,7 @@ async function walkDir3(dir) {
13292
13252
  try {
13293
13253
  const entries = await readdir3(dir, { withFileTypes: true });
13294
13254
  for (const entry of entries) {
13295
- const full = resolve5(dir, entry.name);
13255
+ const full = resolve4(dir, entry.name);
13296
13256
  if (entry.isDirectory()) {
13297
13257
  files.push(...await walkDir3(full));
13298
13258
  } else {
@@ -13310,13 +13270,13 @@ async function syncFile(cwd, targetRelativePath, sourceContent, errors) {
13310
13270
  if (sourceContent === null) {
13311
13271
  return false;
13312
13272
  }
13313
- const targetPath = resolve5(cwd, targetRelativePath);
13273
+ const targetPath = resolve4(cwd, targetRelativePath);
13314
13274
  const escapeError = checkForPathEscape(cwd, targetPath);
13315
13275
  if (escapeError) {
13316
13276
  errors.push(escapeError);
13317
13277
  return false;
13318
13278
  }
13319
- await mkdir6(resolve5(targetPath, ".."), { recursive: true });
13279
+ await mkdir6(resolve4(targetPath, ".."), { recursive: true });
13320
13280
  if (existsSync18(targetPath)) {
13321
13281
  const existing = await readFile6(targetPath, "utf-8");
13322
13282
  if (existing === sourceContent) {
@@ -13331,7 +13291,7 @@ function walkDirSync(dir) {
13331
13291
  try {
13332
13292
  const entries = readdirSync4(dir, { withFileTypes: true });
13333
13293
  for (const entry of entries) {
13334
- const full = resolve5(dir, entry.name);
13294
+ const full = resolve4(dir, entry.name);
13335
13295
  if (entry.isDirectory()) {
13336
13296
  result.push(...walkDirSync(full));
13337
13297
  } else {
@@ -13343,7 +13303,7 @@ function walkDirSync(dir) {
13343
13303
  return result;
13344
13304
  }
13345
13305
  async function detectOverrides(cwd) {
13346
- const overridesDir = resolve5(cwd, OVERRIDES_DIR);
13306
+ const overridesDir = resolve4(cwd, OVERRIDES_DIR);
13347
13307
  if (!existsSync18(overridesDir)) {
13348
13308
  return [];
13349
13309
  }
@@ -13353,13 +13313,13 @@ async function detectOverrides(cwd) {
13353
13313
  async function detectProjectOwnedFiles(cwd) {
13354
13314
  const found = [];
13355
13315
  for (const ownedPath of PROJECT_OWNED_PATHS) {
13356
- const fullPath = resolve5(cwd, ownedPath);
13316
+ const fullPath = resolve4(cwd, ownedPath);
13357
13317
  if (existsSync18(fullPath)) {
13358
13318
  found.push(ownedPath);
13359
13319
  }
13360
13320
  }
13361
13321
  for (const ownedDir of PROJECT_OWNED_DIRECTORIES) {
13362
- const fullDir = resolve5(cwd, ownedDir);
13322
+ const fullDir = resolve4(cwd, ownedDir);
13363
13323
  if (existsSync18(fullDir)) {
13364
13324
  const files = await walkDir3(fullDir);
13365
13325
  for (const file of files) {
@@ -13371,7 +13331,7 @@ async function detectProjectOwnedFiles(cwd) {
13371
13331
  }
13372
13332
  async function isReleaseWorkflowEnabled(cwd) {
13373
13333
  try {
13374
- const configPath = resolve5(cwd, ".pourkit", "config.json");
13334
+ const configPath = resolve4(cwd, ".pourkit", "config.json");
13375
13335
  const content = await readFile6(configPath, "utf-8");
13376
13336
  const parsed = JSON.parse(content);
13377
13337
  return parsed.releaseWorkflow?.enabled === true;
@@ -13501,7 +13461,7 @@ async function runWorkflowPackSyncCommand(options) {
13501
13461
  const schemaResult = await runConfigSyncSchemaCommand({ cwd });
13502
13462
  let configMemory;
13503
13463
  try {
13504
- const configPath = resolve5(cwd, ".pourkit", "config.json");
13464
+ const configPath = resolve4(cwd, ".pourkit", "config.json");
13505
13465
  const config = await loadConfig(configPath);
13506
13466
  if (config.memory?.enabled === true && config.memory?.provider === "icm") {
13507
13467
  configMemory = config.memory;
@@ -13511,7 +13471,7 @@ async function runWorkflowPackSyncCommand(options) {
13511
13471
  const managedBlockContent = generateManagedBlockContent(configMemory);
13512
13472
  const fullManagedBlock = `${MANAGED_BLOCK_BEGIN3}${managedBlockContent}${MANAGED_BLOCK_END2}`;
13513
13473
  async function syncManagedAgentFile(fileName, options2) {
13514
- const filePath = resolve5(cwd, fileName);
13474
+ const filePath = resolve4(cwd, fileName);
13515
13475
  if (!existsSync18(filePath)) {
13516
13476
  if (!options2.createIfMissing) return false;
13517
13477
  await writeFile3(filePath, fullManagedBlock + "\n", "utf-8");
@@ -13548,7 +13508,7 @@ ${fullManagedBlock}
13548
13508
  }
13549
13509
  const enabledAddons = releaseEnabled ? ["release"] : [];
13550
13510
  const manifestMeta = buildWorkflowPackMetadata(enabledAddons);
13551
- const manifestPath = resolve5(cwd, ".pourkit", "manifest.json");
13511
+ const manifestPath = resolve4(cwd, ".pourkit", "manifest.json");
13552
13512
  let manifestWritten = false;
13553
13513
  let previousManifestWorkflowPack = void 0;
13554
13514
  try {
@@ -13566,7 +13526,7 @@ ${fullManagedBlock}
13566
13526
  );
13567
13527
  let manifest = existingRaw ? JSON.parse(existingRaw) : {};
13568
13528
  manifest.workflowPack = manifestMeta;
13569
- await mkdir6(resolve5(manifestPath, ".."), { recursive: true });
13529
+ await mkdir6(resolve4(manifestPath, ".."), { recursive: true });
13570
13530
  await writeFile3(
13571
13531
  manifestPath,
13572
13532
  JSON.stringify(manifest, null, 2) + "\n",
@@ -15484,11 +15444,11 @@ function createCliProgram(version) {
15484
15444
  return program;
15485
15445
  }
15486
15446
  async function resolveCliVersion() {
15487
- if (isPackageVersion("0.0.0-next-20260620182746")) {
15488
- return "0.0.0-next-20260620182746";
15447
+ if (isPackageVersion("0.0.0-next-20260620201514")) {
15448
+ return "0.0.0-next-20260620201514";
15489
15449
  }
15490
- if (isReleaseVersion("0.0.0-next-20260620182746")) {
15491
- return "0.0.0-next-20260620182746";
15450
+ if (isReleaseVersion("0.0.0-next-20260620201514")) {
15451
+ return "0.0.0-next-20260620201514";
15492
15452
  }
15493
15453
  try {
15494
15454
  const root = repoRoot();