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/dist/cli.js
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI agent-steward (Спринт 32, Pipeline-as-code).
|
|
4
|
+
*
|
|
5
|
+
* Команды:
|
|
6
|
+
* agent-steward pipeline validate <file> [--json]
|
|
7
|
+
* agent-steward pipeline apply <file> [--dry-run] [--json]
|
|
8
|
+
* agent-steward pipeline export --pipeline <name> [--out <file>]
|
|
9
|
+
*
|
|
10
|
+
* Exit-коды: 0 — успех, 1 — ошибки валидации/применения, 2 — неверные аргументы.
|
|
11
|
+
*/
|
|
12
|
+
import { writeFileSync } from "node:fs";
|
|
13
|
+
import { stringify } from "yaml";
|
|
14
|
+
import { closeDb, initDb } from "./db/index.js";
|
|
15
|
+
import { listTasks } from "./db/tasks-repo.js";
|
|
16
|
+
import { loadPipelineFile } from "./core/pipeline-io.js";
|
|
17
|
+
import { executePipelineApply, planPipelineApply } from "./core/pipeline-apply.js";
|
|
18
|
+
import { tasksToPipelineSpec } from "./core/pipeline-map.js";
|
|
19
|
+
import { saveTaskDefinition } from "./task-transfer.js";
|
|
20
|
+
import { listWorkspaces } from "./workspaces.js";
|
|
21
|
+
import { runMission } from "./core/mission.js";
|
|
22
|
+
const USAGE = `agent-steward — планировщик agent jobs
|
|
23
|
+
|
|
24
|
+
Использование:
|
|
25
|
+
agent-steward pipeline validate <file> [--json]
|
|
26
|
+
agent-steward pipeline apply <file> [--dry-run] [--json]
|
|
27
|
+
agent-steward pipeline export --pipeline <name> [--out <file>]
|
|
28
|
+
|
|
29
|
+
Команды:
|
|
30
|
+
validate проверить opencode.pipeline.yaml, не меняя задачи
|
|
31
|
+
apply создать/обновить задачи из файла (идемпотентно)
|
|
32
|
+
export выгрузить задачи pipeline из БД обратно в YAML
|
|
33
|
+
|
|
34
|
+
Опции:
|
|
35
|
+
--json машинный вывод
|
|
36
|
+
--dry-run показать план apply без изменений
|
|
37
|
+
--pipeline имя pipeline для export
|
|
38
|
+
--out файл для export (по умолчанию stdout)
|
|
39
|
+
`;
|
|
40
|
+
function printIssueList(label, issues) {
|
|
41
|
+
if (issues.length === 0)
|
|
42
|
+
return;
|
|
43
|
+
console.error(label);
|
|
44
|
+
for (const issue of issues) {
|
|
45
|
+
console.error(` - ${issue.path}: ${issue.message}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function requireFile(args) {
|
|
49
|
+
const file = args.find((arg) => !arg.startsWith("--"));
|
|
50
|
+
if (!file) {
|
|
51
|
+
console.error("Не указан файл pipeline.\n");
|
|
52
|
+
console.error(USAGE);
|
|
53
|
+
process.exit(2);
|
|
54
|
+
}
|
|
55
|
+
return file;
|
|
56
|
+
}
|
|
57
|
+
function flagValue(args, name) {
|
|
58
|
+
const index = args.indexOf(name);
|
|
59
|
+
if (index === -1)
|
|
60
|
+
return undefined;
|
|
61
|
+
const value = args[index + 1];
|
|
62
|
+
if (!value || value.startsWith("--")) {
|
|
63
|
+
console.error(`Опция ${name} требует значение.`);
|
|
64
|
+
process.exit(2);
|
|
65
|
+
}
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
function workspaceResolver() {
|
|
69
|
+
const workspaces = listWorkspaces();
|
|
70
|
+
const byId = new Map(workspaces.map((ws) => [ws.id.toLowerCase(), ws.id]));
|
|
71
|
+
const byName = new Map(workspaces.map((ws) => [ws.name.trim().toLowerCase(), ws.id]));
|
|
72
|
+
return (value) => {
|
|
73
|
+
const key = value.trim().toLowerCase();
|
|
74
|
+
return byId.get(key) ?? byName.get(key);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** Создаёт задачу через общий путь schedulerCreateTask и сохраняет определение. */
|
|
78
|
+
async function persistDefinition(def) {
|
|
79
|
+
const { schedulerCreateTask } = await import("./index.js");
|
|
80
|
+
await schedulerCreateTask(def.name, def.schedule, def.prompt, def.timeoutSeconds, def.workingDirectory, def.retryCount, def.retryDelay, def.qualityGate, def.nextTaskOnSuccess, def.nextTaskOnError, def.triggerType, def.watchPath, def.dependsOn, def.model, def.priority, def.beforeScript, def.afterScript, def.mcpEvent, def.workspaceId, def.allowedTools, def.deniedTools, def.matrix, def.matrixParentId, "create", def.timezone, def.notBefore, def.notAfter, def.pausedUntil, def.runAt, def.session, def.sessionId, def.sessionMaxRuns, {
|
|
81
|
+
activeDays: def.activeDays,
|
|
82
|
+
windowPolicy: def.windowPolicy,
|
|
83
|
+
watchGlobs: def.watchGlobs,
|
|
84
|
+
watchIgnore: def.watchIgnore,
|
|
85
|
+
gitBranch: def.gitBranch,
|
|
86
|
+
gitPaths: def.gitPaths,
|
|
87
|
+
gitIgnore: def.gitIgnore,
|
|
88
|
+
gitPollSeconds: def.gitPollSeconds,
|
|
89
|
+
}, def.runWhenLoggedOff, def.paused, def.legacyShell);
|
|
90
|
+
await saveTaskDefinition(def);
|
|
91
|
+
}
|
|
92
|
+
async function runValidate(args) {
|
|
93
|
+
const file = requireFile(args);
|
|
94
|
+
const json = args.includes("--json");
|
|
95
|
+
const result = await loadPipelineFile(file);
|
|
96
|
+
if (json) {
|
|
97
|
+
console.log(JSON.stringify({
|
|
98
|
+
ok: result.ok,
|
|
99
|
+
errors: result.errors,
|
|
100
|
+
warnings: result.warnings,
|
|
101
|
+
steps: result.spec?.steps.length ?? 0,
|
|
102
|
+
}, null, 2));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
printIssueList("Ошибки:", result.errors);
|
|
106
|
+
printIssueList("Предупреждения:", result.warnings);
|
|
107
|
+
if (result.ok && result.spec) {
|
|
108
|
+
console.log(`OK: «${result.spec.name}», шагов: ${result.spec.steps.length}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return result.ok ? 0 : 1;
|
|
112
|
+
}
|
|
113
|
+
async function runExport(args) {
|
|
114
|
+
const pipelineName = flagValue(args, "--pipeline");
|
|
115
|
+
if (!pipelineName) {
|
|
116
|
+
console.error("Для export укажите --pipeline <name>.\n");
|
|
117
|
+
console.error(USAGE);
|
|
118
|
+
return 2;
|
|
119
|
+
}
|
|
120
|
+
const out = flagValue(args, "--out");
|
|
121
|
+
initDb();
|
|
122
|
+
try {
|
|
123
|
+
const exported = tasksToPipelineSpec(listTasks(), pipelineName);
|
|
124
|
+
if (exported.spec.steps.length === 0) {
|
|
125
|
+
console.error(`Pipeline «${pipelineName}» не найден в БД.`);
|
|
126
|
+
return 1;
|
|
127
|
+
}
|
|
128
|
+
for (const warning of exported.warnings)
|
|
129
|
+
console.error(`Предупреждение: ${warning}`);
|
|
130
|
+
const yaml = stringify(exported.spec, { lineWidth: 0 });
|
|
131
|
+
if (out) {
|
|
132
|
+
writeFileSync(out, yaml, "utf8");
|
|
133
|
+
console.log(`Записано: ${out} (шагов: ${exported.spec.steps.length})`);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
process.stdout.write(yaml);
|
|
137
|
+
}
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
closeDb();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function runApply(args) {
|
|
145
|
+
const file = requireFile(args);
|
|
146
|
+
const dryRun = args.includes("--dry-run");
|
|
147
|
+
const json = args.includes("--json");
|
|
148
|
+
const parsed = await loadPipelineFile(file);
|
|
149
|
+
if (!parsed.ok || !parsed.spec) {
|
|
150
|
+
printIssueList("Ошибки:", parsed.errors);
|
|
151
|
+
printIssueList("Предупреждения:", parsed.warnings);
|
|
152
|
+
return 1;
|
|
153
|
+
}
|
|
154
|
+
initDb();
|
|
155
|
+
try {
|
|
156
|
+
const plan = planPipelineApply(parsed.spec, listTasks(), {
|
|
157
|
+
resolveWorkspaceId: workspaceResolver(),
|
|
158
|
+
});
|
|
159
|
+
for (const warning of plan.warnings)
|
|
160
|
+
console.error(`Предупреждение: ${warning}`);
|
|
161
|
+
if (!dryRun) {
|
|
162
|
+
await executePipelineApply(plan, {
|
|
163
|
+
create: persistDefinition,
|
|
164
|
+
update: persistDefinition,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const summary = {
|
|
168
|
+
pipeline: parsed.spec.name,
|
|
169
|
+
dryRun,
|
|
170
|
+
creates: plan.creates.map((task) => task.name),
|
|
171
|
+
updates: plan.updates.map((entry) => entry.task.name),
|
|
172
|
+
unchanged: plan.unchanged.map((task) => task.name),
|
|
173
|
+
stale: plan.stale.map((task) => task.name),
|
|
174
|
+
};
|
|
175
|
+
if (json) {
|
|
176
|
+
console.log(JSON.stringify(summary, null, 2));
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const verb = dryRun ? "Будет создано" : "Создано";
|
|
180
|
+
console.log(`${verb}: ${summary.creates.length}`);
|
|
181
|
+
console.log(`Обновлено: ${summary.updates.length}`);
|
|
182
|
+
console.log(`Без изменений: ${summary.unchanged.length}`);
|
|
183
|
+
if (summary.stale.length > 0) {
|
|
184
|
+
console.log(`Устаревшие (не удалены): ${summary.stale.join(", ")}`);
|
|
185
|
+
}
|
|
186
|
+
for (const name of summary.creates)
|
|
187
|
+
console.log(` + ${name}`);
|
|
188
|
+
for (const name of summary.updates)
|
|
189
|
+
console.log(` ~ ${name}`);
|
|
190
|
+
}
|
|
191
|
+
return 0;
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
console.error(`Ошибка apply: ${err instanceof Error ? err.message : String(err)}`);
|
|
195
|
+
return 1;
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
closeDb();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function listFlag(args, name) {
|
|
202
|
+
const value = flagValue(args, name);
|
|
203
|
+
if (value === undefined)
|
|
204
|
+
return undefined;
|
|
205
|
+
const list = value
|
|
206
|
+
.split(",")
|
|
207
|
+
.map((item) => item.trim())
|
|
208
|
+
.filter(Boolean);
|
|
209
|
+
return list.length > 0 ? list : undefined;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* AB-8.2: `agent-steward run <prompt>` — ad-hoc миссия без регистрации в ОС.
|
|
213
|
+
* Проходит тот же runtime, что и задачи: план → маршрут → GATE → ledger.
|
|
214
|
+
*/
|
|
215
|
+
async function runAdHoc(args) {
|
|
216
|
+
const valueFlags = new Set([
|
|
217
|
+
"--cwd",
|
|
218
|
+
"--gate",
|
|
219
|
+
"--task-type",
|
|
220
|
+
"--model",
|
|
221
|
+
"--timeout",
|
|
222
|
+
"--policy",
|
|
223
|
+
"--allow-tools",
|
|
224
|
+
"--deny-tools",
|
|
225
|
+
"--session",
|
|
226
|
+
"--session-id",
|
|
227
|
+
"--name",
|
|
228
|
+
]);
|
|
229
|
+
let prompt;
|
|
230
|
+
for (let index = 0; index < args.length; index++) {
|
|
231
|
+
const arg = args[index];
|
|
232
|
+
if (arg.startsWith("--")) {
|
|
233
|
+
if (valueFlags.has(arg))
|
|
234
|
+
index++;
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
prompt = arg;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
if (!prompt?.trim()) {
|
|
241
|
+
console.error("agent-steward run <prompt> [--cwd <dir>] [--gate <cmd>] [--task-type <type>] " +
|
|
242
|
+
"[--model <model>] [--timeout <sec>] [--policy hybrid|secure|legacy] " +
|
|
243
|
+
"[--allow-tools a,b] [--deny-tools a,b] [--session new|reuse|last] " +
|
|
244
|
+
"[--session-id ses_...] [--name <name>] [--dry-run] [--json]");
|
|
245
|
+
return 2;
|
|
246
|
+
}
|
|
247
|
+
const json = args.includes("--json");
|
|
248
|
+
const timeoutRaw = flagValue(args, "--timeout");
|
|
249
|
+
const timeoutSeconds = timeoutRaw === undefined ? undefined : Number(timeoutRaw);
|
|
250
|
+
if (timeoutSeconds !== undefined && (!Number.isInteger(timeoutSeconds) || timeoutSeconds <= 0)) {
|
|
251
|
+
console.error("--timeout должен быть целым положительным числом секунд.");
|
|
252
|
+
return 2;
|
|
253
|
+
}
|
|
254
|
+
const policyRaw = flagValue(args, "--policy");
|
|
255
|
+
if (policyRaw && !["hybrid", "secure", "legacy"].includes(policyRaw)) {
|
|
256
|
+
console.error("--policy должен быть hybrid, secure или legacy.");
|
|
257
|
+
return 2;
|
|
258
|
+
}
|
|
259
|
+
const sessionRaw = flagValue(args, "--session");
|
|
260
|
+
if (sessionRaw && !["new", "reuse", "last"].includes(sessionRaw)) {
|
|
261
|
+
console.error("--session должен быть new, reuse или last.");
|
|
262
|
+
return 2;
|
|
263
|
+
}
|
|
264
|
+
const spec = {
|
|
265
|
+
prompt,
|
|
266
|
+
cwd: flagValue(args, "--cwd"),
|
|
267
|
+
taskName: flagValue(args, "--name"),
|
|
268
|
+
taskType: flagValue(args, "--task-type"),
|
|
269
|
+
model: flagValue(args, "--model"),
|
|
270
|
+
session: sessionRaw,
|
|
271
|
+
sessionId: flagValue(args, "--session-id"),
|
|
272
|
+
timeoutSeconds,
|
|
273
|
+
gate: flagValue(args, "--gate"),
|
|
274
|
+
gateTimeoutSeconds: undefined,
|
|
275
|
+
policy: policyRaw,
|
|
276
|
+
allowedTools: listFlag(args, "--allow-tools"),
|
|
277
|
+
deniedTools: listFlag(args, "--deny-tools"),
|
|
278
|
+
dryRun: args.includes("--dry-run"),
|
|
279
|
+
};
|
|
280
|
+
initDb();
|
|
281
|
+
try {
|
|
282
|
+
const result = await runMission(spec);
|
|
283
|
+
if (json) {
|
|
284
|
+
console.log(JSON.stringify({
|
|
285
|
+
success: result.success,
|
|
286
|
+
dryRun: result.dryRun,
|
|
287
|
+
runId: result.runId,
|
|
288
|
+
status: result.status,
|
|
289
|
+
description: result.description,
|
|
290
|
+
error: result.error,
|
|
291
|
+
logFile: result.logFile,
|
|
292
|
+
steps: result.steps,
|
|
293
|
+
}, null, 2));
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
console.log(result.description);
|
|
297
|
+
for (const step of result.steps) {
|
|
298
|
+
console.log(` ${step.stepName}: ${step.status} (attempt ${step.attempt})`);
|
|
299
|
+
}
|
|
300
|
+
if (result.error)
|
|
301
|
+
console.error(`Ошибка: ${result.error}`);
|
|
302
|
+
if (result.logFile)
|
|
303
|
+
console.log(`Лог: ${result.logFile}`);
|
|
304
|
+
if (result.runId)
|
|
305
|
+
console.log(`Запуск: ${result.runId}`);
|
|
306
|
+
}
|
|
307
|
+
return result.success ? 0 : 1;
|
|
308
|
+
}
|
|
309
|
+
catch (err) {
|
|
310
|
+
console.error(`Ошибка миссии: ${err instanceof Error ? err.message : String(err)}`);
|
|
311
|
+
return 1;
|
|
312
|
+
}
|
|
313
|
+
finally {
|
|
314
|
+
closeDb();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
async function main(argv) {
|
|
318
|
+
const [group, command, ...rest] = argv;
|
|
319
|
+
if (group === "--help" || group === "-h" || group === "help" || !group) {
|
|
320
|
+
console.log(USAGE);
|
|
321
|
+
return group ? 0 : 2;
|
|
322
|
+
}
|
|
323
|
+
if (group === "run") {
|
|
324
|
+
return runAdHoc([command, ...rest].filter((value) => Boolean(value)));
|
|
325
|
+
}
|
|
326
|
+
if (group !== "pipeline") {
|
|
327
|
+
console.error(`Неизвестная команда «${group}».\n`);
|
|
328
|
+
console.error(USAGE);
|
|
329
|
+
return 2;
|
|
330
|
+
}
|
|
331
|
+
switch (command) {
|
|
332
|
+
case "validate":
|
|
333
|
+
return runValidate(rest);
|
|
334
|
+
case "apply":
|
|
335
|
+
return runApply(rest);
|
|
336
|
+
case "export":
|
|
337
|
+
return runExport(rest);
|
|
338
|
+
default:
|
|
339
|
+
console.error(`Неизвестная команда pipeline «${command ?? ""}».\n`);
|
|
340
|
+
console.error(USAGE);
|
|
341
|
+
return 2;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
main(process.argv.slice(2))
|
|
345
|
+
.then((code) => {
|
|
346
|
+
process.exitCode = code;
|
|
347
|
+
})
|
|
348
|
+
.catch((err) => {
|
|
349
|
+
console.error(`Ошибка: ${err instanceof Error ? err.message : String(err)}`);
|
|
350
|
+
process.exitCode = 1;
|
|
351
|
+
});
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AC-1: единый путь исполнения.
|
|
3
|
+
*
|
|
4
|
+
* Любой запуск — зарегистрированная задача или ad-hoc миссия — сначала
|
|
5
|
+
* превращается в `RunContext` (вход, задача, профиль, безопасность), затем в
|
|
6
|
+
* план `createRun → декомпозиция → маршрут → исполнение → GATE → ledger`.
|
|
7
|
+
* Транспорт (OpenCode, локальная модель, облако) скрыт за `StepExecutor`,
|
|
8
|
+
* поэтому ядро не зависит от конкретного CLI.
|
|
9
|
+
*
|
|
10
|
+
* Модуль намеренно не запускает процессы сам: исполнитель передаётся снаружи.
|
|
11
|
+
* Это позволяет тестировать путь без регистрации задачи в ОС и подменять
|
|
12
|
+
* OpenCode на любой другой транспорт.
|
|
13
|
+
*/
|
|
14
|
+
import { type MissionDecomposer, type MissionStep, type PlanSource } from "./router/planner.js";
|
|
15
|
+
import { type StepRoute } from "./router/dispatch.js";
|
|
16
|
+
import type { CapabilityThresholds } from "../db/capability-repo.js";
|
|
17
|
+
/** Откуда пришёл запуск. Оба источника идут одним путём. */
|
|
18
|
+
export type RunOrigin = "registered" | "ad-hoc";
|
|
19
|
+
/** Что инициировало запуск. */
|
|
20
|
+
export type RunTrigger = "manual" | "cron" | "file" | "git" | "mcp-event" | "once";
|
|
21
|
+
/** Политика доступа к инструментам (совпадает с core/permissions). */
|
|
22
|
+
export type RunPermissionPolicy = "hybrid" | "secure" | "legacy";
|
|
23
|
+
/** Профиль исполнения: модель, сессия и рабочее пространство. */
|
|
24
|
+
export interface RunProfile {
|
|
25
|
+
model?: string | null;
|
|
26
|
+
session?: "new" | "reuse" | "last";
|
|
27
|
+
sessionId?: string | null;
|
|
28
|
+
workspaceId?: string | null;
|
|
29
|
+
}
|
|
30
|
+
/** Контракт безопасности запуска. */
|
|
31
|
+
export interface RunSafety {
|
|
32
|
+
policy: RunPermissionPolicy;
|
|
33
|
+
allowedTools?: readonly string[];
|
|
34
|
+
deniedTools?: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* AC-1.1: контракт контекста запуска.
|
|
38
|
+
* Содержит всё, что нужно ядру до первого шага, и не содержит транспорта.
|
|
39
|
+
*/
|
|
40
|
+
export interface RunContext {
|
|
41
|
+
origin: RunOrigin;
|
|
42
|
+
trigger: RunTrigger;
|
|
43
|
+
taskName: string;
|
|
44
|
+
/** Исходная миссия/промпт, по которой строится план. */
|
|
45
|
+
mission: string;
|
|
46
|
+
/** Промпт, который получит исполнитель (обычно совпадает с mission). */
|
|
47
|
+
prompt: string;
|
|
48
|
+
cwd: string;
|
|
49
|
+
/** Явный тип задачи: если задан, декомпозиция не нужна. */
|
|
50
|
+
taskType?: string;
|
|
51
|
+
profile: RunProfile;
|
|
52
|
+
safety: RunSafety;
|
|
53
|
+
/** Свободные метаданные: родительский запуск, матрица, источник. */
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
/** Структурный минимум определения зарегистрированной задачи. */
|
|
57
|
+
export interface RegisteredTaskLike {
|
|
58
|
+
name: string;
|
|
59
|
+
prompt: string;
|
|
60
|
+
taskType?: string;
|
|
61
|
+
schedule?: string;
|
|
62
|
+
priority?: number;
|
|
63
|
+
model?: string | null;
|
|
64
|
+
workingDirectory?: string;
|
|
65
|
+
workdir?: string;
|
|
66
|
+
workspaceId?: string;
|
|
67
|
+
session?: "new" | "reuse" | "last";
|
|
68
|
+
sessionId?: string | null;
|
|
69
|
+
allowedTools?: string[];
|
|
70
|
+
deniedTools?: string[];
|
|
71
|
+
triggerType?: RunTrigger;
|
|
72
|
+
qualityGate?: string;
|
|
73
|
+
beforeScript?: string;
|
|
74
|
+
afterScript?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Опции фабрик контекста. */
|
|
77
|
+
export interface RunContextOverrides {
|
|
78
|
+
cwd?: string;
|
|
79
|
+
taskName?: string;
|
|
80
|
+
taskType?: string;
|
|
81
|
+
trigger?: RunTrigger;
|
|
82
|
+
policy?: RunPermissionPolicy;
|
|
83
|
+
profile?: Partial<RunProfile>;
|
|
84
|
+
safety?: Partial<RunSafety>;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* AC-1.1: контекст зарегистрированной задачи. Определение из БД — только
|
|
89
|
+
* источник данных; дальнейший путь не отличается от ad-hoc.
|
|
90
|
+
*/
|
|
91
|
+
export declare function createRegisteredRunContext(definition: RegisteredTaskLike, overrides?: RunContextOverrides): RunContext;
|
|
92
|
+
/** AC-1.1: контекст ad-hoc миссии — без записи в ОС и без task definition. */
|
|
93
|
+
export declare function createAdHocRunContext(mission: string, overrides?: RunContextOverrides): RunContext;
|
|
94
|
+
/** Проверяет контракт безопасности до создания запуска. */
|
|
95
|
+
export declare function validateRunContext(context: RunContext): void;
|
|
96
|
+
/** Один шаг плана с готовым маршрутом (AC-1.3: трассировка). */
|
|
97
|
+
export interface PlannedStep extends MissionStep {
|
|
98
|
+
order: number;
|
|
99
|
+
route: StepRoute;
|
|
100
|
+
}
|
|
101
|
+
/** План исполнения: контекст + шаги + источник декомпозиции. */
|
|
102
|
+
export interface ExecutionPlan {
|
|
103
|
+
context: RunContext;
|
|
104
|
+
steps: PlannedStep[];
|
|
105
|
+
source: PlanSource;
|
|
106
|
+
ambiguousTaskTypes: string[];
|
|
107
|
+
warnings: string[];
|
|
108
|
+
}
|
|
109
|
+
/** Опции построения плана. */
|
|
110
|
+
export interface BuildPlanOptions {
|
|
111
|
+
maxSteps?: number;
|
|
112
|
+
decomposer?: MissionDecomposer;
|
|
113
|
+
thresholds?: CapabilityThresholds;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* AC-1.3: строит план и маршрут каждого шага до первого исполнения.
|
|
117
|
+
* Сам по себе план ничего не запускает — это и есть dry-run.
|
|
118
|
+
*/
|
|
119
|
+
export declare function buildExecutionPlan(context: RunContext, options?: BuildPlanOptions): Promise<ExecutionPlan>;
|
|
120
|
+
/** Человекочитаемая трассировка маршрута для dry-run и логов. */
|
|
121
|
+
export declare function describeExecutionPlan(plan: ExecutionPlan): string;
|
|
122
|
+
/** Вход исполнителя шага: всё, что нужно транспорту, без знания о ядре. */
|
|
123
|
+
export interface StepExecutionInput {
|
|
124
|
+
step: PlannedStep;
|
|
125
|
+
context: RunContext;
|
|
126
|
+
/** Полный план — исполнителю может понадобиться предыдущий шаг. */
|
|
127
|
+
plan: ExecutionPlan;
|
|
128
|
+
}
|
|
129
|
+
/** Результат исполнителя шага. */
|
|
130
|
+
export interface StepExecutionResult {
|
|
131
|
+
output?: unknown;
|
|
132
|
+
/** Явная ошибка без исключения; ядро переведёт шаг в failed. */
|
|
133
|
+
error?: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* AC-1.2: абстракция исполнителя. Ядро не знает, OpenCode это, локальная
|
|
137
|
+
* модель или облачный API — только умеет ли исполнитель взять маршрут.
|
|
138
|
+
*/
|
|
139
|
+
export interface StepExecutor {
|
|
140
|
+
readonly id: string;
|
|
141
|
+
supports(route: StepRoute): boolean;
|
|
142
|
+
execute(input: StepExecutionInput): Promise<StepExecutionResult> | StepExecutionResult;
|
|
143
|
+
}
|
|
144
|
+
/** HTTP-/CLI-независимый исполнитель OpenCode: транспорт передаётся функцией. */
|
|
145
|
+
export interface OpenCodeInvocation {
|
|
146
|
+
prompt: string;
|
|
147
|
+
cwd: string;
|
|
148
|
+
model: string | null;
|
|
149
|
+
session: RunProfile["session"];
|
|
150
|
+
sessionId: string | null;
|
|
151
|
+
step: PlannedStep;
|
|
152
|
+
context: RunContext;
|
|
153
|
+
}
|
|
154
|
+
export declare function createOpenCodeExecutor(invoke: (input: OpenCodeInvocation) => Promise<unknown> | unknown, id?: string): StepExecutor;
|
|
155
|
+
/** Вердикт GATE после шага. */
|
|
156
|
+
export interface GateVerdict {
|
|
157
|
+
ok: boolean;
|
|
158
|
+
reason?: string;
|
|
159
|
+
}
|
|
160
|
+
export type Gate = (input: StepExecutionInput & {
|
|
161
|
+
result: StepExecutionResult;
|
|
162
|
+
}) => GateVerdict | Promise<GateVerdict>;
|
|
163
|
+
/** Ошибка GATE: шаг выполнен, но результат не принят. */
|
|
164
|
+
export declare class GateRejectedError extends Error {
|
|
165
|
+
constructor(reason: string);
|
|
166
|
+
}
|
|
167
|
+
/** Результат выполнения одного шага. */
|
|
168
|
+
export interface ExecutedStep {
|
|
169
|
+
stepName: string;
|
|
170
|
+
taskType: string;
|
|
171
|
+
target: StepRoute["target"];
|
|
172
|
+
status: "passed" | "failed" | "skipped";
|
|
173
|
+
attempt: number;
|
|
174
|
+
output?: unknown;
|
|
175
|
+
error?: string;
|
|
176
|
+
}
|
|
177
|
+
/** Результат выполнения плана. */
|
|
178
|
+
export interface ExecutionResult {
|
|
179
|
+
runId: string;
|
|
180
|
+
status: "passed" | "failed";
|
|
181
|
+
steps: ExecutedStep[];
|
|
182
|
+
error: string | null;
|
|
183
|
+
plan: ExecutionPlan;
|
|
184
|
+
}
|
|
185
|
+
/** Опции исполнения. */
|
|
186
|
+
export interface ExecutePlanOptions {
|
|
187
|
+
/** Исполнители в порядке приоритета. */
|
|
188
|
+
executors: StepExecutor[];
|
|
189
|
+
gate?: Gate;
|
|
190
|
+
/** Останавливаться на первой ошибке (по умолчанию true). */
|
|
191
|
+
stopOnError?: boolean;
|
|
192
|
+
/** Дополнительные метаданные запуска. */
|
|
193
|
+
metadata?: Record<string, unknown>;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* AC-1.4: единое исполнение плана для зарегистрированной и ad-hoc миссии.
|
|
197
|
+
*
|
|
198
|
+
* Создаёт запуск в ledger, для каждого шага фиксирует running/passed/failed,
|
|
199
|
+
* применяет GATE и завершает запуск. Шаги `review`/`explore` пропускаются:
|
|
200
|
+
* их нельзя исполнить автоматически.
|
|
201
|
+
*/
|
|
202
|
+
export declare function executeExecutionPlan(plan: ExecutionPlan, options: ExecutePlanOptions): Promise<ExecutionResult>;
|
|
203
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/core/execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,4DAA4D;AAC5D,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEhD,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,MAAM,CAAC;AAEnF,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjE,iEAAiE;AACjE,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,qCAAqC;AACrC,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ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