api #

software garage for power users and devs

211 modules ยท 556 declarations

Modules
#

_testing_emit_notifications_action_spec
#

testing_action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: false; input: ZodObject<{ count: ZodNumber; }, $strict>; output: ZodObject<...>; async: true; streams: string; description: string; } import {_testing_emit_notifications_action_spec} from '@fuzdev/zzz/testing_action_specs.js';

_testing_notification_action_spec
#

testing_action_specs.ts view source

{ method: string; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ index: ZodNumber; }, $strict>; output: ZodVoid; async: true; description: string; } import {_testing_notification_action_spec} from '@fuzdev/zzz/testing_action_specs.js';

Action
#

action.svelte.ts view source

import {Action} from '@fuzdev/zzz/action.svelte.js';

Represents a single action in the system, tracking its full lifecycle through action events.

inheritance

extends: Cell<typeof ActionJson>

method

type ActionMethod

$state.raw

action_event_data

type ActionEventData | undefined

$state.raw

spec

type ActionSpecUnion

readonly $derived.by

kind

type ActionKind

readonly $derived

has_error

type boolean

readonly $derived

pending

Returns true if the action is still pending (not in a terminal state). An action is complete when it reaches a terminal phase (where next phase is null) AND the step is terminal (handled or failed).

type boolean

readonly $derived.by

failed

type boolean

readonly $derived

success

Returns true if the action completed successfully. Success means: action is complete (terminal phase + step), step is 'handled', and no error.

type boolean

readonly $derived.by

constructor

type new (options: ActionOptions): Action

options

unlisten_to_action_event

type (() => void) | undefined

action_event

type ActionEvent | undefined

listen_to_action_event

type (action_event: ActionEvent<string, "send" | "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "receive" | "execute", "initial" | "failed" | "parsed" | "handling" | "handled">): () => void

action_event

type ActionEvent<string, "send" | "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "receive" | "execute", "initial" | "failed" | "parsed" | "handling" | "handled">
returns () => void

dispose

type (): void

returns void

action_specs
#

action_collections.ts view source

({ method: string; initiator: "frontend" | "backend" | "both"; side_effects: boolean; input: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; output: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; ... 6 more ...; rate_limit?: "both" | ... 2 more ... | undefined; } | { ...; } | { ...; ... import {action_specs} from '@fuzdev/zzz/action_collections.js';

ActionContextmenu
#

ActionDetail
#

ActionEventDatas
#

action_collections.ts view source

ActionEventDatas import type {ActionEventDatas} from '@fuzdev/zzz/action_collections.js';

Action event data types indexed by method name. These represent the full discriminated union of all possible states for each action's event data, properly typed with inputs and outputs.

heartbeat

type ActionEventRequestResponseData< 'heartbeat', ActionInputs['heartbeat'], ActionOutputs['heartbeat'] >

cancel

type ActionEventRemoteNotificationData<'cancel', ActionInputs['cancel']>

ping

type ActionEventRequestResponseData<'ping', ActionInputs['ping'], ActionOutputs['ping']>

session_load

type ActionEventRequestResponseData< 'session_load', ActionInputs['session_load'], ActionOutputs['session_load'] >

filer_change

type ActionEventRemoteNotificationData<'filer_change', ActionInputs['filer_change']>

diskfile_update

type ActionEventRequestResponseData< 'diskfile_update', ActionInputs['diskfile_update'], ActionOutputs['diskfile_update'] >

diskfile_delete

type ActionEventRequestResponseData< 'diskfile_delete', ActionInputs['diskfile_delete'], ActionOutputs['diskfile_delete'] >

directory_create

type ActionEventRequestResponseData< 'directory_create', ActionInputs['directory_create'], ActionOutputs['directory_create'] >

completion_create

type ActionEventRequestResponseData< 'completion_create', ActionInputs['completion_create'], ActionOutputs['completion_create'] >

completion_progress

type ActionEventRemoteNotificationData< 'completion_progress', ActionInputs['completion_progress'] >

toggle_main_menu

type ActionEventLocalCallData< 'toggle_main_menu', ActionInputs['toggle_main_menu'], ActionOutputs['toggle_main_menu'] >

provider_load_status

type ActionEventRequestResponseData< 'provider_load_status', ActionInputs['provider_load_status'], ActionOutputs['provider_load_status'] >

provider_update_api_key

type ActionEventRequestResponseData< 'provider_update_api_key', ActionInputs['provider_update_api_key'], ActionOutputs['provider_update_api_key'] >

terminal_create

type ActionEventRequestResponseData< 'terminal_create', ActionInputs['terminal_create'], ActionOutputs['terminal_create'] >

terminal_data_send

type ActionEventRequestResponseData< 'terminal_data_send', ActionInputs['terminal_data_send'], ActionOutputs['terminal_data_send'] >

terminal_data

type ActionEventRemoteNotificationData<'terminal_data', ActionInputs['terminal_data']>

terminal_resize

type ActionEventRequestResponseData< 'terminal_resize', ActionInputs['terminal_resize'], ActionOutputs['terminal_resize'] >

terminal_close

type ActionEventRequestResponseData< 'terminal_close', ActionInputs['terminal_close'], ActionOutputs['terminal_close'] >

terminal_exited

type ActionEventRemoteNotificationData< 'terminal_exited', ActionInputs['terminal_exited'] >

workspace_open

type ActionEventRequestResponseData< 'workspace_open', ActionInputs['workspace_open'], ActionOutputs['workspace_open'] >

workspace_close

type ActionEventRequestResponseData< 'workspace_close', ActionInputs['workspace_close'], ActionOutputs['workspace_close'] >

workspace_list

type ActionEventRequestResponseData< 'workspace_list', ActionInputs['workspace_list'], ActionOutputs['workspace_list'] >

workspace_changed

type ActionEventRemoteNotificationData< 'workspace_changed', ActionInputs['workspace_changed'] >

ActionInputs
#

action_collections.ts view source

{ readonly heartbeat: ZodDefault<ZodObject<{}, $strict>>; readonly cancel: ZodObject<{ request_id: ZodUnion<readonly [ZodString, ZodNumber]>; }, $strict>; ... 21 more ...; readonly workspace_changed: ZodObject<...>; } import type {ActionInputs} from '@fuzdev/zzz/action_collections.js';

Action parameter schemas indexed by method name. These represent the input data for each action, e.g. JSON-RPC request/notification params and local call arguments.

ActionJson
#

action.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; method: ZodEnum<...>; action_event_data: ZodOptional<...>; }, $strict> import type {ActionJson} from '@fuzdev/zzz/action.svelte.js';

ActionJsonInput
#

action.svelte.ts view source

{ method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | ... 13 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_event_data?... import type {ActionJsonInput} from '@fuzdev/zzz/action.svelte.js';

method

type "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | "completion_progress" | ... 12 more ... | "workspace_changed"

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

action_event_data?

type { kind: "request_response" | "remote_notification" | "local_call"; phase: "send" | "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }

ActionList
#

ActionList.svelte view source

import ActionList from '@fuzdev/zzz/ActionList.svelte';

limit?

type number
optional default 20

selected_action_id?

type string
optional default null

attrs?

type HTMLAttributes<HTMLDivElement>
optional

onselect?

type (action: Action) => void
optional

ActionListitem
#

ActionListitem.svelte view source

import ActionListitem from '@fuzdev/zzz/ActionListitem.svelte';

action

type Action

selected?

type boolean
optional default false

onselect?

type (action: Action) => void
optional

ActionMethod
#

action_metatypes.ts view source

ZodEnum<{ ping: "ping"; heartbeat: "heartbeat"; cancel: "cancel"; "peer/ping": "peer/ping"; session_load: "session_load"; filer_change: "filer_change"; diskfile_update: "diskfile_update"; diskfile_delete: "diskfile_delete"; ... 15 more ...; workspace_changed: "workspace_changed"; }> import type {ActionMethod} from '@fuzdev/zzz/action_metatypes.js';

All action method names. Request/response actions have two types per method.

ActionOptions
#

action.svelte.ts view source

ActionOptions import type {ActionOptions} from '@fuzdev/zzz/action.svelte.js';

inheritance

extends: CellOptions<typeof ActionJson>

ActionOutputs
#

action_collections.ts view source

{ readonly heartbeat: ZodObject<{}, $strict>; readonly cancel: ZodVoid; readonly 'peer/ping': ZodObject<{ nonce: ZodNumber; protocol_version: ZodNumber; }, $strict>; ... 20 more ...; readonly workspace_changed: ZodVoid; } import type {ActionOutputs} from '@fuzdev/zzz/action_collections.js';

Action result schemas indexed by method name. These represent the output data for each action, e.g. JSON-RPC response results and local call return values.

Actions
#

actions.svelte.ts view source

import {Actions} from '@fuzdev/zzz/actions.svelte.js';

Stores the action history.

inheritance

extends: Cell<typeof ActionsJson>

items

type IndexedCollection<Action>

readonly

history_limit

type number

$state.raw

constructor

type new (options: ActionsOptions): Actions

options

set_json

Override to populate the indexed collection after parsing JSON.

type (value?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | ... 17 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_event_data?: { ...; } | undefined; }[] | undefined; } | undefined): void

value?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | ... 17 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action...
optional
returns void

add

type (action: Action): void

action

type Action
returns void

add_from_json

type (action_json: { method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | ... 13 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_event_data?: { ...; } | undefined; }): Action

action_json

type { method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | ... 13 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_event_data?...
returns Action

ActionSchema
#

ActionsJson
#

actions.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; }, $strict> import type {ActionsJson} from '@fuzdev/zzz/actions.svelte.js';

ActionsJsonInput
#

actions.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | ... 17 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action... import type {ActionsJsonInput} from '@fuzdev/zzz/actions.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | ... 13 more ... | "workspace_changed"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_event_data?...

ActionsOptions
#

actions.svelte.ts view source

ActionsOptions import type {ActionsOptions} from '@fuzdev/zzz/actions.svelte.js';

inheritance

extends: CellOptions<typeof ActionsJson>

history_limit?

type number

ActionSpecs
#

action_collections.ts view source

{ readonly heartbeat: { method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: false; input: ZodDefault<ZodObject<{}, $strict>>; output: ZodObject<...>; async: true; description: string; }; ... 22 more ...; readonly workspace_changed: { ...; }; } import type {ActionSpecs} from '@fuzdev/zzz/action_collections.js';

Action specifications indexed by method name. These represent the complete action spec definitions.

all_action_specs
#

action_specs.ts view source

({ method: string; initiator: "frontend" | "backend" | "both"; side_effects: boolean; input: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; output: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; ... 6 more ...; rate_limit?: "both" | ... 2 more ... | undefined; } | { ...; } | { ...; ... import {all_action_specs} from '@fuzdev/zzz/action_specs.js';

Canonical action spec list โ€” fuz_app's protocol actions (heartbeat, cancel) plus zzz-owned specs. Single source of truth for codegen and runtime registries (Frontend.action_registry, Backend.action_registry).

Codegen helpers default-filter protocol actions out of typed surfaces (FrontendActionsApi, BackendActionHandlers, ActionMethod, etc.) since they're dispatcher-owned. Server WS registration pairs protocol specs with fuz_app-shipped handlers via protocol_actions; iteration over all_action_specs skips them via is_protocol_action_method to avoid double-registration. Adding a future protocol action requires no consumer edit โ€” fuz_app's protocol_action_specs is the upstream canonical bundle.

API_PATH
#

API_PATH_FOR_HTTP_RPC
#

API_URL
#

API_URL_FOR_HTTP_RPC
#

App
#

app.svelte.ts view source

import {App} from '@fuzdev/zzz/app.svelte.js';

The App is the user's implementation of the Zzz client app. It extends Frontend and should be able to customize as much as possible, including both behaviors and types. (both a work in progress)

inheritance

extends: Frontend

constructor

type new (options?: AppOptions | undefined): App

options?

type AppOptions | undefined
optional

app_context
#

app.svelte.ts view source

{ get: (error_message?: string | undefined) => App; get_maybe: () => App | undefined; set: (value: App) => App; } import {app_context} from '@fuzdev/zzz/app.svelte.js';

This is an example of a user-typed alias of frontend_context. I like this pattern in my apps but there are other patterns too.

AppOptions
#

BACKEND_ARTIFICIAL_RESPONSE_DELAY
#

BackendActionMethod
#

action_metatypes.ts view source

ZodEnum<{ ping: "ping"; heartbeat: "heartbeat"; cancel: "cancel"; "peer/ping": "peer/ping"; session_load: "session_load"; filer_change: "filer_change"; diskfile_update: "diskfile_update"; diskfile_delete: "diskfile_delete"; ... 14 more ...; workspace_changed: "workspace_changed"; }> import type {BackendActionMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of all actions the backend may encounter โ€” request_response and remote_notification (local_call is frontend-only).

BackendRequestResponseMethod
#

action_metatypes.ts view source

ZodEnum<{ ping: "ping"; session_load: "session_load"; diskfile_update: "diskfile_update"; diskfile_delete: "diskfile_delete"; directory_create: "directory_create"; completion_create: "completion_create"; ... 8 more ...; workspace_list: "workspace_list"; }> import type {BackendRequestResponseMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of request_response actions the backend handles (initiator excludes backend).

BOTS_DEFAULT
#

BroadcastActionMethod
#

action_metatypes.ts view source

ZodEnum<{ filer_change: "filer_change"; terminal_data: "terminal_data"; terminal_exited: "terminal_exited"; workspace_changed: "workspace_changed"; }> import type {BroadcastActionMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of remote_notification actions exposed by the broadcast API (backend-initiated, excluding request-scoped progress notifications named by another action's streams).

calculate_reorderable_target_index
#

reorderable_helpers.ts view source

(source_index: number, current_index: number, position: ReorderableValidDropPosition): number import {calculate_reorderable_target_index} from '@fuzdev/zzz/reorderable_helpers.js';

Calculate the target index based on source, current index, and position.

source_index

type number

current_index

type number

position

returns

number

Capabilities
#

capabilities.svelte.ts view source

import {Capabilities} from '@fuzdev/zzz/capabilities.svelte.js';

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>

$state.raw

websocket

WebSocket capability that derives its state from the socket.

type Capability<WebsocketCapabilityData | null | undefined>

readonly $derived.by

filesystem

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

type Capability<FilesystemCapabilityData | null | undefined>

readonly $derived.by

providers

Per-provider availability capabilities, keyed by ProviderName. Each derives its state from provider_status; see ProviderCapability.

type Record<ProviderName, ProviderCapability>

readonly

pings

Store pings - both pending and completed.

type Array<PingData>

$state

latest_ping_time

Most recent completed ping round trip time in milliseconds.

type number | null

readonly $derived

completed_pings

Completed pings (for display).

type Array<PingData>

readonly $derived

pending_ping_count

Number of pending pings.

type number

readonly $derived

has_pending_pings

Has pending pings.

type boolean

readonly $derived

backend_available

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

type boolean | null | undefined

readonly $derived

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 $derived

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 $derived

constructor

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

options

type CellOptions<ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; 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>

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

CapabilitiesJson
#

capabilities.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; }, $strict> import type {CapabilitiesJson} from '@fuzdev/zzz/capabilities.svelte.js';

CapabilitiesJsonInput
#

capabilities.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; } import type {CapabilitiesJsonInput} from '@fuzdev/zzz/capabilities.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

CapabilitiesView
#

Capability
#

capabilities.svelte.ts view source

Capability<T> import type {Capability} from '@fuzdev/zzz/capabilities.svelte.js';

Generic interface for a capability with standardized status tracking.

generics

Capability<T>
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

CapabilityBackend
#

CapabilityFilesystem
#

CapabilityProvider
#

CapabilityProviderApi
#

CapabilityProviderApi.svelte view source

import CapabilityProviderApi from '@fuzdev/zzz/CapabilityProviderApi.svelte';

provider_name

type "claude" | "chatgpt" | "gemini"

show_info?

type boolean
optional default true

CapabilitySystem
#

CapabilityWebsocket
#

Cell
#

cell.svelte.ts view source

import {Cell} from '@fuzdev/zzz/cell.svelte.js';

The Cell is the base class for schema-driven data models in Zzz. The goals are still evolving, but a main idea is to have fully reactive state that can be flexibly snapshotted and reinstantiated in a typesafe, extensible system that uses normal Svelte patterns.

The design aims for:

  • Integration with Svelte's reactivity, encouraging single-depth inheritance with Svelte class patterns for both persistent and ephemeral state
  • Schema-driven parsing/validation and JSON serialization/deserialization (supporting snapshot and restore/replay patterns) via Zod
  • Custom property encoding/decoding for complex types, and no boilerplate for schema-inferrable properties
  • Lifecycle management with generic instantiation/registration and disposal (conceptually a WIP, partially implemented)
  • Runtime type metadata for reflection

Cells are automatically registered in the global registry by id, making them discoverable and referenceable throughout the system. Each cell has common properties including id and created/updated timestamps.

There are currently a lot of rough edges and missing features! My hope is that this could be generic enough to extract to a library, but it's not there yet. I assume there's a really nice design in this space that takes full advantage of Svelte runes.

Many things will be possible with this pattern, but it's still a work in progress.

generics

Cell<TSchema extends z.ZodType = z.ZodType>
TSchema
constraint z.ZodType
default z.ZodType

inheritance

implements: CellJson

cid

type number

readonly

id

type Uuid

$state.raw

created

type Datetime

$state.raw

updated

type Datetime

$state.raw

schema

type TSchema

readonly

schema_keys

type Array<SchemaKeys<TSchema>>

readonly $derived

field_schemas

type Map<SchemaKeys<TSchema>, z.ZodType>

readonly $derived

field_schema_info

type Map<SchemaKeys<TSchema>, SchemaClassInfo | null>

readonly $derived

json

type z.output<TSchema>

readonly $derived

json_serialized

type string

readonly $derived

json_parsed

type z.ZodSafeParseResult<z.output<TSchema>>

readonly $derived.by

app

type Frontend

readonly

decoders

Type-safe decoders for custom field decoding. Override in subclasses to handle special field types.

Each decoder function takes a value of any type and should either:

  1. Return a value (including null) to be assigned to the property
  2. Return undefined to use the default decoding behavior
  3. Return HANDLED to indicate the decoder has fully processed the property (virtual properties MUST return HANDLED if they exist in schema but not in class)

type CellValueDecoder<TSchema>

protected

created_date

type Date

readonly $derived

created_formatted_short_date

type string

readonly $derived

created_formatted_datetime

type string

readonly $derived

created_formatted_time

type string

readonly $derived

updated_date

type Date

readonly $derived

updated_formatted_short_date

type string

readonly $derived

updated_formatted_datetime

type string

readonly $derived

updated_formatted_time

type string

readonly $derived

constructor

type new <TSchema extends z.ZodType = ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>(schema: TSchema, options: CellOptions<TSchema>): Cell<TSchema>

schema

type TSchema

options

type CellOptions<TSchema>

init

Initialize the instance with options.json data if provided. Must be called before using the instance - the current pattern is calling it at the end of subclass constructors.

We should investigate deferring to callers so e.g. instantiating from the registry would init automatically, subclasses need no init logic (which can get unwieldy with inheritance), and then callers could always do custom init patterns if they wanted.

Can't be called automatically by the Cell's constructor because the subclass' constructor needs to run first to support field initialization. A design goal behind the Cell is to support normal TS and Svelte patterns with the most power and least intrusion. (there's a balance to find from Zzz's POV)

type (): void

protected
returns void

dispose

Clean up resources when this cell is no longer needed.

type (): void

returns void

[Symbol.dispose]

This is not supported in Safari, don't rely on this yet. Uncomment temporarily to experiment in dev.

type (): void

returns void

register

Register this cell in the global cell registry. Called automatically by init().

type (): void

protected
returns void

unregister

Unregister this cell from the global cell registry. Called automatically by dispose().

type (): void

protected
returns void

toJSON

For Svelte's $snapshot.

type (): output<TSchema>

returns output<TSchema>

to_json

Encodes the cell's serializable state as JSON. Use the derived cell.json if you don't need a fresh copy.

type (): output<TSchema>

returns output<TSchema>

set_json

Apply JSON data to this instance. Overwrites all properties including 'id'. Special-cases created and updated for synchronization.

type (value: input<TSchema> | undefined): void

value

type input<TSchema> | undefined
returns void

set_json_partial

Update only the specified properties on this instance. Preserves current values for any properties not included in the input.

type (partial_value: Partial<input<TSchema>>): void

partial_value

type Partial<input<TSchema>>
returns void

encode_property

Encode a value during serialization. Can be overridden for custom encoding logic. Defaults to Svelte's $state.snapshot, which handles most cases and uses toJSON when available, so overriding to_json is sufficient for most cases before overriding encode_property.

type (value: unknown, _key: string): unknown

value

type unknown

_key

type string
returns unknown

decode_property

Decode a value based on its schema type information. This handles instantiating classes, transforming arrays, and special types.

Complex property types might require custom handling in parser functions rather than using this general decoding mechanism.

type <K extends SchemaKeys<TSchema>>(value: unknown, key: K): any

value

type unknown

key

type K
returns any

assign_property

Process a single schema property during JSON deserialization. This method handles the workflow for mapping schema properties to instance properties.

Flow:

  1. If a decoder exists for this property, try to use it
  2. If decoder returns HANDLED, consider the property fully handled (short circuit)
  3. If decoder returns a value other than HANDLED or undefined, use that value
  4. If decoder returns undefined, fall through to standard decoding
  5. For properties not directly represented in the class instance but defined in the schema, the decoder MUST return HANDLED to indicate proper handling

type (key: SchemaKeys<TSchema>, value: unknown): void

protected

key

type SchemaKeys<TSchema>

value

type unknown
returns void

clone

Generic clone method that works for any subclass.

type (json?: input<TSchema> | undefined, options?: CellOptions<TSchema> | undefined): this

json?

type input<TSchema> | undefined
optional

options?

type CellOptions<TSchema> | undefined
optional
returns this

cell_classes
#

cell_classes.ts view source

{ Parts: typeof Parts; Capabilities: typeof Capabilities; Chat: typeof Chat; Chats: typeof Chats; Diskfile: typeof Diskfile; DiskfileTab: typeof DiskfileTab; DiskfileTabs: typeof DiskfileTabs; ... 23 more ...; Workspaces: typeof Workspaces; } import {cell_classes} from '@fuzdev/zzz/cell_classes.js';

CellClasses
#

cell_classes.ts view source

{ Parts: typeof Parts; Capabilities: typeof Capabilities; Chat: typeof Chat; Chats: typeof Chats; Diskfile: typeof Diskfile; DiskfileTab: typeof DiskfileTab; DiskfileTabs: typeof DiskfileTabs; ... 23 more ...; Workspaces: typeof Workspaces; } import type {CellClasses} from '@fuzdev/zzz/cell_classes.js';

Parts

type typeof Parts

Capabilities

type typeof Capabilities

Chat

type typeof Chat

Chats

type typeof Chats

Diskfile

type typeof Diskfile

DiskfileTab

type typeof DiskfileTab

DiskfileTabs

type typeof DiskfileTabs

DiskfilePart

type typeof DiskfilePart

DiskfileHistory

type typeof DiskfileHistory

Diskfiles

type typeof Diskfiles

DiskfilesEditor

type typeof DiskfilesEditor

Model

type typeof Model

Models

type typeof Models

Action

type typeof Action

Actions

type typeof Actions

Prompt

type typeof Prompt

Prompts

type typeof Prompts

Provider

type typeof Provider

Providers

type typeof Providers

Space

type typeof Space

Spaces

type typeof Spaces

Terminal

type typeof Terminal

TerminalPreset

type typeof TerminalPreset

Turn

type typeof Turn

Thread

type typeof Thread

Threads

type typeof Threads

Time

type typeof Time

TextPart

type typeof TextPart

Ui

type typeof Ui

Workspace

type typeof Workspace

Workspaces

type typeof Workspaces

CellClassNames
#

cell_classes.ts view source

"Chat" | "Prompt" | "Prompts" | "Action" | "Actions" | "Ui" | "Capabilities" | "Parts" | "Chats" | "Diskfile" | "DiskfileTab" | "DiskfileTabs" | "DiskfilePart" | "DiskfileHistory" | ... 16 more ... | "Workspaces" import type {CellClassNames} from '@fuzdev/zzz/cell_classes.js';

CellJson
#

cell_types.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; }, $strict> import type {CellJson} from '@fuzdev/zzz/cell_types.js';

Base schema that defines common properties for all cells.

CellJsonInput
#

cell_types.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; } import type {CellJsonInput} from '@fuzdev/zzz/cell_types.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

CellOptions
#

cell.svelte.ts view source

CellOptions<TSchema> import type {CellOptions} from '@fuzdev/zzz/cell.svelte.js';

Any options besides these declared ones are ignored, so they're safe to forward when subclassing without needing to extract the rest options.

generics

CellOptions<TSchema extends z.ZodType>
TSchema
constraint z.ZodType

app

type Frontend

json?

type z.input<TSchema>

CellRegistry
#

cell_registry.svelte.ts view source

import {CellRegistry} from '@fuzdev/zzz/cell_registry.svelte.js';

Registry for managing cell classes and their instances. The goal is to allow dynamic instantiation of all cells from serializable JSON. CellRegistry does not currently justify its weight/complexity and may be removed in the future, but I want to continue exploring the ideas behind it until we get fully snapshottable UI.

app

type Frontend

readonly

class_names

type Array<string>

readonly $derived

all

type Map<Uuid, Cell>

readonly

constructor

type new (app: Frontend): CellRegistry

app

register

Register a cell class with the registry.

type (constructor: ClassConstructor<Cell<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>>): void

constructor

type ClassConstructor<Cell<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>>
returns void

unregister

Unregister a cell class from the registry.

type (class_name: string): boolean

class_name

type string
returns boolean

maybe_instantiate

Attempt to instantiate a class, returning null if not found. Logs an error in development if the class isn't registered.

type <K extends keyof CellRegistryMap>(class_name: K, json?: (CellRegistryMap[K] extends Cell<infer TSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>> ? input<...> : never) | undefined, options?: object | undefined): CellRegistryMap[K] | null

class_name

type K

json?

type (CellRegistryMap[K] extends Cell<infer TSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>> ? input<TSchema> : never) | undefined
optional

options?

type object | undefined
optional
returns CellRegistryMap[K] | null

instantiate

Create an instance of a registered cell class by name. Throws if the class isn't found.

Type is automatically inferred from class name literals.

type <K extends keyof CellRegistryMap>(class_name: K, json?: (CellRegistryMap[K] extends Cell<infer TSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>> ? input<...> : never) | undefined, options?: object | undefined): CellRegistryMap[K]

class_name

type K

json?

type (CellRegistryMap[K] extends Cell<infer TSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>> ? input<TSchema> : never) | undefined
optional

options?

type object | undefined
optional
returns CellRegistryMap[K]

add_cell

type (cell: Cell<any>): void

cell

type Cell<any>
returns void

remove_cell

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

CellRegistryMap
#

cell_classes.ts view source

CellRegistryMap import type {CellRegistryMap} from '@fuzdev/zzz/cell_classes.js';

Chat

type Chat

Prompt

type Prompt

Prompts

type Prompts

Action

type Action

Actions

type Actions

Ui

type Ui

Capabilities

type Capabilities

Parts

type Parts

Chats

type Chats

Diskfile

type Diskfile

DiskfileTab

type DiskfileTab

DiskfileTabs

type DiskfileTabs

DiskfilePart

type DiskfilePart

DiskfileHistory

type DiskfileHistory

Diskfiles

type Diskfiles

DiskfilesEditor

type DiskfilesEditor

Model

type Model

Models

type Models

Provider

type Provider

Providers

type Providers

Space

type Space

Spaces

type Spaces

Terminal

type Terminal

TerminalPreset

type TerminalPreset

Turn

type Turn

Thread

type Thread

Threads

type Threads

Time

type Time

TextPart

type TextPart

Workspace

type Workspace

Workspaces

type Workspaces

CellValueDecoder
#

cell_helpers.ts view source

CellValueDecoder<TSchema, TKey> import type {CellValueDecoder} from '@fuzdev/zzz/cell_helpers.js';

Type helper for decoders that includes base schema properties. Use this instead of ValueParser when creating decoders for cells to properly type the base properties.

generics

CellValueDecoder<TSchema extends z.ZodType, TKey extends keyof z.infer<TSchema> = keyof z.infer<TSchema>>
TSchema
constraint z.ZodType
TKey
constraint keyof z.infer<TSchema>
default keyof z.infer<TSchema>

Chat
#

chat.svelte.ts view source

import {Chat} from '@fuzdev/zzz/chat.svelte.js';

inheritance

extends: Cell<typeof ChatJson>

name

type string

$state.raw

thread_ids

type Array<Uuid>

$state

main_input

type string

$state.raw

view_mode

type ChatViewMode

$state.raw

selected_thread_id

type Uuid | null

$state.raw

main_input_length

type number

readonly $derived

main_input_token_count

type number

readonly $derived

threads

type Array<Thread>

readonly $derived.by

enabled_threads

type Thread[]

readonly $derived

selected_thread

type Thread | undefined

readonly $derived

current_thread

type Thread | undefined

readonly $derived

init_name_status

type AsyncStatus

$state.raw

constructor

type new (options: ChatOptions): Chat

options

add_thread

type (model: Model, select?: boolean | undefined): void

model

type Model

select?

type boolean | undefined
optional
returns void

add_threads_by_model_tag

type (tag: string): void

tag

type string
returns void

remove_thread

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

remove_threads

type (ids: (string & $brand<"Uuid">)[]): void

ids

type (string & $brand<"Uuid">)[]
returns void

remove_threads_by_model_tag

type (tag: string): void

tag

type string
returns void

remove_all_threads

type (): void

returns void

send_to_all

type (content: string): Promise<void>

content

type string
returns Promise<void>

send_to_thread

type (thread_id: string & $brand<"Uuid">, content: string): Promise<void>

thread_id

type string & $brand<"Uuid">

content

type string
returns Promise<void>

init_name_from_turns

Uses an LLM to name the chat based on the user input and AI response. Ignores failures and retries on next intention.

type (user_content: string, assistant_content: string): Promise<void>

user_content

type string

assistant_content

type string
returns Promise<void>

select_thread

Reorder threads by moving from one index to another

type (thread_id: (string & $brand<"Uuid">) | null): void

thread_id

type (string & $brand<"Uuid">) | null
returns void

reorder_threads

type (from_index: number, to_index: number): void

from_index

type number

to_index

type number
returns void

chat_template_defaults
#

config_defaults.ts view source

ChatTemplate[] import {chat_template_defaults} from '@fuzdev/zzz/config_defaults.js';

Default chat templates available in the application

ChatContextmenu
#

ChatInitializer
#

ChatInitializer.svelte view source

import ChatInitializer from '@fuzdev/zzz/ChatInitializer.svelte';

chat?

type Chat
optional

oninit?

type (chat_id: string & $brand<"Uuid">) => void
optional

heading?

type string
optional default 'create new chat'

items?

type Model[]
optional

ChatJson
#

chat.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 5 more ...; selected_thread_id: ZodDefault<...>; }, $strict> import type {ChatJson} from '@fuzdev/zzz/chat.svelte.js';

ChatJsonInput
#

chat.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; } import type {ChatJsonInput} from '@fuzdev/zzz/chat.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

thread_ids?

type string[]

main_input?

type string

view_mode?

type "simple" | "multi"

selected_thread_id?

type string

ChatList
#

ChatListitem
#

ChatOptions
#

chat.svelte.ts view source

ChatOptions import type {ChatOptions} from '@fuzdev/zzz/chat.svelte.js';

inheritance

extends: CellOptions<typeof ChatJson>

Chats
#

chats.svelte.ts view source

import {Chats} from '@fuzdev/zzz/chats.svelte.js';

inheritance

extends: Cell<typeof ChatsJson>

items

type IndexedCollection<Chat>

readonly

selected_id_last_non_null

type Uuid | null

$state.raw

selected

type Chat | undefined

readonly $derived

selected_id_error

type boolean

readonly $derived

show_sort_controls

Controls visibility of sort controls in the chats list.

type boolean

$state.raw

ordered_items

Ordered array of chats derived from the manual_order index.

type Array<Chat>

readonly $derived

items_by_name

type SvelteMap<any, Chat>

readonly $derived

constructor

type new (options: ChatsOptions): Chats

options

add

type (json?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; } | undefined, select?: boolean | undefined): Chat

json?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; } | undefined
optional

