motebit 0.6.2 → 0.6.4

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.
Files changed (2) hide show
  1. package/dist/index.js +63 -5
  2. package/package.json +1 -3
package/dist/index.js CHANGED
@@ -5315,7 +5315,7 @@ var init_config2 = __esm({
5315
5315
  "src/config.ts"() {
5316
5316
  "use strict";
5317
5317
  init_esm_shims();
5318
- VERSION = true ? "0.6.2" : "0.0.0-dev";
5318
+ VERSION = true ? "0.6.4" : "0.0.0-dev";
5319
5319
  CONFIG_DIR = path2.join(os.homedir(), ".motebit");
5320
5320
  CONFIG_PATH = path2.join(CONFIG_DIR, "config.json");
5321
5321
  }
@@ -29245,8 +29245,30 @@ async function main() {
29245
29245
  console.log();
29246
29246
  console.log(` ${dim("3.")} Run ${bold("motebit")} again.`);
29247
29247
  console.log();
29248
+ console.log(` ${dim("Or run locally without a key:")} ${bold("motebit --provider ollama")}`);
29249
+ console.log();
29248
29250
  return;
29249
29251
  }
29252
+ try {
29253
+ const resp = await fetch("https://api.anthropic.com/v1/models", {
29254
+ headers: {
29255
+ "x-api-key": key,
29256
+ "anthropic-version": "2023-06-01"
29257
+ }
29258
+ });
29259
+ if (!resp.ok) {
29260
+ console.log();
29261
+ console.log(` ${dim("\u2500")} ${bold("API key didn't work")}`);
29262
+ console.log();
29263
+ console.log(
29264
+ ` Check that your key is valid at ${cyan("https://console.anthropic.com/settings/keys")}`
29265
+ );
29266
+ console.log(` Then run ${bold("motebit")} again.`);
29267
+ console.log();
29268
+ return;
29269
+ }
29270
+ } catch {
29271
+ }
29250
29272
  } else if (config.provider === "openai") {
29251
29273
  const key = process.env["OPENAI_API_KEY"];
29252
29274
  if (key == null || key === "") {
@@ -29261,8 +29283,29 @@ async function main() {
29261
29283
  console.log();
29262
29284
  console.log(` ${dim("3.")} Run ${bold("motebit")} again.`);
29263
29285
  console.log();
29286
+ console.log(` ${dim("Or run locally without a key:")} ${bold("motebit --provider ollama")}`);
29287
+ console.log();
29264
29288
  return;
29265
29289
  }
29290
+ try {
29291
+ const resp = await fetch("https://api.openai.com/v1/models", {
29292
+ headers: {
29293
+ Authorization: `Bearer ${key}`
29294
+ }
29295
+ });
29296
+ if (!resp.ok) {
29297
+ console.log();
29298
+ console.log(` ${dim("\u2500")} ${bold("API key didn't work")}`);
29299
+ console.log();
29300
+ console.log(
29301
+ ` Check that your key is valid at ${cyan("https://platform.openai.com/api-keys")}`
29302
+ );
29303
+ console.log(` Then run ${bold("motebit")} again.`);
29304
+ console.log();
29305
+ return;
29306
+ }
29307
+ } catch {
29308
+ }
29266
29309
  }
29267
29310
  const envPassphrase = process.env["MOTEBIT_PASSPHRASE"];
29268
29311
  let passphrase;
@@ -29271,10 +29314,14 @@ async function main() {
29271
29314
  try {
29272
29315
  await decryptPrivateKey(fullConfig.cli_encrypted_key, passphrase);
29273
29316
  } catch {
29274
- console.error("Error: incorrect passphrase.");
29275
- console.error(
29276
- " Run `npm create motebit` to generate a new identity, or set MOTEBIT_PASSPHRASE env var."
29277
- );
29317
+ console.log();
29318
+ console.log(` ${dim("\u2500")} ${bold("Incorrect passphrase.")}`);
29319
+ console.log();
29320
+ console.log(` ${dim("Try again, or reset your identity:")}`);
29321
+ console.log();
29322
+ console.log(` ${dim("rm ~/.motebit/config.json")}`);
29323
+ console.log(` ${dim("motebit")}`);
29324
+ console.log();
29278
29325
  process.exit(1);
29279
29326
  }
29280
29327
  } else if (fullConfig.cli_private_key != null && fullConfig.cli_private_key !== "") {
@@ -29302,6 +29349,17 @@ async function main() {
29302
29349
  console.error(" Error: passphrase cannot be empty.");
29303
29350
  process.exit(1);
29304
29351
  }
29352
+ if (!envPassphrase) {
29353
+ const confirm = await promptPassphrase(" Confirm passphrase: ");
29354
+ if (confirm !== passphrase) {
29355
+ console.log();
29356
+ console.log(` ${dim("\u2500")} ${bold("Passphrases didn't match.")}`);
29357
+ console.log();
29358
+ console.log(` ${dim("Run")} ${bold("motebit")} ${dim("again to try once more.")}`);
29359
+ console.log();
29360
+ process.exit(1);
29361
+ }
29362
+ }
29305
29363
  }
29306
29364
  enableBracketedPaste();
29307
29365
  let rl = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motebit",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "type": "module",
5
5
  "description": "Sovereign AI agent — persistent identity, accumulated trust, governance at the boundary",
6
6
  "main": "./dist/index.js",
@@ -57,7 +57,6 @@
57
57
  "ws": "^8.18.0"
58
58
  },
59
59
  "optionalDependencies": {
60
- "better-sqlite3": "^11.0.0",
61
60
  "@xenova/transformers": "^2.17.2"
62
61
  },
63
62
  "devDependencies": {
@@ -79,7 +78,6 @@
79
78
  "@motebit/crypto": "workspace:*",
80
79
  "@motebit/core-identity": "workspace:*",
81
80
  "@motebit/identity-file": "workspace:*",
82
- "@types/better-sqlite3": "^7.6.0",
83
81
  "@types/node": "^22.0.0",
84
82
  "tsup": "^8.0.0",
85
83
  "tsx": "^4.19.0",