@freesyntax/notch-cli 0.4.0 → 0.4.1
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/index.js +29 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1186,8 +1186,23 @@ async function runAgentLoop(messages, config) {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
};
|
|
1188
1188
|
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1189
|
+
var CINDER_SYSTEM_PROMPT_PARTS = [
|
|
1190
|
+
"You are Notch, an expert AI coding assistant. Built by Driftrail.",
|
|
1191
|
+
"Be concise. Think before acting. Do exactly what the user asks, nothing more.",
|
|
1192
|
+
"",
|
|
1193
|
+
"## Tools available",
|
|
1194
|
+
"Read, Write, Edit, Shell, Git, Glob, Grep, WebFetch.",
|
|
1195
|
+
"",
|
|
1196
|
+
"## Core rules",
|
|
1197
|
+
"- Read files before editing them. Never guess at file content.",
|
|
1198
|
+
"- Use exact string matching for edits.",
|
|
1199
|
+
"- If a task is complex, break it into steps.",
|
|
1200
|
+
"- If a command fails, read the error, fix it, and retry. Do not apologize \u2014 just fix it.",
|
|
1201
|
+
"- Keep responses short. No lengthy explanations unless asked."
|
|
1202
|
+
];
|
|
1203
|
+
async function buildSystemPrompt(projectRoot, modelId) {
|
|
1204
|
+
const isCinder = (modelId ?? "").toLowerCase().includes("cinder");
|
|
1205
|
+
const parts = isCinder ? [...CINDER_SYSTEM_PROMPT_PARTS] : [
|
|
1191
1206
|
"You are Notch, an expert AI coding assistant built by Driftrail.",
|
|
1192
1207
|
"You help developers write, debug, refactor, and understand code.",
|
|
1193
1208
|
"You have access to tools for reading/writing files, running shell commands, searching code, and git operations.",
|
|
@@ -1214,7 +1229,9 @@ async function buildSystemPrompt(projectRoot) {
|
|
|
1214
1229
|
}
|
|
1215
1230
|
} catch {
|
|
1216
1231
|
}
|
|
1217
|
-
|
|
1232
|
+
if (!isCinder) {
|
|
1233
|
+
parts.push("", "## Available Tools", describeTools());
|
|
1234
|
+
}
|
|
1218
1235
|
return parts.join("\n");
|
|
1219
1236
|
}
|
|
1220
1237
|
|
|
@@ -2816,7 +2833,7 @@ function printBanner(version, modelLabel, modelId, modelSize, project) {
|
|
|
2816
2833
|
const divider = t.border(" " + "\u2500".repeat(divWidth));
|
|
2817
2834
|
console.log(divider);
|
|
2818
2835
|
console.log(
|
|
2819
|
-
t.dim(" ") + t.bold(modelLabel) + t.dim(
|
|
2836
|
+
t.dim(" ") + t.bold(modelLabel) + t.dim(" \u2502 v") + t.text(version) + t.dim(" \u2502 ") + t.dim("by ") + t.tagline("Driftrail")
|
|
2820
2837
|
);
|
|
2821
2838
|
console.log(t.dim(` ${project}`));
|
|
2822
2839
|
console.log(divider);
|
|
@@ -3716,7 +3733,7 @@ function completeFilePath(partial, cwd) {
|
|
|
3716
3733
|
|
|
3717
3734
|
// src/index.ts
|
|
3718
3735
|
import fs18 from "fs/promises";
|
|
3719
|
-
var VERSION = "0.4.
|
|
3736
|
+
var VERSION = "0.4.1";
|
|
3720
3737
|
var modelChoices = MODEL_IDS.join(", ");
|
|
3721
3738
|
var program = new Command().name("notch").description("Notch CLI \u2014 AI-powered coding assistant by Driftrail").version(VERSION).argument("[prompt...]", "One-shot prompt (runs once and exits)").option(`-m, --model <model>`, `Notch model (${modelChoices})`).option("--base-url <url>", "Override Notch API base URL").option("--api-key <key>", "Notch API key (prefer NOTCH_API_KEY env var)").option("--no-repo-map", "Disable automatic repository mapping").option("--no-markdown", "Disable markdown rendering in output").option("--max-iterations <n>", "Max tool-call rounds per turn", "25").option("-y, --yes", "Auto-confirm destructive actions").option("--trust", "Trust mode \u2014 auto-allow all tool calls").option("--theme <theme>", `UI color theme (${THEME_IDS.join(", ")})`).option("--resume", "Resume the last session for this project").option("--session <id>", "Resume a specific session by ID").option("--cwd <dir>", "Set working directory").parse(process.argv);
|
|
3722
3739
|
var opts = program.opts();
|
|
@@ -3728,9 +3745,8 @@ function printModelTable(activeModel) {
|
|
|
3728
3745
|
const info = MODEL_CATALOG[id];
|
|
3729
3746
|
const active = id === activeModel ? t.success(" \u25CF") : " ";
|
|
3730
3747
|
const label = id === activeModel ? t.bold(`${info.label}`) : t.dim(`${info.label}`);
|
|
3731
|
-
const size = t.info(info.size.padEnd(4));
|
|
3732
3748
|
const ctx = t.dim(`${(info.contextWindow / 1024).toFixed(0)}K ctx`);
|
|
3733
|
-
console.log(` ${active} ${t.brand(id.padEnd(14))} ${
|
|
3749
|
+
console.log(` ${active} ${t.brand(id.padEnd(14))} ${label} ${ctx}`);
|
|
3734
3750
|
}
|
|
3735
3751
|
console.log(t.dim(`
|
|
3736
3752
|
Switch with: /model <name>
|
|
@@ -3912,10 +3928,12 @@ async function main() {
|
|
|
3912
3928
|
spinner.warn("Could not build repo map");
|
|
3913
3929
|
}
|
|
3914
3930
|
}
|
|
3915
|
-
const baseSystemPrompt = await buildSystemPrompt(config.projectRoot);
|
|
3931
|
+
const baseSystemPrompt = await buildSystemPrompt(config.projectRoot, activeModelId);
|
|
3932
|
+
const isCinder = activeModelId.includes("cinder");
|
|
3916
3933
|
const systemPrompt = [
|
|
3917
3934
|
baseSystemPrompt,
|
|
3918
|
-
|
|
3935
|
+
// Skip repo map for Cinder — too many tokens for a 4B model
|
|
3936
|
+
!isCinder && repoMapStr ? `
|
|
3919
3937
|
## Repository Map
|
|
3920
3938
|
${repoMapStr}` : ""
|
|
3921
3939
|
].join("");
|
|
@@ -4126,7 +4144,7 @@ Analyze the above input.`;
|
|
|
4126
4144
|
config.models.chat.model = activeModelId;
|
|
4127
4145
|
model = resolveModel(config.models.chat);
|
|
4128
4146
|
const switchedInfo = MODEL_CATALOG[activeModelId];
|
|
4129
|
-
console.log(chalk8.green(` Switched to ${switchedInfo.label} (${switchedInfo.id}
|
|
4147
|
+
console.log(chalk8.green(` Switched to ${switchedInfo.label} (${switchedInfo.id})
|
|
4130
4148
|
`));
|
|
4131
4149
|
rl.prompt();
|
|
4132
4150
|
return;
|
|
@@ -4707,7 +4725,7 @@ async function handleRalphSubcommand(args, cliOpts) {
|
|
|
4707
4725
|
const config = await loadConfig(cliOpts.cwd ? { projectRoot: cliOpts.cwd } : {});
|
|
4708
4726
|
if (cliOpts.model) config.models.chat.model = cliOpts.model;
|
|
4709
4727
|
const model = resolveModel(config.models.chat);
|
|
4710
|
-
const systemPrompt = await buildSystemPrompt(config.projectRoot);
|
|
4728
|
+
const systemPrompt = await buildSystemPrompt(config.projectRoot, config.models.chat.model);
|
|
4711
4729
|
const toolCtx = {
|
|
4712
4730
|
cwd: config.projectRoot,
|
|
4713
4731
|
requireConfirm: false,
|