howtofixcli 0.7.8 → 0.7.9

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 (152) 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-63ZCQDXH.js +6 -0
  5. package/dist/chunk-6FUWMLWO.js +1 -0
  6. package/dist/chunk-7CHDNTH6.js +1 -0
  7. package/dist/chunk-ACOMNDUL.js +185 -0
  8. package/dist/chunk-AEVPET7X.js +2 -0
  9. package/dist/chunk-AGGIYXN7.js +2 -0
  10. package/dist/chunk-BHVBO4SC.js +1 -0
  11. package/dist/chunk-FPXVDP32.js +8 -0
  12. package/dist/chunk-GIUYIKH3.js +109 -0
  13. package/dist/chunk-GQCAJ56I.js +5 -0
  14. package/dist/chunk-GXB7RZHH.js +1 -0
  15. package/dist/chunk-IGEY3AWF.js +1 -0
  16. package/dist/chunk-ILDDDLRC.js +1 -0
  17. package/dist/chunk-JFYVRWJI.js +2 -0
  18. package/dist/chunk-MVLCGU3G.js +1 -0
  19. package/dist/chunk-N345KWWK.js +1 -0
  20. package/dist/chunk-NBQFPCRT.js +1 -0
  21. package/dist/chunk-OIPSLIZE.js +5 -0
  22. package/dist/chunk-ORJ2QZBG.js +3 -0
  23. package/dist/chunk-PCALBZOO.js +2 -0
  24. package/dist/chunk-PDNBGUYP.js +2 -0
  25. package/dist/chunk-S656RE4A.js +1 -0
  26. package/dist/chunk-TSEKPGK4.js +1 -0
  27. package/dist/chunk-U6CI6KXN.js +34 -0
  28. package/dist/chunk-UTYFLLSM.js +1 -0
  29. package/dist/chunk-V3R4FYTJ.js +1 -0
  30. package/dist/chunk-V656XVXV.js +8 -0
  31. package/dist/chunk-WKUJ7CFO.js +1 -0
  32. package/dist/chunk-WOT6VMZA.js +1 -0
  33. package/dist/chunk-WUPU6LTD.js +4 -0
  34. package/dist/chunk-WX3V5P7U.js +5 -0
  35. package/dist/chunk-ZKZ6WCI3.js +2 -0
  36. package/dist/main.js +94 -536
  37. package/package.json +15 -62
  38. package/dist/account-credential.js +0 -136
  39. package/dist/account-credential.test.js +0 -38
  40. package/dist/activity.js +0 -124
  41. package/dist/agent-defs.js +0 -237
  42. package/dist/agent-limiter.js +0 -68
  43. package/dist/agents.js +0 -554
  44. package/dist/anim.js +0 -361
  45. package/dist/args.js +0 -228
  46. package/dist/at-file.js +0 -28
  47. package/dist/brand-extension.js +0 -87
  48. package/dist/brand.js +0 -76
  49. package/dist/browser.js +0 -58
  50. package/dist/cache-report.js +0 -139
  51. package/dist/checkpoint.js +0 -437
  52. package/dist/claims.js +0 -167
  53. package/dist/cli-auth.js +0 -142
  54. package/dist/cli-checkin.js +0 -120
  55. package/dist/cli-credentials.js +0 -254
  56. package/dist/clipboard.js +0 -149
  57. package/dist/collapse.js +0 -129
  58. package/dist/commands.js +0 -301
  59. package/dist/compaction-guard.js +0 -81
  60. package/dist/context-extension.js +0 -17
  61. package/dist/dcp/commands.js +0 -172
  62. package/dist/dcp/compress-state.js +0 -139
  63. package/dist/dcp/compress.js +0 -329
  64. package/dist/dcp/dcp-extension.js +0 -288
  65. package/dist/dcp/dedup.js +0 -93
  66. package/dist/dcp/ids.js +0 -189
  67. package/dist/dcp/index.js +0 -25
  68. package/dist/dcp/prompts.js +0 -68
  69. package/dist/dcp/protected-content.js +0 -221
  70. package/dist/dcp/protected.js +0 -161
  71. package/dist/dcp/prune.js +0 -418
  72. package/dist/dcp/state.js +0 -176
  73. package/dist/device-id.js +0 -90
  74. package/dist/device-id.test.js +0 -23
  75. package/dist/errors.js +0 -63
  76. package/dist/extensions.js +0 -48
  77. package/dist/fatal.js +0 -35
  78. package/dist/feed.js +0 -498
  79. package/dist/fs-atomic.js +0 -54
  80. package/dist/gateway-errors.js +0 -90
  81. package/dist/git.js +0 -230
  82. package/dist/goal-extension.js +0 -88
  83. package/dist/goal.js +0 -222
  84. package/dist/hooks-extension.js +0 -176
  85. package/dist/hooks.js +0 -443
  86. package/dist/howtofix-account.js +0 -715
  87. package/dist/hud-line.js +0 -153
  88. package/dist/hwid.js +0 -130
  89. package/dist/interrupt.js +0 -60
  90. package/dist/json-events.js +0 -50
  91. package/dist/level-style.js +0 -112
  92. package/dist/loop-guard.js +0 -95
  93. package/dist/lsp-tools.js +0 -32
  94. package/dist/lsp.js +0 -347
  95. package/dist/mcp-config.js +0 -85
  96. package/dist/mcp-lifecycle.js +0 -147
  97. package/dist/model-catalog.js +0 -217
  98. package/dist/model-resolve.js +0 -65
  99. package/dist/notes.js +0 -78
  100. package/dist/oauth-login.js +0 -568
  101. package/dist/paths.js +0 -61
  102. package/dist/permissions.js +0 -298
  103. package/dist/plan-mode.js +0 -363
  104. package/dist/preset-command.js +0 -227
  105. package/dist/preset-extension.js +0 -35
  106. package/dist/preset-mcp.js +0 -292
  107. package/dist/presets.js +0 -727
  108. package/dist/prompt-files.js +0 -103
  109. package/dist/prompt-text.js +0 -41
  110. package/dist/proxy.js +0 -137
  111. package/dist/quality/ast.js +0 -196
  112. package/dist/quality/cognitive.js +0 -83
  113. package/dist/quality/cyclomatic.js +0 -30
  114. package/dist/quality/halstead.js +0 -83
  115. package/dist/quality/index.js +0 -18
  116. package/dist/quality/length.js +0 -3
  117. package/dist/quality/maintainability.js +0 -15
  118. package/dist/quality/nesting.js +0 -57
  119. package/dist/quality/report.js +0 -803
  120. package/dist/quality/smells.js +0 -67
  121. package/dist/quality-tool.js +0 -63
  122. package/dist/read-only-commands.js +0 -597
  123. package/dist/repo-map.js +0 -292
  124. package/dist/rtk.js +0 -193
  125. package/dist/sandbox.js +0 -105
  126. package/dist/schema.js +0 -214
  127. package/dist/session-lifecycle.js +0 -19
  128. package/dist/session-retention.js +0 -111
  129. package/dist/session.js +0 -446
  130. package/dist/sessions.js +0 -100
  131. package/dist/settings.js +0 -148
  132. package/dist/skills.js +0 -35
  133. package/dist/slop-tool.js +0 -96
  134. package/dist/spend-cap.js +0 -43
  135. package/dist/subagent.js +0 -171
  136. package/dist/tar.js +0 -146
  137. package/dist/theme.js +0 -79
  138. package/dist/thinking.js +0 -45
  139. package/dist/todo.js +0 -114
  140. package/dist/tool-loadout.js +0 -97
  141. package/dist/tool-render.js +0 -769
  142. package/dist/tools.js +0 -176
  143. package/dist/ui.js +0 -4757
  144. package/dist/update.js +0 -533
  145. package/dist/usage-segment.js +0 -69
  146. package/dist/web-tools.js +0 -46
  147. package/dist/web.js +0 -265
  148. package/dist/welcome.js +0 -179
  149. package/dist/workflow-engine.js +0 -246
  150. package/dist/workflow-progress.js +0 -446
  151. package/dist/workflow-view.js +0 -195
  152. 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
- });