ui/server/src/researchApi
POST /api/research (the Cockpit's read-only "research" actions: summarize and doctor) honouring the project's project.execution.mode.
Cockpit server, v0.9. Source: ui/server/src/researchApi.mjs.
Variables#
NO_JSON_CONTRACT_NOTE#
constNO_JSON_CONTRACT_NOTE:"This view has no --format json contract in the CLI, so it ran in-process even though the project asks for cli mode."='This view has no --format json contract in the CLI, so it ran in-process even though the project asks for cli mode.'
Defined in: ui/server/src/researchApi.mjs:16
Functions#
executionFor()#
executionFor(
projectDir,findRoot?):object
Defined in: ui/server/src/researchApi.mjs:26
The execution mode and the contained root for the open project.
Parameters#
projectDir
string
The open project's directory (settings), or null.
findRoot?
(dir) => string
Derives the contained project root (default: projectGuard's).
Returns#
object
error is set (and mode is 'engine') when
architecture.yml is unreadable or names an unknown mode: the user's to fix, so the route answers 400.
error?
optionalerror?:string
mode
mode:
"engine"|"cli"
root
root:
string
handleResearch()#
handleResearch(
ctx):Promise<{body:any;status:number; }>
Defined in: ui/server/src/researchApi.mjs:44
Handle one /api/research request.
Parameters#
ctx
inProcess(args) runs the in-process path and returns runCapturing's result; cli passes env, bin,
timeoutMs or spawnImpl to the executor (tests).
body?
any
cli?
any = {}
findRoot?
Function
inProcess
(args) => Promise<any>
projectDir
string
Returns#
Promise<{ body: any; status: number; }>
The HTTP status and JSON body.