xonecas.io
64875
Mc

mini-coder / commit a7328d1

fix: remove dead code.

xonecas2026-02-21 a7328d1a05c42cfa09cb9d6ff48c85951ced86c1 parent c2d19d0

2 files changed

TODO.md+40−0
@@ -0,0 +1,40 @@
1+## `/model` thinking-effort toggle
2+
3+The idea specifies: *"/model allows the user to pick a model as well as thinking
4+effort for the model if supported. Selection persists across sessions."*
5+
6+`runTurn()` in `src/llm-api/turn.ts` builds `streamOpts` with no `providerOptions`,
7+so thinking effort is never forwarded to the SDK. The `settings` table (via
8+`getSetting`/`setSetting` in `src/session/db.ts`) is already available for
9+persistence alongside `preferred_model`.
10+
11+**Fix:**
12+- Add `thinkingEffort?: "low" | "medium" | "high"` to `runTurn()` options and pass
13+ it as `providerOptions` — e.g. for Anthropic:
14+ `{ anthropic: { thinking: { type: "enabled", budgetTokens: N } } }`.
15+- Expose it in `/model` (e.g. `/model --effort high`) and persist to `settings`
16+ with key `"thinking_effort"`.
17+- Read it back in `agent.ts` (alongside `getPreferredModel()`) and thread it into
18+ every `runTurn()` call including subagents.
19+- Gate display in `/model` listing to models that support it (Claude 3.5+ Sonnet /
20+ Opus, o-series OpenAI models). Add a capability flag in `providers.ts`.
21+
22+---
23+
24+## `@` references for global skills / agent configs
25+
26+The idea says: *"Reference files, skills, agents from the working directory and
27+global community configs with `@` in prompt input."*
28+
29+Currently `getFileCompletions()` in `src/cli/input.ts` only scans `cwd` with
30+`Bun.Glob`, and `resolveFileRefs()` in `src/agent/agent.ts` (line 501) only reads
31+files relative to `cwd` or as absolute paths. Global skill/agent files under
32+`~/.agents/` (the convention referenced in the idea from `skills.sh`) are never
33+surfaced.
34+
35+**Fix:**
36+- Extend `getFileCompletions()` to also scan `~/.agents/` for skill/agent files and
37+ surface them as `@~/.agents/<name>` completions alongside local results.
38+- In `resolveFileRefs()`, resolve `@`-refs that start with `~/` or match a known
39+ global skill name against `homedir() + "/.agents/"` in addition to `cwd`.
40+- Optionally distinguish global refs visually in Tab-completion output.
src/mcp/manager.ts+0−92
@@ -1,92 +0,0 @@
1-import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2-import { join } from "node:path";
3-import type { ToolDef } from "../llm-api/types.ts";
4-import { getConfigDir } from "../session/db.ts";
5-import {
6- type McpClient,
7- type McpServerConfig,
8- connectMcpServer,
9-} from "./client.ts";
10-
11-// ─── Config persistence ───────────────────────────────────────────────────────
12-
13-function getMcpConfigPath(): string {
14- return join(getConfigDir(), "mcp.json");
15-}
16-
17-export function loadMcpConfig(): McpServerConfig[] {
18- const path = getMcpConfigPath();
19- if (!existsSync(path)) return [];
20- try {
21- const raw = readFileSync(path, "utf-8");
22- return JSON.parse(raw) as McpServerConfig[];
23- } catch {
24- return [];
25- }
26-}
27-
28-export function saveMcpConfig(servers: McpServerConfig[]): void {
29- const dir = getConfigDir();
30- if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
31- writeFileSync(getMcpConfigPath(), JSON.stringify(servers, null, 2));
32-}
33-
34-export function addMcpConfig(server: McpServerConfig): void {
35- const servers = loadMcpConfig();
36- const existing = servers.findIndex((s) => s.name === server.name);
37- if (existing !== -1) servers[existing] = server;
38- else servers.push(server);
39- saveMcpConfig(servers);
40-}
41-
42-export function removeMcpConfig(name: string): void {
43- const servers = loadMcpConfig().filter((s) => s.name !== name);
44- saveMcpConfig(servers);
45-}
46-
47-// ─── Active connections ───────────────────────────────────────────────────────
48-
49-const _activeClients: Map<string, McpClient> = new Map();
50-
51-/**
52- * Connect to all configured MCP servers, return their combined tools.
53- */
54-export async function connectAllMcp(): Promise<ToolDef[]> {
55- const configs = loadMcpConfig();
56- const allTools: ToolDef[] = [];
57-
58- for (const config of configs) {
59- try {
60- if (!_activeClients.has(config.name)) {
61- const client = await connectMcpServer(config);
62- _activeClients.set(config.name, client);
63- }
64- const client = _activeClients.get(config.name);
65- if (!client) {
66- throw new Error(`MCP client missing for ${config.name}`);
67- }
68- allTools.push(...client.tools);
69- } catch (err) {
70- console.error(
71- `[mcp] Failed to connect to "${config.name}":`,
72- err instanceof Error ? err.message : err,
73- );
74- }
75- }
76-
77- return allTools;
78-}
79-
80-/**
81- * Close all active MCP connections.
82- */
83-export async function closeAllMcp(): Promise<void> {
84- for (const client of _activeClients.values()) {
85- try {
86- await client.close();
87- } catch {
88- /* ignore */
89- }
90- }
91- _activeClients.clear();
92-}