Line

You are reading the unreleased docs (next). See latest (v0.9)

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, next. Source: ui/server/src/writeVerbsApi.mjs.

Variables#

LLM_IN_PROCESS_NOTE#

const LLM_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:41

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; llmModel() names the installed model Settings picked for it, or a falsy value for the provider's own default; cli passes env, bin, timeoutMs, spawnImpl to the executor.

body?

any

cli?

any = {}

findRoot?

Function

inProcess

(argv) => Promise<any>

llmModel?

() => string = ...

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:80

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; llmModel() is the model Settings picked for it, or a falsy value for the provider's own default.

body?

any

cli?

any = {}

findRoot?

Function

inProcess

(argv) => Promise<any>

llmModel?

() => string = ...

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:61

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.