agent-steward 0.0.2 → 0.0.3

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 (180) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/CROSS_PLATFORM.md +11 -9
  3. package/README.md +9 -8
  4. package/ROADMAP-STRATEGY.md +93 -44
  5. package/ROADMAP.md +114 -999
  6. package/dist/core/cron-to-schtasks.d.ts +0 -8
  7. package/dist/core/cron-to-schtasks.d.ts.map +1 -1
  8. package/dist/core/cron-to-schtasks.js +11 -86
  9. package/dist/core/dry-run.js +1 -1
  10. package/dist/core/file-watcher.js +9 -9
  11. package/dist/core/git-trigger.js +4 -4
  12. package/dist/core/lock.js +2 -4
  13. package/dist/core/one-shot.d.ts +27 -5
  14. package/dist/core/one-shot.d.ts.map +1 -1
  15. package/dist/core/one-shot.js +53 -10
  16. package/dist/core/otel.js +2 -2
  17. package/dist/core/ps-wrapper.d.ts +1 -1
  18. package/dist/core/ps-wrapper.d.ts.map +1 -1
  19. package/dist/core/ps-wrapper.js +55 -35
  20. package/dist/core/record-history.js +22 -22
  21. package/dist/core/schedule-v2.d.ts +2 -2
  22. package/dist/core/schedule-v2.d.ts.map +1 -1
  23. package/dist/core/schedule-v2.js +7 -7
  24. package/dist/core/scheduler/at-fallback.d.ts +42 -0
  25. package/dist/core/scheduler/at-fallback.d.ts.map +1 -0
  26. package/dist/core/scheduler/at-fallback.js +70 -0
  27. package/dist/core/scheduler/linux.d.ts +3 -1
  28. package/dist/core/scheduler/linux.d.ts.map +1 -1
  29. package/dist/core/scheduler/linux.js +43 -7
  30. package/dist/core/scheduler/mac.d.ts +14 -8
  31. package/dist/core/scheduler/mac.d.ts.map +1 -1
  32. package/dist/core/scheduler/mac.js +71 -22
  33. package/dist/core/scheduler/posix.d.ts.map +1 -1
  34. package/dist/core/scheduler/posix.js +12 -1
  35. package/dist/core/scheduler/registry.d.ts +2 -0
  36. package/dist/core/scheduler/registry.d.ts.map +1 -1
  37. package/dist/core/scheduler/windows.d.ts +16 -3
  38. package/dist/core/scheduler/windows.d.ts.map +1 -1
  39. package/dist/core/scheduler/windows.js +249 -96
  40. package/dist/core/secrets.js +2 -2
  41. package/dist/core/self-analysis.js +55 -55
  42. package/dist/core/summary.js +1 -1
  43. package/dist/core/triage-chain.js +1 -1
  44. package/dist/core/triage-worker.js +2 -2
  45. package/dist/core/triage.js +1 -1
  46. package/dist/core/wrappers/bash.js +33 -33
  47. package/dist/db/index.d.ts +2 -0
  48. package/dist/db/index.d.ts.map +1 -1
  49. package/dist/db/index.js +9 -1
  50. package/dist/db/run-journal.d.ts +60 -0
  51. package/dist/db/run-journal.d.ts.map +1 -0
  52. package/dist/db/run-journal.js +143 -0
  53. package/dist/db/run-resume.d.ts +48 -0
  54. package/dist/db/run-resume.d.ts.map +1 -0
  55. package/dist/db/run-resume.js +137 -0
  56. package/dist/db/runs-repo.d.ts +120 -0
  57. package/dist/db/runs-repo.d.ts.map +1 -0
  58. package/dist/db/runs-repo.js +319 -0
  59. package/dist/db/schema.d.ts +16 -2
  60. package/dist/db/schema.d.ts.map +1 -1
  61. package/dist/db/schema.js +190 -35
  62. package/dist/index.d.ts +1 -1
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +66 -36
  65. package/dist/notifications.js +18 -18
  66. package/dist/profiles.d.ts +7 -3
  67. package/dist/profiles.d.ts.map +1 -1
  68. package/dist/profiles.js +85 -7
  69. package/dist/rpc.d.ts +109 -0
  70. package/dist/rpc.d.ts.map +1 -1
  71. package/dist/rpc.js +89 -0
  72. package/dist/server.d.ts +2 -2
  73. package/dist/server.d.ts.map +1 -1
  74. package/dist/server.js +20 -19
  75. package/dist/shared/jobs-view.d.ts.map +1 -1
  76. package/dist/skill.js +1 -1
  77. package/dist/task-transfer.d.ts +1 -1
  78. package/dist/task-transfer.d.ts.map +1 -1
  79. package/dist/task-transfer.js +14 -10
  80. package/dist/types.d.ts +20 -4
  81. package/dist/types.d.ts.map +1 -1
  82. package/dist/types.js +37 -9
  83. package/dist/workspaces.js +1 -1
  84. package/docs/ARCHITECTURE.md +110 -8
  85. package/docs/COMPATIBILITY.md +10 -6
  86. package/docs/CONCEPT.md +15 -3
  87. package/docs/CROSS_PLATFORM.ru.md +11 -9
  88. package/docs/CROSS_PLATFORM.zh.md +11 -9
  89. package/docs/FAQ.md +2 -2
  90. package/docs/FAQ.ru.md +2 -2
  91. package/docs/FAQ.zh.md +2 -2
  92. package/docs/FEATURES.md +5 -4
  93. package/docs/FEATURES.zh.md +5 -4
  94. package/docs/MIGRATION.md +34 -26
  95. package/docs/README.ru.md +26 -7
  96. package/docs/README.zh.md +9 -8
  97. package/docs/V1-V2-COMPATIBILITY-PLAN.md +6 -6
  98. package/gui-experimental.cjs +8 -8
  99. package/index.js +1 -0
  100. package/locales/en.json +1 -0
  101. package/locales/ru.json +1 -0
  102. package/locales/zh.json +1 -0
  103. package/package.json +31 -10
  104. package/src/core/analytics.ts +2 -2
  105. package/src/core/audit.ts +17 -17
  106. package/src/core/cron-to-schtasks.ts +14 -93
  107. package/src/core/dry-run.ts +26 -26
  108. package/src/core/file-watcher.ts +17 -17
  109. package/src/core/git-trigger.ts +9 -9
  110. package/src/core/glob.ts +1 -1
  111. package/src/core/local-ai.ts +2 -2
  112. package/src/core/lock.ts +9 -9
  113. package/src/core/matrix.ts +31 -31
  114. package/src/core/native-notify.ts +2 -2
  115. package/src/core/one-shot.ts +63 -13
  116. package/src/core/otel.ts +4 -4
  117. package/src/core/permissions.ts +5 -5
  118. package/src/core/prometheus.ts +17 -17
  119. package/src/core/ps-wrapper.ts +57 -37
  120. package/src/core/record-history.ts +40 -40
  121. package/src/core/retention.ts +3 -3
  122. package/src/core/savings.ts +1 -1
  123. package/src/core/schedule-gate.ts +12 -12
  124. package/src/core/schedule-v2.ts +24 -24
  125. package/src/core/scheduler/at-fallback.ts +113 -0
  126. package/src/core/scheduler/index.ts +3 -3
  127. package/src/core/scheduler/linux.ts +64 -13
  128. package/src/core/scheduler/logs.ts +1 -1
  129. package/src/core/scheduler/mac.ts +112 -60
  130. package/src/core/scheduler/posix.ts +15 -1
  131. package/src/core/scheduler/registry.ts +6 -4
  132. package/src/core/scheduler/windows.ts +295 -125
  133. package/src/core/secrets.ts +13 -13
  134. package/src/core/self-analysis.ts +61 -61
  135. package/src/core/session.ts +3 -3
  136. package/src/core/structured-log.ts +3 -3
  137. package/src/core/summary.ts +25 -25
  138. package/src/core/telegram.ts +16 -16
  139. package/src/core/triage-chain.ts +4 -4
  140. package/src/core/triage-compare.ts +8 -8
  141. package/src/core/triage-rules.ts +4 -4
  142. package/src/core/triage-shadow.ts +7 -7
  143. package/src/core/triage-worker.ts +6 -6
  144. package/src/core/triage.ts +23 -23
  145. package/src/core/watch-paths.ts +1 -1
  146. package/src/core/wrappers/bash.ts +41 -41
  147. package/src/db/git-state-repo.ts +1 -1
  148. package/src/db/history-repo.ts +22 -22
  149. package/src/db/index.ts +16 -6
  150. package/src/db/metrics-repo.ts +10 -10
  151. package/src/db/migrate.ts +10 -10
  152. package/src/db/recovery.ts +3 -3
  153. package/src/db/run-journal.ts +212 -0
  154. package/src/db/run-resume.ts +220 -0
  155. package/src/db/runs-repo.ts +481 -0
  156. package/src/db/schema.ts +205 -44
  157. package/src/db/settings-repo.ts +2 -2
  158. package/src/db/tasks-repo.ts +10 -10
  159. package/src/db/templates-repo.ts +7 -7
  160. package/src/gui.tsx +1 -1
  161. package/src/history.ts +4 -4
  162. package/src/i18n.ts +7 -7
  163. package/src/index.ts +341 -304
  164. package/src/integrations.ts +6 -6
  165. package/src/notifications.ts +76 -76
  166. package/src/profiles.ts +98 -7
  167. package/src/rpc.ts +96 -1
  168. package/src/schtasks.ts +2 -2
  169. package/src/server.ts +43 -42
  170. package/src/settings.ts +44 -44
  171. package/src/shared/jobs-view.ts +60 -60
  172. package/src/skill.ts +1 -1
  173. package/src/task-transfer.ts +58 -56
  174. package/src/templates.ts +1 -1
  175. package/src/types.ts +45 -10
  176. package/src/workspaces.ts +16 -16
  177. package/dist/core/self-analysis.test.d.ts +0 -2
  178. package/dist/core/self-analysis.test.d.ts.map +0 -1
  179. package/dist/core/self-analysis.test.js +0 -219
  180. package/dist/gui-experimental.cjs +0 -1
