opencode-windows-scheduler 1.5.2 → 1.5.5

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 (231) hide show
  1. package/CHANGELOG.md +107 -2
  2. package/CROSS_PLATFORM.md +107 -71
  3. package/LICENSE +21 -21
  4. package/README.md +74 -26
  5. package/ROADMAP-STRATEGY.md +11 -4
  6. package/ROADMAP.md +322 -112
  7. package/dist/core/analytics.d.ts +3 -0
  8. package/dist/core/analytics.d.ts.map +1 -1
  9. package/dist/core/analytics.js +4 -0
  10. package/dist/core/audit.d.ts +2 -1
  11. package/dist/core/audit.d.ts.map +1 -1
  12. package/dist/core/audit.js +32 -1
  13. package/dist/core/cron-to-schtasks.d.ts.map +1 -1
  14. package/dist/core/cron-to-schtasks.js +21 -4
  15. package/dist/core/file-watcher.d.ts.map +1 -1
  16. package/dist/core/file-watcher.js +16 -1
  17. package/dist/core/git-trigger.d.ts +4 -2
  18. package/dist/core/git-trigger.d.ts.map +1 -1
  19. package/dist/core/git-trigger.js +34 -16
  20. package/dist/core/local-ai.d.ts +52 -0
  21. package/dist/core/local-ai.d.ts.map +1 -0
  22. package/dist/core/local-ai.js +119 -0
  23. package/dist/core/lock.d.ts +14 -0
  24. package/dist/core/lock.d.ts.map +1 -1
  25. package/dist/core/lock.js +81 -4
  26. package/dist/core/matrix.d.ts.map +1 -1
  27. package/dist/core/matrix.js +3 -2
  28. package/dist/core/native-notify.d.ts.map +1 -1
  29. package/dist/core/native-notify.js +3 -0
  30. package/dist/core/one-shot.d.ts +7 -1
  31. package/dist/core/one-shot.d.ts.map +1 -1
  32. package/dist/core/one-shot.js +15 -2
  33. package/dist/core/permissions.d.ts +69 -0
  34. package/dist/core/permissions.d.ts.map +1 -0
  35. package/dist/core/permissions.js +143 -0
  36. package/dist/core/ps-wrapper.d.ts +9 -30
  37. package/dist/core/ps-wrapper.d.ts.map +1 -1
  38. package/dist/core/ps-wrapper.js +477 -108
  39. package/dist/core/record-history.d.ts +11 -0
  40. package/dist/core/record-history.d.ts.map +1 -1
  41. package/dist/core/record-history.js +106 -4
  42. package/dist/core/savings.d.ts +70 -0
  43. package/dist/core/savings.d.ts.map +1 -0
  44. package/dist/core/savings.js +87 -0
  45. package/dist/core/schedule-gate.js +7 -3
  46. package/dist/core/schedule-v2.js +1 -1
  47. package/dist/core/scheduler/index.d.ts +13 -1
  48. package/dist/core/scheduler/index.d.ts.map +1 -1
  49. package/dist/core/scheduler/index.js +35 -4
  50. package/dist/core/scheduler/linux.d.ts +4 -1
  51. package/dist/core/scheduler/linux.d.ts.map +1 -1
  52. package/dist/core/scheduler/linux.js +53 -20
  53. package/dist/core/scheduler/mac.d.ts +2 -1
  54. package/dist/core/scheduler/mac.d.ts.map +1 -1
  55. package/dist/core/scheduler/mac.js +24 -6
  56. package/dist/core/scheduler/posix.d.ts +1 -1
  57. package/dist/core/scheduler/posix.d.ts.map +1 -1
  58. package/dist/core/scheduler/posix.js +2 -2
  59. package/dist/core/scheduler/registry.d.ts +3 -2
  60. package/dist/core/scheduler/registry.d.ts.map +1 -1
  61. package/dist/core/scheduler/registry.js +6 -5
  62. package/dist/core/scheduler/windows.d.ts +49 -1
  63. package/dist/core/scheduler/windows.d.ts.map +1 -1
  64. package/dist/core/scheduler/windows.js +219 -34
  65. package/dist/core/secrets.d.ts +5 -3
  66. package/dist/core/secrets.d.ts.map +1 -1
  67. package/dist/core/secrets.js +86 -8
  68. package/dist/core/self-analysis.d.ts +117 -0
  69. package/dist/core/self-analysis.d.ts.map +1 -0
  70. package/dist/core/self-analysis.js +539 -0
  71. package/dist/core/session.d.ts +11 -3
  72. package/dist/core/session.d.ts.map +1 -1
  73. package/dist/core/session.js +34 -5
  74. package/dist/core/shutdown.d.ts +26 -0
  75. package/dist/core/shutdown.d.ts.map +1 -0
  76. package/dist/core/shutdown.js +49 -0
  77. package/dist/core/summary.d.ts +69 -0
  78. package/dist/core/summary.d.ts.map +1 -0
  79. package/dist/core/summary.js +250 -0
  80. package/dist/core/telegram.d.ts +10 -0
  81. package/dist/core/telegram.d.ts.map +1 -1
  82. package/dist/core/telegram.js +228 -47
  83. package/dist/core/triage-chain.d.ts +40 -0
  84. package/dist/core/triage-chain.d.ts.map +1 -0
  85. package/dist/core/triage-chain.js +80 -0
  86. package/dist/core/triage-compare.d.ts +68 -0
  87. package/dist/core/triage-compare.d.ts.map +1 -0
  88. package/dist/core/triage-compare.js +184 -0
  89. package/dist/core/triage-rules.d.ts +23 -0
  90. package/dist/core/triage-rules.d.ts.map +1 -0
  91. package/dist/core/triage-rules.js +196 -0
  92. package/dist/core/triage-shadow.d.ts +91 -0
  93. package/dist/core/triage-shadow.d.ts.map +1 -0
  94. package/dist/core/triage-shadow.js +160 -0
  95. package/dist/core/triage-worker.d.ts +55 -0
  96. package/dist/core/triage-worker.d.ts.map +1 -0
  97. package/dist/core/triage-worker.js +314 -0
  98. package/dist/core/triage.d.ts +76 -0
  99. package/dist/core/triage.d.ts.map +1 -0
  100. package/dist/core/triage.js +271 -0
  101. package/dist/core/watch-paths.d.ts +6 -0
  102. package/dist/core/watch-paths.d.ts.map +1 -0
  103. package/dist/core/watch-paths.js +62 -0
  104. package/dist/core/wrappers/bash.d.ts +15 -3
  105. package/dist/core/wrappers/bash.d.ts.map +1 -1
  106. package/dist/core/wrappers/bash.js +153 -120
  107. package/dist/db/history-repo.d.ts +1 -1
  108. package/dist/db/history-repo.d.ts.map +1 -1
  109. package/dist/db/history-repo.js +29 -14
  110. package/dist/db/schema.d.ts +1 -1
  111. package/dist/db/schema.d.ts.map +1 -1
  112. package/dist/db/schema.js +31 -0
  113. package/dist/history.d.ts +2 -2
  114. package/dist/history.d.ts.map +1 -1
  115. package/dist/history.js +3 -3
  116. package/dist/i18n.d.ts +25 -2
  117. package/dist/i18n.d.ts.map +1 -1
  118. package/dist/i18n.js +75 -10
  119. package/dist/index.d.ts +66 -3
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +527 -68
  122. package/dist/integrations.d.ts +9 -1
  123. package/dist/integrations.d.ts.map +1 -1
  124. package/dist/integrations.js +34 -6
  125. package/dist/notifications.d.ts +30 -2
  126. package/dist/notifications.d.ts.map +1 -1
  127. package/dist/notifications.js +289 -10
  128. package/dist/profiles.d.ts +1 -1
  129. package/dist/profiles.d.ts.map +1 -1
  130. package/dist/profiles.js +21 -3
  131. package/dist/rpc.d.ts +401 -5
  132. package/dist/rpc.d.ts.map +1 -1
  133. package/dist/rpc.js +138 -5
  134. package/dist/server.d.ts +20 -0
  135. package/dist/server.d.ts.map +1 -1
  136. package/dist/server.js +136 -14
  137. package/dist/settings.d.ts +167 -3
  138. package/dist/settings.d.ts.map +1 -1
  139. package/dist/settings.js +322 -3
  140. package/dist/task-transfer.d.ts +8 -1
  141. package/dist/task-transfer.d.ts.map +1 -1
  142. package/dist/task-transfer.js +2 -2
  143. package/dist/types.d.ts +8 -1
  144. package/dist/types.d.ts.map +1 -1
  145. package/dist/types.js +23 -5
  146. package/dist/workspaces.d.ts +9 -0
  147. package/dist/workspaces.d.ts.map +1 -1
  148. package/dist/workspaces.js +25 -0
  149. package/docs/ARCHITECTURE.md +48 -28
  150. package/docs/CONCEPT.md +230 -0
  151. package/docs/CROSS_PLATFORM.ru.md +150 -0
  152. package/docs/CROSS_PLATFORM.zh.md +146 -0
  153. package/docs/FAQ.md +52 -0
  154. package/docs/FAQ.ru.md +53 -0
  155. package/docs/FAQ.zh.md +43 -0
  156. package/docs/FEATURES.md +141 -44
  157. package/docs/FEATURES.zh.md +655 -0
  158. package/docs/LOCAL-AI.md +300 -0
  159. package/docs/MIGRATION.md +17 -0
  160. package/docs/README.ru.md +22 -16
  161. package/docs/README.zh.md +286 -0
  162. package/docs/SAVINGS.md +61 -0
  163. package/docs/SAVINGS.ru.md +60 -0
  164. package/docs/SAVINGS.zh.md +52 -0
  165. package/docs/ZH-LOCALE-PLAN.md +324 -0
  166. package/docs/spikes/local-model-structured-output.md +81 -0
  167. package/docs/spikes/ollama-qwen3-4b-smoke.json +28 -0
  168. package/docs/spikes/ollama-qwen3-4b.json +163 -0
  169. package/gui-experimental.cjs +8 -8
  170. package/locales/en.json +85 -0
  171. package/locales/ru.json +85 -0
  172. package/locales/zh.json +780 -0
  173. package/package.json +31 -7
  174. package/scripts/bench-local.mjs +321 -0
  175. package/scripts/check-zh-locale.mjs +218 -0
  176. package/scripts/run-tests.mjs +236 -0
  177. package/scripts/spike-local-structured.mjs +182 -0
  178. package/scripts/test-locale.mjs +4 -3
  179. package/skills/scheduled-job-best-practices/SKILL.md +6 -3
  180. package/skills/scheduled-job-best-practices/references/recipes.md +40 -0
  181. package/src/core/analytics.ts +10 -0
  182. package/src/core/audit.ts +39 -1
  183. package/src/core/cron-to-schtasks.ts +23 -4
  184. package/src/core/file-watcher.ts +20 -1
  185. package/src/core/git-trigger.ts +34 -16
  186. package/src/core/local-ai.ts +173 -0
  187. package/src/core/lock.ts +88 -3
  188. package/src/core/matrix.ts +5 -1
  189. package/src/core/native-notify.ts +3 -0
  190. package/src/core/one-shot.ts +18 -2
  191. package/src/core/permissions.ts +200 -0
  192. package/src/core/ps-wrapper.ts +492 -108
  193. package/src/core/record-history.ts +111 -4
  194. package/src/core/savings.ts +150 -0
  195. package/src/core/schedule-gate.ts +9 -3
  196. package/src/core/schedule-v2.ts +1 -1
  197. package/src/core/scheduler/index.ts +41 -3
  198. package/src/core/scheduler/linux.ts +67 -22
  199. package/src/core/scheduler/mac.ts +24 -7
  200. package/src/core/scheduler/posix.ts +2 -2
  201. package/src/core/scheduler/registry.ts +7 -5
  202. package/src/core/scheduler/windows.ts +237 -32
  203. package/src/core/secrets.ts +101 -7
  204. package/src/core/self-analysis.ts +744 -0
  205. package/src/core/session.ts +40 -5
  206. package/src/core/shutdown.ts +69 -0
  207. package/src/core/summary.ts +318 -0
  208. package/src/core/telegram.ts +266 -55
  209. package/src/core/triage-chain.ts +125 -0
  210. package/src/core/triage-compare.ts +277 -0
  211. package/src/core/triage-rules.ts +238 -0
  212. package/src/core/triage-shadow.ts +240 -0
  213. package/src/core/triage-worker.ts +344 -0
  214. package/src/core/triage.ts +366 -0
  215. package/src/core/watch-paths.ts +70 -0
  216. package/src/core/wrappers/bash.ts +181 -138
  217. package/src/db/history-repo.ts +31 -18
  218. package/src/db/schema.ts +31 -0
  219. package/src/gui.tsx +551 -14
  220. package/src/history.ts +7 -3
  221. package/src/i18n.ts +87 -13
  222. package/src/index.ts +649 -71
  223. package/src/integrations.ts +50 -6
  224. package/src/notifications.ts +468 -5
  225. package/src/profiles.ts +21 -3
  226. package/src/rpc.ts +143 -5
  227. package/src/server.ts +135 -16
  228. package/src/settings.ts +582 -5
  229. package/src/task-transfer.ts +10 -3
  230. package/src/types.ts +24 -5
  231. package/src/workspaces.ts +22 -0
