dsh-mnemon-source-journal 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +50 -2
- package/cordis.patch.yml +6 -0
- package/lib/index.js +320 -0
- package/package.json +41 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 chenge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-mnemon-source-journal
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
把逐字对话账本接成 [dsh-mnemon](https://github.com/omdsh-dev/dsh-mnemon) 认得的一个**情景记忆来源**。
|
|
4
|
+
|
|
5
|
+
账本是按天、按会话分篇的 Markdown(一行一句原话,不经过模型改写)。这个来源让它变得可检索:按日期翻、按词搜、整篇取回。
|
|
6
|
+
|
|
7
|
+
## 设计取舍
|
|
8
|
+
|
|
9
|
+
- **不进每轮上下文**。账本动辄几十万字,投影是空的(`fragments: []`),只有真的问到时才走检索。
|
|
10
|
+
- **一次最多给 2600 字**,前后各留一段上下文,避免把预算吃光。
|
|
11
|
+
- **最多扫 4000 个文件**,更早的自己清理。
|
|
12
|
+
- **只读**。它不写账本,写账本是别的事。
|
|
13
|
+
|
|
14
|
+
这两个数在 `lib/index.js` 顶部:`MAX_ITEM_CHARS = 2600`、`MAX_FILES = 4000`。
|
|
15
|
+
|
|
16
|
+
## 注意:它声明的是 `episodic` 角色
|
|
17
|
+
|
|
18
|
+
mnemon 的默认策略 `default-three-tier` 只认三档(`runtime` / `documents` / `memory-spaces`),**不接收 `episodic`**。所以挂上去之后:
|
|
19
|
+
|
|
20
|
+
- 它不会出现在每轮投影里(这本来就是设计意图);
|
|
21
|
+
- 但用 `default-three-tier` 时它连 Route 也不注册,View 里只会留一条 `unsupported-source-role` 诊断 —— 等于装了不生效。
|
|
22
|
+
|
|
23
|
+
两条路:
|
|
24
|
+
1. 换用 `general` 策略(会把它当 selection 收进去);
|
|
25
|
+
2. 等上游给策略加角色白名单。
|
|
26
|
+
|
|
27
|
+
## 你可能不需要它
|
|
28
|
+
|
|
29
|
+
如果你的流程已经是「本地记账 → 跨天归档进库 → 从库里检索」,那本地账本只是中间态,第二天内容就进库了,没必要再检索本地原始文件。这种情况下这两个包加在一起是冗余的。[dsh-weknora-journal](https://www.npmjs.com/package/dsh-weknora-journal) 负责归档,这个包只负责让本地账本可查。
|
|
30
|
+
|
|
31
|
+
## 安装
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm add dsh-mnemon-source-journal
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
包自带 bundle patch,装进 profile 的 `dsh.profile.bundles` 即可,不需要手工改 `cordis.patch.yml`。
|
|
38
|
+
|
|
39
|
+
## 账本放哪
|
|
40
|
+
|
|
41
|
+
默认读 `~/.mnemon/transcripts`,文件名形如 `2026-11-28-<会话短号>.md`。文件名带日期即可被按天归档。
|
|
42
|
+
|
|
43
|
+
最多读 4000 个文件,更早的请自行清理。
|
|
44
|
+
|
|
45
|
+
## 依赖
|
|
46
|
+
|
|
47
|
+
- `dsh-mnemon` >= 0.5.40
|
|
48
|
+
|
|
49
|
+
## 许可
|
|
50
|
+
|
|
51
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bundle layer for dsh-mnemon-source-journal.
|
|
2
|
+
# Mounts one host-plane source: the daily transcripts under ~/.mnemon/transcripts
|
|
3
|
+
# exposed to mnemon as a narrative source (search only, no per-turn projection). Role is configurable.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: mnemon-source-journal
|
|
6
|
+
name: "dsh-mnemon-source-journal"
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
// 逐字账本 · mnemon 的「来源」
|
|
2
|
+
//
|
|
3
|
+
// 这个包只做一件事:把 ~/.mnemon/transcripts 里那份逐字记录,变成 mnemon 认得的一个来源。
|
|
4
|
+
// 这样它和 WeKnora、和自动归档的文档是平级的——能浏览、能按日期翻、能按词搜、能整篇读。
|
|
5
|
+
//
|
|
6
|
+
// 为什么不是"策略":策略和策略扩展都强制要求确定性(同输入必须同输出,不许调模型),
|
|
7
|
+
// 而账本天生是"只增不改的流水",最合适的身份就是来源(Source)。
|
|
8
|
+
//
|
|
9
|
+
// 设计取舍:
|
|
10
|
+
// - 不在每轮注入里塞账本(那是几百万字),只在被问到的时候按词检索;
|
|
11
|
+
// - 检索用词面打分,不走向量:账本本来就是原文,词面命中就是最好的证据;
|
|
12
|
+
// - 一条结果最多给 2600 字,够看清上下文,又不至于一口气吃掉预算。
|
|
13
|
+
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
15
|
+
import { appendFileSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
16
|
+
import { homedir } from "node:os";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { COMPOSABLE_MEMORY_API_VERSION } from "dsh-mnemon/contracts";
|
|
19
|
+
import { defineMemoryPlugin, defineMemorySource, installMemory, memoryConfigurationDigest, truncateMemoryText } from "dsh-mnemon/extension-sdk";
|
|
20
|
+
|
|
21
|
+
const name = "dsh-mnemon-source-journal";
|
|
22
|
+
const inject = ["mnemonMemory"];
|
|
23
|
+
|
|
24
|
+
const DEFAULT_DIR = join(homedir(), ".mnemon", "transcripts");
|
|
25
|
+
const FILE_PATTERN = /^\d{4}-\d{2}-\d{2}(-[0-9a-zA-Z]{1,16})?\.md$/u;
|
|
26
|
+
const MAX_ITEM_CHARS = 2600;
|
|
27
|
+
const MAX_FILES = 4000;
|
|
28
|
+
const LOAD_LOG = join(homedir(), ".mnemon", "state", "journal-source.log");
|
|
29
|
+
let loggedOnce = false;
|
|
30
|
+
|
|
31
|
+
function logOnce(message) {
|
|
32
|
+
if (loggedOnce) return;
|
|
33
|
+
loggedOnce = true;
|
|
34
|
+
try {
|
|
35
|
+
appendFileSync(LOAD_LOG, new Date().toISOString() + " " + message + "\n");
|
|
36
|
+
} catch {
|
|
37
|
+
// 日志写不了不影响主流程
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ZH_STOP = new Set([
|
|
42
|
+
"什么", "怎么", "这个", "那个", "我们", "你们", "他们", "可以", "不是", "就是", "还是",
|
|
43
|
+
"如果", "因为", "所以", "但是", "然后", "这样", "那样", "多少", "哪些", "如何", "是否",
|
|
44
|
+
"已经", "需要", "应该", "帮我", "给我", "一下", "看看", "知道", "告诉", "请问", "之前",
|
|
45
|
+
"以后", "今天", "明天", "昨天", "为什", "么时", "时候", "是不", "有没", "能不", "不会",
|
|
46
|
+
"有什", "么样", "的话", "一个", "现在", "没有", "我要", "你能", "我的", "你的", "他的",
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const EN_STOP = new Set([
|
|
50
|
+
"the", "and", "for", "are", "but", "not", "you", "all", "can", "has", "had", "her", "was",
|
|
51
|
+
"one", "our", "out", "day", "get", "him", "his", "how", "man", "new", "now", "old", "see",
|
|
52
|
+
"two", "way", "who", "did", "its", "let", "put", "say", "she", "too", "use", "with", "this",
|
|
53
|
+
"that", "from", "they", "what", "when", "will", "would", "there", "their", "about", "into",
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
function tokensOf(text) {
|
|
57
|
+
const tokens = [];
|
|
58
|
+
for (const match of text.matchAll(/[A-Za-z][A-Za-z0-9_.+#-]{1,}/gu)) {
|
|
59
|
+
const word = match[0].toLowerCase();
|
|
60
|
+
if (word.length >= 2 && !EN_STOP.has(word)) tokens.push(word);
|
|
61
|
+
}
|
|
62
|
+
for (const match of text.matchAll(/[\u4e00-\u9fa5]{2,}/gu)) {
|
|
63
|
+
const run = match[0];
|
|
64
|
+
for (let index = 0; index + 2 <= run.length; index += 1) {
|
|
65
|
+
const word = run.slice(index, index + 2);
|
|
66
|
+
if (!ZH_STOP.has(word)) tokens.push(word);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return [...new Set(tokens)];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function readDir(dir) {
|
|
73
|
+
let names = [];
|
|
74
|
+
try {
|
|
75
|
+
names = readdirSync(dir);
|
|
76
|
+
} catch {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
const files = [];
|
|
80
|
+
for (const fileName of names) {
|
|
81
|
+
if (!FILE_PATTERN.test(fileName)) continue;
|
|
82
|
+
const full = join(dir, fileName);
|
|
83
|
+
try {
|
|
84
|
+
const info = statSync(full);
|
|
85
|
+
if (!info.isFile()) continue;
|
|
86
|
+
files.push({ id: fileName.replace(/\.md$/u, ""), fileName, path: full, size: info.size, mtime: info.mtimeMs });
|
|
87
|
+
} catch {
|
|
88
|
+
// 单个文件读不到就跳过,不影响其余
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
files.sort((left, right) => right.id.localeCompare(left.id));
|
|
92
|
+
return files.slice(0, MAX_FILES);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function revisionOf(files) {
|
|
96
|
+
const hash = createHash("sha256");
|
|
97
|
+
for (const file of files) hash.update(`${file.id}:${file.size}:${file.mtime}\n`);
|
|
98
|
+
return hash.digest("hex").slice(0, 16);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function bodyOf(file) {
|
|
102
|
+
try {
|
|
103
|
+
return readFileSync(file.path, "utf8");
|
|
104
|
+
} catch {
|
|
105
|
+
return "";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 命中一段就把它周围的话一起端出来,不然只给一行「**你** 嗯」没有意义。
|
|
110
|
+
function excerptAround(text, tokens, limit) {
|
|
111
|
+
if (text.length <= limit) return text;
|
|
112
|
+
let best = 0;
|
|
113
|
+
let bestScore = -1;
|
|
114
|
+
const step = 400;
|
|
115
|
+
for (let start = 0; start < text.length; start += step) {
|
|
116
|
+
const slice = text.slice(start, start + limit).toLowerCase();
|
|
117
|
+
let score = 0;
|
|
118
|
+
for (const token of tokens) if (slice.includes(token)) score += token.length >= 3 ? 2 : 1;
|
|
119
|
+
if (score > bestScore) {
|
|
120
|
+
bestScore = score;
|
|
121
|
+
best = start;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const head = best === 0 ? "" : "…";
|
|
125
|
+
return head + text.slice(best, best + limit) + (best + limit < text.length ? "…" : "");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function createJournalSource(config = {}) {
|
|
129
|
+
const dir = typeof config.dir === "string" && config.dir !== "" ? config.dir : DEFAULT_DIR;
|
|
130
|
+
|
|
131
|
+
return defineMemorySource({
|
|
132
|
+
manifest: {
|
|
133
|
+
apiVersion: COMPOSABLE_MEMORY_API_VERSION,
|
|
134
|
+
kind: "source",
|
|
135
|
+
typeId: "journal",
|
|
136
|
+
packageName: name,
|
|
137
|
+
role: "episodic",
|
|
138
|
+
capabilities: ["status", "project", "search", "read"],
|
|
139
|
+
consistency: "namespace-pinned-live-read",
|
|
140
|
+
routes: [
|
|
141
|
+
{
|
|
142
|
+
id: "search",
|
|
143
|
+
description: "在逐字账本里按词检索:问一件事时,把当天那段原话找出来。",
|
|
144
|
+
capability: "search",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
required: ["query"],
|
|
148
|
+
additionalProperties: false,
|
|
149
|
+
properties: {
|
|
150
|
+
query: { type: "string" },
|
|
151
|
+
limit: { type: "integer" },
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
maxCalls: 4,
|
|
155
|
+
maxResults: 20,
|
|
156
|
+
maxCharacters: 16000,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
actions: [],
|
|
160
|
+
},
|
|
161
|
+
create(context) {
|
|
162
|
+
const files = () => readDir(dir);
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
facts() {
|
|
166
|
+
const current = files();
|
|
167
|
+
logOnce("facts() 被调用,账本 " + current.length + " 本");
|
|
168
|
+
const today = new Date();
|
|
169
|
+
const stamp = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, "0")}-${String(today.getDate()).padStart(2, "0")}`;
|
|
170
|
+
const days = current.filter((file) => file.id.slice(0, 10) === stamp).length;
|
|
171
|
+
return {
|
|
172
|
+
sourceInstanceKey: context.sourceInstanceKey,
|
|
173
|
+
sourceTypeId: "journal",
|
|
174
|
+
role: "episodic",
|
|
175
|
+
availability: "ready",
|
|
176
|
+
revision: revisionOf(current),
|
|
177
|
+
capabilities: ["status", "project", "search", "read"],
|
|
178
|
+
routeIds: ["search"],
|
|
179
|
+
actionIds: [],
|
|
180
|
+
hints: { sessions: current.length, todaySessions: days },
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
project(request) {
|
|
185
|
+
const current = files();
|
|
186
|
+
return {
|
|
187
|
+
// 账本不参与每轮注入:它是几百万字,塞进去只会把上下文挤爆。
|
|
188
|
+
// 想用它的时候走 search 这条道。
|
|
189
|
+
fragments: [],
|
|
190
|
+
readGrant: {
|
|
191
|
+
id: `${context.sourceInstanceKey}/grant/${revisionOf(current)}`,
|
|
192
|
+
sourceInstanceKey: context.sourceInstanceKey,
|
|
193
|
+
schema: "dsh-mnemon.journal/v1",
|
|
194
|
+
value: { ids: current.map((file) => file.id) },
|
|
195
|
+
revision: revisionOf(current),
|
|
196
|
+
consistency: "namespace-pinned-live-read",
|
|
197
|
+
},
|
|
198
|
+
presentation: {
|
|
199
|
+
visibleItems: current.length,
|
|
200
|
+
totalItems: current.length,
|
|
201
|
+
items: current.slice(0, 24).map((file) => ({
|
|
202
|
+
id: file.id,
|
|
203
|
+
title: truncateMemoryText(file.id, 160),
|
|
204
|
+
excerpt: truncateMemoryText(`${Math.round(file.size / 1024)} KB`, 60),
|
|
205
|
+
})),
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
async query(request) {
|
|
211
|
+
const input = request.input ?? {};
|
|
212
|
+
const query = typeof input.query === "string" ? input.query.trim() : "";
|
|
213
|
+
const limitValue = Number(input.limit);
|
|
214
|
+
const limit = Number.isFinite(limitValue) && limitValue > 0 ? Math.min(20, Math.floor(limitValue)) : 10;
|
|
215
|
+
const tokens = tokensOf(query);
|
|
216
|
+
const current = files();
|
|
217
|
+
|
|
218
|
+
const scored = [];
|
|
219
|
+
for (const file of current) {
|
|
220
|
+
if (tokens.length === 0) {
|
|
221
|
+
scored.push({ file, score: 0, hits: 0 });
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const text = bodyOf(file).toLowerCase();
|
|
225
|
+
let score = 0;
|
|
226
|
+
let hits = 0;
|
|
227
|
+
for (const token of tokens) {
|
|
228
|
+
if (!text.includes(token)) continue;
|
|
229
|
+
hits += 1;
|
|
230
|
+
score += token.length >= 3 ? 2 : 1;
|
|
231
|
+
}
|
|
232
|
+
if (file.id.toLowerCase().includes(query.toLowerCase())) score += 3;
|
|
233
|
+
if (hits > 0) scored.push({ file, score, hits });
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// 一个词都没命中时,退成"最近几天的账本",总比什么都不给强。
|
|
237
|
+
const ranked = (scored.length > 0 ? scored : current.map((file) => ({ file, score: 0, hits: 0 })))
|
|
238
|
+
.sort((left, right) => right.score - left.score || right.file.id.localeCompare(left.file.id))
|
|
239
|
+
.slice(0, limit);
|
|
240
|
+
|
|
241
|
+
let remaining = request.route.maxCharacters ?? 16000;
|
|
242
|
+
const items = [];
|
|
243
|
+
let truncated = scored.length > limit;
|
|
244
|
+
for (const row of ranked) {
|
|
245
|
+
if (remaining <= 0) {
|
|
246
|
+
truncated = true;
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
const raw = bodyOf(row.file);
|
|
250
|
+
const budget = Math.min(MAX_ITEM_CHARS, remaining);
|
|
251
|
+
const text = excerptAround(raw, tokens, budget);
|
|
252
|
+
remaining -= text.length;
|
|
253
|
+
items.push({
|
|
254
|
+
id: row.file.id,
|
|
255
|
+
text,
|
|
256
|
+
score: row.score,
|
|
257
|
+
revision: String(Math.round(row.file.mtime)),
|
|
258
|
+
provenance: {
|
|
259
|
+
kind: "match",
|
|
260
|
+
day: row.file.id.slice(0, 10),
|
|
261
|
+
file: row.file.fileName,
|
|
262
|
+
bytes: row.file.size,
|
|
263
|
+
hits: row.hits,
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
metadata: { query, total: scored.length, sessions: current.length },
|
|
270
|
+
id: `evidence:${context.sourceInstanceKey}:${Date.now()}`,
|
|
271
|
+
viewId: request.view.id,
|
|
272
|
+
routeId: request.route.id,
|
|
273
|
+
sourceInstanceKey: context.sourceInstanceKey,
|
|
274
|
+
observedAt: new Date().toISOString(),
|
|
275
|
+
truncated,
|
|
276
|
+
items,
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const LABEL = {
|
|
285
|
+
en: "Transcript Journal",
|
|
286
|
+
"zh-CN": "逐字账本",
|
|
287
|
+
ja: "逐字ジャーナル",
|
|
288
|
+
es: "Diario literal",
|
|
289
|
+
fr: "Journal littéral",
|
|
290
|
+
de: "Wörtliches Journal",
|
|
291
|
+
ru: "Дословный журнал",
|
|
292
|
+
pt: "Diário literal",
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const memoryPlugin = defineMemoryPlugin({
|
|
296
|
+
packageName: name,
|
|
297
|
+
label: LABEL,
|
|
298
|
+
description: {
|
|
299
|
+
en: "The raw, word-for-word record of past sessions, searchable by date and keyword.",
|
|
300
|
+
"zh-CN": "过去每一天每个会话的逐字原话,能按日期翻、按词搜,不做任何改写。",
|
|
301
|
+
ja: "過去のセッションの逐語記録。日付とキーワードで検索できる。",
|
|
302
|
+
es: "El registro literal de sesiones pasadas, buscable por fecha y palabra clave.",
|
|
303
|
+
fr: "Le compte rendu mot à mot des sessions passées, cherchable par date et mot-clé.",
|
|
304
|
+
de: "Das wörtliche Protokoll vergangener Sitzungen, durchsuchbar nach Datum und Stichwort.",
|
|
305
|
+
ru: "Дословная запись прошлых сессий с поиском по дате и ключевому слову.",
|
|
306
|
+
pt: "O registro literal de sessões passadas, pesquisável por data e palavra-chave.",
|
|
307
|
+
},
|
|
308
|
+
roles: ["source"],
|
|
309
|
+
provides: [{ id: "source" }],
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
function apply(ctx, config = {}) {
|
|
313
|
+
installMemory(
|
|
314
|
+
ctx,
|
|
315
|
+
{ plugin: memoryPlugin, sources: [createJournalSource(config)] },
|
|
316
|
+
{ effectiveDigest: memoryConfigurationDigest(config) },
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export { apply, createJournalSource, inject, memoryPlugin, name };
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-source-journal",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Event-driven conversation journal for mnemon. Appends every turn to a dated transcript so nothing is lost between compactions.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20"
|
|
8
|
+
},
|
|
9
|
+
"main": "./lib/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./lib/index.js",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"README.md",
|
|
17
|
+
"cordis.patch.yml",
|
|
18
|
+
"package.json"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"dsh-mnemon": "*"
|
|
22
|
+
},
|
|
23
|
+
"dsh": {
|
|
24
|
+
"bundle": {
|
|
25
|
+
"patch": "./cordis.patch.yml"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"dsh",
|
|
30
|
+
"dsh-plugin",
|
|
31
|
+
"mnemon",
|
|
32
|
+
"mnemon-source",
|
|
33
|
+
"journal",
|
|
34
|
+
"transcript",
|
|
35
|
+
"memory"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"author": "chenge",
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"registry": "https://registry.npmjs.org"
|
|
42
|
+
}
|
|
43
|
+
}
|