package/docs/MIGRATION.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Migration guide
2
2
 
3
- How to move existing automation into `opencode-windows-scheduler` from cron, systemd
3
+ How to move existing automation into `agent-steward` (plugin id
4
+ `opencode-windows-scheduler`) from cron, systemd
4
5
  timers, launchd, Windows Task Scheduler, or another scheduler plugin.
5
6
 
6
7
  - [Before you start](#before-you-start)
@@ -19,10 +20,11 @@ timers, launchd, Windows Task Scheduler, or another scheduler plugin.
19
20
  1. **Install and build.**
20
21
 
21
22
  ```bash
22
- npm install -g opencode-windows-scheduler
23
+ npm install -g agent-steward
23
24
  ```
24
25
 
25
- Add the plugin to `opencode.json` and restart OpenCode. If OpenCode's built-in
26
+ Add the plugin to `opencode.json` and reload OpenCode (V2 reloads config
27
+ automatically; on V1 restart it). If OpenCode's built-in
26
28
  schedules are enabled, disable them so two schedulers do not run the same work.
27
29
 
28
30
  2. **Check Node.** `node --version` must be 20 or newer (22.5+ for the built-in SQLite
@@ -243,7 +245,7 @@ For every migrated job:
243
245
  ## From `opencode-windows-scheduler` to `agent-steward` (package rename)
244
246
 
245
247
  The npm package `opencode-windows-scheduler` was renamed to `agent-steward` at milestone
246
- **2.0.0**. This section covers the rename migration only — task definitions, schedules,
248
+ **Д7** (release `agent-steward@0.0.2`). This section covers the rename migration only — task definitions, schedules,
247
249
  history and settings are **unchanged**.
248
250
 
249
251
  ### What changes
@@ -252,25 +254,28 @@ history and settings are **unchanged**.
252
254
  |------|--------------------------------------|-------------------------|
253
255
  | npm package name | `opencode-windows-scheduler` | `agent-steward` |
254
256
  | GitHub repository | `DeadSno/opencode-windows-scheduler` | `DeadSno/agent-steward` |
255
- | Install command | `opencode plugin add opencode-windows-scheduler` | `opencode plugin add opencode-windows-scheduler` |
256
- | V1 config key | `"plugin": ["opencode-windows-scheduler"]` | same (unchanged) |
257
- | V2 config key | `"plugins": ["opencode-windows-scheduler"]` | same (unchanged) |
257
+ | Install command | `opencode plugin add opencode-windows-scheduler` | `opencode plugin add agent-steward` |
258
+ | V1 config key | `"plugin": ["opencode-windows-scheduler"]` | `"plugin": ["agent-steward"]` |
259
+ | V2 config key | `"plugins": ["opencode-windows-scheduler"]` | `"plugins": ["agent-steward"]` |
258
260
  | `plugin id` | `opencode-windows-scheduler` | same (unchanged) |
259
- | State paths | `%APPDATA%\opencode\windows-scheduler` / `~/.config/opencode/windows-scheduler` | same (unchanged) |
261
+ | State paths | `%APPDATA%\opencode\windows-scheduler` / `~/.config/opencode/windows-scheduler` | `%APPDATA%\opencode\agent-steward` / `~/.config/opencode/agent-steward` (migrated automatically) |
262
+ | Windows task folder | `\OpenCode\windows-scheduler\` | `\OpenCode\agent-steward\` (legacy folder still recognized) |
260
263
 
261
- **Only the npm package name and GitHub repository changed.** Your tasks, schedules,
262
- SQLite history, profiles, secrets and dashboard settings continue to work without
263
- modification.
264
+ **The npm package name, config entries and user-facing data/task paths changed.**
265
+ The plugin id, SQLite filename and log file names stay the same. On first start the
266
+ legacy state directory is copied to the new location and absolute paths in settings
267
+ are rewritten; existing tasks and history are preserved.
264
268
 
265
269
  ### Migration steps
266
270
 
267
- 1. **Update the OpenCode config** (`opencode.jsonc`):
271
+ 1. **Update the OpenCode config** (`opencode.jsonc`) — the value is the npm package
272
+ name, so it changes to `agent-steward`:
268
273
 
269
274
  V1:
270
275
  ```jsonc
271
276
  {
272
277
  "$schema": "https://opencode.ai/config.json",
273
- "plugin": ["opencode-windows-scheduler"]
278
+ "plugin": ["agent-steward"]
274
279
  }
275
280
  ```
276
281
 
@@ -278,23 +283,22 @@ modification.
278
283
  ```jsonc
279
284
  {
280
285
  "$schema": "https://opencode.ai/config.json",
281
- "plugins": ["opencode-windows-scheduler"]
286
+ "plugins": ["agent-steward"]
282
287
  }
283
288
  ```
284
289
 
285
- The plugin key stays `opencode-windows-scheduler` — only the npm package name
286
- changed. Restart OpenCode after saving.
290
+ The `plugin id` reported by the plugin remains `opencode-windows-scheduler`.
291
+ OpenCode V2 reloads the config automatically (use `/reload` if needed); on V1
292
+ restart OpenCode after saving.
287
293
 
288
- 2. **Install from the new package** — OpenCode resolves the plugin by `plugin id`, not
289
- by npm package name, so existing installations keep working. New installs use
290
- `agent-steward`:
294
+ 2. **Install from the new package**:
291
295
 
292
296
  ```bash
293
- opencode plugin add opencode-windows-scheduler
297
+ opencode plugin add agent-steward
294
298
  ```
295
299
 
296
- OpenCode will install the `agent-steward` package under the hood (the `plugin id`
297
- `opencode-windows-scheduler` maps to the new package).
300
+ Existing installations that still list `opencode-windows-scheduler` keep working
301
+ until the thin re-export wrapper is deprecated.
298
302
 
299
303
  3. **Old package (`opencode-windows-scheduler`)** — remains published as a thin
300
304
  re-export wrapper around `agent-steward` for one major version. It receives only
@@ -303,13 +307,17 @@ modification.
303
307
  with the new package).
304
308
 
305
309
  4. **Verify** — run `dry_run` on any existing task and confirm it executes. Check
306
- `get_history` for the latest runs. Nothing should change in behaviour.
310
+ `get_history` for the latest runs. Task behaviour should not change; after the first
311
+ start your data appears in the new state directory.
307
312
 
308
313
  ### Rollback
309
314
 
310
- No rollback is needed — the `plugin id` and all state paths are identical before and
311
- after the rename. If you prefer the old npm package name, keep using
312
- `opencode-windows-scheduler` (the thin re-export) until it is deprecated.
315
+ The `plugin id`, SQLite filename and log names are identical before and after the
316
+ rename, so the plugin itself needs no rollback. If you prefer the old npm package name,
317
+ switch the config entry back to `opencode-windows-scheduler` while the thin re-export is
318
+ still published. Note that `agent-steward` is the authoritative state directory after
319
+ migration: copy it back to the legacy path if the old package must read the migrated
320
+ data.
313
321
 
314
322
 
315
323
  ## Local AI / triage migration
package/docs/README.ru.md CHANGED
@@ -63,13 +63,13 @@ Translations: [English](../README.md) · [中文](README.zh.md).
63
63
 
64
64
  | Линия OpenCode | Ключ в `opencode.jsonc` |
65
65
  |---|---|
66
- | V1 (`1.18.29`–`1.19.x`) | `"plugin": ["opencode-windows-scheduler"]` |
67
- | V2 (`≥ 2.2.7`) | `"plugins": ["opencode-windows-scheduler"]` |
66
+ | V1 (`1.18.29`–`1.19.x`) | `"plugin": ["agent-steward"]` |
67
+ | V2 (`≥ 2.2.7`) | `"plugins": ["agent-steward"]` |
68
68
 
69
69
  Используйте ключ своей линии; добавлять оба не нужно. В V2 проще через CLI:
70
70
 
71
71
  ```bash
72
- opencode plugin add opencode-windows-scheduler
72
+ opencode plugin add agent-steward
73
73
  ```
74
74
 
75
75
  V1 — вручную:
@@ -77,7 +77,7 @@ V1 — вручную:
77
77
  ```jsonc
78
78
  {
79
79
  "$schema": "https://opencode.ai/config.json",
80
- "plugin": ["opencode-windows-scheduler"]
80
+ "plugin": ["agent-steward"]
81
81
  }
82
82
  ```
83
83
 
@@ -86,14 +86,14 @@ V2 — тот же плагин вручную:
86
86
  ```jsonc
87
87
  {
88
88
  "$schema": "https://opencode.ai/config.json",
89
- "plugins": ["opencode-windows-scheduler"],
89
+ "plugins": ["agent-steward"],
90
90
  "experimental": {
91
91
  "schedules": false
92
92
  }
93
93
  }
94
94
  ```
95
95
 
96
- `experimental.schedules: false` отключает встроенный планировщик OpenCode, чтобы агент не путал встроенные инструменты расписаний с инструментами этого плагина. После изменения конфигурации перезапустите OpenCode. Панель TUI входит в тот же пакет (`exports["./tui"]`), поэтому включается той же записью на обеих линиях.
96
+ `experimental.schedules: false` отключает встроенный планировщик OpenCode, чтобы агент не путал встроенные инструменты расписаний с инструментами этого плагина. В OpenCode 2.x конфигурация перезагружается автоматически; если изменения не подхватились, выполните `/reload`. В 1.x перезапустите OpenCode после правки конфигурации. Панель TUI входит в тот же пакет (`exports["./tui"]`), поэтому включается той же записью на обеих линиях.
97
97
 
98
98
  Из исходников:
99
99
 
@@ -124,6 +124,7 @@ npm run build && npm run build:gui
124
124
  | `matrix_control` | `action`, `name?` | Результаты матрицы, отмена клонов, очистка осиротевших задач, предпросмотр |
125
125
  | `get_metrics` | — | Всего запусков, успехов и падений |
126
126
  | `get_analytics` | `days?`, `topLimit?` | Отчёт за период: запуски, успешность, длительность, токены, стоимость, топ задач |
127
+ | `self_analysis` | `days?`, `topLimit?`, `includeAnomalies?` | Самодиагностика за период: оценка здоровья, аномалии, тренды и рекомендации по оптимизации |
127
128
  | `manage_settings` | `action`, `maxConcurrent?`, `winterMode?`, `notifications?`, `history?` | Чтение и изменение глобальных настроек (параллелизм, уведомления, retention) |
128
129
  | `manage_local_ai` | `action` (`get`/`update`/`test`), `mode?`, `baseUrl?`, `model?`, `timeoutMs?`, `fallback?`, `confidenceThreshold?`, `shadow?` | Настройки локального ассистента для триажа уведомлений и проверка модели одним запросом (см. [LOCAL-AI.md](LOCAL-AI.md)) |
129
130
  | `manage_templates` | `action`, поля шаблона | Список, сохранение и удаление шаблонов задач |
@@ -132,10 +133,28 @@ npm run build && npm run build:gui
132
133
  | `send_notification` | `action` (`test`/`digest`), `channel?` (`all`/`webhook`/`telegram`/`native`) | Проверка каналов уведомлений или отправка дайджеста |
133
134
  | `get_dashboard_info` | — | Порт/URL дашборда, платформа, заголовок, активный профиль |
134
135
  | `cleanup_history` | `retentionDays?`, `maxRecords?` | Удаление старой истории по возрасту и/или лимиту записей |
136
+ | `manage_secrets` | `action`, `name?`, `value?` | Создание, список и удаление секретов AES-256-GCM для `env` задач |
137
+ | `get_audit_log` | `action?`, `target?`, `actor?`, `since?`, `until?`, `limit?` | Журнал мутаций: кто, что и когда изменил и через какой интерфейс |
135
138
  | `emit_event` | `eventName`, `payload?` | Запуск задач, подписанных на MCP-событие |
136
139
 
137
140
  `schedule_task` принимает и полную конфигурацию матрицы (`workspaceIds`, `strategy`, `failureMode`, `aggregation`, `concurrency`, `overrides`, `createAggregator`).
138
141
 
142
+ ## Права и разрешения
143
+
144
+ Задачи агента запускаются через `opencode run --auto`, поэтому их политика инструментов должна быть задана явно. Глобальная настройка `permissions.defaultPolicy` (GUI → Settings или `manage_settings`) задаёт базу:
145
+
146
+ | Политика | Разрешено по умолчанию | Запрещено по умолчанию |
147
+ |---|---|---|
148
+ | `hybrid` (по умолчанию) | read, edit, glob, grep, subagent, skill, webfetch, websearch | shell, question |
149
+ | `secure` | read, glob, grep, skill | edit, shell, question, webfetch, websearch, subagent |
150
+ | `legacy` | все десять действий | — |
151
+
152
+ `deniedTools` всегда важнее. Непустой `allowedTools` превращается в allowlist: всё, что не перечислено, запрещено, а разрешённое политикой действие можно явно вернуть (например, `shell`). `legacyShell: true` возвращает `shell` только при `hybrid` — для задач, перенесённых со старых версий.
153
+
154
+ Заблокированные действия пишутся в аудит как `tool.blocked` с `reason: "default-policy"` и `hint`, а каждый запуск записывает действующую политику.
155
+
156
+ Рекомендуемый приём: держите `git commit`/`push`, сборки и тесты вне агента — в `qualityGate` или `afterScript` (обёртка запускает их через `bash -c`), а агенту оставьте `read`/`edit`. Тогда большинству задач `shell` вообще не нужен.
157
+
139
158
  ## Скилл для агента
140
159
 
141
160
  Плагин сам регистрирует встроенный скилл `scheduled-job-best-practices`: агент подгружает инструкцию только когда она действительно нужна — проектирование cron, самодостаточные промпты, Quality Gates, лимиты матрицы, правила DAG и разбор падений. Ручная настройка `.opencode/skills` не требуется. Вместе со скиллом поставляется `references/recipes.md` — семь готовых конфигураций.
@@ -205,7 +224,7 @@ src/
205
224
  npm install
206
225
  npm run build # tsc
207
226
  npm run build:gui # vite
208
- npm test # 58 сюит, 600+ проверок
227
+ npm test # 73 сюит, 600+ проверок
209
228
  npm run test:en # те же сюиты с английской локалью
210
229
  ```
211
230
 
package/docs/README.zh.md CHANGED
@@ -72,13 +72,13 @@ Translations: [English](../README.md) · [Русский](README.ru.md).
72
72
 
73
73
  | OpenCode 版本线 | `opencode.jsonc` 中的键 |
74
74
  |---|---|
75
- | V1(`1.18.29`–`1.19.x`) | `"plugin": ["opencode-windows-scheduler"]` |
76
- | V2(`≥ 2.2.7`) | `"plugins": ["opencode-windows-scheduler"]` |
75
+ | V1(`1.18.29`–`1.19.x`) | `"plugin": ["agent-steward"]` |
76
+ | V2(`≥ 2.2.7`) | `"plugins": ["agent-steward"]` |
77
77
 
78
78
  请使用对应版本线的键,无需同时添加两者。V2 可直接用 CLI:
79
79
 
80
80
  ```bash
81
- opencode plugin add opencode-windows-scheduler
81
+ opencode plugin add agent-steward
82
82
  ```
83
83
 
84
84
  V1 手动配置:
@@ -86,7 +86,7 @@ V1 手动配置:
86
86
  ```jsonc
87
87
  {
88
88
  "$schema": "https://opencode.ai/config.json",
89
- "plugin": ["opencode-windows-scheduler"]
89
+ "plugin": ["agent-steward"]
90
90
  }
91
91
  ```
92
92
 
@@ -95,14 +95,14 @@ V2 手动配置:
95
95
  ```jsonc
96
96
  {
97
97
  "$schema": "https://opencode.ai/config.json",
98
- "plugins": ["opencode-windows-scheduler"],
98
+ "plugins": ["agent-steward"],
99
99
  "experimental": {
100
100
  "schedules": false
101
101
  }
102
102
  }
103
103
  ```
104
104
 
105
- `experimental.schedules: false` 会关闭 OpenCode 内置调度器,避免 agent 把内置任务工具与本插件的工具混淆。修改配置后请重启 OpenCode。TUI 面板随同一个包提供(`exports["./tui"]`),两条版本线都用同一条配置启用。
105
+ `experimental.schedules: false` 会关闭 OpenCode 内置调度器,避免 agent 把内置任务工具与本插件的工具混淆。OpenCode 2.x 会自动重新加载配置;如未生效,请执行 `/reload`。1.x 修改配置后请重启 OpenCode。TUI 面板随同一个包提供(`exports["./tui"]`),两条版本线都用同一条配置启用。
106
106
 
107
107
  从源码安装:
108
108
 
@@ -115,7 +115,7 @@ npm run build && npm run build:gui
115
115
 
116
116
  ## Agent 工具
117
117
 
118
- agent 可获得完整功能 —— 25 个工具,覆盖调度、流水线、运维、可观测性与管理:
118
+ agent 可获得完整功能 —— 26 个工具,覆盖调度、流水线、运维、可观测性与管理:
119
119
 
120
120
  | 工具 | 参数 | 作用 |
121
121
  |---|---|---|
@@ -133,6 +133,7 @@ agent 可获得完整功能 —— 25 个工具,覆盖调度、流水线、运
133
133
  | `matrix_control` | `action`、`name?` | 矩阵结果、取消待运行克隆、清理孤儿、预览克隆 |
134
134
  | `get_metrics` | — | 汇总的运行数、成功数与失败数 |
135
135
  | `get_analytics` | `days?`、`topLimit?` | 周期报告:数量、成功率、耗时、token、成本、热门任务 |
136
+ | `self_analysis` | `days?`、`topLimit?`、`includeAnomalies?` | 周期自检报告:健康评分、异常检测、趋势分析与优化建议 |
136
137
  | `manage_settings` | `action`、`maxConcurrent?`、`winterMode?`、`notifications?`、`history?` | 读取/更新全局设置(并发、通知、保留策略) |
137
138
  | `manage_local_ai` | `action`(`get`/`update`/`test`)、`mode?`、`baseUrl?`、`model?`、`timeoutMs?`、`fallback?`、`confidenceThreshold?`、`shadow?` | 读取、更新或测试本地分诊助手;`test` 会发送一条合成通知并返回延迟与判定结果 |
138
139
  | `manage_templates` | `action`、模板字段 | 列出、保存或删除可复用的任务模板 |
@@ -230,7 +231,7 @@ src/
230
231
  npm install
231
232
  npm run build # tsc
232
233
  npm run build:gui # vite
233
- npm test # 58 test suites, 600+ checks
234
+ npm test # 73 test suites, 600+ checks
234
235
  npm run test:en # same suites with the English locale
235
236
  ```
236
237
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Статус: план утверждён по структуре, выполнение — по одной подзадаче.
4
4
  Версия работ: `opencode-windows-scheduler@1.5.6`.
5
- Переименование: milestone `2.0.0`, пакет `agent-steward` начинается с `0.0.2`
5
+ Переименование: milestone Д7, пакет `agent-steward` начинается с `0.0.2`
6
6
  (версия `0.0.1` занята placeholder-резервом).
7
7
 
8
8
  ## Принятые решения
@@ -65,13 +65,13 @@
65
65
  (pinned, только типы), `peerDependencies` отсутствуют.
66
66
 
67
67
  ### Задача З1.2. Зафиксировать границы поверхности
68
- - П1.2.1 — таблица «V1 / V2» в `docs/CROSS_PLATFORM.md` или отдельном документе. ✅
68
+ - П1.2.1 — таблица «V1 / V2» в `CROSS_PLATFORM.md` или отдельном документе. ✅
69
69
  - П1.2.2 — явно указать: GUI и RPC — только V2; TUI — обе версии. ✅
70
70
  - П1.2.3 — README: требование «OpenCode v2» заменить на «V1 >=1.18.29 или V2». ✅
71
71
 
72
72
  ### Задача З1.3. Инварианты состояния
73
73
  - П1.3.1 — `plugin id` остаётся `opencode-windows-scheduler` до rename. ✅
74
- - П1.3.2 — пути `%APPDATA%/opencode/windows-scheduler`, SQLite и логов не меняются. ✅
74
+ - П1.3.2 — пути `%APPDATA%\opencode\agent-steward`, SQLite и логов не меняются. ✅
75
75
  - П1.3.3 — префикс задач планировщика не меняется. ✅
76
76
 
77
77
  ---
@@ -222,7 +222,7 @@
222
222
 
223
223
  ---
224
224
 
225
- ## Деталь Д7. Rename 2.0.0 → `agent-steward` 0.0.2
225
+ ## Деталь Д7. Rename → `agent-steward` 0.0.2
226
226
 
227
227
  - П7.1 — rename-only релиз без фич.
228
228
  - П7.2 — сменить `name` пакета, сохранить `plugin id` и пути состояния.
@@ -292,8 +292,8 @@
292
292
  | П1.2.2 | В матрице GUI и RPC помечены «**нет**» для V1 (subpath `/gui` и `/rpc` в V1-пакете отсутствуют), TUI — «**обе линии**»: V2 регистрирует панель через `setup(ctx)`, V1 — через отдельный `src/tui-v1.tsx` (З3.4). Под таблицей добавлен явный абзац «GUI и RPC — только V2»; пакет не обещает их в V1 и не подменяет TUI заглушкой. |
293
293
  | П1.2.3 | README (en/ru/zh) обновлены: tagline и раздел Install больше не требуют «OpenCode v2», теперь «V1 ≥ 1.18.29 или V2» + ссылка на `docs/COMPATIBILITY.md` (GUI/RPC — только V2, TUI — обе линии). Переводы `docs/README.ru.md` и `docs/README.zh.md` поправлены в том же коммите. |
294
294
  | П1.3.1 | `plugin id` остаётся `opencode-windows-scheduler` (`src/index.ts`, `Plugin.define({ id })`). Зафиксировано в разделе «Инварианты состояния»; `test-docs` сверяет значение в коде и документе. |
295
- | П1.3.2 | Пути состояния сведены в таблицу: Windows `%APPDATA%\opencode\windows-scheduler`, macOS/Linux `$XDG_CONFIG_HOME/opencode/windows-scheduler` или `~/.config/opencode/windows-scheduler`; профили — `<base>/profiles/<name>`; SQLite — `<PLUGIN_DIR>/scheduler.db` (`OPENCODE_SCHEDULER_DB` только для тестов); логи/обёртки/locks/prompts/env и `secrets.json`/`secrets.key` — под `<PLUGIN_DIR>`. `test-docs` сверяет `profiles.ts`, `db/index.ts`, `types.ts`. |
296
- | П1.3.3 | Префикс задач не меняется: Windows default — `\OpenCode\windows-scheduler\`, профиль — `\OpenCode\windows-scheduler-<profile>\` (`windows.ts`); crontab-блок — `opencode-scheduler:<folder>` (legacy без суффикса читается); launchd label — `com.opencode.scheduler.<name>`. В таблице инвариантов указано, что rename 2.0.0 меняет только npm-имя. Итог: `test-docs` 50 → 60/60. |
295
+ | П1.3.2 | Пути состояния сведены в таблицу: Windows `%APPDATA%\opencode\agent-steward`, macOS/Linux `$XDG_CONFIG_HOME/opencode/agent-steward` или `~/.config/opencode/agent-steward`; профили — `<base>/profiles/<name>`; SQLite — `<PLUGIN_DIR>/scheduler.db` (`OPENCODE_SCHEDULER_DB` только для тестов); логи/обёртки/locks/prompts/env и `secrets.json`/`secrets.key` — под `<PLUGIN_DIR>`. `test-docs` сверяет `profiles.ts`, `db/index.ts`, `types.ts`. |
296
+ | П1.3.3 | Префикс задач не меняется: Windows default — `\OpenCode\windows-scheduler\`, профиль — `\OpenCode\windows-scheduler-<profile>\` (`windows.ts`); crontab-блок — `opencode-scheduler:<folder>` (legacy без суффикса читается); launchd label — `com.opencode.scheduler.<name>`. В таблице инвариантов указано, что rename (Д7) меняет только npm-имя. Итог: `test-docs` 50 → 60/60. |
297
297
 
298
298
  ### Д2. Извлечение общего ядра — ✅ 17.11.2026 (П2.1.3, П2.2.3, П2.4.2 закрыты в З3.1)
299
299