opencode-windows-scheduler 1.2.3 → 1.4.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +61 -2
  2. package/README.md +21 -4
  3. package/ROADMAP-STRATEGY.md +61 -159
  4. package/ROADMAP.md +60 -98
  5. package/dist/core/audit.d.ts +68 -0
  6. package/dist/core/audit.d.ts.map +1 -0
  7. package/dist/core/audit.js +206 -0
  8. package/dist/core/native-notify.d.ts +36 -0
  9. package/dist/core/native-notify.d.ts.map +1 -0
  10. package/dist/core/native-notify.js +110 -0
  11. package/dist/core/record-history.js +4 -4
  12. package/dist/core/secrets.d.ts +57 -0
  13. package/dist/core/secrets.d.ts.map +1 -0
  14. package/dist/core/secrets.js +331 -0
  15. package/dist/core/structured-log.d.ts.map +1 -1
  16. package/dist/core/structured-log.js +9 -0
  17. package/dist/core/telegram.d.ts +45 -0
  18. package/dist/core/telegram.d.ts.map +1 -0
  19. package/dist/core/telegram.js +160 -0
  20. package/dist/db/schema.d.ts +1 -1
  21. package/dist/db/schema.d.ts.map +1 -1
  22. package/dist/db/schema.js +15 -0
  23. package/dist/index.d.ts +30 -4
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +349 -22
  26. package/dist/notifications.d.ts +26 -6
  27. package/dist/notifications.d.ts.map +1 -1
  28. package/dist/notifications.js +191 -34
  29. package/dist/rpc.d.ts +400 -0
  30. package/dist/rpc.d.ts.map +1 -1
  31. package/dist/rpc.js +146 -0
  32. package/dist/server.d.ts.map +1 -1
  33. package/dist/server.js +67 -0
  34. package/dist/settings.d.ts +63 -2
  35. package/dist/settings.d.ts.map +1 -1
  36. package/dist/settings.js +126 -2
  37. package/dist/workspaces.d.ts +8 -2
  38. package/dist/workspaces.d.ts.map +1 -1
  39. package/dist/workspaces.js +21 -4
  40. package/docs/ARCHITECTURE.md +16 -6
  41. package/docs/FEATURES.md +57 -12
  42. package/docs/README.ru.md +23 -4
  43. package/gui-experimental.cjs +4 -4
  44. package/package.json +5 -2
  45. package/src/core/audit.ts +291 -0
  46. package/src/core/native-notify.ts +154 -0
  47. package/src/core/record-history.ts +6 -4
  48. package/src/core/secrets.ts +385 -0
  49. package/src/core/structured-log.ts +9 -0
  50. package/src/core/telegram.ts +219 -0
  51. package/src/db/schema.ts +15 -0
  52. package/src/gui.tsx +543 -6
  53. package/src/index.ts +459 -22
  54. package/src/notifications.ts +232 -40
  55. package/src/rpc.ts +157 -0
  56. package/src/server.ts +67 -0
  57. package/src/settings.ts +213 -4
  58. package/src/workspaces.ts +22 -4
package/dist/index.js CHANGED
@@ -34,6 +34,8 @@ import { migrateJsonToDb } from "./db/migrate.js";
34
34
  import { checkJsonBackups, recoverInterruptedRuns } from "./db/recovery.js";
35
35
  import { getTask, listMatrixClones, saveTask } from "./db/tasks-repo.js";
36
36
  import { addWorkspace, deleteWorkspace, getWorkspace, listWorkspaces, updateWorkspace, validateWorkspacePath, readGitBranch, writeWorkspaceEnvFile, maskEnvForLog, } from "./workspaces.js";
37
+ import { deleteSecret, hasSecret, listSecrets, setSecret, } from "./core/secrets.js";
38
+ import { readAuditLog, recordAudit, } from "./core/audit.js";
37
39
  // Путь к вспомогательному node-скрипту записи истории/метрик (dist/core/record-history.js).
38
40
  const require = createRequire(import.meta.url);
39
41
  const resolvedRecorder = require.resolve("./core/record-history.js");
