agent-steward 0.0.2 → 0.0.4

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 (263) hide show
  1. package/CHANGELOG.md +45 -2
  2. package/CROSS_PLATFORM.md +11 -9
  3. package/README.md +11 -10
  4. package/ROADMAP-STRATEGY.md +93 -44
  5. package/ROADMAP.md +148 -1017
  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/dlq-api.d.ts +44 -0
  10. package/dist/core/dlq-api.d.ts.map +1 -0
  11. package/dist/core/dlq-api.js +68 -0
  12. package/dist/core/dry-run.d.ts.map +1 -1
  13. package/dist/core/dry-run.js +19 -2
  14. package/dist/core/file-watcher.js +9 -9
  15. package/dist/core/git-trigger.js +4 -4
  16. package/dist/core/lock.d.ts +20 -4
  17. package/dist/core/lock.d.ts.map +1 -1
  18. package/dist/core/lock.js +99 -26
  19. package/dist/core/one-shot.d.ts +31 -5
  20. package/dist/core/one-shot.d.ts.map +1 -1
  21. package/dist/core/one-shot.js +78 -10
  22. package/dist/core/opencode-cli.d.ts +28 -0
  23. package/dist/core/opencode-cli.d.ts.map +1 -0
  24. package/dist/core/opencode-cli.js +74 -0
  25. package/dist/core/opencode-models.d.ts +62 -0
  26. package/dist/core/opencode-models.d.ts.map +1 -0
  27. package/dist/core/opencode-models.js +277 -0
  28. package/dist/core/otel.js +2 -2
  29. package/dist/core/ps-wrapper.d.ts +1 -1
  30. package/dist/core/ps-wrapper.d.ts.map +1 -1
  31. package/dist/core/ps-wrapper.js +66 -36
  32. package/dist/core/record-history.d.ts +15 -0
  33. package/dist/core/record-history.d.ts.map +1 -1
  34. package/dist/core/record-history.js +78 -54
  35. package/dist/core/router/dispatch.d.ts +36 -0
  36. package/dist/core/router/dispatch.d.ts.map +1 -0
  37. package/dist/core/router/dispatch.js +59 -0
  38. package/dist/core/router/escalation.d.ts +47 -0
  39. package/dist/core/router/escalation.d.ts.map +1 -0
  40. package/dist/core/router/escalation.js +87 -0
  41. package/dist/core/router/planner.d.ts +53 -0
  42. package/dist/core/router/planner.d.ts.map +1 -0
  43. package/dist/core/router/planner.js +113 -0
  44. package/dist/core/router/rules.d.ts +46 -0
  45. package/dist/core/router/rules.d.ts.map +1 -0
  46. package/dist/core/router/rules.js +85 -0
  47. package/dist/core/run-panel-api.d.ts +94 -0
  48. package/dist/core/run-panel-api.d.ts.map +1 -0
  49. package/dist/core/run-panel-api.js +169 -0
  50. package/dist/core/schedule-gate.js +5 -1
  51. package/dist/core/schedule-v2.d.ts +36 -2
  52. package/dist/core/schedule-v2.d.ts.map +1 -1
  53. package/dist/core/schedule-v2.js +98 -12
  54. package/dist/core/scheduler/at-fallback.d.ts +95 -0
  55. package/dist/core/scheduler/at-fallback.d.ts.map +1 -0
  56. package/dist/core/scheduler/at-fallback.js +200 -0
  57. package/dist/core/scheduler/linux.d.ts +13 -2
  58. package/dist/core/scheduler/linux.d.ts.map +1 -1
  59. package/dist/core/scheduler/linux.js +67 -13
  60. package/dist/core/scheduler/mac.d.ts +14 -8
  61. package/dist/core/scheduler/mac.d.ts.map +1 -1
  62. package/dist/core/scheduler/mac.js +71 -22
  63. package/dist/core/scheduler/posix.d.ts.map +1 -1
  64. package/dist/core/scheduler/posix.js +37 -2
  65. package/dist/core/scheduler/registry.d.ts +13 -0
  66. package/dist/core/scheduler/registry.d.ts.map +1 -1
  67. package/dist/core/scheduler/registry.js +83 -21
  68. package/dist/core/scheduler/run-now.d.ts +16 -0
  69. package/dist/core/scheduler/run-now.d.ts.map +1 -0
  70. package/dist/core/scheduler/run-now.js +28 -0
  71. package/dist/core/scheduler/windows.d.ts +16 -3
  72. package/dist/core/scheduler/windows.d.ts.map +1 -1
  73. package/dist/core/scheduler/windows.js +249 -96
  74. package/dist/core/secrets.d.ts.map +1 -1
  75. package/dist/core/secrets.js +127 -30
  76. package/dist/core/self-analysis.js +55 -55
  77. package/dist/core/session.d.ts.map +1 -1
  78. package/dist/core/session.js +18 -11
  79. package/dist/core/summary.js +1 -1
  80. package/dist/core/task-name.d.ts +24 -0
  81. package/dist/core/task-name.d.ts.map +1 -0
  82. package/dist/core/task-name.js +40 -0
  83. package/dist/core/triage-chain.js +1 -1
  84. package/dist/core/triage-worker.js +2 -2
  85. package/dist/core/triage.js +1 -1
  86. package/dist/core/wrappers/bash.d.ts.map +1 -1
  87. package/dist/core/wrappers/bash.js +82 -37
  88. package/dist/db/capability-repo.d.ts +83 -0
  89. package/dist/db/capability-repo.d.ts.map +1 -0
  90. package/dist/db/capability-repo.js +182 -0
  91. package/dist/db/history-repo.d.ts +8 -0
  92. package/dist/db/history-repo.d.ts.map +1 -1
  93. package/dist/db/history-repo.js +19 -0
  94. package/dist/db/index.d.ts +6 -0
  95. package/dist/db/index.d.ts.map +1 -1
  96. package/dist/db/index.js +48 -2
  97. package/dist/db/migrate.d.ts.map +1 -1
  98. package/dist/db/migrate.js +3 -1
  99. package/dist/db/run-context.d.ts +103 -0
  100. package/dist/db/run-context.d.ts.map +1 -0
  101. package/dist/db/run-context.js +224 -0
  102. package/dist/db/run-dlq.d.ts +100 -0
  103. package/dist/db/run-dlq.d.ts.map +1 -0
  104. package/dist/db/run-dlq.js +191 -0
  105. package/dist/db/run-journal.d.ts +60 -0
  106. package/dist/db/run-journal.d.ts.map +1 -0
  107. package/dist/db/run-journal.js +143 -0
  108. package/dist/db/run-resume.d.ts +51 -0
  109. package/dist/db/run-resume.d.ts.map +1 -0
  110. package/dist/db/run-resume.js +156 -0
  111. package/dist/db/runs-repo.d.ts +128 -0
  112. package/dist/db/runs-repo.d.ts.map +1 -0
  113. package/dist/db/runs-repo.js +342 -0
  114. package/dist/db/schema.d.ts +16 -2
  115. package/dist/db/schema.d.ts.map +1 -1
  116. package/dist/db/schema.js +342 -35
  117. package/dist/db/settings-repo.d.ts +11 -0
  118. package/dist/db/settings-repo.d.ts.map +1 -1
  119. package/dist/db/settings-repo.js +25 -0
  120. package/dist/db/step-idempotency.d.ts +51 -0
  121. package/dist/db/step-idempotency.d.ts.map +1 -0
  122. package/dist/db/step-idempotency.js +136 -0
  123. package/dist/index.d.ts +5 -5
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +168 -40
  126. package/dist/notifications.js +18 -18
  127. package/dist/profiles.d.ts +7 -3
  128. package/dist/profiles.d.ts.map +1 -1
  129. package/dist/profiles.js +85 -7
  130. package/dist/rpc.d.ts +787 -0
  131. package/dist/rpc.d.ts.map +1 -1
  132. package/dist/rpc.js +324 -0
  133. package/dist/server.d.ts +33 -2
  134. package/dist/server.d.ts.map +1 -1
  135. package/dist/server.js +115 -54
  136. package/dist/shared/jobs-view.d.ts.map +1 -1
  137. package/dist/skill.js +1 -1
  138. package/dist/task-transfer.d.ts +1 -1
  139. package/dist/task-transfer.d.ts.map +1 -1
  140. package/dist/task-transfer.js +14 -10
  141. package/dist/types.d.ts +20 -4
  142. package/dist/types.d.ts.map +1 -1
  143. package/dist/types.js +44 -9
  144. package/dist/workspaces.d.ts +25 -3
  145. package/dist/workspaces.d.ts.map +1 -1
  146. package/dist/workspaces.js +44 -9
  147. package/docs/ARCHITECTURE.md +335 -9
  148. package/docs/COMPATIBILITY.md +10 -6
  149. package/docs/CONCEPT.md +183 -91
  150. package/docs/CROSS_PLATFORM.ru.md +11 -9
  151. package/docs/CROSS_PLATFORM.zh.md +11 -9
  152. package/docs/EXECUTION-LOOP.md +196 -0
  153. package/docs/FAQ.md +2 -2
  154. package/docs/FAQ.ru.md +2 -2
  155. package/docs/FAQ.zh.md +2 -2
  156. package/docs/FEATURES.md +5 -4
  157. package/docs/FEATURES.zh.md +5 -4
  158. package/docs/MIGRATION.md +34 -26
  159. package/docs/README.ru.md +27 -8
  160. package/docs/README.zh.md +11 -10
  161. package/docs/SAFETY.md +122 -0
  162. package/docs/SAVINGS.md +29 -0
  163. package/docs/SAVINGS.ru.md +29 -0
  164. package/docs/SAVINGS.zh.md +18 -0
  165. package/docs/V1-V2-COMPATIBILITY-PLAN.md +6 -6
  166. package/gui-experimental.cjs +8 -8
  167. package/index.js +1 -0
  168. package/locales/en.json +68 -0
  169. package/locales/ru.json +68 -0
  170. package/locales/zh.json +68 -0
  171. package/package.json +57 -11
  172. package/scripts/audit-bundle.mjs +215 -0
  173. package/src/core/analytics.ts +2 -2
  174. package/src/core/audit.ts +17 -17
  175. package/src/core/cron-to-schtasks.ts +14 -93
  176. package/src/core/dlq-api.ts +98 -0
  177. package/src/core/dry-run.ts +51 -27
  178. package/src/core/file-watcher.ts +17 -17
  179. package/src/core/git-trigger.ts +9 -9
  180. package/src/core/glob.ts +1 -1
  181. package/src/core/local-ai.ts +2 -2
  182. package/src/core/lock.ts +104 -31
  183. package/src/core/matrix.ts +31 -31
  184. package/src/core/native-notify.ts +2 -2
  185. package/src/core/one-shot.ts +91 -13
  186. package/src/core/opencode-cli.ts +103 -0
  187. package/src/core/opencode-models.ts +315 -0
  188. package/src/core/otel.ts +4 -4
  189. package/src/core/permissions.ts +5 -5
  190. package/src/core/prometheus.ts +17 -17
  191. package/src/core/ps-wrapper.ts +68 -38
  192. package/src/core/record-history.ts +114 -76
  193. package/src/core/retention.ts +3 -3
  194. package/src/core/router/dispatch.ts +94 -0
  195. package/src/core/router/escalation.ts +129 -0
  196. package/src/core/router/planner.ts +166 -0
  197. package/src/core/router/rules.ts +109 -0
  198. package/src/core/run-panel-api.ts +262 -0
  199. package/src/core/savings.ts +1 -1
  200. package/src/core/schedule-gate.ts +17 -13
  201. package/src/core/schedule-v2.ts +138 -29
  202. package/src/core/scheduler/at-fallback.ts +298 -0
  203. package/src/core/scheduler/index.ts +3 -3
  204. package/src/core/scheduler/linux.ts +92 -19
  205. package/src/core/scheduler/logs.ts +1 -1
  206. package/src/core/scheduler/mac.ts +112 -60
  207. package/src/core/scheduler/posix.ts +35 -2
  208. package/src/core/scheduler/registry.ts +109 -26
  209. package/src/core/scheduler/run-now.ts +32 -0
  210. package/src/core/scheduler/windows.ts +295 -125
  211. package/src/core/secrets.ts +139 -39
  212. package/src/core/self-analysis.ts +61 -61
  213. package/src/core/session.ts +26 -13
  214. package/src/core/structured-log.ts +3 -3
  215. package/src/core/summary.ts +25 -25
  216. package/src/core/task-name.ts +67 -0
  217. package/src/core/telegram.ts +16 -16
  218. package/src/core/triage-chain.ts +4 -4
  219. package/src/core/triage-compare.ts +8 -8
  220. package/src/core/triage-rules.ts +4 -4
  221. package/src/core/triage-shadow.ts +7 -7
  222. package/src/core/triage-worker.ts +6 -6
  223. package/src/core/triage.ts +23 -23
  224. package/src/core/watch-paths.ts +1 -1
  225. package/src/core/wrappers/bash.ts +90 -45
  226. package/src/db/capability-repo.ts +285 -0
  227. package/src/db/git-state-repo.ts +1 -1
  228. package/src/db/history-repo.ts +44 -22
  229. package/src/db/index.ts +53 -7
  230. package/src/db/metrics-repo.ts +10 -10
  231. package/src/db/migrate.ts +13 -11
  232. package/src/db/recovery.ts +3 -3
  233. package/src/db/run-context.ts +370 -0
  234. package/src/db/run-dlq.ts +310 -0
  235. package/src/db/run-journal.ts +212 -0
  236. package/src/db/run-resume.ts +256 -0
  237. package/src/db/runs-repo.ts +504 -0
  238. package/src/db/schema.ts +357 -44
  239. package/src/db/settings-repo.ts +33 -2
  240. package/src/db/step-idempotency.ts +185 -0
  241. package/src/db/tasks-repo.ts +10 -10
  242. package/src/db/templates-repo.ts +7 -7
  243. package/src/gui.tsx +516 -1
  244. package/src/history.ts +4 -4
  245. package/src/i18n.ts +7 -7
  246. package/src/index.ts +465 -308
  247. package/src/integrations.ts +6 -6
  248. package/src/notifications.ts +76 -76
  249. package/src/profiles.ts +98 -7
  250. package/src/rpc.ts +347 -1
  251. package/src/schtasks.ts +2 -2
  252. package/src/server.ts +155 -78
  253. package/src/settings.ts +44 -44
  254. package/src/shared/jobs-view.ts +60 -60
  255. package/src/skill.ts +1 -1
  256. package/src/task-transfer.ts +58 -56
  257. package/src/templates.ts +1 -1
  258. package/src/types.ts +54 -10
  259. package/src/workspaces.ts +73 -24
  260. package/dist/core/self-analysis.test.d.ts +0 -2
  261. package/dist/core/self-analysis.test.d.ts.map +0 -1
  262. package/dist/core/self-analysis.test.js +0 -219
  263. package/dist/gui-experimental.cjs +0 -1
