capabilities.svelte.ts

Declarations
#

10 declarations

view source

Capabilities
#

capabilities.svelte.ts view source

A class that encapsulates system capabilities detection and management. This is NOT generic or extensible - it contains hardcoded logic for all capabilities the system supports.

inheritance

extends:
  • Cell<typeof CapabilitiesJson>

backend

type Capability<ServerCapabilityData | null | undefined>

websocket

WebSocket capability that derives its state from the socket.

type Capability<WebsocketCapabilityData | null | undefined>

readonly

filesystem

The filesystem capability derives its state from the backend and zzz_dir.

type Capability<FilesystemCapabilityData | null | undefined>

readonly

ollama

Ollama capability that derives its state from provider_status (authoritative) and app.ollama (for richer data when available).

type Capability<OllamaCapabilityData | null | undefined>

readonly

claude

Claude capability that derives its state from provider_status.

type Capability<null | undefined>

readonly

chatgpt

ChatGPT capability that derives its state from provider_status.

type Capability<null | undefined>

readonly

gemini

Gemini capability that derives its state from provider_status.

type Capability<null | undefined>

readonly

pings

Store pings - both pending and completed.

type Array<PingData>

latest_ping_time

Most recent completed ping round trip time in milliseconds.

type number | null

readonly

completed_pings

Completed pings (for display).

type Array<PingData>

readonly

pending_ping_count

Number of pending pings.

type number

readonly

has_pending_pings

Has pending pings.

type boolean

readonly

backend_available

Convenience accessor for backend availability. undefined means uninitialized, null means loading/checking. boolean indicates if available.

type boolean | null | undefined

readonly

ollama_available

Convenience accessor for ollama availability. undefined means uninitialized, null means loading/checking. boolean indicates if available.

type boolean | null | undefined

readonly

websocket_available

Convenience accessor for websocket availability. undefined means uninitialized, null means loading/checking. boolean indicates if the socket is actively connected.

type boolean | null | undefined

readonly

filesystem_available

Convenience accessor for filesystem availability. undefined means uninitialized, null means loading/checking. boolean indicates if filesystem is available.

type boolean | null | undefined

readonly

ollama_models

Latest Ollama model list response, if available.

type Array<{ name: string; size: number; model_response: OllamaListResponseItem; }>

readonly

constructor

type new (options: CellOptions<ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; }, $strict>>): Capabilities

options
type CellOptions<ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; }, $strict>>

init_backend_check

Check backend availability only if it hasn't been checked before. (when status is 'initial')

type (): Promise<void>

returns Promise<void>

check_backend

Check backend availability with a ping.

type (): Promise<void>

returns Promise<void>

init_ollama_check

Check Ollama availability only if it hasn't been checked before. (when status is 'initial')

type (): Promise<void>

returns Promise<void>

check_ollama

Check Ollama availability by loading provider status and refreshing models.

type (): Promise<void>

returns Promise<void>

handle_ping_sent

type (request_id: string | number): void

request_id
type string | number
returns void

handle_ping_received

type (ping_id: string | number): void

ping_id
type string | number
returns void

handle_ping_error

type (ping_id: string | number, error_message: string): void

ping_id
type string | number
error_message
type string
returns void

reset_backend

Reset just the backend capability to uninitialized state.

type (): void

returns void

init_claude_check

Check Claude availability only if it hasn't been checked before.

type (): Promise<void>

returns Promise<void>

check_claude

Check Claude availability by loading provider status.

type (): Promise<void>

returns Promise<void>

init_chatgpt_check

Check ChatGPT availability only if it hasn't been checked before.

type (): Promise<void>

returns Promise<void>

check_chatgpt

Check ChatGPT availability by loading provider status.

type (): Promise<void>

returns Promise<void>

init_gemini_check

Check Gemini availability only if it hasn't been checked before.

type (): Promise<void>

returns Promise<void>

check_gemini

Check Gemini availability by loading provider status.

type (): Promise<void>

returns Promise<void>

CapabilitiesJson
#

capabilities.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; }, $strict>

CapabilitiesJsonInput
#

Capability
#

capabilities.svelte.ts view source

Capability<T>

Generic interface for a capability with standardized status tracking.

generics

T

name

The capability name.

type string

data

The capability's status: undefined=not initialized, null=checking, otherwise available or not.

type T

status

Async status tracking the connection/check state.

type AsyncStatus

message_id

Message id of the last request for this capability's info, if any.

type JsonrpcRequestId | null

error_message

Error message if any

type string | null

updated

Timestamp when the capability was last checked.

type number | null

FilesystemCapabilityData
#

capabilities.svelte.ts view source

FilesystemCapabilityData

zzz_dir

type DiskfileDirectoryPath | null | undefined

scoped_dirs

type ReadonlyArray<DiskfileDirectoryPath>

OllamaCapabilityData
#

capabilities.svelte.ts view source

OllamaCapabilityData

list_response

type OllamaListResponse | null

ps_response

type OllamaPsResponse | null

round_trip_time

type number | null

PING_HISTORY_MAX
#

PingData
#

ServerCapabilityData
#

WebsocketCapabilityData
#

capabilities.svelte.ts view source

WebsocketCapabilityData

url

type string | null

connected

type boolean

reconnect_count

type number

last_connect_time

type number | null

last_send_time

type number | null

last_receive_time

type number | null

connection_duration

type number | null

pending_pings

type number

Depends on
#

Imported by
#