@cleocode/brain 2026.11.16 → 2026.11.17-rc.ci.734
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/README.md +31 -21
- package/dist/src/adapters/agent-registry.d.ts +12 -9
- package/dist/src/adapters/agent-registry.d.ts.map +1 -1
- package/dist/src/adapters/agent-registry.js +40 -65
- package/dist/src/adapters/agent-registry.js.map +1 -1
- package/dist/src/adapters/brain.d.ts +3 -2
- package/dist/src/adapters/brain.d.ts.map +1 -1
- package/dist/src/adapters/brain.js +172 -172
- package/dist/src/adapters/brain.js.map +1 -1
- package/dist/src/adapters/conduit.d.ts +5 -4
- package/dist/src/adapters/conduit.d.ts.map +1 -1
- package/dist/src/adapters/conduit.js +53 -64
- package/dist/src/adapters/conduit.js.map +1 -1
- package/dist/src/adapters/index.d.ts +2 -2
- package/dist/src/adapters/index.d.ts.map +1 -1
- package/dist/src/adapters/index.js +11 -10
- package/dist/src/adapters/index.js.map +1 -1
- package/dist/src/adapters/nexus.d.ts +5 -3
- package/dist/src/adapters/nexus.d.ts.map +1 -1
- package/dist/src/adapters/nexus.js +47 -44
- package/dist/src/adapters/nexus.js.map +1 -1
- package/dist/src/adapters/tasks.d.ts +4 -2
- package/dist/src/adapters/tasks.d.ts.map +1 -1
- package/dist/src/adapters/tasks.js +93 -92
- package/dist/src/adapters/tasks.js.map +1 -1
- package/dist/src/cleo-home.d.ts +22 -12
- package/dist/src/cleo-home.d.ts.map +1 -1
- package/dist/src/cleo-home.js +24 -20
- package/dist/src/cleo-home.js.map +1 -1
- package/dist/src/db-connections.d.ts +23 -101
- package/dist/src/db-connections.d.ts.map +1 -1
- package/dist/src/db-connections.js +43 -169
- package/dist/src/db-connections.js.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/project-context.d.ts +15 -7
- package/dist/src/project-context.d.ts.map +1 -1
- package/dist/src/project-context.js +10 -15
- package/dist/src/project-context.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project context resolution for the Living Brain substrate.
|
|
3
3
|
*
|
|
4
|
-
* `ProjectContext` carries the resolved absolute
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `ProjectContext` carries the resolved absolute path of the project store
|
|
5
|
+
* (`.cleo/cleo.db`) so substrate adapters can route queries to the correct
|
|
6
|
+
* project without depending on SvelteKit request locals.
|
|
7
7
|
*
|
|
8
8
|
* The `ProjectContext` shape defined here is structurally compatible with
|
|
9
9
|
* (i.e. a subtype of) the studio's richer `ProjectContext` in
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @task T969
|
|
18
18
|
* @task T11040 (verified 2026-05-27: resolveProjectByCwd used for projectPath; 72/72 tests pass)
|
|
19
|
+
* @task T14583 (both store paths name the project cleo.db)
|
|
19
20
|
*/
|
|
20
21
|
/**
|
|
21
22
|
* Resolved paths for the active project context.
|
|
@@ -27,9 +28,16 @@
|
|
|
27
28
|
export interface ProjectContext {
|
|
28
29
|
/** Absolute path to the project root. */
|
|
29
30
|
projectPath: string;
|
|
30
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Absolute path to the project `cleo.db`, which holds the brain tables.
|
|
33
|
+
* Same file as {@link ProjectContext.tasksDbPath}; the name predates the
|
|
34
|
+
* consolidated store.
|
|
35
|
+
*/
|
|
31
36
|
brainDbPath: string;
|
|
32
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Absolute path to the project `cleo.db`. The substrate adapters read every
|
|
39
|
+
* project-scope table from this file.
|
|
40
|
+
*/
|
|
33
41
|
tasksDbPath: string;
|
|
34
42
|
}
|
|
35
43
|
/**
|
|
@@ -37,8 +45,8 @@ export interface ProjectContext {
|
|
|
37
45
|
*
|
|
38
46
|
* Derives `projectPath` from {@link resolveProjectByCwd} (canonical project
|
|
39
47
|
* root), falling back to the `.cleo`-relative path for non-project contexts.
|
|
40
|
-
*
|
|
41
|
-
* projectId→
|
|
48
|
+
* The store path flows through {@link getCleoProjectDir}, which uses
|
|
49
|
+
* projectId→registry resolution instead of CWD-walk-up (T11040).
|
|
42
50
|
*
|
|
43
51
|
* @returns A context whose paths derive from projectId resolution where possible.
|
|
44
52
|
* @task T11040 — migrate from CWD-walk-up to projectId-based resolution
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../../src/project-context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../../src/project-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,cAAc,CAY7D"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project context resolution for the Living Brain substrate.
|
|
3
3
|
*
|
|
4
|
-
* `ProjectContext` carries the resolved absolute
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `ProjectContext` carries the resolved absolute path of the project store
|
|
5
|
+
* (`.cleo/cleo.db`) so substrate adapters can route queries to the correct
|
|
6
|
+
* project without depending on SvelteKit request locals.
|
|
7
7
|
*
|
|
8
8
|
* The `ProjectContext` shape defined here is structurally compatible with
|
|
9
9
|
* (i.e. a subtype of) the studio's richer `ProjectContext` in
|
|
@@ -16,18 +16,17 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @task T969
|
|
18
18
|
* @task T11040 (verified 2026-05-27: resolveProjectByCwd used for projectPath; 72/72 tests pass)
|
|
19
|
+
* @task T14583 (both store paths name the project cleo.db)
|
|
19
20
|
*/
|
|
20
|
-
import { existsSync } from 'node:fs';
|
|
21
|
-
import { join } from 'node:path';
|
|
22
21
|
import { resolveProjectByCwd } from '@cleocode/paths';
|
|
23
|
-
import { getCleoProjectDir } from './cleo-home.js';
|
|
22
|
+
import { getCleoProjectDir, getProjectStorePath } from './cleo-home.js';
|
|
24
23
|
/**
|
|
25
24
|
* Resolve the default project context using projectId-based resolution.
|
|
26
25
|
*
|
|
27
26
|
* Derives `projectPath` from {@link resolveProjectByCwd} (canonical project
|
|
28
27
|
* root), falling back to the `.cleo`-relative path for non-project contexts.
|
|
29
|
-
*
|
|
30
|
-
* projectId→
|
|
28
|
+
* The store path flows through {@link getCleoProjectDir}, which uses
|
|
29
|
+
* projectId→registry resolution instead of CWD-walk-up (T11040).
|
|
31
30
|
*
|
|
32
31
|
* @returns A context whose paths derive from projectId resolution where possible.
|
|
33
32
|
* @task T11040 — migrate from CWD-walk-up to projectId-based resolution
|
|
@@ -38,15 +37,11 @@ export function resolveDefaultProjectContext() {
|
|
|
38
37
|
// Use canonical project root from projectId resolution when available;
|
|
39
38
|
// fall back to regex-stripping .cleo/ for non-project contexts.
|
|
40
39
|
const projectPath = project !== null ? project.projectRoot : projectDir.replace(/\/.cleo$/, '');
|
|
41
|
-
const
|
|
42
|
-
const tasksDbPath = join(projectDir, 'tasks.db');
|
|
43
|
-
// existsSync is referenced to match the studio surface, and documents intent;
|
|
44
|
-
// adapters re-check existence before opening to avoid stale races.
|
|
45
|
-
void existsSync;
|
|
40
|
+
const storePath = getProjectStorePath();
|
|
46
41
|
return {
|
|
47
42
|
projectPath,
|
|
48
|
-
brainDbPath,
|
|
49
|
-
tasksDbPath,
|
|
43
|
+
brainDbPath: storePath,
|
|
44
|
+
tasksDbPath: storePath,
|
|
50
45
|
};
|
|
51
46
|
}
|
|
52
47
|
//# sourceMappingURL=project-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context.js","sourceRoot":"","sources":["../../src/project-context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project-context.js","sourceRoot":"","sources":["../../src/project-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAyBxE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B;IAC1C,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IACvC,uEAAuE;IACvE,gEAAgE;IAChE,MAAM,WAAW,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChG,MAAM,SAAS,GAAG,mBAAmB,EAAE,CAAC;IACxC,OAAO;QACL,WAAW;QACX,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,SAAS;KACvB,CAAC;AACJ,CAAC"}
|