opencode-windows-scheduler 1.3.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 +47 -1
- package/README.md +11 -5
- package/ROADMAP-STRATEGY.md +45 -26
- package/ROADMAP.md +279 -35
- package/dist/core/audit.d.ts +68 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +206 -0
- 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/secrets.d.ts +57 -0
- package/dist/core/secrets.d.ts.map +1 -0
- package/dist/core/secrets.js +331 -0
- package/dist/core/structured-log.d.ts.map +1 -1
- package/dist/core/structured-log.js +9 -0
- 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 +23 -0
- package/dist/index.d.ts +68 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +589 -45
- package/dist/rpc.d.ts +623 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +219 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +67 -0
- package/dist/settings.d.ts +16 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +29 -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/dist/workspaces.d.ts +8 -2
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +21 -4
- package/docs/ARCHITECTURE.md +14 -5
- package/docs/FEATURES.md +80 -1
- package/docs/README.ru.md +15 -5
- package/gui-experimental.cjs +9 -4
- package/package.json +8 -3
- package/src/core/audit.ts +291 -0
- 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/secrets.ts +385 -0
- package/src/core/structured-log.ts +9 -0
- package/src/core/wrappers/bash.ts +4 -0
- package/src/db/git-state-repo.ts +62 -0
- package/src/db/schema.ts +23 -0
- package/src/gui.tsx +548 -4
- package/src/index.ts +790 -47
- package/src/rpc.ts +230 -0
- package/src/server.ts +67 -0
- package/src/settings.ts +51 -0
- package/src/task-transfer.ts +124 -5
- package/src/templates.ts +1 -1
- package/src/workspaces.ts +22 -4
package/dist/task-transfer.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { PLUGIN_DIR, sanitizeName } from "./types.js";
|
|
4
4
|
import { listTasks, saveTask, deleteTask, } from "./db/tasks-repo.js";
|
|
5
5
|
import { normalizeOneShotRunAt } from "./core/one-shot.js";
|
|
6
|
-
import { isValidIanaTimeZone, validateLaunchWindow } from "./core/schedule-v2.js";
|
|
6
|
+
import { isValidIanaTimeZone, normalizeActiveDays, validateLaunchWindow, } from "./core/schedule-v2.js";
|
|
7
7
|
import { isValidSessionId } from "./core/session.js";
|
|
8
8
|
const PREFIX = "\\OpenCode\\windows-scheduler\\";
|
|
9
9
|
/** Приоритет по умолчанию — «Обычный». */
|
|
@@ -108,6 +108,7 @@ export async function buildExportJson(tasks) {
|
|
|
108
108
|
? { dependsOn: definition.dependsOn }
|
|
109
109
|
: {}),
|
|
110
110
|
...(definition?.triggerType === "file" ? { triggerType: "file" } : {}),
|
|
111
|
+
...(definition?.triggerType === "git" ? { triggerType: "git" } : {}),
|
|
111
112
|
...(definition?.triggerType === "mcp-event"
|
|
112
113
|
? { triggerType: "mcp-event" }
|
|
113
114
|
: {}),
|
|
@@ -131,6 +132,27 @@ export async function buildExportJson(tasks) {
|
|
|
131
132
|
...(definition?.timezone ? { timezone: definition.timezone } : {}),
|
|
132
133
|
...(definition?.notBefore ? { notBefore: definition.notBefore } : {}),
|
|
133
134
|
...(definition?.notAfter ? { notAfter: definition.notAfter } : {}),
|
|
135
|
+
// Спринт 27: дни недели, политика окна и git/glob-триггеры.
|
|
136
|
+
...(Array.isArray(definition?.activeDays) && definition.activeDays.length > 0
|
|
137
|
+
? { activeDays: definition.activeDays }
|
|
138
|
+
: {}),
|
|
139
|
+
...(definition?.windowPolicy ? { windowPolicy: definition.windowPolicy } : {}),
|
|
140
|
+
...(definition?.gitBranch ? { gitBranch: definition.gitBranch } : {}),
|
|
141
|
+
...(Array.isArray(definition?.gitPaths) && definition.gitPaths.length > 0
|
|
142
|
+
? { gitPaths: definition.gitPaths }
|
|
143
|
+
: {}),
|
|
144
|
+
...(Array.isArray(definition?.gitIgnore) && definition.gitIgnore.length > 0
|
|
145
|
+
? { gitIgnore: definition.gitIgnore }
|
|
146
|
+
: {}),
|
|
147
|
+
...(definition?.gitPollSeconds !== undefined
|
|
148
|
+
? { gitPollSeconds: definition.gitPollSeconds }
|
|
149
|
+
: {}),
|
|
150
|
+
...(Array.isArray(definition?.watchGlobs) && definition.watchGlobs.length > 0
|
|
151
|
+
? { watchGlobs: definition.watchGlobs }
|
|
152
|
+
: {}),
|
|
153
|
+
...(Array.isArray(definition?.watchIgnore) && definition.watchIgnore.length > 0
|
|
154
|
+
? { watchIgnore: definition.watchIgnore }
|
|
155
|
+
: {}),
|
|
134
156
|
...(definition?.pausedUntil ? { pausedUntil: definition.pausedUntil } : {}),
|
|
135
157
|
...(Array.isArray(definition?.allowedTools) && definition.allowedTools.length > 0
|
|
136
158
|
? { allowedTools: definition.allowedTools }
|
|
@@ -203,11 +225,13 @@ export function parseImportJson(raw) {
|
|
|
203
225
|
const prompt = typeof source.prompt === "string" ? source.prompt.trim() : "";
|
|
204
226
|
const triggerType = source.triggerType === "file"
|
|
205
227
|
? "file"
|
|
206
|
-
: source.triggerType === "
|
|
207
|
-
? "
|
|
208
|
-
: source.triggerType === "
|
|
209
|
-
? "
|
|
210
|
-
: "
|
|
228
|
+
: source.triggerType === "git"
|
|
229
|
+
? "git"
|
|
230
|
+
: source.triggerType === "mcp-event"
|
|
231
|
+
? "mcp-event"
|
|
232
|
+
: source.triggerType === "once"
|
|
233
|
+
? "once"
|
|
234
|
+
: "cron";
|
|
211
235
|
const watchPath = typeof source.watchPath === "string" ? source.watchPath.trim() : "";
|
|
212
236
|
const rawRunAt = typeof source.runAt === "string" ? source.runAt.trim() : "";
|
|
213
237
|
const rawDelaySeconds = typeof source.delaySeconds === "number" ? source.delaySeconds : undefined;
|
|
@@ -319,6 +343,51 @@ export function parseImportJson(raw) {
|
|
|
319
343
|
const model = readOptionalString(source.model);
|
|
320
344
|
const priority = normalizePriority(source.priority);
|
|
321
345
|
const workspaceId = readOptionalString(source.workspaceId);
|
|
346
|
+
// Спринт 27: git-триггер, glob-маски и временные окна.
|
|
347
|
+
if (triggerType === "git" && !workspaceId && !workingDirectory) {
|
|
348
|
+
errors.push(`Запись ${position}${name ? ` (${name})` : ""}: для git-триггера нужна рабочая директория (workingDirectory или workspaceId).`);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
const readStringList = (value) => {
|
|
352
|
+
if (!Array.isArray(value))
|
|
353
|
+
return undefined;
|
|
354
|
+
const items = value
|
|
355
|
+
.filter((entry) => typeof entry === "string" && Boolean(entry.trim()))
|
|
356
|
+
.map((entry) => entry.trim());
|
|
357
|
+
return items.length > 0 ? items : undefined;
|
|
358
|
+
};
|
|
359
|
+
const gitBranch = readOptionalString(source.gitBranch);
|
|
360
|
+
const gitPaths = readStringList(source.gitPaths);
|
|
361
|
+
const gitIgnore = readStringList(source.gitIgnore);
|
|
362
|
+
const watchGlobs = readStringList(source.watchGlobs);
|
|
363
|
+
const watchIgnore = readStringList(source.watchIgnore);
|
|
364
|
+
const gitPollSeconds = typeof source.gitPollSeconds === "number" &&
|
|
365
|
+
Number.isFinite(source.gitPollSeconds) &&
|
|
366
|
+
source.gitPollSeconds > 0
|
|
367
|
+
? Math.floor(source.gitPollSeconds)
|
|
368
|
+
: undefined;
|
|
369
|
+
const rawDays = Array.isArray(source.activeDays) ? source.activeDays : undefined;
|
|
370
|
+
let activeDays;
|
|
371
|
+
if (rawDays) {
|
|
372
|
+
const days = rawDays.filter((value) => typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 6);
|
|
373
|
+
if (days.length !== rawDays.length) {
|
|
374
|
+
errors.push(`Запись ${position}${name ? ` (${name})` : ""}: activeDays должен содержать числа 0..6 (0 = воскресенье).`);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
activeDays = normalizeActiveDays(days);
|
|
378
|
+
}
|
|
379
|
+
let windowPolicy;
|
|
380
|
+
if (source.windowPolicy !== undefined) {
|
|
381
|
+
if (source.windowPolicy === "skip" ||
|
|
382
|
+
source.windowPolicy === "postpone" ||
|
|
383
|
+
source.windowPolicy === "run") {
|
|
384
|
+
windowPolicy = source.windowPolicy;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
errors.push(`Запись ${position}${name ? ` (${name})` : ""}: неизвестный windowPolicy «${String(source.windowPolicy)}» (ожидается skip, postpone или run).`);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
322
391
|
// Планирование 2.0 (Спринт 19): IANA-зона, окно запуска, пауза до даты.
|
|
323
392
|
const timezone = readOptionalString(source.timezone);
|
|
324
393
|
if (timezone && !isValidIanaTimeZone(timezone)) {
|
|
@@ -528,6 +597,14 @@ export function parseImportJson(raw) {
|
|
|
528
597
|
...(timezone !== undefined ? { timezone } : {}),
|
|
529
598
|
...(notBefore !== undefined ? { notBefore } : {}),
|
|
530
599
|
...(notAfter !== undefined ? { notAfter } : {}),
|
|
600
|
+
...(activeDays !== undefined ? { activeDays } : {}),
|
|
601
|
+
...(windowPolicy !== undefined ? { windowPolicy } : {}),
|
|
602
|
+
...(gitBranch !== undefined ? { gitBranch } : {}),
|
|
603
|
+
...(gitPaths !== undefined ? { gitPaths } : {}),
|
|
604
|
+
...(gitIgnore !== undefined ? { gitIgnore } : {}),
|
|
605
|
+
...(gitPollSeconds !== undefined ? { gitPollSeconds } : {}),
|
|
606
|
+
...(watchGlobs !== undefined ? { watchGlobs } : {}),
|
|
607
|
+
...(watchIgnore !== undefined ? { watchIgnore } : {}),
|
|
531
608
|
...(pausedUntil !== undefined ? { pausedUntil } : {}),
|
|
532
609
|
...(mcpEvent ? { mcpEvent } : {}),
|
|
533
610
|
...(allowedTools !== undefined ? { allowedTools } : {}),
|
package/dist/templates.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface TaskTemplate {
|
|
|
28
28
|
nextTaskOnError?: string;
|
|
29
29
|
/** DAG-зависимости: задачи, которые должны успешно завершиться раньше этой. */
|
|
30
30
|
dependsOn?: string[];
|
|
31
|
-
triggerType?: "cron" | "file" | "mcp-event";
|
|
31
|
+
triggerType?: "cron" | "file" | "git" | "mcp-event";
|
|
32
32
|
/** Параметры MCP-события (для triggerType === "mcp-event"). */
|
|
33
33
|
mcpEvent?: {
|
|
34
34
|
server: string;
|
package/dist/templates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,K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GED
|
@@ -50,12 +50,18 @@ export declare function parseEnvFileContent(content: string): Record<string, str
|
|
|
50
50
|
export declare function readWorkspaceEnvFile(envFile?: string): Record<string, string>;
|
|
51
51
|
/**
|
|
52
52
|
* Итоговые env-переменные workspace: сначала .env-файл, затем явные пары
|
|
53
|
-
* (пары важнее файла).
|
|
53
|
+
* (пары важнее файла). Ссылки `${secret:NAME}` разворачиваются из
|
|
54
|
+
* зашифрованного хранилища (Спринт 26); отсутствующий секрет даёт пустую
|
|
55
|
+
* строку и предупреждение с именем — без значения. Никогда не бросает.
|
|
54
56
|
*/
|
|
55
57
|
export declare function resolveWorkspaceEnv(workspace: Workspace | undefined): Record<string, string>;
|
|
56
58
|
/** Маскирует значение секрета для логов. */
|
|
57
59
|
export declare function maskSecretValue(): string;
|
|
58
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Копия env для логов: значения «секретных» ключей заменены на ***.
|
|
62
|
+
* Чистые ссылки `${secret:NAME}` сохраняются как есть — это не секрет,
|
|
63
|
+
* а указатель, и он помогает диагностике (Спринт 26).
|
|
64
|
+
*/
|
|
59
65
|
export declare function maskEnvForLog(env: Record<string, string> | undefined): Record<string, string>;
|
|
60
66
|
/**
|
|
61
67
|
* Каталог env-файлов задач внутри каталога плагина (по одному файлу на задачу).
|
package/dist/workspaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,GAA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GAAG,OAAO,CAenD;AAED,kDAAkD;AAClD,wBAAgB,eAAe,IAAI,MAAM,CAGxC"}
|
package/dist/workspaces.js
CHANGED
|
@@ -4,6 +4,7 @@ import { basename, join, resolve } from "node:path";
|
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
import { getDb } from "./db/index.js";
|
|
6
6
|
import { clearWorkspaceAssignments } from "./db/tasks-repo.js";
|
|
7
|
+
import { hasSecretRef, resolveSecretRefs } from "./core/secrets.js";
|
|
7
8
|
/** Максимум пар env на workspace — защита от раздувания строки JSON. */
|
|
8
9
|
export const MAX_WORKSPACE_ENV_PAIRS = 100;
|
|
9
10
|
/** Палитра цветных маркеров для GUI/дашборда. */
|
|
@@ -88,28 +89,44 @@ export function readWorkspaceEnvFile(envFile) {
|
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* Итоговые env-переменные workspace: сначала .env-файл, затем явные пары
|
|
91
|
-
* (пары важнее файла).
|
|
92
|
+
* (пары важнее файла). Ссылки `${secret:NAME}` разворачиваются из
|
|
93
|
+
* зашифрованного хранилища (Спринт 26); отсутствующий секрет даёт пустую
|
|
94
|
+
* строку и предупреждение с именем — без значения. Никогда не бросает.
|
|
92
95
|
*/
|
|
93
96
|
export function resolveWorkspaceEnv(workspace) {
|
|
94
97
|
if (!workspace)
|
|
95
98
|
return {};
|
|
96
|
-
|
|
99
|
+
const merged = {
|
|
97
100
|
...readWorkspaceEnvFile(workspace.envFile),
|
|
98
101
|
...(workspace.env ?? {}),
|
|
99
102
|
};
|
|
103
|
+
const resolved = resolveSecretRefs(merged);
|
|
104
|
+
if (resolved.missing.length > 0) {
|
|
105
|
+
console.warn(`[workspace] "${workspace.name}": не найдены секреты: ${resolved.missing.join(", ")}`);
|
|
106
|
+
}
|
|
107
|
+
return resolved.env;
|
|
100
108
|
}
|
|
101
109
|
/** Маскирует значение секрета для логов. */
|
|
102
110
|
export function maskSecretValue() {
|
|
103
111
|
return "***";
|
|
104
112
|
}
|
|
105
113
|
const SECRET_KEY_RE = /(TOKEN|SECRET|PASS|PASSWORD|KEY|CREDENTIAL|AUTH)/i;
|
|
106
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Копия env для логов: значения «секретных» ключей заменены на ***.
|
|
116
|
+
* Чистые ссылки `${secret:NAME}` сохраняются как есть — это не секрет,
|
|
117
|
+
* а указатель, и он помогает диагностике (Спринт 26).
|
|
118
|
+
*/
|
|
107
119
|
export function maskEnvForLog(env) {
|
|
108
120
|
if (!env)
|
|
109
121
|
return {};
|
|
110
122
|
const masked = {};
|
|
111
123
|
for (const [key, value] of Object.entries(env)) {
|
|
112
|
-
|
|
124
|
+
if (hasSecretRef(value)) {
|
|
125
|
+
masked[key] = String(value);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
masked[key] = SECRET_KEY_RE.test(key) ? maskSecretValue() : value;
|
|
129
|
+
}
|
|
113
130
|
}
|
|
114
131
|
return masked;
|
|
115
132
|
}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -120,7 +120,7 @@ from their clones instead of their own last run.
|
|
|
120
120
|
|
|
121
121
|
| Path | Role |
|
|
122
122
|
| --- | --- |
|
|
123
|
-
| `src/index.ts` | Plugin lifecycle,
|
|
123
|
+
| `src/index.ts` | Plugin lifecycle, 24 agent tools, RPC handlers, task CRUD, view assembly |
|
|
124
124
|
| `src/rpc.ts` | JSON-schema contracts for every RPC method |
|
|
125
125
|
| `src/gui.tsx` | OpenCode sidebar panel (SolidJS, built to `gui-experimental.cjs`) |
|
|
126
126
|
| `src/server.ts` | Local web dashboard HTTP server and HTML rendering |
|
|
@@ -129,10 +129,12 @@ from their clones instead of their own last run.
|
|
|
129
129
|
| `src/profiles.ts` | Profile directory resolution: per-profile plugin dir (base for `default`, `<base>/profiles/<name>` for named profiles); profile name, marker, port, create/delete/switch |
|
|
130
130
|
| `src/workspaces.ts` | Workspace registry and path validation; env pairs and `.env` file resolution with secret masking |
|
|
131
131
|
| `src/templates.ts` | Reusable task templates |
|
|
132
|
-
| `src/settings.ts` | Plugin settings: notifications
|
|
132
|
+
| `src/settings.ts` | Plugin settings: notifications, history retention, audit |
|
|
133
133
|
| `src/notifications.ts` | Multi-channel delivery (webhook, Telegram, native OS) with retries/backoff, templates, task filters, quiet hours, matrix and stuck-clone notifications, daily/weekly digest |
|
|
134
134
|
| `src/core/telegram.ts` | Telegram Bot API `sendMessage`: parse-mode escaping, dashboard link, token validation and masking |
|
|
135
135
|
| `src/core/native-notify.ts` | Native OS notifications: Windows Toast (PowerShell/WinRT), macOS `osascript`, Linux `notify-send`; no external dependency |
|
|
136
|
+
| `src/core/secrets.ts` | Encrypted secret store (AES-256-GCM, `secrets.key` 0600, `${secret:NAME}` refs, redaction) |
|
|
137
|
+
| `src/core/audit.ts` | SQLite audit journal (`audit_log`), redacted details, retention cleanup |
|
|
136
138
|
| `src/history.ts` | History model and status types |
|
|
137
139
|
| `src/version.ts` | Runtime plugin version (reads package.json) |
|
|
138
140
|
| `src/core/retention.ts` | Daily history prune and incremental vacuum |
|
|
@@ -265,6 +267,7 @@ existing directory. Env keys must match `^[A-Za-z_][A-Za-z0-9_]*$`; max 100 pair
|
|
|
265
267
|
| --- | --- |
|
|
266
268
|
| `cron` | OS scheduler on the translated schedule |
|
|
267
269
|
| `file` | chokidar watches `watchPath`; debounced change starts the task |
|
|
270
|
+
| `git` | Polls `HEAD` in the task working directory; runs when new commits match branch/path/ignore filters |
|
|
268
271
|
| `mcp-event` | `emit_event` RPC/tool matches server + event and starts subscribers |
|
|
269
272
|
|
|
270
273
|
Cron expressions are standard 5-field. The Windows backend supports the subset that
|
|
@@ -306,7 +309,7 @@ never requires a manual migration.
|
|
|
306
309
|
|
|
307
310
|
| Interface | Audience | Entry point |
|
|
308
311
|
| --- | --- | --- |
|
|
309
|
-
| Agent tools | AI agent |
|
|
312
|
+
| Agent tools | AI agent | 24 tools registered via `ctx.tool.transform` |
|
|
310
313
|
| Agent skill | AI agent | `skills/scheduled-job-best-practices` |
|
|
311
314
|
| RPC | Sidebar GUI | `src/rpc.ts` contracts, ~30 methods |
|
|
312
315
|
| Sidebar GUI | Human | `gui-experimental.cjs` |
|
|
@@ -320,8 +323,14 @@ never requires a manual migration.
|
|
|
320
323
|
- `allowedTools` / `deniedTools` are **metadata passed to the run**, not a sandbox.
|
|
321
324
|
They are recorded in history for audit, but they do not constrain `opencode` at the
|
|
322
325
|
OS level.
|
|
323
|
-
-
|
|
324
|
-
|
|
326
|
+
- Task prompts, hooks and Quality Gate scripts are **plain text** executed with your
|
|
327
|
+
user privileges; only secrets (in `secrets.json`, AES-256-GCM) are encrypted.
|
|
328
|
+
Workspace `env` can reference secrets as `${secret:NAME}`; values are masked in
|
|
329
|
+
logs, history and audit. Treat task creation like granting shell access.
|
|
330
|
+
- Secrets are stored encrypted in `<PLUGIN_DIR>/secrets.json` (AES-256-GCM) with a
|
|
331
|
+
32-byte key file `secrets.key` (rights 0600). Workspace `env` can reference them
|
|
332
|
+
as `${secret:NAME}`; values are substituted at run time and masked in logs,
|
|
333
|
+
history and audit.
|
|
325
334
|
- Workspace paths are validated, but hooks are not sandboxed: only schedule jobs from
|
|
326
335
|
repositories you trust.
|
|
327
336
|
|
package/docs/FEATURES.md
CHANGED
|
@@ -102,6 +102,11 @@ it is never accepted from user input or exported as plain text.
|
|
|
102
102
|
- `notBefore` / `notAfter` — daily launch window in `HH:MM` (may cross midnight,
|
|
103
103
|
e.g. `22:00`–`06:00`). A run that fires outside the window is **postponed**
|
|
104
104
|
until the window opens (once, via a defer-file), not skipped.
|
|
105
|
+
- `activeDays` — allowed weekdays `0`=Sunday … `6`=Saturday (Спринт 27). Empty or
|
|
106
|
+
all seven means every day. Applies to cron and event triggers.
|
|
107
|
+
- `windowPolicy` — behaviour outside the window or on a disallowed day (Спринт 27):
|
|
108
|
+
`postpone` (default) waits for the next opening (max 12 hours), `skip` drops the
|
|
109
|
+
run, `run` executes anyway.
|
|
105
110
|
- `pausedUntil` — pause a task until an ISO moment. `pause_task` accepts
|
|
106
111
|
`until`; the plugin re-enables the task automatically at startup and on a
|
|
107
112
|
5-minute timer, and `resume_task` resumes early.
|
|
@@ -120,6 +125,52 @@ it is never accepted from user input or exported as plain text.
|
|
|
120
125
|
The file is watched with chokidar in the plugin host, changes are debounced. File
|
|
121
126
|
triggers ignore `schedule`.
|
|
122
127
|
|
|
128
|
+
#### Glob-маски для файловых триггеров (Спринт 27)
|
|
129
|
+
|
|
130
|
+
`watchGlobs` и `watchIgnore` ограничивают, какие изменения считаются триггером:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"name": "regen-docs",
|
|
135
|
+
"triggerType": "file",
|
|
136
|
+
"watchPath": "C:\\projects\\site",
|
|
137
|
+
"watchGlobs": ["**/*.md", "**/*.html"],
|
|
138
|
+
"watchIgnore": ["node_modules/**", "**/*.log"],
|
|
139
|
+
"prompt": "Rebuild the static site when docs change."
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Маски поддерживают `*` (не пересекает `/`), `**` (любые сегменты, включая ноль),
|
|
144
|
+
`?` (один символ), `[abc]` / `[a-z]` (классы), `{a,b}` (альтернативы) и `!`
|
|
145
|
+
(отрицание). Пустой `watchGlobs` означает «любое изменение». Пути нормализуются
|
|
146
|
+
к POSIX-виду (`\` → `/`), сравнение регистронезависимое на Windows.
|
|
147
|
+
|
|
148
|
+
### Git triggers (Спринт 27)
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"name": "deploy-on-push",
|
|
153
|
+
"triggerType": "git",
|
|
154
|
+
"workingDirectory": "C:\\projects\\api",
|
|
155
|
+
"gitBranch": "main, release/*",
|
|
156
|
+
"gitPaths": ["src/**", "package.json"],
|
|
157
|
+
"gitIgnore": ["**/*.md", "CHANGELOG.md"],
|
|
158
|
+
"gitPollSeconds": 60,
|
|
159
|
+
"prompt": "Deploy the changed services to staging."
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Задача с `triggerType: "git"` запускается, когда в её рабочей директории появляется
|
|
164
|
+
новый коммит. Первый опрос только запоминает текущий `HEAD` (baseline) и ничего не
|
|
165
|
+
запускает. Последующие опросы сравнивают `git diff --name-only <last>..HEAD` и
|
|
166
|
+
запускают задачу, если совпадают маски `gitPaths` (пусто — любой файл) и не
|
|
167
|
+
попадают под `gitIgnore`. Фильтр `gitBranch` ограничивает ветки (через запятую,
|
|
168
|
+
поддерживает `*` и `?`).
|
|
169
|
+
|
|
170
|
+
Период опроса `gitPollSeconds` — минимум 5 секунд, по умолчанию 60. Состояние
|
|
171
|
+
(последний обработанный коммит) хранится в таблице SQLite `git_state`, поэтому
|
|
172
|
+
перезапуск плагина не приводит к повторным запускам.
|
|
173
|
+
|
|
123
174
|
### MCP event triggers
|
|
124
175
|
|
|
125
176
|
```json
|
|
@@ -436,6 +487,33 @@ and native OS notifications — configurable in settings and testable with
|
|
|
436
487
|
and reports per-channel success/failure. Failures in one channel never block the
|
|
437
488
|
others and never throw into the task run.
|
|
438
489
|
|
|
490
|
+
### Secrets (Спринт 26)
|
|
491
|
+
|
|
492
|
+
Encrypted secret storage in `<PLUGIN_DIR>/secrets.json` with AES-256-GCM and a
|
|
493
|
+
32-byte key file `secrets.key` (rights 0600). The `manage_secrets` tool (and the
|
|
494
|
+
«🔐 Секреты» GUI panel) supports `list`, `set` and `delete`. Secret names match
|
|
495
|
+
`[A-Za-z0-9_.-]` and are up to 64 characters; list shows only name, masked preview
|
|
496
|
+
(`••••` + last 4 chars) and update time — never the value.
|
|
497
|
+
|
|
498
|
+
In task workspace `env`, reference a secret as `${secret:NAME}`. The value is
|
|
499
|
+
substituted at run time (missing secrets resolve to an empty string with a
|
|
500
|
+
name-only warning). Secret references survive masking — they are shown verbatim in
|
|
501
|
+
the GUI env editor — while literal secret-like values (`TOKEN=`, `PASSWORD=`, …)
|
|
502
|
+
are masked as `***` in logs, structured logs, history and audit.
|
|
503
|
+
|
|
504
|
+
### Audit log (Спринт 26)
|
|
505
|
+
|
|
506
|
+
Every mutation — task create/update/delete/run, settings, templates, profiles,
|
|
507
|
+
workspaces, secrets, import, history cleanup — is recorded in an `audit_log`
|
|
508
|
+
table in SQLite with action, target type/target, actor (`mcp`/`gui`/`http`),
|
|
509
|
+
source, redacted details and remote address. Indexes on `ts` and `action`;
|
|
510
|
+
retention defaults to 90 days / 10 000 records with automatic cleanup.
|
|
511
|
+
|
|
512
|
+
The `get_audit_log` tool (and the «📜 Журнал аудита» GUI panel) reads the journal
|
|
513
|
+
with filters by `action`, `target`, `actor`, `since`/`until` and `limit`. Also
|
|
514
|
+
available as RPC `get_audit` and HTTP `GET /api/audit`. Secret values in details
|
|
515
|
+
are redacted; `${secret:NAME}` references are preserved verbatim.
|
|
516
|
+
|
|
439
517
|
### Crash recovery
|
|
440
518
|
|
|
441
519
|
Runs left in `running` after a crash are marked `error` on the next plugin start, so
|
|
@@ -453,11 +531,12 @@ the `cleanup_history` RPC and the GUI's «Очистить сейчас» button
|
|
|
453
531
|
|
|
454
532
|
## Agent interface
|
|
455
533
|
|
|
456
|
-
Twenty-
|
|
534
|
+
Twenty-four tools: `schedule_task`, `list_tasks`, `update_task`, `delete_task`,
|
|
457
535
|
`run_task_now`, `pause_task`, `resume_task`, `get_history`, `get_task_logs`, `dry_run`,
|
|
458
536
|
`manage_workspaces`, `matrix_control` (results/cancel/cleanup/preview), `get_metrics`,
|
|
459
537
|
`get_analytics`, `manage_settings`, `manage_templates`, `manage_profiles`,
|
|
460
538
|
`transfer_tasks`, `send_notification`, `get_dashboard_info`, `cleanup_history`,
|
|
539
|
+
`manage_secrets`, `get_audit_log`,
|
|
461
540
|
`emit_event`.
|
|
462
541
|
|
|
463
542
|
A bundled skill, `scheduled-job-best-practices`, teaches the agent safe defaults:
|
package/docs/README.ru.md
CHANGED
|
@@ -35,11 +35,11 @@ English version: [README.md](../README.md).
|
|
|
35
35
|
| Надёжность | lock-файл от наложения запусков, таймауты с жёстким kill, повторы с задержкой, crash recovery |
|
|
36
36
|
| Качество | команда Quality Gate, before/after hooks, allow/deny списки инструментов для задачи |
|
|
37
37
|
| Оркестрация | DAG `dependsOn`, цепочки `nextTaskOnSuccess` / `nextTaskOnError`, матричный fan-out (parallel/sequential, `continue`/`stop`, concurrency, переопределения для workspace, агрегатор) |
|
|
38
|
-
| Триггеры | cron, одноразовый запуск (`triggerType: "once"`), изменение файла (chokidar), MCP-события, входящие webhooks (`POST /api/hooks/:task` с HMAC) |
|
|
38
|
+
| Триггеры | cron, одноразовый запуск (`triggerType: "once"`), git-коммиты (`triggerType: "git"`, фильтры ветки/путей/игнорирования), изменение файла (chokidar, glob-маски `watchGlobs`/`watchIgnore`), MCP-события, входящие webhooks (`POST /api/hooks/:task` с HMAC) |
|
|
39
39
|
| Мультирепо | workspaces с валидацией путей, запуски по workspace, матрица поверх родительской задачи |
|
|
40
40
|
| Наблюдаемость | история SQLite (success / error / timeout / partial / running), метрики (длительность, токены, стоимость), JSONL-логи с `/api/logs`, Prometheus `/metrics`, экспорт OTLP, логи по задачам, веб-дашборд с аналитикой за 14 дней, ретеншн истории и экспорт CSV/JSON |
|
|
41
|
-
| Эксплуатация | dry-run, экспорт/импорт JSON, шаблоны, уведомления по нескольким каналам (webhook, Telegram, нативные toast), тихие часы, дайджест, настройки |
|
|
42
|
-
| Интерфейсы | панель OpenCode GUI, веб-дашборд,
|
|
41
|
+
| Эксплуатация | dry-run, экспорт/импорт JSON, шаблоны, уведомления по нескольким каналам (webhook, Telegram, нативные toast), тихие часы, дайджест, зашифрованные секреты (`${secret:NAME}`), журнал аудита, настройки |
|
|
42
|
+
| Интерфейсы | панель OpenCode GUI, веб-дашборд, 24 инструмента для агента, встроенный скилл |
|
|
43
43
|
|
|
44
44
|
## Установка
|
|
45
45
|
|
|
@@ -80,11 +80,11 @@ npm run build && npm run build:gui
|
|
|
80
80
|
|
|
81
81
|
## Инструменты для агента
|
|
82
82
|
|
|
83
|
-
Агенту доступен весь функционал —
|
|
83
|
+
Агенту доступен весь функционал — 24 инструмента: расписание, пайплайны, эксплуатация, аналитика и администрирование.
|
|
84
84
|
|
|
85
85
|
| Инструмент | Аргументы | Что делает |
|
|
86
86
|
|---|---|---|
|
|
87
|
-
| `schedule_task` | `name`, `prompt`, `schedule` для cron или `runAt` / `delaySeconds` для одноразового запуска, опционально `session` / `sessionMaxRuns`, `timeoutSeconds`, `model`, `priority`, `beforeScript`, `afterScript`, `qualityGate`, `dependsOn`, `retryCount`, `retryDelay`, `nextTaskOnSuccess`, `nextTaskOnError`, `triggerType
|
|
87
|
+
| `schedule_task` | `name`, `prompt`, `schedule` для cron или `runAt` / `delaySeconds` для одноразового запуска, опционально `session` / `sessionMaxRuns`, `timeoutSeconds`, `model`, `priority`, `beforeScript`, `afterScript`, `qualityGate`, `dependsOn`, `retryCount`, `retryDelay`, `nextTaskOnSuccess`, `nextTaskOnError`, `triggerType` (`cron`/`file`/`git`/`mcp-event`/`once`), `mcpEvent`, `watchPath`, `watchGlobs`, `watchIgnore`, `gitBranch`, `gitPaths`, `gitIgnore`, `gitPollSeconds`, `activeDays`, `windowPolicy` (`skip`/`postpone`/`run`), `workingDirectory`, `workspaceId`, `allowedTools`, `deniedTools`, `matrix` | Регистрирует задачу в планировщике ОС (cron, одноразовый запуск, файл, git или MCP-событие) |
|
|
88
88
|
| `list_tasks` | — | Задачи: расписание, статус, следующее время запуска, цепочки, workspace, сводка матрицы |
|
|
89
89
|
| `update_task` | `name` + изменяемые поля | Частичное обновление: незаданные поля сохраняются, пустые — очищаются, `matrix: null` убирает матрицу |
|
|
90
90
|
| `delete_task` | `name` | Удаляет задачу (родитель матрицы — вместе с клонами и агрегатором) |
|
|
@@ -158,6 +158,10 @@ src/
|
|
|
158
158
|
dry-run.ts симуляция пайплайна
|
|
159
159
|
lock.ts защита от наложения запусков
|
|
160
160
|
file-watcher.ts триггеры chokidar
|
|
161
|
+
telegram.ts доставка в Telegram Bot API
|
|
162
|
+
native-notify.ts нативные уведомления (Windows/macOS/Linux)
|
|
163
|
+
secrets.ts зашифрованное хранилище секретов (AES-256-GCM)
|
|
164
|
+
audit.ts журнал аудита (audit_log в SQLite)
|
|
161
165
|
db/ SQLite: задачи, история, метрики, настройки
|
|
162
166
|
task-transfer.ts экспорт / импорт / валидация
|
|
163
167
|
```
|
|
@@ -201,6 +205,12 @@ Windows (Планировщик Windows), macOS (launchd) и Linux (crontab). Р
|
|
|
201
205
|
**Можно ли отключить уведомления на ночь?**
|
|
202
206
|
Да. Задайте `notifications.quietHours` (`enabled`, `from`, `to` в `HH:MM`). В этом окне успешные и `partial` запуски не отправляются, а ошибки и таймауты приходят всегда.
|
|
203
207
|
|
|
208
|
+
**Как хранить секреты?**
|
|
209
|
+
Используйте `manage_secrets` (или панель «🔐 Секреты» в сайдбаре). Секреты хранятся в `<PLUGIN_DIR>/secrets.json` с шифрованием AES-256-GCM и ключевым файлом `secrets.key` (права 0600). В `env` задачи секрет ссылается как `${secret:NAME}` — значение подставляется при запуске и маскируется в логах, истории и аудите.
|
|
210
|
+
|
|
211
|
+
**Можно ли посмотреть, кто что изменил?**
|
|
212
|
+
Да. Журнал аудита (`get_audit_log`, панель «📜 Журнал аудита», `GET /api/audit`) записывает каждую мутацию — создание/изменение/удаление/запуск задачи, настройки, шаблоны, профили, workspace, секреты, импорт, очистку истории — с aktёром (mcp/gui/http), источником, временной меткой и замаскированными деталями. Ретеншн по умолчанию 90 дней / 10 000 записей.
|
|
213
|
+
|
|
204
214
|
**Чем это отличается от `experimental.schedules` в OpenCode?**
|
|
205
215
|
Встроенный планировщик выполняет задачи, пока OpenCode запущен. Этот плагин использует нативный планировщик ОС и добавляет DAG-пайплайны, матричные сборки, Quality Gates, webhooks и наблюдаемость.
|
|
206
216
|
|