@michengai/dsh-automation 0.1.45 → 0.1.46
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/CHANGELOG.md +10 -0
- package/CHANGELOG.zh-CN.md +10 -0
- package/NOTICE +32 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/lib/client.js +315 -4870
- package/lib/client.js.map +3 -4
- package/lib/types/client/antd-locale.d.ts +2 -0
- package/lib/types/client/antd-ui.d.ts +42 -0
- package/lib/types/client/contracts.d.ts +3 -1
- package/lib/types/client/create-modal-logic.d.ts +1 -1
- package/lib/types/client/delete-confirmation.d.ts +1 -1
- package/lib/types/client/host-icon-resolve.d.ts +9 -0
- package/lib/types/client/host-icons.d.ts +23 -0
- package/lib/types/client/host-theme.d.ts +4 -0
- package/lib/types/client/icons.d.ts +1 -13
- package/lib/types/client/locales.d.ts +29 -7
- package/lib/types/client/native-group-actions.d.ts +10 -2
- package/lib/types/client/native-session-list.d.ts +16 -0
- package/lib/types/client/native-session-menu.d.ts +17 -0
- package/lib/types/client/plugin-update-model.d.ts +9 -0
- package/lib/types/client/plugin-update-ui.d.ts +2 -9
- package/lib/types/client/schedule-rail-model.d.ts +19 -1
- package/lib/types/client/sort-menu.d.ts +2 -2
- package/lib/types/client/workspace-toolbar-metrics.d.ts +2 -0
- package/lib/types/client/workspace-toolbar.d.ts +6 -4
- package/package.json +20 -16
- package/lib/types/client/dropdown-menu.d.ts +0 -22
- package/lib/types/client/menu.d.ts +0 -54
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Locale } from 'antd/es/locale/index.js';
|
|
2
|
+
import type { ButtonProps } from 'antd/es/button/Button.js';
|
|
3
|
+
import type { CheckboxProps } from 'antd/es/checkbox/Checkbox.js';
|
|
4
|
+
import type { ConfigProviderProps } from 'antd/es/config-provider/index.js';
|
|
5
|
+
import type { DropdownProps } from 'antd/es/dropdown/dropdown.js';
|
|
6
|
+
import type { InputProps } from 'antd/es/input/Input.js';
|
|
7
|
+
import type { TextAreaProps, TextAreaRef } from 'antd/es/input/TextArea.js';
|
|
8
|
+
import type { ModalProps } from 'antd/es/modal/interface.js';
|
|
9
|
+
import type { ProgressProps } from 'antd/es/progress/progress.js';
|
|
10
|
+
import type { SegmentedProps } from 'antd/es/segmented/index.js';
|
|
11
|
+
import type { SelectProps } from 'antd/es/select/index.js';
|
|
12
|
+
import type { SwitchProps } from 'antd/es/switch/index.js';
|
|
13
|
+
import type { TabsProps } from 'antd/es/tabs/index.js';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
export declare const Input: React.ComponentType<InputProps> & {
|
|
16
|
+
TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaRef>>;
|
|
17
|
+
};
|
|
18
|
+
/** 操作按钮默认用中等尺寸和圆角。标题栏和小按钮可以传入 size、shape 覆盖。 */
|
|
19
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export declare const Checkbox: React.ComponentType<CheckboxProps> & {
|
|
21
|
+
Group: React.ComponentType<{
|
|
22
|
+
options: readonly {
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[];
|
|
26
|
+
value: readonly string[];
|
|
27
|
+
onChange: (value: string[]) => void;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
export declare const ConfigProvider: React.ComponentType<ConfigProviderProps>;
|
|
31
|
+
export declare const Dropdown: React.ComponentType<DropdownProps>;
|
|
32
|
+
export declare const Modal: React.ComponentType<ModalProps>;
|
|
33
|
+
export declare const Progress: React.ComponentType<ProgressProps>;
|
|
34
|
+
export declare const Segmented: React.ComponentType<SegmentedProps<import("antd/es/segmented/index.js").SegmentedValue>>;
|
|
35
|
+
export declare const Select: React.ComponentType<SelectProps<any, import("antd/es/select/index.js").DefaultOptionType>>;
|
|
36
|
+
export declare const Switch: React.ComponentType<SwitchProps>;
|
|
37
|
+
export declare const Tabs: React.ComponentType<TabsProps>;
|
|
38
|
+
/** 按钮不插汉字空格,亮暗跟随宿主的 data-ds-dark-theme。 */
|
|
39
|
+
export declare function AntdProvider(props: {
|
|
40
|
+
locale?: Locale;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}): React.ReactElement;
|
|
@@ -75,5 +75,7 @@ export interface NativeSwitcherProps {
|
|
|
75
75
|
readonly open?: (sessionId: string) => void;
|
|
76
76
|
readonly useSessions?: SessionSelector;
|
|
77
77
|
readonly useWorkspaces?: WorkspaceSelector;
|
|
78
|
-
readonly renderSlot?: (name: string, props?: Record<string, unknown
|
|
78
|
+
readonly renderSlot?: (name: string, props?: Record<string, unknown>, opts?: {
|
|
79
|
+
readonly hookContext?: unknown;
|
|
80
|
+
}) => ReactNode;
|
|
79
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AutomationPermission } from './protocol.js';
|
|
2
|
-
/**
|
|
2
|
+
/** 新建/编辑弹窗点遮罩不关。Esc 只关这一层弹窗,不能继续冒泡把设置页关掉。 */
|
|
3
3
|
export declare function shouldCloseCreateModal(reason: 'backdrop' | 'escape' | 'cancel'): boolean;
|
|
4
4
|
/** 与 Chat 一致:从其他权限切换到完全访问时显示风险确认。 */
|
|
5
5
|
export declare function shouldConfirmFullAccess(current: AutomationPermission, next: AutomationPermission): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type HostIcon = (props: {
|
|
2
|
+
readonly size?: number;
|
|
3
|
+
readonly className?: string;
|
|
4
|
+
}) => JSX.Element | null;
|
|
5
|
+
/** 0.1.7 把尺寸从组件名里拿掉了。旧宿主仍导出带尺寸的名字,缺哪个就用另一个。没有对应导出时返回 undefined,调用方再退回自绘。 */
|
|
6
|
+
export declare function pickHostExport(source: Readonly<Record<string, unknown>>, name: string): unknown;
|
|
7
|
+
/** 宿主图标渲染出 null 时改用自绘。 */
|
|
8
|
+
export declare function hostOrFallback(icon: HostIcon, fallback: HostIcon): HostIcon;
|
|
9
|
+
export declare function pickHostIcon(source: Readonly<Record<string, unknown>>, ...names: readonly string[]): HostIcon;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { pickHostIcon, type HostIcon } from './host-icon-resolve.js';
|
|
2
|
+
export type { HostIcon };
|
|
3
|
+
export { pickHostIcon };
|
|
4
|
+
export declare const IconEllipsisOutline: HostIcon;
|
|
5
|
+
export declare const IconSettingsOutline: HostIcon;
|
|
6
|
+
export declare const IconArchiveOutline: HostIcon;
|
|
7
|
+
export declare const IconBranchOutline: HostIcon;
|
|
8
|
+
export declare const IconEditOutline: HostIcon;
|
|
9
|
+
export declare const IconTrashOutline: HostIcon;
|
|
10
|
+
export declare const IconCheckOutline: HostIcon;
|
|
11
|
+
export declare const IconChevronDownOutline: HostIcon;
|
|
12
|
+
export declare const IconListPenOutline: HostIcon;
|
|
13
|
+
export declare const IconSearchOutline: HostIcon;
|
|
14
|
+
export declare const IconCloseFill: HostIcon;
|
|
15
|
+
export declare const IconSlidersTwoOutline: HostIcon;
|
|
16
|
+
export declare const IconFolderClose: HostIcon;
|
|
17
|
+
export declare const IconWorkspaceTreeOutline: HostIcon;
|
|
18
|
+
export declare const IconFlatListOutline: HostIcon;
|
|
19
|
+
export declare const IconChevronsUpDownOutline: HostIcon;
|
|
20
|
+
export declare const IconClockOutline: HostIcon;
|
|
21
|
+
export declare const IconArchiveCheckOutline: HostIcon;
|
|
22
|
+
/** 0.1.7 的 Menu 会渲染 children。同一版才出现不带尺寸的图标名,旧 Menu 只认 items。 */
|
|
23
|
+
export declare function hostMenuRendersChildren(): boolean;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
2
|
type IconProps = SVGProps<SVGSVGElement>;
|
|
3
|
-
export declare function AutomationIcon(props: IconProps): JSX.Element;
|
|
4
3
|
export declare function PlusIcon(props: IconProps): JSX.Element;
|
|
5
4
|
export declare function RefreshIcon(props: IconProps): JSX.Element;
|
|
6
|
-
export declare function PlayIcon(props: IconProps): JSX.Element;
|
|
7
|
-
export declare function PauseIcon(props: IconProps): JSX.Element;
|
|
8
|
-
export declare function TrashIcon(props: IconProps): JSX.Element;
|
|
9
5
|
export declare function ShieldIcon(props: IconProps): JSX.Element;
|
|
10
6
|
export declare function CalendarIcon(props: IconProps): JSX.Element;
|
|
11
|
-
export declare function CheckIcon(props: IconProps): JSX.Element;
|
|
12
|
-
export declare function AlertIcon(props: IconProps): JSX.Element;
|
|
13
7
|
export declare function MoreIcon(props: IconProps): JSX.Element;
|
|
14
8
|
export declare function InfoIcon(props: IconProps): JSX.Element;
|
|
15
9
|
export declare function ClockIcon(props: IconProps): JSX.Element;
|
|
@@ -17,16 +11,10 @@ export declare function ChatIcon(props: IconProps): JSX.Element;
|
|
|
17
11
|
export declare function GithubIcon(props: IconProps): JSX.Element;
|
|
18
12
|
export declare function FolderIcon(props: IconProps): JSX.Element;
|
|
19
13
|
export declare function SparkleIcon(props: IconProps): JSX.Element;
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function CheckOutlineIcon(props: IconProps): JSX.Element;
|
|
22
|
-
export declare function SearchOutlineIcon(props: IconProps): JSX.Element;
|
|
23
|
-
export declare function SlidersIcon(props: IconProps): JSX.Element;
|
|
14
|
+
export declare function UnarchiveOutlineIcon(props: IconProps): JSX.Element;
|
|
24
15
|
export declare function FolderClosedIcon(props: IconProps): JSX.Element;
|
|
25
16
|
export declare function FolderOpenIcon(props: IconProps): JSX.Element;
|
|
26
|
-
export declare function PlayOutlineIcon(props: IconProps): JSX.Element;
|
|
27
|
-
export declare function TreeCornerIcon(props: IconProps): JSX.Element;
|
|
28
17
|
export declare function ChevronIcon(props: IconProps): JSX.Element;
|
|
29
|
-
export declare function PencilIcon(props: IconProps): JSX.Element;
|
|
30
18
|
/** 复刻官方任务树 running StateDot:3x3 像素绕圈。 */
|
|
31
19
|
export declare function RunningStateDot(): JSX.Element;
|
|
32
20
|
export {};
|
|
@@ -13,15 +13,20 @@ export declare const en: {
|
|
|
13
13
|
readonly "sidebar.section": "Scheduled";
|
|
14
14
|
readonly "sidebar.workspaces": "Workspaces";
|
|
15
15
|
readonly "sidebar.search": "Search";
|
|
16
|
-
readonly "sidebar.
|
|
16
|
+
readonly "sidebar.sessions": "Sessions";
|
|
17
|
+
readonly "sidebar.searchSessions": "Search session names";
|
|
17
18
|
readonly "sidebar.clearSearch": "Clear search";
|
|
18
|
-
readonly "sidebar.filter": "
|
|
19
|
+
readonly "sidebar.filter": "View options";
|
|
19
20
|
readonly "sidebar.groupBy": "Group by";
|
|
20
|
-
readonly "sidebar.groupWorkspace": "
|
|
21
|
-
readonly "sidebar.
|
|
22
|
-
readonly "sidebar.
|
|
21
|
+
readonly "sidebar.groupWorkspace": "WorkSpace";
|
|
22
|
+
readonly "sidebar.groupWorkspaceTree": "Workspace Tree";
|
|
23
|
+
readonly "sidebar.groupList": "In one list";
|
|
24
|
+
readonly "sidebar.sortBy": "Order by";
|
|
23
25
|
readonly "sidebar.sortManual": "Manual";
|
|
24
|
-
readonly "sidebar.sortTime": "
|
|
26
|
+
readonly "sidebar.sortTime": "Last updated";
|
|
27
|
+
readonly "sidebar.filterBy": "Filter sessions";
|
|
28
|
+
readonly "sidebar.showArchived": "Show archived";
|
|
29
|
+
readonly "sidebar.onlyArchived": "Archived only";
|
|
25
30
|
readonly "header.lead": "Plan automatic tasks, or trigger them by hand. Describe the recurring work in any chat to create it quickly.";
|
|
26
31
|
readonly "header.githubProject": "GitHub";
|
|
27
32
|
readonly "header.githubFeedback": "Issues";
|
|
@@ -43,12 +48,13 @@ export declare const en: {
|
|
|
43
48
|
readonly "session.rename": "Rename";
|
|
44
49
|
readonly "session.fork": "Fork session";
|
|
45
50
|
readonly "session.archive": "Archive session";
|
|
51
|
+
readonly "session.unarchive": "Restore";
|
|
46
52
|
readonly "session.moreActions": "More actions for {title}";
|
|
47
53
|
readonly "session.groupActions": "Actions for {name}";
|
|
48
54
|
readonly "session.taskSettings": "Task settings";
|
|
49
55
|
readonly "session.archiveGroup": "Archive all conversations";
|
|
50
56
|
readonly "session.archiveGroupConfirm": "Archive all";
|
|
51
|
-
readonly "session.archiveGroupDescription": "Archive all {count} conversations for “{name}”.
|
|
57
|
+
readonly "session.archiveGroupDescription": "Archive all {count} conversations for “{name}”. Choose Filter → Show archived to restore them.";
|
|
52
58
|
readonly "session.archiveGroupPending": "Archiving conversations…";
|
|
53
59
|
readonly "session.archiveGroupFailed": "Some conversations could not be archived: {message}";
|
|
54
60
|
readonly "session.archiveGroupClose": "Close";
|
|
@@ -62,6 +68,12 @@ export declare const en: {
|
|
|
62
68
|
readonly "session.deleteSessionCancel": "Cancel";
|
|
63
69
|
readonly "session.idle": "Idle";
|
|
64
70
|
readonly "session.runningStatus": "Running";
|
|
71
|
+
readonly "session.completed": "Completed";
|
|
72
|
+
readonly "session.waitingApproval": "Waiting for approval";
|
|
73
|
+
readonly "session.planReview": "Plan to review";
|
|
74
|
+
readonly "session.waitingAnswer": "Waiting for an answer";
|
|
75
|
+
readonly "session.subagentsRunning": "{count} subagents running";
|
|
76
|
+
readonly "session.archived": "Archived";
|
|
65
77
|
readonly "session.delete": "Remove from Scheduled";
|
|
66
78
|
readonly "session.deleteFolder": "Remove folder";
|
|
67
79
|
readonly "session.confirmDeleteFolder": "Remove this folder from Scheduled?";
|
|
@@ -92,6 +104,7 @@ export declare const en: {
|
|
|
92
104
|
readonly "sort.created.desc": "Created time descending";
|
|
93
105
|
readonly "sort.planned.asc": "Planned time ascending";
|
|
94
106
|
readonly "sort.planned.desc": "Planned time descending";
|
|
107
|
+
readonly "sort.default.save": "Set as default";
|
|
95
108
|
readonly "sort.default.saved": "Default";
|
|
96
109
|
readonly "form.workspace": "Workspace";
|
|
97
110
|
readonly "form.workspacePath": "Folder path";
|
|
@@ -216,7 +229,16 @@ export declare const en: {
|
|
|
216
229
|
readonly "error.action": "The action failed. Please try again.";
|
|
217
230
|
readonly "error.taskMissing": "This scheduled task no longer exists.";
|
|
218
231
|
readonly "error.offline": "Could not reach the local automation service. Check that DSH is still running and try again.";
|
|
232
|
+
readonly "time.minutes": "{count}m";
|
|
233
|
+
readonly "time.hours": "{count}h";
|
|
234
|
+
readonly "time.days": "{count}d";
|
|
235
|
+
readonly "time.ago": "{text} ago";
|
|
219
236
|
readonly "time.now": "now";
|
|
237
|
+
readonly "session.copy": "Copy";
|
|
238
|
+
readonly "session.copied": "Copied";
|
|
239
|
+
readonly "session.compactApproval": "Approval";
|
|
240
|
+
readonly "session.compactPlan": "Plan review";
|
|
241
|
+
readonly "session.compactAnswer": "Answer";
|
|
220
242
|
readonly "time.minuteAgo": "{count}m ago";
|
|
221
243
|
readonly "time.hourAgo": "{count}h ago";
|
|
222
244
|
readonly "time.dayAgo": "{count}d ago";
|
|
@@ -2,18 +2,26 @@ export declare const ARCHIVE_MANAGER_PLUGIN = "@michengai/dsh-archive-manager";
|
|
|
2
2
|
export declare function hasArchiveManagerPlugin(root: {
|
|
3
3
|
querySelector(selector: string): unknown;
|
|
4
4
|
} | undefined): boolean;
|
|
5
|
-
export type ScheduledSessionMenuAction = 'rename' | 'fork' | 'archive' | 'delete-session';
|
|
5
|
+
export type ScheduledSessionMenuAction = 'rename' | 'fork' | 'archive' | 'unarchive' | 'delete-session';
|
|
6
6
|
export interface ScheduledListHostActions {
|
|
7
7
|
readonly renameSession?: (sessionId: string, title: string) => void | Promise<void>;
|
|
8
8
|
readonly archiveSession?: (sessionId: string) => void | Promise<void>;
|
|
9
|
+
readonly unarchiveSession?: (sessionId: string) => void | Promise<void>;
|
|
9
10
|
readonly deleteSession?: (sessionId: string) => void | Promise<void>;
|
|
10
11
|
readonly forkSession?: (sessionId: string) => void | Promise<void>;
|
|
12
|
+
readonly notifyArchivedNotOpenable?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface ScheduledSessionMenuState {
|
|
15
|
+
readonly canDelete: boolean;
|
|
16
|
+
readonly archived: boolean;
|
|
17
|
+
readonly canUnarchive: boolean;
|
|
11
18
|
}
|
|
12
19
|
/** 官方 WorkspaceBrowser 会把这四个操作放进列表 props;页签渲染和自绘回退必须抽同一份。 */
|
|
13
20
|
export declare function scheduledListHostActions(props?: Record<string, unknown> | null): ScheduledListHostActions;
|
|
14
21
|
/** 官方任务树本身没有删除;删除项由 archive-manager 补进菜单。没装归档插件时即使宿主传入 deleteSession 也不展示。 */
|
|
15
22
|
export declare function canDeleteScheduledSession(archiveManagerInstalled: boolean, deleteSession?: (sessionId: string) => void | Promise<void>): boolean;
|
|
16
|
-
|
|
23
|
+
/** 定时列表不提供置顶。顺序是重命名、分叉、归档或恢复,最后才是删除。 */
|
|
24
|
+
export declare function scheduledSessionMenuActions(state: ScheduledSessionMenuState): readonly ScheduledSessionMenuAction[];
|
|
17
25
|
export declare function scheduledGroupShowsActiveFolder(sessionIds: readonly string[], selectedId: string | null): boolean;
|
|
18
26
|
export declare function scheduledSessionOmitsStatusSlot(flat: boolean, running: boolean): boolean;
|
|
19
27
|
/** 串行归档,避免多个 workspace 状态写入相互覆盖。 */
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
import type { SessionSelector, Translate, WorkspaceSelector } from './contracts.js';
|
|
2
3
|
import type { AutomationRuntime } from './runtime.js';
|
|
3
4
|
import type { AutomationTaskSettingsRequest } from './task-settings-request.js';
|
|
5
|
+
interface SessionStatusLike {
|
|
6
|
+
readonly running?: boolean;
|
|
7
|
+
readonly completionUnread?: boolean;
|
|
8
|
+
readonly pendingInteraction?: {
|
|
9
|
+
readonly kind?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
4
12
|
export declare function NativeScheduleSessionList(props: {
|
|
5
13
|
readonly t: Translate;
|
|
6
14
|
readonly runtime: AutomationRuntime;
|
|
@@ -9,7 +17,15 @@ export declare function NativeScheduleSessionList(props: {
|
|
|
9
17
|
readonly useWorkspaces?: WorkspaceSelector;
|
|
10
18
|
readonly renameSession?: (sessionId: string, title: string) => void | Promise<void>;
|
|
11
19
|
readonly archiveSession?: (sessionId: string) => void | Promise<void>;
|
|
20
|
+
readonly unarchiveSession?: (sessionId: string) => void | Promise<void>;
|
|
12
21
|
readonly deleteSession?: (sessionId: string) => void | Promise<void>;
|
|
13
22
|
readonly forkSession?: (sessionId: string) => void | Promise<void>;
|
|
23
|
+
readonly notifyArchivedNotOpenable?: () => void;
|
|
14
24
|
readonly openTaskSettings?: (request: AutomationTaskSettingsRequest) => void;
|
|
25
|
+
readonly renderSlot?: (name: string, props?: Record<string, unknown>, opts?: {
|
|
26
|
+
readonly hookContext?: unknown;
|
|
27
|
+
readonly only?: string;
|
|
28
|
+
}) => ReactNode;
|
|
29
|
+
readonly useSessionStatus?: <T>(selector: (state: ReadonlyMap<string, SessionStatusLike>) => T) => T;
|
|
15
30
|
}): JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -10,4 +10,21 @@ export declare function nativeSessionHoverStyle(row: {
|
|
|
10
10
|
readonly width: number;
|
|
11
11
|
readonly height: number;
|
|
12
12
|
}): CSSProperties;
|
|
13
|
+
export interface SessionHoverStatus {
|
|
14
|
+
readonly state: 'ongoing' | 'warning' | 'done' | 'idle' | 'archived';
|
|
15
|
+
readonly label: string;
|
|
16
|
+
readonly trailing?: string;
|
|
17
|
+
}
|
|
18
|
+
/** 对齐官方 SessionHoverContent:待处理优先,其次运行和子代理,完成只在未读时出现;已归档不再重复空闲或完成。 */
|
|
19
|
+
export declare function scheduledSessionHoverStatuses(input: {
|
|
20
|
+
readonly running: boolean;
|
|
21
|
+
readonly archived: boolean;
|
|
22
|
+
readonly pendingKind?: string;
|
|
23
|
+
readonly runningSubagentCount?: number;
|
|
24
|
+
readonly completed?: boolean;
|
|
25
|
+
}, t: Translate): SessionHoverStatus[];
|
|
26
|
+
/** 行内时间不带「前」,和官方 timeLabel 一样。 */
|
|
27
|
+
export declare function sessionRowTime(value: string, t: Translate, now?: number): string;
|
|
28
|
+
/** 悬停卡用官方 hoverTimeLabel:刚刚保持原样,其余套「前」。 */
|
|
29
|
+
export declare function sessionHoverTime(value: string, t: Translate, now?: number): string;
|
|
13
30
|
export declare function relativeTime(value: string, t: Translate, now?: number): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function manualPluginUpdateCommand(profileName: string, packageName: string, version: string): string;
|
|
2
|
+
interface PluginUpdateEscapeEvent {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
preventDefault(): void;
|
|
5
|
+
stopPropagation(): void;
|
|
6
|
+
stopImmediatePropagation(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function handlePluginUpdateEscape(event: PluginUpdateEscapeEvent, close: () => void): boolean;
|
|
9
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { handlePluginUpdateEscape, manualPluginUpdateCommand } from './plugin-update-model.js';
|
|
2
|
+
export { handlePluginUpdateEscape, manualPluginUpdateCommand };
|
|
1
3
|
export type PluginUpdateUiOptions = {
|
|
2
4
|
readonly endpoint: string;
|
|
3
5
|
readonly packageName: string;
|
|
@@ -8,13 +10,4 @@ export type PluginUpdateUiOptions = {
|
|
|
8
10
|
readonly createIcon: (name: PluginUpdateIconName) => HTMLElement;
|
|
9
11
|
};
|
|
10
12
|
export type PluginUpdateIconName = 'refresh' | 'download' | 'copy' | 'close';
|
|
11
|
-
export declare function manualPluginUpdateCommand(profileName: string, packageName: string, version: string): string;
|
|
12
|
-
interface PluginUpdateEscapeEvent {
|
|
13
|
-
readonly key: string;
|
|
14
|
-
preventDefault(): void;
|
|
15
|
-
stopPropagation(): void;
|
|
16
|
-
stopImmediatePropagation(): void;
|
|
17
|
-
}
|
|
18
|
-
export declare function handlePluginUpdateEscape(event: PluginUpdateEscapeEvent, close: () => void): boolean;
|
|
19
13
|
export declare function observePluginUpdate(options: PluginUpdateUiOptions): () => void;
|
|
20
|
-
export {};
|
|
@@ -64,6 +64,9 @@ export interface TaskOverviewRow {
|
|
|
64
64
|
export declare function automationToggleMutation(status: AutomationStatus): 'pause' | 'resume';
|
|
65
65
|
/** 任务总览只由任务定义生成,不依赖执行记录或会话是否已经创建。 */
|
|
66
66
|
export declare function deriveTaskOverviewRows(automations: readonly OverviewAutomationLike[]): TaskOverviewRow[];
|
|
67
|
+
export type ArchivedSessionFilter = 'default' | 'show' | 'only';
|
|
68
|
+
/** 默认隐藏已归档;显示和仅归档跟官方筛选同一套规则。空 id 一律不展示。 */
|
|
69
|
+
export declare function scheduledSessionVisible(sessionId: string | undefined, archived: ReadonlySet<string>, filter: ArchivedSessionFilter): boolean;
|
|
67
70
|
/** 归档立即摘掉。宿主会话簿经常晚于自动化快照,缺席不能当成已删除。 */
|
|
68
71
|
export declare function keepScheduledSessionLink(sessionId: string | undefined, archived: ReadonlySet<string>, _presentIds?: ReadonlySet<string>): boolean;
|
|
69
72
|
/** 当前打开的是定时会话,但快照还没有这条执行记录时,侧栏应立刻再拉一次。 */
|
|
@@ -158,7 +161,20 @@ export declare function isMarkedWorkspaceWrapper(component: unknown): boolean;
|
|
|
158
161
|
export declare function resolveOfficialTreeComponent(component: unknown): unknown;
|
|
159
162
|
export declare function isAutomationWorkspaceWrapper(item: unknown): boolean;
|
|
160
163
|
export declare function pickWrappableWorkspacesEntry(entries: readonly unknown[]): unknown;
|
|
161
|
-
export type WorkspaceGroupMode = 'workspace' | 'list';
|
|
164
|
+
export type WorkspaceGroupMode = 'workspace' | 'workspace-tree' | 'list';
|
|
165
|
+
/** 官方按工作区树:子目录挂到路径最长的已打开工作区下面。 */
|
|
166
|
+
export declare function owningParentFolder(path: string, candidates: readonly string[]): string | undefined;
|
|
167
|
+
export interface WorkspaceTreeGroup<T> {
|
|
168
|
+
readonly id: string;
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly depth: number;
|
|
171
|
+
readonly keep?: boolean;
|
|
172
|
+
readonly sessions: readonly T[];
|
|
173
|
+
}
|
|
174
|
+
/** 定时会话按宿主工作区归组,工作区路径嵌套时缩进。没有工作区的会话进未分组。 */
|
|
175
|
+
export declare function groupScheduledSessionsByWorkspaceTree<T extends {
|
|
176
|
+
readonly id?: string;
|
|
177
|
+
}>(sessions: readonly T[], workspaces: readonly NativeWorkspaceLike[], ungroupedLabel: string): WorkspaceTreeGroup<T>[];
|
|
162
178
|
export type WorkspaceListSort = 'manual' | 'time';
|
|
163
179
|
export interface SearchableRailGroup {
|
|
164
180
|
readonly name: string;
|
|
@@ -167,5 +183,7 @@ export interface SearchableRailGroup {
|
|
|
167
183
|
readonly label?: string;
|
|
168
184
|
readonly updatedAt?: string;
|
|
169
185
|
}[];
|
|
186
|
+
/** 按工作区树时,没有自己的会话、只用来托住子工作区的父级也要留着。 */
|
|
187
|
+
readonly keep?: boolean;
|
|
170
188
|
}
|
|
171
189
|
export declare function applyWorkspaceBrowserQuery<T extends SearchableRailGroup>(groups: readonly T[], query: string, sort: WorkspaceListSort, groupMode?: WorkspaceGroupMode): T[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Translate } from './contracts.js';
|
|
2
2
|
import { type AutomationSortDirection, type AutomationSortKey, type SortPreferenceStorage } from './helpers.js';
|
|
3
|
-
/**
|
|
4
|
-
export declare function SortMenu({ t, storage, storageKey, sortKey, sortDirection, onSelect,
|
|
3
|
+
/** 设置页与侧栏总览共用的排序菜单。当前项可以存成默认。 */
|
|
4
|
+
export declare function SortMenu({ t, storage, storageKey, sortKey, sortDirection, onSelect, iconOnly, className, }: {
|
|
5
5
|
readonly t: Translate;
|
|
6
6
|
readonly storage?: SortPreferenceStorage;
|
|
7
7
|
readonly storageKey: string;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Translate } from './contracts.js';
|
|
2
|
-
import type { WorkspaceGroupMode, WorkspaceListSort } from './schedule-rail-model.js';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export declare function WorkspaceToolbar({ t, query, sort, groupMode, onQueryChange, onSortChange, onGroupModeChange, }: {
|
|
2
|
+
import type { ArchivedSessionFilter, WorkspaceGroupMode, WorkspaceListSort } from './schedule-rail-model.js';
|
|
3
|
+
import { officialSearchIconSize } from './workspace-toolbar-metrics.js';
|
|
4
|
+
export { officialSearchIconSize };
|
|
5
|
+
export declare function WorkspaceToolbar({ t, query, sort, groupMode, archivedFilter, onQueryChange, onSortChange, onGroupModeChange, onArchivedFilterChange, }: {
|
|
6
6
|
readonly t: Translate;
|
|
7
7
|
readonly query: string;
|
|
8
8
|
readonly sort: WorkspaceListSort;
|
|
9
9
|
readonly groupMode: WorkspaceGroupMode;
|
|
10
|
+
readonly archivedFilter?: ArchivedSessionFilter;
|
|
10
11
|
readonly onQueryChange: (query: string) => void;
|
|
11
12
|
readonly onSortChange: (sort: WorkspaceListSort) => void;
|
|
12
13
|
readonly onGroupModeChange: (mode: WorkspaceGroupMode) => void;
|
|
14
|
+
readonly onArchivedFilterChange?: (filter: ArchivedSessionFilter) => void;
|
|
13
15
|
}): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-automation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "DSH Automation — 在独立 DSH Session 中按计划执行和管理编码任务 · Schedule and manage coding tasks in isolated DSH sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|
|
@@ -66,31 +66,35 @@
|
|
|
66
66
|
"test:matrix": "pnpm build && node scripts/test-version-matrix.mjs"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
+
"antd": "^6.6.5",
|
|
69
70
|
"luxon": "^3.7.2",
|
|
70
71
|
"zod": "^4.1.5"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
74
|
"@deepseek-ai/cordis": ">=4.0.1 <5.0.0",
|
|
74
|
-
"@deepseek-ai/dsh-agent": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
75
|
-
"@deepseek-ai/dsh-agent-default-model": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
75
|
+
"@deepseek-ai/dsh-agent": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
76
|
+
"@deepseek-ai/dsh-agent-default-model": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
76
77
|
"@deepseek-ai/dsh-agent-presets": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
77
|
-
"@deepseek-ai/dsh-client-connection": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
78
|
-
"@deepseek-ai/dsh-client-locale": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
81
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
82
|
-
"@deepseek-ai/dsh-host-webserver": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
83
|
-
"@deepseek-ai/dsh-llm": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
84
|
-
"@deepseek-ai/dsh-permission-presets": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
85
|
-
"@deepseek-ai/dsh-session": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
86
|
-
"@deepseek-ai/dsh-storage-domain": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
87
|
-
"@deepseek-ai/dsh-tools": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
88
|
-
"@deepseek-ai/dsh-user-approval": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
89
|
-
"@deepseek-ai/dsh-workspace": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
78
|
+
"@deepseek-ai/dsh-client-connection": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
79
|
+
"@deepseek-ai/dsh-client-locale": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
81
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
82
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
83
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
84
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
85
|
+
"@deepseek-ai/dsh-permission-presets": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
86
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
87
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
88
|
+
"@deepseek-ai/dsh-tools": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
89
|
+
"@deepseek-ai/dsh-user-approval": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
90
|
+
"@deepseek-ai/dsh-workspace": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
90
91
|
"@deepseek-ai/schemastery": ">=3.18.1 <4.0.0",
|
|
91
92
|
"react": "^18.2.0"
|
|
92
93
|
},
|
|
93
94
|
"peerDependenciesMeta": {
|
|
95
|
+
"@deepseek-ai/dsh-agent-presets": {
|
|
96
|
+
"optional": true
|
|
97
|
+
},
|
|
94
98
|
"react": {
|
|
95
99
|
"optional": true
|
|
96
100
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
export interface DropdownMenuOption {
|
|
3
|
-
readonly key: string;
|
|
4
|
-
readonly label: string;
|
|
5
|
-
readonly selected: boolean;
|
|
6
|
-
readonly onSelect: () => void;
|
|
7
|
-
readonly keepOpen?: boolean;
|
|
8
|
-
readonly trailing?: {
|
|
9
|
-
readonly label: string;
|
|
10
|
-
readonly active: boolean;
|
|
11
|
-
readonly onSelect: () => void;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/** 设置页与侧栏共用的紧凑下拉菜单:显示当前选中项,支持点击外部与 Escape 关闭。 */
|
|
15
|
-
export declare function DropdownMenu({ ariaLabel, className, buttonClassName, menuClassName, options, trigger, }: {
|
|
16
|
-
readonly ariaLabel: string;
|
|
17
|
-
readonly className?: string;
|
|
18
|
-
readonly buttonClassName?: string;
|
|
19
|
-
readonly menuClassName?: string;
|
|
20
|
-
readonly options: readonly DropdownMenuOption[];
|
|
21
|
-
readonly trigger?: ReactNode;
|
|
22
|
-
}): JSX.Element;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
-
export interface MenuOption<T extends string> {
|
|
3
|
-
readonly value: T;
|
|
4
|
-
readonly label: string;
|
|
5
|
-
readonly icon?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
declare function useMenuOpen(): {
|
|
8
|
-
readonly open: boolean;
|
|
9
|
-
readonly setOpen: (value: boolean | ((current: boolean) => boolean)) => void;
|
|
10
|
-
readonly root: React.RefObject<HTMLDivElement>;
|
|
11
|
-
readonly menu: React.RefObject<HTMLDivElement>;
|
|
12
|
-
};
|
|
13
|
-
export declare function MenuPopup({ open, anchor, menuRef, up, end, className, ariaLabel, children, onClick, }: {
|
|
14
|
-
readonly open: boolean;
|
|
15
|
-
readonly anchor: RefObject<HTMLElement>;
|
|
16
|
-
readonly menuRef: RefObject<HTMLDivElement>;
|
|
17
|
-
readonly up?: boolean | undefined;
|
|
18
|
-
readonly end?: boolean | undefined;
|
|
19
|
-
readonly className: string;
|
|
20
|
-
readonly ariaLabel?: string;
|
|
21
|
-
readonly children: ReactNode;
|
|
22
|
-
readonly onClick?: () => void;
|
|
23
|
-
}): JSX.Element | null;
|
|
24
|
-
export declare function MenuHostProvider({ host, children, }: {
|
|
25
|
-
readonly host: HTMLElement | null;
|
|
26
|
-
readonly children: ReactNode;
|
|
27
|
-
}): JSX.Element;
|
|
28
|
-
export declare function MenuRow({ icon, label, hint, active, chevron, kv, onClick, }: {
|
|
29
|
-
readonly icon?: ReactNode;
|
|
30
|
-
readonly label: ReactNode;
|
|
31
|
-
readonly hint?: ReactNode;
|
|
32
|
-
readonly active?: boolean;
|
|
33
|
-
readonly chevron?: boolean;
|
|
34
|
-
readonly kv?: boolean;
|
|
35
|
-
readonly onClick: () => void;
|
|
36
|
-
}): JSX.Element;
|
|
37
|
-
export declare function MenuSelect<T extends string>({ value, options, onChange, wide, pill, up, icon, }: {
|
|
38
|
-
readonly value: T;
|
|
39
|
-
readonly options: readonly MenuOption<T>[];
|
|
40
|
-
readonly onChange: (value: T) => void;
|
|
41
|
-
readonly wide?: boolean;
|
|
42
|
-
readonly pill?: boolean;
|
|
43
|
-
readonly up?: boolean;
|
|
44
|
-
readonly icon?: ReactNode;
|
|
45
|
-
}): JSX.Element;
|
|
46
|
-
export declare function MenuPanel({ label, children, ghost, up, persist, }: {
|
|
47
|
-
readonly label: ReactNode;
|
|
48
|
-
readonly children: ReactNode;
|
|
49
|
-
readonly ghost?: boolean;
|
|
50
|
-
readonly up?: boolean;
|
|
51
|
-
readonly persist?: boolean;
|
|
52
|
-
}): JSX.Element;
|
|
53
|
-
export declare function useMenuState(): ReturnType<typeof useMenuOpen>;
|
|
54
|
-
export {};
|