@sentry/junior-memory 0.179.0 → 0.181.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @sentry/junior-memory
2
2
 
3
- The memory plugin stores durable, actor-scoped facts, recalls relevant facts
3
+ The memory plugin stores durable facts, recalls relevant facts
4
4
  into prompts, and learns candidates from completed sessions. SQL schemas,
5
5
  exported types, tools, and tests are authoritative.
6
6
 
@@ -13,27 +13,29 @@ exported types, tools, and tests are authoritative.
13
13
  learning.
14
14
  - The `memory` CLI namespace provides explicit administrative search and
15
15
  inspection.
16
- - The dashboard exposes a searchable, paginated **Memories** user page for
17
- personal memories owned by actors linked to the signed-in viewer. Its
18
- **Forget** action archives the selected memory. The overview charts global
19
- passive-extraction cost from the durable `memory/memories_captured` events;
20
- the System plugin report uses the same event-cost feed.
21
- - Authenticated REST clients can list and search personal memories through
16
+ - The dashboard exposes a searchable, paginated **Memories** user page. It
17
+ includes public memory and private memory owned by the authenticated user.
18
+ The overview charts global passive-extraction cost from the durable
19
+ `memory/memories_captured` events. The System plugin report uses the same
20
+ event-cost feed.
21
+ - Authenticated REST clients can list and search authorized memories through
22
22
  `GET /api/plugins/memory/memories`, read one through
23
- `GET /api/plugins/memory/memories/:id`, and archive one through
24
- `DELETE /api/plugins/memory/memories/:id`. Personal bearer tokens remain
25
- read-only, so mutations require a dashboard browser session.
23
+ `GET /api/plugins/memory/memories/:id`, and forget an authorized private
24
+ memory through `DELETE /api/plugins/memory/memories/:id`. Public memory is
25
+ read-only in the dashboard and REST API.
26
26
 
27
27
  ## Scope And Visibility
28
28
 
29
- - Memory scope is derived from the active actor and source, never from
30
- model-supplied ownership fields.
31
- - Dashboard and REST requests authorize one verified viewer, then derive access
32
- from every linked provider identity so no arbitrary identity is treated as
33
- the canonical user.
34
- - Private conversations and local sources remain private by default.
35
- - Recall filters candidates by actor, source, visibility, status, and relevance
36
- before content reaches the model.
29
+ - The Source sets memory visibility. Model output cannot set it.
30
+ - Public memory is visible everywhere.
31
+ - Private memory belongs to one User. Every Identity linked to that User can
32
+ access it.
33
+ - Junior records the optional Location where it learned a memory. Location is
34
+ a record of where Junior learned it. It does not grant access.
35
+ - The subject says what a memory is about. It does not set access. A user
36
+ preference can be public or private based on its Source.
37
+ - Recall filters candidates by visibility, status, and relevance before content
38
+ reaches the model.
37
39
  - Administrative reads require explicit selectors and safe output defaults.
38
40
  - Memory content, embeddings, source excerpts, and review prompts must not be
39
41
  logged or traced.
@@ -71,13 +73,12 @@ exported types, tools, and tests are authoritative.
71
73
  and slightly prefers lexical ranks so exact tokens survive soft semantic
72
74
  neighbors. Vector recall also applies the cosine distance cutoff in SQL, and
73
75
  embeddings use an HNSW cosine index (`vector_cosine_ops`).
74
- - Automatic recall also runs personal-scope-only vector and lexical probes so
75
- older actor preferences are not buried when newer workspace conversation
76
- memories fill the shared lexical recency window with common tokens. On RRF
77
- score ties, personal-scope matches rank ahead of conversation matches.
76
+ - Automatic recall also searches private memory by itself. This keeps newer
77
+ public memory with common words from hiding older private memory. On equal
78
+ RRF scores, private memory ranks first.
78
79
  - Automatic recall retrieves a bounded candidate window, then uses the
79
- memory-owned relevance model to admit at most five directly useful memories.
80
- An empty result contributes no filler prompt text.
80
+ memory relevance model and prompt limit to select useful memories. An empty
81
+ result adds no prompt text.
81
82
  - Every completed automatic recall attempt emits an invisible, namespaced
82
83
  `memory/memories_recalled` conversation event with the admitted memory IDs
83
84
  and best-effort embedding and relevance-model cost, including retrievals that
package/dist/agent.d.ts CHANGED
@@ -13,6 +13,7 @@ declare const createMemoryRequestSchema: z.ZodObject<{
13
13
  expiresAtMs: z.ZodOptional<z.ZodNumber>;
14
14
  runtimeContext: z.ZodObject<{
15
15
  conversationId: z.ZodOptional<z.ZodString>;
16
+ locationId: z.ZodOptional<z.ZodString>;
16
17
  actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
17
18
  platform: z.ZodLiteral<"slack">;
18
19
  teamId: z.ZodString;
@@ -58,6 +59,7 @@ declare const createMemoryRequestSchema: z.ZodObject<{
58
59
  }>;
59
60
  conversationId: z.ZodString;
60
61
  }, z.core.$strict>], "platform">;
62
+ userId: z.ZodOptional<z.ZodString>;
61
63
  }, z.core.$strict>;
