@epam/ai-dial-chat-hooks 1.4.0-dev.96 → 1.5.0-dev.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/api-error/map-api-error.d.ts +10 -0
- package/api-error/map-api-error.d.ts.map +1 -0
- package/api-error/map-api-error.js +11 -0
- package/catalog/create-publish-api.d.ts +14 -10
- package/catalog/create-publish-api.d.ts.map +1 -1
- package/catalog/create-publish-api.js +8 -9
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -1
- package/catalog/map-deployment-to-catalog-item.js +1 -0
- package/catalog/publish-target-taken.d.ts +31 -0
- package/catalog/publish-target-taken.d.ts.map +1 -0
- package/catalog/publish-target-taken.js +14 -0
- package/catalog/resource-name-conflict.d.ts.map +1 -1
- package/catalog/resource-name-conflict.js +19 -22
- package/catalog/resource-save.d.ts +2 -4
- package/catalog/resource-save.d.ts.map +1 -1
- package/catalog/resource-save.js +38 -32
- package/catalog/use-publish-target-guard.d.ts +45 -0
- package/catalog/use-publish-target-guard.d.ts.map +1 -0
- package/catalog/use-publish-target-guard.js +18 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts +11 -3
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
- package/catalog/usePublishFolders/usePublishFolders.js +41 -31
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +27 -11
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.js +163 -138
- package/catalog.js +51 -49
- package/conversation/conversation-list.d.ts +7 -1
- package/conversation/conversation-list.d.ts.map +1 -1
- package/conversation/conversation-list.js +11 -2
- package/conversation/conversation-transfer/zip-export.d.ts +1 -1
- package/conversation/conversation-transfer/zip-export.d.ts.map +1 -1
- package/conversation/conversation-transfer/zip-export.js +7 -8
- package/conversation/conversation-transfer/zip-import.d.ts.map +1 -1
- package/conversation/conversation-transfer/zip-import.js +8 -9
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationExport/useConversationExport.js +3 -1
- package/conversation.js +3 -3
- package/entry-points/catalog.d.ts +2 -0
- package/entry-points/catalog.d.ts.map +1 -1
- package/entry-points/scheduled-tasks.d.ts +1 -0
- package/entry-points/scheduled-tasks.d.ts.map +1 -1
- package/entry-points/skill-editor.d.ts +1 -0
- package/entry-points/skill-editor.d.ts.map +1 -1
- package/entry-points/utils.d.ts +1 -0
- package/entry-points/utils.d.ts.map +1 -1
- package/file-manager.js +33 -33
- package/files/dial-file-manager.types.d.ts +4 -2
- package/files/dial-file-manager.types.d.ts.map +1 -1
- package/files/dial-file.d.ts +6 -0
- package/files/dial-file.d.ts.map +1 -1
- package/files/dial-file.js +17 -12
- package/files/useDialFileListing/useDialFileListing.d.ts +9 -1
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/files/useDialFileListing/useDialFileListing.js +205 -183
- package/files/useDialFileManager/useDialFileManager.d.ts +1 -1
- package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -1
- package/files/useDialFileManager/useDialFileManager.js +114 -113
- package/files/useDialFileMutations/useDialFileMutations.d.ts +2 -1
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -1
- package/files/useDialFileMutations/useDialFileMutations.js +5 -5
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/index.js +267 -262
- package/org-units/org-unit-guards.d.ts +95 -1
- package/org-units/org-unit-guards.d.ts.map +1 -1
- package/org-units/org-unit-guards.js +51 -16
- package/org-units/useOrgUnits/useOrgUnits.d.ts +12 -4
- package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -1
- package/org-units/useOrgUnits/useOrgUnits.js +44 -35
- package/package.json +20 -20
- package/project/project-conversation-data-source.js +4 -4
- package/project/project-refresh.d.ts +2 -0
- package/project/project-refresh.d.ts.map +1 -1
- package/project/project-refresh.js +1 -1
- package/project/use-project-actions.d.ts +3 -1
- package/project/use-project-actions.d.ts.map +1 -1
- package/project/use-project-actions.js +39 -38
- package/project/use-project.d.ts +3 -1
- package/project/use-project.d.ts.map +1 -1
- package/project/use-project.js +57 -44
- package/scheduled-task/scheduled-task-display.d.ts +51 -4
- package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-display.js +53 -46
- package/scheduled-task/scheduled-task-next-occurrence.d.ts +2 -0
- package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-next-occurrence.js +2 -2
- package/scheduled-task/scheduled-task-time-format.d.ts +36 -0
- package/scheduled-task/scheduled-task-time-format.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-time-format.js +34 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-trigger.js +13 -14
- package/scheduled-tasks.js +14 -13
- package/skill/skill-archive.d.ts.map +1 -1
- package/skill/skill-archive.js +6 -7
- package/skill/skill-file-batch-validation.d.ts +6 -0
- package/skill/skill-file-batch-validation.d.ts.map +1 -1
- package/skill/skill-file-batch-validation.js +39 -37
- package/skill/skill-types.d.ts +0 -6
- package/skill/skill-types.d.ts.map +1 -1
- package/skill/skill-types.js +7 -8
- package/skill/skill.d.ts +2 -9
- package/skill/skill.d.ts.map +1 -1
- package/skill/skill.js +33 -34
- package/skill/types/skill-editor-submit.d.ts +8 -0
- package/skill/types/skill-editor-submit.d.ts.map +1 -0
- package/skill/types/skill-editor-submit.js +6 -0
- package/skill/useSkillEditorLoad.js +1 -1
- package/skill/useSkillEditorSubmit.d.ts +2 -3
- package/skill/useSkillEditorSubmit.d.ts.map +1 -1
- package/skill/useSkillEditorSubmit.js +103 -102
- package/skill/useSkillFileActions.d.ts +7 -1
- package/skill/useSkillFileActions.d.ts.map +1 -1
- package/skill/useSkillFileActions.js +55 -49
- package/skill-editor.js +7 -6
- package/utils.js +28 -27
package/project/use-project.js
CHANGED
|
@@ -2,72 +2,85 @@ import { getApiErrorStatus as e } from "../api-error/api-error.js";
|
|
|
2
2
|
import { ProjectRefreshOutcome as t } from "./project-refresh.js";
|
|
3
3
|
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
4
4
|
//#region src/project/use-project.ts
|
|
5
|
-
var o = (
|
|
6
|
-
let
|
|
5
|
+
var o = (t) => {
|
|
6
|
+
let n = e(t);
|
|
7
|
+
return {
|
|
8
|
+
hasError: n !== 404 && n !== 403,
|
|
9
|
+
isNotFound: n === 404,
|
|
10
|
+
isAccessDenied: n === 403
|
|
11
|
+
};
|
|
12
|
+
}, s = (n) => {
|
|
13
|
+
switch (e(n)) {
|
|
14
|
+
case 404: return t.NotFound;
|
|
15
|
+
case 403: return t.AccessLost;
|
|
16
|
+
default: return t.Failed;
|
|
17
|
+
}
|
|
18
|
+
}, c = (e, c, l) => {
|
|
19
|
+
let [u, d] = a(0), [f, p] = a(), m = `${u}:${c ?? ""}`;
|
|
7
20
|
r(() => {
|
|
8
|
-
if (!
|
|
21
|
+
if (!l || c == null) return;
|
|
9
22
|
let t = new AbortController();
|
|
10
23
|
return (async () => {
|
|
11
24
|
try {
|
|
12
|
-
let
|
|
25
|
+
let n = await e.getProject(c, t.signal);
|
|
13
26
|
if (t.signal.aborted) return;
|
|
14
|
-
|
|
15
|
-
key:
|
|
16
|
-
project:
|
|
27
|
+
p({
|
|
28
|
+
key: m,
|
|
29
|
+
project: n,
|
|
17
30
|
hasError: !1,
|
|
18
|
-
isNotFound: !1
|
|
31
|
+
isNotFound: !1,
|
|
32
|
+
isAccessDenied: !1
|
|
19
33
|
});
|
|
20
|
-
} catch (
|
|
34
|
+
} catch (e) {
|
|
21
35
|
if (t.signal.aborted) return;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
key: p,
|
|
36
|
+
p({
|
|
37
|
+
key: m,
|
|
25
38
|
project: null,
|
|
26
|
-
|
|
27
|
-
isNotFound: r
|
|
39
|
+
...o(e)
|
|
28
40
|
});
|
|
29
41
|
}
|
|
30
42
|
})(), () => t.abort();
|
|
31
43
|
}, [
|
|
32
|
-
|
|
44
|
+
e,
|
|
45
|
+
l,
|
|
33
46
|
c,
|
|
34
|
-
|
|
35
|
-
p
|
|
47
|
+
m
|
|
36
48
|
]);
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
49
|
+
let h = n(() => {
|
|
50
|
+
d((e) => e + 1);
|
|
51
|
+
}, []), g = f?.key === m ? f : void 0, _ = g?.project ?? null, v = i(null);
|
|
40
52
|
r(() => () => {
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
|
|
53
|
+
v.current?.abort(), v.current = null;
|
|
54
|
+
}, [m]);
|
|
55
|
+
let y = n(async () => {
|
|
56
|
+
if (_ == null || c == null) return t.Skipped;
|
|
57
|
+
v.current?.abort();
|
|
46
58
|
let n = new AbortController();
|
|
47
|
-
|
|
59
|
+
v.current = n;
|
|
48
60
|
try {
|
|
49
|
-
let
|
|
50
|
-
return n.signal.aborted ? t.Skipped : (
|
|
51
|
-
...
|
|
52
|
-
project:
|
|
53
|
-
} :
|
|
54
|
-
} catch (
|
|
55
|
-
return n.signal.aborted ? t.Skipped : e
|
|
61
|
+
let r = await e.getProject(c, n.signal);
|
|
62
|
+
return n.signal.aborted ? t.Skipped : (p((e) => e?.key === m ? {
|
|
63
|
+
...e,
|
|
64
|
+
project: r
|
|
65
|
+
} : e), t.Updated);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
return n.signal.aborted ? t.Skipped : s(e);
|
|
56
68
|
}
|
|
57
69
|
}, [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
e,
|
|
71
|
+
c,
|
|
72
|
+
m,
|
|
73
|
+
_
|
|
62
74
|
]);
|
|
63
75
|
return {
|
|
64
|
-
project:
|
|
65
|
-
isLoading:
|
|
66
|
-
hasError:
|
|
67
|
-
isNotFound:
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
project: _,
|
|
77
|
+
isLoading: l && c != null && g == null,
|
|
78
|
+
hasError: g?.hasError ?? !1,
|
|
79
|
+
isNotFound: g?.isNotFound ?? !1,
|
|
80
|
+
isAccessDenied: g?.isAccessDenied ?? !1,
|
|
81
|
+
retry: h,
|
|
82
|
+
refresh: y
|
|
70
83
|
};
|
|
71
84
|
};
|
|
72
85
|
//#endregion
|
|
73
|
-
export {
|
|
86
|
+
export { c as useProject };
|
|
@@ -9,7 +9,7 @@ export interface ScheduledTaskScheduleLabels {
|
|
|
9
9
|
everyNMinutes: (count: number) => string;
|
|
10
10
|
/** An hourly run at `minute` past the hour. */
|
|
11
11
|
hourlyAt: (minute: string) => string;
|
|
12
|
-
/** A daily run at `time
|
|
12
|
+
/** A daily run at `time`, a locale-formatted clock time such as `9:00 AM` or `09:00`. */
|
|
13
13
|
dailyAt: (time: string) => string;
|
|
14
14
|
/** A weekly run on `day` — one weekday name, or several joined as a locale list — at `time`. */
|
|
15
15
|
weeklyAt: (day: string, time: string) => string;
|
|
@@ -22,6 +22,30 @@ export interface ScheduledTaskScheduleLabels {
|
|
|
22
22
|
/** Appends the task's zone to a schedule label, e.g. "Daily at 09:00 (Asia/Tokyo)". Omit to never show the zone. */
|
|
23
23
|
withTimezone?: (label: string, timezone: string) => string;
|
|
24
24
|
}
|
|
25
|
+
/** Host-translated zone suffix for a detail value, e.g. "{label} ({timezone})". */
|
|
26
|
+
export interface ScheduledTaskZoneLabels {
|
|
27
|
+
/** Appends `timezone` to an already formatted date or time. */
|
|
28
|
+
withTimezone: (label: string, timezone: string) => string;
|
|
29
|
+
}
|
|
30
|
+
/** Host-translated wording for a cron activity window. */
|
|
31
|
+
export interface ScheduledTaskActiveWindowLabels extends ScheduledTaskZoneLabels {
|
|
32
|
+
/** The window between two locale-formatted task-zone wall times, e.g. "{startDate} – {endDate}". */
|
|
33
|
+
range: (startDate: string, endDate: string) => string;
|
|
34
|
+
}
|
|
35
|
+
/** Locale and viewer zone used to format a task's next run. */
|
|
36
|
+
export interface ScheduledTaskNextRunOptions {
|
|
37
|
+
/** BCP 47 locale for the date and time. Defaults to the runtime default. */
|
|
38
|
+
locale?: string;
|
|
39
|
+
/** The viewer's IANA zone the instant is shown in and named after. Defaults to `getBrowserTimezone()`. */
|
|
40
|
+
browserTimezone?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Why a task that is not completed still cannot be turned on. */
|
|
43
|
+
export declare enum ScheduledTaskActivationBlock {
|
|
44
|
+
/** A one-time (`date`) schedule with no next run has already fired. */
|
|
45
|
+
OneTimeFired = "oneTimeFired",
|
|
46
|
+
/** A recurring (`cron`) schedule's activity window `endDate` has passed. */
|
|
47
|
+
WindowEnded = "windowEnded"
|
|
48
|
+
}
|
|
25
49
|
/** Host-translated duration units for a run. */
|
|
26
50
|
export interface ScheduledTaskRunDurationLabels {
|
|
27
51
|
/** `count` hours, e.g. "1h". */
|
|
@@ -46,6 +70,8 @@ export interface ScheduledTaskScheduleLabelOptions {
|
|
|
46
70
|
locale?: string;
|
|
47
71
|
/** The viewer's IANA zone; a task in a different zone gets its zone appended to the label. Defaults to the browser's resolved zone. */
|
|
48
72
|
browserTimezone?: string;
|
|
73
|
+
/** Appends the task's zone even when it equals the viewer's zone. Needs `labels.withTimezone`. Defaults to `false`. */
|
|
74
|
+
alwaysShowTimezone?: boolean;
|
|
49
75
|
}
|
|
50
76
|
/** Inputs for formatting a run's start time. */
|
|
51
77
|
export interface ScheduledTaskRunTimestampOptions {
|
|
@@ -87,8 +113,6 @@ export declare enum ScheduledTaskDeleteErrorKind {
|
|
|
87
113
|
/** Any other failure. */
|
|
88
114
|
Generic = "generic"
|
|
89
115
|
}
|
|
90
|
-
/** Formats a zone-local `YYYY-MM-DDTHH:mm` as a medium date and short time without converting it to another zone. */
|
|
91
|
-
export declare const formatZonedDateTime: (dateTime: string, locale?: string) => string;
|
|
92
116
|
/**
|
|
93
117
|
* Formats a stored trigger datetime — a zone-local wall time, or an absolute
|
|
94
118
|
* instant written by an older client — as the wall time it shows in the
|
|
@@ -100,7 +124,7 @@ export declare const formatScheduledTaskTriggerTime: (value: string, timezone: s
|
|
|
100
124
|
* stored wall time is shown as is, and the zone is appended when it differs
|
|
101
125
|
* from the viewer's.
|
|
102
126
|
*/
|
|
103
|
-
export declare const formatScheduledTaskScheduleLabel: (task: ScheduledTaskDto, labels: ScheduledTaskScheduleLabels, { locale, browserTimezone, }?: ScheduledTaskScheduleLabelOptions) => string;
|
|
127
|
+
export declare const formatScheduledTaskScheduleLabel: (task: ScheduledTaskDto, labels: ScheduledTaskScheduleLabels, { locale, browserTimezone, alwaysShowTimezone, }?: ScheduledTaskScheduleLabelOptions) => string;
|
|
104
128
|
/** Maps a scheduled-task DTO to the scheduled-tasks lib's card item. */
|
|
105
129
|
export declare const toScheduledTaskItem: (task: ScheduledTaskDto, labels: ScheduledTaskScheduleLabels, options?: ScheduledTaskScheduleLabelOptions) => ScheduledTaskItem;
|
|
106
130
|
/** Maps scheduled-task DTOs to card items, preserving order. */
|
|
@@ -117,4 +141,27 @@ export declare const toScheduledTaskRunItems: (runs: ScheduledTaskRunDto[], opti
|
|
|
117
141
|
export declare const classifyScheduledTaskDeleteError: (status: number | undefined) => ScheduledTaskDeleteErrorKind;
|
|
118
142
|
/** Returns the admin-consent message, else the scheduler's own trimmed reason, else the fallback. */
|
|
119
143
|
export declare const selectScheduledTaskErrorMessage: (details: Pick<ApiErrorDetails, "code" | "upstreamMessage">, { adminConsentRequired, fallback }: ScheduledTaskErrorMessages) => string;
|
|
144
|
+
/**
|
|
145
|
+
* Formats a task's `nextRunTime`, an absolute instant, in the viewer's zone and
|
|
146
|
+
* names that zone, e.g. `Nov 19, 2026, 5:45 PM (Europe/Kyiv)`. The instant is
|
|
147
|
+
* formatted in the same zone the suffix names, so the two cannot disagree.
|
|
148
|
+
* Without a resolvable viewer zone the instant is shown in the runtime's
|
|
149
|
+
* default zone with no suffix.
|
|
150
|
+
*/
|
|
151
|
+
export declare const formatScheduledTaskNextRunTime: (nextRunTime: string, labels: ScheduledTaskZoneLabels, { locale, browserTimezone, }?: ScheduledTaskNextRunOptions) => string;
|
|
152
|
+
/**
|
|
153
|
+
* Formats a cron activity window as task-zone wall times and always names the
|
|
154
|
+
* task's zone (`UTC` when it has none). Without an explicit start date the
|
|
155
|
+
* window begins at the next scheduled occurrence: the server's `nextRunTime`,
|
|
156
|
+
* or one computed from the cron fields when the server has none (e.g. an
|
|
157
|
+
* inactive task). Returns `undefined` when the window has no end date.
|
|
158
|
+
*/
|
|
159
|
+
export declare const formatScheduledTaskActiveWindow: (task: Pick<ScheduledTaskDto, "trigger" | "timezone" | "nextRunTime">, labels: ScheduledTaskActiveWindowLabels, locale?: string) => string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Returns why the task cannot be turned on, or `undefined` when it can. This is
|
|
162
|
+
* the fallback for tasks whose `isCompleted` is missing (a failed runs check)
|
|
163
|
+
* or whose last run is still in flight: a one-time schedule with no next run
|
|
164
|
+
* has already fired, and a cron schedule whose window ended cannot run again.
|
|
165
|
+
*/
|
|
166
|
+
export declare const getScheduledTaskActivationBlock: (task: Pick<ScheduledTaskDto, "triggerType" | "nextRunTime" | "trigger">, now?: number) => ScheduledTaskActivationBlock | undefined;
|
|
120
167
|
//# sourceMappingURL=scheduled-task-display.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-display.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-display.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"scheduled-task-display.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-display.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK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,+BAA+B,GAC1C,WAAW,MAAM,EACjB,iBAAiB,MAAM,GAAG,IAAI,GAAG,SAAS,EAC1C,QAAQ,+BAA+B,EACvC,mCAIG,gCAAqC,KACvC,MAWF,CAAC;AAgBF,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,GACjC,KAAK,mBAAmB,EACxB,wFAOG,2BAA2B,KAC7B,oBAyBF,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,GAClC,MAAM,mBAAmB,EAAE,EAC3B,SAAS,2BAA2B,KACnC,oBAAoB,EACkC,CAAC;AAE1D,4EAA4E;AAC5E,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,MAAM,GAAG,SAAS,KACzB,4BAKF,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,+BAA+B,GAC1C,SAAS,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,iBAAiB,CAAC,EAC1D,oCAAoC,0BAA0B,KAC7D,MAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GACzC,aAAa,MAAM,EACnB,QAAQ,uBAAuB,EAC/B,+BAGG,2BAAgC,KAClC,MAOF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,GAC1C,MAAM,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC,EACpE,QAAQ,+BAA+B,EACvC,SAAS,MAAM,KACd,MAAM,GAAG,SAgBX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,GAC1C,MAAM,IAAI,CAAC,gBAAgB,EAAE,aAAa,GAAG,aAAa,GAAG,SAAS,CAAC,EACvE,MAAK,MAAmB,KACvB,4BAA4B,GAAG,SAcjC,CAAC"}
|
|
@@ -1,74 +1,81 @@
|
|
|
1
1
|
import { ScheduledTaskTriggerDescriptionKind as e, describeScheduledTaskTrigger as t } from "./scheduled-task-description.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { getBrowserTimezone as n } from "../shared/browser-timezone.js";
|
|
3
|
+
import { isSameTimezone as r } from "../shared/timezones.js";
|
|
4
|
+
import { getNextCronOccurrence as i, hasScheduledTaskWindowEnded as a } from "./scheduled-task-next-occurrence.js";
|
|
5
|
+
import { SCHEDULED_TASK_WALL_DATE_TIME_PATTERN as o, formatScheduledTaskClockTime as s, formatScheduledTaskInstant as c, formatScheduledTaskRunDate as l, formatScheduledTaskRunTime as u, formatScheduledTaskWeekdays as d, formatZonedDateTime as f } from "./scheduled-task-time-format.js";
|
|
6
|
+
import { ScheduledTaskDtoTriggerTypeEnum as p, ScheduledTaskErrorCode as m, ScheduledTaskRunDtoStatusEnum as h } from "@epam/ai-dial-chat-api-client";
|
|
7
|
+
import { ScheduledTaskRunStatus as g, instantToZonedDateTime as _, isAbsoluteInstant as v } from "@epam/ai-dial-scheduled-tasks";
|
|
5
8
|
//#region src/scheduled-task/scheduled-task-display.ts
|
|
6
|
-
var
|
|
9
|
+
var y = /* @__PURE__ */ function(e) {
|
|
10
|
+
return e.OneTimeFired = "oneTimeFired", e.WindowEnded = "windowEnded", e;
|
|
11
|
+
}({}), b = /* @__PURE__ */ function(e) {
|
|
7
12
|
return e.NotFound = "notFound", e.Retryable = "retryable", e.Generic = "generic", e;
|
|
8
|
-
}({}),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
switch (c.kind) {
|
|
21
|
-
case e.OneTime: return u(i.onceAt(h(c.dateTime ?? "", a)));
|
|
22
|
-
case e.EveryNMinutes: return i.everyNMinutes(c.intervalMinutes ?? 0);
|
|
23
|
-
case e.Hourly: return u(i.hourlyAt(l));
|
|
24
|
-
case e.Daily: return u(i.dailyAt(l));
|
|
25
|
-
case e.Weekly: return u(i.weeklyAt(p(c.daysOfWeek ?? [c.dayOfWeek ?? ""], a), l));
|
|
26
|
-
case e.Monthly: return u(i.monthlyAt(c.dayOfMonth ?? "", l));
|
|
13
|
+
}({}), x = 60, S = 3600, C = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), w = (e, t, n) => {
|
|
14
|
+
let r = v(e) ? _(e, t) : e.slice(0, 16);
|
|
15
|
+
return !r || !o.test(r) ? e : f(r, n);
|
|
16
|
+
}, T = (n, i, { locale: a, browserTimezone: o = Intl.DateTimeFormat().resolvedOptions().timeZone, alwaysShowTimezone: c = !1 } = {}) => {
|
|
17
|
+
let l = n.timezone || "UTC", u = t(n.trigger, { timezone: l }), p = u.time ?? "", m = s(p, a), h = (e) => i.withTimezone && (c || !r(l, o)) ? i.withTimezone(e, l) : e;
|
|
18
|
+
switch (u.kind) {
|
|
19
|
+
case e.OneTime: return h(i.onceAt(f(u.dateTime ?? "", a)));
|
|
20
|
+
case e.EveryNMinutes: return i.everyNMinutes(u.intervalMinutes ?? 0);
|
|
21
|
+
case e.Hourly: return h(i.hourlyAt(p));
|
|
22
|
+
case e.Daily: return h(i.dailyAt(m));
|
|
23
|
+
case e.Weekly: return h(i.weeklyAt(d(u.daysOfWeek ?? [u.dayOfWeek ?? ""], a), m));
|
|
24
|
+
case e.Monthly: return h(i.monthlyAt(u.dayOfMonth ?? "", m));
|
|
27
25
|
case e.Invalid: return i.invalid;
|
|
28
26
|
default: return i.recurringFallback;
|
|
29
27
|
}
|
|
30
|
-
},
|
|
28
|
+
}, E = (e, t, n) => ({
|
|
31
29
|
id: e.id,
|
|
32
30
|
displayName: e.displayName,
|
|
33
31
|
descriptionPreview: e.description,
|
|
34
|
-
scheduleLabel:
|
|
32
|
+
scheduleLabel: T(e, t, n),
|
|
35
33
|
isActive: e.isActive,
|
|
36
34
|
isCompleted: e.isCompleted
|
|
37
|
-
}),
|
|
35
|
+
}), D = (e, t, n) => e.map((e) => E(e, t, n)), O = (e, t) => {
|
|
38
36
|
if (e == null) return;
|
|
39
37
|
let n = [
|
|
40
|
-
[Math.floor(e /
|
|
41
|
-
[Math.floor(e %
|
|
42
|
-
[e %
|
|
38
|
+
[Math.floor(e / S), t.hours],
|
|
39
|
+
[Math.floor(e % S / x), t.minutes],
|
|
40
|
+
[e % x, t.seconds]
|
|
43
41
|
].filter(([e]) => e > 0).map(([e, t]) => t(e));
|
|
44
42
|
return t.suffix(n.length ? n.join(" ") : t.seconds(0));
|
|
45
|
-
},
|
|
46
|
-
let o = new Date(e), s =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}).format(o), s), l = r ? b(t, r) : void 0;
|
|
50
|
-
return l ? `${c} ${l}` : c;
|
|
51
|
-
}, S = (e) => {
|
|
43
|
+
}, k = (e, t, n, { durationLabels: r, locale: i, now: a = /* @__PURE__ */ new Date() } = {}) => {
|
|
44
|
+
let o = new Date(e), s = u(o, i), c = C(o, a) ? n.todayAt(s) : n.dateAt(l(o, i), s), d = r ? O(t, r) : void 0;
|
|
45
|
+
return d ? `${c} ${d}` : c;
|
|
46
|
+
}, A = (e) => {
|
|
52
47
|
switch (e) {
|
|
53
|
-
case
|
|
54
|
-
case
|
|
55
|
-
case
|
|
56
|
-
default: return
|
|
48
|
+
case h.Success: return g.Success;
|
|
49
|
+
case h.Error: return g.Error;
|
|
50
|
+
case h.InProgress: return g.InProgress;
|
|
51
|
+
default: return g.Missed;
|
|
57
52
|
}
|
|
58
|
-
},
|
|
53
|
+
}, j = (e, { timestampLabels: t, durationLabels: n, conversations: r, conversationIdsMatch: i, locale: a, now: o }) => {
|
|
59
54
|
let { conversationId: s } = e, c = s ? r.find((e) => i(e.id, s)) : void 0;
|
|
60
55
|
return {
|
|
61
56
|
id: e.id,
|
|
62
|
-
status:
|
|
63
|
-
timestampLabel:
|
|
57
|
+
status: A(e.status),
|
|
58
|
+
timestampLabel: k(e.startTime, void 0, t, {
|
|
64
59
|
locale: a,
|
|
65
60
|
now: o
|
|
66
61
|
}),
|
|
67
|
-
durationLabel:
|
|
62
|
+
durationLabel: O(e.durationSeconds, n),
|
|
68
63
|
conversationId: s,
|
|
69
64
|
isUnread: c?.isUnread === !0,
|
|
70
65
|
errorText: e.errorText
|
|
71
66
|
};
|
|
72
|
-
},
|
|
67
|
+
}, M = (e, t) => e.map((e) => j(e, t)), N = (e) => e === 404 || e === 409 ? "notFound" : e === 502 ? "retryable" : "generic", P = (e, { adminConsentRequired: t, fallback: n }) => e.code === m.ScheduledTaskAdminConsentRequired ? t : e.upstreamMessage?.trim() || n, F = (e, t, { locale: r, browserTimezone: i = n() } = {}) => {
|
|
68
|
+
let a = c(e, r, i);
|
|
69
|
+
return i ? t.withTimezone(a, i) : a;
|
|
70
|
+
}, I = (e, t, n) => {
|
|
71
|
+
let r = e.trigger.cron;
|
|
72
|
+
if (!r?.endDate) return;
|
|
73
|
+
let a = e.timezone || "UTC", o = r.startDate ?? e.nextRunTime ?? i(r, a);
|
|
74
|
+
if (o) return t.withTimezone(t.range(w(o, a, n), w(r.endDate, a, n)), a);
|
|
75
|
+
}, L = (e, t = Date.now()) => {
|
|
76
|
+
if (e.triggerType === p.Date && e.nextRunTime == null) return "oneTimeFired";
|
|
77
|
+
let n = e.trigger.cron?.endDate;
|
|
78
|
+
if (e.triggerType === p.Cron && n != null && a(n, t)) return "windowEnded";
|
|
79
|
+
};
|
|
73
80
|
//#endregion
|
|
74
|
-
export {
|
|
81
|
+
export { y as ScheduledTaskActivationBlock, b as ScheduledTaskDeleteErrorKind, N as classifyScheduledTaskDeleteError, I as formatScheduledTaskActiveWindow, F as formatScheduledTaskNextRunTime, O as formatScheduledTaskRunDuration, k as formatScheduledTaskRunTimestamp, T as formatScheduledTaskScheduleLabel, w as formatScheduledTaskTriggerTime, L as getScheduledTaskActivationBlock, P as selectScheduledTaskErrorMessage, E as toScheduledTaskItem, D as toScheduledTaskItems, j as toScheduledTaskRunItem, M as toScheduledTaskRunItems };
|
|
@@ -8,4 +8,6 @@ import { ScheduleCronDto } from '@epam/ai-dial-chat-api-client';
|
|
|
8
8
|
* evaluate or the zone is unknown.
|
|
9
9
|
*/
|
|
10
10
|
export declare const getNextCronOccurrence: (cron: ScheduleCronDto, timezone: string, from?: Date) => string | undefined;
|
|
11
|
+
/** Returns whether a cron activity window's `endDate` is at or before `now` (epoch ms, default: the current time). */
|
|
12
|
+
export declare const hasScheduledTaskWindowEnded: (endDate: string, now?: number) => boolean;
|
|
11
13
|
//# sourceMappingURL=scheduled-task-next-occurrence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-next-occurrence.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-next-occurrence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA8BrE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,eAAe,EACrB,UAAU,MAAM,EAChB,OAAM,IAAiB,KACtB,MAAM,GAAG,SAmCX,CAAC"}
|
|
1
|
+
{"version":3,"file":"scheduled-task-next-occurrence.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-next-occurrence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA8BrE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,eAAe,EACrB,UAAU,MAAM,EAChB,OAAM,IAAiB,KACtB,MAAM,GAAG,SAmCX,CAAC;AAEF,sHAAsH;AACtH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,MAAK,MAAmB,KACvB,OAA6C,CAAC"}
|
|
@@ -15,6 +15,6 @@ var n = "last", r = 366, i = /^\d+$/, a = 864e5, o = (e, t, r) => t == null ? r
|
|
|
15
15
|
let t = new Date(g + e * a), n = `${t.toISOString().slice(0, 10)}T${h}`;
|
|
16
16
|
if (n > m && o(t, f, p)) return n;
|
|
17
17
|
}
|
|
18
|
-
};
|
|
18
|
+
}, c = (e, t = Date.now()) => new Date(e).getTime() <= t;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { s as getNextCronOccurrence };
|
|
20
|
+
export { s as getNextCronOccurrence, c as hasScheduledTaskWindowEnded };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** A zone-local `YYYY-MM-DDTHH:mm`, the shape the wall-time formatter can show. */
|
|
2
|
+
export declare const SCHEDULED_TASK_WALL_DATE_TIME_PATTERN: RegExp;
|
|
3
|
+
/** Style of a weekday name. */
|
|
4
|
+
export declare enum ScheduledTaskWeekdayStyle {
|
|
5
|
+
Long = "long",
|
|
6
|
+
Narrow = "narrow"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Formats a stored `HH:mm` wall time as the locale's short clock time (`9:00 AM`
|
|
10
|
+
* or `09:00`) without converting it to another zone. Returns the raw value when
|
|
11
|
+
* it is not a valid `HH:mm`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const formatScheduledTaskClockTime: (time: string, locale?: string) => string;
|
|
14
|
+
/** Formats a zone-local `YYYY-MM-DDTHH:mm` as a medium date and short time without converting it to another zone. */
|
|
15
|
+
export declare const formatZonedDateTime: (dateTime: string, locale?: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Formats an absolute instant (an ISO string such as `nextRunTime`) as a medium
|
|
18
|
+
* date and short time in `timeZone`, or in the viewer's zone when it is
|
|
19
|
+
* omitted. A host that labels the value with a zone passes that same zone, so
|
|
20
|
+
* the clock time and the label cannot disagree. Returns the raw value when the
|
|
21
|
+
* instant is not a date or the zone is unknown.
|
|
22
|
+
*/
|
|
23
|
+
export declare const formatScheduledTaskInstant: (instant: string, locale?: string, timeZone?: string) => string;
|
|
24
|
+
/** Formats the time of day of an instant as the locale's short time in the viewer's zone, e.g. `11:00 AM`. */
|
|
25
|
+
export declare const formatScheduledTaskRunTime: (date: Date, locale?: string) => string;
|
|
26
|
+
/** Formats the calendar day of an instant without a year in the viewer's zone, e.g. `Nov 17`. */
|
|
27
|
+
export declare const formatScheduledTaskRunDate: (date: Date, locale?: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Formats an APScheduler weekday (`'0'` is Monday) as its localized name.
|
|
30
|
+
* 2023-01-02 was a Monday and the formatter runs in UTC, so the name is the
|
|
31
|
+
* segment's own day, not the viewer's local calendar's.
|
|
32
|
+
*/
|
|
33
|
+
export declare const formatScheduledTaskWeekday: (dayOfWeek: string | number | undefined, locale?: string, style?: ScheduledTaskWeekdayStyle) => string;
|
|
34
|
+
/** Formats several APScheduler weekdays as one locale list, e.g. `Monday, Wednesday and Friday`. */
|
|
35
|
+
export declare const formatScheduledTaskWeekdays: (daysOfWeek: string[], locale?: string) => string;
|
|
36
|
+
//# sourceMappingURL=scheduled-task-time-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled-task-time-format.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-time-format.ts"],"names":[],"mappings":"AAcA,mFAAmF;AACnF,eAAO,MAAM,qCAAqC,QACf,CAAC;AAIpC,+BAA+B;AAC/B,oBAAY,yBAAyB;IACnC,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,EACZ,SAAS,MAAM,KACd,MAUF,CAAC;AAEF,qHAAqH;AACrH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAChB,SAAS,MAAM,KACd,MAKqC,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,WAAW,MAAM,KAChB,MAUF,CAAC;AAEF,8GAA8G;AAC9G,eAAO,MAAM,0BAA0B,GACrC,MAAM,IAAI,EACV,SAAS,MAAM,KACd,MACmE,CAAC;AAEvE,iGAAiG;AACjG,eAAO,MAAM,0BAA0B,GACrC,MAAM,IAAI,EACV,SAAS,MAAM,KACd,MAGA,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,GAAG,MAAM,GAAG,SAAS,EACtC,SAAS,MAAM,EACf,QAAO,yBAA0D,KAChE,MAGA,CAAC;AAEJ,oGAAoG;AACpG,eAAO,MAAM,2BAA2B,GACtC,YAAY,MAAM,EAAE,EACpB,SAAS,MAAM,KACd,MAKA,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/scheduled-task/scheduled-task-time-format.ts
|
|
2
|
+
var e = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/, t = /^(\d{1,2}):(\d{2})$/, n = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.Long = "long", e.Narrow = "narrow", e;
|
|
4
|
+
}({}), r = (e, n) => {
|
|
5
|
+
let r = t.exec(e);
|
|
6
|
+
if (!r) return e;
|
|
7
|
+
let i = Number(r[1]), a = Number(r[2]);
|
|
8
|
+
return i > 23 || a > 59 ? e : new Intl.DateTimeFormat(n, {
|
|
9
|
+
timeStyle: "short",
|
|
10
|
+
timeZone: "UTC"
|
|
11
|
+
}).format(new Date(Date.UTC(1970, 0, 1, i, a)));
|
|
12
|
+
}, i = (e, t) => new Intl.DateTimeFormat(t, {
|
|
13
|
+
dateStyle: "medium",
|
|
14
|
+
timeStyle: "short",
|
|
15
|
+
timeZone: "UTC"
|
|
16
|
+
}).format(/* @__PURE__ */ new Date(`${e}:00Z`)), a = (e, t, n) => {
|
|
17
|
+
try {
|
|
18
|
+
return new Intl.DateTimeFormat(t, {
|
|
19
|
+
dateStyle: "medium",
|
|
20
|
+
timeStyle: "short",
|
|
21
|
+
timeZone: n
|
|
22
|
+
}).format(new Date(e));
|
|
23
|
+
} catch {
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
}, o = (e, t) => new Intl.DateTimeFormat(t, { timeStyle: "short" }).format(e), s = (e, t) => new Intl.DateTimeFormat(t, {
|
|
27
|
+
month: "short",
|
|
28
|
+
day: "numeric"
|
|
29
|
+
}).format(e), c = (e, t, n = "long") => new Intl.DateTimeFormat(t, {
|
|
30
|
+
weekday: n,
|
|
31
|
+
timeZone: "UTC"
|
|
32
|
+
}).format(new Date(Date.UTC(2023, 0, 2 + Number(e)))), l = (e, t) => new Intl.ListFormat(t, { type: "conjunction" }).format(e.map((e) => c(e, t)));
|
|
33
|
+
//#endregion
|
|
34
|
+
export { e as SCHEDULED_TASK_WALL_DATE_TIME_PATTERN, n as ScheduledTaskWeekdayStyle, r as formatScheduledTaskClockTime, a as formatScheduledTaskInstant, s as formatScheduledTaskRunDate, o as formatScheduledTaskRunTime, c as formatScheduledTaskWeekday, l as formatScheduledTaskWeekdays, i as formatZonedDateTime };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-trigger.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAEhB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,6BAA6B,EACnC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,0BAA0B,CAAC;AAuFlC;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,6BAA6B,KACpC,0BAuCF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,6BAA6B,KACpC,0BAGD,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled-task-trigger.d.ts","sourceRoot":"","sources":["../../src/scheduled-task/scheduled-task-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAEhB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,6BAA6B,EACnC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,0BAA0B,CAAC;AAuFlC;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,6BAA6B,KACpC,0BAuCF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,6BAA6B,KACpC,0BAGD,CAAC;AAqIH;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC1C,KAAK,gBAAgB,KACpB,6BA4HF,CAAC"}
|
|
@@ -44,30 +44,29 @@ var o = /* @__PURE__ */ new Set([
|
|
|
44
44
|
...v(e),
|
|
45
45
|
skillUrls: [...new Set(e.skillUrls ?? [])]
|
|
46
46
|
}), b = (e, t) => a(e) ? i(e, t) ?? e.slice(0, f) : e.slice(0, f), x = (e, t) => b(e, t).slice(0, d), S = (t) => {
|
|
47
|
-
let n = new Set(Object.entries(t).filter(([, e]) => e != null).map(([e]) => e)), r = [...n].filter((e) => !o.has(e)), i = n.has("day_of_week"), a = n.has("day");
|
|
48
|
-
if (
|
|
49
|
-
if (t.hour === "*" && l.test(String(t.minute)) && !i && !a) return {
|
|
47
|
+
let n = new Set(Object.entries(t).filter(([, e]) => e != null).map(([e]) => e)), r = [...n].filter((e) => !o.has(e)), i = n.has("day_of_week"), a = n.has("day"), s = n.has("hour"), u = n.has("minute");
|
|
48
|
+
if (u && (!s || t.hour === "*") && !i && !a && l.test(String(t.minute))) return {
|
|
50
49
|
ok: !0,
|
|
51
50
|
isHourly: !0,
|
|
52
51
|
minute: String(Number(t.minute))
|
|
53
52
|
};
|
|
54
|
-
if (!l.test(String(t.hour)) || !l.test(String(t.minute))) return { ok: !1 };
|
|
55
|
-
let
|
|
56
|
-
if (
|
|
57
|
-
if (
|
|
53
|
+
if (r.length > 0 || i && a || !s || !u || !l.test(String(t.hour)) || !l.test(String(t.minute))) return { ok: !1 };
|
|
54
|
+
let d = `${e(Number(t.hour))}:${e(Number(t.minute))}`, f = i ? String(t.day_of_week).split(",") : [];
|
|
55
|
+
if (f.some((e) => !c.test(e)) || new Set(f).size !== f.length) return { ok: !1 };
|
|
56
|
+
if (f.length > 1) return {
|
|
58
57
|
ok: !0,
|
|
59
58
|
isHourly: !1,
|
|
60
59
|
isCustom: !0,
|
|
61
|
-
time:
|
|
62
|
-
daysOfWeek: p(
|
|
60
|
+
time: d,
|
|
61
|
+
daysOfWeek: p(f)
|
|
63
62
|
};
|
|
64
|
-
let
|
|
65
|
-
return
|
|
63
|
+
let m = a ? String(t.day) : void 0;
|
|
64
|
+
return m !== void 0 && (!l.test(m) || Number(m) < 1 || Number(m) > 31) ? { ok: !1 } : {
|
|
66
65
|
ok: !0,
|
|
67
66
|
isHourly: !1,
|
|
68
|
-
time:
|
|
69
|
-
...
|
|
70
|
-
...
|
|
67
|
+
time: d,
|
|
68
|
+
...f.length ? { dayOfWeek: f[0] } : {},
|
|
69
|
+
...m ? { dayOfMonth: String(Number(m)) } : {}
|
|
71
70
|
};
|
|
72
71
|
}, C = (e) => {
|
|
73
72
|
if (!e.model || typeof e.prompt != "string" || !e.prompt.trim() && !e.skillUrls?.length) return {
|
package/scheduled-tasks.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { UnsupportedTriggerReason as e } from "./scheduled-task/scheduled-task-mapping.js";
|
|
2
2
|
import { ScheduledTaskTriggerDescriptionKind as t, describeScheduledTaskTrigger as n } from "./scheduled-task/scheduled-task-description.js";
|
|
3
3
|
import { UTC_TIMEZONE_ID as r, findTimezoneOption as i, getTimezoneOptions as a, isKnownTimezone as o, isSameTimezone as s } from "./shared/timezones.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
4
|
+
import { getNextCronOccurrence as c, hasScheduledTaskWindowEnded as l } from "./scheduled-task/scheduled-task-next-occurrence.js";
|
|
5
|
+
import { SCHEDULED_TASK_WALL_DATE_TIME_PATTERN as u, ScheduledTaskWeekdayStyle as d, formatScheduledTaskClockTime as f, formatScheduledTaskInstant as p, formatScheduledTaskRunDate as m, formatScheduledTaskRunTime as h, formatScheduledTaskWeekday as g, formatScheduledTaskWeekdays as _, formatZonedDateTime as v } from "./scheduled-task/scheduled-task-time-format.js";
|
|
6
|
+
import { ScheduledTaskActivationBlock as y, ScheduledTaskDeleteErrorKind as b, classifyScheduledTaskDeleteError as x, formatScheduledTaskActiveWindow as S, formatScheduledTaskNextRunTime as C, formatScheduledTaskRunDuration as w, formatScheduledTaskRunTimestamp as T, formatScheduledTaskScheduleLabel as E, formatScheduledTaskTriggerTime as D, getScheduledTaskActivationBlock as O, selectScheduledTaskErrorMessage as k, toScheduledTaskItem as A, toScheduledTaskItems as j, toScheduledTaskRunItem as M, toScheduledTaskRunItems as N } from "./scheduled-task/scheduled-task-display.js";
|
|
7
|
+
import { mapFormValuesToCreateBody as P, mapFormValuesToUpdateBody as F, mapScheduledTaskDtoToFormValues as I } from "./scheduled-task/scheduled-task-trigger.js";
|
|
8
|
+
import { prepareScheduledTaskCreateBody as L, prepareScheduledTaskUpdateBody as R } from "./scheduled-task/scheduled-task-preparation.js";
|
|
9
|
+
import { createScheduledTasksApiClient as z } from "./scheduled-task/scheduled-tasks-api-client.js";
|
|
10
|
+
import { useScheduledTasks as B } from "./scheduled-task/use-scheduled-tasks.js";
|
|
11
|
+
import { mergeRunsById as V, useScheduledTaskRuns as H } from "./scheduled-task/use-scheduled-task-runs.js";
|
|
12
|
+
import { ScheduledTaskRunStatusFeedback as U, mergeScheduledTaskRuns as W, useStartScheduledTask as G } from "./scheduled-task/useStartScheduledTask.js";
|
|
13
|
+
import { checkScheduledTaskAuthSessionError as K } from "./scheduled-task/check-scheduled-task-auth-session-error.js";
|
|
14
|
+
import { useScheduledTaskSkillDisplayNames as q } from "./scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.js";
|
|
15
|
+
import { ActiveScheduledTaskDetailState as J, ActiveScheduledTaskStatus as Y, resolveActiveScheduledTask as X } from "./scheduled-task/active-scheduled-task.js";
|
|
16
|
+
import { useActiveScheduledTaskDetails as Z } from "./scheduled-task/useActiveScheduledTaskDetails.js";
|
|
17
|
+
export { J as ActiveScheduledTaskDetailState, Y as ActiveScheduledTaskStatus, u as SCHEDULED_TASK_WALL_DATE_TIME_PATTERN, y as ScheduledTaskActivationBlock, b as ScheduledTaskDeleteErrorKind, U as ScheduledTaskRunStatusFeedback, t as ScheduledTaskTriggerDescriptionKind, d as ScheduledTaskWeekdayStyle, r as UTC_TIMEZONE_ID, e as UnsupportedTriggerReason, K as checkScheduledTaskAuthSessionError, x as classifyScheduledTaskDeleteError, z as createScheduledTasksApiClient, n as describeScheduledTaskTrigger, i as findTimezoneOption, S as formatScheduledTaskActiveWindow, f as formatScheduledTaskClockTime, p as formatScheduledTaskInstant, C as formatScheduledTaskNextRunTime, m as formatScheduledTaskRunDate, w as formatScheduledTaskRunDuration, h as formatScheduledTaskRunTime, T as formatScheduledTaskRunTimestamp, E as formatScheduledTaskScheduleLabel, D as formatScheduledTaskTriggerTime, g as formatScheduledTaskWeekday, _ as formatScheduledTaskWeekdays, v as formatZonedDateTime, c as getNextCronOccurrence, O as getScheduledTaskActivationBlock, a as getTimezoneOptions, l as hasScheduledTaskWindowEnded, o as isKnownTimezone, s as isSameTimezone, P as mapFormValuesToCreateBody, F as mapFormValuesToUpdateBody, I as mapScheduledTaskDtoToFormValues, V as mergeRunsById, W as mergeScheduledTaskRuns, L as prepareScheduledTaskCreateBody, R as prepareScheduledTaskUpdateBody, X as resolveActiveScheduledTask, k as selectScheduledTaskErrorMessage, A as toScheduledTaskItem, j as toScheduledTaskItems, M as toScheduledTaskRunItem, N as toScheduledTaskRunItems, Z as useActiveScheduledTaskDetails, H as useScheduledTaskRuns, q as useScheduledTaskSkillDisplayNames, B as useScheduledTasks, G as useStartScheduledTask };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-archive.d.ts","sourceRoot":"","sources":["../../src/skill/skill-archive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-archive.d.ts","sourceRoot":"","sources":["../../src/skill/skill-archive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AA0BvE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,IAAI,KACZ,OAAO,CAAC,oBAAoB,EAAE,CAsBhC,CAAC"}
|
package/skill/skill-archive.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { SKILL_FOLDER_MARKER as e, nameFromPath as t } from "./skill.js";
|
|
2
2
|
import { inferMimeTypeFromPath as n } from "@epam/ai-dial-chat-shared";
|
|
3
|
-
import { unzipSync as r } from "fflate";
|
|
4
3
|
//#region src/skill/skill-archive.ts
|
|
5
|
-
var
|
|
4
|
+
var r = "__MACOSX/", i = ".DS_Store", a = (n) => n.endsWith("/") || n.startsWith(r) || t(n) === i || t(n) === e, o = (e) => new Promise((t, n) => {
|
|
6
5
|
let r = new FileReader();
|
|
7
6
|
r.onload = () => t(new Uint8Array(r.result)), r.onerror = () => n(r.error), r.readAsArrayBuffer(e);
|
|
8
|
-
}),
|
|
9
|
-
let i =
|
|
10
|
-
return Object.entries(
|
|
7
|
+
}), s = async (e) => {
|
|
8
|
+
let r = await o(e), { unzipSync: i } = await import("fflate"), s = i(r);
|
|
9
|
+
return Object.entries(s).flatMap(([e, r]) => {
|
|
11
10
|
let i = e.replace(/\\/g, "/");
|
|
12
|
-
return
|
|
11
|
+
return a(i) ? [] : [{
|
|
13
12
|
path: i,
|
|
14
13
|
file: new File([r], t(i), { type: n(i) ?? "" })
|
|
15
14
|
}];
|
|
16
15
|
});
|
|
17
16
|
};
|
|
18
17
|
//#endregion
|
|
19
|
-
export {
|
|
18
|
+
export { s as extractSkillArchive };
|
|
@@ -39,6 +39,12 @@ export interface SkillFileBatchValidationMessages {
|
|
|
39
39
|
}
|
|
40
40
|
/** Snapshot of editor state the batch validator projects new totals against. */
|
|
41
41
|
export interface SkillFileBatchValidationContext {
|
|
42
|
+
/** Maximum total files including SKILL.md. When omitted, the server checks the count. */
|
|
43
|
+
maxFiles?: number;
|
|
44
|
+
/** Maximum bytes per file, including the manifest. Defaults to 1 MiB. */
|
|
45
|
+
maxFileBytes?: number;
|
|
46
|
+
/** Maximum total bytes, including the manifest. Defaults to 16 MiB. */
|
|
47
|
+
maxTotalBytes?: number;
|
|
42
48
|
/** Paths already present in the editor's supporting-file tree. */
|
|
43
49
|
existingPaths: string[];
|
|
44
50
|
/** Sum of the bytes already held for existing supporting files. */
|