@deepseek-ai/dsh-client-ui-schedule 0.1.7-alpha.2 → 0.1.7-rc.2
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/README.i18n.yaml +39 -5
- package/README.md +36 -39
- package/README.zh.md +42 -45
- package/lib/client.js +6735 -171
- package/lib/index.js +1 -1
- package/lib/types/client/CalendarIcon.d.ts +17 -0
- package/lib/types/client/CatalogFeedback.d.ts +28 -0
- package/lib/types/client/ClockPicker.d.ts +33 -0
- package/lib/types/client/DatePicker.d.ts +27 -0
- package/lib/types/client/DeleteToast.d.ts +47 -0
- package/lib/types/client/DeliveryHistory.d.ts +29 -0
- package/lib/types/client/PickerPopover.d.ts +27 -0
- package/lib/types/client/ScheduleCatalogAction.d.ts +12 -13
- package/lib/types/client/ScheduleCreateCard.d.ts +37 -0
- package/lib/types/client/ScheduleTaskTab.d.ts +36 -0
- package/lib/types/client/ScheduleTaskTabTitle.d.ts +21 -0
- package/lib/types/client/ScheduleTurnCard.d.ts +25 -0
- package/lib/types/client/SessionScheduleHover.d.ts +34 -0
- package/lib/types/client/SessionScheduleMark.d.ts +31 -0
- package/lib/types/client/TaskDetail.d.ts +158 -0
- package/lib/types/client/TaskManagerIcon.d.ts +11 -0
- package/lib/types/client/TaskManagerPage.d.ts +25 -0
- package/lib/types/client/TaskMenu.d.ts +76 -0
- package/lib/types/client/catalog-source.d.ts +91 -0
- package/lib/types/client/definition.d.ts +40 -0
- package/lib/types/client/frequency-locales.d.ts +71 -0
- package/lib/types/client/index.d.ts +40 -4
- package/lib/types/client/locales.d.ts +59 -8
- package/lib/types/client/recent-time-zones.d.ts +15 -0
- package/lib/types/client/relative-clock.d.ts +26 -0
- package/lib/types/client/schedule-create-card.d.ts +46 -0
- package/lib/types/client/schedule-format.d.ts +177 -0
- package/lib/types/client/schedule-turn.d.ts +63 -0
- package/lib/types/client/session-link.d.ts +41 -0
- package/lib/types/client/session-schedule-state.d.ts +62 -0
- package/lib/types/client/task-cron.d.ts +116 -0
- package/lib/types/client/task-manager-locales.d.ts +195 -0
- package/lib/types/client/task-tab-bindings.d.ts +114 -0
- package/lib/types/client/task-tab-target.d.ts +31 -0
- package/lib/types/client/task-timing.d.ts +96 -0
- package/lib/types/index.d.ts +1 -1
- package/package.json +31 -12
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable recovery for a restored task tab.
|
|
3
|
+
*
|
|
4
|
+
* The Sidebar persists a tab's layout record — its own id, kind, contentId, and
|
|
5
|
+
* title — but not the opener's navigation parameters, so a task tab restored by
|
|
6
|
+
* a reload carries no task identity and its body can only report feedback. This
|
|
7
|
+
* page type therefore keeps what it last showed, keyed by the Session and the
|
|
8
|
+
* layout record's id: the persisted layout restores both, and its minted counter
|
|
9
|
+
* never reuses an id for as long as that layout lives, so the association
|
|
10
|
+
* outlives the reload that dropped the parameters. The contentId cannot serve as
|
|
11
|
+
* this key because every tab of one page kind records the same one.
|
|
12
|
+
*
|
|
13
|
+
* One storage key per Session holds one entry per tab id. A write keeps only
|
|
14
|
+
* entries whose tab a non-empty list of committed ids contains; a read reports a
|
|
15
|
+
* target only when the entry's kind and contentId match the record reading it,
|
|
16
|
+
* and leaves the document untouched, so the drop of a mismatched entry is a
|
|
17
|
+
* separate call a render effect makes. A body removes an entry a read that
|
|
18
|
+
* succeeded after the tab appeared cannot resolve. Only the task's Session and id are stored; its name, instruction, and
|
|
19
|
+
* deliveries are not.
|
|
20
|
+
*/
|
|
21
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
22
|
+
import type { ScheduleId } from '@deepseek-ai/dsh-schedule/client';
|
|
23
|
+
/** The Sidebar fields that identify one task tab page across a reload. */
|
|
24
|
+
export interface TaskTabPage {
|
|
25
|
+
/** The persisted layout record's own id. */
|
|
26
|
+
readonly id: string;
|
|
27
|
+
/** That record's registered page kind. */
|
|
28
|
+
readonly kind: string;
|
|
29
|
+
/** That record's content identity, shared by every tab of this page kind. */
|
|
30
|
+
readonly contentId: string;
|
|
31
|
+
}
|
|
32
|
+
/** The task one tab page last showed. */
|
|
33
|
+
export interface TaskTabTarget {
|
|
34
|
+
/** The Session that owns the task. */
|
|
35
|
+
readonly sessionId: SessionId;
|
|
36
|
+
/** The task's own identity. */
|
|
37
|
+
readonly id: ScheduleId;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The committed tab ids of one Session, read when an entry is stored so a closed
|
|
41
|
+
* tab leaves none behind. `undefined` and an empty list both skip that removal:
|
|
42
|
+
* `ctx.sidebarRight.tabsIn` returns the empty list for a Session whose layout is
|
|
43
|
+
* not adopted as well as for one whose adopted layout holds no tabs, and pruning
|
|
44
|
+
* against that answer would drop entries a restored tab still resolves through.
|
|
45
|
+
*/
|
|
46
|
+
export type TaskTabLiveIds = (sessionId: SessionId) => readonly string[] | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Last shown task per task tab page, kept in this window and in browser storage.
|
|
49
|
+
*
|
|
50
|
+
* The window copy is authoritative for this window's reads: it keeps the value
|
|
51
|
+
* usable when storage is absent or rejects writes, and it avoids reparsing the
|
|
52
|
+
* stored document on every render.
|
|
53
|
+
*/
|
|
54
|
+
export declare class TaskTabBindings {
|
|
55
|
+
private readonly liveTabIds?;
|
|
56
|
+
private readonly memory;
|
|
57
|
+
/**
|
|
58
|
+
* @param liveTabIds - the committed layout's tab ids for one Session, read when an entry is stored.
|
|
59
|
+
*/
|
|
60
|
+
constructor(liveTabIds?: TaskTabLiveIds | undefined);
|
|
61
|
+
/**
|
|
62
|
+
* Read the task one page last showed.
|
|
63
|
+
*
|
|
64
|
+
* An entry whose kind or contentId differs from the page reading it belongs to
|
|
65
|
+
* a layout id that has since been reused; the read reports no task and leaves
|
|
66
|
+
* the document untouched, and `dropMismatched` removes it after the render.
|
|
67
|
+
* @param sessionId - the Session holding the tab.
|
|
68
|
+
* @param page - the restored layout record.
|
|
69
|
+
* @returns the task to show, or undefined when the page has no applicable entry.
|
|
70
|
+
*/
|
|
71
|
+
read(sessionId: SessionId, page: TaskTabPage): TaskTabTarget | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Drop one page's entry when it recorded another kind or contentId.
|
|
74
|
+
*
|
|
75
|
+
* A read reports the mismatch without writing, so the page resolves its target
|
|
76
|
+
* in a render and drops the entry from an effect; a render React discards must
|
|
77
|
+
* not rewrite what it read.
|
|
78
|
+
* @param sessionId - the Session holding the tab.
|
|
79
|
+
* @param page - the layout record the stored entry has to match.
|
|
80
|
+
*/
|
|
81
|
+
dropMismatched(sessionId: SessionId, page: TaskTabPage): void;
|
|
82
|
+
/**
|
|
83
|
+
* Record the task one page now shows.
|
|
84
|
+
* @param sessionId - the Session holding the tab.
|
|
85
|
+
* @param page - the navigated layout record.
|
|
86
|
+
* @param target - the task the navigation named.
|
|
87
|
+
*/
|
|
88
|
+
write(sessionId: SessionId, page: TaskTabPage, target: TaskTabTarget): void;
|
|
89
|
+
/**
|
|
90
|
+
* Drop one page's entry once a read that succeeded after the tab appeared shows
|
|
91
|
+
* its task is gone.
|
|
92
|
+
* @param sessionId - the Session holding the tab.
|
|
93
|
+
* @param page - the layout record whose entry is removed.
|
|
94
|
+
*/
|
|
95
|
+
forget(sessionId: SessionId, page: TaskTabPage): void;
|
|
96
|
+
/** Release this window's cached documents. */
|
|
97
|
+
clear(): void;
|
|
98
|
+
/**
|
|
99
|
+
* One Session's entries, from this window or from storage.
|
|
100
|
+
* @param sessionId - the Session holding the tabs.
|
|
101
|
+
* @returns its entries, empty when nothing is saved or storage is unreachable.
|
|
102
|
+
*/
|
|
103
|
+
private document;
|
|
104
|
+
/**
|
|
105
|
+
* Replace one Session's entries, dropping those of tabs a non-empty list of
|
|
106
|
+
* committed ids does not hold, and publish them to this window and to storage.
|
|
107
|
+
* An empty result removes the Session's key rather than storing an empty
|
|
108
|
+
* document.
|
|
109
|
+
* @param sessionId - the Session holding the tabs.
|
|
110
|
+
* @param entries - the complete replacement set.
|
|
111
|
+
*/
|
|
112
|
+
private store;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=task-tab-bindings.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SidebarRightNavigationParams } from '@deepseek-ai/dsh-client-ui-sidebar-right/client';
|
|
2
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
3
|
+
import type { TaskTabBindings, TaskTabPage, TaskTabTarget } from './task-tab-bindings.ts';
|
|
4
|
+
/** The layout and navigation fields one task tab carries. */
|
|
5
|
+
export interface TaskTabSource extends TaskTabPage {
|
|
6
|
+
/** Navigation the tab's last open carried; a restored record carries no parameters. */
|
|
7
|
+
readonly navigation: {
|
|
8
|
+
readonly params: SidebarRightNavigationParams;
|
|
9
|
+
readonly revision: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** The task one task tab resolves, and where it came from. */
|
|
13
|
+
export interface TaskTabTargetResolution {
|
|
14
|
+
/** Whether the current layout still carries the opener's navigation parameters. */
|
|
15
|
+
readonly navigated: boolean;
|
|
16
|
+
/** Task the navigation named, or undefined when it carried another type's parameters. */
|
|
17
|
+
readonly navigation: TaskTabTarget | undefined;
|
|
18
|
+
/** Binding this page kind wrote for this layout id, read only for a restored record. */
|
|
19
|
+
readonly recovered: TaskTabTarget | undefined;
|
|
20
|
+
/** Task to show: the navigation's, or the restored binding's. */
|
|
21
|
+
readonly params: TaskTabTarget | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the task one task tab shows from its navigation or its stored binding.
|
|
25
|
+
* @param sessionId - the Session holding the tab.
|
|
26
|
+
* @param tab - the tab's layout fields and its last navigation.
|
|
27
|
+
* @param taskBindings - provider-owned binding store for restored task tabs.
|
|
28
|
+
* @returns the navigation, the recovered binding, and the task to show.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useTaskTabTarget(sessionId: SessionId, tab: TaskTabSource, taskBindings: TaskTabBindings): TaskTabTargetResolution;
|
|
31
|
+
//# sourceMappingURL=task-tab-target.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact rule snapshots, editable timing fields, the injected task update callback, and Host
|
|
3
|
+
* failure mapping; zone interpretation belongs to the Host.
|
|
4
|
+
*/
|
|
5
|
+
import type { RemoteResult } from '@deepseek-ai/dsh-api-remotes/client';
|
|
6
|
+
import type { ScheduleRecord, ScheduleUpdateRequest, ScheduleUpdateResult } from '@deepseek-ai/dsh-schedule/client';
|
|
7
|
+
import type { TaskManagerKey } from './task-manager-locales.ts';
|
|
8
|
+
/** Task mutation callback injected by the task catalog owner. */
|
|
9
|
+
export interface TaskTimingInjected {
|
|
10
|
+
/**
|
|
11
|
+
* Compare and update the exact task, then refresh the authoritative catalog on success or a stale rule.
|
|
12
|
+
* Catalog read failures remain in catalog state and do not change the persistence result.
|
|
13
|
+
* @param request - Captured task and Session, complete expected record, and the optional
|
|
14
|
+
* replacement name, instruction, and timing change; an omitted `change` keeps the committed target.
|
|
15
|
+
* @returns Original Remote mutation result; transport or storage exceptions may reject.
|
|
16
|
+
*/
|
|
17
|
+
readonly onUpdateTiming: (request: ScheduleUpdateRequest) => Promise<RemoteResult<ScheduleUpdateResult>>;
|
|
18
|
+
}
|
|
19
|
+
/** Native input values retained for one edit session. */
|
|
20
|
+
export interface TimingDraft {
|
|
21
|
+
date: string;
|
|
22
|
+
time: string;
|
|
23
|
+
timeZone: string;
|
|
24
|
+
seconds: string;
|
|
25
|
+
expression: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Project only persisted rule fields, excluding catalog metadata and delivery receipts.
|
|
29
|
+
* @param record - Rule from the current catalog.
|
|
30
|
+
* @returns Independent complete expected rule for compare-and-update.
|
|
31
|
+
*/
|
|
32
|
+
export declare function timingSnapshot(record: ScheduleRecord): ScheduleRecord;
|
|
33
|
+
/**
|
|
34
|
+
* The zone a new or switched-to rule starts its clock rows in, and whether that
|
|
35
|
+
* zone came from the stored rule rather than this device.
|
|
36
|
+
*
|
|
37
|
+
* A daily, weekly, or cron record stores the zone its wall clock means, so
|
|
38
|
+
* editing it keeps that zone. A one-shot `at` target and an `after` interval
|
|
39
|
+
* store only the committed instant and no creation zone, so they start in this
|
|
40
|
+
* device's zone.
|
|
41
|
+
* @param record - rule the draft is seeded from.
|
|
42
|
+
* @returns the draft's IANA zone and whether it is the no-stored-zone fallback.
|
|
43
|
+
*/
|
|
44
|
+
export declare function draftZone(record: ScheduleRecord): {
|
|
45
|
+
zone: string;
|
|
46
|
+
stored: boolean;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The date and clock one instant names in one zone, keeping millisecond precision.
|
|
50
|
+
*
|
|
51
|
+
* The locale is fixed, so the field order never follows the interface language,
|
|
52
|
+
* and each field is read by name rather than from a formatted string.
|
|
53
|
+
* @param instant - canonical ISO instant.
|
|
54
|
+
* @param zone - IANA zone the returned wall clock is expressed in.
|
|
55
|
+
* @returns `YYYY-MM-DDTHH:MM:SS.mmm` in that zone.
|
|
56
|
+
*/
|
|
57
|
+
export declare function zonedWallClock(instant: string, zone: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Initialize one-shot inputs in the zone the rule states, or in this device's
|
|
60
|
+
* zone for a rule that stores none.
|
|
61
|
+
*
|
|
62
|
+
* An `at` target stores an instant and no creation zone, so its rows show that
|
|
63
|
+
* instant in the draft's zone: the shown pair names the instant the record
|
|
64
|
+
* already commits rather than restating it in a zone the record does not have.
|
|
65
|
+
* @param record - Expected rule captured when editing starts.
|
|
66
|
+
* @returns Native input values without rounding seconds or milliseconds.
|
|
67
|
+
*/
|
|
68
|
+
export declare function timingDraft(record: ScheduleRecord): TimingDraft;
|
|
69
|
+
/**
|
|
70
|
+
* One date as the rows and pickers expose it.
|
|
71
|
+
*
|
|
72
|
+
* The draft, the calendar's own comparisons, and the text submitted to the Host
|
|
73
|
+
* all stay `YYYY-MM-DD`; only the exposed text takes the slashed form the design
|
|
74
|
+
* states, so no caller has to parse or re-format a date merely to show it.
|
|
75
|
+
* @param date - stored or staged ISO date text.
|
|
76
|
+
* @returns the same date with slashes between its fields.
|
|
77
|
+
*/
|
|
78
|
+
export declare function slashDate(date: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* One clock time at whole-second precision.
|
|
81
|
+
*
|
|
82
|
+
* The rows and the clock picker both show `HH:MM:SS`; an untouched stored value
|
|
83
|
+
* keeps its milliseconds in the draft so a save can submit them back.
|
|
84
|
+
* @param time - stored or staged clock text, with or without fractional seconds.
|
|
85
|
+
* @returns the same clock time at whole-second precision, or the input when it is not a clock time.
|
|
86
|
+
*/
|
|
87
|
+
export declare function secondPrecision(time: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Localize controlled Host failures without exposing transport or storage diagnostics.
|
|
90
|
+
* @param code - Error code returned by the timing update.
|
|
91
|
+
* @returns Dictionary key describing the recovery action.
|
|
92
|
+
*/
|
|
93
|
+
export declare function timingError(code: Extract<ScheduleUpdateResult, {
|
|
94
|
+
code: string;
|
|
95
|
+
}>['code']): TaskManagerKey;
|
|
96
|
+
//# sourceMappingURL=task-timing.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Schedule catalog plugin, node half. The empty apply keeps the
|
|
3
3
|
* optional browser feature addressable from the host-owned Loader overlay.
|
|
4
4
|
*/
|
|
5
5
|
/** Host plugin body — Schedule catalog behavior exists only in the browser entry. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-schedule",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.1.7-
|
|
3
|
+
"description": "Host task management page and Session reminder catalog",
|
|
4
|
+
"version": "0.1.7-rc.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -20,8 +20,17 @@
|
|
|
20
20
|
"dsh": {
|
|
21
21
|
"client": {
|
|
22
22
|
"inject": [
|
|
23
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
24
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
25
|
+
"@deepseek-ai/dsh-api-workspace-controller",
|
|
26
|
+
"@deepseek-ai/dsh-client-connection",
|
|
23
27
|
"@deepseek-ai/dsh-client-locale",
|
|
24
28
|
"@deepseek-ai/dsh-client-ui-conversation",
|
|
29
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
30
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
31
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right",
|
|
32
|
+
"@deepseek-ai/dsh-client-ui-tool",
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
25
34
|
"@deepseek-ai/dsh-client-ui-primitives"
|
|
26
35
|
],
|
|
27
36
|
"platform": "web"
|
|
@@ -43,19 +52,29 @@
|
|
|
43
52
|
"@testing-library/react": "^16.1.0",
|
|
44
53
|
"@types/react": "~18.3.1",
|
|
45
54
|
"@types/react-dom": "~18.3.0",
|
|
55
|
+
"clsx": "^2.1.1",
|
|
46
56
|
"react": "^18.2.0",
|
|
47
57
|
"react-dom": "^18.2.0",
|
|
48
|
-
"@deepseek-ai/dsh-api-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-client-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-client-
|
|
53
|
-
"@deepseek-ai/dsh-client-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
58
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.7-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.1.7-rc.2",
|
|
60
|
+
"@deepseek-ai/dsh-client-connection": "0.1.7-rc.2",
|
|
61
|
+
"@deepseek-ai/dsh-api-session-controller": "0.1.7-rc.2",
|
|
62
|
+
"@deepseek-ai/dsh-client-locale": "0.1.7-rc.2",
|
|
63
|
+
"@deepseek-ai/dsh-client-test-runtime": "0.1.7-rc.2",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.7-rc.2",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.1.7-rc.2",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.1.7-rc.2",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-session": "0.1.7-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.1.7-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-tool": "0.1.7-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.1.7-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.1.7-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-schedule": "0.1.7-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-session": "0.1.7-rc.2",
|
|
56
76
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.1.7-alpha.2"
|
|
77
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-rc.2"
|
|
59
78
|
},
|
|
60
79
|
"files": [
|
|
61
80
|
"lib/index.js",
|