@redaksjon/protokoll 0.0.12 → 0.0.13

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 (75) hide show
  1. package/.cursor/rules/definition-of-done.md +1 -0
  2. package/.cursor/rules/no-emoticons.md +26 -12
  3. package/README.md +483 -69
  4. package/dist/agentic/executor.js +473 -41
  5. package/dist/agentic/executor.js.map +1 -1
  6. package/dist/agentic/index.js.map +1 -1
  7. package/dist/agentic/tools/lookup-person.js +123 -4
  8. package/dist/agentic/tools/lookup-person.js.map +1 -1
  9. package/dist/agentic/tools/lookup-project.js +139 -22
  10. package/dist/agentic/tools/lookup-project.js.map +1 -1
  11. package/dist/agentic/tools/route-note.js +5 -1
  12. package/dist/agentic/tools/route-note.js.map +1 -1
  13. package/dist/arguments.js +6 -3
  14. package/dist/arguments.js.map +1 -1
  15. package/dist/cli/action.js +704 -0
  16. package/dist/cli/action.js.map +1 -0
  17. package/dist/cli/config.js +482 -0
  18. package/dist/cli/config.js.map +1 -0
  19. package/dist/cli/context.js +466 -0
  20. package/dist/cli/context.js.map +1 -0
  21. package/dist/cli/feedback.js +858 -0
  22. package/dist/cli/feedback.js.map +1 -0
  23. package/dist/cli/index.js +103 -0
  24. package/dist/cli/index.js.map +1 -0
  25. package/dist/cli/install.js +572 -0
  26. package/dist/cli/install.js.map +1 -0
  27. package/dist/cli/transcript.js +199 -0
  28. package/dist/cli/transcript.js.map +1 -0
  29. package/dist/constants.js +11 -4
  30. package/dist/constants.js.map +1 -1
  31. package/dist/context/index.js +25 -1
  32. package/dist/context/index.js.map +1 -1
  33. package/dist/context/storage.js +56 -3
  34. package/dist/context/storage.js.map +1 -1
  35. package/dist/interactive/handler.js +310 -9
  36. package/dist/interactive/handler.js.map +1 -1
  37. package/dist/main.js +11 -1
  38. package/dist/main.js.map +1 -1
  39. package/dist/output/index.js.map +1 -1
  40. package/dist/output/manager.js +46 -1
  41. package/dist/output/manager.js.map +1 -1
  42. package/dist/phases/complete.js +37 -2
  43. package/dist/phases/complete.js.map +1 -1
  44. package/dist/pipeline/orchestrator.js +104 -31
  45. package/dist/pipeline/orchestrator.js.map +1 -1
  46. package/dist/protokoll.js +68 -2
  47. package/dist/protokoll.js.map +1 -1
  48. package/dist/reasoning/client.js +83 -0
  49. package/dist/reasoning/client.js.map +1 -1
  50. package/dist/reasoning/index.js +1 -0
  51. package/dist/reasoning/index.js.map +1 -1
  52. package/dist/util/metadata.js.map +1 -1
  53. package/dist/util/sound.js +116 -0
  54. package/dist/util/sound.js.map +1 -0
  55. package/docs/duplicate-question-prevention.md +117 -0
  56. package/docs/examples.md +152 -0
  57. package/docs/interactive-context-example.md +92 -0
  58. package/docs/package-lock.json +6 -0
  59. package/docs/package.json +3 -1
  60. package/guide/action.md +375 -0
  61. package/guide/config.md +207 -0
  62. package/guide/configuration.md +82 -67
  63. package/guide/context-commands.md +574 -0
  64. package/guide/context-system.md +20 -7
  65. package/guide/development.md +106 -4
  66. package/guide/feedback.md +335 -0
  67. package/guide/index.md +100 -4
  68. package/guide/interactive.md +15 -14
  69. package/guide/quickstart.md +21 -7
  70. package/guide/reasoning.md +18 -4
  71. package/guide/routing.md +192 -97
  72. package/package.json +1 -1
  73. package/scripts/coverage-priority.mjs +323 -0
  74. package/tsconfig.tsbuildinfo +1 -1
  75. package/vitest.config.ts +5 -1
