zidane-ui/ settings/ testing
import { … } from 'zidane-ui/settings/testing'ui/src/settings/testing/index.ts
Functions#
createFixturePerformanceHostFunction#
Creates the in-memory member.
function createFixturePerformanceHost(
options?: FixturePerformanceOptions,
): FixturePerformanceHostParameters
| Name | Type | Default | Description |
|---|---|---|---|
| options? | FixturePerformanceOptions | {} | History, tick rate, whether profiles are busy. |
Returns
createFixtureSettingsAccountsFunction#
Creates the fixture's providers and mcp groups.
function createFixtureSettingsAccounts(
data?: FixtureSettingsAccountsData,
): FixtureSettingsAccountsParameters
| Name | Type | Default | Description |
|---|---|---|---|
| data? | FixtureSettingsAccountsData | {} | The providers and servers held, and how sign-ins finish. |
Returns
createFixtureSettingsHostFunction#
Creates an in-memory SettingsHost.
function createFixtureSettingsHost(
options?: FixtureSettingsOptions,
): FixtureSettingsHostParameters
| Name | Type | Default | Description |
|---|---|---|---|
| options? | FixtureSettingsOptions | {} | The stored settings, and whether it is read-only, may write, or fails reads. |
Returns
FixtureSettingsHostThe host and its control.
createFixtureSettingsModelsFunction#
Creates the fixture's models group.
function createFixtureSettingsModels(
data?: FixtureSettingsModelsData,
): Pick<SettingsHost, 'models'>Parameters
| Name | Type | Description |
|---|---|---|
| data? | FixtureSettingsModelsData | The models data; absent: no |
Returns
Pick<SettingsHost, 'models'>createFixtureSettingsSectionsFunction#
Creates the in-memory catalog and diagnostics members.
function createFixtureSettingsSections(
data?: FixtureSettingsSectionsData,
): FixtureSettingsSectionsParameters
| Name | Type | Default | Description |
|---|---|---|---|
| data? | FixtureSettingsSectionsData | {} | What they hold. A key left out leaves its group out. |
Returns
fixturePerfSampleFunction#
Sample n, deterministic: a smooth wave per process, a spike every 20 samples.
function fixturePerfSample(n: number, at: number): PerfSampleParameters
| Name | Type | Description |
|---|---|---|
| n | number | The sample's index. |
| at | number | Its time. |
Returns
Constants#
DEMO_MCP_INSTANCESConstant#
The running process of filesystem, shared by two sessions.
const DEMO_MCP_INSTANCES: readonly SettingsMcpInstance[]DEMO_MCP_SERVERSConstant#
MCP servers in every state MCP servers draws.
const DEMO_MCP_SERVERS: readonly SettingsMcpServer[]DEMO_PROVIDERSConstant#
Providers in every state Accounts draws.
const DEMO_PROVIDERS: readonly SettingsProvider[]Interfaces#
FixtureExtensionOptionsInterface#
The extension options of the fixture: the schema, the action rows, their probes and what a run does.
interface FixtureExtensionOptionsProperties
| Name | Type | Description |
|---|---|---|
| actions? | SettingsExtensionAction[] | The action rows declared. |
| runs? | Record<string, SettingsExtensionActionResult> | What running each action (keyed |
| schema? | WireExtensionConfigSchema | The options declared. |
| statuses? | Record<string, SettingsExtensionActionStatus> | The probes, keyed |
FixtureHostCatalogsInterface#
A host's catalogs, as catalog.* reports them.
interface FixtureHostCatalogsProperties
| Name | Type | Description |
|---|---|---|
| extensions | HostCatalogExtension[] | The host's extensions. |
| mcps | HostCatalogMcp[] | The host's MCP servers. |
| plugins | HostCatalogPlugin[] | The host's plugins. |
| skills | HostCatalogSkill[] | The host's skills. |
FixturePerformanceControlInterface#
Drives the fixture from outside.
interface FixturePerformanceControlProperties
| Name | Type | Description |
|---|---|---|
| emit | (sample: PerfSample) => void | Emits |
| 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. |
FixturePerformanceOptionsInterface#
Options for createFixturePerformanceHost.
interface FixturePerformanceOptionsProperties
| Name | Type | Description |
|---|---|---|
| history? | number | Samples already held. Default: 30, ending now. |
| intervalMs? | number | Milliseconds between samples while watched; |
| profileBusy? | boolean | Profiles answer |
| profileOutcome? | PerfProfileOutcome | What |
| reportPath? | string | Where |
| samples? | PerfSample[] | The history held, instead of the generated one. |
| threads? | Record<number, PerfOsThread[]> | What |
| watchError? | PerfWatchError | Every watch fails with this (a server too old, a token without admin): no samples follow. |
FixtureSettingsAccountsInterface#
The groups and their control.
interface FixtureSettingsAccountsProperties
| Name | Type | Description |
|---|---|---|
| control | FixtureSettingsAccountsControl | Reads what the groups hold and finishes their sign-ins. |
| mcp? | SettingsMcpHost | The |
| providers? | SettingsProvidersHost | The |
FixtureSettingsAccountsControlInterface#
Reads what the fixture holds and finishes its sign-ins.
interface FixtureSettingsAccountsControlProperties
| Name | Type | Description |
|---|---|---|
| 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. |
FixtureSettingsAccountsDataInterface#
What the fixture's Accounts and MCP servers hold. Each key offers its group.
interface FixtureSettingsAccountsDataProperties
| Name | Type | Description |
|---|---|---|
| mcp? | readonly SettingsMcpServer[] | The MCP servers (offers |
| mcpInstances? | readonly SettingsMcpInstance[] | Their running processes (offers |
| providers? | readonly SettingsProvider[] | The providers (offers |
| signInMs? | number | A sign-in finishes on its own after this many ms. Default: only on |
| signInUrl? | string | The address a sign-in opens. Default: |
FixtureSettingsControlInterface#
Changes the fixture's stored settings from outside.
interface FixtureSettingsControlProperties
| Name | Type | Description |
|---|---|---|
| accounts | FixtureSettingsAccountsControl | Accounts' providers and MCP servers' servers, and their sign-ins. |
| performance | FixturePerformanceControl | null | The performance member's control ( |
| sections | FixtureSettingsSectionsControl | 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 ( |
| store | (patch: Partial<Settings>) => void | Another writer changed the stored settings; the host reads them on its next |
| stored | () => Settings | The settings stored now. |
| unreadable | (next: boolean) => void | Make reads fail ( |
FixtureSettingsModelsDataInterface#
The fixture's model data; each key offers its member of models.
interface FixtureSettingsModelsDataProperties
| Name | Type | Description |
|---|---|---|
| decisionModels? | SettingsDecisionModel[] | The decision models (for every folder). |
| lastUsed? | ModelPickRef | null | The last model picked ( |
| tests? | Record<string, SettingsModelTest> | How a test of each model goes, by model setting; a model left out fails as |
FixtureSettingsOptionsInterface#
Options for createFixtureSettingsHost.
interface FixtureSettingsOptionsProperties
| Name | Type | Description |
|---|---|---|
| accounts? | FixtureSettingsAccountsData | Accounts' providers and MCP servers' servers; each key offers its group. |
| claudeImport? | { detect: SettingsClaudeImportDetect; summary: SettingsClaudeImportSummary } | What |
| models? | FixtureSettingsModelsData | The model rows' decision models, tests and last used model; each key offers its member of |
| performance? | FixturePerformanceOptions | Offers |
| readOnly? | boolean | Leave |
| sections? | FixtureSettingsSectionsData | The catalog and diagnostics sections' data (skills, extensions, plugins, …); each key offers its group. |
| unreadable? | boolean | The settings can't be read: |
| values? | Partial<Settings> | The stored settings over |
| writable? | boolean | Offer |
FixtureSettingsSectionsInterface#
The members and their control.
interface FixtureSettingsSectionsProperties
| Name | Type | Description |
|---|---|---|
| control | FixtureSettingsSectionsControl | Reads and changes what they hold. |
| environments? | SettingsEnvironmentsHost | Over |
| extensions? | SettingsExtensionsHost | Over |
| hostCatalog? | SettingsHostCatalog | Over |
| instructions? | SettingsInstructionsHost | Over |
| logs? | SettingsLogsHost | Over |
| plugins? | SettingsPluginsHost | Over |
| skills? | SettingsSkillsHost | Over |
FixtureSettingsSectionsControlInterface#
Changes the fixture's catalogs from outside and reads what actions did.
interface FixtureSettingsSectionsControlProperties
| Name | Type | Description |
|---|---|---|
| catalogChanged | (kind: SettingsCatalogKind) => void | A host catalog changed there: |
| 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. |
FixtureSettingsSectionsDataInterface#
What the fixture's catalog and diagnostics members hold. Each key offers its group.
interface FixtureSettingsSectionsDataProperties
| Name | Type | Description |
|---|---|---|
| environments? | EnvironmentDescriptor[] | The environment kinds. |
| extensionOptions? | FixtureExtensionOptions | The options and actions the enabled extensions declare (with |
| extensions? | SettingsExtension[] | The extensions (for every folder). |
| extensionSources? | Record<string, ExtensionSourceListing> | What a source spec lists, for the extensions browser (with |
| hostCatalog? | FixtureHostCatalogs | null | A host's catalogs ( |
| 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 ( |
| logs? | LogRecord[] | The log records held. |
| plugins? | SettingsPlugin[] | The plugins (for every folder). |
| skills? | SkillConfig[] | The skills (for every folder); their |
| skillSources? | Record<string, SkillSourceListing> | What a source spec lists, for the skills browser. |
Types#
FixturePerformanceHostType#
The fixture member and its control.
type FixturePerformanceHost = SettingsPerformanceHost & { control: FixturePerformanceControl }FixtureSettingsHostType#
A fixture settings host and its control.
type FixtureSettingsHost = SettingsHost & { control: FixtureSettingsControl }