@remnic/core 9.3.641 → 9.3.642

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.
@@ -0,0 +1,130 @@
1
+ export type LocalSessionRole = "user" | "assistant" | "tool" | "system" | "other";
2
+
3
+ export interface LocalSessionTurn {
4
+ role: LocalSessionRole;
5
+ content: string;
6
+ timestamp?: string;
7
+ sessionKey?: string;
8
+ sourceId?: string;
9
+ metadata?: Record<string, unknown>;
10
+ }
11
+
12
+ export interface LocalSessionParseWarning {
13
+ code: string;
14
+ message: string;
15
+ fileRef?: string;
16
+ line?: number;
17
+ }
18
+
19
+ export interface LocalSessionParsedFile {
20
+ turns: LocalSessionTurn[];
21
+ warnings: LocalSessionParseWarning[];
22
+ }
23
+
24
+ export interface LocalSessionAdapterInput {
25
+ content: string;
26
+ fileName: string;
27
+ fileExtension: string;
28
+ fileRef: string;
29
+ }
30
+
31
+ export interface LocalSessionAdapterOptions {
32
+ strict?: boolean;
33
+ }
34
+
35
+ export interface LocalSessionSourceAdapter {
36
+ id: string;
37
+ parseFile(
38
+ input: LocalSessionAdapterInput,
39
+ options?: LocalSessionAdapterOptions
40
+ ): LocalSessionParsedFile | Promise<LocalSessionParsedFile>;
41
+ }
42
+
43
+ export interface RedactionRuleConfig {
44
+ name: string;
45
+ pattern: string;
46
+ flags?: string;
47
+ replacement?: string;
48
+ }
49
+
50
+ export interface RedactionConfig {
51
+ disableDefaults?: boolean;
52
+ rules?: RedactionRuleConfig[];
53
+ }
54
+
55
+ export interface CompiledRedactionRule {
56
+ name: string;
57
+ pattern: RegExp;
58
+ replacement: string;
59
+ }
60
+
61
+ export interface RedactionReport {
62
+ applied: number;
63
+ ruleNames: string[];
64
+ }
65
+
66
+ export interface SessionSummaryExcerpt {
67
+ role: LocalSessionRole;
68
+ text: string;
69
+ timestamp?: string;
70
+ }
71
+
72
+ export interface SessionSummaryDraft {
73
+ schemaVersion: 1;
74
+ draftId: string;
75
+ generatedAt: string;
76
+ sourceAdapter: string;
77
+ sourceSessionRef: string;
78
+ sourceFileCount: number;
79
+ sourceFileRefs: Array<{
80
+ hash: string;
81
+ extension: string;
82
+ }>;
83
+ firstTimestamp?: string;
84
+ lastTimestamp?: string;
85
+ turnCount: number;
86
+ roles: Record<LocalSessionRole, number>;
87
+ summary: string;
88
+ redaction: {
89
+ enabled: boolean;
90
+ applied: number;
91
+ ruleNames: string[];
92
+ };
93
+ excerpts?: SessionSummaryExcerpt[];
94
+ metadata: {
95
+ storesRawTranscript: false;
96
+ storesLocalPaths: false;
97
+ storesSourceSessionKey: false;
98
+ };
99
+ }
100
+
101
+ export interface CollectLocalSessionSummariesOptions {
102
+ inputDir: string;
103
+ source?: string;
104
+ strict?: boolean;
105
+ redactionConfig?: RedactionConfig;
106
+ includeRedactedExcerpts?: boolean;
107
+ maxFiles?: number;
108
+ maxSessions?: number;
109
+ now?: Date;
110
+ }
111
+
112
+ export interface LocalSessionSummaryReport {
113
+ generatedAt: string;
114
+ source: string;
115
+ filesScanned: number;
116
+ filesParsed: number;
117
+ turnsParsed: number;
118
+ sessionsSummarized: number;
119
+ warnings: LocalSessionParseWarning[];
120
+ drafts: SessionSummaryDraft[];
121
+ wroteFiles: string[];
122
+ }
123
+
124
+ export interface LocalSessionSummaryCliOptions extends CollectLocalSessionSummariesOptions {
125
+ memoryDir?: string;
126
+ output?: string;
127
+ write?: boolean;
128
+ redactionConfigPath?: string;
129
+ stdout?: Pick<NodeJS.WritableStream, "write">;
130
+ }