aura-code 0.3.0 → 0.3.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/README.md +2 -2
- package/dist/agent/loop.js +6 -0
- package/dist/agent/loop.js.map +1 -1
- package/dist/agent/system-prompt.js +9 -0
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/cli/index.js +132 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/providers/factory.js +12 -0
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.js +21 -8
- package/dist/providers/google.js.map +1 -1
- package/dist/ruby/model-selector.d.ts +20 -0
- package/dist/ruby/model-selector.js +114 -0
- package/dist/ruby/model-selector.js.map +1 -0
- package/dist/ruby/stats.d.ts +6 -0
- package/dist/ruby/stats.js +103 -0
- package/dist/ruby/stats.js.map +1 -0
- package/dist/setup/provider-registry.d.ts +32 -0
- package/dist/setup/provider-registry.js +159 -0
- package/dist/setup/provider-registry.js.map +1 -0
- package/dist/setup/provider-test.d.ts +15 -0
- package/dist/setup/provider-test.js +195 -0
- package/dist/setup/provider-test.js.map +1 -0
- package/dist/setup/provider-wizard.d.ts +29 -0
- package/dist/setup/provider-wizard.js +363 -0
- package/dist/setup/provider-wizard.js.map +1 -0
- package/dist/tools/index.js +3 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/shadow-shield.d.ts +11 -0
- package/dist/tools/shadow-shield.js +538 -0
- package/dist/tools/shadow-shield.js.map +1 -0
- package/dist/util/errors.js +9 -1
- package/dist/util/errors.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<a href="https://www.npmjs.com/package/aura-code"><img src="https://img.shields.io/npm/v/aura-code?color=cc0000&label=npm&logo=npm" alt="npm version"></a>
|
|
14
14
|
<a href="https://github.com/milodule3-debug/aura-code/actions/workflows/ci.yml"><img src="https://github.com/milodule3-debug/aura-code/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
15
|
-
<img src="https://img.shields.io/badge/tests-
|
|
15
|
+
<img src="https://img.shields.io/badge/tests-1035%2B-brightgreen" alt="1035+ tests">
|
|
16
16
|
<a href="https://github.com/milodule3-debug/aura-code/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License"></a>
|
|
17
17
|
<img src="https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js&logoColor=white" alt="Node.js 18+">
|
|
18
18
|
<a href="https://github.com/milodule3-debug/aura-code"><img src="https://img.shields.io/github/stars/milodule3-debug/aura-code?style=social" alt="GitHub Stars"></a>
|
|
@@ -111,7 +111,7 @@ Any OpenAI-compatible endpoint also works via `openrouter/<model>`.
|
|
|
111
111
|
|
|
112
112
|
| Metric | Value |
|
|
113
113
|
|--------|-------|
|
|
114
|
-
| Tests |
|
|
114
|
+
| Tests | 1035+ passing, 0 failures |
|
|
115
115
|
| Version | v0.3.0 |
|
|
116
116
|
| Language | TypeScript (strict) |
|
|
117
117
|
| License | MIT |
|
package/dist/agent/loop.js
CHANGED
|
@@ -126,6 +126,12 @@ async function runLoopBody(args) {
|
|
|
126
126
|
}
|
|
127
127
|
catch (e) {
|
|
128
128
|
display.error(`Provider error: ${String(e)}`);
|
|
129
|
+
// If we failed on the first turn without making any tool calls, the assistant
|
|
130
|
+
// never responded. Pop the user's task so we don't poison the chat history
|
|
131
|
+
// with consecutive user messages on the next attempt.
|
|
132
|
+
if (turns === 1 && toolCallCount === 0) {
|
|
133
|
+
history.pop();
|
|
134
|
+
}
|
|
129
135
|
await persist(opts.sessionPath, history);
|
|
130
136
|
return {
|
|
131
137
|
success: false,
|
package/dist/agent/loop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/agent/loop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,oC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,EAAE,CAAC;IAChE,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,aAAa,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACtE,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;AACpE,CAAC"}
|
|
@@ -24,6 +24,15 @@ You are working in a ${ctx.language} project called "${ctx.name}" (${ctx.framewo
|
|
|
24
24
|
- When done, summarize exactly what changed and what was verified (tests passed, build succeeded, specific checks that passed).
|
|
25
25
|
- If the task requires a code change, you must eventually call write_file or edit_file to apply it. Do not spend all turns on read_file and search_code — at some point you must commit to making the change. Aim for a 2:1 ratio of reads to writes, not 100% reads.
|
|
26
26
|
- Never respond to a task with only prose. Always begin by using at least one tool (search_code, read_file, or list_dir) to investigate the codebase before summarizing or concluding. A response with zero tool calls is almost always incomplete.
|
|
27
|
+
- Not every task is a coding task. For questions, research, or information requests, use web_search/web_fetch and respond with the information directly — no code changes needed.
|
|
28
|
+
|
|
29
|
+
## Web and information tools
|
|
30
|
+
- You have web_search and web_fetch tools. USE THEM for any question about current events, weather, news, documentation, or anything that requires up-to-date information.
|
|
31
|
+
- When web_search returns results, READ THE RESULTS — they are already in your context. Extract the relevant information (temperatures, dates, facts, summaries) and present it directly to the user. Do NOT say "I can't browse the results" — you already have them.
|
|
32
|
+
- If search results contain snippets with the answer, give the answer directly. If you need more detail, use web_fetch on the most relevant URL to get the full page content.
|
|
33
|
+
- For weather: extract temperature, conditions, humidity, wind from the search snippets and present them clearly.
|
|
34
|
+
- For documentation/articles: summarize the key points, don't just list links.
|
|
35
|
+
- You are NOT limited to coding tasks. You can research, summarize, explain, translate, and answer general knowledge questions using your tools and knowledge.
|
|
27
36
|
|
|
28
37
|
## Code standards
|
|
29
38
|
- Match the existing code style: indentation, naming conventions, comment style.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":";;AAEA,8CAmEC;AAED,oDAmCC;AAxGD,SAAgB,iBAAiB,CAAC,GAAmB,EAAE,YAAoB;IACzE,OAAO;uBACc,GAAG,CAAC,QAAQ,oBAAoB,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4CtE,GAAG,CAAC,QAAQ;aACX,GAAG,CAAC,SAAS;QAClB,GAAG,CAAC,IAAI;;;;EAId,GAAG,CAAC,IAAI;;;;;EAKR,GAAG,CAAC,MAAM;;;;EAIV,GAAG,CAAC,MAAM;;;EAGV,GAAG,CAAC,aAAa;;YAEP,YAAY,uDAAuD,CAAC;AAChF,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAY,EAAE,WAAmB;IACpE,OAAO,wEAAwE,IAAI;;gBAErE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BzB,CAAC;AACH,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -55,6 +55,7 @@ const defaults_js_1 = require("../config/defaults.js");
|
|
|
55
55
|
const session_store_js_1 = require("../agent/session-store.js");
|
|
56
56
|
const global_config_js_1 = require("../setup/global-config.js");
|
|
57
57
|
const first_run_js_1 = require("../setup/first-run.js");
|
|
58
|
+
const provider_wizard_js_1 = require("../setup/provider-wizard.js");
|
|
58
59
|
const index_js_3 = require("../orchestration/index.js");
|
|
59
60
|
const index_js_4 = require("../perception/index.js");
|
|
60
61
|
const weakness_miner_js_1 = require("../harness/weakness-miner.js");
|
|
@@ -63,12 +64,14 @@ const engine_js_1 = require("../workflows/engine.js");
|
|
|
63
64
|
const engine_js_2 = require("../architect/engine.js");
|
|
64
65
|
const diamond_js_1 = require("./diamond.js");
|
|
65
66
|
const episode_capture_js_1 = require("../ruby/episode-capture.js");
|
|
67
|
+
const model_selector_js_1 = require("../ruby/model-selector.js");
|
|
68
|
+
const stats_js_1 = require("../ruby/stats.js");
|
|
66
69
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
67
70
|
// Parse args
|
|
68
71
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
69
72
|
const argv = (0, minimist_1.default)(process.argv.slice(2), {
|
|
70
73
|
string: ['model', 'm', 'api-key', 'base-url', 'mode', 'cwd', 'rate-limit-rpm', 'rate-limit-tpm', 'max-retries', 'max-verify-retries', 'max-turns', 'fallback', 'resume', 'chat-id', 'profile', 'test-command', 'workflow', 'resume-workflow', 'workflow-name', 'apply-harness', 'blueprint', 'build'],
|
|
71
|
-
boolean: ['help', 'h', 'version', 'v', 'auto', 'readonly', 'models', 'no-session', 'no-setup', 'reset-setup', 'orchestrate', 'plan', 'architect', 'list-sessions', 'new-session', 'verify', 'analyze', 'workflows', 'propose-harness', 'blueprints', 'once'],
|
|
74
|
+
boolean: ['help', 'h', 'version', 'v', 'auto', 'readonly', 'models', 'no-session', 'no-setup', 'reset-setup', 'setup', 'orchestrate', 'plan', 'architect', 'list-sessions', 'new-session', 'verify', 'analyze', 'stats', 'workflows', 'propose-harness', 'blueprints', 'once'],
|
|
72
75
|
alias: { m: 'model', h: 'help', v: 'version' },
|
|
73
76
|
default: {
|
|
74
77
|
model: process.env.AURA_MODEL,
|
|
@@ -165,6 +168,29 @@ if (argv.analyze) {
|
|
|
165
168
|
}
|
|
166
169
|
process.exit(0);
|
|
167
170
|
}
|
|
171
|
+
if (argv.stats) {
|
|
172
|
+
(async () => {
|
|
173
|
+
const root = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
|
|
174
|
+
const episodes = await (0, episode_capture_js_1.loadEpisodes)(root);
|
|
175
|
+
const output = (0, stats_js_1.formatStats)(episodes);
|
|
176
|
+
// Print each line, highlighting the header
|
|
177
|
+
for (const line of output.split('\n')) {
|
|
178
|
+
if (line.trim() === 'Aura Stats') {
|
|
179
|
+
console.log(chalk_1.default.hex('#cc785c').bold(line));
|
|
180
|
+
}
|
|
181
|
+
else if (line.includes(':')) {
|
|
182
|
+
const colonIdx = line.indexOf(':');
|
|
183
|
+
const label = line.slice(0, colonIdx + 1);
|
|
184
|
+
const value = line.slice(colonIdx + 1);
|
|
185
|
+
console.log(chalk_1.default.hex('#8a7768')(label) + chalk_1.default.hex('#ede0cc')(value));
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
console.log(line);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
process.exit(0);
|
|
192
|
+
})();
|
|
193
|
+
}
|
|
168
194
|
if (argv['propose-harness']) {
|
|
169
195
|
// Ensure a weakness report exists — mine if needed
|
|
170
196
|
if (!fs.existsSync((0, weakness_miner_js_1.reportPath)())) {
|
|
@@ -410,6 +436,7 @@ async function main() {
|
|
|
410
436
|
const cliModel = typeof argv.model === 'string' ? argv.model : undefined;
|
|
411
437
|
const skipSetup = argv['no-setup'] === true || argv.help === true || argv.h === true || argv.models === true || argv.version === true || argv.v === true;
|
|
412
438
|
const resetSetup = argv['reset-setup'] === true;
|
|
439
|
+
const cliSetup = argv['setup'] === true;
|
|
413
440
|
if (resetSetup) {
|
|
414
441
|
// Wipe global config so the wizard fires unconditionally.
|
|
415
442
|
try {
|
|
@@ -417,9 +444,20 @@ async function main() {
|
|
|
417
444
|
}
|
|
418
445
|
catch { /* not present */ }
|
|
419
446
|
}
|
|
447
|
+
// --setup flag: run provider wizard before entering REPL
|
|
448
|
+
if (cliSetup && !skipSetup) {
|
|
449
|
+
const cfg = await (0, provider_wizard_js_1.runProviderWizard)();
|
|
450
|
+
if (cfg) {
|
|
451
|
+
resolved.model = cfg.model;
|
|
452
|
+
resolved.baseUrl = cfg.baseUrl;
|
|
453
|
+
runtimeConfig.model = cfg.model;
|
|
454
|
+
runtimeConfig.baseUrl = cfg.baseUrl;
|
|
455
|
+
runtimeConfig.apiKey = cfg.apiKey;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
420
458
|
// When --reset-setup is set, force the wizard to fire (overrides env-var
|
|
421
459
|
// detection — the user explicitly wants to reconfigure).
|
|
422
|
-
const shouldRunWizard = !skipSetup && isInteractive && (resetSetup || (0, first_run_js_1.needsWizard)({ cliApiKey, cliModel }));
|
|
460
|
+
const shouldRunWizard = !skipSetup && !cliSetup && isInteractive && (resetSetup || (0, first_run_js_1.needsWizard)({ cliApiKey, cliModel }));
|
|
423
461
|
if (shouldRunWizard) {
|
|
424
462
|
// If stdin is not a TTY and there's nothing piped in, the wizard will
|
|
425
463
|
// hang. Skip with a helpful message instead.
|
|
@@ -743,6 +781,23 @@ async function main() {
|
|
|
743
781
|
catch {
|
|
744
782
|
// Router failed — fall through to single agent
|
|
745
783
|
}
|
|
784
|
+
// ── RubyAlternator: suggest model from competence history ─────────────────
|
|
785
|
+
// Only when the user has NOT explicitly specified --model
|
|
786
|
+
if (!cliModel) {
|
|
787
|
+
try {
|
|
788
|
+
const availableModelIds = (0, factory_js_1.getAllModels)().map(m => m.id);
|
|
789
|
+
const suggested = await (0, model_selector_js_1.selectModel)(ctx.root, task, availableModelIds);
|
|
790
|
+
if (suggested && suggested !== runtimeConfig.model) {
|
|
791
|
+
console.log(chalk_1.default.hex('#4e3d30')(` Using ${suggested} (selected by competence history)\n`));
|
|
792
|
+
runtimeConfig.model = suggested;
|
|
793
|
+
// Rebuild provider with the suggested model
|
|
794
|
+
provider = buildProvider(display);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
catch {
|
|
798
|
+
// Competence selection is best-effort; never block the user
|
|
799
|
+
}
|
|
800
|
+
}
|
|
746
801
|
const doVerify = cliVerify || !!fileConfig.verify;
|
|
747
802
|
const episodeStart = Date.now();
|
|
748
803
|
let result;
|
|
@@ -845,6 +900,7 @@ async function main() {
|
|
|
845
900
|
providerConfig: { model: resolved.model, apiKey: runtimeConfig.apiKey, baseUrl: runtimeConfig.baseUrl ?? undefined },
|
|
846
901
|
permissions, cumulative,
|
|
847
902
|
chatState: { projectRoot, activeChatId, activeChatHistory, activeChatTitle, noSession },
|
|
903
|
+
rl,
|
|
848
904
|
};
|
|
849
905
|
const cmdResult = await handleReplCommand(input, replCtx);
|
|
850
906
|
if (cmdResult.handled) {
|
|
@@ -859,6 +915,21 @@ async function main() {
|
|
|
859
915
|
return;
|
|
860
916
|
}
|
|
861
917
|
// Run task — pass current conversation history for stay-active mode
|
|
918
|
+
// ── RubyAlternator: suggest model from competence history ──────────────
|
|
919
|
+
// Only when the user has NOT set a model explicitly via --model or :model
|
|
920
|
+
if (!cliModel) {
|
|
921
|
+
try {
|
|
922
|
+
const availableModelIds = (0, factory_js_1.getAllModels)().map(m => m.id);
|
|
923
|
+
const suggested = await (0, model_selector_js_1.selectModel)(ctx.root, input, availableModelIds);
|
|
924
|
+
if (suggested && suggested !== runtimeConfig.model) {
|
|
925
|
+
console.log(chalk_1.default.hex('#4e3d30')(` Using ${suggested} (selected by competence history)\n`));
|
|
926
|
+
runtimeConfig.model = suggested;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
catch {
|
|
930
|
+
// Competence selection is best-effort; never block the user
|
|
931
|
+
}
|
|
932
|
+
}
|
|
862
933
|
let result;
|
|
863
934
|
try {
|
|
864
935
|
const currentProvider = buildProvider(display);
|
|
@@ -873,6 +944,11 @@ async function main() {
|
|
|
873
944
|
context: ctx, permissions, display,
|
|
874
945
|
initialHistory: activeChatHistory,
|
|
875
946
|
maxTurns: resolved.maxTurns,
|
|
947
|
+
confirmFn: async (msg) => new Promise(res => {
|
|
948
|
+
rl.question(`\\n⚠️ ${msg} [y/N] `, a => {
|
|
949
|
+
res(a.trim().toLowerCase() === 'y' || a.trim().toLowerCase() === 'yes');
|
|
950
|
+
});
|
|
951
|
+
}),
|
|
876
952
|
spawnConfig: {
|
|
877
953
|
apiKey: runtimeConfig.apiKey,
|
|
878
954
|
baseUrl: runtimeConfig.baseUrl ?? undefined,
|
|
@@ -891,6 +967,11 @@ async function main() {
|
|
|
891
967
|
context: ctx, permissions, display,
|
|
892
968
|
initialHistory: activeChatHistory,
|
|
893
969
|
maxTurns: resolved.maxTurns,
|
|
970
|
+
confirmFn: async (msg) => new Promise(res => {
|
|
971
|
+
rl.question(`\\n⚠️ ${msg} [y/N] `, a => {
|
|
972
|
+
res(a.trim().toLowerCase() === 'y' || a.trim().toLowerCase() === 'yes');
|
|
973
|
+
});
|
|
974
|
+
}),
|
|
894
975
|
spawnConfig: {
|
|
895
976
|
apiKey: runtimeConfig.apiKey,
|
|
896
977
|
baseUrl: runtimeConfig.baseUrl ?? undefined,
|
|
@@ -902,6 +983,10 @@ async function main() {
|
|
|
902
983
|
catch (err) {
|
|
903
984
|
const msg = err instanceof Error ? (err.stack || err.message) : String(err);
|
|
904
985
|
console.error(chalk_1.default.hex('#b15439')(`\n ✗ Unhandled error: ${msg}\n`));
|
|
986
|
+
// Suggest :provider on auth errors
|
|
987
|
+
if (/\b(401|403|unauthorized|invalid.*api.?key|authentication)\b/i.test(msg)) {
|
|
988
|
+
console.error(chalk_1.default.hex('#cc785c')(' 💡 Run :provider to reconfigure your API key\n'));
|
|
989
|
+
}
|
|
905
990
|
ask();
|
|
906
991
|
return;
|
|
907
992
|
}
|
|
@@ -971,7 +1056,7 @@ function trySetModel(c, newModel) {
|
|
|
971
1056
|
* Interactive model selector — shows all models grouped by provider,
|
|
972
1057
|
* lets the user pick by number or type a custom model ID.
|
|
973
1058
|
*/
|
|
974
|
-
function showModelSelector(c) {
|
|
1059
|
+
async function showModelSelector(c) {
|
|
975
1060
|
const allModels = (0, factory_js_1.getAllModels)();
|
|
976
1061
|
// Build flat numbered list grouped by provider
|
|
977
1062
|
const entries = [];
|
|
@@ -993,28 +1078,31 @@ function showModelSelector(c) {
|
|
|
993
1078
|
}
|
|
994
1079
|
console.log(chalk_1.default.hex('#4e3d30')(`\n Current: ${runtimeConfig.model}`));
|
|
995
1080
|
console.log(chalk_1.default.hex('#4e3d30')(' Type a number, model ID, or press Enter to cancel:\n'));
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}
|
|
1004
|
-
// Try as a number
|
|
1005
|
-
const num = parseInt(choice, 10);
|
|
1006
|
-
if (!isNaN(num) && num >= 1 && num <= entries.length) {
|
|
1007
|
-
const selected = entries[num - 1];
|
|
1008
|
-
if (selected.id) {
|
|
1009
|
-
trySetModel(c, selected.id);
|
|
1081
|
+
return new Promise(resolve => {
|
|
1082
|
+
c.rl.question(chalk_1.default.hex('#cc785c')(' ▸ '), (answer) => {
|
|
1083
|
+
const choice = answer.trim();
|
|
1084
|
+
if (!choice) {
|
|
1085
|
+
console.log(chalk_1.default.hex('#4e3d30')(' Cancelled.\n'));
|
|
1086
|
+
resolve();
|
|
1087
|
+
return;
|
|
1010
1088
|
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1089
|
+
// Try as a number
|
|
1090
|
+
const num = parseInt(choice, 10);
|
|
1091
|
+
if (!isNaN(num) && num >= 1 && num <= entries.length) {
|
|
1092
|
+
const selected = entries[num - 1];
|
|
1093
|
+
if (selected.id) {
|
|
1094
|
+
trySetModel(c, selected.id);
|
|
1095
|
+
}
|
|
1096
|
+
else {
|
|
1097
|
+
console.log(chalk_1.default.hex('#b15439')(' ✗ That\'s a section header, pick a model number.'));
|
|
1098
|
+
}
|
|
1099
|
+
resolve();
|
|
1100
|
+
return;
|
|
1013
1101
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1102
|
+
// Treat as a raw model ID
|
|
1103
|
+
trySetModel(c, choice);
|
|
1104
|
+
resolve();
|
|
1105
|
+
});
|
|
1018
1106
|
});
|
|
1019
1107
|
}
|
|
1020
1108
|
async function handleReplCommand(input, c) {
|
|
@@ -1037,6 +1125,7 @@ async function handleReplCommand(input, c) {
|
|
|
1037
1125
|
' :delete <id> Delete a saved session',
|
|
1038
1126
|
'',
|
|
1039
1127
|
' ── Model / API ──────────────────────────────────',
|
|
1128
|
+
' :provider Provider setup wizard (configure provider, model, API key)',
|
|
1040
1129
|
' :model Interactive model selector',
|
|
1041
1130
|
' :model <id> Switch to a specific model',
|
|
1042
1131
|
' :models List all available models',
|
|
@@ -1230,6 +1319,24 @@ async function handleReplCommand(input, c) {
|
|
|
1230
1319
|
}
|
|
1231
1320
|
return { handled: true };
|
|
1232
1321
|
}
|
|
1322
|
+
// ── Provider wizard command ────────────────────────────────────────────────
|
|
1323
|
+
if (input === ':provider' || input === '/provider') {
|
|
1324
|
+
const cfg = await (0, provider_wizard_js_1.runProviderWizard)(c.rl);
|
|
1325
|
+
if (cfg) {
|
|
1326
|
+
// Update current session's provider without restart
|
|
1327
|
+
runtimeConfig.model = cfg.model;
|
|
1328
|
+
runtimeConfig.baseUrl = cfg.baseUrl;
|
|
1329
|
+
runtimeConfig.apiKey = cfg.apiKey;
|
|
1330
|
+
c.providerConfig.model = cfg.model;
|
|
1331
|
+
c.providerConfig.baseUrl = cfg.baseUrl;
|
|
1332
|
+
c.providerConfig.apiKey = cfg.apiKey;
|
|
1333
|
+
// Keep resolved in sync
|
|
1334
|
+
resolved.model = cfg.model;
|
|
1335
|
+
resolved.baseUrl = cfg.baseUrl;
|
|
1336
|
+
console.log(chalk_1.default.hex('#5a9e6e')(` ✓ Now using ${cfg.provider} · ${cfg.model}`));
|
|
1337
|
+
}
|
|
1338
|
+
return { handled: true };
|
|
1339
|
+
}
|
|
1233
1340
|
if (input === ':models') {
|
|
1234
1341
|
const allModels = (0, factory_js_1.getAllModels)();
|
|
1235
1342
|
const byProvider = allModels.reduce((acc, m) => {
|
|
@@ -1246,7 +1353,7 @@ async function handleReplCommand(input, c) {
|
|
|
1246
1353
|
return { handled: true };
|
|
1247
1354
|
}
|
|
1248
1355
|
if (input === ':model' || input === '/model') {
|
|
1249
|
-
showModelSelector(c);
|
|
1356
|
+
await showModelSelector(c);
|
|
1250
1357
|
return { handled: true };
|
|
1251
1358
|
}
|
|
1252
1359
|
if (input.startsWith(':model ') || input.startsWith('/model ')) {
|
|
@@ -1644,6 +1751,7 @@ ${chalk_1.default.hex('#cc785c').bold(' aura')} ${chalk_1.default.hex('#8a7768'
|
|
|
1644
1751
|
--resume [id] Resume latest session, or a specific session by ID
|
|
1645
1752
|
--chat-id <id> Attach to a specific chat ID (creates if missing)
|
|
1646
1753
|
--list-sessions List all saved sessions for this project
|
|
1754
|
+
--setup Run the provider setup wizard before entering REPL
|
|
1647
1755
|
--no-setup Skip the first-run setup wizard
|
|
1648
1756
|
--reset-setup Wipe saved config and re-run the setup wizard
|
|
1649
1757
|
--orchestrate Force multi-agent orchestration mode
|