@onebrain-ai/cli 2.0.4 → 2.0.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.
Files changed (2) hide show
  1. package/dist/onebrain +42 -14
  2. package/package.json +1 -1
package/dist/onebrain CHANGED
@@ -10210,9 +10210,9 @@ var init_register_hooks = __esm(() => {
10210
10210
  };
10211
10211
  HOOK_EVENTS = ["Stop", "PreCompact", "PostCompact", "SessionStart"];
10212
10212
  PERMISSIONS_TO_ADD = [
10213
- "Bash(onebrain:*)",
10214
- "Bash(bun install -g @onebrain-ai/cli:*)",
10215
- "Bash(npm install -g @onebrain-ai/cli:*)"
10213
+ "Bash(onebrain *)",
10214
+ "Bash(bun install -g @onebrain-ai/cli*)",
10215
+ "Bash(npm install -g @onebrain-ai/cli*)"
10216
10216
  ];
10217
10217
  BUN_BIN = join4(homedir2(), ".bun", "bin");
10218
10218
  NPM_GLOBAL_BIN = join4(homedir2(), ".npm-global", "bin");
@@ -10431,7 +10431,8 @@ async function checkQmdEmbeddings(config) {
10431
10431
  };
10432
10432
  }
10433
10433
  try {
10434
- const proc = Bun.spawn(["qmd", "status", "--json"], {
10434
+ const qmdArgs = process.platform === "win32" ? ["powershell.exe", "-NoProfile", "-Command", "qmd status --json"] : ["qmd", "status", "--json"];
10435
+ const proc = Bun.spawn(qmdArgs, {
10435
10436
  stdout: "pipe",
10436
10437
  stderr: "pipe"
10437
10438
  });
@@ -10742,7 +10743,7 @@ init_dist();
10742
10743
  import { mkdir as mkdir3, readFile as readFile3, rename as rename3, stat as stat3, writeFile as writeFile3 } from "node:fs/promises";
10743
10744
  import { homedir as homedir3 } from "node:os";
10744
10745
  import { dirname as dirname3, join as join5 } from "node:path";
10745
- var binaryVersion = "2.0.4";
10746
+ var binaryVersion = "2.0.5";
10746
10747
  var STANDARD_FOLDERS = [
10747
10748
  "00-inbox",
10748
10749
  "01-projects",
@@ -11060,9 +11061,22 @@ async function fetchLatestVersion(fetchFn) {
11060
11061
  }
11061
11062
  return tagName;
11062
11063
  }
11064
+ var _windowsShell;
11065
+ function windowsShell() {
11066
+ if (_windowsShell !== undefined)
11067
+ return _windowsShell;
11068
+ try {
11069
+ const r2 = Bun.spawnSync(["pwsh", "--version"], { stdout: "pipe", stderr: "pipe" });
11070
+ _windowsShell = r2.exitCode === 0 ? "pwsh" : "powershell.exe";
11071
+ } catch {
11072
+ _windowsShell = "powershell.exe";
11073
+ }
11074
+ return _windowsShell;
11075
+ }
11063
11076
  async function defaultInstallBinary(version) {
11064
11077
  const isWindows = process.platform === "win32";
11065
- const cmd = isWindows ? ["npm", "install", "-g", `@onebrain-ai/cli@${version}`] : ["bun", "install", "-g", `@onebrain-ai/cli@${version}`];
11078
+ const safeVersion = version.replace(/'/g, "''");
11079
+ const cmd = isWindows ? [windowsShell(), "-NoProfile", "-Command", `npm install -g '@onebrain-ai/cli@${safeVersion}'`] : ["bun", "install", "-g", `@onebrain-ai/cli@${version}`];
11066
11080
  const proc = Bun.spawn(cmd, { stdout: "pipe", stderr: "pipe" });
11067
11081
  const exitCode = await proc.exited;
11068
11082
  if (exitCode !== 0) {
@@ -11072,7 +11086,9 @@ async function defaultInstallBinary(version) {
11072
11086
  }
11073
11087
  async function defaultValidateBinary() {
11074
11088
  try {
11075
- const proc = Bun.spawn(["onebrain", "--version"], { stdout: "pipe", stderr: "pipe" });
11089
+ const isWindows = process.platform === "win32";
11090
+ const cmd = isWindows ? [windowsShell(), "-NoProfile", "-Command", "onebrain --version"] : ["onebrain", "--version"];
11091
+ const proc = Bun.spawn(cmd, { stdout: "pipe", stderr: "pipe" });
11076
11092
  const exitCode = await proc.exited;
11077
11093
  if (exitCode !== 0)
11078
11094
  return false;
@@ -11774,6 +11790,13 @@ async function orphanScanCommand(logsFolder, sessionToken) {
11774
11790
  }
11775
11791
 
11776
11792
  // src/internal/qmd-reindex.ts
11793
+ function buildQmdSpawnArgs(collection, platform = process.platform) {
11794
+ if (platform === "win32") {
11795
+ const safe = collection.replace(/'/g, "''");
11796
+ return ["powershell.exe", "-NoProfile", "-Command", `qmd update -c '${safe}'`];
11797
+ }
11798
+ return ["qmd", "update", "-c", collection];
11799
+ }
11777
11800
  async function qmdReindexCommand(vaultRoot) {
11778
11801
  try {
11779
11802
  const config = await loadVaultConfig(vaultRoot);
@@ -11781,7 +11804,7 @@ async function qmdReindexCommand(vaultRoot) {
11781
11804
  if (!collection) {
11782
11805
  return;
11783
11806
  }
11784
- const proc = Bun.spawn(["qmd", "update", "-c", collection], {
11807
+ const proc = Bun.spawn(buildQmdSpawnArgs(collection), {
11785
11808
  detached: true,
11786
11809
  stdin: "ignore",
11787
11810
  stdout: "ignore",
@@ -11808,9 +11831,9 @@ var HOOK_COMMANDS2 = {
11808
11831
  };
11809
11832
  var HOOK_EVENTS2 = ["Stop", "PreCompact", "PostCompact", "SessionStart"];
11810
11833
  var PERMISSIONS_TO_ADD2 = [
11811
- "Bash(onebrain:*)",
11812
- "Bash(bun install -g @onebrain-ai/cli:*)",
11813
- "Bash(npm install -g @onebrain-ai/cli:*)"
11834
+ "Bash(onebrain *)",
11835
+ "Bash(bun install -g @onebrain-ai/cli*)",
11836
+ "Bash(npm install -g @onebrain-ai/cli*)"
11814
11837
  ];
11815
11838
  var BUN_BIN2 = join10(homedir4(), ".bun", "bin");
11816
11839
  var NPM_GLOBAL_BIN2 = join10(homedir4(), ".npm-global", "bin");
@@ -12164,7 +12187,8 @@ async function cleanStaleStateFile(token, tmpDir) {
12164
12187
  }
12165
12188
  async function queryQmdUnembedded() {
12166
12189
  try {
12167
- const proc = Bun.spawn(["qmd", "status", "--json"], {
12190
+ const qmdArgs = process.platform === "win32" ? ["powershell.exe", "-NoProfile", "-Command", "qmd status --json"] : ["qmd", "status", "--json"];
12191
+ const proc = Bun.spawn(qmdArgs, {
12168
12192
  stdout: "pipe",
12169
12193
  stderr: "pipe"
12170
12194
  });
@@ -12702,8 +12726,12 @@ async function vaultSyncCommand2(vaultRoot, opts = {}) {
12702
12726
  }
12703
12727
 
12704
12728
  // src/index.ts
12705
- var VERSION = "2.0.4";
12706
- var RELEASE_DATE = "2026-04-25";
12729
+ var VERSION = "2.0.5";
12730
+ var RELEASE_DATE = "2026-04-26";
12731
+ if (process.platform === "win32") {
12732
+ process.stdout.setDefaultEncoding("utf8");
12733
+ process.stderr.setDefaultEncoding("utf8");
12734
+ }
12707
12735
  var VERSION_STRING = `OneBrain v${VERSION} \u2014 released ${RELEASE_DATE}`;
12708
12736
  if (process.argv.slice(2).length === 0) {
12709
12737
  console.log(VERSION_STRING);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onebrain-ai/cli",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "CLI for OneBrain — personal AI OS for Obsidian with persistent memory, 24+ skills, and Claude Code integration",
5
5
  "keywords": [
6
6
  "onebrain",