Skip to content

zidane-ui/settings/testing

import { … } from 'zidane-ui/settings/testing'ui/src/settings/testing/index.ts

Functions#

createFixturePerformanceHostFunction#

Creates the in-memory member.

TypeScript
function createFixturePerformanceHost(
  options?: FixturePerformanceOptions,
): FixturePerformanceHost
Parameters
NameTypeDefaultDescription
options?FixturePerformanceOptions{}

History, tick rate, whether profiles are busy.

ui/src/settings/headless/fixture-performance.ts:263

createFixtureSettingsAccountsFunction#

Creates the fixture's providers and mcp groups.

TypeScript
function createFixtureSettingsAccounts(
  data?: FixtureSettingsAccountsData,
): FixtureSettingsAccounts
Parameters
NameTypeDefaultDescription
data?FixtureSettingsAccountsData{}

The providers and servers held, and how sign-ins finish.

ui/src/settings/headless/fixture-accounts.ts:80

createFixtureSettingsHostFunction#

Creates an in-memory SettingsHost.

TypeScript
function createFixtureSettingsHost(
  options?: FixtureSettingsOptions,
): FixtureSettingsHost
Parameters
NameTypeDefaultDescription
options?FixtureSettingsOptions{}

The stored settings, and whether it is read-only, may write, or fails reads.

FixtureSettingsHost

The host and its control.

ui/src/settings/headless/fixture-host.ts:86

createFixtureSettingsModelsFunction#

Creates the fixture's models group.

TypeScript
function createFixtureSettingsModels(
  data?: FixtureSettingsModelsData,
): Pick<SettingsHost, 'models'>
Parameters
NameTypeDescription
data?FixtureSettingsModelsData

The models data; absent: no models group.

Pick<SettingsHost, 'models'>

ui/src/settings/headless/fixture-models.ts:33

createFixtureSettingsSectionsFunction#

Creates the in-memory catalog and diagnostics members.

TypeScript
function createFixtureSettingsSections(
  data?: FixtureSettingsSectionsData,
): FixtureSettingsSections
Parameters
NameTypeDefaultDescription
data?FixtureSettingsSectionsData{}

What they hold. A key left out leaves its group out.

ui/src/settings/headless/fixture-sections.ts:128

fixturePerfSampleFunction#

Sample n, deterministic: a smooth wave per process, a spike every 20 samples.

TypeScript
function fixturePerfSample(n: number, at: number): PerfSample
Parameters
NameTypeDescription
nnumber

The sample's index.

atnumber

Its time.

ui/src/settings/headless/fixture-performance.ts:74

Constants#

DEMO_MCP_INSTANCESConstant#

The running process of filesystem, shared by two sessions.

TypeScript
const DEMO_MCP_INSTANCES: readonly SettingsMcpInstance[]

ui/src/settings/testing/accounts-demo.ts:115

DEMO_MCP_SERVERSConstant#

MCP servers in every state MCP servers draws.

TypeScript
const DEMO_MCP_SERVERS: readonly SettingsMcpServer[]

ui/src/settings/testing/accounts-demo.ts:78

DEMO_PROVIDERSConstant#

Providers in every state Accounts draws.

TypeScript
const DEMO_PROVIDERS: readonly SettingsProvider[]

ui/src/settings/testing/accounts-demo.ts:15

Interfaces#

FixtureExtensionOptionsInterface#

The extension options of the fixture: the schema, the action rows, their probes and what a run does.

TypeScript
interface FixtureExtensionOptions
FixtureExtensionOptions properties
NameTypeDescription
actions?SettingsExtensionAction[]

The action rows declared.

runs?Record<string, SettingsExtensionActionResult>

What running each action (keyed extension:key) answers; unlisted: done. Offers runAction with actions.

schema?WireExtensionConfigSchema

The options declared.

statuses?Record<string, SettingsExtensionActionStatus>

The probes, keyed extension:key.

ui/src/settings/headless/fixture-sections.ts:45

FixtureHostCatalogsInterface#

A host's catalogs, as catalog.* reports them.

TypeScript
interface FixtureHostCatalogs
FixtureHostCatalogs properties
NameTypeDescription
extensionsHostCatalogExtension[]

The host's extensions.

mcpsHostCatalogMcp[]

The host's MCP servers.

pluginsHostCatalogPlugin[]

The host's plugins.

skillsHostCatalogSkill[]

The host's skills.

ui/src/settings/headless/fixture-sections.ts:33

FixturePerformanceControlInterface#

Drives the fixture from outside.

