dsh-claude-compat 0.8.0 → 0.8.2

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 CHANGED
@@ -8,7 +8,7 @@
8
8
  <a href="README.zh-CN.md"><img src="https://img.shields.io/badge/🌐_įŽ€äŊ“中文-į‚šæˆ‘é˜…č¯ģ中文-red?style=for-the-badge" alt="įŽ€äŊ“中文"></a>
9
9
  <img src="https://img.shields.io/npm/dm/dsh-claude-compat?style=flat-square&label=downloads/month&color=brightgreen" alt="npm downloads/month">
10
10
  <img src="https://img.shields.io/npm/dt/dsh-claude-compat?style=flat-square&label=total%20downloads&color=blue" alt="npm total downloads">
11
- <img src="https://img.shields.io/badge/version-0.8.0-blue?style=flat-square" alt="Version">
11
+ <img src="https://img.shields.io/badge/version-0.8.1-blue?style=flat-square" alt="Version">
12
12
  <img src="https://img.shields.io/badge/license-MIT-orange?style=flat-square" alt="License">
13
13
  </p>
14
14
 
package/README.zh-CN.md CHANGED
@@ -8,7 +8,7 @@
8
8
  <a href="README.md"><img src="https://img.shields.io/badge/🌐_English-Click_me-red?style=for-the-badge" alt="English"></a>
9
9
  <img src="https://img.shields.io/npm/dm/dsh-claude-compat?style=flat-square&label=downloads/month&color=brightgreen" alt="npm downloads/month">
10
10
  <img src="https://img.shields.io/npm/dt/dsh-claude-compat?style=flat-square&label=total%20downloads&color=blue" alt="npm total downloads">
11
- <img src="https://img.shields.io/badge/version-0.8.0-blue?style=flat-square" alt="Version">
11
+ <img src="https://img.shields.io/badge/version-0.8.1-blue?style=flat-square" alt="Version">
12
12
  <img src="https://img.shields.io/badge/license-MIT-orange?style=flat-square" alt="License">
13
13
  </p>
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-claude-compat",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
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,13 +405,18 @@ 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');
408
+ const present = (list) => list.some((m) => m?.source?.kind === 'plugin' && m.source.plugin === 'dsh-claude-compat');
409
+ // Take one snapshot outside the loop: Session has no `events` property
410
+ // (dsh 0.1.2-rc.1) — snapshotEvents() is the public API. Indexing the
411
+ // snapshot by seq is stable and avoids re-materializing per node.
412
+ const events = agent.session.snapshotEvents();
409
413
  const alreadyInjected = present(messages)
410
414
  || present(decision.messages)
411
415
  || agent.session.surface.nodes.some((seq) => {
412
- const event = agent.session.events[seq];
416
+ const event = events[seq];
413
417
  return event?.type === 'user/message'
414
- && event.data?.source?.kind === 'claude-compat';
418
+ && event.data?.source?.kind === 'plugin'
419
+ && event.data.source.plugin === 'dsh-claude-compat';
415
420
  });
416
421
  if (alreadyInjected) return decision;
417
422
  // Session cwd, NOT process.cwd() — the DSH process may be launched from
@@ -426,7 +431,7 @@ function registerRulesSection(ctx, config) {
426
431
  // of the message array. Not in system prompt.
427
432
  cache.set(cwd, createUserMessage({
428
433
  content: [{ type: 'text', text }],
429
- source: { kind: 'claude-compat', form: 'rules' },
434
+ source: { kind: 'plugin', plugin: 'dsh-claude-compat', form: 'rules' },
430
435
  }));
431
436
  }
432
437
  return {