select?

type boolean | undefined
optional
returns Chat

generate_unique_name

type (base_name?: string): string

base_name

type string
default 'new chat'
returns string

add_chat

type (chat: Chat, select?: boolean | undefined): Chat

chat

type Chat

select?

type boolean | undefined
optional
returns Chat

add_many

type (chats_json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; }[], select?: number | ... 1 more ... | undefined): Chat[]

chats_json

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; }[]

select?

type number | boolean | undefined
optional
returns Chat[]

remove

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

remove_many

type (ids: (string & $brand<"Uuid">)[]): number

ids

type (string & $brand<"Uuid">)[]
returns number

select

type (chat_id: (string & $brand<"Uuid">) | null): Promise<void>

chat_id

type (string & $brand<"Uuid">) | null
returns Promise<void>

select_next

type (): Promise<void>

returns Promise<void>

navigate_to

type (chat_id: (string & $brand<"Uuid">) | null, force?: boolean): Promise<void>

chat_id

type (string & $brand<"Uuid">) | null

force

type boolean
default false
returns Promise<void>

reorder_chats

type (from_index: number, to_index: number): void

from_index

type number

to_index

type number
returns void

toggle_sort_controls

Toggles the visibility of sort controls in the chats list.

type (value?: boolean): void

value

type boolean
default !this.show_sort_controls
returns void

chat_templates

type ChatTemplate[]

$state.raw

get_template_by_id

type (id: string): ChatTemplate | undefined

id

type string
returns ChatTemplate | undefined

get_default_template

type (): ChatTemplate

returns ChatTemplate

selected_id

type (string & $brand<"Uuid">) | null

gettersetter

ChatSchema
#

ChatsContextmenu
#

ChatsJson
#

chats.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 4 more ...; show_sort_controls: ZodDefault<...>; }, $strict> import type {ChatsJson} from '@fuzdev/zzz/chats.svelte.js';

ChatsJsonInput
#

chats.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | ... import type {ChatsJsonInput} from '@fuzdev/zzz/chats.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; }[]

selected_id?

type string

selected_id_last_non_null?

type string

show_sort_controls?

type boolean

ChatsOptions
#

chats.svelte.ts view source

ChatsOptions import type {ChatsOptions} from '@fuzdev/zzz/chats.svelte.js';

inheritance

extends: CellOptions<typeof ChatsJson>

ChatsSchema
#

ChatTemplate
#

chat_template.ts view source

ChatTemplate import type {ChatTemplate} from '@fuzdev/zzz/chat_template.js';

Represents a template for creating a new chat with specific model configurations

id

type Uuid

name

Human-readable name of the template.

type string

model_names

List of model names to include in chats created from this template.

type Array<string>

ChatThread
#

ChatThread.svelte view source

import ChatThread from '@fuzdev/zzz/ChatThread.svelte';

thread

type Thread

onsend

type (input: string) => Promise<void>

focus_key?

type string | number
optional

pending_element_to_focus_key?

type string | number
optional bindable

turns_attrs?

type HTMLAttributes<HTMLDivElement>
optional

attrs?

type HTMLAttributes<HTMLDivElement>
optional

ChatThreadAddByModel
#

ChatThreadAddByModel.svelte view source

accepts children

import ChatThreadAddByModel from '@fuzdev/zzz/ChatThreadAddByModel.svelte';

chat

type Chat

attrs?

type HTMLAttributes<HTMLDivElement>
optional

children?

type Snippet<[]>
optional

ChatThreadManageByTag
#

ChatView
#

ChatViewMode
#

ChatViewMulti
#

ChatViewSimple
#

ClassNotRegisteredError
#

cell_registry.svelte.ts view source

import {ClassNotRegisteredError} from '@fuzdev/zzz/cell_registry.svelte.js';

Error thrown when attempting to instantiate an unregistered class.

inheritance

extends: Error

class_name

type string

readonly

available_classes

type Array<string>

readonly

constructor

type new (class_name: string, available_classes: string[], options?: ErrorOptions | undefined): ClassNotRegisteredError

class_name

type string

available_classes

type string[]

options?

type ErrorOptions | undefined
optional

ClearRestoreButton
#

ClearRestoreButton.svelte view source

accepts children

import ClearRestoreButton from '@fuzdev/zzz/ClearRestoreButton.svelte';

value

type string | (string[] & string)
bindable

restore_icon?

type string | Snippet<[]> | SvgData
optional default icon_restore

clear_icon?

type string | Snippet<[]> | SvgData
optional default icon_clear

intersects

SvelteHTMLElements['button']

click_outside
#

click_outside.svelte.ts view source

(cb: () => void): Attachment<HTMLElement> import {click_outside} from '@fuzdev/zzz/click_outside.svelte.js';

Creates an attachment that calls cb when a mousedown occurs outside the element.

cb

type () => void

returns

Attachment<HTMLElement>

completion_create_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; provider_name: ZodEnum<...>; model: ZodString; prompt: ZodStrin... import {completion_create_action_spec} from '@fuzdev/zzz/action_specs.js';

completion_progress_action_spec
#

action_specs.ts view source

{ method: string; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ chunk: ZodOptional<ZodObject<{ model: ZodOptional<ZodString>; created_at: ZodOptional<...>; done: ZodOptional<...>; message: ZodOptional<...>; }, $loose>>; _meta: ZodOptional<...>; }, $strict>; out... import {completion_progress_action_spec} from '@fuzdev/zzz/action_specs.js';

CompletionCreateInput
#

action_specs.ts view source

ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; prompt: ZodString; completion_messages: ZodOptional<...>; }, $strict>; _meta: ZodOptional<...>; }, $s... import type {CompletionCreateInput} from '@fuzdev/zzz/action_specs.js';

Input for completion_create.

CompletionCreateOutput
#

action_specs.ts view source

ZodObject<{ completion_response: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; data: ZodDiscriminatedUnion<...>; }, $strict>; _meta: ZodOptional<...>; }, $strict> import type {CompletionCreateOutput} from '@fuzdev/zzz/action_specs.js';

Output for completion_create.

CompletionMessage
#

completion_types.ts view source

ZodObject<{ role: ZodString; content: ZodString; }, $loose> import type {CompletionMessage} from '@fuzdev/zzz/completion_types.js';

CompletionProgressInput
#

action_specs.ts view source

ZodObject<{ chunk: ZodOptional<ZodObject<{ model: ZodOptional<ZodString>; created_at: ZodOptional<ZodString>; done: ZodOptional<ZodBoolean>; message: ZodOptional<...>; }, $loose>>; _meta: ZodOptional<...>; }, $strict> import type {CompletionProgressInput} from '@fuzdev/zzz/action_specs.js';

Input for completion_progress.

TODO improve chunk schema. Today it carries a loose provider-shaped payload (model, created_at, done, message); add done_reason, timing fields (total_duration, load_duration, prompt_eval_*, eval_*), thinking, images, tool_calls as more provider streams land.

CompletionRequest
#

completion_types.ts view source

ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; prompt: ZodString; completion_messages: ZodOptional<...>; }, $strict> import type {CompletionRequest} from '@fuzdev/zzz/completion_types.js';

CompletionResponse
#

completion_types.ts view source

ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; data: ZodDiscriminatedUnion<...>; }, $strict> import type {CompletionResponse} from '@fuzdev/zzz/completion_types.js';

CompletionRole
#

CONTENT_PREVIEW_LENGTH
#

ContentEditor
#

ContentEditor.svelte view source

accepts children

import ContentEditor from '@fuzdev/zzz/ContentEditor.svelte';

Focus the textarea element - exposed for parent components.

content

type string
bindable

token_count?

Estimated if not provided and show_stats is true.

type number
optional

placeholder?

type string
optional default format_placeholder()

readonly?

type boolean
optional default false

show_stats?

type boolean
optional default false

show_actions?

type boolean
optional default false

textarea_height?

type string
optional

focus_key?

type string | number
optional

pending_element_to_focus_key?

type string | number
optional bindable

attrs?

type HTMLTextareaAttributes
optional

after?

type Snippet<[]>
optional

children?

type Snippet<[]>
optional

onsave?

type (value: string) => void
optional

ContentPreview
#

ContentPreview.svelte view source

import ContentPreview from '@fuzdev/zzz/ContentPreview.svelte';

content

type string

height?

type string
optional default '200px'

min_height?

type string
optional default height

max_height?

type string
optional default height

attrs?

type HTMLAttributes<HTMLPreElement>
optional

ContentStats
#

ContextmenuEntryCopyToClipboard
#

ContextmenuEntryCopyToClipboard.svelte view source

accepts children

import ContextmenuEntryCopyToClipboard from '@fuzdev/zzz/ContextmenuEntryCopyToClipboard.svelte';

content

type string | Thunk<string> | undefined

label?

type string
optional default 'copy'

preview?

type string
optional

preview_limit?

type number
optional

show_preview?

type boolean
optional default true

children?

type Snippet<[]>
optional

intersects

OmitStrict<ComponentProps<typeof ContextmenuEntry>, 'run' | 'children'>

ContextmenuEntryToggle
#

ContextmenuEntryToggle.svelte view source

accepts children

import ContextmenuEntryToggle from '@fuzdev/zzz/ContextmenuEntryToggle.svelte';

enabled

type boolean
bindable

label?

type string
optional default 'item'

children?

type Snippet<[enabled: boolean]>
optional
snippet parameters
enabled boolean

intersects

OmitStrict<Partial<ComponentProps<typeof ContextmenuEntry>>, 'children'>

create_client_id
#

helpers.ts view source

(): string import {create_client_id} from '@fuzdev/zzz/helpers.js';

Creates an id suitable for insecure use on a single client, like for element ids.

returns

string

create_derived_index
#

indexed_collection_helpers.svelte.ts view source

<T extends IndexedItem, TResult extends Array<T> = T[]>(options: DerivedIndexOptions<T, TResult>): IndexDefinition<T, TResult, void> import {create_derived_index} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Creates an incremental derived collection index.

options

type DerivedIndexOptions<T, TResult>

returns

IndexDefinition<T, TResult, void>

generics

create_derived_index<T extends IndexedItem, TResult extends Array<T> = Array<T>>
T
constraint IndexedItem
TResult
constraint Array<T>
default Array<T>

create_dynamic_index
#

indexed_collection_helpers.svelte.ts view source

<T extends IndexedItem, F extends (...args: Array<any>) => any>(options: DynamicIndexOptions<T, F>): IndexDefinition<T, F, Parameters<F>[0]> import {create_dynamic_index} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Create a dynamic index that computes results on-demand based on query parameters.

options

type DynamicIndexOptions<T, F>

returns

IndexDefinition<T, F, Parameters<F>[0]>

generics

create_dynamic_index<T extends IndexedItem, F extends (...args: Array<any>) => any>
T
constraint IndexedItem
F
constraint (...args: Array<any>) => any

create_frontend_action_handlers
#

create_map_by_property
#

iterable_helpers.ts view source

<T, K extends keyof T>(items: Iterable<T>, property: K): Map<T[K], T> import {create_map_by_property} from '@fuzdev/zzz/iterable_helpers.js';

Creates a Map from an iterable, keyed by a specified property.

items

type Iterable<T>

property

type K

returns

Map<T[K], T>

generics

create_map_by_property<T, K extends keyof T>
T
K
constraint keyof T

create_multi_index
#

indexed_collection_helpers.svelte.ts view source

<T extends IndexedItem, K>(options: MultiIndexOptions<T, K>): IndexDefinition<T, SvelteMap<K, T[]>, K> import {create_multi_index} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Create a multi-value index (one key maps to many items).

options

type MultiIndexOptions<T, K>

returns

IndexDefinition<T, SvelteMap<K, T[]>, K>

generics

create_multi_index<T extends IndexedItem, K>
T
constraint IndexedItem
K

create_single_index
#

indexed_collection_helpers.svelte.ts view source

<T extends IndexedItem, K>(options: SingleIndexOptions<T, K>): IndexDefinition<T, SvelteMap<K, T>, K> import {create_single_index} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Create a single-value index (one key maps to one item).

options

type SingleIndexOptions<T, K>

returns

IndexDefinition<T, SvelteMap<K, T>, K>

generics

create_single_index<T extends IndexedItem, K>
T
constraint IndexedItem
K

create_turn_from_part
#

turn.svelte.ts view source

(part: PartUnion, role: string, json: Partial<OmitStrict<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; ... 5 more ...; error_message?: string | undefined; }, "role" | "part_ids">>): Turn import {create_turn_from_part} from '@fuzdev/zzz/turn.svelte.js';

part

role

type string

json

type Partial<OmitStrict<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; part_ids: (string & $brand<"Uuid">)[]; ... 4 more ...; error_message?: string | undefined; }, "role" | "part_ids">>

returns

Turn

create_turn_from_parts
#

turn.svelte.ts view source

(parts: PartUnion[], role: string, json: Partial<OmitStrict<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; ... 5 more ...; error_message?: string | undefined; }, "role" | "part_ids">>): Turn import {create_turn_from_parts} from '@fuzdev/zzz/turn.svelte.js';

parts

type PartUnion[]

role

type string

json

type Partial<OmitStrict<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; part_ids: (string & $brand<"Uuid">)[]; ... 4 more ...; error_message?: string | undefined; }, "role" | "part_ids">>

returns

Turn

create_turn_from_text
#

turn.svelte.ts view source

(content: string, role: string, json: Partial<OmitStrict<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; part_ids: (string & $brand<...>)[]; ... 4 more ...; error_message?: string | undefined; }, "role" | "part_ids">>, app: Frontend): Turn import {create_turn_from_text} from '@fuzdev/zzz/turn.svelte.js';

content

type string

role

type string

json

type Partial<OmitStrict<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; part_ids: (string & $brand<"Uuid">)[]; ... 4 more ...; error_message?: string | undefined; }, "role" | "part_ids">>

app

returns

Turn

Dashboard
#

DashboardActions
#

DashboardCapabilities
#

DashboardChats
#

DashboardDiskfiles
#

DashboardHeader
#

DashboardHeader.svelte view source

accepts children

import DashboardHeader from '@fuzdev/zzz/DashboardHeader.svelte';

header

type Snippet<[]>

children

type Snippet<[]>

DashboardHome
#

DashboardModels
#

DashboardPrompts
#

DashboardProviders
#

DashboardSettings
#

DEFAULT_AUTO_RECONNECT
#

DEFAULT_HEARTBEAT_INTERVAL
#

DEFAULT_RECONNECT_DELAY
#

DEFAULT_RECONNECT_DELAY_MAX
#

defined
#

helpers.ts view source

<T>(value: T | undefined): T import {defined} from '@fuzdev/zzz/helpers.js';

value

type T | undefined

returns

T

generics

defined<T>
T

DerivedIndexOptions
#

indexed_collection_helpers.svelte.ts view source

DerivedIndexOptions<T, TResult> import type {DerivedIndexOptions} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Options for derived indexes.

generics

DerivedIndexOptions<T extends IndexedItem, TResult extends Array<T> = Array<T>>
T
constraint IndexedItem
TResult
constraint Array<T>
default Array<T>

inheritance

extends: IndexOptions<T, void>

compute

Function that computes the derived collection from the full collection.

type (collection: IndexedCollection<T>) => TResult

sort?

Optional sort function for the derived array.

type (a: T, b: T) => number

onadd?

Optional custom add handler.

type (items: TResult, item: T, collection: IndexedCollection<T>) => TResult

onremove?

Optional custom remove handler.

type (items: TResult, item: T, collection: IndexedCollection<T>) => TResult

DESK_WIDTH
#

DeskMenu
#

detect_reorderable_direction
#

reorderable_helpers.ts view source

(element: HTMLElement): ReorderableDirection import {detect_reorderable_direction} from '@fuzdev/zzz/reorderable_helpers.js';

Detect layout direction from an element - supports flex and grid.

element

type HTMLElement

returns

ReorderableDirection

directory_create_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath", "out">; }, $strict>; output: ZodNull; async: true; description: string; } import {directory_create_action_spec} from '@fuzdev/zzz/action_specs.js';

DirectoryCreateInput
#

action_specs.ts view source

ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath", "out">; }, $strict> import type {DirectoryCreateInput} from '@fuzdev/zzz/action_specs.js';

Input for directory_create.

Diskfile
#

diskfile.svelte.ts view source

import {Diskfile} from '@fuzdev/zzz/diskfile.svelte.js';

inheritance

extends: Cell<typeof DiskfileJson>

path

type DiskfilePath

$state.raw

source_dir

type DiskfileDirectoryPath

$state.raw

content

type string | null

$state.raw

part

type PartUnion | undefined

readonly $derived

dependents

type Array<[DiskfilePath, SerializableDisknode]>

$state.raw

dependencies

type Array<[DiskfilePath, SerializableDisknode]>

$state.raw

dependencies_count

type number

readonly $derived

dependents_count

type number

readonly $derived

pathname

e.g. .zzz/foo/bar.json

type string | null | undefined

readonly $derived

path_relative

e.g. bar/foo.json

type string | null | undefined

readonly $derived

content_length

type number

readonly $derived

content_preview

type string

readonly $derived

constructor

type new (options: DiskfileOptions): Diskfile

options

diskfile_delete_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath", "out">; }, $strict>; output: ZodNull; async: true; description: string; } import {diskfile_delete_action_spec} from '@fuzdev/zzz/action_specs.js';

diskfile_update_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath", "out">; content: ZodString; }, $strict>; output: ZodNull; async: true; description: string; } import {diskfile_update_action_spec} from '@fuzdev/zzz/action_specs.js';

DiskfileActions
#

DiskfileChange
#

diskfile_types.ts view source

ZodObject<{ type: ZodEnum<{ add: "add"; change: "change"; delete: "delete"; }>; path: $ZodBranded<ZodString, "DiskfilePath", "out">; }, $strict> import type {DiskfileChange} from '@fuzdev/zzz/diskfile_types.js';

DiskfileChangeType
#

diskfile_types.ts view source

ZodEnum<{ add: "add"; change: "change"; delete: "delete"; }> import type {DiskfileChangeType} from '@fuzdev/zzz/diskfile_types.js';

DiskfileContextmenu
#

DiskfileContextmenu.svelte view source

accepts children

import DiskfileContextmenu from '@fuzdev/zzz/DiskfileContextmenu.svelte';

