@oisincoveney/pipeline 2.8.0 → 2.8.2
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/argo-submit.d.ts +2 -4
- package/dist/argo-submit.js +80 -80
- package/dist/cluster-doctor.js +89 -101
- package/dist/config/defaults.js +9 -19
- package/dist/config/load.js +32 -39
- package/dist/config/schemas.d.ts +1 -1
- package/dist/gates.js +6 -225
- package/dist/mcp/gateway-error.js +15 -0
- package/dist/mcp/gateway.js +119 -220
- package/dist/moka-global-config.js +20 -20
- package/dist/moka-submit.d.ts +1 -1
- package/dist/pipeline-runtime.js +580 -371
- package/dist/run-state/git-refs.js +124 -94
- package/dist/runner-command-contract.d.ts +2 -2
- package/dist/runner-event-sink.js +37 -69
- package/dist/runtime/agent-node/agent-node.js +214 -173
- package/dist/runtime/builtins/builtins.js +344 -57
- package/dist/runtime/changed-files/changed-files.js +15 -27
- package/dist/runtime/changed-files/index.js +2 -0
- package/dist/runtime/drain-merge/drain-merge.js +124 -82
- package/dist/runtime/gates/gates.js +46 -28
- package/dist/runtime/hooks/hooks.js +74 -29
- package/dist/runtime/opencode-server.js +27 -21
- package/dist/runtime/opencode-session-executor.js +101 -44
- package/dist/runtime/parallel-node/parallel-node.js +24 -5
- package/dist/runtime/select-candidate/select-candidate.js +45 -29
- package/dist/runtime/services/agent-node-runtime-service.js +15 -0
- package/dist/runtime/services/command-executor-service.js +8 -0
- package/dist/runtime/services/config-io-service.js +42 -0
- package/dist/runtime/services/drain-merge-git-service.js +10 -0
- package/dist/runtime/services/git-porcelain-service.js +38 -0
- package/dist/runtime/services/kubernetes-argo-service.d.ts +13 -0
- package/dist/runtime/services/kubernetes-argo-service.js +81 -0
- package/dist/runtime/services/mcp-gateway-service.js +184 -0
- package/dist/runtime/services/opencode-sdk-service.js +27 -0
- package/dist/runtime/services/runner-event-sink-http-service.js +80 -0
- package/dist/runtime/services/select-candidate-service.js +13 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PipelineConfigError } from "./config/schemas.js";
|
|
2
|
+
import { ConfigIoService, runConfigIoSync } from "./runtime/services/config-io-service.js";
|
|
2
3
|
import "./config.js";
|
|
3
|
-
import { parseDocument } from "yaml";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import {
|
|
5
|
+
import { Effect } from "effect";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
//#region src/moka-global-config.ts
|
|
@@ -30,27 +30,27 @@ function mokaGlobalConfigPath(homeDir = homedir()) {
|
|
|
30
30
|
}
|
|
31
31
|
function loadMokaGlobalConfig() {
|
|
32
32
|
const configPath = mokaGlobalConfigPath();
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
return runConfigIoSync(Effect.gen(function* () {
|
|
34
|
+
const source = yield* (yield* ConfigIoService).readOptionalText(configPath);
|
|
35
|
+
return source === null ? null : yield* parseMokaGlobalConfigEffect(source, configPath);
|
|
36
|
+
}));
|
|
35
37
|
}
|
|
36
38
|
function parseMokaGlobalConfig(source, sourcePath) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
return runConfigIoSync(parseMokaGlobalConfigEffect(source, sourcePath));
|
|
40
|
+
}
|
|
41
|
+
function parseMokaGlobalConfigEffect(source, sourcePath) {
|
|
42
|
+
return Effect.gen(function* () {
|
|
43
|
+
const yaml = yield* (yield* ConfigIoService).parseYaml(source, sourcePath);
|
|
44
|
+
const parsed = mokaGlobalConfigSchema.safeParse(yaml);
|
|
45
|
+
if (!parsed.success) {
|
|
46
|
+
const issues = parsed.error.issues.map((issue) => ({
|
|
47
|
+
path: issue.path.join("."),
|
|
48
|
+
message: issue.message
|
|
49
|
+
}));
|
|
50
|
+
return yield* Effect.fail(new PipelineConfigError("PIPELINE_CONFIG_VALIDATION_ERROR", [`Invalid ${sourcePath}:`, ...issues.map((issue) => issue.path ? `- ${issue.path}: ${issue.message}` : `- ${issue.message}`)].join("\n"), issues));
|
|
51
|
+
}
|
|
52
|
+
return parsed.data;
|
|
40
53
|
});
|
|
41
|
-
if (document.errors.length > 0) throw new PipelineConfigError("PIPELINE_CONFIG_PARSE_ERROR", `Failed to parse ${sourcePath}`, document.errors.map((err) => ({
|
|
42
|
-
message: err.message,
|
|
43
|
-
path: sourcePath
|
|
44
|
-
})));
|
|
45
|
-
const parsed = mokaGlobalConfigSchema.safeParse(document.toJS());
|
|
46
|
-
if (!parsed.success) {
|
|
47
|
-
const issues = parsed.error.issues.map((issue) => ({
|
|
48
|
-
path: issue.path.join("."),
|
|
49
|
-
message: issue.message
|
|
50
|
-
}));
|
|
51
|
-
throw new PipelineConfigError("PIPELINE_CONFIG_VALIDATION_ERROR", [`Invalid ${sourcePath}:`, ...issues.map((issue) => issue.path ? `- ${issue.path}: ${issue.message}` : `- ${issue.message}`)].join("\n"), issues);
|
|
52
|
-
}
|
|
53
|
-
return parsed.data;
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
export { MOKA_GLOBAL_CONFIG_PATH, loadMokaGlobalConfig, mokaGlobalConfigPath, mokaGlobalConfigSchema, parseMokaGlobalConfig };
|
package/dist/moka-submit.d.ts
CHANGED
|
@@ -160,8 +160,8 @@ declare const mokaSubmitOptionsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
160
160
|
}, z.core.$strict>>;
|
|
161
161
|
serviceAccountName: z.ZodOptional<z.ZodString>;
|
|
162
162
|
mode: z.ZodEnum<{
|
|
163
|
-
quick: "quick";
|
|
164
163
|
full: "full";
|
|
164
|
+
quick: "quick";
|
|
165
165
|
}>;
|
|
166
166
|
schedulePath: z.ZodOptional<z.ZodString>;
|
|
167
167
|
scheduleYaml: z.ZodOptional<z.ZodString>;
|