@redaksjon/protokoll-engine 0.1.1-dev.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.
Files changed (240) hide show
  1. package/README.md +47 -0
  2. package/dist/agentic/executor.d.ts +21 -0
  3. package/dist/agentic/executor.d.ts.map +1 -0
  4. package/dist/agentic/index.d.ts +27 -0
  5. package/dist/agentic/index.d.ts.map +1 -0
  6. package/dist/agentic/registry.d.ts +11 -0
  7. package/dist/agentic/registry.d.ts.map +1 -0
  8. package/dist/agentic/tools/lookup-person.d.ts +3 -0
  9. package/dist/agentic/tools/lookup-person.d.ts.map +1 -0
  10. package/dist/agentic/tools/lookup-project.d.ts +3 -0
  11. package/dist/agentic/tools/lookup-project.d.ts.map +1 -0
  12. package/dist/agentic/tools/route-note.d.ts +3 -0
  13. package/dist/agentic/tools/route-note.d.ts.map +1 -0
  14. package/dist/agentic/tools/store-context.d.ts +3 -0
  15. package/dist/agentic/tools/store-context.d.ts.map +1 -0
  16. package/dist/agentic/tools/verify-spelling.d.ts +3 -0
  17. package/dist/agentic/tools/verify-spelling.d.ts.map +1 -0
  18. package/dist/agentic/types.d.ts +110 -0
  19. package/dist/agentic/types.d.ts.map +1 -0
  20. package/dist/constants.d.ts +98 -0
  21. package/dist/constants.d.ts.map +1 -0
  22. package/dist/feedback/analyzer.d.ts +13 -0
  23. package/dist/feedback/analyzer.d.ts.map +1 -0
  24. package/dist/feedback/decision-tracker.d.ts +14 -0
  25. package/dist/feedback/decision-tracker.d.ts.map +1 -0
  26. package/dist/feedback/handler.d.ts +14 -0
  27. package/dist/feedback/handler.d.ts.map +1 -0
  28. package/dist/feedback/index.d.ts +12 -0
  29. package/dist/feedback/index.d.ts.map +1 -0
  30. package/dist/feedback/types.d.ts +72 -0
  31. package/dist/feedback/types.d.ts.map +1 -0
  32. package/dist/index.d.ts +24 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +32 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/index10.js +4 -0
  37. package/dist/index10.js.map +1 -0
  38. package/dist/index11.js +22 -0
  39. package/dist/index11.js.map +1 -0
  40. package/dist/index12.js +125 -0
  41. package/dist/index12.js.map +1 -0
  42. package/dist/index13.js +124 -0
  43. package/dist/index13.js.map +1 -0
  44. package/dist/index14.js +296 -0
  45. package/dist/index14.js.map +1 -0
  46. package/dist/index15.js +100 -0
  47. package/dist/index15.js.map +1 -0
  48. package/dist/index16.js +107 -0
  49. package/dist/index16.js.map +1 -0
  50. package/dist/index17.js +185 -0
  51. package/dist/index17.js.map +1 -0
  52. package/dist/index18.js +53 -0
  53. package/dist/index18.js.map +1 -0
  54. package/dist/index19.js +19 -0
  55. package/dist/index19.js.map +1 -0
  56. package/dist/index2.js +33 -0
  57. package/dist/index2.js.map +1 -0
  58. package/dist/index20.js +105 -0
  59. package/dist/index20.js.map +1 -0
  60. package/dist/index21.js +26 -0
  61. package/dist/index21.js.map +1 -0
  62. package/dist/index22.js +49 -0
  63. package/dist/index22.js.map +1 -0
  64. package/dist/index23.js +119 -0
  65. package/dist/index23.js.map +1 -0
  66. package/dist/index24.js +330 -0
  67. package/dist/index24.js.map +1 -0
  68. package/dist/index25.js +57 -0
  69. package/dist/index25.js.map +1 -0
  70. package/dist/index26.js +38 -0
  71. package/dist/index26.js.map +1 -0
  72. package/dist/index27.js +127 -0
  73. package/dist/index27.js.map +1 -0
  74. package/dist/index28.js +157 -0
  75. package/dist/index28.js.map +1 -0
  76. package/dist/index29.js +163 -0
  77. package/dist/index29.js.map +1 -0
  78. package/dist/index3.js +36 -0
  79. package/dist/index3.js.map +1 -0
  80. package/dist/index30.js +173 -0
  81. package/dist/index30.js.map +1 -0
  82. package/dist/index31.js +423 -0
  83. package/dist/index31.js.map +1 -0
  84. package/dist/index32.js +161 -0
  85. package/dist/index32.js.map +1 -0
  86. package/dist/index33.js +152 -0
  87. package/dist/index33.js.map +1 -0
  88. package/dist/index34.js +56 -0
  89. package/dist/index34.js.map +1 -0
  90. package/dist/index35.js +103 -0
  91. package/dist/index35.js.map +1 -0
  92. package/dist/index36.js +451 -0
  93. package/dist/index36.js.map +1 -0
  94. package/dist/index37.js +431 -0
  95. package/dist/index37.js.map +1 -0
  96. package/dist/index38.js +87 -0
  97. package/dist/index38.js.map +1 -0
  98. package/dist/index39.js +122 -0
  99. package/dist/index39.js.map +1 -0
  100. package/dist/index4.js +3 -0
  101. package/dist/index4.js.map +1 -0
  102. package/dist/index40.js +299 -0
  103. package/dist/index40.js.map +1 -0
  104. package/dist/index41.js +49 -0
  105. package/dist/index41.js.map +1 -0
  106. package/dist/index42.js +151 -0
  107. package/dist/index42.js.map +1 -0
  108. package/dist/index43.js +226 -0
  109. package/dist/index43.js.map +1 -0
  110. package/dist/index44.js +49 -0
  111. package/dist/index44.js.map +1 -0
  112. package/dist/index45.js +45 -0
  113. package/dist/index45.js.map +1 -0
  114. package/dist/index46.js +37 -0
  115. package/dist/index46.js.map +1 -0
  116. package/dist/index47.js +51 -0
  117. package/dist/index47.js.map +1 -0
  118. package/dist/index48.js +39 -0
  119. package/dist/index48.js.map +1 -0
  120. package/dist/index49.js +239 -0
  121. package/dist/index49.js.map +1 -0
  122. package/dist/index5.js +17 -0
  123. package/dist/index5.js.map +1 -0
  124. package/dist/index50.js +163 -0
  125. package/dist/index50.js.map +1 -0
  126. package/dist/index51.js +81 -0
  127. package/dist/index51.js.map +1 -0
  128. package/dist/index52.js +78 -0
  129. package/dist/index52.js.map +1 -0
  130. package/dist/index53.js +22 -0
  131. package/dist/index53.js.map +1 -0
  132. package/dist/index54.js +8 -0
  133. package/dist/index54.js.map +1 -0
  134. package/dist/index55.js +8 -0
  135. package/dist/index55.js.map +1 -0
  136. package/dist/index56.js +17 -0
  137. package/dist/index56.js.map +1 -0
  138. package/dist/index57.js +4 -0
  139. package/dist/index57.js.map +1 -0
  140. package/dist/index58.js +17 -0
  141. package/dist/index58.js.map +1 -0
  142. package/dist/index59.js +4 -0
  143. package/dist/index59.js.map +1 -0
  144. package/dist/index6.js +22 -0
  145. package/dist/index6.js.map +1 -0
  146. package/dist/index60.js +6 -0
  147. package/dist/index60.js.map +1 -0
  148. package/dist/index7.js +27 -0
  149. package/dist/index7.js.map +1 -0
  150. package/dist/index8.js +22 -0
  151. package/dist/index8.js.map +1 -0
  152. package/dist/index9.js +5 -0
  153. package/dist/index9.js.map +1 -0
  154. package/dist/logging.d.ts +7 -0
  155. package/dist/logging.d.ts.map +1 -0
  156. package/dist/output/index.d.ts +15 -0
  157. package/dist/output/index.d.ts.map +1 -0
  158. package/dist/phases/complete.d.ts +17 -0
  159. package/dist/phases/complete.d.ts.map +1 -0
  160. package/dist/phases/index.d.ts +5 -0
  161. package/dist/phases/index.d.ts.map +1 -0
  162. package/dist/phases/locate.d.ts +15 -0
  163. package/dist/phases/locate.d.ts.map +1 -0
  164. package/dist/phases/simple-replace.d.ts +72 -0
  165. package/dist/phases/simple-replace.d.ts.map +1 -0
  166. package/dist/phases/transcribe.d.ts +19 -0
  167. package/dist/phases/transcribe.d.ts.map +1 -0
  168. package/dist/pipeline/index.d.ts +10 -0
  169. package/dist/pipeline/index.d.ts.map +1 -0
  170. package/dist/pipeline/orchestrator.d.ts +13 -0
  171. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  172. package/dist/pipeline/types.d.ts +58 -0
  173. package/dist/pipeline/types.d.ts.map +1 -0
  174. package/dist/prompt/index.d.ts +3 -0
  175. package/dist/prompt/index.d.ts.map +1 -0
  176. package/dist/prompt/templates.d.ts +40 -0
  177. package/dist/prompt/templates.d.ts.map +1 -0
  178. package/dist/prompt/transcribe.d.ts +42 -0
  179. package/dist/prompt/transcribe.d.ts.map +1 -0
  180. package/dist/reasoning/client.d.ts +42 -0
  181. package/dist/reasoning/client.d.ts.map +1 -0
  182. package/dist/reasoning/index.d.ts +17 -0
  183. package/dist/reasoning/index.d.ts.map +1 -0
  184. package/dist/reasoning/strategy.d.ts +12 -0
  185. package/dist/reasoning/strategy.d.ts.map +1 -0
  186. package/dist/reasoning/types.d.ts +58 -0
  187. package/dist/reasoning/types.d.ts.map +1 -0
  188. package/dist/reflection/collector.d.ts +18 -0
  189. package/dist/reflection/collector.d.ts.map +1 -0
  190. package/dist/reflection/index.d.ts +13 -0
  191. package/dist/reflection/index.d.ts.map +1 -0
  192. package/dist/reflection/reporter.d.ts +10 -0
  193. package/dist/reflection/reporter.d.ts.map +1 -0
  194. package/dist/reflection/types.d.ts +99 -0
  195. package/dist/reflection/types.d.ts.map +1 -0
  196. package/dist/routing/classifier.d.ts +8 -0
  197. package/dist/routing/classifier.d.ts.map +1 -0
  198. package/dist/routing/index.d.ts +12 -0
  199. package/dist/routing/index.d.ts.map +1 -0
  200. package/dist/routing/router.d.ts +8 -0
  201. package/dist/routing/router.d.ts.map +1 -0
  202. package/dist/routing/types.d.ts +68 -0
  203. package/dist/routing/types.d.ts.map +1 -0
  204. package/dist/transcript/feedback.d.ts +70 -0
  205. package/dist/transcript/feedback.d.ts.map +1 -0
  206. package/dist/transcript/index.d.ts +10 -0
  207. package/dist/transcript/index.d.ts.map +1 -0
  208. package/dist/transcript/operations.d.ts +152 -0
  209. package/dist/transcript/operations.d.ts.map +1 -0
  210. package/dist/transcript/pkl-utils.d.ts +66 -0
  211. package/dist/transcript/pkl-utils.d.ts.map +1 -0
  212. package/dist/transcription/index.d.ts +17 -0
  213. package/dist/transcription/index.d.ts.map +1 -0
  214. package/dist/transcription/service.d.ts +10 -0
  215. package/dist/transcription/service.d.ts.map +1 -0
  216. package/dist/transcription/types.d.ts +41 -0
  217. package/dist/transcription/types.d.ts.map +1 -0
  218. package/dist/types.d.ts +28 -0
  219. package/dist/types.d.ts.map +1 -0
  220. package/dist/util/collision-detector.d.ts +77 -0
  221. package/dist/util/collision-detector.d.ts.map +1 -0
  222. package/dist/util/dates.d.ts +57 -0
  223. package/dist/util/dates.d.ts.map +1 -0
  224. package/dist/util/general.d.ts +3 -0
  225. package/dist/util/general.d.ts.map +1 -0
  226. package/dist/util/media.d.ts +9 -0
  227. package/dist/util/media.d.ts.map +1 -0
  228. package/dist/util/metadata.d.ts +138 -0
  229. package/dist/util/metadata.d.ts.map +1 -0
  230. package/dist/util/openai.d.ts +22 -0
  231. package/dist/util/openai.d.ts.map +1 -0
  232. package/dist/util/sounds-like-database.d.ts +98 -0
  233. package/dist/util/sounds-like-database.d.ts.map +1 -0
  234. package/dist/util/storage.d.ts +35 -0
  235. package/dist/util/storage.d.ts.map +1 -0
  236. package/dist/util/text-replacer.d.ts +56 -0
  237. package/dist/util/text-replacer.d.ts.map +1 -0
  238. package/dist/utils/entityFinder.d.ts +29 -0
  239. package/dist/utils/entityFinder.d.ts.map +1 -0
  240. package/package.json +84 -0