TypeScript
interface FixturePerformanceControl
FixturePerformanceControl properties
NameTypeDescription
emit(sample: PerfSample) => void

Emits sample to every watcher.

profiles() => { seconds: number; target: PerfProfileTarget }[]

Profiles recorded, in order.

resets() => number

Counter resets taken.

tick() => PerfSample

Emits the next generated sample to every watcher.

watchers() => number

How many watchers are open.

ui/src/settings/headless/fixture-performance.ts:41

FixturePerformanceOptionsInterface#

Options for createFixturePerformanceHost.

TypeScript
interface FixturePerformanceOptions
FixturePerformanceOptions properties
NameTypeDescription
history?number

Samples already held. Default: 30, ending now.

intervalMs?number

Milliseconds between samples while watched; 0 never ticks (tests drive control.tick). Default 2000.

profileBusy?boolean

Profiles answer busy. Default: false.

profileOutcome?PerfProfileOutcome

What profile answers, instead of the generated profile.

reportPath?string

Where exportReport says it wrote.

samples?PerfSample[]

The history held, instead of the generated one.

threads?Record<number, PerfOsThread[]>

What threads(pid) answers per pid, instead of a generic list.

watchError?PerfWatchError

Every watch fails with this (a server too old, a token without admin): no samples follow.

ui/src/settings/headless/fixture-performance.ts:21

FixtureSettingsAccountsInterface#

The groups and their control.

TypeScript
interface FixtureSettingsAccounts
FixtureSettingsAccounts properties
NameTypeDescription
controlFixtureSettingsAccountsControl

Reads what the groups hold and finishes their sign-ins.

mcp?SettingsMcpHost

The mcp group, when data.mcp was given.

providers?SettingsProvidersHost

The providers group, when data.providers was given.

ui/src/settings/headless/fixture-accounts.ts:48

FixtureSettingsAccountsControlInterface#

Reads what the fixture holds and finishes its sign-ins.

TypeScript
interface FixtureSettingsAccountsControl
FixtureSettingsAccountsControl properties
NameTypeDescription
finishSignIn() => void

Finishes every sign-in that waits for its browser.

providers() => readonly SettingsProvider[]

The providers held now.

restarts() => readonly string[]

The servers restarted, in order.

servers() => readonly SettingsMcpServer[]

The MCP servers held now.

ui/src/settings/headless/fixture-accounts.ts:36

FixtureSettingsAccountsDataInterface#

What the fixture's Accounts and MCP servers hold. Each key offers its group.

TypeScript
interface FixtureSettingsAccountsData
FixtureSettingsAccountsData properties
NameTypeDescription
mcp?readonly SettingsMcpServer[]

The MCP servers (offers mcp).

mcpInstances?readonly SettingsMcpInstance[]

Their running processes (offers mcp.instances and mcp.restart).

providers?readonly SettingsProvider[]

The providers (offers providers).

signInMs?number

A sign-in finishes on its own after this many ms. Default: only on control.finishSignIn().

signInUrl?string

The address a sign-in opens. Default: https://example.com/sign-in.

ui/src/settings/headless/fixture-accounts.ts:22

FixtureSettingsControlInterface#

Changes the fixture's stored settings from outside.

TypeScript
interface FixtureSettingsControl
FixtureSettingsControl properties
NameTypeDescription
accountsFixtureSettingsAccountsControl

Accounts' providers and MCP servers' servers, and their sign-ins.

performanceFixturePerformanceControl | null

The performance member's control (null without options.performance).

sectionsFixtureSettingsSectionsControl

The catalog and diagnostics sections' data and what their actions did.

claudeImports() => SettingsClaudeImportSelection[]

The Claude Code imports run, in order.

refuse(next: boolean) => void

Refuse (true) or take (false) the next writes.

store(patch: Partial<Settings>) => void

Another writer changed the stored settings; the host reads them on its next refresh.

stored() => Settings

The settings stored now.

unreadable(next: boolean) => void

Make reads fail (true) or succeed (false).

ui/src/settings/headless/fixture-host.ts:58

FixtureSettingsModelsDataInterface#

The fixture's model data; each key offers its member of models.

TypeScript
interface FixtureSettingsModelsData
FixtureSettingsModelsData properties
NameTypeDescription
decisionModels?SettingsDecisionModel[]

The decision models (for every folder).

lastUsed?ModelPickRef | null

The last model picked (null: none).

tests?Record<string, SettingsModelTest>

How a test of each model goes, by model setting; a model left out fails as unavailable. Offers test and testDecision.

ui/src/settings/headless/fixture-models.ts:12

