@onebrain-ai/cli 2.1.13 → 2.1.14
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 +72 -8
- package/package.json +1 -1
package/dist/onebrain
CHANGED
|
@@ -9521,7 +9521,7 @@ var init_lib = __esm(() => {
|
|
|
9521
9521
|
var require_package = __commonJS((exports, module) => {
|
|
9522
9522
|
module.exports = {
|
|
9523
9523
|
name: "@onebrain-ai/cli",
|
|
9524
|
-
version: "2.1.
|
|
9524
|
+
version: "2.1.14",
|
|
9525
9525
|
description: "CLI for OneBrain \u2014 personal AI OS for Obsidian with persistent memory, 24+ skills, and Claude Code integration",
|
|
9526
9526
|
keywords: [
|
|
9527
9527
|
"onebrain",
|
|
@@ -10086,15 +10086,70 @@ function applyHooks(settings) {
|
|
|
10086
10086
|
}
|
|
10087
10087
|
return result;
|
|
10088
10088
|
}
|
|
10089
|
+
function isLegacyQmdCmd(cmd) {
|
|
10090
|
+
return /\bqmd\s+update\b/.test(cmd);
|
|
10091
|
+
}
|
|
10092
|
+
function migrateLegacyQmdEntries(groups, keepCanonical) {
|
|
10093
|
+
let touched = false;
|
|
10094
|
+
for (const group of groups) {
|
|
10095
|
+
if (!group.hooks)
|
|
10096
|
+
continue;
|
|
10097
|
+
if (keepCanonical) {
|
|
10098
|
+
let groupTouched = false;
|
|
10099
|
+
for (const entry of group.hooks) {
|
|
10100
|
+
if (isLegacyQmdCmd(entry.command ?? "")) {
|
|
10101
|
+
entry.command = QMD_CMD;
|
|
10102
|
+
if (!entry.type)
|
|
10103
|
+
entry.type = "command";
|
|
10104
|
+
groupTouched = true;
|
|
10105
|
+
}
|
|
10106
|
+
}
|
|
10107
|
+
if (groupTouched) {
|
|
10108
|
+
group.matcher = QMD_MATCHER;
|
|
10109
|
+
touched = true;
|
|
10110
|
+
}
|
|
10111
|
+
} else {
|
|
10112
|
+
const before = group.hooks.length;
|
|
10113
|
+
group.hooks = group.hooks.filter((h) => !isLegacyQmdCmd(h.command ?? ""));
|
|
10114
|
+
if (group.hooks.length !== before)
|
|
10115
|
+
touched = true;
|
|
10116
|
+
}
|
|
10117
|
+
}
|
|
10118
|
+
if (keepCanonical) {
|
|
10119
|
+
let seenCanonical = false;
|
|
10120
|
+
for (const group of groups) {
|
|
10121
|
+
if (!group.hooks)
|
|
10122
|
+
continue;
|
|
10123
|
+
const before = group.hooks.length;
|
|
10124
|
+
group.hooks = group.hooks.filter((h) => {
|
|
10125
|
+
if (h.command !== QMD_CMD)
|
|
10126
|
+
return true;
|
|
10127
|
+
if (seenCanonical)
|
|
10128
|
+
return false;
|
|
10129
|
+
seenCanonical = true;
|
|
10130
|
+
return true;
|
|
10131
|
+
});
|
|
10132
|
+
if (group.hooks.length !== before)
|
|
10133
|
+
touched = true;
|
|
10134
|
+
}
|
|
10135
|
+
}
|
|
10136
|
+
for (let i = groups.length - 1;i >= 0; i--) {
|
|
10137
|
+
const g = groups[i];
|
|
10138
|
+
if (g && (g.hooks?.length ?? 0) === 0)
|
|
10139
|
+
groups.splice(i, 1);
|
|
10140
|
+
}
|
|
10141
|
+
return touched;
|
|
10142
|
+
}
|
|
10089
10143
|
function applyQmdHook(settings) {
|
|
10090
10144
|
if (!settings.hooks)
|
|
10091
10145
|
settings.hooks = {};
|
|
10092
10146
|
if (!settings.hooks["PostToolUse"])
|
|
10093
10147
|
settings.hooks["PostToolUse"] = [];
|
|
10094
10148
|
const groups = settings.hooks["PostToolUse"];
|
|
10149
|
+
const migrated = migrateLegacyQmdEntries(groups, true);
|
|
10095
10150
|
const already = groups.some((g) => g.hooks?.some((h) => h.command === QMD_CMD));
|
|
10096
10151
|
if (already)
|
|
10097
|
-
return "ok";
|
|
10152
|
+
return migrated ? "migrated" : "ok";
|
|
10098
10153
|
groups.push({ matcher: QMD_MATCHER, hooks: [{ type: "command", command: QMD_CMD }] });
|
|
10099
10154
|
return "added";
|
|
10100
10155
|
}
|
|
@@ -10186,16 +10241,25 @@ async function runRegisterHooks(opts = {}) {
|
|
|
10186
10241
|
const settings = await readSettings(settingsPath);
|
|
10187
10242
|
result.hooks = applyHooks(settings);
|
|
10188
10243
|
let qmdStatus;
|
|
10189
|
-
if (qmdCollection)
|
|
10244
|
+
if (qmdCollection) {
|
|
10190
10245
|
qmdStatus = applyQmdHook(settings);
|
|
10246
|
+
} else {
|
|
10247
|
+
const groups = settings.hooks?.["PostToolUse"] ?? [];
|
|
10248
|
+
const stripped = migrateLegacyQmdEntries(groups, false);
|
|
10249
|
+
if (stripped && groups.length === 0 && settings.hooks) {
|
|
10250
|
+
delete settings.hooks["PostToolUse"];
|
|
10251
|
+
}
|
|
10252
|
+
}
|
|
10191
10253
|
if (isTTY) {
|
|
10192
10254
|
const parts = HOOK_EVENTS.map((e2) => {
|
|
10193
10255
|
const status = result.hooks[e2];
|
|
10194
10256
|
const icon = import_picocolors4.default.green(status === "ok" ? "\u2713" : status === "migrated" ? "\u2191" : "+");
|
|
10195
10257
|
return `${import_picocolors4.default.dim(e2)} ${icon}`;
|
|
10196
10258
|
});
|
|
10197
|
-
if (qmdStatus)
|
|
10198
|
-
|
|
10259
|
+
if (qmdStatus) {
|
|
10260
|
+
const qmdIcon = qmdStatus === "ok" ? "\u2713" : qmdStatus === "migrated" ? "\u2191" : "+";
|
|
10261
|
+
parts.push(`${import_picocolors4.default.dim("PostToolUse")} ${import_picocolors4.default.green(qmdIcon)}`);
|
|
10262
|
+
}
|
|
10199
10263
|
hooksSpinner?.stop(`Hooks ${parts.join(" ")}`);
|
|
10200
10264
|
} else {
|
|
10201
10265
|
const hookLine = HOOK_EVENTS.map((e2) => {
|
|
@@ -10205,7 +10269,7 @@ async function runRegisterHooks(opts = {}) {
|
|
|
10205
10269
|
}).join(" ");
|
|
10206
10270
|
note(hookLine);
|
|
10207
10271
|
if (qmdStatus)
|
|
10208
|
-
note(`PostToolUse ${qmdStatus
|
|
10272
|
+
note(`PostToolUse ${qmdStatus}`);
|
|
10209
10273
|
}
|
|
10210
10274
|
permSpinner = isTTY ? L2() : null;
|
|
10211
10275
|
permSpinner?.start("Updating permissions...");
|
|
@@ -10858,7 +10922,7 @@ var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
|
10858
10922
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
10859
10923
|
function resolveBinaryVersion() {
|
|
10860
10924
|
if (true)
|
|
10861
|
-
return "2.1.
|
|
10925
|
+
return "2.1.14";
|
|
10862
10926
|
try {
|
|
10863
10927
|
const pkg = require_package();
|
|
10864
10928
|
return pkg.version ?? "dev";
|
|
@@ -13088,7 +13152,7 @@ function patchUtf8(stream) {
|
|
|
13088
13152
|
}
|
|
13089
13153
|
|
|
13090
13154
|
// src/index.ts
|
|
13091
|
-
var VERSION = "2.1.
|
|
13155
|
+
var VERSION = "2.1.14";
|
|
13092
13156
|
var RELEASE_DATE = "2026-05-06";
|
|
13093
13157
|
patchUtf8(process.stdout);
|
|
13094
13158
|
patchUtf8(process.stderr);
|