@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.
Files changed (156) hide show
  1. package/LICENSE +24 -0
  2. package/README.en.md +84 -0
  3. package/README.md +83 -2
  4. package/THIRD_PARTY_NOTICES.md +762 -0
  5. package/assets/icon-full.webp +0 -0
  6. package/assets/icon.webp +0 -0
  7. package/assets/wordmark.png +0 -0
  8. package/cordis.patch.yml +3 -0
  9. package/lib/client.js +127442 -0
  10. package/lib/index.mjs +9613 -0
  11. package/lib/types/client/app/addStep.d.ts +25 -0
  12. package/lib/types/client/app/desktop.d.ts +52 -0
  13. package/lib/types/client/app/host.d.ts +29 -0
  14. package/lib/types/client/app/sessions.d.ts +117 -0
  15. package/lib/types/client/app/theme.d.ts +27 -0
  16. package/lib/types/client/app/usePluginConfig.d.ts +59 -0
  17. package/lib/types/client/app/useRunFile.d.ts +24 -0
  18. package/lib/types/client/app/useRunGraph.d.ts +51 -0
  19. package/lib/types/client/app/useRunHistory.d.ts +21 -0
  20. package/lib/types/client/app/useRuns.d.ts +84 -0
  21. package/lib/types/client/app/useVersions.d.ts +50 -0
  22. package/lib/types/client/app/useWorkflow.d.ts +67 -0
  23. package/lib/types/client/app/viewport.d.ts +14 -0
  24. package/lib/types/client/i18n.d.ts +930 -0
  25. package/lib/types/client/index.d.ts +18 -0
  26. package/lib/types/client/model/connect.d.ts +44 -0
  27. package/lib/types/client/model/editor.d.ts +252 -0
  28. package/lib/types/client/model/fileKind.d.ts +15 -0
  29. package/lib/types/client/model/hostPath.d.ts +15 -0
  30. package/lib/types/client/model/htmlPreview.d.ts +24 -0
  31. package/lib/types/client/model/hubRuns.d.ts +45 -0
  32. package/lib/types/client/model/layout.d.ts +83 -0
  33. package/lib/types/client/model/library.d.ts +109 -0
  34. package/lib/types/client/model/nudge.d.ts +43 -0
  35. package/lib/types/client/model/pathSample.d.ts +26 -0
  36. package/lib/types/client/model/route.d.ts +121 -0
  37. package/lib/types/client/model/runDraft.d.ts +68 -0
  38. package/lib/types/client/model/runGraph.d.ts +15 -0
  39. package/lib/types/client/model/runHistory.d.ts +40 -0
  40. package/lib/types/client/model/themes.d.ts +87 -0
  41. package/lib/types/client/model/time.d.ts +7 -0
  42. package/lib/types/client/rpc.d.ts +42 -0
  43. package/lib/types/client/ui/AppearancePicker.d.ts +23 -0
  44. package/lib/types/client/ui/Canvas.d.ts +76 -0
  45. package/lib/types/client/ui/Confirm.d.ts +42 -0
  46. package/lib/types/client/ui/DocViewer.d.ts +67 -0
  47. package/lib/types/client/ui/Dock.d.ts +13 -0
  48. package/lib/types/client/ui/FileTag.d.ts +9 -0
  49. package/lib/types/client/ui/FileViewer.d.ts +30 -0
  50. package/lib/types/client/ui/FlowStreaks.d.ts +40 -0
  51. package/lib/types/client/ui/Handoff.d.ts +30 -0
  52. package/lib/types/client/ui/HostPicker.d.ts +31 -0
  53. package/lib/types/client/ui/HubDialog.d.ts +38 -0
  54. package/lib/types/client/ui/HubRunRow.d.ts +22 -0
  55. package/lib/types/client/ui/HubRuns.d.ts +19 -0
  56. package/lib/types/client/ui/HubSettings.d.ts +20 -0
  57. package/lib/types/client/ui/HubStorage.d.ts +18 -0
  58. package/lib/types/client/ui/HubWorkflowList.d.ts +21 -0
  59. package/lib/types/client/ui/HubWorkflowRow.d.ts +33 -0
  60. package/lib/types/client/ui/HubWorkflows.d.ts +26 -0
  61. package/lib/types/client/ui/HubWorkspacePicker.d.ts +16 -0
  62. package/lib/types/client/ui/Icon.d.ts +83 -0
  63. package/lib/types/client/ui/InputPanel.d.ts +37 -0
  64. package/lib/types/client/ui/InputsDialog.d.ts +22 -0
  65. package/lib/types/client/ui/Inspector.d.ts +51 -0
  66. package/lib/types/client/ui/Issues.d.ts +15 -0
  67. package/lib/types/client/ui/Launch.d.ts +30 -0
  68. package/lib/types/client/ui/Library.d.ts +23 -0
  69. package/lib/types/client/ui/LinkRow.d.ts +31 -0
  70. package/lib/types/client/ui/Markdown.d.ts +21 -0
  71. package/lib/types/client/ui/NodeHeads.d.ts +47 -0
  72. package/lib/types/client/ui/NoteDrawer.d.ts +21 -0
  73. package/lib/types/client/ui/OpenWith.d.ts +21 -0
  74. package/lib/types/client/ui/Outputs.d.ts +61 -0
  75. package/lib/types/client/ui/PanelHead.d.ts +21 -0
  76. package/lib/types/client/ui/PlanDialog.d.ts +18 -0
  77. package/lib/types/client/ui/PreviewCard.d.ts +38 -0
  78. package/lib/types/client/ui/QuickAdd.d.ts +30 -0
  79. package/lib/types/client/ui/ResourceItemDialog.d.ts +33 -0
  80. package/lib/types/client/ui/ResourceItems.d.ts +30 -0
  81. package/lib/types/client/ui/ResourcePanel.d.ts +26 -0
  82. package/lib/types/client/ui/Resources.d.ts +43 -0
  83. package/lib/types/client/ui/RunDraftBar.d.ts +35 -0
  84. package/lib/types/client/ui/RunEdge.d.ts +29 -0
  85. package/lib/types/client/ui/RunFiles.d.ts +24 -0
  86. package/lib/types/client/ui/RunInput.d.ts +26 -0
  87. package/lib/types/client/ui/RunItemDialog.d.ts +43 -0
  88. package/lib/types/client/ui/RunModeSwitch.d.ts +14 -0
  89. package/lib/types/client/ui/RunNav.d.ts +22 -0
  90. package/lib/types/client/ui/RunNodeState.d.ts +42 -0
  91. package/lib/types/client/ui/RunOverview.d.ts +27 -0
  92. package/lib/types/client/ui/RunPosition.d.ts +24 -0
  93. package/lib/types/client/ui/RunResource.d.ts +40 -0
  94. package/lib/types/client/ui/RunStatusMenu.d.ts +28 -0
  95. package/lib/types/client/ui/RunStep.d.ts +45 -0
  96. package/lib/types/client/ui/RunTopBar.d.ts +42 -0
  97. package/lib/types/client/ui/RunView.d.ts +43 -0
  98. package/lib/types/client/ui/SettingsDialog.d.ts +25 -0
  99. package/lib/types/client/ui/SettingsFields.d.ts +37 -0
  100. package/lib/types/client/ui/SkillPicker.d.ts +25 -0
  101. package/lib/types/client/ui/SkillPreview.d.ts +27 -0
  102. package/lib/types/client/ui/StepMark.d.ts +16 -0
  103. package/lib/types/client/ui/StepPanel.d.ts +26 -0
  104. package/lib/types/client/ui/ThemePicker.d.ts +13 -0
  105. package/lib/types/client/ui/TipLayer.d.ts +17 -0
  106. package/lib/types/client/ui/TopBar.d.ts +32 -0
  107. package/lib/types/client/ui/VersionList.d.ts +19 -0
  108. package/lib/types/client/ui/VersionRow.d.ts +19 -0
  109. package/lib/types/client/ui/VersionsDialog.d.ts +18 -0
  110. package/lib/types/client/ui/WorkflowRow.d.ts +32 -0
  111. package/lib/types/client/ui/WorkflowSwitcher.d.ts +20 -0
  112. package/lib/types/client/ui/WorkflowView.d.ts +27 -0
  113. package/lib/types/client/ui/lines.d.ts +13 -0
  114. package/lib/types/client/ui/primitives.d.ts +119 -0
  115. package/lib/types/client/ui/resourceUi.d.ts +49 -0
  116. package/lib/types/client/ui/stepIcons.d.ts +10 -0
  117. package/lib/types/host/authoringSkill.d.ts +17 -0
  118. package/lib/types/host/config.d.ts +54 -0
  119. package/lib/types/host/hostFs.d.ts +69 -0
  120. package/lib/types/host/plan.d.ts +68 -0
  121. package/lib/types/host/pluginConfig.d.ts +57 -0
  122. package/lib/types/host/rpc.d.ts +45 -0
  123. package/lib/types/host/runs/files.d.ts +37 -0
  124. package/lib/types/host/runs/notice.d.ts +21 -0
  125. package/lib/types/host/runs/service.d.ts +258 -0
  126. package/lib/types/host/runs/skill.d.ts +16 -0
  127. package/lib/types/host/runs/storage.d.ts +16 -0
  128. package/lib/types/host/runs/store.d.ts +56 -0
  129. package/lib/types/host/skillView.d.ts +22 -0
  130. package/lib/types/host/store/atomic.d.ts +34 -0
  131. package/lib/types/host/store/materialize.d.ts +19 -0
  132. package/lib/types/host/store/merge.d.ts +25 -0
  133. package/lib/types/host/store/paths.d.ts +86 -0
  134. package/lib/types/host/store/repository.d.ts +217 -0
  135. package/lib/types/host/store/versions.d.ts +38 -0
  136. package/lib/types/host/tool/tool.d.ts +432 -0
  137. package/lib/types/index.d.ts +35 -0
  138. package/lib/types/shared/appearance.d.ts +49 -0
  139. package/lib/types/shared/compile.d.ts +71 -0
  140. package/lib/types/shared/graph.d.ts +54 -0
  141. package/lib/types/shared/graphDiff.d.ts +29 -0
  142. package/lib/types/shared/inputs.d.ts +46 -0
  143. package/lib/types/shared/limits.d.ts +77 -0
  144. package/lib/types/shared/model.d.ts +122 -0
  145. package/lib/types/shared/naming.d.ts +59 -0
  146. package/lib/types/shared/outputPaths.d.ts +49 -0
  147. package/lib/types/shared/resources.d.ts +98 -0
  148. package/lib/types/shared/runCursor.d.ts +54 -0
  149. package/lib/types/shared/runState.d.ts +221 -0
  150. package/lib/types/shared/runSync.d.ts +24 -0
  151. package/lib/types/shared/types.d.ts +488 -0
  152. package/lib/types/shared/validate.d.ts +54 -0
  153. package/lib/types/shared/wire.d.ts +600 -0
  154. package/locale/en.json +6 -0
  155. package/locale/zh.json +6 -0
  156. package/package.json +144 -4
