dsh-plugin-sessiongraph-tool 0.1.12 → 0.1.14
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/lib/command.d.ts +8 -0
- package/lib/command.js +6 -3
- package/lib/index.d.ts +7 -0
- package/lib/index.js +2 -0
- package/package.json +3 -3
package/lib/command.d.ts
CHANGED
|
@@ -98,6 +98,14 @@ export interface CommandRegistry {
|
|
|
98
98
|
}
|
|
99
99
|
/** What the command needs from the plugin configuration. */
|
|
100
100
|
export interface CommandOptions {
|
|
101
|
+
/**
|
|
102
|
+
* Feed the command's result back into the session as a plugin message (default false).
|
|
103
|
+
*
|
|
104
|
+
* Off by default after `/sessiongraph status` was observed to hang the desktop shell: the command
|
|
105
|
+
* plane runs on the host's main thread, and calling `agent.inject` from inside a handler drags the
|
|
106
|
+
* agent loop (prompt assembly, and with it every synchronous status read) onto that same stack.
|
|
107
|
+
*/
|
|
108
|
+
injectResults?: boolean;
|
|
101
109
|
/** Absolute directory holding the index. */
|
|
102
110
|
readonly indexRoot: string;
|
|
103
111
|
/** Longest snippet the `search` subcommand prints per hit. */
|
package/lib/command.js
CHANGED
|
@@ -101,8 +101,9 @@ export async function runCommand(ctx, options, invocation) {
|
|
|
101
101
|
const result = await dispatch(ctx, options, plan, invocation);
|
|
102
102
|
// Only a successful lookup is worth telling the model about: a typo or a failed call is the
|
|
103
103
|
// human's problem, and injecting it would spend context on something the model cannot use.
|
|
104
|
-
if (result.kind === 'success')
|
|
105
|
-
injectCommandNotice(invocation, plan, result.text ?? '');
|
|
104
|
+
if (result.kind === 'success') {
|
|
105
|
+
injectCommandNotice(invocation, plan, result.text ?? '', options.injectResults === true);
|
|
106
|
+
}
|
|
106
107
|
return result;
|
|
107
108
|
}
|
|
108
109
|
catch (error) {
|
|
@@ -147,7 +148,9 @@ export const INJECTED_NOTICE_PLUGIN = 'dsh-plugin-sessiongraph';
|
|
|
147
148
|
* @param plan - the parsed subcommand that ran.
|
|
148
149
|
* @param text - the result text the person saw.
|
|
149
150
|
*/
|
|
150
|
-
function injectCommandNotice(invocation, plan, text) {
|
|
151
|
+
function injectCommandNotice(invocation, plan, text, enabled) {
|
|
152
|
+
if (!enabled)
|
|
153
|
+
return;
|
|
151
154
|
const agent = invocation.agent;
|
|
152
155
|
if (agent?.inject === undefined)
|
|
153
156
|
return;
|
package/lib/index.d.ts
CHANGED
|
@@ -68,6 +68,13 @@ export interface Config {
|
|
|
68
68
|
* disables the lazy refresh entirely: queries then trust the indexer's own schedule.
|
|
69
69
|
*/
|
|
70
70
|
freshnessThresholdMs?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Feed `/sessiongraph` command results back into the session as a plugin message (default false).
|
|
73
|
+
* Off by default: calling `agent.inject` from inside a command handler drags the agent loop onto
|
|
74
|
+
* the host's main thread, and `/sessiongraph status` was observed to hang the desktop shell that
|
|
75
|
+
* way. Set true only if you want the model to see what you just searched.
|
|
76
|
+
*/
|
|
77
|
+
injectCommandResults?: boolean;
|
|
71
78
|
/** Tool-call timeout budget in ms for the query-side `sessiongraph` tool (default 30000). */
|
|
72
79
|
timeoutMs?: number;
|
|
73
80
|
/** Tool-call timeout budget in ms for the `sessiongraph_index` tool (default 300000). */
|
package/lib/index.js
CHANGED
|
@@ -65,6 +65,7 @@ export const Config = z.object({
|
|
|
65
65
|
maxLimit: z.number().default(DEFAULT_MAX_LIMIT),
|
|
66
66
|
maxSnippetChars: z.number().default(DEFAULT_MAX_SNIPPET_CHARS),
|
|
67
67
|
freshnessThresholdMs: z.number().default(DEFAULT_FRESHNESS_THRESHOLD_MS),
|
|
68
|
+
injectCommandResults: z.boolean().default(false),
|
|
68
69
|
timeoutMs: z.number().max(MAX_TIMER_DELAY_MS).default(DEFAULT_SESSIONGRAPH_TOOL_TIMEOUT_MS),
|
|
69
70
|
indexTimeoutMs: z.number().max(MAX_TIMER_DELAY_MS).default(DEFAULT_SESSIONGRAPH_INDEX_TIMEOUT_MS),
|
|
70
71
|
});
|
|
@@ -148,6 +149,7 @@ export function apply(ctx, config) {
|
|
|
148
149
|
registerCommands(ctx, {
|
|
149
150
|
indexRoot,
|
|
150
151
|
maxSnippetChars: resolved.maxSnippetChars,
|
|
152
|
+
injectResults: resolved.injectCommandResults,
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
155
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-sessiongraph-tool",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Model-facing sessiongraph tools for DeepSeek Harness — a read-only sessiongraph tool that searches the whole local conversation history, plus a sessiongraph_index tool that builds or refreshes the index on its own, much larger timeout budget",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
53
|
-
"dsh-plugin-sessiongraph-service": "^0.1.
|
|
54
|
-
"dsh-plugin-sessiongraph-sessions": "^0.1.
|
|
53
|
+
"dsh-plugin-sessiongraph-service": "^0.1.14",
|
|
54
|
+
"dsh-plugin-sessiongraph-sessions": "^0.1.14"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@deepseek-ai/cordis": ">=4.0.1",
|