@mmerterden/multi-agent-pipeline 20.28.0 → 20.30.0
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 +19 -0
- package/README.md +19 -6
- package/README.tr.md +5 -5
- package/docs/architecture.md +3 -3
- package/docs/ecosystem.md +5 -5
- package/docs/facts.json +7 -7
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +122 -1
- package/install/codex.mjs +2 -0
- package/install/copilot.mjs +13 -0
- package/install/templates/claude-hooks.json +30 -1
- package/manifest.json +189 -77
- package/package.json +2 -1
- package/pipeline/commands/multi-agent/analysis/SKILL.md +3 -1
- package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +13 -15
- package/pipeline/commands/multi-agent/office-off/SKILL.md +27 -0
- package/pipeline/commands/multi-agent/office-on/SKILL.md +50 -0
- package/pipeline/commands/multi-agent/office-status/SKILL.md +29 -0
- package/pipeline/commands/multi-agent/resume/SKILL.md +2 -1
- package/pipeline/commands/multi-agent/serve/SKILL.md +4 -2
- package/pipeline/commands/multi-agent/stack/SKILL.md +15 -8
- package/pipeline/commands/multi-agent/steer/SKILL.md +10 -9
- package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
- package/pipeline/contract/CHANGELOG.md +62 -0
- package/pipeline/contract/README.md +52 -6
- package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
- package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
- package/pipeline/contract/fixtures/error-unsigned.json +1 -1
- package/pipeline/contract/manifest.json +367 -22
- package/pipeline/contract/types/index.d.ts +531 -4
- package/pipeline/lib/hook-registration.mjs +252 -0
- package/pipeline/lib/prefs-value.mjs +44 -0
- package/pipeline/lib/run-completion.mjs +148 -0
- package/pipeline/multi-agent-refs/analysis/render.md +4 -4
- package/pipeline/multi-agent-refs/cross-cli-contract.md +5 -4
- package/pipeline/multi-agent-refs/features/doctor.md +11 -0
- package/pipeline/multi-agent-refs/features/office-threat-model.md +91 -0
- package/pipeline/multi-agent-refs/help/en.md +3 -0
- package/pipeline/multi-agent-refs/help/tr.md +3 -0
- package/pipeline/multi-agent-refs/phases/operations.md +17 -0
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +6 -2
- package/pipeline/multi-agent-refs/phases/phase-1-plan.md +2 -2
- package/pipeline/multi-agent-refs/phases/phase-2-dev.md +1 -1
- package/pipeline/multi-agent-refs/phases/phase-3-review.md +2 -2
- package/pipeline/multi-agent-refs/phases/phase-4-commit.md +7 -6
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +5 -4
- package/pipeline/office/NOTICE.md +42 -0
- package/pipeline/office/assets/BIN.png +0 -0
- package/pipeline/office/assets/BOOKSHELF.png +0 -0
- package/pipeline/office/assets/CACTUS.png +0 -0
- package/pipeline/office/assets/CLOCK.png +0 -0
- package/pipeline/office/assets/COFFEE.png +0 -0
- package/pipeline/office/assets/COFFEE_TABLE.png +0 -0
- package/pipeline/office/assets/CUSHIONED_BENCH.png +0 -0
- package/pipeline/office/assets/CUSHIONED_CHAIR_BACK.png +0 -0
- package/pipeline/office/assets/CUSHIONED_CHAIR_FRONT.png +0 -0
- package/pipeline/office/assets/CUSHIONED_CHAIR_SIDE.png +0 -0
- package/pipeline/office/assets/DESK_FRONT.png +0 -0
- package/pipeline/office/assets/DESK_SIDE.png +0 -0
- package/pipeline/office/assets/DOUBLE_BOOKSHELF.png +0 -0
- package/pipeline/office/assets/HANGING_PLANT.png +0 -0
- package/pipeline/office/assets/LARGE_PAINTING.png +0 -0
- package/pipeline/office/assets/LARGE_PLANT.png +0 -0
- package/pipeline/office/assets/PC_BACK.png +0 -0
- package/pipeline/office/assets/PC_FRONT_OFF.png +0 -0
- package/pipeline/office/assets/PC_FRONT_ON_1.png +0 -0
- package/pipeline/office/assets/PC_FRONT_ON_2.png +0 -0
- package/pipeline/office/assets/PC_FRONT_ON_3.png +0 -0
- package/pipeline/office/assets/PC_SIDE.png +0 -0
- package/pipeline/office/assets/PLANT.png +0 -0
- package/pipeline/office/assets/PLANT_2.png +0 -0
- package/pipeline/office/assets/POT.png +0 -0
- package/pipeline/office/assets/SMALL_PAINTING.png +0 -0
- package/pipeline/office/assets/SMALL_PAINTING_2.png +0 -0
- package/pipeline/office/assets/SMALL_TABLE_FRONT.png +0 -0
- package/pipeline/office/assets/SMALL_TABLE_SIDE.png +0 -0
- package/pipeline/office/assets/SOFA_BACK.png +0 -0
- package/pipeline/office/assets/SOFA_FRONT.png +0 -0
- package/pipeline/office/assets/SOFA_SIDE.png +0 -0
- package/pipeline/office/assets/TABLE_FRONT.png +0 -0
- package/pipeline/office/assets/WHITEBOARD.png +0 -0
- package/pipeline/office/assets/WOODEN_BENCH.png +0 -0
- package/pipeline/office/assets/WOODEN_CHAIR_BACK.png +0 -0
- package/pipeline/office/assets/WOODEN_CHAIR_FRONT.png +0 -0
- package/pipeline/office/assets/WOODEN_CHAIR_SIDE.png +0 -0
- package/pipeline/office/assets/char_0.png +0 -0
- package/pipeline/office/assets/char_1.png +0 -0
- package/pipeline/office/assets/char_2.png +0 -0
- package/pipeline/office/assets/char_3.png +0 -0
- package/pipeline/office/assets/char_4.png +0 -0
- package/pipeline/office/assets/char_5.png +0 -0
- package/pipeline/office/assets/floor_0.png +0 -0
- package/pipeline/office/assets/floor_1.png +0 -0
- package/pipeline/office/assets/floor_2.png +0 -0
- package/pipeline/office/assets/floor_3.png +0 -0
- package/pipeline/office/assets/floor_4.png +0 -0
- package/pipeline/office/assets/floor_5.png +0 -0
- package/pipeline/office/assets/floor_6.png +0 -0
- package/pipeline/office/assets/floor_7.png +0 -0
- package/pipeline/office/assets/floor_8.png +0 -0
- package/pipeline/office/assets/wall_0.png +0 -0
- package/pipeline/office/index.html +5319 -0
- package/pipeline/preferences-template.json +7 -0
- package/pipeline/rules/figma-pipeline.md +2 -0
- package/pipeline/schemas/activity-chat.schema.json +78 -0
- package/pipeline/schemas/activity-roles.json +48 -0
- package/pipeline/schemas/activity-roles.schema.json +49 -0
- package/pipeline/schemas/activity.schema.json +429 -0
- package/pipeline/schemas/agent-state.schema.json +20 -5
- package/pipeline/schemas/autopilot-on-request.schema.json +33 -0
- package/pipeline/schemas/autopilot-on.schema.json +111 -0
- package/pipeline/schemas/contract-error.schema.json +33 -3
- package/pipeline/schemas/issue-maturity.schema.json +68 -0
- package/pipeline/schemas/ledger.schema.json +202 -0
- package/pipeline/schemas/permissions.schema.json +47 -0
- package/pipeline/schemas/phases.json +3 -2
- package/pipeline/schemas/phases.schema.json +5 -1
- package/pipeline/schemas/prefs.schema.json +56 -0
- package/pipeline/schemas/prs.schema.json +73 -0
- package/pipeline/schemas/review-verdict-request.schema.json +20 -0
- package/pipeline/schemas/review-verdict.schema.json +62 -0
- package/pipeline/schemas/routine-delete.schema.json +59 -0
- package/pipeline/schemas/routines.schema.json +38 -0
- package/pipeline/schemas/run-evidence.schema.json +29 -0
- package/pipeline/schemas/run-results.schema.json +218 -0
- package/pipeline/schemas/runs-index.schema.json +1 -1
- package/pipeline/schemas/service-read.schema.json +58 -0
- package/pipeline/schemas/stack-change.schema.json +82 -0
- package/pipeline/schemas/stack-request.schema.json +33 -0
- package/pipeline/schemas/stack.schema.json +59 -0
- package/pipeline/schemas/steer-request.schema.json +25 -0
- package/pipeline/schemas/steer.schema.json +59 -0
- package/pipeline/schemas/tool-call-request.schema.json +19 -0
- package/pipeline/schemas/tool-call.schema.json +47 -0
- package/pipeline/schemas/tools.schema.json +60 -0
- package/pipeline/scripts/_active-run.mjs +158 -0
- package/pipeline/scripts/_autopilot-outcomes.mjs +1 -0
- package/pipeline/scripts/_cost.mjs +66 -1
- package/pipeline/scripts/_guard_rules.py +605 -0
- package/pipeline/scripts/_office-smoke-lib.sh +115 -0
- package/pipeline/scripts/_spawn-async.mjs +73 -0
- package/pipeline/scripts/_transcript-tail.mjs +274 -0
- package/pipeline/scripts/activity-snapshot.mjs +1027 -0
- package/pipeline/scripts/agent-guard.py +118 -7
- package/pipeline/scripts/agent-guard.sh +50 -3
- package/pipeline/scripts/argv-secret-scan.mjs +114 -0
- package/pipeline/scripts/autopilot-control.mjs +214 -9
- package/pipeline/scripts/autopilot-runner.mjs +8 -2
- package/pipeline/scripts/confirm-command.mjs +70 -0
- package/pipeline/scripts/contract-server.mjs +1178 -48
- package/pipeline/scripts/cost-analyze.mjs +2 -53
- package/pipeline/scripts/cost-table.json +1 -0
- package/pipeline/scripts/doctor.mjs +54 -0
- package/pipeline/scripts/evidence-gate.mjs +8 -4
- package/pipeline/scripts/gate-ledger.mjs +163 -7
- package/pipeline/scripts/office-build.mjs +89 -0
- package/pipeline/scripts/office-control.mjs +383 -0
- package/pipeline/scripts/office-ledger.mjs +409 -0
- package/pipeline/scripts/plan-coverage-gate.mjs +9 -8
- package/pipeline/scripts/pre-commit-check.sh +12 -0
- package/pipeline/scripts/routine-registry.mjs +42 -6
- package/pipeline/scripts/run-results.mjs +373 -0
- package/pipeline/scripts/run-scope-guard.mjs +188 -0
- package/pipeline/scripts/run-scope-guard.sh +23 -0
- package/pipeline/scripts/run-stop-guard.mjs +246 -0
- package/pipeline/scripts/run-stop-guard.sh +25 -0
- package/pipeline/scripts/service-read.mjs +244 -0
- package/pipeline/scripts/stack-toggle.mjs +285 -0
- package/pipeline/scripts/steer-run.mjs +97 -0
- package/pipeline/scripts/toolkit-tools.mjs +599 -0
- package/pipeline/scripts/uninstall.mjs +4 -0
- package/pipeline/scripts/validate-state.mjs +26 -0
- package/pipeline/scripts/work-items.mjs +304 -0
- package/pipeline/scripts/write-state.mjs +114 -0
- package/pipeline/skills/.skill-manifest.json +19 -7
- package/pipeline/skills/.skills-index.json +34 -1
- package/pipeline/skills/shared/README.md +6 -3
- package/pipeline/skills/shared/core/multi-agent-autopilot-on/SKILL.md +13 -15
- package/pipeline/skills/shared/core/multi-agent-office-off/SKILL.md +16 -0
- package/pipeline/skills/shared/core/multi-agent-office-on/SKILL.md +22 -0
- package/pipeline/skills/shared/core/multi-agent-office-status/SKILL.md +17 -0
- package/pipeline/skills/shared/core/multi-agent-serve/SKILL.md +4 -2
- package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +14 -6
- package/pipeline/skills/shared/core/multi-agent-steer/SKILL.md +10 -9
- package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
- package/pipeline/skills/skills-index.md +4 -1
|
@@ -82,6 +82,7 @@ import { runMain } from "../lib/fatal.mjs";
|
|
|
82
82
|
import { LIVE_STATUSES, resolveClaudeBin } from "../lib/claude-sessions.mjs";
|
|
83
83
|
import { invokedDirectly } from "../lib/invoked-directly.mjs";
|
|
84
84
|
import { readRegularJson } from "../lib/regular-file.mjs";
|
|
85
|
+
import { completionGaps } from "../lib/run-completion.mjs";
|
|
85
86
|
import { messages, outputLanguage } from "../lib/user-facing.mjs";
|
|
86
87
|
import {
|
|
87
88
|
ARTIFACTS_SUBDIR,
|
|
@@ -1152,7 +1153,10 @@ export function prFromState(state) {
|
|
|
1152
1153
|
*
|
|
1153
1154
|
* "finished with no PR" is deliberately not "failed": a run can stop
|
|
1154
1155
|
* legitimately without opening one, and calling that a failure would put a
|
|
1155
|
-
* healthy item into the retry path.
|
|
1156
|
+
* healthy item into the retry path. It is only that when the state earns it
|
|
1157
|
+
* (lib/run-completion.mjs): a `complete` written below the mode's last phase,
|
|
1158
|
+
* without Phase 4 evidence or without a plan-coverage verdict is
|
|
1159
|
+
* `stopped-incomplete`, which is retried, not filed as finished.
|
|
1156
1160
|
*/
|
|
1157
1161
|
export function outcomeFor(supervised, state, prUrl) {
|
|
1158
1162
|
if (prUrl) return OUTCOME.PR_OPENED;
|
|
@@ -1166,7 +1170,9 @@ export function outcomeFor(supervised, state, prUrl) {
|
|
|
1166
1170
|
if (rateLimited({ row: supervised.lastRow, state })) return OUTCOME.RATE_LIMITED;
|
|
1167
1171
|
if (state && state.verificationFailed) return OUTCOME.VERIFICATION_FAILED;
|
|
1168
1172
|
const status = state && state.status;
|
|
1169
|
-
if (status === "complete" || status === "completed")
|
|
1173
|
+
if (status === "complete" || status === "completed") {
|
|
1174
|
+
return completionGaps(state).length ? OUTCOME.STOPPED_INCOMPLETE : OUTCOME.COMPLETED_NO_PR;
|
|
1175
|
+
}
|
|
1170
1176
|
if (status === "failed") return OUTCOME.FAILED;
|
|
1171
1177
|
return state ? `stopped-${status || "unknown"}` : OUTCOME.NO_STATE;
|
|
1172
1178
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* confirm-command.mjs - carry the user's yes for one command to agent-guard.
|
|
4
|
+
*
|
|
5
|
+
* agent-guard asks before a write a person must confirm (closing an issue, a
|
|
6
|
+
* PR body that closes one, a Jira transition POST). In bypassPermissions and
|
|
7
|
+
* dontAsk no permission prompt is raised, so the guard denies and says to ask
|
|
8
|
+
* the user with AskUserQuestion. On a yes, this records it: a file named by the
|
|
9
|
+
* sha256 of the exact command under <log root>/confirmations/. The next time
|
|
10
|
+
* agent-guard sees that exact command it consumes the record and lets it run;
|
|
11
|
+
* a record older than ten minutes, or for any other command, does nothing.
|
|
12
|
+
*
|
|
13
|
+
* Attended only. Under MULTI_AGENT_UNATTENDED=1 nobody gave an answer, so the
|
|
14
|
+
* script refuses (exit 2) and agent-guard never reads a record there.
|
|
15
|
+
*
|
|
16
|
+
* Usage: confirm-command.mjs --command '<the exact command>'
|
|
17
|
+
* Exit: 0 recorded, 2 usage or unattended, 3 could not write
|
|
18
|
+
*
|
|
19
|
+
* @module pipeline/scripts/confirm-command
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
24
|
+
import { homedir } from "node:os";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
|
|
27
|
+
import { runMain } from "../lib/fatal.mjs";
|
|
28
|
+
import { invokedDirectly } from "../lib/invoked-directly.mjs";
|
|
29
|
+
import { isUnattended } from "../lib/unattended.mjs";
|
|
30
|
+
|
|
31
|
+
/** Where records live; agent-guard's _guard_rules.confirmations_dir agrees. */
|
|
32
|
+
export function confirmationsDir(env = process.env) {
|
|
33
|
+
const root = env.LOGS_ROOT || join(homedir(), ".claude", "logs", "multi-agent");
|
|
34
|
+
return join(root, "confirmations");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The record path for one command. */
|
|
38
|
+
export function recordPath(command, env = process.env) {
|
|
39
|
+
const digest = createHash("sha256").update(command, "utf8").digest("hex");
|
|
40
|
+
return join(confirmationsDir(env), `${digest}.json`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function main() {
|
|
44
|
+
const argv = process.argv.slice(2);
|
|
45
|
+
const i = argv.indexOf("--command");
|
|
46
|
+
const command = i === -1 ? undefined : argv[i + 1];
|
|
47
|
+
if (typeof command !== "string" || !command) {
|
|
48
|
+
process.stderr.write("usage: confirm-command.mjs --command '<the exact command>'\n");
|
|
49
|
+
process.exitCode = 2;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (isUnattended()) {
|
|
53
|
+
process.stderr.write("confirm-command: refused, nobody can confirm in an unattended run\n");
|
|
54
|
+
process.exitCode = 2;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
mkdirSync(confirmationsDir(), { recursive: true, mode: 0o700 });
|
|
59
|
+
writeFileSync(recordPath(command), `${JSON.stringify({ at: new Date().toISOString() })}\n`, {
|
|
60
|
+
mode: 0o600,
|
|
61
|
+
});
|
|
62
|
+
} catch (err) {
|
|
63
|
+
process.stderr.write(`confirm-command: ${err.message}\n`);
|
|
64
|
+
process.exitCode = 3;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
process.stdout.write("confirm-command: recorded for 10 minutes, one use\n");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (invokedDirectly(import.meta.url)) runMain("confirm-command", main, { code: 3 });
|