@michengai/dsh-automation 0.1.20 → 0.1.21
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 +9 -0
- package/CHANGELOG.zh-CN.md +9 -0
- package/lib/client.js +19 -8
- package/lib/client.js.map +2 -2
- package/lib/types/client/ScheduleRail.d.ts +1 -12
- package/lib/types/client/contracts.d.ts +5 -2
- package/lib/types/client/locales.d.ts +1 -0
- package/lib/types/client/native-session-list.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
-
import type { Translate } from './contracts.js';
|
|
2
|
+
import type { SessionSelector, Translate, WorkspaceSelector } from './contracts.js';
|
|
3
3
|
import type { AutomationRuntime } from './runtime.js';
|
|
4
|
-
import { type NativeSessionLike, type NativeWorkspaceLike } from './schedule-rail-model.js';
|
|
5
4
|
import { type ScheduleView } from './schedule-overview.js';
|
|
6
5
|
import type { NativeTabRegistry } from './native-tabs.js';
|
|
7
|
-
type SessionSelector = <S>(select: (state: {
|
|
8
|
-
ids?: string[];
|
|
9
|
-
byId?: Record<string, NativeSessionLike>;
|
|
10
|
-
current?: string | null;
|
|
11
|
-
}) => S, eq?: (a: S, b: S) => boolean) => S;
|
|
12
|
-
type WorkspaceSelector = <S>(select: (state: {
|
|
13
|
-
items?: NativeWorkspaceLike[];
|
|
14
|
-
archivedSessionIds?: string[];
|
|
15
|
-
}) => S, eq?: (a: S, b: S) => boolean) => S;
|
|
16
6
|
export declare function ScheduleRail({ t, runtime, openSession, view: controlledView, showViewSwitch, }: {
|
|
17
7
|
readonly t: Translate;
|
|
18
8
|
readonly runtime: AutomationRuntime;
|
|
@@ -34,4 +24,3 @@ export declare function NativeScheduleShell({ t, runtime, officialTree, hostProp
|
|
|
34
24
|
readonly tabRegistry?: NativeTabRegistry;
|
|
35
25
|
readonly wide?: boolean;
|
|
36
26
|
}): JSX.Element | null;
|
|
37
|
-
export {};
|
|
@@ -2,8 +2,11 @@ import type { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import type { AutomationLocaleKey } from './locales.js';
|
|
3
3
|
import type { AutomationRuntime } from './runtime.js';
|
|
4
4
|
import type { PermissionTranslate } from './permissions.js';
|
|
5
|
+
import type { SessionListState, WorkspaceListState } from './schedule-rail-model.js';
|
|
5
6
|
export type Translate = (key: AutomationLocaleKey, params?: Record<string, unknown>) => string;
|
|
6
7
|
export type ModelTranslate = (key: string, params?: Record<string, unknown>) => string;
|
|
8
|
+
export type SessionSelector = <Selected>(select: (state: SessionListState) => Selected, equals?: (left: Selected, right: Selected) => boolean) => Selected;
|
|
9
|
+
export type WorkspaceSelector = <Selected>(select: (state: WorkspaceListState) => Selected, equals?: (left: Selected, right: Selected) => boolean) => Selected;
|
|
7
10
|
export interface AutomationViewProps {
|
|
8
11
|
readonly t: Translate;
|
|
9
12
|
readonly permissionT: PermissionTranslate;
|
|
@@ -63,7 +66,7 @@ export interface NativeSwitcherProps {
|
|
|
63
66
|
readonly wide?: boolean;
|
|
64
67
|
readonly openSession?: (sessionId: string) => void;
|
|
65
68
|
readonly open?: (sessionId: string) => void;
|
|
66
|
-
readonly useSessions?:
|
|
67
|
-
readonly useWorkspaces?:
|
|
69
|
+
readonly useSessions?: SessionSelector;
|
|
70
|
+
readonly useWorkspaces?: WorkspaceSelector;
|
|
68
71
|
readonly renderSlot?: (name: string, props?: Record<string, unknown>) => ReactNode;
|
|
69
72
|
}
|
|
@@ -41,6 +41,7 @@ export declare const en: {
|
|
|
41
41
|
readonly 'session.rename': "Rename";
|
|
42
42
|
readonly 'session.fork': "Fork session";
|
|
43
43
|
readonly 'session.archive': "Archive session";
|
|
44
|
+
readonly 'session.moreActions': "More actions for {title}";
|
|
44
45
|
readonly 'session.groupActions': "Actions for {name}";
|
|
45
46
|
readonly 'session.taskSettings': "Task settings";
|
|
46
47
|
readonly 'session.archiveGroup': "Archive all conversations";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Translate } from './contracts.js';
|
|
1
|
+
import type { SessionSelector, Translate, WorkspaceSelector } from './contracts.js';
|
|
2
2
|
import type { AutomationRuntime } from './runtime.js';
|
|
3
3
|
import type { AutomationTaskSettingsRequest } from './task-settings-request.js';
|
|
4
4
|
export { nativeSessionMenuStyle, nextOpenSessionMenu, nextOpenSessionMenuId, pointerPoint, relativeTime, resolveEventElement, shouldCloseNativeSessionMenu, } from './native-session-menu.js';
|
|
@@ -6,8 +6,8 @@ export declare function NativeScheduleSessionList(props: {
|
|
|
6
6
|
readonly t: Translate;
|
|
7
7
|
readonly runtime: AutomationRuntime;
|
|
8
8
|
readonly openSession?: (sessionId: string) => void;
|
|
9
|
-
readonly useSessions?:
|
|
10
|
-
readonly useWorkspaces?:
|
|
9
|
+
readonly useSessions?: SessionSelector;
|
|
10
|
+
readonly useWorkspaces?: WorkspaceSelector;
|
|
11
11
|
readonly renameSession?: (sessionId: string, title: string) => void | Promise<void>;
|
|
12
12
|
readonly archiveSession?: (sessionId: string) => void | Promise<void>;
|
|
13
13
|
readonly deleteSession?: (sessionId: string) => void | Promise<void>;
|