@illumiarq/lumis 1.2.10 → 1.2.11
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/bridges/project-bridge.d.ts +2 -0
- package/dist/bridges/project-bridge.d.ts.map +1 -0
- package/dist/bridges/project-bridge.js +174 -0
- package/dist/bridges/project-bridge.js.map +1 -0
- package/dist/cli.d.ts +1 -16
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +538 -170
- package/dist/cli.js.map +1 -1
- package/dist/commands/app/cache-workflows.d.ts +7 -0
- package/dist/commands/app/cache-workflows.d.ts.map +1 -0
- package/dist/commands/app/cache-workflows.js +139 -0
- package/dist/commands/app/cache-workflows.js.map +1 -0
- package/dist/commands/app/command-runtime.d.ts +11 -0
- package/dist/commands/app/command-runtime.d.ts.map +1 -0
- package/dist/commands/app/command-runtime.js +41 -0
- package/dist/commands/app/command-runtime.js.map +1 -0
- package/dist/commands/app/config-cache.d.ts +3 -0
- package/dist/commands/app/config-cache.d.ts.map +1 -0
- package/dist/commands/app/config-cache.js +75 -0
- package/dist/commands/app/config-cache.js.map +1 -0
- package/dist/commands/app/config-publish.d.ts +2 -0
- package/dist/commands/app/config-publish.d.ts.map +1 -0
- package/dist/commands/app/config-publish.js +68 -0
- package/dist/commands/app/config-publish.js.map +1 -0
- package/dist/commands/app/config-stubs.d.ts +3 -0
- package/dist/commands/app/config-stubs.d.ts.map +1 -0
- package/dist/commands/app/config-stubs.js +154 -0
- package/dist/commands/app/config-stubs.js.map +1 -0
- package/dist/commands/app/database.d.ts +3 -0
- package/dist/commands/app/database.d.ts.map +1 -0
- package/dist/commands/app/database.js +221 -0
- package/dist/commands/app/database.js.map +1 -0
- package/dist/commands/app/docs.d.ts +7 -0
- package/dist/commands/app/docs.d.ts.map +1 -0
- package/dist/commands/app/docs.js +61 -0
- package/dist/commands/app/docs.js.map +1 -0
- package/dist/commands/app/routes.d.ts +5 -0
- package/dist/commands/app/routes.d.ts.map +1 -0
- package/dist/commands/app/routes.js +95 -0
- package/dist/commands/app/routes.js.map +1 -0
- package/dist/commands/app/security.d.ts +3 -0
- package/dist/commands/app/security.d.ts.map +1 -0
- package/dist/commands/app/security.js +15 -0
- package/dist/commands/app/security.js.map +1 -0
- package/dist/commands/app/worker-schedule.d.ts +5 -0
- package/dist/commands/app/worker-schedule.d.ts.map +1 -0
- package/dist/commands/app/worker-schedule.js +94 -0
- package/dist/commands/app/worker-schedule.js.map +1 -0
- package/dist/commands/app-commands.d.ts +19 -0
- package/dist/commands/app-commands.d.ts.map +1 -0
- package/dist/commands/app-commands.js +77 -0
- package/dist/commands/app-commands.js.map +1 -0
- package/dist/commands/build-vercel-fn.d.ts +9 -0
- package/dist/commands/build-vercel-fn.d.ts.map +1 -0
- package/dist/commands/build-vercel-fn.js +32 -0
- package/dist/commands/build-vercel-fn.js.map +1 -0
- package/dist/commands/build.d.ts +14 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +24 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/info.d.ts +9 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +41 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/keys.d.ts +3 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.js +60 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/commands/maintenance.d.ts +9 -0
- package/dist/commands/maintenance.d.ts.map +1 -0
- package/dist/commands/maintenance.js +38 -0
- package/dist/commands/maintenance.js.map +1 -0
- package/dist/commands/module-list.d.ts +2 -0
- package/dist/commands/module-list.d.ts.map +1 -0
- package/dist/commands/module-list.js +27 -0
- package/dist/commands/module-list.js.map +1 -0
- package/dist/commands/preview.d.ts +14 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +49 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/serve.d.ts +16 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +61 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/{output/ansi.d.ts → console.d.ts} +8 -4
- package/dist/console.d.ts.map +1 -0
- package/dist/{output/ansi.js → console.js} +12 -4
- package/dist/console.js.map +1 -0
- package/dist/index.d.ts +15 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +26 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +83 -0
- package/dist/paths.js.map +1 -0
- package/dist/server-wrapper.d.ts +12 -0
- package/dist/server-wrapper.d.ts.map +1 -0
- package/dist/server-wrapper.js +63 -0
- package/dist/server-wrapper.js.map +1 -0
- package/dist/vercel-wrapper.d.ts +6 -0
- package/dist/vercel-wrapper.d.ts.map +1 -0
- package/dist/vercel-wrapper.js +50 -0
- package/dist/vercel-wrapper.js.map +1 -0
- package/package.json +19 -37
- package/README.md +0 -38
- package/dist/adapter-loader.d.ts +0 -67
- package/dist/adapter-loader.d.ts.map +0 -1
- package/dist/adapter-loader.js +0 -273
- package/dist/adapter-loader.js.map +0 -1
- package/dist/commands/commands.command.d.ts +0 -38
- package/dist/commands/commands.command.d.ts.map +0 -1
- package/dist/commands/commands.command.js +0 -176
- package/dist/commands/commands.command.js.map +0 -1
- package/dist/commands/doctor.command.d.ts +0 -9
- package/dist/commands/doctor.command.d.ts.map +0 -1
- package/dist/commands/doctor.command.js +0 -922
- package/dist/commands/doctor.command.js.map +0 -1
- package/dist/commands/init.command.d.ts +0 -9
- package/dist/commands/init.command.d.ts.map +0 -1
- package/dist/commands/init.command.js +0 -135
- package/dist/commands/init.command.js.map +0 -1
- package/dist/commands/intent.command.d.ts +0 -26
- package/dist/commands/intent.command.d.ts.map +0 -1
- package/dist/commands/intent.command.js +0 -211
- package/dist/commands/intent.command.js.map +0 -1
- package/dist/commands/ir-rebuild.command.d.ts +0 -9
- package/dist/commands/ir-rebuild.command.d.ts.map +0 -1
- package/dist/commands/ir-rebuild.command.js +0 -36
- package/dist/commands/ir-rebuild.command.js.map +0 -1
- package/dist/commands/ir-show.command.d.ts +0 -9
- package/dist/commands/ir-show.command.d.ts.map +0 -1
- package/dist/commands/ir-show.command.js +0 -32
- package/dist/commands/ir-show.command.js.map +0 -1
- package/dist/commands/make.command.d.ts +0 -9
- package/dist/commands/make.command.d.ts.map +0 -1
- package/dist/commands/make.command.js +0 -93
- package/dist/commands/make.command.js.map +0 -1
- package/dist/commands/pack.command.d.ts +0 -16
- package/dist/commands/pack.command.d.ts.map +0 -1
- package/dist/commands/pack.command.js +0 -44
- package/dist/commands/pack.command.js.map +0 -1
- package/dist/commands/runtime.command.d.ts +0 -6
- package/dist/commands/runtime.command.d.ts.map +0 -1
- package/dist/commands/runtime.command.js +0 -379
- package/dist/commands/runtime.command.js.map +0 -1
- package/dist/commands/runtime.d.ts +0 -45
- package/dist/commands/runtime.d.ts.map +0 -1
- package/dist/commands/runtime.js +0 -66
- package/dist/commands/runtime.js.map +0 -1
- package/dist/commands/tinker-agent-plan.d.ts +0 -26
- package/dist/commands/tinker-agent-plan.d.ts.map +0 -1
- package/dist/commands/tinker-agent-plan.js +0 -115
- package/dist/commands/tinker-agent-plan.js.map +0 -1
- package/dist/commands/tinker-chat-commands.d.ts +0 -19
- package/dist/commands/tinker-chat-commands.d.ts.map +0 -1
- package/dist/commands/tinker-chat-commands.js +0 -263
- package/dist/commands/tinker-chat-commands.js.map +0 -1
- package/dist/commands/tinker-chat-runtime.d.ts +0 -30
- package/dist/commands/tinker-chat-runtime.d.ts.map +0 -1
- package/dist/commands/tinker-chat-runtime.js +0 -227
- package/dist/commands/tinker-chat-runtime.js.map +0 -1
- package/dist/commands/tinker-classic-mode.d.ts +0 -15
- package/dist/commands/tinker-classic-mode.d.ts.map +0 -1
- package/dist/commands/tinker-classic-mode.js +0 -160
- package/dist/commands/tinker-classic-mode.js.map +0 -1
- package/dist/commands/tinker-eval.command.d.ts +0 -3
- package/dist/commands/tinker-eval.command.d.ts.map +0 -1
- package/dist/commands/tinker-eval.command.js +0 -151
- package/dist/commands/tinker-eval.command.js.map +0 -1
- package/dist/commands/tinker-repl-display.d.ts +0 -15
- package/dist/commands/tinker-repl-display.d.ts.map +0 -1
- package/dist/commands/tinker-repl-display.js +0 -147
- package/dist/commands/tinker-repl-display.js.map +0 -1
- package/dist/commands/tinker-session-runtime.d.ts +0 -27
- package/dist/commands/tinker-session-runtime.d.ts.map +0 -1
- package/dist/commands/tinker-session-runtime.js +0 -196
- package/dist/commands/tinker-session-runtime.js.map +0 -1
- package/dist/commands/tinker.command.d.ts +0 -9
- package/dist/commands/tinker.command.d.ts.map +0 -1
- package/dist/commands/tinker.command.js +0 -142
- package/dist/commands/tinker.command.js.map +0 -1
- package/dist/commands/use.command.d.ts +0 -10
- package/dist/commands/use.command.d.ts.map +0 -1
- package/dist/commands/use.command.js +0 -69
- package/dist/commands/use.command.js.map +0 -1
- package/dist/config-loader.d.ts +0 -110
- package/dist/config-loader.d.ts.map +0 -1
- package/dist/config-loader.js +0 -119
- package/dist/config-loader.js.map +0 -1
- package/dist/launcher.d.ts +0 -16
- package/dist/launcher.d.ts.map +0 -1
- package/dist/launcher.js +0 -301
- package/dist/launcher.js.map +0 -1
- package/dist/lib/file-scanner.d.ts +0 -8
- package/dist/lib/file-scanner.d.ts.map +0 -1
- package/dist/lib/file-scanner.js +0 -70
- package/dist/lib/file-scanner.js.map +0 -1
- package/dist/lib/tinker-memory.d.ts +0 -19
- package/dist/lib/tinker-memory.d.ts.map +0 -1
- package/dist/lib/tinker-memory.js +0 -107
- package/dist/lib/tinker-memory.js.map +0 -1
- package/dist/lib/tinker-observer.d.ts +0 -47
- package/dist/lib/tinker-observer.d.ts.map +0 -1
- package/dist/lib/tinker-observer.js +0 -77
- package/dist/lib/tinker-observer.js.map +0 -1
- package/dist/lib/tinker-policy.d.ts +0 -21
- package/dist/lib/tinker-policy.d.ts.map +0 -1
- package/dist/lib/tinker-policy.js +0 -102
- package/dist/lib/tinker-policy.js.map +0 -1
- package/dist/lib/tinker-replay.d.ts +0 -51
- package/dist/lib/tinker-replay.d.ts.map +0 -1
- package/dist/lib/tinker-replay.js +0 -123
- package/dist/lib/tinker-replay.js.map +0 -1
- package/dist/output/ansi.d.ts.map +0 -1
- package/dist/output/ansi.js.map +0 -1
- package/dist/output/plan-display.d.ts +0 -4
- package/dist/output/plan-display.d.ts.map +0 -1
- package/dist/output/plan-display.js +0 -49
- package/dist/output/plan-display.js.map +0 -1
- package/dist/output/result-display.d.ts +0 -5
- package/dist/output/result-display.d.ts.map +0 -1
- package/dist/output/result-display.js +0 -17
- package/dist/output/result-display.js.map +0 -1
- package/dist/plugins/tinker-plugin.d.ts +0 -86
- package/dist/plugins/tinker-plugin.d.ts.map +0 -1
- package/dist/plugins/tinker-plugin.js +0 -42
- package/dist/plugins/tinker-plugin.js.map +0 -1
- package/dist/router-preferences.d.ts +0 -5
- package/dist/router-preferences.d.ts.map +0 -1
- package/dist/router-preferences.js +0 -22
- package/dist/router-preferences.js.map +0 -1
- package/dist/runtime/executor.d.ts +0 -33
- package/dist/runtime/executor.d.ts.map +0 -1
- package/dist/runtime/executor.js +0 -180
- package/dist/runtime/executor.js.map +0 -1
- package/dist/runtime/orchestration.d.ts +0 -43
- package/dist/runtime/orchestration.d.ts.map +0 -1
- package/dist/runtime/orchestration.js +0 -209
- package/dist/runtime/orchestration.js.map +0 -1
- package/dist/runtime/policy.d.ts +0 -49
- package/dist/runtime/policy.d.ts.map +0 -1
- package/dist/runtime/policy.js +0 -78
- package/dist/runtime/policy.js.map +0 -1
- package/dist/runtime/profiles.d.ts +0 -15
- package/dist/runtime/profiles.d.ts.map +0 -1
- package/dist/runtime/profiles.js +0 -131
- package/dist/runtime/profiles.js.map +0 -1
- package/dist/runtime/transcripts.d.ts +0 -59
- package/dist/runtime/transcripts.d.ts.map +0 -1
- package/dist/runtime/transcripts.js +0 -172
- package/dist/runtime/transcripts.js.map +0 -1
- package/dist/tools/git-diff.d.ts +0 -3
- package/dist/tools/git-diff.d.ts.map +0 -1
- package/dist/tools/git-diff.js +0 -16
- package/dist/tools/git-diff.js.map +0 -1
- package/dist/tools/index.d.ts +0 -24
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -88
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/lint.d.ts +0 -3
- package/dist/tools/lint.d.ts.map +0 -1
- package/dist/tools/lint.js +0 -35
- package/dist/tools/lint.js.map +0 -1
- package/dist/tools/read-file.d.ts +0 -3
- package/dist/tools/read-file.d.ts.map +0 -1
- package/dist/tools/read-file.js +0 -47
- package/dist/tools/read-file.js.map +0 -1
- package/dist/tools/run-command.d.ts +0 -3
- package/dist/tools/run-command.d.ts.map +0 -1
- package/dist/tools/run-command.js +0 -71
- package/dist/tools/run-command.js.map +0 -1
- package/dist/tools/run-tests.d.ts +0 -3
- package/dist/tools/run-tests.d.ts.map +0 -1
- package/dist/tools/run-tests.js +0 -49
- package/dist/tools/run-tests.js.map +0 -1
- package/dist/tools/tool-dispatch.d.ts +0 -32
- package/dist/tools/tool-dispatch.d.ts.map +0 -1
- package/dist/tools/tool-dispatch.js +0 -120
- package/dist/tools/tool-dispatch.js.map +0 -1
- package/dist/tools/typecheck.d.ts +0 -3
- package/dist/tools/typecheck.d.ts.map +0 -1
- package/dist/tools/typecheck.js +0 -48
- package/dist/tools/typecheck.js.map +0 -1
- package/dist/tools/types.d.ts +0 -62
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/types.js +0 -7
- package/dist/tools/types.js.map +0 -1
- package/dist/tools/write-file.d.ts +0 -15
- package/dist/tools/write-file.d.ts.map +0 -1
- package/dist/tools/write-file.js +0 -52
- package/dist/tools/write-file.js.map +0 -1
- package/dist/tracing/types.d.ts +0 -10
- package/dist/tracing/types.d.ts.map +0 -1
- package/dist/tracing/types.js +0 -2
- package/dist/tracing/types.js.map +0 -1
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime selection command.
|
|
3
|
-
*
|
|
4
|
-
* Sets the preferred AI runtime (ollama, anthropic, claude-code, copilot, etc.)
|
|
5
|
-
* in the Lumis config file for future commands.
|
|
6
|
-
*/
|
|
7
|
-
import fs from 'node:fs';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
export const SUPPORTED_RUNTIMES = [
|
|
10
|
-
'ollama',
|
|
11
|
-
'anthropic',
|
|
12
|
-
'openai',
|
|
13
|
-
'openrouter',
|
|
14
|
-
'groq',
|
|
15
|
-
'deepseek',
|
|
16
|
-
'mistral',
|
|
17
|
-
'gemini',
|
|
18
|
-
'claude-code',
|
|
19
|
-
'copilot',
|
|
20
|
-
'local',
|
|
21
|
-
];
|
|
22
|
-
/**
|
|
23
|
-
* Execute the use command to select preferred runtime.
|
|
24
|
-
*
|
|
25
|
-
* @param context - Shared command runtime context.
|
|
26
|
-
* @returns Exit code (0 success, 1 on validation/write errors).
|
|
27
|
-
*/
|
|
28
|
-
export async function executeUseCommand(context) {
|
|
29
|
-
if (context.commandArgs.length === 0) {
|
|
30
|
-
context.writeError('Missing runtime name.\n');
|
|
31
|
-
context.write(`Usage: lumis use <runtime>\n`);
|
|
32
|
-
context.write(`Supported runtimes: ${SUPPORTED_RUNTIMES.join(', ')}\n`);
|
|
33
|
-
context.write(`Example: lumis use claude-code\n`);
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
const requestedRuntime = context.commandArgs[0].toLowerCase();
|
|
37
|
-
if (!SUPPORTED_RUNTIMES.includes(requestedRuntime)) {
|
|
38
|
-
context.writeError(`Unknown runtime: ${requestedRuntime}\n`);
|
|
39
|
-
context.write(`Supported runtimes: ${SUPPORTED_RUNTIMES.join(', ')}\n`);
|
|
40
|
-
return 1;
|
|
41
|
-
}
|
|
42
|
-
let config = {};
|
|
43
|
-
const configPath = path.join(context.projectRoot, 'lumis.config.json');
|
|
44
|
-
// Load or create config
|
|
45
|
-
if (fs.existsSync(configPath)) {
|
|
46
|
-
try {
|
|
47
|
-
const raw = fs.readFileSync(configPath, 'utf8');
|
|
48
|
-
config = JSON.parse(raw);
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
context.writeError(`Failed to read config: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
52
|
-
return 1;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// Update config with new runtime preference
|
|
56
|
-
config.preferredRuntime = requestedRuntime;
|
|
57
|
-
// Write back to config file
|
|
58
|
-
try {
|
|
59
|
-
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
60
|
-
context.write(`✔ Set preferred runtime to: ${requestedRuntime}\n`);
|
|
61
|
-
context.write(`Config saved to: ${configPath}\n`);
|
|
62
|
-
return 0;
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
context.writeError(`Failed to write config: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
66
|
-
return 1;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=use.command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use.command.js","sourceRoot":"","sources":["../../src/commands/use.command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAI5B,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,UAAU;IACV,SAAS;IACT,QAAQ;IACR,aAAa;IACb,SAAS;IACT,OAAO;CACP,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAuB;IAC9D,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAA;QAC7C,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC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,IAAI,CAAC;QACJ,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACrE,OAAO,CAAC,KAAK,CAAC,+BAA+B,gBAAgB,IAAI,CAAC,CAAA;QAClE,OAAO,CAAC,KAAK,CAAC,oBAAoB,UAAU,IAAI,CAAC,CAAA;QACjD,OAAO,CAAC,CAAA;IACT,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,UAAU,CAAC,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzG,OAAO,CAAC,CAAA;IACT,CAAC;AACF,CAAC"}
|
package/dist/config-loader.d.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import type { LumisTraceListener } from './tracing/types.js';
|
|
2
|
-
export type LumisConfig = {
|
|
3
|
-
adapter?: string;
|
|
4
|
-
preferredRuntime?: string;
|
|
5
|
-
routing?: {
|
|
6
|
-
nextjs?: {
|
|
7
|
-
router?: 'app' | 'pages';
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
projectCommands?: Array<{
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
command: string;
|
|
14
|
-
}>;
|
|
15
|
-
context?: {
|
|
16
|
-
include?: string[];
|
|
17
|
-
exclude?: string[];
|
|
18
|
-
};
|
|
19
|
-
ai?: {
|
|
20
|
-
enabled?: boolean;
|
|
21
|
-
provider?: string;
|
|
22
|
-
model?: string;
|
|
23
|
-
mode?: 'manual' | 'auto';
|
|
24
|
-
defaultModel?: string;
|
|
25
|
-
taskModels?: {
|
|
26
|
-
intentParse?: string;
|
|
27
|
-
planPropose?: string;
|
|
28
|
-
tokenSuggest?: string;
|
|
29
|
-
templateVariant?: string;
|
|
30
|
-
};
|
|
31
|
-
systemPromptExtra?: string;
|
|
32
|
-
};
|
|
33
|
-
runtime?: {
|
|
34
|
-
enabled?: boolean;
|
|
35
|
-
profileId?: string;
|
|
36
|
-
postMakeTasks?: Array<'typecheck' | 'lint' | 'boundaryCheck' | 'build' | 'test'>;
|
|
37
|
-
taskCommandOverrides?: Partial<Record<'typecheck' | 'lint' | 'boundaryCheck' | 'build' | 'test', string>>;
|
|
38
|
-
failOnTaskError?: boolean;
|
|
39
|
-
policy?: {
|
|
40
|
-
mode?: 'strict' | 'advisory';
|
|
41
|
-
requireApprovalForRemote?: boolean;
|
|
42
|
-
approvalEnvVar?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Optional allowlist of command names (exact match or glob prefix) that
|
|
45
|
-
* may be executed via the runtime. In strict mode, commands not matching
|
|
46
|
-
* any entry are blocked. In advisory mode a warning is emitted but
|
|
47
|
-
* execution proceeds.
|
|
48
|
-
*
|
|
49
|
-
* Each entry is either an exact command name (e.g. "pnpm") or a prefix
|
|
50
|
-
* glob ending in "*" (e.g. "pnpm *" matches any pnpm invocation).
|
|
51
|
-
* When absent or empty, all commands are allowed.
|
|
52
|
-
*/
|
|
53
|
-
commandAllowlist?: string[];
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Supply-chain policy: license allowlist and audit threshold.
|
|
58
|
-
*
|
|
59
|
-
* Used by `lumis doctor` to surface supply-chain hygiene issues without
|
|
60
|
-
* running a full audit shell-out at every invocation.
|
|
61
|
-
*/
|
|
62
|
-
supply?: {
|
|
63
|
-
/**
|
|
64
|
-
* SPDX license identifiers that are permitted in direct dependencies.
|
|
65
|
-
* When defined, any direct dependency whose `license` field in
|
|
66
|
-
* `node_modules/<pkg>/package.json` is not in this list will be flagged.
|
|
67
|
-
* Example: ["MIT", "ISC", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause"]
|
|
68
|
-
*/
|
|
69
|
-
allowedLicenses?: string[];
|
|
70
|
-
/**
|
|
71
|
-
* Maximum number of npm/pnpm audit vulnerabilities before doctor fails.
|
|
72
|
-
* Requires `pnpm audit --json` or `npm audit --json` to be run separately.
|
|
73
|
-
* Doctor checks for a cached `.lumis/audit.json` result file.
|
|
74
|
-
* Default: 0 (any vulnerability fails in strict mode).
|
|
75
|
-
*/
|
|
76
|
-
maxVulnerabilities?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Severity threshold for failing. Default: "critical".
|
|
79
|
-
*/
|
|
80
|
-
failOnSeverity?: 'info' | 'low' | 'moderate' | 'high' | 'critical';
|
|
81
|
-
};
|
|
82
|
-
presetPrompts?: Array<{
|
|
83
|
-
label: string;
|
|
84
|
-
prompt: string;
|
|
85
|
-
}>;
|
|
86
|
-
};
|
|
87
|
-
type LoadLumisConfigOptions = {
|
|
88
|
-
onTrace?: LumisTraceListener;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Load lumis config from the project, probing candidate paths in priority order:
|
|
92
|
-
* 1. config/lumis.ts (canonical — preferred for new projects)
|
|
93
|
-
* 2. src/config/lumis.ts (src-first layout variant)
|
|
94
|
-
* 3. lumis.config.ts (legacy root TS — silently honoured)
|
|
95
|
-
* 4. lumis.config.json (legacy root JSON — silently honoured)
|
|
96
|
-
*
|
|
97
|
-
* @param projectRoot - Absolute path of the target project.
|
|
98
|
-
* @returns Parsed Lumis config object, or empty defaults when config is absent.
|
|
99
|
-
*/
|
|
100
|
-
export declare function loadLumisConfig(projectRoot: string, options?: LoadLumisConfigOptions): Promise<LumisConfig>;
|
|
101
|
-
/**
|
|
102
|
-
* Save the lumis config, writing to the first existing config path found,
|
|
103
|
-
* or `config/lumis.ts` for new projects (canonical preferred location).
|
|
104
|
-
*
|
|
105
|
-
* @param projectRoot - Absolute path of the target project.
|
|
106
|
-
* @param config - Lumis configuration to persist.
|
|
107
|
-
*/
|
|
108
|
-
export declare function saveLumisConfig(projectRoot: string, config: LumisConfig): void;
|
|
109
|
-
export {};
|
|
110
|
-
//# sourceMappingURL=config-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,MAAM,MAAM,WAAW,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE;QACT,MAAM,CAAC,EAAE;YACR,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,CAAA;SACxB,CAAA;KACD,CAAA;IACD,eAAe,CAAC,EAAE,KAAK,CAAC;QACvB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,OAAO,EAAE,MAAM,CAAA;KACf,CAAC,CAAA;IACF,OAAO,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAClB,CAAA;IACD,EAAE,CAAC,EAAE;QACJ,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;QACxB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,UAAU,CAAC,EAAE;YACZ,WAAW,CAAC,EAAE,MAAM,CAAA;YACpB,WAAW,CAAC,EAAE,MAAM,CAAA;YACpB,YAAY,CAAC,EAAE,MAAM,CAAA;YACrB,eAAe,CAAC,EAAE,MAAM,CAAA;SACxB,CAAA;QACD,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAC1B,CAAA;IACD,OAAO,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,aAAa,CAAC,EAAE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
|
1
|
-
/**
|
|
2
|
-
* Host config loading for `lumis` CLI/runtime.
|
|
3
|
-
*
|
|
4
|
-
* The config is optional; when absent, runtime falls back to defaults and
|
|
5
|
-
* detection-based pack resolution.
|
|
6
|
-
*/
|
|
7
|
-
import fs from 'node:fs';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
async function emitTrace(onTrace, event) {
|
|
10
|
-
if (!onTrace)
|
|
11
|
-
return;
|
|
12
|
-
await onTrace(event);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Load lumis config from the project, probing candidate paths in priority order:
|
|
16
|
-
* 1. config/lumis.ts (canonical — preferred for new projects)
|
|
17
|
-
* 2. src/config/lumis.ts (src-first layout variant)
|
|
18
|
-
* 3. lumis.config.ts (legacy root TS — silently honoured)
|
|
19
|
-
* 4. lumis.config.json (legacy root JSON — silently honoured)
|
|
20
|
-
*
|
|
21
|
-
* @param projectRoot - Absolute path of the target project.
|
|
22
|
-
* @returns Parsed Lumis config object, or empty defaults when config is absent.
|
|
23
|
-
*/
|
|
24
|
-
export async function loadLumisConfig(projectRoot, options = {}) {
|
|
25
|
-
await emitTrace(options.onTrace, {
|
|
26
|
-
type: 'config-load',
|
|
27
|
-
status: 'start',
|
|
28
|
-
name: 'lumis.config',
|
|
29
|
-
context: { projectRoot },
|
|
30
|
-
});
|
|
31
|
-
const candidates = [
|
|
32
|
-
{ filePath: path.join(projectRoot, 'pkg', 'lumis.config.ts'), name: 'pkg/lumis.config.ts', kind: 'ts' },
|
|
33
|
-
// legacy subdirectory form — silently honoured for one wave
|
|
34
|
-
{ filePath: path.join(projectRoot, 'pkg', 'lumis', 'config.ts'), name: 'pkg/lumis/config.ts', kind: 'ts' },
|
|
35
|
-
{ filePath: path.join(projectRoot, 'config', 'lumis.ts'), name: 'config/lumis.ts', kind: 'ts' },
|
|
36
|
-
{ filePath: path.join(projectRoot, 'src', 'config', 'lumis.ts'), name: 'src/config/lumis.ts', kind: 'ts' },
|
|
37
|
-
{ filePath: path.join(projectRoot, 'lumis.config.ts'), name: 'lumis.config.ts', kind: 'ts' },
|
|
38
|
-
{ filePath: path.join(projectRoot, 'lumis.config.json'), name: 'lumis.config.json', kind: 'json' },
|
|
39
|
-
];
|
|
40
|
-
for (const candidate of candidates) {
|
|
41
|
-
if (!fs.existsSync(candidate.filePath))
|
|
42
|
-
continue;
|
|
43
|
-
if (candidate.kind === 'ts') {
|
|
44
|
-
const { pathToFileURL } = await import('node:url');
|
|
45
|
-
const module = await import(pathToFileURL(candidate.filePath).href);
|
|
46
|
-
await emitTrace(options.onTrace, {
|
|
47
|
-
type: 'config-load',
|
|
48
|
-
status: 'success',
|
|
49
|
-
name: candidate.name,
|
|
50
|
-
context: { configPath: candidate.filePath },
|
|
51
|
-
});
|
|
52
|
-
return (module.default ?? {});
|
|
53
|
-
}
|
|
54
|
-
const raw = fs.readFileSync(candidate.filePath, 'utf8');
|
|
55
|
-
try {
|
|
56
|
-
const parsed = JSON.parse(raw);
|
|
57
|
-
await emitTrace(options.onTrace, {
|
|
58
|
-
type: 'config-load',
|
|
59
|
-
status: 'success',
|
|
60
|
-
name: candidate.name,
|
|
61
|
-
context: { configPath: candidate.filePath },
|
|
62
|
-
});
|
|
63
|
-
return parsed;
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
await emitTrace(options.onTrace, {
|
|
67
|
-
type: 'config-load',
|
|
68
|
-
status: 'failure',
|
|
69
|
-
name: candidate.name,
|
|
70
|
-
message: error instanceof Error ? error.message : String(error),
|
|
71
|
-
context: { configPath: candidate.filePath },
|
|
72
|
-
});
|
|
73
|
-
return {};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
await emitTrace(options.onTrace, {
|
|
77
|
-
type: 'config-load',
|
|
78
|
-
status: 'info',
|
|
79
|
-
name: 'lumis.config',
|
|
80
|
-
message: 'No config file found. Using defaults.',
|
|
81
|
-
context: { projectRoot },
|
|
82
|
-
});
|
|
83
|
-
return {};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Save the lumis config, writing to the first existing config path found,
|
|
87
|
-
* or `config/lumis.ts` for new projects (canonical preferred location).
|
|
88
|
-
*
|
|
89
|
-
* @param projectRoot - Absolute path of the target project.
|
|
90
|
-
* @param config - Lumis configuration to persist.
|
|
91
|
-
*/
|
|
92
|
-
export function saveLumisConfig(projectRoot, config) {
|
|
93
|
-
const existingPaths = [
|
|
94
|
-
path.join(projectRoot, 'pkg', 'lumis.config.ts'),
|
|
95
|
-
path.join(projectRoot, 'pkg', 'lumis', 'config.ts'),
|
|
96
|
-
path.join(projectRoot, 'config', 'lumis.ts'),
|
|
97
|
-
path.join(projectRoot, 'src', 'config', 'lumis.ts'),
|
|
98
|
-
path.join(projectRoot, 'lumis.config.ts'),
|
|
99
|
-
path.join(projectRoot, 'lumis.config.json'),
|
|
100
|
-
];
|
|
101
|
-
const existing = existingPaths.find((p) => fs.existsSync(p));
|
|
102
|
-
if (existing && existing.endsWith('.json')) {
|
|
103
|
-
fs.writeFileSync(existing, JSON.stringify(config, null, 2), 'utf8');
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (existing) {
|
|
107
|
-
// Existing TS file — write JSON serialisation is not safe; callers should
|
|
108
|
-
// handle TS config editing explicitly. Fall back to JSON alongside it.
|
|
109
|
-
fs.writeFileSync(existing, JSON.stringify(config, null, 2), 'utf8');
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
// No existing config — write canonical flat location (TS scaffold handled by init).
|
|
113
|
-
const pkgDir = path.join(projectRoot, 'pkg');
|
|
114
|
-
if (!fs.existsSync(pkgDir)) {
|
|
115
|
-
fs.mkdirSync(pkgDir, { recursive: true });
|
|
116
|
-
}
|
|
117
|
-
fs.writeFileSync(path.join(pkgDir, 'lumis.config.json'), JSON.stringify(config, null, 2), 'utf8');
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=config-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":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
|
|
9
|
-
projectRoot: string;
|
|
10
|
-
write: (message: string) => void;
|
|
11
|
-
stdin?: NodeJS.ReadStream;
|
|
12
|
-
stdout?: NodeJS.WriteStream;
|
|
13
|
-
};
|
|
14
|
-
export declare function runInteractiveLauncher(options: LauncherOptions): Promise<LauncherResult>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=launcher.d.ts.map
|
package/dist/launcher.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,cAAc,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEvC,KAAK,eAAe,GAAG;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;CAC3B,CAAA;AA4LD,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAoK9F"}
|
package/dist/launcher.js
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import readline from 'node:readline';
|
|
3
|
-
import { loadLumisConfig, saveLumisConfig } from './config-loader.js';
|
|
4
|
-
import { SUPPORTED_RUNTIMES } from './commands/use.command.js';
|
|
5
|
-
import { ansi } from './output/ansi.js';
|
|
6
|
-
const RUNTIME_KEY_ENV = {
|
|
7
|
-
anthropic: 'ANTHROPIC_API_KEY',
|
|
8
|
-
openai: 'OPENAI_API_KEY',
|
|
9
|
-
openrouter: 'OPENROUTER_API_KEY',
|
|
10
|
-
groq: 'GROQ_API_KEY',
|
|
11
|
-
deepseek: 'DEEPSEEK_API_KEY',
|
|
12
|
-
mistral: 'MISTRAL_API_KEY',
|
|
13
|
-
gemini: 'GEMINI_API_KEY',
|
|
14
|
-
};
|
|
15
|
-
const RUNTIME_GROUPS = [
|
|
16
|
-
{ label: 'Agent CLIs', ids: ['claude-code', 'copilot'] },
|
|
17
|
-
{ label: 'Model Providers', ids: ['ollama', 'anthropic', 'openai', 'openrouter', 'groq', 'deepseek', 'mistral', 'gemini'] },
|
|
18
|
-
{ label: 'Fallback', ids: ['local'] },
|
|
19
|
-
];
|
|
20
|
-
function commandExists(command) {
|
|
21
|
-
const isWindows = process.platform === 'win32';
|
|
22
|
-
const lookup = isWindows ? 'where' : 'which';
|
|
23
|
-
const result = spawnSync(lookup, [command], {
|
|
24
|
-
stdio: 'ignore',
|
|
25
|
-
env: process.env,
|
|
26
|
-
});
|
|
27
|
-
return result.status === 0;
|
|
28
|
-
}
|
|
29
|
-
async function checkOllamaAvailability(baseUrl, timeoutMs = 1200) {
|
|
30
|
-
try {
|
|
31
|
-
const controller = new AbortController();
|
|
32
|
-
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
33
|
-
const response = await fetch(baseUrl, {
|
|
34
|
-
method: 'HEAD',
|
|
35
|
-
signal: controller.signal,
|
|
36
|
-
});
|
|
37
|
-
clearTimeout(timeoutId);
|
|
38
|
-
return response.status === 404 || response.status === 200;
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async function detectRuntimeScores(preferredRuntime) {
|
|
45
|
-
const preferred = preferredRuntime?.toLowerCase();
|
|
46
|
-
const env = process.env;
|
|
47
|
-
const scores = [];
|
|
48
|
-
const ollamaUrl = env['OLLAMA_BASE_URL'] ?? 'http://localhost:11434/v1';
|
|
49
|
-
const ollamaAvailable = await checkOllamaAvailability(ollamaUrl);
|
|
50
|
-
scores.push({
|
|
51
|
-
id: 'ollama',
|
|
52
|
-
score: ollamaAvailable ? (preferred === 'ollama' ? 100 : 55) : 0,
|
|
53
|
-
reason: ollamaAvailable ? `Running at ${ollamaUrl}` : 'Not running',
|
|
54
|
-
preferred: preferred === 'ollama',
|
|
55
|
-
available: ollamaAvailable,
|
|
56
|
-
});
|
|
57
|
-
const providers = [
|
|
58
|
-
{ id: 'groq', key: 'GROQ_API_KEY', score: 90 },
|
|
59
|
-
{ id: 'openrouter', key: 'OPENROUTER_API_KEY', score: 85 },
|
|
60
|
-
{ id: 'anthropic', key: 'ANTHROPIC_API_KEY', score: 80 },
|
|
61
|
-
{ id: 'openai', key: 'OPENAI_API_KEY', score: 75 },
|
|
62
|
-
{ id: 'deepseek', key: 'DEEPSEEK_API_KEY', score: 70 },
|
|
63
|
-
{ id: 'mistral', key: 'MISTRAL_API_KEY', score: 65 },
|
|
64
|
-
{ id: 'gemini', key: 'GEMINI_API_KEY', score: 60 },
|
|
65
|
-
];
|
|
66
|
-
for (const provider of providers) {
|
|
67
|
-
const configured = (env[provider.key] ?? '').trim().length > 0;
|
|
68
|
-
if (!configured)
|
|
69
|
-
continue;
|
|
70
|
-
const isPreferred = preferred === provider.id;
|
|
71
|
-
scores.push({
|
|
72
|
-
id: provider.id,
|
|
73
|
-
score: isPreferred ? 100 : provider.score,
|
|
74
|
-
reason: `Configured via ${provider.key}`,
|
|
75
|
-
preferred: isPreferred,
|
|
76
|
-
available: true,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (preferred === 'claude-code') {
|
|
80
|
-
scores.push({ id: 'claude-code', score: 100, reason: 'Preferred runtime requested', preferred: true, available: true });
|
|
81
|
-
}
|
|
82
|
-
if (preferred === 'copilot') {
|
|
83
|
-
scores.push({ id: 'copilot', score: 100, reason: 'Preferred runtime requested', preferred: true, available: true });
|
|
84
|
-
}
|
|
85
|
-
scores.push({
|
|
86
|
-
id: 'local',
|
|
87
|
-
score: preferred === 'local' ? 100 : 5,
|
|
88
|
-
reason: 'Deterministic fallback',
|
|
89
|
-
preferred: preferred === 'local',
|
|
90
|
-
available: true,
|
|
91
|
-
});
|
|
92
|
-
scores.sort((a, b) => b.score - a.score);
|
|
93
|
-
return scores;
|
|
94
|
-
}
|
|
95
|
-
function runtimeStatusLabel(runtimeId, score) {
|
|
96
|
-
if (runtimeId === 'claude-code') {
|
|
97
|
-
if (commandExists('claude'))
|
|
98
|
-
return ansi.green('installed');
|
|
99
|
-
if (score?.preferred)
|
|
100
|
-
return ansi.yellow('preferred (not detected)');
|
|
101
|
-
return ansi.dim('not detected');
|
|
102
|
-
}
|
|
103
|
-
if (runtimeId === 'copilot') {
|
|
104
|
-
if (commandExists('github-copilot'))
|
|
105
|
-
return ansi.green('installed');
|
|
106
|
-
if (score?.preferred)
|
|
107
|
-
return ansi.yellow('preferred (not detected)');
|
|
108
|
-
return ansi.dim('not detected');
|
|
109
|
-
}
|
|
110
|
-
if (score?.available) {
|
|
111
|
-
return ansi.green('available');
|
|
112
|
-
}
|
|
113
|
-
const keyEnv = RUNTIME_KEY_ENV[runtimeId];
|
|
114
|
-
if (keyEnv) {
|
|
115
|
-
return ansi.dim(`missing ${keyEnv}`);
|
|
116
|
-
}
|
|
117
|
-
if (runtimeId === 'ollama') {
|
|
118
|
-
return ansi.dim('not running');
|
|
119
|
-
}
|
|
120
|
-
if (runtimeId === 'local') {
|
|
121
|
-
return ansi.green('always available');
|
|
122
|
-
}
|
|
123
|
-
return ansi.dim('unavailable');
|
|
124
|
-
}
|
|
125
|
-
function renderLauncher(args) {
|
|
126
|
-
const runtimeScores = new Map(args.runtimes.map((runtime) => [runtime.id, runtime]));
|
|
127
|
-
const runtimeIndex = new Map(SUPPORTED_RUNTIMES.map((runtimeId, index) => [runtimeId, index]));
|
|
128
|
-
const lines = [];
|
|
129
|
-
lines.push('\u001Bc');
|
|
130
|
-
lines.push(ansi.label('Interactive Launcher'));
|
|
131
|
-
lines.push('');
|
|
132
|
-
lines.push(ansi.bold('AI Runtime'));
|
|
133
|
-
for (const group of RUNTIME_GROUPS) {
|
|
134
|
-
lines.push(` ${ansi.dim(group.label)}`);
|
|
135
|
-
for (const runtimeId of group.ids) {
|
|
136
|
-
const index = runtimeIndex.get(runtimeId);
|
|
137
|
-
if (index === undefined) {
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
const score = runtimeScores.get(runtimeId);
|
|
141
|
-
const selected = args.mode === 'runtime' && args.selectedIndex === index;
|
|
142
|
-
const pointer = selected ? ansi.cyan('▸') : ' ';
|
|
143
|
-
const preferred = args.preferredRuntime === runtimeId ? ` ${ansi.yellow('★')}` : '';
|
|
144
|
-
const status = runtimeStatusLabel(runtimeId, score);
|
|
145
|
-
const scoreText = score?.available ? ansi.dim(`${score.score}%`) : ansi.dim('--');
|
|
146
|
-
lines.push(` ${pointer} ${runtimeId.padEnd(12)} ${status} ${scoreText}${preferred}`);
|
|
147
|
-
}
|
|
148
|
-
lines.push('');
|
|
149
|
-
}
|
|
150
|
-
lines.push(ansi.bold('Quick Actions'));
|
|
151
|
-
args.actions.forEach((action, index) => {
|
|
152
|
-
const selected = args.mode === 'action' && args.selectedIndex === index;
|
|
153
|
-
const pointer = selected ? ansi.cyan('▸') : ' ';
|
|
154
|
-
lines.push(` ${pointer} ${action.label}`);
|
|
155
|
-
lines.push(` ${ansi.dim(action.description)}`);
|
|
156
|
-
});
|
|
157
|
-
lines.push('');
|
|
158
|
-
lines.push(ansi.dim(args.mode === 'runtime'
|
|
159
|
-
? '↑/↓ navigate • tab switch sections • enter → set runtime & start session • esc quit'
|
|
160
|
-
: '↑/↓ navigate • tab switch sections • enter → run action • esc quit'));
|
|
161
|
-
return `${lines.join('\n')}\n`;
|
|
162
|
-
}
|
|
163
|
-
export async function runInteractiveLauncher(options) {
|
|
164
|
-
const stdin = options.stdin ?? process.stdin;
|
|
165
|
-
const stdout = options.stdout ?? process.stdout;
|
|
166
|
-
if (!stdin.isTTY || !stdout.isTTY || typeof stdin.setRawMode !== 'function') {
|
|
167
|
-
return { kind: 'exit', code: 0 };
|
|
168
|
-
}
|
|
169
|
-
const config = await loadLumisConfig(options.projectRoot);
|
|
170
|
-
const runtimes = await detectRuntimeScores(config.preferredRuntime);
|
|
171
|
-
const actions = [
|
|
172
|
-
{
|
|
173
|
-
label: 'Start AI session',
|
|
174
|
-
description: 'Open interactive AI session using the configured runtime (tinker mode)',
|
|
175
|
-
argv: ['tinker'],
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
label: 'Run doctor',
|
|
179
|
-
description: 'Diagnostics for environment and pack routing',
|
|
180
|
-
argv: ['doctor'],
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
label: 'Detect pack',
|
|
184
|
-
description: 'Probe this project and select the best adapter',
|
|
185
|
-
argv: ['pack', 'detect'],
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
label: 'List commands',
|
|
189
|
-
description: 'Show available pack/project commands',
|
|
190
|
-
argv: ['commands', 'list'],
|
|
191
|
-
},
|
|
192
|
-
];
|
|
193
|
-
let preferredRuntime = config.preferredRuntime;
|
|
194
|
-
let mode = 'runtime';
|
|
195
|
-
let selectedIndex = 0;
|
|
196
|
-
const maxIndex = () => (mode === 'runtime' ? SUPPORTED_RUNTIMES.length - 1 : actions.length - 1);
|
|
197
|
-
const render = () => {
|
|
198
|
-
options.write(renderLauncher({
|
|
199
|
-
mode,
|
|
200
|
-
runtimes,
|
|
201
|
-
preferredRuntime,
|
|
202
|
-
actions,
|
|
203
|
-
selectedIndex,
|
|
204
|
-
}));
|
|
205
|
-
};
|
|
206
|
-
const setPreferredRuntime = (runtimeId) => {
|
|
207
|
-
saveLumisConfig(options.projectRoot, {
|
|
208
|
-
...config,
|
|
209
|
-
preferredRuntime: runtimeId,
|
|
210
|
-
});
|
|
211
|
-
// Update local state so next render() shows the ★ on the new selection
|
|
212
|
-
preferredRuntime = runtimeId;
|
|
213
|
-
};
|
|
214
|
-
render();
|
|
215
|
-
return new Promise((resolve) => {
|
|
216
|
-
readline.emitKeypressEvents(stdin);
|
|
217
|
-
stdin.setRawMode(true);
|
|
218
|
-
stdin.resume();
|
|
219
|
-
const cleanup = () => {
|
|
220
|
-
stdin.setRawMode(false);
|
|
221
|
-
stdin.pause();
|
|
222
|
-
stdin.removeListener('keypress', onKeyPress);
|
|
223
|
-
};
|
|
224
|
-
const finish = (result) => {
|
|
225
|
-
cleanup();
|
|
226
|
-
resolve(result);
|
|
227
|
-
};
|
|
228
|
-
const onKeyPress = (_str, key) => {
|
|
229
|
-
if (key.name === 'escape') {
|
|
230
|
-
finish({ kind: 'exit', code: 0 });
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
if (key.ctrl && key.name === 'c') {
|
|
234
|
-
finish({ kind: 'exit', code: 130 });
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (key.name === 'tab') {
|
|
238
|
-
mode = mode === 'runtime' ? 'action' : 'runtime';
|
|
239
|
-
selectedIndex = Math.min(selectedIndex, maxIndex());
|
|
240
|
-
render();
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
if (key.name === 'up') {
|
|
244
|
-
selectedIndex = selectedIndex > 0 ? selectedIndex - 1 : maxIndex();
|
|
245
|
-
render();
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
if (key.name === 'down') {
|
|
249
|
-
selectedIndex = selectedIndex < maxIndex() ? selectedIndex + 1 : 0;
|
|
250
|
-
render();
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
if (key.name === 'return' || key.name === 'right') {
|
|
254
|
-
if (mode === 'runtime') {
|
|
255
|
-
const runtimeId = SUPPORTED_RUNTIMES[selectedIndex];
|
|
256
|
-
if (!runtimeId) {
|
|
257
|
-
finish({ kind: 'exit', code: 1 });
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
// 1. Persist preference — writes lumis.config.json
|
|
261
|
-
setPreferredRuntime(runtimeId);
|
|
262
|
-
// 2. Re-render so the ★ appears on the saved selection before proceeding
|
|
263
|
-
render();
|
|
264
|
-
// 3. Native CLI tools that are full replacements — spawn them directly
|
|
265
|
-
if (runtimeId === 'claude-code' && commandExists('claude')) {
|
|
266
|
-
cleanup();
|
|
267
|
-
const result = spawnSync('claude', [], { stdio: 'inherit', env: process.env });
|
|
268
|
-
resolve({ kind: 'exit', code: result.status ?? 0 });
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
if (runtimeId === 'copilot' && commandExists('gh')) {
|
|
272
|
-
cleanup();
|
|
273
|
-
const result = spawnSync('gh', ['copilot', 'suggest', '--target', 'shell'], {
|
|
274
|
-
stdio: 'inherit',
|
|
275
|
-
env: process.env,
|
|
276
|
-
});
|
|
277
|
-
resolve({ kind: 'exit', code: result.status ?? 0 });
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
if (runtimeId === 'ollama' && commandExists('ollama')) {
|
|
281
|
-
cleanup();
|
|
282
|
-
const result = spawnSync('ollama', ['run', 'llama3'], { stdio: 'inherit', env: process.env });
|
|
283
|
-
resolve({ kind: 'exit', code: result.status ?? 0 });
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
// 4. API-based runtimes and local — dispatch to tinker so the AI session starts
|
|
287
|
-
finish({ kind: 'dispatch', argv: ['tinker'] });
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const action = actions[selectedIndex];
|
|
291
|
-
if (!action) {
|
|
292
|
-
finish({ kind: 'exit', code: 1 });
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
finish({ kind: 'dispatch', argv: action.argv });
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
stdin.on('keypress', onKeyPress);
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
//# sourceMappingURL=launcher.js.map
|