refactor(agent): split runner, tools, output, types
This commit is contained in:
parent
c0e3dabf25
commit
5fdae53687
7 changed files with 104 additions and 70 deletions
15
src/agent/tools.ts
Normal file
15
src/agent/tools.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import type { AgentOptions } from "./types.js";
|
||||
import { getModel } from "@mariozechner/pi-ai";
|
||||
import { createCodingTools } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
export function resolveModel(options: AgentOptions) {
|
||||
if (options.provider && options.model) {
|
||||
return getModel(options.provider, options.model);
|
||||
}
|
||||
return getModel("kimi-coding", "kimi-k2-thinking");
|
||||
}
|
||||
|
||||
export function resolveTools(options: AgentOptions) {
|
||||
const cwd = options.cwd ?? process.cwd();
|
||||
return createCodingTools(cwd);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue