robrain 2.4.5 → 2.4.6
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/commands/check.d.ts +2 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +73 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -5
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/export-memory.js +1 -1
- package/dist/commands/export-memory.js.map +1 -1
- package/dist/commands/init-project.d.ts +2 -0
- package/dist/commands/init-project.d.ts.map +1 -1
- package/dist/commands/init-project.js +71 -12
- package/dist/commands/init-project.js.map +1 -1
- package/dist/commands/inject.js +1 -1
- package/dist/commands/inject.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +36 -8
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/review.js +2 -2
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/synth.d.ts.map +1 -1
- package/dist/commands/synth.js +48 -8
- package/dist/commands/synth.js.map +1 -1
- package/dist/commands/up.d.ts +3 -3
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +4 -3
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/up.test.js +3 -0
- package/dist/commands/up.test.js.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/editor.codex.test.js +47 -1
- package/dist/lib/editor.codex.test.js.map +1 -1
- package/dist/lib/editor.d.ts +27 -4
- package/dist/lib/editor.d.ts.map +1 -1
- package/dist/lib/editor.js +59 -8
- package/dist/lib/editor.js.map +1 -1
- package/dist/lib/load-env.d.ts +8 -0
- package/dist/lib/load-env.d.ts.map +1 -1
- package/dist/lib/load-env.js +25 -4
- package/dist/lib/load-env.js.map +1 -1
- package/dist/lib/synthesis-bundle.d.ts +24 -0
- package/dist/lib/synthesis-bundle.d.ts.map +1 -0
- package/dist/lib/synthesis-bundle.js +52 -0
- package/dist/lib/synthesis-bundle.js.map +1 -0
- package/dist/lib/synthesis-bundle.test.d.ts +2 -0
- package/dist/lib/synthesis-bundle.test.d.ts.map +1 -0
- package/dist/lib/synthesis-bundle.test.js +61 -0
- package/dist/lib/synthesis-bundle.test.js.map +1 -0
- package/package.json +2 -2
- package/scripts/vendor-synthesis.mjs +32 -0
- package/scripts/verify-publish-tarball.mjs +21 -0
- package/vendor/sensing-mcp/dist/index.js +8 -7
- package/vendor/sensing-mcp/package.json +1 -1
- package/vendor/synthesis/dist/index.js +17382 -0
- package/vendor/synthesis/package.json +7 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'fs';
|
|
2
|
+
import { tmpdir } from 'os';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { describe, it, beforeEach, afterEach } from 'node:test';
|
|
5
|
+
import assert from 'node:assert/strict';
|
|
6
|
+
import { resolveSynthesisEntry, SynthesisResolveError } from './synthesis-bundle.js';
|
|
7
|
+
let root;
|
|
8
|
+
function writeBuiltSynthesis(repoRoot) {
|
|
9
|
+
const dist = join(repoRoot, 'packages', 'synthesis', 'dist');
|
|
10
|
+
mkdirSync(dist, { recursive: true });
|
|
11
|
+
const entry = join(dist, 'index.js');
|
|
12
|
+
writeFileSync(entry, '// built synthesis bundle');
|
|
13
|
+
return entry;
|
|
14
|
+
}
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
root = mkdtempSync(join(tmpdir(), 'robrain-synth-'));
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
rmSync(root, { recursive: true, force: true });
|
|
20
|
+
});
|
|
21
|
+
describe('resolveSynthesisEntry', () => {
|
|
22
|
+
it('prefers a built ROBRAIN_REPO checkout and reports it as repoRoot', () => {
|
|
23
|
+
const repo = join(root, 'clone');
|
|
24
|
+
const entry = writeBuiltSynthesis(repo);
|
|
25
|
+
const resolved = resolveSynthesisEntry({ ROBRAIN_REPO: repo }, { checkoutRoot: null });
|
|
26
|
+
assert.equal(resolved.entry, entry);
|
|
27
|
+
assert.equal(resolved.repoRoot, repo);
|
|
28
|
+
});
|
|
29
|
+
it('rejects a ROBRAIN_REPO that is not a robrain checkout', () => {
|
|
30
|
+
const notRepo = join(root, 'elsewhere');
|
|
31
|
+
mkdirSync(notRepo, { recursive: true });
|
|
32
|
+
assert.throws(() => resolveSynthesisEntry({ ROBRAIN_REPO: notRepo }, { checkoutRoot: null }), SynthesisResolveError);
|
|
33
|
+
});
|
|
34
|
+
it('tells the user to build when the checkout has no dist', () => {
|
|
35
|
+
const repo = join(root, 'clone');
|
|
36
|
+
mkdirSync(join(repo, 'packages', 'synthesis'), { recursive: true });
|
|
37
|
+
assert.throws(() => resolveSynthesisEntry({ ROBRAIN_REPO: repo }, { checkoutRoot: null }), /pnpm install && pnpm --filter @robrain\/synthesis build/);
|
|
38
|
+
});
|
|
39
|
+
it('uses an inferred checkout when ROBRAIN_REPO is unset', () => {
|
|
40
|
+
const repo = join(root, 'checkout');
|
|
41
|
+
const entry = writeBuiltSynthesis(repo);
|
|
42
|
+
const resolved = resolveSynthesisEntry({}, { checkoutRoot: repo });
|
|
43
|
+
assert.equal(resolved.entry, entry);
|
|
44
|
+
assert.equal(resolved.repoRoot, repo);
|
|
45
|
+
});
|
|
46
|
+
it('falls back to the vendored bundle with no checkout anywhere', () => {
|
|
47
|
+
const cliRoot = join(root, 'npx-cache', 'node_modules', 'robrain');
|
|
48
|
+
const vendoredDist = join(cliRoot, 'vendor', 'synthesis', 'dist');
|
|
49
|
+
mkdirSync(vendoredDist, { recursive: true });
|
|
50
|
+
writeFileSync(join(vendoredDist, 'index.js'), '// vendored synthesis bundle');
|
|
51
|
+
const resolved = resolveSynthesisEntry({}, { checkoutRoot: null, cliRoot });
|
|
52
|
+
assert.equal(resolved.entry, join(vendoredDist, 'index.js'));
|
|
53
|
+
assert.equal(resolved.repoRoot, undefined);
|
|
54
|
+
});
|
|
55
|
+
it('throws a remediation message when nothing resolves', () => {
|
|
56
|
+
const cliRoot = join(root, 'bare');
|
|
57
|
+
mkdirSync(cliRoot, { recursive: true });
|
|
58
|
+
assert.throws(() => resolveSynthesisEntry({}, { checkoutRoot: null, cliRoot }), /npx robrain@latest synth|ROBRAIN_REPO/);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=synthesis-bundle.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesis-bundle.test.js","sourceRoot":"","sources":["../../src/lib/synthesis-bundle.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAEpF,IAAI,IAAY,CAAA;AAEhB,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;IAC5D,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IACpC,aAAa,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAA;IACjD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,UAAU,CAAC,GAAG,EAAE;IACd,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gB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,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAClC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACvC,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,CAAC,qBAAqB,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAChE,uCAAuC,CACxC,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robrain",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "RoBrain CLI for installation, setup, and memory workflows",
|
|
6
6
|
"author": "Rory Plans, Inc.",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"build": "tsc",
|
|
58
58
|
"dev": "tsc --watch",
|
|
59
59
|
"typecheck": "tsc --noEmit",
|
|
60
|
-
"test": "pnpm build && node --test dist/lib/editor.codex.test.js dist/lib/editor.stale-block.test.js dist/lib/release-guard.test.js dist/lib/mcp-bundle.test.js dist/lib/control-bundle.test.js dist/lib/claude-plugin.test.js dist/lib/hermes-plugin.test.js dist/lib/codex-hooks.test.js dist/commands/outcomes.test.js dist/commands/export-interchange.test.js dist/commands/up.test.js dist/commands/mcp.test.js dist/commands/install.test.js",
|
|
60
|
+
"test": "pnpm build && node --test dist/lib/editor.codex.test.js dist/lib/editor.stale-block.test.js dist/lib/release-guard.test.js dist/lib/mcp-bundle.test.js dist/lib/control-bundle.test.js dist/lib/claude-plugin.test.js dist/lib/hermes-plugin.test.js dist/lib/codex-hooks.test.js dist/commands/outcomes.test.js dist/commands/export-interchange.test.js dist/commands/up.test.js dist/commands/mcp.test.js dist/commands/install.test.js dist/lib/synthesis-bundle.test.js",
|
|
61
61
|
"pack:verify": "node scripts/verify-publish-tarball.mjs",
|
|
62
62
|
"postinstall": "node scripts/chmod-bin.cjs"
|
|
63
63
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Copy the built synthesis bundle into vendor/ so the published robrain
|
|
3
|
+
// tarball is self-contained — `npx robrain synth` runs without a repo clone.
|
|
4
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs'
|
|
5
|
+
import { dirname, join } from 'path'
|
|
6
|
+
import { fileURLToPath } from 'url'
|
|
7
|
+
|
|
8
|
+
const cliRoot = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
9
|
+
const src = join(cliRoot, '..', 'synthesis')
|
|
10
|
+
const dest = join(cliRoot, 'vendor', 'synthesis')
|
|
11
|
+
const srcEntry = join(src, 'dist', 'index.js')
|
|
12
|
+
|
|
13
|
+
if (!existsSync(srcEntry)) {
|
|
14
|
+
console.error('vendor-synthesis: missing', srcEntry)
|
|
15
|
+
console.error('Run: pnpm --filter @robrain/synthesis build')
|
|
16
|
+
process.exit(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const version = JSON.parse(readFileSync(join(src, 'package.json'), 'utf8')).version
|
|
20
|
+
|
|
21
|
+
rmSync(dest, { recursive: true, force: true })
|
|
22
|
+
mkdirSync(join(dest, 'dist'), { recursive: true })
|
|
23
|
+
cpSync(join(src, 'dist'), join(dest, 'dist'), { recursive: true })
|
|
24
|
+
writeFileSync(
|
|
25
|
+
join(dest, 'package.json'),
|
|
26
|
+
JSON.stringify(
|
|
27
|
+
{ name: '@robrain/synthesis', version, private: true, type: 'module', main: './dist/index.js' },
|
|
28
|
+
null,
|
|
29
|
+
2,
|
|
30
|
+
) + '\n',
|
|
31
|
+
)
|
|
32
|
+
console.log(`Vendored synthesis@${version} → packages/cli/vendor/synthesis`)
|
|
@@ -19,6 +19,7 @@ mkdirSync(work, { recursive: true })
|
|
|
19
19
|
|
|
20
20
|
try {
|
|
21
21
|
execFileSync('node', ['scripts/vendor-sensing-mcp.mjs'], { cwd: cliRoot, stdio: 'inherit' })
|
|
22
|
+
execFileSync('node', ['scripts/vendor-synthesis.mjs'], { cwd: cliRoot, stdio: 'inherit' })
|
|
22
23
|
execFileSync('node', ['scripts/vendor-hermes-plugin.mjs'], { cwd: cliRoot, stdio: 'inherit' })
|
|
23
24
|
execFileSync('node', ['scripts/vendor-codex-hooks.mjs'], { cwd: cliRoot, stdio: 'inherit' })
|
|
24
25
|
|
|
@@ -51,6 +52,26 @@ try {
|
|
|
51
52
|
fail(`resolved dir has no dist/index.js: ${dir}`)
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
const synthVendorEntry = join(extracted, 'vendor', 'synthesis', 'dist', 'index.js')
|
|
56
|
+
if (!existsSync(synthVendorEntry)) {
|
|
57
|
+
fail('vendor/synthesis/dist/index.js missing from tarball')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const synthUrl = pathToFileURL(join(extracted, 'dist', 'lib', 'synthesis-bundle.js')).href
|
|
61
|
+
const { resolveSynthesisEntry } = await import(synthUrl)
|
|
62
|
+
// Empty env + checkoutRoot:null simulates an npx install outside any checkout —
|
|
63
|
+
// the resolver must land on the tarball's own vendored bundle.
|
|
64
|
+
const synthResolved = resolveSynthesisEntry({}, { checkoutRoot: null })
|
|
65
|
+
if (!existsSync(synthResolved.entry)) {
|
|
66
|
+
fail(`resolveSynthesisEntry() entry does not exist: ${synthResolved.entry}`)
|
|
67
|
+
}
|
|
68
|
+
// realpath both sides — on macOS the tmpdir is reached via the /var →
|
|
69
|
+
// /private/var symlink, so raw equality false-negatives.
|
|
70
|
+
const { realpathSync: realpath } = await import('fs')
|
|
71
|
+
if (realpath(synthResolved.entry) !== realpath(synthVendorEntry)) {
|
|
72
|
+
fail(`resolveSynthesisEntry() did not pick the tarball's vendored bundle: ${synthResolved.entry}`)
|
|
73
|
+
}
|
|
74
|
+
|
|
54
75
|
const hermesVendorEntry = join(extracted, 'vendor', 'hermes-plugin', 'robrain', '__init__.py')
|
|
55
76
|
if (!existsSync(hermesVendorEntry)) {
|
|
56
77
|
fail('vendor/hermes-plugin/robrain/__init__.py missing from tarball')
|
|
@@ -6432,8 +6432,8 @@ var require_llm = __commonJS({
|
|
|
6432
6432
|
return env.LLM_PROVIDER?.trim().toLowerCase() === "openai" ? "openai" : "anthropic";
|
|
6433
6433
|
}
|
|
6434
6434
|
exports.DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
6435
|
-
function resolveOpenAiBaseUrl2(env = process.env) {
|
|
6436
|
-
const raw = env.OPENAI_BASE_URL?.trim();
|
|
6435
|
+
function resolveOpenAiBaseUrl2(env = process.env, options = {}) {
|
|
6436
|
+
const raw = options.preferHost ? env.OPENAI_HOST_BASE_URL?.trim() || env.OPENAI_BASE_URL?.trim() : env.OPENAI_BASE_URL?.trim();
|
|
6437
6437
|
if (!raw)
|
|
6438
6438
|
return exports.DEFAULT_OPENAI_BASE_URL;
|
|
6439
6439
|
return (0, load_env_js_1.normalizeLoopbackUrl)(raw.replace(/\/+$/, ""));
|
|
@@ -6538,12 +6538,12 @@ var require_embeddings = __commonJS({
|
|
|
6538
6538
|
exports.DEFAULT_EMBEDDING_TIMEOUT_MS = 15e3;
|
|
6539
6539
|
var DEFAULT_MAX_ATTEMPTS = 5;
|
|
6540
6540
|
var DEFAULT_BASE_DELAY_MS = 350;
|
|
6541
|
-
function resolveEmbeddingConfig2(env = process.env) {
|
|
6541
|
+
function resolveEmbeddingConfig2(env = process.env, options = {}) {
|
|
6542
6542
|
const dims = Number(env.OPENAI_EMBEDDING_DIMENSIONS);
|
|
6543
6543
|
return {
|
|
6544
6544
|
provider: env.EMBEDDING_PROVIDER ?? "openai",
|
|
6545
6545
|
openaiApiKey: env.OPENAI_API_KEY,
|
|
6546
|
-
openaiBaseUrl: (
|
|
6546
|
+
openaiBaseUrl: (0, llm_js_1.resolveOpenAiBaseUrl)(env, options),
|
|
6547
6547
|
openaiModel: env.OPENAI_EMBEDDING_MODEL ?? exports.DEFAULT_OPENAI_EMBEDDING_MODEL,
|
|
6548
6548
|
openaiDimensions: Number.isFinite(dims) && dims > 0 ? dims : void 0,
|
|
6549
6549
|
voyageApiKey: env.VOYAGE_API_KEY,
|
|
@@ -22742,7 +22742,8 @@ var init_config = __esm({
|
|
|
22742
22742
|
// OPENAI_BASE_URL — point the OpenAI-compatible calls (LLM_PROVIDER=openai
|
|
22743
22743
|
// chat AND EMBEDDING_PROVIDER=openai embeddings) at Ollama / LM Studio /
|
|
22744
22744
|
// vLLM for a fully-local setup. When set, OPENAI_API_KEY becomes optional.
|
|
22745
|
-
|
|
22745
|
+
// preferHost: OPENAI_HOST_BASE_URL wins when set (host vs Docker URL split).
|
|
22746
|
+
openaiBaseUrl: (0, import_shared.resolveOpenAiBaseUrl)(process.env, { preferHost: true }),
|
|
22746
22747
|
// ── Anthropic (needed for decision classifier Stage 2 — Haiku) ─
|
|
22747
22748
|
// Not validated at process start so the MCP server can boot when Cursor
|
|
22748
22749
|
// does not inject env (set ANTHROPIC_API_KEY in MCP server config or shell).
|
|
@@ -22754,7 +22755,7 @@ var init_config = __esm({
|
|
|
22754
22755
|
// 'cohere') plus its API key. Provider, model, timeout, and retry env vars
|
|
22755
22756
|
// are all resolved by @robrain/shared so Sensing and Perception always
|
|
22756
22757
|
// embed with the same model — see shared/src/embeddings.ts for the list.
|
|
22757
|
-
embedding: (0, import_shared.resolveEmbeddingConfig)(),
|
|
22758
|
+
embedding: (0, import_shared.resolveEmbeddingConfig)(process.env, { preferHost: true }),
|
|
22758
22759
|
// Also reused by the OpenAI chat path when LLM_PROVIDER=openai.
|
|
22759
22760
|
openaiApiKey: process.env.OPENAI_API_KEY,
|
|
22760
22761
|
// ── Perception API (required — where signals get sent) ──────
|
|
@@ -23296,7 +23297,7 @@ function resolveSessionId(raw) {
|
|
|
23296
23297
|
function buildServer() {
|
|
23297
23298
|
const server = new McpServer({
|
|
23298
23299
|
name: "sensing-mcp",
|
|
23299
|
-
version: "2.4.
|
|
23300
|
+
version: "2.4.6"
|
|
23300
23301
|
});
|
|
23301
23302
|
server.tool(
|
|
23302
23303
|
"sensing_start_session",
|