dsh-claude-compat 0.8.1 → 0.8.3
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/package.json +6 -2
- package/src/hooks.js +2 -2
- package/src/index.js +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-claude-compat",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "DeepSeek Harness plugin: bridge Claude Code's .claude/ directories (project and ~/.claude: skills, commands, rules) into DSH native skill registry and message-stream rules injection.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -60,5 +60,9 @@
|
|
|
60
60
|
},
|
|
61
61
|
"bin": {
|
|
62
62
|
"dsh-claude-compat-restart": "scripts/dsh-restart.sh"
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/biedongbin/dsh-claude-compat.git"
|
|
63
67
|
}
|
|
64
|
-
}
|
|
68
|
+
}
|
package/src/hooks.js
CHANGED
|
@@ -108,7 +108,7 @@ export function mapPostHookOutput(exitCode, stdout, { warn = console.warn } = {}
|
|
|
108
108
|
kind: 'accept',
|
|
109
109
|
additionalContexts: [createUserMessage({
|
|
110
110
|
content: [{ type: 'text', text: additional }],
|
|
111
|
-
source: { kind: 'claude-compat', form: 'hook-context' },
|
|
111
|
+
source: { kind: 'plugin', plugin: 'dsh-claude-compat', form: 'hook-context' },
|
|
112
112
|
})],
|
|
113
113
|
};
|
|
114
114
|
}
|
|
@@ -339,7 +339,7 @@ async function runPromptHooks(hooks, agent, config) {
|
|
|
339
339
|
if (text === '') continue;
|
|
340
340
|
extra.push(createUserMessage({
|
|
341
341
|
content: [{ type: 'text', text }],
|
|
342
|
-
source: { kind: 'claude-compat', form: 'hook-context' },
|
|
342
|
+
source: { kind: 'plugin', plugin: 'dsh-claude-compat', form: 'hook-context' },
|
|
343
343
|
}));
|
|
344
344
|
}
|
|
345
345
|
return extra.length > 0 ? extra : undefined;
|
package/src/index.js
CHANGED
|
@@ -405,17 +405,17 @@ function registerRulesSection(ctx, config) {
|
|
|
405
405
|
ctx.on('agent/pre-step', async ({ agent, messages }, next) => {
|
|
406
406
|
const decision = await next();
|
|
407
407
|
if (decision.kind !== 'enter') return decision;
|
|
408
|
-
const present = (list) => list.some((m) => m?.source?.kind === 'claude-compat');
|
|
409
|
-
//
|
|
410
|
-
//
|
|
411
|
-
//
|
|
412
|
-
const events = agent.session.snapshotEvents();
|
|
408
|
+
const present = (list) => list.some((m) => m?.source?.kind === 'plugin' && m.source.plugin === 'dsh-claude-compat');
|
|
409
|
+
// dsh 0.1.2 made the event log private — exact lookup is eventAt(seq),
|
|
410
|
+
// the same API dsh core uses for its own surface scans. Legacy dsh
|
|
411
|
+
// exposed a plain session.events array; keep an optional fallback.
|
|
413
412
|
const alreadyInjected = present(messages)
|
|
414
413
|
|| present(decision.messages)
|
|
415
414
|
|| agent.session.surface.nodes.some((seq) => {
|
|
416
|
-
const event = events[seq];
|
|
415
|
+
const event = agent.session.eventAt?.(seq) ?? agent.session.events?.[seq];
|
|
417
416
|
return event?.type === 'user/message'
|
|
418
|
-
&& event.data?.source?.kind === '
|
|
417
|
+
&& event.data?.source?.kind === 'plugin'
|
|
418
|
+
&& event.data.source.plugin === 'dsh-claude-compat';
|
|
419
419
|
});
|
|
420
420
|
if (alreadyInjected) return decision;
|
|
421
421
|
// Session cwd, NOT process.cwd() — the DSH process may be launched from
|
|
@@ -430,7 +430,7 @@ function registerRulesSection(ctx, config) {
|
|
|
430
430
|
// of the message array. Not in system prompt.
|
|
431
431
|
cache.set(cwd, createUserMessage({
|
|
432
432
|
content: [{ type: 'text', text }],
|
|
433
|
-
source: { kind: 'claude-compat', form: 'rules' },
|
|
433
|
+
source: { kind: 'plugin', plugin: 'dsh-claude-compat', form: 'rules' },
|
|
434
434
|
}));
|
|
435
435
|
}
|
|
436
436
|
return {
|