@redaksjon/protokoll 0.0.11 → 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 (88) 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 +12 -5
  30. package/dist/constants.js.map +1 -1
  31. package/dist/context/discovery.js +1 -1
  32. package/dist/context/discovery.js.map +1 -1
  33. package/dist/context/index.js +25 -1
  34. package/dist/context/index.js.map +1 -1
  35. package/dist/context/storage.js +57 -4
  36. package/dist/context/storage.js.map +1 -1
  37. package/dist/interactive/handler.js +310 -9
  38. package/dist/interactive/handler.js.map +1 -1
  39. package/dist/main.js +11 -1
  40. package/dist/main.js.map +1 -1
  41. package/dist/output/index.js.map +1 -1
  42. package/dist/output/manager.js +47 -2
  43. package/dist/output/manager.js.map +1 -1
  44. package/dist/phases/complete.js +38 -3
  45. package/dist/phases/complete.js.map +1 -1
  46. package/dist/phases/locate.js +1 -1
  47. package/dist/phases/locate.js.map +1 -1
  48. package/dist/pipeline/orchestrator.js +104 -31
  49. package/dist/pipeline/orchestrator.js.map +1 -1
  50. package/dist/protokoll.js +68 -2
  51. package/dist/protokoll.js.map +1 -1
  52. package/dist/reasoning/client.js +83 -0
  53. package/dist/reasoning/client.js.map +1 -1
  54. package/dist/reasoning/index.js +1 -0
  55. package/dist/reasoning/index.js.map +1 -1
  56. package/dist/routing/router.js +2 -2
  57. package/dist/routing/router.js.map +1 -1
  58. package/dist/util/media.js +1 -1
  59. package/dist/util/media.js.map +1 -1
  60. package/dist/util/metadata.js.map +1 -1
  61. package/dist/util/sound.js +116 -0
  62. package/dist/util/sound.js.map +1 -0
  63. package/dist/util/storage.js +3 -3
  64. package/dist/util/storage.js.map +1 -1
  65. package/docs/duplicate-question-prevention.md +117 -0
  66. package/docs/examples.md +152 -0
  67. package/docs/interactive-context-example.md +92 -0
  68. package/docs/package-lock.json +6 -0
  69. package/docs/package.json +3 -1
  70. package/eslint.config.mjs +1 -1
  71. package/guide/action.md +375 -0
  72. package/guide/config.md +207 -0
  73. package/guide/configuration.md +82 -67
  74. package/guide/context-commands.md +574 -0
  75. package/guide/context-system.md +20 -7
  76. package/guide/development.md +106 -4
  77. package/guide/feedback.md +335 -0
  78. package/guide/index.md +100 -4
  79. package/guide/interactive.md +15 -14
  80. package/guide/quickstart.md +21 -7
  81. package/guide/reasoning.md +18 -4
  82. package/guide/routing.md +192 -97
  83. package/package.json +2 -3
  84. package/scripts/copy-assets.mjs +47 -0
  85. package/scripts/coverage-priority.mjs +323 -0
  86. package/tsconfig.tsbuildinfo +1 -1
  87. package/vite.config.ts +6 -13
  88. package/vitest.config.ts +5 -1
