howtofixcli 0.7.13 → 0.7.15

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 (161) hide show
  1. package/dist/chunk-27TRKD65.js +2 -0
  2. package/dist/chunk-3FYCFLNK.js +1 -0
  3. package/dist/chunk-56SEAGAQ.js +1 -0
  4. package/dist/chunk-6FUWMLWO.js +1 -0
  5. package/dist/chunk-7CHDNTH6.js +1 -0
  6. package/dist/chunk-7DTQKDO4.js +2 -0
  7. package/dist/chunk-AGGIYXN7.js +2 -0
  8. package/dist/chunk-AUDMRGWF.js +189 -0
  9. package/dist/chunk-CPJKKHGH.js +1 -0
  10. package/dist/chunk-DAPXGSGD.js +12 -0
  11. package/dist/chunk-DOD7MUGX.js +1 -0
  12. package/dist/chunk-DV2BBBBJ.js +2 -0
  13. package/dist/chunk-EIBOS5KO.js +5 -0
  14. package/dist/chunk-EYWOVCSS.js +6 -0
  15. package/dist/chunk-FPXVDP32.js +8 -0
  16. package/dist/chunk-GXB7RZHH.js +1 -0
  17. package/dist/chunk-HT3MFLAV.js +34 -0
  18. package/dist/chunk-ILDDDLRC.js +1 -0
  19. package/dist/chunk-JFYVRWJI.js +2 -0
  20. package/dist/chunk-JMKK26AT.js +2 -0
  21. package/dist/chunk-LAHVHRCS.js +2 -0
  22. package/dist/chunk-LOOFOBTS.js +1 -0
  23. package/dist/chunk-LSJC73DG.js +1 -0
  24. package/dist/chunk-MOKUBKE7.js +1 -0
  25. package/dist/chunk-N345KWWK.js +1 -0
  26. package/dist/chunk-ONZLNFQ2.js +3 -0
  27. package/dist/chunk-ORJ2QZBG.js +3 -0
  28. package/dist/chunk-PCALBZOO.js +2 -0
  29. package/dist/chunk-SX5VE6XA.js +110 -0
  30. package/dist/chunk-TSEKPGK4.js +1 -0
  31. package/dist/chunk-UNK5HRQR.js +1 -0
  32. package/dist/chunk-UTYFLLSM.js +1 -0
  33. package/dist/chunk-V2RPZMLK.js +1 -0
  34. package/dist/chunk-V3R4FYTJ.js +1 -0
  35. package/dist/chunk-V656XVXV.js +8 -0
  36. package/dist/chunk-VLMQSD25.js +1 -0
  37. package/dist/chunk-WKUJ7CFO.js +1 -0
  38. package/dist/chunk-WOT6VMZA.js +1 -0
  39. package/dist/chunk-WUPU6LTD.js +4 -0
  40. package/dist/chunk-WX3V5P7U.js +5 -0
  41. package/dist/chunk-Y7YM5R75.js +5 -0
  42. package/dist/chunk-YW7NORH3.js +2 -0
  43. package/dist/main.js +99 -540
  44. package/package.json +17 -64
  45. package/dist/account-credential.js +0 -136
  46. package/dist/account-credential.test.js +0 -38
  47. package/dist/activity.js +0 -124
  48. package/dist/agent-defs.js +0 -237
  49. package/dist/agent-limiter.js +0 -68
  50. package/dist/agents.js +0 -554
  51. package/dist/anim.js +0 -361
  52. package/dist/args.js +0 -228
  53. package/dist/at-file.js +0 -28
  54. package/dist/brand-extension.js +0 -87
  55. package/dist/brand.js +0 -76
  56. package/dist/browser.js +0 -58
  57. package/dist/cache-report.js +0 -139
  58. package/dist/checkpoint.js +0 -437
  59. package/dist/claims.js +0 -167
  60. package/dist/cli-auth.js +0 -142
  61. package/dist/cli-checkin.js +0 -120
  62. package/dist/cli-credentials.js +0 -254
  63. package/dist/clipboard.js +0 -149
  64. package/dist/collapse.js +0 -129
  65. package/dist/commands.js +0 -294
  66. package/dist/compaction-guard.js +0 -81
  67. package/dist/context-extension.js +0 -17
  68. package/dist/dcp/commands.js +0 -172
  69. package/dist/dcp/compress-state.js +0 -139
  70. package/dist/dcp/compress.js +0 -329
  71. package/dist/dcp/dcp-extension.js +0 -295
  72. package/dist/dcp/dedup.js +0 -93
  73. package/dist/dcp/ids.js +0 -189
  74. package/dist/dcp/index.js +0 -25
  75. package/dist/dcp/middle-prune.js +0 -76
  76. package/dist/dcp/prompts.js +0 -68
  77. package/dist/dcp/protected-content.js +0 -221
  78. package/dist/dcp/protected.js +0 -161
  79. package/dist/dcp/prune.js +0 -418
  80. package/dist/dcp/state.js +0 -176
  81. package/dist/device-id.js +0 -90
  82. package/dist/device-id.test.js +0 -23
  83. package/dist/errors.js +0 -63
  84. package/dist/extensions.js +0 -48
  85. package/dist/fatal.js +0 -35
  86. package/dist/feed.js +0 -498
  87. package/dist/fs-atomic.js +0 -54
  88. package/dist/gateway-errors.js +0 -90
  89. package/dist/git.js +0 -230
  90. package/dist/goal-extension.js +0 -88
  91. package/dist/goal.js +0 -222
  92. package/dist/hooks-extension.js +0 -176
  93. package/dist/hooks.js +0 -443
  94. package/dist/howtofix-account.js +0 -735
  95. package/dist/hud-line.js +0 -153
  96. package/dist/hwid.js +0 -130
  97. package/dist/interrupt.js +0 -60
  98. package/dist/json-events.js +0 -50
  99. package/dist/level-style.js +0 -112
  100. package/dist/loop-guard.js +0 -95
  101. package/dist/lsp-tools.js +0 -32
  102. package/dist/lsp.js +0 -429
  103. package/dist/mcp-config.js +0 -85
  104. package/dist/mcp-lifecycle.js +0 -147
  105. package/dist/model-catalog.js +0 -217
  106. package/dist/model-facts.js +0 -35
  107. package/dist/model-resolve.js +0 -65
  108. package/dist/notes.js +0 -78
  109. package/dist/oauth-login.js +0 -568
  110. package/dist/paths.js +0 -61
  111. package/dist/permissions.js +0 -298
  112. package/dist/plan-mode.js +0 -363
  113. package/dist/preset-command.js +0 -227
  114. package/dist/preset-extension.js +0 -35
  115. package/dist/preset-mcp.js +0 -292
  116. package/dist/presets.js +0 -727
  117. package/dist/prompt-files.js +0 -103
  118. package/dist/prompt-text.js +0 -41
  119. package/dist/proxy.js +0 -137
  120. package/dist/quality/ast.js +0 -196
  121. package/dist/quality/cognitive.js +0 -83
  122. package/dist/quality/cyclomatic.js +0 -30
  123. package/dist/quality/halstead.js +0 -83
  124. package/dist/quality/index.js +0 -18
  125. package/dist/quality/length.js +0 -3
  126. package/dist/quality/maintainability.js +0 -15
  127. package/dist/quality/nesting.js +0 -57
  128. package/dist/quality/report.js +0 -803
  129. package/dist/quality/smells.js +0 -67
  130. package/dist/quality-tool.js +0 -63
  131. package/dist/read-only-commands.js +0 -597
  132. package/dist/repo-map.js +0 -292
  133. package/dist/rtk.js +0 -193
  134. package/dist/sandbox.js +0 -105
  135. package/dist/schema.js +0 -214
  136. package/dist/session-lifecycle.js +0 -19
  137. package/dist/session-retention.js +0 -111
  138. package/dist/session.js +0 -447
  139. package/dist/sessions.js +0 -100
  140. package/dist/settings.js +0 -148
  141. package/dist/skills.js +0 -35
  142. package/dist/slop-tool.js +0 -96
  143. package/dist/spend-cap.js +0 -43
  144. package/dist/subagent.js +0 -171
  145. package/dist/tar.js +0 -146
  146. package/dist/theme.js +0 -79
  147. package/dist/thinking.js +0 -45
  148. package/dist/todo.js +0 -114
  149. package/dist/tool-loadout.js +0 -97
  150. package/dist/tool-render.js +0 -769
  151. package/dist/tools.js +0 -176
  152. package/dist/ui.js +0 -4778
  153. package/dist/update.js +0 -551
  154. package/dist/usage-segment.js +0 -69
  155. package/dist/web-tools.js +0 -46
  156. package/dist/web.js +0 -265
  157. package/dist/welcome.js +0 -179
  158. package/dist/workflow-engine.js +0 -246
  159. package/dist/workflow-progress.js +0 -446
  160. package/dist/workflow-view.js +0 -195
  161. package/dist/workflow.js +0 -349