diskfile

type Diskfile | null | undefined

children

type Snippet<[]>

DiskfileDeleteInput
#

action_specs.ts view source

ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath", "out">; }, $strict> import type {DiskfileDeleteInput} from '@fuzdev/zzz/action_specs.js';

Input for diskfile_delete.

DiskfileDirectoryPath
#

diskfile_types.ts view source

$ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out"> import type {DiskfileDirectoryPath} from '@fuzdev/zzz/diskfile_types.js';

These always have a trailing slash.

DiskfileEditorNav
#

DiskfileEditorState
#

diskfile_editor_state.svelte.ts view source

import {DiskfileEditorState} from '@fuzdev/zzz/diskfile_editor_state.svelte.js';

Manages the editor state for a diskfile.

app

type Frontend

diskfile

type Diskfile

$state.raw

unsaved_edit_entry_id

type Uuid | null

$state.raw

selected_history_entry_id

type Uuid | null

$state.raw

content_was_modified_by_user

type boolean

$state.raw

last_seen_disk_content

type string | null

$state.raw

original_content

type string | null

readonly $derived

path

type DiskfilePath

readonly $derived.by

has_changes

type boolean

readonly $derived.by

history

type DiskfileHistory | undefined

readonly $derived.by

selected_history_entry

type { id: string & $brand<"Uuid">; created: number; content: string; label: string; is_disk_change: boolean; is_unsaved_edit: boolean; is_original_state: boolean; } | null | undefined

readonly $derived.by

content_history

type Array<HistoryEntry>

readonly $derived

saved_history_entries

type Array<HistoryEntry>

readonly $derived

unsaved_history_entries

type Array<HistoryEntry>

readonly $derived

has_history

type boolean

readonly $derived

has_unsaved_edits

type boolean

readonly $derived

can_clear_history

type boolean

readonly $derived

can_clear_unsaved_edits

type boolean

readonly $derived

unsaved_entry_ids

type (string & $brand<"Uuid">)[]

readonly $derived

content_matching_entry_ids

type Array<Uuid>

readonly $derived

original_length

type number

readonly $derived.by

current_length

type number

readonly $derived

length_diff

type number

readonly $derived

length_diff_percent

type number

readonly $derived

original_token_count

type number

readonly $derived.by

current_token_count

type number

readonly $derived

token_diff

type number

readonly $derived

token_diff_percent

type number

readonly $derived

constructor

type new (options: { app: Frontend; diskfile: Diskfile; }): DiskfileEditorState

options

type { app: Frontend; diskfile: Diskfile; }

reset

Clear and reset the editor state to match the current diskfile content.

type (): void

returns void

check_disk_changes

Check if the diskfile content has changed on disk. Call this when receiving file updates from the server.

type (): void

returns void

save_changes

Save changes to the diskfile.

type (): Promise<boolean>

returns Promise<boolean>

set_content_from_history

Set content from history entry.

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

update_diskfile

Update the diskfile reference. This allows reusing the same editor state instance with a new diskfile.

type (diskfile: Diskfile): void

diskfile

returns void

clear_history

Clear content history, keeping only specific entries based on selection state.

type (): void

returns void

clear_unsaved_edits

Clear all unsaved edit entries from history and reset the editor state if needed.

type (): void

returns void

current_content

type string

gettersetter

DiskfileEditorView
#

DiskfileExplorer
#

DiskfileHistory
#

diskfile_history.svelte.ts view source

import {DiskfileHistory} from '@fuzdev/zzz/diskfile_history.svelte.js';

Stores edit history for a single diskfile.

inheritance

extends: Cell<typeof DiskfileHistoryJson>

path

type DiskfilePath

$state.raw

entries

type Array<HistoryEntry>

$state

max_entries

type number

$state.raw

current_entry

The most recent history entry (by creation timestamp) Since entries are always kept sorted by creation time (newest first), the most recent is always the first element.

type HistoryEntry | null

readonly $derived

constructor

type new (options: DiskfileHistoryOptions): DiskfileHistory

options

add_entry

Add a new history entry.

type (content: string, options?: { is_disk_change?: boolean | undefined; is_unsaved_edit?: boolean | undefined; is_original_state?: boolean | undefined; label?: string | undefined; created?: number | undefined; }): { ...; }

content

type string

options

type { is_disk_change?: boolean | undefined; is_unsaved_edit?: boolean | undefined; is_original_state?: boolean | undefined; label?: string | undefined; created?: number | undefined; }
default EMPTY_OBJECT
returns { id: string & $brand<"Uuid">; created: number; content: string; label: string; is_disk_change: boolean; is_unsaved_edit: boolean; is_original_state: boolean; }

find_entry_by_id

Find a history entry by id.

type (id: string & $brand<"Uuid">): { id: string & $brand<"Uuid">; created: number; content: string; label: string; is_disk_change: boolean; is_unsaved_edit: boolean; is_original_state: boolean; } | undefined

id

type string & $brand<"Uuid">
returns { id: string & $brand<"Uuid">; created: number; content: string; label: string; is_disk_change: boolean; is_unsaved_edit: boolean; is_original_state: boolean; } | undefined

get_content

Get the content of a specific history entry.

type (id: string & $brand<"Uuid">): string | null

id

type string & $brand<"Uuid">
returns string | null

clear_except_current

Clear all history entries except the most recent one by creation time and any entries that match the optional keep predicate.

type (keep?: ((entry: { id: string & $brand<"Uuid">; created: number; content: string; label: string; is_disk_change: boolean; is_unsaved_edit: boolean; is_original_state: boolean; }) => boolean) | undefined): void

keep?

type ((entry: { id: string & $brand<"Uuid">; created: number; content: string; label: string; is_disk_change: boolean; is_unsaved_edit: boolean; is_original_state: boolean; }) => boolean) | undefined
optional
returns void

DiskfileHistoryJson
#

diskfile_history.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; path: $ZodBranded<...>; entries: ZodDefault<...>; max_entries: ZodDefault<...>; }, $strict> import type {DiskfileHistoryJson} from '@fuzdev/zzz/diskfile_history.svelte.js';

Schema for the DiskfileHistory cell.

DiskfileHistoryJsonInput
#

diskfile_history.svelte.ts view source

{ path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; entries?: { created: number; content: string; label: string; id?: string | undefined; is_disk_change?: boolean | undefined; is_unsaved_edit?: boolean | undefined; is_original_state?: boolean | undefined; }[] | undefi... import type {DiskfileHistoryJsonInput} from '@fuzdev/zzz/diskfile_history.svelte.js';

path

type string

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

entries?

type { created: number; content: string; label: string; id?: string | undefined; is_disk_change?: boolean | undefined; is_unsaved_edit?: boolean | undefined; is_original_state?: boolean | undefined; }[]

max_entries?

type number

DiskfileHistoryOptions
#

DiskfileHistoryView
#

DiskfileInfo
#

DiskfileJson
#

diskfile_types.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 5 more ...; dependencies: ZodDefault<...>; }, $strict> import type {DiskfileJson} from '@fuzdev/zzz/diskfile_types.js';

DiskfileJsonInput
#

diskfile_types.ts view source

{ source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | null | undefined; content?: string | null | undefined; dependents?: [...][] | ... 1 more ... | undefined; dependencies?: [...][] | ... 1 more ... | undefined; } import type {DiskfileJsonInput} from '@fuzdev/zzz/diskfile_types.js';

source_dir

type string

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

path?

type string

content?

type string

dependents?

type [string, { id: string; source_dir: string; contents: string | null; ctime: number | null; mtime: number | null; dependents: [string, any][]; dependencies: [string, any][]; }][]

dependencies?

type [string, { id: string; source_dir: string; contents: string | null; ctime: number | null; mtime: number | null; dependents: [string, any][]; dependencies: [string, any][]; }][]

DiskfileListitem
#

DiskfileListitem.svelte view source

import DiskfileListitem from '@fuzdev/zzz/DiskfileListitem.svelte';

diskfile

selected?

type boolean
optional default false

attrs?

type Record<string, unknown>
optional

onselect?

open_not_preview indicates a "open_not_preview select" like a doubleclick or enter keypress.

type (diskfile: Diskfile, open_not_preview: boolean) => void
optional

DiskfileMetrics
#

DiskfileOptions
#

diskfile.svelte.ts view source

DiskfileOptions import type {DiskfileOptions} from '@fuzdev/zzz/diskfile.svelte.js';

inheritance

extends: CellOptions<typeof DiskfileJson>

DiskfilePart
#

part.svelte.ts view source

import {DiskfilePart} from '@fuzdev/zzz/part.svelte.js';

Diskfile part - references content from a Diskfile.

inheritance

extends: Part<typeof DiskfilePartJson>

type

type "diskfile"

readonly

diskfile

type Diskfile | null | undefined

readonly $derived

relative_path

type string | null | undefined

readonly $derived

constructor

type new (options: DiskfilePartOptions): DiskfilePart

options

link_editor_state

Links this part to an editor state.

type (editor_state: { current_content: string; } | null): void

editor_state

type { current_content: string; } | null
returns void

path

Writable value that determines this.diskfile. Also includes special diskfile part logic for attributes.

type (string & $brand<"DiskfilePath">) | null

gettersetter

content

type string | null | undefined

gettersetter

DiskfilePartJson
#

part.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 11 more ...; has_xml_tag: ZodDefault<...>; }, $strict> import type {DiskfilePartJson} from '@fuzdev/zzz/part.svelte.js';

Diskfile part schema - references a diskfile.

DiskfilePartJsonInput
#

part.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; xml_tag_name?: string | undefined; ... 6 more ...; has_xml_tag?: boolean | undefined; } import type {DiskfilePartJsonInput} from '@fuzdev/zzz/part.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

start?

type number

end?

type number

xml_tag_name?

type string

attributes?

type { id?: string | undefined; key?: string | undefined; value?: string | undefined; }[]

enabled?

type boolean

title?

type string

summary?

type string

type?

type "diskfile"

path?

type string

has_xml_tag?

type boolean

DiskfilePartOptions
#

DiskfilePartSchema
#

part.svelte.ts view source

ZodCustom<DiskfilePart, DiskfilePart> import {DiskfilePartSchema} from '@fuzdev/zzz/part.svelte.js';

DiskfilePartView
#

DiskfilePath
#

diskfile_types.ts view source

$ZodBranded<ZodString, "DiskfilePath", "out"> import type {DiskfilePath} from '@fuzdev/zzz/diskfile_types.js';

An absolute Unix-style file path.

DiskfilePicker
#

DiskfilePicker.svelte view source

import DiskfilePicker from '@fuzdev/zzz/DiskfilePicker.svelte';

onpick

type (diskfile: Diskfile | undefined) => boolean | void

filter?

type (diskfile: Diskfile) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

selected_ids?

type (string & $brand<"Uuid">)[]
optional

DiskfilePickerDialog
#

DiskfilePickerDialog.svelte view source

import DiskfilePickerDialog from '@fuzdev/zzz/DiskfilePickerDialog.svelte';

onpick

type (diskfile: Diskfile | undefined) => boolean | void

show?

type boolean
optional bindable default false

filter?

type (diskfile: Diskfile) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

selected_ids?

type (string & $brand<"Uuid">)[]
optional

dialog_props?

type OmitStrict<Omit<HTMLDialogAttributes, "children" | "onclose"> & { show?: boolean | undefined; align?: DialogAlign | undefined; dismissable?: boolean | undefined; content_selector?: string | undefined; onbeforeclose?: (() => boolean | void) | undefined; onclose?: (() => void) | undefined; children: Snippet<...>; }, "...
optional

Diskfiles
#

diskfiles.svelte.ts view source

import {Diskfiles} from '@fuzdev/zzz/diskfiles.svelte.js';

inheritance

extends: Cell<typeof DiskfilesJson>

items

type IndexedCollection<Diskfile>

readonly

selected_file_id

type Uuid | null

$state.raw

selected_file

type Diskfile | null

readonly $derived

editor

The editor for managing diskfiles editing state.

type DiskfilesEditor

readonly

constructor

type new (options: DiskfilesOptions): Diskfiles

options

handle_change

type (params: { change: { type: "add" | "change" | "delete"; path: string & $brand<"DiskfilePath">; }; disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<...> & $brand<...>; ... 4 more ...; dependencies: [...][]; }; }): void

params

type { change: { type: "add" | "change" | "delete"; path: string & $brand<"DiskfilePath">; }; disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<...>; ... 4 more ...; dependencies: [...][]; }; }
returns void

add

type (json: { source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | null | undefined; content?: string | null | undefined; dependents?: [...][] | ... 1 more ... | undefined; dependencies?: [...][] | ... 1 more ... | undefined; }, auto_select?: boolean): Diskfile

json

type { source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | null | undefined; content?: string | null | undefined; dependents?: [...][] | ... 1 more ... | undefined; dependencies?: [...][] | ... 1 more ... | undefined; }

auto_select

type boolean
default true
returns Diskfile

add_initial

Seed diskfiles from an initial file tree (e.g. session load or workspace open).

type (files: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }[]): void

files

type { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }[]
returns void

update

type (path: string & $brand<"DiskfilePath">, content: string): Promise<void>

path

type string & $brand<"DiskfilePath">

content

type string
returns Promise<void>

delete

type (path: string & $brand<"DiskfilePath">): Promise<void>

path

type string & $brand<"DiskfilePath">
returns Promise<void>

create_file

type (filename: string, content?: string): Promise<void>

filename

type string

content

type string
default ''
returns Promise<void>

create_directory

type (dirname: string): Promise<void>

dirname

type string
returns Promise<void>

get_by_path

type (path: string & $brand<"DiskfilePath">): Diskfile | undefined

path

type string & $brand<"DiskfilePath">
returns Diskfile | undefined

to_relative_path

The value undefined means uninitialized, null means loading, '' means none.

type (path: string): string | null | undefined

path

type string
returns string | null | undefined

select

Select a diskfile by id and also update the editor tabs. Default to the first file if id is undefined. If id is null, it selects no file. If open_not_preview is true, opens as a permanent tab, otherwise previews.

type (id: (string & $brand<"Uuid">) | null | undefined, open_not_preview?: boolean): void

id

type (string & $brand<"Uuid">) | null | undefined

open_not_preview

type boolean
default false
returns void

select_next

type (): void

returns void

DiskfileSchema
#

DiskfilesEditor
#

diskfiles_editor.svelte.ts view source

import {DiskfilesEditor} from '@fuzdev/zzz/diskfiles_editor.svelte.js';

Editor state management for diskfiles.

inheritance

extends: Cell<typeof DiskfilesEditorJson>

show_sort_controls

Controls visibility of sort controls in the file explorer.

type boolean

$state.raw

tabs

Tabs for managing the open diskfiles.

type DiskfileTabs

readonly

constructor

type new (options: DiskfilesEditorOptions): DiskfilesEditor

options

preview_diskfile

Opens a diskfile in preview mode.

type (diskfile_id: string & $brand<"Uuid">): void

diskfile_id

type string & $brand<"Uuid">
returns void

open_diskfile

Opens a diskfile in permanent mode.

type (diskfile_id: string & $brand<"Uuid">): void

diskfile_id

type string & $brand<"Uuid">
returns void

reorder_tabs

Reorders tabs.

type (from_index: number, to_index: number): void

from_index

type number

to_index

type number
returns void

select_tab

Selects a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id

type string & $brand<"Uuid">
returns void

close_tab

Closes a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id

type string & $brand<"Uuid">
returns void

reopen_last_closed_tab

Reopens the last closed tab.

type (): void

returns void

promote_preview_tab

Promotes the current preview tab to permanent.

type (): void

returns void

open_tab

Opens (makes permanent) a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id

type string & $brand<"Uuid">
returns void

handle_file_modified

Handles when a diskfile's content is modified.

type (diskfile_id: string & $brand<"Uuid">): void

diskfile_id

type string & $brand<"Uuid">
returns void

sync_selected_file

Syncs the selected diskfile in diskfiles with the selected tab.

type (): void

returns void

toggle_sort_controls

Toggles the visibility of sort controls in the file explorer.

type (value?: boolean): void

value

type boolean
default !this.show_sort_controls
returns void

DiskfilesEditorJson
#

diskfiles_editor.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; show_sort_controls: ZodDefault<...>; }, $strict> import type {DiskfilesEditorJson} from '@fuzdev/zzz/diskfiles_editor.svelte.js';

DiskfilesEditorJsonInput
#

diskfiles_editor.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; show_sort_controls?: boolean | undefined; } import type {DiskfilesEditorJsonInput} from '@fuzdev/zzz/diskfiles_editor.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

show_sort_controls?

type boolean

DiskfilesEditorOptions
#

DiskfilesEditorSchema
#

DiskfilesJson
#

diskfiles.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; diskfiles: ZodDefault<...>; selected_file_id: ZodDefault<...>; }, $strict> import type {DiskfilesJson} from '@fuzdev/zzz/diskfiles.svelte.js';

DiskfilesJsonInput
#

diskfiles.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; diskfiles?: { source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | ... 1 more ... | undefined; content?: string | ... 1 more ... | undefined; dependents?: [...][]... import type {DiskfilesJsonInput} from '@fuzdev/zzz/diskfiles.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

diskfiles?

type { source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | null | undefined; content?: string | null | undefined; dependents?: [...][] | ... 1 more ... | undefined; dependencies?: [...][] | ... 1 more ... | undefined; }[]

selected_file_id?

type string

DiskfilesOptions
#

diskfiles.svelte.ts view source

DiskfilesOptions import type {DiskfilesOptions} from '@fuzdev/zzz/diskfiles.svelte.js';

inheritance

extends: CellOptions<typeof DiskfilesJson>

DiskfileTab
#

diskfile_tab.svelte.ts view source

import {DiskfileTab} from '@fuzdev/zzz/diskfile_tab.svelte.js';

inheritance

extends: Cell<typeof DiskfileTabJson>

diskfile_id

type Uuid

$state.raw

tabs

Reference to the parent tabs collection, allowing us to have collection-derived data, at the cost of requiring exactly 1 parent.

This pattern is somewhat experimental - the idea is it's more declarative to have things like the "preview" or "selected" tabs be state on the collection, so it doesn't need to be separately managed as state on each tab.

type DiskfileTabs

readonly

is_preview

Derived from parent collection's state.

type boolean

readonly $derived.by

is_selected

Derived from parent collection's state.

type boolean

readonly $derived.by

diskfile

type Diskfile | undefined

readonly $derived

constructor

type new (options: DiskfileTabOptions): DiskfileTab

options

DiskfileTabJson
#

diskfile_tab.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; diskfile_id: $ZodBranded<...>; }, $strict> import type {DiskfileTabJson} from '@fuzdev/zzz/diskfile_tab.svelte.js';

DiskfileTabJsonInput
#

diskfile_tab.svelte.ts view source

{ diskfile_id: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; } import type {DiskfileTabJsonInput} from '@fuzdev/zzz/diskfile_tab.svelte.js';

diskfile_id

type string

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

DiskfileTabListitem
#

DiskfileTabListitem.svelte view source

import DiskfileTabListitem from '@fuzdev/zzz/DiskfileTabListitem.svelte';

tab

onselect

type (tab: DiskfileTab) => void

onclose

type (tab: DiskfileTab) => void

onopen

type (tab: DiskfileTab) => void

DiskfileTabOptions
#

DiskfileTabs
#

diskfile_tabs.svelte.ts view source

import {DiskfileTabs} from '@fuzdev/zzz/diskfile_tabs.svelte.js';

Manages tabs for diskfiles in the editor with preview behavior.

inheritance

extends: Cell<typeof DiskfileTabsJson>

selected_tab_id

type Uuid | null

$state.raw

preview_tab_id

type Uuid | null

$state.raw

tab_order

type Array<Uuid>

$state

recent_tab_ids

type Array<Uuid>

$state.raw

max_tab_history

type number

$state.raw

items

type IndexedCollection<DiskfileTab>

by_diskfile_id

Map for looking up tabs by their associated diskfile_id.

type Map<Uuid, DiskfileTab>

readonly $derived

ordered_tabs

Ordered array of tabs derived directly from tab_order. Includes tabs in the explicit order plus any tabs not yet in the order.

type Array<DiskfileTab>

readonly $derived.by

selected_tab

The currently selected tab.

type DiskfileTab | undefined

readonly $derived

selected_diskfile_id

The selected tab's diskfile id.

type Uuid | null

readonly $derived

preview_tab

The preview tab, if any.

type DiskfileTab | undefined

readonly $derived

recent_tabs

type Array<DiskfileTab>

readonly $derived.by

recently_closed_tabs

Recently closed tabs for potential reopening.

type Array<DiskfileTab>

$state

closed_tab_diskfiles

Map of closed tab ids to their diskfile ids - used for browser navigation.

type SvelteMap<Uuid, Uuid>

readonly

constructor

type new (options: DiskfileTabsOptions): DiskfileTabs

options

find_most_recent_tab

Returns the most recently accessed tab id that still exists, excluding the specified tab id.

type (exclude_id: string & $brand<"Uuid">): (string & $brand<"Uuid">) | null

exclude_id

type string & $brand<"Uuid">
returns (string & $brand<"Uuid">) | null

select_tab

Sets the selected tab.

type (tab_id: string & $brand<"Uuid">): void

tab_id

type string & $brand<"Uuid">
returns void

preview_diskfile

Handles preview state when opening a file. If a preview tab for this file already exists, it just selects it.

type (diskfile_id: string & $brand<"Uuid">): DiskfileTab

diskfile_id

type string & $brand<"Uuid">
returns DiskfileTab

open_diskfile

Opens a diskfile as a permanent tab (not preview). If the file is already in a preview tab, promotes it to permanent.

type (diskfile_id: string & $brand<"Uuid">): DiskfileTab

diskfile_id

type string & $brand<"Uuid">
returns DiskfileTab

promote_preview_to_permanent

Promotes the current preview tab to a permanent tab.

type (): boolean

returns boolean

true if a tab was promoted, false otherwise

close_tab

Closes a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id

type string & $brand<"Uuid">
returns void

navigate_to_tab

Navigates to a tab by id. If the tab doesn't exist but was previously closed, creates a preview tab for that diskfile.

type (tab_id: string & $brand<"Uuid">): { resulting_tab_id: (string & $brand<"Uuid">) | null; created_preview: boolean; }

tab_id

the tab id to navigate to

type string & $brand<"Uuid">
returns { resulting_tab_id: (string & $brand<"Uuid">) | null; created_preview: boolean; }

object containing the resulting tab id and a boolean indicating if a new tab was created

open_tab

Opens (makes permanent) a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id

type string & $brand<"Uuid">
returns void

reorder_tabs

Reorders tabs by dragging.

type (from_index: number, to_index: number): void

from_index

type number

to_index

type number
returns void

reopen_last_closed_tab

Reopens the last closed tab.

type (): void

returns void

close_all_tabs

Closes all tabs.

type (): void

returns void

DiskfileTabSchema
#

DiskfileTabsJson
#

diskfile_tabs.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 5 more ...; max_tab_history: ZodDefault<...>; }, $strict> import type {DiskfileTabsJson} from '@fuzdev/zzz/diskfile_tabs.svelte.js';

DiskfileTabsJsonInput
#

diskfile_tabs.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; selected_tab_id?: string | null | undefined; preview_tab_id?: string | null | undefined; tab_order?: string[] | undefined; recent_tab_ids?: string[] | undefined; max_tab_history?: number | undefined; } import type {DiskfileTabsJsonInput} from '@fuzdev/zzz/diskfile_tabs.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

selected_tab_id?

type string

preview_tab_id?

type string

tab_order?

type string[]

recent_tab_ids?

Tracks recently accessed tabs for better tab selection when closing tabs.

type string[]

max_tab_history?

Maximum number of tabs to track in access history.

type number

DiskfileTabsOptions
#

DiskfileTabsSchema
#

DiskfileUpdateInput
#

action_specs.ts view source

ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath", "out">; content: ZodString; }, $strict> import type {DiskfileUpdateInput} from '@fuzdev/zzz/action_specs.js';

Input for diskfile_update.

disknode_to_diskfile_json
#

diskfile_helpers.ts view source

(disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }, existing_id?: string & $brand<...>): { ...; } import {disknode_to_diskfile_json} from '@fuzdev/zzz/diskfile_helpers.js';

Converts a SerializableDisknode to the DiskfileJson format.

disknode

the source file to convert

type { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; contents: string | null; ctime: number | null; mtime: number | null; dependents: [...][]; dependencies: [...][]; }

existing_id

optional existing Uuid to preserve id stability across updates

type string & $brand<"Uuid">
default create_uuid()

returns

{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; path: (string & $brand<"DiskfilePath">) | null; source_dir: string & ... 1 more ... & $brand<...>; content: string | null; dependents: [...][] | null; dependencies: [...][] | null; }

DRAG_OVER_BOTTOM_CLASS_DEFAULT
#

DRAG_OVER_CLASS_DEFAULT
#

DRAG_OVER_LEFT_CLASS_DEFAULT
#

DRAG_OVER_RIGHT_CLASS_DEFAULT
#

DRAG_OVER_TOP_CLASS_DEFAULT
#

DRAGGING_CLASS_DEFAULT
#

DURATION_LG
#

DURATION_SM
#

DynamicIndexOptions
#

indexed_collection_helpers.svelte.ts view source