package/guide/routing.md CHANGED
@@ -7,48 +7,88 @@ The routing system determines where transcribed notes should be saved.
7
7
  Protokoll uses multi-signal classification to route notes:
8
8
 
9
9
  1. Analyzes transcript text for project signals
10
- 2. Matches against configured triggers
10
+ 2. Matches against configured triggers in project files
11
11
  3. Builds output path using Dreadcabinet patterns
12
12
 
13
- ## Configuration
13
+ ## Default Output Configuration
14
14
 
15
- ### Default Routing
15
+ The default output location is set in the main config:
16
16
 
17
17
  ```yaml
18
18
  # ~/.protokoll/config.yaml
19
+ outputDirectory: "~/notes"
20
+ outputStructure: "month"
21
+ outputFilenameOptions:
22
+ - date
23
+ - time
24
+ - subject
25
+ ```
26
+
27
+ This is where notes go when no project matches.
28
+
29
+ ## Project-Specific Routing
30
+
31
+ To route notes to different destinations based on content, create **project files** in your context directory:
32
+
33
+ ### Example Project File
34
+
35
+ ```yaml
36
+ # ~/.protokoll/projects/work.yaml
37
+ id: work
38
+ name: Work Notes
39
+ type: project
40
+
41
+ classification:
42
+ context_type: work
43
+ explicit_phrases:
44
+ - "work note"
45
+ - "about work"
46
+ - "office meeting"
47
+ topics:
48
+ - "standup"
49
+ - "sprint"
50
+ - "roadmap"
51
+ associated_people:
52
+ - "colleague-id"
53
+ associated_companies:
54
+ - "acme-corp"
55
+
19
56
  routing:
20
- default:
21
- path: "~/notes"
22
- structure: "month"
23
- filename:
24
- - date
25
- - time
26
- - subject
57
+ destination: "~/work/notes"
58
+ structure: "month"
59
+ filename_options:
60
+ - date
61
+ - time
62
+ - subject
63
+ auto_tags:
64
+ - work
65
+
66
+ active: true
27
67
  ```
28
68
 
29
- ### Project-Specific Routing
69
+ ### Another Example
30
70
 
31
71
  ```yaml
72
+ # ~/.protokoll/projects/personal.yaml
73
+ id: personal
74
+ name: Personal Notes
75
+ type: project
76
+
77
+ classification:
78
+ context_type: personal
79
+ explicit_phrases:
80
+ - "personal note"
81
+ - "reminder to self"
82
+ - "shopping list"
83
+
32
84
  routing:
33
- projects:
34
- - projectId: "work"
35
- destination:
36
- path: "~/work/notes"
37
- structure: "month"
38
- triggers:
39
- - "work note"
40
- - "about work"
41
- - "office meeting"
42
- priority: 10
43
-
44
- - projectId: "personal"
45
- destination:
46
- path: "~/notes/personal"
47
- structure: "day"
48
- triggers:
49
- - "personal note"
50
- - "reminder to self"
51
- priority: 5
85
+ destination: "~/notes/personal"
86
+ structure: "day"
87
+ filename_options:
88
+ - date
89
+ - subject
90
+
91
+ active: true
52
92
  ```
53
93
 
54
94
  ## Structures
@@ -74,44 +114,50 @@ Combined example: `260111-1430-meeting-notes.md`
74
114
 
75
115
  ## Classification Signals
76
116
 
77
- The classifier looks for multiple signals:
117
+ The classifier looks for multiple signals in project files:
118
+
119
+ ### 1. Explicit Phrases
78
120
 
79
- ### 1. Explicit Triggers
121
+ High-confidence trigger phrases:
80
122
 