@@ -0,0 +1,30 @@
1
+ /**
2
+ * dsh-workflow-lite — 产出文件的查看框。
3
+ *
4
+ * 能看的:小文本(原样)、Markdown(默认排版)、HTML(默认在沙箱里渲染),后两种可切源码。
5
+ * 大文件、二进制、还没生成的只说明原因,
6
+ * 并留着「用其他程序打开」。框子本身是 {@link DocViewer}。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/FileViewer
9
+ */
10
+ import type { Desktop } from '../app/desktop.ts';
11
+ import { type FileTarget } from '../app/useRunFile.ts';
12
+ import type { T } from '../i18n.ts';
13
+ import type { WorkflowLiteRpc } from '../rpc.ts';
14
+ /** 正文前的「说明」一块(文件夹、网址这两种小详情框用;大的查看框收在「说明」开关里)。 */
15
+ export declare function NoteLead(props: {
16
+ t: T;
17
+ text: string;
18
+ }): React.JSX.Element;
19
+ export declare function FileViewer(props: {
20
+ t: T;
21
+ rpc: WorkflowLiteRpc;
22
+ instance: string;
23
+ target: FileTarget;
24
+ /** 文件还没读回来时标题先用它。 */
25
+ title: string;
26
+ desktop: Desktop | undefined;
27
+ /** 这一项的说明(产出文件就是它的生成要求):收在标题行的「说明」开关里。 */
28
+ note?: string | undefined;
29
+ onClose(): void;
30
+ }): React.JSX.Element;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * dsh-workflow-lite — 连线上"流动"的光带:选中步骤/文件时,沿着和它相连的线按数据的方向走。
3
+ *
4
+ * 一道光带是一串紧挨着的小圆点(头大尾小、头亮尾淡),每个点都**在线上**走、只是比前一个
5
+ * 晚出发一点点——所以光带永远贴着曲线弯,也不会伸出线的两头压到卡片上。每个点走到线的两头
6
+ * 时各自淡入淡出:光带是从端点里"长出来"、再"没进"另一头的。颜色永远跟所在的线一致。
7
+ *
8
+ * 只动 `transform` 与 `opacity`,交给合成线程跑,不占主线程、不触发重绘:
9
+ * - 按路径字符串直接算出整条线的长度、等距取点(`model/pathSample.ts`,不碰 DOM),算出每点的位移与透明度;
10
+ * - 每个点外层的 HTML 元素用 Web Animations 按这些点做 `translate` 关键帧(里层只管大小和颜色);
11
+ * 关键帧每条线只解析一次,各点拷一份再改延迟(逐个 `animate` 要把几十个关键帧各解析一遍,
12
+ * 一条线几十个点,点一下卡片就要卡上几十毫秒);短线只放一道光带,也只挂一道的点;
13
+ * - 线变了只换关键帧,动画进度不重来;线在连续变(拖卡片时每帧都变)就先把整组淡出、不跟着换,
14
+ * 停下来 {@link SETTLE_MS} 后按最终的线换一次再淡入——每帧给几十个点换关键帧是拖动卡顿的大头;
15
+ * - 拖卡片期间({@link StreaksMode} 为 `hold`)不看时间间隔,一律藏着、停着,松手才铺:机器一慢、
16
+ * 两帧隔得比 {@link SETTLE_MS} 还久,按时间判断就会每帧都重铺一次,越铺越慢;
17
+ * - 线"活"起来时整组淡入,不再活时整组淡出后才卸载——不会突然出现、突然消失。
18
+ *
19
+ * 点在合成线程上走,平时不占主线程;但只要主线程还在出帧(点卡片后的重渲染、卡片和线的淡入淡出),
20
+ * 每一帧都要把所有在走的点的样式过一遍,点越多越贵。所以点卡片后先等 {@link ENTER_DELAY_MS},
21
+ * 等那一阵过渡走完再挂上光带;淡出时点停在原地,只让整组淡掉;平移、缩放画布时(每帧都出)点也停在
22
+ * 原地,停手再接着走。停住的动画不用每帧过样式。
23
+ *
24
+ * 系统设了「减少动态效果」就什么都不画。
25
+ *
26
+ * @module @xiaoso/dsh-workflow-lite/client/ui/FlowStreaks
27
+ */
28
+ /**
29
+ * 画布让光带怎么样:`run` 照常走;`pause` 停在原地(平移、缩放画布时);
30
+ * `hold` 藏起来停着,松手后再按最终的线铺(拖卡片时)。
31
+ */
32
+ export type StreakMode = 'run' | 'pause' | 'hold';
33
+ export declare const StreaksMode: import("react").Context<StreakMode>;
34
+ export declare function FlowStreaks(props: {
35
+ path: string;
36
+ /** 光带颜色:必须和这条线此刻的描边色一致(通常是一个 `var(--wl-…)`)。 */
37
+ color: string;
38
+ /** 线是不是"活"的。变成 `false` 后先淡出、再卸载。 */
39
+ active: boolean;
40
+ }): React.JSX.Element | null;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * dsh-workflow-lite — 交接:步骤之间的线把上游这一次的执行结果交给下游。
3
+ *
4
+ * 文件不走这里(文件是独立的卡片,见 `Files.tsx`)。一条步骤间的线只有三种状态:
5
+ * 交执行结果(缺省)/ 交执行结果并附一段交接说明 / 只管先后。
6
+ *
7
+ * @module @xiaoso/dsh-workflow-lite/client/ui/Handoff
8
+ */
9
+ import type { WorkflowEdge } from '../../shared/types.ts';
10
+ import type { T } from '../i18n.ts';
11
+ import type { Edit } from '../model/editor.ts';
12
+ /** 悬停到一个文件卡(`null` = 离开):视图据此在画布上高亮用到它的步骤。 */
13
+ export type FocusFile = (fileId: string | null) => void;
14
+ /** 一条步骤间的线交了什么(属性面板的连接清单里用)。 */
15
+ export declare function HandoffChip(props: {
16
+ t: T;
17
+ edge: WorkflowEdge;
18
+ }): React.JSX.Element;
19
+ /**
20
+ * 交接:一个开关(交不交执行结果)+ 交接说明。开关关掉时说明先记着,再打开还在。
21
+ * 说明里连续打字并成一条撤销步。
22
+ */
23
+ export declare function HandoffField(props: {
24
+ t: T;
25
+ edge: WorkflowEdge;
26
+ /** 上游的显示名。 */
27
+ source: string;
28
+ onEdit(edit: Edit): void;
29
+ onSeal(): void;
30
+ }): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * dsh-workflow-lite — 「选择文件 / 选择文件夹」:在主机上点着选,不用手敲路径。
3
+ *
4
+ * 模态框:上面是面包屑路径(每一级都能点,旁边的笔切成输入框直接敲路径)和几个常用位置
5
+ * (工作区、主目录、各个盘符),中间是当前目录里的东西,下面是已选几项。
6
+ * - 列表第一行永远是「上一级」(就在手边,不用回到顶上找按钮);筛选框空着时按 Backspace、
7
+ * 任何时候按 Alt+↑ 也是上一级;
8
+ * - 一行:线条图标(文件夹琥珀色、文件灰色,不带底色)、名字,右边是进入箭头(文件夹)和圆形勾选
9
+ * (能选的才有;悬停或选上时才显出来);
10
+ * - 选文件:点文件这一行就选上 / 取消,双击直接添加;文件夹点了进去;
11
+ * - 选文件夹:点右边的圆圈选上,点这一行进去,也可以「选当前文件夹」;
12
+ * - 筛选框只筛当前目录;隐藏项(`.` 开头)默认不列。
13
+ * 选中的是绝对路径(分隔符 `/`),原样进资源。
14
+ * `single`:编辑一项时换它的路径——只能选一个,选另一个就换过去。
15
+ *
16
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HostPicker
17
+ */
18
+ import type { HostAccess } from '../app/host.ts';
19
+ import type { T } from '../i18n.ts';
20
+ export type PickMode = 'file' | 'folder';
21
+ export declare function HostPicker(props: {
22
+ t: T;
23
+ host: HostAccess;
24
+ mode: PickMode;
25
+ /** 从哪儿开始看(缺省 = 工作区)。 */
26
+ start?: string;
27
+ /** 只选一个。 */
28
+ single?: boolean;
29
+ onPick(paths: string[]): void;
30
+ onClose(): void;
31
+ }): React.JSX.Element;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心:放所有**跨工作流、跨会话**的东西。
3
+ *
4
+ * 标题栏和「工作流设置」同一种样子,几页的切换放在标题栏里:
5
+ * - **运行实例**(`HubRuns.tsx`):所有会话的实例,按工作区分组,能搜、能按工作区 / 本会话筛;
6
+ * 查看、移到本会话、删除记录(状态文件另外问要不要一起删);
7
+ * - **工作流**(`HubWorkflows.tsx`):全部工作流,每一行能就地改名、删除;选一张看它的版本——存、切换、改说明、删除,不用先打开它;
8
+ * - **存储**(`HubStorage.tsx`):数据目录、各样东西的占用,清理已结束的实例与旧版本遗留文件;
9
+ * - **设置**(`HubSettings.tsx`):插件自己的几项设置(数据目录、步骤上限、自动保存等待……)。
10
+ *
11
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubDialog
12
+ */
13
+ import type { SessionRow } from '../app/sessions.ts';
14
+ import type { Runs } from '../app/useRuns.ts';
15
+ import type { T } from '../i18n.ts';
16
+ import type { WorkflowLiteRpc } from '../rpc.ts';
17
+ export declare function HubDialog(props: {
18
+ t: T;
19
+ rpc: WorkflowLiteRpc;
20
+ session: string | undefined;
21
+ /** 宿主的会话列表(拿会话标题、本会话的工作区);会话服务没接上时是空的。 */
22
+ sessionRows: readonly SessionRow[];
23
+ /** 会话服务接上了没有(没接上就不说"会话已不在",只说"其他会话")。 */
24
+ sessionsReady: boolean;
25
+ runs: Runs;
26
+ onOpenRun(id: string): void;
27
+ /** 「工作流」页要的:编辑页正开着哪张、怎么把它的改动写下去 / 重新加载、怎么打开别的一张。 */
28
+ workflows: {
29
+ current: string | null;
30
+ flush(): Promise<boolean>;
31
+ onReload(): void;
32
+ onOpen(name: string): void;
33
+ rename(from: string, to: string): Promise<boolean>;
34
+ remove(name: string): Promise<boolean>;
35
+ onChanged(): void;
36
+ };
37
+ onClose(): void;
38
+ }): React.JSX.Element;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心里的一个实例:工作流名、会话标题、建立时间、目标;进度、总状态;
3
+ * 查看、移到本会话、删除(确认卡浮在删除按钮旁边,问要不要连状态文件一起删;行不挪位)。
4
+ * 状态文件读不出来时,小标能点:行下面展开原因(找不到的路径,或哪几处写得不对)。
5
+ *
6
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubRunRow
7
+ */
8
+ import type { InstanceSummary } from '../../shared/runState.ts';
9
+ import type { T } from '../i18n.ts';
10
+ export declare function HubRunRow(props: {
11
+ t: T;
12
+ item: InstanceSummary;
13
+ /** 会话怎么称呼(标题;找不到时是"会话已不在"之类)、是不是本会话。 */
14
+ session: {
15
+ text: string;
16
+ mine: boolean;
17
+ };
18
+ canMove: boolean;
19
+ onView(): void;
20
+ onMove(): void;
21
+ onDelete(withState: boolean): void;
22
+ }): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「运行实例」页:工具行(搜索、工作区、本会话 / 全部)+ 按工作区分组的列表。
3
+ *
4
+ * 打开时拉一次全部会话的实例;移动、删除之后再拉一次。不跟着外面的重绘重拉——会话列表一有动静
5
+ * (别的会话在输出)外面就会重绘,跟着重拉会让列表一直闪。
6
+ *
7
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubRuns
8
+ */
9
+ import type { SessionRow } from '../app/sessions.ts';
10
+ import type { Runs } from '../app/useRuns.ts';
11
+ import type { T } from '../i18n.ts';
12
+ export declare function HubRuns(props: {
13
+ t: T;
14
+ session: string | undefined;
15
+ sessionRows: readonly SessionRow[];
16
+ sessionsReady: boolean;
17
+ runs: Runs;
18
+ onOpenRun(id: string): void;
19
+ }): React.JSX.Element;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「设置」页:最上面是外观(配色主题,点了就换),
3
+ * 下面是插件自己的几项设置,分「存储 / 画布 / 模型」三组。
4
+ *
5
+ * - 改在草稿上,底下浮出一条「有 N 处改动还没保存 · 放弃 · 保存」,点保存才写;
6
+ * 数据目录这种改错了很麻烦的东西,不能一敲字就生效。
7
+ * - 和默认值不一样的项,右边有个「恢复默认」的小按钮(提示里写着默认是多少)。
8
+ * - 要重启才生效的项标一个小标签;保存后的提示也会再说一遍。
9
+ * - 没有设置服务、或 profile 不让改:照样显示现值,控件都禁用,顶上说明为什么。
10
+ *
11
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubSettings
12
+ */
13
+ import type { T } from '../i18n.ts';
14
+ import type { WorkflowLiteRpc } from '../rpc.ts';
15
+ export declare function HubSettings(props: {
16
+ t: T;
17
+ rpc: WorkflowLiteRpc;
18
+ /** 保存成功:画布要用的上限、自动保存等待跟着换。 */
19
+ onSaved(): void;
20
+ }): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「存储」页:数据目录在哪、里面各样东西占多少,能清的两样(已结束的实例、
3
+ * 旧版本遗留文件)就地清。
4
+ *
5
+ * - 打开时统计一次,之后只在清理时重算——不跟着外面的重绘重拉(外面重绘很频繁,跟着拉会让按钮一直闪)。
6
+ * - 清理已结束的实例要再确认一次(确认卡浮在按钮旁边);旧版本遗留文件没人用,点一下就删,删完这一行就不显示了。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubStorage
9
+ */
10
+ import type { T } from '../i18n.ts';
11
+ import { type WorkflowLiteRpc } from '../rpc.ts';
12
+ export declare function formatBytes(bytes: number): string;
13
+ export declare function HubStorage(props: {
14
+ t: T;
15
+ rpc: WorkflowLiteRpc;
16
+ /** 清掉了实例记录:让外面的实例列表跟上。 */
17
+ onChanged(): void;
18
+ }): React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「工作流」页左边的列表:选一张、就地改名、删除(确认卡挂在那一行上)。
3
+ *
4
+ * 改名、删除走编辑页同一套(`Workflow.rename / remove`):正开着的那张会先把改动写下去 / 停掉排着的保存,
5
+ * 编辑页跟着换名字或空出来;版本目录由主机跟着搬走或删掉。
6
+ *
7
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubWorkflowList
8
+ */
9
+ import type { WorkflowEntry } from '../../shared/types.ts';
10
+ import type { T } from '../i18n.ts';
11
+ export declare function HubWorkflowList(props: {
12
+ t: T;
13
+ workflows: readonly WorkflowEntry[];
14
+ selected: string;
15
+ /** 编辑页正开着的那张。 */
16
+ current: string | null;
17
+ onPick(name: string): void;
18
+ /** 回 `false` = 没改成(名字不行或主机拒了,已经提示过)。 */
19
+ rename(from: string, to: string): Promise<boolean>;
20
+ remove(name: string): Promise<boolean>;
21
+ }): React.JSX.Element;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「工作流」页左边的一行:点它看这张的版本;改名、删除就在这一行上。
3
+ *
4
+ * - 「改名 / 删除」平时藏着,悬停或键盘移到这一行时浮在右端,和「正在编辑」的小绿点换着显示
5
+ * (只动透明度,名字不挪);触屏没有悬停,一直显示。
6
+ * - 改名只把名字那一行换成一条细输入框,下面一行换成按键提示,整行高度不变:
7
+ * 回车或点开确认,Esc 取消(对话框不跟着关)。
8
+ * - 删除的确认卡挂在这一行的删除按钮上(由 `HubWorkflowList` 统一管)。
9
+ *
10
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubWorkflowRow
11
+ */
12
+ import type { WorkflowEntry } from '../../shared/types.ts';
13
+ import type { T } from '../i18n.ts';
14
+ export interface HubWorkflowRowProps {
15
+ t: T;
16
+ entry: WorkflowEntry;
17
+ /** 右边正显示这张。 */
18
+ selected: boolean;
19
+ /** 编辑页正开着这张。 */
20
+ open: boolean;
21
+ editing: boolean;
22
+ /** 这一行的确认卡开着:按钮保持显示。 */
23
+ busy: boolean;
24
+ /** 删除按钮的 ref:确认卡挂在它上面(只有确认卡指着这一行时才给)。 */
25
+ deleteRef: React.RefObject<HTMLButtonElement> | undefined;
26
+ onPick(): void;
27
+ onEdit(): void;
28
+ /** 提交新名字;回 `false` = 名字不行,留在输入框里。 */
29
+ onRename(value: string): Promise<boolean>;
30
+ onCancelEdit(): void;
31
+ onDelete(): void;
32
+ }
33
+ export declare function HubWorkflowRow(props: HubWorkflowRowProps): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「工作流」页:左边全部工作流,右边选中那张的版本({@link VersionList})。
3
+ *
4
+ * 哪张都能直接看、存、切版本,改名、删除也在左边那一行上({@link HubWorkflowList}),
5
+ * 不用先在编辑页打开它;要编辑就点「打开」。
6
+ * 正在编辑的那张:动手前先把编辑页的改动写下去,切换之后编辑页按磁盘重新加载。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubWorkflows
9
+ */
10
+ import type { T } from '../i18n.ts';
11
+ import { type WorkflowLiteRpc } from '../rpc.ts';
12
+ export declare function HubWorkflows(props: {
13
+ t: T;
14
+ rpc: WorkflowLiteRpc;
15
+ /** 编辑页正开着的那张。 */
16
+ current: string | null;
17
+ flush(): Promise<boolean>;
18
+ /** 正开着的那张切了版本:编辑页按磁盘重新加载。 */
19
+ onReload(): void;
20
+ onOpen(name: string): void;
21
+ /** 改名、删除:走编辑页同一套(正开着的那张跟着变)。回 `false` = 没成,已经提示过。 */
22
+ rename(from: string, to: string): Promise<boolean>;
23
+ remove(name: string): Promise<boolean>;
24
+ /** 版本数变了:外面的工作流目录跟上。 */
25
+ onChanged(): void;
26
+ }): React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心的工作区下拉:全部工作区,或列表里出现过的某一个(本工作区在最前)。
3
+ *
4
+ * @module @xiaoso/dsh-workflow-lite/client/ui/HubWorkspacePicker
5
+ */
6
+ import type { T } from '../i18n.ts';
7
+ import type { HubWorkspace } from '../model/hubRuns.ts';
8
+ export declare function HubWorkspacePicker(props: {
9
+ t: T;
10
+ workspaces: readonly HubWorkspace[];
11
+ /** 全部实例数。 */
12
+ total: number;
13
+ /** `'all'` 或工作区的键。 */
14
+ value: string;
15
+ onChange(value: string): void;
16
+ }): React.JSX.Element;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * dsh-workflow-lite — 图标(内联 SVG,24 栅格、描边风格、跟随文字颜色)。
3
+ *
4
+ * 自带一小套而不是引图标库:模块加载器只认冻结的平台 externals,引进来的库要整个打进
5
+ * bundle,而这里总共只用到二十来个。
6
+ *
7
+ * @module @xiaoso/dsh-workflow-lite/client/ui/Icon
8
+ */
9
+ import type { StepIcon } from '../../shared/appearance.ts';
10
+ declare const BASE_PATHS: {
11
+ readonly chevronDown: "M6 9l6 6 6-6";
12
+ readonly chevronUp: "M6 15l6-6 6 6";
13
+ readonly chevronLeft: "M15 6l-6 6 6 6";
14
+ readonly chevronRight: "M9 6l6 6-6 6";
15
+ readonly plus: "M12 5v14M5 12h14";
16
+ readonly minus: "M5 12h14";
17
+ readonly x: "M6 6l12 12M18 6L6 18";
18
+ readonly check: "M5 12.5l4.5 4.5L19 7.5";
19
+ readonly undo: "M9 14L4 9l5-5M4 9h10.5a5.5 5.5 0 010 11H11";
20
+ readonly redo: "M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 000 11H13";
21
+ readonly tidy: "M4 5h6v5H4zM14 5h6v5h-6zM9 14h6v5H9zM7 10v2h10v-2M12 12v2";
22
+ readonly fit: "M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5";
23
+ readonly play: "M7 5l12 7-12 7z";
24
+ readonly alert: "M12 8v5M12 16.5v.5M10.3 4l-7.4 13a2 2 0 001.7 3h14.8a2 2 0 001.7-3L13.7 4a2 2 0 00-3.4 0z";
25
+ readonly info: "M12 11v6M12 7.5v.5M12 21a9 9 0 100-18 9 9 0 000 18z";
26
+ readonly copy: "M9 9h10v11H9zM5 15V4h10";
27
+ readonly trash: "M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3";
28
+ readonly pencil: "M4 20l4-1L19 8l-3-3L5 16l-1 4zM14 7l3 3";
29
+ readonly search: "M11 18a7 7 0 100-14 7 7 0 000 14zM20 20l-4-4";
30
+ readonly file: "M7 3h7l4 4v14H7zM14 3v4h4";
31
+ readonly loop: "M17 3l3 3-3 3M20 6H8a4 4 0 00-4 4v1M7 21l-3-3 3-3M4 18h12a4 4 0 004-4v-1";
32
+ readonly keyboard: "M3 7h18v10H3zM7 11h.5M11 11h.5M15 11h.5M8 14h8";
33
+ readonly library: "M6 4.5h12a2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2v-11a2 2 0 012-2zM9.5 4.5v15";
34
+ readonly panel: "M6 4.5h12a2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2v-11a2 2 0 012-2zM14.5 4.5v15";
35
+ readonly download: "M12 4v11M7 11l5 5 5-5M5 20h14";
36
+ readonly bookmark: "M7 4h10v16l-5-4-5 4z";
37
+ readonly reload: "M20 12a8 8 0 11-2.4-5.7M20 4v5h-5";
38
+ readonly arrowRight: "M5 12h14M13 6l6 6-6 6";
39
+ readonly folder: "M3 7h6l2 2h10v10H3z";
40
+ readonly sliders: "M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4";
41
+ readonly handoff: "M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8";
42
+ readonly result: "M5 5h14v10h-8l-4 4v-4H5zM9 9.5h6M9 12h4";
43
+ readonly eye: "M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12zM12 14.8a2.8 2.8 0 100-5.6 2.8 2.8 0 000 5.6z";
44
+ readonly modeAuto: "M12 3v3M12 18v3M3 12h3M18 12h3M6.3 6.3l2.1 2.1M15.6 15.6l2.1 2.1M6.3 17.7l2.1-2.1M15.6 8.4l2.1-2.1";
45
+ readonly modeSerial: "M3 10h5v4H3zM16 10h5v4h-5zM8 12h8M13 9.5l3 2.5-3 2.5";
46
+ readonly modeSubagent: "M9 3h6v5H9zM3 16h5v5H3zM16 16h5v5h-5zM12 8v4M5.5 16v-4h13v4";
47
+ readonly modeTeam: "M9 11a3 3 0 100-6 3 3 0 000 6zM3 20c0-3 2.7-5 6-5s6 2 6 5M16 5.5a3 3 0 010 5.5M18 15c1.8.6 3 2.4 3 5";
48
+ readonly ask: "M5 5h14v10H10l-4 4v-4H5zM10 8.6a2 2 0 113 1.7c-.6.4-1 .8-1 1.4M12 12.9v.2";
49
+ readonly inputText: "M4 7h16v10H4zM8 10v4";
50
+ readonly inputArea: "M4 5h16v14H4zM8 9h8M8 12h8M8 15h5";
51
+ readonly inputChoice: "M7 9.5a2 2 0 100-4 2 2 0 000 4zM7 18.5a2 2 0 100-4 2 2 0 000 4zM12 7.5h8M12 16.5h8M7 8.2v-1.4";
52
+ readonly inputMulti: "M4 5h5v5H4zM5.4 7.6l1 1 1.6-2M4 14h5v5H4zM12 7.5h8M12 16.5h8";
53
+ readonly palette: "M12 3a9 9 0 000 18c1.1 0 1.6-.8 1.6-1.6 0-.5-.2-.9-.5-1.2-.3-.3-.5-.7-.5-1.2 0-.9.7-1.6 1.6-1.6H16a5 5 0 005-5c0-4-4-7.4-9-7.4zM7.5 12h.01M9.5 8h.01M14.5 8h.01";
54
+ readonly clock: "M12 21a9 9 0 100-18 9 9 0 000 18zM12 7.5V12l3 2";
55
+ readonly sun: "M12 16a4 4 0 100-8 4 4 0 000 8zM12 3v1.5M12 19.5V21M3 12h1.5M19.5 12H21M5.6 5.6l1.1 1.1M17.3 17.3l1.1 1.1M5.6 18.4l1.1-1.1M17.3 6.7l1.1-1.1";
56
+ readonly moon: "M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z";
57
+ readonly pause: "M9 5v14M15 5v14";
58
+ readonly stop: "M7 7h10v10H7z";
59
+ readonly skip: "M5 6l8 6-8 6zM17 6v12";
60
+ readonly hourglass: "M7 3h10M7 21h10M8 3c0 5 8 5 8 9s-8 4-8 9M16 3c0 5-8 5-8 9s8 4 8 9";
61
+ readonly hub: "M5 3h4a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM7 11v4a2 2 0 002 2h4M15 13h4a2 2 0 012 2v4a2 2 0 01-2 2h-4a2 2 0 01-2-2v-4a2 2 0 012-2z";
62
+ readonly shared: "M12 13.6a1.6 1.6 0 100-3.2 1.6 1.6 0 000 3.2zM8.3 8.3a5.2 5.2 0 000 7.4M15.7 8.3a5.2 5.2 0 010 7.4M5.4 5.4a9.3 9.3 0 000 13.2M18.6 5.4a9.3 9.3 0 010 13.2";
63
+ readonly runs: "M4 6h3M4 12h3M4 18h3M10 6h10M10 12h10M10 18h10";
64
+ readonly storage: "M4 6c0-1.7 3.6-3 8-3s8 1.3 8 3-3.6 3-8 3-8-1.3-8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3";
65
+ readonly pin: "M9 3.5h6l-1 5.5 3.5 3.5h-11L10 9zM12 12.5V21";
66
+ readonly flag: "M5 21V4M5 4h12l-2.5 4.5L17 13H5";
67
+ readonly external: "M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1h5";
68
+ readonly folderOpen: "M3 7V5h6l2 2h8v3M3 7v12h15l3-9H6.5L3 19";
69
+ readonly circle: "M12 20a8 8 0 100-16 8 8 0 000 16z";
70
+ readonly note: "M5 4h10l4 4v12H5zM15 4v4h4M8.5 12h7M8.5 15.5h7M8.5 8.5h3";
71
+ readonly overview: "M4 4h7v9H4zM13 4h7v5h-7zM13 11h7v9h-7zM4 15h7v5H4z";
72
+ readonly history: "M4 12a8 8 0 102.3-5.7L4 8.5M4 4v4.5h4.5M12 8v4l2.8 1.8";
73
+ readonly restore: "M4 12a8 8 0 102.3-5.7L4 8.5M4 4v4.5h4.5";
74
+ /** 运行状态:一段脉搏线。 */
75
+ readonly activity: "M3 12h4l3-7 4 14 3-7h4";
76
+ };
77
+ declare const PATHS: Record<keyof typeof BASE_PATHS | StepIcon, string>;
78
+ export type IconName = keyof typeof PATHS;
79
+ export declare function Icon(props: {
80
+ name: IconName;
81
+ size?: number;
82
+ }): React.JSX.Element;
83
+ export {};
@@ -0,0 +1,37 @@
1
+ /**
2
+ * dsh-workflow-lite — 输入节点的属性面板,与步骤面板里「用户输入」那一小节。
3
+ *
4
+ * 一个输入节点 = 执行前问用户的一个问题:
5
+ * - **问题**与用户的**回答**原样进计划,交给连着的步骤(一条没连 = 交给整个工作流);
6
+ * - **怎么回答**:一句话 / 多行文字 / 单选 / 多选;选择题在这里编辑选项,点选项左边的圈设成默认;
7
+ * - **默认值**:用户没改就用它;**必填**:没有回答也没有默认值时不能执行;
8
+ * - **占位文字**与**说明**只给填写的人看,不进计划。
9
+ *
10
+ * 文本框都是受控的:每敲一个字就改文档(合并成一条撤销步),失焦时封口。
11
+ *
12
+ * @module @xiaoso/dsh-workflow-lite/client/ui/InputPanel
13
+ */
14
+ import type { InputNode, StepNode, WorkflowDocument } from '../../shared/types.ts';
15
+ import type { T } from '../i18n.ts';
16
+ import { type Edit, type Selection } from '../model/editor.ts';
17
+ export interface InputPanelProps {
18
+ t: T;
19
+ doc: WorkflowDocument;
20
+ node: InputNode;
21
+ onEdit(edit: Edit): void;
22
+ onSelect(selection: Selection): void;
23
+ onSeal(): void;
24
+ onRemove(id: string): void;
25
+ /** 标题栏里关闭按钮左边的切换(实例视图里「运行 / 编辑」)。 */
26
+ tabs?: React.ReactNode;
27
+ }
28
+ export declare function InputPanel(props: InputPanelProps): React.JSX.Element;
29
+ /**
30
+ * 步骤面板里的「用户输入」:交给这一步的问题(点一下选中那个输入)。一个都没连就不出现。
31
+ */
32
+ export declare function StepInputsField(props: {
33
+ t: T;
34
+ doc: WorkflowDocument;
35
+ step: StepNode;
36
+ onSelect(selection: Selection): void;
37
+ }): React.JSX.Element | null;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * dsh-workflow-lite — 「执行前填写」:图里有输入节点时,点「执行」先在这里回答问题。
3
+ *
4
+ * 问题按画布上从上到下、从左到右的顺序排。每题显示问题、说明(只给填写的人看)、按题型的控件:
5
+ * 一句话 / 多行文字是输入框(占位文字是灰字提示、默认值预先填好),单选 / 多选是一列选项。
6
+ * 必填的都有了回答才能执行;回答随「执行」一起交给插件,编译进计划的「本次执行」段。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/InputsDialog
9
+ */
10
+ import type { InputAnswer, InputNode } from '../../shared/types.ts';
11
+ import type { T } from '../i18n.ts';
12
+ export declare function InputsDialog(props: {
13
+ t: T;
14
+ name: string;
15
+ inputs: readonly InputNode[];
16
+ /** 上一次在这里填的回答(预先填好)。 */
17
+ initial: Record<string, InputAnswer> | undefined;
18
+ /** 在哪里执行(新建会话 / 本会话 / 某个会话的标题)。 */
19
+ where: string;
20
+ onSubmit(answers: Record<string, InputAnswer>): void;
21
+ onClose(): void;
22
+ }): React.JSX.Element;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * dsh-workflow-lite — 属性面板(右侧,选中东西时才出现)。
3
+ *
4
+ * 选中步骤:名称、提示词、产出文件、连接,底部是复制 / 存为模板 / 删除。
5
+ * 选中连线:两端、"什么时候走这条线"、删除。
6
+ *
7
+ * 文本框都是受控的:每敲一个字就改文档(合并成一条撤销步),失焦时封口。
8
+ * 不合法的值(带竖线的名称、绝对路径的产出、带空格的判据)**不写进文档**,只在原地标红——
9
+ * 文档里永远只有能保存的东西。
10
+ *
11
+ * @module @xiaoso/dsh-workflow-lite/client/ui/Inspector
12
+ */
13
+ import type { GraphAnalysis } from '../../shared/graph.ts';
14
+ import type { NodeData, WorkflowDocument, WorkflowNode } from '../../shared/types.ts';
15
+ import type { HostAccess } from '../app/host.ts';
16
+ import type { T } from '../i18n.ts';
17
+ import { type Edit, type Selection } from '../model/editor.ts';
18
+ import { type FocusFile } from './Handoff.tsx';
19
+ export interface InspectorProps {
20
+ t: T;
21
+ doc: WorkflowDocument;
22
+ analysis: GraphAnalysis;
23
+ selection: NonNullable<Selection>;
24
+ /** 刚加进来的空白步骤:面板一出来就把光标放进提示词。 */
25
+ focusPrompt: boolean;
26
+ onEdit(edit: Edit): void;
27
+ onSelect(selection: Selection): void;
28
+ onSeal(): void;
29
+ onDuplicate(id: string): void;
30
+ onRemoveNode(id: string): void;
31
+ onSaveTemplate(name: string, data: NodeData): Promise<boolean>;
32
+ /** 悬停到一个资源:画布高亮用到它的步骤。 */
33
+ onFocusFile: FocusFile;
34
+ /** 给资源选文件、文件夹、Skill 时看主机。 */
35
+ host: HostAccess;
36
+ /** 标题栏里关闭按钮左边的切换(实例视图里「运行 / 编辑」);模板编辑不给。 */
37
+ tabs?: React.ReactNode;
38
+ }
39
+ export declare function Inspector(props: InspectorProps): React.JSX.Element | null;
40
+ /** 一句话描述(给人看:步骤库条目、画布卡片),不进计划。 */
41
+ export declare function DescriptionField(props: {
42
+ t: T;
43
+ value: string;
44
+ onChange(value: string): void;
45
+ onBlur?: () => void;
46
+ }): React.JSX.Element;
47
+ /** 连线两端的小图标:步骤用它的图标,资源用资源图标。 */
48
+ export declare function EndIcon(props: {
49
+ node: WorkflowNode | undefined;
50
+ id: string;
51
+ }): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * dsh-workflow-lite — 顶栏的检查结果:一个小牌子(没有问题 / x 个问题),点开列出每一条,点一条定位到那个节点。
3
+ * 模板编辑和实例视图共用(两边是同一套规则,见 `shared/validate.ts`)。
4
+ *
5
+ * @module @xiaoso/dsh-workflow-lite/client/ui/Issues
6
+ */
7
+ import type { ValidationProblem } from '../../shared/types.ts';
8
+ import type { LocaleKey, T } from '../i18n.ts';
9
+ export declare function Issues(props: {
10
+ t: T;
11
+ problems: readonly ValidationProblem[];
12
+ /** 没有问题时那句说明。 */
13
+ noneBody?: LocaleKey;
14
+ onLocate(nodeId: string): void;
15
+ }): 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/Launch
10
+ */
11
+ import { type SessionRow } from '../app/sessions.ts';
12
+ import type { LocaleKey, T } from '../i18n.ts';
13
+ export interface LaunchProps {
14
+ t: T;
15
+ /** 图是空的:预览、执行都不能点。 */
16
+ empty: boolean;
17
+ /** 执行为什么不能点(`null` = 能点)。 */
18
+ blocked: LocaleKey | null;
19
+ /** 正在建实例 / 发消息。 */
20
+ starting: boolean;
21
+ /** 这个 tab 所在的会话。 */
22
+ session: string | undefined;
23
+ rows: readonly SessionRow[];
24
+ /** 能在同一工作区新建会话(缺省的执行方式);不能时主按钮退回本会话。 */
25
+ canCreate: boolean;
26
+ onPreview(): void;
27
+ /** `null` = 新建会话执行。 */
28
+ onRun(session: string | null): void;
29
+ }
30
+ export declare function Launch(props: LaunchProps): React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * dsh-workflow-lite — 步骤库(左侧浮动面板)。
3
+ *
4
+ * 两种手势,各管一件事:
5
+ * - **拖**:拖到画布上哪里,步骤就落在哪里。往图里加东西只有这一条路(和右侧面板里那个
6
+ * 明确写着「添加到画布」的按钮)——单击加节点落点不明确,容易误加。
7
+ * - **点**:在右侧面板里看它。常用步骤只读;我的步骤可以改、可以删。
8
+ *
9
+ * 「常用步骤」「我的步骤」两节都能收起,收起状态记在本机。
10
+ *
11
+ * @module @xiaoso/dsh-workflow-lite/client/ui/Library
12
+ */
13
+ import type { TemplateEntry } from '../../shared/types.ts';
14
+ import type { T } from '../i18n.ts';
15
+ import { type LibraryFocus } from '../model/library.ts';
16
+ export declare function Library(props: {
17
+ t: T;
18
+ templates: readonly TemplateEntry[];
19
+ focus: LibraryFocus | null;
20
+ onFocus: (focus: LibraryFocus) => void;
21
+ onNewStep: () => void;
22
+ onClose: () => void;
23
+ }): React.JSX.Element;