Skip to main content

Interface: ConfigWriter

Defined in: packages/core/src/application/ports/config-writer.ts:31

Port for writing and mutating the project configuration (specd.yaml).

Unlike ConfigLoader, which is read-only, ConfigWriter handles the operations that create or modify the on-disk configuration.

Methods​

addPlugin()​

addPlugin(configPath, type, name, config?): Promise<void>

Defined in: packages/core/src/application/ports/config-writer.ts:51

Adds or updates a plugin declaration under plugins.<type>.

Parameters​

configPath​

string

Absolute path to the specd.yaml to update

type​

string

Plugin type key (e.g. 'agents')

name​

string

Plugin package name

config?​

Record<string, unknown>

Optional plugin-specific config

Returns​

Promise<void>

A promise that resolves when persistence completes


initProject()​

initProject(options): Promise<InitProjectResult>

Defined in: packages/core/src/application/ports/config-writer.ts:40

Creates a new specd.yaml in projectRoot, creates the required storage directories, and appends specd.local.yaml to .gitignore.

Parameters​

options​

InitProjectOptions

Initialisation options

Returns​

Promise<InitProjectResult>

The path and metadata of the created config

Throws​

When specd.yaml already exists and force is not set


listPlugins()​

listPlugins(configPath, type?): Promise<object[]>

Defined in: packages/core/src/application/ports/config-writer.ts:75

Lists plugin declarations, optionally filtered by type.

Parameters​

configPath​

string

Absolute path to the specd.yaml to read

type?​

string

Optional plugin type filter

Returns​

Promise<object[]>

Declared plugin entries


removePlugin()​

removePlugin(configPath, type, name): Promise<void>

Defined in: packages/core/src/application/ports/config-writer.ts:66

Removes a plugin declaration by name from plugins.<type>.

Parameters​

configPath​

string

Absolute path to the specd.yaml to update

type​

string

Plugin type key (e.g. 'agents')

name​

string

Plugin package name

Returns​

Promise<void>

A promise that resolves when persistence completes