@@ -0,0 +1,196 @@
1
+ # EXECUTION-LOOP — цикл v2.1 (спринты 38–43)
2
+
3
+ > Спека исполнительного цикла. North star: [CONCEPT.md](./CONCEPT.md) §6, §11.
4
+ > Безопасность: [SAFETY.md](./SAFETY.md). Статус компонентов: [ROADMAP.md](../ROADMAP.md) §1.
5
+
6
+ ## 1. Разрыв, который закрываем
7
+
8
+ Построено модулями (спринт 36), но не течёт в живом пути:
9
+
10
+ - **Два мира исполнения.** Планировщик: `wrapper → opencode run → record-history → history`. Durable DAG: `runs/run_steps → resumeRun`. Запланированная задача не создаёт durable-run.
11
+ - **Роутер не вызывается live.** `routeStep` / `decideCapabilityRoute` отсутствуют в `index.ts` / `record-history.ts`.
12
+ - **Карта не обучается.** `recordCapabilityOutcome` не вызывается из горячего пути.
13
+ - **Эскалация не живая.** `escalateAfterGate` есть, но провал гейта идёт в retry/chain.
14
+ - **Нет ad-hoc входа.** Любой запуск требует регистрации: `schedule_task` + `run_task_now`; `once` — это `at` / `schtasks ONCE` / launchd. Цепочки/DAG/retry обходят расписание костылём force-маркера.
15
+
16
+ Не построено вовсе: ledger + provenance; класс риска и компиляция политики;
17
+ бюджет миссии; целостность гейта, flake-aware, отложенные эффекты; context
18
+ compilation, repo-map, инъекция scaffolding; worktree/sandbox, egress-контроль,
19
+ approvals-очередь.
20
+
21
+ Подтверждение:
22
+
23
+ ```bash
24
+ grep -rn "routeStep\|recordCapabilityOutcome\|escalateAfterGate\|planMission" \
25
+ src/index.ts src/core/record-history.ts src/core/ps-wrapper.ts src/core/wrappers/bash.ts
26
+ grep -rn "createRun\|runs-repo" src/core/record-history.ts
27
+ ```
28
+
29
+ ## 2. Целевой кровоток
30
+
31
+ ```
32
+ вход (ad-hoc / внутренний / registered)
33
+ → intake (gate-спека + safety) → компиляция политики → approval?
34
+ → createRun (durable, trigger_kind) → planner (декомпозиция)
35
+ → для каждого шага:
36
+ routeStep (static → capability, reliability, explore capped)
37
+ → context compilation (окно модели + бюджет токенов)
38
+ → capability issuance (TTL) → исполнение (worktree/sandbox)
39
+ внешние эффекты → effect_intents (не применяются)
40
+ → GATE (hard, независимый, tamper-evident, flake-aware)
41
+ pass → применить intents → ledger → карта → пример
42
+ fail → escalate / retry / rollback → к роутингу
43
+ → артефакт (diff/PR) → отчёт из ledger → обучение
44
+
45
+ сквозные: телеметрия (span/шаг) · живой бюджет · аудит · durable state
46
+ ```
47
+
48
+ ## 2.1 Классы входа (гибрид)
49
+
50
+ | Класс | Вход | Регистрация в ОС | Catch-up | Pause расписания |
51
+ |---|---|---|---|---|
52
+ | **Ad-hoc** | `run_mission` / CLI / GUI / RPC | нет | нет | нет (пауза run'а есть) |
53
+ | **Внутренний** | chain / DAG / retry / escalation | нет | нет | нет |
54
+ | **Registered** | cron / once / file / git / mcp-event / webhook | да (cron/once) | да | да |
55
+
56
+ Все три класса проходят **один** runtime. Различаются только источником триггера
57
+ и персистентностью шаблона.
58
+
59
+ Инварианты:
60
+
61
+ 1. Ad-hoc исполняется без единой записи в планировщике ОС.
62
+ 2. Ad-hoc не обходит gate, политику, бюджет, ledger и аудит.
63
+ 3. Внутренние запуски не консультируются с расписанием (force-маркер не нужен структурно).
64
+ 4. Одинаковая спека через ad-hoc и registered даёт одинаковый маршрут и вердикт.
65
+ 5. `trigger_kind` пишется в run и ledger; метрики честно разделяют классы входа.
66
+ 6. Недоступность планировщика ОС не блокирует ad-hoc.
67
+
68
+ Lock/no-overlap для ad-hoc — по run/mission id и по workspace (не по имени задачи);
69
+ изоляция worktree предотвращает конкуренцию двух миссий в одном репо.
70
+
71
+ ## 2.2 Объекты
72
+
73
+ | Объект | Что это | Персистентность |
74
+ |---|---|---|
75
+ | **Миссия** | цель + scope + gate-спека + safety + бюджет | опциональный шаблон; snapshot всегда в run |
76
+ | **Задача** | миссия-шаблон + регистрация триггера | только для registered |
77
+ | **Запуск** | durable-исполнение: шаги, попытки, вердикты | всегда |
78
+
79
+ ## 3. Ledger (append-only, источник правды)
80
+
81
+ ```sql
82
+ CREATE TABLE gate_outcomes (
83
+ id INTEGER PRIMARY KEY,
84
+ mission_id TEXT, run_id TEXT, step_id TEXT, task_type TEXT,
85
+ trigger_kind TEXT, -- adhoc | chain | dag | retry | escalation | cron | once | file | git | mcp | webhook
86
+ executor TEXT, -- local / cloud / model-id
87
+ route_source TEXT, -- static | capability | explore
88
+ route_reason TEXT,
89
+ gate_type TEXT, -- cmd | tests | lint | schema | diff | approval
90
+ verdict TEXT, -- pass | fail | flake | infra_fail
91
+ attempts_to_pass INTEGER, first_pass INTEGER,
92
+ evidence_path TEXT,
93
+ gate_hash TEXT, policy_hash TEXT, prompt_hash TEXT,
94
+ model_version TEXT, tool_versions TEXT,
95
+ effect_intents TEXT, -- JSON: заявленные внешние эффекты
96
+ effects_applied_at TEXT, -- NULL, пока гейт не пройден
97
+ tokens INTEGER, cost_usd REAL,
98
+ counterfactual_cost_usd REAL, verification_cost_usd REAL,
99
+ net_savings_usd REAL,
100
+ time_ms INTEGER, overhead_ms INTEGER,
101
+ escalation_from TEXT, escalation_to TEXT,
102
+ example_ref TEXT, training_record_ref TEXT,
103
+ prev_hash TEXT, -- хеш-цепочка: tamper-evident аудит
104
+ created_at TEXT
105
+ );
106
+ ```
107
+
108
+ - `capability_map` — агрегат по ledger, не отдельная правда.
109
+ - Отчёт (43) и датасет (48) читают **только** ledger.
110
+ - Нет ledger-строки — нет запуска.
111
+ - `prev_hash` даёт **tamper-evident** аудит: подделка заметна. Это **не граница
112
+ безопасности** — у кого есть запись в файл, тот перепишет цепочку. Граница —
113
+ изоляция прав и snapshot гейта.
114
+
115
+ ### Поля capability_map (расширение)
116
+
117
+ `first_pass_rate REAL`, `avg_attempts REAL`, `decay_updated_at TEXT` (EWMA),
118
+ `parent_type TEXT` (иерархия при малых данных).
119
+
120
+ ## 4. Целостность гейта (спринт 39)
121
+
122
+ - Gate-файлы и команда вне write-scope агента; snapshot фиксируется на старте миссии.
123
+ - `gate_hash` и `policy_hash` пишутся в ledger и сверяются перед вердиктом;
124
+ расхождение → `fail` + аудит-инцидент.
125
+ - Gate-executor отделён от агента; артефакт применяется к защищённому дереву.
126
+ - **Гейт всегда hard.** Shadow/canary — только для маршрутов и адаптеров (49).
127
+ - **Тест-атака обязательна:** агент правит тесты → гейт обязан провалить.
128
+
129
+ ## 5. Отложенные внешние эффекты
130
+
131
+ Worktree не защищает от сети/API/БД. Поэтому:
132
+
133
+ 1. До гейта агент **не выполняет** irreversible-действие, а пишет `effect_intents`.
134
+ 2. Гейт проверяет артефакт **и** валидность intents (политика, egress, blast-radius).
135
+ 3. `pass` → применение intents, запись `effects_applied_at`.
136
+ 4. `fail` → discard intents; частично применённые — компенсация (saga, спринт 42).
137
+
138
+ ## 6. Flake-aware вердикт
139
+
140
+ - Повтор гейта на том же артефакте (N=2) при подозрении на флак.
141
+ - verdict `fail` (вина агента) vs `flake` / `infra_fail` (шум/инфра).
142
+ - `flake` и `infra_fail` **не обучают** capability-карту.
143
+ - Quarantine стабильно флакующих гейтов + предупреждение пользователю.
144
+ - `attempts_to_pass` и `first_pass` пишутся всегда.
145
+
146
+ ## 7. Роутинг, бюджет, issuance
147
+
148
+ - `routeStep(taskType)` до сборки контекста; `explore` — с capped бюджетом.
149
+ - Решение учитывает `first_pass_rate`, `avg_attempts`, EWMA-decay; мало данных → `parent_type`.
150
+ - **Живой бюджет** в durable-run: $ / токены / время / эскалации. При подходе к
151
+ границе — даунгрейд модели или `review`; превышение → circuit-breaker.
152
+ - **Capability issuance на шаг**: scoped-конфиг + короткоживущие секреты, очистка
153
+ после шага. База — существующие `permissions` и scoped-инъекция секретов.
154
+
155
+ ## 8. Context compilation (спринт 41)
156
+
157
+ - Выполняется **после роутинга**: окно и бюджет токенов зависят от исполнителя.
158
+ - Пересборка при эскалации (другая модель → другое окно).
159
+ - Repo-map + отбор файлов + gate-passed примеры по типу задачи; дедуп, лимит,
160
+ scrub секретов.
161
+ - Retrieval — bag-of-words векторы (подход `notification_embeddings`), без вектор-БД.
162
+
163
+ ## 9. Приёмка (= CONCEPT §11)
164
+
165
+ 1. Ad-hoc миссия с gate-спекой и safety-контрактом принята, политика скомпилирована,
166
+ планировщик ОС не изменён.
167
+ 2. Шаги смаршрутированы local-first с учётом reliability.
168
+ 3. Гейт объективно верифицировал; провал экалировался/откатился без тихих отказов;
169
+ irreversible не произошёл до pass.
170
+ 4. Ledger показал честную net-экономию и escalation rate.
171
+ 5. Карта обновилась, пример сохранён и переиспользован.
172
+ 6. Паритет: та же спека через registered даёт тот же маршрут и вердикт.
173
+
174
+ Тесты: E2E всего среза + chaos (`kill -9` посреди миссии) + атака на гейт +
175
+ попытка irreversible до pass + недоступность планировщика ОС.
176
+
177
+ ## 10. Архитектурные решения: что отклонено и почему
178
+
179
+ | Предложение | Решение | Причина |
180
+ |---|---|---|
181
+ | Soft-gate / canary для **приёмки** артефакта | ❌ отклонено | Ослабляет keystone: побочные эффекты по «мягкому» вердикту. Canary — только маршруты и адаптеры (49). |
182
+ | AOCL как нормативная модель слоёв | ❌ не опираемся | Стандарт не подтверждён. Интероперабельность — через MCP (уже используется) и стабильные форматы YAML/SQLite. |
183
+ | OPA/Rego или Cedar как движок политик | ⏸ отложено | Внешняя зависимость против «мало deps / одна машина». Достаточно компилятора политики в существующий enforcement. |
184
+ | Hash-linked ledger как «доказуемость» | ✅ переформулировано | **tamper-evident аудит**, не граница безопасности. |
185
+ | Вектор-БД / «динамический RAG» | ❌ отклонено | Durable state уже есть; retrieval — на существующих bag-of-words векторах. |
186
+ | Capability-токены как OAuth/JWT | ⏸ упрощено | Локальная одна машина: scoped-конфиг + TTL-секреты дают тот же эффект без инфраструктуры. |
187
+ | «Сначала зарегистрируй задачу» для одноразовой работы | ❌ отклонено | Гибрид: ad-hoc — полноправный вход; регистрация опциональна. |
188
+
189
+ ## 11. Границы (CONCEPT §8)
190
+
191
+ - Миссии ограниченные, с явным критерием; не open-ended swarm.
192
+ - Облако — эскалация, не замена способной модели.
193
+ - Локальный control plane, одна машина; базовый путь работает без Docker и без
194
+ локальной модели.
195
+ - Планировщик ОС опционален; его недоступность не блокирует ядро.
196
+ - Критичное — человеку: гейт поднимает пол, не потолок.
package/docs/FAQ.md CHANGED
@@ -20,8 +20,8 @@ destroy data.
20
20
 
21
21
  Recovery steps:
22
22
 
23
- 1. Find the file in the plugin directory: `%APPDATA%\opencode\windows-scheduler\`
24
- (Windows) or `~/.config/opencode/windows-scheduler/` (macOS/Linux, or
23
+ 1. Find the file in the plugin directory: `%APPDATA%\opencode\agent-steward\`
24
+ (Windows) or `~/.config/opencode/agent-steward/` (macOS/Linux, or
25
25
  `$XDG_CONFIG_HOME`).
26
26
  2. Open it in an editor: it is usually truncated JSON. Fix the syntax.
27
27
  3. Copy the fixed file back as `secrets.json` (keep the `.corrupt-*` copy as a
package/docs/FAQ.ru.md CHANGED
@@ -20,8 +20,8 @@ Translations: [English](FAQ.md) · [中文](FAQ.zh.md)
20
20
 
21
21
  Порядок восстановления:
22
22
 
23
- 1. Найдите файл в каталоге плагина: `%APPDATA%\opencode\windows-scheduler\`
24
- (Windows) или `~/.config/opencode/windows-scheduler/` (macOS/Linux,
23
+ 1. Найдите файл в каталоге плагина: `%APPDATA%\opencode\agent-steward\`
24
+ (Windows) или `~/.config/opencode/agent-steward/` (macOS/Linux,
25
25
  либо `$XDG_CONFIG_HOME`).
26
26
  2. Откройте его в редакторе: обычно это обрезанный JSON. Исправьте синтаксис.
27
27
  3. Верните исправленный файл под именем `secrets.json` (копию `.corrupt-*`
package/docs/FAQ.zh.md CHANGED
@@ -17,8 +17,8 @@ Translations: [English](FAQ.md) · [Русский](FAQ.ru.md)
17
17
 
18
18
  恢复步骤:
19
19
 
20
- 1. 在插件目录中找到该文件:`%APPDATA%\opencode\windows-scheduler\`(Windows)
21
- 或 `~/.config/opencode/windows-scheduler/`(macOS/Linux,或 `$XDG_CONFIG_HOME`)。
20
+ 1. 在插件目录中找到该文件:`%APPDATA%\opencode\agent-steward\`(Windows)
21
+ 或 `~/.config/opencode/agent-steward/`(macOS/Linux,或 `$XDG_CONFIG_HOME`)。
22
22
  2. 用编辑器打开:通常是截断的 JSON,修正语法。
23
23
  3. 把修好的文件复制回 `secrets.json`(保留 `.corrupt-*` 副本作为备份),
24
24
  用 `manage_secrets`(`action: "list"`)验证。
package/docs/FEATURES.md CHANGED
@@ -567,8 +567,8 @@ side effect of a read operation — recovery is **manual by design** so that no
567
567
  automatic rewrite can destroy data:
568
568
 
569
569
  1. Find the quarantined file in the plugin directory: `secrets.json.corrupt-*`
570
- (Windows: `%APPDATA%\opencode\windows-scheduler\`, macOS/Linux:
571
- `~/.config/opencode/windows-scheduler/` or `$XDG_CONFIG_HOME`).
570
+ (Windows: `%APPDATA%\opencode\agent-steward\`, macOS/Linux:
571
+ `~/.config/opencode/agent-steward/` or `$XDG_CONFIG_HOME`).
572
572
  2. Inspect it: the corruption is usually truncated JSON (interrupted write) or
573
573
  manual editing. Fix the JSON syntax in a text editor.
574
574
  3. Copy the fixed file back to `secrets.json` (keep the `.corrupt-*` copy as a
@@ -610,10 +610,11 @@ the `cleanup_history` RPC and the GUI's **Clear now** button. Aggregates in
610
610
 
611
611
  ## Agent interface
612
612
 
613
- Twenty-five tools: `schedule_task`, `list_tasks`, `update_task`, `delete_task`,
613
+ Twenty-six tools: `schedule_task`, `list_tasks`, `update_task`, `delete_task`,
614
614
  `run_task_now`, `pause_task`, `resume_task`, `get_history`, `get_task_logs`, `dry_run`,
615
615
  `manage_workspaces`, `matrix_control` (results/cancel/cleanup/preview), `get_metrics`,
616
- `get_analytics`, `manage_settings`, `manage_local_ai`, `manage_templates`, `manage_profiles`,
616
+ `get_analytics`, `self_analysis` (health score, anomalies, trends), `manage_settings`,
617
+ `manage_local_ai`, `manage_templates`, `manage_profiles`,
617
618
  `transfer_tasks`, `send_notification`, `get_dashboard_info`, `cleanup_history`,
618
619
  `manage_secrets`, `get_audit_log`,
619
620
  `emit_event`.
@@ -524,8 +524,8 @@ GUI 面板)支持 `list`、`set` 和 `delete`。密钥名匹配
524
524
  自动重写能够破坏数据:
525
525
 
526
526
  1. 在插件目录中找到被隔离的文件:`secrets.json.corrupt-*`
527
- (Windows:`%APPDATA%\opencode\windows-scheduler\`,macOS/Linux:
528
- `~/.config/opencode/windows-scheduler/` 或 `$XDG_CONFIG_HOME`)。
527
+ (Windows:`%APPDATA%\opencode\agent-steward\`,macOS/Linux:
528
+ `~/.config/opencode/agent-steward/` 或 `$XDG_CONFIG_HOME`)。
529
529
  2. 检查它:损坏通常是被截断的 JSON(写入中断)或
530
530
  手工编辑。在文本编辑器中修正 JSON 语法。
531
531
  3. 把修好的文件复制回 `secrets.json`(保留 `.corrupt-*` 副本作为
@@ -566,10 +566,11 @@ GUI 面板)支持 `list`、`set` 和 `delete`。密钥名匹配
566
566
 
567
567
  ## Agent 接口
568
568
 
569
- 二十五个工具:`schedule_task`、`list_tasks`、`update_task`、`delete_task`、
569
+ 二十六个工具:`schedule_task`、`list_tasks`、`update_task`、`delete_task`、
570
570
  `run_task_now`、`pause_task`、`resume_task`、`get_history`、`get_task_logs`、`dry_run`、
571
571
  `manage_workspaces`、`matrix_control`(results/cancel/cleanup/preview)、`get_metrics`、
572
- `get_analytics`、`manage_settings`、`manage_local_ai`、`manage_templates`、`manage_profiles`、
572
+ `get_analytics`、`self_analysis`(健康评分、异常、趋势)、`manage_settings`、
573
+ `manage_local_ai`、`manage_templates`、`manage_profiles`、
573
574
  `transfer_tasks`、`send_notification`、`get_dashboard_info`、`cleanup_history`、
574
575
  `manage_secrets`、`get_audit_log`、
575
576
  `emit_event`。
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
@@ -18,7 +18,7 @@ Translations: [English](../README.md) · [中文](README.zh.md).
18
18
 
19
19
  > Поставь задачу «утренний-отчёт»: каждый день в 09:00 с промптом «Просуммаризируй вчерашние git-коммиты и запиши отчёт в ~/reports/».
20
20
 
21
- 3. Откройте дашборд: агент печатает ссылку при создании задачи (по умолчанию `http://localhost:4380`), позже её можно получить инструментом `get_dashboard_info`. Посмотреть демо без установки: `node scripts/demo-dashboard.mjs` — дашборд с демо-данными на `http://localhost:4380`.
21
+ 3. Откройте дашборд: агент печатает ссылку при создании задачи (по умолчанию `http://localhost:3782`), позже её можно получить инструментом `get_dashboard_info`. Посмотреть демо без установки: `node scripts/demo-dashboard.mjs` — дашборд с демо-данными на `http://localhost:3782`.
22
22
 
23
23
  ![Локальный веб-дашборд: матричные сборки, граф DAG, метрики и история запусков](dashboard.png)
24
24
 
@@ -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 # 83 сюит, 600+ проверок
209
228
  npm run test:en # те же сюиты с английской локалью
210
229
  ```
211
230
 
package/docs/README.zh.md CHANGED
@@ -19,7 +19,7 @@ Translations: [English](../README.md) · [Русский](README.ru.md).
19
19
 
20
20
  > 创建一个名为 "morning-report" 的任务,每天 09:00 运行,提示词为:"Summarize yesterday's git commits and write the report to ~/reports/"。
21
21
 
22
- 3. 打开仪表盘观察运行情况:创建任务时 agent 会打印 URL(默认 `http://localhost:4380`),之后也可以随时用 `get_dashboard_info` 工具获取。想不安装任何东西先看看效果?`node scripts/demo-dashboard.mjs` 会在 `http://localhost:4380` 启动一个演示仪表盘。
22
+ 3. 打开仪表盘观察运行情况:创建任务时 agent 会打印 URL(默认 `http://localhost:3782`),之后也可以随时用 `get_dashboard_info` 工具获取。想不安装任何东西先看看效果?`node scripts/demo-dashboard.mjs` 会在 `http://localhost:3782` 启动一个演示仪表盘。
23
23
 
24
24
  ## 为什么需要它
25
25
 
@@ -35,7 +35,7 @@ Translations: [English](../README.md) · [Русский](README.ru.md).
35
35
 
36
36
  ![本地 Web 仪表盘:矩阵构建、DAG 图、指标与运行历史](dashboard.png)
37
37
 
38
- 不想安装 OpenCode 也想看看效果?`node scripts/demo-dashboard.mjs` 会用演示数据在 http://localhost:4380 启动仪表盘。
38
+ 不想安装 OpenCode 也想看看效果?`node scripts/demo-dashboard.mjs` 会用演示数据在 http://localhost:3782 启动仪表盘。
39
39
 
40
40
  ## 功能
41
41
 
@@ -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 # 83 test suites, 600+ checks
234
235
  npm run test:en # same suites with the English locale
235
236
  ```
236
237