howtofixcli 0.7.7 → 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.
- package/dist/chunk-27TRKD65.js +2 -0
- package/dist/chunk-3FYCFLNK.js +1 -0
- package/dist/chunk-56SEAGAQ.js +1 -0
- package/dist/chunk-63ZCQDXH.js +6 -0
- package/dist/chunk-6FUWMLWO.js +1 -0
- package/dist/chunk-7CHDNTH6.js +1 -0
- package/dist/chunk-ACOMNDUL.js +185 -0
- package/dist/chunk-AEVPET7X.js +2 -0
- package/dist/chunk-AGGIYXN7.js +2 -0
- package/dist/chunk-BHVBO4SC.js +1 -0
- package/dist/chunk-FPXVDP32.js +8 -0
- package/dist/chunk-GIUYIKH3.js +109 -0
- package/dist/chunk-GQCAJ56I.js +5 -0
- package/dist/chunk-GXB7RZHH.js +1 -0
- package/dist/chunk-IGEY3AWF.js +1 -0
- package/dist/chunk-ILDDDLRC.js +1 -0
- package/dist/chunk-JFYVRWJI.js +2 -0
- package/dist/chunk-MVLCGU3G.js +1 -0
- package/dist/chunk-N345KWWK.js +1 -0
- package/dist/chunk-NBQFPCRT.js +1 -0
- package/dist/chunk-OIPSLIZE.js +5 -0
- package/dist/chunk-ORJ2QZBG.js +3 -0
- package/dist/chunk-PCALBZOO.js +2 -0
- package/dist/chunk-PDNBGUYP.js +2 -0
- package/dist/chunk-S656RE4A.js +1 -0
- package/dist/chunk-TSEKPGK4.js +1 -0
- package/dist/chunk-U6CI6KXN.js +34 -0
- package/dist/chunk-UTYFLLSM.js +1 -0
- package/dist/chunk-V3R4FYTJ.js +1 -0
- package/dist/chunk-V656XVXV.js +8 -0
- package/dist/chunk-WKUJ7CFO.js +1 -0
- package/dist/chunk-WOT6VMZA.js +1 -0
- package/dist/chunk-WUPU6LTD.js +4 -0
- package/dist/chunk-WX3V5P7U.js +5 -0
- package/dist/chunk-ZKZ6WCI3.js +2 -0
- package/dist/main.js +94 -536
- package/package.json +15 -62
- package/dist/account-credential.js +0 -136
- package/dist/account-credential.test.js +0 -38
- package/dist/activity.js +0 -124
- package/dist/agent-defs.js +0 -237
- package/dist/agent-limiter.js +0 -68
- package/dist/agents.js +0 -554
- package/dist/anim.js +0 -361
- package/dist/args.js +0 -228
- package/dist/at-file.js +0 -28
- package/dist/brand-extension.js +0 -87
- package/dist/brand.js +0 -76
- package/dist/browser.js +0 -58
- package/dist/cache-report.js +0 -139
- package/dist/checkpoint.js +0 -437
- package/dist/claims.js +0 -167
- package/dist/cli-auth.js +0 -142
- package/dist/cli-checkin.js +0 -116
- package/dist/cli-credentials.js +0 -254
- package/dist/clipboard.js +0 -149
- package/dist/collapse.js +0 -129
- package/dist/commands.js +0 -301
- package/dist/compaction-guard.js +0 -81
- package/dist/context-extension.js +0 -17
- package/dist/dcp/commands.js +0 -172
- package/dist/dcp/compress-state.js +0 -139
- package/dist/dcp/compress.js +0 -329
- package/dist/dcp/dcp-extension.js +0 -288
- package/dist/dcp/dedup.js +0 -93
- package/dist/dcp/ids.js +0 -189
- package/dist/dcp/index.js +0 -25
- package/dist/dcp/prompts.js +0 -68
- package/dist/dcp/protected-content.js +0 -221
- package/dist/dcp/protected.js +0 -161
- package/dist/dcp/prune.js +0 -418
- package/dist/dcp/state.js +0 -176
- package/dist/device-id.js +0 -90
- package/dist/device-id.test.js +0 -23
- package/dist/errors.js +0 -63
- package/dist/extensions.js +0 -48
- package/dist/fatal.js +0 -35
- package/dist/feed.js +0 -498
- package/dist/fs-atomic.js +0 -54
- package/dist/gateway-errors.js +0 -90
- package/dist/git.js +0 -230
- package/dist/goal-extension.js +0 -88
- package/dist/goal.js +0 -222
- package/dist/hooks-extension.js +0 -176
- package/dist/hooks.js +0 -443
- package/dist/howtofix-account.js +0 -715
- package/dist/hud-line.js +0 -153
- package/dist/hwid.js +0 -130
- package/dist/interrupt.js +0 -60
- package/dist/json-events.js +0 -50
- package/dist/level-style.js +0 -112
- package/dist/loop-guard.js +0 -95
- package/dist/lsp-tools.js +0 -32
- package/dist/lsp.js +0 -347
- package/dist/mcp-config.js +0 -85
- package/dist/mcp-lifecycle.js +0 -147
- package/dist/model-catalog.js +0 -217
- package/dist/model-resolve.js +0 -65
- package/dist/notes.js +0 -78
- package/dist/oauth-login.js +0 -568
- package/dist/paths.js +0 -61
- package/dist/permissions.js +0 -298
- package/dist/plan-mode.js +0 -363
- package/dist/preset-command.js +0 -227
- package/dist/preset-extension.js +0 -35
- package/dist/preset-mcp.js +0 -292
- package/dist/presets.js +0 -727
- package/dist/prompt-files.js +0 -103
- package/dist/prompt-text.js +0 -41
- package/dist/proxy.js +0 -137
- package/dist/quality/ast.js +0 -196
- package/dist/quality/cognitive.js +0 -83
- package/dist/quality/cyclomatic.js +0 -30
- package/dist/quality/halstead.js +0 -83
- package/dist/quality/index.js +0 -18
- package/dist/quality/length.js +0 -3
- package/dist/quality/maintainability.js +0 -15
- package/dist/quality/nesting.js +0 -57
- package/dist/quality/report.js +0 -803
- package/dist/quality/smells.js +0 -67
- package/dist/quality-tool.js +0 -63
- package/dist/read-only-commands.js +0 -597
- package/dist/repo-map.js +0 -292
- package/dist/rtk.js +0 -193
- package/dist/sandbox.js +0 -105
- package/dist/schema.js +0 -214
- package/dist/session-lifecycle.js +0 -19
- package/dist/session-retention.js +0 -111
- package/dist/session.js +0 -446
- package/dist/sessions.js +0 -100
- package/dist/settings.js +0 -148
- package/dist/skills.js +0 -35
- package/dist/slop-tool.js +0 -96
- package/dist/spend-cap.js +0 -43
- package/dist/subagent.js +0 -171
- package/dist/tar.js +0 -146
- package/dist/theme.js +0 -79
- package/dist/thinking.js +0 -45
- package/dist/todo.js +0 -114
- package/dist/tool-loadout.js +0 -97
- package/dist/tool-render.js +0 -769
- package/dist/tools.js +0 -176
- package/dist/ui.js +0 -4751
- package/dist/update.js +0 -533
- package/dist/usage-segment.js +0 -69
- package/dist/web-tools.js +0 -46
- package/dist/web.js +0 -265
- package/dist/welcome.js +0 -179
- package/dist/workflow-engine.js +0 -246
- package/dist/workflow-progress.js +0 -446
- package/dist/workflow-view.js +0 -195
- package/dist/workflow.js +0 -349
package/dist/tools.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { Type } from "@netrodev/hxf-ai";
|
|
2
|
-
import { defineTool } from "@netrodev/hxf-coding-agent";
|
|
3
|
-
import { relative, join } from "node:path";
|
|
4
|
-
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
|
-
import { allClaims, claim, release } from "./claims.js";
|
|
6
|
-
import { sessionsIn } from "./sessions.js";
|
|
7
|
-
let asker;
|
|
8
|
-
export function setAsker(next) {
|
|
9
|
-
asker = next;
|
|
10
|
-
}
|
|
11
|
-
export const thinkTool = defineTool({
|
|
12
|
-
name: "think",
|
|
13
|
-
label: "think",
|
|
14
|
-
description: "Private scratchpad. The text is not shown to the user. Use it before a non-obvious step.",
|
|
15
|
-
promptSnippet: "think: private notes, not shown to the user",
|
|
16
|
-
parameters: Type.Object({
|
|
17
|
-
thoughts: Type.String({ description: "Private notes" }),
|
|
18
|
-
}),
|
|
19
|
-
async execute() {
|
|
20
|
-
return { content: [{ type: "text", text: "noted" }], details: { recorded: true } };
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
export const askTool = defineTool({
|
|
24
|
-
name: "ask",
|
|
25
|
-
label: "ask",
|
|
26
|
-
description: "Ask the user one question and wait for a selected answer. Use this instead of guessing when a choice blocks the task.",
|
|
27
|
-
promptSnippet: "ask: ask the user to pick one option",
|
|
28
|
-
parameters: Type.Object({
|
|
29
|
-
question: Type.String(),
|
|
30
|
-
options: Type.Array(Type.String(), { minItems: 2 }),
|
|
31
|
-
}),
|
|
32
|
-
async execute(_toolCallId, params) {
|
|
33
|
-
if (!asker)
|
|
34
|
-
return { content: [{ type: "text", text: "cancelled" }], details: { answer: "cancelled" } };
|
|
35
|
-
const answer = await asker(params.question, params.options);
|
|
36
|
-
return { content: [{ type: "text", text: answer }], details: { answer } };
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
let claimsContext;
|
|
40
|
-
export function setClaimsContext(next) {
|
|
41
|
-
claimsContext = next;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* `sessions` is the cross-session half of claims.
|
|
45
|
-
*
|
|
46
|
-
* A claim tells one session that a file is taken; this tells it by whom, and lets it
|
|
47
|
-
* ask that session to let go. Without it a refusal names an opaque holder id and the
|
|
48
|
-
* only way forward is to wait for a process the caller cannot see.
|
|
49
|
-
*/
|
|
50
|
-
export const sessionsTool = defineTool({
|
|
51
|
-
name: "sessions",
|
|
52
|
-
label: "sessions",
|
|
53
|
-
description: "See the other HowToFix sessions working in this workspace, what they hold, and what they are doing. Use it to find who is blocking a claim, or to tell another session to release a file. Send a message with message + to.",
|
|
54
|
-
promptSnippet: "sessions: other CLI sessions, and who holds what",
|
|
55
|
-
parameters: Type.Object({
|
|
56
|
-
message: Type.Optional(Type.String({ description: "Message text to leave for another session." })),
|
|
57
|
-
to: Type.Optional(Type.String({ description: "Session id to send the message to. Use `all` for every other session." })),
|
|
58
|
-
}),
|
|
59
|
-
async execute(_toolCallId, params) {
|
|
60
|
-
const ctx = claimsContext;
|
|
61
|
-
const dir = ctx?.presenceDir?.();
|
|
62
|
-
if (!ctx || !dir) {
|
|
63
|
-
return { content: [{ type: "text", text: "the session registry is unavailable here" }], details: {} };
|
|
64
|
-
}
|
|
65
|
-
const self = ctx.selfId?.() ?? "";
|
|
66
|
-
const root = ctx.root();
|
|
67
|
-
// `sessionsIn` is the workspace-scoped view; the tool only ever reports sessions
|
|
68
|
-
// in this project, because a claim in another workspace is not this caller's
|
|
69
|
-
// business and naming it would only be noise.
|
|
70
|
-
const here = sessionsIn({ dir }, root);
|
|
71
|
-
if (params.message && params.message.trim()) {
|
|
72
|
-
const target = params.to?.trim() || "all";
|
|
73
|
-
const recipients = here.filter((s) => s.id !== self && (target === "all" || s.id === target));
|
|
74
|
-
if (recipients.length === 0) {
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: "text", text: "no other session in this workspace to message" }],
|
|
77
|
-
details: { sent: 0 },
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
for (const s of recipients) {
|
|
81
|
-
// Appended to the file rather than a queue of its own: the recipient reads it
|
|
82
|
-
// on its next discovery, and a message that outlives the sender is the point.
|
|
83
|
-
const box = join(dir, `${s.id.replace(/[^A-Za-z0-9._-]/g, "_")}.inbox`);
|
|
84
|
-
try {
|
|
85
|
-
mkdirSync(dir, { recursive: true });
|
|
86
|
-
writeFileSync(box, `${JSON.stringify({ from: self, at: Date.now(), text: params.message.trim() })}\n`, { flag: "a" });
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
// A mailbox that cannot be written is not worth failing the call over; the
|
|
90
|
-
// listing below still reports who is there.
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
content: [{ type: "text", text: `left a message for ${recipients.map((s) => s.id).join(", ")}` }],
|
|
95
|
-
details: { sent: recipients.length },
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (here.length === 0) {
|
|
99
|
-
return { content: [{ type: "text", text: "no other session in this workspace" }], details: { sessions: [] } };
|
|
100
|
-
}
|
|
101
|
-
const lines = here.map((s) => {
|
|
102
|
-
const who = s.id === self ? "this session" : s.id;
|
|
103
|
-
const held = allClaims(root).filter((c) => c.holder === `session:${s.id}`);
|
|
104
|
-
const doing = s.activity ? ` — ${s.activity}` : "";
|
|
105
|
-
// The reason is the whole point of the listing: a caller that learns a file is
|
|
106
|
-
// taken but not WHY cannot judge whether to wait, ask, or work elsewhere.
|
|
107
|
-
const heldText = held.length > 0 ? `\n holds:\n${held.map((c) => ` ${relativeFrom(root, c.path)} — ${c.reason}`).join("\n")}` : "";
|
|
108
|
-
return ` ${who} (pid ${s.pid}${s.id === self ? "" : `, seen ${Math.round((Date.now() - s.at) / 1000)}s ago`})${doing}${heldText}`;
|
|
109
|
-
});
|
|
110
|
-
return {
|
|
111
|
-
content: [{ type: "text", text: `sessions in ${root}:\n${lines.join("\n")}` }],
|
|
112
|
-
details: { sessions: here },
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
function renderClaimResult(result) {
|
|
117
|
-
const lines = [];
|
|
118
|
-
if (result.granted.length > 0)
|
|
119
|
-
lines.push(`claimed: ${result.granted.join(", ")}`);
|
|
120
|
-
if (result.conflicts.length > 0) {
|
|
121
|
-
lines.push("");
|
|
122
|
-
lines.push("refused — another agent is working on these:");
|
|
123
|
-
for (const c of result.conflicts)
|
|
124
|
-
lines.push(` ${c.path} — held by ${c.by}: ${c.reason}`);
|
|
125
|
-
lines.push("");
|
|
126
|
-
lines.push("Wait for the holder to release it, or work on something else. Do not edit a refused path.");
|
|
127
|
-
}
|
|
128
|
-
if (lines.length === 0)
|
|
129
|
-
lines.push("nothing to claim");
|
|
130
|
-
return { text: lines.join("\n"), isError: result.conflicts.length > 0 };
|
|
131
|
-
}
|
|
132
|
-
export const claimTool = defineTool({
|
|
133
|
-
name: "claim",
|
|
134
|
-
label: "claim",
|
|
135
|
-
description: "Claim files or directories before editing them, so a parallel agent cannot overwrite your work. Refused paths are held by someone else — do not edit them. Pass no paths to list every claim in this workspace.",
|
|
136
|
-
promptSnippet: "claim: reserve files before editing",
|
|
137
|
-
parameters: Type.Object({
|
|
138
|
-
paths: Type.Optional(Type.Array(Type.String(), {
|
|
139
|
-
description: "Files or directories to claim. Omit to list the current claims.",
|
|
140
|
-
})),
|
|
141
|
-
reason: Type.Optional(Type.String({ description: "Why you are taking them, shown to a refused agent." })),
|
|
142
|
-
release: Type.Optional(Type.Boolean({ description: "Release these paths instead of claiming them. Omit paths to release everything you hold." })),
|
|
143
|
-
}),
|
|
144
|
-
async execute(_toolCallId, params) {
|
|
145
|
-
if (!claimsContext) {
|
|
146
|
-
return {
|
|
147
|
-
content: [{ type: "text", text: "claims are unavailable in this session" }],
|
|
148
|
-
details: {},
|
|
149
|
-
isError: true,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
const root = claimsContext.root();
|
|
153
|
-
const holder = claimsContext.holder();
|
|
154
|
-
if (params.release) {
|
|
155
|
-
const freed = release(root, holder, params.paths);
|
|
156
|
-
return {
|
|
157
|
-
content: [{ type: "text", text: freed.length > 0 ? `released: ${freed.join(", ")}` : "you held nothing matching that" }],
|
|
158
|
-
details: { released: freed },
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
if (!params.paths || params.paths.length === 0) {
|
|
162
|
-
const all = allClaims(root);
|
|
163
|
-
if (all.length === 0)
|
|
164
|
-
return { content: [{ type: "text", text: "no active claims in this workspace" }], details: { claims: [] } };
|
|
165
|
-
const text = all.map((c) => `${c.holder === holder ? "(you) " : ""}${relativeFrom(root, c.path)} — ${c.reason}`).join("\n");
|
|
166
|
-
return { content: [{ type: "text", text }], details: { claims: all } };
|
|
167
|
-
}
|
|
168
|
-
const result = claim({ root, holder, reason: params.reason ?? "no reason given", paths: params.paths });
|
|
169
|
-
const { text, isError } = renderClaimResult(result);
|
|
170
|
-
return { content: [{ type: "text", text }], isError, details: result };
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
function relativeFrom(root, path) {
|
|
174
|
-
const rel = relative(root, path);
|
|
175
|
-
return rel && !rel.startsWith("..") ? rel : path;
|
|
176
|
-
}
|