@@ -0,0 +1,72 @@
1
+ import { Config } from '../types';
2
+ /**
3
+ * Simple Replace Phase
4
+ *
5
+ * Performs intelligent, context-aware string replacement for entity correction.
6
+ * This phase runs after transcription and routing to correct entity names using
7
+ * sounds_like mappings from the protokoll context.
8
+ *
9
+ * Part of the simple-replace optimization (Phase 2).
10
+ */
11
+ import * as Dreadcabinet from '@utilarium/dreadcabinet';
12
+ /**
13
+ * Classification/routing information for context
14
+ */
15
+ export interface Classification {
16
+ project?: string;
17
+ confidence?: number;
18
+ [key: string]: any;
19
+ }
20
+ /**
21
+ * Statistics about the simple-replace phase
22
+ */
23
+ export interface SimpleReplaceStats {
24
+ /** Number of Tier 1 (always safe) replacements made */
25
+ tier1Replacements: number;
26
+ /** Number of Tier 2 (project-scoped) replacements made */
27
+ tier2Replacements: number;
28
+ /** Total replacements made */
29
+ totalReplacements: number;
30
+ /** Number of Tier 1 mappings considered */
31
+ tier1MappingsConsidered: number;
32
+ /** Number of Tier 2 mappings considered */
33
+ tier2MappingsConsidered: number;
34
+ /** Project context used (if any) */
35
+ projectContext?: string;
36
+ /** Classification confidence */
37
+ classificationConfidence?: number;
38
+ /** Processing time in milliseconds */
39
+ processingTimeMs: number;
40
+ /** Applied mappings details */
41
+ appliedMappings: Array<{
42
+ soundsLike: string;
43
+ correctText: string;
44
+ tier: number;
45
+ occurrences: number;
46
+ }>;
47
+ }
48
+ /**
49
+ * Result of the simple-replace phase
50
+ */
51
+ export interface SimpleReplaceResult {
52
+ /** The text after replacements */
53
+ text: string;
54
+ /** Statistics about the replacements */
55
+ stats: SimpleReplaceStats;
56
+ /** Whether any replacements were made */
57
+ replacementsMade: boolean;
58
+ }
59
+ /**
60
+ * Instance interface for simple-replace phase
61
+ */
62
+ export interface Instance {
63
+ /**
64
+ * Apply simple-replace to transcription text using routing context
65
+ */
66
+ replace(transcriptionText: string, classification: Classification, interimPath: string, hash: string): Promise<SimpleReplaceResult>;
67
+ }
68
+ /**
69
+ * Create a simple-replace phase instance
70
+ */
71
+ export declare const create: (config: Config, _operator: Dreadcabinet.Operator) => Instance;
72
+ //# sourceMappingURL=simple-replace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-replace.d.ts","sourceRoot":"","sources":["../../src/phases/simple-replace.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AASjC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,0DAA0D;IAC1D,iBAAiB,EAAE,MAAM,CAAC;IAE1B,8BAA8B;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,2CAA2C;IAC3C,uBAAuB,EAAE,MAAM,CAAC;IAEhC,2CAA2C;IAC3C,uBAAuB,EAAE,MAAM,CAAC;IAEhC,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gCAAgC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,sCAAsC;IACtC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,+BAA+B;IAC/B,eAAe,EAAE,KAAK,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;CACN;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IAEb,wCAAwC;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAE1B,yCAAyC;IACzC,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB;;OAEG;IACH,OAAO,CACH,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,EAAE,WAAW,YAAY,CAAC,QAAQ,KAAG,QAkNzE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Config } from '../types';
2
+ import * as Dreadcabinet from '@utilarium/dreadcabinet';
3
+ import * as Context from '@redaksjon/context';
4
+ import * as Routing from '../routing';
5
+ export interface Transcription {
6
+ text: string;
7
+ audioFileBasename: string;
8
+ toolsUsed?: string[];
9
+ agentIterations?: number;
10
+ }
11
+ export interface Instance {
12
+ transcribe: (creation: Date, outputPath: string, contextPath: string, interimPath: string, filename: string, hash: string, audioFile: string) => Promise<Transcription>;
13
+ }
14
+ export interface TranscribeDependencies {
15
+ contextInstance?: Context.ContextInstance;
16
+ routingInstance?: Routing.RoutingInstance;
17
+ }
18
+ export declare const create: (config: Config, operator: Dreadcabinet.Operator, deps?: TranscribeDependencies) => Instance;
19
+ //# sourceMappingURL=transcribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcribe.d.ts","sourceRoot":"","sources":["../../src/phases/transcribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AASjC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,QAAQ;IACrB,UAAU,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3K;AAED,MAAM,WAAW,sBAAsB;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;CAC7C;AAED,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,EAAE,UAAU,YAAY,CAAC,QAAQ,EAAE,OAAO,sBAAsB,KAAG,QAyNvG,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { PipelineInput, PipelineResult } from './types';
2
+ import * as Orchestrator from './orchestrator';
3
+ export interface PipelineInstance {
4
+ process(input: PipelineInput): Promise<PipelineResult>;
5
+ }
6
+ export type { OrchestratorConfig } from './orchestrator';
7
+ export declare const create: (config: Orchestrator.OrchestratorConfig) => Promise<PipelineInstance>;
8
+ export declare const DEFAULT_PIPELINE_CONFIG: Partial<Orchestrator.OrchestratorConfig>;
9
+ export * from './types';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,eAAO,MAAM,MAAM,GAAU,QAAQ,YAAY,CAAC,kBAAkB,KAAG,OAAO,CAAC,gBAAgB,CAE9F,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAa5E,CAAC;AAGF,cAAc,SAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PipelineConfig, PipelineInput, PipelineResult } from './types';
2
+ export interface OrchestratorInstance {
3
+ process(input: PipelineInput): Promise<PipelineResult>;
4
+ }
5
+ export interface OrchestratorConfig extends PipelineConfig {
6
+ outputDirectory: string;
7
+ outputStructure: string;
8
+ outputFilenameOptions: string[];
9
+ maxAudioSize: number;
10
+ tempDirectory: string;
11
+ }
12
+ export declare const create: (config: OrchestratorConfig) => Promise<OrchestratorInstance>;
13
+ //# sourceMappingURL=orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/pipeline/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAYvF,MAAM,WAAW,oBAAoB;IACjC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACtD,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,MAAM,GAAU,QAAQ,kBAAkB,KAAG,OAAO,CAAC,oBAAoB,CA+jBrF,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { ReflectionReport } from '../reflection/types';
2
+ export interface OutputPaths {
3
+ output: string;
4
+ final: string;
5
+ intermediate: {
6
+ [key: string]: string;
7
+ };
8
+ [key: string]: string | {
9
+ [key: string]: string;
10
+ };
11
+ }
12
+ export interface PipelineConfig {
13
+ model: string;
14
+ transcriptionModel: string;
15
+ reasoningLevel?: 'low' | 'medium' | 'high';
16
+ interactive: boolean;
17
+ selfReflection: boolean;
18
+ debug: boolean;
19
+ dryRun?: boolean;
20
+ silent?: boolean;
21
+ contextDirectory?: string;
22
+ /** Explicit context directories (from protokoll-config.yaml) */
23
+ contextDirectories?: string[];
24
+ intermediateDir: string;
25
+ keepIntermediates: boolean;
26
+ processedDirectory?: string;
27
+ }
28
+ export interface ProgressInfo {
29
+ current: number;
30
+ total: number;
31
+ }
32
+ export interface PipelineInput {
33
+ audioFile: string;
34
+ creation: Date;
35
+ hash: string;
36
+ progress?: ProgressInfo;
37
+ }
38
+ export interface PipelineResult {
39
+ outputPath: string;
40
+ enhancedText: string;
41
+ rawTranscript: string;
42
+ routedProject: string | null;
43
+ routingConfidence: number;
44
+ processingTime: number;
45
+ toolsUsed: string[];
46
+ correctionsApplied: number;
47
+ processedAudioPath?: string;
48
+ reflection?: ReflectionReport;
49
+ intermediatePaths?: OutputPaths;
50
+ }
51
+ export interface PipelineState {
52
+ input: PipelineInput;
53
+ rawTranscript?: string;
54
+ enhancedText?: string;
55
+ routedDestination?: string;
56
+ startTime: Date;
57
+ }
58
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pipeline/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,MAAM,WAAW,cAAc;IAE3B,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAG3C,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAE3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAGrB,aAAa,EAAE,MAAM,CAAC;IAGtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAG1B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B,iBAAiB,CAAC,EAAE,WAAW,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ export * from './transcribe';
2
+ export * from './templates';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { TemplateConfig } from '@kjerneverk/riotprompt';
2
+ /**
3
+ * Available transcription templates
4
+ */
5
+ export declare const TEMPLATES: Record<string, TemplateConfig>;
6
+ /**
7
+ * Initialize templates by registering them with RiotPrompt
8
+ * Should be called once at application startup
9
+ */
10
+ export declare const initializeTemplates: () => void;
11
+ /**
12
+ * Get list of available template names
13
+ */
14
+ export declare const getTemplateNames: () => string[];
15
+ /**
16
+ * Clear all registered templates
17
+ * Useful for testing or reinitialization
18
+ */
19
+ export declare const clearAllTemplates: () => void;
20
+ /**
21
+ * Auto-select appropriate template based on transcript content
22
+ *
23
+ * @param transcriptText - The transcript text to analyze
24
+ * @param hints - Optional hints about the transcript type
25
+ * @returns Template name to use
26
+ */
27
+ export declare const selectTemplate: (transcriptText: string, hints?: {
28
+ isMeeting?: boolean;
29
+ isTechnical?: boolean;
30
+ isQuick?: boolean;
31
+ isInterview?: boolean;
32
+ }) => string;
33
+ /**
34
+ * Get template configuration by name
35
+ *
36
+ * @param name - Template name
37
+ * @returns Template configuration or undefined if not found
38
+ */
39
+ export declare const getTemplate: (name: string) => TemplateConfig | undefined;
40
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/prompt/templates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAoFpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,IAEtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,MAAM,EAEzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,IAEpC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACvB,gBAAgB,MAAM,EACtB,QAAQ;IACJ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,KACF,MA8CF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,cAAc,GAAG,SAG3D,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { Prompt } from '@kjerneverk/riotprompt';
2
+ import { Config } from '../types';
3
+ export type { Prompt };
4
+ /**
5
+ * Creates a prompt for the transcription formatting task.
6
+ *
7
+ * Uses RiotPrompt's cook() API for declarative prompt construction with templates.
8
+ *
9
+ * NOTE: Context is NOT loaded into the prompt. Instead, the agentic executor
10
+ * provides tools for the model to query context on-demand. This is the
11
+ * agentic approach - the model investigates what it needs rather than
12
+ * receiving everything upfront.
13
+ *
14
+ * @param transcriptionText - The raw transcript text
15
+ * @param _config - Protokoll configuration
16
+ * @param options - Optional configuration for template selection
17
+ * @returns Cooked prompt ready for the model
18
+ */
19
+ export declare const createTranscribePrompt: (transcriptionText: string, _config: Config, options?: {
20
+ template?: string;
21
+ autoSelectTemplate?: boolean;
22
+ templateHints?: {
23
+ isMeeting?: boolean;
24
+ isTechnical?: boolean;
25
+ isQuick?: boolean;
26
+ isInterview?: boolean;
27
+ };
28
+ }) => Promise<Prompt>;
29
+ /**
30
+ * Factory interface for transcribe prompts
31
+ */
32
+ export interface Factory {
33
+ createTranscribePrompt: (transcriptionText: string) => Promise<Prompt>;
34
+ }
35
+ /**
36
+ * Create a factory for transcribe prompts
37
+ *
38
+ * @param _model - Model parameter (unused, preserved for API compatibility)
39
+ * @param config - Protokoll configuration
40
+ */
41
+ export declare const create: (_model: unknown, config: Config) => Factory;
42
+ //# sourceMappingURL=transcribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcribe.d.ts","sourceRoot":"","sources":["../../src/prompt/transcribe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAYjC,YAAY,EAAE,MAAM,EAAE,CAAC;AAEvB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAC/B,mBAAmB,MAAM,EACzB,SAAS,MAAM,EACf,UAAU;IACN,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE;QACZ,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,WAAW,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACL,KACF,OAAO,CAAC,MAAM,CA0ChB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,OAAO;IACpB,sBAAsB,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1E;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,OAAO,EAAE,QAAQ,MAAM,KAAG,OAMxD,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { ReasoningConfig, ReasoningRequest, ReasoningResponse } from './types';
2
+ export interface ToolCallRequest {
3
+ messages: Array<{
4
+ role: 'system' | 'user' | 'assistant' | 'tool';
5
+ content: string;
6
+ tool_call_id?: string;
7
+ tool_calls?: Array<{
8
+ id: string;
9
+ function: {
10
+ name: string;
11
+ arguments: string;
12
+ };
13
+ }>;
14
+ }>;
15
+ tools?: Array<{
16
+ type: 'function';
17
+ function: {
18
+ name: string;
19
+ description: string;
20
+ parameters: Record<string, unknown>;
21
+ };
22
+ }>;
23
+ }
24
+ export interface ToolCallResponse {
25
+ content: string;
26
+ tool_calls?: Array<{
27
+ id: string;
28
+ function: {
29
+ name: string;
30
+ arguments: string;
31
+ };
32
+ }>;
33
+ finish_reason?: string;
34
+ }
35
+ export interface ClientInstance {
36
+ complete(request: ReasoningRequest): Promise<ReasoningResponse>;
37
+ completeWithTools(request: ToolCallRequest): Promise<ToolCallResponse>;
38
+ isReasoningModel(model: string): boolean;
39
+ getModelFamily(model: string): 'openai' | 'anthropic' | 'gemini' | 'unknown';
40
+ }
41
+ export declare const create: (config: ReasoningConfig) => ClientInstance;
42
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":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,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACzC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;CAChF;AAED,eAAO,MAAM,MAAM,GAAI,QAAQ,eAAe,KAAG,cAmNhD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ReasoningConfig, ReasoningRequest, ReasoningResponse, ReasoningMetrics } from './types';
2
+ import * as Client from './client';
3
+ import * as Strategy from './strategy';
4
+ export interface ReasoningInstance {
5
+ complete(request: ReasoningRequest): Promise<ReasoningResponse>;
6
+ completeWithTools(request: Client.ToolCallRequest): Promise<Client.ToolCallResponse>;
7
+ executeWithStrategy(request: ReasoningRequest, strategyType: Strategy.TranscriptionStrategy): Promise<ReasoningResponse & {
8
+ metrics: ReasoningMetrics;
9
+ }>;
10
+ isReasoningModel(model: string): boolean;
11
+ getModelFamily(model: string): 'openai' | 'anthropic' | 'gemini' | 'unknown';
12
+ getRecommendedStrategy(transcriptLength: number, hasUnknownNames: boolean, complexity: 'low' | 'medium' | 'high'): Strategy.TranscriptionStrategy;
13
+ }
14
+ export declare const create: (config: ReasoningConfig) => ReasoningInstance;
15
+ export * from './types';
16
+ export type { TranscriptionStrategy, StrategyConfig } from './strategy';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reasoning/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAE9B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAGhE,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAGrF,mBAAmB,CACf,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,QAAQ,CAAC,qBAAqB,GAC7C,OAAO,CAAC,iBAAiB,GAAG;QAAE,OAAO,EAAE,gBAAgB,CAAA;KAAE,CAAC,CAAC;IAG9D,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACzC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IAG7E,sBAAsB,CAClB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,OAAO,EACxB,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GACtC,QAAQ,CAAC,qBAAqB,CAAC;CACrC;AAED,eAAO,MAAM,MAAM,GAAI,QAAQ,eAAe,KAAG,iBAiChD,CAAC;AAGF,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { IterationStrategy } from '@kjerneverk/riotprompt';
2
+ import { ReasoningLevel } from './types';
3
+ export type TranscriptionStrategy = 'simple' | 'investigate-then-respond' | 'multi-pass' | 'adaptive';
4
+ export interface StrategyConfig {
5
+ type: TranscriptionStrategy;
6
+ maxIterations?: number;
7
+ requireMinimumTools?: number;
8
+ reasoningLevel?: ReasoningLevel;
9
+ }
10
+ export declare const createStrategy: (config: StrategyConfig) => IterationStrategy;
11
+ export declare const getRecommendedStrategy: (transcriptLength: number, hasUnknownNames: boolean, complexity: "low" | "medium" | "high") => TranscriptionStrategy;
12
+ //# sourceMappingURL=strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../src/reasoning/strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,qBAAqB,GAC3B,QAAQ,GACR,0BAA0B,GAC1B,YAAY,GACZ,UAAU,CAAC;AAEjB,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC;AAED,eAAO,MAAM,cAAc,GAAI,QAAQ,cAAc,KAAG,iBA6BvD,CAAC;AAYF,eAAO,MAAM,sBAAsB,GAC/B,kBAAkB,MAAM,EACxB,iBAAiB,OAAO,EACxB,YAAY,KAAK,GAAG,QAAQ,GAAG,MAAM,KACtC,qBAaF,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Reasoning System Types
3
+ *
4
+ * Configuration and types for reasoning model integration.
5
+ * Uses riotprompt for prompt building and execution.
6
+ */
7
+ export type ReasoningModel = 'claude-3-5-sonnet' | 'claude-3-opus' | 'claude-4' | 'gpt-4o' | 'gpt-4o-mini' | 'gpt-4-turbo' | 'gpt-5' | 'gpt-5-nano' | 'gpt-5-mini' | 'gpt-5.1' | 'gpt-5.2' | 'o1' | 'o1-mini' | 'o3' | 'o3-mini' | string;
8
+ export type ReasoningLevel = 'none' | 'low' | 'medium' | 'high';
9
+ export interface ReasoningConfig {
10
+ model: ReasoningModel;
11
+ reasoningLevel?: ReasoningLevel;
12
+ maxTokens?: number;
13
+ temperature?: number;
14
+ apiKey?: string;
15
+ provider?: 'openai' | 'anthropic' | 'gemini' | 'auto';
16
+ }
17
+ export interface ReasoningRequest {
18
+ prompt: string;
19
+ systemPrompt?: string;
20
+ context?: string[];
21
+ maxIterations?: number;
22
+ tools?: ToolDefinition[];
23
+ }
24
+ export interface ToolCall {
25
+ id: string;
26
+ name: string;
27
+ arguments: Record<string, unknown>;
28
+ }
29
+ export interface ToolDefinition {
30
+ name: string;
31
+ description: string;
32
+ parameters: Record<string, unknown>;
33
+ }
34
+ export interface ReasoningResponse {
35
+ content: string;
36
+ model: string;
37
+ usage?: {
38
+ promptTokens: number;
39
+ completionTokens: number;
40
+ totalTokens: number;
41
+ };
42
+ toolCalls?: ToolCall[];
43
+ finishReason?: string;
44
+ duration?: number;
45
+ }
46
+ export interface ReasoningMetrics {
47
+ iterations: number;
48
+ toolCallsExecuted: number;
49
+ totalDuration: number;
50
+ tokensUsed: number;
51
+ }
52
+ export interface ModelSettings {
53
+ maxTokens: number;
54
+ supportsTools: boolean;
55
+ reasoningLevel?: boolean;
56
+ }
57
+ export declare const REASONING_MODELS: Record<string, ModelSettings>;
58
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/reasoning/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,MAAM,MAAM,cAAc,GACpB,mBAAmB,GACnB,eAAe,GACf,UAAU,GACV,QAAQ,GACR,aAAa,GACb,aAAa,GACb,OAAO,GACP,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,SAAS,GACT,IAAI,GACJ,SAAS,GACT,IAAI,GACJ,SAAS,GACT,MAAM,CAAC;AAEb,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,cAAc,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;CACzD;AAED,MAAM,WA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ptionMetrics, ToolEffectiveness, ContextChange, RoutingDecisionRecord } from './types';
2
+ export interface CollectorInstance {
3
+ start(): void;
4
+ recordWhisper(duration: number): void;
5
+ recordToolCall(name: string, duration: number, success: boolean): void;
6
+ recordCorrection(original: string, corrected: string): void;
7
+ recordUnknownEntity(entity: string): void;
8
+ recordResolvedEntity(entity: string, resolved: string): void;
9
+ recordModelResponse(model: string, tokens: number): void;
10
+ recordContextChange(change: ContextChange): void;
11
+ recordRoutingDecision(decision: RoutingDecisionRecord): void;
12
+ getMetrics(): TranscriptionMetrics;
13
+ getToolEffectiveness(): ToolEffectiveness[];
14
+ getContextChanges(): ContextChange[];
15
+ getRoutingDecision(): RoutingDecisionRecord | undefined;
16
+ }
17
+ export declare const create: () => CollectorInstance;
18
+ //# sourceMappingURL=collector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/reflection/collector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGxG,MAAM,WAAW,iBAAiB;IAC9B,KAAK,IAAI,IAAI,CAAC;IACd,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACvE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5D,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7D,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IACjD,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC7D,UAAU,IAAI,oBAAoB,CAAC;IACnC,oBAAoB,IAAI,iBAAiB,EAAE,CAAC;IAC5C,iBAAiB,IAAI,aAAa,EAAE,CAAC;IACrC,kBAAkB,IAAI,qBAAqB,GAAG,SAAS,CAAC;CAC3D;AAQD,eAAO,MAAM,MAAM,QAAO,iBAoIzB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ReflectionConfig, ReflectionReport } from './types';
2
+ import * as Collector from './collector';
3
+ import * as Reporter from './reporter';
4
+ export interface ReflectionInstance {
5
+ collector: Collector.CollectorInstance;
6
+ reporter: Reporter.ReporterInstance;
7
+ generate(audioFile: string, outputFile: string, conversationHistory?: unknown[], output?: string): ReflectionReport;
8
+ save(report: ReflectionReport, path: string): Promise<void>;
9
+ }
10
+ export declare const create: (config: ReflectionConfig) => ReflectionInstance;
11
+ export declare const DEFAULT_REFLECTION_CONFIG: ReflectionConfig;
12
+ export * from './types';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reflection/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC;IACvC,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IACpC,QAAQ,CACJ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAC/B,MAAM,CAAC,EAAE,MAAM,GAChB,gBAAgB,CAAC;IACpB,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,MAAM,GAAI,QAAQ,gBAAgB,KAAG,kBAWjD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,gBAKvC,CAAC;AAGF,cAAc,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ReflectionReport, ReflectionConfig } from './types';
2
+ import * as Collector from './collector';
3
+ export interface ReporterInstance {
4
+ generate(collector: Collector.CollectorInstance, audioFile: string, outputFile: string, conversationHistory?: unknown[], output?: string): ReflectionReport;
5
+ formatMarkdown(report: ReflectionReport): string;
6
+ formatJson(report: ReflectionReport): string;
7
+ save(report: ReflectionReport, path: string): Promise<void>;
8
+ }
9
+ export declare const create: (config: ReflectionConfig) => ReporterInstance;
10
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/reflection/reporter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAKnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAIzC,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CACJ,SAAS,EAAE,SAAS,CAAC,iBAAiB,EACtC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAC/B,MAAM,CAAC,EAAE,MAAM,GAChB,gBAAgB,CAAC;IAEpB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACjD,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAAC;IAC7C,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,MAAM,GAAI,QAAQ,gBAAgB,KAAG,gBAgSjD,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Self-Reflection Types
3
+ *
4
+ * Types for tracking and reporting on transcription quality and tool effectiveness.
5
+ */
6
+ export interface TranscriptionMetrics {
7
+ startTime: Date;
8
+ endTime: Date;
9
+ totalDuration: number;
10
+ whisperDuration: number;
11
+ reasoningDuration: number;
12
+ iterations: number;
13
+ toolCallsExecuted: number;
14
+ toolsUsed: string[];
15
+ originalLength: number;
16
+ correctedLength: number;
17
+ correctionsApplied: number;
18
+ unknownEntitiesFound: number;
19
+ entitiesResolved: number;
20
+ model: string;
21
+ tokensUsed: number;
22
+ }
23
+ export interface ToolEffectiveness {
24
+ name: string;
25
+ callCount: number;
26
+ successCount: number;
27
+ failureCount: number;
28
+ avgDuration: number;
29
+ successRate: number;
30
+ }
31
+ export interface QualityAssessment {
32
+ confidence: number;
33
+ nameAccuracy: number;
34
+ routingConfidence: number;
35
+ contentPreservation: number;
36
+ overallScore: number;
37
+ }
38
+ export interface Recommendation {
39
+ type: 'tool-issue' | 'context-gap' | 'performance' | 'quality';
40
+ severity: 'high' | 'medium' | 'low';
41
+ message: string;
42
+ suggestion?: string;
43
+ }
44
+ export interface ContextChange {
45
+ entityType: 'person' | 'project' | 'company' | 'term' | 'ignored';
46
+ entityId: string;
47
+ entityName: string;
48
+ action: 'created' | 'updated';
49
+ details?: Record<string, unknown>;
50
+ }
51
+ export interface RoutingDecisionRecord {
52
+ projectId: string | null;
53
+ destination: string;
54
+ confidence: number;
55
+ reasoning: string;
56
+ signals: Array<{
57
+ type: string;
58
+ value: string;
59
+ weight: number;
60
+ source?: string;
61
+ }>;
62
+ alternativesConsidered?: Array<{
63
+ projectId: string;
64
+ confidence: number;
65
+ whyNotChosen: string;
66
+ }>;
67
+ userConfirmed?: boolean;
68
+ feedbackProvided?: boolean;
69
+ feedbackCorrection?: string;
70
+ }
71
+ export interface ReflectionReport {
72
+ id: string;
73
+ generated: Date;
74
+ audioFile: string;
75
+ outputFile: string;
76
+ summary: {
77
+ duration: number;
78
+ iterations: number;
79
+ toolCalls: number;
80
+ corrections: number;
81
+ confidence: number;
82
+ };
83
+ metrics: TranscriptionMetrics;
84
+ toolEffectiveness: ToolEffectiveness[];
85
+ quality: QualityAssessment;
86
+ recommendations: Recommendation[];
87
+ routingDecision?: RoutingDecisionRecord;
88
+ contextChanges?: ContextChange[];
89
+ conversationHistory?: unknown[];
90
+ output?: string;
91
+ }
92
+ export interface ReflectionConfig {
93
+ enabled: boolean;
94
+ outputPath?: string;
95
+ format: 'markdown' | 'json';
96
+ includeConversation: boolean;
97
+ includeOutput: boolean;
98
+ }
99
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/reflection/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IAEjC,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAC;IAGpB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IAGzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,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C,CAAC;IAGH,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IAGnB,OAAO,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;IAGF,OAAO,EAAE,oBAAoB,CAAC;IAG9B,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;IAGvC,OAAO,EAAE,iBAAiB,CAAC;IAG3B,eAAe,EAAE,cAAc,EAAE,CAAC;IAGlC,eAAe,CAAC,EAAE,qBAAqB,CAAC;IAGxC,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IAGjC,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC;IAGhC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CAC1B"}
@@ -0,0 +1,8 @@
1
+ import { ClassificationResult, ClassificationSignal, ProjectRoute, RoutingContext } from './types';
2
+ import * as Context from '@redaksjon/context';
3
+ export interface ClassifierInstance {
4
+ classify(context: RoutingContext, routes: ProjectRoute[]): ClassificationResult[];
5
+ calculateConfidence(signals: ClassificationSignal[]): number;
6
+ }
7
+ export declare const create: (contextInstance: Context.ContextInstance) => ClassifierInstance;
8
+ //# sourceMappingURL=classifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classifier.d.ts","sourceRoot":"","sources":["../../src/routing/classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACH,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAClF,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;CAChE;AAED,eAAO,MAAM,MAAM,GAAI,iBAAiB,OAAO,CAAC,eAAe,KAAG,kBAiIjE,CAAC"}