@kybernesis/brain-contracts 0.1.5 → 0.2.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.
- package/dist/entity.d.ts +135 -135
- package/dist/entity.d.ts.map +1 -1
- package/dist/entity.js +66 -43
- package/dist/entity.js.map +1 -1
- package/dist/fact.d.ts +94 -94
- package/dist/fact.d.ts.map +1 -1
- package/dist/fact.js +17 -15
- package/dist/fact.js.map +1 -1
- package/dist/sleep.d.ts +77 -77
- package/dist/sleep.d.ts.map +1 -1
- package/dist/sleep.js +27 -25
- package/dist/sleep.js.map +1 -1
- package/dist/timeline.d.ts +76 -76
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +12 -10
- package/dist/timeline.js.map +1 -1
- package/package.json +1 -1
package/dist/sleep.js
CHANGED
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MemoryEdgeRelationSchema, MemoryEdgeMethodSchema, SleepStatusSchema } from './constants.js';
|
|
3
|
+
// Field names are snake_case to match the DB columns / KAD's brain object shapes.
|
|
4
|
+
// This is deliberate and load-bearing — see the header note in `entity.ts`.
|
|
3
5
|
// Maps to sleep_runs table in sleep.db.
|
|
4
6
|
export const SleepRunSchema = z.object({
|
|
5
7
|
id: z.number().int(),
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
started_at: z.string(),
|
|
9
|
+
completed_at: z.string().optional(),
|
|
8
10
|
status: SleepStatusSchema,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
checkpoint_step: z.string().optional(),
|
|
12
|
+
checkpoint_data: z.string().optional(),
|
|
11
13
|
metrics: z.string().optional(),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
error_message: z.string().optional(),
|
|
15
|
+
created_at: z.string(),
|
|
14
16
|
});
|
|
15
17
|
// Maps to memory_edges table in sleep.db.
|
|
16
18
|
export const MemoryEdgeSchema = z.object({
|
|
17
19
|
id: z.number().int(),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
from_path: z.string(),
|
|
21
|
+
to_path: z.string(), // UNIQUE(from_path, to_path)
|
|
20
22
|
relation: MemoryEdgeRelationSchema,
|
|
21
23
|
weight: z.number(),
|
|
22
24
|
confidence: z.number(),
|
|
23
|
-
|
|
25
|
+
shared_tags: z.string().optional(),
|
|
24
26
|
rationale: z.string().optional(),
|
|
25
27
|
method: MemoryEdgeMethodSchema,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
created_at: z.string(),
|
|
29
|
+
last_verified: z.string().optional(),
|
|
28
30
|
});
|
|
29
31
|
// Maps to maintenance_queue table in sleep.db.
|
|
30
32
|
export const MaintenanceItemTypeSchema = z.enum(['timeline', 'entity', 'file']);
|
|
31
33
|
export const MaintenanceQueueItemSchema = z.object({
|
|
32
34
|
id: z.number().int(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
item_type: MaintenanceItemTypeSchema,
|
|
36
|
+
item_id: z.string(),
|
|
35
37
|
task: z.string(),
|
|
36
38
|
priority: z.number().int(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
created_at: z.string(),
|
|
40
|
+
processed_at: z.string().optional(),
|
|
41
|
+
error_message: z.string().optional(),
|
|
40
42
|
});
|
|
41
43
|
// Maps to sleep_telemetry table in sleep.db.
|
|
42
44
|
export const SleepTelemetrySchema = z.object({
|
|
43
45
|
id: z.number().int(),
|
|
44
|
-
|
|
46
|
+
run_id: z.number().int().optional(),
|
|
45
47
|
step: z.string(),
|
|
46
|
-
|
|
48
|
+
event_type: z.string(),
|
|
47
49
|
count: z.number().int(),
|
|
48
|
-
|
|
50
|
+
duration_ms: z.number().int().optional(),
|
|
49
51
|
metadata: z.string().optional(),
|
|
50
|
-
|
|
52
|
+
created_at: z.string(),
|
|
51
53
|
});
|
|
52
54
|
// Maps to tier_transitions table in sleep.db (created lazily).
|
|
53
55
|
export const TierTransitionSchema = z.object({
|
|
54
56
|
id: z.number().int(),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
item_id: z.number().int(),
|
|
58
|
+
from_tier: z.string().optional(),
|
|
59
|
+
to_tier: z.string(),
|
|
58
60
|
reason: z.string().optional(),
|
|
59
|
-
|
|
61
|
+
created_at: z.string(),
|
|
60
62
|
});
|
|
61
63
|
// Maps to chunk_meta table in vectors.db.
|
|
62
64
|
export const VectorChunkMetaSchema = z.object({
|
|
@@ -64,6 +66,6 @@ export const VectorChunkMetaSchema = z.object({
|
|
|
64
66
|
ts: z.string(),
|
|
65
67
|
source: z.string().optional(),
|
|
66
68
|
content: z.string(),
|
|
67
|
-
|
|
69
|
+
origin_id: z.string().optional(),
|
|
68
70
|
});
|
|
69
71
|
//# sourceMappingURL=sleep.js.map
|
package/dist/sleep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../src/sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErG,wCAAwC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACpB,
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../src/sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErG,kFAAkF;AAClF,4EAA4E;AAE5E,wCAAwC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC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C,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAGH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACvB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
package/dist/timeline.d.ts
CHANGED
|
@@ -3,134 +3,134 @@ export declare const TimelineEventSchema: z.ZodObject<{
|
|
|
3
3
|
id: z.ZodNumber;
|
|
4
4
|
type: z.ZodEnum<["conversation", "idea", "file", "transcript", "note", "intake"]>;
|
|
5
5
|
timestamp: z.ZodString;
|
|
6
|
-
|
|
6
|
+
end_timestamp: z.ZodOptional<z.ZodString>;
|
|
7
7
|
title: z.ZodString;
|
|
8
8
|
summary: z.ZodOptional<z.ZodString>;
|
|
9
|
-
|
|
9
|
+
source_path: z.ZodString;
|
|
10
10
|
entities: z.ZodArray<z.ZodString, "many">;
|
|
11
11
|
topics: z.ZodArray<z.ZodString, "many">;
|
|
12
12
|
priority: z.ZodNumber;
|
|
13
|
-
|
|
13
|
+
decay_score: z.ZodNumber;
|
|
14
14
|
tier: z.ZodEnum<["hot", "warm", "archive"]>;
|
|
15
15
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
last_enriched: z.ZodOptional<z.ZodString>;
|
|
17
|
+
access_count: z.ZodNumber;
|
|
18
|
+
is_pinned: z.ZodBoolean;
|
|
19
|
+
last_accessed: z.ZodOptional<z.ZodString>;
|
|
20
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
21
21
|
classification: z.ZodOptional<z.ZodString>;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
connection_id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
source_did: z.ZodOptional<z.ZodString>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
id: number;
|
|
26
26
|
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
27
|
+
priority: number;
|
|
28
|
+
decay_score: number;
|
|
29
|
+
tier: "hot" | "warm" | "archive";
|
|
30
|
+
access_count: number;
|
|
31
|
+
is_pinned: boolean;
|
|
32
|
+
source_path: string;
|
|
27
33
|
timestamp: string;
|
|
28
|
-
title: string;
|
|
29
|
-
sourcePath: string;
|
|
30
34
|
entities: string[];
|
|
35
|
+
title: string;
|
|
31
36
|
topics: string[];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
tier: "hot" | "warm" | "archive";
|
|
35
|
-
accessCount: number;
|
|
36
|
-
isPinned: boolean;
|
|
37
|
-
endTimestamp?: string | undefined;
|
|
38
|
-
summary?: string | undefined;
|
|
37
|
+
last_accessed?: string | undefined;
|
|
38
|
+
project_id?: string | undefined;
|
|
39
39
|
tags?: string[] | undefined;
|
|
40
|
-
lastEnriched?: string | undefined;
|
|
41
|
-
lastAccessed?: string | undefined;
|
|
42
|
-
projectId?: string | undefined;
|
|
43
40
|
classification?: string | undefined;
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
connection_id?: string | undefined;
|
|
42
|
+
source_did?: string | undefined;
|
|
43
|
+
end_timestamp?: string | undefined;
|
|
44
|
+
summary?: string | undefined;
|
|
45
|
+
last_enriched?: string | undefined;
|
|
46
46
|
}, {
|
|
47
47
|
id: number;
|
|
48
48
|
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
49
|
+
priority: number;
|
|
50
|
+
decay_score: number;
|
|
51
|
+
tier: "hot" | "warm" | "archive";
|
|
52
|
+
access_count: number;
|
|
53
|
+
is_pinned: boolean;
|
|
54
|
+
source_path: string;
|
|
49
55
|
timestamp: string;
|
|
50
|
-
title: string;
|
|
51
|
-
sourcePath: string;
|
|
52
56
|
entities: string[];
|
|
57
|
+
title: string;
|
|
53
58
|
topics: string[];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
tier: "hot" | "warm" | "archive";
|
|
57
|
-
accessCount: number;
|
|
58
|
-
isPinned: boolean;
|
|
59
|
-
endTimestamp?: string | undefined;
|
|
60
|
-
summary?: string | undefined;
|
|
59
|
+
last_accessed?: string | undefined;
|
|
60
|
+
project_id?: string | undefined;
|
|
61
61
|
tags?: string[] | undefined;
|
|
62
|
-
lastEnriched?: string | undefined;
|
|
63
|
-
lastAccessed?: string | undefined;
|
|
64
|
-
projectId?: string | undefined;
|
|
65
62
|
classification?: string | undefined;
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
connection_id?: string | undefined;
|
|
64
|
+
source_did?: string | undefined;
|
|
65
|
+
end_timestamp?: string | undefined;
|
|
66
|
+
summary?: string | undefined;
|
|
67
|
+
last_enriched?: string | undefined;
|
|
68
68
|
}>;
|
|
69
69
|
export type TimelineEvent = z.infer<typeof TimelineEventSchema>;
|
|
70
70
|
export declare const TimelineEventInputSchema: z.ZodObject<Omit<{
|
|
71
71
|
id: z.ZodNumber;
|
|
72
72
|
type: z.ZodEnum<["conversation", "idea", "file", "transcript", "note", "intake"]>;
|
|
73
73
|
timestamp: z.ZodString;
|
|
74
|
-
|
|
74
|
+
end_timestamp: z.ZodOptional<z.ZodString>;
|
|
75
75
|
title: z.ZodString;
|
|
76
76
|
summary: z.ZodOptional<z.ZodString>;
|
|
77
|
-
|
|
77
|
+
source_path: z.ZodString;
|
|
78
78
|
entities: z.ZodArray<z.ZodString, "many">;
|
|
79
79
|
topics: z.ZodArray<z.ZodString, "many">;
|
|
80
80
|
priority: z.ZodNumber;
|
|
81
|
-
|
|
81
|
+
decay_score: z.ZodNumber;
|
|
82
82
|
tier: z.ZodEnum<["hot", "warm", "archive"]>;
|
|
83
83
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
last_enriched: z.ZodOptional<z.ZodString>;
|
|
85
|
+
access_count: z.ZodNumber;
|
|
86
|
+
is_pinned: z.ZodBoolean;
|
|
87
|
+
last_accessed: z.ZodOptional<z.ZodString>;
|
|
88
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
89
89
|
classification: z.ZodOptional<z.ZodString>;
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
connection_id: z.ZodOptional<z.ZodString>;
|
|
91
|
+
source_did: z.ZodOptional<z.ZodString>;
|
|
92
92
|
}, "id">, "strip", z.ZodTypeAny, {
|
|
93
93
|
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
94
|
+
priority: number;
|
|
95
|
+
decay_score: number;
|
|
96
|
+
tier: "hot" | "warm" | "archive";
|
|
97
|
+
access_count: number;
|
|
98
|
+
is_pinned: boolean;
|
|
99
|
+
source_path: string;
|
|
94
100
|
timestamp: string;
|
|
95
|
-
title: string;
|
|
96
|
-
sourcePath: string;
|
|
97
101
|
entities: string[];
|
|
102
|
+
title: string;
|
|
98
103
|
topics: string[];
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
tier: "hot" | "warm" | "archive";
|
|
102
|
-
accessCount: number;
|
|
103
|
-
isPinned: boolean;
|
|
104
|
-
endTimestamp?: string | undefined;
|
|
105
|
-
summary?: string | undefined;
|
|
104
|
+
last_accessed?: string | undefined;
|
|
105
|
+
project_id?: string | undefined;
|
|
106
106
|
tags?: string[] | undefined;
|
|
107
|
-
lastEnriched?: string | undefined;
|
|
108
|
-
lastAccessed?: string | undefined;
|
|
109
|
-
projectId?: string | undefined;
|
|
110
107
|
classification?: string | undefined;
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
connection_id?: string | undefined;
|
|
109
|
+
source_did?: string | undefined;
|
|
110
|
+
end_timestamp?: string | undefined;
|
|
111
|
+
summary?: string | undefined;
|
|
112
|
+
last_enriched?: string | undefined;
|
|
113
113
|
}, {
|
|
114
114
|
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
115
|
+
priority: number;
|
|
116
|
+
decay_score: number;
|
|
117
|
+
tier: "hot" | "warm" | "archive";
|
|
118
|
+
access_count: number;
|
|
119
|
+
is_pinned: boolean;
|
|
120
|
+
source_path: string;
|
|
115
121
|
timestamp: string;
|
|
116
|
-
title: string;
|
|
117
|
-
sourcePath: string;
|
|
118
122
|
entities: string[];
|
|
123
|
+
title: string;
|
|
119
124
|
topics: string[];
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
tier: "hot" | "warm" | "archive";
|
|
123
|
-
accessCount: number;
|
|
124
|
-
isPinned: boolean;
|
|
125
|
-
endTimestamp?: string | undefined;
|
|
126
|
-
summary?: string | undefined;
|
|
125
|
+
last_accessed?: string | undefined;
|
|
126
|
+
project_id?: string | undefined;
|
|
127
127
|
tags?: string[] | undefined;
|
|
128
|
-
lastEnriched?: string | undefined;
|
|
129
|
-
lastAccessed?: string | undefined;
|
|
130
|
-
projectId?: string | undefined;
|
|
131
128
|
classification?: string | undefined;
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
connection_id?: string | undefined;
|
|
130
|
+
source_did?: string | undefined;
|
|
131
|
+
end_timestamp?: string | undefined;
|
|
132
|
+
summary?: string | undefined;
|
|
133
|
+
last_enriched?: string | undefined;
|
|
134
134
|
}>;
|
|
135
135
|
export type TimelineEventInput = z.infer<typeof TimelineEventInputSchema>;
|
|
136
136
|
//# sourceMappingURL=timeline.d.ts.map
|
package/dist/timeline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyC,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/timeline.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { EventTypeSchema, TierSchema } from './constants.js';
|
|
3
|
+
// Field names are snake_case to match KAD's canonical brain object interfaces.
|
|
4
|
+
// This is deliberate and load-bearing — see the header note in `entity.ts`.
|
|
3
5
|
// Maps to timeline_events table in timeline.db.
|
|
4
6
|
export const TimelineEventSchema = z.object({
|
|
5
7
|
id: z.number().int(),
|
|
6
8
|
type: EventTypeSchema,
|
|
7
9
|
timestamp: z.string(),
|
|
8
|
-
|
|
10
|
+
end_timestamp: z.string().optional(),
|
|
9
11
|
title: z.string(),
|
|
10
12
|
summary: z.string().optional(),
|
|
11
|
-
|
|
13
|
+
source_path: z.string(), // UNIQUE
|
|
12
14
|
entities: z.array(z.string()),
|
|
13
15
|
topics: z.array(z.string()),
|
|
14
16
|
priority: z.number(),
|
|
15
|
-
|
|
17
|
+
decay_score: z.number(),
|
|
16
18
|
tier: TierSchema,
|
|
17
19
|
tags: z.array(z.string()).optional(),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
last_enriched: z.string().optional(),
|
|
21
|
+
access_count: z.number().int(),
|
|
22
|
+
is_pinned: z.boolean(),
|
|
23
|
+
last_accessed: z.string().optional(),
|
|
22
24
|
// 4 flat scope columns (no nested scopes object — matches KAD wire shape)
|
|
23
|
-
|
|
25
|
+
project_id: z.string().optional(),
|
|
24
26
|
classification: z.string().optional(),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
connection_id: z.string().optional(),
|
|
28
|
+
source_did: z.string().optional(),
|
|
27
29
|
});
|
|
28
30
|
// Input shape for addToTimeline — id is assigned by the DB.
|
|
29
31
|
export const TimelineEventInputSchema = TimelineEventSchema.omit({ id: true });
|
package/dist/timeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE7D,gDAAgD;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACpB,IAAI,EAAE,eAAe;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE7D,+EAA+E;AAC/E,4EAA4E;AAE5E,gDAAgD;AAChD,MAAM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