chore(workflow): auto-generated commit
This commit is contained in:
parent
d786827ac8
commit
64a5fc5301
@ -1,14 +1,14 @@
|
||||
import { join } from "node:path";
|
||||
import type { WorkflowMessage } from "@uncaged/nerve-core";
|
||||
|
||||
export type SolveIssueParse = {
|
||||
type SolveIssueParse = {
|
||||
host: string;
|
||||
owner: string;
|
||||
repo: string;
|
||||
number: number;
|
||||
};
|
||||
|
||||
export type SolveIssueRepo = {
|
||||
type SolveIssueRepo = {
|
||||
path: string;
|
||||
defaultBranch: string;
|
||||
packageManager: string;
|
||||
@ -33,7 +33,7 @@ function extractMarkedSection(text: string, marker: string): Record<string, stri
|
||||
return Object.keys(rec).length > 0 ? rec : null;
|
||||
}
|
||||
|
||||
export function parseSolveIssueParse(text: string): SolveIssueParse | null {
|
||||
function parseSolveIssueParse(text: string): SolveIssueParse | null {
|
||||
const rec = extractMarkedSection(text, "SOLVE_ISSUE_PARSE");
|
||||
if (rec === null) {
|
||||
return null;
|
||||
@ -48,7 +48,7 @@ export function parseSolveIssueParse(text: string): SolveIssueParse | null {
|
||||
return { host, owner, repo, number: num };
|
||||
}
|
||||
|
||||
export function parseSolveIssueRepo(text: string): SolveIssueRepo | null {
|
||||
function parseSolveIssueRepo(text: string): SolveIssueRepo | null {
|
||||
const rec = extractMarkedSection(text, "SOLVE_ISSUE_REPO");
|
||||
if (rec === null) {
|
||||
return null;
|
||||
@ -84,27 +84,3 @@ export function resolveRepoCwd(messages: WorkflowMessage[]): string | null {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function lastParseFromMessages(messages: WorkflowMessage[]): SolveIssueParse | null {
|
||||
for (let i = messages.length - 1; i >= 0; i--) {
|
||||
if (messages[i].role === "read-issue") {
|
||||
const parsed = parseSolveIssueParse(messages[i].content);
|
||||
if (parsed !== null) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function lastRepoFromMessages(messages: WorkflowMessage[]): SolveIssueRepo | null {
|
||||
for (let i = messages.length - 1; i >= 0; i--) {
|
||||
if (messages[i].role === "prepare") {
|
||||
const repo = parseSolveIssueRepo(messages[i].content);
|
||||
if (repo !== null) {
|
||||
return repo;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
import type { StartStep } from "@uncaged/nerve-core";
|
||||
|
||||
/** Runtime may include threadId before types catch up in published nerve-core. */
|
||||
export function threadIdFromStart(start: StartStep): string {
|
||||
const m = start.meta as { threadId?: string };
|
||||
return typeof m.threadId === "string" && m.threadId.length > 0 ? m.threadId : "unknown";
|
||||
}
|
||||
@ -3,7 +3,6 @@ import type { LlmProvider } from "@uncaged/nerve-workflow-utils";
|
||||
import { createCursorRole } from "@uncaged/nerve-workflow-utils";
|
||||
import { z } from "zod";
|
||||
import { resolveRepoCwd } from "../../lib/repo-context.js";
|
||||
import { threadIdFromStart } from "../../lib/start-meta.js";
|
||||
import { buildImplementPrompt } from "./prompt.js";
|
||||
|
||||
export const implementMetaSchema = z.object({
|
||||
@ -32,7 +31,11 @@ export function buildImplementRole({ provider, nerveRoot }: BuildImplementDeps):
|
||||
model: "auto",
|
||||
env: {},
|
||||
timeoutMs: 300_000,
|
||||
prompt: async () => buildImplementPrompt({ threadId: threadIdFromStart(start), nerveRoot }),
|
||||
prompt: async () =>
|
||||
buildImplementPrompt({
|
||||
threadId: (start.meta as { threadId?: string }).threadId ?? "unknown",
|
||||
nerveRoot,
|
||||
}),
|
||||
extract: { provider, schema: implementMetaSchema },
|
||||
});
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ import type { LlmProvider } from "@uncaged/nerve-workflow-utils";
|
||||
import { createCursorRole } from "@uncaged/nerve-workflow-utils";
|
||||
import { z } from "zod";
|
||||
import { resolveRepoCwd } from "../../lib/repo-context.js";
|
||||
import { threadIdFromStart } from "../../lib/start-meta.js";
|
||||
import { buildPlanPrompt } from "./prompt.js";
|
||||
|
||||
export const planMetaSchema = z.object({
|
||||
@ -32,7 +31,11 @@ export function buildPlanRole({ provider, nerveRoot }: BuildPlanDeps): Role<Plan
|
||||
model: "auto",
|
||||
env: {},
|
||||
timeoutMs: 300_000,
|
||||
prompt: async () => buildPlanPrompt({ threadId: threadIdFromStart(start), nerveRoot }),
|
||||
prompt: async () =>
|
||||
buildPlanPrompt({
|
||||
threadId: (start.meta as { threadId?: string }).threadId ?? "unknown",
|
||||
nerveRoot,
|
||||
}),
|
||||
extract: { provider, schema: planMetaSchema },
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user