62
64
  sourceContext: z.ZodOptional<z.ZodObject<{
63
65
  currentUserText: z.ZodOptional<z.ZodString>;
@@ -92,6 +94,7 @@ declare const extractSessionRequestSchema: z.ZodObject<{
92
94
  }, z.core.$strict>], "platform">>;
93
95
  runtimeContext: z.ZodObject<{
94
96
  conversationId: z.ZodOptional<z.ZodString>;
97
+ locationId: z.ZodOptional<z.ZodString>;
95
98
  actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
96
99
  platform: z.ZodLiteral<"slack">;
97
100
  teamId: z.ZodString;
@@ -137,6 +140,7 @@ declare const extractSessionRequestSchema: z.ZodObject<{
137
140
  }>;
138
141
  conversationId: z.ZodString;
139
142
  }, z.core.$strict>], "platform">;
143
+ userId: z.ZodOptional<z.ZodString>;
140
144
  }, z.core.$strict>;
141
145
  transcript: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
142
146
  type: z.ZodLiteral<"message">;
package/dist/api.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Authenticated REST resources for viewer-visible memories.
2
+ * Authenticated REST access to memory.
3
3
  *
4
- * HTTP identity is one verified user whose linked identities authorize
5
- * personal and public workspace scopes.
4
+ * The signed-in User can read public memory and private memory that they own.
6
5
  */
7
6
  import { z } from "zod";
8
7
  import { type PluginConversationEventStats, type PluginRouteApp, type User } from "@sentry/junior-plugin-api";
@@ -102,6 +101,6 @@ interface MemoryApiOptions {
102
101
  resolve(email: string): Promise<User | undefined>;
103
102
  };
104
103
  }
105
- /** Create the authenticated viewer-memory REST app. */
104
+ /** Create the authenticated memory REST app. */
106
105
  export declare function createMemoryApi(options: MemoryApiOptions): PluginRouteApp;
107
106
  export {};
@@ -24,14 +24,14 @@ export declare const juniorMemoryMemories: import("drizzle-orm/pg-core").PgTable
24
24
  tableName: "junior_memory_memories";
25
25
  dataType: "string";
26
26
  columnType: "PgText";
27
- data: "personal" | "conversation";
27
+ data: "public" | "private";
28
28
  driverParam: string;
29
29
  notNull: true;
30
30
  hasDefault: false;
31
31
  isPrimaryKey: false;
32
32
  isAutoincrement: false;
33
33
  hasRuntimeDefault: false;
34
- enumValues: ["personal", "conversation"];
34
+ enumValues: ["private", "public"];
35
35
  baseColumn: never;
36
36
  identity: undefined;
37
37
  generated: undefined;
@@ -176,6 +176,23 @@ export declare const juniorMemoryMemories: import("drizzle-orm/pg-core").PgTable
176
176
  identity: undefined;
177
177
  generated: undefined;
178
178
  }, {}, {}>;
179
+ locationId: import("drizzle-orm/pg-core").PgColumn<{
180
+ name: "location_id";
181
+ tableName: "junior_memory_memories";
182
+ dataType: "string";
183
+ columnType: "PgText";
184
+ data: string;
185
+ driverParam: string;
186
+ notNull: false;
187
+ hasDefault: false;
188
+ isPrimaryKey: false;
189
+ isAutoincrement: false;
190
+ hasRuntimeDefault: false;
191
+ enumValues: [string, ...string[]];
192
+ baseColumn: never;
193
+ identity: undefined;
194
+ generated: undefined;
195
+ }, {}, {}>;
179
196
  idempotencyKey: import("drizzle-orm/pg-core").PgColumn<{
180
197
  name: "idempotency_key";
181
198
  tableName: "junior_memory_memories";
package/dist/events.d.ts CHANGED
@@ -2,21 +2,21 @@ import type { MemoryRecord } from "./store";
2
2
  /** Previous stored memory-capture event shape retained for transcript rendering. */
3
3
  export declare const memoriesCapturedEventV1: import("@sentry/junior-plugin-api").DefinedConversationEvent<{
4
4
  memories: {
5
+ scope: "conversation" | "personal";
5
6
  content: string;
6
7
  id: string;
7
8
  kind: "preference" | "procedure" | "knowledge";
8
9
  observedAtMs: number;
9
- scope: "personal" | "conversation";
10
10
  }[];
11
11
  }>;
12
12
  /** Durable outcome emitted after every completed passive memory extraction. */
13
13
  export declare const memoriesCapturedEvent: import("@sentry/junior-plugin-api").DefinedConversationEvent<{
14
14
  memories: {
15
+ scope: "public" | "private";
15
16
  content: string;
16
17
  id: string;
17
18
  kind: "preference" | "procedure" | "knowledge";
18
19
  observedAtMs: number;
19
- scope: "personal" | "conversation";
20
20
  }[];
21
21
  costUsd?: number | undefined;
22
22
  }>;
@@ -31,5 +31,5 @@ export declare function capturedMemory(memory: MemoryRecord): {
31
31
  id: string;
32
32
  kind: "preference" | "procedure" | "knowledge";
33
33
  observedAtMs: number;
34
- scope: "personal" | "conversation";
34
+ scope: "public" | "private";
35
35
  };