dsh-session-recall 0.7.3 → 0.7.4
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 +10 -0
- package/lib/index.d.ts +10 -2
- package/lib/index.js +4 -3
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -184,6 +184,16 @@ npm test # vitest run
|
|
|
184
184
|
npm run bundle # tsdown → lib/
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
+
## Session toolchain
|
|
188
|
+
|
|
189
|
+
This plugin is one of three layers over the same trusted `ctx.sessionQuery` seam:
|
|
190
|
+
|
|
191
|
+
| Plugin | Layer | Answers |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| [`dsh-session-export`](https://www.npmjs.com/package/dsh-session-export) | Evidence | "What exactly happened in this session?" |
|
|
194
|
+
| `dsh-session-recall` | Memory | "What did I do before, and where is it?" |
|
|
195
|
+
| [`dsh-session-eval`](https://www.npmjs.com/package/dsh-session-eval) | Measurement | "Was that session good? Is the trend improving?" |
|
|
196
|
+
|
|
187
197
|
## License
|
|
188
198
|
|
|
189
199
|
[MIT](https://github.com/kittimzhe/dsh-session-recall/blob/main/LICENSE)
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolDefinition, ToolRunContext } from "@deepseek-ai/dsh-tools";
|
|
2
2
|
import { SessionEventResultFilter, SessionEventSearchDocument, SessionEventSearchPage, SessionEventSearchRequest, SessionLineageTrace, SessionRecord, SessionSearchExecContext, SessionSearchHit, SessionSearchPage, SessionSearchRequest, SessionTitleObservationResult } from "@deepseek-ai/dsh-session-query";
|
|
3
|
-
import {
|
|
3
|
+
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
4
4
|
import { Context } from "@deepseek-ai/cordis";
|
|
5
5
|
import { ContentBlock } from "@deepseek-ai/dsh-llm";
|
|
6
6
|
//#region src/redact.d.ts
|
|
@@ -209,7 +209,8 @@ type RecallApprovalVerdict = 'allowed-once' | 'rejected' | 'cancelled' | 'unavai
|
|
|
209
209
|
* Optional user-approval seam for the `all_projects` gate (`allProjectsPolicy:
|
|
210
210
|
* 'confirm'`). Receives the tool run context (for the agent) and a
|
|
211
211
|
* human-readable reason; `'allowed-once'` is the only grant. Wired from
|
|
212
|
-
* `ctx.approval` in the plugin entry
|
|
212
|
+
* `ctx.get('approval')` in the plugin entry (optional service, not in
|
|
213
|
+
* `inject`); fail-closed when absent.
|
|
213
214
|
*/
|
|
214
215
|
type RecallApprover = (exec: ToolRunContext, reason: string) => Promise<RecallApprovalVerdict>;
|
|
215
216
|
/**
|
|
@@ -218,6 +219,13 @@ type RecallApprover = (exec: ToolRunContext, reason: string) => Promise<RecallAp
|
|
|
218
219
|
*/
|
|
219
220
|
declare function createRecallTool(config?: RecallConfig, engine?: RecallQueryEngine, approver?: RecallApprover): ToolDefinition;
|
|
220
221
|
//#endregion
|
|
222
|
+
//#region node_modules/@deepseek-ai/dsh-util-values/lib/types/index.d.ts
|
|
223
|
+
/** Duplicate-install-safe JSON and immutable-value helpers. @module @deepseek-ai/dsh-util-values */
|
|
224
|
+
/** A value that round-trips through JSON without loss. */
|
|
225
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
226
|
+
[key: string]: JsonValue;
|
|
227
|
+
};
|
|
228
|
+
//#endregion
|
|
221
229
|
//#region src/render.d.ts
|
|
222
230
|
/**
|
|
223
231
|
* Render the compact Markdown the model reads: one header line, one line per
|
package/lib/index.js
CHANGED
|
@@ -844,11 +844,12 @@ const name = "session-recall";
|
|
|
844
844
|
const inject = ["tools", "sessionQuery"];
|
|
845
845
|
/**
|
|
846
846
|
* Build the optional approval seam for `allProjectsPolicy: 'confirm'`: ask
|
|
847
|
-
* `ctx.approval` when the service is composed and the call carries an agent;
|
|
848
|
-
* fail closed (`'unavailable'`) otherwise.
|
|
847
|
+
* `ctx.get('approval')` when the service is composed and the call carries an agent;
|
|
848
|
+
* fail closed (`'unavailable'`) otherwise. Direct `ctx.approval` throws unless
|
|
849
|
+
* the service is declared in `inject`, and this seam is optional. Never throws.
|
|
849
850
|
*/
|
|
850
851
|
function makeApprover(ctx) {
|
|
851
|
-
const approval = ctx.approval;
|
|
852
|
+
const approval = ctx.get("approval");
|
|
852
853
|
if (approval == null || typeof approval.request !== "function") return void 0;
|
|
853
854
|
return async (exec, reason) => {
|
|
854
855
|
const agent = exec.agent;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-recall",
|
|
3
3
|
"description": "Deterministic cross-session transcript retrieval for DeepSeek Harness: the model-facing `recall` tool searches past session logs with explicit scope control",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -39,20 +39,21 @@
|
|
|
39
39
|
"full-text-search"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@deepseek-ai/cordis": "
|
|
43
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
44
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
45
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
46
|
-
"@deepseek-ai/dsh-session-query": "^0.1.
|
|
47
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
42
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
43
|
+
"@deepseek-ai/dsh-agent": "^0.1.5-rc.3",
|
|
44
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-rc.3",
|
|
45
|
+
"@deepseek-ai/dsh-session": "^0.1.5-rc.3",
|
|
46
|
+
"@deepseek-ai/dsh-session-query": "^0.1.5-rc.3",
|
|
47
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-rc.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@deepseek-ai/cordis": "
|
|
51
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
52
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
53
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
54
|
-
"@deepseek-ai/dsh-session-query": "^0.1.
|
|
55
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
50
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
51
|
+
"@deepseek-ai/dsh-agent": "^0.1.5-rc.3",
|
|
52
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-rc.3",
|
|
53
|
+
"@deepseek-ai/dsh-session": "^0.1.5-rc.3",
|
|
54
|
+
"@deepseek-ai/dsh-session-query": "^0.1.5-rc.3",
|
|
55
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-rc.3",
|
|
56
|
+
"@deepseek-ai/dsh-util-values": "^0.1.5-rc.3",
|
|
56
57
|
"@types/js-yaml": "^4.0.9",
|
|
57
58
|
"@types/node": "^26.2.0",
|
|
58
59
|
"js-yaml": "^4.2.0",
|