Line

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

ui/client/features/spec-breakdown/services/SpecBreakdownApi

(R6) -- talks to POST /api/research (action spec, researchApi.mjs) and POST /api/create (a function row's "Fill with AI", the same create.unit block every other Cockpit screen uses, ).

Cockpit client (features), next. Source: ui/client/features/spec-breakdown/services/SpecBreakdownApi.ts.

Functions#

fillFunctionWithAi()#

fillFunctionWithAi(name, feature): Promise<CreateBody & object>

Defined in: ui/client/features/spec-breakdown/services/SpecBreakdownApi.ts:73

A function row's "Fill with AI": construct create service <name> --feature <feature> --llm <provider> (create.unit, docs/BLOCK-CONTRACT.md) -- the same generic, already-shipped path the Dashboard's Create form uses, scoped to the one function this row is about. Refused (never overwritten) when the file already exists, e.g. because "Generate" (mechanical) already wrote it.

Parameters#

name

string

feature

string

Returns#

Promise<CreateBody & object>


generateSpec()#

generateSpec(file, feature?): Promise<RunGenerate>

Defined in: ui/client/features/spec-breakdown/services/SpecBreakdownApi.ts:45

Mechanical generation: the state union, machine, function stubs and locked test, written once, never overwriting an existing file. Refused, with the violation report, when the spec is not accepted.

Parameters#

file

string

feature?

string

Returns#

Promise<RunGenerate>


loadReadBack()#

loadReadBack(file): Promise<LoadReadBack>

Defined in: ui/client/features/spec-breakdown/services/SpecBreakdownApi.ts:37

The read-back (plain English per requirement sentence, ) of an ACCEPTED spec. Refused, with the report's own reason, when the spec has violations -- same as the CLI's --read-back.

Parameters#

file

string

Returns#

Promise<LoadReadBack>


loadSpecReport()#

loadSpecReport(file): Promise<LoadReport>

Defined in: ui/client/features/spec-breakdown/services/SpecBreakdownApi.ts:29

The validation report ({status, counts, violations}) for a machine-spec.v1 file, project-relative to the open project.

Parameters#

file

string

Returns#

Promise<LoadReport>


viewFunctionCode()#

viewFunctionCode(feature, name): Promise<{ ok: true; source: string; } | { error: string; ok: false; }>

Defined in: ui/client/features/spec-breakdown/services/SpecBreakdownApi.ts:57

A function row's "View/edit code": the generated stub at features/<feature>/services/<name>.ts (research/specToCode.mjs's own naming), read through /api/nav/open -- the same contained, generic "open a bare file at a known position" path every other Cockpit screen uses, so a file outside the project, or one that does not exist yet, is refused the same way there.

Parameters#

feature

string

name

string

Returns#

Promise<{ ok: true; source: string; } | { error: string; ok: false; }>