@titan-design/brain 0.6.1 → 0.7.0

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 CHANGED
@@ -46,53 +46,53 @@ See [PM Quick Start](docs/pm-module/quickstart.md) for the full 5-minute guide.
46
46
 
47
47
  ### Core
48
48
 
49
- | Command | Description |
50
- |---------|-------------|
51
- | `brain init` | Initialize workspace and database |
52
- | `brain index` | Index all markdown notes |
53
- | `brain search "query"` | Hybrid BM25 + vector search |
54
- | `brain add <file>` | Add a note from file or stdin |
55
- | `brain quick "text"` | Zero-friction capture to inbox |
56
- | `brain inbox` | View/manage inbox items |
57
- | `brain import <paths>` | Smart import with three-tier extraction (`--dry-run`, `--tier`) |
58
- | `brain ingest` | Bulk-import files to inbox |
59
- | `brain feed` | Manage RSS feed subscriptions |
60
- | `brain extract` | Extract memories from notes (Ollama) |
61
- | `brain memories` | List, history, and stats for memories |
62
- | `brain context <id>` | Show context for a note (relations + memories) |
63
- | `brain lineage <id>` | Show memory version lineage |
64
- | `brain profile` | Generate agent context profile |
65
- | `brain tidy` | LLM-powered note cleanup suggestions |
66
- | `brain doctor` | System health checks (`--fix` for auto-repair) |
67
- | `brain install-hooks` | Set up launchd/systemd scheduled processing |
68
- | `brain status` | Database stats |
69
- | `brain stale` | Notes needing review |
70
- | `brain graph <id>` | Show note relations |
71
- | `brain template <type>` | Output frontmatter template |
72
- | `brain archive` | Archive expired notes |
73
- | `brain config` | View/set configuration |
49
+ | Command | Description |
50
+ | ----------------------- | --------------------------------------------------------------- |
51
+ | `brain init` | Initialize workspace and database |
52
+ | `brain index` | Index all markdown notes |
53
+ | `brain search "query"` | Hybrid BM25 + vector search |
54
+ | `brain add <file>` | Add a note from file or stdin |
55
+ | `brain quick "text"` | Zero-friction capture to inbox |
56
+ | `brain inbox` | View/manage inbox items |
57
+ | `brain import <paths>` | Smart import with three-tier extraction (`--dry-run`, `--tier`) |
58
+ | `brain ingest` | Bulk-import files to inbox |
59
+ | `brain feed` | Manage RSS feed subscriptions |
60
+ | `brain extract` | Extract memories from notes (Ollama) |
61
+ | `brain memories` | List, history, and stats for memories |
62
+ | `brain context <id>` | Show context for a note (relations + memories) |
63
+ | `brain lineage <id>` | Show memory version lineage |
64
+ | `brain profile` | Generate agent context profile |
65
+ | `brain tidy` | LLM-powered note cleanup suggestions |
66
+ | `brain doctor` | System health checks (`--fix` for auto-repair) |
67
+ | `brain install-hooks` | Set up launchd/systemd scheduled processing |
68
+ | `brain status` | Database stats |
69
+ | `brain stale` | Notes needing review |
70
+ | `brain graph <id>` | Show note relations |
71
+ | `brain template <type>` | Output frontmatter template |
72
+ | `brain archive` | Archive expired notes |
73
+ | `brain config` | View/set configuration |
74
74
 
75
75
  ### Project Management (`brain pm`)
76
76
 
77
- | Command | Description |
78
- |---------|-------------|
79
- | `brain pm init <name> --prefix <P>` | Initialize a new project |
80
- | `brain pm use <prefix>` | Set active project context |
81
- | `brain pm list` | List all projects |
82
- | `brain pm status [prefix]` | Show project status |
83
- | `brain pm workstream add <name>` | Add a workstream |
84
- | `brain pm task add <name>` | Create a task |
85
- | `brain pm task list` | List tasks (filterable by status, workstream) |
86
- | `brain pm task done <id>` | Mark task done |
87
- | `brain pm next` | Show eligible tasks (all deps satisfied) |
88
- | `brain pm waves` | Topological wave grouping of remaining tasks |
89
- | `brain pm dispatch <id>` | Assemble context bundle for a task |
90
- | `brain pm complete <id>` | Mark done, run impact analysis |
91
- | `brain pm briefing` | Session briefing with project state overview |
92
- | `brain pm audit summary` | Activity log, cost tracking |
93
- | `brain pm check [--deep]` | Consistency check (structural + semantic analysis) |
94
- | `brain pm setup` | Configure PM module (paths, hooks) |
95
- | `brain pm install-hooks` | Install PM hooks and skills (orchestrator + sanity-check) |
77
+ | Command | Description |
78
+ | ----------------------------------- | --------------------------------------------------------- |
79
+ | `brain pm init <name> --prefix <P>` | Initialize a new project |
80
+ | `brain pm use <prefix>` | Set active project context |
81
+ | `brain pm list` | List all projects |
82
+ | `brain pm status [prefix]` | Show project status |
83
+ | `brain pm workstream add <name>` | Add a workstream |
84
+ | `brain pm task add <name>` | Create a task |
85
+ | `brain pm task list` | List tasks (filterable by status, workstream) |
86
+ | `brain pm task done <id>` | Mark task done |
87
+ | `brain pm next` | Show eligible tasks (all deps satisfied) |
88
+ | `brain pm waves` | Topological wave grouping of remaining tasks |
89
+ | `brain pm dispatch <id>` | Assemble context bundle for a task |
90
+ | `brain pm complete <id>` | Mark done, run impact analysis |
91
+ | `brain pm briefing` | Session briefing with project state overview |
92
+ | `brain pm audit summary` | Activity log, cost tracking |
93
+ | `brain pm check [--deep]` | Consistency check (structural + semantic analysis) |
94
+ | `brain pm setup` | Configure PM module (paths, hooks) |
95
+ | `brain pm install-hooks` | Install PM hooks and skills (orchestrator + sanity-check) |
96
96
 
