omnara 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/dist/cli.js +55 -5
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6204,7 +6204,7 @@ var FALLBACK_NAME = pkg.name ?? "omnara";
|
|
|
6204
6204
|
var FALLBACK_VERSION = pkg.version ?? "0.0.0";
|
|
6205
6205
|
var FALLBACK_DESCRIPTION = pkg.description ?? "Command-line interface for Omnara.";
|
|
6206
6206
|
var PACKAGE_NAME = true ? "omnara" : FALLBACK_NAME;
|
|
6207
|
-
var PACKAGE_VERSION = true ? "0.3.
|
|
6207
|
+
var PACKAGE_VERSION = true ? "0.3.1" : FALLBACK_VERSION;
|
|
6208
6208
|
var PACKAGE_DESCRIPTION = true ? "Command-line interface for Omnara." : FALLBACK_DESCRIPTION;
|
|
6209
6209
|
|
|
6210
6210
|
// src/auth/supabase-client.ts
|
|
@@ -10193,15 +10193,19 @@ async function performClaudeCodeCheck() {
|
|
|
10193
10193
|
if (process.env.OMNARA_SKIP_CLAUDE_CHECK === "true") {
|
|
10194
10194
|
return true;
|
|
10195
10195
|
}
|
|
10196
|
+
const indicator = createClaudeCheckIndicator();
|
|
10196
10197
|
try {
|
|
10198
|
+
indicator?.start();
|
|
10197
10199
|
for await (const message of query4({
|
|
10198
10200
|
prompt: "Respond with one word.",
|
|
10199
10201
|
options: { maxTurns: 1, model: "haiku", settingSources: ["user", "project", "local"] }
|
|
10200
10202
|
})) {
|
|
10201
10203
|
void message;
|
|
10202
10204
|
}
|
|
10205
|
+
indicator?.stop("ok");
|
|
10203
10206
|
return true;
|
|
10204
10207
|
} catch {
|
|
10208
|
+
indicator?.stop("fail");
|
|
10205
10209
|
console.log(
|
|
10206
10210
|
chalk4.red(
|
|
10207
10211
|
"\nError: Omnara couldn't run because it relies on Claude Code, which isn't installed or authenticated. Try running `claude /login`.\n"
|
|
@@ -10210,6 +10214,52 @@ async function performClaudeCodeCheck() {
|
|
|
10210
10214
|
return false;
|
|
10211
10215
|
}
|
|
10212
10216
|
}
|
|
10217
|
+
function createClaudeCheckIndicator() {
|
|
10218
|
+
if (!process.stdout.isTTY) {
|
|
10219
|
+
return {
|
|
10220
|
+
start() {
|
|
10221
|
+
console.log("Checking Claude Code auth...");
|
|
10222
|
+
},
|
|
10223
|
+
stop(status) {
|
|
10224
|
+
if (status !== "ok") {
|
|
10225
|
+
console.log("Claude Code auth failed.");
|
|
10226
|
+
}
|
|
10227
|
+
}
|
|
10228
|
+
};
|
|
10229
|
+
}
|
|
10230
|
+
const label = "Checking Claude Code auth";
|
|
10231
|
+
const frames = ["-", "\\", "|", "/"];
|
|
10232
|
+
let index = 0;
|
|
10233
|
+
let interval = null;
|
|
10234
|
+
let running = false;
|
|
10235
|
+
const stopLine = (status) => {
|
|
10236
|
+
if (!running) {
|
|
10237
|
+
return;
|
|
10238
|
+
}
|
|
10239
|
+
running = false;
|
|
10240
|
+
if (interval) {
|
|
10241
|
+
clearInterval(interval);
|
|
10242
|
+
}
|
|
10243
|
+
const statusText = status === "ok" ? chalk4.green("OK") : chalk4.red("FAILED");
|
|
10244
|
+
const padding = " ";
|
|
10245
|
+
process.stdout.write(`\r${label} ${statusText}${padding}
|
|
10246
|
+
`);
|
|
10247
|
+
};
|
|
10248
|
+
return {
|
|
10249
|
+
start() {
|
|
10250
|
+
if (running) {
|
|
10251
|
+
return;
|
|
10252
|
+
}
|
|
10253
|
+
running = true;
|
|
10254
|
+
process.stdout.write(`${label} ...`);
|
|
10255
|
+
interval = setInterval(() => {
|
|
10256
|
+
process.stdout.write(`\r${label} ${frames[index]} `);
|
|
10257
|
+
index = (index + 1) % frames.length;
|
|
10258
|
+
}, 120);
|
|
10259
|
+
},
|
|
10260
|
+
stop: stopLine
|
|
10261
|
+
};
|
|
10262
|
+
}
|
|
10213
10263
|
|
|
10214
10264
|
// src/cli.ts
|
|
10215
10265
|
import chalk5 from "chalk";
|
|
@@ -10222,6 +10272,10 @@ function createProgram() {
|
|
|
10222
10272
|
process.exitCode = 1;
|
|
10223
10273
|
return;
|
|
10224
10274
|
}
|
|
10275
|
+
const authenticated = await performClaudeCodeCheck();
|
|
10276
|
+
if (!authenticated) {
|
|
10277
|
+
return;
|
|
10278
|
+
}
|
|
10225
10279
|
await launchSessionViaDaemon();
|
|
10226
10280
|
});
|
|
10227
10281
|
program.addCommand(buildAuthCommand());
|
|
@@ -10235,10 +10289,6 @@ async function run(argv) {
|
|
|
10235
10289
|
if (reinstalled) {
|
|
10236
10290
|
return;
|
|
10237
10291
|
}
|
|
10238
|
-
const authenticated = await performClaudeCodeCheck();
|
|
10239
|
-
if (!authenticated) {
|
|
10240
|
-
return;
|
|
10241
|
-
}
|
|
10242
10292
|
try {
|
|
10243
10293
|
await program.parseAsync(argv);
|
|
10244
10294
|
} catch (error) {
|