Interface TroubleOptions<AdditionalData>

Configuration options for creating or updating a Trouble model.

This interface defines all the properties that can be set when initializing a trouble instance. Troubles represent issues, alerts, or conditions that require attention in the KOS system.

Example

const troubleOptions: TroubleOptions = {
id: 'low-fluid-001',
type: 'FLUID_LEVEL',
reason: 'Fluid level below minimum threshold',
rank: 7,
role: 'operator',
color: 'orange',
resolvable: true,
ifaces: ['fluid-monitor', 'alert-system'],
tags: ['maintenance', 'fluid', 'warning'],
createTime: new Date().toISOString()
};
interface TroubleOptions<AdditionalData> {
    ifaces: string[];
    id: string;
    rank: number;
    role: string;
    color: string;
    clientData: unknown;
    type: string;
    tags: string[];
    info: unknown;
    resolvable?: boolean;
    reason?: string;
    createTime?: string;
    group?: string;
    servicePath?: string;
    [key: keyof AdditionalData]: AdditionalData[key];
}

Type Parameters

  • AdditionalData extends object = any

    Optional type parameter for domain-specific trouble data

Indexable

[key: keyof AdditionalData]: AdditionalData[key]

Index signature for additional domain-specific data

Properties

ifaces: string[]

List of interface identifiers this trouble affects

id: string

Unique identifier for the trouble instance

rank: number

Priority rank from 1-10 (10 being most critical)

role: string

User role required to view/resolve this trouble

color: string

Display color for UI representation (e.g., 'red', 'yellow', 'orange')

clientData: unknown

Client-specific data attached to the trouble

type: string

Classification type of the trouble (e.g., 'ERROR', 'WARNING', 'INFO')

tags: string[]

Searchable tags for categorizing troubles

info: unknown

Additional information about the trouble state

resolvable?: boolean

Whether this trouble can be resolved through user action

reason?: string

Human-readable description of why the trouble occurred

createTime?: string

ISO timestamp when the trouble was created

group?: string

Optional grouping identifier for related troubles

servicePath?: string

Service path for the trouble instance