@harness-engineering/cli 1.24.1 → 1.24.3

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 (41) hide show
  1. package/dist/{agents-md-MMVRF77L.js → agents-md-PBKKTSQY.js} +1 -1
  2. package/dist/{architecture-JAEDPYQZ.js → architecture-FBSLURIB.js} +3 -3
  3. package/dist/{assess-project-7JZCVM7D.js → assess-project-74UVWPMB.js} +1 -1
  4. package/dist/bin/harness-mcp.js +13 -13
  5. package/dist/bin/harness.js +18 -17
  6. package/dist/{check-phase-gate-YQHAH4LL.js → check-phase-gate-WY6UICCL.js} +3 -3
  7. package/dist/{chunk-MS6KDQW7.js → chunk-3VYWO6QN.js} +6 -6
  8. package/dist/chunk-3XAPHB2Z.js +43 -0
  9. package/dist/{chunk-AVVJ5EUU.js → chunk-5PMRARB5.js} +1 -1
  10. package/dist/{chunk-NU3BPEDR.js → chunk-A737JDL4.js} +2 -2
  11. package/dist/{chunk-IDZNPTYD.js → chunk-EPUKTTJZ.js} +6 -1
  12. package/dist/{chunk-2DAMN7ED.js → chunk-FJYP32IV.js} +6 -6
  13. package/dist/{chunk-PCWYYFBP.js → chunk-H4U2QNY2.js} +32 -6
  14. package/dist/{chunk-C5FTJ3EU.js → chunk-L5UONZ53.js} +58 -1
  15. package/dist/{chunk-LY3YVKXL.js → chunk-O6UF33QH.js} +351 -104
  16. package/dist/{chunk-W2OZK3KC.js → chunk-SPTKLCKC.js} +1 -1
  17. package/dist/{chunk-TUJAHI22.js → chunk-TB427QOK.js} +5 -5
  18. package/dist/{chunk-HVFCCARH.js → chunk-UFQQBGC3.js} +1 -1
  19. package/dist/{chunk-JGMCHJ6B.js → chunk-V2FGX2KD.js} +3 -3
  20. package/dist/{chunk-JT732X6S.js → chunk-WEN5Z7CL.js} +2 -2
  21. package/dist/{chunk-BWWNQPPO.js → chunk-YPKKEP3O.js} +4 -4
  22. package/dist/{chunk-ZKVLBOYA.js → chunk-ZAMT24QN.js} +426 -383
  23. package/dist/{ci-workflow-HDH4LCOF.js → ci-workflow-QZRHAIO2.js} +1 -1
  24. package/dist/{dist-TZQUURSP.js → dist-7EBSGAHX.js} +3 -1
  25. package/dist/{docs-6SPJYTRR.js → docs-H34GBVRS.js} +4 -4
  26. package/dist/{engine-CSITRE3J.js → engine-VUQEAJFZ.js} +1 -1
  27. package/dist/{entropy-FZP643BK.js → entropy-ZAY73R6A.js} +3 -3
  28. package/dist/{feedback-RSPUJCJJ.js → feedback-TMEGYMWU.js} +2 -2
  29. package/dist/{generate-agent-definitions-OLYWXTYH.js → generate-agent-definitions-PQPG6SX5.js} +1 -1
  30. package/dist/index.d.ts +8 -8
  31. package/dist/index.js +23 -21
  32. package/dist/{loader-P2P7CV2A.js → loader-Y6A42WBD.js} +1 -1
  33. package/dist/{mcp-JZG22CYT.js → mcp-LCHC4NZ5.js} +13 -13
  34. package/dist/{performance-VVWOIJTE.js → performance-N67YJJDG.js} +4 -4
  35. package/dist/{review-pipeline-XSRO7HYZ.js → review-pipeline-YXF5ITL2.js} +4 -1
  36. package/dist/{runtime-VMOIIP6B.js → runtime-XNJUJCSG.js} +1 -1
  37. package/dist/scan-U67OKDRS.js +8 -0
  38. package/dist/{security-4AQ46P3H.js → security-L2YN3CTI.js} +1 -1
  39. package/dist/{validate-T7UTXLEQ.js → validate-MNE25KLZ.js} +2 -2
  40. package/dist/{validate-cross-check-M4NP2UF5.js → validate-cross-check-Y4PDR63C.js} +1 -1
  41. package/package.json +5 -5
@@ -5,38 +5,39 @@ import {
5
5
  handleCreateSelfReview,
6
6
  handleRequestPeerReview,
7
7
  requestPeerReviewDefinition
8
- } from "./chunk-BWWNQPPO.js";
8
+ } from "./chunk-YPKKEP3O.js";
9
9
  import {
10
10
  handleRunSecurityScan,
11
11
  runSecurityScanDefinition
12
- } from "./chunk-HVFCCARH.js";
12
+ } from "./chunk-UFQQBGC3.js";
13
13
  import {
14
14
  handleRunCodeReview,
15
- runCodeReviewDefinition
16
- } from "./chunk-C5FTJ3EU.js";
15
+ runCodeReviewDefinition,
16
+ sortFindingsBySeverity
17
+ } from "./chunk-L5UONZ53.js";
17
18
  import {
18
19
  assessProjectDefinition,
19
20
  handleAssessProject
20
- } from "./chunk-2DAMN7ED.js";
21
+ } from "./chunk-FJYP32IV.js";
21
22
  import {
22
23
  handleValidateProject,
23
24
  validateToolDefinition
24
- } from "./chunk-JT732X6S.js";
25
+ } from "./chunk-WEN5Z7CL.js";
25
26
  import {
26
27
  checkDependenciesDefinition,
27
28
  handleCheckDependencies
28
- } from "./chunk-NU3BPEDR.js";
29
+ } from "./chunk-A737JDL4.js";
29
30
  import {
30
31
  resolveProjectConfig
31
32
  } from "./chunk-Q3XYV5UC.js";
32
33
  import {
33
34
  checkDocsDefinition,
34
35
  handleCheckDocs
35
- } from "./chunk-TUJAHI22.js";
36
+ } from "./chunk-TB427QOK.js";
36
37
  import {
37
38
  detectEntropyDefinition,
38
39
  handleDetectEntropy
39
- } from "./chunk-JGMCHJ6B.js";
40
+ } from "./chunk-V2FGX2KD.js";
40
41
  import {
41
42
  checkPerformanceDefinition,
42
43
  getCriticalPathsDefinition,
@@ -46,17 +47,17 @@ import {
46
47
  handleGetPerfBaselines,
47
48
  handleUpdatePerfBaselines,
48
49
  updatePerfBaselinesDefinition
49
- } from "./chunk-MS6KDQW7.js";
50
+ } from "./chunk-3VYWO6QN.js";
50
51
  import {
51
52
  resultToMcpResponse
52
- } from "./chunk-IDZNPTYD.js";
53
+ } from "./chunk-EPUKTTJZ.js";
53
54
  import {
54
55
  sanitizePath
55
56
  } from "./chunk-W6Y7ZW3Y.js";
