@onebrain-ai/cli 2.2.4 → 2.2.5
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/onebrain +64 -56
- package/package.json +1 -1
package/dist/onebrain
CHANGED
|
@@ -9560,7 +9560,7 @@ var init_lib = __esm(() => {
|
|
|
9560
9560
|
var require_package = __commonJS((exports, module) => {
|
|
9561
9561
|
module.exports = {
|
|
9562
9562
|
name: "@onebrain-ai/cli",
|
|
9563
|
-
version: "2.2.
|
|
9563
|
+
version: "2.2.5",
|
|
9564
9564
|
description: "CLI for OneBrain \u2014 personal AI OS for Obsidian with persistent memory, 24+ skills, and Claude Code integration",
|
|
9565
9565
|
keywords: [
|
|
9566
9566
|
"onebrain",
|
|
@@ -10015,23 +10015,30 @@ async function pathExists(p2) {
|
|
|
10015
10015
|
return false;
|
|
10016
10016
|
}
|
|
10017
10017
|
}
|
|
10018
|
-
async function
|
|
10018
|
+
async function detectHarnesses(vaultRoot) {
|
|
10019
10019
|
const env = process.env["ONEBRAIN_HARNESS"];
|
|
10020
10020
|
if (env) {
|
|
10021
10021
|
if (env === "claude" || env === "claude-code")
|
|
10022
|
-
return "claude";
|
|
10022
|
+
return ["claude"];
|
|
10023
10023
|
if (env === "gemini")
|
|
10024
|
-
return "gemini";
|
|
10024
|
+
return ["gemini"];
|
|
10025
10025
|
if (env === "direct")
|
|
10026
|
-
return "direct";
|
|
10026
|
+
return ["direct"];
|
|
10027
10027
|
process.stderr.write(`harness: unknown ONEBRAIN_HARNESS value "${env}" \u2014 ignoring, falling back to directory detection
|
|
10028
10028
|
`);
|
|
10029
10029
|
}
|
|
10030
|
-
|
|
10031
|
-
return "gemini";
|
|
10030
|
+
const detected = [];
|
|
10032
10031
|
if (await pathExists(join3(vaultRoot, ".claude")))
|
|
10033
|
-
|
|
10034
|
-
|
|
10032
|
+
detected.push("claude");
|
|
10033
|
+
if (await pathExists(join3(vaultRoot, ".gemini")))
|
|
10034
|
+
detected.push("gemini");
|
|
10035
|
+
if (detected.length === 0)
|
|
10036
|
+
return ["direct"];
|
|
10037
|
+
return detected;
|
|
10038
|
+
}
|
|
10039
|
+
async function detectHarness(vaultRoot) {
|
|
10040
|
+
const [first] = await detectHarnesses(vaultRoot);
|
|
10041
|
+
return first ?? "direct";
|
|
10035
10042
|
}
|
|
10036
10043
|
var init_harness = () => {};
|
|
10037
10044
|
|
|
@@ -10282,7 +10289,7 @@ ${PATH_EXPORT}
|
|
|
10282
10289
|
async function runRegisterHooks(opts = {}) {
|
|
10283
10290
|
const vaultRoot = opts.vaultDir ?? process.cwd();
|
|
10284
10291
|
const isTTY = opts.isTTY ?? process.stdout.isTTY ?? false;
|
|
10285
|
-
const
|
|
10292
|
+
const harnesses = await detectHarnesses(vaultRoot);
|
|
10286
10293
|
let qmdCollection;
|
|
10287
10294
|
try {
|
|
10288
10295
|
const vaultConfig = await loadVaultConfig(vaultRoot);
|
|
@@ -10308,52 +10315,53 @@ async function runRegisterHooks(opts = {}) {
|
|
|
10308
10315
|
let hooksSpinner = null;
|
|
10309
10316
|
let permSpinner = null;
|
|
10310
10317
|
try {
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10318
|
+
for (const harness of harnesses) {
|
|
10319
|
+
if (harness === "claude") {
|
|
10320
|
+
hooksSpinner = isTTY ? L2() : null;
|
|
10321
|
+
hooksSpinner?.start("Registering hooks...");
|
|
10322
|
+
const settings = await readSettings(settingsPath);
|
|
10323
|
+
result.hooks = applyHooks(settings);
|
|
10324
|
+
let qmdStatus;
|
|
10325
|
+
if (qmdCollection) {
|
|
10326
|
+
qmdStatus = applyQmdHook(settings);
|
|
10327
|
+
} else {
|
|
10328
|
+
const groups = settings.hooks?.["PostToolUse"] ?? [];
|
|
10329
|
+
const stripped = migrateLegacyQmdEntries(groups, false);
|
|
10330
|
+
if (stripped && groups.length === 0 && settings.hooks) {
|
|
10331
|
+
delete settings.hooks["PostToolUse"];
|
|
10332
|
+
}
|
|
10324
10333
|
}
|
|
10334
|
+
if (isTTY) {
|
|
10335
|
+
const parts = HOOK_EVENTS.map((e2) => {
|
|
10336
|
+
const status = result.hooks[e2];
|
|
10337
|
+
const icon = import_picocolors4.default.green(status === "ok" ? "\u2713" : status === "migrated" ? "\u2191" : "+");
|
|
10338
|
+
return `${import_picocolors4.default.dim(e2)} ${icon}`;
|
|
10339
|
+
});
|
|
10340
|
+
if (qmdStatus) {
|
|
10341
|
+
const qmdIcon = qmdStatus === "ok" ? "\u2713" : qmdStatus === "migrated" ? "\u2191" : "+";
|
|
10342
|
+
parts.push(`${import_picocolors4.default.dim("PostToolUse")} ${import_picocolors4.default.green(qmdIcon)}`);
|
|
10343
|
+
}
|
|
10344
|
+
hooksSpinner?.stop(`Hooks ${parts.join(" ")}`);
|
|
10345
|
+
} else {
|
|
10346
|
+
const hookLine = HOOK_EVENTS.map((e2) => {
|
|
10347
|
+
const status = result.hooks[e2] ?? "ok";
|
|
10348
|
+
return `${e2} ${status}`;
|
|
10349
|
+
}).join(" ");
|
|
10350
|
+
note(hookLine);
|
|
10351
|
+
if (qmdStatus)
|
|
10352
|
+
note(`PostToolUse ${qmdStatus}`);
|
|
10353
|
+
}
|
|
10354
|
+
permSpinner = isTTY ? L2() : null;
|
|
10355
|
+
permSpinner?.start("Updating permissions...");
|
|
10356
|
+
result.permissionsAdded = applyPermissions(settings);
|
|
10357
|
+
await writeSettings(settingsPath, settings);
|
|
10358
|
+
permSpinner?.stop("Permissions ok");
|
|
10359
|
+
if (!isTTY)
|
|
10360
|
+
note("permissions ok");
|
|
10361
|
+
}
|
|
10362
|
+
if (harness === "direct") {
|
|
10363
|
+
await registerDirectPath();
|
|
10325
10364
|
}
|
|
10326
|
-
if (isTTY) {
|
|
10327
|
-
const parts = HOOK_EVENTS.map((e2) => {
|
|
10328
|
-
const status = result.hooks[e2];
|
|
10329
|
-
const icon = import_picocolors4.default.green(status === "ok" ? "\u2713" : status === "migrated" ? "\u2191" : "+");
|
|
10330
|
-
return `${import_picocolors4.default.dim(e2)} ${icon}`;
|
|
10331
|
-
});
|
|
10332
|
-
if (qmdStatus) {
|
|
10333
|
-
const qmdIcon = qmdStatus === "ok" ? "\u2713" : qmdStatus === "migrated" ? "\u2191" : "+";
|
|
10334
|
-
parts.push(`${import_picocolors4.default.dim("PostToolUse")} ${import_picocolors4.default.green(qmdIcon)}`);
|
|
10335
|
-
}
|
|
10336
|
-
hooksSpinner?.stop(`Hooks ${parts.join(" ")}`);
|
|
10337
|
-
} else {
|
|
10338
|
-
const hookLine = HOOK_EVENTS.map((e2) => {
|
|
10339
|
-
const status = result.hooks[e2];
|
|
10340
|
-
const label = status === "ok" || status === "added" || status === "migrated" ? "ok" : status ?? "ok";
|
|
10341
|
-
return `${e2} ${label}`;
|
|
10342
|
-
}).join(" ");
|
|
10343
|
-
note(hookLine);
|
|
10344
|
-
if (qmdStatus)
|
|
10345
|
-
note(`PostToolUse ${qmdStatus}`);
|
|
10346
|
-
}
|
|
10347
|
-
permSpinner = isTTY ? L2() : null;
|
|
10348
|
-
permSpinner?.start("Updating permissions...");
|
|
10349
|
-
result.permissionsAdded = applyPermissions(settings);
|
|
10350
|
-
await writeSettings(settingsPath, settings);
|
|
10351
|
-
permSpinner?.stop("Permissions ok");
|
|
10352
|
-
if (!isTTY)
|
|
10353
|
-
note("permissions ok");
|
|
10354
|
-
}
|
|
10355
|
-
if (harness === "direct") {
|
|
10356
|
-
await registerDirectPath();
|
|
10357
10365
|
}
|
|
10358
10366
|
result.ok = true;
|
|
10359
10367
|
if (!isTTY) {
|
|
@@ -11040,7 +11048,7 @@ var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
|
11040
11048
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
11041
11049
|
function resolveBinaryVersion() {
|
|
11042
11050
|
if (true)
|
|
11043
|
-
return "2.2.
|
|
11051
|
+
return "2.2.5";
|
|
11044
11052
|
try {
|
|
11045
11053
|
const pkg = require_package();
|
|
11046
11054
|
return pkg.version ?? "dev";
|
|
@@ -13338,7 +13346,7 @@ function patchUtf8(stream) {
|
|
|
13338
13346
|
}
|
|
13339
13347
|
|
|
13340
13348
|
// src/index.ts
|
|
13341
|
-
var VERSION = "2.2.
|
|
13349
|
+
var VERSION = "2.2.5";
|
|
13342
13350
|
var RELEASE_DATE = "2026-05-12";
|
|
13343
13351
|
patchUtf8(process.stdout);
|
|
13344
13352
|
patchUtf8(process.stderr);
|