@sentry/junior-memory 0.205.0 → 0.207.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
@@ -6,8 +6,8 @@ exported types, tools, and tests are authoritative.
6
6
 
7
7
  ## Surfaces
8
8
 
9
- - `createMemory`, `removeMemory`, `listMemories`, and `searchMemories` are
10
- model-visible tools registered by `src/plugin.ts`. `removeMemory` can forget
9
+ - `createMemory`, `archiveMemory`, `listMemories`, and `searchMemories` are
10
+ model-visible tools registered by `src/plugin.ts`. `archiveMemory` can forget
11
11
  public memory or private memory owned by the current User.
12
12
  - `userPrompt` recall contributes bounded memory context before a run.
13
13
  - `processSession` reviews completed sessions asynchronously for passive
package/dist/index.d.ts CHANGED
@@ -551,15 +551,15 @@ declare const memoryRuntimeContextSchema: z.ZodObject<{
551
551
  }>;
552
552
  conversationId: z.ZodString;
553
553
  }, z.core.$strict>, z.ZodObject<{
554
- kind: z.ZodLiteral<"resource_event">;
554
+ kind: z.ZodLiteral<"event">;
555
555
  eventKey: z.ZodString;
556
556
  eventType: z.ZodString;
557
557
  identifier: z.ZodString;
558
558
  namespace: z.ZodString;
559
559
  }, z.core.$strict>, z.ZodObject<{
560
- kind: z.ZodLiteral<"scheduled_task">;
560
+ kind: z.ZodLiteral<"scheduled_automation">;
561
561
  }, z.core.$strict>, z.ZodObject<{
562
- kind: z.ZodLiteral<"event_task">;
562
+ kind: z.ZodLiteral<"event_automation">;
563
563
  }, z.core.$strict>, z.ZodObject<{
564
564
  kind: z.ZodLiteral<"plugin_dispatch">;
565
565
  }, z.core.$strict>, z.ZodObject<{
@@ -677,15 +677,15 @@ declare const memorySupersessionInputSchema: z.ZodObject<{
677
677
  }>;
678
678
  conversationId: z.ZodString;
679
679
  }, z.core.$strict>, z.ZodObject<{
680
- kind: z.ZodLiteral<"resource_event">;
680
+ kind: z.ZodLiteral<"event">;
681
681
  eventKey: z.ZodString;
682
682
  eventType: z.ZodString;
683
683
  identifier: z.ZodString;
684
684
  namespace: z.ZodString;
685
685
  }, z.core.$strict>, z.ZodObject<{
686
- kind: z.ZodLiteral<"scheduled_task">;
686
+ kind: z.ZodLiteral<"scheduled_automation">;
687
687
  }, z.core.$strict>, z.ZodObject<{
688
- kind: z.ZodLiteral<"event_task">;
688
+ kind: z.ZodLiteral<"event_automation">;
689
689
  }, z.core.$strict>, z.ZodObject<{
690
690
  kind: z.ZodLiteral<"plugin_dispatch">;
691
691
  }, z.core.$strict>, z.ZodObject<{
package/dist/index.js CHANGED
@@ -373,9 +373,9 @@ function storedMemorySource(source) {
373
373
  case "local":
374
374
  case "web":
375
375
  return source.kind;
376
- case "resource_event":
377
- case "scheduled_task":
378
- case "event_task":
376
+ case "event":
377
+ case "scheduled_automation":
378
+ case "event_automation":
379
379
  case "plugin_dispatch":
380
380
  case "agent_invocation":
381
381
  throw new Error(`${source.kind} Source cannot own a Memory.`);
@@ -1469,10 +1469,10 @@ function sourceLabel(source) {
1469
1469
  case "web":
1470
1470
  case "local":
1471
1471
  return `${source.kind}:${source.conversationId}`;
1472
- case "resource_event":
1473
- return `resource-event:${source.namespace}:${source.eventKey}`;
1474
- case "scheduled_task":
1475
- case "event_task":
1472
+ case "event":
1473
+ return `event:${source.namespace}:${source.eventKey}`;
1474
+ case "scheduled_automation":
1475
+ case "event_automation":
1476
1476
  case "plugin_dispatch":
1477
1477
  case "agent_invocation":
1478
1478
  return source.kind;
@@ -1925,7 +1925,7 @@ async function archiveMemory(db, userId, id) {
1925
1925
  archiveReason: "user_removed"
1926
1926
  }).where(
1927
1927
  and2(
1928
- activeMemoryPredicate(userId, nowMs, "private"),
1928
+ activeMemoryPredicate(userId, nowMs),
1929
1929
  eq2(juniorMemoryMemories.id, memoryId)
1930
1930
  )
1931
1931
  ).returning();
@@ -2563,7 +2563,7 @@ var createMemoryInputSchema2 = z6.object({
2563
2563
  'Expiration selector. Omit or use "never" when the memory should not expire, or use an exact ISO timestamp such as "2027-06-21T00:00:00Z".'
2564
2564
  ).optional()
2565
2565
  }).strict();
2566
- var removeMemoryInputSchema = z6.object({
2566
+ var archiveMemoryInputSchema2 = z6.object({
2567
2567
  id: z6.string().min(1).describe("Memory id or unambiguous short id prefix to remove.")
2568
2568
  }).strict();
2569
2569
  var listMemoriesInputSchema2 = z6.object({
@@ -2727,7 +2727,7 @@ function createMemoryCreateTool(context) {
2727
2727
  }
2728
2728
  });
2729
2729
  }
2730
- function createMemoryRemoveTool(context) {
2730
+ function createMemoryArchiveTool(context) {
2731
2731
  return definePluginTool({
2732
2732
  annotations: {
2733
2733
  destructiveHint: true,
@@ -2737,10 +2737,13 @@ function createMemoryRemoveTool(context) {
2737
2737
  },
2738
2738
  description: "Forget one active memory visible in the current context. This includes public memories and private memories owned by the current User. Use only ids or short id prefixes returned by listMemories or searchMemories. Never remove memories by hidden Actor, provider, scope, or subject ids.",
2739
2739
  executionMode: "sequential",
2740
- inputSchema: removeMemoryInputSchema,
2740
+ inputSchema: archiveMemoryInputSchema2,
2741
2741
  outputSchema: memorySingleOutputSchema,
2742
2742
  execute: async (input) => {
2743
- const parsedInput = parseMemoryToolInput(removeMemoryInputSchema, input);
2743
+ const parsedInput = parseMemoryToolInput(
2744
+ archiveMemoryInputSchema2,
2745
+ input
2746
+ );
2744
2747
  const runtimeContext = await memoryRuntimeContext(context);
2745
2748
  const memory = await (async () => {
2746
2749
  try {
@@ -2752,7 +2755,7 @@ function createMemoryRemoveTool(context) {
2752
2755
  asToolInputError(error);
2753
2756
  }
2754
2757
  })();
2755
- return memoryToolResult("removeMemory", {
2758
+ return memoryToolResult("archiveMemory", {
2756
2759
  memory: compactMemory(memory)
2757
2760
  });
2758
2761
  }
@@ -2896,9 +2899,9 @@ function capturedMemory(memory) {
2896
2899
 
2897
2900
  // src/process-session.ts
2898
2901
  var MEMORY_TOOL_NAMES = /* @__PURE__ */ new Set([
2902
+ "archiveMemory",
2899
2903
  "createMemory",
2900
2904
  "listMemories",
2901
- "removeMemory",
2902
2905
  "searchMemories"
2903
2906
  ]);
2904
2907
  var MEMORY_TASK_STATE_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
@@ -3568,7 +3571,7 @@ function memoryPlugin(options = {}) {
3568
3571
  supersessionDecider: agent
3569
3572
  })
3570
3573
  ),
3571
- removeMemory: createMemoryRemoveTool(context),
3574
+ archiveMemory: createMemoryArchiveTool(context),
3572
3575
  listMemories: createMemoryListTool(context),
3573
3576
  searchMemories: createMemorySearchTool(context)
3574
3577
  };