@oisincoveney/pipeline 3.11.17 → 3.11.18
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-workflow.js +3 -4
- package/dist/hooks.d.ts +1 -1
- package/dist/moka-submit.d.ts +6 -6
- package/dist/run-state/opencode-accounts.js +34 -16
- package/dist/runner-command/run.js +6 -6
- package/dist/runner-event-schema.d.ts +8 -8
- package/dist/runtime/services/runner-command-io-service.js +3 -3
- package/package.json +1 -1
package/dist/argo-workflow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compileArgoExecutionGraph } from "./argo-graph.js";
|
|
2
|
-
import { OPENCODE_OPENAI_ACCOUNTS_STAGING_DIR } from "./run-state/opencode-accounts.js";
|
|
2
|
+
import { OPENCODE_AUTH_STAGING_DIR, OPENCODE_OPENAI_ACCOUNTS_STAGING_DIR } from "./run-state/opencode-accounts.js";
|
|
3
3
|
import { DEFAULT_RUNNER_TASK_DESCRIPTOR_PATH } from "./runner-command/task-descriptor.js";
|
|
4
4
|
import { stringify } from "yaml";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -303,10 +303,9 @@ function runnerWorkflowStorage(options, tasks) {
|
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
volumeMounts.push({
|
|
306
|
-
mountPath:
|
|
306
|
+
mountPath: OPENCODE_AUTH_STAGING_DIR,
|
|
307
307
|
name: "opencode-auth",
|
|
308
|
-
readOnly: true
|
|
309
|
-
subPath: "auth.json"
|
|
308
|
+
readOnly: true
|
|
310
309
|
});
|
|
311
310
|
}
|
|
312
311
|
if (options.opencodeOpenaiAccountsSecret) {
|
package/dist/hooks.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ declare const hookResultSchema: z.ZodObject<{
|
|
|
13
13
|
taskContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
14
|
}, z.core.$strict>>;
|
|
15
15
|
status: z.ZodEnum<{
|
|
16
|
-
fail: "fail";
|
|
17
16
|
pass: "pass";
|
|
17
|
+
fail: "fail";
|
|
18
18
|
skip: "skip";
|
|
19
19
|
}>;
|
|
20
20
|
summary: z.ZodOptional<z.ZodString>;
|
package/dist/moka-submit.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ import { z } from "zod";
|
|
|
5
5
|
//#region src/moka-submit.d.ts
|
|
6
6
|
declare const mokaSubmitDirectHooksSchema: z.ZodRecord<z.ZodEnum<{
|
|
7
7
|
"workflow.start": "workflow.start";
|
|
8
|
-
"node.finish": "node.finish";
|
|
9
|
-
"node.start": "node.start";
|
|
10
8
|
"workflow.success": "workflow.success";
|
|
11
9
|
"workflow.failure": "workflow.failure";
|
|
12
10
|
"workflow.complete": "workflow.complete";
|
|
11
|
+
"node.start": "node.start";
|
|
13
12
|
"node.success": "node.success";
|
|
14
13
|
"node.error": "node.error";
|
|
14
|
+
"node.finish": "node.finish";
|
|
15
15
|
"gate.failure": "gate.failure";
|
|
16
16
|
}> & z.core.$partial, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
17
|
failure: z.ZodDefault<z.ZodEnum<{
|
|
@@ -94,13 +94,13 @@ declare const mokaSubmitOptionsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
94
94
|
}, z.core.$strict>>;
|
|
95
95
|
hooks: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
96
96
|
"workflow.start": "workflow.start";
|
|
97
|
-
"node.finish": "node.finish";
|
|
98
|
-
"node.start": "node.start";
|
|
99
97
|
"workflow.success": "workflow.success";
|
|
100
98
|
"workflow.failure": "workflow.failure";
|
|
101
99
|
"workflow.complete": "workflow.complete";
|
|
100
|
+
"node.start": "node.start";
|
|
102
101
|
"node.success": "node.success";
|
|
103
102
|
"node.error": "node.error";
|
|
103
|
+
"node.finish": "node.finish";
|
|
104
104
|
"gate.failure": "gate.failure";
|
|
105
105
|
}> & z.core.$partial, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
106
|
failure: z.ZodDefault<z.ZodEnum<{
|
|
@@ -207,13 +207,13 @@ declare const mokaSubmitOptionsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
207
207
|
}, z.core.$strict>>;
|
|
208
208
|
hooks: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
209
209
|
"workflow.start": "workflow.start";
|
|
210
|
-
"node.finish": "node.finish";
|
|
211
|
-
"node.start": "node.start";
|
|
212
210
|
"workflow.success": "workflow.success";
|
|
213
211
|
"workflow.failure": "workflow.failure";
|
|
214
212
|
"workflow.complete": "workflow.complete";
|
|
213
|
+
"node.start": "node.start";
|
|
215
214
|
"node.success": "node.success";
|
|
216
215
|
"node.error": "node.error";
|
|
216
|
+
"node.finish": "node.finish";
|
|
217
217
|
"gate.failure": "gate.failure";
|
|
218
218
|
}> & z.core.$partial, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
219
|
failure: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
import { chmodSync, copyFileSync, existsSync, mkdirSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
3
|
+
import { basename, dirname, join } from "node:path";
|
|
4
4
|
//#region src/run-state/opencode-accounts.ts
|
|
5
5
|
const OPENCODE_OPENAI_ACCOUNTS_STAGING_DIR = "/etc/pipeline/opencode-openai-accounts";
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const OPENCODE_AUTH_STAGING_DIR = "/etc/pipeline/opencode-auth";
|
|
7
|
+
const WRITABLE_OPENCODE_CREDENTIAL_FILES = [{
|
|
8
|
+
destFromHome: [".opencode", "oc-codex-multi-auth-accounts.json"],
|
|
9
|
+
stagedPath: join(OPENCODE_OPENAI_ACCOUNTS_STAGING_DIR, "accounts.json")
|
|
10
|
+
}, {
|
|
11
|
+
destFromHome: [
|
|
12
|
+
".local",
|
|
13
|
+
"share",
|
|
14
|
+
"opencode",
|
|
15
|
+
"auth.json"
|
|
16
|
+
],
|
|
17
|
+
stagedPath: join(OPENCODE_AUTH_STAGING_DIR, "auth.json")
|
|
18
|
+
}];
|
|
8
19
|
/**
|
|
9
|
-
* Copy
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
20
|
+
* Copy each staged opencode credential secret to its writable live path so the
|
|
21
|
+
* plugin can rewrite tokens. Only files whose staged source exists are copied
|
|
22
|
+
* (local dev / tests / configs without a given secret keep whatever store is
|
|
23
|
+
* already present). Returns the basenames copied, for run-log evidence.
|
|
13
24
|
*/
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
function prepareOpencodeCredentials(options = {}) {
|
|
26
|
+
const home = homedir();
|
|
27
|
+
const files = options.files ?? WRITABLE_OPENCODE_CREDENTIAL_FILES.map((file) => ({
|
|
28
|
+
destPath: join(home, ...file.destFromHome),
|
|
29
|
+
stagedPath: file.stagedPath
|
|
30
|
+
}));
|
|
31
|
+
const copied = [];
|
|
32
|
+
for (const { stagedPath, destPath } of files) {
|
|
33
|
+
if (!existsSync(stagedPath)) continue;
|
|
34
|
+
mkdirSync(dirname(destPath), { recursive: true });
|
|
35
|
+
copyFileSync(stagedPath, destPath);
|
|
36
|
+
chmodSync(destPath, 384);
|
|
37
|
+
copied.push(basename(destPath));
|
|
38
|
+
}
|
|
39
|
+
return { copied };
|
|
22
40
|
}
|
|
23
41
|
//#endregion
|
|
24
|
-
export { OPENCODE_OPENAI_ACCOUNTS_STAGING_DIR,
|
|
42
|
+
export { OPENCODE_AUTH_STAGING_DIR, OPENCODE_OPENAI_ACCOUNTS_STAGING_DIR, prepareOpencodeCredentials };
|
|
@@ -101,15 +101,15 @@ function runRunnerCommandEffect(options, runtime) {
|
|
|
101
101
|
status: "finish"
|
|
102
102
|
}, "git.workspace.prepare finish");
|
|
103
103
|
logger.info({
|
|
104
|
-
phase: "opencode.
|
|
104
|
+
phase: "opencode.credentials.prepare",
|
|
105
105
|
status: "start"
|
|
106
|
-
}, "opencode.
|
|
107
|
-
const
|
|
106
|
+
}, "opencode.credentials.prepare start");
|
|
107
|
+
const credentialsPrep = yield* io.prepareOpencodeCredentials();
|
|
108
108
|
logger.info({
|
|
109
|
-
copied:
|
|
110
|
-
phase: "opencode.
|
|
109
|
+
copied: credentialsPrep.copied,
|
|
110
|
+
phase: "opencode.credentials.prepare",
|
|
111
111
|
status: "finish"
|
|
112
|
-
}, "opencode.
|
|
112
|
+
}, "opencode.credentials.prepare finish");
|
|
113
113
|
logger.info({
|
|
114
114
|
phase: "config.load",
|
|
115
115
|
status: "start"
|
|
@@ -11,8 +11,8 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
11
11
|
runId: z.ZodString;
|
|
12
12
|
sequence: z.ZodNumber;
|
|
13
13
|
type: z.ZodEnum<{
|
|
14
|
-
"workflow.planned": "workflow.planned";
|
|
15
14
|
"workflow.start": "workflow.start";
|
|
15
|
+
"workflow.planned": "workflow.planned";
|
|
16
16
|
}>;
|
|
17
17
|
workflowPlan: z.ZodObject<{
|
|
18
18
|
edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -58,10 +58,10 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
58
58
|
}>;
|
|
59
59
|
}, z.core.$strip>;
|
|
60
60
|
type: z.ZodEnum<{
|
|
61
|
+
"node.start": "node.start";
|
|
62
|
+
"node.finish": "node.finish";
|
|
61
63
|
"agent.finish": "agent.finish";
|
|
62
64
|
"agent.start": "agent.start";
|
|
63
|
-
"node.finish": "node.finish";
|
|
64
|
-
"node.start": "node.start";
|
|
65
65
|
}>;
|
|
66
66
|
}, z.core.$strip>, z.ZodObject<{
|
|
67
67
|
at: z.ZodOptional<z.ZodString>;
|
|
@@ -108,8 +108,8 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
108
108
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
109
109
|
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
110
110
|
status: z.ZodEnum<{
|
|
111
|
-
fail: "fail";
|
|
112
111
|
pass: "pass";
|
|
112
|
+
fail: "fail";
|
|
113
113
|
skip: "skip";
|
|
114
114
|
}>;
|
|
115
115
|
summary: z.ZodOptional<z.ZodString>;
|
|
@@ -189,8 +189,8 @@ declare const runnerEventBatchSchema: z.ZodObject<{
|
|
|
189
189
|
runId: z.ZodString;
|
|
190
190
|
sequence: z.ZodNumber;
|
|
191
191
|
type: z.ZodEnum<{
|
|
192
|
-
"workflow.planned": "workflow.planned";
|
|
193
192
|
"workflow.start": "workflow.start";
|
|
193
|
+
"workflow.planned": "workflow.planned";
|
|
194
194
|
}>;
|
|
195
195
|
workflowPlan: z.ZodObject<{
|
|
196
196
|
edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -236,10 +236,10 @@ declare const runnerEventBatchSchema: z.ZodObject<{
|
|
|
236
236
|
}>;
|
|
237
237
|
}, z.core.$strip>;
|
|
238
238
|
type: z.ZodEnum<{
|
|
239
|
+
"node.start": "node.start";
|
|
240
|
+
"node.finish": "node.finish";
|
|
239
241
|
"agent.finish": "agent.finish";
|
|
240
242
|
"agent.start": "agent.start";
|
|
241
|
-
"node.finish": "node.finish";
|
|
242
|
-
"node.start": "node.start";
|
|
243
243
|
}>;
|
|
244
244
|
}, z.core.$strip>, z.ZodObject<{
|
|
245
245
|
at: z.ZodOptional<z.ZodString>;
|
|
@@ -286,8 +286,8 @@ declare const runnerEventBatchSchema: z.ZodObject<{
|
|
|
286
286
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
287
287
|
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
288
288
|
status: z.ZodEnum<{
|
|
289
|
-
fail: "fail";
|
|
290
289
|
pass: "pass";
|
|
290
|
+
fail: "fail";
|
|
291
291
|
skip: "skip";
|
|
292
292
|
}>;
|
|
293
293
|
summary: z.ZodOptional<z.ZodString>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { prepareOpencodeCredentials } from "../../run-state/opencode-accounts.js";
|
|
2
2
|
import { commitAndPushNodeRef, mergeDependencyRefs, prepareRunnerGitWorkspace, promoteFinalRef } from "../../run-state/git-refs.js";
|
|
3
3
|
import { runScheduledWorkflowTask } from "../../pipeline-runtime.js";
|
|
4
4
|
import { resolveRunnerEventSinkAuthToken } from "../../runner-command-contract.js";
|
|
@@ -46,8 +46,8 @@ const RunnerCommandIoServiceLive = Layer.succeed(RunnerCommandIoService, {
|
|
|
46
46
|
try: () => mergeDependencyRefs(options),
|
|
47
47
|
catch: (error) => error
|
|
48
48
|
}),
|
|
49
|
-
|
|
50
|
-
try: () =>
|
|
49
|
+
prepareOpencodeCredentials: () => Effect.try({
|
|
50
|
+
try: () => prepareOpencodeCredentials(),
|
|
51
51
|
catch: (error) => error
|
|
52
52
|
}),
|
|
53
53
|
prepareRunnerGitWorkspace: (payload, options) => Effect.tryPromise({
|
package/package.json
CHANGED
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"prepack": "bun run build:cli"
|
|
129
129
|
},
|
|
130
130
|
"type": "module",
|
|
131
|
-
"version": "3.11.
|
|
131
|
+
"version": "3.11.18",
|
|
132
132
|
"description": "Config-driven multi-agent pipeline runner for repository work",
|
|
133
133
|
"main": "./dist/index.js",
|
|
134
134
|
"types": "./dist/index.d.ts",
|