@chenhw7/dsh-memory 0.3.0 → 0.5.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.
Files changed (55) hide show
  1. package/README.md +7 -4
  2. package/README.zh-CN.md +7 -4
  3. package/lib/benchmark/index.d.ts +125 -0
  4. package/lib/benchmark/index.d.ts.map +1 -0
  5. package/lib/benchmark/index.js +150 -0
  6. package/lib/benchmark/index.js.map +1 -0
  7. package/lib/brand.d.ts +11 -0
  8. package/lib/brand.d.ts.map +1 -1
  9. package/lib/brand.js +7 -0
  10. package/lib/brand.js.map +1 -1
  11. package/lib/client/index.js +1666 -42
  12. package/lib/context/index.d.ts +22 -3
  13. package/lib/context/index.d.ts.map +1 -1
  14. package/lib/context/index.js +59 -13
  15. package/lib/context/index.js.map +1 -1
  16. package/lib/context/policy.d.ts +6 -0
  17. package/lib/context/policy.d.ts.map +1 -1
  18. package/lib/context/policy.js +26 -9
  19. package/lib/context/policy.js.map +1 -1
  20. package/lib/index.d.ts +44 -5
  21. package/lib/index.d.ts.map +1 -1
  22. package/lib/index.js +48 -2
  23. package/lib/index.js.map +1 -1
  24. package/lib/notes/index.d.ts +1 -1
  25. package/lib/notes/index.d.ts.map +1 -1
  26. package/lib/notes/index.js +37 -7
  27. package/lib/notes/index.js.map +1 -1
  28. package/lib/notes/writer.d.ts +33 -0
  29. package/lib/notes/writer.d.ts.map +1 -1
  30. package/lib/notes/writer.js +61 -1
  31. package/lib/notes/writer.js.map +1 -1
  32. package/lib/remote/index.d.ts +102 -5
  33. package/lib/remote/index.d.ts.map +1 -1
  34. package/lib/remote/index.js +138 -8
  35. package/lib/remote/index.js.map +1 -1
  36. package/lib/remote/typert.remote-client.d.ts +38 -5
  37. package/lib/remote/typert.remote-client.js +8 -2
  38. package/lib/review/extract.d.ts +48 -4
  39. package/lib/review/extract.d.ts.map +1 -1
  40. package/lib/review/extract.js +164 -11
  41. package/lib/review/extract.js.map +1 -1
  42. package/lib/review/index.d.ts +6 -0
  43. package/lib/review/index.d.ts.map +1 -1
  44. package/lib/review/index.js +12 -10
  45. package/lib/review/index.js.map +1 -1
  46. package/lib/store/index.d.ts +56 -3
  47. package/lib/store/index.d.ts.map +1 -1
  48. package/lib/store/index.js +238 -9
  49. package/lib/store/index.js.map +1 -1
  50. package/lib/tool/index.d.ts.map +1 -1
  51. package/lib/tool/index.js +156 -25
  52. package/lib/tool/index.js.map +1 -1
  53. package/lib/types.d.ts +83 -2
  54. package/lib/types.d.ts.map +1 -1
  55. package/package.json +14 -1
@@ -6,9 +6,18 @@
6
6
  * write-serialized through the existing store contract. The service delegates to
7
7
  * `ctx.memory` — it does not duplicate the store.
8
8
  *
9
- * Host integration: the `./remote` subpath must be mounted in `dsh-api-remotes`
10
- * (see TODO §3.8 verification notes). Write methods should be pinned to loopback
11
- * via `PRIVILEGED_METHODS`.
9
+ * Host integration: the `./remote-service` subpath is mounted as the
10
+ * `memory-remote` composition entry (cordis.patch.yml); the browser half mounts
11
+ * the matching client contribution itself (`src/typert.remote-client.js`).
12
+ *
13
+ * Deployment security (verified against the harness sources, 2026-08): there is
14
+ * NO per-method `PRIVILEGED_METHODS` registry — the trust fence is transport
15
+ * level. Every `/api` request passes `api-request-trust`
16
+ * (`packages/client/connection/src/api-request-trust.ts`), which admits
17
+ * loopback / deployment-derived LAN literals / declared `trustedHosts` hosts
18
+ * and rejects DNS-rebinding and cross-site requests before any RPC runs. So a
19
+ * non-loopback caller cannot reach `add`/`update`/`remove` at all; nothing to
20
+ * pin per method.
12
21
  *
13
22
  * @module @chenhw7/dsh-memory/remote
14
23
  */
