@xandreed/plugin-memory-digest 0.12.0 → 0.14.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,5 +1,5 @@
1
1
  # @xandreed/plugin-memory-digest
2
2
 
3
- Efferent composable agent framework, 0.12.0. Node 24 or Bun.
3
+ Efferent composable agent framework, 0.14.0. Node 24 or Bun.
4
4
 
5
5
  Documentation: https://github.com/xandreeddev/efferent
@@ -1,12 +1,12 @@
1
1
  import { Effect, Layer, Option, Schema } from "effect";
2
- import { definePlugin, HarnessError, ResultDigester, UtilityLlm } from "@xandreed/core";
2
+ import { definePlugin, HarnessError, ResultDigester, userMessageText, UtilityLlm } from "@xandreed/core";
3
3
  export const MemoryDigestConfig = Schema.Struct({
4
4
  maxSourceChars: Schema.Int.pipe(Schema.check(Schema.isBetween({ minimum: 1000, maximum: 400000 })))
5
5
  }), memoryDigestDefaults = { maxSourceChars: 48000 }, UTILITY_DIGESTER = { id: "utility-digest", version: "1" };
6
6
  const clip = (text, max) => text.length <= max ? text : `${text.slice(0, max)}\u2026`;
7
7
  export const digestPrompt = (task, maxSourceChars) => task.mode === "select" ? [
8
8
  task.instructions,
9
- `Request: ${task.userMessage.text}`,
9
+ `Request: ${userMessageText(task.userMessage)}`,
10
10
  "Items:",
11
11
  ...task.items.map((item) => `[${item.key}] ${clip(item.text, Math.max(200, Math.floor(maxSourceChars / Math.max(1, task.items.length))))}`),
12
12
  "Reply with the keys of the items to keep, one per line, and nothing else."
@@ -14,7 +14,7 @@ export const digestPrompt = (task, maxSourceChars) => task.mode === "select" ? [
14
14
 
15
15
  `) : [
16
16
  task.instructions,
17
- `Request: ${task.userMessage.text}`,
17
+ `Request: ${userMessageText(task.userMessage)}`,
18
18
  `Result:
19
19
  ${clip(task.source, maxSourceChars)}`,
20
20
  "Reply with the summary only."
@@ -26,7 +26,7 @@ ${clip(task.source, maxSourceChars)}`,
26
26
  return [...new Set(named.filter((key) => known.has(key)))];
27
27
  }, outcomeOf = (task, reply) => task.mode === "select" ? { keep: keysOf(task, reply), summary: Option.none() } : { keep: [], summary: reply.trim().length === 0 ? Option.none() : Option.some(reply.trim()) }, memoryDigestPlugin = definePlugin({
28
28
  id: "@xandreed/plugin-memory-digest",
29
- version: "0.12.0",
29
+ version: "0.14.0",
30
30
  scope: "session",
31
31
  config: MemoryDigestConfig,
32
32
  defaults: memoryDigestDefaults,
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@xandreed/plugin-memory-digest",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
+ "engines": {
5
+ "node": ">=24",
6
+ "bun": ">=1.3.0"
7
+ },
4
8
  "type": "module",
5
9
  "main": "./dist/index.js",
6
10
  "exports": {
@@ -10,8 +14,8 @@
10
14
  }
11
15
  },
12
16
  "dependencies": {
13
- "@xandreed/core": "0.12.0",
14
- "effect": "4.0.0-rc.118"
17
+ "@xandreed/core": "0.14.0",
18
+ "effect": "4.0.7"
15
19
  },
16
20
  "private": false,
17
21
  "types": "./dist/index.d.ts",
@@ -22,9 +26,5 @@
22
26
  "README.md",
23
27
  "LICENSE"
24
28
  ],
25
- "engines": {
26
- "node": ">=24",
27
- "bun": ">=1.3.0"
28
- },
29
29
  "license": "MIT"
30
30
  }