package/README.md CHANGED
@@ -8,10 +8,19 @@
8
8
  [![license](https://img.shields.io/npm/l/opencode-windows-scheduler.svg)](LICENSE)
9
9
  [![node](https://img.shields.io/node/v/opencode-windows-scheduler.svg)](package.json)
10
10
 
11
- Русская версия: [docs/README.ru.md](docs/README.ru.md).
11
+ Translations: [Russian](docs/README.ru.md) · [中文](docs/README.zh.md).
12
12
 
13
13
  ---
14
14
 
15
+ ## Quickstart
16
+
17
+ 1. Install the plugin (see [Install](#install)) and restart OpenCode.
18
+ 2. Ask the agent to schedule your first job — one call is enough:
19
+
20
+ > Schedule a task "morning-report" that runs every day at 09:00 with the prompt: "Summarize yesterday's git commits and write the report to ~/reports/".
21
+
22
+ 3. Open the dashboard to watch it run: the agent prints the URL when the task is created (default `http://localhost:4380`), or ask for it later with the `get_dashboard_info` tool. Prefer a preview without installing anything? `node scripts/demo-dashboard.mjs` starts a demo dashboard at `http://localhost:4380`.
23
+
15
24
  ## Why
16
25
 
17
26
  Most schedulers for AI agents are cron wrappers: they run a prompt on a timer and write a log file. This plugin treats agent jobs as **workflows**:
@@ -20,7 +29,7 @@ Most schedulers for AI agents are cron wrappers: they run a prompt on a timer an
20
29
  - **Matrix builds** — one template, N repositories, parallel or sequential, with concurrency limits and per-workspace overrides.
21
30
  - **Quality gates** — a job is marked successful only if `npm test` (or any command) passes.
22
31
  - **Observability** — SQLite history, metrics, logs, and a local web dashboard.
23
- - **Runs without OpenCode open** - jobs are registered with the native OS scheduler (Windows Task Scheduler, launchd, crontab) and survive reboots.
32
+ - **Runs without OpenCode open** - cron and one-shot jobs are registered with the native OS scheduler (Windows Task Scheduler, launchd, crontab) and survive reboots. File, git and MCP-event triggers are watched inside the plugin process, so they need OpenCode running.
24
33
 
25
34
  Everything runs on your machine. No SaaS, no telemetry, no accounts.
26
35
 
@@ -32,7 +41,7 @@ Want to see it without installing OpenCode? `node scripts/demo-dashboard.mjs` st
32
41
 
33
42
  | Area | What you get |
34
43
  |---|---|
35
- | Scheduling | cron expressions, one-shot runs via `runAt` / `delaySeconds`, native OS scheduler (Windows / macOS / Linux), timezone-free local time, pause/resume, session continuity (`new` / `reuse` / `last` with `sessionMaxRuns` cleanup) |
44
+ | Scheduling | cron expressions, one-shot runs via `runAt` / `delaySeconds`, native OS scheduler (Windows / macOS / Linux), IANA timezones (native where possible, minute-poll + gate otherwise), pause/resume, session continuity (`new` / `reuse` / `last` with `sessionMaxRuns` cleanup) |
36
45
  | Reliability | lock-file no-overlap protection, timeouts with hard kill, retries with delay, crash recovery |
37
46
  | Quality | Quality Gate command, before/after hooks, per-task allowed/denied tool lists |
38
47
  | Orchestration | `dependsOn` DAG, `nextTaskOnSuccess` / `nextTaskOnError` chains, matrix fan-out (parallel/sequential, `continue`/`stop`, concurrency, per-workspace overrides, aggregator task) |
@@ -40,22 +49,32 @@ Want to see it without installing OpenCode? `node scripts/demo-dashboard.mjs` st
40
49
  | Multi-repo | workspaces with path validation, per-workspace runs, matrix over one parent task |
41
50
  | Observability | SQLite history (success / error / timeout / partial / running), metrics (duration, tokens, cost), JSONL run logs with `/api/logs`, Prometheus `/metrics`, OTLP export, per-task logs, local web dashboard with 14-day analytics, history retention and CSV/JSON export |
42
51
  | Operations | dry-run preview, export/import JSON, templates, multi-channel notifications (webhook, Telegram, native OS toasts), quiet hours, digest, encrypted secrets (`${secret:NAME}`), audit log, settings |
43
- | Interfaces | OpenCode GUI panel, web dashboard, 24 agent tools, built-in agent skill |
52
+ | Interfaces | OpenCode GUI panel, web dashboard, 25 agent tools, built-in agent skill |
44
53
 
45
54
  ### Language
46
55
 
47
- The interface ships in Russian (default) and English. Switch it in the sidebar settings
48
- (Settings → Language) or with the `manage_settings` tool (`action: "update"`,
49
- `locale: "en"`). The change applies immediately to the GUI, notifications and digest,
50
- the dashboard and agent tool results — no restart. Agent tool descriptions and schemas
51
- stay English by design, and diagnostics printed to the console stay Russian.
52
-
53
- Catalogs live in `locales/ru.json` and `locales/en.json`; every key must exist in both,
54
- otherwise CI fails.
56
+ The interface ships in Russian (default), English and Simplified Chinese. The language
57
+ selector sits in the scheduler panel header (🌐 Auto / Русский / English / 中文) and is
58
+ also available through the `manage_settings` tool (`action: "update"`, `locale: "zh"`).
59
+ `locale: "auto"` (the "Auto" option) follows the OpenCode interface language: the panel
60
+ reacts to language changes immediately, and the resolved locale is sent to the server so
61
+ notifications, digests and the dashboard use the same language. The switch applies
62
+ without a restart. Dashboard localization is still being rolled out: some client-side
63
+ strings remain Russian for now. Agent tool descriptions and schemas stay English by
64
+ design, and diagnostics printed to the console stay Russian.
65
+
66
+ Catalogs live in `locales/ru.json`, `locales/en.json` and `locales/zh.json`; every key
67
+ must exist in all three, otherwise CI fails.
68
+
69
+ Documentation is separate from the interface locale: the English docs are the primary
70
+ source, with Russian (`docs/README.ru.md`) and Simplified Chinese (`docs/README.zh.md`,
71
+ `docs/FEATURES.zh.md`, `docs/FAQ.zh.md`, `docs/SAVINGS.zh.md`,
72
+ `docs/CROSS_PLATFORM.zh.md`) translations. Translations may lag behind the English
73
+ originals.
55
74
 
56
75
  ## Install
57
76
 
58
- Requires OpenCode v2 and Node.js 20+.
77
+ Requires OpenCode v2 and Node.js 22.22+ (node:sqlite and chokidar 6 require Node.js 22.22+).
59
78
 
60
79
  ```bash
61
80
  opencode plugin add opencode-windows-scheduler
@@ -75,12 +94,6 @@ Or add the plugin to `opencode.jsonc` manually:
75
94
 
76
95
  `experimental.schedules: false` disables the built-in OpenCode scheduler so the agent does not confuse built-in job tools with this plugin's tools. Restart OpenCode after changing the config.
77
96
 
78
- Alternatively, install globally with npm:
79
-
80
- ```bash
81
- npm install -g opencode-windows-scheduler
82
- ```
83
-
84
97
  From source:
85
98
 
86
99
  ```bash
@@ -92,11 +105,11 @@ npm run build && npm run build:gui
92
105
 
93
106
  ## Agent tools
94
107
 
95
- The agent gets the full feature set — 24 tools covering scheduling, pipelines, operations, observability and administration:
108
+ The agent gets the full feature set — 25 tools covering scheduling, pipelines, operations, observability and administration:
96
109
 
97
110
  | Tool | Arguments | What it does |
98
111
  |---|---|---|
99
- | `schedule_task` | `name`, `prompt`, `schedule` for cron or `runAt` / `delaySeconds` for one-shot, optional `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` | Registers a job with the OS scheduler (cron, one-shot, file, git or MCP-event trigger) |
112
+ | `schedule_task` | `name`, `prompt`, `schedule` for cron or `runAt` / `delaySeconds` for one-shot, optional `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`, `legacyShell`, `matrix` | Registers a job with the OS scheduler (cron, one-shot, file, git or MCP-event trigger) |
100
113
  | `list_tasks` | — | Returns jobs with schedule, status, next run, chains, workspace and matrix summary |
101
114
  | `update_task` | `name` + any field to change | Partial update; omitted fields keep their values, empty values clear them, `matrix: null` removes the matrix |
102
115
  | `delete_task` | `name` | Deletes a job (a matrix parent deletes clones and aggregator) |
@@ -111,19 +124,38 @@ The agent gets the full feature set — 24 tools covering scheduling, pipelines,
111
124
  | `get_metrics` | — | Aggregate runs, successes and failures |
112
125
  | `get_analytics` | `days?`, `topLimit?` | Period report: counts, success rate, duration, tokens, cost, top tasks |
113
126
  | `manage_settings` | `action`, `maxConcurrent?`, `winterMode?`, `notifications?`, `history?` | Read/update global settings (concurrency, notifications, retention) |
127
+ | `manage_local_ai` | `action` (`get`/`update`/`test`), `mode?`, `baseUrl?`, `model?`, `timeoutMs?`, `fallback?`, `confidenceThreshold?`, `shadow?` | Read, update or test the local triage assistant; `test` sends one synthetic notification and reports latency and verdict |
114
128
  | `manage_templates` | `action`, template fields | List, save or delete reusable task templates |
115
129
  | `manage_profiles` | `action`, `name?`, `port?` | List, create, switch or delete isolated profiles |
116
130
  | `transfer_tasks` | `action`, `data?` | Export all tasks to JSON or import them back |
117
131
  | `send_notification` | `action` (`test`/`digest`), `channel?` (`all`/`webhook`/`telegram`/`native`) | Test the notification channels or send the digest |
118
132
  | `get_dashboard_info` | — | Dashboard port/URL, platform, title, active profile |
119
133
  | `cleanup_history` | `retentionDays?`, `maxRecords?` | Delete old history by age and/or record cap |
134
+ | `manage_secrets` | `action`, `name?`, `value?` | Create, list or delete AES-256-GCM encrypted secrets used in task `env` |
135
+ | `get_audit_log` | `action?`, `target?`, `actor?`, `since?`, `until?`, `limit?` | Mutation audit journal: who changed what, when and via which interface |
120
136
  | `emit_event` | `eventName`, `payload?` | Start tasks subscribed to an MCP event |
121
137
 
122
138
  `schedule_task` also accepts the full matrix configuration (`workspaceIds`, `strategy`, `failureMode`, `aggregation`, `concurrency`, `overrides`, `createAggregator`).
123
139
 
140
+ ## Permissions
141
+
142
+ Agent jobs run with `opencode run --auto`, so their tool policy must be explicit. The global `permissions.defaultPolicy` setting (GUI → Settings, or `manage_settings`) chooses the baseline:
143
+
144
+ | Policy | Allowed by default | Denied by default |
145
+ |---|---|---|
146
+ | `hybrid` (default) | read, edit, glob, grep, subagent, skill, webfetch, websearch | shell, question |
147
+ | `secure` | read, glob, grep, skill | edit, shell, question, webfetch, websearch, subagent |
148
+ | `legacy` | all ten actions | — |
149
+
150
+ `deniedTools` always wins. A non-empty `allowedTools` is an allowlist: it denies every action that is not listed, and can explicitly re-enable an action denied by the policy (for example `shell`). `legacyShell: true` re-enables `shell` only under `hybrid`, for tasks migrated from older versions.
151
+
152
+ Blocked actions are written to the audit journal as `tool.blocked` with `reason: "default-policy"` and a `hint`, and each run logs the active policy.
153
+
154
+ Recommended pattern: keep `git commit`/`push`, builds and tests outside the agent, in `qualityGate` or `afterScript` (the wrapper runs them with `bash -c`), and leave the agent with `read`/`edit`. Most jobs then need no `shell` at all.
155
+
124
156
  ## Agent skill
125
157
 
126
- The plugin registers a built-in skill, `scheduled-job-best-practices`, so the agent loads guidance only when it is relevant: cron design, self-contained prompts, Quality Gates, matrix concurrency, DAG rules and post-incident diagnosis. No manual `.opencode/skills` setup is needed. The skill ships with `references/recipes.md` — seven copy-ready configurations.
158
+ The plugin registers a built-in skill, `scheduled-job-best-practices`, so the agent loads guidance only when it is relevant: cron design, self-contained prompts, Quality Gates, matrix concurrency, DAG rules and post-incident diagnosis. No manual `.opencode/skills` setup is needed. The skill ships with `references/recipes.md` — eight copy-ready configurations.
127
159
 
128
160
  ## Matrix builds
129
161
 
@@ -188,7 +220,7 @@ Tasks are **interactive only** by default: Task Scheduler starts them only while
188
220
  npm install
189
221
  npm run build # tsc
190
222
  npm run build:gui # vite
191
- npm test # 33 test suites, 500+ checks
223
+ npm test # 58 test suites, 600+ checks
192
224
  npm run test:en # same suites with the English locale
193
225
  ```
194
226
 
@@ -200,14 +232,30 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
200
232
  ## Documentation
201
233
 
202
234
  - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — process model, modules, backends, data model.
235
+ - [docs/CONCEPT.md](docs/CONCEPT.md) — north-star concept: verifiable local-first orchestration (in Russian).
203
236
  - [docs/FEATURES.md](docs/FEATURES.md) — full feature catalog with examples.
237
+ - [docs/FAQ.md](docs/FAQ.md) — recovery scenarios, webhook replay, operational answers.
204
238
  - [docs/MIGRATION.md](docs/MIGRATION.md) — moving from cron, systemd, launchd or Task Scheduler.
239
+ - [docs/SAVINGS.md](docs/SAVINGS.md) — how the "Saved $" estimate is calculated.
205
240
  - [CROSS_PLATFORM.md](CROSS_PLATFORM.md) — Windows / macOS / Linux differences and backends.
206
241
 
242
+ Translations: [Русский](docs/README.ru.md) · [中文](docs/README.zh.md).
243
+
207
244
  ## FAQ
208
245
 
209
246
  **Does it work when OpenCode is closed?**
210
- Yes. Jobs are registered with the native OS scheduler, so they run without an open OpenCode window.
247
+ Yes, for cron and one-shot jobs. They are registered with the native OS scheduler, so they run without an open OpenCode window.
248
+
249
+ File (`file`), git (`git`) and MCP-event (`mcp-event`) triggers are watched by the plugin process (chokidar / git polling / the MCP event bus), so OpenCode must be running for those triggers to fire.
250
+
251
+ | Trigger | Runs without OpenCode? | Mechanism |
252
+ |---|---|---|
253
+ | `cron` | ✅ Yes | Native OS scheduler (Task Scheduler / launchd / crontab) |
254
+ | `once` | ✅ Yes | Native OS scheduler, one-shot registration |
255
+ | `file` | ❌ No | chokidar watcher inside the plugin process |
256
+ | `git` | ❌ No | Git polling inside the plugin process |
257
+ | `mcp-event` | ❌ No | MCP event bus inside the plugin process |
258
+ | `webhook` (`/api/hooks/:name`) | ❌ No | HTTP server inside the plugin process |
211
259
 
212
260
  **Do jobs run when nobody is logged on?**
213
261
  On Windows, only if you opt in with `runWhenLoggedOff: true`: the task is then registered as `schtasks /ru SYSTEM` and runs in session 0 without your profile, mapped drives or saved credentials. The default is interactive only — the job runs while the user is logged on. Linux crontab always runs without a login; a macOS launchd agent runs only inside a user session.
@@ -228,10 +276,10 @@ No. Windows Toast (PowerShell/WinRT), macOS Notification Center (`osascript`) an
228
276
  Yes. Set `notifications.quietHours` (`enabled`, `from`, `to` in `HH:MM`). During the window successful and `partial` runs are suppressed, while failures and timeouts are always delivered.
229
277
 
230
278
  **How do I store secrets?**
231
- Use `manage_secrets` (or the «🔐 Секреты» panel in the sidebar) to create an encrypted secret. Secrets are stored in `<PLUGIN_DIR>/secrets.json` with AES-256-GCM and a key file (`secrets.key`, rights 0600). In task `env`, reference a secret as `${secret:NAME}` — the value is substituted at run time and masked in logs, history and audit. The secret name can also be set via `manage_settings` → `notifications.telegram.botToken` left empty and `OPENCODE_SCHEDULER_TELEGRAM_BOT_TOKEN` env var instead.
279
+ Use `manage_secrets` (or the **🔐 Secrets** panel in the sidebar) to create an encrypted secret. Secrets are stored in `<PLUGIN_DIR>/secrets.json` with AES-256-GCM and a key file (`secrets.key`; mode 0600 on POSIX, an ACL granting only the current Windows user on Windows). In task `env`, reference a secret as `${secret:NAME}` — the value is substituted at run time and masked in logs, history and audit. The secret name can also be set via `manage_settings` → `notifications.telegram.botToken` left empty and `OPENCODE_SCHEDULER_TELEGRAM_BOT_TOKEN` env var instead.
232
280
 
233
281
  **Can I see who changed what?**
234
- Yes. The audit log (`get_audit_log` tool, «📜 Журнал аудита» panel, `GET /api/audit`) records every mutation — task create/update/delete/run, settings, templates, profiles, workspaces, secrets, import, history cleanup — with actor (mcp/gui/http), source, timestamp and redacted details. Retention defaults to 90 days / 10 000 records.
282
+ Yes. The audit log (`get_audit_log` tool, **Audit log** panel, `GET /api/audit`) records every mutation — task create/update/delete/run, settings, templates, profiles, workspaces, secrets, import, history cleanup — with actor (mcp/gui/http), source, timestamp and redacted details. Retention defaults to 90 days / 10 000 records.
235
283
 
236
284
  **How is this different from `experimental.schedules`?**
237
285
  The built-in scheduler runs jobs while OpenCode is open. This plugin uses the native OS scheduler and adds DAG pipelines, matrix builds, quality gates, webhooks and observability.
@@ -17,15 +17,16 @@
17
17
  | **Open source-first** | Публичный roadmap, CI на 3 ОС, английская документация |
18
18
  | **Оркестрация, а не таймер** | Ров — DAG, матрицы, Quality Gates, наблюдаемость. Cron скопируют за неделю |
19
19
 
20
- **Текущая точка (1.5.1):**
20
+ **Текущая точка (1.5.3):**
21
21
 
22
22
  - опубликован в npm, CI зелёный на Windows / macOS / Linux;
23
- - 24 инструмента агента — паритет с RPC-поверхностью;
24
- - one-shot запуски, непрерывность сессий, профили, webhooks, Telegram и нативные toast, тихие часы, Prometheus и OTLP — есть;
23
+ - 25 инструментов агента — паритет с RPC-поверхностью;
24
+ - локальный триаж + shadow mode, `manage_local_ai` инструмент + блок настроек в GUI — есть;
25
+ - один-shot запуски, непрерывность сессий, профили, webhooks, Telegram и нативные toast, тихие часы, Prometheus и OTLP — есть;
25
26
  - зашифрованные секреты (${secret:NAME}) и журнал аудита — есть;
26
27
  - английский README и `docs/` — основные, русский синхронизирован в `docs/README.ru.md`.
27
28
 
28
- **Чего ещё нет:** enforced permissions (`allowedTools` пока advisory), локальный ИИ, pipeline-as-code, Docker-runner, approvals и remote runners.
29
+ **Чего ещё нет:** pipeline-as-code, Docker-runner, approvals и remote runners.
29
30
 
30
31
  ---
31
32
 
@@ -136,3 +137,9 @@ Enforced `allowedTools` / `deniedTools` вместо advisory, scoped-инъек
136
137
  3. Docker runner — после подтверждения спроса.
137
138
 
138
139
  **Критерий месяца:** пользователь ставит плагин одной командой, получает уведомление в Telegram о падении задачи, токены и доступы не лежат открытым текстом в `tasks.json`, а интерфейс говорит на его языке.
140
+
141
+ ---
142
+
143
+ ## Долгосрочное видение
144
+
145
+ Путь от плагина к фреймворку описан в [docs/CONCEPT.md](./docs/CONCEPT.md) (§13): локальный интеллект + мультиагентная оркестрация + абстракция слоя исполнения. Этот тактический роадмап является реализацией первых двух этапов — глубокой интеграции с OpenCode v2 и подготовки к абстракции Agent Executor Interface.