DynamicIndexOptions<T, F> import type {DynamicIndexOptions} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Options for dynamic indexes.

generics

DynamicIndexOptions<T extends IndexedItem, F extends (...args: Array<any>) => any>
T
constraint IndexedItem
F
constraint (...args: Array<any>) => any

inheritance

extends: IndexOptions<T, Parameters<F>[0]>

factory

Function that creates a query function from the collection.

type (collection: IndexedCollection<T>) => F

onadd?

Optional custom add handler.

type (fn: F, item: T, collection: IndexedCollection<T>) => F

onremove?

Optional custom remove handler.

type (fn: F, item: T, collection: IndexedCollection<T>) => F

EditableText
#

EditableText.svelte view source

import EditableText from '@fuzdev/zzz/EditableText.svelte';

value

type string
bindable

attrs?

type HTMLAttributes<HTMLSpanElement>
optional

span_attrs?

type HTMLAttributes<HTMLSpanElement>
optional

input_attrs?

type HTMLInputAttributes
optional

ErrorMessage
#

ErrorMessageInline
#

ErrorMessageInline.svelte view source

accepts children

import ErrorMessageInline from '@fuzdev/zzz/ErrorMessageInline.svelte';

icon?

type SvgData
optional default icon_error

children

type Snippet<[]>

estimate_token_count
#

helpers.ts view source

(text: string): number import {estimate_token_count} from '@fuzdev/zzz/helpers.js';

Quick and dirty token count estimate using ESTIMATED_CHARS_PER_TOKEN. Real tokenizers are heavy and of little benefit for our cases right now, especially because each LLM may tokenize differently.

text

type string

returns

number

ESTIMATED_CHARS_PER_TOKEN
#

ExternalLink
#

ExternalLinkIcon
#

ExternalLinkIcon.svelte view source

accepts children

import ExternalLinkIcon from '@fuzdev/zzz/ExternalLinkIcon.svelte';

children?

type Snippet<[icon: SvgData]>
optional
snippet parameters
icon SvgData

FailedMessage
#

socket.svelte.ts view source

FailedMessage import type {FailedMessage} from '@fuzdev/zzz/socket.svelte.js';

Failed message that exceeded retry count.

inheritance

extends: QueuedMessage

failed

type number

reason

type string

FILE_DATETIME_FORMAT
#

FILE_SHORT_DATE_FORMAT
#

FILE_TIME_FORMAT
#

filer_change_action_spec
#

action_specs.ts view source

{ method: string; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ change: ZodObject<{ type: ZodEnum<{ add: "add"; change: "change"; delete: "delete"; }>; path: $ZodBranded<...>; }, $strict>; disknode: ZodObject<...>; }, $strict>; output: ZodVoid; async: true; des... import {filer_change_action_spec} from '@fuzdev/zzz/action_specs.js';

FilerChangeInput
#

action_specs.ts view source

ZodObject<{ change: ZodObject<{ type: ZodEnum<{ add: "add"; change: "change"; delete: "delete"; }>; path: $ZodBranded<ZodString, "DiskfilePath", "out">; }, $strict>; disknode: ZodObject<...>; }, $strict> import type {FilerChangeInput} from '@fuzdev/zzz/action_specs.js';

Input for filer_change.

FilesystemCapabilityData
#

capabilities.svelte.ts view source

FilesystemCapabilityData import type {FilesystemCapabilityData} from '@fuzdev/zzz/capabilities.svelte.js';

zzz_dir

type DiskfileDirectoryPath | null | undefined

scoped_dirs

type ReadonlyArray<DiskfileDirectoryPath>

Footer
#

format_datetime
#

time_helpers.ts view source

(value: TimeValue | null | undefined, fallback?: string): string import {format_datetime} from '@fuzdev/zzz/time_helpers.js';

value

type TimeValue | null | undefined

fallback

type string
default ''

returns

string

format_gigabytes
#

format_helpers.ts view source

(gb: number): string import {format_gigabytes} from '@fuzdev/zzz/format_helpers.js';

gb

type number

returns

string

format_ms_to_readable
#

time_helpers.ts view source

(ms: number, decimals?: number): string import {format_ms_to_readable} from '@fuzdev/zzz/time_helpers.js';

ms

type number

decimals

type number
default 0

returns

string

format_placeholder
#

helpers.ts view source

(text?: string | null | undefined): string import {format_placeholder} from '@fuzdev/zzz/helpers.js';

Formats input placeholder text, prefixed with a โ†ณ arrow. The arrow is a text glyph rather than an icon_* SVG because the placeholder attribute can't host markup.

text?

type string | null | undefined
optional

returns

string

format_prompt_content
#

prompt_helpers.ts view source

(parts: PartUnion[]): string import {format_prompt_content} from '@fuzdev/zzz/prompt_helpers.js';

Formats a collection of parts into a prompt string, applying XML tags and attributes where specified.

parts

type PartUnion[]

returns

string

format_short_date
#

time_helpers.ts view source

(value: TimeValue | null | undefined, fallback?: string): string import {format_short_date} from '@fuzdev/zzz/time_helpers.js';

value

type TimeValue | null | undefined

fallback

type string
default ''

returns

string

format_time
#

time_helpers.ts view source

(value: TimeValue | null | undefined, fallback?: string): string import {format_time} from '@fuzdev/zzz/time_helpers.js';

value

type TimeValue | null | undefined

fallback

type string
default ''

returns

string

format_timestamp
#

time_helpers.ts view source

(value: TimeValue | null | undefined, fallback?: string): string import {format_timestamp} from '@fuzdev/zzz/time_helpers.js';

value

type TimeValue | null | undefined

fallback

type string
default ''

returns

string

Frontend
#

frontend.svelte.ts view source

import {Frontend} from '@fuzdev/zzz/frontend.svelte.js';

The base frontend app, typically used by creating your own App extends Frontend. Gettable with frontend_context.get() inside a FrontendRoot.

inheritance

extends: Cell<typeof FrontendJson>
implements: ActionEventEnvironment

executor

type ActionExecutor

readonly

cell_registry

App-wide cell registry, maps class names to constructor and tracks registered instances.

type CellRegistry

readonly

action_registry

type ActionRegistry

readonly

action_handlers

type FrontendActionHandlers

readonly

api

type FrontendActionsApi

readonly

peer

type ActionDispatcher

readonly

time

type Time

readonly

ui

type Ui

readonly

models

type Models

readonly

chats

type Chats

readonly

threads

type Threads

readonly

providers

type Providers

readonly

prompts

type Prompts

readonly

parts

type Parts

readonly

diskfiles

type Diskfiles

readonly

actions

type Actions

readonly

socket

type Socket

readonly

capabilities

type Capabilities

readonly

spaces

type Spaces

readonly

workspaces

type Workspaces

readonly

bots

type ZzzOptions['bots']

readonly

terminal_writers

Callback registry for terminal data routing. TerminalView components register their write callback on mount.

type Map<Uuid, (data: string) => void>

readonly

terminal_exit_handlers

Callback registry for terminal exit notifications. TerminalView components register their exit callback on mount.

type Map<Uuid, (exit_code: number | null) => void>

readonly

provider_status

Tracks which providers are available (configured with API keys).

type Array<ProviderStatus>

$state

tags

type Set<string>

readonly $derived.by

diskfile_histories

type SvelteMap<DiskfilePath, DiskfileHistory>

readonly

futuremode

See into Zzz's future.

type boolean

$state.raw

constructor

type new (options?: FrontendOptions): Frontend

options

default EMPTY_OBJECT

receive_session

