robrain 2.0.0 → 2.0.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.
@@ -194,7 +194,7 @@ export async function installCommand(opts) {
194
194
  planningKey: provisioned.planningKey,
195
195
  embeddingProvider: embeddingProvider ?? 'openai',
196
196
  installedAt: new Date().toISOString(),
197
- version: '2.0.0',
197
+ version: '2.0.1',
198
198
  });
199
199
  spinner.succeed('MCP servers configured');
200
200
  // ── Done ───────────────────────────────────────────────────
@@ -344,7 +344,7 @@ async function installSelfHosted(opts) {
344
344
  ...(perceptionKey ? { perceptionKey } : {}),
345
345
  embeddingProvider: provider,
346
346
  installedAt: new Date().toISOString(),
347
- version: '2.0.0',
347
+ version: '2.0.1',
348
348
  selfHosted: true,
349
349
  });
350
350
  spinner.succeed('MCP servers configured for self-hosted mode');
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ import { synthCommand } from './commands/synth.js';
22
22
  import { exportMemoryCommand } from './commands/export-memory.js';
23
23
  import { explainCommand } from './commands/explain.js';
24
24
  import { projectsListCommand, projectsMergeCommand } from './commands/projects.js';
25
- const VERSION = '2.0.0';
25
+ const VERSION = '2.0.1';
26
26
  program
27
27
  .name('robrain')
28
28
  .description('Institutional memory for AI coding agents — by Rory Plans')
@@ -1,14 +1,32 @@
1
1
  export declare class McpBundleError extends Error {
2
2
  name: string;
3
3
  }
4
- /** True when ~/.robrain/mcp/sensing/dist/index.js exists and is readable. */
4
+ /**
5
+ * True only when a *complete* Sensing bundle is present — both the entrypoint and
6
+ * a package.json declaring ESM. The package.json check is load-bearing: Node treats
7
+ * a bare `.js` without `"type": "module"` as CommonJS and throws on the bundle's
8
+ * `import` statements before any tool registers. A previous half-finished copy
9
+ * (entrypoint present, package.json missing) must therefore read as NOT ready so
10
+ * the install re-materializes it instead of certifying the wreck and writing a
11
+ * success config on top of it.
12
+ */
5
13
  export declare function sensingBundleReady(robrainMcpDir: string): boolean;
6
14
  /** True when a Control MCP entrypoint exists (cloud installs only; not in OSS repo). */
7
15
  export declare function controlBundleReady(robrainMcpDir: string): boolean;
8
16
  /**
9
- * Ensure ~/.robrain/mcp/sensing points at a built @context-system/sensing-mcp package.
10
- * Uses a directory symlink on macOS/Linux (preserves pnpm workspace node_modules).
11
- * On Windows, performs a recursive copy (may require building from the same machine).
17
+ * Ensure ~/.robrain/mcp/sensing resolves to a built sensing-mcp bundle.
18
+ *
19
+ * macOS/Linux: directory symlink into the workspace package — the package's own
20
+ * package.json and (for dev rebuilds) a fresh dist are picked up automatically.
21
+ *
22
+ * Windows: copy the *self-contained* artifact only — the bundled dist plus a
23
+ * minimal package.json declaring ESM. We deliberately do NOT copy the package's
24
+ * node_modules: in a pnpm workspace those entries are symlinks into the monorepo's
25
+ * virtual store (e.g. `@robrain/shared -> ../../../shared`). Copied out of the repo
26
+ * they dangle, and on Windows recreating them can abort the copy partway — which is
27
+ * exactly what produced half-installed, crash-looping Sensing servers. Because the
28
+ * server is bundled into one file with every dependency inlined, no node_modules is
29
+ * needed at the destination.
12
30
  */
13
31
  export declare function ensureSensingMcpBundle(repoRoot: string, robrainMcpDir: string): void;
14
32
  //# sourceMappingURL=mcp-bundle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-bundle.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-bundle.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAe,SAAQ,KAAK;IAC9B,IAAI,SAAmB;CACjC;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAuBpF"}
1
+ {"version":3,"file":"mcp-bundle.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-bundle.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAe,SAAQ,KAAK;IAC9B,IAAI,SAAmB;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAmCpF"}
@@ -1,23 +1,42 @@
1
1
  // packages/cli/src/lib/mcp-bundle.ts
