@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.
Files changed (43) hide show
  1. package/README.md +31 -21
  2. package/dist/src/adapters/agent-registry.d.ts +12 -9
  3. package/dist/src/adapters/agent-registry.d.ts.map +1 -1
  4. package/dist/src/adapters/agent-registry.js +40 -65
  5. package/dist/src/adapters/agent-registry.js.map +1 -1
  6. package/dist/src/adapters/brain.d.ts +3 -2
  7. package/dist/src/adapters/brain.d.ts.map +1 -1
  8. package/dist/src/adapters/brain.js +172 -172
  9. package/dist/src/adapters/brain.js.map +1 -1
  10. package/dist/src/adapters/conduit.d.ts +5 -4
  11. package/dist/src/adapters/conduit.d.ts.map +1 -1
  12. package/dist/src/adapters/conduit.js +53 -64
  13. package/dist/src/adapters/conduit.js.map +1 -1
  14. package/dist/src/adapters/index.d.ts +2 -2
  15. package/dist/src/adapters/index.d.ts.map +1 -1
  16. package/dist/src/adapters/index.js +11 -10
  17. package/dist/src/adapters/index.js.map +1 -1
  18. package/dist/src/adapters/nexus.d.ts +5 -3
  19. package/dist/src/adapters/nexus.d.ts.map +1 -1
  20. package/dist/src/adapters/nexus.js +47 -44
  21. package/dist/src/adapters/nexus.js.map +1 -1
  22. package/dist/src/adapters/tasks.d.ts +4 -2
  23. package/dist/src/adapters/tasks.d.ts.map +1 -1
  24. package/dist/src/adapters/tasks.js +93 -92
  25. package/dist/src/adapters/tasks.js.map +1 -1
  26. package/dist/src/cleo-home.d.ts +22 -12
  27. package/dist/src/cleo-home.d.ts.map +1 -1
  28. package/dist/src/cleo-home.js +24 -20
  29. package/dist/src/cleo-home.js.map +1 -1
  30. package/dist/src/db-connections.d.ts +23 -101
  31. package/dist/src/db-connections.d.ts.map +1 -1
  32. package/dist/src/db-connections.js +43 -169
  33. package/dist/src/db-connections.js.map +1 -1
  34. package/dist/src/index.d.ts +3 -3
  35. package/dist/src/index.d.ts.map +1 -1
  36. package/dist/src/index.js +5 -5
  37. package/dist/src/index.js.map +1 -1
  38. package/dist/src/project-context.d.ts +15 -7
  39. package/dist/src/project-context.d.ts.map +1 -1
  40. package/dist/src/project-context.js +10 -15
  41. package/dist/src/project-context.js.map +1 -1
  42. package/dist/tsconfig.build.tsbuildinfo +1 -1
  43. 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 paths for the per-project
5
- * databases (brain.db, tasks.db) so substrate adapters can route queries to
6
- * the correct project without depending on SvelteKit request locals.
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
- /** Absolute path to brain.db for this project. */
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
- /** Absolute path to tasks.db for this project. */
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
- * DB paths flow through {@link getCleoProjectDir}, which now uses
41
- * projectId→nexus.db resolution instead of CWD-walk-up (T11040).
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;;;;;;;;;;;;;;;;;;GAkBG;AAOH;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,cAAc,CAgB7D"}
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 paths for the per-project
5
- * databases (brain.db, tasks.db) so substrate adapters can route queries to
6
- * the correct project without depending on SvelteKit request locals.
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
- * DB paths flow through {@link getCleoProjectDir}, which now uses
30
- * projectId→nexus.db resolution instead of CWD-walk-up (T11040).
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 brainDbPath = join(projectDir, 'brain.db');
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;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAkBnD;;;;;;;;;;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,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACjD,8EAA8E;IAC9E,mEAAmE;IACnE,KAAK,UAAU,CAAC;IAChB,OAAO;QACL,WAAW;QACX,WAAW;QACX,WAAW;KACZ,CAAC;AACJ,CAAC"}
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"}