buildContext() hardcoded vibnApiUrl='http://localhost:3000' and mcpToken='', so every agent tool call (projects_list, workspace_describe, apps_list, ...) fetched the runner itself on a dead port and failed with 'fetch failed'. Now /agent/execute reads mcpToken from the request body and sets ctx.vibnApiUrl (from VIBN_API_URL), ctx.mcpToken, and ctx.projectId before running the agent.
29 lines
907 B
TypeScript
29 lines
907 B
TypeScript
/**
|
|
* agent-session-runner.ts
|
|
*
|
|
* Upgraded Cloud Agent Executor for VibnCode.
|
|
* Implements 4-level Smart Concurrency (parallel reads/lookups) and the
|
|
* Ralph Loop (autonomous self-correction) entirely inside your secure Cloud VM.
|
|
*/
|
|
import { AgentConfig } from "./agents";
|
|
import { ToolContext } from "./tools";
|
|
export interface OutputLine {
|
|
ts: string;
|
|
type: "step" | "stdout" | "stderr" | "info" | "error" | "done";
|
|
text: string;
|
|
}
|
|
export interface SessionRunOptions {
|
|
sessionId: string;
|
|
projectId: string;
|
|
vibnApiUrl: string;
|
|
appPath: string;
|
|
repoRoot?: string;
|
|
isStopped: () => boolean;
|
|
autoApprove?: boolean;
|
|
giteaRepo?: string;
|
|
coolifyAppUuid?: string;
|
|
coolifyApiUrl?: string;
|
|
coolifyApiToken?: string;
|
|
}
|
|
export declare function runSessionAgent(config: AgentConfig, task: string, ctx: ToolContext, opts: SessionRunOptions): Promise<void>;
|