@sentry/junior-memory 0.125.0 → 0.126.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/agent.d.ts +8 -8
- package/dist/api.d.ts +5 -0
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/store.d.ts +4 -4
- package/dist/types.d.ts +8 -8
- package/package.json +2 -2
- package/src/api.ts +9 -3
- package/src/personal.ts +10 -4
package/dist/store.d.ts
CHANGED
|
@@ -79,9 +79,9 @@ export declare const memorySupersessionInputSchema: z.ZodObject<{
|
|
|
79
79
|
platform: z.ZodLiteral<"slack">;
|
|
80
80
|
teamId: z.ZodString;
|
|
81
81
|
channelId: z.ZodString;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
visibility: z.ZodEnum<{
|
|
83
|
+
public: "public";
|
|
84
|
+
private: "private";
|
|
85
85
|
}>;
|
|
86
86
|
messageTs: z.ZodOptional<z.ZodString>;
|
|
87
87
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
@@ -97,7 +97,7 @@ export declare const memorySupersessionInputSchema: z.ZodObject<{
|
|
|
97
97
|
}, z.core.$strict>>;
|
|
98
98
|
source: z.ZodObject<{
|
|
99
99
|
platform: z.ZodLiteral<"local">;
|
|
100
|
-
|
|
100
|
+
visibility: z.ZodLiteral<"private">;
|
|
101
101
|
conversationId: z.ZodString;
|
|
102
102
|
}, z.core.$strict>;
|
|
103
103
|
}, z.core.$strict>]>;
|
package/dist/types.d.ts
CHANGED
|
@@ -25,9 +25,9 @@ export declare const slackMemoryRuntimeContextSchema: z.ZodObject<{
|
|
|
25
25
|
platform: z.ZodLiteral<"slack">;
|
|
26
26
|
teamId: z.ZodString;
|
|
27
27
|
channelId: z.ZodString;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
visibility: z.ZodEnum<{
|
|
29
|
+
public: "public";
|
|
30
|
+
private: "private";
|
|
31
31
|
}>;
|
|
32
32
|
messageTs: z.ZodOptional<z.ZodString>;
|
|
33
33
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
@@ -45,7 +45,7 @@ export declare const localMemoryRuntimeContextSchema: z.ZodObject<{
|
|
|
45
45
|
}, z.core.$strict>>;
|
|
46
46
|
source: z.ZodObject<{
|
|
47
47
|
platform: z.ZodLiteral<"local">;
|
|
48
|
-
|
|
48
|
+
visibility: z.ZodLiteral<"private">;
|
|
49
49
|
conversationId: z.ZodString;
|
|
50
50
|
}, z.core.$strict>;
|
|
51
51
|
}, z.core.$strict>;
|
|
@@ -64,9 +64,9 @@ export declare const memoryRuntimeContextSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
64
64
|
platform: z.ZodLiteral<"slack">;
|
|
65
65
|
teamId: z.ZodString;
|
|
66
66
|
channelId: z.ZodString;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
visibility: z.ZodEnum<{
|
|
68
|
+
public: "public";
|
|
69
|
+
private: "private";
|
|
70
70
|
}>;
|
|
71
71
|
messageTs: z.ZodOptional<z.ZodString>;
|
|
72
72
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
@@ -82,7 +82,7 @@ export declare const memoryRuntimeContextSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
82
82
|
}, z.core.$strict>>;
|
|
83
83
|
source: z.ZodObject<{
|
|
84
84
|
platform: z.ZodLiteral<"local">;
|
|
85
|
-
|
|
85
|
+
visibility: z.ZodLiteral<"private">;
|
|
86
86
|
conversationId: z.ZodString;
|
|
87
87
|
}, z.core.$strict>;
|
|
88
88
|
}, z.core.$strict>]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.126.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"commander": "^14.0.3",
|
|
28
28
|
"drizzle-orm": "^0.45.2",
|
|
29
29
|
"zod": "^4.4.3",
|
|
30
|
-
"@sentry/junior-plugin-api": "0.
|
|
30
|
+
"@sentry/junior-plugin-api": "0.126.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^25.9.1",
|
package/src/api.ts
CHANGED
|
@@ -48,7 +48,7 @@ const memoryDashboardDaySchema = z
|
|
|
48
48
|
})
|
|
49
49
|
.strict();
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const memoryCostDaySchema = z
|
|
52
52
|
.object({
|
|
53
53
|
costUsd: z.number().finite().nonnegative(),
|
|
54
54
|
date: z.iso.date(),
|
|
@@ -59,8 +59,9 @@ const memoryExtractionDaySchema = z
|
|
|
59
59
|
export const memoryDashboardResponseSchema = z
|
|
60
60
|
.object({
|
|
61
61
|
days: z.array(memoryDashboardDaySchema).length(90),
|
|
62
|
-
extractionDays: z.array(
|
|
62
|
+
extractionDays: z.array(memoryCostDaySchema).length(90),
|
|
63
63
|
generatedAt: z.iso.datetime(),
|
|
64
|
+
recallDays: z.array(memoryCostDaySchema).length(90),
|
|
64
65
|
stats: z
|
|
65
66
|
.object({
|
|
66
67
|
active: z.number().int().min(0),
|
|
@@ -155,18 +156,23 @@ export function createMemoryApi(options: MemoryApiOptions): PluginRouteApp {
|
|
|
155
156
|
isDashboard &&
|
|
156
157
|
(request.method === "GET" || request.method === "HEAD")
|
|
157
158
|
) {
|
|
158
|
-
const [stats, days, extractionDays] = await Promise.all([
|
|
159
|
+
const [stats, days, extractionDays, recallDays] = await Promise.all([
|
|
159
160
|
memories.stats(),
|
|
160
161
|
memories.timeline({ days: 90 }),
|
|
161
162
|
options.eventStats.costsByDay({
|
|
162
163
|
days: 90,
|
|
163
164
|
eventName: "memories_captured",
|
|
164
165
|
}),
|
|
166
|
+
options.eventStats.costsByDay({
|
|
167
|
+
days: 90,
|
|
168
|
+
eventName: "memories_recalled",
|
|
169
|
+
}),
|
|
165
170
|
]);
|
|
166
171
|
const body = memoryDashboardResponseSchema.parse({
|
|
167
172
|
days,
|
|
168
173
|
extractionDays,
|
|
169
174
|
generatedAt: new Date().toISOString(),
|
|
175
|
+
recallDays,
|
|
170
176
|
stats,
|
|
171
177
|
});
|
|
172
178
|
return request.method === "HEAD"
|
package/src/personal.ts
CHANGED
|
@@ -57,7 +57,7 @@ function runtimeContext(actor: PluginUserPageActor): MemoryRuntimeContext {
|
|
|
57
57
|
actor,
|
|
58
58
|
source: {
|
|
59
59
|
platform: "slack",
|
|
60
|
-
|
|
60
|
+
visibility: "private",
|
|
61
61
|
teamId: actor.teamId,
|
|
62
62
|
channelId: "DDASHBOARD",
|
|
63
63
|
},
|
|
@@ -67,7 +67,7 @@ function runtimeContext(actor: PluginUserPageActor): MemoryRuntimeContext {
|
|
|
67
67
|
actor,
|
|
68
68
|
source: {
|
|
69
69
|
platform: "local",
|
|
70
|
-
|
|
70
|
+
visibility: "private",
|
|
71
71
|
conversationId: "local:dashboard:memories",
|
|
72
72
|
},
|
|
73
73
|
};
|
|
@@ -75,7 +75,10 @@ function runtimeContext(actor: PluginUserPageActor): MemoryRuntimeContext {
|
|
|
75
75
|
|
|
76
76
|
function decodeCursor(
|
|
77
77
|
value: string | undefined,
|
|
78
|
-
input: Pick<
|
|
78
|
+
input: Pick<
|
|
79
|
+
ViewerMemoryPageInput,
|
|
80
|
+
"kind" | "origin" | "query" | "visibility"
|
|
81
|
+
>,
|
|
79
82
|
) {
|
|
80
83
|
if (!value) return undefined;
|
|
81
84
|
try {
|
|
@@ -98,7 +101,10 @@ function decodeCursor(
|
|
|
98
101
|
|
|
99
102
|
function encodeCursor(
|
|
100
103
|
cursor: { createdAtMs: number; id: string },
|
|
101
|
-
input: Pick<
|
|
104
|
+
input: Pick<
|
|
105
|
+
ViewerMemoryPageInput,
|
|
106
|
+
"kind" | "origin" | "query" | "visibility"
|
|
107
|
+
>,
|
|
102
108
|
): string {
|
|
103
109
|
return Buffer.from(
|
|
104
110
|
JSON.stringify({
|