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.
- package/CHANGELOG.md +107 -2
- package/CROSS_PLATFORM.md +107 -71
- package/LICENSE +21 -21
- package/README.md +74 -26
- package/ROADMAP-STRATEGY.md +11 -4
- package/ROADMAP.md +322 -112
- package/dist/core/analytics.d.ts +3 -0
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/core/analytics.js +4 -0
- package/dist/core/audit.d.ts +2 -1
- package/dist/core/audit.d.ts.map +1 -1
- package/dist/core/audit.js +32 -1
- package/dist/core/cron-to-schtasks.d.ts.map +1 -1
- package/dist/core/cron-to-schtasks.js +21 -4
- package/dist/core/file-watcher.d.ts.map +1 -1
- package/dist/core/file-watcher.js +16 -1
- package/dist/core/git-trigger.d.ts +4 -2
- package/dist/core/git-trigger.d.ts.map +1 -1
- package/dist/core/git-trigger.js +34 -16
- package/dist/core/local-ai.d.ts +52 -0
- package/dist/core/local-ai.d.ts.map +1 -0
- package/dist/core/local-ai.js +119 -0
- package/dist/core/lock.d.ts +14 -0
- package/dist/core/lock.d.ts.map +1 -1
- package/dist/core/lock.js +81 -4
- package/dist/core/matrix.d.ts.map +1 -1
- package/dist/core/matrix.js +3 -2
- package/dist/core/native-notify.d.ts.map +1 -1
- package/dist/core/native-notify.js +3 -0
- package/dist/core/one-shot.d.ts +7 -1
- package/dist/core/one-shot.d.ts.map +1 -1
- package/dist/core/one-shot.js +15 -2
- package/dist/core/permissions.d.ts +69 -0
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/core/permissions.js +143 -0
- package/dist/core/ps-wrapper.d.ts +9 -30
- package/dist/core/ps-wrapper.d.ts.map +1 -1
- package/dist/core/ps-wrapper.js +477 -108
- package/dist/core/record-history.d.ts +11 -0
- package/dist/core/record-history.d.ts.map +1 -1
- package/dist/core/record-history.js +106 -4
- package/dist/core/savings.d.ts +70 -0
- package/dist/core/savings.d.ts.map +1 -0
- package/dist/core/savings.js +87 -0
- package/dist/core/schedule-gate.js +7 -3
- package/dist/core/schedule-v2.js +1 -1
- package/dist/core/scheduler/index.d.ts +13 -1
- package/dist/core/scheduler/index.d.ts.map +1 -1
- package/dist/core/scheduler/index.js +35 -4
- package/dist/core/scheduler/linux.d.ts +4 -1
- package/dist/core/scheduler/linux.d.ts.map +1 -1
- package/dist/core/scheduler/linux.js +53 -20
- package/dist/core/scheduler/mac.d.ts +2 -1
- package/dist/core/scheduler/mac.d.ts.map +1 -1
- package/dist/core/scheduler/mac.js +24 -6
- package/dist/core/scheduler/posix.d.ts +1 -1
- package/dist/core/scheduler/posix.d.ts.map +1 -1
- package/dist/core/scheduler/posix.js +2 -2
- package/dist/core/scheduler/registry.d.ts +3 -2
- package/dist/core/scheduler/registry.d.ts.map +1 -1
- package/dist/core/scheduler/registry.js +6 -5
- package/dist/core/scheduler/windows.d.ts +49 -1
- package/dist/core/scheduler/windows.d.ts.map +1 -1
- package/dist/core/scheduler/windows.js +219 -34
- package/dist/core/secrets.d.ts +5 -3
- package/dist/core/secrets.d.ts.map +1 -1
- package/dist/core/secrets.js +86 -8
- package/dist/core/self-analysis.d.ts +117 -0
- package/dist/core/self-analysis.d.ts.map +1 -0
- package/dist/core/self-analysis.js +539 -0
- package/dist/core/session.d.ts +11 -3
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +34 -5
- package/dist/core/shutdown.d.ts +26 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +49 -0
- package/dist/core/summary.d.ts +69 -0
- package/dist/core/summary.d.ts.map +1 -0
- package/dist/core/summary.js +250 -0
- package/dist/core/telegram.d.ts +10 -0
- package/dist/core/telegram.d.ts.map +1 -1
- package/dist/core/telegram.js +228 -47
- package/dist/core/triage-chain.d.ts +40 -0
- package/dist/core/triage-chain.d.ts.map +1 -0
- package/dist/core/triage-chain.js +80 -0
- package/dist/core/triage-compare.d.ts +68 -0
- package/dist/core/triage-compare.d.ts.map +1 -0
- package/dist/core/triage-compare.js +184 -0
- package/dist/core/triage-rules.d.ts +23 -0
- package/dist/core/triage-rules.d.ts.map +1 -0
- package/dist/core/triage-rules.js +196 -0
- package/dist/core/triage-shadow.d.ts +91 -0
- package/dist/core/triage-shadow.d.ts.map +1 -0
- package/dist/core/triage-shadow.js +160 -0
- package/dist/core/triage-worker.d.ts +55 -0
- package/dist/core/triage-worker.d.ts.map +1 -0
- package/dist/core/triage-worker.js +314 -0
- package/dist/core/triage.d.ts +76 -0
- package/dist/core/triage.d.ts.map +1 -0
- package/dist/core/triage.js +271 -0
- package/dist/core/watch-paths.d.ts +6 -0
- package/dist/core/watch-paths.d.ts.map +1 -0
- package/dist/core/watch-paths.js +62 -0
- package/dist/core/wrappers/bash.d.ts +15 -3
- package/dist/core/wrappers/bash.d.ts.map +1 -1
- package/dist/core/wrappers/bash.js +153 -120
- package/dist/db/history-repo.d.ts +1 -1
- package/dist/db/history-repo.d.ts.map +1 -1
- package/dist/db/history-repo.js +29 -14
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +31 -0
- package/dist/history.d.ts +2 -2
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +3 -3
- package/dist/i18n.d.ts +25 -2
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +75 -10
- package/dist/index.d.ts +66 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +527 -68
- package/dist/integrations.d.ts +9 -1
- package/dist/integrations.d.ts.map +1 -1
- package/dist/integrations.js +34 -6
- package/dist/notifications.d.ts +30 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +289 -10
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +21 -3
- package/dist/rpc.d.ts +401 -5
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +138 -5
- package/dist/server.d.ts +20 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +136 -14
- package/dist/settings.d.ts +167 -3
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +322 -3
- package/dist/task-transfer.d.ts +8 -1
- package/dist/task-transfer.d.ts.map +1 -1
- package/dist/task-transfer.js +2 -2
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +23 -5
- package/dist/workspaces.d.ts +9 -0
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +25 -0
- package/docs/ARCHITECTURE.md +48 -28
- package/docs/CONCEPT.md +230 -0
- package/docs/CROSS_PLATFORM.ru.md +150 -0
- package/docs/CROSS_PLATFORM.zh.md +146 -0
- package/docs/FAQ.md +52 -0
- package/docs/FAQ.ru.md +53 -0
- package/docs/FAQ.zh.md +43 -0
- package/docs/FEATURES.md +141 -44
- package/docs/FEATURES.zh.md +655 -0
- package/docs/LOCAL-AI.md +300 -0
- package/docs/MIGRATION.md +17 -0
- package/docs/README.ru.md +22 -16
- package/docs/README.zh.md +286 -0
- package/docs/SAVINGS.md +61 -0
- package/docs/SAVINGS.ru.md +60 -0
- package/docs/SAVINGS.zh.md +52 -0
- package/docs/ZH-LOCALE-PLAN.md +324 -0
- package/docs/spikes/local-model-structured-output.md +81 -0
- package/docs/spikes/ollama-qwen3-4b-smoke.json +28 -0
- package/docs/spikes/ollama-qwen3-4b.json +163 -0
- package/gui-experimental.cjs +8 -8
- package/locales/en.json +85 -0
- package/locales/ru.json +85 -0
- package/locales/zh.json +780 -0
- package/package.json +31 -7
- package/scripts/bench-local.mjs +321 -0
- package/scripts/check-zh-locale.mjs +218 -0
- package/scripts/run-tests.mjs +236 -0
- package/scripts/spike-local-structured.mjs +182 -0
- package/scripts/test-locale.mjs +4 -3
- package/skills/scheduled-job-best-practices/SKILL.md +6 -3
- package/skills/scheduled-job-best-practices/references/recipes.md +40 -0
- package/src/core/analytics.ts +10 -0
- package/src/core/audit.ts +39 -1
- package/src/core/cron-to-schtasks.ts +23 -4
- package/src/core/file-watcher.ts +20 -1
- package/src/core/git-trigger.ts +34 -16
- package/src/core/local-ai.ts +173 -0
- package/src/core/lock.ts +88 -3
- package/src/core/matrix.ts +5 -1
- package/src/core/native-notify.ts +3 -0
- package/src/core/one-shot.ts +18 -2
- package/src/core/permissions.ts +200 -0
- package/src/core/ps-wrapper.ts +492 -108
- package/src/core/record-history.ts +111 -4
- package/src/core/savings.ts +150 -0
- package/src/core/schedule-gate.ts +9 -3
- package/src/core/schedule-v2.ts +1 -1
- package/src/core/scheduler/index.ts +41 -3
- package/src/core/scheduler/linux.ts +67 -22
- package/src/core/scheduler/mac.ts +24 -7
- package/src/core/scheduler/posix.ts +2 -2
- package/src/core/scheduler/registry.ts +7 -5
- package/src/core/scheduler/windows.ts +237 -32
- package/src/core/secrets.ts +101 -7
- package/src/core/self-analysis.ts +744 -0
- package/src/core/session.ts +40 -5
- package/src/core/shutdown.ts +69 -0
- package/src/core/summary.ts +318 -0
- package/src/core/telegram.ts +266 -55
- package/src/core/triage-chain.ts +125 -0
- package/src/core/triage-compare.ts +277 -0
- package/src/core/triage-rules.ts +238 -0
- package/src/core/triage-shadow.ts +240 -0
- package/src/core/triage-worker.ts +344 -0
- package/src/core/triage.ts +366 -0
- package/src/core/watch-paths.ts +70 -0
- package/src/core/wrappers/bash.ts +181 -138
- package/src/db/history-repo.ts +31 -18
- package/src/db/schema.ts +31 -0
- package/src/gui.tsx +551 -14
- package/src/history.ts +7 -3
- package/src/i18n.ts +87 -13
- package/src/index.ts +649 -71
- package/src/integrations.ts +50 -6
- package/src/notifications.ts +468 -5
- package/src/profiles.ts +21 -3
- package/src/rpc.ts +143 -5
- package/src/server.ts +135 -16
- package/src/settings.ts +582 -5
- package/src/task-transfer.ts +10 -3
- package/src/types.ts +24 -5
- package/src/workspaces.ts +22 -0
package/README.md
CHANGED
|
@@ -8,10 +8,19 @@
|
|
|
8
8
|
[](LICENSE)
|
|
9
9
|
[](package.json)
|
|
10
10
|
|
|
11
|
-
|
|
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),
|
|
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,
|
|
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)
|
|
48
|
-
(
|
|
49
|
-
`locale: "
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
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 —
|
|
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` —
|
|
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 #
|
|
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.
|
|
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
|
|
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,
|
|
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.
|
package/ROADMAP-STRATEGY.md
CHANGED
|
@@ -17,15 +17,16 @@
|
|
|
17
17
|
| **Open source-first** | Публичный roadmap, CI на 3 ОС, английская документация |
|
|
18
18
|
| **Оркестрация, а не таймер** | Ров — DAG, матрицы, Quality Gates, наблюдаемость. Cron скопируют за неделю |
|
|
19
19
|
|
|
20
|
-
**Текущая точка (1.5.
|
|
20
|
+
**Текущая точка (1.5.3):**
|
|
21
21
|
|
|
22
22
|
- опубликован в npm, CI зелёный на Windows / macOS / Linux;
|
|
23
|
-
-
|
|
24
|
-
-
|
|
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
|
-
**Чего ещё нет:**
|
|
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.
|