@h-rig/bundle-default-lifecycle 0.0.6-alpha.155 → 0.0.6-alpha.156
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/src/branch-naming.d.ts +15 -0
- package/dist/src/branch-naming.js +33 -0
- package/dist/src/cli.js +4 -4
- package/dist/src/closeoutEquivalence.d.ts +1 -1
- package/dist/src/control-plane/completion-verification.d.ts +19 -0
- package/dist/src/control-plane/completion-verification.js +1917 -0
- package/dist/src/control-plane/pr-automation.d.ts +87 -0
- package/dist/src/control-plane/pr-automation.js +638 -0
- package/dist/src/control-plane/task-verify.d.ts +1 -0
- package/dist/src/control-plane/task-verify.js +1484 -0
- package/dist/src/control-plane/verifier.d.ts +138 -0
- package/dist/src/control-plane/verifier.js +1478 -0
- package/dist/src/defaultPipeline.js +4 -4
- package/dist/src/index.js +2716 -54
- package/dist/src/native/closeout-runners.d.ts +5 -0
- package/dist/src/native/closeout-runners.js +41 -0
- package/dist/src/native/in-process-closeout.d.ts +40 -0
- package/dist/src/native/in-process-closeout.js +802 -0
- package/dist/src/pipelineCloseout.d.ts +1 -1
- package/dist/src/pipelineCloseout.js +2712 -52
- package/dist/src/plugin.d.ts +4 -17
- package/dist/src/plugin.js +2029 -25
- package/dist/src/stages/auto-merge.d.ts +1 -2
- package/dist/src/stages/auto-merge.js +657 -3
- package/dist/src/stages/commit.d.ts +1 -1
- package/dist/src/stages/commit.js +657 -3
- package/dist/src/stages/isolation.js +3 -2
- package/dist/src/stages/merge-gate.d.ts +1 -2
- package/dist/src/stages/merge-gate.js +1 -1
- package/dist/src/stages/open-pr.d.ts +2 -2
- package/dist/src/stages/open-pr.js +657 -3
- package/dist/src/stages/push.d.ts +1 -1
- package/dist/src/stages/push.js +657 -3
- package/dist/src/stages/source-closeout.d.ts +1 -1
- package/dist/src/stages/source-closeout.js +657 -3
- package/dist/src/stages/validate.d.ts +1 -1
- package/package.json +32 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/bundle-default-lifecycle/src/native/closeout-runners.ts
|
|
3
|
+
import { resolveGitHubAuthToken } from "@rig/runtime/control-plane/github/token-env";
|
|
4
|
+
function commandEnv(env) {
|
|
5
|
+
const token = resolveGitHubAuthToken(env);
|
|
6
|
+
return token ? { ...env, RIG_GITHUB_TOKEN: token, GH_TOKEN: token, GITHUB_TOKEN: token } : { ...env };
|
|
7
|
+
}
|
|
8
|
+
function createBunCommandRunner(binary, env) {
|
|
9
|
+
return async (args, options) => {
|
|
10
|
+
try {
|
|
11
|
+
const child = Bun.spawn([binary, ...args], {
|
|
12
|
+
cwd: options?.cwd,
|
|
13
|
+
env: commandEnv(env),
|
|
14
|
+
stdin: "ignore",
|
|
15
|
+
stdout: "pipe",
|
|
16
|
+
stderr: "pipe"
|
|
17
|
+
});
|
|
18
|
+
const [exitCode, stdout, stderr] = await Promise.all([
|
|
19
|
+
child.exited,
|
|
20
|
+
new Response(child.stdout).text(),
|
|
21
|
+
new Response(child.stderr).text()
|
|
22
|
+
]);
|
|
23
|
+
return { exitCode, stdout, stderr };
|
|
24
|
+
} catch (error) {
|
|
25
|
+
return {
|
|
26
|
+
exitCode: 1,
|
|
27
|
+
stdout: "",
|
|
28
|
+
stderr: error instanceof Error ? error.message : String(error)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function createEnvCloseoutRunners(env = process.env) {
|
|
34
|
+
return {
|
|
35
|
+
command: createBunCommandRunner("gh", env),
|
|
36
|
+
gitCommand: createBunCommandRunner("git", env)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
createEnvCloseoutRunners
|
|
41
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { JournalCapability, RunCloseoutPhase, RunCloseoutPhaseOutcome } from "@rig/contracts";
|
|
2
|
+
import type { GitCommandRunner, GitHubCommandRunner, RigAutomationConfig, StrictPrGreptileApiOptions } from "@rig/contracts";
|
|
3
|
+
export type RunTaskSourceReflectStatus = "under_review" | "ci_fixing" | "merging" | "closed" | "needs_attention";
|
|
4
|
+
export type InProcessCloseoutStatus = "merged" | "opened" | "skipped" | "needs-attention";
|
|
5
|
+
export type InProcessCloseoutResult = {
|
|
6
|
+
status: InProcessCloseoutStatus;
|
|
7
|
+
prUrl?: string;
|
|
8
|
+
iterations: number;
|
|
9
|
+
feedback: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
export type CloseoutValidationInput = {
|
|
12
|
+
projectRoot: string;
|
|
13
|
+
taskId: string;
|
|
14
|
+
};
|
|
15
|
+
export type CloseoutValidationRunner = (input: CloseoutValidationInput) => Promise<boolean> | boolean;
|
|
16
|
+
export declare class CloseoutValidationError extends Error {
|
|
17
|
+
readonly name = "CloseoutValidationError";
|
|
18
|
+
}
|
|
19
|
+
export type InProcessCloseoutInput = {
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
runId: string;
|
|
22
|
+
taskId: string;
|
|
23
|
+
branch: string;
|
|
24
|
+
workspace: string;
|
|
25
|
+
artifactRoot?: string | null;
|
|
26
|
+
config?: RigAutomationConfig | null;
|
|
27
|
+
sourceTask?: Record<string, unknown> | null;
|
|
28
|
+
command: GitHubCommandRunner;
|
|
29
|
+
gitCommand: GitCommandRunner;
|
|
30
|
+
steerPi: (message: string) => Promise<void>;
|
|
31
|
+
greptileApi?: StrictPrGreptileApiOptions;
|
|
32
|
+
runValidation?: CloseoutValidationRunner;
|
|
33
|
+
onValidationStart?: () => Promise<void> | void;
|
|
34
|
+
kernelJournal?: JournalCapability | null;
|
|
35
|
+
journalPhase: (phase: RunCloseoutPhase, outcome: RunCloseoutPhaseOutcome, detail?: string | null) => Promise<void> | void;
|
|
36
|
+
reflect: (status: RunTaskSourceReflectStatus, summary: string, options?: {
|
|
37
|
+
errorText?: string | null;
|
|
38
|
+
}) => Promise<void> | void;
|
|
39
|
+
};
|
|
40
|
+
export declare function runInProcessCloseout(input: InProcessCloseoutInput): Promise<InProcessCloseoutResult>;
|