type (data: { zzz_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; scoped_dirs: readonly (string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">)[]; files: { ...; }[]; provider_status: ({ ...; } | { ...; })[]; workspaces: { ...; }[]; }): void

data

type { zzz_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; scoped_dirs: readonly (string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">)[]; files: { ...; }[]; provider_status: ({ ...; } | { ...; })[]; workspaces: { ...; }[]; }
returns void

add_providers

type (providers_json: { name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }[]): void

providers_json

type { name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }[]
returns void

add_provider

type (provider_json: { name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }): void

provider_json

type { name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }
returns void

lookup_provider_status

type (provider_name: string): { name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; } | null

provider_name

type string
returns { name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; } | null

update_provider_status

type (status: { name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }): void

status

type { name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }
returns void

get_diskfile_history

type (path: string & $brand<"DiskfilePath">): DiskfileHistory | undefined

path

type string & $brand<"DiskfilePath">
returns DiskfileHistory | undefined

create_diskfile_history

type (path: string & $brand<"DiskfilePath">): DiskfileHistory

path

type string & $brand<"DiskfilePath">

lookup_action_handler

type (method: string, phase: "send" | "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "receive" | "execute"): ((event: any) => any) | undefined

method

type string

phase

type "send" | "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "receive" | "execute"
returns ((event: any) => any) | undefined

lookup_action_spec

type (method: string): { method: string; initiator: "frontend" | "backend" | "both"; side_effects: boolean; input: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; ... 7 more ...; rate_limit?: "both" | ... 2 more ... | undefined; } | { ...; } | { ...; } | undefined

method

type string
returns { method: string; initiator: "frontend" | "backend" | "both"; side_effects: boolean; input: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; output: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; ... 6 more ...; rate_limit?: "both" | ... 2 more ... | undefined; } | { ...; } | { ...; }...

zzz_dir

The zzz_dir is the path to Zzz's primary directory on the server's filesystem. The server's ScopedFs instance restricts operations to this directory. The value is undefined when uninitialized, null when loading, and '' when disabled or no server.

type (string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">) | null | undefined

gettersetter

scoped_dirs

Additional filesystem paths the server can access for user files.

type readonly (string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">)[]

gettersetter

frontend_context
#

frontend.svelte.ts view source

{ get: (error_message?: string | undefined) => Frontend; get_maybe: () => Frontend | undefined; set: (value: Frontend) => Frontend; } import {frontend_context} from '@fuzdev/zzz/frontend.svelte.js';

FrontendActionHandlers
#

frontend_action_types.ts view source

FrontendActionHandlers import type {FrontendActionHandlers} from '@fuzdev/zzz/frontend_action_types.js';

Frontend action handlers organized by method and phase. Generated using spec.initiator to determine valid phases:

  • initiator: 'frontend' โ†’ send/execute phases
  • initiator: 'backend' โ†’ receive phases
  • initiator: 'both' โ†’ all valid phases

heartbeat?

type { send_request?: ( action_event: TypedActionEvent<'heartbeat', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'heartbeat', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'heartbeat', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'heartbeat', 'receive_error', 'handling'>, ) => void | Promise<void>; }

cancel?

type { send?: (action_event: TypedActionEvent<'cancel', 'send', 'handling'>) => void | Promise<void>; }

ping?

type { send_request?: ( action_event: TypedActionEvent<'ping', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'ping', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'ping', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'ping', 'receive_error', 'handling'>, ) => void | Promise<void>; receive_request?: ( action_event: TypedActionEvent<'ping', 'receive_request', 'handling'>, ) => ActionOutputs['ping'] | Promise<ActionOutputs['ping']>; send_response?: ( action_event: TypedActionEvent<'ping', 'send_response', 'handling'>, ) => void | Promise<void>; }

session_load?

type { send_request?: ( action_event: TypedActionEvent<'session_load', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'session_load', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'session_load', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'session_load', 'receive_error', 'handling'>, ) => void | Promise<void>; }

filer_change?

type { receive?: ( action_event: TypedActionEvent<'filer_change', 'receive', 'handling'>, ) => void | Promise<void>; }

diskfile_update?

type { send_request?: ( action_event: TypedActionEvent<'diskfile_update', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'diskfile_update', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'diskfile_update', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'diskfile_update', 'receive_error', 'handling'>, ) => void | Promise<void>; }

diskfile_delete?

type { send_request?: ( action_event: TypedActionEvent<'diskfile_delete', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'diskfile_delete', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'diskfile_delete', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'diskfile_delete', 'receive_error', 'handling'>, ) => void | Promise<void>; }

directory_create?

type { send_request?: ( action_event: TypedActionEvent<'directory_create', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'directory_create', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'directory_create', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'directory_create', 'receive_error', 'handling'>, ) => void | Promise<void>; }

completion_create?

type { send_request?: ( action_event: TypedActionEvent<'completion_create', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'completion_create', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'completion_create', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'completion_create', 'receive_error', 'handling'>, ) => void | Promise<void>; }

completion_progress?

type { receive?: ( action_event: TypedActionEvent<'completion_progress', 'receive', 'handling'>, ) => void | Promise<void>; }

toggle_main_menu?

type { execute?: ( action_event: TypedActionEvent<'toggle_main_menu', 'execute', 'handling'>, ) => ActionOutputs['toggle_main_menu']; }

provider_load_status?

type { send_request?: ( action_event: TypedActionEvent<'provider_load_status', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'provider_load_status', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'provider_load_status', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'provider_load_status', 'receive_error', 'handling'>, ) => void | Promise<void>; }

provider_update_api_key?

type { send_request?: ( action_event: TypedActionEvent<'provider_update_api_key', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'provider_update_api_key', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'provider_update_api_key', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'provider_update_api_key', 'receive_error', 'handling'>, ) => void | Promise<void>; }

terminal_create?

type { send_request?: ( action_event: TypedActionEvent<'terminal_create', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'terminal_create', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'terminal_create', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'terminal_create', 'receive_error', 'handling'>, ) => void | Promise<void>; }

terminal_data_send?

type { send_request?: ( action_event: TypedActionEvent<'terminal_data_send', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'terminal_data_send', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'terminal_data_send', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'terminal_data_send', 'receive_error', 'handling'>, ) => void | Promise<void>; }

terminal_data?

type { receive?: ( action_event: TypedActionEvent<'terminal_data', 'receive', 'handling'>, ) => void | Promise<void>; }

terminal_resize?

type { send_request?: ( action_event: TypedActionEvent<'terminal_resize', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'terminal_resize', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'terminal_resize', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'terminal_resize', 'receive_error', 'handling'>, ) => void | Promise<void>; }

terminal_close?

type { send_request?: ( action_event: TypedActionEvent<'terminal_close', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'terminal_close', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'terminal_close', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'terminal_close', 'receive_error', 'handling'>, ) => void | Promise<void>; }

terminal_exited?

type { receive?: ( action_event: TypedActionEvent<'terminal_exited', 'receive', 'handling'>, ) => void | Promise<void>; }

workspace_open?

type { send_request?: ( action_event: TypedActionEvent<'workspace_open', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'workspace_open', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'workspace_open', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'workspace_open', 'receive_error', 'handling'>, ) => void | Promise<void>; }

workspace_close?

type { send_request?: ( action_event: TypedActionEvent<'workspace_close', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'workspace_close', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'workspace_close', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'workspace_close', 'receive_error', 'handling'>, ) => void | Promise<void>; }

workspace_list?

type { send_request?: ( action_event: TypedActionEvent<'workspace_list', 'send_request', 'handling'>, ) => void | Promise<void>; receive_response?: ( action_event: TypedActionEvent<'workspace_list', 'receive_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: TypedActionEvent<'workspace_list', 'send_error', 'handling'>, ) => void | Promise<void>; receive_error?: ( action_event: TypedActionEvent<'workspace_list', 'receive_error', 'handling'>, ) => void | Promise<void>; }

workspace_changed?

type { receive?: ( action_event: TypedActionEvent<'workspace_changed', 'receive', 'handling'>, ) => void | Promise<void>; }

FrontendActionMethod
#

action_metatypes.ts view source

ZodEnum<{ ping: "ping"; heartbeat: "heartbeat"; cancel: "cancel"; "peer/ping": "peer/ping"; session_load: "session_load"; filer_change: "filer_change"; diskfile_update: "diskfile_update"; diskfile_delete: "diskfile_delete"; ... 15 more ...; workspace_changed: "workspace_changed"; }> import type {FrontendActionMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of all actions in the typed FrontendActionsApi surface โ€” every spec the frontend may encounter (call, receive, or execute locally).

FrontendActionsApi
#

action_metatypes.ts view source

FrontendActionsApi import type {FrontendActionsApi} from '@fuzdev/zzz/action_metatypes.js';

Typed dispatch surface for the frontend's RPC client. Symmetric counterpart of BackendActionsApi. Async methods (request_response, remote_notification, async local_call) return Promise<Result<...>> and accept an optional RpcClientCallOptions second arg that threads signal, transport_name, and queue through to the peer. Sync local_call methods return values directly.

heartbeat

type ( input?: ActionInputs['heartbeat'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['heartbeat']}, {error: JsonrpcErrorObject}>>

cancel

type ( input: ActionInputs['cancel'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['cancel']}, {error: JsonrpcErrorObject}>>

ping

type ( input?: void, options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['ping']}, {error: JsonrpcErrorObject}>>

session_load

type ( input?: void, options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['session_load']}, {error: JsonrpcErrorObject}>>

filer_change

type ( input: ActionInputs['filer_change'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['filer_change']}, {error: JsonrpcErrorObject}>>

diskfile_update

type ( input: ActionInputs['diskfile_update'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['diskfile_update']}, {error: JsonrpcErrorObject}>>

diskfile_delete

type ( input: ActionInputs['diskfile_delete'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['diskfile_delete']}, {error: JsonrpcErrorObject}>>

directory_create

type ( input: ActionInputs['directory_create'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['directory_create']}, {error: JsonrpcErrorObject}>>

completion_create

type ( input: ActionInputs['completion_create'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['completion_create']}, {error: JsonrpcErrorObject}>>

completion_progress

type ( input?: ActionInputs['completion_progress'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['completion_progress']}, {error: JsonrpcErrorObject}>>

toggle_main_menu

type (input?: ActionInputs['toggle_main_menu']) => ActionOutputs['toggle_main_menu']

provider_load_status

type ( input: ActionInputs['provider_load_status'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['provider_load_status']}, {error: JsonrpcErrorObject}>>

provider_update_api_key

type ( input: ActionInputs['provider_update_api_key'], options?: RpcClientCallOptions, ) => Promise< Result<{value: ActionOutputs['provider_update_api_key']}, {error: JsonrpcErrorObject}> >

terminal_create

type ( input: ActionInputs['terminal_create'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['terminal_create']}, {error: JsonrpcErrorObject}>>

terminal_data_send

type ( input: ActionInputs['terminal_data_send'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['terminal_data_send']}, {error: JsonrpcErrorObject}>>

terminal_data

type ( input: ActionInputs['terminal_data'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['terminal_data']}, {error: JsonrpcErrorObject}>>

terminal_resize

type ( input: ActionInputs['terminal_resize'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['terminal_resize']}, {error: JsonrpcErrorObject}>>

terminal_close

type ( input: ActionInputs['terminal_close'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['terminal_close']}, {error: JsonrpcErrorObject}>>

terminal_exited

type ( input: ActionInputs['terminal_exited'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['terminal_exited']}, {error: JsonrpcErrorObject}>>

workspace_open

type ( input: ActionInputs['workspace_open'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['workspace_open']}, {error: JsonrpcErrorObject}>>

workspace_close

type ( input: ActionInputs['workspace_close'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['workspace_close']}, {error: JsonrpcErrorObject}>>

workspace_list

type ( input?: void, options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['workspace_list']}, {error: JsonrpcErrorObject}>>

workspace_changed

type ( input: ActionInputs['workspace_changed'], options?: RpcClientCallOptions, ) => Promise<Result<{value: ActionOutputs['workspace_changed']}, {error: JsonrpcErrorObject}>>

FrontendJson
#

frontend.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; ui: ZodDefault<...>; }, $strict> import type {FrontendJson} from '@fuzdev/zzz/frontend.svelte.js';

FrontendJsonInput
#

frontend.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ui?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; show_main_dialog?: boolean | undefined; ... 6 more ...; desk_pinned?: boolean | undefined; } | undefined; } import type {FrontendJsonInput} from '@fuzdev/zzz/frontend.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

ui?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; show_main_dialog?: boolean | undefined; show_sidebar?: boolean | undefined; tutorial_for_database?: boolean | undefined; ... 4 more ...; desk_pinned?: boolean | undefined; }

FrontendOptions
#

frontend.svelte.ts view source

FrontendOptions import type {FrontendOptions} from '@fuzdev/zzz/frontend.svelte.js';

inheritance

extends: OmitStrict<CellOptions<typeof FrontendJson>, 'app'>

app?

Do not use - optional to avoid circular reference problem.

type never

models?

type Array<ModelJsonInput>

bots?

type ZzzOptions['bots']

providers?

type Array<ProviderJsonInput>

cell_classes?

type Record<string, ClassConstructor<Cell<any>>>

action_specs?

type Array<ActionSpecUnion>

action_handlers?

type FrontendActionHandlers

http_rpc_url?

type string | null

http_headers?

type Record<string, string>

socket_url?

type string | null

FrontendRequestResponseMethod
#

action_metatypes.ts view source

ZodEnum<{ ping: "ping"; }> import type {FrontendRequestResponseMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of request_response actions the frontend handles (initiator excludes frontend).

FrontendRoot
#

gen
#

get_cell_class_names
#

cell_classes.ts view source

(): ("Chat" | "Prompt" | "Prompts" | "Action" | "Actions" | "Ui" | "Capabilities" | "Parts" | "Chats" | "Diskfile" | "DiskfileTab" | "DiskfileTabs" | "DiskfilePart" | "DiskfileHistory" | ... 16 more ... | "Workspaces")[] import {get_cell_class_names} from '@fuzdev/zzz/cell_classes.js';

Get a list of all registered cell class names.

returns

("Chat" | "Prompt" | "Prompts" | "Action" | "Actions" | "Ui" | "Capabilities" | "Parts" | "Chats" | "Diskfile" | "DiskfileTab" | "DiskfileTabs" | "DiskfilePart" | "DiskfileHistory" | ... 16 more ... | "Workspaces")[]

get_global_cell_count
#

cell.svelte.ts view source

(): number import {get_global_cell_count} from '@fuzdev/zzz/cell.svelte.js';

A monotonic id for cell instances on the client. This is not reactive and never changes on the instance, whereas id can change. It's useful for ordering - the motivating usecase was correctly sorting objects with the same created millisecond.

This may cause issues based on how data gets queried, but at least it's stable once loaded. However we may need to revisit this if it causes problems.

returns

number

get_icon_for_action_kind
#

action_icons.ts view source

(kind: "request_response" | "remote_notification" | "local_call"): SvgData import {get_icon_for_action_kind} from '@fuzdev/zzz/action_icons.js';

kind

type "request_response" | "remote_notification" | "local_call"

returns

SvgData

get_icon_for_action_method
#

action_icons.ts view source

(method: "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | "completion_progress" | ... 12 more ... | "workspace_changed"): SvgData import {get_icon_for_action_method} from '@fuzdev/zzz/action_icons.js';

method

type "ping" | "heartbeat" | "cancel" | "peer/ping" | "session_load" | "filer_change" | "diskfile_update" | "diskfile_delete" | "directory_create" | "completion_create" | "completion_progress" | ... 12 more ... | "workspace_changed"

returns

SvgData

get_part_type_icon
#

get_reorderable_drop_position
#

reorderable_helpers.ts view source

(direction: ReorderableDirection, source_index: number, target_index: number): ReorderableValidDropPosition import {get_reorderable_drop_position} from '@fuzdev/zzz/reorderable_helpers.js';

Determine the drop position based on source and target indices and layout direction.

direction

source_index

type number

target_index

type number

returns

ReorderableValidDropPosition

get_schema_class_info
#

cell_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | null | undefined): SchemaClassInfo | null import {get_schema_class_info} from '@fuzdev/zzz/cell_helpers.js';

Get schema class information from a Zod schema. This helps determine how to decode values based on their schema definition.

schema

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | null | undefined

returns

SchemaClassInfo | null

get_unique_name
#

helpers.ts view source

(name: string, existing_names: { has: (name: string) => boolean; } | { includes: (name: string) => boolean; }): string import {get_unique_name} from '@fuzdev/zzz/helpers.js';

name

type string

existing_names

type { has: (name: string) => boolean; } | { includes: (name: string) => boolean; }

returns

string

goto_unless_current
#

navigation_helpers.ts view source

(path: string | URL, options?: { replaceState?: boolean | undefined; noScroll?: boolean | undefined; keepFocus?: boolean | undefined; invalidateAll?: boolean | undefined; invalidate?: (string | ... 1 more ... | ((url: URL) => boolean))[] | undefined; state?: PageState | undefined; } | undefined): Promise<...> import {goto_unless_current} from '@fuzdev/zzz/navigation_helpers.js';

Navigate to a path only if we're not already on that path. This avoids unnecessary navigation history changes when already at the destination.

path

type string | URL

options?

type { replaceState?: boolean | undefined; noScroll?: boolean | undefined; keepFocus?: boolean | undefined; invalidateAll?: boolean | undefined; invalidate?: (string | URL | ((url: URL) => boolean))[] | undefined; state?: PageState | undefined; } | undefined
optional

returns

Promise<void>

handle_testing_emit_notifications
#

testing_action_specs.ts view source

(input: { count: number; }, ctx: ActionContext): { count: number; } | Promise<{ count: number; }> import {handle_testing_emit_notifications} from '@fuzdev/zzz/testing_action_specs.js';

Handler for _testing_emit_notifications. Emits count notifications via ctx.notify.

input

type { count: number; }

ctx

type ActionContext

returns

{ count: number; } | Promise<{ count: number; }>

HANDLED
#

cell_helpers.ts view source

unique symbol import {HANDLED} from '@fuzdev/zzz/cell_helpers.js';

Sentinel value to indicate a parser has completely handled a property.

has_dependencies
#

HISTORY_LIMIT_DEFAULT
#

HistoryEntry
#

diskfile_history.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodNumber; content: ZodString; label: ZodString; is_disk_change: ZodDefault<...>; is_unsaved_edit: ZodDefault<...>; is_original_state: ZodDefault<...>; }, $strict> import type {HistoryEntry} from '@fuzdev/zzz/diskfile_history.svelte.js';

Schema for history entries.

IndexDefinition
#

indexed_collection.svelte.ts view source

IndexDefinition<T, TResult, TQuery> import type {IndexDefinition} from '@fuzdev/zzz/indexed_collection.svelte.js';

Generic index definition with full flexibility.

generics

IndexDefinition<T extends IndexedItem, TResult = any, TQuery = any>
T
constraint IndexedItem
TResult
default any
TQuery
default any

key

Unique identifier for this index.

type string

type?

Optional index type for simpler creation.

type IndexType

extractor?

Optional extractor function for single/multi indexes.

type (item: T) => any

compute

Function to compute the index value from scratch.

type (collection: IndexedCollection<T>) => TResult

query_schema?

Schema for validating query parameters.

type z.ZodType<TQuery>

matches?

Optional predicate to determine if an item is relevant to this index.

type (item: T) => boolean

onadd?

Optional function to update the index when an item is added.

type (result: TResult, item: T, collection: IndexedCollection<T>) => TResult

onremove?

Optional function to update the index when an item is removed.

type (result: TResult, item: T, collection: IndexedCollection<T>) => TResult

IndexedCollection
#

indexed_collection.svelte.ts view source

import {IndexedCollection} from '@fuzdev/zzz/indexed_collection.svelte.js';

A helper class for managing collections with incremental updates, efficient querying, and automatic index maintenance.

generics

IndexedCollection<T extends IndexedItem, TKeySingle extends string = string, TKeyMulti extends string = string, TKeyDerived extends string = string, TKeyDynamic extends string = string>
T
constraint IndexedItem
TKeySingle
constraint string
default string
TKeyMulti
constraint string
default string
TKeyDerived
constraint string
default string
TKeyDynamic
constraint string
default string

by_id

The main source of truth, the full collection keyed by Uuid.

type SvelteMap<Uuid, T>

readonly

values

type Array<T>

readonly $derived

keys

type Array<Uuid>

readonly $derived

size

Get the current count of items.

type number

readonly $derived

indexes

Stores all index values in a reactive object.

type Record<string, any>

readonly $state

constructor

type new <T extends IndexedItem, TKeySingle extends string = string, TKeyMulti extends string = string, TKeyDerived extends string = string, TKeyDynamic extends string = string>(options?: IndexedCollectionOptions<T, TKeySingle, TKeyMulti, TKeyDerived, TKeyDynamic> | undefined): IndexedCollection<...>

options?

type IndexedCollectionOptions<T, TKeySingle, TKeyMulti, TKeyDerived, TKeyDynamic> | undefined
optional

toJSON

type (): readonly any[]

returns readonly any[]

get_index

Get a typed index value by key.

type <TResult = any>(key: TKeySingle | TKeyMulti | TKeyDerived | TKeyDynamic): TResult

key

type TKeySingle | TKeyMulti | TKeyDerived | TKeyDynamic
returns TResult

single_index

Get a single-value index with proper typing.

type (key: TKeySingle): SvelteMap<any, T>

key

type TKeySingle
returns SvelteMap<any, T>

multi_index

Get a multi-value index with proper typing.

type (key: TKeyMulti): SvelteMap<any, T[]>

key

type TKeyMulti
returns SvelteMap<any, T[]>

derived_index

Get a derived index with proper typing.

type (key: TKeyDerived): T[]

key

type TKeyDerived
returns T[]

dynamic_index

Get a dynamic (function) index with proper typing.

type <Q = any>(key: TKeyDynamic): (query: Q) => T

key

type TKeyDynamic
returns (query: Q) => T

query

Query an index with parameters.

This method is type-aware when the index has a query_schema that defines TQuery.

type <TResult = any, TQuery = any>(key: TKeySingle | TKeyMulti | TKeyDerived | TKeyDynamic, query: TQuery): TResult

key

type TKeySingle | TKeyMulti | TKeyDerived | TKeyDynamic

query

type TQuery
returns TResult

add

Add an item to the collection and update all indexes.

type (item: T): void

item

type T
returns void

add_many

Add multiple items to the collection at once.

type (items: T[]): void

items

type T[]
returns void

remove

Remove an item by its id and update all indexes.

type (id: string & $brand<"Uuid">): boolean

id

type string & $brand<"Uuid">
returns boolean

remove_many

Remove multiple items efficiently.

type (ids: (string & $brand<"Uuid">)[]): number

ids

type (string & $brand<"Uuid">)[]
returns number

get

Get an item by its id.

type (id: string & $brand<"Uuid">): T | undefined

id

type string & $brand<"Uuid">
returns T | undefined

has

Check if the collection has an item with the given id.

type (id: string & $brand<"Uuid">): boolean

id

type string & $brand<"Uuid">
returns boolean

clear

Clear all items and reset indexes.

type (): void

returns void

where

Get all items matching a multi-indexed property value. Type-safe version that uses the TKeyMulti generic parameter.

type <V = any>(index_key: TKeyMulti, value: V): T[]

index_key

type TKeyMulti

value

type V
returns T[]

first

Get the first N items matching a multi-indexed property value. Type-safe version that uses the TKeyMulti generic parameter.

type <V = any>(index_key: TKeyMulti, value: V, limit: number): T[]

index_key

type TKeyMulti

value

type V

limit

type number
returns T[]

latest

Get the latest N items matching a multi-indexed property value. Type-safe version that uses the TKeyMulti generic parameter.

type <V = any>(index_key: TKeyMulti, value: V, limit: number): T[]

index_key

type TKeyMulti

value

type V

limit

type number
returns T[]

by

Get an item by a single-value index. Returns the item or throws if no item is found. Type-safe version that uses the TKeySingle generic parameter.

type <V = any>(index_key: TKeySingle, value: V): T

index_key

type TKeySingle

value

type V
returns T

by_optional

Get an item by a single-value index, returning undefined if not found. Type-safe version that uses the TKeySingle generic parameter.

type <V = any>(index_key: TKeySingle, value: V): T | undefined

index_key

type TKeySingle

value

type V
returns T | undefined

IndexedCollectionOptions
#

indexed_collection.svelte.ts view source

IndexedCollectionOptions<T, TKeySingle, TKeyMulti, TKeyDerived, TKeyDynamic> import type {IndexedCollectionOptions} from '@fuzdev/zzz/indexed_collection.svelte.js';

generics

IndexedCollectionOptions<T extends IndexedItem, TKeySingle extends string = string, TKeyMulti extends string = string, TKeyDerived extends string = string, TKeyDynamic extends string = string>
T
constraint IndexedItem
TKeySingle
constraint string
default string
TKeyMulti
constraint string
default string
TKeyDerived
constraint string
default string
TKeyDynamic
constraint string
default string

indexes?

type Array<IndexDefinition<T>>

initial_items?

type Array<T>

validate?

type boolean

index_types?

type { single?: Array<TKeySingle>; multi?: Array<TKeyMulti>; derived?: Array<TKeyDerived>; dynamic?: Array<TKeyDynamic>; }

IndexedItem
#

IndexOptions
#

indexed_collection_helpers.svelte.ts view source

IndexOptions<T, TQuery> import type {IndexOptions} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Common options interface for all index types.

generics

IndexOptions<T extends IndexedItem, TQuery = any>
T
constraint IndexedItem
TQuery
default any

key

Unique key for this index.

type string

matches?

Optional predicate to determine if an item is relevant to this index.

type (item: T) => boolean

query_schema?

Schema for query input validation and typing.

type z.ZodType<TQuery>

IndexType
#

INVALID_DROP_CLASS_DEFAULT
#

is_cell_type
#

cell_classes.ts view source

<K extends CellClassNames>(cell: Cell<any> | null | undefined, class_name: K): cell is CellRegistryMap[K] import {is_cell_type} from '@fuzdev/zzz/cell_classes.js';

Type guard to check if a cell is an instance of a specific cell class.

cell

type Cell<any> | null | undefined

class_name

type K

returns

boolean

generics

is_cell_type<K extends CellClassNames>
K
constraint CellClassNames

is_path_absolute
#

diskfile_helpers.ts view source

(path: string): boolean import {is_path_absolute} from '@fuzdev/zzz/diskfile_helpers.js';

path

type string

returns

boolean

is_reorder_allowed
#

reorderable_helpers.ts view source

(can_reorder: ((from_index: number, to_index: number) => boolean) | undefined, source_index: number, target_index: number): boolean import {is_reorder_allowed} from '@fuzdev/zzz/reorderable_helpers.js';

Check if reordering is allowed between two indices.

can_reorder

type ((from_index: number, to_index: number) => boolean) | undefined

source_index

type number

target_index

type number

returns

boolean

ITEM_CLASS_DEFAULT
#

JSONRPC_ERROR_CODES
#

zzz_jsonrpc_errors.ts view source

{ readonly ai_provider_error: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); readonly parse_error: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<...>); ... 13 more ...; readonly request_cancelled: -32700 | ... 4 more ... | (number & $brand<...>); } import {JSONRPC_ERROR_CODES} from '@fuzdev/zzz/zzz_jsonrpc_errors.js';

Extended error codes with zzz-specific AI provider error.

jsonrpc_error_messages
#

zzz_jsonrpc_errors.ts view source

{ readonly ai_provider_error: (provider?: string | undefined, message?: string | undefined, data?: unknown) => { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; ... 14 more ...; readonly request_cancelled: (...a... import {jsonrpc_error_messages} from '@fuzdev/zzz/zzz_jsonrpc_errors.js';

Extended error message constructors.

jsonrpc_errors
#

zzz_jsonrpc_errors.ts view source

{ readonly ai_provider_error: (provider?: string | undefined, message?: string | undefined, data?: unknown) => ThrownJsonrpcError; readonly parse_error: (...args: any[]) => ThrownJsonrpcError; ... 13 more ...; readonly request_cancelled: (...args: any[]) => ThrownJsonrpcError; } import {jsonrpc_errors} from '@fuzdev/zzz/zzz_jsonrpc_errors.js';

Extended error throwers.

JsonrpcErrorName
#

zzz_jsonrpc_errors.ts view source

JsonrpcErrorName import type {JsonrpcErrorName} from '@fuzdev/zzz/zzz_jsonrpc_errors.js';

zzz error names โ€” extends fuz_app's base set with AI provider errors.

library_context
#

library.ts view source

{ get: (error_message?: string | undefined) => Library; get_maybe: () => Library | undefined; set: (value: Library) => Library; } import {library_context} from '@fuzdev/zzz/library.js';

LIST_CLASS_DEFAULT
#

LocalCallActionMethod
#

action_metatypes.ts view source

ZodEnum<{ toggle_main_menu: "toggle_main_menu"; }> import type {LocalCallActionMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of all local_call actions.

logo_chatgpt
#

logos.ts view source

{ label: string; paths: { d: string; }[]; } import {logo_chatgpt} from '@fuzdev/zzz/logos.js';

logo_claude
#

logos.ts view source

{ label: string; fill: string; paths: { d: string; }[]; } import {logo_claude} from '@fuzdev/zzz/logos.js';

logo_gemini
#

logos.ts view source

{ label: string; fill: string; gradients: { type: "radial"; id: string; attrs: { cx: string; cy: string; r: string; gradientUnits: string; gradientTransform: string; }; stops: { offset: string; color: string; }[]; }[]; paths: { ...; }[]; } import {logo_gemini} from '@fuzdev/zzz/logos.js';

logo_zzz
#

logos.ts view source

{ label: string; fill: string; paths: { d: string; }[]; } import {logo_zzz} from '@fuzdev/zzz/logos.js';

main_nav_items_default
#

MainDialog
#

Model
#

model.svelte.ts view source

import {Model} from '@fuzdev/zzz/model.svelte.js';

inheritance

extends: Cell<typeof ModelJson>

name

type ModelName

$state.raw

provider_name

type ProviderName

$state.raw

tags

type Array<string>

$state

architecture

type string | undefined

$state.raw

parameter_count

type number | undefined

$state.raw

context_window

type number | undefined

$state.raw

output_token_limit

type number | undefined

$state.raw

embedding_length

type number | undefined

$state.raw

filesize

Size in gigabytes.

type number | undefined

$state.raw

cost_input

type number | undefined

$state.raw

cost_output

type number | undefined

$state.raw

training_cutoff

type string | undefined

$state.raw

provider

Lookup the provider for this model.

type Provider | undefined

readonly $derived

context_window_formatted

type string | null

readonly $derived

constructor

type new (options: ModelOptions): Model

options

ModelContextmenu
#

ModelContextmenu.svelte view source

accepts children

import ModelContextmenu from '@fuzdev/zzz/ModelContextmenu.svelte';

model

type Model | undefined

children

type Snippet<[]>

ModelDetail
#

ModelJson
#

model.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 12 more ...; training_cutoff: ZodOptional<...>; }, $strict> import type {ModelJson} from '@fuzdev/zzz/model.svelte.js';

ModelJsonInput
#

model.svelte.ts view source

{ name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; } import type {ModelJsonInput} from '@fuzdev/zzz/model.svelte.js';

name

type string

provider_name

type "claude" | "chatgpt" | "gemini"

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

tags?

type string[]

architecture?

type string

parameter_count?

type number

context_window?

type number

output_token_limit?

type number

embedding_length?

type number

filesize?

Size in gigabytes.

type number

cost_input?

type number

cost_output?

type number

training_cutoff?

type string

ModelLink
#

ModelListitem
#

ModelName
#

ModelOptions
#

model.svelte.ts view source

ModelOptions import type {ModelOptions} from '@fuzdev/zzz/model.svelte.js';

inheritance

extends: CellOptions<typeof ModelJson>

ModelPicker
#

ModelPicker.svelte view source

import ModelPicker from '@fuzdev/zzz/ModelPicker.svelte';

onpick

type (model: Model | undefined) => boolean | void

items?

type Model[]
optional default models.ordered_by_name

filter?

type (model: Model) => boolean
optional

heading?

type string
optional default 'pick a model'

ModelPickerDialog
#

ModelPickerDialog.svelte view source

accepts children

import ModelPickerDialog from '@fuzdev/zzz/ModelPickerDialog.svelte';

show

type boolean
bindable default false

onpick

type (model: Model | undefined) => boolean | void

filter?

type (model: Model) => boolean
optional

dialog_props?

type OmitStrict<Omit<HTMLDialogAttributes, "children" | "onclose"> & { show?: boolean | undefined; align?: DialogAlign | undefined; dismissable?: boolean | undefined; content_selector?: string | undefined; onbeforeclose?: (() => boolean | void) | undefined; onclose?: (() => void) | undefined; children: Snippet<...>; }, "...
optional

children?

type Snippet<[]>
optional

Models
#

models.svelte.ts view source

import {Models} from '@fuzdev/zzz/models.svelte.js';

inheritance

extends: Cell<typeof ModelsJson>

items

type IndexedCollection<Model>

readonly

ordered_by_name

Get all models ordered alphabetically by name.

type Array<Model>

readonly $derived

constructor

type new (options: ModelsOptions): Models

options

add

type (model_json: { name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; }): void

model_json

type { name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; }
returns void

add_many

type (models_json: { name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; }[]): void

models_json

type { name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; }[]
returns void

find_by_name

type (name: string): Model | undefined

name

type string
returns Model | undefined

filter_by_names

type (names: string[]): Model[] | undefined

names

type string[]
returns Model[] | undefined

filter_by_tag

type (tag: string): Model[]

tag

type string
returns Model[]

models_default
#

config_defaults.ts view source

{ name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; }[] import {models_default} from '@fuzdev/zzz/config_defaults.js';

ModelSchema
#

ModelSelect
#

ModelSelect.svelte view source

import ModelSelect from '@fuzdev/zzz/ModelSelect.svelte';

selected_model

type Model

models?

type Model[]
optional default app.models.ordered_by_name

ModelsJson
#

models.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; }, $strict> import type {ModelsJson} from '@fuzdev/zzz/models.svelte.js';

ModelsJsonInput
#

models.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; ... 11 more ...; training_cutoff?: string | undefined; }[] | undefined; } import type {ModelsJsonInput} from '@fuzdev/zzz/models.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { name: string; provider_name: "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; architecture?: string | undefined; ... 7 more ...; training_cutoff?: string | undefined; }[]

ModelsOptions
#

models.svelte.ts view source

ModelsOptions import type {ModelsOptions} from '@fuzdev/zzz/models.svelte.js';

inheritance

extends: CellOptions<typeof ModelsJson>

ModelSummary
#

ModelSummary.svelte view source

import ModelSummary from '@fuzdev/zzz/ModelSummary.svelte';

model

type Model

omit_provider?

type boolean
optional

attrs?

type HTMLAttributes<HTMLDivElement>
optional

MultiIndexOptions
#

indexed_collection_helpers.svelte.ts view source

MultiIndexOptions<T, K> import type {MultiIndexOptions} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Options for multi-value indexes.

generics

MultiIndexOptions<T extends IndexedItem, K>
T
constraint IndexedItem
K

inheritance

extends: IndexOptions<T, K>

extractor

Function that extracts the key(s) from an item.

type (item: T) => K | Array<K> | undefined

sort?

Optional sort function for items in each bucket.

type (a: T, b: T) => number

NavItem
#

NavLink
#

NavLinkItem
#

parse_url_param_uuid
#

url_params_helpers.ts view source

(value: unknown): (string & $brand<"Uuid">) | null import {parse_url_param_uuid} from '@fuzdev/zzz/url_params_helpers.js';

Parse and validate a UUID parameter value from the URL.

value

type unknown

returns

(string & $brand<"Uuid">) | null

Part
#

part.svelte.ts view source

import {Part} from '@fuzdev/zzz/part.svelte.js';

Abstract base class for all part types.

generics

Part<T extends z.ZodType = typeof PartJsonBase>
T
constraint z.ZodType
default typeof PartJsonBase

inheritance

extends: Cell<T>

type

type string

abstractreadonly

start

type number | null

$state.raw

end

type number | null

$state.raw

length

type number | null | undefined

readonly $derived.by

token_count

type number | null | undefined

readonly $derived.by

content_preview

content with a max length.

type string | null | undefined

readonly $derived.by

name

type string

$state.raw

has_xml_tag

type boolean

$state.raw

xml_tag_name

type string

$state.raw

attributes

type Array<XmlAttributeWithDefaults>

$state

enabled

type boolean

$state.raw

title

type string | null

$state.raw

summary

type string | null

$state.raw

xml_tag_name_default

type string

readonly $derived.by

add_attribute

type (partial?: { id?: string | undefined; key?: string | undefined; value?: string | undefined; }): void

partial

type { id?: string | undefined; key?: string | undefined; value?: string | undefined; }
default EMPTY_OBJECT
returns void

update_attribute

type (id: string & $brand<"Uuid">, updates: Partial<OmitStrict<{ id: string & $brand<"Uuid">; key: string; value: string; }, "id">>): boolean

id

type string & $brand<"Uuid">

updates

type Partial<OmitStrict<{ id: string & $brand<"Uuid">; key: string; value: string; }, "id">>
returns boolean

true if the attribute was updated, false if the attribute was not found

remove_attribute

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

create

type (app: Frontend, json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | ... 1 more ... | undefined; ... 7 more ...; content?: string | undefined; }, options?: TextPartOptions | undefined): TextPart

static

app

json

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; has_xml_tag?: boolean | undefined; ... 6 more ...; content?: string | undefined; }

options?

type TextPartOptions | undefined
optional
returns TextPart

content

type string | null | undefined

getterabstract

PART_ICONS
#

part_helpers.ts view source

{ text: { label: string; paths: { d: string; }[]; }; diskfile: { label: string; paths: { d: string; }[]; }; } import {PART_ICONS} from '@fuzdev/zzz/part_helpers.js';

PartContextmenu
#

PartEditorForDiskfile
#

PartEditorForText
#

PartJson
#

part.svelte.ts view source

ZodDiscriminatedUnion<[ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 11 more ...; content: ZodDefault<...>; }, $strict>, ZodObject<...>], "type"> import type {PartJson} from '@fuzdev/zzz/part.svelte.js';

Union of all part types for deserialization.

PartJsonBase
#

part.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 10 more ...; summary: ZodDefault<...>; }, $strict> import type {PartJsonBase} from '@fuzdev/zzz/part.svelte.js';

Common properties for all part types.

PartJsonInput
#

part.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; } import type {PartJsonInput} from '@fuzdev/zzz/part.svelte.js';

PartJsonType
#

PartList
#

PartList.svelte view source

import PartList from '@fuzdev/zzz/PartList.svelte';

parts

type PartUnion[]

prompt?

type Prompt
optional

onreorder?

type (from_index: number, to_index: number) => void
optional

reorderable_options?

optional

item_attrs?

type HTMLLiAttributes
optional

attrs?

type HTMLAttributes<HTMLUListElement>
optional

empty?

type Snippet<[]>
optional default empty_default

PartListitem
#

PartListitem.svelte view source

import PartListitem from '@fuzdev/zzz/PartListitem.svelte';

part

selected?

type boolean
optional

onclick?

type (part: PartUnion) => void
optional

sm?

type boolean
optional default true

attrs?

type HTMLButtonAttributes
optional

PartOptions
#

part.svelte.ts view source

PartOptions<T> import type {PartOptions} from '@fuzdev/zzz/part.svelte.js';

generics

PartOptions<T extends z.ZodType = typeof PartJsonBase>
T
constraint z.ZodType
default typeof PartJsonBase

inheritance

extends: CellOptions<T>

json?

type z.input<T>

PartOptionsUnion
#

PartPicker
#

PartPicker.svelte view source

import PartPicker from '@fuzdev/zzz/PartPicker.svelte';

onpick

type (part: PartUnion | undefined) => boolean | void

filter?

type (part: PartUnion) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

PartPickerDialog
#

PartPickerDialog.svelte view source

import PartPickerDialog from '@fuzdev/zzz/PartPickerDialog.svelte';

onpick

type (part: PartUnion | undefined) => boolean | void

show?

type boolean
optional bindable default false

filter?

type (part: PartUnion) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

dialog_props?

type OmitStrict<Omit<HTMLDialogAttributes, "children" | "onclose"> & { show?: boolean | undefined; align?: DialogAlign | undefined; dismissable?: boolean | undefined; content_selector?: string | undefined; onbeforeclose?: (() => boolean | void) | undefined; onclose?: (() => void) | undefined; children: Snippet<...>; }, "...
optional

PartRemoveButton
#

Parts
#

parts.svelte.ts view source

import {Parts} from '@fuzdev/zzz/parts.svelte.js';

inheritance

extends: Cell<typeof PartsJson>

items

type IndexedCollection<PartUnion>

readonly

constructor

type new (options: PartsOptions): Parts

options

add

Add a part to the collection.

type (json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; }): PartUnion

json

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; }
returns PartUnion

generate_unique_name

Generate a unique name for a part.

type (base_name?: string): string

base_name

type string
default 'new part'
returns string

remove

Remove a part by id.

type (id: string & $brand<"Uuid">): boolean

id

type string & $brand<"Uuid">
returns boolean

find_part_by_diskfile_path

Find a part that references a specific file path.

type (path: string): PartUnion | undefined

path

type string
returns PartUnion | undefined

PartSchema
#

part.svelte.ts view source

ZodCustom<Part<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>, Part<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>> import {PartSchema} from '@fuzdev/zzz/part.svelte.js';

PartsJson
#

parts.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; }, $strict> import type {PartsJson} from '@fuzdev/zzz/parts.svelte.js';

PartsJsonInput
#

parts.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ... 10 more ...; content?: string | undefined; } | { ...; })[] | undefined; } import type {PartsJsonInput} from '@fuzdev/zzz/parts.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; })[]

PartsOptions
#

parts.svelte.ts view source

PartsOptions import type {PartsOptions} from '@fuzdev/zzz/parts.svelte.js';

inheritance

extends: CellOptions<typeof PartsJson>

PartStats
#

PartSummary
#

PartToggleButton
#

PartUnion
#

PartView
#

PathWithLeadingSlash
#

zod_helpers.ts view source

ZodPipe<ZodString, ZodTransform<string, string>> import type {PathWithLeadingSlash} from '@fuzdev/zzz/zod_helpers.js';

PathWithoutTrailingSlash
#

zod_helpers.ts view source

ZodPipe<ZodString, ZodTransform<string, string>> import type {PathWithoutTrailingSlash} from '@fuzdev/zzz/zod_helpers.js';

PathWithTrailingSlash
#

zod_helpers.ts view source

ZodPipe<ZodString, ZodTransform<string, string>> import type {PathWithTrailingSlash} from '@fuzdev/zzz/zod_helpers.js';

Picker
#

Picker.svelte view source

accepts children

import Picker from '@fuzdev/zzz/Picker.svelte';

items

The collection of items - required

type T[]

onpick

Handle both picking an item or no item. Return false to prevent closing.

type (item: T | undefined) => boolean | void

filter?

type (item: T) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

sorters?

type Sorter<T>[]
optional default EMPTY_ARRAY

sort_key_default?

type string
optional

show_sort_controls?

type boolean
optional default false

no_items?

type string | Snippet<[]>
optional

heading?

type string
optional default null

children

Called once per item

type Snippet<[item: T, pick: (item: T) => void]>
snippet parameters
item T
pick (item: T) => void

generics

Picker<T extends {id: Uuid}>
T
constraint {id: Uuid}

PickerDialog
#

PickerDialog.svelte view source

accepts children

import PickerDialog from '@fuzdev/zzz/PickerDialog.svelte';

items

The collection of items - required

type T[]

onpick

Handle both picking an item or no item. Return false to prevent closing.

type (item: T | undefined) => boolean | void

filter?

type (item: T) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

sorters?

type Sorter<T>[]
optional

sort_key_default?

type string
optional

show_sort_controls?

type boolean
optional

no_items?

type string | Snippet<[]>
optional

heading?

type string
optional

children

Called once per item

type Snippet<[item: T, pick: (item: T) => void]>
snippet parameters
item T
pick (item: T) => void

show?

type boolean
optional bindable default false

dialog_props?

type OmitStrict<Omit<HTMLDialogAttributes, "children" | "onclose"> & { show?: boolean | undefined; align?: DialogAlign | undefined; dismissable?: boolean | undefined; content_selector?: string | undefined; onbeforeclose?: (() => boolean | void) | undefined; onclose?: (() => void) | undefined; children: Snippet<...>; }, "...
optional

generics

PickerDialog<T extends {id: Uuid}>
T
constraint {id: Uuid}

ping_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "both"; auth: { account: "none"; actor: "none"; }; side_effects: false; input: ZodVoid; output: ZodObject<{ ping_id: ZodUnion<readonly [ZodString, ZodNumber]>; }, $strict>; async: true; description: string; } import {ping_action_spec} from '@fuzdev/zzz/action_specs.js';

PING_HISTORY_MAX
#

PingData
#

capabilities.svelte.ts view source

PingData import type {PingData} from '@fuzdev/zzz/capabilities.svelte.js';

ping_id

type JsonrpcRequestId

completed

type boolean

sent_time

type number

received_time

type number | null

round_trip_time

type number | null

PingForm
#

PingForm.svelte view source

accepts children

import PingForm from '@fuzdev/zzz/PingForm.svelte';

children?

type Snippet<[]>
optional

PingOutput
#

action_specs.ts view source

ZodObject<{ ping_id: ZodUnion<readonly [ZodString, ZodNumber]>; }, $strict> import type {PingOutput} from '@fuzdev/zzz/action_specs.js';

Output for ping. Echoes the JSON-RPC request id back as ping_id.

Poller
#

poller.svelte.ts view source

import {Poller} from '@fuzdev/zzz/poller.svelte.js';

Helper class to manage polling intervals. Automatically cleans up on disposal.

DEFAULT_INTERVAL

type number

static

constructor

type new (options: PollerOptions): Poller

options

start

Start polling with optional overrides.

type (options?: { immediate?: boolean | undefined; interval?: number | undefined; } | undefined): void

options?

type { immediate?: boolean | undefined; interval?: number | undefined; } | undefined
optional
returns void

stop

Stop polling.

type (): void

returns void

set_interval

Update the polling interval. If polling is active, it will restart with the new interval. No-op if the interval is already set to the same value.

type (interval: number | undefined): void

interval

type number | undefined
returns void

dispose

Dispose of the poller, stopping any active polling.

type (): void

returns void

active

Check if the poller is currently active.

type boolean

getter

PollerOptions
#

poller.svelte.ts view source

PollerOptions import type {PollerOptions} from '@fuzdev/zzz/poller.svelte.js';

poll_fn

Function to call on each poll interval.

type () => void | Promise<void>

interval?

Polling interval in milliseconds.

type number

immediate?

Whether to run the poll function immediately on start, defaults to true.

type boolean

PONG_DISPLAY_LIMIT
#

ProgressBar
#

ProgressBar.svelte view source

import ProgressBar from '@fuzdev/zzz/ProgressBar.svelte';

value

The percentage value of the progress bar, 0-100.

type number

text?

type Snippet<[]>
optional

ProgressMeta
#

action_specs.ts view source

ZodObject<{ progressToken: ZodOptional<$ZodBranded<ZodUUID, "Uuid", "out">>; }, $loose> import type {ProgressMeta} from '@fuzdev/zzz/action_specs.js';

Progress-token envelope shared by streaming actions. Carries the caller's progressToken so streamed *_progress notifications can be correlated with the originating request. looseObject lets transports tack on additional MCP-style metadata without a schema bump.

Prompt
#

prompt.svelte.ts view source

import {Prompt} from '@fuzdev/zzz/prompt.svelte.js';

inheritance

extends: Cell<typeof PromptJson>

name

type string

$state.raw

parts

type Array<PartUnion>

$state

content

type string

readonly $derived

length

type number

readonly $derived

token_count

type number

readonly $derived

content_preview

type string

readonly $derived

constructor

type new (options: PromptOptions): Prompt

options

add_part

Add a part to this prompt.

type (part: PartUnion): PartUnion

part

returns PartUnion

remove_part

type (id: string & $brand<"Uuid">): boolean

id

type string & $brand<"Uuid">
returns boolean

remove_all_parts

type (): void

returns void

reorder_parts

type (from_index: number, to_index: number): void

from_index

type number

to_index

type number
returns void

PromptActionContent
#

PromptContextmenu
#

PromptJson
#

prompt.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; name: ZodDefault<...>; parts: ZodDefault<...>; }, $strict> import type {PromptJson} from '@fuzdev/zzz/prompt.svelte.js';

PromptJsonInput
#

prompt.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ... 10 more ...; content?: string | undefined; } | { ...; })[] | undefined; } import type {PromptJsonInput} from '@fuzdev/zzz/prompt.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

parts?

type ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; })[]

PromptList
#

PromptListitem
#

PromptMessage
#

prompt.svelte.ts view source

PromptMessage import type {PromptMessage} from '@fuzdev/zzz/prompt.svelte.js';

role

type 'user' | 'system'

content

type Array<PromptActionContent>

PromptOptions
#

prompt.svelte.ts view source

PromptOptions import type {PromptOptions} from '@fuzdev/zzz/prompt.svelte.js';

inheritance

extends: CellOptions<typeof PromptJson>

name?

type string

PromptPicker
#

PromptPicker.svelte view source

import PromptPicker from '@fuzdev/zzz/PromptPicker.svelte';

onpick

type (prompt: Prompt | undefined) => boolean | void

filter?

type (prompt: Prompt) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

selected_ids?

type (string & $brand<"Uuid">)[]
optional

PromptPickerDialog
#

PromptPickerDialog.svelte view source

import PromptPickerDialog from '@fuzdev/zzz/PromptPickerDialog.svelte';

onpick

type (prompt: Prompt | undefined) => boolean | void

show?

type boolean
optional bindable default false

filter?

type (prompt: Prompt) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

selected_ids?

type (string & $brand<"Uuid">)[]
optional

dialog_props?

type OmitStrict<Omit<HTMLDialogAttributes, "children" | "onclose"> & { show?: boolean | undefined; align?: DialogAlign | undefined; dismissable?: boolean | undefined; content_selector?: string | undefined; onbeforeclose?: (() => boolean | void) | undefined; onclose?: (() => void) | undefined; children: Snippet<...>; }, "...
optional

Prompts
#

prompts.svelte.ts view source

import {Prompts} from '@fuzdev/zzz/prompts.svelte.js';

inheritance

extends: Cell<typeof PromptsJson>

items

type IndexedCollection<Prompt>

readonly

selected_id_last_non_null

type Uuid | null

$state.raw

selected

type Prompt | undefined

readonly $derived

show_sort_controls

Controls visibility of sort controls in the prompts list.

type boolean

$state.raw

ordered_items

Ordered array of prompts derived from the manual_order index.

type Array<Prompt>

readonly $derived

constructor

type new (options: PromptsOptions): Prompts

options

filter_by_part

type (part: PartUnion): Prompt[]

part

returns Prompt[]

add

type (json?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; ... 11 more ...; content?: string | undefined; } | { ...; })[] | undefined; } | undefined): Prompt

json?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; ... 11 more ...; content?: string | undefined; } | { ...; })[] | undefined; } | undefined
optional
returns Prompt

