@redaksjon/protokoll 0.0.13 → 0.0.14

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 (108) hide show
  1. package/README.md +198 -0
  2. package/dist/feedback.js +5193 -0
  3. package/dist/feedback.js.map +1 -0
  4. package/dist/main.js +1858 -9
  5. package/dist/main.js.map +1 -1
  6. package/dist/mcp/server.js +1330 -0
  7. package/dist/mcp/server.js.map +1 -0
  8. package/guide/index.md +16 -0
  9. package/guide/mcp-integration.md +341 -0
  10. package/package.json +5 -3
  11. package/tsconfig.tsbuildinfo +1 -1
  12. package/vite.config.ts +13 -29
  13. package/dist/agentic/executor.js +0 -747
  14. package/dist/agentic/executor.js.map +0 -1
  15. package/dist/agentic/index.js +0 -19
  16. package/dist/agentic/index.js.map +0 -1
  17. package/dist/agentic/registry.js +0 -41
  18. package/dist/agentic/registry.js.map +0 -1
  19. package/dist/agentic/tools/lookup-person.js +0 -185
  20. package/dist/agentic/tools/lookup-person.js.map +0 -1
  21. package/dist/agentic/tools/lookup-project.js +0 -210
  22. package/dist/agentic/tools/lookup-project.js.map +0 -1
  23. package/dist/agentic/tools/route-note.js +0 -49
  24. package/dist/agentic/tools/route-note.js.map +0 -1
  25. package/dist/agentic/tools/store-context.js +0 -51
  26. package/dist/agentic/tools/store-context.js.map +0 -1
  27. package/dist/agentic/tools/verify-spelling.js +0 -57
  28. package/dist/agentic/tools/verify-spelling.js.map +0 -1
  29. package/dist/arguments.js +0 -178
  30. package/dist/arguments.js.map +0 -1
  31. package/dist/cli/action.js +0 -704
  32. package/dist/cli/action.js.map +0 -1
  33. package/dist/cli/config.js +0 -482
  34. package/dist/cli/config.js.map +0 -1
  35. package/dist/cli/context.js +0 -466
  36. package/dist/cli/context.js.map +0 -1
  37. package/dist/cli/feedback.js +0 -858
  38. package/dist/cli/feedback.js.map +0 -1
  39. package/dist/cli/index.js +0 -103
  40. package/dist/cli/index.js.map +0 -1
  41. package/dist/cli/install.js +0 -572
  42. package/dist/cli/install.js.map +0 -1
  43. package/dist/cli/transcript.js +0 -199
  44. package/dist/cli/transcript.js.map +0 -1
  45. package/dist/constants.js +0 -91
  46. package/dist/constants.js.map +0 -1
  47. package/dist/context/discovery.js +0 -114
  48. package/dist/context/discovery.js.map +0 -1
  49. package/dist/context/index.js +0 -82
  50. package/dist/context/index.js.map +0 -1
  51. package/dist/context/storage.js +0 -184
  52. package/dist/context/storage.js.map +0 -1
  53. package/dist/interactive/handler.js +0 -524
  54. package/dist/interactive/handler.js.map +0 -1
  55. package/dist/interactive/index.js +0 -18
  56. package/dist/interactive/index.js.map +0 -1
  57. package/dist/interactive/onboarding.js +0 -28
  58. package/dist/interactive/onboarding.js.map +0 -1
  59. package/dist/logging.js +0 -46
  60. package/dist/logging.js.map +0 -1
  61. package/dist/output/index.js +0 -8
  62. package/dist/output/index.js.map +0 -1
  63. package/dist/output/manager.js +0 -150
  64. package/dist/output/manager.js.map +0 -1
  65. package/dist/phases/complete.js +0 -142
  66. package/dist/phases/complete.js.map +0 -1
  67. package/dist/phases/locate.js +0 -64
  68. package/dist/phases/locate.js.map +0 -1
  69. package/dist/pipeline/index.js +0 -8
  70. package/dist/pipeline/index.js.map +0 -1
  71. package/dist/pipeline/orchestrator.js +0 -354
  72. package/dist/pipeline/orchestrator.js.map +0 -1
  73. package/dist/protokoll.js +0 -180
  74. package/dist/protokoll.js.map +0 -1
  75. package/dist/reasoning/client.js +0 -233
  76. package/dist/reasoning/client.js.map +0 -1
  77. package/dist/reasoning/index.js +0 -37
  78. package/dist/reasoning/index.js.map +0 -1
  79. package/dist/reasoning/strategy.js +0 -60
  80. package/dist/reasoning/strategy.js.map +0 -1
  81. package/dist/reflection/collector.js +0 -124
  82. package/dist/reflection/collector.js.map +0 -1
  83. package/dist/reflection/index.js +0 -16
  84. package/dist/reflection/index.js.map +0 -1
  85. package/dist/reflection/reporter.js +0 -238
  86. package/dist/reflection/reporter.js.map +0 -1
  87. package/dist/routing/classifier.js +0 -201
  88. package/dist/routing/classifier.js.map +0 -1
  89. package/dist/routing/index.js +0 -27
  90. package/dist/routing/index.js.map +0 -1
  91. package/dist/routing/router.js +0 -153
  92. package/dist/routing/router.js.map +0 -1
  93. package/dist/transcription/index.js +0 -41
  94. package/dist/transcription/index.js.map +0 -1
  95. package/dist/transcription/service.js +0 -64
  96. package/dist/transcription/service.js.map +0 -1
  97. package/dist/transcription/types.js +0 -31
  98. package/dist/transcription/types.js.map +0 -1
  99. package/dist/util/dates.js +0 -96
  100. package/dist/util/dates.js.map +0 -1
  101. package/dist/util/media.js +0 -103
  102. package/dist/util/media.js.map +0 -1
  103. package/dist/util/metadata.js +0 -95
  104. package/dist/util/metadata.js.map +0 -1
  105. package/dist/util/sound.js +0 -116
  106. package/dist/util/sound.js.map +0 -1
  107. package/dist/util/storage.js +0 -135
  108. package/dist/util/storage.js.map +0 -1