81
123
  ```yaml
82
- triggers:
83
- - "work note" # Exact phrase
84
- - "about project alpha" # Project mention
124
+ classification:
125
+ explicit_phrases:
126
+ - "work note" # Exact phrase
127
+ - "about project alpha" # Project mention
85
128
  ```
86
129
 
87
130
  ### 2. Associated People
88
131
 
89
- If a person is associated with a project:
132
+ If a person is mentioned and linked to a project:
90
133
 
91
134
  ```yaml
92
- # Person file
93
- company: acme-corp
94
- projects:
95
- - quarterly-planning
135
+ classification:
136
+ associated_people:
137
+ - "priya-sharma" # Person ID
96
138
  ```
97
139
 
98
- Mentioning that person increases confidence for those projects.
140
+ Mentioning that person increases confidence for the project.
99
141
 
100
142
  ### 3. Topic Keywords
101
143
 
102
- Projects can define topic keywords:
144
+ General topic keywords:
103
145
 
104
146
  ```yaml
105
- topics:
106
- - "budget"
107
- - "roadmap"
108
- - "quarterly"
147
+ classification:
148
+ topics:
149
+ - "budget"
150
+ - "roadmap"
151
+ - "quarterly"
109
152
  ```
110
153
 
111
154
  ### 4. Context Type
112
155
 
156
+ General category:
157
+
113
158
  ```yaml
114
- category: "work" # or "personal", "mixed"
159
+ classification:
160
+ context_type: "work" # or "personal", "mixed"
115
161
  ```
116
162
 
117
163
  ## Confidence Scoring
@@ -120,7 +166,7 @@ Each signal contributes to a confidence score:
120
166
 
121
167
  | Signal | Weight |
122
168
  |--------|--------|
123
- | Explicit trigger match | 0.8 |
169
+ | Explicit phrase match | 0.8 |
124
170
  | Associated person | 0.3 |
125
171
  | Topic keyword | 0.2 |
126
172
  | Context type match | 0.1 |
@@ -133,18 +179,19 @@ The project with highest confidence wins.
133
179
 
134
180
  ```typescript
135
181
  interface RoutingInstance {
136
- // Classify text for project signals
137
- classify(text: string): ProjectClassification[];
182
+ // Route based on context
183
+ route(context: RoutingContext): RouteDecision;
138
184
 
139
- // Route to destination
140
- route(text: string, config: RoutingConfig): RouteDestination;
185
+ // Build output path from decision
186
+ buildOutputPath(decision: RouteDecision, context: RoutingContext): string;
141
187
  }
142
188
 
143
- interface RouteDestination {
189
+ interface RouteDecision {
144
190
  projectId: string | null;
145
- path: string;
146
- structure: FilesystemStructure;
191
+ destination: RouteDestination;
147
192
  confidence: number;
193
+ signals: ClassificationSignal[];
194
+ reasoning: string;
148
195
  }
149
196
  ```
150
197
 
