xonecas.io
64875
Mc

mini-coder / commit f629fc8

chore: docs

xonecas2026-03-14 f629fc8b9c43dfd3391465fb40ca73e87adb6baa parent d966c5d

2 files changed

plan.md+0−102
@@ -1,102 +0,0 @@
1-# Plan: Lean and Mean
2-
3-## Overview
4-
5-Three changes:
6-1. **One-shot exit** — when `mc` is called with a prompt (interactive, non-subagent), exit after the agent finishes instead of dropping into the input loop.
7-2. **Drop `glob` and `grep` tools** — agents can use `shell` for these. Remove all related source, tests, hooks, and documentation.
8-3. **Cleanup pass** — dead code, orphaned helpers, stale references.
9-
10----
11-
12-## 1. One-shot exit (`src/index.ts`)
13-
14-Currently when a prompt is provided, `processUserInput` runs and then `runInputLoop` starts anyway. Change this:
15-
16-```
17-if (args.prompt) {
18- await runner.processUserInput(...);
19- return; // ← exit instead of falling into runInputLoop
20-}
21-await runInputLoop(...);
22-```
23-
24-Update the `printHelp` example comment in `src/cli/args.ts` from
25-`# one-shot prompt then interactive` → `# one-shot prompt then exit`.
26-
27----
28-
29-## 2. Drop `glob` and `grep` tools
30-
31-### Files to delete
32-- `src/tools/glob.ts`
33-- `src/tools/glob.test.ts`
34-- `src/tools/grep.ts`
35-- `src/tools/grep.test.ts`
36-- `src/tools/ignore.ts` — only consumed by glob and grep
37-- `src/tools/scan-path.ts` — only consumed by glob and grep
38-
39-### `src/agent/tools.ts`
40-- Remove imports: `GlobOutput`, `globTool`, `GrepOutput`, `grepTool`, `hookEnvForGlob`, `hookEnvForGrep`
41-- Remove `"glob"` and `"grep"` from `HOOKABLE_TOOLS`
42-- Remove `withHooks(withCwdDefault(globTool …))` entry from `buildToolSet`
43-- Remove `withHooks(withCwdDefault(grepTool …))` entry from `buildToolSet`
44-- Remove `withCwdDefault(globTool …)` and `withCwdDefault(grepTool …)` from `buildReadOnlyToolSet`
45-
46-### `src/tools/hooks.ts`
47-- Delete `hookEnvForGlob` function
48-- Delete `hookEnvForGrep` function
49-
50-### `src/agent/system-prompt.ts`
51-- Line 96: update guideline — remove `glob, grep` from the list of dedicated tools:
52- `"Prefer dedicated tools (read, replace, insert) over shell for file operations."`
53-- Line 101: update tool output format note — remove mention of `grep` prefixing lines
54- (only `read` adds the `line:hash|` prefix now):
55- `` `read` prefixes every line with `line:hash|` … ``
56-
57-### `src/agent/tools.test.ts`
58-- No glob/grep-specific tests exist here, but verify the `buildReadOnlyToolSet` test no longer expects glob/grep (it currently doesn't assert on them, so it should be fine as-is).
59-
60----
61-
62-## 3. Cleanup pass
63-
64-### `src/agent/system-prompt.ts` — SKILL.md reference
65-The skill file (`SKILL.md`) lists `glob` and `grep` as core tools; update it once the tools are removed.
66-File: `.agents/skills/mini-coder/SKILL.md` — remove `glob` and `grep` from the tools table, remove hook references for those tools.
67-
68-### `src/agent/tools.test.ts`
69-- After removing tools, confirm no lingering `"glob"` / `"grep"` name checks remain.
70-
71-### Verify no other source files import from `glob.ts`, `grep.ts`, `ignore.ts`, or `scan-path.ts`
72-- Run `knip` / `typecheck` after deletions to surface any missed references.
73-
74----
75-
76-## 4. Verification
77-
78-```bash
79-bun run jscpd && bun run knip && bun run typecheck && bun run format && bun run lint && bun run test
80-```
81-
82-All checks must pass cleanly before closing out.
83-
84----
85-
86-## Touch-list (ordered)
87-
88-| # | File | Action |
89-|---|------|--------|
90-| 1 | `src/index.ts` | Return after one-shot prompt instead of entering input loop |
91-| 2 | `src/cli/args.ts` | Fix help comment for prompt example |
92-| 3 | `src/tools/glob.ts` | Delete |
93-| 4 | `src/tools/glob.test.ts` | Delete |
94-| 5 | `src/tools/grep.ts` | Delete |
95-| 6 | `src/tools/grep.test.ts` | Delete |
96-| 7 | `src/tools/ignore.ts` | Delete |
97-| 8 | `src/tools/scan-path.ts` | Delete |
98-| 9 | `src/agent/tools.ts` | Remove glob/grep imports, registrations, HOOKABLE_TOOLS entries |
99-| 10 | `src/tools/hooks.ts` | Remove `hookEnvForGlob`, `hookEnvForGrep` |
100-| 11 | `src/agent/system-prompt.ts` | Update guidelines and tool-output-format text |
101-| 12 | `.agents/skills/mini-coder/SKILL.md` | Remove glob/grep from tools table and hooks list |
102-| 13 | Verify | `bun run jscpd && bun run knip && … && bun run test` |
src/llm-api/turn.ts+3−1
@@ -751,7 +751,7 @@ export async function* runTurn(options: {
751751 // OpenAI GPT models use the Responses API (@ai-sdk/openai v3 / ai v6 default),
752752 // but we keep prompts only in `system` messages for consistency across
753753 // providers and to avoid prompting shape drift on GPT reasoning models.
754- const useInstructions = false;
754+ const useInstructions = false; // TODO: This is dead code, we should remove it and its usage. Keep the comment above.
755755
756756 const toolCount = Object.keys(toolSet).length;
757757 const thinkingOpts = thinkingEffort
@@ -939,6 +939,7 @@ export async function* runTurn(options: {
939939 ? { providerOptions: mergedProviderOptions }
940940 : {}),
941941 ...(signal ? { abortSignal: signal } : {}),
942+ // TODO: I don't think this is ever used. we should probably remove it
942943 experimental_repairToolCall: async ({ toolCall }) => {
943944 // To avoid 400 Bad Request from the API when it receives malformed JSON
944945 // in the assistant's tool_calls history, we repair it to a minimal valid JSON.
@@ -978,6 +979,7 @@ export async function* runTurn(options: {
978979 switch (c.type) {
979980 case "text-delta": {
980981 // AI SDK v6: property is `text`, not `textDelta`
982+ // TODO: Why do we still check for textDelta then?
981983 const delta =
982984 typeof c.text === "string"
983985 ? c.text