@@ -68,9 +77,28 @@ function toEntryJson(entry) {
68
77
  createdAt: entry.createdAt,
69
78
  updatedAt: entry.updatedAt,
70
79
  ...entry.category !== undefined ? { category: entry.category } : {},
80
+ ...entry.summary !== undefined ? { summary: entry.summary } : {},
71
81
  ...entry.projectName !== undefined ? { projectName: entry.projectName } : {},
72
82
  ...entry.pinned !== undefined ? { pinned: entry.pinned } : {},
73
83
  ...entry.lastRecalledAt !== undefined ? { lastRecalledAt: entry.lastRecalledAt } : {},
84
+ ...entry.staleSince !== undefined ? { staleSince: entry.staleSince } : {},
85
+ };
86
+ }
87
+ /** Project one {@link MemorySuggestion} to the wire shape. */
88
+ function toSuggestionJson(suggestion) {
89
+ return {
90
+ id: suggestion.id,
91
+ scope: suggestion.scope,
92
+ content: suggestion.content,
93
+ hits: suggestion.hits,
94
+ firstSeenAt: suggestion.firstSeenAt,
95
+ lastSeenAt: suggestion.lastSeenAt,
96
+ source: suggestion.source,
97
+ ...suggestion.category !== undefined ? { category: suggestion.category } : {},
98
+ ...suggestion.summary !== undefined ? { summary: suggestion.summary } : {},
99
+ ...suggestion.projectName !== undefined ? { projectName: suggestion.projectName } : {},
100
+ ...suggestion.targetEntryId !== undefined ? { targetEntryId: suggestion.targetEntryId } : {},
101
+ ...suggestion.sessionId !== undefined ? { sessionId: suggestion.sessionId } : {},
74
102
  };
75
103
  }
76
104
  // ─── Service class ──────────────────────────────────────────────────────────
