@xiaoso/dsh-workflow-lite 0.0.0-stage → 0.1.0
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 +24 -0
- package/README.en.md +84 -0
- package/README.md +83 -2
- package/THIRD_PARTY_NOTICES.md +762 -0
- package/assets/icon-full.webp +0 -0
- package/assets/icon.webp +0 -0
- package/assets/wordmark.png +0 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +127442 -0
- package/lib/index.mjs +9613 -0
- package/lib/types/client/app/addStep.d.ts +25 -0
- package/lib/types/client/app/desktop.d.ts +52 -0
- package/lib/types/client/app/host.d.ts +29 -0
- package/lib/types/client/app/sessions.d.ts +117 -0
- package/lib/types/client/app/theme.d.ts +27 -0
- package/lib/types/client/app/usePluginConfig.d.ts +59 -0
- package/lib/types/client/app/useRunFile.d.ts +24 -0
- package/lib/types/client/app/useRunGraph.d.ts +51 -0
- package/lib/types/client/app/useRunHistory.d.ts +21 -0
- package/lib/types/client/app/useRuns.d.ts +84 -0
- package/lib/types/client/app/useVersions.d.ts +50 -0
- package/lib/types/client/app/useWorkflow.d.ts +67 -0
- package/lib/types/client/app/viewport.d.ts +14 -0
- package/lib/types/client/i18n.d.ts +930 -0
- package/lib/types/client/index.d.ts +18 -0
- package/lib/types/client/model/connect.d.ts +44 -0
- package/lib/types/client/model/editor.d.ts +252 -0
- package/lib/types/client/model/fileKind.d.ts +15 -0
- package/lib/types/client/model/hostPath.d.ts +15 -0
- package/lib/types/client/model/htmlPreview.d.ts +24 -0
- package/lib/types/client/model/hubRuns.d.ts +45 -0
- package/lib/types/client/model/layout.d.ts +83 -0
- package/lib/types/client/model/library.d.ts +109 -0
- package/lib/types/client/model/nudge.d.ts +43 -0
- package/lib/types/client/model/pathSample.d.ts +26 -0
- package/lib/types/client/model/route.d.ts +121 -0
- package/lib/types/client/model/runDraft.d.ts +68 -0
- package/lib/types/client/model/runGraph.d.ts +15 -0
- package/lib/types/client/model/runHistory.d.ts +40 -0
- package/lib/types/client/model/themes.d.ts +87 -0
- package/lib/types/client/model/time.d.ts +7 -0
- package/lib/types/client/rpc.d.ts +42 -0
- package/lib/types/client/ui/AppearancePicker.d.ts +23 -0
- package/lib/types/client/ui/Canvas.d.ts +76 -0
- package/lib/types/client/ui/Confirm.d.ts +42 -0
- package/lib/types/client/ui/DocViewer.d.ts +67 -0
- package/lib/types/client/ui/Dock.d.ts +13 -0
- package/lib/types/client/ui/FileTag.d.ts +9 -0
- package/lib/types/client/ui/FileViewer.d.ts +30 -0
- package/lib/types/client/ui/FlowStreaks.d.ts +40 -0
- package/lib/types/client/ui/Handoff.d.ts +30 -0
- package/lib/types/client/ui/HostPicker.d.ts +31 -0
- package/lib/types/client/ui/HubDialog.d.ts +38 -0
- package/lib/types/client/ui/HubRunRow.d.ts +22 -0
- package/lib/types/client/ui/HubRuns.d.ts +19 -0
- package/lib/types/client/ui/HubSettings.d.ts +20 -0
- package/lib/types/client/ui/HubStorage.d.ts +18 -0
- package/lib/types/client/ui/HubWorkflowList.d.ts +21 -0
- package/lib/types/client/ui/HubWorkflowRow.d.ts +33 -0
- package/lib/types/client/ui/HubWorkflows.d.ts +26 -0
- package/lib/types/client/ui/HubWorkspacePicker.d.ts +16 -0
- package/lib/types/client/ui/Icon.d.ts +83 -0
- package/lib/types/client/ui/InputPanel.d.ts +37 -0
- package/lib/types/client/ui/InputsDialog.d.ts +22 -0
- package/lib/types/client/ui/Inspector.d.ts +51 -0
- package/lib/types/client/ui/Issues.d.ts +15 -0
- package/lib/types/client/ui/Launch.d.ts +30 -0
- package/lib/types/client/ui/Library.d.ts +23 -0
- package/lib/types/client/ui/LinkRow.d.ts +31 -0
- package/lib/types/client/ui/Markdown.d.ts +21 -0
- package/lib/types/client/ui/NodeHeads.d.ts +47 -0
- package/lib/types/client/ui/NoteDrawer.d.ts +21 -0
- package/lib/types/client/ui/OpenWith.d.ts +21 -0
- package/lib/types/client/ui/Outputs.d.ts +61 -0
- package/lib/types/client/ui/PanelHead.d.ts +21 -0
- package/lib/types/client/ui/PlanDialog.d.ts +18 -0
- package/lib/types/client/ui/PreviewCard.d.ts +38 -0
- package/lib/types/client/ui/QuickAdd.d.ts +30 -0
- package/lib/types/client/ui/ResourceItemDialog.d.ts +33 -0
- package/lib/types/client/ui/ResourceItems.d.ts +30 -0
- package/lib/types/client/ui/ResourcePanel.d.ts +26 -0
- package/lib/types/client/ui/Resources.d.ts +43 -0
- package/lib/types/client/ui/RunDraftBar.d.ts +35 -0
- package/lib/types/client/ui/RunEdge.d.ts +29 -0
- package/lib/types/client/ui/RunFiles.d.ts +24 -0
- package/lib/types/client/ui/RunInput.d.ts +26 -0
- package/lib/types/client/ui/RunItemDialog.d.ts +43 -0
- package/lib/types/client/ui/RunModeSwitch.d.ts +14 -0
- package/lib/types/client/ui/RunNav.d.ts +22 -0
- package/lib/types/client/ui/RunNodeState.d.ts +42 -0
- package/lib/types/client/ui/RunOverview.d.ts +27 -0
- package/lib/types/client/ui/RunPosition.d.ts +24 -0
- package/lib/types/client/ui/RunResource.d.ts +40 -0
- package/lib/types/client/ui/RunStatusMenu.d.ts +28 -0
- package/lib/types/client/ui/RunStep.d.ts +45 -0
- package/lib/types/client/ui/RunTopBar.d.ts +42 -0
- package/lib/types/client/ui/RunView.d.ts +43 -0
- package/lib/types/client/ui/SettingsDialog.d.ts +25 -0
- package/lib/types/client/ui/SettingsFields.d.ts +37 -0
- package/lib/types/client/ui/SkillPicker.d.ts +25 -0
- package/lib/types/client/ui/SkillPreview.d.ts +27 -0
- package/lib/types/client/ui/StepMark.d.ts +16 -0
- package/lib/types/client/ui/StepPanel.d.ts +26 -0
- package/lib/types/client/ui/ThemePicker.d.ts +13 -0
- package/lib/types/client/ui/TipLayer.d.ts +17 -0
- package/lib/types/client/ui/TopBar.d.ts +32 -0
- package/lib/types/client/ui/VersionList.d.ts +19 -0
- package/lib/types/client/ui/VersionRow.d.ts +19 -0
- package/lib/types/client/ui/VersionsDialog.d.ts +18 -0
- package/lib/types/client/ui/WorkflowRow.d.ts +32 -0
- package/lib/types/client/ui/WorkflowSwitcher.d.ts +20 -0
- package/lib/types/client/ui/WorkflowView.d.ts +27 -0
- package/lib/types/client/ui/lines.d.ts +13 -0
- package/lib/types/client/ui/primitives.d.ts +119 -0
- package/lib/types/client/ui/resourceUi.d.ts +49 -0
- package/lib/types/client/ui/stepIcons.d.ts +10 -0
- package/lib/types/host/authoringSkill.d.ts +17 -0
- package/lib/types/host/config.d.ts +54 -0
- package/lib/types/host/hostFs.d.ts +69 -0
- package/lib/types/host/plan.d.ts +68 -0
- package/lib/types/host/pluginConfig.d.ts +57 -0
- package/lib/types/host/rpc.d.ts +45 -0
- package/lib/types/host/runs/files.d.ts +37 -0
- package/lib/types/host/runs/notice.d.ts +21 -0
- package/lib/types/host/runs/service.d.ts +258 -0
- package/lib/types/host/runs/skill.d.ts +16 -0
- package/lib/types/host/runs/storage.d.ts +16 -0
- package/lib/types/host/runs/store.d.ts +56 -0
- package/lib/types/host/skillView.d.ts +22 -0
- package/lib/types/host/store/atomic.d.ts +34 -0
- package/lib/types/host/store/materialize.d.ts +19 -0
- package/lib/types/host/store/merge.d.ts +25 -0
- package/lib/types/host/store/paths.d.ts +86 -0
- package/lib/types/host/store/repository.d.ts +217 -0
- package/lib/types/host/store/versions.d.ts +38 -0
- package/lib/types/host/tool/tool.d.ts +432 -0
- package/lib/types/index.d.ts +35 -0
- package/lib/types/shared/appearance.d.ts +49 -0
- package/lib/types/shared/compile.d.ts +71 -0
- package/lib/types/shared/graph.d.ts +54 -0
- package/lib/types/shared/graphDiff.d.ts +29 -0
- package/lib/types/shared/inputs.d.ts +46 -0
- package/lib/types/shared/limits.d.ts +77 -0
- package/lib/types/shared/model.d.ts +122 -0
- package/lib/types/shared/naming.d.ts +59 -0
- package/lib/types/shared/outputPaths.d.ts +49 -0
- package/lib/types/shared/resources.d.ts +98 -0
- package/lib/types/shared/runCursor.d.ts +54 -0
- package/lib/types/shared/runState.d.ts +221 -0
- package/lib/types/shared/runSync.d.ts +24 -0
- package/lib/types/shared/types.d.ts +488 -0
- package/lib/types/shared/validate.d.ts +54 -0
- package/lib/types/shared/wire.d.ts +600 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +144 -4
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 连接清单的一行(模板的属性面板与实例的右栏共用)。
|
|
3
|
+
*
|
|
4
|
+
* 上面一行:方向箭头、对面那一步的图标与名字、回头线的环、条件小标,行尾可放一样东西
|
|
5
|
+
* (实例里是对面那一步的状态);下面一行是这条线交了什么。整行点下去选中这条线。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/LinkRow
|
|
8
|
+
*/
|
|
9
|
+
import type { WorkflowEdge, WorkflowNode } from '../../shared/types.ts';
|
|
10
|
+
import type { T } from '../i18n.ts';
|
|
11
|
+
/** 条件的小标(和画布上那条线同色);`always` 时只有要求才画。 */
|
|
12
|
+
export declare function WhenChip(props: {
|
|
13
|
+
t: T;
|
|
14
|
+
when: string | undefined;
|
|
15
|
+
always?: boolean;
|
|
16
|
+
}): React.JSX.Element | null;
|
|
17
|
+
export declare function LinkRow(props: {
|
|
18
|
+
t: T;
|
|
19
|
+
edge: WorkflowEdge;
|
|
20
|
+
direction: 'in' | 'out';
|
|
21
|
+
/** 对面那个节点(找不到时按 id 显示)。 */
|
|
22
|
+
other: WorkflowNode | undefined;
|
|
23
|
+
otherId: string;
|
|
24
|
+
back: boolean;
|
|
25
|
+
/** 这次走过没有(实例里);不给 = 不表态。 */
|
|
26
|
+
taken?: boolean | undefined;
|
|
27
|
+
takenLabel?: string | undefined;
|
|
28
|
+
end?: React.ReactNode;
|
|
29
|
+
testId: string;
|
|
30
|
+
onPick(): void;
|
|
31
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 一个小而安全的 Markdown 渲染器(计划预览用)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么不引库:模块加载器只认冻结的平台 externals,引进来的库要整个打进 bundle;而计划
|
|
5
|
+
* 只用到 Markdown 的一小块(标题、段落、粗体、行内代码、表格、列表、引用、代码块、分隔线)。
|
|
6
|
+
*
|
|
7
|
+
* **只产出 React 元素,从不拼 HTML 字符串**:提示词是用户写的任意文本,走 `innerHTML`
|
|
8
|
+
* 就是一个注入口。链接只认 http(s)。
|
|
9
|
+
*
|
|
10
|
+
* 换行按"一行就是一行"处理(GitHub 评论区那种),而不是 CommonMark 的"单个换行算空格"——
|
|
11
|
+
* 提示词与计划都是按行写的,把它们挤成一段反而难读。
|
|
12
|
+
*
|
|
13
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/Markdown
|
|
14
|
+
*/
|
|
15
|
+
import type { ReactNode } from 'react';
|
|
16
|
+
/** 把一行文字渲染成行内元素(代码里的东西原样保留,不再往里解析)。 */
|
|
17
|
+
export declare function renderInline(text: string, key?: string): ReactNode[];
|
|
18
|
+
export declare function Markdown(props: {
|
|
19
|
+
text: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 各种东西的右栏标题栏:步骤、资源、输入、连线、概览。
|
|
3
|
+
*
|
|
4
|
+
* 模板的属性面板、实例右栏的「运行」与「编辑」都用这几个,所以实例里两边切换时标题栏一点不动。
|
|
5
|
+
* 右边的 `extra` 放在关闭按钮左边(实例里是「运行 / 编辑」的切换)。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/NodeHeads
|
|
8
|
+
*/
|
|
9
|
+
import type { GraphAnalysis } from '../../shared/graph.ts';
|
|
10
|
+
import type { InputNode, ResourceNode, StepNode, WorkflowDocument, WorkflowEdge } from '../../shared/types.ts';
|
|
11
|
+
import type { LocaleKey, T } from '../i18n.ts';
|
|
12
|
+
import type { Edit } from '../model/editor.ts';
|
|
13
|
+
import { type IconName } from './Icon.tsx';
|
|
14
|
+
interface HeadProps {
|
|
15
|
+
t: T;
|
|
16
|
+
/** 关闭按钮左边的东西。 */
|
|
17
|
+
extra?: React.ReactNode;
|
|
18
|
+
onClose(): void;
|
|
19
|
+
closeTestId?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function StepHead(props: HeadProps & {
|
|
22
|
+
node: StepNode;
|
|
23
|
+
onEdit(edit: Edit): void;
|
|
24
|
+
onSeal(): void;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
export declare function ResourceHead(props: HeadProps & {
|
|
27
|
+
node: ResourceNode;
|
|
28
|
+
onEdit(edit: Edit): void;
|
|
29
|
+
onSeal(): void;
|
|
30
|
+
}): React.JSX.Element;
|
|
31
|
+
export declare function InputHead(props: HeadProps & {
|
|
32
|
+
node: InputNode;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
/** 线的标题与图标(右栏标题栏、顶栏「在看什么」用)。 */
|
|
35
|
+
export declare function edgeHead(doc: WorkflowDocument, analysis: GraphAnalysis, edge: WorkflowEdge): {
|
|
36
|
+
icon: IconName;
|
|
37
|
+
title: LocaleKey;
|
|
38
|
+
};
|
|
39
|
+
export declare function EdgeHead(props: HeadProps & {
|
|
40
|
+
doc: WorkflowDocument;
|
|
41
|
+
analysis: GraphAnalysis;
|
|
42
|
+
edge: WorkflowEdge;
|
|
43
|
+
}): React.JSX.Element;
|
|
44
|
+
/** 概览的图标块(右栏标题栏与顶栏「在看什么」共用)。 */
|
|
45
|
+
export declare function OverviewMark(): React.JSX.Element;
|
|
46
|
+
export declare function OverviewHead(props: HeadProps): React.JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 查看框里的「说明」:标题行一个开关,点开从右边滑出一栏,盖在正文上面。
|
|
3
|
+
*
|
|
4
|
+
* 说明(产出文件的生成要求、步骤的描述)常常很长,放在正文上面会一直占着一大块,HTML 页面还会被挤出
|
|
5
|
+
* 两层滚动条;收在开关里,要看时再拉出来,正文不跟着重排。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/NoteDrawer
|
|
8
|
+
*/
|
|
9
|
+
import type { T } from '../i18n.ts';
|
|
10
|
+
/** 标题行里的开关。 */
|
|
11
|
+
export declare function NoteToggle(props: {
|
|
12
|
+
t: T;
|
|
13
|
+
open: boolean;
|
|
14
|
+
onToggle(): void;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
/** 滑出来的那一栏;Esc 先收起它,再按一次才关查看框。 */
|
|
17
|
+
export declare function NoteDrawer(props: {
|
|
18
|
+
t: T;
|
|
19
|
+
text: string;
|
|
20
|
+
onClose(): void;
|
|
21
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 「用其他程序打开」按钮。
|
|
3
|
+
*
|
|
4
|
+
* 点开列出系统里能打开这类文件的程序(默认的那个排第一并标出来),最后一项是在文件管理器里显示——
|
|
5
|
+
* 和 DSH 文档预览右上角那个按钮一样。宿主没有桌面能力(远程访问、没接上服务)或文件还不在时不出现。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/OpenWith
|
|
8
|
+
*/
|
|
9
|
+
import type { Desktop } from '../app/desktop.ts';
|
|
10
|
+
import type { T } from '../i18n.ts';
|
|
11
|
+
export interface OpenWithProps {
|
|
12
|
+
t: T;
|
|
13
|
+
desktop: Desktop | undefined;
|
|
14
|
+
/** 文件的绝对路径;文件还不在时为 `null`(系统程序那一半不出现)。 */
|
|
15
|
+
path: string | null;
|
|
16
|
+
/** 只留图标(文件面板的标题行里用);缺省是「图标 + 字 + 箭头」。 */
|
|
17
|
+
compact?: boolean;
|
|
18
|
+
/** 打开失败时告诉调用方(给人看的一句话)。 */
|
|
19
|
+
onError?: (text: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function OpenWith(props: OpenWithProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 产出文件:面板里的清单,与编辑 / 查看单个文件的模态框。
|
|
3
|
+
*
|
|
4
|
+
* 清单只负责"一眼看全":每个文件一行,路径 + 生成规则的头两行。要改哪一个就点它,
|
|
5
|
+
* 在模态框里有完整的空间写路径和规则——面板那一条窄栏里塞两个输入框加一个大文本框,
|
|
6
|
+
* 多来几个文件就挤成一团。模态框里的改动"完成"时才一次交出去(一次改动 = 一条撤销步),
|
|
7
|
+
* 交出去的永远是合法的值。
|
|
8
|
+
*
|
|
9
|
+
* 画布卡片上的产出浮窗、步骤面板、「我的步骤」编辑器、内置步骤的只读详情,都走这里。
|
|
10
|
+
*
|
|
11
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/Outputs
|
|
12
|
+
*/
|
|
13
|
+
import type { NodeData, OutputSpec } from '../../shared/types.ts';
|
|
14
|
+
import type { T } from '../i18n.ts';
|
|
15
|
+
/** 要从外面(画布卡片的浮窗)打开哪一项:`seq` 每次请求都变,同一项点两次也能再开。 */
|
|
16
|
+
export interface OutputRequest {
|
|
17
|
+
index: number | 'new';
|
|
18
|
+
seq: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 产出:不声明 / 写入文件 / 不产出;「写入文件」下面是文件清单。
|
|
22
|
+
* 步骤面板与「我的步骤」编辑器共用它。
|
|
23
|
+
*/
|
|
24
|
+
export declare function OutputField(props: {
|
|
25
|
+
t: T;
|
|
26
|
+
value: NodeData['output'];
|
|
27
|
+
/** 切到「写入文件」或新加一项时预填的文件名。 */
|
|
28
|
+
suggest: string;
|
|
29
|
+
/** 这些产出属于谁(模态框的副标题)。 */
|
|
30
|
+
owner: string;
|
|
31
|
+
/** 工作流设置里的产出根目录:编辑框里据此预览最终写到哪。 */
|
|
32
|
+
root?: string | undefined;
|
|
33
|
+
onChange(value: NodeData['output']): void;
|
|
34
|
+
request?: OutputRequest | null;
|
|
35
|
+
onRequestDone?: () => void;
|
|
36
|
+
}): React.JSX.Element;
|
|
37
|
+
/** 只读地列出产出:点一个文件,在模态框里看它的完整生成规则。 */
|
|
38
|
+
export declare function OutputList(props: {
|
|
39
|
+
t: T;
|
|
40
|
+
output: NodeData['output'];
|
|
41
|
+
owner: string;
|
|
42
|
+
}): React.JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* 编辑(或新加)一个产出文件:路径 + 生成规则。步骤模板的产出清单用它;
|
|
45
|
+
* 画布上给步骤「新建产出文件」也用它(`title` 换成那边的说法)。
|
|
46
|
+
*/
|
|
47
|
+
export declare function OutputEditor(props: {
|
|
48
|
+
title?: string;
|
|
49
|
+
t: T;
|
|
50
|
+
owner: string;
|
|
51
|
+
root: string | undefined;
|
|
52
|
+
/** `null` = 新加一项。 */
|
|
53
|
+
initial: OutputSpec | null;
|
|
54
|
+
suggest: string;
|
|
55
|
+
/** 同一步骤里其它文件的路径(查重名用)。 */
|
|
56
|
+
taken: readonly string[];
|
|
57
|
+
canRemove: boolean;
|
|
58
|
+
onSave(spec: OutputSpec): void;
|
|
59
|
+
onRemove(): void;
|
|
60
|
+
onClose(): void;
|
|
61
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 右栏的标题栏:模板的属性面板与实例的右栏共用,两边长得一样。
|
|
3
|
+
*
|
|
4
|
+
* 左边一个图标块(步骤的外观、资源 / 输入 / 连线的图标;实例里是「在看什么」的切换),中间是名字,
|
|
5
|
+
* 名字下面一行小字是 ID(点一下复制,复制图标悬停才露),右边是关闭。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/PanelHead
|
|
8
|
+
*/
|
|
9
|
+
import type { T } from '../i18n.ts';
|
|
10
|
+
export declare function PanelHead(props: {
|
|
11
|
+
t: T;
|
|
12
|
+
lead: React.ReactNode;
|
|
13
|
+
/** 名字:能改的是输入框,只看的是一段字。 */
|
|
14
|
+
title: React.ReactNode;
|
|
15
|
+
/** 节点 id(连线、概览没有)。 */
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
/** 名字右边的小标(输入的题型)。 */
|
|
18
|
+
extra?: React.ReactNode;
|
|
19
|
+
onClose(): void;
|
|
20
|
+
closeTestId?: string;
|
|
21
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 「预览计划」对话框:把当前工作流编译成派发计划给人看。
|
|
3
|
+
*
|
|
4
|
+
* 两个版本:「给模型」就是执行时模型拿到的那份(提示词以任务描述路径引用,工作区按本会话的写);
|
|
5
|
+
* 「给人看」把提示词内联,适合通读与存档。实例 id 执行时才有,计划里先留着 `{instance}`。
|
|
6
|
+
* 打开前会先把没落盘的改动写下去——编译读的是磁盘。
|
|
7
|
+
*
|
|
8
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/PlanDialog
|
|
9
|
+
*/
|
|
10
|
+
import type { PlanBuildResponse } from '../../shared/wire.ts';
|
|
11
|
+
import type { T } from '../i18n.ts';
|
|
12
|
+
export declare function PlanDialog(props: {
|
|
13
|
+
t: T;
|
|
14
|
+
name: string;
|
|
15
|
+
build(full: boolean): Promise<PlanBuildResponse>;
|
|
16
|
+
onLocate(nodeId: string): void;
|
|
17
|
+
onClose(): void;
|
|
18
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 右栏里的一段长文字:只露前几行,点这块或标题行的 👁 在弹窗里看全文(可复制)。
|
|
3
|
+
*
|
|
4
|
+
* 实例里步骤的提示词、摘要、失败原因,连线的上游摘要与交接说明,模板里步骤的提示词都用它,长短不一但样子一致。
|
|
5
|
+
* 能改的(给了 `edit`)标题行多一支笔,弹窗里多一个「编辑」:大段文字都在弹窗里改,右栏只露一截。
|
|
6
|
+
* 空着的能改的那块写着占位,点一下直接进「编辑」。
|
|
7
|
+
*
|
|
8
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/PreviewCard
|
|
9
|
+
*/
|
|
10
|
+
import type { Desktop } from '../app/desktop.ts';
|
|
11
|
+
import type { T } from '../i18n.ts';
|
|
12
|
+
import { type DocEdit } from './DocViewer.tsx';
|
|
13
|
+
/** 能改时怎么交出去。 */
|
|
14
|
+
export interface PreviewEdit extends Omit<DocEdit, 'start'> {
|
|
15
|
+
/** 弹窗关上(一次编辑结束):断开撤销合并。 */
|
|
16
|
+
onSeal?(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare function PreviewCard(props: {
|
|
19
|
+
t: T;
|
|
20
|
+
/** 小标题(可以带改过的小圆点)。 */
|
|
21
|
+
label: React.ReactNode;
|
|
22
|
+
text: string;
|
|
23
|
+
/** 弹窗:标题、左边的图标块、标题下面一行、收在「说明」开关里的说明。 */
|
|
24
|
+
name: string;
|
|
25
|
+
badge: React.ReactNode;
|
|
26
|
+
meta: string;
|
|
27
|
+
note?: string;
|
|
28
|
+
copyLabel: string;
|
|
29
|
+
desktop: Desktop | undefined;
|
|
30
|
+
testId: string;
|
|
31
|
+
/** 露几行(缺省 4)。 */
|
|
32
|
+
lines?: number;
|
|
33
|
+
/** 卡片下面的一行说明。 */
|
|
34
|
+
help?: React.ReactNode;
|
|
35
|
+
edit?: PreviewEdit;
|
|
36
|
+
/** 一出来就打开弹窗、进「编辑」(刚加的空白步骤写提示词)。 */
|
|
37
|
+
autoEdit?: boolean;
|
|
38
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 就地添加步骤的小菜单。
|
|
3
|
+
*
|
|
4
|
+
* 三个入口共用它:双击画布空白处、点步骤右侧的「+」、把连线拖到空白处松手。
|
|
5
|
+
* 后两种会把新步骤顺手连在来源后面。从步骤出发时前两项是「产出文件」(放着这一步写的文件的资源卡)和
|
|
6
|
+
* 「用户输入」(执行前问用户、回答交给这一步);从资源卡、输入卡拖出来时只列步骤(新步骤读它);
|
|
7
|
+
* 在空白处还能放一张空的资源卡或输入卡。
|
|
8
|
+
*
|
|
9
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/QuickAdd
|
|
10
|
+
*/
|
|
11
|
+
import type { TemplateEntry } from '../../shared/types.ts';
|
|
12
|
+
import type { T } from '../i18n.ts';
|
|
13
|
+
import { type StepSource } from '../model/library.ts';
|
|
14
|
+
export declare function QuickAdd(props: {
|
|
15
|
+
t: T;
|
|
16
|
+
/** 相对视图根的坐标。 */
|
|
17
|
+
at: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
bounds: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
templates: readonly TemplateEntry[];
|
|
26
|
+
/** 从哪儿来:步骤的「+」/ 资源卡、输入卡拖出来的线 / 空白处。 */
|
|
27
|
+
origin: 'step' | 'resource' | 'input' | 'none';
|
|
28
|
+
onPick(source: StepSource): void;
|
|
29
|
+
onClose(): void;
|
|
30
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 编辑(或新加)资源里的一项:模态框。
|
|
3
|
+
*
|
|
4
|
+
* 面板里的清单一行只放名字和位置;值、说明、「浏览」「从清单选」这些交互都在这里,有地方好好写。
|
|
5
|
+
* - 文件 / 文件夹:路径 +「浏览」(主机上选);下面写出实际位置(相对路径看有没有步骤写它)。
|
|
6
|
+
* - 网址:一行网址,旁边能直接打开看一眼。
|
|
7
|
+
* - Skill:skill 名 +「从清单选」;DSH 认得这个名字就把它的一句话说明带出来,还能点开看 SKILL.md。
|
|
8
|
+
* - 自定义:一大块文字,就是一段原样交给执行者的提示词(它本身就是正文,没有说明)。
|
|
9
|
+
* 「完成」时才一次交出去(一次改动 = 一条撤销步),交出去的永远是写法合法、不重复的一项。
|
|
10
|
+
*
|
|
11
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/ResourceItemDialog
|
|
12
|
+
*/
|
|
13
|
+
import type { ResourceItem, ResourceKind } from '../../shared/types.ts';
|
|
14
|
+
import type { HostAccess } from '../app/host.ts';
|
|
15
|
+
import type { T } from '../i18n.ts';
|
|
16
|
+
export declare function ResourceItemDialog(props: {
|
|
17
|
+
t: T;
|
|
18
|
+
kind: ResourceKind;
|
|
19
|
+
/** `null` = 新加一项。 */
|
|
20
|
+
initial: ResourceItem | null;
|
|
21
|
+
/** 属于哪个资源(副标题)。 */
|
|
22
|
+
owner: string;
|
|
23
|
+
host: HostAccess;
|
|
24
|
+
/** 有步骤写这个资源(相对路径落在产出根目录下)。 */
|
|
25
|
+
written: boolean;
|
|
26
|
+
/** 产出根目录(还没换实例 id;写在工作区根时为 `undefined`)。 */
|
|
27
|
+
root: string | undefined;
|
|
28
|
+
/** 同一资源里的其它项(查重)。 */
|
|
29
|
+
others: readonly ResourceItem[];
|
|
30
|
+
onSave(item: ResourceItem): void;
|
|
31
|
+
onRemove?: (() => void) | undefined;
|
|
32
|
+
onClose(): void;
|
|
33
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 资源里的内容:面板里的紧凑清单 + 「添加」菜单。
|
|
3
|
+
*
|
|
4
|
+
* 一项一行,只放「一眼看清」的东西:种类图标、名字、位置(路径 / 网址 / 种类),有说明的在行尾挂个小标。
|
|
5
|
+
* 要看、要改就点这一行,在模态框里编辑({@link ResourceItemDialog});悬停时行尾浮出「移除」。
|
|
6
|
+
*
|
|
7
|
+
* 添加:点「添加内容」弹出一个小菜单——
|
|
8
|
+
* - 文件、文件夹:直接打开主机上的选择框,可以一次选好几个;
|
|
9
|
+
* - Skill:打开会话里的 agent 能用的 skill 清单,可以一次勾好几个、点眼睛看 SKILL.md;
|
|
10
|
+
* - 网址、自定义、手填路径(还不存在的文件,比如产出):打开编辑框,写好了才加进来。
|
|
11
|
+
* 和已有的重复的不再加。
|
|
12
|
+
*
|
|
13
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/ResourceItems
|
|
14
|
+
*/
|
|
15
|
+
import type { ResourceItem } from '../../shared/types.ts';
|
|
16
|
+
import type { HostAccess } from '../app/host.ts';
|
|
17
|
+
import type { T } from '../i18n.ts';
|
|
18
|
+
export declare function ResourceItems(props: {
|
|
19
|
+
t: T;
|
|
20
|
+
items: readonly ResourceItem[];
|
|
21
|
+
host: HostAccess;
|
|
22
|
+
/** 资源的显示名(编辑框的副标题)。 */
|
|
23
|
+
owner: string;
|
|
24
|
+
/** 有步骤写这个资源(相对路径落在产出根目录下)。 */
|
|
25
|
+
written: boolean;
|
|
26
|
+
/** 产出根目录(还没换实例 id;写在工作区根时为 `undefined`)。 */
|
|
27
|
+
root: string | undefined;
|
|
28
|
+
/** 改内容:整份换掉。一次改动 = 一条撤销步。 */
|
|
29
|
+
onChange(items: ResourceItem[]): void;
|
|
30
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 选中资源卡时的属性面板。
|
|
3
|
+
*
|
|
4
|
+
* 从上到下:名字(标题栏里直接改)、ID、描述(只在卡片上显示,不进计划)、内容(一项一行,点开在模态框里改)、
|
|
5
|
+
* 写它的步骤(每个带整份写出 / 在原文件上更新的开关)、读它的步骤。一条线都没连时写明「交给整个工作流」。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/ResourcePanel
|
|
8
|
+
*/
|
|
9
|
+
import type { ResourceNode, WorkflowDocument } from '../../shared/types.ts';
|
|
10
|
+
import type { HostAccess } from '../app/host.ts';
|
|
11
|
+
import type { T } from '../i18n.ts';
|
|
12
|
+
import { type Edit, type Selection } from '../model/editor.ts';
|
|
13
|
+
import type { FocusFile } from './Handoff.tsx';
|
|
14
|
+
export declare function ResourcePanel(props: {
|
|
15
|
+
t: T;
|
|
16
|
+
doc: WorkflowDocument;
|
|
17
|
+
node: ResourceNode;
|
|
18
|
+
host: HostAccess;
|
|
19
|
+
onEdit(edit: Edit): void;
|
|
20
|
+
onSelect(selection: Selection): void;
|
|
21
|
+
onSeal(): void;
|
|
22
|
+
onFocusFile: FocusFile;
|
|
23
|
+
onRemove(id: string): void;
|
|
24
|
+
/** 标题栏里关闭按钮左边的切换(实例视图里「运行 / 编辑」)。 */
|
|
25
|
+
tabs?: React.ReactNode;
|
|
26
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 选中步骤时它连着的资源,与连着资源的线。
|
|
3
|
+
*
|
|
4
|
+
* - {@link StepResourcesField}:选中步骤时,"它写哪些资源、读哪些资源",还有交给整个工作流的那些;
|
|
5
|
+
* 能新建一个产出文件、关联图里已有的资源;
|
|
6
|
+
* - {@link ResourceEdgeBody}:选中一条连着资源的线时,写入方式或读取说明;
|
|
7
|
+
* - {@link ModeToggle}:整份写出 / 在原文件上更新的小开关(资源面板里写它的步骤也用它)。
|
|
8
|
+
*
|
|
9
|
+
* 行上悬停 = 画布高亮这个资源的上下游;点一行 = 选中那张卡。
|
|
10
|
+
*
|
|
11
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/Resources
|
|
12
|
+
*/
|
|
13
|
+
import type { ResourceNode, StepNode, WorkflowDocument, WorkflowEdge } from '../../shared/types.ts';
|
|
14
|
+
import type { T } from '../i18n.ts';
|
|
15
|
+
import { type Edit, type Selection } from '../model/editor.ts';
|
|
16
|
+
import type { FocusFile } from './Handoff.tsx';
|
|
17
|
+
/** 资源的小图标:只有一项时用那一项的种类图标,否则是一叠。 */
|
|
18
|
+
export declare function ResourceIcon(props: {
|
|
19
|
+
resource: ResourceNode;
|
|
20
|
+
size?: number;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
/** 资源的一行摘要:第一项的写法,多项时加上「等 N 项」。 */
|
|
23
|
+
export declare function resourceSummary(t: T, resource: ResourceNode): string;
|
|
24
|
+
export declare function StepResourcesField(props: {
|
|
25
|
+
t: T;
|
|
26
|
+
doc: WorkflowDocument;
|
|
27
|
+
step: StepNode;
|
|
28
|
+
onEdit(edit: Edit): void;
|
|
29
|
+
onSelect(selection: Selection): void;
|
|
30
|
+
onFocusFile: FocusFile;
|
|
31
|
+
}): React.JSX.Element;
|
|
32
|
+
/** 写入方式:整份写出 / 在原文件上更新(两格的小开关)。 */
|
|
33
|
+
export declare function ModeToggle(props: {
|
|
34
|
+
t: T;
|
|
35
|
+
update: boolean;
|
|
36
|
+
onChange(update: boolean): void;
|
|
37
|
+
}): React.JSX.Element;
|
|
38
|
+
export declare function ResourceEdgeBody(props: {
|
|
39
|
+
t: T;
|
|
40
|
+
edge: WorkflowEdge;
|
|
41
|
+
kind: 'write' | 'read';
|
|
42
|
+
onEdit(edit: Edit): void;
|
|
43
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例视图底部的草稿栏:「已改 x 处 · 改动清单 · 给模型的说明 · 通知模型(开关)· 放弃 · 保存」。
|
|
3
|
+
*
|
|
4
|
+
* 图的改动与状态的改动攒在一起:清单里图的在前(一处一行),状态的在后(一个字段一行),每行都能单独撤回;
|
|
5
|
+
* 冲突(模型同时改了同一个字段)排在最前面,让用户选。保存不了的时候按钮按住,悬停说明原因。
|
|
6
|
+
* 「通知模型」默认开着;关掉就只保存。「放弃」要二次确认,确认卡浮在按钮旁边,栏里的东西不挪位。
|
|
7
|
+
*
|
|
8
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/RunDraftBar
|
|
9
|
+
*/
|
|
10
|
+
import type { GraphChange } from '../../shared/graphDiff.ts';
|
|
11
|
+
import type { WorkflowDocument } from '../../shared/types.ts';
|
|
12
|
+
import type { Run } from '../app/useRuns.ts';
|
|
13
|
+
import type { T } from '../i18n.ts';
|
|
14
|
+
/** 清单里图的一行。 */
|
|
15
|
+
export interface DraftLine {
|
|
16
|
+
key: string;
|
|
17
|
+
text: React.ReactNode;
|
|
18
|
+
onUndo(): void;
|
|
19
|
+
}
|
|
20
|
+
/** 图的一处改动写成清单里的一行:「<b>审查</b> · 改了提示词、名称」。 */
|
|
21
|
+
export declare function graphLine(t: T, change: GraphChange, base: WorkflowDocument, doc: WorkflowDocument): React.ReactNode;
|
|
22
|
+
export declare function DraftBar(props: {
|
|
23
|
+
t: T;
|
|
24
|
+
current: Run;
|
|
25
|
+
/** 图的改动(排在状态的改动前面)。 */
|
|
26
|
+
graph: readonly DraftLine[];
|
|
27
|
+
/** 改了几处:图一处一项,状态按对象算。 */
|
|
28
|
+
count: number;
|
|
29
|
+
/** 保存不了的原因(图有问题、改完的状态对不上);`null` = 能存。 */
|
|
30
|
+
blocked: string | null;
|
|
31
|
+
/** 右栏开着没有(开着就让到右栏左边)。 */
|
|
32
|
+
panel: boolean;
|
|
33
|
+
onSave(): void;
|
|
34
|
+
onDiscard(): void;
|
|
35
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例视图右栏:选中一条线。
|
|
3
|
+
*
|
|
4
|
+
* 和模板里选中连线看到的一样,换成只读、带上本次运行:
|
|
5
|
+
* - 两端(带各自的状态,点一下到那一步 / 那张卡);
|
|
6
|
+
* - 一张小表:**状态**(已流转 / 未流转,下面一行是依据:条件线看上游的判定)、
|
|
7
|
+
* **条件**(步骤之间的线)、**交接**(执行结果 / 只管先后);连资源的线是写入方式或读取;
|
|
8
|
+
* - **上游摘要**、**交接说明**:只露几行,点开看全文——下游拿到的就是它们;
|
|
9
|
+
* - 用户输入的线:本次的回答;回头线说明在循环里、目标做到第几轮。
|
|
10
|
+
*
|
|
11
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/RunEdge
|
|
12
|
+
*/
|
|
13
|
+
import type { GraphAnalysis } from '../../shared/graph.ts';
|
|
14
|
+
import type { RunState } from '../../shared/runState.ts';
|
|
15
|
+
import type { InputAnswer, WorkflowDocument, WorkflowEdge } from '../../shared/types.ts';
|
|
16
|
+
import type { Desktop } from '../app/desktop.ts';
|
|
17
|
+
import type { T } from '../i18n.ts';
|
|
18
|
+
export declare function RunEdgeDetail(props: {
|
|
19
|
+
t: T;
|
|
20
|
+
snapshot: WorkflowDocument;
|
|
21
|
+
analysis: GraphAnalysis;
|
|
22
|
+
edge: WorkflowEdge;
|
|
23
|
+
state: RunState | null;
|
|
24
|
+
/** 本次经过的线;不记进度时为 `null`。 */
|
|
25
|
+
taken: ReadonlySet<string> | null;
|
|
26
|
+
answers: Readonly<Record<string, InputAnswer>> | undefined;
|
|
27
|
+
desktop: Desktop | undefined;
|
|
28
|
+
onSelectNode(id: string): void;
|
|
29
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例视图里步骤详情的「产出 / 读取」:它写哪些、读哪些资源;
|
|
3
|
+
* 悬停在画布上高亮那张卡,点一下选中它(选中资源卡后的右栏见 `RunResource.tsx`)。
|
|
4
|
+
*
|
|
5
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/RunFiles
|
|
6
|
+
*/
|
|
7
|
+
import type { ResourceNode, WorkflowDocument } from '../../shared/types.ts';
|
|
8
|
+
import type { T } from '../i18n.ts';
|
|
9
|
+
/**
|
|
10
|
+
* 资源里一个文件 / 文件夹在工作区里的路径(实例的快照里产出根目录已换上实例 id):
|
|
11
|
+
* 有步骤写它时相对路径拼上产出根目录,只被读时相对工作区。
|
|
12
|
+
*/
|
|
13
|
+
export declare function itemDisplayPath(doc: WorkflowDocument, node: ResourceNode, index: number): string;
|
|
14
|
+
export declare function StepResourceList(props: {
|
|
15
|
+
t: T;
|
|
16
|
+
snapshot: WorkflowDocument;
|
|
17
|
+
step: string;
|
|
18
|
+
/** 模型在状态文件里报告的产出(可能有图里没画出来的)。 */
|
|
19
|
+
reported: readonly string[];
|
|
20
|
+
made: Readonly<Record<string, readonly (boolean | null)[]>>;
|
|
21
|
+
onSelectResource(id: string): void;
|
|
22
|
+
onFocusFile(id: string | null): void;
|
|
23
|
+
onViewPath(path: string): void;
|
|
24
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例视图里选中一个输入节点:这次执行用户是怎么回答的。
|
|
3
|
+
*
|
|
4
|
+
* 问题、用户的回答(执行前填的,已补上默认值),以及回答交给了哪些步骤(点一下看那一步)。
|
|
5
|
+
* 回答是实例建立时定下的,这里只读。
|
|
6
|
+
*
|
|
7
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/RunInput
|
|
8
|
+
*/
|
|
9
|
+
import type { RunState } from '../../shared/runState.ts';
|
|
10
|
+
import type { InputAnswer, InputNode, WorkflowDocument } from '../../shared/types.ts';
|
|
11
|
+
import type { T } from '../i18n.ts';
|
|
12
|
+
/** 用户的回答:文字原样、多选一行一个、没填写就说没填写。 */
|
|
13
|
+
export declare function AnswerView(props: {
|
|
14
|
+
t: T;
|
|
15
|
+
answer: InputAnswer | undefined;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
/** 回答的一行写法(步骤详情的「用户输入」里):多选用顿号连起来。 */
|
|
18
|
+
export declare function answerLine(t: T, answer: InputAnswer | undefined): string;
|
|
19
|
+
export declare function RunInputDetail(props: {
|
|
20
|
+
t: T;
|
|
21
|
+
snapshot: WorkflowDocument;
|
|
22
|
+
input: InputNode;
|
|
23
|
+
answer: InputAnswer | undefined;
|
|
24
|
+
state: RunState | null;
|
|
25
|
+
onSelectStep(id: string): void;
|
|
26
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例视图里点开资源的一项:文件夹、网址、自定义文字各自的详情框。
|
|
3
|
+
*
|
|
4
|
+
* 文件用 {@link FileViewer}(能读正文),Skill 用 {@link SkillPreview}(读 SKILL.md),都不在这里。
|
|
5
|
+
* 三个框都是 {@link DocViewer} 的小号:标题行同样有复制、用其他程序打开(文件夹)、关闭,
|
|
6
|
+
* 文件夹、网址的说明放在正文前(框小、说明就是主要内容);自定义文字的说明收在「说明」开关里。
|
|
7
|
+
* - 文件夹:里面有什么(目录在前,只列名字),可以复制路径、用其他程序打开或在文件管理器里显示;
|
|
8
|
+
* - 网址:整条网址(点了在浏览器里开),底部一个「在浏览器中打开」;
|
|
9
|
+
* - 自定义文字:整段排版显示,可以复制。
|
|
10
|
+
*
|
|
11
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/RunItemDialog
|
|
12
|
+
*/
|
|
13
|
+
import type { ResourceItem } from '../../shared/types.ts';
|
|
14
|
+
import type { Desktop } from '../app/desktop.ts';
|
|
15
|
+
import type { HostAccess } from '../app/host.ts';
|
|
16
|
+
import type { T } from '../i18n.ts';
|
|
17
|
+
import { type WorkflowLiteRpc } from '../rpc.ts';
|
|
18
|
+
/** 文件夹:里面有什么。 */
|
|
19
|
+
export declare function FolderDialog(props: {
|
|
20
|
+
t: T;
|
|
21
|
+
rpc: WorkflowLiteRpc;
|
|
22
|
+
instance: string;
|
|
23
|
+
host: HostAccess;
|
|
24
|
+
node: string;
|
|
25
|
+
index: number;
|
|
26
|
+
item: ResourceItem;
|
|
27
|
+
desktop: Desktop | undefined;
|
|
28
|
+
onClose(): void;
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
/** 网址:整条网址、说明,底部在浏览器中打开。 */
|
|
31
|
+
export declare function UrlDialog(props: {
|
|
32
|
+
t: T;
|
|
33
|
+
item: ResourceItem;
|
|
34
|
+
desktop: Desktop | undefined;
|
|
35
|
+
onClose(): void;
|
|
36
|
+
}): React.JSX.Element;
|
|
37
|
+
/** 自定义文字:整段排版显示。 */
|
|
38
|
+
export declare function TextDialog(props: {
|
|
39
|
+
t: T;
|
|
40
|
+
item: ResourceItem;
|
|
41
|
+
desktop: Desktop | undefined;
|
|
42
|
+
onClose(): void;
|
|
43
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例右栏标题栏里「运行 / 编辑」的切换:两个图标格,挨着关闭按钮。
|
|
3
|
+
* 选中格下面的滑块靠 `transform` 滑过去;文字在悬停提示里。
|
|
4
|
+
*
|
|
5
|
+
* @module @xiaoso/dsh-workflow-lite/client/ui/RunModeSwitch
|
|
6
|
+
*/
|
|
7
|
+
import type { T } from '../i18n.ts';
|
|
8
|
+
/** 右栏选中东西时看什么:这次运行的样子,还是改它(模板的属性面板)。 */
|
|
9
|
+
export type PanelMode = 'run' | 'edit';
|
|
10
|
+
export declare function RunModeSwitch(props: {
|
|
11
|
+
t: T;
|
|
12
|
+
mode: PanelMode;
|
|
13
|
+
onChange(mode: PanelMode): void;
|
|
14
|
+
}): React.JSX.Element;
|