@@ -1,210 +0,0 @@
1
- /**
2
- * Lookup Project Tool
3
- *
4
- * Looks up project information for routing and context.
5
- * Prompts to create unknown projects when user input is available.
6
- */ /**
7
- * Extract context from transcript around where a term is mentioned.
8
- * Returns approximately one sentence before and after the term mention.
9
- */ function extractTermContext(transcript, term) {
10
- // Case-insensitive search for the term
11
- const lowerTranscript = transcript.toLowerCase();
12
- const lowerTerm = term.toLowerCase();
13
- const index = lowerTranscript.indexOf(lowerTerm);
14
- if (index === -1) {
15
- return null;
16
- }
17
- // Define strong sentence boundaries (., !, ?)
18
- const sentenceBoundary = /[.!?]/;
19
- // Look backwards for the start (find the sentence boundary 1 sentence before)
20
- let startIndex = 0;
21
- let boundariesFound = 0;
22
- for(let i = index - 1; i >= 0; i--){
23
- if (sentenceBoundary.test(transcript[i])) {
24
- boundariesFound++;
25
- // After finding first boundary (end of current sentence),
26
- // keep looking for the second (end of previous sentence)
27
- if (boundariesFound === 2) {
28
- // Start after this boundary
29
- startIndex = i + 1;
30
- break;
31
- }
32
- }
33
- }
34
- // Look forwards for the end (find sentence boundary 1 sentence after)
35
- let endIndex = transcript.length;
36
- boundariesFound = 0;
37
- for(let i = index + term.length; i < transcript.length; i++){
38
- if (sentenceBoundary.test(transcript[i])) {
39
- boundariesFound++;
40
- // After finding first boundary (end of current sentence),
41
- // keep looking for the second (end of next sentence)
42
- if (boundariesFound === 2) {
43
- // Include this boundary
44
- endIndex = i + 1;
45
- break;
46
- }
47
- }
48
- }
49
- // Extract and clean up the context
50
- let context = transcript.substring(startIndex, endIndex).trim();
51
- // Limit length to avoid overwhelming the prompt (max ~300 chars)
52
- if (context.length > 300) {
53
- // Try to cut at a sentence boundary
54
- const midPoint = context.indexOf(term);
55
- if (midPoint !== -1) {
56
- // Keep the sentence with the term, trim around it
57
- let sentenceStart = midPoint;
58
- let sentenceEnd = midPoint + term.length;
59
- // Find sentence start
60
- for(let i = midPoint - 1; i >= 0; i--){
61
- if (sentenceBoundary.test(context[i])) {
62
- sentenceStart = i + 1;
63
- break;
64
- }
65
- }
66
- // Find sentence end
67
- for(let i = midPoint + term.length; i < context.length; i++){
68
- if (sentenceBoundary.test(context[i])) {
69
- sentenceEnd = i + 1;
70
- break;
71
- }
72
- }
73
- context = context.substring(sentenceStart, sentenceEnd).trim();
74
- } else {
75
- // Just truncate if term not found in extracted context
76
- context = context.substring(0, 300) + '...';
77
- }
78
- }
79
- return context;
80
- }
81
- const create = (ctx)=>({
82
- name: 'lookup_project',
83
- description: 'Look up project information for routing and context. Use when you need to determine where this note should be filed.',
84
- parameters: {
85
- type: 'object',
86
- properties: {
87
- name: {
88
- type: 'string',
89
- description: 'The project name or identifier'
90
- },
91
- triggerPhrase: {
92
- type: 'string',
93
- description: 'A phrase from the transcript that might indicate the project'
94
- }
95
- },
96
- required: [
97
- 'name'
98
- ]
99
- },
100
- execute: async (args)=>{
101
- var _ctx_resolvedEntities;
102
- const context = ctx.contextInstance;
103
- // First, check if this project/term was already resolved in this session
104
- if ((_ctx_resolvedEntities = ctx.resolvedEntities) === null || _ctx_resolvedEntities === void 0 ? void 0 : _ctx_resolvedEntities.has(args.name)) {
105
- const resolvedName = ctx.resolvedEntities.get(args.name);
106
- return {
107
- success: true,
108
- data: {
109
- found: true,
110
- suggestion: `Already resolved: use "${resolvedName}"`,
111
- cached: true
112
- }
113
- };
114
- }
115
- // Check if this term is on the ignore list
116
- if (context.isIgnored(args.name)) {
117
- return {
118
- success: true,
119
- data: {
120
- found: false,
121
- ignored: true,
122
- message: `"${args.name}" is on the ignore list - skipping without prompting`
123
- }
124
- };
125
- }
126
- // Look up project by name
127
- const projects = context.search(args.name);
128
- const projectMatches = projects.filter((e)=>e.type === 'project');
129
- if (projectMatches.length > 0) {
130
- const project = projectMatches[0];
131
- return {
132
- success: true,
133
- data: {
134
- found: true,
135
- project
136
- }
137
- };
138
- }
139
- // Try getting all projects and matching trigger phrases
140
- if (args.triggerPhrase) {
141
- const allProjects = context.getAllProjects();
142
- for (const project of allProjects){
143
- var _ref;
144
- var _project_classification;
145
- const phrases = (_ref = (_project_classification = project.classification) === null || _project_classification === void 0 ? void 0 : _project_classification.explicit_phrases) !== null && _ref !== void 0 ? _ref : [];
146
- if (phrases.some((p)=>{
147
- var _args_triggerPhrase;
148
- return (_args_triggerPhrase = args.triggerPhrase) === null || _args_triggerPhrase === void 0 ? void 0 : _args_triggerPhrase.toLowerCase().includes(p.toLowerCase());
149
- })) {
150
- return {
151
- success: true,
152
- data: {
153
- found: true,
154
- project,
155
- matchedTrigger: args.triggerPhrase
156
- }
157
- };
158
- }
159
- }
160
- }
161
- // Project not found - always signal that we need user input
162
- // The executor will decide whether to actually prompt based on handler availability
163
- const allProjects = context.getAllProjects();
164
- const projectOptions = allProjects.filter((p)=>p.active !== false).map((p)=>`${p.name}${p.description ? ` - ${p.description}` : ''}`);
165
- // Extract filename from sourceFile path for cleaner display
166
- const fileName = ctx.sourceFile.split('/').pop() || ctx.sourceFile;
167
- const fileDate = ctx.audioDate.toLocaleString('en-US', {
168
- weekday: 'short',
169
- year: 'numeric',
170
- month: 'short',
171
- day: 'numeric',
172
- hour: '2-digit',
173
- minute: '2-digit'
174
- });
175
- // Find context from transcript where the project/term is mentioned
176
- const transcriptContext = extractTermContext(ctx.transcriptText, args.name);
177
- const contextLines = [
178
- `File: ${fileName}`,
179
- `Date: ${fileDate}`,
180
- '',
181
- `Unknown project/term: "${args.name}"`
182
- ];
183
- if (transcriptContext) {
184
- contextLines.push('');
185
- contextLines.push('Context from transcript:');
186
- contextLines.push(`"${transcriptContext}"`);
187
- } else if (args.triggerPhrase) {
188
- contextLines.push('');
189
- contextLines.push('Context from transcript:');
190
- contextLines.push(`"${args.triggerPhrase}"`);
191
- }
192
- return {
193
- success: true,
194
- needsUserInput: true,
195
- userPrompt: contextLines.join('\n'),
196
- data: {
197
- found: false,
198
- clarificationType: 'new_project',
199
- term: args.name,
200
- triggerPhrase: args.triggerPhrase,
201
- message: `Project "${args.name}" not found. Asking user if this is a new project.`,
202
- knownProjects: allProjects.filter((p)=>p.active !== false),
203
- options: projectOptions
204
- }
205
- };
206
- }
207
- });
208
-
209
- export { create };
210
- //# sourceMappingURL=lookup-project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookup-project.js","sources":["../../../src/agentic/tools/lookup-project.ts"],"sourcesContent":["/**\n * Lookup Project Tool\n * \n * Looks up project information for routing and context.\n * Prompts to create unknown projects when user input is available.\n */\n\nimport { TranscriptionTool, ToolContext, ToolResult } from '../types';\n\n/**\n * Extract context from transcript around where a term is mentioned.\n * Returns approximately one sentence before and after the term mention.\n */\nfunction extractTermContext(transcript: string, term: string): string | null {\n // Case-insensitive search for the term\n const lowerTranscript = transcript.toLowerCase();\n const lowerTerm = term.toLowerCase();\n const index = lowerTranscript.indexOf(lowerTerm);\n \n if (index === -1) {\n return null;\n }\n \n // Define strong sentence boundaries (., !, ?)\n const sentenceBoundary = /[.!?]/;\n \n // Look backwards for the start (find the sentence boundary 1 sentence before)\n let startIndex = 0;\n let boundariesFound = 0;\n for (let i = index - 1; i >= 0; i--) {\n if (sentenceBoundary.test(transcript[i])) {\n boundariesFound++;\n // After finding first boundary (end of current sentence), \n // keep looking for the second (end of previous sentence)\n if (boundariesFound === 2) {\n // Start after this boundary\n startIndex = i + 1;\n break;\n }\n }\n }\n \n // Look forwards for the end (find sentence boundary 1 sentence after)\n let endIndex = transcript.length;\n boundariesFound = 0;\n for (let i = index + term.length; i < transcript.length; i++) {\n if (sentenceBoundary.test(transcript[i])) {\n boundariesFound++;\n // After finding first boundary (end of current sentence),\n // keep looking for the second (end of next sentence)\n if (boundariesFound === 2) {\n // Include this boundary\n endIndex = i + 1;\n break;\n }\n }\n }\n \n // Extract and clean up the context\n let context = transcript.substring(startIndex, endIndex).trim();\n \n // Limit length to avoid overwhelming the prompt (max ~300 chars)\n if (context.length > 300) {\n // Try to cut at a sentence boundary\n const midPoint = context.indexOf(term);\n if (midPoint !== -1) {\n // Keep the sentence with the term, trim around it\n let sentenceStart = midPoint;\n let sentenceEnd = midPoint + term.length;\n \n // Find sentence start\n for (let i = midPoint - 1; i >= 0; i--) {\n if (sentenceBoundary.test(context[i])) {\n sentenceStart = i + 1;\n break;\n }\n }\n \n // Find sentence end\n for (let i = midPoint + term.length; i < context.length; i++) {\n if (sentenceBoundary.test(context[i])) {\n sentenceEnd = i + 1;\n break;\n }\n }\n \n context = context.substring(sentenceStart, sentenceEnd).trim();\n } else {\n // Just truncate if term not found in extracted context\n context = context.substring(0, 300) + '...';\n }\n }\n \n return context;\n}\n\nexport const create = (ctx: ToolContext): TranscriptionTool => ({\n name: 'lookup_project',\n description: 'Look up project information for routing and context. Use when you need to determine where this note should be filed.',\n parameters: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description: 'The project name or identifier',\n },\n triggerPhrase: {\n type: 'string',\n description: 'A phrase from the transcript that might indicate the project',\n },\n },\n required: ['name'],\n },\n execute: async (args: { name: string; triggerPhrase?: string }): Promise<ToolResult> => {\n const context = ctx.contextInstance;\n \n // First, check if this project/term was already resolved in this session\n if (ctx.resolvedEntities?.has(args.name)) {\n const resolvedName = ctx.resolvedEntities.get(args.name);\n return {\n success: true,\n data: {\n found: true,\n suggestion: `Already resolved: use \"${resolvedName}\"`,\n cached: true,\n },\n };\n }\n \n // Check if this term is on the ignore list\n if (context.isIgnored(args.name)) {\n return {\n success: true,\n data: {\n found: false,\n ignored: true,\n message: `\"${args.name}\" is on the ignore list - skipping without prompting`,\n },\n };\n }\n \n // Look up project by name\n const projects = context.search(args.name);\n const projectMatches = projects.filter(e => e.type === 'project');\n \n if (projectMatches.length > 0) {\n const project = projectMatches[0];\n return {\n success: true,\n data: {\n found: true,\n project,\n },\n };\n }\n \n // Try getting all projects and matching trigger phrases\n if (args.triggerPhrase) {\n const allProjects = context.getAllProjects();\n for (const project of allProjects) {\n const phrases = project.classification?.explicit_phrases ?? [];\n if (phrases.some(p => args.triggerPhrase?.toLowerCase().includes(p.toLowerCase()))) {\n return {\n success: true,\n data: {\n found: true,\n project,\n matchedTrigger: args.triggerPhrase,\n },\n };\n }\n }\n }\n \n // Project not found - always signal that we need user input\n // The executor will decide whether to actually prompt based on handler availability\n const allProjects = context.getAllProjects();\n const projectOptions = allProjects\n .filter(p => p.active !== false)\n .map(p => `${p.name}${p.description ? ` - ${p.description}` : ''}`);\n \n // Extract filename from sourceFile path for cleaner display\n const fileName = ctx.sourceFile.split('/').pop() || ctx.sourceFile;\n const fileDate = ctx.audioDate.toLocaleString('en-US', {\n weekday: 'short',\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n \n // Find context from transcript where the project/term is mentioned\n const transcriptContext = extractTermContext(ctx.transcriptText, args.name);\n \n const contextLines = [\n `File: ${fileName}`,\n `Date: ${fileDate}`,\n '',\n `Unknown project/term: \"${args.name}\"`,\n ];\n \n if (transcriptContext) {\n contextLines.push('');\n contextLines.push('Context from transcript:');\n contextLines.push(`\"${transcriptContext}\"`);\n } else if (args.triggerPhrase) {\n contextLines.push('');\n contextLines.push('Context from transcript:');\n contextLines.push(`\"${args.triggerPhrase}\"`);\n }\n \n return {\n success: true,\n needsUserInput: true,\n userPrompt: contextLines.join('\\n'),\n data: {\n found: false,\n clarificationType: 'new_project',\n term: args.name,\n triggerPhrase: args.triggerPhrase,\n message: `Project \"${args.name}\" not found. Asking user if this is a new project.`,\n knownProjects: allProjects.filter(p => p.active !== false),\n options: projectOptions,\n },\n };\n },\n});\n\n"],"names":["extractTermContext","transcript","term","lowerTranscript","toLowerCase","lowerTerm","index","indexOf","sentenceBoundary","startIndex","boundariesFound","i","test","endIndex","length","context","substring","trim","midPoint","sentenceStart","sentenceEnd","create","ctx","name","description","parameters","type","properties","triggerPhrase","required","execute","args","contextInstance","resolvedEntities","has","resolvedName","get","success","data","found","suggestion","cached","isIgnored","ignored","message","projects","search","projectMatches","filter","e","project","allProjects","getAllProjects","phrases","classification","explicit_phrases","some","p","includes","matchedTrigger","projectOptions","active","map","fileName","sourceFile","split","pop","fileDate","audioDate","toLocaleString","weekday","year","month","day","hour","minute","transcriptContext","transcriptText","contextLines","push","needsUserInput","userPrompt","join","clarificationType","knownProjects","options"],"mappings":"AAAA;;;;;;;;AAYC,IACD,SAASA,kBAAAA,CAAmBC,UAAkB,EAAEC,IAAY,EAAA;;IAExD,MAAMC,eAAAA,GAAkBF,WAAWG,WAAW,EAAA;IAC9C,MAAMC,SAAAA,GAAYH,KAAKE,WAAW,EAAA;IAClC,MAAME,KAAAA,GAAQH,eAAAA,CAAgBI,OAAO,CAACF,SAAAA,CAAAA;IAEtC,IAAIC,KAAAA,KAAU,EAAC,EAAG;QACd,OAAO,IAAA;AACX,IAAA;;AAGA,IAAA,MAAME,gBAAAA,GAAmB,OAAA;;AAGzB,IAAA,IAAIC,UAAAA,GAAa,CAAA;AACjB,IAAA,IAAIC,eAAAA,GAAkB,CAAA;AACtB,IAAA,IAAK,IAAIC,CAAAA,GAAIL,KAAAA,GAAQ,CAAA,EAAGK,CAAAA,IAAK,GAAGA,CAAAA,EAAAA,CAAK;AACjC,QAAA,IAAIH,iBAAiBI,I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,EAAgB,IAAA;gBAChBC,UAAAA,EAAYH,YAAAA,CAAaI,IAAI,CAAC,IAAA,CAAA;gBAC9B5C,IAAAA,EAAM;oBACFC,KAAAA,EAAO,KAAA;oBACP4C,iBAAAA,EAAmB,aAAA;AACnBjF,oBAAAA,IAAAA,EAAM6B,KAAKR,IAAI;AACfK,oBAAAA,aAAAA,EAAeG,KAAKH,aAAa;AACjCgB,oBAAAA,OAAAA,EAAS,CAAC,SAAS,EAAEb,KAAKR,IAAI,CAAC,kDAAkD,CAAC;AAClF6D,oBAAAA,aAAAA,EAAejC,YAAYH,MAAM,CAACS,CAAAA,CAAAA,GAAKA,CAAAA,CAAEI,MAAM,KAAK,KAAA,CAAA;oBACpDwB,OAAAA,EAASzB;AACb;AACJ,aAAA;AACJ,QAAA;AACJ,KAAA;;;;"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Route Note Tool
3
- *
4
- * Determines the destination for a note based on content analysis.
5
- */ const create = (ctx)=>({
6
- name: 'route_note',
7
- description: 'Determine the destination for this note based on content analysis.',
8
- parameters: {
9
- type: 'object',
10
- properties: {
11
- projectHint: {
12
- type: 'string',
13
- description: 'The detected project name or hint'
14
- },
15
- contentSummary: {
16
- type: 'string',
17
- description: 'Brief summary of what the note is about'
18
- }
19
- }
20
- },
21
- execute: async (args)=>{
22
- const routing = ctx.routingInstance;
23
- const routingContext = {
24
- transcriptText: ctx.transcriptText,
25
- audioDate: ctx.audioDate,
26
- sourceFile: ctx.sourceFile
27
- };
28
- const decision = routing.route(routingContext);
29
- const outputPath = routing.buildOutputPath(decision, routingContext);
30
- return {
31
- success: true,
32
- data: {
33
- projectId: decision.projectId,
34
- // Return the routing decision (base path + structure), NOT the built output path
35
- // The orchestrator will call buildOutputPath() later
36
- routingDecision: decision,
37
- // Also include the built path for informational purposes
38
- outputPath: outputPath,
39
- confidence: decision.confidence,
40
- reasoning: decision.reasoning,
41
- projectHint: args.projectHint,
42
- contentSummary: args.contentSummary
43
- }
44
- };
45
- }
46
- });
47
-
48
- export { create };
49
- //# sourceMappingURL=route-note.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"route-note.js","sources":["../../../src/agentic/tools/route-note.ts"],"sourcesContent":["/**\n * Route Note Tool\n * \n * Determines the destination for a note based on content analysis.\n */\n\nimport { TranscriptionTool, ToolContext, ToolResult } from '../types';\n\nexport const create = (ctx: ToolContext): TranscriptionTool => ({\n name: 'route_note',\n description: 'Determine the destination for this note based on content analysis.',\n parameters: {\n type: 'object',\n properties: {\n projectHint: {\n type: 'string',\n description: 'The detected project name or hint',\n },\n contentSummary: {\n type: 'string',\n description: 'Brief summary of what the note is about',\n },\n },\n },\n execute: async (args: { projectHint?: string; contentSummary?: string }): Promise<ToolResult> => {\n const routing = ctx.routingInstance;\n \n const routingContext = {\n transcriptText: ctx.transcriptText,\n audioDate: ctx.audioDate,\n sourceFile: ctx.sourceFile,\n };\n \n const decision = routing.route(routingContext);\n const outputPath = routing.buildOutputPath(decision, routingContext);\n \n return {\n success: true,\n data: {\n projectId: decision.projectId,\n // Return the routing decision (base path + structure), NOT the built output path\n // The orchestrator will call buildOutputPath() later\n routingDecision: decision,\n // Also include the built path for informational purposes\n outputPath: outputPath,\n confidence: decision.confidence,\n reasoning: decision.reasoning,\n projectHint: args.projectHint,\n contentSummary: args.contentSummary,\n },\n };\n },\n});\n\n"],"names":["create","ctx","name","description","parameters","type","properties","projectHint","contentSummary","execute","args","routing","routingInstance","routingContext","transcriptText","audioDate","sourceFile","decision","route","outputPath","buildOutputPath","success","data","projectId","routingDecision","confidence","reasoning"],"mappings":"AAAA;;;;AAIC,IAIM,MAAMA,MAAAA,GAAS,CAACC,OAAyC;QAC5DC,IAAAA,EAAM,YAAA;QACNC,WAAAA,EAAa,oEAAA;QACbC,UAAAA,EAAY;YACRC,IAAAA,EAAM,QAAA;YACNC,UAAAA,EAAY;gBACRC,WAAAA,EAAa;oBACTF,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB,iBAAA;gBACAK,cAAAA,EAAgB;oBACZH,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB;AACJ;AACJ,SAAA;AACAM,QAAAA,OAAAA,EAAS,OAAOC,IAAAA,GAAAA;YACZ,MAAMC,OAAAA,GAAUV,IAAIW,eAAe;AAEnC,YAAA,MAAMC,cAAAA,GAAiB;AACnBC,gBAAAA,cAAAA,EAAgBb,IAAIa,cAAc;AAClCC,gBAAAA,SAAAA,EAAWd,IAAIc,SAAS;AACxBC,gBAAAA,UAAAA,EAAYf,IAAIe;AACpB,aAAA;YAEA,MAAMC,QAAAA,GAAWN,OAAAA,CAAQO,KAAK,CAACL,cAAAA,CAAAA;AAC/B,YAAA,MAAMM,UAAAA,GAAaR,OAAAA,CAAQS,eAAe,CAACH,QAAAA,EAAUJ,cAAAA,CAAAA;YAErD,OAAO;gBACHQ,OAAAA,EAAS,IAAA;gBACTC,IAAAA,EAAM;AACFC,oBAAAA,SAAAA,EAAWN,SAASM,SAAS;;;oBAG7BC,eAAAA,EAAiBP,QAAAA;;oBAEjBE,UAAAA,EAAYA,UAAAA;AACZM,oBAAAA,UAAAA,EAAYR,SAASQ,UAAU;AAC/BC,oBAAAA,SAAAA,EAAWT,SAASS,SAAS;AAC7BnB,oBAAAA,WAAAA,EAAaG,KAAKH,WAAW;AAC7BC,oBAAAA,cAAAA,EAAgBE,KAAKF;AACzB;AACJ,aAAA;AACJ,QAAA;AACJ,KAAA;;;;"}
@@ -1,51 +0,0 @@
1
- /**
2
- * Store Context Tool
3
- *
4
- * Stores new context information for future use.
5
- */ const create = (_ctx)=>({
6
- name: 'store_context',
7
- description: 'Store new context information for future use. Use when you learn something new that should be remembered.',
8
- parameters: {
9
- type: 'object',
10
- properties: {
11
- entityType: {
12
- type: 'string',
13
- enum: [
14
- 'person',
15
- 'project',
16
- 'company',
17
- 'term'
18
- ],
19
- description: 'Type of entity to store'
20
- },
21
- name: {
22
- type: 'string',
23
- description: 'Name of the entity'
24
- },
25
- details: {
26
- type: 'object',
27
- description: 'Additional details about the entity'
28
- }
29
- },
30
- required: [
31
- 'entityType',
32
- 'name'
33
- ]
34
- },
35
- execute: async (args)=>{
36
- // This tool requires --self-update flag to actually persist
37
- // Otherwise it just acknowledges without saving
38
- return {
39
- success: true,
40
- data: {
41
- stored: false,
42
- message: 'Context storage requires --self-update flag. Information noted but not persisted.',
43
- entityType: args.entityType,
44
- name: args.name
45
- }
46
- };
47
- }
48
- });
49
-
50
- export { create };
51
- //# sourceMappingURL=store-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-context.js","sources":["../../../src/agentic/tools/store-context.ts"],"sourcesContent":["/**\n * Store Context Tool\n * \n * Stores new context information for future use.\n */\n\nimport { TranscriptionTool, ToolContext, ToolResult } from '../types';\n\nexport const create = (_ctx: ToolContext): TranscriptionTool => ({\n name: 'store_context',\n description: 'Store new context information for future use. Use when you learn something new that should be remembered.',\n parameters: {\n type: 'object',\n properties: {\n entityType: {\n type: 'string',\n enum: ['person', 'project', 'company', 'term'],\n description: 'Type of entity to store',\n },\n name: {\n type: 'string',\n description: 'Name of the entity',\n },\n details: {\n type: 'object',\n description: 'Additional details about the entity',\n },\n },\n required: ['entityType', 'name'],\n },\n \n execute: async (args: { entityType: string; name: string; details?: any }): Promise<ToolResult> => {\n // This tool requires --self-update flag to actually persist\n // Otherwise it just acknowledges without saving\n \n return {\n success: true,\n data: {\n stored: false,\n message: 'Context storage requires --self-update flag. Information noted but not persisted.',\n entityType: args.entityType,\n name: args.name,\n },\n };\n },\n});\n\n"],"names":["create","_ctx","name","description","parameters","type","properties","entityType","enum","details","required","execute","args","success","data","stored","message"],"mappings":"AAAA;;;;AAIC,IAIM,MAAMA,MAAAA,GAAS,CAACC,QAA0C;QAC7DC,IAAAA,EAAM,eAAA;QACNC,WAAAA,EAAa,2GAAA;QACbC,UAAAA,EAAY;YACRC,IAAAA,EAAM,QAAA;YACNC,UAAAA,EAAY;gBACRC,UAAAA,EAAY;oBACRF,IAAAA,EAAM,QAAA;oBACNG,IAAAA,EAAM;AAAC,wBAAA,QAAA;AAAU,wBAAA,SAAA;AAAW,wBAAA,SAAA;AAAW,wBAAA;AAAO,qBAAA;oBAC9CL,WAAAA,EAAa;AACjB,iBAAA;gBACAD,IAAAA,EAAM;oBACFG,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB,iBAAA;gBACAM,OAAAA,EAAS;oBACLJ,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB;AACJ,aAAA;YACAO,QAAAA,EAAU;AAAC,gBAAA,YAAA;AAAc,gBAAA;AAAO;AACpC,SAAA;AAEAC,QAAAA,OAAAA,EAAS,OAAOC,IAAAA,GAAAA;;;YAIZ,OAAO;gBACHC,OAAAA,EAAS,IAAA;gBACTC,IAAAA,EAAM;oBACFC,MAAAA,EAAQ,KAAA;oBACRC,OAAAA,EAAS,mFAAA;AACTT,oBAAAA,UAAAA,EAAYK,KAAKL,UAAU;AAC3BL,oBAAAA,IAAAA,EAAMU,KAAKV;AACf;AACJ,aAAA;AACJ,QAAA;AACJ,KAAA;;;;"}
@@ -1,57 +0,0 @@
1
- /**
2
- * Verify Spelling Tool
3
- *
4
- * Requests user verification for an unknown name or term.
5
- */ const create = (ctx)=>({
6
- name: 'verify_spelling',
7
- description: 'Request user verification for an unknown name or term. Use when you encounter something that needs human confirmation.',
8
- parameters: {
9
- type: 'object',
10
- properties: {
11
- term: {
12
- type: 'string',
13
- description: 'The term that needs verification'
14
- },
15
- context: {
16
- type: 'string',
17
- description: 'Context around where this term appears'
18
- },
19
- suggestedSpelling: {
20
- type: 'string',
21
- description: 'Your best guess at the correct spelling'
22
- }
23
- },
24
- required: [
25
- 'term'
26
- ]
27
- },
28
- execute: async (args)=>{
29
- if (!ctx.interactiveMode) {
30
- // In batch mode, return best guess
31
- return {
32
- success: true,
33
- data: {
34
- verified: false,
35
- useSuggestion: true,
36
- spelling: args.suggestedSpelling || args.term,
37
- message: 'Non-interactive mode: using best guess'
38
- }
39
- };
40
- }
41
- // In interactive mode, mark for user input
42
- return {
43
- success: true,
44
- needsUserInput: true,
45
- userPrompt: `Unknown term: "${args.term}"${args.context ? ` (context: "${args.context}")` : ''}
46
- ${args.suggestedSpelling ? `Suggested spelling: "${args.suggestedSpelling}"` : ''}
47
- Please provide the correct spelling:`,
48
- data: {
49
- term: args.term,
50
- suggestedSpelling: args.suggestedSpelling
51
- }
52
- };
53
- }
54
- });
55
-
56
- export { create };
57
- //# sourceMappingURL=verify-spelling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify-spelling.js","sources":["../../../src/agentic/tools/verify-spelling.ts"],"sourcesContent":["/**\n * Verify Spelling Tool\n * \n * Requests user verification for an unknown name or term.\n */\n\nimport { TranscriptionTool, ToolContext, ToolResult } from '../types';\n\nexport const create = (ctx: ToolContext): TranscriptionTool => ({\n name: 'verify_spelling',\n description: 'Request user verification for an unknown name or term. Use when you encounter something that needs human confirmation.',\n parameters: {\n type: 'object',\n properties: {\n term: {\n type: 'string',\n description: 'The term that needs verification',\n },\n context: {\n type: 'string',\n description: 'Context around where this term appears',\n },\n suggestedSpelling: {\n type: 'string',\n description: 'Your best guess at the correct spelling',\n },\n },\n required: ['term'],\n },\n execute: async (args: { term: string; context?: string; suggestedSpelling?: string }): Promise<ToolResult> => {\n if (!ctx.interactiveMode) {\n // In batch mode, return best guess\n return {\n success: true,\n data: {\n verified: false,\n useSuggestion: true,\n spelling: args.suggestedSpelling || args.term,\n message: 'Non-interactive mode: using best guess',\n },\n };\n }\n \n // In interactive mode, mark for user input\n return {\n success: true,\n needsUserInput: true,\n userPrompt: `Unknown term: \"${args.term}\"${args.context ? ` (context: \"${args.context}\")` : ''}\n${args.suggestedSpelling ? `Suggested spelling: \"${args.suggestedSpelling}\"` : ''}\nPlease provide the correct spelling:`,\n data: {\n term: args.term,\n suggestedSpelling: args.suggestedSpelling,\n },\n };\n },\n});\n\n"],"names":["create","ctx","name","description","parameters","type","properties","term","context","suggestedSpelling","required","execute","args","interactiveMode","success","data","verified","useSuggestion","spelling","message","needsUserInput","userPrompt"],"mappings":"AAAA;;;;AAIC,IAIM,MAAMA,MAAAA,GAAS,CAACC,OAAyC;QAC5DC,IAAAA,EAAM,iBAAA;QACNC,WAAAA,EAAa,wHAAA;QACbC,UAAAA,EAAY;YACRC,IAAAA,EAAM,QAAA;YACNC,UAAAA,EAAY;gBACRC,IAAAA,EAAM;oBACFF,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB,iBAAA;gBACAK,OAAAA,EAAS;oBACLH,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB,iBAAA;gBACAM,iBAAAA,EAAmB;oBACfJ,IAAAA,EAAM,QAAA;oBACNF,WAAAA,EAAa;AACjB;AACJ,aAAA;YACAO,QAAAA,EAAU;AAAC,gBAAA;AAAO;AACtB,SAAA;AACAC,QAAAA,OAAAA,EAAS,OAAOC,IAAAA,GAAAA;YACZ,IAAI,CAACX,GAAAA,CAAIY,eAAe,EAAE;;gBAEtB,OAAO;oBACHC,OAAAA,EAAS,IAAA;oBACTC,IAAAA,EAAM;wBACFC,QAAAA,EAAU,KAAA;wBACVC,aAAAA,EAAe,IAAA;AACfC,wBAAAA,QAAAA,EAAUN,IAAAA,CAAKH,iBAAiB,IAAIG,IAAAA,CAAKL,IAAI;wBAC7CY,OAAAA,EAAS;AACb;AACJ,iBAAA;AACJ,YAAA;;YAGA,OAAO;gBACHL,OAAAA,EAAS,IAAA;gBACTM,cAAAA,EAAgB,IAAA;gBAChBC,UAAAA,EAAY,CAAC,eAAe,EAAET,IAAAA,CAAKL,IAAI,CAAC,CAAC,EAAEK,IAAAA,CAAKJ,OAAO,GAAG,CAAC,YAAY,EAAEI,IAAAA,CAAKJ,OAAO,CAAC,EAAE,CAAC,GAAG,EAAA;AACxG,EAAEI,IAAAA,CAAKH,iBAAiB,GAAG,CAAC,qBAAqB,EAAEG,IAAAA,CAAKH,iBAAiB,CAAC,CAAC,CAAC,GAAG,EAAA;oCAC3C,CAAC;gBACzBM,IAAAA,EAAM;AACFR,oBAAAA,IAAAA,EAAMK,KAAKL,IAAI;AACfE,oBAAAA,iBAAAA,EAAmBG,KAAKH;AAC5B;AACJ,aAAA;AACJ,QAAA;AACJ,KAAA;;;;"}
package/dist/arguments.js DELETED
@@ -1,178 +0,0 @@
1
- import { Command } from 'commander';
2
- import { PROGRAM_NAME, DEFAULT_REASONING_LEVEL, VERSION, PROTOKOLL_DEFAULTS, DEFAULT_MAX_AUDIO_SIZE } from './constants.js';
3
- import { getLogger } from './logging.js';
4
- import { create } from './util/storage.js';
5
-
6
- const configure = async (dreadcabinet, cardigantime)=>{
7
- const logger = getLogger();
8
- let program = new Command();
9
- program.name(PROGRAM_NAME).summary('Intelligent audio transcription tool with context').description('Protokoll transcribes audio files intelligently using context to improve accuracy').option('--dry-run', 'perform a dry run without saving files').option('--verbose', 'enable verbose logging').option('--debug', 'enable debug logging').option('--openai-api-key <openaiApiKey>', 'OpenAI API key').option('--transcription-model <transcriptionModel>', 'OpenAI transcription model to use').option('--model <model>', 'OpenAI model to use for transcription enhancement').option('--reasoning-level <reasoningLevel>', `reasoning effort level: low, medium, or high (default: ${DEFAULT_REASONING_LEVEL})`).option('--overrides', 'allow overrides of the default configuration').option('--context-directories [contextDirectories...]', 'directories containing context files to be included in prompts').option('--max-audio-size <maxAudioSize>', 'maximum audio file size in bytes').option('--temp-directory <tempDirectory>', 'temporary directory for processing files').option('--batch', 'disable interactive prompts (for automation/cron jobs)').option('--self-reflection', 'generate self-reflection reports (default: true)').option('--no-self-reflection', 'disable self-reflection reports').option('--silent', 'disable sound notifications in interactive mode').option('--processed-directory <processedDirectory>', 'directory to move processed audio files to');
10
- await dreadcabinet.configure(program);
11
- program = await cardigantime.configure(program);
12
- program.version(VERSION);
13
- // Check if --check-config is in process.argv early
14
- if (process.argv.includes('--check-config')) {
15
- program.parse();
16
- const cliArgs = program.opts();
17
- // Use CardiganTime's built-in checkConfig method
18
- await cardigantime.checkConfig(cliArgs);
19
- // Return minimal config for consistency, but main processing is done
20
- const config = PROTOKOLL_DEFAULTS;
21
- const secureConfig = {
22
- openaiApiKey: process.env.OPENAI_API_KEY
23
- };
24
- return [
25
- config,
26
- secureConfig
27
- ];
28
- }
29
- // Check if --init-config is in process.argv early
30
- if (process.argv.includes('--init-config')) {
31
- program.parse();
32
- const cliArgs = program.opts();
33
- // Use CardiganTime's built-in generateConfig method
34
- await cardigantime.generateConfig(cliArgs.configDirectory || PROTOKOLL_DEFAULTS.configDirectory);
35
- // Return minimal config for consistency, but main processing is done
36
- const config = PROTOKOLL_DEFAULTS;
37
- const secureConfig = {
38
- openaiApiKey: process.env.OPENAI_API_KEY
39
- };
40
- return [
41
- config,
42
- secureConfig
43
- ];
44
- }
45
- program.parse();
46
- const cliArgs = program.opts();
47
- logger.debug('Command Line Options: %s', JSON.stringify(cliArgs, null, 2));
48
- // Get values from config file first using CardiganTime's hierarchical configuration
49
- const fileValues = await cardigantime.read(cliArgs);
50
- // Read the Raw values from the Dreadcabinet Command Line Arguments
51
- const dreadcabinetValues = await dreadcabinet.read(cliArgs);
52
- // Extract protokoll-specific CLI args (only include if explicitly set)
53
- const protokollCliArgs = {};
54
- // --batch disables interactive mode (interactive is default)
55
- if (cliArgs.batch !== undefined) protokollCliArgs.interactive = !cliArgs.batch;
56
- if (cliArgs.selfReflection !== undefined) protokollCliArgs.selfReflection = cliArgs.selfReflection;
57
- if (cliArgs.debug !== undefined) protokollCliArgs.debug = cliArgs.debug;
58
- if (cliArgs.verbose !== undefined) protokollCliArgs.verbose = cliArgs.verbose;
59
- if (cliArgs.dryRun !== undefined) protokollCliArgs.dryRun = cliArgs.dryRun;
60
- if (cliArgs.model !== undefined) protokollCliArgs.model = cliArgs.model;
61
- if (cliArgs.transcriptionModel !== undefined) protokollCliArgs.transcriptionModel = cliArgs.transcriptionModel;
62
- if (cliArgs.reasoningLevel !== undefined) protokollCliArgs.reasoningLevel = cliArgs.reasoningLevel;
63
- if (cliArgs.overrides !== undefined) protokollCliArgs.overrides = cliArgs.overrides;
64
- if (cliArgs.contextDirectories !== undefined) protokollCliArgs.contextDirectories = cliArgs.contextDirectories;
65
- if (cliArgs.maxAudioSize !== undefined) {
66
- protokollCliArgs.maxAudioSize = typeof cliArgs.maxAudioSize === 'string' ? parseInt(cliArgs.maxAudioSize, 10) : cliArgs.maxAudioSize;
67
- }
68
- if (cliArgs.tempDirectory !== undefined) protokollCliArgs.tempDirectory = cliArgs.tempDirectory;
69
- if (cliArgs.processedDirectory !== undefined) protokollCliArgs.processedDirectory = cliArgs.processedDirectory;
70
- if (cliArgs.silent !== undefined) protokollCliArgs.silent = cliArgs.silent;
71
- // Merge configurations: Defaults -> File -> Dreadcabinet CLI -> Protokoll CLI (highest precedence)
72
- let mergedConfig = {
73
- ...PROTOKOLL_DEFAULTS,
74
- ...fileValues,
75
- ...dreadcabinetValues,
76
- ...protokollCliArgs
77
- };
78
- const secureConfig = {
79
- ...process.env.OPENAI_API_KEY !== undefined && {
80
- openaiApiKey: process.env.OPENAI_API_KEY
81
- }
82
- };
83
- // Convert maxAudioSize if it's a string AFTER merging
84
- if (typeof mergedConfig.maxAudioSize === 'string') {
85
- const parsedSize = parseInt(mergedConfig.maxAudioSize, 10);
86
- if (!isNaN(parsedSize)) {
87
- mergedConfig.maxAudioSize = parsedSize;
88
- } else {
89
- logger.warn(`Invalid maxAudioSize value detected after merge: '${mergedConfig.maxAudioSize}', using default: ${DEFAULT_MAX_AUDIO_SIZE}`);
90
- mergedConfig.maxAudioSize = DEFAULT_MAX_AUDIO_SIZE; // Use Protokoll default if parsing fails
91
- }
92
- } else if (mergedConfig.maxAudioSize === undefined) {
93
- // If still undefined after all merges, apply Protokoll default
94
- mergedConfig.maxAudioSize = DEFAULT_MAX_AUDIO_SIZE;
95
- }
96
- // Apply Dreadcabinet defaults
97
- mergedConfig = dreadcabinet.applyDefaults(mergedConfig);
98
- const config = mergedConfig;
99
- // Validate Dreadcabinet final config
100
- dreadcabinet.validate(config);
101
- // Validate Protokoll final config
102
- await validateConfig(config);
103
- await validateSecureConfig(secureConfig);
104
- logger.debug('Final configuration: %s', JSON.stringify(config, null, 2));
105
- return [
106
- config,
107
- secureConfig
108
- ];
109
- };
110
- async function validateSecureConfig(config) {
111
- const logger = getLogger();
112
- if (!config.openaiApiKey) {
113
- config.openaiApiKey = process.env.OPENAI_API_KEY;
114
- if (!config.openaiApiKey) {
115
- throw new Error('OpenAI API key is required. Provide it via CLI (--openai-api-key), config file, or OPENAI_API_KEY environment variable.');
116
- }
117
- logger.debug("Using OpenAI API key from environment variable.");
118
- }
119
- }
120
- async function validateConfig(config) {
121
- const logger = getLogger();
122
- // Validate that models are provided (but don't restrict to specific allowlist)
123
- validateModelPresence(config.model, true, 'model');
124
- validateModelPresence(config.transcriptionModel, true, 'transcriptionModel');
125
- if (config.contextDirectories && config.contextDirectories.length > 0) {
126
- await validateContextDirectories(config.contextDirectories);
127
- } else {
128
- logger.debug("No context directories provided.");
129
- config.contextDirectories = [];
130
- }
131
- if (config.tempDirectory) {
132
- await validateTempDirectory(config.tempDirectory);
133
- } else {
134
- throw new Error('Temp directory is required.');
135
- }
136
- if (typeof config.maxAudioSize !== 'number' || config.maxAudioSize <= 0) {
137
- throw new Error(`Invalid maxAudioSize: ${config.maxAudioSize}. Must be a positive number.`);
138
- }
139
- logger.debug("Final configuration validated successfully.");
140
- }
141
- function validateModelPresence(model, required, modelOptionName) {
142
- const logger = getLogger();
143
- logger.debug(`Validating model presence for ${modelOptionName}: ${model} (Required: ${required})`);
144
- if (!model) {
145
- throw new Error(`Model for ${modelOptionName} is required`);
146
- }
147
- if (model && model.trim() === '') {
148
- throw new Error(`Model for ${modelOptionName} cannot be empty`);
149
- }
150
- // Note: We no longer validate against a static allowlist
151
- // The actual model validation will happen when the API call is made
152
- // This allows for dynamic model discovery and future model additions
153
- }
154
- async function validateContextDirectories(contextDirectories) {
155
- const logger = getLogger();
156
- logger.debug(`Validating context directories: ${contextDirectories.join(', ')}`);
157
- const storage = create({
158
- log: logger.info.bind(logger)
159
- });
160
- for (const directory of contextDirectories){
161
- if (!await storage.isDirectoryReadable(directory)) {
162
- throw new Error(`Context directory does not exist or is not readable: ${directory}`);
163
- }
164
- }
165
- }
166
- async function validateTempDirectory(tempDirectory) {
167
- const logger = getLogger();
168
- logger.debug(`Validating temp directory: ${tempDirectory}`);
169
- const storage = create({
170
- log: logger.info.bind(logger)
171
- });
172
- if (!await storage.isDirectoryWritable(tempDirectory)) {
173
- throw new Error(`Temp directory does not exist or is not writable: ${tempDirectory}`);
174
- }
175
- }
176
-
177
- export { configure };
178
- //# sourceMappingURL=arguments.js.map