@oisincoveney/pipeline 1.22.4 → 1.22.6
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/defaults/opencode-ecosystem.yaml +9 -0
- package/dist/gates.js +59 -9
- package/package.json +1 -1
|
@@ -50,6 +50,15 @@ ecosystem_code:
|
|
|
50
50
|
role: OpenTelemetry plugin pattern for runtime observability
|
|
51
51
|
default_stack: true
|
|
52
52
|
source: https://www.npmjs.com/package/@devtheops/opencode-plugin-otel
|
|
53
|
+
- id: opencode-goal-plugin
|
|
54
|
+
name: opencode-goal-plugin
|
|
55
|
+
package: "@prevalentware/opencode-goal-plugin"
|
|
56
|
+
plugin:
|
|
57
|
+
kind: npm
|
|
58
|
+
package: "@prevalentware/opencode-goal-plugin"
|
|
59
|
+
role: Codex-style long-running goal mode with /goal slash command, persistent state, evidence-gated completion, and TUI sidebar
|
|
60
|
+
default_stack: true
|
|
61
|
+
source: https://www.npmjs.com/package/@prevalentware/opencode-goal-plugin
|
|
53
62
|
- id: opencode-snip
|
|
54
63
|
name: opencode-snip
|
|
55
64
|
role: prompt snippet and command-discipline helper patterns
|
package/dist/gates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseJson } from "./safe-json.js";
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, readFileSync, renameSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { execa } from "execa";
|
|
5
5
|
import { resolveCommand } from "package-manager-detector/commands";
|
|
@@ -33,16 +33,52 @@ function envCommand(envName) {
|
|
|
33
33
|
}
|
|
34
34
|
async function resolvePackageScript(worktreePath, scriptName) {
|
|
35
35
|
if (!readPackageScripts(worktreePath)[scriptName]) return null;
|
|
36
|
-
const resolved = resolveCommand(
|
|
37
|
-
cwd: worktreePath,
|
|
38
|
-
stopDir: worktreePath
|
|
39
|
-
}))?.agent ?? "npm", "run", [scriptName]);
|
|
36
|
+
const resolved = resolveCommand(await detectPackageManagerAgent(worktreePath), "run", [scriptName]);
|
|
40
37
|
if (!resolved) return null;
|
|
41
38
|
return {
|
|
42
39
|
command: resolved.command,
|
|
43
40
|
args: resolved.args
|
|
44
41
|
};
|
|
45
42
|
}
|
|
43
|
+
async function detectPackageManagerAgent(worktreePath) {
|
|
44
|
+
return (await detect({
|
|
45
|
+
cwd: worktreePath,
|
|
46
|
+
stopDir: worktreePath
|
|
47
|
+
}))?.agent ?? "npm";
|
|
48
|
+
}
|
|
49
|
+
async function resolvePackageBinaryCommand(worktreePath, binary, args) {
|
|
50
|
+
if (!existsSync(join(worktreePath, "package.json"))) return null;
|
|
51
|
+
switch (await detectPackageManagerAgent(worktreePath)) {
|
|
52
|
+
case "bun": return {
|
|
53
|
+
command: "bun",
|
|
54
|
+
args: [
|
|
55
|
+
"x",
|
|
56
|
+
binary,
|
|
57
|
+
...args
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
case "pnpm": return {
|
|
61
|
+
command: "pnpm",
|
|
62
|
+
args: [
|
|
63
|
+
"exec",
|
|
64
|
+
binary,
|
|
65
|
+
...args
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
case "yarn": return {
|
|
69
|
+
command: "yarn",
|
|
70
|
+
args: [
|
|
71
|
+
"exec",
|
|
72
|
+
binary,
|
|
73
|
+
...args
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
default: return {
|
|
77
|
+
command: "npx",
|
|
78
|
+
args: [binary, ...args]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
46
82
|
async function runTests(worktreePath, signal) {
|
|
47
83
|
const projectCommand = envCommand("PIPELINE_TEST_COMMAND") ?? await resolvePackageScript(worktreePath, "test");
|
|
48
84
|
if (!projectCommand) return {
|
|
@@ -70,15 +106,16 @@ async function runLint(worktreePath, signal) {
|
|
|
70
106
|
exitCode: 0,
|
|
71
107
|
output: "skipped"
|
|
72
108
|
};
|
|
73
|
-
return await runProjectCommand(projectCommand, worktreePath, signal);
|
|
109
|
+
return await runProjectCommand(projectCommand, worktreePath, signal, { hidePipelineRuns: true });
|
|
74
110
|
}
|
|
75
111
|
async function runFallow(worktreePath, signal) {
|
|
76
|
-
return runProjectCommand(envCommand("PIPELINE_FALLOW_COMMAND") ?? await resolvePackageScript(worktreePath, "fallow") ?? {
|
|
112
|
+
return runProjectCommand(envCommand("PIPELINE_FALLOW_COMMAND") ?? await resolvePackageScript(worktreePath, "fallow") ?? await resolvePackageBinaryCommand(worktreePath, "fallow", ["audit"]) ?? {
|
|
77
113
|
args: ["audit"],
|
|
78
114
|
command: "fallow"
|
|
79
|
-
}, worktreePath, signal);
|
|
115
|
+
}, worktreePath, signal, { hidePipelineRuns: true });
|
|
80
116
|
}
|
|
81
|
-
async function runProjectCommand(projectCommand, worktreePath, signal) {
|
|
117
|
+
async function runProjectCommand(projectCommand, worktreePath, signal, options) {
|
|
118
|
+
const hiddenRuns = options?.hidePipelineRuns ? hidePipelineRunsDirectory(worktreePath) : null;
|
|
82
119
|
try {
|
|
83
120
|
const result = await execa(projectCommand.command, projectCommand.args, {
|
|
84
121
|
cancelSignal: signal,
|
|
@@ -98,8 +135,21 @@ async function runProjectCommand(projectCommand, worktreePath, signal) {
|
|
|
98
135
|
exitCode: e.exitCode ?? 1,
|
|
99
136
|
output: commandErrorOutput(e)
|
|
100
137
|
};
|
|
138
|
+
} finally {
|
|
139
|
+
hiddenRuns?.restore();
|
|
101
140
|
}
|
|
102
141
|
}
|
|
142
|
+
function hidePipelineRunsDirectory(worktreePath) {
|
|
143
|
+
const pipelineDir = join(worktreePath, ".pipeline");
|
|
144
|
+
const runsDir = join(pipelineDir, "runs");
|
|
145
|
+
if (!existsSync(runsDir)) return null;
|
|
146
|
+
const hiddenRunsDir = join(pipelineDir, `.runs-hidden-${process.pid}-${Date.now()}`);
|
|
147
|
+
renameSync(runsDir, hiddenRunsDir);
|
|
148
|
+
return { restore: () => {
|
|
149
|
+
if (!existsSync(hiddenRunsDir)) return;
|
|
150
|
+
renameSync(hiddenRunsDir, runsDir);
|
|
151
|
+
} };
|
|
152
|
+
}
|
|
103
153
|
function commandError(err) {
|
|
104
154
|
return err;
|
|
105
155
|
}
|
package/package.json
CHANGED
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"prepack": "bun run build:cli"
|
|
112
112
|
},
|
|
113
113
|
"type": "module",
|
|
114
|
-
"version": "1.22.
|
|
114
|
+
"version": "1.22.6",
|
|
115
115
|
"description": "Config-driven multi-agent pipeline runner for repository work",
|
|
116
116
|
"main": "./dist/index.js",
|
|
117
117
|
"types": "./dist/index.d.ts",
|