ui/server/src/writeVerbsApi
POST /api/create, /api/refactor and /api/import honouring the project's project.execution.mode (the routes in index.mjs are thin calls into these handlers; research is researchApi.mjs).
Cockpit server, v0.9. Source: ui/server/src/writeVerbsApi.mjs.
Variables#
LLM_IN_PROCESS_NOTE#
constLLM_IN_PROCESS_NOTE:"A model call runs in the Cockpit server (it holds the provider keys), so this request ran in-process even though the project asks for cli mode."='A model call runs in the Cockpit server (it holds the provider keys), so this request ran in-process even though the project asks for cli mode.'
Defined in: ui/server/src/writeVerbsApi.mjs:18
Functions#
handleCreate()#
handleCreate(
ctx):Promise<{body:any;status:number; }>
Defined in: ui/server/src/writeVerbsApi.mjs:40
Handle one /api/create request.
Parameters#
ctx
inProcess(argv) runs the in-process path (runCapturing) and returns its result; llmProvider() names the
provider Settings picked for create's fill; cli passes env, bin, timeoutMs, spawnImpl to the executor.
body?
any
cli?
any = {}
findRoot?
Function
inProcess
(argv) => Promise<any>
llmProvider?
() => string = ...
projectDir
string
Returns#
Promise<{ body: any; status: number; }>
The HTTP status and JSON body.
handleImport()#
handleImport(
ctx):Promise<{body:any;status:number; }>
Defined in: ui/server/src/writeVerbsApi.mjs:77
Handle one /api/import request.
Parameters#
ctx
As handleCreate, plus resolveRead (workspace containment for from and planPath; may throw) and mapError
(turns what it throws into a status and body); llmProvider() is the provider Settings picked for import's fill.
body?
any
cli?
any = {}
findRoot?
Function
inProcess
(argv) => Promise<any>
llmProvider?
() => string = ...
mapError
(e) => object
projectDir
string
resolveRead
(value) => string
Returns#
Promise<{ body: any; status: number; }>
The HTTP status and JSON body.
handleRefactor()#
handleRefactor(
ctx):Promise<{body:any;status:number; }>
Defined in: ui/server/src/writeVerbsApi.mjs:59
Handle one /api/refactor request.
Parameters#
ctx
As handleCreate.
body?
any
cli?
any = {}
findRoot?
Function
inProcess
(argv) => Promise<any>
projectDir
string
Returns#
Promise<{ body: any; status: number; }>
The HTTP status and JSON body.