agent-steward 0.0.4 → 0.0.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 +134 -2
- package/CROSS_PLATFORM.md +19 -0
- package/README.md +52 -7
- package/ROADMAP-STRATEGY.md +21 -18
- package/ROADMAP.md +140 -159
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +351 -0
- package/dist/core/execution.d.ts +203 -0
- package/dist/core/execution.d.ts.map +1 -0
- package/dist/core/execution.js +309 -0
- package/dist/core/gate-integrity.d.ts +35 -0
- package/dist/core/gate-integrity.d.ts.map +1 -0
- package/dist/core/gate-integrity.js +132 -0
- package/dist/core/git-trigger.d.ts.map +1 -1
- package/dist/core/git-trigger.js +14 -2
- package/dist/core/guard-run.d.ts +4 -0
- package/dist/core/guard-run.d.ts.map +1 -0
- package/dist/core/guard-run.js +101 -0
- package/dist/core/guard.d.ts +52 -0
- package/dist/core/guard.d.ts.map +1 -0
- package/dist/core/guard.js +362 -0
- package/dist/core/lock.d.ts +41 -0
- package/dist/core/lock.d.ts.map +1 -1
- package/dist/core/lock.js +141 -29
- package/dist/core/matrix.d.ts.map +1 -1
- package/dist/core/matrix.js +75 -15
- package/dist/core/mission.d.ts +83 -0
- package/dist/core/mission.d.ts.map +1 -0
- package/dist/core/mission.js +334 -0
- package/dist/core/pipeline-apply.d.ts +38 -0
- package/dist/core/pipeline-apply.d.ts.map +1 -0
- package/dist/core/pipeline-apply.js +117 -0
- package/dist/core/pipeline-io.d.ts +13 -0
- package/dist/core/pipeline-io.d.ts.map +1 -0
- package/dist/core/pipeline-io.js +64 -0
- package/dist/core/pipeline-map.d.ts +46 -0
- package/dist/core/pipeline-map.d.ts.map +1 -0
- package/dist/core/pipeline-map.js +196 -0
- package/dist/core/pipeline-spec.d.ts +109 -0
- package/dist/core/pipeline-spec.d.ts.map +1 -0
- package/dist/core/pipeline-spec.js +554 -0
- package/dist/core/ps-wrapper.d.ts +19 -2
- package/dist/core/ps-wrapper.d.ts.map +1 -1
- package/dist/core/ps-wrapper.js +250 -62
- package/dist/core/record-history.d.ts.map +1 -1
- package/dist/core/record-history.js +130 -29
- package/dist/core/router/rules.d.ts.map +1 -1
- package/dist/core/router/rules.js +6 -0
- package/dist/core/scheduler/linux.d.ts +8 -1
- package/dist/core/scheduler/linux.d.ts.map +1 -1
- package/dist/core/scheduler/linux.js +34 -9
- package/dist/core/scheduler/mac.d.ts +44 -2
- package/dist/core/scheduler/mac.d.ts.map +1 -1
- package/dist/core/scheduler/mac.js +126 -15
- package/dist/core/scheduler/windows.d.ts.map +1 -1
- package/dist/core/scheduler/windows.js +15 -12
- package/dist/core/structured-log.d.ts +7 -1
- package/dist/core/structured-log.d.ts.map +1 -1
- package/dist/core/worktree-run.d.ts +4 -0
- package/dist/core/worktree-run.d.ts.map +1 -0
- package/dist/core/worktree-run.js +164 -0
- package/dist/core/worktree.d.ts +115 -0
- package/dist/core/worktree.d.ts.map +1 -0
- package/dist/core/worktree.js +462 -0
- package/dist/core/wrappers/bash.d.ts +17 -0
- package/dist/core/wrappers/bash.d.ts.map +1 -1
- package/dist/core/wrappers/bash.js +175 -24
- package/dist/db/capability-repo.d.ts +43 -2
- package/dist/db/capability-repo.d.ts.map +1 -1
- package/dist/db/capability-repo.js +96 -11
- package/dist/db/history-repo.d.ts +38 -5
- package/dist/db/history-repo.d.ts.map +1 -1
- package/dist/db/history-repo.js +88 -25
- package/dist/db/metrics-repo.js +2 -2
- package/dist/db/recovery.d.ts.map +1 -1
- package/dist/db/recovery.js +5 -4
- package/dist/db/run-journal.d.ts +33 -5
- package/dist/db/run-journal.d.ts.map +1 -1
- package/dist/db/run-journal.js +78 -14
- package/dist/db/run-resume.d.ts +5 -0
- package/dist/db/run-resume.d.ts.map +1 -1
- package/dist/db/run-resume.js +9 -2
- package/dist/db/runs-repo.d.ts +19 -2
- package/dist/db/runs-repo.d.ts.map +1 -1
- package/dist/db/runs-repo.js +22 -6
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +63 -2
- package/dist/history.d.ts +1 -1
- package/dist/history.d.ts.map +1 -1
- package/dist/i18n.d.ts +5 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +11 -4
- package/dist/index.d.ts +136 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +378 -14
- package/dist/notifications.d.ts +22 -0
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +36 -8
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +25 -4
- package/dist/rpc.d.ts +246 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +117 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +77 -18
- package/dist/settings.d.ts +2 -2
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +3 -3
- package/dist/shared/jobs-view.d.ts +1 -1
- package/dist/shared/jobs-view.d.ts.map +1 -1
- package/dist/shared/jobs-view.js +2 -0
- package/dist/task-transfer.d.ts +16 -0
- package/dist/task-transfer.d.ts.map +1 -1
- package/dist/task-transfer.js +16 -0
- package/docs/ARCHITECTURE.md +281 -65
- package/docs/COMPATIBILITY.md +2 -2
- package/docs/CONCEPT.md +18 -4
- package/docs/CROSS_PLATFORM.ru.md +20 -0
- package/docs/CROSS_PLATFORM.zh.md +18 -0
- package/docs/EXECUTION-LOOP.md +22 -7
- package/docs/FEATURES.md +65 -4
- package/docs/FEATURES.zh.md +52 -4
- package/docs/MIGRATION.md +2 -2
- package/docs/PIPELINE.md +293 -0
- package/docs/README.ru.md +42 -3
- package/docs/README.zh.md +43 -3
- package/docs/SAFETY.md +23 -3
- package/gui-experimental.cjs +9 -8
- package/locales/en.json +17 -1
- package/locales/ru.json +17 -1
- package/locales/zh.json +17 -1
- package/opencode.pipeline.yaml +35 -0
- package/package.json +23 -4
- package/scripts/test-home.mjs +83 -0
- package/src/cli.ts +412 -0
- package/src/core/dry-run.ts +2 -2
- package/src/core/execution.ts +538 -0
- package/src/core/file-watcher.ts +2 -2
- package/src/core/gate-integrity.ts +160 -0
- package/src/core/git-trigger.ts +18 -5
- package/src/core/guard-run.ts +119 -0
- package/src/core/guard.ts +431 -0
- package/src/core/lock.ts +178 -37
- package/src/core/matrix.ts +95 -50
- package/src/core/mission.ts +485 -0
- package/src/core/native-notify.ts +1 -1
- package/src/core/pipeline-apply.ts +158 -0
- package/src/core/pipeline-io.ts +79 -0
- package/src/core/pipeline-map.ts +264 -0
- package/src/core/pipeline-spec.ts +775 -0
- package/src/core/ps-wrapper.ts +263 -63
- package/src/core/record-history.ts +164 -77
- package/src/core/router/rules.ts +6 -0
- package/src/core/schedule-gate.ts +1 -1
- package/src/core/scheduler/at-fallback.ts +1 -1
- package/src/core/scheduler/linux.ts +40 -11
- package/src/core/scheduler/logs.ts +2 -2
- package/src/core/scheduler/mac.ts +174 -14
- package/src/core/scheduler/registry.ts +2 -2
- package/src/core/scheduler/windows.ts +19 -15
- package/src/core/secrets.ts +8 -8
- package/src/core/structured-log.ts +22 -5
- package/src/core/telegram.ts +2 -2
- package/src/core/triage-worker.ts +7 -7
- package/src/core/triage.ts +2 -2
- package/src/core/worktree-run.ts +199 -0
- package/src/core/worktree.ts +600 -0
- package/src/core/wrappers/bash.ts +190 -23
- package/src/db/capability-repo.ts +127 -10
- package/src/db/history-repo.ts +129 -22
- package/src/db/metrics-repo.ts +2 -2
- package/src/db/recovery.ts +5 -4
- package/src/db/run-journal.ts +100 -13
- package/src/db/run-resume.ts +17 -1
- package/src/db/runs-repo.ts +36 -6
- package/src/db/schema.ts +65 -2
- package/src/gui.tsx +177 -13
- package/src/history.ts +1 -1
- package/src/i18n.ts +12 -4
- package/src/index.ts +524 -4
- package/src/notifications.ts +38 -8
- package/src/profiles.ts +26 -4
- package/src/rpc.ts +128 -0
- package/src/server.ts +94 -18
- package/src/settings.ts +5 -5
- package/src/shared/jobs-view.ts +3 -1
- package/src/task-transfer.ts +31 -0
package/locales/en.json
CHANGED
|
@@ -189,6 +189,7 @@
|
|
|
189
189
|
"gui.history.error": "❌ Error",
|
|
190
190
|
"gui.history.modelTitle": "Model: {model}",
|
|
191
191
|
"gui.history.nextTaskTitle": "Next task in the chain was started",
|
|
192
|
+
"gui.history.skipped": "⏭ Skipped",
|
|
192
193
|
"gui.history.success": "✅ Success",
|
|
193
194
|
"gui.historyCleanupHint": "Only finished records are deleted; unfinished runs are kept.",
|
|
194
195
|
"gui.historyDeleteOlderLabel": "Delete records older than, days",
|
|
@@ -256,6 +257,7 @@
|
|
|
256
257
|
"gui.jobStatus.partial": "🟠 Partial",
|
|
257
258
|
"gui.jobStatus.paused": "⏸ Paused",
|
|
258
259
|
"gui.jobStatus.running": "🟡 Running: {seconds} s",
|
|
260
|
+
"gui.jobStatus.skipped": "⏭ Skipped",
|
|
259
261
|
"gui.jobStatus.success": "🟢 Done",
|
|
260
262
|
"gui.jobStatus.unknown": "⚪ Unknown",
|
|
261
263
|
"gui.jobsTitle": "Scheduler",
|
|
@@ -844,5 +846,19 @@
|
|
|
844
846
|
"tool.workspace.needDeleteId": "action=delete requires id.",
|
|
845
847
|
"tool.workspace.needPath": "action=add requires path.",
|
|
846
848
|
"tool.workspace.needUpdateId": "action=update requires id.",
|
|
847
|
-
"tool.workspace.notFound": "Workspace not found."
|
|
849
|
+
"tool.workspace.notFound": "Workspace not found.",
|
|
850
|
+
"gui.missionHeading": "Ad-hoc mission",
|
|
851
|
+
"gui.missionHint": "Runs without OS registration through the same runtime, GATE and ledger.",
|
|
852
|
+
"gui.missionCwdPlaceholder": "Working directory (defaults to current)",
|
|
853
|
+
"gui.missionTimeout": "Timeout, sec",
|
|
854
|
+
"gui.missionPolicy": "Permission policy",
|
|
855
|
+
"gui.missionPolicyHybrid": "hybrid",
|
|
856
|
+
"gui.missionPolicySecure": "secure",
|
|
857
|
+
"gui.missionPolicyLegacy": "legacy",
|
|
858
|
+
"gui.missionDryRun": "Plan only (dry-run)",
|
|
859
|
+
"gui.missionRun": "Run mission",
|
|
860
|
+
"gui.missionTitle": "Ad-hoc mission",
|
|
861
|
+
"gui.missionEmptyPrompt": "Enter a mission prompt.",
|
|
862
|
+
"gui.missionStarted": "Mission completed",
|
|
863
|
+
"gui.missionFailed": "Mission failed"
|
|
848
864
|
}
|
package/locales/ru.json
CHANGED
|
@@ -189,6 +189,7 @@
|
|
|
189
189
|
"gui.history.error": "❌ Ошибка",
|
|
190
190
|
"gui.history.modelTitle": "Модель: {model}",
|
|
191
191
|
"gui.history.nextTaskTitle": "Запущена следующая задача в цепочке",
|
|
192
|
+
"gui.history.skipped": "⏭ Пропущено",
|
|
192
193
|
"gui.history.success": "✅ Успех",
|
|
193
194
|
"gui.historyCleanupHint": "Удаляются только завершённые записи; незавершённые запуски не трогаются.",
|
|
194
195
|
"gui.historyDeleteOlderLabel": "Удалять записи старше, дней",
|
|
@@ -256,6 +257,7 @@
|
|
|
256
257
|
"gui.jobStatus.partial": "🟠 Частично",
|
|
257
258
|
"gui.jobStatus.paused": "⏸ Пауза",
|
|
258
259
|
"gui.jobStatus.running": "🟡 Выполняется: {seconds} сек",
|
|
260
|
+
"gui.jobStatus.skipped": "⏭ Пропущено",
|
|
259
261
|
"gui.jobStatus.success": "🟢 Готова",
|
|
260
262
|
"gui.jobStatus.unknown": "⚪ Неизвестно",
|
|
261
263
|
"gui.jobsTitle": "Планировщик",
|
|
@@ -844,5 +846,19 @@
|
|
|
844
846
|
"tool.workspace.needDeleteId": "Для action=delete нужен id.",
|
|
845
847
|
"tool.workspace.needPath": "Для action=add нужен path.",
|
|
846
848
|
"tool.workspace.needUpdateId": "Для action=update нужен id.",
|
|
847
|
-
"tool.workspace.notFound": "Workspace не найден."
|
|
849
|
+
"tool.workspace.notFound": "Workspace не найден.",
|
|
850
|
+
"gui.missionHeading": "Ad-hoc миссия",
|
|
851
|
+
"gui.missionHint": "Запуск без регистрации в ОС: единый runtime, GATE и ledger.",
|
|
852
|
+
"gui.missionCwdPlaceholder": "Рабочая директория (по умолчанию — текущая)",
|
|
853
|
+
"gui.missionTimeout": "Таймаут, сек",
|
|
854
|
+
"gui.missionPolicy": "Политика прав",
|
|
855
|
+
"gui.missionPolicyHybrid": "hybrid",
|
|
856
|
+
"gui.missionPolicySecure": "secure",
|
|
857
|
+
"gui.missionPolicyLegacy": "legacy",
|
|
858
|
+
"gui.missionDryRun": "Только план (dry-run)",
|
|
859
|
+
"gui.missionRun": "Запустить миссию",
|
|
860
|
+
"gui.missionTitle": "Ad-hoc миссия",
|
|
861
|
+
"gui.missionEmptyPrompt": "Введите промпт миссии.",
|
|
862
|
+
"gui.missionStarted": "Миссия выполнена",
|
|
863
|
+
"gui.missionFailed": "Миссия не выполнена"
|
|
848
864
|
}
|
package/locales/zh.json
CHANGED
|
@@ -189,6 +189,7 @@
|
|
|
189
189
|
"gui.history.error": "❌ 失败",
|
|
190
190
|
"gui.history.modelTitle": "模型:{model}",
|
|
191
191
|
"gui.history.nextTaskTitle": "链中的下一个任务已启动",
|
|
192
|
+
"gui.history.skipped": "⏭ 已跳过",
|
|
192
193
|
"gui.history.success": "✅ 成功",
|
|
193
194
|
"gui.historyCleanupHint": "仅删除已完成的记录;未完成的运行会保留。",
|
|
194
195
|
"gui.historyDeleteOlderLabel": "删除早于以下天数的记录",
|
|
@@ -256,6 +257,7 @@
|
|
|
256
257
|
"gui.jobStatus.partial": "🟠 部分",
|
|
257
258
|
"gui.jobStatus.paused": "⏸ 暂停",
|
|
258
259
|
"gui.jobStatus.running": "🟡 正在运行:{seconds} 秒",
|
|
260
|
+
"gui.jobStatus.skipped": "⏭ 已跳过",
|
|
259
261
|
"gui.jobStatus.success": "🟢 完成",
|
|
260
262
|
"gui.jobStatus.unknown": "⚪ 未知",
|
|
261
263
|
"gui.jobsTitle": "调度器",
|
|
@@ -844,5 +846,19 @@
|
|
|
844
846
|
"tool.workspace.needDeleteId": "action=delete 需要 id。",
|
|
845
847
|
"tool.workspace.needPath": "action=add 需要 path。",
|
|
846
848
|
"tool.workspace.needUpdateId": "action=update 需要 id。",
|
|
847
|
-
"tool.workspace.notFound": "未找到工作区。"
|
|
849
|
+
"tool.workspace.notFound": "未找到工作区。",
|
|
850
|
+
"gui.missionHeading": "Ad-hoc 任务",
|
|
851
|
+
"gui.missionHint": "无需在操作系统中注册,使用同一 runtime、GATE 和 ledger。",
|
|
852
|
+
"gui.missionCwdPlaceholder": "工作目录(默认为当前目录)",
|
|
853
|
+
"gui.missionTimeout": "超时,秒",
|
|
854
|
+
"gui.missionPolicy": "权限策略",
|
|
855
|
+
"gui.missionPolicyHybrid": "hybrid",
|
|
856
|
+
"gui.missionPolicySecure": "secure",
|
|
857
|
+
"gui.missionPolicyLegacy": "legacy",
|
|
858
|
+
"gui.missionDryRun": "仅计划(dry-run)",
|
|
859
|
+
"gui.missionRun": "运行任务",
|
|
860
|
+
"gui.missionTitle": "Ad-hoc 任务",
|
|
861
|
+
"gui.missionEmptyPrompt": "请输入任务提示词。",
|
|
862
|
+
"gui.missionStarted": "任务已完成",
|
|
863
|
+
"gui.missionFailed": "任务失败"
|
|
848
864
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
name: nightly-release
|
|
3
|
+
|
|
4
|
+
description: Lint, test and build the repository every night after the last commit.
|
|
5
|
+
|
|
6
|
+
defaults:
|
|
7
|
+
timeoutSeconds: 1800
|
|
8
|
+
retryCount: 1
|
|
9
|
+
retryDelay: 120
|
|
10
|
+
allowedTools: [read, edit, glob, grep]
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- id: lint
|
|
14
|
+
schedule: "0 2 * * *"
|
|
15
|
+
prompt: >
|
|
16
|
+
Run the linter and fix every reported problem in the changed files.
|
|
17
|
+
Do not change behaviour, only style and obvious defects.
|
|
18
|
+
qualityGate: npm run lint
|
|
19
|
+
|
|
20
|
+
- id: test
|
|
21
|
+
needs: [lint]
|
|
22
|
+
trigger: dag
|
|
23
|
+
prompt: >
|
|
24
|
+
Run the test suite, find the cause of any failure and fix it.
|
|
25
|
+
Add a regression test when the fix changes behaviour.
|
|
26
|
+
qualityGate: npm test
|
|
27
|
+
|
|
28
|
+
- id: build
|
|
29
|
+
needs: [test]
|
|
30
|
+
trigger: dag
|
|
31
|
+
timeoutSeconds: 3600
|
|
32
|
+
prompt: >
|
|
33
|
+
Build the package and verify that dist/ contains the CLI entry point.
|
|
34
|
+
Report the build output size.
|
|
35
|
+
qualityGate: npm run build
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-steward",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "OpenCode plugin for V1 and V2: scheduling and orchestrating AI agent jobs — cron, one-shot runs, DAG pipelines, matrix builds, quality gates, SQLite history, metrics and a local web dashboard. Windows, macOS and Linux. Free and open source (MIT).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "agent-steward contributors",
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
],
|
|
37
37
|
"main": "dist/index.js",
|
|
38
38
|
"types": "dist/index.d.ts",
|
|
39
|
+
"bin": {
|
|
40
|
+
"agent-steward": "dist/cli.js"
|
|
41
|
+
},
|
|
39
42
|
"type": "module",
|
|
40
43
|
"exports": {
|
|
41
44
|
".": {
|
|
@@ -43,6 +46,10 @@
|
|
|
43
46
|
"default": "./dist/index.js"
|
|
44
47
|
},
|
|
45
48
|
"./tui": "./src/tui.tsx",
|
|
49
|
+
"./rpc": {
|
|
50
|
+
"types": "./dist/rpc.d.ts",
|
|
51
|
+
"default": "./dist/rpc.js"
|
|
52
|
+
},
|
|
46
53
|
"./gui-experimental": "./gui-experimental.cjs",
|
|
47
54
|
"./package.json": "./package.json"
|
|
48
55
|
},
|
|
@@ -56,6 +63,7 @@
|
|
|
56
63
|
"scripts",
|
|
57
64
|
"docs",
|
|
58
65
|
"README.md",
|
|
66
|
+
"opencode.pipeline.yaml",
|
|
59
67
|
"LICENSE",
|
|
60
68
|
"CHANGELOG.md",
|
|
61
69
|
"CROSS_PLATFORM.md",
|
|
@@ -78,7 +86,7 @@
|
|
|
78
86
|
"prepare": "npm run build",
|
|
79
87
|
"prepublishOnly": "npm run build && npm run build:gui",
|
|
80
88
|
"pretest": "npm run build",
|
|
81
|
-
"test": "node test-sqlite.mjs && node test-user-version.mjs && node test-run-state.mjs && node test-run-journal.mjs && node test-run-resume.mjs && node test-step-idempotency.mjs && node test-run-dlq.mjs && node test-run-context.mjs && node test-dlq-gui.mjs && node test-pause-gui.mjs && node test-router-rules.mjs && node test-capability-map.mjs && node test-planner.mjs && node test-escalation.mjs && node test-router-dispatch.mjs && node test-crash-recovery.mjs && node test-workspaces.mjs && node test-role-scoped.mjs && node test-permissions-policy.mjs && node test-dry-run.mjs && node test-matrix.mjs && node test-matrix-lifecycle.mjs && node test-matrix-sync.mjs && node test-retention.mjs && node test-metrics.mjs && node test-savings.mjs && node test-schedule-v2.mjs && node test-notifications-v2.mjs && node test-notifications-dedup.mjs && node test-notifications-embedding.mjs && node test-notifications-summary.mjs && node test-settings.mjs && node test-notifications-v3.mjs && node test-triage.mjs && node test-triage-rules.mjs && node test-triage-compare.mjs && node test-triage-chain.mjs && node test-triage-shadow.mjs && node test-triage-audit.mjs && node test-triage-async.mjs && node test-local-ai.mjs && node test-secrets.mjs && node test-audit.mjs && node test-profiles.mjs && node test-env.mjs && node test-agent-tools.mjs && node test-self-analysis.mjs && node test-skill.mjs && node test-integrations.mjs && node test-one-shot.mjs && node test-session-continuity.mjs && node test-task-status.mjs && node test-jobs-view.mjs && node test-dag.mjs && node test-dashboard.mjs && node test-dashboard-trust.mjs && node test-dashboard-dag.mjs && node test-dashboard-json.mjs && node test-docs.mjs && node test-glob.mjs && node test-git-trigger.mjs && node test-window-v3.mjs && node test-i18n.mjs && node test-gui-bundle.mjs && node test-stale-lock.mjs && node test-task-name-limit.mjs && node test-task-name-limit-profile.mjs && node test-delete-profile.mjs && node test-execution-hardening.mjs && node test-path-safety.mjs && node test-watch-paths.mjs && node test-windows-oem.mjs && node test-schtasks-errors.mjs && node test-schtasks-locales.mjs && node test-cron-to-schtasks.mjs && node test-mac-cron.mjs && node test-at-fallback.mjs && node test-shutdown.mjs && node test-dual-entry.mjs && node test-v1-integration.mjs && node test-usage-from-log.mjs && node test-posix-e2e.mjs && node test-model-validation.mjs && node test-run-now.mjs && node test-task-name-collision.mjs && node test-pause-one-shot.mjs && node test-package-exports.mjs && node test-registry-resilience.mjs && node test-posix-create-rollback.mjs && node test-workflows.mjs && node test-dag-latest-history.mjs && node test-retry-counter.mjs && node test-models-config.mjs && node test-posix-cron.mjs && node test-migrate-partial.mjs && node test-windows-locales.mjs && node test-at-e2e.mjs",
|
|
89
|
+
"test": "node test-sqlite.mjs && node test-user-version.mjs && node test-run-state.mjs && node test-run-journal.mjs && node test-run-resume.mjs && node test-step-idempotency.mjs && node test-run-dlq.mjs && node test-run-context.mjs && node test-dlq-gui.mjs && node test-pause-gui.mjs && node test-router-rules.mjs && node test-capability-map.mjs && node test-planner.mjs && node test-escalation.mjs && node test-router-dispatch.mjs && node test-execution-pipeline.mjs && node test-mission-run.mjs && node test-crash-recovery.mjs && node test-prompt-argv.mjs && node test-ps-watchdog.mjs && node test-workspaces.mjs && node test-role-scoped.mjs && node test-permissions-policy.mjs && node test-dry-run.mjs && node test-matrix.mjs && node test-matrix-lifecycle.mjs && node test-matrix-sync.mjs && node test-retention.mjs && node test-metrics.mjs && node test-savings.mjs && node test-schedule-v2.mjs && node test-notifications-v2.mjs && node test-notifications-dedup.mjs && node test-notifications-embedding.mjs && node test-notifications-summary.mjs && node test-settings.mjs && node test-notifications-v3.mjs && node test-triage.mjs && node test-triage-rules.mjs && node test-triage-compare.mjs && node test-triage-chain.mjs && node test-triage-shadow.mjs && node test-triage-audit.mjs && node test-triage-async.mjs && node test-local-ai.mjs && node test-secrets.mjs && node test-audit.mjs && node test-profiles.mjs && node test-env.mjs && node test-agent-tools.mjs && node test-self-analysis.mjs && node test-skill.mjs && node test-integrations.mjs && node test-one-shot.mjs && node test-session-continuity.mjs && node test-task-status.mjs && node test-jobs-view.mjs && node test-dag.mjs && node test-dashboard.mjs && node test-dashboard-trust.mjs && node test-dashboard-dag.mjs && node test-dashboard-json.mjs && node test-dashboard-xss.mjs && node test-profile-isolation.mjs && node test-docs.mjs && node test-glob.mjs && node test-git-trigger.mjs && node test-window-v3.mjs && node test-i18n.mjs && node test-gui-bundle.mjs && node test-lock-format.mjs && node test-stale-lock.mjs && node test-task-name-limit.mjs && node test-task-name-limit-profile.mjs && node test-delete-profile.mjs && node test-execution-hardening.mjs && node test-path-safety.mjs && node test-watch-paths.mjs && node test-windows-oem.mjs && node test-schtasks-errors.mjs && node test-schtasks-locales.mjs && node test-cron-to-schtasks.mjs && node test-mac-cron.mjs && node test-mac-launchctl.mjs && node test-at-fallback.mjs && node test-shutdown.mjs && node test-dual-entry.mjs && node test-v1-integration.mjs && node test-usage-from-log.mjs && node test-posix-e2e.mjs && node test-model-validation.mjs && node test-run-now.mjs && node test-task-name-collision.mjs && node test-pause-one-shot.mjs && node test-package-exports.mjs && node test-registry-resilience.mjs && node test-posix-create-rollback.mjs && node test-workflows.mjs && node test-dag-latest-history.mjs && node test-retry-counter.mjs && node test-models-config.mjs && node test-posix-cron.mjs && node test-migrate-partial.mjs && node test-windows-locales.mjs && node test-pipeline.mjs && node test-at-e2e.mjs && node test-worktree.mjs && node test-guards.mjs && node test-w4.mjs",
|
|
82
90
|
"test:sqlite": "node test-sqlite.mjs",
|
|
83
91
|
"test:user-version": "node test-user-version.mjs",
|
|
84
92
|
"test:run-state": "node test-run-state.mjs",
|
|
@@ -95,6 +103,10 @@
|
|
|
95
103
|
"test:escalation": "node test-escalation.mjs",
|
|
96
104
|
"test:router-dispatch": "node test-router-dispatch.mjs",
|
|
97
105
|
"test:crash": "node test-crash-recovery.mjs",
|
|
106
|
+
"test:prompt-argv": "node test-prompt-argv.mjs",
|
|
107
|
+
"test:execution-pipeline": "node test-execution-pipeline.mjs",
|
|
108
|
+
"test:mission-run": "node test-mission-run.mjs",
|
|
109
|
+
"test:ps-watchdog": "node test-ps-watchdog.mjs",
|
|
98
110
|
"test:chaos": "node test-chaos-dag.mjs",
|
|
99
111
|
"test:workspaces": "node test-workspaces.mjs",
|
|
100
112
|
"test:role": "node test-role-scoped.mjs",
|
|
@@ -108,6 +120,9 @@
|
|
|
108
120
|
"test:posix-cron": "node test-posix-cron.mjs",
|
|
109
121
|
"test:migrate-partial": "node test-migrate-partial.mjs",
|
|
110
122
|
"test:at-e2e": "node test-at-e2e.mjs",
|
|
123
|
+
"test:worktree": "node test-worktree.mjs",
|
|
124
|
+
"test:guards": "node test-guards.mjs",
|
|
125
|
+
"test:w4": "node test-w4.mjs",
|
|
111
126
|
"test:notifications-v2": "node test-notifications-v2.mjs",
|
|
112
127
|
"test:notifications-v3": "node test-notifications-v3.mjs",
|
|
113
128
|
"test:settings": "node test-settings.mjs",
|
|
@@ -137,6 +152,8 @@
|
|
|
137
152
|
"test:dashboard": "node test-dashboard.mjs",
|
|
138
153
|
"test:dashboard-dag": "node test-dashboard-dag.mjs",
|
|
139
154
|
"test:dashboard-json": "node test-dashboard-json.mjs",
|
|
155
|
+
"test:dashboard-xss": "node test-dashboard-xss.mjs",
|
|
156
|
+
"test:profile-isolation": "node test-profile-isolation.mjs",
|
|
140
157
|
"test:docs": "node test-docs.mjs",
|
|
141
158
|
"test:glob": "node test-glob.mjs",
|
|
142
159
|
"test:git-trigger": "node test-git-trigger.mjs",
|
|
@@ -152,6 +169,8 @@
|
|
|
152
169
|
"test:schtasks-errors": "node test-schtasks-errors.mjs",
|
|
153
170
|
"test:cron-to-schtasks": "node test-cron-to-schtasks.mjs",
|
|
154
171
|
"test:mac-cron": "node test-mac-cron.mjs",
|
|
172
|
+
"test:mac-launchctl": "node test-mac-launchctl.mjs",
|
|
173
|
+
"test:lock-format": "node test-lock-format.mjs",
|
|
155
174
|
"test:at-fallback": "node test-at-fallback.mjs",
|
|
156
175
|
"test:shutdown": "node test-shutdown.mjs",
|
|
157
176
|
"test:usage-from-log": "node test-usage-from-log.mjs",
|
|
@@ -177,6 +196,7 @@
|
|
|
177
196
|
"@opencode/schema": "^2.2.7",
|
|
178
197
|
"chokidar": "^6.0.0",
|
|
179
198
|
"iconv-lite": "^0.7.3",
|
|
199
|
+
"yaml": "^2.9.1",
|
|
180
200
|
"zod": "^4.6.7"
|
|
181
201
|
},
|
|
182
202
|
"devDependencies": {
|
|
@@ -191,7 +211,6 @@
|
|
|
191
211
|
"typescript": "^5.9.3",
|
|
192
212
|
"typescript-eslint": "^8.73.0",
|
|
193
213
|
"vite": "^7.0.0",
|
|
194
|
-
"vite-plugin-solid": "^2.11.0"
|
|
195
|
-
"yaml": "^2.9.1"
|
|
214
|
+
"vite-plugin-solid": "^2.11.0"
|
|
196
215
|
}
|
|
197
216
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Общий харнесс для временных домашних каталогов тестов.
|
|
3
|
+
*
|
|
4
|
+
* Каждая сюита получает свой собственный каталог (fs.mkdtemp), поэтому
|
|
5
|
+
* параллельный прогон не может пересечься с другой сюитой. Удаление делает
|
|
6
|
+
* несколько попыток с backoff: на Windows SQLite/WAL и дашборд могут держать
|
|
7
|
+
* файлы ещё несколько тиков после closeDb()/closeDashboardServer(), из-за чего
|
|
8
|
+
* обычный fs.rm падает с ENOTEMPTY.
|
|
9
|
+
*
|
|
10
|
+
* Если ОС так и не отпустила файл, тест НЕ падает из-за утечки temp-каталога —
|
|
11
|
+
* выводится предупреждение. Это сознательный компромисс: предсказуемость
|
|
12
|
+
* прогона важнее чистоты временной папки.
|
|
13
|
+
*/
|
|
14
|
+
import fs from "node:fs";
|
|
15
|
+
import fsp from "node:fs/promises";
|
|
16
|
+
import os from "node:os";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
|
|
19
|
+
const DEFAULT_ATTEMPTS = 6;
|
|
20
|
+
|
|
21
|
+
function sleepSync(ms) {
|
|
22
|
+
// Синхронная пауза без внешних зависимостей (для тестов с fs.rmSync).
|
|
23
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function makePaths(prefix) {
|
|
27
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
28
|
+
return {
|
|
29
|
+
root,
|
|
30
|
+
appData: path.join(root, "AppData"),
|
|
31
|
+
pluginDir: path.join(root, "AppData", "opencode", "windows-scheduler"),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Создаёт изолированный home синхронно (до динамических импортов сервера). */
|
|
36
|
+
export function createTestHomeSync(prefix) {
|
|
37
|
+
const paths = makePaths(prefix);
|
|
38
|
+
fs.mkdirSync(paths.pluginDir, { recursive: true });
|
|
39
|
+
return paths;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Асинхронный аналог createTestHomeSync. */
|
|
43
|
+
export async function createTestHome(prefix) {
|
|
44
|
+
const paths = makePaths(prefix);
|
|
45
|
+
await fsp.mkdir(paths.pluginDir, { recursive: true });
|
|
46
|
+
return paths;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Надёжная синхронная уборка с backoff. Возвращает true, если каталог удалён. */
|
|
50
|
+
export function removeTestHomeSync(target, { attempts = DEFAULT_ATTEMPTS, warn = true } = {}) {
|
|
51
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
52
|
+
try {
|
|
53
|
+
fs.rmSync(target, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
54
|
+
return true;
|
|
55
|
+
} catch (err) {
|
|
56
|
+
if (err?.code === "ENOENT") return true;
|
|
57
|
+
if (attempt === attempts) {
|
|
58
|
+
if (warn) console.warn(`Не удалось удалить временный каталог ${target}: ${String(err)}`);
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
sleepSync(100 * attempt);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Асинхронный аналог removeTestHomeSync. */
|
|
68
|
+
export async function removeTestHome(target, { attempts = DEFAULT_ATTEMPTS, warn = true } = {}) {
|
|
69
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
70
|
+
try {
|
|
71
|
+
await fsp.rm(target, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
72
|
+
return true;
|
|
73
|
+
} catch (err) {
|
|
74
|
+
if (err?.code === "ENOENT") return true;
|
|
75
|
+
if (attempt === attempts) {
|
|
76
|
+
if (warn) console.warn(`Не удалось удалить временный каталог ${target}: ${String(err)}`);
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
await new Promise((resolve) => setTimeout(resolve, 100 * attempt));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|