generate_unique_name

type (base_name?: string): string

base_name

type string
default 'new prompt'
returns string

add_many

type (prompts_json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; ... 11 more ...; content?: string | undefined; } | { ...; })[] | undefined; }[]): Prompt[]

prompts_json

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ... 10 more ...; content?: string | undefined; } | { ...; })[] | undefined; }[]
returns Prompt[]

remove

type (prompt: Prompt): void

prompt

type Prompt
returns void

remove_many

type (prompt_ids: (string & $brand<"Uuid">)[]): number

prompt_ids

type (string & $brand<"Uuid">)[]
returns number

select

type (prompt_id: (string & $brand<"Uuid">) | null): Promise<void>

prompt_id

type (string & $brand<"Uuid">) | null
returns Promise<void>

select_next

type (): Promise<void>

returns Promise<void>

navigate_to

type (prompt_id: (string & $brand<"Uuid">) | null, force?: boolean): Promise<void>

prompt_id

type (string & $brand<"Uuid">) | null

force

type boolean
default false
returns Promise<void>

reorder_prompts

type (from_index: number, to_index: number): void

from_index

type number

to_index

type number
returns void

remove_part

type (part_id: string & $brand<"Uuid">): void

part_id

type string & $brand<"Uuid">
returns void

toggle_sort_controls

Toggles the visibility of sort controls in the prompts list.

type (value?: boolean): void

value

type boolean
default !this.show_sort_controls
returns void

selected_id

type (string & $brand<"Uuid">) | null

gettersetter

PromptSchema
#

PromptsJson
#

prompts.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; selected_id: ZodDefault<...>; show_sort_controls: ZodDefault<...>; }, $strict> import type {PromptsJson} from '@fuzdev/zzz/prompts.svelte.js';

PromptsJsonInput
#

prompts.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ ...; } | { ...; })[] | undefined; }[] | undefined; selected_id?: string | ... 1 more ... | undefi... import type {PromptsJsonInput} from '@fuzdev/zzz/prompts.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ... 10 more ...; content?: string | undefined; } | { ...; })[] | undefined; }[]

selected_id?

type string

show_sort_controls?

type boolean

PromptsOptions
#

prompts.svelte.ts view source

PromptsOptions import type {PromptsOptions} from '@fuzdev/zzz/prompts.svelte.js';

inheritance

extends: CellOptions<typeof PromptsJson>

PromptsSchema
#

PromptStats
#

PromptSummary
#

Provider
#

provider.svelte.ts view source

import {Provider} from '@fuzdev/zzz/provider.svelte.js';

inheritance

extends: Cell<typeof ProviderJson>

name

type ProviderName

$state.raw

title

type string

$state.raw

url

type string

$state.raw

homepage

type string

$state.raw

company

type string

$state.raw

api_key_url

type string | null

$state.raw

models

type Array<Model>

readonly $derived

status

Status for this provider (availability, error messages, etc.).

type ProviderStatus | null

readonly $derived

available

Whether this provider is available (configured with API keys, etc.).

type boolean

readonly $derived

constructor

type new (options: ProviderOptions): Provider

options

PROVIDER_ERROR_NEEDS_API_KEY
#

provider_load_status_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: false; input: ZodObject<{ provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; reload: ZodOptional<...>; }, $strict>; output: ZodObject<...>; async: true; de... import {provider_load_status_action_spec} from '@fuzdev/zzz/action_specs.js';

provider_update_api_key_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; roles: string[]; credential_types: string[]; }; side_effects: true; input: ZodObject<{ provider_name: ZodEnum<...>; api_key: ZodString; acting: ZodOptional<...>; }, $strict>; output: ZodObject<...>; asy... import {provider_update_api_key_action_spec} from '@fuzdev/zzz/action_specs.js';

ProviderCapability
#

provider_capability.svelte.ts view source

import {ProviderCapability} from '@fuzdev/zzz/provider_capability.svelte.js';

Per-provider availability capability, derived from the backend's provider_status. Plain reactive class โ€” not a Cell: it has no persisted state, everything is $derived from app.lookup_provider_status(name). One instance per ProviderName lives in Capabilities.providers, collapsing what were three hand-rolled claude/chatgpt/gemini $derived blocks plus their init_*_check/check_* pairs into a single keyed shape.

inheritance

implements: Capability<null | undefined>

app

type Frontend

readonly

name

type ProviderName

readonly

message_id

type JsonrpcRequestId | null

readonly

status

type AsyncStatus

readonly $derived

data

null available, undefined unknown โ€” matches the Capability data contract.

type null | undefined

readonly $derived

error_message

type string | null

readonly $derived

updated

type number | null

readonly $derived

constructor

type new (options: ProviderCapabilityOptions): ProviderCapability

options

init_check

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

type (): Promise<void>

returns Promise<void>

check

Check availability by loading provider status from the backend.

type (): Promise<void>

returns Promise<void>

ProviderCapabilityOptions
#

ProviderData
#

provider_types.ts view source

{ type: "claude"; value: any; } | { type: "chatgpt"; value: any; } | { type: "gemini"; value: { text: string; candidates?: any[] | null | undefined; function_calls?: any[] | null | undefined; prompt_feedback?: any; usage_metadata?: any; }; } import type {ProviderData} from '@fuzdev/zzz/provider_types.js';

ProviderDataChatgpt
#

provider_types.ts view source

ZodObject<{ type: ZodLiteral<"chatgpt">; value: ZodDefault<ZodOptional<ZodAny>>; }, $strict> import type {ProviderDataChatgpt} from '@fuzdev/zzz/provider_types.js';

ProviderDataClaude
#

provider_types.ts view source

ZodObject<{ type: ZodLiteral<"claude">; value: ZodDefault<ZodOptional<ZodAny>>; }, $strict> import type {ProviderDataClaude} from '@fuzdev/zzz/provider_types.js';

ProviderDataGemini
#

provider_types.ts view source

ZodObject<{ type: ZodLiteral<"gemini">; value: ZodObject<{ text: ZodString; candidates: ZodOptional<ZodNullable<ZodArray<ZodAny>>>; function_calls: ZodOptional<...>; prompt_feedback: ZodOptional<...>; usage_metadata: ZodOptional<...>; }, $strict>; }, $strict> import type {ProviderDataGemini} from '@fuzdev/zzz/provider_types.js';

ProviderDataSchema
#

provider_types.ts view source

ZodDiscriminatedUnion<[ZodObject<{ type: ZodLiteral<"claude">; value: ZodDefault<ZodOptional<ZodAny>>; }, $strict>, ZodObject<{ type: ZodLiteral<...>; value: ZodDefault<...>; }, $strict>, ZodObject<...>], "type"> import {ProviderDataSchema} from '@fuzdev/zzz/provider_types.js';

ProviderDetail
#

ProviderJson
#

provider.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 6 more ...; api_key_url: ZodNullable<...>; }, $strict> import type {ProviderJson} from '@fuzdev/zzz/provider.svelte.js';

ProviderJsonInput
#

provider.svelte.ts view source

{ name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; } import type {ProviderJsonInput} from '@fuzdev/zzz/provider.svelte.js';

name

type "claude" | "chatgpt" | "gemini"

title

type string

url

type string

homepage

type string

company

type string

api_key_url

type string | null

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

ProviderLink
#

ProviderLoadStatusInput
#

action_specs.ts view source

ZodObject<{ provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; reload: ZodOptional<ZodDefault<ZodBoolean>>; }, $strict> import type {ProviderLoadStatusInput} from '@fuzdev/zzz/action_specs.js';

Input for provider_load_status.

ProviderLoadStatusOutput
#

action_specs.ts view source

ZodObject<{ status: ZodDiscriminatedUnion<[ZodObject<{ name: ZodString; available: ZodLiteral<true>; checked_at: ZodNumber; }, $strict>, ZodObject<{ name: ZodString; available: ZodLiteral<...>; error: ZodString; checked_at: ZodNumber; }, $strict>], "available">; }, $strict> import type {ProviderLoadStatusOutput} from '@fuzdev/zzz/action_specs.js';

Output for provider_load_status.

ProviderLogo
#

ProviderName
#

provider_types.ts view source

ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }> import type {ProviderName} from '@fuzdev/zzz/provider_types.js';

See app.providers.names for the available names at runtime.

ProviderOptions
#

provider.svelte.ts view source

ProviderOptions import type {ProviderOptions} from '@fuzdev/zzz/provider.svelte.js';

inheritance

extends: CellOptions<typeof ProviderJson>

Providers
#

providers.svelte.ts view source

import {Providers} from '@fuzdev/zzz/providers.svelte.js';

inheritance

extends: Cell<typeof ProvidersJson>

items

type Array<Provider>

$state

names

type ReadonlyArray<ProviderName>

readonly $derived

constructor

type new (options: ProvidersOptions): Providers

options

add

type (provider: Provider): void

provider

returns void

find_by_name

type (name: string): Provider | undefined

name

type string
returns Provider | undefined

providers_default
#

config_defaults.ts view source

{ name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }[] import {providers_default} from '@fuzdev/zzz/config_defaults.js';

ProvidersJson
#

providers.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; }, $strict> import type {ProvidersJson} from '@fuzdev/zzz/providers.svelte.js';

ProvidersJsonInput
#

providers.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }[] |... import type {ProvidersJsonInput} from '@fuzdev/zzz/providers.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { name: "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; company: string; api_key_url: string | null; id?: string | undefined; created?: string | undefined; updated?: string | undefined; }[]

ProvidersOptions
#

providers.svelte.ts view source

ProvidersOptions import type {ProvidersOptions} from '@fuzdev/zzz/providers.svelte.js';

inheritance

extends: CellOptions<typeof ProvidersJson>

ProviderStatus
#

provider_types.ts view source

ZodDiscriminatedUnion<[ZodObject<{ name: ZodString; available: ZodLiteral<true>; checked_at: ZodNumber; }, $strict>, ZodObject<{ name: ZodString; available: ZodLiteral<...>; error: ZodString; checked_at: ZodNumber; }, $strict>], "available"> import type {ProviderStatus} from '@fuzdev/zzz/provider_types.js';

ProviderSummary
#

ProviderUpdateApiKeyInput
#

action_specs.ts view source

