c05fac746c
- workflow-agent-cursor: workspace config now optional (string | null)
- When null, uses LLM call to extract workspace path from AgentContext
(previous steps' meta, start prompt) before spawning cursor-agent CLI
- Requires llmProvider when workspace is null
- develop bundle-entry: switched from hermes to cursor agent for all roles
- solve-issue bundle-entry: created, developer role uses workflowAsAgent('develop'),
preparer/submitter remain hermes
小橘 <xiaoju@shazhou.work>
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
/**
|
|
* develop bundle entry — 小橘 🍊
|
|
*
|
|
* All roles use cursor-agent with workspace auto-extracted from context.
|
|
*/
|
|
import { createCursorAgent } from "@uncaged/workflow-agent-cursor";
|
|
import { createWorkflow } from "@uncaged/workflow-runtime";
|
|
import { buildDevelopDescriptor, developWorkflowDefinition } from "./src/index.js";
|
|
|
|
function requireEnv(name: string): string {
|
|
const value = process.env[name];
|
|
if (value === undefined || value === "") {
|
|
throw new Error(`missing required env var: ${name}`);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function optionalEnv(name: string): string | null {
|
|
const value = process.env[name];
|
|
if (value === undefined || value === "") {
|
|
return null;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
const llmProvider = {
|
|
baseUrl:
|
|
optionalEnv("WORKFLOW_LLM_BASE_URL") ?? "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
apiKey: requireEnv("WORKFLOW_LLM_API_KEY"),
|
|
model: optionalEnv("WORKFLOW_LLM_MODEL") ?? "qwen-plus",
|
|
};
|
|
|
|
const agent = createCursorAgent({
|
|
model: optionalEnv("WORKFLOW_CURSOR_MODEL"),
|
|
timeout: optionalEnv("WORKFLOW_CURSOR_TIMEOUT")
|
|
? Number(optionalEnv("WORKFLOW_CURSOR_TIMEOUT"))
|
|
: 0,
|
|
workspace: null,
|
|
llmProvider,
|
|
});
|
|
|
|
const wf = createWorkflow(developWorkflowDefinition, { agent, overrides: null });
|
|
|
|
export const descriptor = buildDevelopDescriptor();
|
|
export const run = wf;
|