@franshjy/dbrief 0.1.0 → 0.2.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
@@ -1,7 +1,7 @@
1
1
  # Dbrief
2
2
 
3
3
  Dbrief extracts daily session activity into artifacts for generating Markdown daily notes.
4
- Currently only support Codex, with Opencode and Claude Code support on the way.
4
+ The extractor currently supports Codex and Opencode session data (Claude on the way). The final note output is plain Markdown.
5
5
 
6
6
  ## How does Dbrief work?
7
7
 
@@ -10,6 +10,8 @@ You can install the skill to the agent of your choice, and you can either:
10
10
  - Edit the skill to modify the location, writing style, or note layout
11
11
  - Or just use it directly with the default layout.
12
12
 
13
+ When no `--source` is provided, Dbrief auto-discovers supported local sources that have readable local state.
14
+
13
15
  ## Installation
14
16
 
15
17
  ```bash
@@ -22,10 +24,10 @@ npm install -g @franshjy/dbrief
22
24
  cd ~/your-project
23
25
  dbrief install # Install dbrief-note skill
24
26
  dbrief extract # Extract today's sessions
25
- codex "Generate my daily note from dbrief_2026-06-04.json"
27
+ $dbrief_note
26
28
  ```
27
29
 
28
- The CLI produces the JSON artifact. Codex uses the installed skill to turn that artifact into a portable Markdown note with `Summary`, `Projects`, and `Other` sections.
30
+ The CLI produces the JSON artifact. Your coding agent uses the installed `dbrief-note` skill to turn that artifact into a Markdown note with `Summary`, `Projects`, and `Other` sections.
29
31
 
30
32
  ## Commands
31
33
 
@@ -39,6 +41,9 @@ dbrief extract --date 2026-06-01 # Specific date -> ./dbrief_2026-06-
39
41
  dbrief extract --from 2026-05-01 # From date to today
40
42
  dbrief extract --to 2026-06-01 # From earliest to date
41
43
  dbrief extract --from 2026-05-01 --to 2026-06-01 # Date range -> current directory by default
44
+ dbrief extract --source codex # Codex only
45
+ dbrief extract --source opencode # Opencode only
46
+ dbrief extract --source codex,opencode # Explicit merged sources
42
47
  dbrief extract --out ./output.json # Custom output path
43
48
  ```
44
49
 
@@ -47,11 +52,16 @@ dbrief extract --out ./output.json # Custom output path
47
52
  - `--from <date>`: Start date for range extraction
48
53
  - `--to <date>`: End date for range extraction
49
54
  - `--out <path>`: Output file (single day) or directory (range)
50
- - `--codex-dir <path>`: Codex data directory (default: ~/.codex)
55
+ - `--source <source>`: Enable session source(s): `codex`, `opencode`
56
+ - `--codex-dir <path>`: Codex data directory (default: `~/.codex`)
57
+ - `--opencode-dir <path>`: Opencode data directory (default: `~/.local/share/opencode`)
58
+
59
+ Notes:
60
+ - Source merge is the default behavior when multiple supported local sources are discovered.
51
61
 
52
62
  ### install
53
63
 
54
- Install the dbrief-note skill to `.codex/skills/dbrief-note/` in the current directory. The skill currently writes Markdown only and is currently only installed on Codex, though you can manually install the skill on any coding agent you want.
64
+ Install the dbrief-note skill to `.codex/skills/dbrief-note/` in the current directory. The skill writes Markdown only. Dbrief does not include note-app adapters or native app APIs in this release.
55
65
 
56
66
  ```bash
57
67
  dbrief install
@@ -78,21 +88,21 @@ Output is minified JSON. Messages are tuples of `["u"|"a", content_string]`.
78
88
 
79
89
  ```json
80
90
  {
81
- "date": "2026-06-04",
91
+ "date": "2026-06-01",
82
92
  "timezone": "Asia/Bangkok",
83
93
  "projects": [
84
94
  {
85
- "project_key": "C:/dev/projects/codex-trails",
95
+ "project_key": "project-alpha",
86
96
  "threads": [
87
97
  {
88
- "title": "How does codex store compressed context?",
98
+ "title": "Daily note output contract",
89
99
  "branch": "master",
90
100
  "context": [],
91
101
  "messages": [
92
- ["u", "How does codex store compacted context?"],
93
- ["a", "Three compaction paths exist: local, remote v1, remote v2..."],
94
- ["u", "Can I extract the summary from JSONL?"],
95
- ["a", "Only `replacement_history` is persisted. The summary is ephemeral."]
102
+ ["u", "Why did you modify the mapper of the user table?"],
103
+ ["a", "Whoopsies!"],
104
+ ["u", "tf?"],
105
+ ["a", "My bad g"]
96
106
  ]
97
107
  }
98
108
  ]
@@ -105,9 +115,14 @@ Output is minified JSON. Messages are tuples of `["u"|"a", content_string]`.
105
115
  - **Full** (no compaction): `context` = `[]`, `messages` = all messages
106
116
  - **Hybrid** (compacted): `context` = replacement_history, `messages` = post-compaction messages
107
117
 
108
- ## Note Writing Contract
118
+ **Current source behavior:**
119
+ - **Codex**: Reads thread metadata from `state_5.sqlite` and transcript content from JSONL rollout files.
120
+ - **Opencode**: Reads session, message, and part data from `opencode.db`, flattening visible user/assistant text only.
121
+ -
122
+ ## Note Writing Structure
109
123
 
110
- The primary output of `dbrief extract` is JSON. The final daily note is generated by Codex using the installed `dbrief-note` skill.
124
+ The primary output of `dbrief extract` is JSON. The final daily note is generated by the installed `dbrief-note` skill.
125
+ You can override the default structure by editing the skill. The writer should also preserve an existing note structure when updating an existing file.
111
126
 
112
127
  The default Markdown structure is:
113
128
 
@@ -126,7 +141,7 @@ The default Markdown structure is:
126
141
  ```bash
127
142
  npm install
128
143
  npm run build
129
- npm link (to access the dbrief command)
144
+ npm link
130
145
  ```
131
146
 
132
147
  ## License