brainclaw 1.28.6 → 1.28.7
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/brainclaw-vscode.vsix +0 -0
- package/dist/cli.js +36 -2
- package/dist/facts.js +7 -7
- package/dist/facts.json +6 -6
- package/package.json +1 -1
|
Binary file
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from 'node:fs';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { getInstalledBrainclawVersion } from './core/brainclaw-version.js';
|
|
6
|
-
import { cleanOrphanFiles, memoryDir } from './core/io.js';
|
|
6
|
+
import { cleanOrphanFiles, isSafeSessionId, memoryDir } from './core/io.js';
|
|
7
7
|
import { initLogLevel, logger } from './core/logger.js';
|
|
8
8
|
import { resolveEffectiveCwd } from './core/store-resolution.js';
|
|
9
9
|
import { resolveProjectCwd } from './core/cross-project.js';
|
|
@@ -82,6 +82,38 @@ function trailingGlobalOptionError(argv, actionCommand) {
|
|
|
82
82
|
}
|
|
83
83
|
return undefined;
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Hook subprocesses do not reliably inherit the MCP process environment. The
|
|
87
|
+
* agent integrations do, however, provide their session identity in the JSON
|
|
88
|
+
* event on stdin. Hydrate it before preAction resolves the effective project;
|
|
89
|
+
* otherwise a session-scoped switch silently falls back to the workspace root.
|
|
90
|
+
*
|
|
91
|
+
* This is deliberately best-effort: hooks are advisory, stdin may be empty or
|
|
92
|
+
* non-JSON, and an explicitly exported session id remains authoritative.
|
|
93
|
+
*/
|
|
94
|
+
function hydrateHookSessionFromStdin(argv) {
|
|
95
|
+
if (!argv.includes('--hook') || process.stdin.isTTY || process.env.BRAINCLAW_SESSION_ID)
|
|
96
|
+
return;
|
|
97
|
+
try {
|
|
98
|
+
const raw = fs.readFileSync(0, 'utf8').trim();
|
|
99
|
+
if (!raw)
|
|
100
|
+
return;
|
|
101
|
+
const event = JSON.parse(raw);
|
|
102
|
+
const sessionId = typeof event.session_id === 'string'
|
|
103
|
+
? event.session_id.trim()
|
|
104
|
+
: typeof event.sessionId === 'string'
|
|
105
|
+
? event.sessionId.trim()
|
|
106
|
+
: typeof event.metadata?.session === 'string'
|
|
107
|
+
? event.metadata.session.trim()
|
|
108
|
+
: '';
|
|
109
|
+
if (sessionId && isSafeSessionId(sessionId)) {
|
|
110
|
+
process.env.BRAINCLAW_SESSION_ID = sessionId;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Invalid hook input must never break the agent's prompt loop.
|
|
115
|
+
}
|
|
116
|
+
}
|
|
85
117
|
/**
|
|
86
118
|
* Resolve the (possibly nested) subcommand named in argv without parsing.
|
|
87
119
|
* Used to run the trailing-global-option guard BEFORE Commander parses:
|
|
@@ -122,7 +154,9 @@ program
|
|
|
122
154
|
.option('--cwd <path>', 'Override working directory for this invocation')
|
|
123
155
|
.option('--project <name>', 'Run the command against a linked project (cross_project_links or workspace store-chain child). Resolves via resolveProjectCwd; mutually exclusive with --cwd.')
|
|
124
156
|
.hook('preAction', (_thisCommand, actionCommand) => {
|
|
125
|
-
const
|
|
157
|
+
const argv = process.argv.slice(2);
|
|
158
|
+
hydrateHookSessionFromStdin(argv);
|
|
159
|
+
const root = parseLeadingGlobalOptions(argv);
|
|
126
160
|
initLogLevel({ verbose: root.verbose, debug: root.debug });
|
|
127
161
|
// Skip effective cwd resolution for commands that create the store
|
|
128
162
|
const cmdName = actionCommand.name();
|
package/dist/facts.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by scripts/emit-site-facts.mjs at build time. Do not edit manually.
|
|
2
|
-
// Source: brainclaw v1.28.
|
|
2
|
+
// Source: brainclaw v1.28.7 on 2026-08-31T10:15:17.297Z
|
|
3
3
|
export const FACTS = {
|
|
4
|
-
"version": "1.28.
|
|
5
|
-
"generated_at": "2026-08-
|
|
4
|
+
"version": "1.28.7",
|
|
5
|
+
"generated_at": "2026-08-31T10:15:17.297Z",
|
|
6
6
|
"tools": {
|
|
7
7
|
"count": 71,
|
|
8
8
|
"published_count": 69,
|
|
@@ -479,7 +479,7 @@ export const FACTS = {
|
|
|
479
479
|
},
|
|
480
480
|
"bench": {
|
|
481
481
|
"schema": "brainclaw.bench.v1",
|
|
482
|
-
"generated_at": "2026-08-
|
|
482
|
+
"generated_at": "2026-08-31T10:15:15.107Z",
|
|
483
483
|
"node_version": "v24.19.0",
|
|
484
484
|
"platform": "linux-x64",
|
|
485
485
|
"repeats": 3,
|
|
@@ -488,7 +488,7 @@ export const FACTS = {
|
|
|
488
488
|
"name": "cold_onboard",
|
|
489
489
|
"volume": "empty",
|
|
490
490
|
"description": "fresh machine → init → first useful context. Baseline for time-to-first-value.",
|
|
491
|
-
"duration_ms_median":
|
|
491
|
+
"duration_ms_median": 82,
|
|
492
492
|
"payload_chars_median": 1640,
|
|
493
493
|
"payload_tokens_est_median": 410
|
|
494
494
|
},
|
|
@@ -496,7 +496,7 @@ export const FACTS = {
|
|
|
496
496
|
"name": "warm_work",
|
|
497
497
|
"volume": "medium",
|
|
498
498
|
"description": "bclaw_work consult over a real-shaped store (~200 plans / 500 handoffs / 450 claims).",
|
|
499
|
-
"duration_ms_median":
|
|
499
|
+
"duration_ms_median": 127,
|
|
500
500
|
"payload_chars_median": 2626,
|
|
501
501
|
"payload_tokens_est_median": 657
|
|
502
502
|
},
|
|
@@ -504,7 +504,7 @@ export const FACTS = {
|
|
|
504
504
|
"name": "first_edit",
|
|
505
505
|
"volume": "medium",
|
|
506
506
|
"description": "code_find + code_brief on the fresh-agent path (missing index, first touch).",
|
|
507
|
-
"duration_ms_median":
|
|
507
|
+
"duration_ms_median": 13,
|
|
508
508
|
"payload_chars_median": 1680,
|
|
509
509
|
"payload_tokens_est_median": 420
|
|
510
510
|
}
|
package/dist/facts.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.28.
|
|
3
|
-
"generated_at": "2026-08-
|
|
2
|
+
"version": "1.28.7",
|
|
3
|
+
"generated_at": "2026-08-31T10:15:17.297Z",
|
|
4
4
|
"tools": {
|
|
5
5
|
"count": 71,
|
|
6
6
|
"published_count": 69,
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
},
|
|
478
478
|
"bench": {
|
|
479
479
|
"schema": "brainclaw.bench.v1",
|
|
480
|
-
"generated_at": "2026-08-
|
|
480
|
+
"generated_at": "2026-08-31T10:15:15.107Z",
|
|
481
481
|
"node_version": "v24.19.0",
|
|
482
482
|
"platform": "linux-x64",
|
|
483
483
|
"repeats": 3,
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
"name": "cold_onboard",
|
|
487
487
|
"volume": "empty",
|
|
488
488
|
"description": "fresh machine → init → first useful context. Baseline for time-to-first-value.",
|
|
489
|
-
"duration_ms_median":
|
|
489
|
+
"duration_ms_median": 82,
|
|
490
490
|
"payload_chars_median": 1640,
|
|
491
491
|
"payload_tokens_est_median": 410
|
|
492
492
|
},
|
|
@@ -494,7 +494,7 @@
|
|
|
494
494
|
"name": "warm_work",
|
|
495
495
|
"volume": "medium",
|
|
496
496
|
"description": "bclaw_work consult over a real-shaped store (~200 plans / 500 handoffs / 450 claims).",
|
|
497
|
-
"duration_ms_median":
|
|
497
|
+
"duration_ms_median": 127,
|
|
498
498
|
"payload_chars_median": 2626,
|
|
499
499
|
"payload_tokens_est_median": 657
|
|
500
500
|
},
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
"name": "first_edit",
|
|
503
503
|
"volume": "medium",
|
|
504
504
|
"description": "code_find + code_brief on the fresh-agent path (missing index, first touch).",
|
|
505
|
-
"duration_ms_median":
|
|
505
|
+
"duration_ms_median": 13,
|
|
506
506
|
"payload_chars_median": 1680,
|
|
507
507
|
"payload_tokens_est_median": 420
|
|
508
508
|
}
|