@knyazevai/dsh 0.1.2 → 0.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @knyazevai/dsh
2
2
 
3
- Плагин [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): провайдер **Knyazev AI**, модели Flash / Kimi / MiniMax, thinking и effort `off / high / max`. После установки Flash уже выбран — в Models остаётся только ключ.
3
+ Плагин [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): провайдер **Knyazev AI**, модели Flash / Kimi / MiniMax, thinking и effort `off / high / max`. После установки выбран **Flash max** — в Models остаётся только ключ.
4
4
 
5
5
  ## Установка
6
6
 
@@ -29,7 +29,7 @@ npx @deepseek-ai/dsh plugin --profile web add -w .
29
29
 
30
30
  ## После установки
31
31
 
32
- Новые сессии сразу идут на **Knyazev AI / DeepSeek V4 Flash** (effort `high`). Kimi и MiniMax уже в пикере, сабагенты на том же маршруте.
32
+ Новые сессии сразу идут на **Knyazev AI / DeepSeek V4 Flash** с effort **max**. Kimi и MiniMax уже в пикере, сабагенты на том же маршруте.
33
33
 
34
34
  Ключ в пакет не входит. Если `KNYAZEV_AI_API_KEY` ещё не в окружении — открой Harness → Models → **Knyazev AI** и вставь `kn_live_…` из [кабинета](https://knyazevai.work). Модели выбирать не нужно.
35
35
 
@@ -44,7 +44,7 @@ git clone https://github.com/knyazev741/deepseek-harness
44
44
  cd deepseek-harness
45
45
  pnpm install
46
46
  pnpm run build
47
- pnpm dsh plugin --profile web add @knyazevai/dsh
47
+ pnpm dsh plugin --profile fork-web add -w @knyazevai/dsh@0.1.4
48
48
  pnpm dsh web
49
49
  ```
50
50
 
@@ -72,7 +72,7 @@ pnpm dsh web
72
72
 
73
73
  MiniMax без пикера effort: модель не отдаёт reasoning отдельным полем.
74
74
 
75
- Дефолт Harness после установки: `knyazev-ai` / `deepseek-v4-flash`. Сабагенты (`subagent`, `subagent_fork`) на том же маршруте.
75
+ Дефолт Harness после установки: `knyazev-ai` / `deepseek-v4-flash`, effort `max`. Сабагенты (`subagent`, `subagent_fork`) на том же маршруте.
76
76
 
77
77
  ## Обновление / снятие
78
78
 
@@ -101,15 +101,13 @@ git push origin v0.1.1 # пуш тега запускает тесты + пуб
101
101
 
102
102
  Тесты перед публикацией идут сами (`prepublishOnly` в `package.json`).
103
103
 
104
- Установка **по имени** — сразу после публикации, на любой машине:
104
+ Установка **по имени** — на любой машине:
105
105
 
106
106
  ```sh
107
- npx @deepseek-ai/dsh plugin --profile web add @knyazevai/dsh
107
+ npx @deepseek-ai/dsh plugin --profile web add -w @knyazevai/dsh
108
108
  npx @deepseek-ai/dsh web
109
109
  ```
110
110
 
111
- Пока пакет не на npm — действует установка с GitHub из раздела «Установка».
112
-
113
111
  ## Docs
114
112
 
115
113
  https://knyazevai.work/docs
package/cordis.patch.yml CHANGED
@@ -25,7 +25,7 @@
25
25
  compat:
26
26
  thinkingFormat: qwen
27
27
  supportsReasoningEffort: false
28
- reasoning: high
28
+ reasoning: max
29
29
  models:
30
30
  - id: deepseek-v4-flash
31
31
  name: DeepSeek V4 Flash
@@ -76,25 +76,9 @@
76
76
  provider: knyazev-ai
77
77
  model: deepseek-v4-flash
78
78
 
79
- # Compaction policy for huge Knyazev contexts. The harness code fix behind
80
- # maxSummarizationInputTokens lives in dsh-compaction-basic (harness commit
81
- # 078d3db591) and ships only with a harness build that contains it; this layer
82
- # carries just the knyazev-scoped policy. The global budget stays 0 (replay the
83
- # whole region = old behavior) so non-Knyazev providers are unaffected; only
84
- # knyazev-ai routes replay bounded input in small fast passes. compactionRetries
85
- # and maxOverflowRetries are bumped so a slow gateway prefill gets more chances.
86
- - id: compaction-basic
87
- config:
88
- maxSummarizationInputTokens: 0
89
- compactionRetries: 2
90
- maxOverflowRetries: 2
91
- modelPolicies:
92
- - provider: knyazev-ai
93
- model: deepseek-v4-flash
94
- maxSummarizationInputTokens: 131072
95
- - provider: knyazev-ai
96
- model: kimi-2.6
97
- maxSummarizationInputTokens: 131072
98
- - provider: knyazev-ai
99
- model: minimax-2.7
100
- maxSummarizationInputTokens: 131072
79
+ # Agent Presets mount compaction in a nested `compaction` group. The deployment
80
+ # plugin contributes a complete group replacement to standard, code, and
81
+ # cordis at preset-mount time, while minimal intentionally keeps no compaction.
82
+ - insert:
83
+ - id: knyazev-ai-compaction
84
+ name: '@knyazevai/dsh'
package/lib/provider.js CHANGED
@@ -4,7 +4,81 @@ export const PROVIDER_ID = "knyazev-ai";
4
4
  export const API_KEY_ENV = "KNYAZEV_AI_API_KEY";
5
5
  export const BASE_URL = "https://knyazevai.work/v1";
6
6
  export const DEFAULT_MODEL_ID = "deepseek-v4-flash";
7
- export const DEFAULT_REASONING = "high";
7
+ export const DEFAULT_REASONING = "max";
8
+
9
+ /** Cordis plugin name for the per-agent-preset compaction overlay. */
10
+ export const name = "knyazev-ai-compaction";
11
+
12
+ /** No required services: headless profiles do not compose Agent Presets. */
13
+ export const inject = [];
14
+
15
+ const AGENT_PRESET_PATCH_CONTRIBUTOR = Symbol.for("dsh.agent-presets.patch-contributor");
16
+
17
+ const COMPACTION_PATCH = {
18
+ id: "compaction",
19
+ config: [
20
+ {
21
+ id: "compaction-basic",
22
+ name: "@deepseek-ai/dsh-compaction-basic",
23
+ config: {
24
+ maxSummarizationInputTokens: 0,
25
+ compactionRetries: 2,
26
+ maxOverflowRetries: 2,
27
+ modelPolicies: [
28
+ {
29
+ provider: "knyazev-ai",
30
+ model: "deepseek-v4-flash",
31
+ thresholdRatio: 0.5,
32
+ maxSummarizationInputTokens: 131072,
33
+ },
34
+ {
35
+ provider: "knyazev-ai",
36
+ model: "kimi-2.6",
37
+ maxSummarizationInputTokens: 131072,
38
+ },
39
+ {
40
+ provider: "knyazev-ai",
41
+ model: "minimax-2.7",
42
+ maxSummarizationInputTokens: 131072,
43
+ },
44
+ ],
45
+ },
46
+ },
47
+ {
48
+ id: "command-compact",
49
+ name: "@deepseek-ai/dsh-command-compact",
50
+ },
51
+ {
52
+ id: "tool-result-pruner",
53
+ name: "@deepseek-ai/dsh-compaction-tool-result-pruner",
54
+ config: {
55
+ thresholdChars: 8192,
56
+ headChars: 4096,
57
+ tailChars: 1024,
58
+ },
59
+ },
60
+ ],
61
+ };
62
+
63
+ const COMPACTION_PRESET_IDS = ["standard", "code", "cordis"];
64
+
65
+ /**
66
+ * Contribute the compaction group to the shipped presets that own it.
67
+ *
68
+ * The contributor face is optional so the provider remains loadable on older
69
+ * Harness builds; those builds simply retain their stored preset composition.
70
+ */
71
+ export function apply(ctx) {
72
+ ctx.inject(["agentPresets"], (childCtx) => {
73
+ const agentPresets = typeof childCtx.get === "function" ? childCtx.get("agentPresets") : childCtx.agentPresets;
74
+ const contributor = agentPresets?.[AGENT_PRESET_PATCH_CONTRIBUTOR];
75
+ if (contributor === undefined || typeof contributor.register !== "function") return;
76
+
77
+ for (const presetId of COMPACTION_PRESET_IDS) {
78
+ contributor.register({ presetId, patches: [COMPACTION_PATCH] });
79
+ }
80
+ });
81
+ }
8
82
 
9
83
  export const REASONING_EFFORTS = Object.freeze({
10
84
  off: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knyazevai/dsh",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "DeepSeek Harness plugin: Knyazev AI models with thinking and effort",
5
5
  "type": "module",
6
6
  "license": "MIT",