ZodObject<{ provider_name: ZodEnum<{ claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; api_key: ZodString; acting: ZodOptional<$ZodBranded<ZodUUID, "Uuid", "out">>; }, $strict> import type {ProviderUpdateApiKeyInput} from '@fuzdev/zzz/action_specs.js';

Input for provider_update_api_key.

ProviderUpdateApiKeyOutput
#

action_specs.ts view source

ZodObject<{ status: ZodDiscriminatedUnion<[ZodObject<{ name: ZodString; available: ZodLiteral<true>; checked_at: ZodNumber; }, $strict>, ZodObject<{ name: ZodString; available: ZodLiteral<...>; error: ZodString; checked_at: ZodNumber; }, $strict>], "available">; }, $strict> import type {ProviderUpdateApiKeyOutput} from '@fuzdev/zzz/action_specs.js';

Output for provider_update_api_key.

QueuedMessage
#

socket.svelte.ts view source

QueuedMessage import type {QueuedMessage} from '@fuzdev/zzz/socket.svelte.js';

Queued message that couldn't be sent immediately.

id

type Uuid

data

type any

created

type number

RemoteNotificationActionMethod
#

action_metatypes.ts view source

ZodEnum<{ cancel: "cancel"; filer_change: "filer_change"; completion_progress: "completion_progress"; terminal_data: "terminal_data"; terminal_exited: "terminal_exited"; workspace_changed: "workspace_changed"; }> import type {RemoteNotificationActionMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of all remote_notification actions.

render_completion_messages
#

thread_helpers.ts view source

(turns: Iterable<Turn>, completion_messages?: { [x: string]: unknown; role: string; content: string; }[]): { [x: string]: unknown; role: string; content: string; }[] import {render_completion_messages} from '@fuzdev/zzz/thread_helpers.js';

Creates a thread history array for model consumption from a collection of turns. Normalizes content for assistant turns with responses.

turns

type Iterable<Turn>

completion_messages

type { [x: string]: unknown; role: string; content: string; }[]
default []

returns

{ [x: string]: unknown; role: string; content: string; }[]

render_message_with_role
#

thread_helpers.ts view source

(role: string, content: string, tag?: string): string import {render_message_with_role} from '@fuzdev/zzz/thread_helpers.js';

Renders a single message with an XML tag that includes the role attribute.

role

type string

content

type string

tag

type string
default 'message'

returns

string

render_messages_to_string
#

thread_helpers.ts view source

(turns: Iterable<{ role: string; content: string; enabled?: boolean | undefined; }>, tag?: string): string import {render_messages_to_string} from '@fuzdev/zzz/thread_helpers.js';

turns

type Iterable<{ role: string; content: string; enabled?: boolean | undefined; }>

tag

type string
default 'message'

returns

string

reorder_list
#

list_helpers.ts view source

(items: any[], from_index: number, to_index: number): void import {reorder_list} from '@fuzdev/zzz/list_helpers.js';

Reorders an array, mutating it by moving an item from one index to another.

items

type any[]

from_index

type number

to_index

type number

returns

void

Reorderable
#

reorderable.svelte.ts view source

import {Reorderable} from '@fuzdev/zzz/reorderable.svelte.js';

inheritance

initialized

type boolean

source_index

type number

source_item_id

type ReorderableItemId | null

active_indicator_item_id

type ReorderableItemId | null

current_indicator

type ReorderableDropPosition

direction

type ReorderableDirection

id

type ReorderableId

readonly

list_class

type string | null

readonly

item_class

type string | null

readonly

dragging_class

type string | null

readonly

drag_over_class

type string | null

readonly

drag_over_top_class

type string | null

readonly

drag_over_bottom_class

type string | null

readonly

drag_over_left_class

type string | null

readonly

drag_over_right_class

type string | null

readonly

invalid_drop_class

type string | null

readonly

list_node

type HTMLElement | null

list_params

type ReorderableListParams | null

indices

type Map<ReorderableItemId, number>

readonly

elements

type Map<ReorderableItemId, HTMLElement>

readonly

pending_items

type Array<{ id: ReorderableItemId; index: number; element: HTMLElement; }>

constructor

type new (options?: ReorderableOptions): Reorderable

options

default EMPTY_OBJECT

init

Made public for testing purposes.

type (): void

returns void

clear_indicators

type (): void

returns void

update_indicator

type (item_id: ReorderableItemId, new_indicator: ReorderableDropPosition, is_valid?: boolean): void

item_id

new_indicator

is_valid

type boolean
default true
returns void

list

type (params: ReorderableListParams) => Attachment<HTMLElement>

item

type (params: ReorderableItemParams) => Attachment<HTMLElement>

#drag_classes

type string[]

getter

#is_valid_drag_operation

type boolean

getter

ReorderableDirection
#

ReorderableDropPosition
#

ReorderableId
#

reorderable.svelte.ts view source

ReorderableId import type {ReorderableId} from '@fuzdev/zzz/reorderable.svelte.js';

intersects

Flavored<string, 'ReorderableId'>

[key: number]

type string

ReorderableItemId
#

reorderable.svelte.ts view source

ReorderableItemId import type {ReorderableItemId} from '@fuzdev/zzz/reorderable.svelte.js';

intersects

Flavored<string, 'ReorderableItemId'>

[key: number]

type string

ReorderableItemParams
#

reorderable.svelte.ts view source

ReorderableItemParams import type {ReorderableItemParams} from '@fuzdev/zzz/reorderable.svelte.js';

Parameters for item attachment.

index

type number

ReorderableListParams
#

reorderable.svelte.ts view source

ReorderableListParams import type {ReorderableListParams} from '@fuzdev/zzz/reorderable.svelte.js';

Parameters for list attachment.

onreorder

type (from_index: number, to_index: number) => void

can_reorder?

type (from_index: number, to_index: number) => boolean

direction?

type ReorderableDirection

ReorderableOptions
#

reorderable.svelte.ts view source

ReorderableOptions import type {ReorderableOptions} from '@fuzdev/zzz/reorderable.svelte.js';

Additional configuration options for Reorderable.

direction?

Forces a specific direction for the reorderable list. Defaults to auto-detection, 'vertical' as the fallback.

type ReorderableDirection

list_class?

type string | null

item_class?

type string | null

dragging_class?

type string | null

drag_over_class?

type string | null

drag_over_top_class?

type string | null

drag_over_bottom_class?

type string | null

drag_over_left_class?

type string | null

drag_over_right_class?

type string | null

invalid_drop_class?

type string | null

ReorderableStyleOptions
#

reorderable.svelte.ts view source

ReorderableStyleOptions import type {ReorderableStyleOptions} from '@fuzdev/zzz/reorderable.svelte.js';

Styling configuration for reorderable components.

list_class

type string | null

item_class

type string | null

dragging_class

type string | null

drag_over_class

type string | null

drag_over_top_class

type string | null

drag_over_bottom_class

type string | null

drag_over_left_class

type string | null

drag_over_right_class

type string | null

invalid_drop_class

type string | null

ReorderableValidDropPosition
#

RequestResponseActionMethod
#

action_metatypes.ts view source

ZodEnum<{ ping: "ping"; heartbeat: "heartbeat"; "peer/ping": "peer/ping"; session_load: "session_load"; diskfile_update: "diskfile_update"; diskfile_delete: "diskfile_delete"; directory_create: "directory_create"; ... 9 more ...; workspace_list: "workspace_list"; }> import type {RequestResponseActionMethod} from '@fuzdev/zzz/action_metatypes.js';

Names of all request_response actions.

SchemaClassInfo
#

cell_helpers.ts view source

SchemaClassInfo import type {SchemaClassInfo} from '@fuzdev/zzz/cell_helpers.js';

Schema class information extracted from a Zod schema.

type

type string

is_array

type boolean

class_name?

type string

element_class?

type string

SchemaKeys
#

cell_types.ts view source

SchemaKeys<T> import type {SchemaKeys} from '@fuzdev/zzz/cell_types.js';

Get keys from a Zod schema object.

generics

SchemaKeys<T extends z.ZodType>
T
constraint z.ZodType

[key: number]

type string

SchemaValue
#

cell_types.ts view source

SchemaValue<T, K> import type {SchemaValue} from '@fuzdev/zzz/cell_types.js';

Get value type for a specific key in a Zod schema.

generics

SchemaValue<T extends z.ZodType, K extends SchemaKeys<T>>
T
constraint z.ZodType
K
constraint SchemaKeys<T>

SCRATCHPAD_NAME
#

Scrollable
#

scrollable.svelte.ts view source

import {Scrollable} from '@fuzdev/zzz/scrollable.svelte.js';

Manages scroll state and provides attachments for scroll detection and styling.

target_class

CSS class name to apply when scrolled.

type string

$state.raw

threshold

Threshold in pixels before considering the element scrolled.

type number

$state.raw

scroll_y

The current scroll Y position.

type number

$state.raw

scrolled

Whether element is scrolled past threshold.

type boolean

readonly $derived

constructor

type new (params?: ScrollableParameters | undefined): Scrollable

params?

type ScrollableParameters | undefined
optional

container

Attachment for the scrollable container - detects scrolling and updates state.

type Attachment

target

Attachment for the element that should receive the scrolled class. Since attachments run in effects, the class updates will be reactive automatically.

type Attachment

ScrollableParameters
#

scrollable.svelte.ts view source

ScrollableParameters import type {ScrollableParameters} from '@fuzdev/zzz/scrollable.svelte.js';

target_class?

CSS class to apply to the target element when scrolled. Defaults to 'scrolled'.

type string

threshold?

Threshold in pixels before considering the element scrolled. Defaults to 0.

type number

SerializableDisknode
#

diskfile_types.ts view source

ZodObject<{ id: $ZodBranded<ZodString, "DiskfilePath", "out">; source_dir: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<...>>, "DiskfileDirectoryPath", "out">; ... 4 more ...; dependencies: ZodArray<...>; }, $strict> import type {SerializableDisknode} from '@fuzdev/zzz/diskfile_types.js';

SERVER_HOST
#

SERVER_PROTOCOL
#

SERVER_PROXIED_PORT
#

SERVER_URL
#

ServerCapabilityData
#

session_load_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: false; input: ZodVoid; output: ZodObject<{ data: ZodObject<{ zzz_dir: $ZodBranded<ZodPipe<ZodPipe<...>, $ZodBranded<...>>, "DiskfileDirectoryPath", "out">; scoped_dirs: ZodReadonly<...>; fi... import {session_load_action_spec} from '@fuzdev/zzz/action_specs.js';

SessionLoadData
#

action_specs.ts view source

ZodObject<{ zzz_dir: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; scoped_dirs: ZodReadonly<...>; files: ZodArray<...>; provider_status: ZodArray<...>; workspaces: ZodArray<...>; }, $strict> import type {SessionLoadData} from '@fuzdev/zzz/action_specs.js';

Inner payload of session_load. The fields here are the actual session snapshot โ€” files, scoped dirs, provider status, workspaces.

TODO extract to diskfile_types.ts (or a session-specific module) once the Rust backend grows its own typed session response and we can move this schema to the shared boundary.

SessionLoadOutput
#

action_specs.ts view source

ZodObject<{ data: ZodObject<{ zzz_dir: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; scoped_dirs: ZodReadonly<...>; files: ZodArray<...>; provider_status: ZodArray<...>; workspaces: ZodArray<...>; }, $strict>; },... import type {SessionLoadOutput} from '@fuzdev/zzz/action_specs.js';

Output for session_load. The data wrapper is historical; the Rust backend serializes this exact shape (SessionLoadResult in crates/zzz_server), so flattening it is a coordinated wire change on both sides.

set_reorderable_drag_data_transfer
#

reorderable_helpers.ts view source

(dataTransfer: DataTransfer, item_id: ReorderableItemId): void import {set_reorderable_drag_data_transfer} from '@fuzdev/zzz/reorderable_helpers.js';

Set up drag data transfer with consistent properties and formats This centralizes the dataTransfer setup logic used in multiple places.

dataTransfer

type DataTransfer

item_id

returns

void

Settings
#

SingleIndexOptions
#

indexed_collection_helpers.svelte.ts view source

SingleIndexOptions<T, K> import type {SingleIndexOptions} from '@fuzdev/zzz/indexed_collection_helpers.svelte.js';

Options for single-value indexes.

generics

SingleIndexOptions<T extends IndexedItem, K>
T
constraint IndexedItem
K

inheritance

extends: IndexOptions<T, K>

extractor

Function that extracts the key from an item.

type (item: T) => K

Socket
#

socket.svelte.ts view source

import {Socket} from '@fuzdev/zzz/socket.svelte.js';

Wraps FrontendWebsocketClient with zzz-specific concerns: a retryable fire-and-forget send queue (distinct from fuz_app's request-level durable queue), URL input tracking, and a mapping from fuz_app's SocketStatus onto zzz's AsyncStatus. Plain reactive class โ€” not a Cell. Implements WebsocketRpcConnection so it can back FrontendWebsocketTransport; the request method is a one-line delegate to the underlying FrontendWebsocketClient, keeping the pending-request map in one canonical place.

The bespoke heartbeat timer has been retired โ€” fuz_app's FrontendWebsocketClient now ships an activity-aware heartbeat that sends the shared heartbeat_action at heartbeat_interval idle. Assigning heartbeat_interval pushes the new policy into the live client immediately (the timer is restarted in place when connected).

Reconnect settings (reconnect_delay, reconnect_delay_max, auto_reconnect) propagate to the underlying client on assignment via apply_reconnect_policy() โ€” in-flight waits are monotonically shortened (never extended).

inheritance

implements: WebsocketRpcConnection

app

type Frontend

readonly

url_input

type string

$state.raw

last_send_time

UI timestamps for the "last send" / "last receive" diagnostics in CapabilityWebsocket. Not used for heartbeat scheduling โ€” fuz_app's client owns that.

type number | null

$state.raw

last_receive_time

type number | null

$state.raw

message_queue

type Array<QueuedMessage>

$state

failed_messages

type SvelteMap<string, FailedMessage>

ws

type WebSocket | null

readonly $derived

url

type string | null

readonly $derived

reconnect_count

type number

readonly $derived

current_reconnect_delay

type number

readonly $derived

last_connect_time

type number | null

readonly $derived

reconnect_attempt

Changes each time a close fires โ€” used by the UI as an animation key so each reconnect wait restarts the progress bar.

type number

readonly $derived

is_reconnect_pending

type boolean

readonly $derived

status

type AsyncStatus

readonly $derived

connected

type boolean

readonly $derived

open

type boolean

readonly $derived

can_send

type boolean

readonly $derived

has_queued_messages

type boolean

readonly $derived

queued_message_count

type number

readonly $derived

failed_message_count

type number

readonly $derived

connection_duration

type number | null

readonly $derived.by

connection_duration_rounded

type number | null

readonly $derived.by

constructor

type new (options: SocketOptions): Socket

options

connect

type (url?: string | null): void

url

type string | null
default null
returns void

disconnect

type (): void

returns void

request

Delegate to the underlying FrontendWebsocketClient.request โ€” keeps the pending-request map, durable queue, and AbortSignal cancel in one canonical place. Rejects when there is no client (call connect() first).

type (method: string, params?: unknown, options?: { signal?: AbortSignal | undefined; queue?: boolean | undefined; id?: string | number | undefined; } | undefined): Promise<unknown>

method

type string

params?

type unknown
optional

options?

type { signal?: AbortSignal | undefined; queue?: boolean | undefined; id?: string | number | undefined; } | undefined
optional
returns Promise<unknown>

send

type (data: object): boolean

data

type object
returns boolean

update_url

type (url: string): void

url

type string
returns void

retry_queued_messages

type (): void

returns void

clear_failed_messages

type (): void

returns void

cancel_reconnect

type (): void

returns void

apply_reconnect_policy

Push the current auto_reconnect / reconnect_delay / reconnect_delay_max fields to the underlying client. No-op when there is no client (next connect() picks them up from construction).

type (): void

returns void

add_message_handler

type (handler: SocketMessageHandler): () => void

handler

type SocketMessageHandler
returns () => void

add_error_handler

type (handler: SocketErrorHandler): () => void

handler

type SocketErrorHandler
returns () => void

heartbeat_interval

Heartbeat idle interval in ms. Writing pushes the new policy into the underlying client immediately โ€” when connected, the live timer is restarted in place; when disconnected, the policy is stashed for the next connect().

type number

gettersetter

reconnect_delay

Reconnect policy fields. Assignments push into the underlying client via apply_reconnect_policy() so in-flight waits honor the new policy (monotonically shortened, never extended).

type number

gettersetter

reconnect_delay_max

type number

gettersetter

auto_reconnect

type boolean

gettersetter

SocketMessageQueue
#

SocketOptions
#

sort_by_numeric
#

sortable.svelte.ts view source

<T extends Cell<any>>(key: string, label: string, field: keyof T, direction?: "asc" | "desc"): Sorter<T> import {sort_by_numeric} from '@fuzdev/zzz/sortable.svelte.js';

Creates a numeric sorter with optional direction. Falls back to cell's cid for equal values.

key

type string

label

type string

field

type keyof T

direction

type "asc" | "desc"
default 'asc'

returns

Sorter<T>

generics

sort_by_numeric<T extends Cell<any>>
T
constraint Cell<any>

sort_by_text
#

sortable.svelte.ts view source

<T extends Cell<any>>(key: string, label: string, field: keyof T, direction?: "asc" | "desc"): Sorter<T> import {sort_by_text} from '@fuzdev/zzz/sortable.svelte.js';

Creates a text sorter with optional direction. Falls back to cell's cid for equal values.

key

type string

label

type string

field

type keyof T

direction

type "asc" | "desc"
default 'asc'

returns

Sorter<T>

generics

sort_by_text<T extends Cell<any>>
T
constraint Cell<any>

Sortable
#

sortable.svelte.ts view source

import {Sortable} from '@fuzdev/zzz/sortable.svelte.js';

Manages the sortable state for a collection of items with reactive data sources.

generics

Sortable<T>
T

items

type Array<T>

readonly $derived.by

sorters

type Array<Sorter<T>>

readonly $derived.by

default_key

type string | undefined

readonly $derived.by

active_key

Current active sort key.

type string

$state.raw

active_sorter

The currently active sorter.

type Sorter<T> | undefined

readonly $derived

active_sort_fn

The sort function from the active sorter.

type ((a: T, b: T) => number) | undefined

readonly $derived

sorted_items

Sorted items based on the current active sorter.

type Array<T>

readonly $derived.by

constructor

Creates a new Sortable instance with reactive sources.

type new <T>(items_getter: Thunk<T[]>, sorters_getter: Thunk<Sorter<T>[]>, key_getter_default?: Thunk<string | undefined> | undefined): Sortable<T>

items_getter

function that returns the current items array

type Thunk<T[]>

sorters_getter

function that returns the current sorters

type Thunk<Sorter<T>[]>

key_getter_default?

optional function that returns the current default sort key

type Thunk<string | undefined> | undefined
optional

update_active_key

Updates the active key based on sorters and default key. Called automatically on initialization and when sorters change.

type (): void

returns void

SortableList
#

SortableList.svelte view source

accepts children

import SortableList from '@fuzdev/zzz/SortableList.svelte';

items

type T[]

filter?

type (item: T) => boolean
optional

exclude_ids?

type (string & $brand<"Uuid">)[]
optional

sorters?

type Sorter<T>[]
optional default EMPTY_ARRAY

sort_key_default?

type string
optional

show_sort_controls?

type boolean
optional default false

no_items?

type string | Snippet<[]>
optional default '[no items available]'

list_attrs?

type HTMLAttributes<HTMLUListElement>
optional

item_attrs?

type HTMLLiAttributes
optional

label_attrs?

type HTMLLabelAttributes
optional

children

Called once per item.

type Snippet<[item: T]>
snippet parameters
item T

generics

SortableList<T extends {id: Uuid}>
T
constraint {id: Uuid}

Sorter
#

sortable.svelte.ts view source

Sorter<T> import type {Sorter} from '@fuzdev/zzz/sortable.svelte.js';

generics

Sorter<T>
T

key

type string

label

type string

fn

type (a: T, b: T) => number

Space
#

space.svelte.ts view source

import {Space} from '@fuzdev/zzz/space.svelte.js';

inheritance

extends: Cell<typeof SpaceJson>

name

type string

$state.raw

directory_paths

type Array<DiskfileDirectoryPath>

$state

directory_count

type number

readonly $derived

active_directory_paths

Directory paths filtered to only include those backed by an open workspace. Stale entries (from closed workspaces) are excluded.

type Array<DiskfileDirectoryPath>

readonly $derived

constructor

type new (options: SpaceOptions): Space

options

add_directory

type (path: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">): void

path

type string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">
returns void

remove_directory

type (path: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">): void

path

type string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">
returns void

SpaceJson
#

space.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; name: ZodDefault<...>; directory_paths: ZodDefault<...>; }, $strict> import type {SpaceJson} from '@fuzdev/zzz/space.svelte.js';

SpaceJsonInput
#

space.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; directory_paths?: string[] | undefined; } import type {SpaceJsonInput} from '@fuzdev/zzz/space.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

directory_paths?

type string[]

SpaceOptions
#

space.svelte.ts view source

SpaceOptions import type {SpaceOptions} from '@fuzdev/zzz/space.svelte.js';

inheritance

extends: CellOptions<typeof SpaceJson>

Spaces
#

spaces.svelte.ts view source

import {Spaces} from '@fuzdev/zzz/spaces.svelte.js';

inheritance

extends: Cell<typeof SpacesJson>

items

type IndexedCollection<Space>

readonly

active_id

type Uuid | null

$state.raw

active

type Space | undefined

readonly $derived

scratchpad

type Space | undefined

readonly $derived

constructor

type new (options: SpacesOptions): Spaces

options

ensure_scratchpad

type (): Space

returns Space

add

type (json?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; directory_paths?: string[] | undefined; } | undefined): Space

json?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; directory_paths?: string[] | undefined; } | undefined
optional
returns Space

generate_unique_name

type (base_name?: string): string

base_name

type string
default 'new space'
returns string

remove

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

activate

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

SpacesJson
#

spaces.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; active_id: ZodDefault<...>; }, $strict> import type {SpacesJson} from '@fuzdev/zzz/spaces.svelte.js';

SpacesJsonInput
#

spaces.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; directory_paths?: string[] | undefined; }[] | undefined; active_id?: string | ... 1 more ... | undefined; } import type {SpacesJsonInput} from '@fuzdev/zzz/spaces.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; directory_paths?: string[] | undefined; }[]

active_id?

type string

SpacesOptions
#

spaces.svelte.ts view source

SpacesOptions import type {SpacesOptions} from '@fuzdev/zzz/spaces.svelte.js';

inheritance

extends: CellOptions<typeof SpacesJson>

SUPPORTED_CODE_FILETYPE_MATCHER
#

Terminal
#

terminal.svelte.ts view source

import {Terminal} from '@fuzdev/zzz/terminal.svelte.js';

inheritance

extends: Cell<typeof TerminalJson>

name

type string

$state.raw

command

type string

$state.raw

args

type Array<string>

$state.raw

cwd

type string | undefined

$state.raw

status

type TerminalStatus

$state.raw

exit_code

type number | null

$state.raw

preset_id

type Uuid | null

$state.raw

constructor

type new (options: TerminalOptions): Terminal

options

terminal_close_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; signal: ZodOptional<...>; }, $strict>; output: ZodObject<...>; async: true; description: string; } import {terminal_close_action_spec} from '@fuzdev/zzz/action_specs.js';

terminal_create_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ command: ZodString; args: ZodDefault<ZodArray<ZodString>>; cwd: ZodOptional<...>; preset_id: ZodOptional<...>; }, $strict>; output: ZodObject<...>; async: true; des... import {terminal_create_action_spec} from '@fuzdev/zzz/action_specs.js';

terminal_data_action_spec
#

action_specs.ts view source

{ method: string; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; data: ZodString; }, $strict>; output: ZodVoid; async: true; description: string; } import {terminal_data_action_spec} from '@fuzdev/zzz/action_specs.js';

terminal_data_send_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; data: ZodString; }, $strict>; output: ZodNull; async: true; description: string; } import {terminal_data_send_action_spec} from '@fuzdev/zzz/action_specs.js';

terminal_exited_action_spec
#

action_specs.ts view source

{ method: string; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; exit_code: ZodNullable<...>; }, $strict>; output: ZodVoid; async: true; description: string; } import {terminal_exited_action_spec} from '@fuzdev/zzz/action_specs.js';

terminal_resize_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; cols: ZodNumber; rows: ZodNumber; }, $strict>; output: ZodNull; async: true; description: string; } import {terminal_resize_action_spec} from '@fuzdev/zzz/action_specs.js';

TerminalCloseInput
#

action_specs.ts view source

ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; signal: ZodOptional<ZodDefault<ZodString>>; }, $strict> import type {TerminalCloseInput} from '@fuzdev/zzz/action_specs.js';

Input for terminal_close.

TerminalCloseOutput
#

action_specs.ts view source

ZodObject<{ exit_code: ZodNullable<ZodNumber>; }, $strict> import type {TerminalCloseOutput} from '@fuzdev/zzz/action_specs.js';

Output for terminal_close.

TerminalCommandInput
#

TerminalContextmenu
#

TerminalContextmenu.svelte view source

accepts children

import TerminalContextmenu from '@fuzdev/zzz/TerminalContextmenu.svelte';

get_terminal_text

type Thunk<string> | null

display_command

type string

children

type Snippet<[]>

TerminalCreateInput
#

action_specs.ts view source

ZodObject<{ command: ZodString; args: ZodDefault<ZodArray<ZodString>>; cwd: ZodOptional<ZodString>; preset_id: ZodOptional<$ZodBranded<...>>; }, $strict> import type {TerminalCreateInput} from '@fuzdev/zzz/action_specs.js';

Input for terminal_create.

TerminalCreateOutput
#

action_specs.ts view source

ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; }, $strict> import type {TerminalCreateOutput} from '@fuzdev/zzz/action_specs.js';

Output for terminal_create.

TerminalDataInput
#

action_specs.ts view source

ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; data: ZodString; }, $strict> import type {TerminalDataInput} from '@fuzdev/zzz/action_specs.js';

Input for terminal_data (backend โ†’ frontend stdout/stderr stream).

TerminalDataSendInput
#

action_specs.ts view source

ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; data: ZodString; }, $strict> import type {TerminalDataSendInput} from '@fuzdev/zzz/action_specs.js';

Input for terminal_data_send.

TerminalExitedInput
#

action_specs.ts view source

ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; exit_code: ZodNullable<ZodNumber>; }, $strict> import type {TerminalExitedInput} from '@fuzdev/zzz/action_specs.js';

Input for terminal_exited.

TerminalJson
#

terminal.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 7 more ...; preset_id: ZodDefault<...>; }, $strict> import type {TerminalJson} from '@fuzdev/zzz/terminal.svelte.js';

TerminalJsonInput
#

terminal.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; command?: string | undefined; args?: string[] | undefined; cwd?: string | undefined; status?: "running" | ... 2 more ... | undefined; exit_code?: number | ... 1 more ... | undefined; preset_id?: string |... import type {TerminalJsonInput} from '@fuzdev/zzz/terminal.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

command?

type string

args?

type string[]

cwd?

type string

status?

type "running" | "stopped" | "exited"

exit_code?

type number

preset_id?

type string

TerminalOptions
#

terminal.svelte.ts view source

TerminalOptions import type {TerminalOptions} from '@fuzdev/zzz/terminal.svelte.js';

inheritance

extends: CellOptions<typeof TerminalJson>

TerminalPreset
#

terminal_preset.svelte.ts view source

import {TerminalPreset} from '@fuzdev/zzz/terminal_preset.svelte.js';

inheritance

extends: Cell<typeof TerminalPresetJson>

name

type string

$state.raw

command

type string

$state.raw

args

type Array<string>

$state.raw

cwd

type string | undefined

$state.raw

constructor

type new (options: TerminalPresetOptions): TerminalPreset

options

TerminalPresetBar
#

TerminalPresetBar.svelte view source

import TerminalPresetBar from '@fuzdev/zzz/TerminalPresetBar.svelte';

presets

type TerminalPreset[]

onrun

type (preset: TerminalPreset) => void

oncreate?

type (name: string, command: string, args: string[]) => void
optional

ondelete?

type (preset: TerminalPreset) => void
optional

TerminalPresetJson
#

terminal_preset.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 4 more ...; cwd: ZodOptional<...>; }, $strict> import type {TerminalPresetJson} from '@fuzdev/zzz/terminal_preset.svelte.js';

TerminalPresetJsonInput
#

terminal_preset.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; command?: string | undefined; args?: string[] | undefined; cwd?: string | undefined; } import type {TerminalPresetJsonInput} from '@fuzdev/zzz/terminal_preset.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

command?

type string

args?

type string[]

cwd?

type string

TerminalPresetOptions
#

terminal_preset.svelte.ts view source

TerminalPresetOptions import type {TerminalPresetOptions} from '@fuzdev/zzz/terminal_preset.svelte.js';

inheritance

extends: CellOptions<typeof TerminalPresetJson>

TerminalResizeInput
#

action_specs.ts view source

ZodObject<{ terminal_id: $ZodBranded<ZodUUID, "Uuid", "out">; cols: ZodNumber; rows: ZodNumber; }, $strict> import type {TerminalResizeInput} from '@fuzdev/zzz/action_specs.js';

Input for terminal_resize.

TerminalRunItem
#

TerminalRunItem.svelte view source

import TerminalRunItem from '@fuzdev/zzz/TerminalRunItem.svelte';

terminal_id

type string & $brand<"Uuid">

command

type string

args

type string[]

onclose

type (exit_code: number | null) => void

onrestart?

type () => void
optional

TerminalRunner
#

TerminalStatus
#

terminal.svelte.ts view source

ZodEnum<{ running: "running"; stopped: "stopped"; exited: "exited"; }> import type {TerminalStatus} from '@fuzdev/zzz/terminal.svelte.js';

TerminalView
#

TerminalView.svelte view source

import TerminalView from '@fuzdev/zzz/TerminalView.svelte';

terminal_id

type string & $brand<"Uuid">

onclose?

type (exit_code: number | null) => void
optional

get_text?

type (fn: () => string) => void
optional

testing_action_specs
#

testing_action_specs.ts view source

({ method: string; initiator: "frontend" | "backend" | "both"; side_effects: boolean; input: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; output: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; ... 6 more ...; rate_limit?: "both" | ... 2 more ... | undefined; } | { ...; } | { ...; ... import {testing_action_specs} from '@fuzdev/zzz/testing_action_specs.js';

Both test specs as a single array โ€” splice into all_action_specs when test mode is on.

TestingEmitNotificationsInput
#

testing_action_specs.ts view source

ZodObject<{ count: ZodNumber; }, $strict> import type {TestingEmitNotificationsInput} from '@fuzdev/zzz/testing_action_specs.js';

Input for _testing_emit_notifications.

TestingEmitNotificationsOutput
#

testing_action_specs.ts view source

ZodObject<{ count: ZodNumber; }, $strict> import type {TestingEmitNotificationsOutput} from '@fuzdev/zzz/testing_action_specs.js';

Output for _testing_emit_notifications.

TestingNotificationInput
#

testing_action_specs.ts view source

ZodObject<{ index: ZodNumber; }, $strict> import type {TestingNotificationInput} from '@fuzdev/zzz/testing_action_specs.js';

Input for _testing_notification.

TextPart
#

part.svelte.ts view source

import {TextPart} from '@fuzdev/zzz/part.svelte.js';

Text part - stores content directly.

inheritance

extends: Part<typeof TextPartJson>

type

type "text"

readonly

content

type string

$state.raw

constructor

type new (options: TextPartOptions): TextPart

options

TextPartJson
#

part.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 11 more ...; content: ZodDefault<...>; }, $strict> import type {TextPartJson} from '@fuzdev/zzz/part.svelte.js';

Text part schema - direct content storage.

TextPartJsonInput
#

part.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; has_xml_tag?: boolean | undefined; ... 6 more ...; content?: string | undefined; } import type {TextPartJsonInput} from '@fuzdev/zzz/part.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

start?

type number

end?

type number

has_xml_tag?

type boolean

xml_tag_name?

type string

attributes?

type { id?: string | undefined; key?: string | undefined; value?: string | undefined; }[]

enabled?

type boolean

