@kybernesis/brain-contracts 0.1.1 → 0.1.3
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/tenant.d.ts +12 -1
- package/dist/tenant.d.ts.map +1 -1
- package/dist/tenant.js +13 -2
- package/dist/tenant.js.map +1 -1
- package/dist/timeline.d.ts +40 -40
- package/dist/timeline.js +1 -1
- package/dist/timeline.js.map +1 -1
- package/package.json +1 -1
package/dist/tenant.d.ts
CHANGED
|
@@ -24,5 +24,16 @@ export interface TenantContext {
|
|
|
24
24
|
displayName?: string;
|
|
25
25
|
paths: TenantPaths;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Resolve the on-disk paths for a tenant.
|
|
29
|
+
*
|
|
30
|
+
* @param slug tenant identifier
|
|
31
|
+
* @param storageRoot the tenant's home directory (defaults to ~/.kyberagent/<slug>)
|
|
32
|
+
* @param brainSubdir the subdirectory under `home` holding the brain DBs.
|
|
33
|
+
* Defaults to 'brain'. **KAD stores its brain DBs in 'data'**
|
|
34
|
+
* (`<home>/data/timeline.db`), so KAD's adapter MUST pass
|
|
35
|
+
* 'data' here — otherwise the library opens an empty
|
|
36
|
+
* `<home>/brain/` and every existing agent looks brain-dead.
|
|
37
|
+
*/
|
|
38
|
+
export declare function pathsFor(slug: string, storageRoot?: string, brainSubdir?: string): TenantPaths;
|
|
28
39
|
//# sourceMappingURL=tenant.d.ts.map
|
package/dist/tenant.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../src/tenant.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MA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IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,SAAU,GAAG,WAAW,CAuB/F"}
|
package/dist/tenant.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the on-disk paths for a tenant.
|
|
4
|
+
*
|
|
5
|
+
* @param slug tenant identifier
|
|
6
|
+
* @param storageRoot the tenant's home directory (defaults to ~/.kyberagent/<slug>)
|
|
7
|
+
* @param brainSubdir the subdirectory under `home` holding the brain DBs.
|
|
8
|
+
* Defaults to 'brain'. **KAD stores its brain DBs in 'data'**
|
|
9
|
+
* (`<home>/data/timeline.db`), so KAD's adapter MUST pass
|
|
10
|
+
* 'data' here — otherwise the library opens an empty
|
|
11
|
+
* `<home>/brain/` and every existing agent looks brain-dead.
|
|
12
|
+
*/
|
|
13
|
+
export function pathsFor(slug, storageRoot, brainSubdir = 'brain') {
|
|
3
14
|
const home = storageRoot ?? path.join(process.env['HOME'] ?? '/tmp', '.kyberagent', slug);
|
|
4
|
-
const brainDir = path.join(home,
|
|
15
|
+
const brainDir = path.join(home, brainSubdir);
|
|
5
16
|
return {
|
|
6
17
|
home,
|
|
7
18
|
brainDir,
|
package/dist/tenant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.js","sourceRoot":"","sources":["../src/tenant.ts"],"names":[],"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AAE,UAAU,CAAC;QAC5C,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC;QAC7D,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
package/dist/timeline.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const TimelineEventSchema: z.ZodObject<{
|
|
|
12
12
|
priority: z.ZodNumber;
|
|
13
13
|
decayScore: z.ZodNumber;
|
|
14
14
|
tier: z.ZodEnum<["hot", "warm", "archive"]>;
|
|
15
|
-
tags: z.ZodArray<z.ZodString, "many"
|
|
15
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
16
|
lastEnriched: z.ZodOptional<z.ZodString>;
|
|
17
17
|
accessCount: z.ZodNumber;
|
|
18
18
|
isPinned: z.ZodBoolean;
|
|
@@ -22,49 +22,49 @@ export declare const TimelineEventSchema: z.ZodObject<{
|
|
|
22
22
|
connectionId: z.ZodOptional<z.ZodString>;
|
|
23
23
|
sourceDid: z.ZodOptional<z.ZodString>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
26
25
|
id: number;
|
|
26
|
+
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
27
|
+
timestamp: string;
|
|
28
|
+
title: string;
|
|
29
|
+
sourcePath: string;
|
|
30
|
+
entities: string[];
|
|
31
|
+
topics: string[];
|
|
27
32
|
priority: number;
|
|
28
33
|
decayScore: number;
|
|
29
34
|
tier: "hot" | "warm" | "archive";
|
|
30
35
|
accessCount: number;
|
|
31
36
|
isPinned: boolean;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
title: string;
|
|
37
|
-
topics: string[];
|
|
37
|
+
endTimestamp?: string | undefined;
|
|
38
|
+
summary?: string | undefined;
|
|
39
|
+
tags?: string[] | undefined;
|
|
40
|
+
lastEnriched?: string | undefined;
|
|
38
41
|
lastAccessed?: string | undefined;
|
|
39
42
|
projectId?: string | undefined;
|
|
40
43
|
classification?: string | undefined;
|
|
41
44
|
connectionId?: string | undefined;
|
|
42
45
|
sourceDid?: string | undefined;
|
|
43
|
-
endTimestamp?: string | undefined;
|
|
44
|
-
summary?: string | undefined;
|
|
45
|
-
lastEnriched?: string | undefined;
|
|
46
46
|
}, {
|
|
47
|
-
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
48
47
|
id: number;
|
|
48
|
+
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
49
|
+
timestamp: string;
|
|
50
|
+
title: string;
|
|
51
|
+
sourcePath: string;
|
|
52
|
+
entities: string[];
|
|
53
|
+
topics: string[];
|
|
49
54
|
priority: number;
|
|
50
55
|
decayScore: number;
|
|
51
56
|
tier: "hot" | "warm" | "archive";
|
|
52
57
|
accessCount: number;
|
|
53
58
|
isPinned: boolean;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
title: string;
|
|
59
|
-
topics: string[];
|
|
59
|
+
endTimestamp?: string | undefined;
|
|
60
|
+
summary?: string | undefined;
|
|
61
|
+
tags?: string[] | undefined;
|
|
62
|
+
lastEnriched?: string | undefined;
|
|
60
63
|
lastAccessed?: string | undefined;
|
|
61
64
|
projectId?: string | undefined;
|
|
62
65
|
classification?: string | undefined;
|
|
63
66
|
connectionId?: string | undefined;
|
|
64
67
|
sourceDid?: string | undefined;
|
|
65
|
-
endTimestamp?: string | undefined;
|
|
66
|
-
summary?: string | undefined;
|
|
67
|
-
lastEnriched?: string | undefined;
|
|
68
68
|
}>;
|
|
69
69
|
export type TimelineEvent = z.infer<typeof TimelineEventSchema>;
|
|
70
70
|
export declare const TimelineEventInputSchema: z.ZodObject<Omit<{
|
|
@@ -80,7 +80,7 @@ export declare const TimelineEventInputSchema: z.ZodObject<Omit<{
|
|
|
80
80
|
priority: z.ZodNumber;
|
|
81
81
|
decayScore: z.ZodNumber;
|
|
82
82
|
tier: z.ZodEnum<["hot", "warm", "archive"]>;
|
|
83
|
-
tags: z.ZodArray<z.ZodString, "many"
|
|
83
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
84
|
lastEnriched: z.ZodOptional<z.ZodString>;
|
|
85
85
|
accessCount: z.ZodNumber;
|
|
86
86
|
isPinned: z.ZodBoolean;
|
|
@@ -91,46 +91,46 @@ export declare const TimelineEventInputSchema: z.ZodObject<Omit<{
|
|
|
91
91
|
sourceDid: z.ZodOptional<z.ZodString>;
|
|
92
92
|
}, "id">, "strip", z.ZodTypeAny, {
|
|
93
93
|
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
94
|
+
timestamp: string;
|
|
95
|
+
title: string;
|
|
96
|
+
sourcePath: string;
|
|
97
|
+
entities: string[];
|
|
98
|
+
topics: string[];
|
|
94
99
|
priority: number;
|
|
95
100
|
decayScore: number;
|
|
96
101
|
tier: "hot" | "warm" | "archive";
|
|
97
102
|
accessCount: number;
|
|
98
103
|
isPinned: boolean;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
title: string;
|
|
104
|
-
topics: string[];
|
|
104
|
+
endTimestamp?: string | undefined;
|
|
105
|
+
summary?: string | undefined;
|
|
106
|
+
tags?: string[] | undefined;
|
|
107
|
+
lastEnriched?: string | undefined;
|
|
105
108
|
lastAccessed?: string | undefined;
|
|
106
109
|
projectId?: string | undefined;
|
|
107
110
|
classification?: string | undefined;
|
|
108
111
|
connectionId?: string | undefined;
|
|
109
112
|
sourceDid?: string | undefined;
|
|
110
|
-
endTimestamp?: string | undefined;
|
|
111
|
-
summary?: string | undefined;
|
|
112
|
-
lastEnriched?: string | undefined;
|
|
113
113
|
}, {
|
|
114
114
|
type: "conversation" | "idea" | "file" | "transcript" | "note" | "intake";
|
|
115
|
+
timestamp: string;
|
|
116
|
+
title: string;
|
|
117
|
+
sourcePath: string;
|
|
118
|
+
entities: string[];
|
|
119
|
+
topics: string[];
|
|
115
120
|
priority: number;
|
|
116
121
|
decayScore: number;
|
|
117
122
|
tier: "hot" | "warm" | "archive";
|
|
118
123
|
accessCount: number;
|
|
119
124
|
isPinned: boolean;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
title: string;
|
|
125
|
-
topics: string[];
|
|
125
|
+
endTimestamp?: string | undefined;
|
|
126
|
+
summary?: string | undefined;
|
|
127
|
+
tags?: string[] | undefined;
|
|
128
|
+
lastEnriched?: string | undefined;
|
|
126
129
|
lastAccessed?: string | undefined;
|
|
127
130
|
projectId?: string | undefined;
|
|
128
131
|
classification?: string | undefined;
|
|
129
132
|
connectionId?: string | undefined;
|
|
130
133
|
sourceDid?: string | undefined;
|
|
131
|
-
endTimestamp?: string | undefined;
|
|
132
|
-
summary?: string | undefined;
|
|
133
|
-
lastEnriched?: string | undefined;
|
|
134
134
|
}>;
|
|
135
135
|
export type TimelineEventInput = z.infer<typeof TimelineEventInputSchema>;
|
|
136
136
|
//# sourceMappingURL=timeline.d.ts.map
|
package/dist/timeline.js
CHANGED
|
@@ -14,7 +14,7 @@ export const TimelineEventSchema = z.object({
|
|
|
14
14
|
priority: z.number(),
|
|
15
15
|
decayScore: z.number(),
|
|
16
16
|
tier: TierSchema,
|
|
17
|
-
tags: z.array(z.string()),
|
|
17
|
+
tags: z.array(z.string()).optional(),
|
|
18
18
|
lastEnriched: z.string().optional(),
|
|
19
19
|
accessCount: z.number().int(),
|
|
20
20
|
isPinned: z.boolean(),
|
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,CA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