@lincyaw/dsh 0.2.0-rc.39 → 0.2.0-rc.40
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/build/dist/client.js +19 -19
- package/build/dist/client.json +1 -1
- package/package.json +7 -7
- package/src/node/tools.ts +4 -1
- package/src/node/turns.ts +2 -2
package/build/dist/client.json
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"../kernel/src/document-voices.ts",
|
|
53
53
|
"../kernel/src/document-colors.ts",
|
|
54
54
|
"../kernel/src/document-caption-timings.ts",
|
|
55
|
+
"../kernel/src/document-caption-scale.ts",
|
|
55
56
|
"../kernel/src/parameters.ts",
|
|
56
57
|
"../kernel/src/document.ts",
|
|
57
58
|
"../kernel/src/document-components.ts",
|
|
@@ -69,7 +70,6 @@
|
|
|
69
70
|
"../kernel/src/escape-html.ts",
|
|
70
71
|
"../kernel/src/html.ts",
|
|
71
72
|
"../kernel/src/requests.ts",
|
|
72
|
-
"../kernel/src/document-caption-scale.ts",
|
|
73
73
|
"../kernel/src/step-keys.ts",
|
|
74
74
|
"../kernel/src/follow.ts",
|
|
75
75
|
"../kernel/src/logging.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/dsh",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.40",
|
|
4
4
|
"description": "Presmium's bundle for DeepSeek Harness: the workbench of presmium studio, its host side (Presmium's tools, approvals, document context, skills and routes) and its client side (the root layout and the workbench's panels, precompiled) (experimental)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"node-addon-require-builtin": "0.1.9",
|
|
86
86
|
"ws": "8.22.0",
|
|
87
87
|
"zod": "4.4.3",
|
|
88
|
-
"@lincyaw/cli": "1.0.0-rc.
|
|
89
|
-
"@lincyaw/mcp": "1.0.0-rc.
|
|
90
|
-
"@lincyaw/
|
|
91
|
-
"@lincyaw/
|
|
88
|
+
"@lincyaw/cli": "1.0.0-rc.41",
|
|
89
|
+
"@lincyaw/mcp": "1.0.0-rc.41",
|
|
90
|
+
"@lincyaw/skills": "1.0.0-rc.41",
|
|
91
|
+
"@lincyaw/kernel": "1.0.0-rc.41"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@deepseek-ai/dsh": "0.2.1-alpha.4"
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"react": "18.3.1",
|
|
105
105
|
"react-dom": "18.3.1",
|
|
106
106
|
"react-resizable-panels": "^4.14.5",
|
|
107
|
-
"@lincyaw/design": "1.0.0-rc.
|
|
108
|
-
"@lincyaw/workbench": "0.2.0-rc.
|
|
107
|
+
"@lincyaw/design": "1.0.0-rc.41",
|
|
108
|
+
"@lincyaw/workbench": "0.2.0-rc.41"
|
|
109
109
|
},
|
|
110
110
|
"scripts": {}
|
|
111
111
|
}
|
package/src/node/tools.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const CANDIDATE_TOOLS = new Set([
|
|
|
15
15
|
'run_code', 'capture_slides', 'capture_reading', 'capture_overview',
|
|
16
16
|
])
|
|
17
17
|
|
|
18
|
+
/** New tools carry their routing with their schema; the names retain compatibility with older servers. */
|
|
19
|
+
export const isCandidateTool = (tool: ListedTool): boolean => tool.workspace ? tool.workspace === 'candidate' : CANDIDATE_TOOLS.has(tool.name)
|
|
20
|
+
|
|
18
21
|
const IMAGE_TYPES = new Set<string>(['image/png', 'image/jpeg', 'image/webp', 'image/gif'])
|
|
19
22
|
|
|
20
23
|
/**
|
|
@@ -48,7 +51,7 @@ function definition(ctx: DshContext, binding: DocumentBinding, tool: ListedTool)
|
|
|
48
51
|
parameters: tool.inputSchema,
|
|
49
52
|
output: { schema: { type: 'string' }, render: (_args, value) => [{ type: 'text', text: String(value) }] },
|
|
50
53
|
async execute(args, exec) {
|
|
51
|
-
const result = await (
|
|
54
|
+
const result = await (isCandidateTool(tool) ? binding.client : binding.authorClient).call(tool.name, (args ?? {}) as Record<string, unknown>, exec.signal)
|
|
52
55
|
if (result.isError) throw new Error(result.text)
|
|
53
56
|
if (result.images.length > 0) prepared.set(exec.token, [...result.text ? [{ type: 'text' as const, text: result.text }] : [], ...await imageBlocks(ctx, tool.name, result.images, exec)])
|
|
54
57
|
return result.text
|
package/src/node/turns.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { errorMessage } from '@lincyaw/kernel'
|
|
|
3
3
|
import { isInside } from '@lincyaw/kernel/node'
|
|
4
4
|
import type { DshAgent, DshContext, DshToolExecution } from './dsh-types.ts'
|
|
5
5
|
import { WORKSPACE_ROUTES } from './server-routes.ts'
|
|
6
|
-
import {
|
|
6
|
+
import { isCandidateTool, PREFIX } from './tools.ts'
|
|
7
7
|
|
|
8
8
|
// What a writing tool answers when the change cannot be recorded. The AI reads it and tells the author in their own
|
|
9
9
|
// language, so it names what the author sees (Version History) and none of the internals behind it.
|
|
@@ -108,7 +108,7 @@ export function apply(ctx: DshContext): void {
|
|
|
108
108
|
await ctx.presmium.bindings.candidateOf(exec.agent)
|
|
109
109
|
const binding = ctx.presmium.bindings.bindingOf(exec.agent)
|
|
110
110
|
const tool = exec.name.startsWith(PREFIX) ? binding?.tools.find(tool => `${PREFIX}${tool.name}` === exec.name) : undefined
|
|
111
|
-
if (!WRITING_TOOLS.has(exec.name) && (!tool || tool.kind === 'read' || !
|
|
111
|
+
if (!WRITING_TOOLS.has(exec.name) && (!tool || tool.kind === 'read' || !isCandidateTool(tool))) return next()
|
|
112
112
|
const document = ctx.presmium.bindings.bindingOf(exec.agent)?.document.dir ?? ''
|
|
113
113
|
const agentSessionId = rootAgentSessionOf(exec.agent.session.id)
|
|
114
114
|
const state = turnStateOf(agentSessionId)
|