@@ -521,7 +523,7 @@ export const manageSettingsSchema = z.object({
521
523
  notifications: z
522
524
  .any()
523
525
  .optional()
524
- .describe("Notification settings patch (enabled, onlyOnError, webhook, templates, filters, matrix, digest)."),
526
+ .describe("Notification settings patch (enabled, onlyOnError, webhook, telegram, native, quietHours, templates, filters, matrix, digest)."),
525
527
  history: z
526
528
  .object({
527
529
  retentionDays: z.number().int().min(1).max(3650).optional(),
@@ -533,6 +535,10 @@ export const manageSettingsSchema = z.object({
533
535
  .any()
534
536
  .optional()
535
537
  .describe("Integration settings patch (hooks: enabled, token, secret, requireSignature, maxBodyBytes, timestampToleranceSeconds)."),
538
+ audit: z
539
+ .any()
540
+ .optional()
541
+ .describe("Audit log settings patch (enabled, retentionDays, maxRecords)."),
536
542
  });
537
543
  /** manage_templates — пользовательские шаблоны задач. */
538
544
  export const manageTemplatesSchema = z.object({
@@ -585,6 +591,10 @@ export const sendNotificationSchema = z.object({
585
591
  action: z
586
592
  .enum(["test", "digest"])
587
593
  .describe("test — send a test message through the configured channel; digest — send the digest now."),
594
+ channel: z
595
+ .enum(["all", "webhook", "telegram", "native"])
596
+ .optional()
597
+ .describe("For action=test: which channel to check (default all enabled)."),
588
598
  });
589
599
  /** get_dashboard_info — сведения о панели управления. */
590
600
  export const getDashboardInfoSchema = z.object({});
@@ -598,6 +608,29 @@ export const emitEventSchema = z.object({
598
608
  eventName: z.string().min(1).describe("Event name, for example 'deploy.finished'."),
599
609
  payload: z.any().optional().describe("Event payload passed to trigger filters."),
600
610
  });
611
+ /** manage_secrets — зашифрованное хранилище секретов (Спринт 26). */
612
+ export const manageSecretsSchema = z.object({
613
+ action: z
614
+ .enum(["list", "set", "delete"])
615
+ .describe("list — secret names and previews; set — create or replace; delete — remove by name."),
616
+ name: z
617
+ .string()
618
+ .optional()
619
+ .describe("Secret name ([A-Za-z0-9_.-], max 64 chars). Required for set/delete."),
620
+ value: z.string().optional().describe("Secret value (required for set). Never returned by list."),
621
+ });
622
+ /** get_audit_log — журнал мутаций задач и настроек (Спринт 26). */
623
+ export const getAuditLogSchema = z.object({
624
+ action: z.string().optional().describe("Filter by action, for example task.create."),
625
+ target: z.string().optional().describe("Filter by target name or id."),
626
+ actor: z
627
+ .string()
628
+ .optional()
629
+ .describe("Filter by actor: mcp (agent), gui (dashboard), http (webhook/API)."),
630
+ since: z.string().optional().describe("ISO timestamp lower bound."),
631
+ until: z.string().optional().describe("ISO timestamp upper bound."),
632
+ limit: z.number().int().min(1).max(5000).optional().describe("Max records (default 200)."),
633
+ });
601
634
  /**
602
635
  * Директория проекта, в которой запущен OpenCode. Используется как рабочая
603
636
  * директория задачи по умолчанию, чтобы `opencode run` подхватил opencode.json
@@ -1541,11 +1574,12 @@ const manageSettingsExecute = wrapExecute(async (args) => {
1541
1574
  args.winterMode === undefined &&
1542
1575
  args.notifications === undefined &&
1543
1576
  args.history === undefined &&
1544
- args.integrations === undefined) {
1577
+ args.integrations === undefined &&
1578
+ args.audit === undefined) {
1545
1579
  return {
1546
1580
  content: JSON.stringify({
1547
1581
  success: false,
1548
- error: "Для action=update передайте хотя бы одно поле: maxConcurrent, winterMode, notifications, history или integrations.",
1582
+ error: "Для action=update передайте хотя бы одно поле: maxConcurrent, winterMode, notifications, history, integrations или audit.",
1549
1583
  settings: current,
1550
1584
  }),
1551
1585
  };
@@ -1556,6 +1590,7 @@ const manageSettingsExecute = wrapExecute(async (args) => {
1556
1590
  notifications: args.notifications,
1557
1591
  history: args.history,
1558
1592
  integrations: args.integrations,
1593
+ audit: args.audit,
1559
1594
  });
1560
1595
  return { content: JSON.stringify({ success: true, settings }) };
1561
1596
  });
@@ -1693,7 +1728,7 @@ const transferTasksExecute = wrapExecute(async (args) => {
1693
1728
  /** send_notification — тестовое уведомление или дайджест. */
1694
1729
  const sendNotificationExecute = wrapExecute(async (args) => {
1695
1730
  const result = args.action === "test"
1696
- ? await sendTestNotification()
1731
+ ? await sendTestNotification(args.channel ?? "all")
1697
1732
  : await sendDigestNow({ updateLastSentAt: false });
1698
1733
  return { content: JSON.stringify(result) };
1699
1734
  });
@@ -1760,6 +1795,180 @@ const emitEventExecute = wrapExecute(async (args) => {
1760
1795
  }),
1761
1796
  };
1762
1797
  });
1798
+ /** manage_secrets — зашифрованное хранилище секретов. */
1799
+ const manageSecretsExecute = wrapExecute(async (args) => {
1800
+ if (args.action === "list") {
1801
+ return { content: JSON.stringify({ success: true, secrets: listSecrets() }) };
1802
+ }
1803
+ const name = (args.name ?? "").trim();
1804
+ if (!name) {
1805
+ return {
1806
+ content: JSON.stringify({
1807
+ success: false,
1808
+ error: "Для set/delete нужно имя секрета.",
1809
+ }),
1810
+ };
1811
+ }
1812
+ if (args.action === "delete") {
1813
+ const existed = hasSecret(name);
1814
+ deleteSecret(name);
1815
+ return {
1816
+ content: JSON.stringify({
1817
+ success: existed,
1818
+ message: existed
1819
+ ? `Секрет ${name} удалён.`
1820
+ : `Секрет ${name} не найден.`,
1821
+ }),
1822
+ };
1823
+ }
1824
+ const value = args.value;
1825
+ if (typeof value !== "string" || value.length === 0) {
1826
+ return {
1827
+ content: JSON.stringify({
1828
+ success: false,
1829
+ error: "Для action=set нужно непустое значение value.",
1830
+ }),
1831
+ };
1832
+ }
1833
+ const item = setSecret(name, value);
1834
+ return {
1835
+ content: JSON.stringify({
1836
+ success: true,
1837
+ message: `Секрет ${item.name} сохранён в зашифрованном виде.`,
1838
+ secret: item,
1839
+ }),
1840
+ };
1841
+ });
1842
+ /** get_audit_log — чтение журнала мутаций. */
1843
+ const getAuditLogExecute = wrapExecute(async (args) => {
1844
+ const result = readAuditLog({
1845
+ action: args.action,
1846
+ target: args.target,
1847
+ actor: args.actor,
1848
+ since: args.since,
1849
+ until: args.until,
1850
+ limit: args.limit,
1851
+ });
1852
+ return { content: JSON.stringify({ success: true, ...result }) };
1853
+ });
1854
+ /**
1855
+ * Оборачивает execute инструмента, записывая успешную мутацию в audit log.
1856
+ * Аудит не должен ломать сам инструмент, поэтому ошибки проглатываются.
1857
+ */
1858
+ function withAudit(toolName, describe, execute) {
1859
+ return async (args, context) => {
1860
+ const result = await execute(args, context);
1861
+ try {
1862
+ const raw = String(result?.content ?? "");
1863
+ const parsed = raw ? JSON.parse(raw) : null;
1864
+ if (parsed?.success === false)
1865
+ return result;
1866
+ const entry = describe(args);
1867
+ if (entry) {
1868
+ recordAudit({ ...entry, actor: "mcp", source: toolName });
1869
+ }
1870
+ }
1871
+ catch {
1872
+ // Аудит — вспомогательная функция: не мешает основной операции.
1873
+ }
1874
+ return result;
1875
+ };
1876
+ }
1877
+ /** Правила аудита для RPC-методов GUI (Спринт 26). */
1878
+ const RPC_AUDIT_RULES = {
1879
+ create_task: { action: "task.create", targetType: "task", target: (i) => i.name ?? "" },
1880
+ update_task: { action: "task.update", targetType: "task", target: (i) => i.name ?? "" },
1881
+ delete_task: { action: "task.delete", targetType: "task", target: (i) => i.name ?? "" },
1882
+ run_task: { action: "task.run", targetType: "task", target: (i) => i.name ?? "" },
1883
+ pause_task: { action: "task.pause", targetType: "task", target: (i) => i.name ?? "" },
1884
+ resume_task: { action: "task.resume", targetType: "task", target: (i) => i.name ?? "" },
1885
+ cancel_matrix: { action: "matrix.cancel", targetType: "matrix", target: (i) => i.name ?? "" },
1886
+ cleanup_matrix_orphans: {
1887
+ action: "matrix.cleanup",
1888
+ targetType: "matrix",
1889
+ target: () => "orphans",
1890
+ },
1891
+ cleanup_history: {
1892
+ action: "history.cleanup",
1893
+ targetType: "history",
1894
+ target: () => "runs",
1895
+ },
1896
+ emit_event: { action: "event.emit", targetType: "event", target: (i) => i.eventName ?? "" },
1897
+ add_workspace: {
1898
+ action: "workspace.add",
1899
+ targetType: "workspace",
1900
+ target: (i) => i.name ?? i.path ?? "",
1901
+ },
1902
+ update_workspace: {
1903
+ action: "workspace.update",
1904
+ targetType: "workspace",
1905
+ target: (i) => i.id ?? "",
1906
+ },
1907
+ delete_workspace: {
1908
+ action: "workspace.delete",
1909
+ targetType: "workspace",
1910
+ target: (i) => i.id ?? "",
1911
+ },
1912
+ set_profile: { action: "profile.switch", targetType: "profile", target: (i) => i.name ?? "" },
1913
+ create_profile: {
1914
+ action: "profile.create",
1915
+ targetType: "profile",
1916
+ target: (i) => i.name ?? "",
1917
+ },
1918
+ delete_profile: {
1919
+ action: "profile.delete",
1920
+ targetType: "profile",
1921
+ target: (i) => i.name ?? "",
1922
+ },
1923
+ import_tasks: { action: "tasks.import", targetType: "tasks", target: () => "snapshot" },
1924
+ save_settings: { action: "settings.update", targetType: "settings", target: () => "global" },
1925
+ save_template: {
1926
+ action: "template.save",
1927
+ targetType: "template",
1928
+ target: (i) => i.id ?? i.name ?? "",
1929
+ },
1930
+ delete_template: {
1931
+ action: "template.delete",
1932
+ targetType: "template",
1933
+ target: (i) => i.id ?? "",
1934
+ },
1935
+ save_secret: { action: "secret.set", targetType: "secret", target: (i) => i.name ?? "" },
1936
+ delete_secret: { action: "secret.delete", targetType: "secret", target: (i) => i.name ?? "" },
1937
+ };
1938
+ /**
1939
+ * Оборачивает RPC-обработчики GUI: успешные мутации попадают в audit log
1940
+ * с actor=gui. Ошибки аудита не влияют на ответ GUI.
1941
+ */
1942
+ function withRpcAudit(handlers) {
1943
+ const wrapped = {};
1944
+ for (const [name, handler] of Object.entries(handlers)) {
1945
+ const rule = RPC_AUDIT_RULES[name];
1946
+ if (!rule || typeof handler !== "function") {
1947
+ wrapped[name] = handler;
1948
+ continue;
1949
+ }
1950
+ wrapped[name] = async (...args) => {
1951
+ const input = args[0] ?? {};
1952
+ const result = await handler(...args);
1953
+ try {
1954
+ if (result?.success !== false) {
1955
+ recordAudit({
1956
+ action: rule.action,
1957
+ targetType: rule.targetType,
1958
+ target: rule.target(input),
1959
+ actor: "gui",
1960
+ source: name,
1961
+ });
1962
+ }
1963
+ }
1964
+ catch {
1965
+ // Журнал не должен ломать GUI-операцию.
1966
+ }
1967
+ return result;
1968
+ };
1969
+ }
1970
+ return wrapped;
1971
+ }
1763
1972
  /**
1764
1973
  * Менеджер файловых триггеров живёт на уровне модуля, чтобы его можно было
1765
1974
  * обновлять после создания/изменения/удаления задачи. Раньше refresh()
@@ -1906,7 +2115,7 @@ export default Plugin.define({
1906
2115
  "Every run goes through a timeout + lock-file wrapper, so overlapping runs are skipped. " +
1907
2116
  "Without workingDirectory the task runs in the current project folder, where opencode run picks up the project's opencode.json and MCP servers.",
1908
2117
  options: { codemode: true },
1909
- execute: scheduleTaskExecute,
2118
+ execute: withAudit("schedule_task", (args) => ({ action: "task.create", targetType: "task", target: args.name }), scheduleTaskExecute),
1910
2119
  });
1911
2120
  editor.add({
1912
2121
  name: "list_tasks",
@@ -1922,7 +2131,7 @@ export default Plugin.define({
1922
2131
  description: "Partially updates an existing task: omitted fields keep their current values, empty strings/arrays clear them. " +
1923
2132
  "Matrix changes are synced (clones are diffed, running clones are never touched); pass matrix: null to remove the matrix and its clones.",
1924
2133
  options: { codemode: true },
1925
- execute: updateTaskExecute,
2134
+ execute: withAudit("update_task", (args) => ({ action: "task.update", targetType: "task", target: args.name }), updateTaskExecute),
1926
2135
  });
1927
2136
  editor.add({
1928
2137
  name: "delete_task",
@@ -1930,7 +2139,7 @@ export default Plugin.define({
1930
2139
  description: `Deletes a task from the scheduler (${scheduler.title}) by name. ` +
1931
2140
  "Deleting a matrix parent also deletes its clones and aggregator; deleting a single clone is refused (delete the whole matrix instead).",
1932
2141
  options: { codemode: true },
1933
- execute: deleteTaskExecute,
2142
+ execute: withAudit("delete_task", (args) => ({ action: "task.delete", targetType: "task", target: args.name }), deleteTaskExecute),
1934
2143
  });
1935
2144
  editor.add({
1936
2145
  name: "run_task_now",
@@ -1938,21 +2147,21 @@ export default Plugin.define({
1938
2147
  description: `Runs a task immediately in the scheduler (${scheduler.title}) for testing. ` +
1939
2148
  "Runs through the timeout + lock wrapper. For a matrix parent this starts the fan-out instead of the parent itself.",
1940
2149
  options: { codemode: true },
1941
- execute: runTaskNowExecute,
2150
+ execute: withAudit("run_task_now", (args) => ({ action: "task.run", targetType: "task", target: args.name }), runTaskNowExecute),
1942
2151
  });
1943
2152
  editor.add({
1944
2153
  name: "pause_task",
1945
2154
  input: pauseTaskSchema,
1946
2155
  description: "Pauses a task in the OS scheduler. For a matrix parent every clone is paused (the parent itself never runs).",
1947
2156
  options: { codemode: true },
1948
- execute: pauseTaskExecute,
2157
+ execute: withAudit("pause_task", (args) => ({ action: "task.pause", targetType: "task", target: args.name }), pauseTaskExecute),
1949
2158
  });
1950
2159
  editor.add({
1951
2160
  name: "resume_task",
1952
2161
  input: resumeTaskSchema,
1953
2162
  description: "Resumes a previously paused task. For a matrix parent every clone is resumed.",
1954
2163
  options: { codemode: true },
1955
- execute: resumeTaskExecute,
2164
+ execute: withAudit("resume_task", (args) => ({ action: "task.resume", targetType: "task", target: args.name }), resumeTaskExecute),
1956
2165
  });
1957
2166
  editor.add({
1958
2167
  name: "get_history",
@@ -1981,14 +2190,26 @@ export default Plugin.define({
1981
2190
  input: manageWorkspacesSchema,
1982
2191
  description: "Manages multi-repo workspaces: list, add, update or delete. Tasks can target a workspace by id (cwd = workspace path) or fan out to several with matrix.workspaceIds.",
1983
2192
  options: { codemode: true },
1984
- execute: manageWorkspacesExecute,
2193
+ execute: withAudit("manage_workspaces", (args) => args.action === "list"
2194
+ ? null
2195
+ : {
2196
+ action: `workspace.${args.action}`,
2197
+ targetType: "workspace",
2198
+ target: args.id || args.name || "",
2199
+ }, manageWorkspacesExecute),
1985
2200
  });
1986
2201
  editor.add({
1987
2202
  name: "matrix_control",
1988
2203
  input: matrixControlSchema,
1989
2204
  description: "Matrix lifecycle: results (aggregate status/counters of a matrix), cancel (cancel pending clones, stop running ones), cleanup (delete orphaned clones and aggregators whose parent is gone) or preview (expand a matrix config into clone names without creating anything).",
1990
2205
  options: { codemode: true },
1991
- execute: matrixControlExecute,
2206
+ execute: withAudit("matrix_control", (args) => args.action === "cancel" || args.action === "cleanup"
2207
+ ? {
2208
+ action: `matrix.${args.action}`,
2209
+ targetType: "matrix",
2210
+ target: args.name || "",
2211
+ }
2212
+ : null, matrixControlExecute),
1992
2213
  });
1993
2214
  editor.add({
1994
2215
  name: "get_metrics",
@@ -2007,30 +2228,46 @@ export default Plugin.define({
2007
2228
  editor.add({
2008
2229
  name: "manage_settings",
2009
2230
  input: manageSettingsSchema,
2010
- description: "Reads or updates global scheduler settings: maxConcurrent, winterMode, notifications (webhook, filters, matrix alerts, digest) and history retention. Updates are merged into the current settings.",
2231
+ description: "Reads or updates global scheduler settings: maxConcurrent, winterMode, notifications (webhook, Telegram, native OS notifications, quiet hours, filters, matrix alerts, digest) and history retention. Updates are merged into the current settings.",
2011
2232
  options: { codemode: true },
2012
- execute: manageSettingsExecute,
2233
+ execute: withAudit("manage_settings", (args) => args.action === "update"
2234
+ ? { action: "settings.update", targetType: "settings", target: "global" }
2235
+ : null, manageSettingsExecute),
2013
2236
  });
2014
2237
  editor.add({
2015
2238
  name: "manage_templates",
2016
2239
  input: manageTemplatesSchema,
2017
2240
  description: "Lists, saves or deletes reusable task templates (prompt, schedule, retries, Quality Gate, chains, triggers, tool restrictions).",
2018
2241
  options: { codemode: true },
2019
- execute: manageTemplatesExecute,
2242
+ execute: withAudit("manage_templates", (args) => args.action === "list"
2243
+ ? null
2244
+ : {
2245
+ action: `template.${args.action}`,
2246
+ targetType: "template",
2247
+ target: args.id || args.name || "",
2248
+ }, manageTemplatesExecute),
2020
2249
  });
2021
2250
  editor.add({
2022
2251
  name: "manage_profiles",
2023
2252
  input: manageProfilesSchema,
2024
2253
  description: "Lists, creates, switches or deletes isolated scheduler profiles (separate database, settings and dashboard port). Switching requires an OpenCode restart.",
2025
2254
  options: { codemode: true },
2026
- execute: manageProfilesExecute,
2255
+ execute: withAudit("manage_profiles", (args) => args.action === "list"
2256
+ ? null
2257
+ : {
2258
+ action: `profile.${args.action}`,
2259
+ targetType: "profile",
2260
+ target: args.name || "",
2261
+ }, manageProfilesExecute),
2027
2262
  });
2028
2263
  editor.add({
2029
2264
  name: "transfer_tasks",
2030
2265
  input: transferTasksSchema,
2031
2266
  description: "Exports all tasks as a portable JSON snapshot or imports tasks from such a snapshot, recreating them in the OS scheduler.",
2032
2267
  options: { codemode: true },
2033
- execute: transferTasksExecute,
2268
+ execute: withAudit("transfer_tasks", (args) => args.action === "import"
2269
+ ? { action: "tasks.import", targetType: "tasks", target: "snapshot" }
2270
+ : null, transferTasksExecute),
2034
2271
  });
2035
2272
  editor.add({
2036
2273
  name: "send_notification",
@@ -2051,7 +2288,30 @@ export default Plugin.define({
2051
2288
  input: cleanupHistorySchema,
2052
2289
  description: "Deletes old run history by age and/or record cap, using the stored retention policy unless overridden.",
2053
2290
  options: { codemode: true },
2054
- execute: cleanupHistoryExecute,
2291
+ execute: withAudit("cleanup_history", () => ({ action: "history.cleanup", targetType: "history", target: "runs" }), cleanupHistoryExecute),
2292
+ });
2293
+ editor.add({
2294
+ name: "manage_secrets",
2295
+ input: manageSecretsSchema,
2296
+ description: "Manages the encrypted secret store: list (names and masked previews), set (create or replace) or delete. " +
2297
+ "Secrets are encrypted with AES-256-GCM at rest and referenced from workspace env as ${secret:NAME}; " +
2298
+ "values are never returned by list and are redacted from logs and audit details.",
2299
+ options: { codemode: true },
2300
+ execute: withAudit("manage_secrets", (args) => args.action === "list"
2301
+ ? null
2302
+ : {
2303
+ action: `secret.${args.action}`,
2304
+ targetType: "secret",
2305
+ target: (args.name ?? "").trim(),
2306
+ }, manageSecretsExecute),
2307
+ });
2308
+ editor.add({
2309
+ name: "get_audit_log",
2310
+ input: getAuditLogSchema,
2311
+ description: "Returns the audit journal of task and settings mutations: who changed what, when and through which interface (mcp, gui, http). " +
2312
+ "Filter by action, target, actor, time range and limit. Secret values are redacted.",
2313
+ options: { codemode: true },
2314
+ execute: getAuditLogExecute,
2055
2315
  });
2056
2316
  editor.add({
2057
2317
  name: "emit_event",
@@ -2086,7 +2346,7 @@ export default Plugin.define({
2086
2346
  // Регистрируем RPC-методы, вызываемые из GUI-панели.
2087
2347
  // Общая логика создания задачи вынесена в schedulerCreateTask, чтобы
2088
2348
  // schedule_task и create_task использовали один и тот же путь.
2089
- const rpcRegistration = await ctx.rpc.register(SchedulerRpc, {
2349
+ const rpcHandlers = {
2090
2350
  get_tasks: async () => {
2091
2351
  return { tasks: await collectTasksView() };
2092
2352
  },
@@ -2569,13 +2829,14 @@ export default Plugin.define({
2569
2829
  return await loadSettings();
2570
2830
  },
2571
2831
  save_settings: async (input) => {
2572
- const { maxConcurrent, winterMode, notifications, history, integrations } = input;
2832
+ const { maxConcurrent, winterMode, notifications, history, integrations, audit } = input;
2573
2833
  const current = await loadSettings();
2574
2834
  if (maxConcurrent === undefined &&
2575
2835
  winterMode === undefined &&
2576
2836
  notifications === undefined &&
2577
2837
  history === undefined &&
2578
- integrations === undefined) {
2838
+ integrations === undefined &&
2839
+ audit === undefined) {
2579
2840
  return {
2580
2841
  success: false,
2581
2842
  maxConcurrent: current.maxConcurrent,
@@ -2583,6 +2844,7 @@ export default Plugin.define({
2583
2844
  notifications: current.notifications,
2584
2845
  history: current.history,
2585
2846
  integrations: current.integrations,
2847
+ audit: current.audit,
2586
2848
  };
2587
2849
  }
2588
2850
  const settings = await saveSettings({
@@ -2591,6 +2853,7 @@ export default Plugin.define({
2591
2853
  notifications,
2592
2854
  history,
2593
2855
  integrations,
2856
+ audit,
2594
2857
  });
2595
2858
  return {
2596
2859
  success: true,
@@ -2599,6 +2862,7 @@ export default Plugin.define({
2599
2862
  notifications: settings.notifications,
2600
2863
  history: settings.history,
2601
2864
  integrations: settings.integrations,
2865
+ audit: settings.audit,
2602
2866
  };
2603
2867
  },
2604
2868
  test_notification: async () => {
@@ -2608,6 +2872,68 @@ export default Plugin.define({
2608
2872
  // Ручная отправка не сдвигает плановое расписание дайджеста.
2609
2873
  return await sendDigestNow({ updateLastSentAt: false });
2610
2874
  },
2875
+ // --- Спринт 26: секреты и аудит -------------------------------------
2876
+ list_secrets: async () => {
2877
+ return { success: true, secrets: listSecrets() };
2878
+ },
2879
+ save_secret: async (input) => {
2880
+ try {
2881
+ const source = (input ?? {});
2882
+ const name = (source.name ?? "").trim();
2883
+ if (!name) {
2884
+ return { success: false, message: "Нужно имя секрета." };
2885
+ }
2886
+ if (typeof source.value !== "string" || source.value.length === 0) {
2887
+ return { success: false, message: "Нужно непустое значение секрета." };
2888
+ }
2889
+ const secret = setSecret(name, source.value);
2890
+ return {
2891
+ success: true,
2892
+ message: `Секрет ${secret.name} сохранён в зашифрованном виде.`,
2893
+ secret,
2894
+ };
2895
+ }
2896
+ catch (err) {
2897
+ return {
2898
+ success: false,
2899
+ message: err instanceof Error ? err.message : String(err),
2900
+ };
2901
+ }
2902
+ },
2903
+ delete_secret: async (input) => {
2904
+ try {
2905
+ const name = ((input ?? {}).name ?? "").trim();
2906
+ if (!name) {
2907
+ return { success: false, message: "Нужно имя секрета." };
2908
+ }
2909
+ const existed = hasSecret(name);
2910
+ deleteSecret(name);
2911
+ return {
2912
+ success: existed,
2913
+ message: existed
2914
+ ? `Секрет ${name} удалён.`
2915
+ : `Секрет ${name} не найден.`,
2916
+ };
2917
+ }
2918
+ catch (err) {
2919
+ return {
2920
+ success: false,
2921
+ message: err instanceof Error ? err.message : String(err),
2922
+ };
2923
+ }
2924
+ },
2925
+ get_audit: async (input) => {
2926
+ const source = (input ?? {});
2927
+ const result = readAuditLog({
2928
+ action: source.action,
2929
+ target: source.target,
2930
+ actor: source.actor,
2931
+ since: source.since,
2932
+ until: source.until,
2933
+ limit: source.limit,
2934
+ });
2935
+ return { success: true, ...result };
2936
+ },
2611
2937
  get_templates: async () => {
2612
2938
  try {
2613
2939
  return { templates: await loadTemplates() };
@@ -2713,7 +3039,8 @@ export default Plugin.define({
2713
3039
  return { success: false, error: err instanceof Error ? err.message : String(err) };
2714
3040
  }
2715
3041
  },
2716
- });
3042
+ };
3043
+ const rpcRegistration = await ctx.rpc.register(SchedulerRpc, withRpcAudit(rpcHandlers));
2717
3044
  // Lifecycle матриц (Спринт 16): при старте вычищаем клоны/агрегаторы,
2718
3045
  // чьи родители были удалены в прошлых сессиях.
2719
3046
  void cleanupOrphanedMatrixTasks().catch((err) => {
@@ -8,6 +8,10 @@ export interface NotificationPayload {
8
8
  status: NotificationStatus;
9
9
  durationMs: number;
10
10
  error?: string | null;
11
+ /** Потраченные токены, если известны. */
12
+ tokens?: number | null;
13
+ /** Стоимость запуска в USD, если известна. */
14
+ costUsd?: number | null;
11
15
  }
12
16
  /** Человекочитаемая длительность: 2300 мс → «2.3s». */
13
17
  export declare function formatDuration(durationMs: number): string;
@@ -56,6 +60,23 @@ export interface WebhookOptions {
56
60
  * вызывающий код обязан перехватить его, чтобы уведомление не ломало задачу.
57
61
  */
58
62
  export declare function sendWebhook(url: string, message: string, options?: WebhookOptions): Promise<void>;
63
+ /** Канал доставки уведомлений. */
64
+ export type NotificationChannel = "webhook" | "telegram" | "native";
65
+ /** Результат отправки в один канал. */
66
+ export interface ChannelDeliveryResult {
67
+ channel: NotificationChannel;
68
+ ok: boolean;
69
+ error?: string;
70
+ }
71
+ /**
72
+ * Тихие часы: true, если сейчас действует окно `quiet`. Диапазон может
73
+ * переходить через полночь (22:00 → 08:00). Некорректное время — false.
74
+ */
75
+ export declare function isQuietHours(now: Date, quiet?: {
76
+ enabled?: boolean;
77
+ from?: string;
78
+ to?: string;
79
+ } | null): boolean;
59
80
  /**
60
81
  * Уведомляет о завершении задачи во все включённые каналы.
61
82
  *
@@ -65,7 +86,7 @@ export declare function sendWebhook(url: string, message: string, options?: Webh
65
86
  * - фильтры include/exclude отсекают задачи по имени;
66
87
  * - ошибки отправки только логируются, наружу не выбрасываются.
67
88
  */
68
- export declare function notifyTaskCompletion(taskName: string, status: NotificationStatus, durationMs: number, error?: string | null): Promise<void>;
89
+ export declare function notifyTaskCompletion(taskName: string, status: NotificationStatus, durationMs: number, error?: string | null, tokens?: number | null, costUsd?: number | null): Promise<void>;
69
90
  /**
70
91
  * Уведомляет о завершении матрицы (Спринт 20).
71
92
  *
@@ -139,12 +160,11 @@ export declare function sendDigestNow(options?: {
139
160
  /** Плановая проверка дайджеста: отправляет, если пора. Возвращает true при отправке. */
140
161
  export declare function maybeSendDigest(now?: Date): Promise<boolean>;
141
162
  /**
142
- * Отправляет тестовое сообщение в webhook (кнопка «🧪 Тестовое уведомление»).
143
- *
144
- * В отличие от notifyTaskCompletion, результат возвращается пользователю:
145
- * при тесте важно увидеть причину ошибки.
163
+ * Отправляет тестовое сообщение в выбранный канал или во все включённые
164
+ * (кнопка «🧪 Тестовое уведомление»). В отличие от notifyTaskCompletion,
165
+ * результат возвращается пользователю: при тесте важна причина ошибки.
146
166
  */
147
- export declare function sendTestNotification(): Promise<{
167
+ export declare function sendTestNotification(channel?: "all" | NotificationChannel): Promise<{
148
168
  success: boolean;
149
169
  message: string;
150
170
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAExB,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAG7B,oEAAoE;AACpE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1E,8BAA8B;AAC9B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAQD,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGzD;AAOD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQrE;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAST;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,CAIR;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,EAC5B,SAAS,CAAC,EAAE,qBAAqB,GAChC,MAAM,CA8BR;AAED,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,UAAU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