@ai-launchpad-v1/expert-code 0.1.0 → 0.1.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 +38 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2130,9 +2130,15 @@ function errorMessage(e) {
|
|
|
2130
2130
|
// ui.ts
|
|
2131
2131
|
init_esm_shims();
|
|
2132
2132
|
var useColor = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
2133
|
+
var truecolor = /truecolor|24bit/i.test(process.env.COLORTERM || "");
|
|
2133
2134
|
function wrap(code, s) {
|
|
2134
2135
|
return useColor ? `\x1B[${code}m${s}\x1B[0m` : s;
|
|
2135
2136
|
}
|
|
2137
|
+
function brandOrange(s) {
|
|
2138
|
+
if (!useColor) return s;
|
|
2139
|
+
const seq = truecolor ? "38;2;242;106;31" : "38;5;208";
|
|
2140
|
+
return `\x1B[${seq}m${s}\x1B[0m`;
|
|
2141
|
+
}
|
|
2136
2142
|
var c = {
|
|
2137
2143
|
dim: (s) => wrap(2, s),
|
|
2138
2144
|
bold: (s) => wrap(1, s),
|
|
@@ -2142,8 +2148,13 @@ var c = {
|
|
|
2142
2148
|
blue: (s) => wrap(34, s),
|
|
2143
2149
|
magenta: (s) => wrap(35, s),
|
|
2144
2150
|
cyan: (s) => wrap(36, s),
|
|
2145
|
-
gray: (s) => wrap(90, s)
|
|
2151
|
+
gray: (s) => wrap(90, s),
|
|
2152
|
+
/** The ExpertAI brand accent — use for the masthead, prompt, and primary actions. */
|
|
2153
|
+
orange: brandOrange
|
|
2146
2154
|
};
|
|
2155
|
+
function wordmark(suffix, prefix = "Expert") {
|
|
2156
|
+
return c.bold(prefix) + c.bold(c.orange(suffix));
|
|
2157
|
+
}
|
|
2147
2158
|
function out(s = "") {
|
|
2148
2159
|
process.stdout.write(s);
|
|
2149
2160
|
}
|
|
@@ -2156,9 +2167,9 @@ var PLAN_GLYPH = {
|
|
|
2156
2167
|
done: "\u25CF"
|
|
2157
2168
|
};
|
|
2158
2169
|
function toolStartLine(t) {
|
|
2159
|
-
const label = c.
|
|
2170
|
+
const label = c.orange(labelForTool(t.name).padEnd(6));
|
|
2160
2171
|
const desc = describeToolUse(t);
|
|
2161
|
-
return `${c.
|
|
2172
|
+
return `${c.orange("\xB7")} ${label} ${c.gray(desc)}`;
|
|
2162
2173
|
}
|
|
2163
2174
|
function printToolResult(t, r) {
|
|
2164
2175
|
if (t.name === "update_plan") {
|
|
@@ -2236,18 +2247,23 @@ function printApprovalRequest(t) {
|
|
|
2236
2247
|
line();
|
|
2237
2248
|
line(c.yellow(c.bold(" \u26A0 Approval needed")));
|
|
2238
2249
|
if (t.name === "run_command") {
|
|
2239
|
-
line(` ${c.bold("run")} ${c.
|
|
2250
|
+
line(` ${c.bold("run")} ${c.orange(describeToolUse(t))}`);
|
|
2240
2251
|
} else if (t.name === "write_file") {
|
|
2241
|
-
line(` ${c.bold("write")} ${c.
|
|
2252
|
+
line(` ${c.bold("write")} ${c.orange(describeToolUse(t))}`);
|
|
2242
2253
|
} else if (t.name === "edit_file") {
|
|
2243
|
-
line(` ${c.bold("edit")} ${c.
|
|
2254
|
+
line(` ${c.bold("edit")} ${c.orange(describeToolUse(t))}`);
|
|
2244
2255
|
} else {
|
|
2245
|
-
line(` ${c.bold(labelForTool(t.name))} ${c.
|
|
2256
|
+
line(` ${c.bold(labelForTool(t.name))} ${c.orange(describeToolUse(t))}`);
|
|
2246
2257
|
}
|
|
2247
2258
|
}
|
|
2248
|
-
function
|
|
2259
|
+
function masthead() {
|
|
2260
|
+
const product = c.bold("Expert") + " " + c.bold(c.orange("Code"));
|
|
2249
2261
|
line();
|
|
2250
|
-
line(c.
|
|
2262
|
+
line(` ${c.orange("\u259A\u2598")} ${product} ${c.dim("\xB7")} ${c.dim("by ") + wordmark("AI")}`);
|
|
2263
|
+
line(` ${c.orange("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")}`);
|
|
2264
|
+
}
|
|
2265
|
+
function banner(root, name, laneLabel, mode) {
|
|
2266
|
+
masthead();
|
|
2251
2267
|
line(c.dim(` workspace ${name} ${c.gray(root)}`));
|
|
2252
2268
|
line(c.dim(` model ${laneLabel}`));
|
|
2253
2269
|
line(c.dim(` autonomy ${mode}`));
|
|
@@ -2260,12 +2276,12 @@ function banner(root, name, laneLabel, mode) {
|
|
|
2260
2276
|
function help() {
|
|
2261
2277
|
line();
|
|
2262
2278
|
line(c.bold(" Commands"));
|
|
2263
|
-
line(` ${c.
|
|
2264
|
-
line(` ${c.
|
|
2265
|
-
line(` ${c.
|
|
2266
|
-
line(` ${c.
|
|
2267
|
-
line(` ${c.
|
|
2268
|
-
line(` ${c.
|
|
2279
|
+
line(` ${c.orange("/help")} show this help`);
|
|
2280
|
+
line(` ${c.orange("/init")} explore the project and write (or refresh) its EXPERT.md`);
|
|
2281
|
+
line(` ${c.orange("/auto")} autonomy: auto \u2014 safe reads + edits run; risky commands ask`);
|
|
2282
|
+
line(` ${c.orange("/manual")} autonomy: manual \u2014 every write/edit/command asks first`);
|
|
2283
|
+
line(` ${c.orange("/clear")} start a fresh task (drop the current conversation)`);
|
|
2284
|
+
line(` ${c.orange("/exit")} quit (or Ctrl-D)`);
|
|
2269
2285
|
line();
|
|
2270
2286
|
line(c.dim(" During a task, press Ctrl-C once to stop it and return to the prompt."));
|
|
2271
2287
|
line(c.dim(" At an approval prompt: y = run, n = skip, a = always allow this exact command,"));
|
|
@@ -2315,7 +2331,7 @@ async function runRepl({ model, workspace, manual }) {
|
|
|
2315
2331
|
else line(c.dim(" No EXPERT.md yet \u2014 type /init to generate one for this project.\n"));
|
|
2316
2332
|
let transcript = [];
|
|
2317
2333
|
for (; ; ) {
|
|
2318
|
-
const input = (await ask(c.bold(c.
|
|
2334
|
+
const input = (await ask(c.bold(c.orange("\u203A ")))).trim();
|
|
2319
2335
|
if (!input) continue;
|
|
2320
2336
|
if (input === "/exit" || input === "/quit") {
|
|
2321
2337
|
rl.close();
|
|
@@ -2460,7 +2476,7 @@ async function runRepl({ model, workspace, manual }) {
|
|
|
2460
2476
|
}
|
|
2461
2477
|
|
|
2462
2478
|
// index.ts
|
|
2463
|
-
var VERSION = true ? "0.1.
|
|
2479
|
+
var VERSION = true ? "0.1.1" : "dev";
|
|
2464
2480
|
function withReadline(fn) {
|
|
2465
2481
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
2466
2482
|
const ask = (q) => new Promise((res) => rl.question(q, (a) => res(a)));
|
|
@@ -2530,7 +2546,7 @@ async function cmdSetup(args) {
|
|
|
2530
2546
|
}
|
|
2531
2547
|
await withReadline(async (ask) => {
|
|
2532
2548
|
line();
|
|
2533
|
-
line(c.bold("
|
|
2549
|
+
line(" " + c.bold("Expert") + " " + c.bold(c.orange("Code")) + c.dim(" \u2014 BYOK setup"));
|
|
2534
2550
|
line(c.dim(" Use your own AI provider key. Stored in " + configPath() + "\n"));
|
|
2535
2551
|
PROVIDERS.forEach((p, i) => line(` ${i + 1}. ${PROVIDER_LABELS[p]}`));
|
|
2536
2552
|
const pick = (await ask("\n Provider [1-5, default 1]: ")).trim();
|
|
@@ -2556,7 +2572,7 @@ async function cmdLogin() {
|
|
|
2556
2572
|
}
|
|
2557
2573
|
await withReadline(async (ask) => {
|
|
2558
2574
|
line();
|
|
2559
|
-
line(c.bold("
|
|
2575
|
+
line(" " + c.bold("Expert") + " " + c.bold(c.orange("Code")) + c.dim(" \u2014 sign in"));
|
|
2560
2576
|
line(c.dim(" We will email you a one-time code.\n"));
|
|
2561
2577
|
try {
|
|
2562
2578
|
const email = await login(ask);
|
|
@@ -2643,8 +2659,7 @@ async function cmdRun(args) {
|
|
|
2643
2659
|
await runRepl({ model, workspace, manual });
|
|
2644
2660
|
}
|
|
2645
2661
|
function printUsage() {
|
|
2646
|
-
|
|
2647
|
-
line(c.bold(" expert") + c.dim(" \u2014 Expert Code in your terminal"));
|
|
2662
|
+
masthead();
|
|
2648
2663
|
line();
|
|
2649
2664
|
line(" Usage:");
|
|
2650
2665
|
line(" expert [directory] [--manual] start the agent (default: current dir)");
|
|
@@ -2663,9 +2678,9 @@ function printMissingKey(provider) {
|
|
|
2663
2678
|
line(c.red(` No API key found for provider "${provider}".`));
|
|
2664
2679
|
line();
|
|
2665
2680
|
line(" Set one up once with:");
|
|
2666
|
-
line(c.
|
|
2681
|
+
line(c.orange(" expert setup"));
|
|
2667
2682
|
line(c.dim(" \u2026or sign in to use the hosted backend (no key):"));
|
|
2668
|
-
line(c.
|
|
2683
|
+
line(c.orange(" expert login"));
|
|
2669
2684
|
line(c.dim(` \u2026or set ${provider.toUpperCase()}_API_KEY in your environment for this session.`));
|
|
2670
2685
|
line();
|
|
2671
2686
|
}
|
package/package.json
CHANGED