@plainconceptsplatform/workflows 0.4.8 → 0.4.9
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/dist/catalog-installation.js +6 -3
- package/dist/catalog-installation.test.js +3 -3
- package/loops/workflows/agent-apply-review.md +1 -0
- package/loops/workflows/agent-audit.md +1 -0
- package/loops/workflows/agent-direct.md +1 -0
- package/loops/workflows/agent-implement.md +1 -0
- package/loops/workflows/agent-merge-gate.md +1 -0
- package/loops/workflows/agent-propose.md +1 -0
- package/loops/workflows/agent-refine.md +1 -0
- package/package.json +1 -1
|
@@ -162,16 +162,19 @@ async function preCommitHookUpdate(repositoryPath) {
|
|
|
162
162
|
const compileLine = "node scripts/compile-agent-workflows.mjs";
|
|
163
163
|
const stageLine = "git add -- .github/workflows/*.lock.yml";
|
|
164
164
|
const actionLockLine = "[ ! -f .github/actions/actions-lock.json ] || git add -- .github/actions/actions-lock.json";
|
|
165
|
-
const managedLines =
|
|
165
|
+
const managedLines = `if git diff --cached --name-only -- .github | grep -q .; then\n ${compileLine}\n ${stageLine}\n ${actionLockLine}\nfi\n`;
|
|
166
166
|
if (!await exists(hookPath)) {
|
|
167
167
|
return { target, content: managedLines };
|
|
168
168
|
}
|
|
169
169
|
const content = await readFile(hookPath, "utf8");
|
|
170
170
|
if (content.includes("compile-agent-workflows")) {
|
|
171
|
-
|
|
171
|
+
const legacyLines = `${compileLine}\n${stageLine}\n${actionLockLine}\n`;
|
|
172
|
+
if (content.includes(managedLines))
|
|
172
173
|
return { target, content };
|
|
174
|
+
if (content.includes(legacyLines))
|
|
175
|
+
return { target, content: content.replace(legacyLines, managedLines) };
|
|
173
176
|
const suffix = content.endsWith("\n") || content === "" ? "" : "\n";
|
|
174
|
-
return { target, content: `${content}${suffix}${
|
|
177
|
+
return { target, content: `${content}${suffix}${managedLines}` };
|
|
175
178
|
}
|
|
176
179
|
return { target, content: content.endsWith("\n") || content === ""
|
|
177
180
|
? `${content}${managedLines}`
|
|
@@ -253,20 +253,20 @@ describe("catalog installation", () => {
|
|
|
253
253
|
const repositoryPath = await createDirectory({});
|
|
254
254
|
await ensurePreCommitHook(repositoryPath);
|
|
255
255
|
await expect(readFile(join(repositoryPath, ".husky", "pre-commit"), "utf8"))
|
|
256
|
-
.resolves.toBe("node scripts/compile-agent-workflows.mjs\
|
|
256
|
+
.resolves.toBe("if git diff --cached --name-only -- .github | grep -q .; then\n node scripts/compile-agent-workflows.mjs\n git add -- .github/workflows/*.lock.yml\n [ ! -f .github/actions/actions-lock.json ] || git add -- .github/actions/actions-lock.json\nfi\n");
|
|
257
257
|
});
|
|
258
258
|
it("keeps existing pre-commit commands and appends the compiler once", async () => {
|
|
259
259
|
const repositoryPath = await createDirectory({ ".husky/pre-commit": "pnpm lint\n" });
|
|
260
260
|
await ensurePreCommitHook(repositoryPath);
|
|
261
261
|
await ensurePreCommitHook(repositoryPath);
|
|
262
262
|
await expect(readFile(join(repositoryPath, ".husky", "pre-commit"), "utf8"))
|
|
263
|
-
.resolves.toBe("pnpm lint\
|
|
263
|
+
.resolves.toBe("pnpm lint\nif git diff --cached --name-only -- .github | grep -q .; then\n node scripts/compile-agent-workflows.mjs\n git add -- .github/workflows/*.lock.yml\n [ ! -f .github/actions/actions-lock.json ] || git add -- .github/actions/actions-lock.json\nfi\n");
|
|
264
264
|
});
|
|
265
265
|
it("upgrades an existing compiler hook to stage generated locks", async () => {
|
|
266
266
|
const repositoryPath = await createDirectory({ ".husky/pre-commit": "node scripts/compile-agent-workflows.mjs\n" });
|
|
267
267
|
await ensurePreCommitHook(repositoryPath);
|
|
268
268
|
await expect(readFile(join(repositoryPath, ".husky", "pre-commit"), "utf8"))
|
|
269
|
-
.resolves.toContain("git
|
|
269
|
+
.resolves.toContain("if git diff --cached --name-only -- .github | grep -q .; then");
|
|
270
270
|
});
|
|
271
271
|
it("leaves consumer files untouched when staged workflow compilation fails", async () => {
|
|
272
272
|
const sourcePath = await createDirectory({
|
|
@@ -23,6 +23,7 @@ name: "Agent: Apply Review"
|
|
|
23
23
|
# Router-only worker. The Work Router owns triggers, classification, and rung 1-2 checks.
|
|
24
24
|
# This workflow receives the classified inputs and runs rung 3+.
|
|
25
25
|
imports:
|
|
26
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.86.2
|
|
26
27
|
- shared/platform-defaults.md
|
|
27
28
|
- shared/opencode-ci.md
|
|
28
29
|
|
|
@@ -24,6 +24,7 @@ name: "Agent: Audit"
|
|
|
24
24
|
# Shared: network policy only. This workflow owns its Safe Outputs and OpenCode configuration.
|
|
25
25
|
# permissions, engine, model and runs-on cannot be shared , see shared/platform-defaults.md.
|
|
26
26
|
imports:
|
|
27
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.86.2
|
|
27
28
|
- shared/platform-defaults.md
|
|
28
29
|
- shared/opencode-ci.md
|
|
29
30
|
|
|
@@ -28,6 +28,7 @@ name: "Agent: Implement Issue"
|
|
|
28
28
|
# Shared: network policy only. This workflow owns its Safe Outputs and OpenCode configuration.
|
|
29
29
|
# permissions, engine, model and runs-on cannot be shared , see shared/platform-defaults.md.
|
|
30
30
|
imports:
|
|
31
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.86.2
|
|
31
32
|
- shared/platform-defaults.md
|
|
32
33
|
- shared/opencode-ci.md
|
|
33
34
|
|
|
@@ -25,6 +25,7 @@ name: "Agent: Merge Gate"
|
|
|
25
25
|
# Router-only worker. The Work Router owns triggers, classification, and rung 1-2 checks.
|
|
26
26
|
# This workflow receives the classified inputs and runs rung 3+.
|
|
27
27
|
imports:
|
|
28
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.86.2
|
|
28
29
|
- shared/platform-defaults.md
|
|
29
30
|
- shared/opencode-ci.md
|
|
30
31
|
|
|
@@ -37,6 +37,7 @@ name: "Agent: Propose Feature"
|
|
|
37
37
|
# Shared: network policy only. This workflow owns its Safe Outputs and OpenCode configuration.
|
|
38
38
|
# permissions, engine, model and runs-on cannot be shared, see shared/platform-defaults.md.
|
|
39
39
|
imports:
|
|
40
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.86.2
|
|
40
41
|
- shared/platform-defaults.md
|
|
41
42
|
- shared/opencode-ci.md
|
|
42
43
|
|