@@ -0,0 +1,375 @@
1
+ # Transcript Actions
2
+
3
+ Protokoll includes the `action` command for editing and combining existing transcripts. These capabilities help you organize, merge, and manage your transcript library after the initial transcription.
4
+
5
+ ## Overview
6
+
7
+ The `action` command provides two modes:
8
+
9
+ | Mode | Usage | Description |
10
+ |------|-------|-------------|
11
+ | **Edit** | `protokoll action [options] <file>` | Edit a single transcript (title, project) |
12
+ | **Combine** | `protokoll action --combine "<files>"` | Merge multiple transcripts into one |
13
+
14
+ ## Edit Mode
15
+
16
+ Edit a single transcript to change its title and/or project.
17
+
18
+ ### Basic Usage
19
+
20
+ ```bash
21
+ protokoll action [options] <file>
22
+ ```
23
+
24
+ Where `<file>` is the path to the transcript to edit.
25
+
26
+ ### Examples
27
+
28
+ #### Change the Title
29
+
30
+ ```bash
31
+ protokoll action --title "Time to Celebrate" /path/to/transcript.md
32
+ ```
33
+
34
+ This will:
35
+ 1. Update the document heading to `# Time to Celebrate`
36
+ 2. Rename the file to `15-1412-time-to-celebrate.md` (preserving timestamp)
37
+
38
+ #### Change the Project
39
+
40
+ ```bash
41
+ protokoll action --project client-alpha /path/to/transcript.md
42
+ ```
43
+
44
+ This will:
45
+ 1. Update the project metadata in the document
46
+ 2. Move the file to the project's configured destination
47
+
48
+ #### Change Both Title and Project
49
+
50
+ ```bash
51
+ protokoll action --title "Q1 Planning Session" --project quarterly-planning /path/to/transcript.md
52
+ ```
53
+
54
+ #### Preview Changes (Dry Run)
55
+
56
+ ```bash
57
+ protokoll action --title "New Title" /path/to/transcript.md --dry-run --verbose
58
+ ```
59
+
60
+ Shows what would happen without making any changes.
61
+
62
+ ## Combine Mode
63
+
64
+ Merge multiple related transcripts into a single document. When combining, source files are **automatically deleted** after the combined file is created.
65
+
66
+ ### Basic Usage
67
+
68
+ ```bash
69
+ protokoll action --combine "<files>"
70
+ ```
71
+
72
+ Where `<files>` is a newline-separated list of transcript file paths.
73
+
74
+ ### Examples
75
+
76
+ #### Combine with Custom Title
77
+
78
+ ```bash
79
+ protokoll action --title "Time to Celebrate" --combine "/path/to/part1.md
80
+ /path/to/part2.md
81
+ /path/to/part3.md"
82
+ ```
83
+
84
+ This creates a combined transcript and deletes the source files.
85
+
86
+ #### Combine and Change Project
87
+
88
+ ```bash
89
+ protokoll action --title "Full Meeting Notes" --project client-alpha --combine "/path/to/part1.md
90
+ /path/to/part2.md"
91
+ ```
92
+
93
+ This will:
94
+ 1. Combine the transcripts
95
+ 2. Set the custom title
96
+ 3. Update the metadata to reflect the new project
97
+ 4. Route the output to the project's configured destination
98
+ 5. Delete the source files
99
+
100
+ #### Preview Changes (Dry Run)
101
+
102
+ ```bash
103
+ protokoll action --combine "/path/to/files..." --dry-run --verbose
104
+ ```
105
+
106
+ Shows what would happen without making any changes.
107
+
108
+ ### Command Options
109
+
110
+ | Option | Short | Description |
111
+ |--------|-------|-------------|
112
+ | `--title <title>` | `-t` | Set a custom title for the document and filename |
113
+ | `--project <id>` | `-p` | Change to a different project (updates metadata and routing) |
114
+ | `--combine <files>` | `-c` | Combine multiple files (newline-separated list) |
115
+ | `--dry-run` | | Show what would happen without making changes |
116
+ | `--verbose` | `-v` | Show detailed output |
117
+
118
+ ## How It Works
119
+
120
+ ### Edit Mode
121
+
122
+ 1. **Parses the transcript**: Extracts title, metadata, and content
123
+ 2. **Updates title**: If `--title` is provided, changes the document heading
124
+ 3. **Updates project**: If `--project` is provided, updates metadata and destination
125
+ 4. **Renames/moves file**: If title or project changed, moves to new location
126
+ 5. **Deletes original**: If file was renamed, removes the old file
127
+
128
+ ### Combine Mode
129
+
130
+ 1. **Parses all transcripts**: Extracts metadata, title, and content from each file
131
+ 2. **Sorts chronologically**: Orders transcripts by filename (which includes timestamp)
132
+ 3. **Merges metadata**: Uses the first transcript's date/time, combines durations, deduplicates tags
133
+ 4. **Creates sections**: Each source transcript becomes a section with its original title
134
+ 5. **Routes intelligently**: If `--project` is specified, uses that project's routing configuration
135
+ 6. **Cleans up**: Automatically deletes source files after successful combine
136
+
137
+ ### Title Slugification
138
+
139
+ When you provide a custom title, it's converted to a filename-safe format:
140
+
141
+ | Title | Filename |
142
+ |-------|----------|
143
+ | `Time to Celebrate` | `time-to-celebrate` |
144
+ | `Meeting: Q1 Planning & Review!` | `meeting-q1-planning-review` |
145
+ | `Sprint 42 Retrospective` | `sprint-42-retrospective` |
146
+
147
+ The slug is limited to 50 characters and preserves the timestamp prefix from the original file.
148
+
149
+ ## Output Format
150
+
151
+ ### Edit Mode Output
152
+
153
+ When editing a single transcript:
154
+
155
+ ```markdown
156
+ # New Title Here
157
+
158
+ ## Metadata
159
+
160
+ **Date**: January 15, 2026
161
+ **Time**: 02:12 PM
162
+
163
+ **Project**: New Project Name
164
+ **Project ID**: `new-project-id`
165
+
166
+ ### Routing
167
+ ...
168
+
169
+ ---
170
+
171
+ [Original content preserved]
172
+ ```
173
+
174
+ ### Combine Mode Output
175
+
176
+ When combining transcripts:
177
+
178
+ ```markdown
179
+ # Combined Title
180
+
181
+ ## Metadata
182
+
183
+ **Date**: January 15, 2026
184
+ **Time**: 02:12 PM
185
+
186
+ **Project**: Project Name
187
+ **Project ID**: `project-id`
188
+
189
+ ### Routing
190
+ ...
191
+
192
+ **Tags**: `tag1`, `tag2`, `tag3`
193
+
194
+ **Duration**: 15m 30s
195
+
196
+ ---
197
+
198
+ ## First Part Title
199
+ *Source: 15-1412-first-part.md*
200
+
201
+ First part content...
202
+
203
+ ## Second Part Title
204
+ *Source: 15-1421-second-part.md*
205
+
206
+ Second part content...
207
+ ```
208
+
209
+ ## Project Routing
210
+
211
+ When using `--project`, the action command leverages Protokoll's routing system:
212
+
213
+ ### Project Configuration
214
+
215
+ Projects are configured in `.protokoll/projects/`:
216
+
217
+ ```yaml
218
+ # ~/.protokoll/projects/client-alpha.yaml
219
+ id: client-alpha
220
+ name: Client Alpha
221
+ type: project
222
+
223
+ classification:
224
+ context_type: work
225
+ explicit_phrases:
226
+ - "client alpha"
227
+
228
+ routing:
229
+ destination: "~/clients/alpha/notes"
230
+ structure: "month"
231
+ filename_options:
232
+ - date
233
+ - time
234
+ - subject
235
+ auto_tags:
236
+ - client
237
+ - alpha
238
+
239
+ active: true
240
+ ```
241
+
242
+ ### Routing Behavior
243
+
244
+ When you specify `--project client-alpha`:
245
+
246
+ 1. **Metadata Update**: Project name and ID are updated in the transcript
247
+ 2. **Destination**: Output goes to `~/clients/alpha/notes/2026/01/` (based on structure)
248
+ 3. **Filename**: Built using the project's filename options (or slugified title if provided)
249
+ 4. **Tags**: Project's `auto_tags` are added to the combined tags
250
+
251
+ ## Use Cases
252
+
253
+ ### 1. Rename a Transcript
254
+
255
+ You want to give a transcript a more meaningful title:
256
+
257
+ ```bash
258
+ protokoll action --title "Q1 Budget Review Meeting" /path/to/15-1412-meeting.md
259
+ ```
260
+
261
+ ### 2. Move to Different Project
262
+
263
+ You realize a transcript belongs to a different project:
264
+
265
+ ```bash
266
+ protokoll action --project client-beta /path/to/15-1412-meeting.md
267
+ ```
268
+
269
+ ### 3. Consolidate Meeting Notes
270
+
271
+ You recorded a long meeting in multiple segments:
272
+
273
+ ```bash
274
+ protokoll action --title "Full Team Standup" --combine "/path/to/part1.md
275
+ /path/to/part2.md
276
+ /path/to/part3.md"
277
+ ```
278
+
279
+ ### 4. Reorganize by Project
280
+
281
+ Combine transcripts that were initially routed to the default location:
282
+
283
+ ```bash
284
+ protokoll action --title "Sprint 42 Planning" --project sprint-42 --combine "/path/to/misc1.md
285
+ /path/to/misc2.md"
286
+ ```
287
+
288
+ ## Troubleshooting
289
+
290
+ ### File Not Found
291
+
292
+ ```
293
+ Error: File not found: /path/to/file.md
294
+ ```
295
+
296
+ Ensure the file path is correct and accessible. Use absolute paths to avoid ambiguity.
297
+
298
+ ### Project Not Found
299
+
300
+ ```
301
+ Error: Project not found: my-project
302
+ ```
303
+
304
+ Verify the project exists:
305
+
306
+ ```bash
307
+ protokoll project list
308
+ protokoll project show my-project
309
+ ```
310
+
311
+ ### Must Specify Title or Project
312
+
313
+ ```
314
+ Error: Must specify --title and/or --project when editing a single file.
315
+ ```
316
+
317
+ When editing a single file (not combining), you must provide at least one of `--title` or `--project`.
318
+
319
+ ### At Least 2 Files Required
320
+
321
+ ```
322
+ Error: At least 2 transcript files are required for --combine.
323
+ ```
324
+
325
+ The combine mode requires at least 2 transcripts. For single files, use edit mode instead.
326
+
327
+ ## Best Practices
328
+
329
+ 1. **Use `--dry-run` first**: Always preview changes before committing
330
+
331
+ 2. **Verify project routing**: Check project configuration before using `--project`
332
+
333
+ 3. **Use absolute paths**: Avoid relative paths to prevent confusion
334
+
335
+ 4. **Meaningful titles**: When combining, provide a descriptive title that captures the full session
336
+
337
+ ## API Reference
338
+
339
+ For programmatic use, the action module exports:
340
+
341
+ ```typescript
342
+ import {
343
+ parseTranscript,
344
+ combineTranscripts,
345
+ editTranscript,
346
+ parseFilePaths,
347
+ extractTimestampFromFilename,
348
+ formatMetadataMarkdown,
349
+ slugifyTitle,
350
+ } from '@redaksjon/protokoll/cli/action';
351
+
352
+ // Parse a single transcript
353
+ const parsed = await parseTranscript('/path/to/transcript.md');
354
+
355
+ // Edit a transcript
356
+ const edited = await editTranscript('/path/to/file.md', {
357
+ title: 'New Title',
358
+ projectId: 'my-project',
359
+ });
360
+
361
+ // Combine multiple transcripts
362
+ const combined = await combineTranscripts(
363
+ ['/path/to/file1.md', '/path/to/file2.md'],
364
+ { title: 'Combined Title', projectId: 'my-project' }
365
+ );
366
+
367
+ // Slugify a title for use in filenames
368
+ const slug = slugifyTitle('New Approach to Life'); // 'new-approach-to-life'
369
+ ```
370
+
371
+ ## See Also
372
+
373
+ - [Routing System](./routing.md) - How project routing works
374
+ - [Context Commands](./context-commands.md) - Managing projects and entities
375
+ - [Configuration](./configuration.md) - Setting up Protokoll
@@ -0,0 +1,207 @@
1
+ # Configuration Command
2
+
3
+ The `config` command provides an easy way to view and edit Protokoll's configuration without manually editing YAML files.
4
+
5
+ ## Basic Usage
6
+
7
+ ### Interactive Mode
8
+
9
+ Running `protokoll config` without arguments opens an interactive configuration editor:
10
+
11
+ ```bash
12
+ protokoll config
13
+ ```
14
+
15
+ The editor walks through each setting category, showing:
16
+ - Current value (or default if not set)
17
+ - Description of what the setting does
18
+ - Allowed values or examples
19
+ - Prompt to enter a new value
20
+
21
+ ```
22
+ ╔════════════════════════════════════════════════════════════════╗
23
+ ║ PROTOKOLL CONFIGURATION EDITOR ║
24
+ ╚════════════════════════════════════════════════════════════════╝
25
+
26
+ Config file: ~/.protokoll/config.yaml
27
+
28
+ Press Enter to keep current value, or type a new value.
29
+ Type 'q' to quit, 's' to save and exit.
30
+
31
+ ── AI Models ──
32
+
33
+ model
34
+ AI model for transcription enhancement
35
+ Examples: gpt-5.2, gpt-4o, gpt-4o-mini, claude-3-5-sonnet
36
+ Current: gpt-5.2
37
+ New value (Enter to skip): gpt-4o
38
+ ✓ Set to: gpt-4o
39
+ ```
40
+
41
+ ### List All Settings
42
+
43
+ View all configuration options and their current values:
44
+
45
+ ```bash
46
+ protokoll config --list
47
+ ```
48
+
49
+ Output:
50
+ ```
51
+ Protokoll Configuration
52
+ Config file: ~/.protokoll/config.yaml
53
+
54
+ model gpt-5.2
55
+ transcriptionModel whisper-1 (default)
56
+ reasoningLevel medium (default)
57
+ inputDirectory ./recordings
58
+ outputDirectory ~/notes
59
+ ...
60
+ ```
61
+
62
+ ### View a Specific Setting
63
+
64
+ Check the current value of any setting:
65
+
66
+ ```bash
67
+ protokoll config model
68
+ ```
69
+
70
+ Output:
71
+ ```
72
+ model
73
+ AI model for transcription enhancement
74
+
75
+ Value: gpt-5.2
76
+ Examples: gpt-5.2, gpt-4o, gpt-4o-mini, claude-3-5-sonnet
77
+ ```
78
+
79
+ ### Set a Specific Value
80
+
81
+ Change any setting with a one-line command:
82
+
83
+ ```bash
84
+ protokoll config model gpt-4o-mini
85
+ ```
86
+
87
+ Output:
88
+ ```
89
+ ✓ model = gpt-4o-mini
90
+ Saved to: ~/.protokoll/config.yaml
91
+ ```
92
+
93
+ ### Show Config File Path
94
+
95
+ Find where your configuration is stored:
96
+
97
+ ```bash
98
+ protokoll config --path
99
+ ```
100
+
101
+ ## Available Settings
102
+
103
+ ### AI Models
104
+
105
+ | Setting | Type | Default | Description |
106
+ |---------|------|---------|-------------|
107
+ | `model` | string | `gpt-5.2` | AI model for transcription enhancement |
108
+ | `transcriptionModel` | string | `whisper-1` | Model for audio transcription |
109
+ | `reasoningLevel` | string | `medium` | Reasoning effort: `low`, `medium`, or `high` |
110
+
111
+ ### Directories
112
+
113
+ | Setting | Type | Default | Description |
114
+ |---------|------|---------|-------------|
115
+ | `inputDirectory` | path | `./` | Where to read audio files from |
116
+ | `outputDirectory` | path | `~/notes` | Where to write transcripts |
117
+ | `processedDirectory` | path | `./processed` | Where to move processed audio files |
118
+ | `tempDirectory` | path | `/tmp` | Temporary directory for processing |
119
+
120
+ ### Output Format
121
+
122
+ | Setting | Type | Default | Description |
123
+ |---------|------|---------|-------------|
124
+ | `outputStructure` | string | `month` | Directory structure: `none`, `year`, `month`, `day` |
125
+ | `outputFilenameOptions` | array | `date,time,subject` | Components in output filenames |
126
+ | `timezone` | string | `Etc/UTC` | Timezone for date/time operations |
127
+
128
+ ### Behavior
129
+
130
+ | Setting | Type | Default | Description |
131
+ |---------|------|---------|-------------|
132
+ | `interactive` | boolean | `true` | Enable interactive prompts |
133
+ | `selfReflection` | boolean | `true` | Generate self-reflection reports |
134
+ | `silent` | boolean | `false` | Disable sound notifications |
135
+ | `verbose` | boolean | `false` | Enable verbose logging |
136
+ | `debug` | boolean | `false` | Enable debug mode |
137
+ | `dryRun` | boolean | `false` | Show what would happen without changes |
138
+
139
+ ### Limits
140
+
141
+ | Setting | Type | Default | Description |
142
+ |---------|------|---------|-------------|
143
+ | `maxAudioSize` | number | `26214400` | Maximum audio file size in bytes (25MB) |
144
+
145
+ ## Examples
146
+
147
+ ### Setting Up for Work
148
+
149
+ ```bash
150
+ # Set a work-appropriate model
151
+ protokoll config model gpt-4o-mini
152
+
153
+ # Output to work notes folder
154
+ protokoll config outputDirectory ~/work/notes
155
+
156
+ # Organize by month
157
+ protokoll config outputStructure month
158
+ ```
159
+
160
+ ### Disabling Interactive Mode for Automation
161
+
162
+ ```bash
163
+ # Disable interactive prompts (use in cron jobs)
164
+ protokoll config interactive false
165
+
166
+ # Disable sounds
167
+ protokoll config silent true
168
+ ```
169
+
170
+ ### Debugging Issues
171
+
172
+ ```bash
173
+ # Enable debug output
174
+ protokoll config debug true
175
+
176
+ # Enable verbose logging
177
+ protokoll config verbose true
178
+ ```
179
+
180
+ ### Configuring Array Values
181
+
182
+ For array settings like `outputFilenameOptions`, use comma-separated values:
183
+
184
+ ```bash
185
+ # Just date and subject (no time)
186
+ protokoll config outputFilenameOptions "date,subject"
187
+
188
+ # All options
189
+ protokoll config outputFilenameOptions "date,time,subject"
190
+ ```
191
+
192
+ ## Configuration Hierarchy
193
+
194
+ Protokoll uses hierarchical configuration:
195
+
196
+ 1. **Default values** - Built into Protokoll
197
+ 2. **Global config** - `~/.protokoll/config.yaml`
198
+ 3. **Project config** - `.protokoll/config.yaml` in any parent directory
199
+ 4. **Command-line arguments** - Highest priority
200
+
201
+ The `config` command edits either the global config or the closest project config, depending on which exists.
202
+
203
+ ## See Also
204
+
205
+ - [Quick Start Guide](./quickstart.md) - Getting started with Protokoll
206
+ - [Routing System](./routing.md) - Configure project-specific routing
207
+ - [Context System](./context-system.md) - Add people, terms, and projects