@@ -152,71 +199,119 @@ interface RouteDestination {
152
199
 
153
200
  ### Work vs Personal
154
201
 
202
+ Main config (default destination):
203
+
155
204
  ```yaml
205
+ # ~/.protokoll/config.yaml
206
+ outputDirectory: "~/notes/personal"
207
+ outputStructure: "month"
208
+ ```
209
+
210
+ Work project file:
211
+
212
+ ```yaml
213
+ # ~/.protokoll/projects/work.yaml
214
+ id: work
215
+ name: Work
216
+ type: project
217
+
218
+ classification:
219
+ context_type: work
220
+ explicit_phrases:
221
+ - "work"
222
+ - "office"
223
+ - "standup"
224
+ - "meeting with"
225
+
156
226
  routing:
157
- default:
158
- path: "~/notes/personal"
159
- structure: "month"
160
-
161
- projects:
162
- - projectId: "work"
163
- destination:
164
- path: "~/work/notes"
165
- structure: "day"
166
- triggers:
167
- - "work"
168
- - "office"
169
- - "standup"
170
- - "meeting with"
227
+ destination: "~/work/notes"
228
+ structure: "day"
229
+ filename_options:
230
+ - date
231
+ - time
232
+ - subject
233
+
234
+ active: true
171
235
  ```
172
236
 
173
237
  Recording: "This is a note about the standup meeting..."
174
- → Routes to: `~/work/notes/2026/01/11/standup-meeting.md`
238
+ → Routes to: `~/work/notes/2026/01/11/260111-0930-standup-meeting.md`
175
239
 
176
240
  Recording: "Reminder to buy groceries..."
177
- → Routes to: `~/notes/personal/2026/01/groceries.md`
241
+ → Routes to: `~/notes/personal/2026/01/260111-groceries.md` (default)
178
242
 
179
243
  ### Multiple Projects
180
244
 
181
245
  ```yaml
246
+ # ~/.protokoll/projects/project-alpha.yaml
247
+ id: project-alpha
248
+ name: Project Alpha
249
+ type: project
250
+
251
+ classification:
252
+ context_type: work
253
+ explicit_phrases:
254
+ - "project alpha"
255
+ - "alpha team"
256
+
257
+ routing:
258
+ destination: "~/work/alpha/notes"
259
+ structure: "month"
260
+ filename_options:
261
+ - date
262
+ - time
263
+ - subject
264
+
265
+ active: true
266
+ ```
267
+
268
+ ```yaml
269
+ # ~/.protokoll/projects/project-beta.yaml
270
+ id: project-beta
271
+ name: Project Beta
272
+ type: project
273
+
274
+ classification:
275
+ context_type: work
276
+ explicit_phrases:
277
+ - "project beta"
278
+ - "beta launch"
279
+
182
280
  routing:
183
- projects:
184
- - projectId: "project-alpha"
185
- destination:
186
- path: "~/work/alpha/notes"
187
- triggers:
188
- - "project alpha"
189
- - "alpha team"
190
- priority: 10
191
-
192
- - projectId: "project-beta"
193
- destination:
194
- path: "~/work/beta/notes"
195
- triggers:
196
- - "project beta"
197
- - "beta launch"
198
- priority: 10
281
+ destination: "~/work/beta/notes"
282
+ structure: "month"
283
+ filename_options:
284
+ - date
285
+ - time
286
+ - subject
287
+
288
+ active: true
199
289
  ```
200
290
 
201
291
  ## Troubleshooting
202
292
 
203
293
  ### Notes Going to Wrong Project
204
294
 
205
- 1. Check trigger phrases match your speech patterns
206
- 2. Add more specific triggers
295
+ 1. Check `explicit_phrases` match your speech patterns
296
+ 2. Add more specific phrases
207
297
  3. Use `--debug` to see classification scores
208
298
 
209
299
  ### Notes Going to Default
210
300
 
211
- 1. Verify project config is loaded
212
- 2. Check triggers are case-insensitive matches
213
- 3. Add more trigger variations
301
+ 1. Verify project files are in `.protokoll/projects/`
302
+ 2. Check `active: true` is set
303
+ 3. Ensure phrases are case-insensitive matches
304
+ 4. Add more phrase variations
214
305
 
215
306
  ### Path Not Created
216
307
 
217
- ```yaml
218
- routing:
219
- default:
220
- createDirectories: true # Ensure this is set
221
- ```
308
+ Directories are created automatically. If they're not:
309
+
310
+ 1. Check write permissions on parent directory
311
+ 2. Use `--verbose` to see directory creation logs
312
+
313
+ ## See Also
222
314
 
315
+ - [Transcript Actions](./action.md) - Edit transcripts and change their project routing after creation
316
+ - [Context System](./context-system.md) - How context storage works
317
+ - [Configuration](./configuration.md) - All configuration options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redaksjon/protokoll",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Focused audio transcription with intelligent context integration",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",