97
97
  ## Architecture
98
98
 
@@ -148,6 +148,28 @@ Brain indexes markdown files with YAML frontmatter into a SQLite database. It co
148
148
  - `slow` — permanent knowledge (decisions, patterns, research) with review intervals
149
149
  - `fast` — ephemeral (meetings, session logs) with expiry dates
150
150
 
151
+ ### Knowledge Graph
152
+
153
+ Link related notes and traverse connections:
154
+
155
+ 1. Add `related` field to YAML frontmatter:
156
+ ```yaml
157
+ related:
158
+ - database-migration-patterns
159
+ - service-architecture-overview
160
+ ```
161
+ 2. Re-index after adding relations: `brain index`
162
+ 3. Traverse the graph:
163
+ ```bash
164
+ brain graph <note-id> # Show direct relations
165
+ brain graph <note-id> --depth 2 # Show 2-hop connections
166
+ brain graph <note-id> --json # Machine-readable output
167
+ ```
168
+ 4. Use `--expand` in search to include graph-connected notes:
169
+ ```bash
170
+ brain search "query" --expand
171
+ ```
172
+
151
173
  ## Testing
152
174
 
153
175
  ```bash
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  withBrain,
3
3
  withDb
4
- } from "./chunk-HNC656YT.js";
4
+ } from "./chunk-IESQY2UZ.js";
5
5
  import "./chunk-BDNH2E2O.js";
6
- import "./chunk-AJKFX2TM.js";
6
+ import "./chunk-LLAHWRO4.js";
7
7
  import "./chunk-PO3GJPIC.js";
8
8
  export {
9
9
  withBrain,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  addFrontmatterField
3
- } from "./chunk-AJKFX2TM.js";
3
+ } from "./chunk-LLAHWRO4.js";
4
4
 
5
5
  // src/services/search.ts
6
6
  import { existsSync } from "fs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BDNH2E2O.js";
4
4
  import {
5
5
  addFrontmatterField
6
- } from "./chunk-AJKFX2TM.js";
6
+ } from "./chunk-LLAHWRO4.js";
7
7
 
8
8
  // src/services/config.ts
9
9
  import { readFileSync, writeFileSync, mkdirSync, existsSync, copyFileSync } from "fs";
@@ -1667,9 +1667,7 @@ var ModuleRegistry = class {
1667
1667
  // --- Import Hints ---
1668
1668
  /** Returns all note types that have importHints configured */
1669
1669
  getImportableNoteTypes() {
1670
- return this.getAllNoteTypes().filter(
1671
- ({ noteType }) => noteType.importHints
1672
- );
1670
+ return this.getAllNoteTypes().filter(({ noteType }) => noteType.importHints);
1673
1671
  }
1674
1672
  /** Match CSV/table column headers against registered tableColumnAliases.
1675
1673
  * Returns the best-matching note type if 2+ columns match, else null. */
@@ -1694,7 +1692,11 @@ var ModuleRegistry = class {
1694
1692
  bestMatch = { module, noteType: noteType.name, columnMapping: mapping, hits };
1695
1693
  }
1696
1694
  }
1697
- return bestMatch ? { module: bestMatch.module, noteType: bestMatch.noteType, columnMapping: bestMatch.columnMapping } : null;
1695
+ return bestMatch ? {
1696
+ module: bestMatch.module,
1697
+ noteType: bestMatch.noteType,
1698
+ columnMapping: bestMatch.columnMapping
1699
+ } : null;
1698
1700
  }
1699
1701
  /** Returns archetype texts for embedding-based classification */
1700
1702
  getArchetypeTexts() {
@@ -18,7 +18,8 @@ var VALID_CORE_NOTE_TYPES = [
18
18
  "research",
19
19
  "meeting",
20
20
  "session-log",
21
- "guide"
21
+ "guide",
22
+ "workflow"
22
23
  ];
23
24
  var VALID_NOTE_TIERS = ["slow", "fast"];
24
25
  var VALID_NOTE_CONFIDENCES = ["high", "medium", "low", "speculative"];