@@ -1,67 +0,0 @@
1
- /**
2
- * Compound smells — spec §3.7.
3
- *
4
- * A smell fires only when SEVERAL metrics are over their warn line at the same
5
- * time; one metric over the line is just a number and is reported as such.
6
- * Ids, labels, and conditions come from the reference
7
- * (`code-multivitals/src/analyzers/smells.ts`); the `warn`/`ok` tests of the
8
- * reference are expressed here as severity RANKS supplied by the caller, so
9
- * this module depends on neither thresholds nor config and stays trivially
10
- * testable.
11
- *
12
- * Rank semantics (from `report.ts`): `0` = ok, `1` = warn, `2` = error; a
13
- * metric "at warn" means rank ≥ 1 (warn or worse), and MI < 65 is exactly
14
- * rank(mi) ≥ 1.
15
- */
16
- /** The report prints one concrete next step per smell that fired (spec §6). */
17
- export const SMELL_SUGGESTIONS = {
18
- "god-function": "split it into smaller functions, one job each",
19
- incomprehensible: "extract helpers and simplify the flow before touching it",
20
- bloated: "long but linear; extract helpers",
21
- "deeply-tangled": "nesting, not branching; flatten with early returns",
22
- fragile: "many branches; add guard clauses and tests around it",
23
- };
24
- export function detectSmells(values, ranks) {
25
- const smells = [];
26
- // God Function: does too much — long, branchy, AND deep.
27
- if (ranks.cyclomatic >= 1 && ranks.length >= 1 && ranks.nesting >= 1) {
28
- smells.push({
29
- id: "god-function",
30
- label: "God Function",
31
- reason: `high cyclomatic complexity (${values.cyclomatic}), long body (${values.length} lines), and deep nesting (${values.nesting}) — likely doing too many things`,
32
- });
33
- }
34
- // Incomprehensible: hard to read — cognitively dense, big vocabulary, low MI.
35
- if (ranks.cognitive >= 1 && ranks.halstead >= 1 && ranks.mi >= 1) {
36
- smells.push({
37
- id: "incomprehensible",
38
- label: "Incomprehensible",
39
- reason: `high cognitive complexity (${values.cognitive}) and Halstead volume (${values.halstead}) with MI ${values.mi} — very hard to understand`,
40
- });
41
- }
42
- // Bloated: too much code, but not because of branching — extract helpers.
43
- if (ranks.length >= 1 && ranks.halstead >= 1 && ranks.cyclomatic === 0) {
44
- smells.push({
45
- id: "bloated",
46
- label: "Bloated",
47
- reason: `large function (${values.length} lines) with high vocabulary (Halstead ${values.halstead}) but low branching — consider extracting helpers`,
48
- });
49
- }
50
- // Deeply Tangled: the complexity comes from nesting, not from branches.
51
- if (ranks.nesting >= 1 && ranks.cognitive >= 1 && ranks.cyclomatic === 0) {
52
- smells.push({
53
- id: "deeply-tangled",
54
- label: "Deeply Tangled",
55
- reason: `nesting depth ${values.nesting} drives cognitive complexity ${values.cognitive} — flatten with early returns or extracted helpers`,
56
- });
57
- }
58
- // Fragile: branchy and hard to maintain, but short enough to not be bloated.
59
- if (ranks.cyclomatic >= 1 && ranks.mi >= 1 && ranks.length === 0) {
60
- smells.push({
61
- id: "fragile",
62
- label: "Fragile",
63
- reason: `high cyclomatic complexity (${values.cyclomatic}) with MI ${values.mi} — many branches, hard to change safely`,
64
- });
65
- }
66
- return smells;
67
- }
@@ -1,63 +0,0 @@
1
- /**
2
- * The `quality` tool — metrics for the code the agent just wrote.
3
- *
4
- * Read-only by construction: it analyses source and reports, it never edits.
5
- * That is the whole point of exposing it to the agent. A run that ends with
6
- * "done" can be checked against numbers instead of a claim, and the agent can
7
- * act on the numbers before it reports: "cognitive 31, split it" is something
8
- * it can fix, "looks clean to me" is not.
9
- *
10
- * It defaults to the files the agent is most likely to have touched rather than
11
- * the whole project, because a whole-project scan on a large repo is slow and
12
- * buries the one function the agent just wrote under a hundred unrelated
13
- * warnings.
14
- */
15
- import { defineTool } from "@netrodev/hxf-coding-agent";
16
- import { Type } from "typebox";
17
- import { analyzeFiles, collectTargetPaths, formatHuman, loadQualityConfig, qualityEnabled, reportScore, summarize } from "./quality/index.js";
18
- /** Longest report handed back to the model, so one call cannot flood the context. */
19
- const MAX_REPORT_CHARS = 6000;
20
- export const qualityTool = defineTool({
21
- name: "quality",
22
- label: "quality",
23
- description: "Measure code quality: cyclomatic and cognitive complexity, nesting depth, function length, Halstead volume, maintainability index, and compound smells like god-function and deeply-tangled. Read-only. Use it before reporting a task finished, especially on functions you just wrote or changed; it reports concrete numbers with line numbers and a suggested next step, so 'is this too complex' stops being a guess. Defaults to the changed files; pass a path to narrow it further.",
24
- promptSnippet: "quality: complexity and maintainability metrics for changed code",
25
- parameters: Type.Object({
26
- path: Type.Optional(Type.String({ description: "One file or directory, relative to the project root. Omit to scan the changed set." })),
27
- changes: Type.Optional(Type.Boolean({ description: "Scan only files changed against the base ref. Default true when path is omitted." })),
28
- base: Type.Optional(Type.String({ description: "Git ref for `changes`. Defaults to HEAD." })),
29
- top: Type.Optional(Type.Number({ description: "Only report the N worst functions." })),
30
- }),
31
- async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
32
- const cwd = ctx.cwd ?? process.cwd();
33
- const state = qualityEnabled(cwd);
34
- if (!state.enabled) {
35
- return {
36
- content: [{ type: "text", text: `quality metrics are off (source: ${state.source})` }],
37
- details: { off: true },
38
- };
39
- }
40
- const config = loadQualityConfig(cwd);
41
- const useChanges = params.changes ?? params.path === undefined;
42
- const paths = collectTargetPaths(cwd, { changes: useChanges, base: params.base, target: params.path }, config.ignore);
43
- if (paths.length === 0) {
44
- return {
45
- content: [{ type: "text", text: useChanges ? "no changed files to measure" : "no source files found" }],
46
- details: { files: 0 },
47
- };
48
- }
49
- const report = await analyzeFiles(paths, config);
50
- const summary = summarize(report);
51
- const text = formatHuman(report, config, { top: params.top });
52
- const clipped = text.length > MAX_REPORT_CHARS ? `${text.slice(0, MAX_REPORT_CHARS)}\n… (truncated; run the quality script for the full report)` : text;
53
- return {
54
- content: [{ type: "text", text: clipped }],
55
- details: {
56
- files: summary.files,
57
- functions: summary.functions,
58
- findings: summary.findings,
59
- score: reportScore(report),
60
- },
61
- };
62
- },
63
- });