brainclaw 0.27.0 → 0.29.2

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.
@@ -3,6 +3,7 @@ import os from 'node:os';
3
3
  import path from 'node:path';
4
4
  import { loadActiveProject } from './active-project.js';
5
5
  import { loadConfig } from './config.js';
6
+ import { loadCurrentSession } from './identity.js';
6
7
  import { MEMORY_DIR } from './io.js';
7
8
  import { summarizeWorkspaceProjects } from './workspace-projects.js';
8
9
  /**
@@ -91,8 +92,9 @@ export function resolveTargetStore(cwd = process.cwd(), target = 'local', option
91
92
  * Priority:
92
93
  * 1. explicitCwd (--cwd flag)
93
94
  * 2. BRAINCLAW_PROJECT env var → resolved by name/path from workspace
94
- * 3. active-project.json in workspace root
95
- * 4. process.cwd()
95
+ * 3. Session-scoped active project (from .current-session)
96
+ * 4. Global active-project.json in workspace root
97
+ * 5. process.cwd()
96
98
  */
97
99
  export function resolveEffectiveCwd(options = {}) {
98
100
  // 1. Explicit --cwd flag
@@ -106,7 +108,15 @@ export function resolveEffectiveCwd(options = {}) {
106
108
  if (resolved)
107
109
  return resolved;
108
110
  }
109
- // 3. active-project.json from workspace root
111
+ // 3. Session-scoped active project (per-agent, no cross-agent interference)
112
+ const session = loadCurrentSession(process.cwd());
113
+ if (session?.active_project) {
114
+ const sp = session.active_project;
115
+ if (fs.existsSync(path.join(sp.path, MEMORY_DIR, 'config.yaml'))) {
116
+ return sp.path;
117
+ }
118
+ }
119
+ // 4. Global active-project.json from workspace root
110
120
  const wsRoot = resolveWorkspaceRoot(process.cwd(), options.storeChainOptions);
111
121
  if (wsRoot) {
112
122
  const active = loadActiveProject(wsRoot);
@@ -114,7 +124,7 @@ export function resolveEffectiveCwd(options = {}) {
114
124
  return active.path;
115
125
  }
116
126
  }
117
- // 4. Default
127
+ // 5. Default
118
128
  return process.cwd();
119
129
  }
120
130
  /**
@@ -44,14 +44,21 @@ More directive:
44
44
  - The top 5 most critical traps (the agent won't see them otherwise)
45
45
  - Explicit step-by-step protocol with all MCP calls listed
46
46
 
47
- ### For agents without MCP (Copilot)
47
+ ### For agents without MCP (Copilot, autonomous agents)
48
48
 
49
- Full static context:
49
+ Full static context via instruction file or SKILL.md:
50
50
  - All of the above
51
51
  - Active plans with status and assignees
52
52
  - All shared traps
53
53
  - Recent architectural decisions
54
54
 
55
+ ### For autonomous agents (OpenClaw, NanoClaw, NemoClaw, PicoClaw, ZeroClaw)
56
+
57
+ Skill-based integration via `skills/<agent>/SKILL.md`:
58
+ - Compact brainclaw usage instructions adapted to the agent's workflow
59
+ - Uses `--profile compact` by default (short sessions, constrained resources)
60
+ - Supports task-based and scheduled workflow models
61
+
55
62
  ## Setting up agent integration
56
63
 
57
64
  ### Automatic (recommended)
@@ -83,7 +90,7 @@ brainclaw export --detect --write # auto-detect and write all formats
83
90
  When brainclaw memory changes (new constraints, resolved traps, updated plans), regenerate instruction files:
84
91
 
85
92
  ```bash
86
- brainclaw export --all # all 9 agent formats at once
93
+ brainclaw export --all # all 15 agent formats at once
87
94
  brainclaw export --detect --write # only the detected agent
88
95
  ```
89
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainclaw",
3
- "version": "0.27.0",
3
+ "version": "0.29.2",
4
4
  "description": "Shared project memory for humans and coding agents.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,7 +45,7 @@
45
45
  "license": "BUSL-1.1",
46
46
  "homepage": "https://brainclaw.dev",
47
47
  "engines": {
48
- "node": ">=20"
48
+ "node": ">=18.0.0"
49
49
  },
50
50
  "dependencies": {
51
51
  "commander": "^13.1.0",