opencode-windows-scheduler 1.4.0 → 1.5.0
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 +24 -0
- package/README.md +2 -2
- package/ROADMAP-STRATEGY.md +43 -24
- package/ROADMAP.md +280 -31
- package/dist/core/dry-run.d.ts +31 -0
- package/dist/core/dry-run.d.ts.map +1 -1
- package/dist/core/dry-run.js +129 -1
- package/dist/core/file-watcher.d.ts.map +1 -1
- package/dist/core/file-watcher.js +53 -10
- package/dist/core/git-trigger.d.ts +80 -0
- package/dist/core/git-trigger.d.ts.map +1 -0
- package/dist/core/git-trigger.js +288 -0
- package/dist/core/glob.d.ts +38 -0
- package/dist/core/glob.d.ts.map +1 -0
- package/dist/core/glob.js +233 -0
- package/dist/core/ps-wrapper.d.ts.map +1 -1
- package/dist/core/ps-wrapper.js +7 -0
- package/dist/core/schedule-gate.js +55 -30
- package/dist/core/schedule-v2.d.ts +29 -1
- package/dist/core/schedule-v2.d.ts.map +1 -1
- package/dist/core/schedule-v2.js +81 -3
- package/dist/core/scheduler/types.d.ts +1 -1
- package/dist/core/scheduler/types.d.ts.map +1 -1
- package/dist/core/wrappers/bash.d.ts.map +1 -1
- package/dist/core/wrappers/bash.js +4 -0
- package/dist/db/git-state-repo.d.ts +16 -0
- package/dist/db/git-state-repo.d.ts.map +1 -0
- package/dist/db/git-state-repo.js +38 -0
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +8 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +247 -26
- package/dist/rpc.d.ts +223 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +73 -0
- package/dist/task-transfer.d.ts +30 -3
- package/dist/task-transfer.d.ts.map +1 -1
- package/dist/task-transfer.js +83 -6
- package/dist/templates.d.ts +1 -1
- package/dist/templates.d.ts.map +1 -1
- package/docs/ARCHITECTURE.md +1 -0
- package/docs/FEATURES.md +51 -0
- package/docs/README.ru.md +2 -2
- package/gui-experimental.cjs +9 -4
- package/package.json +6 -3
- package/src/core/dry-run.ts +188 -1
- package/src/core/file-watcher.ts +65 -10
- package/src/core/git-trigger.ts +367 -0
- package/src/core/glob.ts +226 -0
- package/src/core/ps-wrapper.ts +7 -0
- package/src/core/schedule-gate.ts +67 -33
- package/src/core/schedule-v2.ts +108 -3
- package/src/core/scheduler/types.ts +1 -1
- package/src/core/wrappers/bash.ts +4 -0
- package/src/db/git-state-repo.ts +62 -0
- package/src/db/schema.ts +8 -0
- package/src/gui.tsx +225 -4
- package/src/index.ts +338 -28
- package/src/rpc.ts +73 -0
- package/src/task-transfer.ts +124 -5
- package/src/templates.ts +1 -1
package/src/gui.tsx
CHANGED
|
@@ -103,7 +103,7 @@ interface Job {
|
|
|
103
103
|
beforeScript?: string
|
|
104
104
|
/** Post-flight команда (undefined — не задана). */
|
|
105
105
|
afterScript?: string
|
|
106
|
-
triggerType?: "cron" | "file" | "mcp-event" | "once"
|
|
106
|
+
triggerType?: "cron" | "file" | "git" | "mcp-event" | "once"
|
|
107
107
|
/** Для triggerType "once" — время одного запуска (ISO-8601). */
|
|
108
108
|
runAt?: string | null
|
|
109
109
|
/** OpenCode-сессия: new — каждый запуск новая, reuse — переиспользовать, last — --continue. */
|
|
@@ -142,6 +142,22 @@ interface Job {
|
|
|
142
142
|
notBefore?: string | null
|
|
143
143
|
/** Окно запуска: конец "HH:MM" (может быть меньше notBefore). */
|
|
144
144
|
notAfter?: string | null
|
|
145
|
+
/** Разрешённые дни недели 0=Вс..6=Сб (null — все дни). */
|
|
146
|
+
activeDays?: number[] | null
|
|
147
|
+
/** Поведение вне окна: skip / postpone / run (null — postpone). */
|
|
148
|
+
windowPolicy?: "skip" | "postpone" | "run" | null
|
|
149
|
+
/** Glob-маски файлового триггера (null — любое изменение). */
|
|
150
|
+
watchGlobs?: string[] | null
|
|
151
|
+
/** Glob-маски игнорируемых файлов файлового триггера. */
|
|
152
|
+
watchIgnore?: string[] | null
|
|
153
|
+
/** Git-триггер: фильтр по ветке (glob, через запятую). */
|
|
154
|
+
gitBranch?: string | null
|
|
155
|
+
/** Git-триггер: маски изменённых файлов, запускающих задачу. */
|
|
156
|
+
gitPaths?: string[] | null
|
|
157
|
+
/** Git-триггер: маски игнорируемых изменённых файлов. */
|
|
158
|
+
gitIgnore?: string[] | null
|
|
159
|
+
/** Git-триггер: период опроса, секунды. */
|
|
160
|
+
gitPollSeconds?: number | null
|
|
145
161
|
/** Пауза до даты (ISO) — задача включится автоматически. */
|
|
146
162
|
pausedUntil?: string | null
|
|
147
163
|
}
|
|
@@ -161,9 +177,17 @@ interface CustomTemplate {
|
|
|
161
177
|
beforeScript?: string
|
|
162
178
|
afterScript?: string
|
|
163
179
|
dependsOn?: string[]
|
|
164
|
-
triggerType?: "cron" | "file" | "mcp-event"
|
|
180
|
+
triggerType?: "cron" | "file" | "git" | "mcp-event"
|
|
165
181
|
mcpEvent?: { server: string; event: string; filter?: string }
|
|
166
182
|
watchPath?: string
|
|
183
|
+
watchGlobs?: string[]
|
|
184
|
+
watchIgnore?: string[]
|
|
185
|
+
gitBranch?: string
|
|
186
|
+
gitPaths?: string[]
|
|
187
|
+
gitIgnore?: string[]
|
|
188
|
+
gitPollSeconds?: number
|
|
189
|
+
activeDays?: number[]
|
|
190
|
+
windowPolicy?: "skip" | "postpone" | "run"
|
|
167
191
|
workingDirectory?: string
|
|
168
192
|
workspaceId?: string
|
|
169
193
|
allowedTools?: string[]
|
|
@@ -246,6 +270,19 @@ function shortError(msg: string, limit = 150): string {
|
|
|
246
270
|
return firstLine.length > limit ? firstLine.slice(0, limit - 1).trimEnd() + "…" : firstLine
|
|
247
271
|
}
|
|
248
272
|
|
|
273
|
+
/** Разбивает строку из textarea в список: по запятым и переводам строк. */
|
|
274
|
+
function splitListInput(raw: string): string[] {
|
|
275
|
+
return (raw || "")
|
|
276
|
+
.split(/[\r\n,]+/)
|
|
277
|
+
.map((item) => item.trim())
|
|
278
|
+
.filter(Boolean)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** Обратное преобразование списка масок в строку для textarea. */
|
|
282
|
+
function joinListInput(list?: string[] | null): string {
|
|
283
|
+
return Array.isArray(list) ? list.join("\n") : ""
|
|
284
|
+
}
|
|
285
|
+
|
|
249
286
|
/** Пресеты cron-расписаний */
|
|
250
287
|
const CRON_PRESETS: Array<{ label: string; value: string }> = [
|
|
251
288
|
{ label: "Каждую минуту", value: "* * * * *" },
|
|
@@ -805,8 +842,8 @@ export default Plugin.define({
|
|
|
805
842
|
const [beforeScript, setBeforeScript] = createSignal("")
|
|
806
843
|
const [afterScript, setAfterScript] = createSignal("")
|
|
807
844
|
|
|
808
|
-
// Триггеры (cron / file / mcp-event / once) и рабочая директория
|
|
809
|
-
const [triggerType, setTriggerType] = createSignal<"cron" | "file" | "mcp-event" | "once">("cron")
|
|
845
|
+
// Триггеры (cron / file / git / mcp-event / once) и рабочая директория
|
|
846
|
+
const [triggerType, setTriggerType] = createSignal<"cron" | "file" | "git" | "mcp-event" | "once">("cron")
|
|
810
847
|
const [watchPath, setWatchPath] = createSignal("")
|
|
811
848
|
// Разовое время: ISO-8601 или задержка в секундах от нажатия "Запланировать".
|
|
812
849
|
const [runAt, setRunAt] = createSignal("")
|
|
@@ -818,6 +855,15 @@ export default Plugin.define({
|
|
|
818
855
|
const [timezone, setTimezone] = createSignal("")
|
|
819
856
|
const [notBefore, setNotBefore] = createSignal("")
|
|
820
857
|
const [notAfter, setNotAfter] = createSignal("")
|
|
858
|
+
// Спринт 27: дни недели, политика вне окна, glob- и git-фильтры.
|
|
859
|
+
const [activeDays, setActiveDays] = createSignal<number[]>([])
|
|
860
|
+
const [windowPolicy, setWindowPolicy] = createSignal<"skip" | "postpone" | "run">("postpone")
|
|
861
|
+
const [watchGlobs, setWatchGlobs] = createSignal("")
|
|
862
|
+
const [watchIgnore, setWatchIgnore] = createSignal("")
|
|
863
|
+
const [gitBranch, setGitBranch] = createSignal("")
|
|
864
|
+
const [gitPaths, setGitPaths] = createSignal("")
|
|
865
|
+
const [gitIgnore, setGitIgnore] = createSignal("")
|
|
866
|
+
const [gitPollSeconds, setGitPollSeconds] = createSignal("")
|
|
821
867
|
const [mcpServer, setMcpServer] = createSignal("")
|
|
822
868
|
const [mcpEventName, setMcpEventName] = createSignal("")
|
|
823
869
|
const [mcpFilter, setMcpFilter] = createSignal("")
|
|
@@ -932,6 +978,24 @@ export default Plugin.define({
|
|
|
932
978
|
}
|
|
933
979
|
}
|
|
934
980
|
|
|
981
|
+
/** Спринт 27: дни недели, политика окна и glob/git-фильтры для payload. */
|
|
982
|
+
const triggerExtrasPayload = () => {
|
|
983
|
+
const pollRaw = gitPollSeconds().trim()
|
|
984
|
+
const poll = pollRaw ? Number(pollRaw) : undefined
|
|
985
|
+
return {
|
|
986
|
+
activeDays: activeDays().length > 0 ? activeDays() : undefined,
|
|
987
|
+
windowPolicy: windowPolicy(),
|
|
988
|
+
watchGlobs: splitListInput(watchGlobs()),
|
|
989
|
+
watchIgnore: splitListInput(watchIgnore()),
|
|
990
|
+
gitBranch: (gitBranch() || "").trim(),
|
|
991
|
+
gitPaths: splitListInput(gitPaths()),
|
|
992
|
+
gitIgnore: splitListInput(gitIgnore()),
|
|
993
|
+
...(poll !== undefined && Number.isFinite(poll) && poll >= 5
|
|
994
|
+
? { gitPollSeconds: Math.floor(poll) }
|
|
995
|
+
: {}),
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
935
999
|
/** Сбрасывает поля формы матрицы. */
|
|
936
1000
|
function resetMatrixForm() {
|
|
937
1001
|
setMatrixMode(false)
|
|
@@ -1281,11 +1345,21 @@ export default Plugin.define({
|
|
|
1281
1345
|
setTriggerType(
|
|
1282
1346
|
t.triggerType === "file"
|
|
1283
1347
|
? "file"
|
|
1348
|
+
: t.triggerType === "git"
|
|
1349
|
+
? "git"
|
|
1284
1350
|
: t.triggerType === "mcp-event"
|
|
1285
1351
|
? "mcp-event"
|
|
1286
1352
|
: "cron"
|
|
1287
1353
|
)
|
|
1288
1354
|
setWatchPath(t.watchPath ?? "")
|
|
1355
|
+
setWatchGlobs(joinListInput(t.watchGlobs))
|
|
1356
|
+
setWatchIgnore(joinListInput(t.watchIgnore))
|
|
1357
|
+
setGitBranch(t.gitBranch ?? "")
|
|
1358
|
+
setGitPaths(joinListInput(t.gitPaths))
|
|
1359
|
+
setGitIgnore(joinListInput(t.gitIgnore))
|
|
1360
|
+
setGitPollSeconds(t.gitPollSeconds ? String(t.gitPollSeconds) : "")
|
|
1361
|
+
setActiveDays(Array.isArray(t.activeDays) ? t.activeDays : [])
|
|
1362
|
+
setWindowPolicy(t.windowPolicy ?? "postpone")
|
|
1289
1363
|
setTimezone(t.timezone ?? "")
|
|
1290
1364
|
setNotBefore(t.notBefore ?? "")
|
|
1291
1365
|
setNotAfter(t.notAfter ?? "")
|
|
@@ -1359,6 +1433,7 @@ export default Plugin.define({
|
|
|
1359
1433
|
}
|
|
1360
1434
|
: undefined,
|
|
1361
1435
|
watchPath: (watchPath() || "").trim(),
|
|
1436
|
+
...triggerExtrasPayload(),
|
|
1362
1437
|
workingDirectory: (workingDirectory() || "").trim(),
|
|
1363
1438
|
workspaceId: (workspaceId() || "").trim() || undefined,
|
|
1364
1439
|
allowedTools: allowedTools().length > 0 ? allowedTools() : undefined,
|
|
@@ -1553,6 +1628,7 @@ export default Plugin.define({
|
|
|
1553
1628
|
}
|
|
1554
1629
|
: undefined,
|
|
1555
1630
|
watchPath: (watchPath() || "").trim(),
|
|
1631
|
+
...triggerExtrasPayload(),
|
|
1556
1632
|
workingDirectory: (workingDirectory() || "").trim(),
|
|
1557
1633
|
workspaceId: (workspaceId() || "").trim() || undefined,
|
|
1558
1634
|
allowedTools: allowedTools().length > 0 ? allowedTools() : undefined,
|
|
@@ -1821,6 +1897,7 @@ export default Plugin.define({
|
|
|
1821
1897
|
}
|
|
1822
1898
|
: undefined,
|
|
1823
1899
|
watchPath: (watchPath() || "").trim(),
|
|
1900
|
+
...triggerExtrasPayload(),
|
|
1824
1901
|
workingDirectory: (workingDirectory() || "").trim(),
|
|
1825
1902
|
workspaceId: (workspaceId() || "").trim() || undefined,
|
|
1826
1903
|
allowedTools: allowedTools().length > 0 ? allowedTools() : [],
|
|
@@ -1890,6 +1967,16 @@ export default Plugin.define({
|
|
|
1890
1967
|
setAfterScript(job.afterScript ?? "")
|
|
1891
1968
|
setTriggerType(job.triggerType ?? "cron")
|
|
1892
1969
|
setWatchPath(job.watchPath ?? "")
|
|
1970
|
+
setWatchGlobs(joinListInput(job.watchGlobs))
|
|
1971
|
+
setWatchIgnore(joinListInput(job.watchIgnore))
|
|
1972
|
+
setGitBranch(job.gitBranch ?? "")
|
|
1973
|
+
setGitPaths(joinListInput(job.gitPaths))
|
|
1974
|
+
setGitIgnore(joinListInput(job.gitIgnore))
|
|
1975
|
+
setGitPollSeconds(
|
|
1976
|
+
typeof job.gitPollSeconds === "number" ? String(job.gitPollSeconds) : ""
|
|
1977
|
+
)
|
|
1978
|
+
setActiveDays(Array.isArray(job.activeDays) ? job.activeDays : [])
|
|
1979
|
+
setWindowPolicy(job.windowPolicy ?? "postpone")
|
|
1893
1980
|
setRunAt(job.runAt ?? "")
|
|
1894
1981
|
setDelaySeconds("")
|
|
1895
1982
|
setSession(job.session === "reuse" || job.session === "last" ? job.session : "new")
|
|
@@ -1963,6 +2050,13 @@ export default Plugin.define({
|
|
|
1963
2050
|
if (triggerType() === "once" && !(runAt() || "").trim() && !(delaySeconds() || "").trim()) {
|
|
1964
2051
|
return "Укажите время запуска или задержку."
|
|
1965
2052
|
}
|
|
2053
|
+
// Спринт 27: git-триггер работает только в git-репозитории задачи.
|
|
2054
|
+
if (triggerType() === "git" && !(workspaceId() || "").trim() && !(workingDirectory() || "").trim()) {
|
|
2055
|
+
return "Для git-триггера выберите workspace или укажите рабочую директорию."
|
|
2056
|
+
}
|
|
2057
|
+
if ((gitPollSeconds() || "").trim() && !/^([5-9]|[1-9]\d+)$/.test(gitPollSeconds().trim())) {
|
|
2058
|
+
return "Период опроса git — целое число секунд не меньше 5."
|
|
2059
|
+
}
|
|
1966
2060
|
if (matrixMode() && matrixWorkspaceIds().length === 0) return "Выберите хотя бы один workspace для матрицы."
|
|
1967
2061
|
if (session() === "reuse" && (sessionMaxRuns() || "").trim() && !/^[1-9]\d*$/.test(sessionMaxRuns().trim())) {
|
|
1968
2062
|
return "Лимит запусков сессии — целое положительное число."
|
|
@@ -2088,6 +2182,15 @@ export default Plugin.define({
|
|
|
2088
2182
|
{job.watchPath && (
|
|
2089
2183
|
<span title={`Отслеживание файла: ${job.watchPath}`} style="font-size:13px;flex-shrink:0;cursor:help">👁️</span>
|
|
2090
2184
|
)}
|
|
2185
|
+
{Array.isArray(job.watchGlobs) && job.watchGlobs.length > 0 && (
|
|
2186
|
+
<span title={`Glob-маски файлового триггера: ${job.watchGlobs.join(", ")}`} style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #5ac8fa;color:#5ac8fa;background:rgba(90,200,250,0.12)">✳ {job.watchGlobs.length} масок</span>
|
|
2187
|
+
)}
|
|
2188
|
+
{job.triggerType === "git" && (
|
|
2189
|
+
<span title={`Git-триггер: новый коммит${job.gitBranch ? ` в ветке ${job.gitBranch}` : ""}${Array.isArray(job.gitPaths) && job.gitPaths.length > 0 ? `, пути: ${job.gitPaths.join(", ")}` : ""}. Опрос каждые ${job.gitPollSeconds ?? 60} с.`} style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #ff9f0a;color:#ff9f0a;background:rgba(255,159,10,0.12)">🔀 git</span>
|
|
2190
|
+
)}
|
|
2191
|
+
{Array.isArray(job.activeDays) && job.activeDays.length > 0 && (
|
|
2192
|
+
<span title={`Запуск только в дни: ${job.activeDays.map((d) => ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"][d] ?? d).join(", ")}`} style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #30d158;color:#30d158;background:rgba(48,209,88,0.12)">📅 {job.activeDays.length}/7</span>
|
|
2193
|
+
)}
|
|
2091
2194
|
{job.timezone && (
|
|
2092
2195
|
<span title={`Часовой пояс задачи: ${job.timezone}`} style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #64d2ff;color:#64d2ff;background:rgba(100,210,255,0.12)">🌍 {job.timezone}</span>
|
|
2093
2196
|
)}
|
|
@@ -3654,6 +3757,16 @@ export default Plugin.define({
|
|
|
3654
3757
|
/>
|
|
3655
3758
|
При изменении файла
|
|
3656
3759
|
</label>
|
|
3760
|
+
<label style="display:flex;align-items:center;gap:6px;cursor:pointer;flex:1">
|
|
3761
|
+
<input
|
|
3762
|
+
type="radio"
|
|
3763
|
+
name="triggerType"
|
|
3764
|
+
checked={triggerType() === "git"}
|
|
3765
|
+
onChange={() => setTriggerType("git")}
|
|
3766
|
+
style="accent-color:#007acc"
|
|
3767
|
+
/>
|
|
3768
|
+
Новый коммит (Git)
|
|
3769
|
+
</label>
|
|
3657
3770
|
<label style="display:flex;align-items:center;gap:6px;cursor:pointer;flex:1">
|
|
3658
3771
|
<input
|
|
3659
3772
|
type="radio"
|
|
@@ -3687,9 +3800,73 @@ export default Plugin.define({
|
|
|
3687
3800
|
placeholder="например, C:\project\src\main.ts"
|
|
3688
3801
|
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"
|
|
3689
3802
|
/>
|
|
3803
|
+
<label style="display:block;margin:12px 0 6px;font-size:12px;color:#b0b0b0;font-weight:500">Glob-маски (по одной в строке, пусто — любое изменение)</label>
|
|
3804
|
+
<textarea
|
|
3805
|
+
value={watchGlobs() || ""}
|
|
3806
|
+
onInput={(e) => setWatchGlobs(e.currentTarget.value)}
|
|
3807
|
+
rows={3}
|
|
3808
|
+
placeholder={"**/*.md\nsrc/**"}
|
|
3809
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace"
|
|
3810
|
+
/>
|
|
3811
|
+
<label style="display:block;margin:12px 0 6px;font-size:12px;color:#b0b0b0;font-weight:500">Исключения (glob, по одной в строке)</label>
|
|
3812
|
+
<textarea
|
|
3813
|
+
value={watchIgnore() || ""}
|
|
3814
|
+
onInput={(e) => setWatchIgnore(e.currentTarget.value)}
|
|
3815
|
+
rows={2}
|
|
3816
|
+
placeholder={"node_modules/**\n*.log"}
|
|
3817
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace"
|
|
3818
|
+
/>
|
|
3819
|
+
<div style="font-size:11px;color:#8e8e93;margin-top:6px">Маски считаются от пути watchPath. Поддерживаются *, **, ? и классы [abc]; маска каталога с /** рекурсивна.</div>
|
|
3690
3820
|
</div>
|
|
3691
3821
|
)}
|
|
3692
3822
|
|
|
3823
|
+
{triggerType() === "git" && (
|
|
3824
|
+
<>
|
|
3825
|
+
<div style="display:block;width:100%;margin-bottom:12px">
|
|
3826
|
+
<label style="display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500">Ветки (glob, через запятую; пусто — любая)</label>
|
|
3827
|
+
<input
|
|
3828
|
+
type="text"
|
|
3829
|
+
value={gitBranch() || ""}
|
|
3830
|
+
onInput={(e) => setGitBranch(e.currentTarget.value)}
|
|
3831
|
+
placeholder="main, release/*"
|
|
3832
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"
|
|
3833
|
+
/>
|
|
3834
|
+
</div>
|
|
3835
|
+
<div style="display:block;width:100%;margin-bottom:12px">
|
|
3836
|
+
<label style="display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500">Пути изменений (glob, по одной в строке; пусто — любой файл)</label>
|
|
3837
|
+
<textarea
|
|
3838
|
+
value={gitPaths() || ""}
|
|
3839
|
+
onInput={(e) => setGitPaths(e.currentTarget.value)}
|
|
3840
|
+
rows={3}
|
|
3841
|
+
placeholder={"src/**\n**/*.md"}
|
|
3842
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace"
|
|
3843
|
+
/>
|
|
3844
|
+
</div>
|
|
3845
|
+
<div style="display:block;width:100%;margin-bottom:12px">
|
|
3846
|
+
<label style="display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500">Игнорируемые пути (glob, по одной в строке)</label>
|
|
3847
|
+
<textarea
|
|
3848
|
+
value={gitIgnore() || ""}
|
|
3849
|
+
onInput={(e) => setGitIgnore(e.currentTarget.value)}
|
|
3850
|
+
rows={2}
|
|
3851
|
+
placeholder={"docs/**\n*.lock"}
|
|
3852
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace"
|
|
3853
|
+
/>
|
|
3854
|
+
</div>
|
|
3855
|
+
<div style="display:block;width:100%;margin-bottom:12px">
|
|
3856
|
+
<label style="display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500">Период опроса, секунды (минимум 5, по умолчанию 60)</label>
|
|
3857
|
+
<input
|
|
3858
|
+
type="number"
|
|
3859
|
+
min="5"
|
|
3860
|
+
value={gitPollSeconds() || ""}
|
|
3861
|
+
onInput={(e) => setGitPollSeconds(e.currentTarget.value)}
|
|
3862
|
+
placeholder="60"
|
|
3863
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"
|
|
3864
|
+
/>
|
|
3865
|
+
<div style="font-size:11px;color:#8e8e93;margin-top:6px">Первый опрос запоминает текущий HEAD без запуска задачи — дальше задача стартует на новом коммите, затронувшем подходящие файлы.</div>
|
|
3866
|
+
</div>
|
|
3867
|
+
</>
|
|
3868
|
+
)}
|
|
3869
|
+
|
|
3693
3870
|
{triggerType() === "mcp-event" && (
|
|
3694
3871
|
<>
|
|
3695
3872
|
<div style="display:block;width:100%;margin-bottom:12px">
|
|
@@ -3881,6 +4058,50 @@ export default Plugin.define({
|
|
|
3881
4058
|
<div style="display:block;margin-top:6px;font-size:11px;color:#808080">
|
|
3882
4059
|
Вне окна запуск переносится на его открытие, а не пропускается. Например 22:00 — 06:00.
|
|
3883
4060
|
</div>
|
|
4061
|
+
<div style="display:block;margin-top:12px">
|
|
4062
|
+
<label style="display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500">Дни недели (пусто — все дни)</label>
|
|
4063
|
+
<div style="display:flex;gap:10px;flex-wrap:wrap">
|
|
4064
|
+
{[
|
|
4065
|
+
{ value: 1, label: "Пн" },
|
|
4066
|
+
{ value: 2, label: "Вт" },
|
|
4067
|
+
{ value: 3, label: "Ср" },
|
|
4068
|
+
{ value: 4, label: "Чт" },
|
|
4069
|
+
{ value: 5, label: "Пт" },
|
|
4070
|
+
{ value: 6, label: "Сб" },
|
|
4071
|
+
{ value: 0, label: "Вс" },
|
|
4072
|
+
].map((day) => (
|
|
4073
|
+
<label style="display:flex;align-items:center;gap:5px;cursor:pointer;font-size:12px;color:#d0d0d5">
|
|
4074
|
+
<input
|
|
4075
|
+
type="checkbox"
|
|
4076
|
+
checked={activeDays().includes(day.value)}
|
|
4077
|
+
onChange={(e) => {
|
|
4078
|
+
const next = e.currentTarget.checked
|
|
4079
|
+
? [...activeDays(), day.value]
|
|
4080
|
+
: activeDays().filter((d) => d !== day.value)
|
|
4081
|
+
setActiveDays([...next].sort((a, b) => a - b))
|
|
4082
|
+
}}
|
|
4083
|
+
style="accent-color:#007acc"
|
|
4084
|
+
/>
|
|
4085
|
+
{day.label}
|
|
4086
|
+
</label>
|
|
4087
|
+
))}
|
|
4088
|
+
</div>
|
|
4089
|
+
</div>
|
|
4090
|
+
<div style="display:block;margin-top:12px">
|
|
4091
|
+
<label style="display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500">Вне окна или в неразрешённый день</label>
|
|
4092
|
+
<select
|
|
4093
|
+
value={windowPolicy()}
|
|
4094
|
+
onChange={(e) => setWindowPolicy(e.currentTarget.value as "skip" | "postpone" | "run")}
|
|
4095
|
+
style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"
|
|
4096
|
+
>
|
|
4097
|
+
<option value="postpone">Перенести на открытие окна (по умолчанию)</option>
|
|
4098
|
+
<option value="skip">Пропустить запуск</option>
|
|
4099
|
+
<option value="run">Выполнить всё равно</option>
|
|
4100
|
+
</select>
|
|
4101
|
+
<div style="display:block;margin-top:6px;font-size:11px;color:#808080">
|
|
4102
|
+
Для cron политика применяется в обёртке, для файловых и git-триггеров — при обработке события. Перенос ждёт не дольше 12 часов.
|
|
4103
|
+
</div>
|
|
4104
|
+
</div>
|
|
3884
4105
|
</div>
|
|
3885
4106
|
</div>
|
|
3886
4107
|
|