FixtureSettingsOptionsInterface#

Options for createFixtureSettingsHost.

TypeScript
interface FixtureSettingsOptions
FixtureSettingsOptions properties
NameTypeDescription
accounts?FixtureSettingsAccountsData

Accounts' providers and MCP servers' servers; each key offers its group.

claudeImport?{ detect: SettingsClaudeImportDetect; summary: SettingsClaudeImportSummary }

What ~/.claude holds and what an import answers; offers claudeImport.

models?FixtureSettingsModelsData

The model rows' decision models, tests and last used model; each key offers its member of models.

performance?FixturePerformanceOptions

Offers performance: a believable app whose figures drift while watched.

readOnly?boolean

Leave update out: every row read-only. Default: false.

sections?FixtureSettingsSectionsData

The catalog and diagnostics sections' data (skills, extensions, plugins, …); each key offers its group.

unreadable?boolean

The settings can't be read: document lands on an error. Default: false.

values?Partial<Settings>

The stored settings over DEFAULT_SETTINGS.

writable?boolean

Offer writable with this value (a connection that may or may not write). Default: not offered.

ui/src/settings/headless/fixture-host.ts:36

FixtureSettingsSectionsInterface#

The members and their control.

TypeScript
interface FixtureSettingsSections
FixtureSettingsSections properties
NameTypeDescription
controlFixtureSettingsSectionsControl

Reads and changes what they hold.

environments?SettingsEnvironmentsHost

Over environments.

extensions?SettingsExtensionsHost

Over extensions.

hostCatalog?SettingsHostCatalog

Over hostCatalog.

instructions?SettingsInstructionsHost

Over instructions.

logs?SettingsLogsHost

Over logs.

plugins?SettingsPluginsHost

Over plugins.

skills?SettingsSkillsHost

Over skills (and skillSources).

ui/src/settings/headless/fixture-sections.ts:104

FixtureSettingsSectionsControlInterface#

Changes the fixture's catalogs from outside and reads what actions did.

TypeScript
interface FixtureSettingsSectionsControl
FixtureSettingsSectionsControl properties
NameTypeDescription
catalogChanged(kind: SettingsCatalogKind) => void

A host catalog changed there: hostCatalog.onChanged listeners hear it.

data() => FixtureSettingsSectionsData

What the fixture holds now.

environmentChanges() => readonly EnvironmentSettingsChange[]

Environment edits applied, in order.

log(record: LogRecord) => void

A new log record, told to followers.

overrides() => readonly string[]

System overrides created, by session.

ui/src/settings/headless/fixture-sections.ts:90

FixtureSettingsSectionsDataInterface#

What the fixture's catalog and diagnostics members hold. Each key offers its group.

TypeScript
interface FixtureSettingsSectionsData
FixtureSettingsSectionsData properties
NameTypeDescription
environments?EnvironmentDescriptor[]

The environment kinds.

extensionOptions?FixtureExtensionOptions

The options and actions the enabled extensions declare (with extensions); each key offers its member.

extensions?SettingsExtension[]

The extensions (for every folder).

extensionSources?Record<string, ExtensionSourceListing>

What a source spec lists, for the extensions browser (with extensions, and with hostCatalog its browser and Change origin). An unlisted spec answers a not-found listing. changeOrigin moves an extension to a listed source holding its name, else fails as the installer does (name-mismatch, naming what it found).

hostCatalog?FixtureHostCatalogs | null

A host's catalogs (null: the host can't list them).

hostInstallFailures?Record<string, string>

Host installs that fail, by spec: the error each rejects with.

hostInstalls?boolean

The host takes installs from this connection. Default: true.

instructions?Record<string, ContextSegmentsReport | null>

Each session's prompt (null: no live agent).

logs?LogRecord[]

The log records held.

plugins?SettingsPlugin[]

The plugins (for every folder).

skills?SkillConfig[]

The skills (for every folder); their instructions are their SKILL.md bodies.

skillSources?Record<string, SkillSourceListing>

What a source spec lists, for the skills browser.

ui/src/settings/headless/fixture-sections.ts:57

Types#

FixturePerformanceHostType#

The fixture member and its control.

TypeScript
type FixturePerformanceHost = SettingsPerformanceHost & { control: FixturePerformanceControl }

ui/src/settings/headless/fixture-performance.ts:55

FixtureSettingsHostType#

A fixture settings host and its control.

TypeScript
type FixtureSettingsHost = SettingsHost & { control: FixtureSettingsControl }

ui/src/settings/headless/fixture-host.ts:78