56
57
  import {
57
58
  TrackerConfigSchema,
58
59
  resolveConfig
59
- } from "./chunk-AVVJ5EUU.js";
60
+ } from "./chunk-5PMRARB5.js";
60
61
  import {
61
62
  GENERATED_HEADER_CLAUDE,
62
63
  GENERATED_HEADER_CODEX,
@@ -88,10 +89,11 @@ import {
88
89
  checkTaint,
89
90
  detectChangeType,
90
91
  estimateTokens,
92
+ paginate,
91
93
  scanForInjection,
92
94
  serializeEnvelope,
93
95
  writeTaint
94
- } from "./chunk-PCWYYFBP.js";
96
+ } from "./chunk-H4U2QNY2.js";
95
97
  import {
96
98
  Err,
97
99
  Ok
@@ -240,21 +242,22 @@ var DEFAULT_PIPELINE = new CompactionPipeline([
240
242
  new StructuralStrategy(),
241
243
  new TruncationStrategy()
242
244
  ]);
243
- function buildHeader(orig, comp) {
245
+ var LOSSLESS_PIPELINE = new CompactionPipeline([new StructuralStrategy()]);
246
+ function buildHeader(pipeline, orig, comp) {
244
247
  const pct = orig > 0 ? Math.round((1 - comp / orig) * 100) : 0;
245
- return `<!-- packed: ${DEFAULT_PIPELINE.strategyNames.join("+")} | ${orig}\u2192${comp} tokens (-${pct}%) -->`;
248
+ return `<!-- packed: ${pipeline.strategyNames.join("+")} | ${orig}\u2192${comp} tokens (-${pct}%) -->`;
246
249
  }
247
- function compactText(text) {
248
- return DEFAULT_PIPELINE.apply(text, DEFAULT_TOKEN_BUDGET);
250
+ function compactText(text, pipeline, budget) {
251
+ return pipeline.apply(text, budget);
249
252
  }
250
- function compactResult(result) {
253
+ function compactResultWith(result, pipeline, budget) {
251
254
  const texts = result.content.filter((i) => i.type === "text");
252
255
  const origTok = texts.reduce((s, i) => s + estimateTokens(i.text), 0);
253
256
  const packed = /* @__PURE__ */ new Map();
254
- for (const item of texts) packed.set(item, compactText(item.text));
257
+ for (const item of texts) packed.set(item, compactText(item.text, pipeline, budget));
255
258
  const compTok = [...packed.values()].reduce((s, t) => s + estimateTokens(t), 0);
256
- const hdrTok = estimateTokens(buildHeader(origTok, compTok));
257
- const header = buildHeader(origTok, compTok + hdrTok);
259
+ const hdrTok = estimateTokens(buildHeader(pipeline, origTok, compTok));
260
+ const header = buildHeader(pipeline, origTok, compTok + hdrTok);
258
261
  let first = true;
259
262
  const content = result.content.map((item) => {
260
263
  if (item.type !== "text") return item;
@@ -268,6 +271,32 @@ ${c}` };
268
271
  });
269
272
  return { ...result, content };
270
273
  }
274
+ var LOSSLESS_ONLY_TOOLS = /* @__PURE__ */ new Set([
275
+ "run_skill",
276
+ // Skill instructions the agent must follow completely
277
+ "emit_interaction",
278
+ // User decision trees — truncation breaks choice clarity
279
+ "manage_state",
280
+ // Project state JSON — truncation corrupts parsed schemas
281
+ "code_unfold",
282
+ // Complete symbol implementations by AST boundary
283
+ "init_project",
284
+ // Project scaffolding templates
285
+ "generate_linter",
286
+ // Generated ESLint rules — must be syntactically complete
287
+ "validate_linter_config",
288
+ // Linter validation — must be structurally complete
289
+ "generate_agent_definitions",
290
+ // Generated agent configs (YAML/JSON)
291
+ "generate_slash_commands",
292
+ // Generated command definitions
293
+ "run_persona",
294
+ // Persona execution results with generated artifacts
295
+ "generate_persona_artifacts",
296
+ // Generated configs, CI workflows
297
+ "manage_roadmap"
298
+ // Structured roadmap with cross-references and dependencies
299
+ ]);
271
300
  function wrapWithCompaction(toolName, handler) {
272
301
  return async (input) => {
273
302
  if (toolName === "compact") {
@@ -278,7 +307,10 @@ function wrapWithCompaction(toolName, handler) {
278
307
  }
279
308
  const result = await handler(input);
280
309
  try {
281
- return compactResult(result);
310
+ if (LOSSLESS_ONLY_TOOLS.has(toolName)) {
311
+ return compactResultWith(result, LOSSLESS_PIPELINE);
312
+ }
313
+ return compactResultWith(result, DEFAULT_PIPELINE, DEFAULT_TOKEN_BUDGET);
282
314
  } catch {
283
315
  return result;
284
316
  }
@@ -651,7 +683,7 @@ ${skippedMsg}`
651
683
  async function handleInitProject(input) {
652
684
  const i = input;
653
685
  try {
654
- const { TemplateEngine } = await import("./engine-CSITRE3J.js");
686
+ const { TemplateEngine } = await import("./engine-VUQEAJFZ.js");
655
687
  const engine = new TemplateEngine(resolveTemplatesDir());
656
688
  const safePath = sanitizePath(i.path);
657
689
  const detected = tryDetectFramework(engine, safePath, i);
@@ -672,7 +704,7 @@ var listPersonasDefinition = {
672
704
  inputSchema: { type: "object", properties: {} }
673
705
  };
674
706
  async function handleListPersonas() {
675
- const { listPersonas } = await import("./loader-P2P7CV2A.js");
707
+ const { listPersonas } = await import("./loader-Y6A42WBD.js");
676
708
  const result = listPersonas(resolvePersonasDir());
677
709
  return resultToMcpResponse(result);
678
710
  }
@@ -696,10 +728,10 @@ async function handleGeneratePersonaArtifacts(input) {
696
728
  if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.name)) {
697
729
  return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.name}`)));
698
730
  }
699
- const { loadPersona } = await import("./loader-P2P7CV2A.js");
700
- const { generateRuntime } = await import("./runtime-VMOIIP6B.js");
701
- const { generateAgentsMd } = await import("./agents-md-MMVRF77L.js");
702
- const { generateCIWorkflow } = await import("./ci-workflow-HDH4LCOF.js");
731
+ const { loadPersona } = await import("./loader-Y6A42WBD.js");
732
+ const { generateRuntime } = await import("./runtime-XNJUJCSG.js");
733
+ const { generateAgentsMd } = await import("./agents-md-PBKKTSQY.js");
734
+ const { generateCIWorkflow } = await import("./ci-workflow-QZRHAIO2.js");
703
735
  const personasDir = resolvePersonasDir();
704
736
  const filePath = path3.join(personasDir, `${input.name}.yaml`);
705
737
  if (!filePath.startsWith(personasDir)) {
@@ -754,7 +786,7 @@ async function handleRunPersona(input) {
754
786
  if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.persona)) {
755
787
  return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.persona}`)));
756
788
  }
757
- const { loadPersona } = await import("./loader-P2P7CV2A.js");
789
+ const { loadPersona } = await import("./loader-Y6A42WBD.js");
758
790
  const { runPersona } = await import("./runner-TY7DJGQV.js");
759
791
  const { executeSkill } = await import("./skill-executor-GA7BDX3F.js");
760
792
  const personasDir = resolvePersonasDir();
@@ -1134,7 +1166,6 @@ function parseSkillEntry(yamlPath, source, tierOverrides) {
1134
1166
  const meta = result.data;
1135
1167
  const effectiveTier = tierOverrides?.[meta.name] ?? meta.tier;
1136
1168
  if (meta.internal) return null;
1137
- if (effectiveTier !== 3 && source !== "community") return null;
1138
1169
  return {
1139
1170
  tier: effectiveTier ?? 3,
1140
1171
  type: meta.type,
@@ -1518,7 +1549,7 @@ async function autoSyncRoadmap(projectPath) {
1518
1549
  try {
1519
1550
  const roadmapFile = path11.join(projectPath, "docs", "roadmap.md");
1520
1551
  if (!fs10.existsSync(roadmapFile)) return;
1521
- const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-TZQUURSP.js");
1552
+ const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-7EBSGAHX.js");
1522
1553
  const raw = fs10.readFileSync(roadmapFile, "utf-8");
1523
1554
  const parseResult = parseRoadmap(raw);
1524
1555
  if (!parseResult.ok) return;
@@ -1545,7 +1576,7 @@ async function triggerExternalSync(projectPath, roadmapFile) {
1545
1576
  }
1546
1577
  const token = process.env.GITHUB_TOKEN;
1547
1578
  if (!token) return;
1548
- const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-TZQUURSP.js");
1579
+ const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-7EBSGAHX.js");
1549
1580
  const adapter = new GitHubIssuesSyncAdapter({
1550
1581
  token,
1551
1582
  config: trackerConfig
@@ -1657,12 +1688,12 @@ var manageStateDefinition = {
1657
1688
  }
1658
1689
  };
1659
1690
  async function handleShow(projectPath, input) {
1660
- const { loadState } = await import("./dist-TZQUURSP.js");
1691
+ const { loadState } = await import("./dist-7EBSGAHX.js");
1661
1692
  return resultToMcpResponse(await loadState(projectPath, input.stream, input.session));
1662
1693
  }
1663
1694
  async function handleLearn(projectPath, input) {
1664
1695
  if (!input.learning) return mcpError("Error: learning is required for learn action");
1665
- const { appendLearning } = await import("./dist-TZQUURSP.js");
1696
+ const { appendLearning } = await import("./dist-7EBSGAHX.js");
1666
1697
  const result = await appendLearning(
1667
1698
  projectPath,
1668
1699
  input.learning,
@@ -1677,7 +1708,7 @@ async function handleLearn(projectPath, input) {
1677
1708
  async function handleFailure(projectPath, input) {
1678
1709
  if (!input.description) return mcpError("Error: description is required for failure action");
1679
1710
  if (!input.failureType) return mcpError("Error: failureType is required for failure action");
1680
- const { appendFailure } = await import("./dist-TZQUURSP.js");
1711
+ const { appendFailure } = await import("./dist-7EBSGAHX.js");
1681
1712
  const result = await appendFailure(
1682
1713
  projectPath,
1683
1714
  input.description,
@@ -1690,24 +1721,24 @@ async function handleFailure(projectPath, input) {
1690
1721
  return resultToMcpResponse(Ok({ recorded: true }));
1691
1722
  }
1692
1723
  async function handleArchive(projectPath, input) {
1693
- const { archiveFailures } = await import("./dist-TZQUURSP.js");
1724
+ const { archiveFailures } = await import("./dist-7EBSGAHX.js");
1694
1725
  const result = await archiveFailures(projectPath, input.stream, input.session);
1695
1726
  if (!result.ok) return resultToMcpResponse(result);
1696
1727
  return resultToMcpResponse(Ok({ archived: true }));
1697
1728
  }
1698
1729
  async function handleReset(projectPath, input) {
1699
- const { saveState, DEFAULT_STATE } = await import("./dist-TZQUURSP.js");
1730
+ const { saveState, DEFAULT_STATE } = await import("./dist-7EBSGAHX.js");
1700
1731
  const result = await saveState(projectPath, { ...DEFAULT_STATE }, input.stream, input.session);
1701
1732
  if (!result.ok) return resultToMcpResponse(result);
1702
1733
  return resultToMcpResponse(Ok({ reset: true }));
1703
1734
  }
1704
1735
  async function handleGate(projectPath, _input) {
1705
- const { runMechanicalGate } = await import("./dist-TZQUURSP.js");
1736
+ const { runMechanicalGate } = await import("./dist-7EBSGAHX.js");
1706
1737
  return resultToMcpResponse(await runMechanicalGate(projectPath));
1707
1738
  }
1708
1739
  async function handleSaveHandoff(projectPath, input) {
1709
1740
  if (!input.handoff) return mcpError("Error: handoff is required for save-handoff action");
1710
- const { saveHandoff } = await import("./dist-TZQUURSP.js");
1741
+ const { saveHandoff } = await import("./dist-7EBSGAHX.js");
1711
1742
  const result = await saveHandoff(
1712
1743
  projectPath,
1713
1744
  input.handoff,
@@ -1719,7 +1750,7 @@ async function handleSaveHandoff(projectPath, input) {
1719
1750
  return resultToMcpResponse(Ok({ saved: true }));
1720
1751
  }
1721
1752
  async function handleLoadHandoff(projectPath, input) {
1722
- const { loadHandoff } = await import("./dist-TZQUURSP.js");
1753
+ const { loadHandoff } = await import("./dist-7EBSGAHX.js");
1723
1754
  return resultToMcpResponse(await loadHandoff(projectPath, input.stream, input.session));
1724
1755
  }
1725
1756
  async function handleAppendEntry(projectPath, input) {
@@ -1727,7 +1758,7 @@ async function handleAppendEntry(projectPath, input) {
1727
1758
  if (!input.section) return mcpError("Error: section is required for append_entry action");
1728
1759
  if (!input.authorSkill) return mcpError("Error: authorSkill is required for append_entry action");
1729
1760
  if (!input.content) return mcpError("Error: content is required for append_entry action");
1730
- const { appendSessionEntry } = await import("./dist-TZQUURSP.js");
1761
+ const { appendSessionEntry } = await import("./dist-7EBSGAHX.js");
1731
1762
  const result = await appendSessionEntry(
1732
1763
  projectPath,
1733
1764
  input.session,
@@ -1743,7 +1774,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
1743
1774
  if (!input.entryId) return mcpError("Error: entryId is required for update_entry_status action");
1744
1775
  if (!input.newStatus)
1745
1776
  return mcpError("Error: newStatus is required for update_entry_status action");
1746
- const { updateSessionEntryStatus } = await import("./dist-TZQUURSP.js");
1777
+ const { updateSessionEntryStatus } = await import("./dist-7EBSGAHX.js");
1747
1778
  const result = await updateSessionEntryStatus(
1748
1779
  projectPath,
1749
1780
  input.session,
@@ -1756,7 +1787,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
1756
1787
  async function handleReadSection(projectPath, input) {
1757
1788
  if (!input.session) return mcpError("Error: session is required for read_section action");
1758
1789
  if (!input.section) return mcpError("Error: section is required for read_section action");
1759
- const { readSessionSection } = await import("./dist-TZQUURSP.js");
1790
+ const { readSessionSection } = await import("./dist-7EBSGAHX.js");
1760
1791
  const result = await readSessionSection(
1761
1792
  projectPath,
1762
1793
  input.session,
@@ -1766,13 +1797,13 @@ async function handleReadSection(projectPath, input) {
1766
1797
  }
1767
1798
  async function handleReadSections(projectPath, input) {
1768
1799
  if (!input.session) return mcpError("Error: session is required for read_sections action");
1769
- const { readSessionSections } = await import("./dist-TZQUURSP.js");
1800
+ const { readSessionSections } = await import("./dist-7EBSGAHX.js");
1770
1801
  const result = await readSessionSections(projectPath, input.session);
1771
1802
  return resultToMcpResponse(result);
1772
1803
  }
1773
1804
  async function handleArchiveSession(projectPath, input) {
1774
1805
  if (!input.session) return mcpError("Error: session is required for archive_session action");
1775
- const { archiveSession } = await import("./dist-TZQUURSP.js");
1806
+ const { archiveSession } = await import("./dist-7EBSGAHX.js");
1776
1807
  const result = await archiveSession(projectPath, input.session);
1777
1808
  if (!result.ok) return resultToMcpResponse(result);
1778
1809
  await autoSyncRoadmap(projectPath);
@@ -1836,7 +1867,7 @@ var listStreamsDefinition = {
1836
1867
  };
1837
1868
  async function handleListStreams(input) {
1838
1869
  try {
1839
- const { listStreams, loadStreamIndex } = await import("./dist-TZQUURSP.js");
1870
+ const { listStreams, loadStreamIndex } = await import("./dist-7EBSGAHX.js");
1840
1871
  const projectPath = sanitizePath(input.path);
1841
1872
  const indexResult = await loadStreamIndex(projectPath);
1842
1873
  const streamsResult = await listStreams(projectPath);
@@ -1874,7 +1905,7 @@ var checkPhaseGateDefinition = {
1874
1905
  };
1875
1906
  async function handleCheckPhaseGate(input) {
1876
1907
  try {
1877
- const { runCheckPhaseGate } = await import("./check-phase-gate-YQHAH4LL.js");
1908
+ const { runCheckPhaseGate } = await import("./check-phase-gate-WY6UICCL.js");
1878
1909
  const result = await runCheckPhaseGate({ cwd: sanitizePath(input.path) });
1879
1910
  if (result.ok) {
1880
1911
  return { content: [{ type: "text", text: JSON.stringify(result.value) }] };
@@ -1930,7 +1961,7 @@ async function handleValidateCrossCheck(input) {
1930
1961
  };
1931
1962
  }
1932
1963
  try {
1933
- const { runCrossCheck } = await import("./validate-cross-check-M4NP2UF5.js");
1964
+ const { runCrossCheck } = await import("./validate-cross-check-Y4PDR63C.js");
1934
1965
  const specsDir = path12.resolve(projectPath, input.specsDir ?? "docs/specs");
1935
1966
  if (!specsDir.startsWith(projectPath)) {
1936
1967
  return {
@@ -2650,7 +2681,7 @@ async function handleGenerateSlashCommands(input) {
2650
2681
  // src/mcp/resources/state.ts
2651
2682
  async function getStateResource(projectRoot) {
2652
2683
  try {
2653
- const { loadState, migrateToStreams } = await import("./dist-TZQUURSP.js");
2684
+ const { loadState, migrateToStreams } = await import("./dist-7EBSGAHX.js");
2654
2685
  await migrateToStreams(projectRoot);
2655
2686
  const result = await loadState(projectRoot);
2656
2687
  if (result.ok) {
@@ -2728,6 +2759,14 @@ var queryGraphDefinition = {
2728
2759
  type: "string",
2729
2760
  enum: ["summary", "detailed"],
2730
2761
  description: "Response density: summary returns node/edge counts by type + top 10 nodes by connectivity, detailed returns full arrays. Default: detailed"
2762
+ },
2763
+ offset: {
2764
+ type: "number",
2765
+ description: "Number of nodes to skip (pagination). Default: 0. Nodes are sorted by connectivity (edge count desc)."
2766
+ },
2767
+ limit: {
2768
+ type: "number",
2769
+ description: "Max nodes to return (pagination). Default: 50."
2731
2770
  }
2732
2771
  },
2733
2772
  required: ["path", "rootNodeIds"]
@@ -2776,8 +2815,32 @@ async function handleQueryGraph(input) {
2776
2815
  pruneObservability: input.pruneObservability
2777
2816
  }
2778
2817
  });
2779
- const text = input.mode === "summary" ? buildSummaryText(result) : JSON.stringify(result);
2780
- return { content: [{ type: "text", text }] };
2818
+ if (input.mode === "summary") {
2819
+ const text = buildSummaryText(result);
2820
+ return { content: [{ type: "text", text }] };
2821
+ }
2822
+ const edgeCountByNode = /* @__PURE__ */ new Map();
2823
+ for (const edge of result.edges) {
2824
+ edgeCountByNode.set(edge.from, (edgeCountByNode.get(edge.from) ?? 0) + 1);
2825
+ edgeCountByNode.set(edge.to, (edgeCountByNode.get(edge.to) ?? 0) + 1);
2826
+ }
2827
+ const sortedNodes = [...result.nodes].sort(
2828
+ (a, b) => (edgeCountByNode.get(b.id) ?? 0) - (edgeCountByNode.get(a.id) ?? 0)
2829
+ );
2830
+ const offset = input.offset ?? 0;
2831
+ const limit = input.limit ?? 50;
2832
+ const paged = paginate(sortedNodes, offset, limit);
2833
+ const pagedNodeIds = new Set(paged.items.map((n) => n.id));
2834
+ const filteredEdges = result.edges.filter(
2835
+ (e) => pagedNodeIds.has(e.from) || pagedNodeIds.has(e.to)
2836
+ );
2837
+ const response = {
2838
+ nodes: paged.items,
2839
+ edges: filteredEdges,
2840
+ stats: result.stats,
2841
+ pagination: paged.pagination
2842
+ };
2843
+ return { content: [{ type: "text", text: JSON.stringify(response) }] };
2781
2844
  } catch (error) {
2782
2845
  return {
2783
2846
  content: [
@@ -2956,6 +3019,14 @@ var getRelationshipsDefinition = {
2956
3019
  type: "string",
2957
3020
  enum: ["summary", "detailed"],
2958
3021
  description: "Response density: summary returns neighbor counts by type + direct neighbors only, detailed returns full traversal. Default: detailed"
3022
+ },
3023
+ offset: {
3024
+ type: "number",
3025
+ description: "Number of edges to skip (pagination). Default: 0. Edges are sorted by weight (confidence desc)."
3026
+ },
3027
+ limit: {
3028
+ type: "number",
3029
+ description: "Max edges to return (pagination). Default: 50."
2959
3030
  }
2960
3031
  },
2961
3032
  required: ["path", "nodeId"]
@@ -3006,6 +3077,12 @@ async function handleGetRelationships(input) {
3006
3077
  ]
3007
3078
  };
3008
3079
  }
3080
+ const sortedEdges = [...filteredEdges].sort(
3081
+ (a, b) => (b.confidence ?? 1) - (a.confidence ?? 1)
3082
+ );
3083
+ const offset = input.offset ?? 0;
3084
+ const limit = input.limit ?? 50;
3085
+ const paged = paginate(sortedEdges, offset, limit);
3009
3086
  return {
3010
3087
  content: [
3011
3088
  {
@@ -3014,9 +3091,15 @@ async function handleGetRelationships(input) {
3014
3091
  nodeId: input.nodeId,
3015
3092
  direction,
3016
3093
  depth: input.depth ?? 1,
3017
- nodes: filteredNodes,
3018
- edges: filteredEdges,
3019
- stats: result.stats
3094
+ // Filter nodes to only those referenced by paginated edges
3095
+ nodes: filteredNodes.filter(
3096
+ (n) => paged.items.some(
3097
+ (e) => e.from === n.id || e.to === n.id
3098
+ )
3099
+ ),
3100
+ edges: paged.items,
3101
+ stats: result.stats,
3102
+ pagination: paged.pagination
3020
3103
  })
3021
3104
  }
3022
3105
  ]
@@ -3269,6 +3352,14 @@ var detectAnomaliesDefinition = {
3269
3352
  type: "array",
3270
3353
  items: { type: "string" },
3271
3354
  description: "Metrics to analyze (default: cyclomaticComplexity, fanIn, fanOut, hotspotScore, transitiveDepth)"
3355
+ },
3356
+ offset: {
3357
+ type: "number",
3358
+ description: "Number of anomaly entries to skip (pagination). Default: 0. Anomalies are sorted by Z-score desc."
3359
+ },
3360
+ limit: {
3361
+ type: "number",
3362
+ description: "Max anomaly entries to return (pagination). Default: 30."
3272
3363
  }
3273
3364
  },
3274
3365
  required: ["path"]
@@ -3285,8 +3376,17 @@ async function handleDetectAnomalies(input) {
3285
3376
  ...input.threshold !== void 0 && { threshold: input.threshold },
3286
3377
  ...input.metrics !== void 0 && { metrics: input.metrics }
3287
3378
  });
3379
+ const offset = input.offset ?? 0;
3380
+ const limit = input.limit ?? 30;
3381
+ const paged = paginate(report.statisticalOutliers, offset, limit);
3382
+ const { statisticalOutliers: _fullOutliers, ...rest } = report;
3383
+ const response = {
3384
+ ...rest,
3385
+ statisticalOutliers: paged.items,
3386
+ pagination: paged.pagination
3387
+ };
3288
3388
  return {
3289
- content: [{ type: "text", text: JSON.stringify(report) }]
3389
+ content: [{ type: "text", text: JSON.stringify(response) }]
3290
3390
  };
3291
3391
  } catch (error) {
3292
3392
  return {
@@ -3583,7 +3683,7 @@ var generateAgentDefinitionsDefinition = {
3583
3683
  }
3584
3684
  };
3585
3685
  async function handleGenerateAgentDefinitions(input) {
3586
- const { generateAgentDefinitions } = await import("./generate-agent-definitions-OLYWXTYH.js");
3686
+ const { generateAgentDefinitions } = await import("./generate-agent-definitions-PQPG6SX5.js");
3587
3687
  const platforms = input.platform === "all" || !input.platform ? ["claude-code", "gemini-cli"] : [input.platform];
3588
3688
  const results = generateAgentDefinitions({
3589
3689
  platforms: [...platforms],
@@ -3910,7 +4010,7 @@ function shouldTriggerExternalSync(input, response) {
3910
4010
  }
3911
4011
  async function handleManageRoadmap(input) {
3912
4012
  try {
3913
- const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, assignFeature } = await import("./dist-TZQUURSP.js");
4013
+ const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, assignFeature } = await import("./dist-7EBSGAHX.js");
3914
4014
  const { Ok: Ok2 } = await import("./dist-666AAZQ6.js");
3915
4015
  const projectPath = sanitizePath(input.path);
3916
4016
  const deps = {
@@ -4345,7 +4445,7 @@ async function handleTransition(validInput, projectPath, id) {
4345
4445
  const transition = transitionResult.data;
4346
4446
  const prompt = renderTransition(transition);
4347
4447
  try {
4348
- const { saveHandoff } = await import("./dist-TZQUURSP.js");
4448
+ const { saveHandoff } = await import("./dist-7EBSGAHX.js");
4349
4449
  await saveHandoff(
4350
4450
  projectPath,
4351
4451
  {
@@ -4413,7 +4513,7 @@ async function handleEmitInteraction(input) {
4413
4513
  }
4414
4514
  async function recordInteraction(projectPath, id, type, decision, stream) {
4415
4515
  try {
4416
- const { loadState, saveState } = await import("./dist-TZQUURSP.js");
4516
+ const { loadState, saveState } = await import("./dist-7EBSGAHX.js");
4417
4517
  const stateResult = await loadState(projectPath, stream);
4418
4518
  if (stateResult.ok) {
4419
4519
  const state = stateResult.value;
@@ -4429,6 +4529,50 @@ async function recordInteraction(projectPath, id, type, decision, stream) {
4429
4529
  }
4430
4530
 
4431
4531
  // src/mcp/tools/gather-context.ts
4532
+ function flattenSessionSections(sections) {
4533
+ if (!sections) return [];
4534
+ return Object.entries(sections).flatMap(
4535
+ ([name, entries]) => Array.isArray(entries) ? entries.map((e) => ({ sectionName: name, ...e })) : []
4536
+ );
4537
+ }
4538
+ function sectionItems(input) {
4539
+ if (input.section === "graphContext") {
4540
+ const blocks = input.graphContext?.context ?? [];
4541
+ return [...blocks].sort((a, b) => b.score - a.score);
4542
+ }
4543
+ if (input.section === "learnings") {
4544
+ return Array.isArray(input.learnings) ? input.learnings : [];
4545
+ }
4546
+ const flat = flattenSessionSections(input.sessionSections);
4547
+ return flat.sort((a, b) => (b.timestamp ?? "").localeCompare(a.timestamp ?? ""));
4548
+ }
4549
+ function checkSectionGuards(section, mode) {
4550
+ if (section === "graphContext" && (mode ?? "summary") === "summary") {
4551
+ return {
4552
+ content: [
4553
+ {
4554
+ type: "text",
4555
+ text: JSON.stringify({
4556
+ error: "section=graphContext requires mode=detailed. Summary mode aggregates graph blocks into counts \u2014 there are no paginatable items.",
4557
+ hint: 'Pass mode="detailed" to paginate graphContext blocks.'
4558
+ })
4559
+ }
4560
+ ],
4561
+ isError: true
4562
+ };
4563
+ }
4564
+ return null;
4565
+ }
4566
+ function paginateSection(input) {
4567
+ const items = sectionItems(input);
4568
+ const paged = paginate(items, input.offset, input.limit);
4569
+ return {
4570
+ section: input.section,
4571
+ items: paged.items,
4572
+ pagination: paged.pagination,
4573
+ meta: input.meta
4574
+ };
4575
+ }
4432
4576
  var gatherContextDefinition = {
4433
4577
  name: "gather_context",
4434
4578
  description: "Assemble all working context an agent needs in a single call: state, learnings, handoff, graph context, project validation, and session sections. Runs constituents in parallel.",
@@ -4477,6 +4621,19 @@ var gatherContextDefinition = {
4477
4621
  type: "string",
4478
4622
  enum: ["index", "summary", "full"],
4479
4623
  description: 'Retrieval depth for learnings. "index" returns one-line summaries, "summary" (default) returns full entries, "full" returns entries with linked context.'
4624
+ },
4625
+ section: {
4626
+ type: "string",
4627
+ enum: ["graphContext", "learnings", "sessionSections"],
4628
+ description: "Section to paginate. When provided, offset/limit apply within this section only and the response contains only { section, items, pagination, meta }. Note: section=graphContext requires mode=detailed (summary mode has no paginatable blocks). When omitted, returns the full response."
4629
+ },
4630
+ offset: {
4631
+ type: "number",
4632
+ description: "Number of items to skip within the section (pagination). Default: 0. Requires section param."
4633
+ },
4634
+ limit: {
4635
+ type: "number",
4636
+ description: "Max items to return within the section (pagination). Default: 20. Requires section param."
4480
4637
  }
4481
4638
  },
4482
4639
  required: ["path", "intent"]
@@ -4502,10 +4659,10 @@ async function handleGatherContext(input) {
4502
4659
  input.include ?? ["state", "learnings", "handoff", "graph", "validation"]
4503
4660
  );
4504
4661
  const errors = [];
4505
- const statePromise = includeSet.has("state") ? import("./dist-TZQUURSP.js").then(
4662
+ const statePromise = includeSet.has("state") ? import("./dist-7EBSGAHX.js").then(
4506
4663
  (core) => core.loadState(projectPath, void 0, input.session)
4507
4664
  ) : Promise.resolve(null);
4508
- const learningsPromise = includeSet.has("learnings") ? import("./dist-TZQUURSP.js").then(
4665
+ const learningsPromise = includeSet.has("learnings") ? import("./dist-7EBSGAHX.js").then(
4509
4666
  (core) => core.loadBudgetedLearnings(projectPath, {
4510
4667
  intent: input.intent,
4511
4668
  tokenBudget: input.learningsBudget ?? 1e3,
@@ -4514,7 +4671,7 @@ async function handleGatherContext(input) {
4514
4671
  ...input.depth !== void 0 && { depth: input.depth }
4515
4672
  })
4516
4673
  ) : Promise.resolve(null);
4517
- const handoffPromise = includeSet.has("handoff") ? import("./dist-TZQUURSP.js").then(
4674
+ const handoffPromise = includeSet.has("handoff") ? import("./dist-7EBSGAHX.js").then(
4518
4675
  (core) => core.loadHandoff(projectPath, void 0, input.session)
4519
4676
  ) : Promise.resolve(null);
4520
4677
  const graphPromise = includeSet.has("graph") ? (async () => {
@@ -4558,11 +4715,11 @@ async function handleGatherContext(input) {
4558
4715
  context: contextBlocks
4559
4716
  };
4560
4717
  })() : Promise.resolve(null);
4561
- const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-TZQUURSP.js").then(
4718
+ const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-7EBSGAHX.js").then(
4562
4719
  (core) => core.readSessionSections(projectPath, input.session)
4563
4720
  ) : Promise.resolve(null);
4564
4721
  const shouldIncludeEvents = input.includeEvents !== void 0 ? input.includeEvents : includeSet.has("events") || !!input.session && !input.include;
4565
- const eventsPromise = shouldIncludeEvents ? import("./dist-TZQUURSP.js").then(async (core) => {
4722
+ const eventsPromise = shouldIncludeEvents ? import("./dist-7EBSGAHX.js").then(async (core) => {
4566
4723
  const result = await core.loadEvents(projectPath, {
4567
4724
  session: input.session
4568
4725
  });
@@ -4570,7 +4727,7 @@ async function handleGatherContext(input) {
4570
4727
  return core.formatEventTimeline(result.value);
4571
4728
  }) : Promise.resolve(null);
4572
4729
  const validationPromise = includeSet.has("validation") ? (async () => {
4573
- const { handleValidateProject: handleValidateProject2 } = await import("./validate-T7UTXLEQ.js");
4730
+ const { handleValidateProject: handleValidateProject2 } = await import("./validate-MNE25KLZ.js");
4574
4731
  const result = await handleValidateProject2({ path: projectPath });
4575
4732
  const first = result.content[0];
4576
4733
  return first ? JSON.parse(first.text) : null;
@@ -4664,7 +4821,7 @@ async function handleGatherContext(input) {
4664
4821
  };
4665
4822
  if (input.session) {
4666
4823
  try {
4667
- const core = await import("./dist-TZQUURSP.js");
4824
+ const core = await import("./dist-7EBSGAHX.js");
4668
4825
  core.updateSessionIndex(
4669
4826
  projectPath,
4670
4827
  input.session,
@@ -4676,6 +4833,22 @@ async function handleGatherContext(input) {
4676
4833
  const outputText = JSON.stringify(output);
4677
4834
  const tokenEstimate = Math.ceil(outputText.length / 4);
4678
4835
  output.meta.tokenEstimate = tokenEstimate;
4836
+ if (input.section) {
4837
+ const guardError = checkSectionGuards(input.section, input.mode);
4838
+ if (guardError) return guardError;
4839
+ const result = paginateSection({
4840
+ section: input.section,
4841
+ offset: input.offset ?? 0,
4842
+ limit: input.limit ?? 20,
4843
+ graphContext,
4844
+ learnings: Array.isArray(outputLearnings) ? outputLearnings : [],
4845
+ sessionSections,
4846
+ meta: output.meta
4847
+ });
4848
+ return {
4849
+ content: [{ type: "text", text: JSON.stringify(result) }]
4850
+ };
4851
+ }
4679
4852
  return {
4680
4853
  content: [
4681
4854
  {
@@ -4708,6 +4881,14 @@ var reviewChangesDefinition = {
4708
4881
  type: "string",
4709
4882
  enum: ["summary", "detailed"],
4710
4883
  description: "Response density. Default: summary"
4884
+ },
4885
+ offset: {
4886
+ type: "number",
4887
+ description: "Number of findings to skip (pagination). Default: 0. Findings are sorted by severity desc (error > warning > info)."
4888
+ },
4889
+ limit: {
4890
+ type: "number",
4891
+ description: "Max findings to return (pagination). Default: 20."
4711
4892
  }
4712
4893
  },
4713
4894
  required: ["path", "depth"]
@@ -4776,7 +4957,7 @@ async function handleReviewChanges(input) {
4776
4957
  }
4777
4958
  try {
4778
4959
  const reviewFn = DEPTH_HANDLERS[effectiveDepth];
4779
- return await reviewFn(projectPath, diff, diffLines, downgraded);
4960
+ return await reviewFn(projectPath, diff, diffLines, downgraded, input.offset, input.limit);
4780
4961
  } catch (error) {
4781
4962
  return {
4782
4963
  content: [
@@ -4789,12 +4970,15 @@ async function handleReviewChanges(input) {
4789
4970
  };
4790
4971
  }
4791
4972
  }
4792
- async function runQuickReview(projectPath, diff, diffLines, downgraded) {
4793
- const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-RSPUJCJJ.js");
4973
+ async function runQuickReview(projectPath, diff, diffLines, downgraded, offset, limit) {
4974
+ const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-TMEGYMWU.js");
4794
4975
  const result = await handleAnalyzeDiff2({ diff, path: projectPath });
4795
4976
  const firstContent = result.content[0];
4796
4977
  if (!firstContent) throw new Error("Empty analyze_diff response");
4797
4978
  const parsed = JSON.parse(firstContent.text);
4979
+ const rawFindings = parsed.findings ?? parsed.warnings ?? [];
4980
+ const sorted = sortFindingsBySeverity(rawFindings);
4981
+ const paged = paginate(sorted, offset ?? 0, limit ?? 20);
4798
4982
  return {
4799
4983
  content: [
4800
4984
  {
@@ -4802,7 +4986,8 @@ async function runQuickReview(projectPath, diff, diffLines, downgraded) {
4802
4986
  text: JSON.stringify({
4803
4987
  depth: "quick",
4804
4988
  downgraded,
4805
- findings: parsed.findings ?? parsed.warnings ?? [],
4989
+ findings: paged.items,
4990
+ pagination: paged.pagination,
4806
4991
  fileCount: parsed.summary?.filesChanged ?? parsed.files?.length ?? 0,
4807
4992
  lineCount: diffLines,
4808
4993
  ...result.isError ? { error: parsed } : {}
@@ -4820,8 +5005,8 @@ function extractFileCount(diffParsed) {
4820
5005
  const files = diffParsed.files;
4821
5006
  return files?.length ?? 0;
4822
5007
  }
4823
- async function runStandardReview(projectPath, diff, diffLines, downgraded) {
4824
- const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-RSPUJCJJ.js");
5008
+ async function runStandardReview(projectPath, diff, diffLines, downgraded, offset, limit) {
5009
+ const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-TMEGYMWU.js");
4825
5010
  const [diffResult, reviewResult] = await Promise.all([
4826
5011
  handleAnalyzeDiff2({ diff, path: projectPath }),
4827
5012
  handleCreateSelfReview2({ path: projectPath, diff })
@@ -4835,6 +5020,8 @@ async function runStandardReview(projectPath, diff, diffLines, downgraded) {
4835
5020
  ...extractFindings(diffParsed, "findings", "warnings"),
4836
5021
  ...extractFindings(reviewParsed, "findings", "items")
4837
5022
  ];
5023
+ const sorted = sortFindingsBySeverity(findings);
5024
+ const paged = paginate(sorted, offset ?? 0, limit ?? 20);
4838
5025
  return {
4839
5026
  content: [
4840
5027
  {
@@ -4842,7 +5029,8 @@ async function runStandardReview(projectPath, diff, diffLines, downgraded) {
4842
5029
  text: JSON.stringify({
4843
5030
  depth: "standard",
4844
5031
  downgraded,
4845
- findings,
5032
+ findings: paged.items,
5033
+ pagination: paged.pagination,
4846
5034
  diffAnalysis: diffParsed,
4847
5035
  selfReview: reviewParsed,
4848
5036
  fileCount: extractFileCount(diffParsed),
@@ -4852,12 +5040,19 @@ async function runStandardReview(projectPath, diff, diffLines, downgraded) {
4852
5040
  ]
4853
5041
  };
4854
5042
  }
4855
- async function runDeepReview(projectPath, diff, diffLines, _downgraded) {
4856
- const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-XSRO7HYZ.js");
4857
- const result = await handleRunCodeReview2({ path: projectPath, diff });
5043
+ async function runDeepReview(projectPath, diff, diffLines, _downgraded, offset, limit) {
5044
+ const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-YXF5ITL2.js");
5045
+ const result = await handleRunCodeReview2({
5046
+ path: projectPath,
5047
+ diff,
5048
+ _skipPagination: true
5049
+ });
4858
5050
  const deepContent = result.content[0];
4859
5051
  if (!deepContent) throw new Error("Empty code review response");
4860
5052
  const parsed = JSON.parse(deepContent.text);
5053
+ const rawFindings = parsed.findings ?? [];
5054
+ const sorted = sortFindingsBySeverity(rawFindings);
5055
+ const paged = paginate(sorted, offset ?? 0, limit ?? 20);
4861
5056
  return {
4862
5057
  content: [
4863
5058
  {
@@ -4865,7 +5060,8 @@ async function runDeepReview(projectPath, diff, diffLines, _downgraded) {
4865
5060
  text: JSON.stringify({
4866
5061
  depth: "deep",
4867
5062
  downgraded: false,
4868
- findings: parsed.findings ?? [],
5063
+ findings: paged.items,
5064
+ pagination: paged.pagination,
4869
5065
  assessment: parsed.assessment,
4870
5066
  findingCount: parsed.findingCount,
4871
5067
  lineCount: diffLines,
@@ -5139,7 +5335,7 @@ async function handleDetectStaleConstraints(input) {
5139
5335
  ]
5140
5336
  };
5141
5337
  }
5142
- const { detectStaleConstraints } = await import("./dist-TZQUURSP.js");
5338
+ const { detectStaleConstraints } = await import("./dist-7EBSGAHX.js");
5143
5339
  const result = detectStaleConstraints(
5144
5340
  store,
5145
5341
  windowDays,
@@ -5256,10 +5452,10 @@ function countCriticalFindings(securityData) {
5256
5452
  return findings.filter((f) => f.severity === "error").length;
5257
5453
  }
5258
5454
  async function runHealthChecks(projectPath) {
5259
- const { handleAssessProject: handleAssessProject2 } = await import("./assess-project-7JZCVM7D.js");
5260
- const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-JAEDPYQZ.js");
5261
- const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-FZP643BK.js");
5262
- const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-4AQ46P3H.js");
5455
+ const { handleAssessProject: handleAssessProject2 } = await import("./assess-project-74UVWPMB.js");
5456
+ const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-FBSLURIB.js");
5457
+ const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-ZAY73R6A.js");
5458
+ const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-L2YN3CTI.js");
5263
5459
  const [assessResult, depsResult, entropyResult, securityResult] = await Promise.all([
5264
5460
  handleAssessProject2({
5265
5461
  path: projectPath,
@@ -5408,10 +5604,11 @@ async function handleSearchSkills(input) {
5408
5604
  const snapshot = loadCachedSnapshot(projectRoot);
5409
5605
  const freshSnapshot = snapshot && isSnapshotFresh(snapshot, projectRoot) ? snapshot : void 0;
5410
5606
  const queryTerms = query.toLowerCase().split(/\s+/).filter((t) => t.length > 2);
5607
+ const MIN_SCORE = 0.25;
5411
5608
  const results = [];
5412
5609
  for (const [name, entry] of Object.entries(index.skills)) {
5413
5610
  const score = scoreSkill(entry, queryTerms, profile, [], name, freshSnapshot);
5414
- if (score > 0 || queryTerms.length === 0) {
5611
+ if (score >= MIN_SCORE || queryTerms.length === 0) {
5415
5612
  results.push({
5416
5613
  name,
5417
5614
  description: entry.description,
@@ -6012,6 +6209,14 @@ var getDecayTrendsDefinition = {
6012
6209
  "module-size",
6013
6210
  "dependency-depth"
6014
6211
  ]
6212
+ },
6213
+ offset: {
6214
+ type: "number",
6215
+ description: "Number of trend entries to skip (pagination). Default: 0. Trends are sorted by decay magnitude (absolute delta) desc. Ignored when category is set (category filter returns a single entry)."
6216
+ },
6217
+ limit: {
6218
+ type: "number",
6219
+ description: "Max trend entries to return (pagination). Default: 20. Ignored when category is set (category filter returns a single entry)."
6015
6220
  }
6016
6221
  },
6017
6222
  required: ["path"]
@@ -6033,7 +6238,7 @@ async function handleGetDecayTrends(input) {
6033
6238
  };
6034
6239
  }
6035
6240
  try {
6036
- const core = await import("./dist-TZQUURSP.js");
6241
+ const core = await import("./dist-7EBSGAHX.js");
6037
6242
  const { TimelineManager } = core;
6038
6243
  const manager = new TimelineManager(projectPath);
6039
6244
  const timeline = manager.load();
@@ -6051,9 +6256,14 @@ async function handleGetDecayTrends(input) {
6051
6256
  if (input.last !== void 0) trendOptions.last = input.last;
6052
6257
  if (input.since !== void 0) trendOptions.since = input.since;
6053
6258
  const trends = manager.trends(trendOptions);
6259
+ const categoryEntries = Object.entries(trends.categories).map(([name, trend]) => ({
6260
+ category: name,
6261
+ ...trend
6262
+ }));
6263
+ categoryEntries.sort((a, b) => Math.abs(b.delta) - Math.abs(a.delta));
6054
6264
  if (input.category) {
6055
- const categoryTrend = trends.categories[input.category];
6056
- if (!categoryTrend) {
6265
+ const match = categoryEntries.find((e) => e.category === input.category);
6266
+ if (!match) {
6057
6267
  return {
6058
6268
  content: [
6059
6269
  {
@@ -6070,7 +6280,12 @@ async function handleGetDecayTrends(input) {
6070
6280
  text: JSON.stringify(
6071
6281
  {
6072
6282
  category: input.category,
6073
- trend: categoryTrend,
6283
+ trend: {
6284
+ current: match.current,
6285
+ previous: match.previous,
6286
+ delta: match.delta,
6287
+ direction: match.direction
6288
+ },
6074
6289
  snapshotCount: trends.snapshotCount,
6075
6290
  from: trends.from,
6076
6291
  to: trends.to
@@ -6082,11 +6297,23 @@ async function handleGetDecayTrends(input) {
6082
6297
  ]
6083
6298
  };
6084
6299
  }
6300
+ const paged = paginate(categoryEntries, input.offset ?? 0, input.limit ?? 20);
6085
6301
  return {
6086
6302
  content: [
6087
6303
  {
6088
6304
  type: "text",
6089
- text: JSON.stringify(trends, null, 2)
6305
+ text: JSON.stringify(
6306
+ {
6307
+ stability: trends.stability,
6308
+ categories: paged.items,
6309
+ snapshotCount: trends.snapshotCount,
6310
+ from: trends.from,
6311
+ to: trends.to,
6312
+ pagination: paged.pagination
6313
+ },
6314
+ null,
6315
+ 2
6316
+ )
6090
6317
  }
6091
6318
  ]
6092
6319
  };
@@ -6117,6 +6344,14 @@ var codeOutlineDefinition = {
6117
6344
  glob: {
6118
6345
  type: "string",
6119
6346
  description: 'Optional glob pattern to filter files (e.g. "*.ts", "src/**/*.py"). Only used when path is a directory.'
6347
+ },
6348
+ offset: {
6349
+ type: "number",
6350
+ description: "Number of file entries to skip (pagination, directory mode only). Default: 0. Files are sorted by modification time desc."
6351
+ },
6352
+ limit: {
6353
+ type: "number",
6354
+ description: "Max file entries to return (pagination, directory mode only). Default: 30."
6120
6355
  }
6121
6356
  },
6122
6357
  required: ["path"]
@@ -6138,7 +6373,7 @@ async function handleCodeOutline(input) {
6138
6373
  };
6139
6374
  }
6140
6375
  try {
6141
- const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-TZQUURSP.js");
6376
+ const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-7EBSGAHX.js");
6142
6377
  const { stat } = await import("fs/promises");
6143
6378
  const stats = await stat(targetPath).catch(() => null);
6144
6379
  if (stats?.isFile()) {
@@ -6150,19 +6385,31 @@ async function handleCodeOutline(input) {
6150
6385
  const exts = Object.keys(EXTENSION_MAP).map((e) => e.slice(1));
6151
6386
  const pattern = input.glob ?? `**/*.{${exts.join(",")}}`;
6152
6387
  const files = await glob(pattern, { cwd: targetPath, absolute: true });
6388
+ const fileStats = await Promise.all(
6389
+ files.map(async (f) => {
6390
+ const fStat = await stat(f).catch(() => null);
6391
+ return { path: f, mtimeMs: fStat?.mtimeMs ?? 0 };
6392
+ })
6393
+ );
6394
+ fileStats.sort((a, b) => b.mtimeMs - a.mtimeMs);
6395
+ const { paginate: paginate2 } = await import("./dist-7EBSGAHX.js");
6396
+ const paged = paginate2(fileStats, input.offset ?? 0, input.limit ?? 30);
6153
6397
  const results = [];
6154
- const MAX_FILES = 50;
6155
- for (const file of files.slice(0, MAX_FILES)) {
6156
- const outline = await getOutline(file);
6398
+ for (const entry of paged.items) {
6399
+ const outline = await getOutline(entry.path);
6157
6400
  results.push(formatOutline(outline));
6158
6401
  }
6159
- if (files.length > MAX_FILES) {
6160
- results.push(
6161
- `
6162
- ... and ${files.length - MAX_FILES} more files (use a narrower glob to see them)`
6163
- );
6164
- }
6165
- return { content: [{ type: "text", text: results.join("\n\n") }] };
6402
+ return {
6403
+ content: [
6404
+ {
6405
+ type: "text",
6406
+ text: JSON.stringify({
6407
+ outlines: results.join("\n\n"),
6408
+ pagination: paged.pagination
6409
+ })
6410
+ }
6411
+ ]
6412
+ };
6166
6413
  }
6167
6414
  return {
6168
6415
  content: [{ type: "text", text: `Error: Path not found: ${targetPath}` }],
@@ -6218,7 +6465,7 @@ async function handleCodeSearch(input) {
6218
6465
  };
6219
6466
  }
6220
6467
  try {
6221
- const { searchSymbols } = await import("./dist-TZQUURSP.js");
6468
+ const { searchSymbols } = await import("./dist-7EBSGAHX.js");
6222
6469
  const result = await searchSymbols(input.query, directory, input.glob);
6223
6470
  const lines = [`Search: "${result.query}" \u2014 ${result.matches.length} matches`];
6224
6471
  for (const match of result.matches) {
@@ -6287,7 +6534,7 @@ async function handleCodeUnfold(input) {
6287
6534
  }
6288
6535
  try {
6289
6536
  if (input.symbol) {
6290
- const { unfoldSymbol } = await import("./dist-TZQUURSP.js");
6537
+ const { unfoldSymbol } = await import("./dist-7EBSGAHX.js");
6291
6538
  const result = await unfoldSymbol(filePath, input.symbol);
6292
6539
  const header = result.warning ? `${result.file}:${result.startLine}-${result.endLine} ${result.warning}
6293
6540
  ` : `${result.file}:${result.startLine}-${result.endLine}
@@ -6295,7 +6542,7 @@ async function handleCodeUnfold(input) {
6295
6542
  return { content: [{ type: "text", text: header + result.content }] };
6296
6543
  }
6297
6544
  if (input.startLine != null && input.endLine != null) {
6298
- const { unfoldRange } = await import("./dist-TZQUURSP.js");
6545
+ const { unfoldRange } = await import("./dist-7EBSGAHX.js");
6299
6546
  const result = await unfoldRange(filePath, input.startLine, input.endLine);
6300
6547
  const header = `${result.file}:${result.startLine}-${result.endLine}
6301
6548
  `;
@@ -6480,7 +6727,7 @@ async function handlePredictFailures(input) {
6480
6727
  };
6481
6728
  }
6482
6729
  try {
6483
- const core = await import("./dist-TZQUURSP.js");
6730
+ const core = await import("./dist-7EBSGAHX.js");
6484
6731
  const { TimelineManager, PredictionEngine, SpecImpactEstimator } = core;
6485
6732
  const manager = new TimelineManager(projectPath);
6486
6733
  const includeRoadmap = input.includeRoadmap !== false;
@@ -7029,7 +7276,7 @@ async function appendUpdateNotification(result, resolvedRoot) {
7029
7276
  shouldRunCheck,
7030
7277
  readCheckState,
7031
7278
  spawnBackgroundCheck
7032
- } = await import("./dist-TZQUURSP.js");
7279
+ } = await import("./dist-7EBSGAHX.js");
7033
7280
  const { CLI_VERSION } = await import("./version-KFFPOQAX.js");
7034
7281
  const configInterval = readConfigInterval(resolvedRoot);
7035
7282
  const DEFAULT_INTERVAL = 864e5;