title?

type string

summary?

type string

type?

type "text"

content?

type string

TextPartOptions
#

TextPartSchema
#

Thread
#

thread.svelte.ts view source

import {Thread} from '@fuzdev/zzz/thread.svelte.js';

A thread is a linear sequence of turns that maintains a chronological record of interactions between the user and the AI.

inheritance

extends: Cell<typeof ThreadJson>

model_name

type string

$state.raw

model

type Model | undefined

readonly $derived.by

turns

type IndexedCollection<Turn>

readonly

enabled

type boolean

$state.raw

content

type string

readonly $derived

length

type number

readonly $derived

token_count

type number

readonly $derived

content_preview

type string

readonly $derived

pending

Reactive flag: true while send_message has an in-flight completion_create. Owned by the thread so multiple views of the same thread stay in sync. Callers that bypass send_message and call app.api.completion_create directly will not update this flag.

type boolean

$state.raw

constructor

type new (options: ThreadOptions): Thread

options

add_turn

Add a turn to this thread.

type (turn: Turn): void

turn

type Turn
returns void

add_user_turn

Create and add a user turn with the given content.

type (content: string, request?: { created: string & $brand<"Datetime">; provider_name: "claude" | "chatgpt" | "gemini"; model: string; prompt: string; completion_messages?: { [x: string]: unknown; role: string; content: string; }[] | undefined; } | undefined): Turn

content

type string

request?

type { created: string & $brand<"Datetime">; provider_name: "claude" | "chatgpt" | "gemini"; model: string; prompt: string; completion_messages?: { [x: string]: unknown; role: string; content: string; }[] | undefined; } | undefined
optional
returns Turn

add_assistant_turn

Create and add an assistant turn with the given content.

type (content: string, json?: Partial<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; part_ids: (string & $brand<...>)[]; ... 4 more ...; error_message?: string | undefined; }> | undefined): Turn

content

type string

json?

type Partial<{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; part_ids: (string & $brand<"Uuid">)[]; ... 4 more ...; error_message?: string | undefined; }> | undefined
optional
returns Turn

add_system_turn

Create and add a system turn with the given content.

type (content: string): Turn

content

type string
returns Turn

add_turn_from_part

Create and add a turn from a part.

type (part: PartUnion, role: string): Turn

part

role

type string
returns Turn

remove_all_turns

Remove all turns from this thread.

type (): void

returns void

send_message

Send a message to the AI and create corresponding turns. Returns null if provider is unavailable (defensive check - UI should prevent this).

type (content: string): Promise<Turn | null>

content

type string
returns Promise<Turn | null>

cancel_pending

Abort the in-flight completion_create call (if any). Safe to call when nothing is pending โ€” no-op. The frontend WS client rejects the pending promise with request_cancelled and fires a cancel notification so the server can stop its provider stream.

type (): void

returns void

switch_model

type (model_id: string & $brand<"Uuid">): void

model_id

type string & $brand<"Uuid">
returns void

ThreadContextmenu
#

ThreadJson
#

thread_types.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; model_name: ZodDefault<...>; turns: ZodDefault<...>; enabled: ZodDefault<...>; }, $strict> import type {ThreadJson} from '@fuzdev/zzz/thread_types.js';

ThreadJsonInput
#

thread_types.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; model_name?: string | undefined; turns?: { role: string; id?: string | undefined; created?: string | undefined; ... 5 more ...; error_message?: string | undefined; }[] | undefined; enabled?: boolean | undefined; } import type {ThreadJsonInput} from '@fuzdev/zzz/thread_types.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

model_name?

type string

turns?

type { role: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; part_ids?: string[] | undefined; thread_id?: string | null | undefined; request?: { provider_name: "claude" | ... 1 more ... | "gemini"; model: string; prompt: string; created?: string | undefined; completion_message...

enabled?

type boolean

ThreadList
#

ThreadListitem
#

ThreadOptions
#

thread.svelte.ts view source

ThreadOptions import type {ThreadOptions} from '@fuzdev/zzz/thread.svelte.js';

inheritance

extends: CellOptions<typeof ThreadJson>

Threads
#

threads.svelte.ts view source

import {Threads} from '@fuzdev/zzz/threads.svelte.js';

inheritance

extends: Cell<typeof ThreadsJson>

items

type IndexedCollection<Thread>

readonly

constructor

type new (options: ThreadsOptions): Threads

options

add_thread

type (thread: Thread): Thread

thread

type Thread
returns Thread

remove

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

remove_many

type (ids: (string & $brand<"Uuid">)[]): number

ids

type (string & $brand<"Uuid">)[]
returns number

ThreadsJson
#

threads.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; }, $strict> import type {ThreadsJson} from '@fuzdev/zzz/threads.svelte.js';

ThreadsJsonInput
#

threads.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; model_name?: string | undefined; turns?: { ...; }[] | undefined; enabled?: boolean | undefined; }[] | undefined; } import type {ThreadsJsonInput} from '@fuzdev/zzz/threads.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; model_name?: string | undefined; turns?: { role: string; id?: string | undefined; created?: string | undefined; ... 5 more ...; error_message?: string | undefined; }[] | undefined; enabled?: boolean | undefined; }[]

ThreadsOptions
#

threads.svelte.ts view source

ThreadsOptions import type {ThreadsOptions} from '@fuzdev/zzz/threads.svelte.js';

inheritance

extends: CellOptions<typeof ThreadsJson>

ThreadToggleButton
#

Time
#

time.svelte.ts view source

import {Time} from '@fuzdev/zzz/time.svelte.js';

Reactive time management class that provides time-related utilities. Has a configurable update interval that defaults to a full minute to minimize wasteful reactivity, so it's suitable for any cases that need at best 1-minute precision, unless reconfigured.

inheritance

extends: Cell<typeof TimeJson>

DEFAULT_INTERVAL

Default update interval in milliseconds (1 minute). The idea is to minimize reactivity and CPU usage for a common use case.

type number

static

now

Current time that updates on the configured interval. This is reactive and can be used in derived computations.

type SvelteDate

readonly

now_ms

type number

readonly $derived

now_timestamp

type string

readonly $derived

now_formatted_short_date

type string

readonly $derived

now_formatted_datetime

type string

readonly $derived

now_formatted_time

type string

readonly $derived

interval

The interval in milliseconds between time updates.

type number

$state.raw

running

Whether the interval timer is currently running.

type boolean

$state.raw

constructor

type new (options: TimeOptions): Time

options

start

Starts the interval timer if it's not already running.

type (): boolean

returns boolean

stop

Stops the interval timer if it's running.

type (): boolean

returns boolean

restart

Restarts the interval timer with a new interval.

type (interval?: number | undefined): void

interval?

type number | undefined
optional
returns void

update_now

Updates the now to the current time immediately.

type (value?: number): void

value

type number
default Date.now()
returns void

dispose

Override Cell.dispose to stop the interval timer before unregistering.

type (): void

returns void

TimeJson
#

time.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; }, $strict> import type {TimeJson} from '@fuzdev/zzz/time.svelte.js';

TimeJsonInput
#

time.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; } import type {TimeJsonInput} from '@fuzdev/zzz/time.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

TimeOptions
#

time.svelte.ts view source

TimeOptions import type {TimeOptions} from '@fuzdev/zzz/time.svelte.js';

Options for configuring a Time instance.

inheritance

extends: CellOptions<typeof TimeJson>

interval?

Interval in milliseconds for updating now.

type number

default 60_000 (1 minute)

autostart?

Whether to automatically start the timer on initialization.

type boolean

default true in browser, false otherwise

TimeValue
#

TimeWidget
#

to_chats_url
#

nav_helpers.ts view source

(chat_id: (string & $brand<"Uuid">) | null): string import {to_chats_url} from '@fuzdev/zzz/nav_helpers.js';

chat_id

type (string & $brand<"Uuid">) | null

returns

string

to_completion_response_text
#

response_helpers.ts view source

(completion_response: { created: string & $brand<"Datetime">; provider_name: "claude" | "chatgpt" | "gemini"; model: string; data: { type: "claude"; value: any; } | { type: "chatgpt"; value: any; } | { ...; }; } | null | undefined): string | null import {to_completion_response_text} from '@fuzdev/zzz/response_helpers.js';

Extracts the text content from a completion response.

completion_response

type { created: string & $brand<"Datetime">; provider_name: "claude" | "chatgpt" | "gemini"; model: string; data: { type: "claude"; value: any; } | { type: "chatgpt"; value: any; } | { ...; }; } | null | undefined

returns

string | null

to_nav_link_href
#

to_preview
#

helpers.ts view source

(content: string | null | undefined, max_length?: number): string import {to_preview} from '@fuzdev/zzz/helpers.js';

content

type string | null | undefined

max_length

type number
default CONTENT_PREVIEW_LENGTH

returns

string

to_prompts_url
#

nav_helpers.ts view source

(prompt_id: (string & $brand<"Uuid">) | null): string import {to_prompts_url} from '@fuzdev/zzz/nav_helpers.js';

prompt_id

type (string & $brand<"Uuid">) | null

returns

string

to_relative_path
#

diskfile_helpers.ts view source

(path: string, parent: string): string import {to_relative_path} from '@fuzdev/zzz/diskfile_helpers.js';

path

type string

parent

type string

returns

string

to_reordered_list
#

list_helpers.ts view source

<T>(items: T[], from_index: number, to_index: number): T[] import {to_reordered_list} from '@fuzdev/zzz/list_helpers.js';

Creates a new reordered array without modifying the original.

items

type T[]

from_index

type number

to_index

type number

returns

T[]

generics

to_reordered_list<T>
T

toggle_main_menu_action_spec
#

action_specs.ts view source

{ method: string; kind: "local_call"; initiator: "frontend"; auth: null; side_effects: true; input: ZodOptional<ZodObject<{ show: ZodOptional<ZodBoolean>; }, $strict>>; output: ZodObject<...>; async: false; description: string; } import {toggle_main_menu_action_spec} from '@fuzdev/zzz/action_specs.js';

ToggleButton
#

ToggleButton.svelte view source

accepts children

import ToggleButton from '@fuzdev/zzz/ToggleButton.svelte';

active

Current state of the toggle

type boolean
bindable

active_content

Content to display when toggle is active

type string | Snippet<[]>

inactive_content

Content to display when toggle is inactive

type string | Snippet<[]>

intersects

SvelteHTMLElements['button']

ToggleMainMenuInput
#

action_specs.ts view source

ZodOptional<ZodObject<{ show: ZodOptional<ZodBoolean>; }, $strict>> import type {ToggleMainMenuInput} from '@fuzdev/zzz/action_specs.js';

Input for toggle_main_menu. Optional โ€” omit to toggle, pass {show} to set explicitly.

ToggleMainMenuOutput
#

action_specs.ts view source

ZodObject<{ show: ZodBoolean; }, $strict> import type {ToggleMainMenuOutput} from '@fuzdev/zzz/action_specs.js';

Output for toggle_main_menu.

Turn
#

turn.svelte.ts view source

import {Turn} from '@fuzdev/zzz/turn.svelte.js';

Turn represents a conversation turn (like A2A Message). Contextualizes parts within a conversation, providing role, metadata, and ordering.

inheritance

extends: Cell<typeof TurnJson>

part_ids

type Array<Uuid>

$state

thread_id

type Uuid | null | undefined

$state.raw

role

type CompletionRole

$state.raw

request

type CompletionRequest | undefined

$state.raw

response

type CompletionResponse | undefined

$state.raw

error_message

type string | undefined

$state.raw

parts

type Array<PartUnion>

readonly $derived

length

type number

readonly $derived

token_count

type number

readonly $derived

raw_content

type string | null | undefined

readonly $derived

is_content_loaded

type boolean

readonly $derived

is_content_empty

type boolean

readonly $derived

pending

type boolean

readonly $derived

constructor

type new (options: TurnOptions): Turn

options

set_part

type (part: PartUnion): void

part

returns void

add_part

type (part: PartUnion): void

part

returns void

remove_part

type (part_id: string & $brand<"Uuid">): boolean

part_id

type string & $brand<"Uuid">
returns boolean

enabled

type boolean

gettersetter

content

type string

gettersetter

TurnContextmenu
#

TurnJson
#

turn_types.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 6 more ...; error_message: ZodOptional<...>; }, $strict> import type {TurnJson} from '@fuzdev/zzz/turn_types.js';

Turn is a conversation turn (like A2A Message) that references one or more parts (content entities). Turns contextualize reusable content within conversations, providing role, metadata, and ordering.

TurnJsonInput
#

turn_types.ts view source

{ role: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; part_ids?: string[] | undefined; thread_id?: string | null | undefined; request?: { provider_name: "claude" | ... 1 more ... | "gemini"; model: string; prompt: string; created?: string | undefined; completion_message... import type {TurnJsonInput} from '@fuzdev/zzz/turn_types.js';

role

type string

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

part_ids?

type string[]

thread_id?

type string

request?

type { provider_name: "claude" | "chatgpt" | "gemini"; model: string; prompt: string; created?: string | undefined; completion_messages?: { [x: string]: unknown; role: string; content: string; }[] | undefined; }

response?

type { provider_name: "claude" | "chatgpt" | "gemini"; model: string; data: { type: "claude"; value?: any; } | { type: "chatgpt"; value?: any; } | { type: "gemini"; value: { text: string; candidates?: any[] | null | undefined; function_calls?: any[] | ... 1 more ... | undefined; prompt_feedback?: any; usage_metadata?: an...

error_message?

type string

TurnList
#

TurnListitem
#

TurnOptions
#

turn.svelte.ts view source

TurnOptions import type {TurnOptions} from '@fuzdev/zzz/turn.svelte.js';

inheritance

extends: CellOptions<typeof TurnJson>

TurnSchema
#

turn_types.ts view source

ZodCustom<Cell<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>, Cell<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>> import {TurnSchema} from '@fuzdev/zzz/turn_types.js';

TurnView
#

TutorialForChats
#

TutorialForDatabase
#

TutorialForDiskfiles
#

TutorialForPrompts
#

Ui
#

ui.svelte.ts view source

import {Ui} from '@fuzdev/zzz/ui.svelte.js';

inheritance

extends: Cell<typeof UiJson>

show_main_dialog

type boolean

$state.raw

show_sidebar

type boolean

$state.raw

tutorial_for_database

type boolean

$state.raw

tutorial_for_chats

type boolean

$state.raw

tutorial_for_prompts

type boolean

$state.raw

tutorial_for_diskfiles

type boolean

$state.raw

show_desk_menu

type boolean

$state.raw

desk_pinned

type boolean

$state.raw

pending_element_to_focus_key

Consumed by components like ContentEditor for focusing elements.

type string | number | null

$state.raw

constructor

type new (options: UiOptions): Ui

options

toggle_main_menu

Toggle the main menu visibility.

type (value?: boolean): boolean

value

type boolean
default !this.show_main_dialog
returns boolean

toggle_sidebar

Toggle the sidebar visibility.

type (value?: boolean): boolean

value

type boolean
default !this.show_sidebar
returns boolean

toggle_desk_menu

Toggle the desk menu visibility.

type (value?: boolean): boolean

value

type boolean
default !this.show_desk_menu
returns boolean

toggle_desk_pinned

Toggle the desk menu pinned state.

type (value?: boolean): boolean

value

type boolean
default !this.desk_pinned
returns boolean

UiJson
#

ui.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; ... 8 more ...; desk_pinned: ZodDefault<...>; }, $strict> import type {UiJson} from '@fuzdev/zzz/ui.svelte.js';

UiJsonInput
#

ui.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; show_main_dialog?: boolean | undefined; show_sidebar?: boolean | undefined; tutorial_for_database?: boolean | undefined; ... 4 more ...; desk_pinned?: boolean | undefined; } import type {UiJsonInput} from '@fuzdev/zzz/ui.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

show_main_dialog?

type boolean

show_sidebar?

type boolean

tutorial_for_database?

type boolean

tutorial_for_chats?

type boolean

tutorial_for_prompts?

type boolean

tutorial_for_diskfiles?

type boolean

show_desk_menu?

type boolean

desk_pinned?

type boolean

UiOptions
#

ui.svelte.ts view source

UiOptions import type {UiOptions} from '@fuzdev/zzz/ui.svelte.js';

inheritance

extends: CellOptions<typeof UiJson>

validate_reorderable_target_index
#

reorderable_helpers.ts view source

(target_index: number, max_index: number): number import {validate_reorderable_target_index} from '@fuzdev/zzz/reorderable_helpers.js';

Validate and adjust a target index to ensure it's within bounds

target_index

type number

max_index

type number

returns

number

ValueParser
#

cell_helpers.ts view source

ValueParser<TSchema, TKey> import type {ValueParser} from '@fuzdev/zzz/cell_helpers.js';

generics

ValueParser<TSchema extends z.ZodType, TKey extends keyof z.infer<TSchema> = keyof z.infer<TSchema>>
TSchema
constraint z.ZodType
TKey
constraint keyof z.infer<TSchema>
default keyof z.infer<TSchema>

WEBSOCKET_PATH
#

WEBSOCKET_URL
#

WEBSOCKET_URL_OBJECT
#

WebsocketCapabilityData
#

capabilities.svelte.ts view source

WebsocketCapabilityData import type {WebsocketCapabilityData} from '@fuzdev/zzz/capabilities.svelte.js';

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

Workspace
#

workspace.svelte.ts view source

import {Workspace} from '@fuzdev/zzz/workspace.svelte.js';

A workspace represents an open directory that zzz is watching and serving.

Workspaces are the primary unit of file access โ€” each workspace registers its directory with ScopedFs and starts a Filer for file watching.

inheritance

extends: Cell<typeof WorkspaceJson>

path

type DiskfileDirectoryPath

$state.raw

name

type string

$state.raw

opened_at

type Datetime

$state.raw

constructor

type new (options: WorkspaceOptions): Workspace

options

workspace_changed_action_spec
#

action_specs.ts view source

{ method: string; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ type: ZodEnum<{ open: "open"; close: "close"; }>; workspace: ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<...>, $ZodBranded<...>>, "DiskfileDirectoryPath", "out">; name: ZodString; opened_at: ZodS... import {workspace_changed_action_spec} from '@fuzdev/zzz/action_specs.js';

workspace_close_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<...>>, "DiskfileDirectoryPath", "out">; }, $strict>; output: ZodNull; async:... import {workspace_close_action_spec} from '@fuzdev/zzz/action_specs.js';

workspace_list_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: false; input: ZodVoid; output: ZodObject<{ workspaces: ZodArray<ZodObject<{ path: $ZodBranded<...>; name: ZodString; opened_at: ZodString; }, $strict>>; }, $strict>; async: true; descriptio... import {workspace_list_action_spec} from '@fuzdev/zzz/action_specs.js';

workspace_open_action_spec
#

action_specs.ts view source

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "none"; }; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<...>>, "DiskfileDirectoryPath", "out">; }, $strict>; output: ZodObject<...>;... import {workspace_open_action_spec} from '@fuzdev/zzz/action_specs.js';

WorkspaceChangedInput
#

action_specs.ts view source

ZodObject<{ type: ZodEnum<{ open: "open"; close: "close"; }>; workspace: ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; name: ZodString; opened_at: ZodString; }, $strict>; }, $strict> import type {WorkspaceChangedInput} from '@fuzdev/zzz/action_specs.js';

Input for workspace_changed.

WorkspaceCloseInput
#

action_specs.ts view source

ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; }, $strict> import type {WorkspaceCloseInput} from '@fuzdev/zzz/action_specs.js';

Input for workspace_close.

WorkspaceInfoJson
#

workspace.svelte.ts view source

ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; name: ZodString; opened_at: ZodString; }, $strict> import type {WorkspaceInfoJson} from '@fuzdev/zzz/workspace.svelte.js';

The wire format for workspace info shared between frontend and backend. Used in action spec inputs/outputs and for JSON persistence.

WorkspaceJson
#

workspace.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; path: $ZodBranded<...>; name: ZodDefault<...>; opened_at: ZodDefault<...>; }, $strict> import type {WorkspaceJson} from '@fuzdev/zzz/workspace.svelte.js';

WorkspaceJsonInput
#

workspace.svelte.ts view source

{ path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; } import type {WorkspaceJsonInput} from '@fuzdev/zzz/workspace.svelte.js';

path

type string

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

name?

type string

opened_at?

type string

WorkspaceListOutput
#

action_specs.ts view source

ZodObject<{ workspaces: ZodArray<ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; name: ZodString; opened_at: ZodString; }, $strict>>; }, $strict> import type {WorkspaceListOutput} from '@fuzdev/zzz/action_specs.js';

Output for workspace_list.

WorkspaceOpenInput
#

action_specs.ts view source

ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; }, $strict> import type {WorkspaceOpenInput} from '@fuzdev/zzz/action_specs.js';

Input for workspace_open.

WorkspaceOpenOutput
#

action_specs.ts view source

ZodObject<{ workspace: ZodObject<{ path: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath", "out">>, "DiskfileDirectoryPath", "out">; name: ZodString; opened_at: ZodString; }, $strict>; files: ZodArray<...>; }, $strict> import type {WorkspaceOpenOutput} from '@fuzdev/zzz/action_specs.js';

Output for workspace_open.

WorkspaceOptions
#

workspace.svelte.ts view source

WorkspaceOptions import type {WorkspaceOptions} from '@fuzdev/zzz/workspace.svelte.js';

inheritance

extends: CellOptions<typeof WorkspaceJson>

Workspaces
#

workspaces.svelte.ts view source

import {Workspaces} from '@fuzdev/zzz/workspaces.svelte.js';

Collection of open workspaces.

Manages the set of directories the daemon is watching and serving. Each workspace has a unique path used as the index key.

inheritance

extends: Cell<typeof WorkspacesJson>

items

type IndexedCollection<Workspace>

readonly

active_id

type Uuid | null

$state.raw

active

type Workspace | undefined

readonly $derived

constructor

type new (options: WorkspacesOptions): Workspaces

options

add

Add a workspace. If a workspace with the same path already exists, returns it.

type (json: { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }): Workspace

json

type { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }
returns Workspace

remove

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

get_by_path

type (path: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">): Workspace | undefined

path

type string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">
returns Workspace | undefined

remove_by_path

Remove the workspace at path, if one exists. No-op when absent.

type (path: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">): void

path

type string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">
returns void

activate

type (id: string & $brand<"Uuid">): void

id

type string & $brand<"Uuid">
returns void

WorkspacesJson
#

workspaces.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; active_id: ZodDefault<...>; }, $strict> import type {WorkspacesJson} from '@fuzdev/zzz/workspaces.svelte.js';

WorkspacesJsonInput
#

workspaces.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }[] | undefined; active_id?: string | ... 1 more ... | undefin... import type {WorkspacesJsonInput} from '@fuzdev/zzz/workspaces.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }[]

active_id?

type string

WorkspacesOptions
#

workspaces.svelte.ts view source

WorkspacesOptions import type {WorkspacesOptions} from '@fuzdev/zzz/workspaces.svelte.js';

inheritance

extends: CellOptions<typeof WorkspacesJson>

XmlAttribute
#

xml.ts view source

ZodObject<{ id: $ZodBranded<ZodUUID, "Uuid", "out">; key: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>; value: ZodString; }, $strict> import type {XmlAttribute} from '@fuzdev/zzz/xml.js';

XmlAttributeEditor
#

XmlAttributeEditor.svelte view source

import XmlAttributeEditor from '@fuzdev/zzz/XmlAttributeEditor.svelte';

attribute

type { id: string & $brand<"Uuid">; key: string; value: string; }

dormant?

type boolean
optional

onupdate

type (updates: Partial<OmitStrict<{ id: string & $brand<"Uuid">; key: string; value: string; }, "id">>) => void

onremove

type () => void

XmlAttributeKey
#

xml.ts view source

ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString> import type {XmlAttributeKey} from '@fuzdev/zzz/xml.js';

XmlAttributeKeyWithDefault
#

xml.ts view source

ZodDefault<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>> import type {XmlAttributeKeyWithDefault} from '@fuzdev/zzz/xml.js';

XmlAttributeValue
#

xml.ts view source

ZodString import type {XmlAttributeValue} from '@fuzdev/zzz/xml.js';

XmlAttributeValueWithDefault
#

xml.ts view source

ZodDefault<ZodString> import type {XmlAttributeValueWithDefault} from '@fuzdev/zzz/xml.js';

XmlAttributeWithDefaults
#

xml.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; key: ZodDefault<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>; value: ZodDefault<...>; }, $strict> import type {XmlAttributeWithDefaults} from '@fuzdev/zzz/xml.js';

XmlTagControls
#

ZZZ_DIR
#

ZZZ_DIR_CACHE
#

ZZZ_DIR_RUN
#

ZZZ_DIR_STATE
#

ZZZ_DIR_STATE_COMPLETIONS
#

ZZZ_SCOPED_DIRS
#

constants.ts view source

string[] import {ZZZ_SCOPED_DIRS} from '@fuzdev/zzz/constants.js';

Comma-separated list of filesystem paths that Zzz can access. Empty array means no scoped filesystem access.

ZzzOptions
#

config_helpers.ts view source

ZzzOptions import type {ZzzOptions} from '@fuzdev/zzz/config_helpers.js';

providers

type Array<ProviderJsonInput>

models

type Array<ModelJsonInput>

bots

type { /** * Names things. */ namerbot: ModelName; }

ZzzOptionsCreator
#