@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,22 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例顶栏最右(右栏开关右边)的「在看什么」:图标就是右栏里正在看的那个东西的图标(同色),
3
+ * 概览是固定的概览图标;右栏收着时没有在看的东西,图标块不上色。点开按分类列出这次执行的节点
4
+ * (概览 / 步骤 / 资源 / 输入),能搜,点一项就切过去(右栏收着就打开)。
5
+ *
6
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunNav
7
+ */
8
+ import type { GraphAnalysis } from '../../shared/graph.ts';
9
+ import type { RunState } from '../../shared/runState.ts';
10
+ import type { WorkflowDocument } from '../../shared/types.ts';
11
+ import type { T } from '../i18n.ts';
12
+ import { type Selection } from '../model/editor.ts';
13
+ export declare function RunNav(props: {
14
+ t: T;
15
+ doc: WorkflowDocument;
16
+ analysis: GraphAnalysis;
17
+ state: RunState | null;
18
+ selection: Selection;
19
+ /** 右栏收着:没有在看的东西,图标块不上色(不像是开着的)。 */
20
+ idle: boolean;
21
+ onPick(selection: Selection): void;
22
+ }): React.JSX.Element;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例视图里一个步骤的运行状态:状态、轮次、判定、摘要、失败原因(都能改,改动进草稿),
3
+ * 以及谁做的、什么时候开始结束。
4
+ *
5
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunNodeState
6
+ */
7
+ import { type NodeStatus, type RunState, type StateEdit } from '../../shared/runState.ts';
8
+ import type { Desktop } from '../app/desktop.ts';
9
+ import type { Run } from '../app/useRuns.ts';
10
+ import type { LocaleKey, T } from '../i18n.ts';
11
+ import { type IconName } from './Icon.tsx';
12
+ /** 步骤状态的一句话说明(悬停提示)。 */
13
+ export declare function nodeHint(status: NodeStatus): LocaleKey;
14
+ export declare const NODE_ICON: Record<NodeStatus, IconName>;
15
+ export declare function isEdited(draft: readonly StateEdit[], path: readonly string[]): boolean;
16
+ /** 改了还没保存的字段:标题旁一个小圆点。 */
17
+ export declare function EditedDot(props: {
18
+ on: boolean;
19
+ }): React.JSX.Element | null;
20
+ /** 状态小标(只读):用到它的步骤、上下游里每一行行尾的那个。 */
21
+ export declare function StatusChip(props: {
22
+ t: T;
23
+ status: NodeStatus | undefined;
24
+ }): React.JSX.Element | null;
25
+ /** 状态、轮次、判定、摘要、失败原因。 */
26
+ export declare function StepStatus(props: {
27
+ t: T;
28
+ current: Run;
29
+ id: string;
30
+ node: RunState['nodes'][string];
31
+ verdicts: readonly string[] | undefined;
32
+ onRerun(): void;
33
+ /** 摘要、失败原因的弹窗:标题与图标块。 */
34
+ name: string;
35
+ badge: React.ReactNode;
36
+ desktop: Desktop | undefined;
37
+ }): React.JSX.Element;
38
+ /** 谁做的、什么时候开始、什么时候结束;都没有就不画。 */
39
+ export declare function StepFacts(props: {
40
+ t: T;
41
+ node: RunState['nodes'][string] | undefined;
42
+ }): React.JSX.Element | null;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例视图右栏什么都没选时的概览:总状态与进度、执行位置、说明、基本信息、时间线;
3
+ * 不记运行状态的实例只讲清楚为什么看不到进度。
4
+ *
5
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunOverview
6
+ */
7
+ import type { RunCursor } from '../../shared/runCursor.ts';
8
+ import { type InstanceSummary, type RunState } from '../../shared/runState.ts';
9
+ import type { WorkflowDocument } from '../../shared/types.ts';
10
+ import type { Run } from '../app/useRuns.ts';
11
+ import type { T } from '../i18n.ts';
12
+ /** 不记运行状态的实例:右栏只讲清楚为什么看不到进度,再列几样基本信息。 */
13
+ export declare function Untracked(props: {
14
+ t: T;
15
+ summary: InstanceSummary;
16
+ snapshot: WorkflowDocument;
17
+ }): React.JSX.Element;
18
+ export declare function Overview(props: {
19
+ t: T;
20
+ current: Run;
21
+ snapshot: WorkflowDocument;
22
+ state: RunState;
23
+ cursor: RunCursor | null;
24
+ summary: InstanceSummary | undefined;
25
+ labelOf(id: string): string;
26
+ onSelect(id: string | null): void;
27
+ }): React.JSX.Element;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例总览里的「执行位置」:正在执行、最后执行、下一步各是哪几步。
3
+ *
4
+ * 和画布卡片右上角的小标是同一份结论(`shared/runCursor.ts`,模型 `resume` 拿到的也是它):
5
+ * 循环里转到第几轮、从哪一步回来的,一眼能看出来。点一行到那一步。
6
+ * 「指定」可以改下一步:勾选的步骤进草稿(状态里的 `next`),存下后模型照它接着做。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunPosition
9
+ */
10
+ import type { RunCursor } from '../../shared/runCursor.ts';
11
+ import type { RunState } from '../../shared/runState.ts';
12
+ import type { WorkflowDocument } from '../../shared/types.ts';
13
+ import type { T } from '../i18n.ts';
14
+ export declare function RunPosition(props: {
15
+ t: T;
16
+ snapshot: WorkflowDocument;
17
+ state: RunState;
18
+ cursor: RunCursor;
19
+ /** 指定下一步在草稿里改过(标题旁挂小圆点)。 */
20
+ pinEdited: boolean;
21
+ /** 改指定的下一步(`null` = 取消指定,回到按流转推)。 */
22
+ onPin(ids: string[] | null): void;
23
+ onSelect(id: string): void;
24
+ }): React.JSX.Element;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例视图右栏:选中一张资源卡。
3
+ *
4
+ * 右栏只放缩略信息,细节都在点开之后的详情框里:
5
+ * - 描述(最多三行);
6
+ * - **内容**:每项一行——图标、名字,下面一行是它此刻的样子(文件:生成没有 · 大小 · 修改时间;
7
+ * 文件夹:在不在 · 修改时间;网址:路径;Skill:一句话说明;自定义:字数);有说明的挂一个「说明」小签
8
+ * (和模板里一样,全文在悬停提示与查看框里)。行尾是「查看」和
9
+ * 「打开」(文件 / 文件夹交给系统程序,网址在浏览器里开);点这一行也是查看。
10
+ * 查看按种类不同:文件读正文({@link FileViewer}),文件夹列里面有什么,网址、自定义文字显示全文,
11
+ * Skill 读 SKILL.md;每种都把这一项的说明放在正文前。
12
+ * - **用到它的步骤**:谁产出、谁更新、谁读,带各自的运行状态,点一下跳过去。
13
+ *
14
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunResource
15
+ */
16
+ import type { RunState } from '../../shared/runState.ts';
17
+ import type { ResourceNode, WorkflowDocument } from '../../shared/types.ts';
18
+ import type { Desktop } from '../app/desktop.ts';
19
+ import type { HostAccess } from '../app/host.ts';
20
+ import { type FileTarget } from '../app/useRunFile.ts';
21
+ import type { T } from '../i18n.ts';
22
+ import type { WorkflowLiteRpc } from '../rpc.ts';
23
+ export declare function RunResourceDetail(props: {
24
+ t: T;
25
+ rpc: WorkflowLiteRpc;
26
+ instance: string;
27
+ host: HostAccess;
28
+ snapshot: WorkflowDocument;
29
+ resource: ResourceNode;
30
+ /** 每一项在不在(不是路径的项为 `null`)。 */
31
+ made: readonly (boolean | null)[];
32
+ state: RunState | null;
33
+ /** 状态文件的修改时间:变了就重读文件信息(模型写完文件通常也会更新状态)。 */
34
+ version: number;
35
+ desktop: Desktop | undefined;
36
+ onSelectStep(id: string): void;
37
+ onFocusFile(id: string | null): void;
38
+ onView(target: FileTarget, title: string, note: string | undefined): void;
39
+ onError(text: string): void;
40
+ }): React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例视图里点步骤卡上的状态小标弹出的小菜单:改状态(有条件出边的改成完成时先问判定)、
3
+ * 指定为下一步、重跑这一步。
4
+ *
5
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunStatusMenu
6
+ */
7
+ import { type NodeStatus } from '../../shared/runState.ts';
8
+ import type { T } from '../i18n.ts';
9
+ export declare function StatusMenu(props: {
10
+ t: T;
11
+ at: {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ node: {
16
+ status: NodeStatus;
17
+ verdict?: string;
18
+ };
19
+ step: 'status' | 'verdict';
20
+ verdicts: readonly string[];
21
+ onStatus(status: NodeStatus): void;
22
+ onVerdict(verdict: string): void;
23
+ onRerun(): void;
24
+ /** 这一步在不在用户指定的下一步里。 */
25
+ pinned: boolean;
26
+ onPin(): void;
27
+ onClose(): void;
28
+ }): React.JSX.Element;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例视图右栏:选中一个步骤。
3
+ *
4
+ * 和模板里选中步骤看到的是同一套东西,只是都换成只读、带上本次运行的样子:
5
+ * - 描述(最多三行);
6
+ * - 运行状态(能改,见 `RunNodeState.tsx`);
7
+ * - **提示词**:只露四行,点开看全文(可复制);
8
+ * - **用户输入**:问了什么、这次怎么答的,点一下看那道题;
9
+ * - **产出 / 读取**:它写哪些、读哪些资源(`RunFiles.tsx`);
10
+ * - **连接**:上游、下游,和模板里同一种行(`LinkRow.tsx`),多了对面那一步的状态,箭头绿的是本次
11
+ * 经过的线;点一行看那条线(线的两端再点一下就到对面那一步)。
12
+ *
13
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunStep
14
+ */
15
+ import type { GraphAnalysis } from '../../shared/graph.ts';
16
+ import type { RunState } from '../../shared/runState.ts';
17
+ import type { InputAnswer, StepNode, WorkflowDocument } from '../../shared/types.ts';
18
+ import type { Desktop } from '../app/desktop.ts';
19
+ import type { Run } from '../app/useRuns.ts';
20
+ import type { T } from '../i18n.ts';
21
+ export declare function RunStepDetail(props: {
22
+ t: T;
23
+ current: Run;
24
+ snapshot: WorkflowDocument;
25
+ analysis: GraphAnalysis;
26
+ step: StepNode;
27
+ state: RunState | null;
28
+ /** 图里刚加、还没保存的步骤:没有运行状态可看。 */
29
+ fresh?: boolean;
30
+ /** 这次走过的线;不记进度时为 `null`。 */
31
+ taken: ReadonlySet<string> | null;
32
+ verdicts: readonly string[] | undefined;
33
+ answers: Readonly<Record<string, InputAnswer>> | undefined;
34
+ made: Readonly<Record<string, readonly (boolean | null)[]>>;
35
+ desktop: Desktop | undefined;
36
+ onRerun(): void;
37
+ onSelectNode(id: string): void;
38
+ onSelectEdge(id: string): void;
39
+ onFocusFile(id: string | null): void;
40
+ onViewPath(path: string): void;
41
+ /** 改这一步的提示词(改的是这次执行的图,进草稿)。 */
42
+ onEditPrompt(prompt: string): void;
43
+ /** 一次编辑结束(弹窗关上):断开撤销合并。 */
44
+ onSeal(): void;
45
+ }): React.JSX.Element;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * dsh-workflow-lite — 实例视图的顶栏:实例与工作流的下拉、总状态与进度;撤销重做、整理、检查结果
3
+ * (和模板编辑的顶栏同一组);打开模板、复制状态文件路径、「在看什么」与右栏开关。
4
+ * 状态小标与下拉里「本会话的实例」那一段,工作流中心与模板编辑的顶栏也用。
5
+ *
6
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunTopBar
7
+ */
8
+ import { type InstanceSummary, type RunState, type RunStatus } from '../../shared/runState.ts';
9
+ import type { ValidationProblem } from '../../shared/types.ts';
10
+ import type { RunHistory } from '../app/useRunHistory.ts';
11
+ import type { Runs } from '../app/useRuns.ts';
12
+ import type { LocaleKey, T } from '../i18n.ts';
13
+ import type { RunViewProps } from './RunView.tsx';
14
+ export declare const RUN_STATUS_TEXT: Record<RunStatus, LocaleKey>;
15
+ /** 实例的状态小标。 */
16
+ export declare function RunStatusBadge(props: {
17
+ t: T;
18
+ status: RunStatus | undefined;
19
+ problem?: 'missing' | 'invalid' | undefined;
20
+ /** 这个实例不记运行状态(没有状态文件)。 */
21
+ untracked?: boolean;
22
+ }): React.JSX.Element;
23
+ export declare function RunTopBar(props: RunViewProps & {
24
+ summary: InstanceSummary | undefined;
25
+ state: RunState | null;
26
+ /** 右栏开关右边「在看什么」的切换(顶栏最右)。 */
27
+ nav: React.ReactNode;
28
+ onTogglePanel(): void;
29
+ /** 图和状态排成一条的撤销 / 重做。 */
30
+ history: RunHistory;
31
+ /** 这张图的检查结果(和模板同一套规则);图还没读回来是 `null`。 */
32
+ problems: readonly ValidationProblem[] | null;
33
+ onTidy(): void;
34
+ onLocate(nodeId: string): void;
35
+ }): React.JSX.Element;
36
+ /** 下拉里「本会话的实例」那一段。没有实例就什么都不画。 */
37
+ export declare function RunMenuSection(props: {
38
+ t: T;
39
+ runs: Runs;
40
+ activeId: string | null;
41
+ onOpenRun(id: string): void;
42
+ }): React.JSX.Element | null;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流实例视图。
3
+ *
4
+ * 和模板是同一张图、同一套画布:每张步骤卡挂上运行状态,走过的线亮、没走过的淡。
5
+ * 状态和图都能改,而且要顺手——卡片上的状态小标一点就改状态,右栏就地改字段;图和模板里一样拖、连、加、删,
6
+ * 右栏切到「编辑」就是模板的属性面板。改动先攒成草稿(「已改 x 处」),确认后一次写进实例
7
+ * (图的快照、状态文件),并以后台通知的形式告诉模型。执行过的步骤不能从图里删(改成「跳过」)。
8
+ *
9
+ * 顶栏和模板一样有撤销重做、整理、检查结果:撤销把图的改动和状态的改动排成一条(`useRunHistory`),
10
+ * 检查和模板是同一套规则。
11
+ *
12
+ * @module @xiaoso/dsh-workflow-lite/client/ui/RunView
13
+ */
14
+ import type { NodeData, TemplateEntry, WorkflowEntry } from '../../shared/types.ts';
15
+ import type { Desktop } from '../app/desktop.ts';
16
+ import { type Runs } from '../app/useRuns.ts';
17
+ import type { T } from '../i18n.ts';
18
+ import type { WorkflowLiteRpc } from '../rpc.ts';
19
+ export interface RunViewProps {
20
+ t: T;
21
+ rpc: WorkflowLiteRpc;
22
+ session: string | undefined;
23
+ id: string;
24
+ runs: Runs;
25
+ workflows: readonly WorkflowEntry[];
26
+ /** 「我的步骤」(就地添加菜单里列出来)。 */
27
+ templates: readonly TemplateEntry[];
28
+ /** 读一个「我的步骤」的内容;读不到回 `null`。 */
29
+ loadTemplate(name: string): Promise<NodeData | null>;
30
+ /** 把一个步骤存成「我的步骤」。 */
31
+ onSaveTemplate(name: string, data: NodeData): Promise<boolean>;
32
+ narrow: boolean;
33
+ inspectorW: number;
34
+ /** 右栏开着没有(点画布空白处收起,顶栏的开关再打开)。 */
35
+ panelOpen: boolean;
36
+ onPanel(open: boolean): void;
37
+ onOpenRun(id: string): void;
38
+ onOpenTemplate(name: string): void;
39
+ onOpenHub(): void;
40
+ /** 用系统程序打开产出文件;宿主没有桌面能力时不给。 */
41
+ desktop?: Desktop;
42
+ }
43
+ export declare function RunView(props: RunViewProps): React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * dsh-workflow-lite — 「工作流设置」对话框:整张工作流的全局配置,都会编译进派发计划。
3
+ *
4
+ * 三块(画在 `SettingsFields.tsx`),一项一行,不堆说明——细节收在各自的「?」里:
5
+ * - **执行方式**:自动 / 串行 / 主 agent + 子代理 / Agent 团队(四张卡),下面一行**复用执行者**:
6
+ * 同一步骤再次执行时交回上次的子代理或队员、每次新建,或不规定;串行时用不上。
7
+ * - **执行时**:**设定目标**(缺省开,开始前用 `create_goal` 设成会话目标)与**记录运行状态**两个开关。
8
+ * - **产出根目录**:每个步骤的产出文件编译时都拼在它下面;说明里的拼接示例跟着输入实时变,
9
+ * 拼接与标准化走 `shared/outputPaths.ts`(和编译器同一份)。保存成默认值 = 不写这个键。
10
+ *
11
+ * 「完成」时一次交出去(一次改动 = 一条撤销步)。
12
+ *
13
+ * @module @xiaoso/dsh-workflow-lite/client/ui/SettingsDialog
14
+ */
15
+ import type { WorkflowSettings } from '../../shared/types.ts';
16
+ import type { T } from '../i18n.ts';
17
+ export declare function SettingsDialog(props: {
18
+ t: T;
19
+ name: string;
20
+ settings: WorkflowSettings | undefined;
21
+ /** 预览用的示例产出(图里第一个产出文件;没有就是 `plan.md`)。 */
22
+ sample: string;
23
+ onSave(settings: WorkflowSettings | undefined): void;
24
+ onClose(): void;
25
+ }): React.JSX.Element;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * dsh-workflow-lite — 「工作流设置」对话框里的三块:执行方式(四张卡 + 复用执行者)、
3
+ * 执行时(设定目标、记录运行状态两个开关)、产出根目录。状态都在对话框里,这里只画。
4
+ *
5
+ * @module @xiaoso/dsh-workflow-lite/client/ui/SettingsFields
6
+ */
7
+ import { checkOutputRoot } from '../../shared/outputPaths.ts';
8
+ import { type ExecutionMode, type ReusePolicy } from '../../shared/types.ts';
9
+ import type { T } from '../i18n.ts';
10
+ export declare function ModeGroup(props: {
11
+ t: T;
12
+ mode: ExecutionMode;
13
+ reuse: ReusePolicy;
14
+ onMode(mode: ExecutionMode): void;
15
+ onReuse(reuse: ReusePolicy): void;
16
+ }): React.JSX.Element;
17
+ export declare function DuringGroup(props: {
18
+ t: T;
19
+ setGoal: boolean;
20
+ runState: boolean;
21
+ onSetGoal(on: boolean): void;
22
+ onRunState(on: boolean): void;
23
+ }): React.JSX.Element;
24
+ /** 根目录现在的样子:问题、标准化后的写法、是不是默认值(保存时据此决定写不写)。 */
25
+ export declare function rootStatus(root: string): {
26
+ problem: ReturnType<typeof checkOutputRoot>;
27
+ normalized: string | undefined;
28
+ isDefault: boolean;
29
+ };
30
+ export declare function RootGroup(props: {
31
+ t: T;
32
+ root: string;
33
+ /** 说明里拼接示例用的产出(图里第一个产出文件;没有就是 `plan.md`)。 */
34
+ sample: string;
35
+ inputRef: React.RefObject<HTMLInputElement>;
36
+ onChange(root: string): void;
37
+ }): React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * dsh-workflow-lite — 「选择 Skill」:从会话里的 agent 能用的 skill 里挑。
3
+ *
4
+ * 一行一个 skill:左边是勾选区(勾选框、名字、一句话说明),点它选上 / 取消;右边是来源小签和
5
+ * 一只「眼睛」,点它看 SKILL.md({@link SkillPreview},那里也能直接选上)。可以勾好几个一起加,
6
+ * 已经在这个资源里的标成「已添加」。列不出来(没接上 skill 服务、一个都没有)时给一个「手写名字」
7
+ * 的出口(`onManual`),平时不占地方。
8
+ * `single`:编辑一项时换它的 skill——点一行就选定、直接关掉。
9
+ *
10
+ * @module @xiaoso/dsh-workflow-lite/client/ui/SkillPicker
11
+ */
12
+ import type { HostAccess } from '../app/host.ts';
13
+ import type { T } from '../i18n.ts';
14
+ export declare function SkillPicker(props: {
15
+ t: T;
16
+ host: HostAccess;
17
+ /** 资源里已经有的 skill。 */
18
+ existing: readonly string[];
19
+ /** 只选一个:点一行就交出去。 */
20
+ single?: boolean;
21
+ /** 列不出来时「手写一个名字」;不给就没有这个出口。 */
22
+ onManual?: () => void;
23
+ onPick(names: string[]): void;
24
+ onClose(): void;
25
+ }): React.JSX.Element;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * dsh-workflow-lite — 看一个 skill 的 SKILL.md。
3
+ *
4
+ * 框子是 {@link DocViewer}:正文默认排版、可切源码;标题行能复制路径、用其他程序打开
5
+ * SKILL.md 或在文件管理器里显示它所在的文件夹(插件运行时注册的 skill 没有文件,这两样不出现)。
6
+ * 正文前是它的一句话说明和「什么时候用」。从选择框里点开时,底部带一个「选上 / 用这个」。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/SkillPreview
9
+ */
10
+ import type { HostAccess } from '../app/host.ts';
11
+ import type { T } from '../i18n.ts';
12
+ import { type IconName } from './Icon.tsx';
13
+ /** 底部的那个按钮(不给就没有底部)。 */
14
+ export interface SkillPreviewAction {
15
+ label: string;
16
+ icon: IconName;
17
+ primary: boolean;
18
+ disabled?: boolean;
19
+ onClick(): void;
20
+ }
21
+ export declare function SkillPreview(props: {
22
+ t: T;
23
+ host: HostAccess;
24
+ name: string;
25
+ action?: SkillPreviewAction;
26
+ onClose(): void;
27
+ }): React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * dsh-workflow-lite — 步骤的图标块:卡片、面板、步骤库、连接清单里认一个步骤的那个小色块。
3
+ *
4
+ * 样子取自步骤自己的 `data.icon` / `data.color`,没存的按 id 猜(`shared/appearance.ts`)。
5
+ *
6
+ * @module @xiaoso/dsh-workflow-lite/client/ui/StepMark
7
+ */
8
+ import { type Appearance } from '../../shared/appearance.ts';
9
+ import type { NodeData } from '../../shared/types.ts';
10
+ /** 一个步骤的样子。 */
11
+ export declare function lookOf(id: string, data: Pick<NodeData, 'icon' | 'color'> | undefined): Appearance;
12
+ export declare function StepMark(props: {
13
+ look: Appearance;
14
+ size?: number;
15
+ className?: string;
16
+ }): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * dsh-workflow-lite — 步骤库条目的详情(右侧面板):点一下库里的条目就在这里看它。
3
+ *
4
+ * - **常用步骤**是内置的:只读展示提示词与产出,不能改。能做的只有"添加到画布"和
5
+ * "复制为我的步骤"(复制出来的那份就可以随便改了)。连接这类只对画布上的步骤有意义的
6
+ * 东西,这里不出现。
7
+ * - **我的步骤**就是 `templates/nodes/<ID>.json`:可以改 ID、名称、描述、提示词、产出,
8
+ * 显式保存(Ctrl+S 也行),也可以删除。离开时还有没保存的改动,就顺手保存一次——
9
+ * 改了一半一点别处就丢,比"多保存了一次"糟糕得多。
10
+ *
11
+ * @module @xiaoso/dsh-workflow-lite/client/ui/StepPanel
12
+ */
13
+ import type { NodeData } from '../../shared/types.ts';
14
+ import type { Workflow } from '../app/useWorkflow.ts';
15
+ import type { T } from '../i18n.ts';
16
+ import { type LibraryFocus, type StepSource } from '../model/library.ts';
17
+ export interface StepPanelProps {
18
+ t: T;
19
+ wf: Workflow;
20
+ focus: LibraryFocus;
21
+ onFocus(focus: LibraryFocus | null): void;
22
+ onAddToCanvas(source: StepSource): void;
23
+ /** 把一份内容带去新建「我的步骤」(复制内置步骤用)。 */
24
+ onCopyToMine(seed: NodeData, name: string): void;
25
+ }
26
+ export declare function StepPanel(props: StepPanelProps): React.JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流中心「设置」页的「外观」:亮色、暗色各挑一套配色主题。
3
+ *
4
+ * 点一下马上换,不进下面的保存条(只是看起来的样子,记在浏览器里,见 app/theme.ts)。
5
+ * 每张小卡是那套主题的缩略:画布底、一条侧栏、两张卡和连着它们的线、选中的那张描强调色。
6
+ * 亮、暗两行里,此刻正用着的那一行标「正在用」。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/ThemePicker
9
+ */
10
+ import type { T } from '../i18n.ts';
11
+ export declare function ThemePicker(props: {
12
+ t: T;
13
+ }): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * dsh-workflow-lite — 悬停提示:整个视图共用一个浮层。
3
+ *
4
+ * 元素上写 `data-tip="…"` 就有提示,不用包组件、也不用加类名(不用原生 `title`:
5
+ * 浏览器自带的提示样子、延迟都和插件对不上)。
6
+ *
7
+ * - 浮层挂在视图根上:不被滚动区、对话框裁掉;画布缩放时字号也不跟着变。
8
+ * - 悬停一会儿或键盘聚焦才出来;刚收起一个又指向下一个时立刻出来,扫一排按钮不用每个都等。
9
+ * - 默认在元素正下方居中,下面放不下翻到上方,左右夹在视图里;长文字折行,`\n` 换行。
10
+ * - 按下指针、滚动、滚轮、Esc 都收起;按过的那个元素在指针离开前不再弹,点完按钮不挡视线。
11
+ * - `data-tip` 变了(比如「复制路径」→「已复制」)跟着换字;元素没了就收起。
12
+ *
13
+ * @module @xiaoso/dsh-workflow-lite/client/ui/TipLayer
14
+ */
15
+ export declare function TipLayer(props: {
16
+ root: HTMLElement | null;
17
+ }): React.ReactNode;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * dsh-workflow-lite — 顶栏:左边是"我在哪张工作流、存好了没有",右边是撤销重做、整理、
3
+ * 工作流设置、检查结果,以及「预览 / 执行」组。
4
+ *
5
+ * 低频的文件操作(新建、改名、删除、重新加载)都收在工作流名字的下拉里({@link WorkflowSwitcher}),
6
+ * 顶栏上常驻的只有高频动作。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/TopBar
9
+ */
10
+ import type { Runs } from '../app/useRuns.ts';
11
+ import type { Workflow } from '../app/useWorkflow.ts';
12
+ import type { T } from '../i18n.ts';
13
+ import { type LaunchProps } from './Launch.tsx';
14
+ export interface TopBarProps {
15
+ t: T;
16
+ wf: Workflow;
17
+ libraryOpen: boolean;
18
+ onToggleLibrary(): void;
19
+ onTidy(): void;
20
+ onLocate(nodeId: string): void;
21
+ onPreview(): void;
22
+ /** 「执行」那一半要的东西。 */
23
+ launch: Pick<LaunchProps, 'blocked' | 'starting' | 'session' | 'rows' | 'canCreate' | 'onRun'>;
24
+ onSettings(): void;
25
+ /** 打开这张工作流的版本。 */
26
+ onVersions(): void;
27
+ /** 本会话的工作流实例(下拉里「本会话的实例」那一段)。 */
28
+ runs: Runs;
29
+ onOpenRun(id: string): void;
30
+ onOpenHub(): void;
31
+ }
32
+ export declare function TopBar(props: TopBarProps): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * dsh-workflow-lite — 一个工作流的版本:上面「说明 + 存为版本」,下面版本列表(新的在前)。
3
+ *
4
+ * 编辑页的「版本」对话框与工作流中心的「工作流」页共用。存的、比的都是磁盘上那份
5
+ * (编辑页正开着这张时先把改动写下去,见 {@link useVersions})。
6
+ * 现在的内容和某个版本一样时,存的按钮按住,旁边说「现在的内容就是 v3」。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/VersionList
9
+ */
10
+ import type { T } from '../i18n.ts';
11
+ import type { WorkflowLiteRpc } from '../rpc.ts';
12
+ export declare function VersionList(props: {
13
+ t: T;
14
+ rpc: WorkflowLiteRpc;
15
+ name: string;
16
+ before?: () => Promise<boolean>;
17
+ onRestored?: () => void;
18
+ onChanged?: () => void;
19
+ }): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * dsh-workflow-lite — 版本列表的一行:「v3 · 说明 · 时间 · 步骤数 · 当前」。
3
+ *
4
+ * - 点这一行展开「切到这一版会有哪些变化」(和磁盘上现在的内容比);
5
+ * - 「切换 / 编辑说明 / 删除」平时藏着,悬停或键盘移进来时浮在右端(和 `WorkflowRow` 一个做法);
6
+ * - 切换、删除都要再确认一次,确认卡浮在按钮旁边;编辑说明就在这一行原地换成输入框。
7
+ *
8
+ * @module @xiaoso/dsh-workflow-lite/client/ui/VersionRow
9
+ */
10
+ import type { VersionEntry } from '../../shared/types.ts';
11
+ import type { Versions } from '../app/useVersions.ts';
12
+ import type { T } from '../i18n.ts';
13
+ export declare function VersionRow(props: {
14
+ t: T;
15
+ entry: VersionEntry;
16
+ versions: Versions;
17
+ /** 和现在内容一样的那个版本号(切换的确认卡据此说"切回来不丢")。 */
18
+ currentN: number | null;
19
+ }): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * dsh-workflow-lite — 编辑页的「版本」对话框:正开着的这张工作流的版本(内容见 {@link VersionList})。
3
+ *
4
+ * 动手之前先把还没写下去的改动存掉(版本存的是磁盘上那份);切换写回之后按磁盘重新加载画布。
5
+ *
6
+ * @module @xiaoso/dsh-workflow-lite/client/ui/VersionsDialog
7
+ */
8
+ import type { T } from '../i18n.ts';
9
+ import type { WorkflowLiteRpc } from '../rpc.ts';
10
+ export declare function VersionsDialog(props: {
11
+ t: T;
12
+ rpc: WorkflowLiteRpc;
13
+ name: string;
14
+ flush(): Promise<boolean>;
15
+ onRestored(): void;
16
+ onChanged(): void;
17
+ onClose(): void;
18
+ }): React.JSX.Element;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * dsh-workflow-lite — 工作流下拉里的一行:点名字打开;改名、删除就在这一行上,不用先切过去。
3
+ *
4
+ * - 「改名 / 删除」两个小按钮平时藏着,悬停或键盘移到这一行时浮在右端,和步骤数换着显示
5
+ * (同一个位置淡入淡出,名字不挪);触屏没有悬停,一直显示。
6
+ * - 改名在原行换成输入框,高度不变:回车或点开确认,Esc 取消。
7
+ * - 删除的确认卡挂在这一行的删除按钮上(由下拉统一管,见 `WorkflowSwitcher`)。
8
+ *
9
+ * @module @xiaoso/dsh-workflow-lite/client/ui/WorkflowRow
10
+ */
11
+ import type { WorkflowEntry } from '../../shared/types.ts';
12
+ import type { T } from '../i18n.ts';
13
+ export interface WorkflowRowProps {
14
+ t: T;
15
+ entry: WorkflowEntry;
16
+ /** 正开着的这张。 */
17
+ active: boolean;
18
+ editing: boolean;
19
+ /** 这一行的确认卡开着:按钮保持显示。 */
20
+ busy: boolean;
21
+ /** 删除按钮的 ref:确认卡挂在它上面(只有确认卡指着这一行时才给)。 */
22
+ deleteRef: React.RefObject<HTMLButtonElement> | undefined;
23
+ onOpen(): void;
24
+ onEdit(): void;
25
+ /** 提交新名字;回 `false` = 名字不行,留在输入框里。 */
26
+ onRename(value: string): Promise<boolean>;
27
+ onCancelEdit(): void;
28
+ onDelete(): void;
29
+ }
30
+ export declare function WorkflowRow(props: WorkflowRowProps): React.JSX.Element;
31
+ /** 删除确认卡上补的那句:正开着的要说编辑页会空出来,有版本的要说版本一起没。 */
32
+ export declare function deleteDesc(t: T, entry: WorkflowEntry, open: boolean): string;