@@ -87,9 +115,14 @@ let MemoryRemoteService = (() => {
87
115
  let _get_decorators;
88
116
  let _add_decorators;
89
117
  let _update_decorators;
90
- let _remove_decorators;
118
+ let _removeEntry_decorators;
91
119
  let _pin_decorators;
120
+ let _suggestList_decorators;
121
+ let _suggestAdopt_decorators;
122
+ let _suggestReject_decorators;
123
+ let _archive_decorators;
92
124
  let _health_decorators;
125
+ let _projects_decorators;
93
126
  let _auditLog_decorators;
94
127
  return class MemoryRemoteService extends _classSuper {
95
128
  static {
@@ -99,18 +132,28 @@ let MemoryRemoteService = (() => {
99
132
  _get_decorators = [Remote('get')];
100
133
  _add_decorators = [Remote('add')];
101
134
  _update_decorators = [Remote('update')];
102
- _remove_decorators = [Remote('remove')];
135
+ _removeEntry_decorators = [Remote('removeEntry')];
103
136
  _pin_decorators = [Remote('pin')];
137
+ _suggestList_decorators = [Remote('suggestList')];
138
+ _suggestAdopt_decorators = [Remote('suggestAdopt')];
139
+ _suggestReject_decorators = [Remote('suggestReject')];
140
+ _archive_decorators = [Remote('archive')];
104
141
  _health_decorators = [Remote('health')];
142
+ _projects_decorators = [Remote('projects')];
105
143
  _auditLog_decorators = [Remote('auditLog')];
106
144
  __esDecorate(this, null, _list_decorators, { kind: "method", name: "list", static: false, private: false, access: { has: obj => "list" in obj, get: obj => obj.list }, metadata: _metadata }, null, _instanceExtraInitializers);
107
145
  __esDecorate(this, null, _search_decorators, { kind: "method", name: "search", static: false, private: false, access: { has: obj => "search" in obj, get: obj => obj.search }, metadata: _metadata }, null, _instanceExtraInitializers);
108
146
  __esDecorate(this, null, _get_decorators, { kind: "method", name: "get", static: false, private: false, access: { has: obj => "get" in obj, get: obj => obj.get }, metadata: _metadata }, null, _instanceExtraInitializers);
109
147
  __esDecorate(this, null, _add_decorators, { kind: "method", name: "add", static: false, private: false, access: { has: obj => "add" in obj, get: obj => obj.add }, metadata: _metadata }, null, _instanceExtraInitializers);
110
148
  __esDecorate(this, null, _update_decorators, { kind: "method", name: "update", static: false, private: false, access: { has: obj => "update" in obj, get: obj => obj.update }, metadata: _metadata }, null, _instanceExtraInitializers);
111
- __esDecorate(this, null, _remove_decorators, { kind: "method", name: "remove", static: false, private: false, access: { has: obj => "remove" in obj, get: obj => obj.remove }, metadata: _metadata }, null, _instanceExtraInitializers);
149
+ __esDecorate(this, null, _removeEntry_decorators, { kind: "method", name: "removeEntry", static: false, private: false, access: { has: obj => "removeEntry" in obj, get: obj => obj.removeEntry }, metadata: _metadata }, null, _instanceExtraInitializers);
112
150
  __esDecorate(this, null, _pin_decorators, { kind: "method", name: "pin", static: false, private: false, access: { has: obj => "pin" in obj, get: obj => obj.pin }, metadata: _metadata }, null, _instanceExtraInitializers);
151
+ __esDecorate(this, null, _suggestList_decorators, { kind: "method", name: "suggestList", static: false, private: false, access: { has: obj => "suggestList" in obj, get: obj => obj.suggestList }, metadata: _metadata }, null, _instanceExtraInitializers);
152
+ __esDecorate(this, null, _suggestAdopt_decorators, { kind: "method", name: "suggestAdopt", static: false, private: false, access: { has: obj => "suggestAdopt" in obj, get: obj => obj.suggestAdopt }, metadata: _metadata }, null, _instanceExtraInitializers);
153
+ __esDecorate(this, null, _suggestReject_decorators, { kind: "method", name: "suggestReject", static: false, private: false, access: { has: obj => "suggestReject" in obj, get: obj => obj.suggestReject }, metadata: _metadata }, null, _instanceExtraInitializers);
154
+ __esDecorate(this, null, _archive_decorators, { kind: "method", name: "archive", static: false, private: false, access: { has: obj => "archive" in obj, get: obj => obj.archive }, metadata: _metadata }, null, _instanceExtraInitializers);
113
155
  __esDecorate(this, null, _health_decorators, { kind: "method", name: "health", static: false, private: false, access: { has: obj => "health" in obj, get: obj => obj.health }, metadata: _metadata }, null, _instanceExtraInitializers);
156
+ __esDecorate(this, null, _projects_decorators, { kind: "method", name: "projects", static: false, private: false, access: { has: obj => "projects" in obj, get: obj => obj.projects }, metadata: _metadata }, null, _instanceExtraInitializers);
114
157
  __esDecorate(this, null, _auditLog_decorators, { kind: "method", name: "auditLog", static: false, private: false, access: { has: obj => "auditLog" in obj, get: obj => obj.auditLog }, metadata: _metadata }, null, _instanceExtraInitializers);
115
158
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
116
159
  }
@@ -129,7 +172,10 @@ let MemoryRemoteService = (() => {
129
172
  return { entries: [], total: 0 };
130
173
  const scope = request.scope;
131
174
  const projectName = request.projectName;
132
- const all = store.list(scope, projectName);
175
+ // Newest first: the management UI is a recency-oriented inbox, and lazy
176
+ // loading must surface fresh memories in the first batch. Sorted here —
177
+ // not in the store — so other store.list consumers keep their contract.
178
+ const all = [...store.list(scope, projectName)].sort((a, b) => b.createdAt - a.createdAt);
133
179
  const total = all.length;
134
180
  const offset = request.offset ?? 0;
135
181
  const limit = request.limit ?? 100;
@@ -141,6 +187,7 @@ let MemoryRemoteService = (() => {
141
187
  if (store === undefined)
142
188
  return { entries: [], total: 0 };
143
189
  const query = buildSearchQuery(request);
190
+ query.recordRecall = false;
144
191
  const result = store.search(query);
145
192
  return { entries: result.entries.map(toEntryJson), total: result.total };
146
193
  }
@@ -181,6 +228,7 @@ let MemoryRemoteService = (() => {
181
228
  source: 'ui',
182
229
  ...request.content !== undefined ? { content: request.content } : {},
183
230
  ...request.category !== undefined ? { category: request.category } : {},
231
+ ...request.summary !== undefined ? { summary: request.summary } : {},
184
232
  };
185
233
  const updated = await store.update(request.id, input);
186
234
  if (updated === undefined)
@@ -191,7 +239,13 @@ let MemoryRemoteService = (() => {
191
239
  return { found: false, error: e instanceof Error ? e.message : 'update failed' };
192
240
  }
193
241
  }
194
- async remove(request) {
242
+ /**
243
+ * Delete one entry. Named `removeEntry` rather than `remove`: the gateway's
244
+ * client-side namespace service reserves a handful of member names
245
+ * (`remove` among them — its internal uninstall method), and a contribution
246
+ * descriptor carrying one of those names fails validation at mount time.
247
+ */
248
+ async removeEntry(request) {
195
249
  const store = this.memory();
196
250
  if (store === undefined)
197
251
  return { removed: false };
@@ -209,6 +263,64 @@ let MemoryRemoteService = (() => {
209
263
  return { found: false };
210
264
  return { entry: toEntryJson(entry), found: true };
211
265
  }
266
+ /**
267
+ * Pending-review queue for the Memory section's review tab (P1-1). Highest
268
+ * `hits` first — the store's ordering already encodes "frequency is signal".
269
+ */
270
+ suggestList() {
271
+ const store = this.memory();
272
+ if (store === undefined)
273
+ return { suggestions: [] };
274
+ return { suggestions: store.listSuggestions().map(toSuggestionJson) };
275
+ }
276
+ /**
277
+ * Adopt one pending proposal, optionally with human edits. The write goes
278
+ * through the store contract (scanner, audit with source `'ui'`), so the
279
+ * human decision lands exactly like a hand-made edit.
280
+ */
281
+ async suggestAdopt(request) {
282
+ const store = this.memory();
283
+ if (store === undefined)
284
+ return { found: false, error: 'memory service not available' };
285
+ try {
286
+ const entry = await store.adoptSuggestion(request.id, {
287
+ ...(request.content !== undefined ? { content: request.content } : {}),
288
+ ...(request.category !== undefined ? { category: request.category } : {}),
289
+ ...(request.summary !== undefined ? { summary: request.summary } : {}),
290
+ });
291
+ if (entry === undefined)
292
+ return { found: false };
293
+ return { entry: toEntryJson(entry), found: true };
294
+ }
295
+ catch (e) {
296
+ return { found: false, error: e instanceof Error ? e.message : 'adopt failed' };
297
+ }
298
+ }
299
+ /** Reject one pending proposal: the row leaves the queue, nothing is written. */
300
+ async suggestReject(request) {
301
+ const store = this.memory();
302
+ if (store === undefined)
303
+ return { rejected: false };
304
+ const rejected = await store.rejectSuggestion(request.id);
305
+ return { rejected };
306
+ }
307
+ /**
308
+ * Manual dormancy toggle (P1-7 archive): `archived: true` stamps
309
+ * `staleSince` (hidden from injection, still searchable); false lifts it.
310
+ * Directly reuses the soft-decay representation so every existing surface
311
+ * (injection filters, stale badges, recall-revival) behaves consistently.
312
+ */
313
+ async archive(request) {
314
+ const store = this.memory();
315
+ if (store === undefined)
316
+ return { found: false };
317
+ const entry = request.archived
318
+ ? await store.archiveEntry(request.id)
319
+ : await store.unarchiveEntry(request.id);
320
+ if (entry === undefined)
321
+ return { found: false };
322
+ return { entry: toEntryJson(entry), found: true };
323
+ }
212
324
  health() {
213
325
  const store = this.memory();
214
326
  if (store === undefined) {
@@ -221,12 +333,30 @@ let MemoryRemoteService = (() => {
221
333
  pinned: h.pinned,
222
334
  auditRecords: h.auditRecords,
223
335
  };
336
+ if (h.stale !== undefined)
337
+ result.stale = h.stale;
224
338
  if (h.lastActivityTs !== undefined)
225
339
  result.lastActivityTs = h.lastActivityTs;
226
340
  if (h.lastExtractionTs !== undefined)
227
341
  result.lastExtractionTs = h.lastExtractionTs;
228
342
  return result;
229
343
  }
344
+ /**
345
+ * Distinct project names across all `project`-scoped entries — the data
346
+ * source for the management UI's workspace selector. Aggregated here from
347
+ * `store.list('project')` so the store contract stays untouched.
348
+ */
349
+ projects() {
350
+ const store = this.memory();
351
+ if (store === undefined)
352
+ return { projects: [] };
353
+ const names = new Set();
354
+ for (const entry of store.list('project')) {
355
+ if (entry.projectName !== undefined)
356
+ names.add(entry.projectName);
357
+ }
358
+ return { projects: [...names].sort() };
359
+ }
230
360
  auditLog(request) {
231
361
  const store = this.memory();
232
362
  if (store === undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/remote/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAY9E,0BAA0B;AAC1B,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAA;AAEnC,sCAAsC;AACtC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAA;AAQhC;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,IAAI,mBAAmB,CAAC,GAAG,CAAC,CAAA;AAC9B,CAAC;AAiBD,SAAS,WAAW,CAAC,KAAkB;IACrC,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAY;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;QACnE,GAAG,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;QAC5E,GAAG,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;QAC7D,GAAG,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cA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AE,EAAE,CAAA;YAC/C,MAAM,GAAG,GAAG,KAAK,CAAC,cAAc,EAAE,CAAA;YAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,GAAG,CAAA;YAClC,MAAM,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;YACnD,OAAO,EAAE,OAAO,EAAE,CAAA;QACpB,CAAC;;;SAzNU,mBAAmB;AA8NhC,+EAA+E;AAC/E,SAAS,gBAAgB,CAAC,OAA4B;IACpD,MAAM,KAAK,GAAsB,EAAE,CAAA;IACnC,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAG,KAAyC,CAAC,KAAK,GAAG,OAAO,CAAC,KAA6B,CAAA;IACzH,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAAG,KAA+C,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAmC,CAAA;IAC3I,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;QAAG,KAAiC,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;IAC3G,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAG,KAA2B,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IACnF,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAG,KAA2B,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IACnF,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -9,11 +9,28 @@ export interface MemoryEntryJson {
9
9
  scope: 'global' | 'project' | 'user'
10
10
  category?: string
11
11
  content: string
12
+ summary?: string
12
13
  projectName?: string
13
14
  createdAt: number
14
15
  updatedAt: number
15
16
  pinned?: boolean
16
17
  lastRecalledAt?: number
18
+ staleSince?: number
19
+ }
20
+ export type AuditSourceJson = 'tool' | 'review' | 'flush' | 'ui' | 'janitor'
21
+ export interface MemorySuggestionJson {
22
+ id: string
23
+ scope: 'global' | 'project' | 'user'
24
+ category?: string
25
+ content: string
26
+ summary?: string
27
+ projectName?: string
28
+ hits: number
29
+ firstSeenAt: number
30
+ lastSeenAt: number
31
+ targetEntryId?: string
32
+ source: AuditSourceJson
33
+ sessionId?: string
17
34
  }
18
35
  export interface MemoryListResult { entries: readonly MemoryEntryJson[]; total: number }
19
36
  export interface MemorySearchResult { entries: readonly MemoryEntryJson[]; total: number }
@@ -22,21 +39,27 @@ export interface MemoryAddResult { entry?: MemoryEntryJson; error?: string }
22
39
  export interface MemoryUpdateResult { entry?: MemoryEntryJson; found: boolean; error?: string }
23
40
  export interface MemoryRemoveResult { removed: boolean }
24
41
  export interface MemoryPinResult { entry?: MemoryEntryJson; found: boolean }
42
+ export interface MemorySuggestListResult { suggestions: readonly MemorySuggestionJson[] }
43
+ export interface MemorySuggestAdoptRequest { id: string; content?: string; category?: string; summary?: string }
44
+ export interface MemorySuggestAdoptResult { entry?: MemoryEntryJson; found: boolean; error?: string }
45
+ export interface MemorySuggestRejectResult { rejected: boolean }
25
46
  export interface MemoryHealthResult {
26
47
  totalEntries: number
27
48
  byScope: { global: number; project: number; user: number }
28
49
  pinned: number
29
50
  auditRecords: number
51
+ stale?: number
30
52
  lastActivityTs?: number
31
53
  lastExtractionTs?: number
32
54
  }
55
+ export interface MemoryProjectsResult { projects: readonly string[] }
33
56
  export interface AuditEntryJson {
34
57
  id: string
35
58
  op: 'add' | 'update' | 'remove'
36
59
  entryId: string
37
60
  scope: 'global' | 'project' | 'user'
38
61
  category?: string
39
- source: 'tool' | 'review' | 'flush' | 'ui'
62
+ source: AuditSourceJson
40
63
  sessionId?: string
41
64
  ts: number
42
65
  contentPreview: string
@@ -49,10 +72,15 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
49
72
  search: (request: { scope?: string; category?: string; projectName?: string; query?: string; limit?: number }) => Promise<RemoteResult<MemorySearchResult>>
50
73
  get: (request: { id: string }) => Promise<RemoteResult<MemoryGetResult>>
51
74
  add: (request: { scope: string; content: string; category?: string; projectName?: string }) => Promise<RemoteResult<MemoryAddResult>>
52
- update: (request: { id: string; content?: string; category?: string }) => Promise<RemoteResult<MemoryUpdateResult>>
53
- remove: (request: { id: string }) => Promise<RemoteResult<MemoryRemoveResult>>
75
+ update: (request: { id: string; content?: string; category?: string; summary?: string }) => Promise<RemoteResult<MemoryUpdateResult>>
76
+ removeEntry: (request: { id: string }) => Promise<RemoteResult<MemoryRemoveResult>>
54
77
  pin: (request: { id: string; pinned: boolean }) => Promise<RemoteResult<MemoryPinResult>>
78
+ archive: (request: { id: string; archived: boolean }) => Promise<RemoteResult<MemoryPinResult>>
79
+ suggestList: () => Promise<RemoteResult<MemorySuggestListResult>>
80
+ suggestAdopt: (request: MemorySuggestAdoptRequest) => Promise<RemoteResult<MemorySuggestAdoptResult>>
81
+ suggestReject: (request: { id: string }) => Promise<RemoteResult<MemorySuggestRejectResult>>
55
82
  health: () => Promise<RemoteResult<MemoryHealthResult>>
83
+ projects: () => Promise<RemoteResult<MemoryProjectsResult>>
56
84
  auditLog: (request: { limit?: number }) => Promise<RemoteResult<MemoryAuditResult>>
57
85
  }
58
86
  interface TypertRemoteMap {
@@ -60,10 +88,15 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
60
88
  'memoryRemote/search': (request: { scope?: string; category?: string; projectName?: string; query?: string; limit?: number }) => Promise<RemoteResult<MemorySearchResult>>
61
89
  'memoryRemote/get': (request: { id: string }) => Promise<RemoteResult<MemoryGetResult>>
62
90
  'memoryRemote/add': (request: { scope: string; content: string; category?: string; projectName?: string }) => Promise<RemoteResult<MemoryAddResult>>
63
- 'memoryRemote/update': (request: { id: string; content?: string; category?: string }) => Promise<RemoteResult<MemoryUpdateResult>>
64
- 'memoryRemote/remove': (request: { id: string }) => Promise<RemoteResult<MemoryRemoveResult>>
91
+ 'memoryRemote/update': (request: { id: string; content?: string; category?: string; summary?: string }) => Promise<RemoteResult<MemoryUpdateResult>>
92
+ 'memoryRemote/removeEntry': (request: { id: string }) => Promise<RemoteResult<MemoryRemoveResult>>
65
93
  'memoryRemote/pin': (request: { id: string; pinned: boolean }) => Promise<RemoteResult<MemoryPinResult>>
94
+ 'memoryRemote/archive': (request: { id: string; archived: boolean }) => Promise<RemoteResult<MemoryPinResult>>
95
+ 'memoryRemote/suggestList': () => Promise<RemoteResult<MemorySuggestListResult>>
96
+ 'memoryRemote/suggestAdopt': (request: MemorySuggestAdoptRequest) => Promise<RemoteResult<MemorySuggestAdoptResult>>
97
+ 'memoryRemote/suggestReject': (request: { id: string }) => Promise<RemoteResult<MemorySuggestRejectResult>>
66
98
  'memoryRemote/health': () => Promise<RemoteResult<MemoryHealthResult>>
99
+ 'memoryRemote/projects': () => Promise<RemoteResult<MemoryProjectsResult>>
67
100
  'memoryRemote/auditLog': (request: { limit?: number }) => Promise<RemoteResult<MemoryAuditResult>>
68
101
  }
69
102
  interface TypertRemoteNamespaceMap {
@@ -31,8 +31,9 @@ const _remove_param = z.object({}).passthrough()
31
31
  const _remove_result = z.object({}).passthrough()
32
32
  const _pin_param = z.object({}).passthrough()
33
33
  const _pin_result = z.object({}).passthrough()
34
- // health() takes no request parameter — no _health_param schema needed.
34
+ // health() and projects() take no request parameter — no schema needed for them.
35
35
  const _health_result = z.object({}).passthrough()
36
+ const _projects_result = z.object({}).passthrough()
36
37
  const _auditLog_param = z.object({}).passthrough()
37
38
  const _auditLog_result = z.object({}).passthrough()
38
39
 
@@ -60,7 +61,7 @@ const descriptors = [
60
61
  parameters: [{ name: 'request', wire: 'request', source: 'json', codec: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryUpdateRequest`, schema: _update_param } }],
61
62
  result: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryUpdateResult`, schema: _update_result },
62
63
  sourceLocation: { file: 'src/remote/index.ts', line: 0, column: 0 } },
63
- { id: `${pkg}#${ns}/remove`, service: ns, namespace: ns, method: 'remove', invocation: { kind: 'direct' },
64
+ { id: `${pkg}#${ns}/removeEntry`, service: ns, namespace: ns, method: 'removeEntry', invocation: { kind: 'direct' },
64
65
  parameters: [{ name: 'request', wire: 'request', source: 'json', codec: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryRemoveRequest`, schema: _remove_param } }],
65
66
  result: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryRemoveResult`, schema: _remove_result },
66
67
  sourceLocation: { file: 'src/remote/index.ts', line: 0, column: 0 } },
@@ -75,6 +76,11 @@ const descriptors = [
75
76
  parameters: [],
76
77
  result: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryHealthResult`, schema: _health_result },
77
78
  sourceLocation: { file: 'src/remote/index.ts', line: 0, column: 0 } },
79
+ { id: `${pkg}#${ns}/projects`, service: ns, namespace: ns, method: 'projects', invocation: { kind: 'direct' },
80
+ // Same no-parameter shape as health(): projects() takes no request object.
81
+ parameters: [],
82
+ result: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryProjectsResult`, schema: _projects_result },
83
+ sourceLocation: { file: 'src/remote/index.ts', line: 0, column: 0 } },
78
84
  { id: `${pkg}#${ns}/auditLog`, service: ns, namespace: ns, method: 'auditLog', invocation: { kind: 'direct' },
79
85
  parameters: [{ name: 'request', wire: 'request', source: 'json', codec: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryAuditRequest`, schema: _auditLog_param } }],
80
86
  result: { mode: 'strict', typeSymbol: `${pkg}/remote/types#MemoryAuditResult`, schema: _auditLog_result },
@@ -34,6 +34,15 @@ export declare function stripContentTag(content: string): {
34
34
  content: string;
35
35
  category: MemoryCategory | undefined;
36
36
  };
37
+ /**
38
+ * Strip leading date/time/git prefixes the model may have hallucinated onto
39
+ * the content. Applied at the parsing layer so every extraction path
40
+ * (review, flush, pitfall, curator) is covered uniformly. Returns the
41
+ * cleaned content; `createdAt`/`updatedAt` are always written by the store.
42
+ * @param content - the raw extracted content (tags already stripped).
43
+ * @returns the content without any model-authored metadata prefix.
44
+ */
45
+ export declare function stripModelDatePrefix(content: string): string;
37
46
  /**
38
47
  * Flatten a text onto a single line. Embedded newlines in conversation
39
48
  * fragments or stored entries could forge the line-oriented extraction
@@ -43,6 +52,17 @@ export declare function stripContentTag(content: string): {
43
52
  * @returns the single-line form (newline runs replaced by one space).
44
53
  */
45
54
  export declare function flattenFragment(text: string): string;
55
+ /**
56
+ * Strip a leading `[summary:…]` tag from content, returning the extracted
57
+ * summary text and the remaining content. The tag may appear immediately
58
+ * after a category tag (e.g. `"[procedure] [summary:short desc] details"`).
59
+ * @param content - tag-stripped content (category tag already removed).
60
+ * @returns the extracted summary (trimmed, possibly `undefined`) and content.
61
+ */
62
+ export declare function stripSummaryTag(content: string): {
63
+ summary: string | undefined;
64
+ content: string;
65
+ };
46
66
  /** One parsed memory entry awaiting scanner + store validation. */
47
67
  export interface ParsedMemory {
48
68
  /** Which scope the extracted memory belongs to. */
@@ -51,6 +71,8 @@ export interface ParsedMemory {
51
71
  readonly content: string;
52
72
  /** Optional category inferred from the matched signal, when available. */
53
73
  readonly category?: MemoryCategory;
74
+ /** Optional short summary from a `[summary:…]` tag, when present. */
75
+ readonly summary?: string;
54
76
  }
55
77
  /**
56
78
  * Parse the line-oriented extraction output into memory entries. Each
@@ -119,6 +141,22 @@ export declare function collectStreamText(ctx: Context, options: GenerateOptions
119
141
  * @throws when no provider/model route resolves or the stream fails.
120
142
  */
121
143
  export declare function extractMemories(ctx: Context, session: Session, system: string, messages: Message[], signal?: AbortSignal, modelOverride?: ExtractionModelOverride): Promise<ParsedMemory[]>;
144
+ /**
145
+ * Route parsed memory proposals into the human-review queue (P1-1 optional
146
+ * confirm mode). Mirrors {@link storeMemories}' gates exactly — tag stripping,
147
+ * date-prefix stripping, content scan — but instead of writing entries the
148
+ * proposal lands as a suggestion:
149
+ *
150
+ * - near-duplicate of a stored entry → a proposal AGAINST that entry
151
+ * (`targetEntryId`, P1-2 update-re-review semantics);
152
+ * - otherwise a create-proposal, deduped against the queue itself by the
153
+ * store (`observeSuggestion` accumulates `hits` on repeats).
154
+ *
155
+ * The LLM dedup judge does NOT run in this mode: a human is the judge here,
156
+ * and every judge call would only decide which queue row a proposal merges
157
+ * into. Each entry is independent; failures skip that entry without throwing.
158
+ */
159
+ export declare function suggestMemories(ctx: Context, parsed: readonly ParsedMemory[], attachCategory?: MemoryCategory, source?: AuditSource, sessionId?: string, inferredProjectName?: string): Promise<void>;
122
160
  /**
123
161
  * Store parsed memory entries through the scanner and the memory store. Each
124
162
  * entry is independent: a scanner rejection or store failure skips that
@@ -140,8 +178,11 @@ export declare function extractMemories(ctx: Context, session: Session, system:
140
178
  * @param session - the live session, for routing the LLM judge call.
141
179
  * @param modelOverride - optional provider/model override for the judge (§3.6).
142
180
  * @param judgeEnabled - whether to run the LLM judge on prefilter hits (default true).
181
+ * @param confirmMode - when true, proposals land in the human-review queue
182
+ * instead of the store (P1-1); the judge is skipped there (see
183
+ * {@link suggestMemories}).
143
184
  */
144
- export declare function storeMemories(ctx: Context, parsed: readonly ParsedMemory[], attachCategory?: MemoryCategory, source?: AuditSource, sessionId?: string, inferredProjectName?: string, session?: Session, modelOverride?: ExtractionModelOverride, judgeEnabled?: boolean): Promise<void>;
185
+ export declare function storeMemories(ctx: Context, parsed: readonly ParsedMemory[], attachCategory?: MemoryCategory, source?: AuditSource, sessionId?: string, inferredProjectName?: string, session?: Session, modelOverride?: ExtractionModelOverride, judgeEnabled?: boolean, confirmMode?: boolean): Promise<void>;
145
186
  /**
146
187
  * Run the periodic-review extraction: build the review prompt from the
147
188
  * current memory snapshot and the accumulated candidates, extract, and store.
@@ -154,7 +195,7 @@ export declare function storeMemories(ctx: Context, parsed: readonly ParsedMemor
154
195
  * candidates are retried on the next threshold crossing, and dedup makes
155
196
  * re-storing idempotent.
156
197
  */
157
- export declare function runReviewExtraction(ctx: Context, agent: Agent, candidates: readonly MemoryCandidate[], modelOverride?: ExtractionModelOverride, judgeEnabled?: boolean): Promise<number>;
198
+ export declare function runReviewExtraction(ctx: Context, agent: Agent, candidates: readonly MemoryCandidate[], modelOverride?: ExtractionModelOverride, judgeEnabled?: boolean, confirmMode?: boolean): Promise<number>;
158
199
  /** System prompt for the low-frequency curator pass (re-summarize oversized entries). */
159
200
  export declare const CURATOR_SYSTEM_PROMPT: string;
160
201
  /**
@@ -190,9 +231,12 @@ export declare function parseCuratedLines(text: string, allowedIds: readonly str
190
231
  * @param session - the session whose request header routes the call.
191
232
  * @param selected - the oversized entries to curate.
192
233
  * @param modelOverride - optional provider/model override.
234
+ * @param confirmMode - when true, rewrites land as proposals against the
235
+ * targeted entries instead of direct updates (P1-2: the model never
236
+ * silently rewrites a confirmed entry).
193
237
  * @returns the number of entries actually rewritten.
194
238
  */
195
- export declare function runCuration(ctx: Context, session: Session, selected: readonly MemoryEntry[], modelOverride?: ExtractionModelOverride): Promise<number>;
239
+ export declare function runCuration(ctx: Context, session: Session, selected: readonly MemoryEntry[], modelOverride?: ExtractionModelOverride, confirmMode?: boolean): Promise<number>;
196
240
  /**
197
241
  * Run the compaction/dispose flush extraction: build the flush prompt from the
198
242
  * shadowed conversation fragments, extract, and store. Best-effort and
@@ -204,5 +248,5 @@ export declare function runCuration(ctx: Context, session: Session, selected: re
204
248
  * @param modelOverride - optional provider/model override (§3.6).
205
249
  * @returns the number of parsed entries (before scanner/store filtering).
206
250
  */
207
- export declare function runFlushExtraction(ctx: Context, session: Session, fragments: readonly string[], signal?: AbortSignal, modelOverride?: ExtractionModelOverride, judgeEnabled?: boolean): Promise<number>;
251
+ export declare function runFlushExtraction(ctx: Context, session: Session, fragments: readonly string[], signal?: AbortSignal, modelOverride?: ExtractionModelOverride, judgeEnabled?: boolean, confirmMode?: boolean): Promise<number>;
208
252
  //# sourceMappingURL=extract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/review/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAA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