@michengai/dsh-automation 1.0.4 → 1.0.5
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 +32 -0
- package/CHANGELOG.zh-CN.md +32 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/lib/client.js +38 -60
- package/lib/client.js.map +3 -3
- package/lib/index.js +1 -2
- package/lib/types/client/ScheduleRail.d.ts +12 -9
- package/lib/types/client/create-task-request.d.ts +9 -0
- package/lib/types/client/helpers.d.ts +1 -10
- package/lib/types/client/host-icon-markup.d.ts +3 -0
- package/lib/types/client/host-icon-resolve.d.ts +2 -4
- package/lib/types/client/host-icons.d.ts +19 -26
- package/lib/types/client/icons.d.ts +0 -18
- package/lib/types/client/locales.d.ts +4 -90
- package/lib/types/client/native-tabs.d.ts +24 -0
- package/lib/types/client/protocol.d.ts +0 -3
- package/lib/types/client/records-view-store.d.ts +32 -0
- package/lib/types/client/schedule-overview.d.ts +2 -1
- package/lib/types/client/schedule-rail-model.d.ts +54 -52
- package/lib/types/client/settings-nav-icon.d.ts +3 -3
- package/lib/types/client/workspace-menu.d.ts +38 -0
- package/lib/types/domain.d.ts +0 -1
- package/lib/types/executor.d.ts +7 -6
- package/package.json +2 -1
- package/lib/types/client/native-group-actions.d.ts +0 -30
- package/lib/types/client/native-session-list.d.ts +0 -31
- package/lib/types/client/native-session-menu.d.ts +0 -49
- package/lib/types/client/workspace-toolbar-metrics.d.ts +0 -2
- package/lib/types/client/workspace-toolbar.d.ts +0 -15
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 官方工作区 … 菜单没有 slot,只有写死的「重命名 / 删除工作区」。
|
|
3
|
+
* 记录视图的合成任务组需要「任务设置」,因此像归档插件一样监听菜单节点并注入。
|
|
4
|
+
* 真实工作区不处理;只为合成任务组提供任务设置入口。
|
|
5
|
+
*/
|
|
6
|
+
export interface WorkspaceTaskSettingsTarget {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly sessionIds: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export interface TaskSettingsMenuInjectorOptions {
|
|
12
|
+
/** 菜单打开时才取文案,避免插件 apply 阶段语言尚未就绪时固化英文。 */
|
|
13
|
+
readonly label: string | (() => string);
|
|
14
|
+
readonly resolveTask: (workspaceId: string) => WorkspaceTaskSettingsTarget | undefined;
|
|
15
|
+
readonly openTaskSettings: (request: {
|
|
16
|
+
automationId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
sessionIds: string[];
|
|
19
|
+
}) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 安装工作区菜单注入器。
|
|
23
|
+
* @param options 菜单文案、分组解析和打开任务设置的回调。
|
|
24
|
+
* @returns 卸载函数。
|
|
25
|
+
*/
|
|
26
|
+
export declare function installTaskSettingsMenuInjector(options: TaskSettingsMenuInjectorOptions): () => void;
|
|
27
|
+
export interface TaskGroupOptionOptions {
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly groupLabel: string;
|
|
30
|
+
readonly workspaceLabel: string;
|
|
31
|
+
readonly checked: boolean;
|
|
32
|
+
readonly onSelect: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 在官方视图选项菜单里注入第四个分组选项「按任务」。
|
|
36
|
+
* 官方菜单只有工作区/工作区树/平铺,没有新增模式的 slot,因此用 DOM 注入。
|
|
37
|
+
*/
|
|
38
|
+
export declare function installTaskGroupOption(options: TaskGroupOptionOptions): () => void;
|
package/lib/types/domain.d.ts
CHANGED
|
@@ -58,7 +58,6 @@ export declare const automationDomainSpec: {
|
|
|
58
58
|
export declare function createDefinition(input: CreateAutomationInput): AutomationDefinition;
|
|
59
59
|
export declare function updateDefinition(current: AutomationDefinition, input: UpdateAutomationInput): AutomationDefinition;
|
|
60
60
|
export declare function pauseDefinition(current: AutomationDefinition, now: string): AutomationDefinition;
|
|
61
|
-
export declare function resumeDefinition(current: AutomationDefinition, now: string): AutomationDefinition;
|
|
62
61
|
export declare function deleteDefinition(current: AutomationDefinition): DeleteAutomationPlan;
|
|
63
62
|
export declare function occurrenceKey(automationId: string, definitionRevision: number, scheduledFor: string): string;
|
|
64
63
|
export declare function runIdForOccurrence(key: string): string;
|
package/lib/types/executor.d.ts
CHANGED
|
@@ -8,8 +8,7 @@ export interface SessionEventLike {
|
|
|
8
8
|
readonly data: Record<string, any>;
|
|
9
9
|
}
|
|
10
10
|
interface SessionEventReader {
|
|
11
|
-
|
|
12
|
-
snapshotEvents?(): readonly SessionEventLike[];
|
|
11
|
+
snapshotEvents(): readonly SessionEventLike[];
|
|
13
12
|
}
|
|
14
13
|
export interface SessionOwnershipHintObject extends SessionEventReader {
|
|
15
14
|
deriveMessages?(): readonly {
|
|
@@ -49,12 +48,14 @@ export declare function readSessionEvents(session: SessionEventReader): readonly
|
|
|
49
48
|
export declare function watchSessionEvents(ctx: {
|
|
50
49
|
on?(name: string, listener: (...args: any[]) => void): () => void;
|
|
51
50
|
}, session: unknown, fromSeq: number): SessionEventWatch;
|
|
52
|
-
/**
|
|
53
|
-
export
|
|
54
|
-
export declare function summarizeRun(events: readonly SessionEventLike[], firstSeq: number): {
|
|
51
|
+
/** 一次执行的可读结论:正文加上终止原因。 */
|
|
52
|
+
export interface RunSummary {
|
|
55
53
|
readonly text: string;
|
|
56
54
|
readonly reason?: Record<string, any>;
|
|
57
|
-
}
|
|
55
|
+
}
|
|
56
|
+
/** 增量能产出正文或结束原因时用增量;否则回退同步快照。 */
|
|
57
|
+
export declare function summarizeCollectedRun(live: readonly SessionEventLike[], session: SessionEventReader, firstSeq: number): RunSummary;
|
|
58
|
+
export declare function summarizeRun(events: readonly SessionEventLike[], firstSeq: number): RunSummary;
|
|
58
59
|
export declare function executeAutomationRun(ctx: Context, definition: AutomationDefinition, run: AutomationRun, config: ExecutorConfig): Promise<RunCompletion>;
|
|
59
60
|
export declare function pinAutomationSessionTitle(ctx: Context, session: unknown, title: string): void;
|
|
60
61
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-automation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
"esbuild": "^0.25.0",
|
|
127
127
|
"js-yaml": "4.3.1",
|
|
128
128
|
"react": "^18.3.1",
|
|
129
|
+
"react-dom": "^18.3.1",
|
|
129
130
|
"tsx": "^4.20.0",
|
|
130
131
|
"typescript": "^5.9.0"
|
|
131
132
|
},
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare const ARCHIVE_MANAGER_PLUGIN = "@michengai/dsh-archive-manager";
|
|
2
|
-
export declare function hasArchiveManagerPlugin(root: {
|
|
3
|
-
querySelector(selector: string): unknown;
|
|
4
|
-
} | undefined): boolean;
|
|
5
|
-
export type ScheduledSessionMenuAction = 'rename' | 'fork' | 'archive' | 'unarchive' | 'delete-session';
|
|
6
|
-
export interface ScheduledListHostActions {
|
|
7
|
-
readonly renameSession?: (sessionId: string, title: string) => void | Promise<void>;
|
|
8
|
-
readonly archiveSession?: (sessionId: string) => void | Promise<void>;
|
|
9
|
-
readonly unarchiveSession?: (sessionId: string) => void | Promise<void>;
|
|
10
|
-
readonly deleteSession?: (sessionId: string) => void | Promise<void>;
|
|
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;
|
|
18
|
-
}
|
|
19
|
-
/** 官方 WorkspaceBrowser 会把这四个操作放进列表 props;页签渲染和自绘回退必须抽同一份。 */
|
|
20
|
-
export declare function scheduledListHostActions(props?: Record<string, unknown> | null): ScheduledListHostActions;
|
|
21
|
-
/** 官方任务树本身没有删除;删除项由 archive-manager 补进菜单。没装归档插件时即使宿主传入 deleteSession 也不展示。 */
|
|
22
|
-
export declare function canDeleteScheduledSession(archiveManagerInstalled: boolean, deleteSession?: (sessionId: string) => void | Promise<void>): boolean;
|
|
23
|
-
/** 定时列表不提供置顶。顺序是重命名、分叉、归档或恢复,最后才是删除。 */
|
|
24
|
-
export declare function scheduledSessionMenuActions(state: ScheduledSessionMenuState): readonly ScheduledSessionMenuAction[];
|
|
25
|
-
export declare function scheduledGroupShowsActiveFolder(sessionIds: readonly string[], selectedId: string | null): boolean;
|
|
26
|
-
export declare function scheduledSessionOmitsStatusSlot(flat: boolean, running: boolean): boolean;
|
|
27
|
-
/** 串行归档,避免多个 workspace 状态写入相互覆盖。 */
|
|
28
|
-
export declare function archiveScheduledGroup(sessionIds: readonly string[], archiveSession: (sessionId: string) => void | Promise<void>): Promise<void>;
|
|
29
|
-
/** 串行恢复,避免多个 workspace 状态写入相互覆盖。 */
|
|
30
|
-
export declare function unarchiveScheduledGroup(sessionIds: readonly string[], unarchiveSession: (sessionId: string) => void | Promise<void>): Promise<void>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { SessionSelector, Translate, WorkspaceSelector } from './contracts.js';
|
|
3
|
-
import type { AutomationRuntime } from './runtime.js';
|
|
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
|
-
}
|
|
12
|
-
export declare function NativeScheduleSessionList(props: {
|
|
13
|
-
readonly t: Translate;
|
|
14
|
-
readonly runtime: AutomationRuntime;
|
|
15
|
-
readonly openSession?: (sessionId: string) => void;
|
|
16
|
-
readonly useSessions?: SessionSelector;
|
|
17
|
-
readonly useWorkspaces?: WorkspaceSelector;
|
|
18
|
-
readonly renameSession?: (sessionId: string, title: string) => void | Promise<void>;
|
|
19
|
-
readonly archiveSession?: (sessionId: string) => void | Promise<void>;
|
|
20
|
-
readonly unarchiveSession?: (sessionId: string) => void | Promise<void>;
|
|
21
|
-
readonly deleteSession?: (sessionId: string) => void | Promise<void>;
|
|
22
|
-
readonly forkSession?: (sessionId: string) => void | Promise<void>;
|
|
23
|
-
readonly notifyArchivedNotOpenable?: () => void;
|
|
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;
|
|
30
|
-
}): JSX.Element;
|
|
31
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { Translate } from './contracts.js';
|
|
3
|
-
type SlotRenderer = (name: string, props?: Record<string, unknown>, opts?: {
|
|
4
|
-
readonly hookContext?: unknown;
|
|
5
|
-
readonly only?: string;
|
|
6
|
-
}) => ReactNode;
|
|
7
|
-
/** 宿主 renderSlot 在条目未声明该子插槽时抛 SlotOwnershipError。接住它,避免定时页整页失败。 */
|
|
8
|
-
export declare function renderOwnedSlot(renderSlot: SlotRenderer | undefined, name: string, props?: Record<string, unknown>, opts?: {
|
|
9
|
-
readonly hookContext?: unknown;
|
|
10
|
-
readonly only?: string;
|
|
11
|
-
}): ReactNode;
|
|
12
|
-
export declare function nativeSessionHoverStyle(row: {
|
|
13
|
-
readonly right: number;
|
|
14
|
-
readonly top: number;
|
|
15
|
-
}, card: {
|
|
16
|
-
readonly width: number;
|
|
17
|
-
readonly height: number;
|
|
18
|
-
}, viewport: {
|
|
19
|
-
readonly width: number;
|
|
20
|
-
readonly height: number;
|
|
21
|
-
}): CSSProperties;
|
|
22
|
-
export interface SessionHoverStatus {
|
|
23
|
-
readonly state: 'ongoing' | 'warning' | 'done' | 'idle' | 'archived';
|
|
24
|
-
readonly label: string;
|
|
25
|
-
readonly trailing?: string;
|
|
26
|
-
}
|
|
27
|
-
/** 对齐官方 SessionHoverContent:待处理优先,其次运行和子代理,完成只在未读时出现;已归档不再重复空闲或完成。 */
|
|
28
|
-
export declare function scheduledSessionHoverStatuses(input: {
|
|
29
|
-
readonly running: boolean;
|
|
30
|
-
readonly archived: boolean;
|
|
31
|
-
readonly pendingKind?: string;
|
|
32
|
-
readonly runningSubagentCount?: number;
|
|
33
|
-
readonly completed?: boolean;
|
|
34
|
-
}, t: Translate): SessionHoverStatus[];
|
|
35
|
-
/** 会话标题在悬停时匀速滚到末尾,并交给样式做两端淡出。 */
|
|
36
|
-
export declare function placeSessionTitle(title: HTMLElement, left: number, range: number): void;
|
|
37
|
-
export declare function restSessionTitle(title: HTMLElement): void;
|
|
38
|
-
export declare function startSessionTitleMarquee(title: HTMLElement | null, frame: {
|
|
39
|
-
id: number;
|
|
40
|
-
}): void;
|
|
41
|
-
export declare function stopSessionTitleMarquee(title: HTMLElement | null, frame: {
|
|
42
|
-
id: number;
|
|
43
|
-
}): void;
|
|
44
|
-
/** 行内时间不带「前」,和官方 timeLabel 一样。 */
|
|
45
|
-
export declare function sessionRowTime(value: string, t: Translate, now?: number): string;
|
|
46
|
-
/** 悬停卡用官方 hoverTimeLabel:刚刚保持原样,其余套「前」。 */
|
|
47
|
-
export declare function sessionHoverTime(value: string, t: Translate, now?: number): string;
|
|
48
|
-
export declare function relativeTime(value: string, t: Translate, now?: number): string;
|
|
49
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Translate } from './contracts.js';
|
|
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
|
-
readonly t: Translate;
|
|
7
|
-
readonly query: string;
|
|
8
|
-
readonly sort: WorkspaceListSort;
|
|
9
|
-
readonly groupMode: WorkspaceGroupMode;
|
|
10
|
-
readonly archivedFilter?: ArchivedSessionFilter;
|
|
11
|
-
readonly onQueryChange: (query: string) => void;
|
|
12
|
-
readonly onSortChange: (sort: WorkspaceListSort) => void;
|
|
13
|
-
readonly onGroupModeChange: (mode: WorkspaceGroupMode) => void;
|
|
14
|
-
readonly onArchivedFilterChange?: (filter: ArchivedSessionFilter) => void;
|
|
15
|
-
}): JSX.Element;
|