@sparkelf/dsh-plus 0.2.2-alpha.2.44 → 0.2.2-alpha.2.45
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkelf/dsh-plus",
|
|
3
3
|
"description": "DeepSeek Harness Plus official-base Web distribution profile and ranged compatibility patchset",
|
|
4
|
-
"version": "0.2.2-alpha.2.
|
|
4
|
+
"version": "0.2.2-alpha.2.45",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@sparkelf/dsh-workbench-vault": "0.1.2",
|
|
76
76
|
"@sparkelf/dsh-ssh-manager": "0.7.5",
|
|
77
77
|
"@sparkelf/dsh-api-client": "0.5.3",
|
|
78
|
-
"dsh-better-sidebar": "npm:@sparkelf/dsh-better-sidebar@0.29.0-sparkelf.
|
|
78
|
+
"dsh-better-sidebar": "npm:@sparkelf/dsh-better-sidebar@0.29.0-sparkelf.18",
|
|
79
79
|
"@sparkelf/dsh-office-viewer-fonts": "0.1.6",
|
|
80
80
|
"dsh-video-preview": "0.1.4",
|
|
81
81
|
"dsh-right-bg-anim": "1.1.0",
|
|
@@ -607,6 +607,21 @@
|
|
|
607
607
|
},
|
|
608
608
|
"file": "./patches/dsh-resource-ref-chip.patch",
|
|
609
609
|
"retireWhen": "官方 primitives 的 ReferenceIconKind 增加 resource 类型后退役"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"id": "session-controller-image-downgrade-and-tool-visibility",
|
|
613
|
+
"dsh": ">=0.2.2-alpha.2",
|
|
614
|
+
"target": {
|
|
615
|
+
"kind": "dsh-source",
|
|
616
|
+
"packages": [
|
|
617
|
+
"@deepseek-ai/dsh-api-session-controller"
|
|
618
|
+
],
|
|
619
|
+
"paths": [
|
|
620
|
+
"packages/api/session-controller/"
|
|
621
|
+
]
|
|
622
|
+
},
|
|
623
|
+
"file": "./patches/session-controller-image-downgrade-and-tool-visibility.patch",
|
|
624
|
+
"retireWhen": "上游 dsh-api-session-controller 支持非视觉模型图片降级与按模型能力裁剪工具面后退役"
|
|
610
625
|
}
|
|
611
626
|
]
|
|
612
627
|
},
|
|
@@ -644,7 +659,7 @@
|
|
|
644
659
|
"@sparkelf/dsh-quant": "0.91.0-sparkelf.13",
|
|
645
660
|
"@sparkelf/dsh-genui": "0.15.0-sparkelf.1",
|
|
646
661
|
"@sparkelf/dsh-sql-workbench": "0.5.4-sparkelf.1",
|
|
647
|
-
"@sparkelf/dsh-better-sidebar": "0.29.0-sparkelf.
|
|
662
|
+
"@sparkelf/dsh-better-sidebar": "0.29.0-sparkelf.18"
|
|
648
663
|
}
|
|
649
664
|
},
|
|
650
665
|
"team": {
|
|
@@ -699,14 +714,14 @@
|
|
|
699
714
|
}
|
|
700
715
|
},
|
|
701
716
|
"dependencies": {
|
|
702
|
-
"@deepseek-ai/dsh-computer-use": "
|
|
703
|
-
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp": "
|
|
704
|
-
"@deepseek-ai/dsh-tool-session-query": "
|
|
705
|
-
"@deepseek-ai/dsh-web-search-exa": "
|
|
717
|
+
"@deepseek-ai/dsh-computer-use": "workspace:>=0.2.2-alpha.2",
|
|
718
|
+
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp": "workspace:>=0.2.2-alpha.2",
|
|
719
|
+
"@deepseek-ai/dsh-tool-session-query": "workspace:>=0.2.2-alpha.2",
|
|
720
|
+
"@deepseek-ai/dsh-web-search-exa": "workspace:>=0.1.6-alpha.1",
|
|
706
721
|
"@sparkelf/dsh-client-ui-skill-center": "0.2.2-alpha.2.5",
|
|
707
722
|
"@sparkelf/dsh-image-hoist": ">=0.1.3",
|
|
708
|
-
"@sparkelf/dsh-plugin-backup": "
|
|
709
|
-
"@sparkelf/dsh-plugin-mcp-credentials": "
|
|
723
|
+
"@sparkelf/dsh-plugin-backup": "workspace:>=0.2.1-alpha.1",
|
|
724
|
+
"@sparkelf/dsh-plugin-mcp-credentials": "workspace:>=0.2.1-alpha.1",
|
|
710
725
|
"dshmarket": ">=1.66.7",
|
|
711
726
|
"semver": ">=7.7.3",
|
|
712
727
|
"yaml": ">=2.9.0"
|
|
@@ -716,8 +731,8 @@
|
|
|
716
731
|
},
|
|
717
732
|
"devDependencies": {
|
|
718
733
|
"@changfenhuang/dsh-genui": "0.9.9",
|
|
719
|
-
"@
|
|
720
|
-
"@
|
|
734
|
+
"@deepseek-ai/cordis": "workspace:^",
|
|
735
|
+
"@types/semver": ">=7.7.1"
|
|
721
736
|
},
|
|
722
737
|
"bin": {
|
|
723
738
|
"dsh-plus": "lib/bin.js"
|
|
@@ -725,6 +740,6 @@
|
|
|
725
740
|
"optionalDependencies": {
|
|
726
741
|
"@deepseek-ai/dsh-computer-use": ">=0.2.2-alpha.2",
|
|
727
742
|
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-mcp": ">=0.2.2-alpha.2",
|
|
728
|
-
"@deepseek-ai/dsh-web-search-exa": "
|
|
743
|
+
"@deepseek-ai/dsh-web-search-exa": "workspace:>=0.1.6-alpha.1"
|
|
729
744
|
}
|
|
730
|
-
}
|
|
745
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
--- a/packages/api/session-controller/src/commands.ts 2026-11-03 00:40:46.207711920 +0800
|
|
2
|
+
+++ b/packages/api/session-controller/src/commands.ts 2026-11-03 00:40:46.209868821 +0800
|
|
3
|
+
@@ -83,6 +83,9 @@
|
|
4
|
+
|
|
5
|
+
/** Implements Session business commands delegated by the Session Controller Remote service. */
|
|
6
|
+
export class SessionCommandController {
|
|
7
|
+
+ /** 每个 agent 当前生效的工具可见性限制的撤销函数(按模型能力同步)。 */
|
|
8
|
+
+ private readonly toolVisibility = new WeakMap<Agent, () => void>()
|
|
9
|
+
+
|
|
10
|
+
/**
|
|
11
|
+
* @param ctx - Host context carrying Agent, model, attachment, title, and Workspace services.
|
|
12
|
+
* @param agents - sole owner of create, resume, and Agent composition.
|
|
13
|
+
@@ -142,6 +145,31 @@
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
+ * 按当前模型的输入能力裁剪工具面。
|
|
18
|
+
+ *
|
|
19
|
+
+ * `read_image` 会把像素作为图像内容送进对话;纯文本模型即使被允许调用也消费不了,
|
|
20
|
+
+ * 而它只要出现在工具清单里,模型就会去试、试了必然失败。这里用
|
|
21
|
+
+ * `ctx.tools.restrict({ deny })` 把它从**可见集合**里摘掉——不是调用时报错。
|
|
22
|
+
+ *
|
|
23
|
+
+ * 只在 agent 作用域调用(全局 ctx 会屏蔽所有 agent);切换模型时先撤销旧限制。
|
|
24
|
+
+ *
|
|
25
|
+
+ * @param agent - 目标 agent(其 ctx 是作用域键)。
|
|
26
|
+
+ * @param selection - 已提交的模型选择。
|
|
27
|
+
+ */
|
|
28
|
+
+ private async syncToolVisibility(agent: Agent, selection: AgentModelSelection): Promise<void> {
|
|
29
|
+
+ const disposers = this.toolVisibility
|
|
30
|
+
+ disposers.get(agent)?.()
|
|
31
|
+
+ disposers.delete(agent)
|
|
32
|
+
+ try {
|
|
33
|
+
+ const info = await this.ctx.llm.resolveModelInfo(selection.provider, selection.model)
|
|
34
|
+
+ if (info.inputModalities?.includes('image') === true) return
|
|
35
|
+
+ disposers.set(agent, agent.ctx.tools.restrict({ deny: ['read_image'] }))
|
|
36
|
+
+ } catch {
|
|
37
|
+
+ // 模型信息取不到时保持默认(全部可见),不影响主流程。
|
|
38
|
+
+ }
|
|
39
|
+
+ }
|
|
40
|
+
+
|
|
41
|
+
+ /**
|
|
42
|
+
* Validate and record one Session model selection; save the default in the background.
|
|
43
|
+
* @param request - Session identity and requested model selection.
|
|
44
|
+
* @returns the normalized selection recorded for the Session, without waiting for default persistence.
|
|
45
|
+
@@ -160,6 +188,7 @@
|
|
46
|
+
}
|
|
47
|
+
await this.ctx.llm.resolveCallConfig(selected)
|
|
48
|
+
agent.model.select(selected)
|
|
49
|
+
+ void this.syncToolVisibility(agent, selected)
|
|
50
|
+
void this.ctx.agentDefaultModel.saveSelection(selected).catch((error: unknown) => {
|
|
51
|
+
this.ctx.logger.warn(
|
|
52
|
+
`session-controller: model selection changed for the Session but the default was not saved: ${String(error)}`,
|
|
53
|
+
@@ -312,20 +341,24 @@
|
|
54
|
+
const hasImage = admission.content.some(part => part.type === 'image')
|
|
55
|
+
const admit = async (): Promise<SessionPromptValue> => {
|
|
56
|
+
try {
|
|
57
|
+
+ let promptContent = admission.content
|
|
58
|
+
if (hasImage) {
|
|
59
|
+
const current = agent.model.current()
|
|
60
|
+
if (current !== undefined) {
|
|
61
|
+
const model = await this.ctx.llm.resolveModelInfo(current.provider, current.model)
|
|
62
|
+
if (model.inputModalities !== undefined && !model.inputModalities.includes('image')) {
|
|
63
|
+
- throw new RemoteError(
|
|
64
|
+
- 'session/attachment-invalid',
|
|
65
|
+
- `Model "${current.model}" does not support image input.`,
|
|
66
|
+
- { reason: 'MODEL_DOES_NOT_SUPPORT_IMAGES' },
|
|
67
|
+
- )
|
|
68
|
+
+ // 纯文本模型:不要把整条消息拒掉。图片块降级成一行文字占位,消息照常入队;
|
|
69
|
+
+ // 模型看不到像素,但至少用户能发出去,不会卡在输入框。
|
|
70
|
+
+ promptContent = admission.content.map(part => part.type === 'image'
|
|
71
|
+
+ ? {
|
|
72
|
+
+ type: 'text' as const,
|
|
73
|
+
+ text: '[图片附件已附加。当前模型不支持图像输入,无法查看图片内容;如需处理请改用文件/工具链路。]',
|
|
74
|
+
+ }
|
|
75
|
+
+ : part)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
- const content = await this.ctx.attachments.admitPromptContent(admission.content)
|
|
80
|
+
+ const content = await this.ctx.attachments.admitPromptContent(promptContent)
|
|
81
|
+
const message: UserMessage = createUserMessage({ content, source })
|
|
82
|
+
if (this.ctx.agents.get(agent.id) !== agent) {
|
|
83
|
+
throw new RemoteError(
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 DeepSeek
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|