2
2
  // Copy or symlink built MCP packages into ~/.robrain/mcp so editor configs resolve.
3
- import { cpSync, existsSync, mkdirSync, rmSync, symlinkSync } from 'fs';
3
+ import { cpSync, existsSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from 'fs';
4
4
  import { platform } from 'os';
5
5
  import { join } from 'path';
6
6
  export class McpBundleError extends Error {
7
7
  name = 'McpBundleError';
8
8
  }
9
- /** True when ~/.robrain/mcp/sensing/dist/index.js exists and is readable. */
9
+ /**
10
+ * True only when a *complete* Sensing bundle is present — both the entrypoint and
11
+ * a package.json declaring ESM. The package.json check is load-bearing: Node treats
12
+ * a bare `.js` without `"type": "module"` as CommonJS and throws on the bundle's
13
+ * `import` statements before any tool registers. A previous half-finished copy
14
+ * (entrypoint present, package.json missing) must therefore read as NOT ready so
15
+ * the install re-materializes it instead of certifying the wreck and writing a
16
+ * success config on top of it.
17
+ */
10
18
  export function sensingBundleReady(robrainMcpDir) {
11
- return existsSync(join(robrainMcpDir, 'sensing', 'dist', 'index.js'));
19
+ const base = join(robrainMcpDir, 'sensing');
20
+ return existsSync(join(base, 'dist', 'index.js')) && existsSync(join(base, 'package.json'));
12
21
  }
13
22
  /** True when a Control MCP entrypoint exists (cloud installs only; not in OSS repo). */
14
23
  export function controlBundleReady(robrainMcpDir) {
15
24
  return existsSync(join(robrainMcpDir, 'control', 'dist', 'index.js'));
16
25
  }
17
26
  /**
18
- * Ensure ~/.robrain/mcp/sensing points at a built @context-system/sensing-mcp package.
19
- * Uses a directory symlink on macOS/Linux (preserves pnpm workspace node_modules).
20
- * On Windows, performs a recursive copy (may require building from the same machine).
27
+ * Ensure ~/.robrain/mcp/sensing resolves to a built sensing-mcp bundle.
28
+ *
29
+ * macOS/Linux: directory symlink into the workspace package — the package's own
30
+ * package.json and (for dev rebuilds) a fresh dist are picked up automatically.
31
+ *
32
+ * Windows: copy the *self-contained* artifact only — the bundled dist plus a
33
+ * minimal package.json declaring ESM. We deliberately do NOT copy the package's
34
+ * node_modules: in a pnpm workspace those entries are symlinks into the monorepo's
35
+ * virtual store (e.g. `@robrain/shared -> ../../../shared`). Copied out of the repo
36
+ * they dangle, and on Windows recreating them can abort the copy partway — which is
37
+ * exactly what produced half-installed, crash-looping Sensing servers. Because the
38
+ * server is bundled into one file with every dependency inlined, no node_modules is
39
+ * needed at the destination.
21
40
  */
22
41
  export function ensureSensingMcpBundle(repoRoot, robrainMcpDir) {
23
42
  if (sensingBundleReady(robrainMcpDir))
@@ -33,7 +52,12 @@ export function ensureSensingMcpBundle(repoRoot, robrainMcpDir) {
33
52
  rmSync(dest, { recursive: true, force: true });
34
53
  }
35
54
  if (platform() === 'win32') {
36
- cpSync(src, dest, { recursive: true });
55
+ mkdirSync(dest, { recursive: true });
56
+ cpSync(join(src, 'dist'), join(dest, 'dist'), { recursive: true });
57
+ // Minimal package.json: Node needs "type": "module" to run the bundled
58
+ // ESM entrypoint. The workspace package.json's `dependencies` are irrelevant
59
+ // at runtime (everything is inlined) and only invite confusion, so omit them.
60
+ writeFileSync(join(dest, 'package.json'), JSON.stringify({ name: 'robrain-sensing-mcp', private: true, type: 'module', main: './dist/index.js' }, null, 2) + '\n');
37
61
  }
38
62
  else {
39
63
  symlinkSync(src, dest, 'dir');
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-bundle.js","sourceRoot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AI,EACJ,CAAC,CACF,GAAG,IAAI,CACT,CAAA;IACH,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;IAC/B,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robrain",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "description": "RoBrain CLI for installation, setup, and memory workflows",
6
6
  "license": "Apache-2.0",