@meiyukichan/dsh-sandore 0.1.0-rc.6
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/LICENSE +201 -0
- package/cordis.patch.yml +39 -0
- package/dsh.plugin.json +16 -0
- package/lib/client/CommandEditor.d.ts +19 -0
- package/lib/client/DagEditor.d.ts +22 -0
- package/lib/client/DefinitionDetail.d.ts +13 -0
- package/lib/client/DefinitionList.d.ts +19 -0
- package/lib/client/DiscussionInput.d.ts +63 -0
- package/lib/client/DragHandle.d.ts +16 -0
- package/lib/client/EditorPane.d.ts +13 -0
- package/lib/client/FlowEditor.d.ts +31 -0
- package/lib/client/InstanceList.d.ts +24 -0
- package/lib/client/NewInstanceDialog.d.ts +19 -0
- package/lib/client/PreviewPanel.d.ts +13 -0
- package/lib/client/RunView.d.ts +79 -0
- package/lib/client/StepChatPanel.d.ts +34 -0
- package/lib/client/TreeNav.d.ts +27 -0
- package/lib/client/UnifiedTimeline.d.ts +11 -0
- package/lib/client/WorkflowButton.d.ts +11 -0
- package/lib/client/WorkflowList.d.ts +18 -0
- package/lib/client/WorkflowOverlay.d.ts +6 -0
- package/lib/client/chat/AssistantMarkdown.d.ts +22 -0
- package/lib/client/chat/CompactionItem.d.ts +24 -0
- package/lib/client/chat/ContextBody.d.ts +136 -0
- package/lib/client/chat/ContextInjectionRow.d.ts +25 -0
- package/lib/client/chat/GenericCommandCard.d.ts +10 -0
- package/lib/client/chat/MessageIconActions.d.ts +41 -0
- package/lib/client/chat/MessageItem.d.ts +65 -0
- package/lib/client/chat/ReasoningRow.d.ts +13 -0
- package/lib/client/chat/TurnTailNodeView.d.ts +29 -0
- package/lib/client/chat/UserMessageRow.d.ts +18 -0
- package/lib/client/chat/attachment/ImageLightbox.d.ts +26 -0
- package/lib/client/chat/attachment/MessageImage.d.ts +56 -0
- package/lib/client/chat/attachment/image-attachment.d.ts +41 -0
- package/lib/client/chat/attachment/image-labels.d.ts +21 -0
- package/lib/client/chat/message-chrome.d.ts +51 -0
- package/lib/client/chat/reference/ReferenceIcon.d.ts +20 -0
- package/lib/client/chat/turn-assistant.d.ts +12 -0
- package/lib/client/chat/turn-metrics.d.ts +42 -0
- package/lib/client/chat/use-calendar-day.d.ts +5 -0
- package/lib/client/chat/use-throttled-visual-update.d.ts +7 -0
- package/lib/client/chat-flow.d.ts +110 -0
- package/lib/client/composer-selects.d.ts +17 -0
- package/lib/client/dag-editor-model.d.ts +141 -0
- package/lib/client/describe-error.d.ts +9 -0
- package/lib/client/index.d.ts +6 -0
- package/lib/client/locales.d.ts +777 -0
- package/lib/client/model-faces.d.ts +156 -0
- package/lib/client/open-discussion.d.ts +24 -0
- package/lib/client/panel-model.d.ts +34 -0
- package/lib/client/remote.d.ts +34 -0
- package/lib/client/run-view-model.d.ts +304 -0
- package/lib/client/sandore-save.d.ts +41 -0
- package/lib/client/sandore-sse.d.ts +15 -0
- package/lib/client/step-chat-retry.d.ts +44 -0
- package/lib/client/tool/GenericToolCard.d.ts +28 -0
- package/lib/client/tool/ToolRow.d.ts +95 -0
- package/lib/client/tool/diff-card-model.d.ts +63 -0
- package/lib/client/tool/read-card-model.d.ts +67 -0
- package/lib/client/tool/search-card-model.d.ts +94 -0
- package/lib/client/tool/terminal-card-model.d.ts +86 -0
- package/lib/client/tool/tool-call-model.d.ts +74 -0
- package/lib/client/tool/web-card-model.d.ts +44 -0
- package/lib/client/use-focus-refresh.d.ts +1 -0
- package/lib/client/workflow-face.d.ts +68 -0
- package/lib/client/workflow-store.d.ts +80 -0
- package/lib/client/workspace-path.d.ts +15 -0
- package/lib/client.js +38389 -0
- package/lib/index.js +8854 -0
- package/lib/microflow/branch-evaluator.d.ts +290 -0
- package/lib/microflow/concurrency-limiter.d.ts +39 -0
- package/lib/microflow/errors.d.ts +39 -0
- package/lib/microflow/file-utils.d.ts +210 -0
- package/lib/microflow/finalize-manager.d.ts +414 -0
- package/lib/microflow/fork-session.d.ts +151 -0
- package/lib/microflow/index.d.ts +17 -0
- package/lib/microflow/internal.d.ts +56 -0
- package/lib/microflow/loop-manager.d.ts +127 -0
- package/lib/microflow/rules-resolver.d.ts +28 -0
- package/lib/microflow/stage-executor.d.ts +362 -0
- package/lib/microflow/step-navigator.d.ts +108 -0
- package/lib/microflow/step-runner.d.ts +190 -0
- package/lib/microflow/subagents.d.ts +380 -0
- package/lib/tool/index.d.ts +65 -0
- package/lib/typert.host.d.ts +16 -0
- package/lib/typert.host.js +25 -0
- package/lib/typert.remote-client.d.ts +114 -0
- package/lib/typert.remote-client.js +399 -0
- package/lib/workflow/ask-tool.d.ts +78 -0
- package/lib/workflow/dag-navigator.d.ts +136 -0
- package/lib/workflow/domain.d.ts +304 -0
- package/lib/workflow/engine-surface.d.ts +70 -0
- package/lib/workflow/errors.d.ts +13 -0
- package/lib/workflow/host-agent.d.ts +53 -0
- package/lib/workflow/index.d.ts +23 -0
- package/lib/workflow/interaction-manager.d.ts +170 -0
- package/lib/workflow/lifecycle-manager.d.ts +111 -0
- package/lib/workflow/persistence.d.ts +35 -0
- package/lib/workflow/plugin.d.ts +27 -0
- package/lib/workflow/reactive-state.d.ts +27 -0
- package/lib/workflow/recovery-manager.d.ts +158 -0
- package/lib/workflow/remote.d.ts +139 -0
- package/lib/workflow/schema.d.ts +1917 -0
- package/lib/workflow/seam.d.ts +254 -0
- package/lib/workflow/shell.d.ts +127 -0
- package/lib/workflow/sse.d.ts +16 -0
- package/lib/workflow/typert/typert.host.d.ts +16 -0
- package/lib/workflow/typert/typert.remote-client.d.ts +114 -0
- package/lib/workflow/types.d.ts +187 -0
- package/lib/workflow/wire.d.ts +256 -0
- package/lib/workflow/workflow-engine.d.ts +373 -0
- package/lib/workflow/yaml-error.d.ts +22 -0
- package/lib/workflow/yaml-parser.d.ts +23 -0
- package/package.json +140 -0
- package/packages/client/CommandEditor.tsx +73 -0
- package/packages/client/DagEditor.module.css +711 -0
- package/packages/client/DagEditor.tsx +1203 -0
- package/packages/client/DefinitionDetail.module.css +110 -0
- package/packages/client/DefinitionDetail.tsx +126 -0
- package/packages/client/DefinitionList.tsx +173 -0
- package/packages/client/DiscussionInput.tsx +763 -0
- package/packages/client/DragHandle.tsx +92 -0
- package/packages/client/EditorPane.tsx +70 -0
- package/packages/client/FlowEditor.tsx +227 -0
- package/packages/client/InstanceList.tsx +250 -0
- package/packages/client/NewInstanceDialog.module.css +244 -0
- package/packages/client/NewInstanceDialog.tsx +478 -0
- package/packages/client/PreviewPanel.tsx +55 -0
- package/packages/client/RunView.module.css +246 -0
- package/packages/client/RunView.tsx +314 -0
- package/packages/client/StepChatPanel.tsx +486 -0
- package/packages/client/TreeNav.tsx +294 -0
- package/packages/client/UnifiedTimeline.tsx +484 -0
- package/packages/client/WorkflowButton.module.css +72 -0
- package/packages/client/WorkflowButton.tsx +50 -0
- package/packages/client/WorkflowList.tsx +158 -0
- package/packages/client/WorkflowOverlay.module.css +390 -0
- package/packages/client/WorkflowOverlay.tsx +136 -0
- package/packages/client/WorkflowPanel.module.css +247 -0
- package/packages/client/chat/AssistantMarkdown.module.css +38 -0
- package/packages/client/chat/AssistantMarkdown.tsx +120 -0
- package/packages/client/chat/ChatView.module.css +198 -0
- package/packages/client/chat/CompactionItem.tsx +85 -0
- package/packages/client/chat/ContextBody.module.css +162 -0
- package/packages/client/chat/ContextBody.tsx +598 -0
- package/packages/client/chat/ContextInjectionRow.module.css +63 -0
- package/packages/client/chat/ContextInjectionRow.tsx +78 -0
- package/packages/client/chat/GenericCommandCard.module.css +87 -0
- package/packages/client/chat/GenericCommandCard.tsx +76 -0
- package/packages/client/chat/MessageIconActions.module.css +84 -0
- package/packages/client/chat/MessageIconActions.tsx +147 -0
- package/packages/client/chat/MessageItem.module.css +293 -0
- package/packages/client/chat/MessageItem.tsx +384 -0
- package/packages/client/chat/ReasoningRow.module.css +82 -0
- package/packages/client/chat/ReasoningRow.tsx +70 -0
- package/packages/client/chat/TurnTailNodeView.module.css +10 -0
- package/packages/client/chat/TurnTailNodeView.tsx +63 -0
- package/packages/client/chat/UserMessageRow.module.css +75 -0
- package/packages/client/chat/UserMessageRow.tsx +92 -0
- package/packages/client/chat/accessibility.module.css +9 -0
- package/packages/client/chat/attachment/ImageLightbox.module.css +45 -0
- package/packages/client/chat/attachment/ImageLightbox.tsx +70 -0
- package/packages/client/chat/attachment/MessageImage.module.css +70 -0
- package/packages/client/chat/attachment/MessageImage.tsx +136 -0
- package/packages/client/chat/attachment/image-attachment.ts +98 -0
- package/packages/client/chat/attachment/image-labels.ts +34 -0
- package/packages/client/chat/message-chrome.ts +96 -0
- package/packages/client/chat/reference/ReferenceIcon.tsx +40 -0
- package/packages/client/chat/turn-assistant.ts +15 -0
- package/packages/client/chat/turn-metrics.ts +102 -0
- package/packages/client/chat/use-calendar-day.ts +27 -0
- package/packages/client/chat/use-throttled-visual-update.ts +44 -0
- package/packages/client/chat-flow.spec.ts +357 -0
- package/packages/client/chat-flow.ts +278 -0
- package/packages/client/composer-selects.module.css +376 -0
- package/packages/client/composer-selects.tsx +531 -0
- package/packages/client/dag-editor-model.spec.ts +173 -0
- package/packages/client/dag-editor-model.ts +359 -0
- package/packages/client/describe-error.spec.ts +18 -0
- package/packages/client/describe-error.ts +12 -0
- package/packages/client/index.ts +144 -0
- package/packages/client/input.module.css +854 -0
- package/packages/client/is-conditional-check.spec.ts +34 -0
- package/packages/client/locales.ts +789 -0
- package/packages/client/model-faces.ts +225 -0
- package/packages/client/open-discussion.spec.ts +39 -0
- package/packages/client/open-discussion.ts +32 -0
- package/packages/client/panel-model.spec.ts +152 -0
- package/packages/client/panel-model.ts +72 -0
- package/packages/client/preview.module.css +95 -0
- package/packages/client/react-dom.d.ts +11 -0
- package/packages/client/reactflow-theme.css +91 -0
- package/packages/client/remote.spec.ts +41 -0
- package/packages/client/remote.ts +46 -0
- package/packages/client/run-view-model.spec.ts +641 -0
- package/packages/client/run-view-model.ts +636 -0
- package/packages/client/sandore-save.spec.ts +146 -0
- package/packages/client/sandore-save.ts +97 -0
- package/packages/client/sandore-sse.ts +59 -0
- package/packages/client/step-chat-retry.spec.ts +70 -0
- package/packages/client/step-chat-retry.ts +65 -0
- package/packages/client/timeline.module.css +503 -0
- package/packages/client/tool/GenericToolCard.tsx +99 -0
- package/packages/client/tool/ToolRow.module.css +308 -0
- package/packages/client/tool/ToolRow.tsx +328 -0
- package/packages/client/tool/diff-card-model.ts +103 -0
- package/packages/client/tool/read-card-model.ts +86 -0
- package/packages/client/tool/search-card-model.ts +166 -0
- package/packages/client/tool/terminal-card-model.ts +225 -0
- package/packages/client/tool/tool-call-model.ts +267 -0
- package/packages/client/tool/web-card-model.ts +80 -0
- package/packages/client/tree-nav.module.css +282 -0
- package/packages/client/use-focus-refresh.ts +23 -0
- package/packages/client/workflow-face.ts +72 -0
- package/packages/client/workflow-store.spec.ts +49 -0
- package/packages/client/workflow-store.ts +161 -0
- package/packages/client/workspace-path.ts +27 -0
- package/packages/css-modules.d.ts +6 -0
- package/packages/microflow/branch-evaluator.spec.ts +745 -0
- package/packages/microflow/branch-evaluator.ts +1037 -0
- package/packages/microflow/concurrency-limiter.ts +70 -0
- package/packages/microflow/errors.ts +64 -0
- package/packages/microflow/file-utils.spec.ts +604 -0
- package/packages/microflow/file-utils.ts +521 -0
- package/packages/microflow/finalize-manager.spec.ts +1977 -0
- package/packages/microflow/finalize-manager.ts +1464 -0
- package/packages/microflow/fork-session.spec.ts +184 -0
- package/packages/microflow/fork-session.ts +316 -0
- package/packages/microflow/index.ts +17 -0
- package/packages/microflow/internal.ts +166 -0
- package/packages/microflow/loop-manager.spec.ts +294 -0
- package/packages/microflow/loop-manager.ts +255 -0
- package/packages/microflow/rules-resolver.spec.ts +147 -0
- package/packages/microflow/rules-resolver.ts +58 -0
- package/packages/microflow/stage-executor.spec.ts +1577 -0
- package/packages/microflow/stage-executor.ts +1478 -0
- package/packages/microflow/step-navigator.spec.ts +301 -0
- package/packages/microflow/step-navigator.ts +300 -0
- package/packages/microflow/step-runner.spec.ts +1132 -0
- package/packages/microflow/step-runner.ts +752 -0
- package/packages/microflow/subagents.spec.ts +215 -0
- package/packages/microflow/subagents.ts +422 -0
- package/packages/tests/fixtures/test-workflow.yaml +128 -0
- package/packages/tests/mocks/agents.ts +206 -0
- package/packages/tests/mocks/llm.ts +46 -0
- package/packages/tests/mocks/session-title.ts +31 -0
- package/packages/tests/mocks/sessions.ts +131 -0
- package/packages/tests/mocks/shell.ts +60 -0
- package/packages/tests/mocks/storage-domain.ts +101 -0
- package/packages/tests/mocks/subagents.ts +197 -0
- package/packages/tests/mocks/subprocess.ts +59 -0
- package/packages/tests/mocks/user-questions.ts +33 -0
- package/packages/tests/mocks/workspace.ts +52 -0
- package/packages/tool/index.spec.ts +287 -0
- package/packages/tool/index.ts +348 -0
- package/packages/workflow/ask-tool.ts +173 -0
- package/packages/workflow/dag-navigator.spec.ts +236 -0
- package/packages/workflow/dag-navigator.ts +425 -0
- package/packages/workflow/domain.ts +26 -0
- package/packages/workflow/engine-surface.ts +71 -0
- package/packages/workflow/errors.ts +13 -0
- package/packages/workflow/host-agent.spec.ts +92 -0
- package/packages/workflow/host-agent.ts +62 -0
- package/packages/workflow/index.ts +25 -0
- package/packages/workflow/interaction-manager.spec.ts +390 -0
- package/packages/workflow/interaction-manager.ts +397 -0
- package/packages/workflow/lifecycle-manager.spec.ts +683 -0
- package/packages/workflow/lifecycle-manager.ts +288 -0
- package/packages/workflow/persistence.spec.ts +109 -0
- package/packages/workflow/persistence.ts +64 -0
- package/packages/workflow/plugin.ts +39 -0
- package/packages/workflow/reactive-state.spec.ts +69 -0
- package/packages/workflow/reactive-state.ts +52 -0
- package/packages/workflow/recovery-manager.spec.ts +606 -0
- package/packages/workflow/recovery-manager.ts +471 -0
- package/packages/workflow/remote.spec.ts +1045 -0
- package/packages/workflow/remote.ts +479 -0
- package/packages/workflow/schema.spec.ts +303 -0
- package/packages/workflow/schema.ts +562 -0
- package/packages/workflow/seam.ts +293 -0
- package/packages/workflow/shell.ts +142 -0
- package/packages/workflow/sse.ts +110 -0
- package/packages/workflow/typert/typert.host.d.ts +16 -0
- package/packages/workflow/typert/typert.host.js +25 -0
- package/packages/workflow/typert/typert.remote-client.d.ts +114 -0
- package/packages/workflow/typert/typert.remote-client.js +399 -0
- package/packages/workflow/types.ts +258 -0
- package/packages/workflow/wire.ts +267 -0
- package/packages/workflow/workflow-engine-e2e.spec.ts +262 -0
- package/packages/workflow/workflow-engine-real-e2e.spec.ts +922 -0
- package/packages/workflow/workflow-engine.spec.ts +4389 -0
- package/packages/workflow/workflow-engine.ts +2133 -0
- package/packages/workflow/yaml-error.ts +29 -0
- package/packages/workflow/yaml-parser.spec.ts +757 -0
- package/packages/workflow/yaml-parser.ts +287 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GenericToolCard:抄自 DSH `packages/client/ui-tool/src/client/tool/toolviews/GenericToolCard.tsx`。
|
|
3
|
+
* 默认工具行——把工具分类为视觉 variant 并渲染摘要行(DSH tool.call.toolview slot 的
|
|
4
|
+
* render-site fallback;未注册工具名落在此处)。内嵌面板不注册任何工具视图,故所有
|
|
5
|
+
* 工具都走通用卡片(与 DSH 对未注册工具的行为一致)。
|
|
6
|
+
* 适配:`openFile`/`inspect` 为可选 props(面板无 trajectory 视图时传 undefined,等价于
|
|
7
|
+
* DSH 未注入时无该 affordance);`cwd`/`home` 可选(home 由 host description 提供,
|
|
8
|
+
* 面板不读取时省略,等价于 DSH 无 host description)。locale 面收窄为 sandore 命名空间。
|
|
9
|
+
* 卡片材质派生(terminal/read/diff/search/web)+ state/summary 覆盖逐字保留。
|
|
10
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/GenericToolCard
|
|
11
|
+
*/
|
|
12
|
+
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
13
|
+
import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
|
|
14
|
+
/** Card props: the tool lifecycle block plus the render site's locale seat. */
|
|
15
|
+
export interface GenericToolCardProps {
|
|
16
|
+
toolName: string;
|
|
17
|
+
block: ToolCallBlock;
|
|
18
|
+
/** Session workspace root; workspace-rooted path summaries display relative to it. */
|
|
19
|
+
cwd?: string | undefined;
|
|
20
|
+
/** Host account home; a leftover POSIX home path displays as `~`. */
|
|
21
|
+
home?: string | undefined;
|
|
22
|
+
/** Open a filesystem path through the Host (already cwd-resolved). */
|
|
23
|
+
openFile?: ((path: string) => void) | undefined;
|
|
24
|
+
/** Jump to this call in the trajectory view. */
|
|
25
|
+
inspect?: (() => void) | undefined;
|
|
26
|
+
t: TranslateNS<'sandore'>;
|
|
27
|
+
}
|
|
28
|
+
export declare function GenericToolCard({ toolName, block, cwd, home, openFile, inspect, t }: GenericToolCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolRow:抄自 DSH `packages/client/ui-tool/src/client/tool/components/ToolRow.tsx`。
|
|
3
|
+
* 工具摘要行(figma 122:9479)——16px leading 槽(状态点/工具图标,hover/展开变 chevron)+
|
|
4
|
+
* 标题 + 分隔点 + FILL 截断摘要,经共享 DisclosureRow chrome,整行作为展开开关。
|
|
5
|
+
* 展开体:IN/OUT 槽标签卡(figma 1249:35657)、run_code 程序经 CodeBlock、或卡片材质
|
|
6
|
+
* (terminal/diff/read/search/web)之一;错误行折叠摘要为失败首行(红字);文件工具的
|
|
7
|
+
* 路径以悬停下划线链接打开(onOpenFile);展开体右下角 hover 揭示 Inspect 跳转。
|
|
8
|
+
* 适配:clsx 替换为本地 `cx`(sandore 无 clsx 依赖);locale 面收窄为 sandore 命名空间。
|
|
9
|
+
* 其余逐字保留。
|
|
10
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/ToolRow
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import type { WebBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
14
|
+
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
15
|
+
import { type DiffCardModel } from './diff-card-model.ts';
|
|
16
|
+
import { type ReadCardModel } from './read-card-model.ts';
|
|
17
|
+
import { type SearchCardModel } from './search-card-model.ts';
|
|
18
|
+
import { type TerminalCardModel } from './terminal-card-model.ts';
|
|
19
|
+
import type { ToolRowState, ToolRowVariant } from './tool-call-model.ts';
|
|
20
|
+
export interface ToolRowProps {
|
|
21
|
+
/** The render site's locale seat (terminal/code body copy). */
|
|
22
|
+
t: TranslateNS<'sandore'>;
|
|
23
|
+
variant: ToolRowVariant;
|
|
24
|
+
/** Wire tool name for tool-owned styling layered over the generic variant. */
|
|
25
|
+
toolName?: string | undefined;
|
|
26
|
+
/** Leading-slot glyph. */
|
|
27
|
+
icon: ReactNode;
|
|
28
|
+
title: string;
|
|
29
|
+
summary: string;
|
|
30
|
+
/**
|
|
31
|
+
* Trailing summary fragment rendered outside the ellipsized summary text, so
|
|
32
|
+
* a narrow row clips the summary before this. For a fragment whose whole
|
|
33
|
+
* value is surviving that clip — the todo row's parallel-active count.
|
|
34
|
+
* null/absent = the summary is the whole collapsed content. Dropped on an
|
|
35
|
+
* error row, whose collapsed summary is the failure line instead.
|
|
36
|
+
*/
|
|
37
|
+
summarySuffix?: string | null | undefined;
|
|
38
|
+
/** Expanded-body input text; null = no input section. */
|
|
39
|
+
body: string | null;
|
|
40
|
+
/** Flattened result text for the expanded Output section; null/absent = no output section. */
|
|
41
|
+
output?: string | null | undefined;
|
|
42
|
+
/** Error first line shown as the collapsed summary on an error row; null/absent = keep `summary`. */
|
|
43
|
+
errorSummary?: string | null | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Terminal-card material for a call whose render intent is a terminal card
|
|
46
|
+
* (derived by `terminalCardModel`); it replaces the text sections when
|
|
47
|
+
* present. A call carries at most one card kind, so the card props below are
|
|
48
|
+
* mutually exclusive.
|
|
49
|
+
*/
|
|
50
|
+
terminal?: TerminalCardModel | null | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Diff-card material for a call whose render intent is a diff card (derived by
|
|
53
|
+
* `diffCardModel`); it replaces the text body when present, the same way
|
|
54
|
+
* `terminal` does.
|
|
55
|
+
*/
|
|
56
|
+
diff?: DiffCardModel | null | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Read-card material for a call whose render intent is a read card (derived by
|
|
59
|
+
* `readCardModel`); it replaces the text body with the file's line-numbered,
|
|
60
|
+
* syntax-highlighted window when present.
|
|
61
|
+
*/
|
|
62
|
+
read?: ReadCardModel | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Search-card material for a call whose render intent is a search card
|
|
65
|
+
* (derived by `searchCardModel`); it replaces the text body with grouped
|
|
66
|
+
* matches or a path list when present.
|
|
67
|
+
*/
|
|
68
|
+
search?: SearchCardModel | null | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Web-card material for a call whose render intent is a web card (derived by
|
|
71
|
+
* `webCardModel`); it replaces the text body with the retrieval's citation
|
|
72
|
+
* list or fetched-source card when present.
|
|
73
|
+
*/
|
|
74
|
+
web?: WebBlockProps | null | undefined;
|
|
75
|
+
state: ToolRowState;
|
|
76
|
+
/**
|
|
77
|
+
* Filesystem path from tool args; when set with onOpenFile, the summary
|
|
78
|
+
* renders as a hover-underline link that opens the host default app.
|
|
79
|
+
*/
|
|
80
|
+
filePath?: string | undefined;
|
|
81
|
+
/** Open the path with the host OS default application (already cwd-resolved). */
|
|
82
|
+
onOpenFile?: ((path: string) => void) | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Jump to this call in the trajectory view: a hover-revealed Inspect pill
|
|
85
|
+
* over the expanded body. Absent = no affordance.
|
|
86
|
+
*/
|
|
87
|
+
inspect?: (() => void) | undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Render the tool row: the shared DisclosureRow chrome, one-line summary, and
|
|
91
|
+
* the expandable body with IN/OUT card, code block, or card material.
|
|
92
|
+
* @param props - ToolRow props (see {@link ToolRowProps}).
|
|
93
|
+
* @returns The tool row element.
|
|
94
|
+
*/
|
|
95
|
+
export declare function ToolRow({ t, variant, toolName, icon, title, summary, summarySuffix, body, output, errorSummary, terminal, diff, read, search, web, state, filePath, onOpenFile, inspect, }: ToolRowProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diff-card-model:抄自 DSH `packages/client/ui-tool/src/client/tool/models/diff-card-model.ts`。
|
|
3
|
+
* 从冻结 call slice 纯派生 diff 卡 props(`card:'diff'` 渲染意图,write/edit 声明)——
|
|
4
|
+
* 聊天工具行展开体与详情面板共用同一派生。逐字保留。
|
|
5
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/diff-card-model
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Pure derivation of the diff-card props from a frozen call slice: the
|
|
9
|
+
* `card:'diff'` render intent the write/edit tools declare arrives on the
|
|
10
|
+
* snapshot as `callView`/`resultView`, and this is the one place that turns
|
|
11
|
+
* that pair into what {@link DiffBlock} draws. Both conversation render sites
|
|
12
|
+
* (the chat tool row's expanded body and the details panel's Output section)
|
|
13
|
+
* call this, so the hunks they show are derived once.
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import type { DiffBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
17
|
+
import type { ToolCallBlock } from './tool-call-model.ts';
|
|
18
|
+
/**
|
|
19
|
+
* Diff-body lines the chat row shows before collapsing the middle — half the
|
|
20
|
+
* primitive's own default, which the details panel keeps. A chat row is a
|
|
21
|
+
* summary surface inside the message flow: the flow must stay scannable across
|
|
22
|
+
* many calls, while the details panel is the single-call reading surface. The
|
|
23
|
+
* same split {@link CHAT_TERMINAL_MAX_LINES} draws for a terminal card, so the
|
|
24
|
+
* two card kinds cap a long body at the same place in the flow. A design
|
|
25
|
+
* constant of this UI's row geometry, not a deployment choice.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CHAT_DIFF_MAX_LINES = 8;
|
|
28
|
+
/**
|
|
29
|
+
* The {@link DiffBlock} props this derivation owns. Picked off the primitive's
|
|
30
|
+
* props so the two stay in step; `maxLines`/`className` belong to each render
|
|
31
|
+
* site.
|
|
32
|
+
*/
|
|
33
|
+
export interface DiffCardModel {
|
|
34
|
+
/**
|
|
35
|
+
* The props {@link DiffBlock} draws. Held as a nested object so a render site
|
|
36
|
+
* spreads exactly the primitive's own surface and can never leak a
|
|
37
|
+
* neighbouring field into it.
|
|
38
|
+
*/
|
|
39
|
+
card: Pick<DiffBlockProps, 'diffs'>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Derive the diff-card props for a tool call, or null when this call is not a
|
|
43
|
+
* diff card and belongs on the generic path.
|
|
44
|
+
*
|
|
45
|
+
* The result side is authoritative once the call settles: the write/edit tools
|
|
46
|
+
* return the applied contextual hunks there (an edit's real before/after, a
|
|
47
|
+
* create's whole-file diff), which replace the call-time diff derived from the
|
|
48
|
+
* arguments alone. While the call is still running only the call side exists,
|
|
49
|
+
* so a running write/edit shows its intended change. Null is the documented
|
|
50
|
+
* generic-card default and covers every non-diff card — including a `card`
|
|
51
|
+
* value this UI version does not know, which arrives over the wire and cannot
|
|
52
|
+
* be trusted to be one of the compiled variants — and a settled call whose
|
|
53
|
+
* result view is generic (how write/edit keep their execution errors on the
|
|
54
|
+
* generic path).
|
|
55
|
+
*
|
|
56
|
+
* This derivation consumes only `diffs`; the render intent's `title` field is
|
|
57
|
+
* deliberately dropped. The row supplies its own title (`Edit`/`Write · path`
|
|
58
|
+
* from the args), which outranks the view's `title`. A tool that names its own
|
|
59
|
+
* diff header therefore does not surface that text on the Web row.
|
|
60
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
61
|
+
* @returns the diff-card props, or null for the generic path.
|
|
62
|
+
*/
|
|
63
|
+
export declare function diffCardModel(block: ToolCallBlock): DiffCardModel | null;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* read-card-model:抄自 DSH `packages/client/ui-tool/src/client/tool/models/read-card-model.ts`。
|
|
3
|
+
* 从冻结 call slice 纯派生 read 卡 props(`card:'read'` 渲染意图,result 侧)——
|
|
4
|
+
* 聊天工具行的常驻展开体与详情面板共用同一派生。适配:`abbreviateHomePath` 经
|
|
5
|
+
* tool-call-model 本地复刻导入(rc.6 runtime 未导出);其余逐字保留。
|
|
6
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/read-card-model
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Pure derivation of the read-card props from a frozen call slice: the
|
|
10
|
+
* `card:'read'` render intent the read tool declares arrives on the snapshot as
|
|
11
|
+
* the settled result node's `resultView`, and this is the one place that turns
|
|
12
|
+
* it into what {@link ReadBlock} draws. Both conversation render sites (the chat
|
|
13
|
+
* tool row's resident body and the details panel's Output section) call this, so
|
|
14
|
+
* the path, lines, total, and language they show are derived once.
|
|
15
|
+
*
|
|
16
|
+
* The read card is result-side only ([read card note](../../../../../../.agents/notes/implemented/feature/2026-07-30-web-read-card.md)):
|
|
17
|
+
* a call carries no file content until `execute` returns, so the pending call
|
|
18
|
+
* stays a generic card (`kind: 'read'`). A running read therefore has no read
|
|
19
|
+
* card, and this returns null for it — the row keeps its args-derived summary
|
|
20
|
+
* until the result arrives.
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
import type { ReadBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
24
|
+
import { type ToolCallBlock } from './tool-call-model.ts';
|
|
25
|
+
/**
|
|
26
|
+
* Content lines the chat row's resident read body shows before collapsing the
|
|
27
|
+
* middle — half the primitive's own default, which the details panel keeps. A
|
|
28
|
+
* chat row is a summary surface inside the message flow: the flow must stay
|
|
29
|
+
* scannable across many calls, while the details panel is the single-call
|
|
30
|
+
* reading surface. A design constant of this UI's row geometry, not a
|
|
31
|
+
* deployment choice, so it is fixed here rather than a plugin Config field. The
|
|
32
|
+
* same split [`CHAT_TERMINAL_MAX_LINES`](./terminal-card-model.ts) draws for
|
|
33
|
+
* terminal output.
|
|
34
|
+
*/
|
|
35
|
+
export declare const CHAT_READ_MAX_LINES = 8;
|
|
36
|
+
/**
|
|
37
|
+
* The {@link ReadBlock} props this derivation owns. Picked off the primitive's
|
|
38
|
+
* props so the two stay in step; `maxLines`/`className` belong to each render
|
|
39
|
+
* site.
|
|
40
|
+
*/
|
|
41
|
+
export type ReadCardModel = Pick<ReadBlockProps, 'label' | 'lines' | 'totalLines' | 'lang'>;
|
|
42
|
+
/**
|
|
43
|
+
* Derive the read-card props for a tool call, or null when this call is not a
|
|
44
|
+
* read card and belongs on the generic path.
|
|
45
|
+
*
|
|
46
|
+
* The read card is result-side only, so only a settled call whose result view
|
|
47
|
+
* declares `card:'read'` produces one. Every other case is null — the
|
|
48
|
+
* documented generic-card default:
|
|
49
|
+
*
|
|
50
|
+
* - A running call: it has no result view yet, and a read carries no content at
|
|
51
|
+
* call time.
|
|
52
|
+
* - A settled call whose result view is not a read card — including a `card`
|
|
53
|
+
* value this UI version does not know, which arrives over the wire and cannot
|
|
54
|
+
* be trusted to be one of the compiled variants, and the read tool's own
|
|
55
|
+
* generic fallback for an error result or a non-envelope body.
|
|
56
|
+
*
|
|
57
|
+
* The label is the read view's `title` when the tool supplied one (the
|
|
58
|
+
* presentation contract's replacement-title rule), otherwise the file path
|
|
59
|
+
* shortened the same way the row summary is: workspace-relative first, then
|
|
60
|
+
* POSIX `~` for a leftover host-home path.
|
|
61
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
62
|
+
* @param sessionCwd - the session workspace root; a workspace-rooted absolute
|
|
63
|
+
* path label displays relative to it. Absent leaves the path as authored.
|
|
64
|
+
* @param home - host account home; a leftover POSIX home path displays as `~`.
|
|
65
|
+
* @returns the read-card props, or null for the generic path.
|
|
66
|
+
*/
|
|
67
|
+
export declare function readCardModel(block: ToolCallBlock, sessionCwd?: string, home?: string): ReadCardModel | null;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* search-card-model:抄自 DSH `packages/client/ui-tool/src/client/tool/models/search-card-model.ts`。
|
|
3
|
+
* 从冻结 call slice 纯派生 search 卡 props(`card:'search'` 渲染意图,grep/glob 声明,
|
|
4
|
+
* result 侧)——聊天工具行常驻展开体与详情面板共用同一派生。逐字保留。
|
|
5
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/search-card-model
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Pure derivation of the search-card props from a frozen call slice: the
|
|
9
|
+
* `card:'search'` render intent the `grep` and `glob` tools declare arrives on
|
|
10
|
+
* the snapshot as `resultView`, and this is the one place that turns it into
|
|
11
|
+
* what {@link SearchBlock} draws. Both conversation render sites (the chat tool
|
|
12
|
+
* row's resident body and the details panel's Output section) call this, so the
|
|
13
|
+
* grouped matches or the path list they show are derived once.
|
|
14
|
+
*
|
|
15
|
+
* The search card is result-time only: a search call has no matches or paths
|
|
16
|
+
* before `execute`, so its pending state stays a `GenericCallView`
|
|
17
|
+
* ({@link module:@deepseek-ai/dsh-tools/src/presentation}). This derivation
|
|
18
|
+
* therefore reads only `resultView` and returns null for a still-running call,
|
|
19
|
+
* unlike the terminal card whose call view carries the command before
|
|
20
|
+
* execution.
|
|
21
|
+
*
|
|
22
|
+
* A capped result also carries a recovery locator (grep/glob's `Full … stored
|
|
23
|
+
* at …` footer) in the raw `tool/result` content, not in the structured
|
|
24
|
+
* matches/paths the view carries. Since both render sites replace that raw
|
|
25
|
+
* result with the card, this derivation surfaces the block's own result text as
|
|
26
|
+
* {@link SearchCardModel.recovery} so the one path to the dropped rows is not
|
|
27
|
+
* lost.
|
|
28
|
+
* @module
|
|
29
|
+
*/
|
|
30
|
+
import type { SearchBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
31
|
+
import type { ToolCallBlock } from './tool-call-model.ts';
|
|
32
|
+
/**
|
|
33
|
+
* Distributive `Omit`: a plain `Omit<A | B, K>` keeps only the keys common to
|
|
34
|
+
* both members, which would drop the `files`/`paths` discriminated fields.
|
|
35
|
+
* Distributing over the naked type parameter `T` preserves each shape.
|
|
36
|
+
*/
|
|
37
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
38
|
+
/** The {@link SearchBlockProps} union minus each render site's own fields. */
|
|
39
|
+
type SearchBlockModelProps = DistributiveOmit<SearchBlockProps, 'maxLines' | 'className'>;
|
|
40
|
+
/**
|
|
41
|
+
* Result rows the chat row's resident search body shows before collapsing the
|
|
42
|
+
* middle — half the primitive's own default, which the details panel keeps. A
|
|
43
|
+
* chat row is a summary surface inside the message flow: the flow must stay
|
|
44
|
+
* scannable across many calls, while the details panel is the single-call
|
|
45
|
+
* reading surface. A design constant of this UI's row geometry, not a
|
|
46
|
+
* deployment choice, so it is fixed here rather than a plugin Config field.
|
|
47
|
+
*/
|
|
48
|
+
export declare const CHAT_SEARCH_MAX_LINES = 8;
|
|
49
|
+
/**
|
|
50
|
+
* The {@link SearchBlock} props this derivation owns. Held as a nested object
|
|
51
|
+
* (`card`) so a render site spreads exactly the primitive's own surface and can
|
|
52
|
+
* never leak a neighbouring field into it. `maxLines`/`className` belong to each
|
|
53
|
+
* render site.
|
|
54
|
+
*/
|
|
55
|
+
export interface SearchCardModel {
|
|
56
|
+
/**
|
|
57
|
+
* The props {@link SearchBlock} draws, minus each render site's own
|
|
58
|
+
* `maxLines`/`className`.
|
|
59
|
+
*/
|
|
60
|
+
card: SearchBlockModelProps;
|
|
61
|
+
/**
|
|
62
|
+
* The result view's replacement title, which the presentation contract lets a
|
|
63
|
+
* search tool set at settle time. Absent when the presenter supplied none; a
|
|
64
|
+
* row then keeps its args-derived summary.
|
|
65
|
+
*/
|
|
66
|
+
title: string | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The raw `tool/result` text, flattened, surfaced only when the search was
|
|
69
|
+
* capped. The card renders the retained matches or paths, but the recovery
|
|
70
|
+
* locator a capped result carries — grep/glob's `Full … stored at: <locator>`
|
|
71
|
+
* footer, the one way to reach the rows the cap dropped — lives only in the raw
|
|
72
|
+
* result text, which the card replaces. A UI that shows the card would
|
|
73
|
+
* otherwise lose it. Absent when the result was not capped (the card holds
|
|
74
|
+
* every result) or the block carries no text.
|
|
75
|
+
*/
|
|
76
|
+
recovery: string | undefined;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Derive the search-card props for a tool call, or null when this call is not
|
|
80
|
+
* a search card and belongs on the generic path.
|
|
81
|
+
*
|
|
82
|
+
* Only the result side matters: the search card carries no call-time state, so
|
|
83
|
+
* a still-running call (no result view) is null, as is a settled call whose
|
|
84
|
+
* result view is not a search card — including a `card` value this UI version
|
|
85
|
+
* does not know, which arrives over the wire and cannot be trusted to be one of
|
|
86
|
+
* the compiled variants, a `card: 'search'` view whose `shape` is neither
|
|
87
|
+
* `matches` nor `paths` (equally untrusted wire data), and a generic result a
|
|
88
|
+
* `grep`/`glob` failure or nested `run_code` dispatch produces (its text keeps
|
|
89
|
+
* the generic path).
|
|
90
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
91
|
+
* @returns the search-card props, or null for the generic path.
|
|
92
|
+
*/
|
|
93
|
+
export declare function searchCardModel(block: ToolCallBlock): SearchCardModel | null;
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* terminal-card-model:抄自 DSH `packages/client/ui-tool/src/client/tool/models/terminal-card-model.ts`。
|
|
3
|
+
* 从冻结 call slice 纯派生 terminal 卡 props:`card:'terminal'` 渲染意图(shell 工具声明)
|
|
4
|
+
* 随快照以 `callView`/`resultView` 到达,这里是把它变成 {@link TerminalBlock} 所绘内容的
|
|
5
|
+
* 唯一地点。locale 面收窄为 sandore 命名空间,其余逐字保留。
|
|
6
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/terminal-card-model
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Pure derivation of the terminal-card props from a frozen call slice: the
|
|
10
|
+
* `card:'terminal'` render intent the shell tools declare arrives on the
|
|
11
|
+
* snapshot as `callView`/`resultView`, and this is the one place that turns
|
|
12
|
+
* that pair into what {@link TerminalBlock} draws. Both conversation render
|
|
13
|
+
* sites (the chat tool row's expanded body and the details panel's Output
|
|
14
|
+
* section) call this, so the command, cwd, output and exit status they show
|
|
15
|
+
* are derived once.
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import type { TerminalBlockLabels, TerminalBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
19
|
+
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
20
|
+
import type { ToolCallBlock } from './tool-call-model.ts';
|
|
21
|
+
/**
|
|
22
|
+
* Build the TerminalBlock display copy from the locale seat — the one place
|
|
23
|
+
* the primitive's label surface pairs with this package's dictionary, shared
|
|
24
|
+
* by every terminal render site (chat row, bash row, details panel).
|
|
25
|
+
* @param t - the render site's locale seat.
|
|
26
|
+
* @returns the full label set for {@link TerminalBlockProps}'s `labels`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function terminalBlockLabels(t: TranslateNS<'sandore'>): TerminalBlockLabels;
|
|
29
|
+
/**
|
|
30
|
+
* The {@link TerminalBlock} props this derivation owns. Picked off the
|
|
31
|
+
* primitive's props so the two stay in step; `home` is absent because the web
|
|
32
|
+
* client has no home path for the session host (a cwd renders as its last
|
|
33
|
+
* path segment), and `maxLines`/`className` belong to each render site.
|
|
34
|
+
*/
|
|
35
|
+
export interface TerminalCardModel {
|
|
36
|
+
/**
|
|
37
|
+
* The props {@link TerminalBlock} draws. Held as a nested object so a render
|
|
38
|
+
* site spreads exactly the primitive's own surface and can never leak a
|
|
39
|
+
* neighbouring field into it.
|
|
40
|
+
*/
|
|
41
|
+
card: Pick<TerminalBlockProps, 'command' | 'cwd' | 'output' | 'exitCode' | 'signal' | 'running'>;
|
|
42
|
+
/**
|
|
43
|
+
* The call view's model-authored description, which the contract defines as
|
|
44
|
+
* rendering ABOVE the card (the card itself has no description slot). Absent
|
|
45
|
+
* when the presenter supplied none, or when the window dropped the call side;
|
|
46
|
+
* a row then keeps its args-derived summary.
|
|
47
|
+
*/
|
|
48
|
+
description: string | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* True when a settled terminal card reports a failing exit — a non-zero code
|
|
52
|
+
* or a terminating signal. The bash tool settles a failing command as a
|
|
53
|
+
* completed call (`isError` stays false: the exit status is result data), so
|
|
54
|
+
* this is the collapsed row's only failure signal; without it the red exit
|
|
55
|
+
* pill would be visible only after expanding the card.
|
|
56
|
+
* @param model - a derived terminal card.
|
|
57
|
+
* @returns whether the card's exit status is a failure.
|
|
58
|
+
*/
|
|
59
|
+
export declare function terminalFailed(model: TerminalCardModel): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Derive the terminal-card props for a tool call, or null when this call is
|
|
62
|
+
* not a terminal card and belongs on the generic path.
|
|
63
|
+
*
|
|
64
|
+
* The call side supplies the command and its working directory; the result
|
|
65
|
+
* side supplies the captured output and exit status. Three cases produce
|
|
66
|
+
* null, all of them the documented generic-card default:
|
|
67
|
+
*
|
|
68
|
+
* - Neither side declares `card:'terminal'` — including a `card` value this
|
|
69
|
+
* UI version does not know, which arrives over the wire and therefore
|
|
70
|
+
* cannot be trusted to be one of the compiled variants.
|
|
71
|
+
* - A settled call whose result view is not a terminal card: the result
|
|
72
|
+
* presentation decides how the settled call renders, and the bash tool
|
|
73
|
+
* returns a generic fenced card for an execution error or a background
|
|
74
|
+
* start, whose text and error styling the generic path preserves.
|
|
75
|
+
*
|
|
76
|
+
* Window truncation can drop the call head from a settled result (see
|
|
77
|
+
* `ToolResultNode.call`/`callView` in dsh-client-runtime), leaving a terminal
|
|
78
|
+
* result with no call side. That still renders: the command falls back to the
|
|
79
|
+
* result view's replacement title, then to an empty command (the prompt line
|
|
80
|
+
* draws bare), and the prompt shows no cwd.
|
|
81
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
82
|
+
* @param sessionCwd - the session workspace root, which resolves an omitted or
|
|
83
|
+
* relative view cwd (see {@link resolveTerminalCwd}); absent leaves both unresolved.
|
|
84
|
+
* @returns the terminal-card props, or null for the generic path.
|
|
85
|
+
*/
|
|
86
|
+
export declare function terminalCardModel(block: ToolCallBlock, sessionCwd?: string): TerminalCardModel | null;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tool-call-model:抄自 DSH `packages/client/ui-tool/src/client/tool/models/tool-call-model.ts`。
|
|
3
|
+
* 工具摘要行的纯 row-model 派生:variant 分类、单行摘要、展开正文文本、结算结果输出。
|
|
4
|
+
* `abbreviateHomePath` 在 DSH 当前源码(rc.8)从 `@deepseek-ai/dsh-client-runtime/client`
|
|
5
|
+
* 导出,但 sandore 编译面锁定的已装版本(rc.6)尚未导出,故按 DSH runtime
|
|
6
|
+
* `workspaces/path.ts` 源码本地复刻(含 Windows/UNC 守卫)。逐字保留其余逻辑。
|
|
7
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/tool-call-model
|
|
8
|
+
*/
|
|
9
|
+
import type { ToolCallBlock, ToolResultNode } from '@deepseek-ai/dsh-client-runtime/client';
|
|
10
|
+
export type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
|
|
11
|
+
/** Tool-call row variants selected by the generic atomic renderer. */
|
|
12
|
+
export type ToolRowVariant = 'search' | 'read' | 'bash' | 'write' | 'edit' | 'code' | 'others';
|
|
13
|
+
/** Row state semantic; colors self-supplied via StateDot (design gives none). */
|
|
14
|
+
export type ToolRowState = 'running' | 'ok' | 'error' | 'stopped';
|
|
15
|
+
/** Figma row titles per variant (design literals, not translatable copy). */
|
|
16
|
+
export declare const VARIANT_TITLES: Record<ToolRowVariant, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Classify a tool name into its row variant.
|
|
19
|
+
* @param toolName - wire tool name.
|
|
20
|
+
* @returns matching variant, others when unknown.
|
|
21
|
+
*/
|
|
22
|
+
export declare function classifyTool(toolName: string): ToolRowVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Display-only POSIX home abbreviation(DSH runtime `workspaces/path.ts` 源码复刻)。
|
|
25
|
+
* Windows drive and UNC paths stay verbatim, including when `home` itself is a
|
|
26
|
+
* Windows path. A missing, empty, or filesystem-root `home` leaves `path`
|
|
27
|
+
* unchanged so `/` cannot become `~`.
|
|
28
|
+
* @param path - absolute or already-short display path.
|
|
29
|
+
* @param home - host account home from `host.describe`; absent skips abbreviation.
|
|
30
|
+
* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function abbreviateHomePath(path: string, home?: string): string;
|
|
33
|
+
/** Everything ToolRow needs, derived once from the frozen slice. */
|
|
34
|
+
export interface ToolRowModel {
|
|
35
|
+
variant: ToolRowVariant;
|
|
36
|
+
title: string;
|
|
37
|
+
summary: string;
|
|
38
|
+
/**
|
|
39
|
+
* Filesystem path from args (`path` / `file_path`) when the row is a file
|
|
40
|
+
* tool; absent for URL reads and non-file tools.
|
|
41
|
+
*/
|
|
42
|
+
filePath: string | undefined;
|
|
43
|
+
/** Expanded-body input text (pretty args); null = no input section. */
|
|
44
|
+
body: string | null;
|
|
45
|
+
/** Flattened result text ({@link resultText}); null while running or when the result carries no text. */
|
|
46
|
+
output: string | null;
|
|
47
|
+
/** First line of the result text on an error row; null for every other state. */
|
|
48
|
+
errorSummary: string | null;
|
|
49
|
+
state: ToolRowState;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Flatten a settled result's content blocks to display text: text blocks
|
|
53
|
+
* verbatim, other block shapes as pretty JSON. Empty content on a failed call
|
|
54
|
+
* falls back to the structured error's `name: code` line.
|
|
55
|
+
* @param node - the settled result node.
|
|
56
|
+
* @returns the flattened result text (may be empty).
|
|
57
|
+
*/
|
|
58
|
+
export declare function resultText(node: ToolResultNode): string;
|
|
59
|
+
/**
|
|
60
|
+
* Strip the workspace root from a workspace-rooted absolute path (display only).
|
|
61
|
+
* @param text - the path to shorten.
|
|
62
|
+
* @param cwd - session workspace root; absent or empty leaves the path unchanged.
|
|
63
|
+
* @returns the path relative to the workspace root, or unchanged when it is not rooted there.
|
|
64
|
+
*/
|
|
65
|
+
export declare function relativizeToCwd(text: string, cwd: string | undefined): string;
|
|
66
|
+
/**
|
|
67
|
+
* Derive the full row model from a frozen call slice.
|
|
68
|
+
* @param toolName - wire tool name (dispatch-supplied; survives windowless results).
|
|
69
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
70
|
+
* @param cwd - session workspace root; workspace-rooted path summaries display relative to it.
|
|
71
|
+
* @param home - host account home; a leftover POSIX home path displays as `~`.
|
|
72
|
+
* @returns the row model.
|
|
73
|
+
*/
|
|
74
|
+
export declare function toolRowModel(toolName: string, block: ToolCallBlock, cwd?: string, home?: string): ToolRowModel;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* web-card-model:抄自 DSH `packages/client/ui-tool/src/client/tool/models/web-card-model.ts`。
|
|
3
|
+
* 从冻结 call slice 纯派生 web 卡 props(`card:'web'` 渲染意图,web_search/web_fetch 在
|
|
4
|
+
* result 时声明)——聊天工具行展开体与详情面板共用同一派生。逐字保留。
|
|
5
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/tool/web-card-model
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Pure derivation of the web-card props from a frozen call slice: the
|
|
9
|
+
* `card:'web'` render intent the `web_search`/`web_fetch` tools declare at
|
|
10
|
+
* result time arrives on the snapshot as `resultView`, and this is the one
|
|
11
|
+
* place that turns it into what {@link WebBlock} draws. Both conversation
|
|
12
|
+
* render sites (the chat tool row's resident/expanded body and the details
|
|
13
|
+
* panel's Output section) call this, so the sources and fetch summary they
|
|
14
|
+
* show are derived once.
|
|
15
|
+
*
|
|
16
|
+
* The web card is result-only by contract: those tools keep a generic pending
|
|
17
|
+
* call view, so there is nothing to derive while the call is still running and
|
|
18
|
+
* a running call always takes the generic path.
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import type { WebBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
22
|
+
import type { ToolCallBlock } from './tool-call-model.ts';
|
|
23
|
+
/**
|
|
24
|
+
* Derive the web-card props for a tool call, or null when this call is not a
|
|
25
|
+
* web card and belongs on the generic path.
|
|
26
|
+
*
|
|
27
|
+
* The result side supplies the whole card: the sources and answer for a
|
|
28
|
+
* `search`, the URL and status for a `fetch`. Cases producing null, all of
|
|
29
|
+
* them the documented generic-card default:
|
|
30
|
+
*
|
|
31
|
+
* - A running call (no `resultView` yet): the web tools keep a generic pending
|
|
32
|
+
* card, so nothing web-shaped exists until the call settles.
|
|
33
|
+
* - A settled call whose result view is not a web card — including a `card`
|
|
34
|
+
* value this UI version does not know, which arrives over the wire and so
|
|
35
|
+
* cannot be trusted to be one of the compiled variants, and a generic result
|
|
36
|
+
* view (a web tool's error path returns the generic card, whose text the
|
|
37
|
+
* generic path preserves).
|
|
38
|
+
* - A web card whose `kind` this UI version does not know (a newer host's
|
|
39
|
+
* value): the wire cannot be trusted to be `search` or `fetch`, so it takes
|
|
40
|
+
* the generic path rather than rendering as a malformed fetch.
|
|
41
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
42
|
+
* @returns the web-card props, or null for the generic path.
|
|
43
|
+
*/
|
|
44
|
+
export declare function webCardModel(block: ToolCallBlock): WebBlockProps | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFocusRefresh(onRefresh: () => void): void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作流 overlay 的业务 face(shell.overlay 条目注入;RPC 已在 index.ts 解包)。
|
|
3
|
+
*
|
|
4
|
+
* 覆盖左列表(实例/定义)、编辑区(DagEditor 编排 / RunView 执行)与测试运行
|
|
5
|
+
* 所需的全部 `ctx.remote.sandore` 访问面。`remote` 为 RunView 控件所需的最小 RPC 面。
|
|
6
|
+
* @module @deepseek-ai/dsh-client-ui-sandore/src/client/workflow-face
|
|
7
|
+
*/
|
|
8
|
+
import type { DagRun, InstanceSummary, WorkflowDefinitionEntry } from 'dsh-sandore/remote';
|
|
9
|
+
import type { SaveDefinition } from './sandore-save.ts';
|
|
10
|
+
import type { RunViewRemote } from './RunView.tsx';
|
|
11
|
+
import type { ModelDirectoryFace, ObservableFace, PermissionSelectValue } from './model-faces.ts';
|
|
12
|
+
/** 创建实例时选择的模型(对齐 Host `StartInstanceInput.model`)。 */
|
|
13
|
+
export interface StartModelSelection {
|
|
14
|
+
provider: string;
|
|
15
|
+
model: string;
|
|
16
|
+
reasoningEffort?: string;
|
|
17
|
+
}
|
|
18
|
+
/** 新增实例入参(去 job 概念:直接绑定工作流定义 + 工作目录 + 模型 + 权限)。 */
|
|
19
|
+
export interface StartInstanceParams {
|
|
20
|
+
workflowId: string;
|
|
21
|
+
originalInput: string;
|
|
22
|
+
/** 必填工作目录:hostAgent 据此 attach 到对应的 web workspace。 */
|
|
23
|
+
cwd: string;
|
|
24
|
+
model?: StartModelSelection;
|
|
25
|
+
permission?: string;
|
|
26
|
+
}
|
|
27
|
+
/** 模型目录条目(弹窗模型下拉数据源,来自 `ctx.llm` 目录)。 */
|
|
28
|
+
export interface ModelDirectoryEntry {
|
|
29
|
+
provider: string;
|
|
30
|
+
providerName: string;
|
|
31
|
+
models: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}[];
|
|
35
|
+
}
|
|
36
|
+
/** WorkflowOverlay 接收的业务 face。 */
|
|
37
|
+
export interface WorkflowOverlayFace {
|
|
38
|
+
/** 拉取实例摘要(RPC 已解包)。 */
|
|
39
|
+
listInstances(): Promise<InstanceSummary[]>;
|
|
40
|
+
/** 拉取定义列表(RPC 已解包)。 */
|
|
41
|
+
listDefinitions(): Promise<WorkflowDefinitionEntry[]>;
|
|
42
|
+
/** 启动实例(新增实例弹窗 / 测试运行;RPC 已解包)。 */
|
|
43
|
+
startInstance(input: StartInstanceParams): Promise<DagRun>;
|
|
44
|
+
/** 模型目录(弹窗模型下拉数据源;RPC 已解包)。 */
|
|
45
|
+
listModelDirectory(): Promise<ModelDirectoryEntry[]>;
|
|
46
|
+
/** 打开 DSH 原生目录选择器(新增实例的工作目录)。 */
|
|
47
|
+
pickDirectory(): Promise<string | undefined>;
|
|
48
|
+
/** 删除定义(RPC 已解包)。 */
|
|
49
|
+
deleteDefinition(id: string): Promise<boolean>;
|
|
50
|
+
/** 删除实例(RPC 已解包;state 表行级删除)。 */
|
|
51
|
+
deleteInstance(instanceId: string): Promise<boolean>;
|
|
52
|
+
/** 读取定义原始 YAML(RPC 已解包)。 */
|
|
53
|
+
getYaml(id: string): Promise<string>;
|
|
54
|
+
/** DagEditor 保存回调(createSandoreSave 接线)。 */
|
|
55
|
+
save: SaveDefinition;
|
|
56
|
+
/** RunView 所需的最小 `ctx.remote.sandore` 访问面。 */
|
|
57
|
+
remote: RunViewRemote;
|
|
58
|
+
/** 打开宿主会话(RunView「查看详情/打开讨论」跳实例或子代理会话)。 */
|
|
59
|
+
openSession(id: string): void;
|
|
60
|
+
/** 某会话的共享模型目录(复用 DSH `ctx.modelDirectories`,行为与主 session 一致)。 */
|
|
61
|
+
modelDirectory(sessionId: string): ModelDirectoryFace;
|
|
62
|
+
/** 某会话的权限投影(`projections.permissions`,可订阅)。 */
|
|
63
|
+
permissions(sessionId: string): ObservableFace<PermissionSelectValue | undefined>;
|
|
64
|
+
/** 对某会话执行一行命令(`/permission <id>` 等,走 DSH `remote.commands`)。 */
|
|
65
|
+
runCommand(sessionId: string, line: string): Promise<boolean>;
|
|
66
|
+
/** 权限投影缺失时的回退:经 `/permission`(无参)查询当前预设与可用列表。 */
|
|
67
|
+
queryPermission(sessionId: string): Promise<PermissionSelectValue | undefined>;
|
|
68
|
+
}
|