api #

Declarations
#

local-first forge for power users and devs

818 declarations

Action
#

action.svelte.ts view source

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

inheritance

extends:
  • Cell<typeof ActionJson>

method

type ActionMethod

action_event_data

type ActionEventData | undefined

spec

type ActionSpecUnion

readonly

kind

type ActionKind

readonly

has_error

readonly

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).

readonly

failed

readonly

success

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

readonly

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<"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more ... | "failed">): () => void

action_event
type ActionEvent<"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more...
returns () => void

dispose

type (): void

returns void

ACTION_DATE_FORMAT
#

ACTION_EVENT_PHASE_BY_KIND
#

action_event_types.ts view source

Record<"request_response" | "remote_notification" | "local_call", readonly ("send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute")[]>

ACTION_EVENT_PHASE_TRANSITIONS
#

action_event_types.ts view source

Record<"send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute", "send_request" | "receive_request" | ... 7 more ... | null>

ACTION_EVENT_STEP_TRANSITIONS
#

action_event_types.ts view source

Record<"initial" | "parsed" | "handling" | "handled" | "failed", readonly ("initial" | "parsed" | "handling" | "handled" | "failed")[]>

action_specs
#

action_collections.ts view source

({ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; })[]

ACTION_TIME_FORMAT
#

ActionAuth
#

ActionContextmenu
#

ActionDetail
#

ActionEvent
#

action_event.ts view source

Action event that manages the lifecycle of an action through its state machine.

generics

TMethod

constraint ActionMethod
default ActionMethod

TEnvironment

TPhase

constraint ActionEventPhase

TStep

constraint ActionEventStep

environment

type TEnvironment

readonly

spec

type ActionSpecUnion

readonly

constructor

type new <TMethod extends ActionMethod = "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu", TEnvironment extends ActionEventEnvironment = ActionEventEnvironment, TPhase extends ActionEventPhase = "send_request" | ... 7 more ... | "execute", TStep extends ActionEventStep = "initial" | ... 3 more ... | "failed">(environment: TEnvironment, spec: { ...; } | ... 1 more ... | { ...; }, data: ActionEventDatas[TMethod]): ActionEvent<...>

environment
type TEnvironment
spec
type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }
data
type ActionEventDatas[TMethod]

toJSON

type (): ActionEventDatas[TMethod]

returns ActionEventDatas[TMethod]

observe

type (listener: ActionEventChangeObserver<TMethod>): () => void

listener
type ActionEventChangeObserver<TMethod>
returns () => void

set_data

type (new_data: ActionEventDatas[TMethod]): void

new_data
type ActionEventDatas[TMethod]
returns void

parse

Parse input data according to the action's schema.

type (): this

returns this

handle_async

Execute the handler for the current phase.

type (): Promise<void>

returns Promise<void>

handle_sync

Execute handler synchronously (only for sync local_call actions).

type (): void

returns void

transition

Transition to a new phase.

type (phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"): void

phase
type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"
returns void

is_complete

type (): boolean

returns boolean

update_progress

type (progress: unknown): void

progress
type unknown
returns void

set_request

type (request: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): void

request
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns void

set_response

type (response: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message: string; data?: unknown; }; }): void

response
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message: string...
returns void

set_notification

type (notification: { [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined; }): void

notification
type { [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined; }
returns void

ActionEventChangeObserver
#

ActionEventData
#

action_event_data.ts view source

ZodObject<{ kind: ZodEnum<{ request_response: "request_response"; remote_notification: "remote_notification"; local_call: "local_call"; }>; phase: ZodEnum<{ send_request: "send_request"; ... 7 more ...; execute: "execute"; }>; ... 9 more ...; notification: ZodNullable<...>; }, $strict>

ActionEventDatas
#

action_collections.ts view source

ActionEventDatas

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.

completion_create

type ActionEventRequestResponseData<'completion_create'>

completion_progress

type ActionEventRemoteNotificationData<'completion_progress'>

directory_create

type ActionEventRequestResponseData<'directory_create'>

diskfile_delete

type ActionEventRequestResponseData<'diskfile_delete'>

diskfile_update

type ActionEventRequestResponseData<'diskfile_update'>

filer_change

type ActionEventRemoteNotificationData<'filer_change'>

ollama_copy

type ActionEventRequestResponseData<'ollama_copy'>

ollama_create

type ActionEventRequestResponseData<'ollama_create'>

ollama_delete

type ActionEventRequestResponseData<'ollama_delete'>

ollama_list

type ActionEventRequestResponseData<'ollama_list'>

ollama_progress

type ActionEventRemoteNotificationData<'ollama_progress'>

ollama_ps

type ActionEventRequestResponseData<'ollama_ps'>

ollama_pull

type ActionEventRequestResponseData<'ollama_pull'>

ollama_show

type ActionEventRequestResponseData<'ollama_show'>

ollama_unload

type ActionEventRequestResponseData<'ollama_unload'>

ping

type ActionEventRequestResponseData<'ping'>

provider_load_status

type ActionEventRequestResponseData<'provider_load_status'>

provider_update_api_key

type ActionEventRequestResponseData<'provider_update_api_key'>

session_load

type ActionEventRequestResponseData<'session_load'>

toggle_main_menu

type ActionEventLocalCallData<'toggle_main_menu'>

ActionEventDataUnion
#

ActionEventEnvironment
#

action_event_types.ts view source

ActionEventEnvironment

executor

readonly

peer

lookup_action_handler

type ( method: ActionMethod, phase: ActionEventPhase, ) => ((event: any) => any) | undefined

lookup_action_spec

type (method: ActionMethod) => ActionSpecUnion | undefined

log

type Logger | null
readonly

actions

type Actions

ActionEventLocalCallData
#

ActionEventPhase
#

action_event_types.ts view source

ZodEnum<{ send_request: "send_request"; receive_request: "receive_request"; send_response: "send_response"; receive_response: "receive_response"; send_error: "send_error"; receive_error: "receive_error"; send: "send"; receive: "receive"; execute: "execute"; }>

ActionEventRemoteNotificationData
#

ActionEventRequestResponseData
#

ActionEventStep
#

ActionExecutor
#

ActionInitiator
#

ActionInput
#

action_types.ts view source

ZodUnion<readonly [ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $loose>, ZodObject<...>]>, ZodUndefined, ZodVoid]>

ActionInputs
#

action_collections.ts view source

{ readonly completion_create: ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; prompt: ZodString; completion_messages: ZodOptional<...>; },...

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">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; method: ZodEnum<...>; action_event_data: ZodOptional<...>; }, $strict>

ActionJsonInput
#

action.svelte.ts view source

{ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_e...

ActionKind
#

action_types.ts view source

ZodEnum<{ request_response: "request_response"; remote_notification: "remote_notification"; local_call: "local_call"; }>

ActionList
#

ActionList.svelte view source

limit?

type number | undefined
optional

selected_action_id?

type string | null | undefined
optional

attrs?

type SvelteHTMLElements['div'] | undefined
optional

onselect?

type ((action: Action) => void) | undefined
optional

ActionListitem
#

ActionMethod
#

action_metatypes.ts view source

ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>

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

ActionMethods
#

action_collections.ts view source

ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>

All method types combined.

ActionOptions
#

ActionOutput
#

action_types.ts view source

ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{}, $loose>>; }, $loose>, ZodUndefined, ZodVoid]>

ActionOutputs
#

action_collections.ts view source

{ readonly completion_create: ZodObject<{ completion_response: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; data: ZodDiscriminatedUnion<...>; }, $strict>; _meta: ZodOp...

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.

ActionPeer
#

action_peer.ts view source

environment

type ActionEventEnvironment

readonly

transports

type Transports

readonly

default_send_options

type ActionPeerSendOptions

constructor

type new (options: ActionPeerOptions): ActionPeer

options

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }, options?: ActionPeerSendOptions | undefined): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
options?
type ActionPeerSendOptions | undefined
optional
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }, options?: ActionPeerSendOptions | undefined): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
options?
type ActionPeerSendOptions | undefined
optional
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }, options?: ActionPeerSendOptions | undefined): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
options?
type ActionPeerSendOptions | undefined
optional
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

receive

type (message: unknown): Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { ...; }; } | { ...; } | null>

message
type unknown
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

ActionPeerOptions
#

ActionPeerSendOptions
#

ActionRegistry
#

action_registry.ts view source

Utility class to manage and query action specifications. Provides helper methods to get actions by various criteria.

specs

type Array<ActionSpecUnion>

constructor

type new (specs: ({ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; })[]): ActionRegistry

specs
type ({ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; })[]

get_schema_imports

type (): string[]

returns string[]

Actions
#

actions.svelte.ts view source

Stores the action history.

inheritance

extends:
  • Cell<typeof ActionsJson>

items

type IndexedCollection<Action>

readonly

history_limit

type number

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: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | ... 15 more ... | "toggle_main_menu"; 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: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | ... 15 more ... | "toggle_main_menu"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; ac...
optional
returns void

add

type (action: Action): void

action
type Action
returns void

add_from_json

type (action_json: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_event_data?: { ...; } | undefined; }): Action

action_json
type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; action_e...
returns Action

ActionsApi
#

action_metatypes.ts view source

ActionsApi

Interface for action dispatch functions. All async methods return Result types for type-safe error handling. Sync methods (like toggle_main_menu) return values directly.

completion_create

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

completion_progress

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

directory_create

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

diskfile_delete

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

diskfile_update

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

filer_change

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

ollama_copy

type ( input: ActionInputs['ollama_copy'], ) => Promise<Result<{value: ActionOutputs['ollama_copy']}, {error: JsonrpcErrorJson}>>

ollama_create

type ( input: ActionInputs['ollama_create'], ) => Promise<Result<{value: ActionOutputs['ollama_create']}, {error: JsonrpcErrorJson}>>

ollama_delete

type ( input: ActionInputs['ollama_delete'], ) => Promise<Result<{value: ActionOutputs['ollama_delete']}, {error: JsonrpcErrorJson}>>

ollama_list

type ( input?: void, ) => Promise<Result<{value: ActionOutputs['ollama_list']}, {error: JsonrpcErrorJson}>>

ollama_progress

type ( input: ActionInputs['ollama_progress'], ) => Promise<Result<{value: ActionOutputs['ollama_progress']}, {error: JsonrpcErrorJson}>>

ollama_ps

type ( input?: void, ) => Promise<Result<{value: ActionOutputs['ollama_ps']}, {error: JsonrpcErrorJson}>>

ollama_pull

type ( input: ActionInputs['ollama_pull'], ) => Promise<Result<{value: ActionOutputs['ollama_pull']}, {error: JsonrpcErrorJson}>>

ollama_show

type ( input: ActionInputs['ollama_show'], ) => Promise<Result<{value: ActionOutputs['ollama_show']}, {error: JsonrpcErrorJson}>>

ollama_unload

type ( input: ActionInputs['ollama_unload'], ) => Promise<Result<{value: ActionOutputs['ollama_unload']}, {error: JsonrpcErrorJson}>>

ping

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

provider_load_status

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

provider_update_api_key

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

session_load

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

toggle_main_menu

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

ActionSchema
#

ActionSideEffects
#

ActionsJson
#

actions.svelte.ts view source

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

ActionsJsonInput
#

actions.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | ... 15 more ... | "toggle_main_menu"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; ac...

ActionsOptions
#

ActionSpec
#

action_spec.ts view source

ZodObject<{ method: ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>; ... 6 more ...; async: ZodBoolean;...

ActionSpecs
#

action_collections.ts view source

{ readonly completion_create: { method: "completion_create"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<...>; model: ZodString; prompt: Zod...

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

ActionSpecUnion
#

action_spec.ts view source

ZodUnion<readonly [ZodObject<{ method: ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; ... 15 more ...; toggle_main_menu: "toggle_main_menu"; }>; ... 6 more ...; async: ZodDefault<...>; }, $strict>...

Alignment
#

Any
#

API_PATH
#

API_PATH_FOR_HTTP_RPC
#

API_URL
#

API_URL_FOR_HTTP_RPC
#

App
#

app.svelte.ts view source

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

inheritance

extends:

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; }

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
#

server/backend.ts view source

Server for managing the Zzz application state and handling client messages.

inheritance

executor

type ActionExecutor

readonly

zzz_dir

The full path to the Zzz directory.

type DiskfileDirectoryPath

readonly

scoped_dirs

Filesystem paths that Zzz can access for user files.

type ReadonlyArray<DiskfileDirectoryPath>

readonly

config

type ZzzConfig

readonly

peer

type ActionPeer

readonly

api

API for backend-initiated actions.

type BackendActionsApi

readonly

scoped_fs

Scoped filesystem interface that restricts operations to allowed directories.

type ScopedFs

readonly

log

type Logger | null

readonly

filers

type Map<string, FilerInstance>

readonly

action_registry

readonly

providers

Available AI providers.

type Array<BackendProvider>

readonly

constructor

type new (options: BackendOptions): Backend

options

lookup_action_handler

type (method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", phase: "send_request" | ... 7 more ... | "execute"): ((event: any) => any) | undefined

method
type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"
phase
type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"
returns ((event: any) => any) | undefined

lookup_action_spec

type (method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): { ...; } | ... 2 more ... | undefined

method
type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"
returns { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | undefined

lookup_provider

type <T extends keyof BackendProviders>(provider_name: T): BackendProviders[T]

provider_name
type T
returns BackendProviders[T]

receive

Process a singular JSON-RPC message and return a response. Like MCP, Zzz breaks from JSON-RPC by not supporting batching.

type (message: unknown): Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { ...; }; } | { ...; } | null>

message
type unknown
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

destroy

Server teardown and cleanup.

type (): Promise<void>

returns Promise<void>

add_provider

type (provider: BackendProvider<unknown>): void

provider
type BackendProvider<unknown>
returns void

backend_action_handlers
#

BACKEND_ARTIFICIAL_RESPONSE_DELAY
#

BackendActionHandlers
#

server/backend_action_types.ts view source

BackendActionHandlers

Backend action handlers organized by method and phase. Generated using spec.initiator to determine valid phases: - initiator: 'backend' → send/execute phases - initiator: 'frontend' → receive phases - initiator: 'both' → all valid phases

completion_create

type { receive_request?: ( action_event: ActionEvent<'completion_create', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['completion_create'] | Promise<ActionOutputs['completion_create']>; send_response?: ( action_event: ActionEvent<'completion_create', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'completion_create', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

completion_progress

type { send?: ( action_event: ActionEvent<'completion_progress', Backend, 'send', 'handling'>, ) => void | Promise<void>; }

directory_create

type { receive_request?: ( action_event: ActionEvent<'directory_create', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['directory_create'] | Promise<ActionOutputs['directory_create']>; send_response?: ( action_event: ActionEvent<'directory_create', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'directory_create', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

diskfile_delete

type { receive_request?: ( action_event: ActionEvent<'diskfile_delete', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['diskfile_delete'] | Promise<ActionOutputs['diskfile_delete']>; send_response?: ( action_event: ActionEvent<'diskfile_delete', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'diskfile_delete', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

diskfile_update

type { receive_request?: ( action_event: ActionEvent<'diskfile_update', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['diskfile_update'] | Promise<ActionOutputs['diskfile_update']>; send_response?: ( action_event: ActionEvent<'diskfile_update', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'diskfile_update', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

filer_change

type { send?: ( action_event: ActionEvent<'filer_change', Backend, 'send', 'handling'>, ) => void | Promise<void>; }

ollama_copy

type { receive_request?: ( action_event: ActionEvent<'ollama_copy', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_copy'] | Promise<ActionOutputs['ollama_copy']>; send_response?: ( action_event: ActionEvent<'ollama_copy', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_copy', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_create

type { receive_request?: ( action_event: ActionEvent<'ollama_create', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_create'] | Promise<ActionOutputs['ollama_create']>; send_response?: ( action_event: ActionEvent<'ollama_create', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_create', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_delete

type { receive_request?: ( action_event: ActionEvent<'ollama_delete', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_delete'] | Promise<ActionOutputs['ollama_delete']>; send_response?: ( action_event: ActionEvent<'ollama_delete', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_delete', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_list

type { receive_request?: ( action_event: ActionEvent<'ollama_list', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_list'] | Promise<ActionOutputs['ollama_list']>; send_response?: ( action_event: ActionEvent<'ollama_list', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_list', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_progress

type { send?: ( action_event: ActionEvent<'ollama_progress', Backend, 'send', 'handling'>, ) => void | Promise<void>; }

ollama_ps

type { receive_request?: ( action_event: ActionEvent<'ollama_ps', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_ps'] | Promise<ActionOutputs['ollama_ps']>; send_response?: ( action_event: ActionEvent<'ollama_ps', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_ps', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_pull

type { receive_request?: ( action_event: ActionEvent<'ollama_pull', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_pull'] | Promise<ActionOutputs['ollama_pull']>; send_response?: ( action_event: ActionEvent<'ollama_pull', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_pull', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_show

type { receive_request?: ( action_event: ActionEvent<'ollama_show', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_show'] | Promise<ActionOutputs['ollama_show']>; send_response?: ( action_event: ActionEvent<'ollama_show', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_show', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ollama_unload

type { receive_request?: ( action_event: ActionEvent<'ollama_unload', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['ollama_unload'] | Promise<ActionOutputs['ollama_unload']>; send_response?: ( action_event: ActionEvent<'ollama_unload', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'ollama_unload', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

ping

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

provider_load_status

type { receive_request?: ( action_event: ActionEvent<'provider_load_status', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['provider_load_status'] | Promise<ActionOutputs['provider_load_status']>; send_response?: ( action_event: ActionEvent<'provider_load_status', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'provider_load_status', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

provider_update_api_key

type { receive_request?: ( action_event: ActionEvent<'provider_update_api_key', Backend, 'receive_request', 'handling'>, ) => | ActionOutputs['provider_update_api_key'] | Promise<ActionOutputs['provider_update_api_key']>; send_response?: ( action_event: ActionEvent<'provider_update_api_key', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'provider_update_api_key', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

session_load

type { receive_request?: ( action_event: ActionEvent<'session_load', Backend, 'receive_request', 'handling'>, ) => ActionOutputs['session_load'] | Promise<ActionOutputs['session_load']>; send_response?: ( action_event: ActionEvent<'session_load', Backend, 'send_response', 'handling'>, ) => void | Promise<void>; send_error?: ( action_event: ActionEvent<'session_load', Backend, 'send_error', 'handling'>, ) => void | Promise<void>; }

toggle_main_menu

type never

BackendActionMethod
#

action_metatypes.ts view source

ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 13 more ...; session_load: "session_load"; }>

Names of all actions that may be handled on the server.

BackendActionsApi
#

server/backend_actions_api.ts view source

BackendActionsApi

filer_change

type (input: ActionInputs['filer_change']) => Promise<void>

completion_progress

type (input: ActionInputs['completion_progress']) => Promise<void>

ollama_progress

type (input: ActionInputs['ollama_progress']) => Promise<void>

BackendOptions
#

server/backend.ts view source

BackendOptions

zzz_dir

Zzz directory path, defaults to .zzz.

type string

scoped_dirs

Filesystem paths that Zzz can access for user files. Defaults to ZZZ_SCOPED_DIRS from env.

type Array<string>

config

Configuration for the backend and AI providers.

action_specs

Action specifications that determine what the backend can do.

type Array<ActionSpecUnion>

action_handlers

Handler function for processing client messages.

handle_filer_change

Handler function for file system changes.

log

Optional logger instance. Disabled when null, and undefined falls back to a new Logger instance.

type Logger | null | undefined

BackendProvider
#

server/backend_provider.ts view source

Base class for all backend AI providers. Provides shared functionality for completion handlers and logging.

generics

TClient

default unknown

name

type string

abstractreadonly

client

type TClient | null

protected

provider_status

type ProviderStatus | null

protected

on_completion_progress

type OnCompletionProgress

protectedreadonly

constructor

type new <TClient = unknown>(options: BackendProviderOptions): BackendProvider<TClient>

options

handle_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

abstract
options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

handle_non_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

abstract
options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

get_handler

type (streaming: boolean): CompletionHandler

streaming
type boolean

create_client

type (): void

protectedabstract
returns void

get_client

Get the client, throwing an error if not configured.

type (): TClient

abstract
returns TClient

load_status

Get status for this provider. Override for custom availability checks.

type (reload?: boolean | undefined): Promise<{ name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }>

abstract
reload?
type boolean | undefined
optional
returns Promise<{ name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }>

invalidate_status

Invalidate cached status, forcing next load to fetch fresh data.

type (): void

returns void

validate_streaming_requirements

Validates that progress_token is provided for streaming requests.

type (progress_token?: (string & $brand<"Uuid">) | undefined): asserts progress_token

protected
progress_token?
type (string & $brand<"Uuid">) | undefined
optional
returns void

send_streaming_progress

Sends streaming progress notification to frontend

type (progress_token: string & $brand<"Uuid">, chunk: { [x: string]: unknown; model?: string | undefined; created_at?: string | undefined; done?: boolean | undefined; message?: { [x: string]: unknown; role: string; content: string; } | undefined; } | undefined): Promise<...>

protected
progress_token
type string & $brand<"Uuid">
chunk
type { [x: string]: unknown; model?: string | undefined; created_at?: string | undefined; done?: boolean | undefined; message?: { [x: string]: unknown; role: string; content: string; } | undefined; } | undefined
returns Promise<void>

log_streaming_chunk

Logs streaming chunk information

type (chunk: unknown): void

protected
chunk
type unknown
returns void

log_streaming_completion

Logs streaming completion information

type (accumulated_length: number): void

protected
accumulated_length
type number
returns void

log_non_streaming_response

Logs non-streaming response information

type (response: unknown): void

protected
response
type unknown
returns void

log_api_response

Logs final API response information

type (api_response: unknown): void

protected
api_response
type unknown
returns void

BackendProviderChatgpt
#

server/backend_provider_chatgpt.ts view source

inheritance

extends:
  • BackendProviderRemote<OpenAI>

name

readonly

constructor

type new (options: BackendProviderOptions): BackendProviderChatgpt

options

create_client

type (): void

protected
returns void

handle_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

handle_non_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

BackendProviderClaude
#

server/backend_provider_claude.ts view source

inheritance

extends:
  • BackendProviderRemote<Anthropic>

name

readonly

constructor

type new (options: BackendProviderOptions): BackendProviderClaude

options

create_client

type (): void

protected
returns void

handle_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

handle_non_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

BackendProviderGemini
#

server/backend_provider_gemini.ts view source

inheritance

extends:
  • BackendProviderRemote<GoogleGenerativeAI>

name

readonly

constructor

type new (options: BackendProviderOptions): BackendProviderGemini

options

create_client

type (): void

protected
returns void

handle_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

handle_non_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

BackendProviderLocal
#

server/backend_provider.ts view source

Base class for locally-installed providers (Ollama). Handles installation checking and provides default error handling for missing installations.

generics

TClient

default unknown

inheritance

extends:
  • BackendProvider<TClient>

constructor

type new <TClient = unknown>(options: BackendProviderOptions): BackendProviderLocal<TClient>

options

get_client

type (): TClient

returns TClient

BackendProviderOllama
#

server/backend_provider_ollama.ts view source

inheritance

extends:
  • BackendProviderLocal<Ollama>

name

readonly

create_client

type (): void

protected
returns void

load_status

type (reload?: boolean): Promise<{ name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }>

reload
type boolean
default false
returns Promise<{ name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }>

handle_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

handle_non_streaming_completion

type (options: CompletionHandlerOptions): Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { ...; } | ... 2 more ... | { ...; }; }; _meta?: { ...; } | undefined; }>

options
returns Promise<{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }>

BackendProviderOptions
#

BackendProviderRemote
#

server/backend_provider.ts view source

Base class for remote API-based providers (Claude, ChatGPT, Gemini). Handles API key management and provides default error handling for missing keys.

generics

TClient

default unknown

inheritance

extends:
  • BackendProvider<TClient>

api_key

type string | null

protected

constructor

type new <TClient = unknown>(options: BackendProviderOptions): BackendProviderRemote<TClient>

options

set_api_key

Update the API key and recreate the client.

type (api_key: string | null): void

api_key
type string | null
returns void

get_client

type (): TClient

returns TClient

load_status

type (reload?: boolean): Promise<{ name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }>

reload
type boolean
default false
returns Promise<{ name: string; available: true; checked_at: number; } | { name: string; available: false; error: string; checked_at: number; }>

BackendWebsocketTransport
#

server/backend_websocket_transport.ts view source

inheritance

implements:

transport_name

readonly

add_connection

Add a new WebSocket connection.

type (ws: WSContext<unknown>): string & $brand<"Uuid">

ws
type WSContext<unknown>
returns string & $brand<"Uuid">

remove_connection

Remove a WebSocket connection.

type (ws: WSContext<unknown>): void

ws
type WSContext<unknown>
returns void

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

is_ready

type (): boolean

returns boolean

BOTS_DEFAULT
#

calculate_reorderable_target_index
#

reorderable_helpers.ts view source

(source_index: number, current_index: number, position: ReorderableValidDropPosition): number

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

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

inheritance

extends:
  • Cell<typeof CapabilitiesJson>

backend

type Capability<ServerCapabilityData | null | undefined>

websocket

WebSocket capability that derives its state from the socket.

type Capability<WebsocketCapabilityData | null | undefined>

readonly

filesystem

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

type Capability<FilesystemCapabilityData | null | undefined>

readonly

ollama

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

type Capability<OllamaCapabilityData | null | undefined>

readonly

claude

Claude capability that derives its state from provider_status.

type Capability<null | undefined>

readonly

chatgpt

ChatGPT capability that derives its state from provider_status.

type Capability<null | undefined>

readonly

gemini

Gemini capability that derives its state from provider_status.

type Capability<null | undefined>

readonly

pings

Store pings - both pending and completed.

type Array<PingData>

latest_ping_time

Most recent completed ping round trip time in milliseconds.

type number | null

readonly

completed_pings

Completed pings (for display).

type Array<PingData>

readonly

pending_ping_count

Number of pending pings.

type number

readonly

has_pending_pings

Has pending pings.

type boolean

readonly

backend_available

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

type boolean | null | undefined

readonly

ollama_available

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

type boolean | null | undefined

readonly

websocket_available

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

type boolean | null | undefined

readonly

filesystem_available

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

type boolean | null | undefined

readonly

ollama_models

Latest Ollama model list response, if available.

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

readonly

constructor

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

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

init_backend_check

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

type (): Promise<void>

returns Promise<void>

check_backend

Check backend availability with a ping.

type (): Promise<void>

returns Promise<void>

init_ollama_check

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

type (): Promise<void>

returns Promise<void>

check_ollama

Check Ollama availability by loading provider status and refreshing models.

type (): Promise<void>

returns Promise<void>

handle_ping_sent

type (request_id: string | number): void

request_id
type string | number
returns void

handle_ping_received

type (ping_id: string | number): void

ping_id
type string | number
returns void

handle_ping_error

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

ping_id
type string | number
error_message
type string
returns void

reset_backend

Reset just the backend capability to uninitialized state.

type (): void

returns void

init_claude_check

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

type (): Promise<void>

returns Promise<void>

check_claude

Check Claude availability by loading provider status.

type (): Promise<void>

returns Promise<void>

init_chatgpt_check

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

type (): Promise<void>

returns Promise<void>

check_chatgpt

Check ChatGPT availability by loading provider status.

type (): Promise<void>

returns Promise<void>

init_gemini_check

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

type (): Promise<void>

returns Promise<void>

check_gemini

Check Gemini availability by loading provider status.

type (): Promise<void>

returns Promise<void>

CapabilitiesJson
#

capabilities.svelte.ts view source

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

CapabilitiesJsonInput
#

CapabilitiesView
#

Capability
#

capabilities.svelte.ts view source

Capability<T>

Generic interface for a capability with standardized status tracking.

generics

T

name

The capability name.

type string

data

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

type T

status

Async status tracking the connection/check state.

type AsyncStatus

message_id

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

type JsonrpcRequestId | null

error_message

Error message if any

type string | null

updated

Timestamp when the capability was last checked.

type number | null

CapabilityBackend
#

CapabilityFilesystem
#

CapabilityProvider
#

CapabilityProviderApi
#

CapabilityProviderOllama
#

CapabilitySystem
#

CapabilityWebsocket
#

CardinalPosition
#

Cell
#

cell.svelte.ts view source

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

TSchema

constraint z.ZodType
default z.ZodType

inheritance

implements:

cid

readonly

id

type Uuid

created

type Datetime

updated

type Datetime

schema

type TSchema

readonly

schema_keys

type Array<SchemaKeys<TSchema>>

readonly

field_schemas

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

readonly

field_schema_info

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

readonly

json

type z.output<TSchema>

readonly

json_serialized

type string

readonly

json_parsed

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

readonly

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

created_formatted_short_date

type string

readonly

created_formatted_datetime

type string

readonly

created_formatted_time

type string

readonly

updated_date

type Date

readonly

updated_formatted_short_date

type string

readonly

updated_formatted_datetime

type string

readonly

updated_formatted_time

type string

readonly

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.

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; ... 18 more ...; Ui: typeof Ui; }

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; ... 18 more ...; Ui: typeof Ui; }

CellClassNames
#

cell_classes.ts view source

"Action" | "Actions" | "Capabilities" | "Parts" | "Chat" | "Chats" | "Diskfile" | "DiskfileTab" | "DiskfileTabs" | "DiskfilePart" | "DiskfileHistory" | "Diskfiles" | "DiskfilesEditor" | ... 12 more ... | "Ui"

CellJson
#

cell_types.ts view source

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

Base schema that defines common properties for all cells.

CellJsonInput
#

CellOptions
#

cell.svelte.ts view source

CellOptions<TSchema>

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

generics

TSchema

constraint z.ZodType

app

json

type z.input<TSchema>

CellRegistry
#

cell_registry.svelte.ts view source

Registry for managing cell classes and their instances. The goal is to allow dynamic instantiation of all cells from serializable JSON. This class 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

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
#

CellValueDecoder
#

cell_helpers.ts view source

CellValueDecoder<TSchema, TKey>

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

TSchema

constraint z.ZodType

TKey

constraint keyof z.infer<TSchema>
default keyof z.infer<TSchema>

Chat
#

chat.svelte.ts view source

inheritance

extends:
  • Cell<typeof ChatJson>

name

type string

thread_ids

type Array<Uuid>

main_input

type string

view_mode

type ChatViewMode

selected_thread_id

type Uuid | null

main_input_length

type number

readonly

main_input_token_count

type number

readonly

threads

type Array<Thread>

readonly

enabled_threads

readonly

selected_thread

type Thread | undefined

readonly

current_thread

type Thread | undefined

readonly

init_name_status

type AsyncStatus

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
#

ChatContextmenu
#

ChatInitializer
#

ChatJson
#

chat.svelte.ts view source

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

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; }

ChatList
#

ChatListitem
#

ChatOptions
#

Chats
#

chats.svelte.ts view source

inheritance

extends:
  • Cell<typeof ChatsJson>

items

type IndexedCollection<Chat>

readonly

selected_id_last_non_null

type Uuid | null

selected

type Chat | undefined

readonly

selected_id_error

type boolean

readonly

show_sort_controls

Controls visibility of sort controls in the chats list.

type boolean

ordered_items

Ordered array of chats derived from the manual_order index.

type Array<Chat>

readonly

items_by_name

readonly

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

get_template_by_id

type (id: string): ChatTemplate | undefined

id
type string
returns ChatTemplate | undefined

get_default_template

type (): ChatTemplate

returns ChatTemplate

ChatSchema
#

ChatsContextmenu
#

ChatsJson
#

chats.svelte.ts view source

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

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 ... | ...

ChatsOptions
#

ChatsSchema
#

ChatTemplate
#

chat_template.ts view source

ChatTemplate

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

thread

type Thread

onsend

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

focus_key?

type string | number | null | undefined
optional

pending_element_to_focus_key?

type string | number | null | undefined
optional bindable

turns_attrs?

type SvelteHTMLElements['div'] | undefined
optional

attrs?

type SvelteHTMLElements['div'] | undefined
optional

ChatThreadAddByModel
#

ChatThreadManageByTag
#

ChatView
#

ChatViewMode
#

ChatViewMulti
#

ChatViewSimple
#

ClassNotRegisteredError
#

cell_registry.svelte.ts view source

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
#

completion_create_action_spec
#

action_specs.ts view source

{ method: "completion_create"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<...>; model: ZodString; prompt: ZodString; completion_messages: Z...

completion_progress_action_spec
#

action_specs.ts view source

{ method: "completion_progress"; 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<...>; }...

CompletionHandler
#

CompletionHandlerOptions
#

CompletionMessage
#

CompletionOptions
#

server/backend_provider.ts view source

CompletionOptions

frequency_penalty

type number

output_token_max

type number

presence_penalty

type number

seed

type number

stop_sequences

type Array<string>

system_message

type string

temperature

type number

top_k

type number

top_p

type number

CompletionRequest
#

completion_types.ts view source

ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; prompt: ZodString; completion_messages: ZodOptional<...>; }, $strict>

CompletionResponse
#

completion_types.ts view source

ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; data: ZodDiscriminatedUnion<...>; }, $strict>

CompletionRole
#

ConfirmButton
#

ConfirmButton.svelte view source

onconfirm

type (popover: Popover) => void

popover_button_attrs?

type SvelteHTMLElements['button'] | undefined
optional

hide_on_confirm?

type boolean | undefined
optional

popover_content?

Unlike on PopoverButton this is optional and has a confirm arg

type Snippet<[popover: Popover, confirm: () => void]> | undefined
optional

popover_button_content?

Content for the popover button

type Snippet<[popover: Popover, confirm: () => void]> | undefined
optional

children?

Unlike on PopoverButton this has a confirm arg

type Snippet<[popover: Popover, confirm: () => void]> | undefined
optional

CONTENT_PREVIEW_LENGTH
#

ContentEditor
#

ContentEditor.svelte view source

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 | undefined
optional

placeholder?

type string | null | undefined
optional

readonly?

type boolean | undefined
optional

show_stats?

type boolean | undefined
optional

show_actions?

type boolean | undefined
optional

textarea_height?

type string | undefined
optional

focus_key?

type string | number | null | undefined
optional

pending_element_to_focus_key?

type string | number | null | undefined
optional bindable

attrs?

type SvelteHTMLElements['textarea'] | undefined
optional

after?

type Snippet | undefined
optional

children?

type Snippet | undefined
optional

onsave?

type ((value: string) => void) | undefined
optional

ContentPreview
#

ContentPreview.svelte view source

content

type string

height?

type string | undefined
optional

min_height?

type string | undefined
optional

max_height?

type string | undefined
optional

attrs?

type SvelteHTMLElements['pre'] | undefined
optional

ContentStats
#

ContextmenuEntryCopyToClipboard
#

ContextmenuEntryCopyToClipboard.svelte view source

content

type string | Thunk<string> | undefined

label?

type string | undefined
optional

preview?

type string | undefined
optional

preview_limit?

type number | undefined
optional

show_preview?

type boolean | undefined
optional

children?

type Snippet | undefined
optional

ContextmenuEntryToggle
#

create_action_event
#

action_event.ts view source

<TMethod extends ActionMethod>(environment: ActionEventEnvironment, spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | ... 15 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, input: unknown, initial_phase?: "send_request" | ... 8 more ... | undefined): ActionEvent<...>

Create an action event from a spec and initial input.

environment

spec

type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }

input

type unknown

initial_phase?

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute" | undefined
optional

returns

ActionEvent<TMethod, ActionEventEnvironment, "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute", "initial" | ... 3 more ... | "failed">

create_action_event_from_json
#

action_event.ts view source

<TMethod extends ActionMethod>(json: ActionEventDatas[TMethod], environment: ActionEventEnvironment): ActionEvent<TMethod, ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more ... | "failed">

Reconstruct an action event from serialized JSON data.

json

type ActionEventDatas[TMethod]

environment

returns

ActionEvent<TMethod, ActionEventEnvironment, "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute", "initial" | ... 3 more ... | "failed">

create_backend_actions_api
#

create_banner
#

codegen.ts view source

(origin_path: string): string

Creates a file banner comment.

origin_path

type string

returns

string

create_client_id
#

helpers.ts view source

(): string

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>

Create an incremental derived collection index.

options

type DerivedIndexOptions<T, TResult>

returns

IndexDefinition<T, TResult, void>

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]>

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]>

create_frontend_actions_api
#

frontend_actions_api.ts view source

<T extends ActionEventEnvironment>(environment: T): ActionsApi

Creates the actions API methods for the frontend. Uses a Proxy to provide dynamic method lookup with full type safety.

environment

type T

returns

ActionsApi

create_initial_data
#

action_event_helpers.ts view source

(kind: "request_response" | "remote_notification" | "local_call", phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute", method: "completion_create" | ... 18 more ... | "toggle_main_menu", executor: "frontend" | "backend", input: unknown): { ...; }

kind

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

phase

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"

method

type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"

executor

type "frontend" | "backend"

input

type unknown

returns

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

create_jsonrpc_error_message
#

jsonrpc_helpers.ts view source

(id: string | number | null, error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }): { ...; }

id

type string | number | null

error

type { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }

returns

{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }

create_jsonrpc_error_message_from_thrown
#

jsonrpc_helpers.ts view source

(id: string | number | null, error: any): { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<...>); message: string; data?: unknown; }; }

Creates a JSON-RPC error response from any error. Handles JsonrpcError and regular Error objects.

id

type string | number | null

error

type any

returns

{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }

create_jsonrpc_notification
#

jsonrpc_helpers.ts view source

(method: string, params: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined): { [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined; }

method

type string

params

type { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined

returns

{ [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined; }

create_jsonrpc_request
#

jsonrpc_helpers.ts view source

(method: string, params: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined, id: string | number): { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { ...; } | undefined; }

method

type string

params

type { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined

id

type string | number

returns

{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }

create_jsonrpc_response
#

jsonrpc_helpers.ts view source

(id: string | number, result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }): { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; }

id

type string | number

result

type { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }

returns

{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; }

create_map_by_property
#

iterable_helpers.ts view source

<T, K extends keyof T>(items: Iterable<T>, property: K): Map<T[K], T>

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

items

type Iterable<T>

property

type K

returns

Map<T[K], 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>

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

options

type MultiIndexOptions<T, K>

returns

IndexDefinition<T, SvelteMap<K, T[]>, 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>

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

options

type SingleIndexOptions<T, K>

returns

IndexDefinition<T, SvelteMap<K, T>, 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

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

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

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

create_uuid
#

Dashboard
#

DashboardActions
#

DashboardCapabilities
#

DashboardChats
#

DashboardDiskfiles
#

DashboardHeader
#

DashboardHome
#

DashboardModels
#

DashboardPrompts
#

DashboardProviders
#

DashboardSettings
#

Datetime
#

DatetimeNow
#

DEFAULT_AUTO_RECONNECT
#

DEFAULT_CLOSE_CODE
#

DEFAULT_HEARTBEAT_INTERVAL
#

DEFAULT_RECONNECT_DELAY
#

DEFAULT_RECONNECT_DELAY_MAX
#

DEFAULT_RETRY_COUNT
#

defined
#

DerivedIndexOptions
#

indexed_collection_helpers.svelte.ts view source

DerivedIndexOptions<T, TResult>

Options for derived indexes.

generics

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

detect_reorderable_direction
#

reorderable_helpers.ts view source

(element: HTMLElement): ReorderableDirection

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: "directory_create"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath">; }, $strict>; output: ZodNull; async: true; }

Diskfile
#

diskfile.svelte.ts view source

inheritance

extends:
  • Cell<typeof DiskfileJson>

path

type DiskfilePath

source_dir

type DiskfileDirectoryPath

content

type string | null

part

type PartUnion | undefined

readonly

dependents

type Array<[DiskfilePath, SerializableDisknode]>

dependencies

type Array<[DiskfilePath, SerializableDisknode]>

dependencies_by_id

type Map<DiskfilePath, SerializableDisknode>

readonly

dependents_by_id

type Map<DiskfilePath, SerializableDisknode>

readonly

dependency_ids

type Array<DiskfilePath>

readonly

dependent_ids

type Array<DiskfilePath>

readonly

has_dependencies

type boolean

readonly

has_dependents

type boolean

readonly

dependencies_count

type number

readonly

dependents_count

type number

readonly

pathname

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

type string | null | undefined

readonly

path_relative

e.g. bar/foo.json

type string | null | undefined

readonly

content_length

type number

readonly

content_token_count

type number | null

readonly

content_preview

type string

readonly

constructor

type new (options: DiskfileOptions): Diskfile

options

diskfile_delete_action_spec
#

action_specs.ts view source

{ method: "diskfile_delete"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath">; }, $strict>; output: ZodNull; async: true; }

diskfile_update_action_spec
#

action_specs.ts view source

{ method: "diskfile_update"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ path: $ZodBranded<ZodString, "DiskfilePath">; content: ZodString; }, $strict>; output: ZodNull; async: true; }

DiskfileActions
#

DiskfileChange
#

diskfile_types.ts view source

ZodObject<{ type: ZodEnum<{ add: "add"; change: "change"; delete: "delete"; }>; path: $ZodBranded<ZodString, "DiskfilePath">; }, $strict>

DiskfileChangeType
#

DiskfileContextmenu
#

DiskfileDirectoryPath
#

diskfile_types.ts view source

$ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<ZodString, "DiskfilePath">>, "DiskfileDirectoryPath">

These always have a trailing slash.

DiskfileEditorNav
#

DiskfileEditorState
#

diskfile_editor_state.svelte.ts view source

Manages the editor state for a diskfile.

app

type Frontend

diskfile

type Diskfile

unsaved_edit_entry_id

type Uuid | null

selected_history_entry_id

type Uuid | null

content_was_modified_by_user

type boolean

last_seen_disk_content

type string | null

original_content

type string | null

readonly

path

type DiskfilePath

readonly

has_changes

readonly

history

type DiskfileHistory | undefined

readonly

selected_history_entry

readonly

content_history

type Array<HistoryEntry>

readonly

saved_history_entries

type Array<HistoryEntry>

readonly

unsaved_history_entries

type Array<HistoryEntry>

readonly

has_history

readonly

has_unsaved_edits

readonly

can_clear_history

readonly

can_clear_unsaved_edits

readonly

unsaved_entry_ids

readonly

content_matching_entry_ids

type Array<Uuid>

readonly

original_length

readonly

current_length

readonly

length_diff

readonly

length_diff_percent

readonly

original_token_count

readonly

current_token_count

readonly

token_diff

readonly

token_diff_percent

readonly

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

DiskfileEditorView
#

DiskfileExplorer
#

DiskfileHistory
#

diskfile_history.svelte.ts view source

Stores edit history for a single diskfile.

inheritance

extends:
  • Cell<typeof DiskfileHistoryJson>

path

type DiskfilePath

entries

type Array<HistoryEntry>

max_entries

type number

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

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">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; path: $ZodBranded<...>; entries: ZodDefault<...>; max_entries: ZodDefault<...>; }, $strict>

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...

DiskfileHistoryOptions
#

DiskfileHistoryView
#

DiskfileInfo
#

DiskfileJson
#

diskfile_types.ts view source

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

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; }

DiskfileListitem
#

DiskfileListitem.svelte view source

diskfile

selected?

type boolean | undefined
optional

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
#

DiskfilePart
#

part.svelte.ts view source

Diskfile part - references content from a Diskfile.

inheritance

extends:
  • Part<typeof DiskfilePartJson>

type

readonly

diskfile

type Diskfile | null | undefined

readonly

relative_path

readonly

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

DiskfilePartJson
#

part.svelte.ts view source

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

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; }

DiskfilePartOptions
#

DiskfilePartSchema
#

DiskfilePartView
#

DiskfilePath
#

DiskfilePicker
#

DiskfilePicker.svelte view source

onpick

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

filter?

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

exclude_ids?

type Array<Uuid> | undefined
optional

selected_ids?

type Array<Uuid> | undefined
optional

DiskfilePickerDialog
#

DiskfilePickerDialog.svelte view source

onpick

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

show?

type boolean | undefined
optional bindable

filter?

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

exclude_ids?

type Array<Uuid> | undefined
optional

selected_ids?

type Array<Uuid> | undefined
optional

dialog_props?

type OmitStrict<ComponentProps<typeof Dialog>, 'children'> | undefined
optional

Diskfiles
#

diskfiles.svelte.ts view source

inheritance

extends:
  • Cell<typeof DiskfilesJson>

items

type IndexedCollection<Diskfile>

readonly

selected_file_id

type Uuid | null

selected_file

type Diskfile | null

readonly

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

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

Editor state management for diskfiles.

inheritance

extends:
  • Cell<typeof DiskfilesEditorJson>

show_sort_controls

Controls visibility of sort controls in the file explorer.

type boolean

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">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; show_sort_controls: ZodDefault<...>; }, $strict>

DiskfilesEditorJsonInput
#

DiskfilesEditorOptions
#

DiskfilesEditorSchema
#

DiskfilesJson
#

diskfiles.svelte.ts view source

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

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?: [...][]...

DiskfilesOptions
#

DiskfileTab
#

diskfile_tab.svelte.ts view source

inheritance

extends:
  • Cell<typeof DiskfileTabJson>

diskfile_id

type Uuid

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

is_selected

Derived from parent collection's state

type boolean

readonly

diskfile

type Diskfile | undefined

readonly

constructor

type new (options: DiskfileTabOptions): DiskfileTab

options

DiskfileTabJson
#

diskfile_tab.svelte.ts view source

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

DiskfileTabJsonInput
#

DiskfileTabListitem
#

DiskfileTabOptions
#

DiskfileTabs
#

diskfile_tabs.svelte.ts view source

Manages tabs for diskfiles in the editor with preview behavior.

inheritance

extends:
  • Cell<typeof DiskfileTabsJson>

selected_tab_id

type Uuid | null

preview_tab_id

type Uuid | null

tab_order

type Array<Uuid>

recent_tab_ids

type Array<Uuid>

max_tab_history

type number

items

type IndexedCollection<DiskfileTab>

by_diskfile_id

Map for looking up tabs by their associated diskfile_id.

type Map<Uuid, DiskfileTab>

readonly

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

selected_tab

The currently selected tab.

type DiskfileTab | undefined

readonly

selected_diskfile_id

The selected tab's diskfile id.

type Uuid | null

readonly

preview_tab

The preview tab, if any.

type DiskfileTab | undefined

readonly

recent_tabs

type Array<DiskfileTab>

readonly

recently_closed_tabs

Recently closed tabs for potential reopening.

type Array<DiskfileTab>

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">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; ... 5 more ...; max_tab_history: ZodDefault<...>; }, $strict>

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; }

DiskfileTabsOptions
#

DiskfileTabsSchema
#

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<...>): { ...; }

Helper function to convert 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>

Options for dynamic indexes.

generics

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

value

type string
bindable

attrs?

type SvelteHTMLElements['span']
optional

span_attrs?

type SvelteHTMLElements['span']
optional

input_attrs?

type SvelteHTMLElements['input']
optional

ErrorMessage
#

ErrorMessageInline
#

estimate_token_count
#

helpers.ts view source

(text: string): number

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

text

type string

returns

number

ESTIMATED_CHARS_PER_TOKEN
#

expect_defined
#

expect_nonnullish
#

expect_ok
#

ExternalLink
#

ExternalLinkIcon
#

extract_action_result
#

action_event_helpers.ts view source

(event: ActionEvent<"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more ... | "failed">): Result<...>

event

type ActionEvent<"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more...

returns

Result<{ value: unknown; }, { error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }>

extract_parameter_count
#

ollama_helpers.ts view source

(parameter_size: string | undefined): number | undefined

Extract parameter count from parameter size string like "7B", "13B", etc.

parameter_size

type string | undefined

returns

number | undefined

FailedMessage
#

FILE_DATETIME_FORMAT
#

FILE_SHORT_DATE_FORMAT
#

FILE_TIME_FORMAT
#

filer_change_action_spec
#

action_specs.ts view source

{ method: "filer_change"; 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: t...

FilerChangeHandler
#

FilerInstance
#

server/backend.ts view source

FilerInstance

Structure to hold a Filer and its cleanup function.

filer

type Filer

cleanup_promise

type Promise<() => void>

FilesystemCapabilityData
#

capabilities.svelte.ts view source

FilesystemCapabilityData

zzz_dir

type DiskfileDirectoryPath | null | undefined

scoped_dirs

type ReadonlyArray<DiskfileDirectoryPath>

Footer
#

format_bytes
#

format_helpers.ts view source

(bytes: number, decimals?: number): string

Format bytes to human readable string.

bytes

type number

decimals

type number
default 1

returns

string

format_datetime
#

time_helpers.ts view source

(value: TimeValue | null | undefined, fallback?: string): string

value

type TimeValue | null | undefined

fallback

type string
default ''

returns

string

format_duration
#

format_gigabytes
#

format_ms_to_readable
#

format_percentage
#

format_helpers.ts view source

(value: number, total: number, decimals?: number): string

Format a number as a percentage.

value

type number

total

type number

decimals

type number
default 1

returns

string

format_prompt_content
#

prompt_helpers.ts view source

(parts: PartUnion[]): string

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

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

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

value

type TimeValue | null | undefined

fallback

type string
default ''

returns

string

format_zod_validation_error
#

zod_helpers.ts view source

(error: ZodError<unknown>): string

Formats a Zod validation error with field paths for clearer error messages.

error

type ZodError<unknown>

returns

string

FREQUENCY_PENALTY_DEFAULT
#

Frontend
#

frontend.svelte.ts view source

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>

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 ActionsApi

readonly

peer

type ActionPeer

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

ollama

type Ollama

readonly

bots

type ZzzConfig['bots']

readonly

provider_status

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

type Array<ProviderStatus>

tags

type Set<string>

readonly

diskfile_histories

type SvelteMap<DiskfilePath, DiskfileHistory>

readonly

futuremode

See into Zzz's future.

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: ({ ...; } | { ...; })[]; }): void

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

add_providers

type (providers_json: { name: "ollama" | "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: "ollama" | "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: "ollama" | "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: "ollama" | "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: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", phase: "send_request" | ... 7 more ... | "execute"): ((event: any) => any) | undefined

method
type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"
phase
type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"
returns ((event: any) => any) | undefined

lookup_action_spec

type (method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): { ...; } | ... 2 more ... | undefined

method
type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"
returns { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | undefined

lookup_action_input_schema

type <TMethod extends ActionMethod>(method: TMethod): { readonly completion_create: ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<...>; model: ZodString; prompt: ZodString; completion_messages: ZodOptional<...>; }, $strict>; _meta: ZodOptional<...>; }, $strict>; ... 18 more ...; readonly toggle_main_menu: ZodOptional<...>; }[TMethod] | undefined

method
type TMethod
returns { readonly completion_create: ZodObject<{ completion_request: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; prompt: ZodString; completion_messages: ZodOptional<...>; },...

lookup_action_output_schema

type <TMethod extends ActionMethod>(method: TMethod): { readonly completion_create: ZodObject<{ completion_response: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<...>; model: ZodString; data: ZodDiscriminatedUnion<...>; }, $strict>; _meta: ZodOptional<...>; }, $strict>; ... 18 more ...; readonly toggle_main_menu: ZodObject<...>; }[TMethod] | undefined

method
type TMethod
returns { readonly completion_create: ZodObject<{ completion_response: ZodObject<{ created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; model: ZodString; data: ZodDiscriminatedUnion<...>; }, $strict>; _meta: ZodOp...

is_valid_phase_for_method

type (method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", phase: "send_request" | ... 7 more ... | "execute"): boolean

method
type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"
phase
type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"
returns boolean

frontend_action_handlers
#

frontend_context
#

frontend.svelte.ts view source

{ get: (error_message?: string | undefined) => Frontend; get_maybe: () => Frontend | undefined; set: (value: Frontend) => Frontend; }

FrontendActionHandlers
#

frontend_action_types.ts view source

FrontendActionHandlers

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

completion_create

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

completion_progress

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

directory_create

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

diskfile_delete

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

diskfile_update

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

filer_change

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

ollama_copy

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

ollama_create

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

ollama_delete

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

ollama_list

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

ollama_progress

type { receive?: ( action_event: ActionEvent<'ollama_progress', Frontend, 'receive', 'handling'>, ) => void | Promise<void>; }

ollama_ps

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

ollama_pull

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

ollama_show

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

ollama_unload

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

ping

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

provider_load_status

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

provider_update_api_key

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

session_load

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

toggle_main_menu

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

FrontendActionMethod
#

action_metatypes.ts view source

ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>

Names of all actions that may be handled on the client.

FrontendHttpTransport
#

frontend_http_transport.ts view source

inheritance

implements:

transport_name

readonly

constructor

type new (url: string, headers?: Record<string, string> | undefined): FrontendHttpTransport

url
type string
headers?
type Record<string, string> | undefined
optional

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

is_ready

type (): boolean

returns boolean

FrontendJson
#

frontend.svelte.ts view source

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

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; ... 4 more ...; tutorial_for_diskfiles?: boolean | undefined; } | undefined; }

FrontendOptions
#

frontend.svelte.ts view source

FrontendOptions

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 ZzzConfig['bots']

providers

type Array<ProviderJsonInput>

cell_classes

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

action_specs

type Array<ActionSpecUnion>

action_handlers

http_rpc_url

type string | null

http_headers

type Record<string, string>

socket_url

type string | null

FrontendRoot
#

FrontendWebsocketTransport
#

frontend_websocket_transport.ts view source

inheritance

implements:

transport_name

readonly

constructor

type new (socket: Socket, request_timeout_ms?: number | undefined): FrontendWebsocketTransport

socket
type Socket
request_timeout_ms?
type number | undefined
optional

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

send

type (message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }): Promise<...>

message
type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }
returns Promise<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message...

is_ready

type (): boolean

returns boolean

dispose

type (): void

returns void

generate_phase_handlers
#

codegen.ts view source

(spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, executor: "frontend" | "backend", imports: ImportBuilder): string

Generates the phase handlers for an action spec using the unified ActionEvent type with the new phase/step type parameters.

spec

type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }

executor

type "frontend" | "backend"

imports

returns

string

generate_position_styles
#

position_helpers.ts view source

(position?: Position, align?: Alignment, offset?: string): Record<string, string>

Generates CSS positioning styles for UI elements.

position

- Where to position the element ('left', 'right', etc.)

default 'center'

align

- Alignment along the position edge ('start', 'center', 'end')

default 'center'

offset

- Distance from the position (CSS value)

type string
default '0'

returns

Record<string, string>

CSS styles as a Record

get_cell_class_names
#

cell_classes.ts view source

(): ("Action" | "Actions" | "Capabilities" | "Parts" | "Chat" | "Chats" | "Diskfile" | "DiskfileTab" | "DiskfileTabs" | "DiskfilePart" | "DiskfileHistory" | "Diskfiles" | "DiskfilesEditor" | ... 12 more ... | "Ui")[]

Get a list of all registered cell class names.

returns

("Action" | "Actions" | "Capabilities" | "Parts" | "Chat" | "Chats" | "Diskfile" | "DiskfileTab" | "DiskfileTabs" | "DiskfilePart" | "DiskfileHistory" | "Diskfiles" | "DiskfilesEditor" | ... 12 more ... | "Ui")[]

get_datetime_now
#

zod_helpers.ts view source

(): string & $brand<"Datetime">

Returns an ISO datetime string that is guaranteed to be monotonically increasing. If called multiple times within the same millisecond, it increments the value by one millisecond to ensure uniqueness and order preservation.

returns

string & $brand<"Datetime">

get_executor_phases
#

codegen.ts view source

(spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, executor: "frontend" | "backend"): ("send_request" | ... 7 more ... | "execute")[]

Determines which phases an executor can handle based on the action spec.

spec

type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }

executor

type "frontend" | "backend"

returns

("send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute")[]

get_field_schema
#

zod_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>, key: string): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Get the Zod schema for a specific field in an object schema.

schema

The object schema

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

key

The property name

type string

returns

ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

The field's schema, or throws if not found

get_global_cell_count
#

cell.svelte.ts view source

(): number

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_glyph_for_action_kind
#

glyphs.ts view source

(kind: "request_response" | "remote_notification" | "local_call"): string

kind

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

returns

string

get_glyph_for_action_method
#

glyphs.ts view source

(method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): string

method

type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"

returns

string

get_handler_return_type
#

codegen.ts view source

(spec: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }, phase: "send_request" | ... 7 more ... | "execute", imports: ImportBuilder, path_prefix: string): string

Gets the handler return type for a specific phase and spec. Also adds necessary imports to the ImportBuilder.

spec

type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }

phase

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"

imports

path_prefix

type string

returns

string

get_initial_phase
#

action_event_helpers.ts view source

(kind: "request_response" | "remote_notification" | "local_call", initiator: "frontend" | "backend" | "both", executor: "frontend" | "backend"): "send_request" | "receive_request" | ... 7 more ... | null

kind

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

initiator

type "frontend" | "backend" | "both"

executor

type "frontend" | "backend"

returns

"send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute" | null

get_inner_array_schema
#

zod_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>): ZodArray<any> | null

Gets the innermost array schema from a potentially nested schema structure. Returns null if no array schema is found.

schema

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

returns

ZodArray<any> | null

get_innermost_type
#

zod_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Gets the innermost type of a zod schema by unwrapping wrappers like transforms, ZodOptional, ZodDefault, etc.

schema

The schema to unwrap

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

returns

ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

The innermost schema without wrappers

get_innermost_type_name
#

zod_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>): string

schema

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

returns

string

get_part_type_glyph
#

get_reorderable_drop_position
#

reorderable_helpers.ts view source

(direction: ReorderableDirection, source_index: number, target_index: number): ReorderableValidDropPosition

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

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

name

type string

existing_names

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

returns

string

global_schema_registry
#

Glyph
#

GLYPH_ACTION
#

GLYPH_ACTION_TYPE_LOCAL_CALL
#

GLYPH_ACTION_TYPE_REMOTE_NOTIFICATION
#

GLYPH_ACTION_TYPE_REQUEST_RESPONSE
#

GLYPH_ADD
#

GLYPH_ARROW_LEFT
#

GLYPH_ARROW_RIGHT
#

GLYPH_BACKEND
#

GLYPH_CANCEL
#

GLYPH_CAPABILITY
#

GLYPH_CHAT
#

GLYPH_CHECKMARK
#

GLYPH_CHEVRON_DOWN
#

GLYPH_CHEVRON_LEFT
#

GLYPH_CHEVRON_RIGHT
#

GLYPH_CHEVRON_UP
#

GLYPH_CLEAR
#

GLYPH_CONNECT
#

GLYPH_COPY
#

GLYPH_CREATE_FILE
#

GLYPH_CREATE_FOLDER
#

GLYPH_DELETE
#

GLYPH_DIRECTORY
#

GLYPH_DISCONNECT
#

GLYPH_DOMAIN
#

GLYPH_DOUBLE_CHEVRON_LEFT
#

GLYPH_DOUBLE_CHEVRON_RIGHT
#

GLYPH_DOWNLOAD
#

GLYPH_DRAG
#

GLYPH_EDIT
#

GLYPH_ERROR
#

GLYPH_EXTERNAL_LINK
#

GLYPH_FILE
#

GLYPH_HEARTBEAT
#

GLYPH_IDEA
#

GLYPH_IMPORTANT
#

GLYPH_INFO
#

GLYPH_LIST
#

GLYPH_LOG
#

GLYPH_MODEL
#

GLYPH_PAGE
#

GLYPH_PART
#

GLYPH_PASTE
#

GLYPH_PAUSE
#

GLYPH_PING
#

GLYPH_PLACEHOLDER
#

GLYPH_PLAY
#

GLYPH_PREVIEW
#

GLYPH_PROJECT
#

GLYPH_PROMPT
#

GLYPH_PROVIDER
#

GLYPH_REFRESH
#

GLYPH_REMOVE
#

GLYPH_RESET
#

GLYPH_RESPONSE
#

GLYPH_RESTORE
#

GLYPH_RETRY
#

GLYPH_SEND
#

GLYPH_SESSION
#

GLYPH_SETTINGS
#

GLYPH_SORT
#

GLYPH_TAB
#

GLYPH_THREAD
#

GLYPH_TURN
#

GLYPH_UNKNOWN
#

GLYPH_VIEW
#

GLYPH_XMARK
#

GLYPH_XMARK_HEAVY
#

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<...>

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_filer_change
#

server/backend_actions_api.ts view source

(change: WatcherChange, disknode: Disknode, backend: Backend, dir: string, filer: Filer): void

Handle file system changes and notify clients.

change

type WatcherChange

disknode

type Disknode

backend

type Backend

dir

type string

filer

type Filer

returns

void

HANDLED
#

has_dependencies
#

HISTORY_LIMIT_DEFAULT
#

HistoryEntry
#

diskfile_history.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodNumber; content: ZodString; label: ZodString; is_disk_change: ZodDefault<...>; is_unsaved_edit: ZodDefault<...>; is_original_state: ZodDefault<...>; }, $strict>

Schema for history entries.

http_status_to_jsonrpc_error_code
#

jsonrpc_helpers.ts view source

(status: number): -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)

status

type number

returns

-32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)

HTTP_STATUS_TO_JSONRPC_ERROR_CODE
#

jsonrpc_helpers.ts view source

Record<number, -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)>

Maps HTTP status codes to JSON-RPC error codes.

HttpStatus
#

ImportBuilder
#

codegen.ts view source

Manages imports for generated code, building them on demand. Automatically optimizes type-only imports to use import type syntax.

Why this matters: - import type statements are completely removed during compilation - Mixed imports like import { type A, B } cannot be safely removed - This ensures optimal tree-shaking and smaller bundle sizes

examples

Example 1

imports

type Map<string, Map<string, ImportItem>>

add

Add a value import to be included in the generated code.

type (from: string, what: string): this

from

The module to import from

type string
what

What to import (value)

type string
returns this

add_type

Add a type import to be included in the generated code.

type (from: string, what: string): this

from

The module to import from

type string
what

What to import (type)

type string
returns this

add_many

Add multiple value imports from the same module.

type (from: string, ...items: string[]): this

from
type string
items
type string[]
returns this

add_types

Add multiple type imports from the same module.

type (from: string, ...items: string[]): this

from
type string
items
type string[]
returns this

build

Generate the import statements. If all imports from a module are types, uses import type syntax.

type (): string

returns string

has_imports

Check if the builder has any imports.

type (): boolean

returns boolean

preview

Preview what imports will be generated (useful for debugging).

type (): string[]

returns string[]

Array of import statement strings

clear

Clear all imports.

type (): this

returns this

IndexDefinition
#

indexed_collection.svelte.ts view source

IndexDefinition<T, TResult, TQuery>

Generic index definition with full flexibility.

generics

T

constraint IndexedItem

TResult

default any

TQuery

default any

key

Unique identifier for this index.

type string

type

Optional index type for simpler creation.

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

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

generics

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 turth, the full collection keyed by Uuid.

type SvelteMap<Uuid, T>

readonly

values

type Array<T>

readonly

keys

type Array<Uuid>

readonly

size

Get the current count of items.

type number

readonly

indexes

Stores all index values in a reactive object.

type Record<string, any>

readonly

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 with improved performance.

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>

generics

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>

Common options interface for all index types.

generics

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_action_complete
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_action_initiator
#

is_action_spec
#

action_spec.ts view source

(value: unknown): value is { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; }

value

type unknown

returns

boolean

is_array_schema
#

zod_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>): boolean

Checks if a Zod schema is an array or contains an array through wrappers.

schema

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

returns

boolean

is_cell_type
#

cell_classes.ts view source

<K extends CellClassNames>(cell: Cell<any> | null | undefined, class_name: K): cell is CellRegistryMap[K]

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

is_execute
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ActionEventLocalCallData & { ...; }

data

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

returns

boolean

is_failed
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_handled
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_handling
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_initial
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_jsonrpc_error_message
#

jsonrpc_helpers.ts view source

(message: unknown): message is { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }

message

type unknown

returns

boolean

is_jsonrpc_message
#

jsonrpc_helpers.ts view source

(message: unknown): message is { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; } | { ...; } | { ...; } | { ...; }

message

type unknown

returns

boolean

is_jsonrpc_notification
#

jsonrpc_helpers.ts view source

(message: unknown): message is { [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; } | undefined; }

message

type unknown

returns

boolean

is_jsonrpc_object
#

is_jsonrpc_request
#

jsonrpc_helpers.ts view source

(message: unknown): message is { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; }

message

type unknown

returns

boolean

is_jsonrpc_request_id
#

is_jsonrpc_response
#

jsonrpc_helpers.ts view source

(message: unknown): message is { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; }

message

type unknown

returns

boolean

is_jsonrpc_singular_message
#

jsonrpc_helpers.ts view source

(message: unknown): message is { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; } | undefined; } | { ...; } | { ...; } | { ...; }

message

type unknown

returns

boolean

is_local_call
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_notification_receive
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ({ ...; } & { ...; }) | ... 3 more ... | ({ ...; } & { ...; })

data

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

returns

boolean

is_notification_send
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ({ ...; } & { ...; }) | ... 3 more ... | ({ ...; } & { ...; })

data

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

returns

boolean

is_notification_send_with_parsed_input
#

action_event_helpers.ts view source

<TMethod extends ActionMethod = "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu">(data: { ...; }): data is ({ ...; } & { ...; }) | ({ ...; } & { ...; })

data

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

returns

boolean

is_parsed
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_path_absolute
#

is_receive_request
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ({ ...; } & { ...; }) | ... 3 more ... | ({ ...; } & { ...; })

data

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

returns

boolean

is_receive_response
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ({ ...; } & { ...; }) | ... 3 more ... | ({ ...; } & { ...; })

data

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

returns

boolean

is_remote_notification
#

action_event_helpers.ts view source

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

data

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

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

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

is_request_response
#

action_event_helpers.ts view source

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

data

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

returns

boolean

is_send_request
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ({ ...; } & { ...; }) | ... 3 more ... | ({ ...; } & { ...; })

data

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

returns

boolean

is_send_request_with_parsed_input
#

action_event_helpers.ts view source

<TMethod extends ActionMethod = "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | ... 11 more ... | "toggle_main_menu">(data: { ...; }): data is ({ ...; } & { ...; }) | ({ ...; } & { ...; })

data

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

returns

boolean

is_send_response
#

action_event_helpers.ts view source

(data: { kind: "request_response" | "remote_notification" | "local_call"; phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"; ... 9 more ...; notification: { ...; } | null; }): data is ({ ...; } & { ...; }) | ... 3 more ... | ({ ...; } & { ...; })

data

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

returns

boolean

ITEM_CLASS_DEFAULT
#

jsonrpc_error_code_to_http_status
#

jsonrpc_helpers.ts view source

(code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)): number

code

type -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)

returns

number

JSONRPC_ERROR_CODE_TO_HTTP_STATUS
#

jsonrpc_helpers.ts view source

Record<-32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">), number>

Maps JSON-RPC error codes to HTTP status codes.

JSONRPC_ERROR_CODES
#

jsonrpc_errors.ts view source

{ readonly parse_error: -32700; readonly invalid_request: -32600; readonly method_not_found: -32601; readonly invalid_params: -32602; readonly internal_error: -32603; readonly unauthenticated: -32700 | ... 4 more ... | (number & $brand<...>); ... 7 more ...; readonly ai_provider_error: -32700 | ... 4 more ... | (num...

Extended JSON-RPC error codes with application-specific errors.

jsonrpc_error_messages
#

jsonrpc_errors.ts view source

{ readonly parse_error: (data?: unknown) => { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; readonly invalid_request: (data?: unknown) => { ...; }; ... 11 more ...; readonly ai_provider_error: (provider?: stri...

jsonrpc_errors
#

jsonrpc_errors.ts view source

{ readonly parse_error: (data?: unknown) => ThrownJsonrpcError; readonly invalid_request: (data?: unknown) => ThrownJsonrpcError; readonly method_not_found: (method?: string | undefined, data?: unknown) => ThrownJsonrpcError; ... 10 more ...; readonly ai_provider_error: (provider?: string | undefined, message?: stri...

JSONRPC_INTERNAL_ERROR
#

JSONRPC_INVALID_PARAMS
#

JSONRPC_INVALID_REQUEST
#

JSONRPC_LATEST_PROTOCOL_VERSION
#

JSONRPC_METHOD_NOT_FOUND
#

JSONRPC_PARSE_ERROR
#

JSONRPC_SERVER_ERROR_END
#

JSONRPC_SERVER_ERROR_START
#

JSONRPC_VERSION
#

JsonrpcErrorCode
#

jsonrpc.ts view source

ZodUnion<readonly [ZodLiteral<-32700>, ZodLiteral<-32600>, ZodLiteral<-32601>, ZodLiteral<-32602>, ZodLiteral<-32603>, $ZodBranded<...>]>

JsonrpcErrorJson
#

jsonrpc.ts view source

ZodObject<{ code: ZodUnion<readonly [ZodLiteral<-32700>, ZodLiteral<-32600>, ZodLiteral<-32601>, ZodLiteral<-32602>, ZodLiteral<-32603>, $ZodBranded<...>]>; message: ZodString; data: ZodOptional<...>; }, $loose>

JsonrpcErrorMessage
#

jsonrpc.ts view source

ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodNullable<ZodUnion<readonly [ZodString, ZodNumber]>>; error: ZodObject<{ code: ZodUnion<readonly [ZodLiteral<-32700>, ... 4 more ..., $ZodBranded<...>]>; message: ZodString; data: ZodOptional<...>; }, $loose>; }, $loose>

A response to a request that indicates an error occurred.

JsonrpcErrorName
#

JsonrpcMcpMeta
#

JsonrpcMessage
#

jsonrpc.ts view source

ZodUnion<readonly [ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodUnion<readonly [ZodString, ZodNumber]>; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $loose>, ZodObject<...>, ZodObject<...>, ZodObject<...>]>

Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.

JsonrpcMessageFromClientToServer
#

jsonrpc.ts view source

ZodUnion<readonly [ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodUnion<readonly [ZodString, ZodNumber]>; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $loose>, ZodObject<...>]>

JsonrpcMessageFromServerToClient
#

jsonrpc.ts view source

ZodUnion<readonly [ZodObject<{ jsonrpc: ZodLiteral<"2.0">; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{}, $loose>>; }, $loose>>; }, $loose>, ZodObject<...>, ZodObject<...>]>

JsonrpcMethod
#

JsonrpcNotification
#

jsonrpc.ts view source

ZodObject<{ jsonrpc: ZodLiteral<"2.0">; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{}, $loose>>; }, $loose>>; }, $loose>

A notification which does not expect a response.

JsonrpcNotificationParams
#

JsonrpcParams
#

jsonrpc.ts view source

ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $loose>, ZodObject<...>]>

JsonrpcProgressToken
#

jsonrpc.ts view source

ZodUnion<readonly [ZodString, ZodNumber]>

A progress token, used to associate progress notifications with the original request.

JsonrpcRequest
#

jsonrpc.ts view source

ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodUnion<readonly [ZodString, ZodNumber]>; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $loose>

A request that expects a response.

JsonrpcRequestId
#

jsonrpc.ts view source

ZodUnion<readonly [ZodString, ZodNumber]>

A uniquely identifying id for a request in JSON-RPC.

Like MCP but unlike JSON-RPC, the type excludes null.

JsonrpcRequestParams
#

jsonrpc.ts view source

ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $loose>

JsonrpcRequestParamsMeta
#

jsonrpc.ts view source

ZodObject<{ progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>

JsonrpcResponse
#

jsonrpc.ts view source

ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodUnion<readonly [ZodString, ZodNumber]>; result: ZodObject<{ _meta: ZodOptional<ZodObject<{}, $loose>>; }, $loose>; }, $loose>

A successful (non-error) response to a request.

JsonrpcResponseOrError
#

jsonrpc.ts view source

ZodUnion<readonly [ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodUnion<readonly [ZodString, ZodNumber]>; result: ZodObject<{ _meta: ZodOptional<ZodObject<{}, $loose>>; }, $loose>; }, $loose>, ZodObject<...>]>

Convenience helper union.

JsonrpcResult
#

JsonrpcServerErrorCode
#

JsonrpcSingularMessage
#

jsonrpc.ts view source

ZodUnion<readonly [ZodObject<{ jsonrpc: ZodLiteral<"2.0">; id: ZodUnion<readonly [ZodString, ZodNumber]>; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ progressToken: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $loose>, ZodObject<...>, ZodObject<...>, ZodObject<...>]>

library_context
#

library.ts view source

{ get: (error_message?: string | undefined) => Library; get_maybe: () => Library | undefined; set: (value: Library) => Library; }

LIST_CLASS_DEFAULT
#

LocalCallActionMethod
#

LocalCallActionSpec
#

action_spec.ts view source

ZodObject<{ method: ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>; ... 6 more ...; auth: ZodDefault<....

Local calls can wrap synchronous or asynchronous actions, and are the escape hatch for remote APIs that do not support SAES.

logo_chatgpt
#

logo_claude
#

logo_gemini
#

logo_zzz
#

main_nav_items_default
#

MainDialog
#

map_watcher_change_to_diskfile_change
#

diskfile_helpers.ts view source

(type: WatcherChangeType): "add" | "change" | "delete"

Maps watcher change types to diskfile change types

type

type WatcherChangeType

returns

"add" | "change" | "delete"

maybe_get_field_schema
#

zod_helpers.ts view source

(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>, key: string): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined

Get the Zod schema for a specific field in an object schema, returning undefined if not found.

schema

The object schema

type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

key

The property name

type string

returns

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

The field's schema, or undefined if not found

Model
#

model.svelte.ts view source

inheritance

extends:
  • Cell<typeof ModelJson>

name

type ModelName

provider_name

type ProviderName

tags

type Array<string>

architecture

type string | undefined

parameter_count

type number | undefined

context_window

type number | undefined

output_token_limit

type number | undefined

embedding_length

type number | undefined

filesize

Size in gigabytes.

type number | undefined

cost_input

type number | undefined

cost_output

type number | undefined

training_cutoff

type string | undefined

ollama_list_response_item

type OllamaListResponseItem | undefined

ollama_show_response

type OllamaShowResponse | undefined

ollama_show_response_loaded

type boolean

ollama_show_response_loading

type boolean

ollama_show_response_error

type string | undefined

downloaded

For models that run locally, this is a boolean indicating if the model is downloaded. Is undefined for non-local models.

type boolean | undefined

readonly

provider

Lookup the provider for this model.

type Provider | undefined

readonly

context_window_formatted

type string | null

readonly

ollama_modified_at

Get the modified date from Ollama data if available.

type Date | undefined

readonly

needs_ollama_details

Check if this model needs its details loaded.

type boolean

readonly

loaded

Check if this model is currently loaded/running. For Ollama models, this checks if the model is in the running models set.

type boolean

readonly

constructor

type new (options: ModelOptions): Model

options

navigate_to_download

Download this model. Currently only works for Ollama models.

type (): Promise<void>

returns Promise<void>

navigate_to_provider_model_view

Navigate to the model view. Currently only works for Ollama models.

type (): Promise<void>

returns Promise<void>

ModelContextmenu
#

ModelDetail
#

ModelJson
#

model.svelte.ts view source

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

ModelJsonInput
#

model.svelte.ts view source

{ name: string; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; ... 13 more ...; ollama_show_response_error?: string | undefined; }

ModelLink
#

ModelListitem
#

ModelName
#

ModelOptions
#

ModelPicker
#

ModelPicker.svelte view source

onpick

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

items?

type Array<Model>
optional

filter?

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

heading?

type string | null
optional

ModelPickerDialog
#

ModelPickerDialog.svelte view source

show

type boolean
bindable

onpick

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

filter?

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

dialog_props?

type OmitStrict<ComponentProps<typeof Dialog>, 'children'> | undefined
optional

children?

type Snippet | undefined
optional

Models
#

models.svelte.ts view source

inheritance

extends:
  • Cell<typeof ModelsJson>

items

type IndexedCollection<Model>

readonly

ordered_by_name

Get all models ordered alphabetically by name.

type Array<Model>

readonly

constructor

type new (options: ModelsOptions): Models

options

add

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

model_json
type { name: string; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; ... 13 more ...; ollama_show_response_error?: string | undefined; }
returns void

add_many

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

models_json
type { name: string; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; ... 13 more ...; ollama_show_response_error?: 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[]

remove_by_name

type (name: string): void

name
type string
returns void

clear

type (): void

returns void

models_default
#

config_defaults.ts view source

{ name: string; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; id?: string | undefined; created?: string | undefined; updated?: string | undefined; tags?: string[] | undefined; ... 13 more ...; ollama_show_response_error?: string | undefined; }[]

ModelSchema
#

ModelSelect
#

ModelsJson
#

models.svelte.ts view source

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

ModelsJsonInput
#

models.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { name: string; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; id?: string | undefined; ... 16 more ...; ollama_show_response_error?: string | undefined; }[] | undefined; }

ModelsOptions
#

ModelSummary
#

monkeypatch_zzz_for_tests
#

test_helpers.ts view source

<T extends Frontend>(app: T): T

Applies testing-specific modifications to a Zzz instance.

app

type T

returns

T

MultiIndexOptions
#

indexed_collection_helpers.svelte.ts view source

MultiIndexOptions<T, K>

Options for multi-value indexes.

generics

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
#

noop_middleware
#

Ollama
#

ollama.svelte.ts view source

Ollama client state management with simplified API. Model data is stored in app.models, not here.

Status Display Pattern

For unified status display (available/unavailable/checking), components should use: - app.capabilities.ollama.status - unified status (prioritizes provider status) - app.capabilities.ollama.error_message - unified error message

This ensures consistency with other providers (Claude, ChatGPT, Gemini) and maintains a single source of truth. The capabilities layer prioritizes backend provider status (authoritative - checks if Ollama is installed) over action-level status (checks if API responds).

The lower-level properties here (list_status, list_error, provider_error, etc.) are operational state that capabilities.ollama derives from. Use these for: - Operational state (models, pulling, creating, etc.) - Action-specific error handling - Internal state management

inheritance

extends:
  • Cell<typeof OllamaJson>

list_response

type OllamaListResponse | null

list_status

type AsyncStatus

list_error

type string | null

list_last_updated

type number | null

list_round_trip_time

type number | null

last_refreshed

type string | null

ever_responded

type boolean

ps_response

type OllamaPsResponse | null

ps_status

type AsyncStatus

ps_error

type string | null

ps_polling_enabled

type boolean

pull_model_name

type string

pull_insecure

type boolean

pulling_models

type SvelteSet<string>

readonly

copy_source_model

type string

copy_destination_model

type string

copy_is_copying

type boolean

create_model_name

type string

create_from_model

type string

create_system_prompt

type string

create_template

type string

create_is_creating

type boolean

manager_selected_view

type 'configure' | 'model' | 'pull' | 'copy' | 'create'

manager_selected_model

type Model | null

manager_last_active_view

type {view: string; model: Model | null} | null

show_read_actions

type boolean

available

type boolean

readonly

actions

readonly

pending_actions

readonly

completed_actions

readonly

filtered_actions

readonly

models

type Array<Model>

readonly

models_downloaded

readonly

models_not_downloaded

readonly

model_by_name

type Map<ModelName, Model>

readonly

model_names

type Array<ModelName>

readonly

running_models

type Array<OllamaPsResponseItem>

readonly

running_model_names

type Set<ModelName>

readonly

pull_parsed_model_name

type ModelName

readonly

pull_already_downloaded

type boolean

readonly

pull_can_pull

type boolean

readonly

pull_is_pulling

type (model_name: string): boolean

model_name
type string
returns boolean

copy_parsed_source_model

type ModelName

readonly

copy_parsed_destination_model

type ModelName

readonly

copy_is_duplicate_name

type boolean

readonly

copy_destination_model_changed

type boolean

readonly

create_parsed_model_name

type ModelName

readonly

create_is_duplicate_name

type boolean

readonly

create_can_create

type boolean

readonly

constructor

type new (options: OllamaOptions): Ollama

options

dispose

type (): void

returns void

refresh

Refresh the list of models and ps info and update the refresh timestamp. Error handlers update state automatically.

If Ollama provider status indicates unavailability, skip API calls to avoid overwriting the provider status with action error messages.

type (): Promise<{ list_response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; } | null; ps_response: { ...; } | null; }>

returns Promise<{ list_response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: stri...

start_ps_polling

Start polling for running models status. Default interval is 10 seconds.

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

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

stop_ps_polling

Stop polling for running models status.

type (): void

returns void

handle_ollama_list_start

Handle the start of a list operation.

type (): void

returns void

handle_ollama_list_complete

List all models available on the Ollama server and sync with app.models.

type (response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; } | null): void

response
type { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; }...
returns void

handle_ollama_ps_start

Handle the start of a ps operation.

type (): void

returns void

handle_ollama_ps_complete

Get the list of currently running models.

type (response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; expires_at: string; model: string; name: string; size: number; size_vram: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; } | null): void

response
type { [x: string]: unknown; models: { [x: string]: unknown; digest: string; expires_at: string; model: string; name: string; size: number; size_vram: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } |...
returns void

handle_ollama_show

Get detailed information about a specific model.

type (request: { [x: string]: unknown; model: string; system?: string | undefined; template?: string | undefined; options?: any; }, response: { [x: string]: unknown; capabilities?: string[] | undefined; details?: { [x: string]: unknown; ... 5 more ...; quantization_level: string; } | undefined; ... 5 more ...; tensors?: any[] | undefined; } | null): void

request
type { [x: string]: unknown; model: string; system?: string | undefined; template?: string | undefined; options?: any; }
response
type { [x: string]: unknown; capabilities?: string[] | undefined; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; ... 5 more ...; tensors?: any[] | undefined; } | null
returns void

handle_ollama_delete

Delete a model from the Ollama server.

type (request: { [x: string]: unknown; model: string; }): Promise<void>

request
type { [x: string]: unknown; model: string; }
returns Promise<void>

clear_model_details

Clear details for a specific model.

type (model: Model): void

model
type Model
returns void

clear_all_model_details

Clear all model details.

type (): void

returns void

pull

Submit pull model form.

type (): Promise<void>

returns Promise<void>

copy

Submit copy model form.

type (): Promise<void>

returns Promise<void>

create

Submit create model form.

type (): Promise<void>

returns Promise<void>

delete

Submit delete model form.

type (model_name: string): Promise<void>

model_name
type string
returns Promise<void>

unload

Unload a model from memory.

type (model_name: string): Promise<void>

model_name
type string
returns Promise<void>

select

Select model in manager.

type (model: Model): Promise<void>

model
type Model
returns Promise<void>

close_form

Handle close form in manager.

type (): void

returns void

set_manager_view

Set the manager view and optionally the selected model.

type (view: "model" | "configure" | "pull" | "copy" | "create", model?: Model | null | undefined): void

view
type "model" | "configure" | "pull" | "copy" | "create"
model?
type Model | null | undefined
optional
returns void

manager_back_to_last_view

Navigate back to the last active view.

type (): void

returns void

ollama_copy_action_spec
#

action_specs.ts view source

{ method: "ollama_copy"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ source: ZodString; destination: ZodString; }, $loose>; output: ZodOptional<...>; async: true; }

ollama_create_action_spec
#

action_specs.ts view source

{ method: "ollama_create"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ model: ZodString; from: ZodOptional<ZodString>; ... 8 more ...; _meta: ZodOptional<...>; }, $strict>; output: ZodOptional<...>; async: true; }

ollama_delete_action_spec
#

action_specs.ts view source

{ method: "ollama_delete"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ model: ZodString; }, $loose>; output: ZodOptional<...>; async: true; }

ollama_list_action_spec
#

action_specs.ts view source

{ method: "ollama_list"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: null; input: ZodOptional<ZodVoid>; output: ZodUnion<readonly [ZodObject<{ models: ZodArray<...>; }, $loose>, ZodNull]>; async: true; }

ollama_logo
#

ollama_progress_action_spec
#

action_specs.ts view source

{ method: "ollama_progress"; kind: "remote_notification"; initiator: "backend"; auth: null; side_effects: true; input: ZodObject<{ status: ZodString; digest: ZodOptional<ZodString>; total: ZodOptional<...>; completed: ZodOptional<...>; _meta: ZodOptional<...>; }, $strict>; output: ZodVoid; async: true; }

ollama_ps_action_spec
#

action_specs.ts view source

{ method: "ollama_ps"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: null; input: ZodOptional<ZodVoid>; output: ZodUnion<readonly [ZodObject<{ models: ZodArray<ZodObject<...>>; }, $loose>, ZodNull]>; async: true; }

ollama_pull_action_spec
#

action_specs.ts view source

{ method: "ollama_pull"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ model: ZodString; insecure: ZodOptional<ZodBoolean>; stream: ZodOptional<...>; _meta: ZodOptional<...>; }, $strict>; output: ZodOptional<...>; async: true; }

ollama_show_action_spec
#

action_specs.ts view source

{ method: "ollama_show"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: null; input: ZodObject<{ model: ZodString; system: ZodOptional<ZodString>; template: ZodOptional<...>; options: ZodOptional<...>; }, $loose>; output: ZodUnion<...>; async: true; }

ollama_unload_action_spec
#

action_specs.ts view source

{ method: "ollama_unload"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ model: ZodString; }, $strict>; output: ZodOptional<...>; async: true; }

OLLAMA_URL
#

OllamaActionItem
#

OllamaActions
#

OllamaCapabilityData
#

capabilities.svelte.ts view source

OllamaCapabilityData

list_response

type OllamaListResponse | null

ps_response

type OllamaPsResponse | null

round_trip_time

type number | null

OllamaConfigure
#

OllamaCopyModel
#

OllamaCopyRequest
#

OllamaCreateModel
#

OllamaCreateRequest
#

ollama_helpers.ts view source

ZodObject<{ model: ZodString; from: ZodOptional<ZodString>; stream: ZodOptional<ZodBoolean>; quantize: ZodOptional<ZodString>; ... 5 more ...; adapters: ZodOptional<...>; }, $loose>

OllamaDeleteRequest
#

OllamaJson
#

ollama.svelte.ts view source

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

OllamaJsonInput
#

ollama.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; host?: string | undefined; }

OllamaListRequest
#

OllamaListResponse
#

ollama_helpers.ts view source

ZodObject<{ models: ZodArray<ZodObject<{ details: ZodOptional<ZodObject<{ families: ZodArray<ZodString>; family: ZodString; format: ZodString; parameter_size: ZodString; parent_model: ZodString; quantization_level: ZodString; }, $loose>>; ... 4 more ...; size: ZodNumber; }, $loose>>; }, $loose>

OllamaListResponseItem
#

ollama_helpers.ts view source

ZodObject<{ details: ZodOptional<ZodObject<{ families: ZodArray<ZodString>; family: ZodString; format: ZodString; parameter_size: ZodString; parent_model: ZodString; quantization_level: ZodString; }, $loose>>; ... 4 more ...; size: ZodNumber; }, $loose>

OllamaManager
#

OllamaModelDetail
#

OllamaModelDetail.svelte view source

model

type Model

onshow

type (model: Model) => void

onclose?

type (model: Model) => void
optional

ondelete?

type (model: Model) => void
optional

header?

type Snippet
optional

OllamaModelDetails
#

ollama_helpers.ts view source

ZodObject<{ families: ZodArray<ZodString>; family: ZodString; format: ZodString; parameter_size: ZodString; parent_model: ZodString; quantization_level: ZodString; }, $loose>

OllamaModelListitem
#

OllamaModelStatus
#

OllamaOptions
#

OllamaProgressResponse
#

ollama_helpers.ts view source

ZodObject<{ status: ZodString; digest: ZodOptional<ZodString>; total: ZodOptional<ZodNumber>; completed: ZodOptional<ZodNumber>; }, $loose>

OllamaPsRequest
#

OllamaPsResponse
#

ollama_helpers.ts view source

ZodObject<{ models: ZodArray<ZodObject<{ details: ZodOptional<ZodObject<{ families: ZodArray<ZodString>; family: ZodString; format: ZodString; parameter_size: ZodString; parent_model: ZodString; quantization_level: ZodString; }, $loose>>; ... 5 more ...; size_vram: ZodNumber; }, $loose>>; }, $loose>

OllamaPsResponseItem
#

ollama_helpers.ts view source

ZodObject<{ details: ZodOptional<ZodObject<{ families: ZodArray<ZodString>; family: ZodString; format: ZodString; parameter_size: ZodString; parent_model: ZodString; quantization_level: ZodString; }, $loose>>; ... 5 more ...; size_vram: ZodNumber; }, $loose>

OllamaPsStatus
#

OllamaPullModel
#

OllamaPullRequest
#

OllamaPushRequest
#

OllamaShowRequest
#

ollama_helpers.ts view source

ZodObject<{ model: ZodString; system: ZodOptional<ZodString>; template: ZodOptional<ZodString>; options: ZodOptional<ZodAny>; }, $loose>

OllamaShowResponse
#

ollama_helpers.ts view source

ZodObject<{ capabilities: ZodOptional<ZodArray<ZodString>>; details: ZodOptional<ZodObject<{ families: ZodArray<ZodString>; family: ZodString; format: ZodString; parameter_size: ZodString; parent_model: ZodString; quantization_level: ZodString; }, $loose>>; ... 5 more ...; tensors: ZodOptional<...>; }, $loose>

OllamaStatusResponse
#

OnCompletionProgress
#

OUTPUT_TOKEN_MAX_DEFAULT
#

parse_action_event
#

action_event.ts view source

(raw_json: unknown, environment: ActionEventEnvironment): ActionEvent<"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | ... 14 more ... | "toggle_main_menu", ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more ... | "failed">

raw_json

type unknown

environment

returns

ActionEvent<"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu", ActionEventEnvironment, "send_request" | ... 7 more ... | "execute", "initial" | ... 3 more...

parse_action_input
#

action_collection_helpers.ts view source

<TMethod extends keyof typeof ActionInputs>(method: TMethod, data: unknown): ActionInputs[TMethod]

Parse action params with validation.

method

type TMethod

data

type unknown

returns

ActionInputs[TMethod]

parse_action_output
#

action_collection_helpers.ts view source

<TMethod extends keyof typeof ActionOutputs>(method: TMethod, data: unknown): ActionOutputs[TMethod]

Parse action result with validation.

method

type TMethod

data

type unknown

returns

ActionOutputs[TMethod]

parse_allowed_origins
#

server/security.ts view source

(env_value: string | undefined): RegExp[]

Parses ALLOWED_ORIGINS env var into regex matchers for request source verification. This is NOT a CSRF protection mechanism - it's a simple origin/referer allowlist that verifies requests are coming from expected sources.

Accepts comma-separated patterns with limited wildcards: - Exact origins: https://api.example.com - Wildcard subdomains: https://*.example.com (matches exactly one subdomain level) - Multiple wildcards: https://*.staging.*.example.com (for deep subdomains) - Wildcard ports: http://localhost:* (matches any port or no port) - IPv6 addresses: http://[::1]:3000, https://[2001:db8::1] - Combined: https://*.example.com:*

Examples: - http://localhost:3000,https://prod.example.com - https://*.api.example.com,http://127.0.0.1:* - http://[::1]:*,https://*.*.corp.example.com:*

env_value

type string | undefined

returns

RegExp[]

parse_url_param_uuid
#

url_params_helpers.ts view source

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

Parse and validate a UUID parameter value from the URL.

value

type unknown

returns

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

Part
#

part.svelte.ts view source

Abstract base class for all part types.

generics

T

constraint z.ZodType
default typeof PartJsonBase

inheritance

extends:
  • Cell<T>

type

type string

abstractreadonly

start

type number | null

end

type number | null

length

type number | null | undefined

readonly

token_count

type number | null | undefined

readonly

content_preview

content with a max length

readonly

name

type string

has_xml_tag

type boolean

xml_tag_name

type string

attributes

type Array<XmlAttributeWithDefaults>

enabled

type boolean

title

type string | null

summary

type string | null

xml_tag_name_default

type string

readonly

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

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

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

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

PART_GLYPHS
#

PartContextmenu
#

PartEditorForDiskfile
#

PartEditorForText
#

PartJson
#

part.svelte.ts view source

ZodDiscriminatedUnion<[ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; ... 11 more ...; content: ZodDefault<...>; }, $strict>, ZodObject<...>], "type">

Union of all part types for deserialization.

PartJsonBase
#

part.svelte.ts view source

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

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; } | { ...; }

PartJsonType
#

PartList
#

PartList.svelte view source

parts

type Array<PartUnion>

prompt?

type Prompt | undefined
optional

onreorder?

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

reorderable_options?

type ReorderableOptions | undefined
optional

item_attrs?

type SvelteHTMLElements['li'] | undefined
optional

attrs?

type SvelteHTMLElements['ul'] | undefined
optional

empty?

type Snippet | undefined
optional

PartListitem
#

PartListitem.svelte view source

part

selected?

type boolean | undefined
optional

onclick?

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

compact?

type boolean | undefined
optional

attrs?

type SvelteHTMLElements['button'] | undefined
optional

PartOptions
#

part.svelte.ts view source

PartOptions<T>

generics

T

constraint z.ZodType
default typeof PartJsonBase

inheritance

extends:
  • CellOptions<T>

json

type z.input<T>

PartOptionsUnion
#

PartPicker
#

PartPicker.svelte view source

onpick

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

filter?

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

exclude_ids?

type Array<Uuid> | undefined
optional

PartPickerDialog
#

PartPickerDialog.svelte view source

onpick

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

show?

type boolean | undefined
optional bindable

filter?

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

exclude_ids?

type Array<Uuid> | undefined
optional

dialog_props?

type OmitStrict<ComponentProps<typeof Dialog>, 'children'> | undefined
optional

PartRemoveButton
#

Parts
#

parts.svelte.ts view source

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

PartsJson
#

parts.svelte.ts view source

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

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; }

PartsOptions
#

PartStats
#

PartSummary
#

PartToggleButton
#

PartUnion
#

PartView
#

PathNotAllowedError
#

server/scoped_fs.ts view source

Error thrown when a path is not allowed

inheritance

extends:
  • Error

name

constructor

type new (path: string, options?: ErrorOptions | undefined): PathNotAllowedError

path
type string
options?
type ErrorOptions | undefined
optional

PathWithLeadingSlash
#

PathWithoutLeadingSlash
#

PathWithoutTrailingSlash
#

PathWithTrailingSlash
#

Picker
#

PickerDialog
#

ping_action_spec
#

action_specs.ts view source

{ method: "ping"; kind: "request_response"; initiator: "both"; auth: "public"; side_effects: null; input: ZodOptional<ZodVoid>; output: ZodObject<{ ping_id: ZodUnion<readonly [ZodString, ZodNumber]>; }, $strict>; async: true; }

PING_HISTORY_MAX
#

PingData
#

PingForm
#

Poller
#

poller.svelte.ts view source

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

DEFAULT_INTERVAL

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

PollerOptions
#

poller.svelte.ts view source

PollerOptions

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
#

Popover
#

popover.svelte.ts view source

Class that manages state and provides actions for popovers.

visible

Whether the popover is currently visible.

position

Position of the popover relative to its trigger.

type Position

align

Alignment along the position edge.

type Alignment

offset

Distance from the position.

disable_outside_click

Whether to disable closing when clicking outside.

popover_class

Custom class for the popover.

constructor

type new (params?: PopoverParameters | undefined): Popover

params?
type PopoverParameters | undefined
optional

update

Updates the popover configuration.

type (params: PopoverParameters): void

params
returns void

show

Shows the popover.

type (): void

returns void

hide

Hides the popover.

type (): void

returns void

toggle

Toggles the popover visibility.

type (visible?: boolean): void

visible
type boolean
default !this.visible
returns void

container

Attachment for the container element.

type Attachment<HTMLElement>

trigger

Attachment factory for the trigger element that shows/hides the popover.

content

Attachment factory for the popover content element.

PopoverButton
#

PopoverButton.svelte view source

position?

type Position | undefined
optional

align?

type Alignment | undefined
optional

disable_outside_click?

type boolean | undefined
optional

popover_class?

type string | undefined
optional

popover_attrs?

type SvelteHTMLElements['div'] | undefined
optional

popover_content

type Snippet<[popover: Popover]>

popover_container_attrs?

type SvelteHTMLElements['div'] | undefined
optional

button?

type Snippet<[popover: Popover]> | undefined
optional

children?

type Snippet<[popover: Popover]> | undefined
optional

PopoverContentParameters
#

PopoverParameters
#

popover.svelte.ts view source

PopoverParameters

Parameters for configuring the popover.

position

Position of the popover relative to its trigger.

align

Alignment along the position edge.

offset

Distance from the position.

type string

disable_outside_click

Whether to disable closing when clicking outside.

type boolean

popover_class

Custom class for the popover content.

type string

onshow

Optional callback when popover is shown.

type () => void

onhide

Optional callback when popover is hidden.

type () => void

PopoverTriggerParameters
#

Position
#

PRESENCE_PENALTY_DEFAULT
#

ProgressBar
#

Prompt
#

prompt.svelte.ts view source

inheritance

extends:
  • Cell<typeof PromptJson>

name

type string

parts

type Array<PartUnion>

content

type string

readonly

length

type number

readonly

token_count

type number

readonly

content_preview

type string

readonly

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">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; name: ZodDefault<...>; parts: ZodDefault<...>; }, $strict>

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; }

PromptList
#

PromptListitem
#

PromptMessage
#

PromptOptions
#

PromptPicker
#

PromptPicker.svelte view source

onpick

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

filter?

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

exclude_ids?

type Array<Uuid> | undefined
optional

selected_ids?

type Array<Uuid> | undefined
optional

PromptPickerDialog
#

PromptPickerDialog.svelte view source

onpick

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

show?

type boolean | undefined
optional bindable

filter?

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

exclude_ids?

type Array<Uuid> | undefined
optional

selected_ids?

type Array<Uuid> | undefined
optional

dialog_props?

type OmitStrict<ComponentProps<typeof Dialog>, 'children'> | undefined
optional

Prompts
#

prompts.svelte.ts view source

inheritance

extends:
  • Cell<typeof PromptsJson>

items

type IndexedCollection<Prompt>

readonly

selected_id_last_non_null

type Uuid | null

selected

type Prompt | undefined

readonly

show_sort_controls

Controls visibility of sort controls in the prompts list.

type boolean

ordered_items

Ordered array of prompts derived from the manual_order index.

type Array<Prompt>

readonly

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

PromptSchema
#

PromptsJson
#

prompts.svelte.ts view source

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

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...

PromptsOptions
#

PromptsSchema
#

PromptStats
#

PromptSummary
#

Provider
#

provider.svelte.ts view source

inheritance

extends:
  • Cell<typeof ProviderJson>

name

type ProviderName

title

type string

url

type string

homepage

type string

company

type string

api_key_url

type string | null

models

type Array<Model>

readonly

status

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

type ProviderStatus | null

readonly

available

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

type boolean

readonly

constructor

type new (options: ProviderOptions): Provider

options

PROVIDER_ERROR_NEEDS_API_KEY
#

PROVIDER_ERROR_NOT_INSTALLED
#

provider_load_status_action_spec
#

action_specs.ts view source

{ method: "provider_load_status"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: null; input: ZodObject<{ provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; reload: ZodOptional<...>; }, $strict>; output: ZodObject<...>; async: true; }

provider_update_api_key_action_spec
#

action_specs.ts view source

{ method: "provider_update_api_key"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: true; input: ZodObject<{ provider_name: ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>; api_key: ZodString; }, $strict>; output: ZodObject<...>; async: true; }

ProviderData
#

provider_types.ts view source

{ type: "ollama"; value: any; } | { 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; }; }

ProviderDataChatgpt
#

ProviderDataClaude
#

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>

ProviderDataOllama
#

ProviderDataSchema
#

provider_types.ts view source

ZodDiscriminatedUnion<[ZodObject<{ type: ZodLiteral<"ollama">; value: ZodDefault<ZodOptional<ZodAny>>; }, $strict>, ZodObject<{ type: ZodLiteral<...>; value: ZodDefault<...>; }, $strict>, ZodObject<...>, ZodObject<...>], "type">

ProviderDetail
#

ProviderJson
#

provider.svelte.ts view source

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

ProviderJsonInput
#

provider.svelte.ts view source

{ name: "ollama" | "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; }

ProviderLink
#

ProviderLogo
#

ProviderName
#

provider_types.ts view source

ZodEnum<{ ollama: "ollama"; claude: "claude"; chatgpt: "chatgpt"; gemini: "gemini"; }>

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

ProviderOptions
#

Providers
#

providers.svelte.ts view source

inheritance

extends:
  • Cell<typeof ProvidersJson>

items

type Array<Provider>

names

type ReadonlyArray<ProviderName>

readonly

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

remove_by_name

type (name: string): void

name
type string
returns void

clear

type (): void

returns void

providers_default
#

config_defaults.ts view source

{ name: "ollama" | "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; }[]

ProvidersJson
#

providers.svelte.ts view source

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

ProvidersJsonInput
#

providers.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { name: "ollama" | "claude" | "chatgpt" | "gemini"; title: string; url: string; homepage: string; ... 4 more ...; updated?: string | undefined; }[] | undefined; }

ProvidersOptions
#

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">

ProviderSummary
#

QueuedMessage
#

register_http_actions
#

register_websocket_actions
#

RegisterActionsOptions
#

RegisterWebsocketActionsOptions
#

RemoteNotificationActionMethod
#

action_metatypes.ts view source

ZodEnum<{ completion_progress: "completion_progress"; filer_change: "filer_change"; ollama_progress: "ollama_progress"; }>

Names of all remote_notification actions.

RemoteNotificationActionSpec
#

action_spec.ts view source

ZodObject<{ method: ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>; ... 6 more ...; async: ZodDefault<...

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; }[]

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

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

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

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

inheritance

initialized

source_index

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

item

ReorderableDirection
#

ReorderableDropPosition
#

ReorderableId
#

ReorderableItemId
#

ReorderableItemParams
#

ReorderableListParams
#

ReorderableOptions
#

reorderable.svelte.ts view source

ReorderableOptions

Additional configuration options for Reorderable.

direction

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

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

ReorderableStyleConfig
#

reorderable.svelte.ts view source

ReorderableStyleConfig

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<{ completion_create: "completion_create"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ollama_copy: "ollama_copy"; ... 10 more ...; session_load: "session_load"; }>

Names of all request_response actions.

RequestResponseActionSpec
#

action_spec.ts view source

ZodObject<{ method: ZodEnum<{ completion_create: "completion_create"; completion_progress: "completion_progress"; directory_create: "directory_create"; diskfile_delete: "diskfile_delete"; diskfile_update: "diskfile_update"; ... 14 more ...; toggle_main_menu: "toggle_main_menu"; }>; ... 6 more ...; async: ZodDefault<...

RequestTracker
#

request_tracker.svelte.ts view source

Tracks RPC requests and their responses to manage promises and timeouts. Used by transports to handle the request-response lifecycle.

pending_requests

type SvelteMap<JsonrpcRequestId, RequestTrackerItem>

readonly

request_timeout_ms

type number

readonly

constructor

type new (request_timeout_ms?: number): RequestTracker

request_timeout_ms
type number
default 120_000

track_request

Track a new request with the given id.

type (id: string | number): Deferred<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { ...; }; }>

id

The request id

type string | number
returns Deferred<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); messag...

A deferred promise that will be resolved when the response is received

resolve_request

Resolve a pending request with the given response data.

type (id: string | number, response: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { ...; }; }): void

id

The request id

type string | number
response

The response data

type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); message: string...
returns void

reject_request

Reject a pending request with the given error.

type (id: string | number, error_message: { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }): void

id

The request id

type string | number
error_message

The complete JsonrpcErrorMessage object

type { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; }
returns void

handle_message

Handle an incoming JSON-RPC message. Resolves or rejects the associated request. Ignores notifications and unknown/invalid messages.

type (message: any): void

message
type any
returns void

cancel_request

Cancel a pending request.

type (id: string | number): void

id

The request id

type string | number
returns void

cancel_all_requests

Cancel all pending requests.

type (reason?: string | undefined): void

reason?

Optional reason to include in rejection

type string | undefined
optional
returns void

RequestTrackerItem
#

request_tracker.svelte.ts view source

Represents a pending request with its associated state.

id

type JsonrpcRequestId

readonly

deferred

type Deferred<JsonrpcResponseOrError>

readonly

created

type Datetime

readonly

status

type AsyncStatus

timeout

type NodeJS.Timeout | undefined

constructor

type new (id: string | number, deferred: Deferred<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { ...; }; }>, created: string & $brand<...>, status: AsyncStatus, timeout: Timeout | undefined): RequestTrackerItem

id
type string | number
deferred
type Deferred<{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: { [x: string]: unknown; _meta?: { [x: string]: unknown; } | undefined; }; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | ... 4 more ... | (number & $brand<...>); messag...
created
type string & $brand<"Datetime">
status
type AsyncStatus
timeout
type Timeout | undefined

safe_parse_action_input
#

action_collection_helpers.ts view source

<TMethod extends keyof typeof ActionInputs>(method: TMethod, data: unknown): ZodSafeParseResult<ActionInputs[TMethod]>

Safe parse action params.

method

type TMethod

data

type unknown

returns

ZodSafeParseResult<ActionInputs[TMethod]>

safe_parse_action_output
#

action_collection_helpers.ts view source

<TMethod extends keyof typeof ActionOutputs>(method: TMethod, data: unknown): ZodSafeParseResult<ActionOutputs[TMethod]>

Safe parse action result.

method

type TMethod

data

type unknown

returns

ZodSafeParseResult<ActionOutputs[TMethod]>

save_completion_response_to_disk
#

server/helpers.ts view source

(input: { completion_request: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; prompt: string; completion_messages?: { ...; }[] | undefined; }; _meta?: { ...; } | undefined; }, output: { ...; }, zzz_dir: string, scoped_fs: ScopedFs): Promise<...>

input

type { completion_request: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; prompt: string; completion_messages?: { ...; }[] | undefined; }; _meta?: { ...; } | undefined; }

output

type { completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }

zzz_dir

type string

scoped_fs

returns

Promise<void>

SchemaClassInfo
#

cell_helpers.ts view source

SchemaClassInfo

Schema class information extracted from a Zod schema.

type

type string

is_array

type boolean

class_name

type string

element_class

type string

SchemaKeys
#

SchemaRegistry
#

schema_registry.ts view source

A central registry for schemas and actions. Provides a single source of truth for schema definitions.

schemas

All schemas, including model schemas, action params, and responses.

type Array<z.ZodType>

model_schemas

Model schemas are distinct from the action schemas. Models are the nouns compared to the Action verbs, and compared to Views they are data not Svelte components.

type Array<z.ZodType>

action_params_schemas

Action parameter schemas.

type Array<z.ZodType>

action_response_schemas

Action response schemas.

type Array<z.ZodType>

schema_by_name

Map of schema names to schemas.

type Map<VocabName, z.ZodType>

name_by_schema

Map of schemas to their names, for reverse lookup. Zod schemas don't have a name property and we don't want to abuse description.

type Map<z.ZodType, VocabName>

action_specs

Collection of all action specs.

type Array<ActionSpecUnion>

request_response_action_specs

Collection of 'request_response' action specs.

type Array<RequestResponseActionSpec>

remote_notification_action_specs

Collection of 'remote_notification' action specs.

type Array<RemoteNotificationActionSpec>

local_call_action_specs

Collection of 'local_call' action specs.

type Array<LocalCallActionSpec>

action_spec_by_name_map

Map of action spec names to action specs.

type Map<ActionMethod, ActionSpecUnion>

add_schema

Add a schema to the appropriate registries.

type (name: VocabName, schema: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | ... 12 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | ZodType<...>): void

name
schema
type { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | ZodType<...>
returns void

register_many

Register multiple schemas at once.

type (schemas: Record<string, any>): void

schemas
type Record<string, any>
returns void

lookup_schema_name

Lookup a schema name, guaranteed to return a string, or throws.

type (schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>): VocabName

schema
type ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
returns VocabName

get_action_spec

Get an action specification by method name.

type (method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): { ...; } | ... 2 more ... | undefined

method
type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"
returns { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | undefined

get_schema

Get a schema by name.

type (name: VocabName): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined

name
returns ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined

SchemaValue
#

cell_types.ts view source

SchemaValue<T, K>

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

generics

T

constraint z.ZodType

K

constraint SchemaKeys<T>

ScopedFs
#

server/scoped_fs.ts view source

Provides a secure wrapper around filesystem operations to prevent path traversal attacks and unauthorized file access.

Security features: - Restricts operations to specified allowed paths - Prevents path traversal attacks by normalizing all paths - Blocks access to symlinks to avoid arbitrary file access - Requires absolute paths to avoid relative path confusion - Validates the entire path hierarchy for each operation

This class should be used whenever performing filesystem operations on user-provided or untrusted input paths to ensure proper access boundaries.

allowed_paths

type ReadonlyArray<ScopedFsPath>

readonly

constructor

Create a new ScopedFs instance with the specified allowed paths.

type new (allowed_paths: readonly string[] | string[]): ScopedFs

allowed_paths

Array of absolute paths that operations will be restricted to

type readonly string[] | string[]

is_path_allowed

Checks if the given path is allowed based on the paths provided during instantiation.

type (path_to_check: string): boolean

path_to_check
type string
returns boolean

is_path_safe

Performs a complete security check on a path, including symlink validation

type (path_to_check: string): Promise<boolean>

path_to_check
type string
returns Promise<boolean>

read_file

type (file_path: string, options?: (ObjectEncodingOptions & Abortable & { flag?: OpenMode | undefined; }) | BufferEncoding | null | undefined): Promise<...>

file_path
type string
options
type (ObjectEncodingOptions & Abortable & { flag?: OpenMode | undefined; }) | BufferEncoding | null | undefined
default 'utf8'
returns Promise<string | Buffer<ArrayBufferLike>>

write_file

type (file_path: string, data: string | ArrayBufferView<ArrayBufferLike> | Iterable<string | ArrayBufferView<ArrayBufferLike>> | AsyncIterable<...> | Stream, options?: BufferEncoding | ... 2 more ... | undefined): Promise<...>

file_path
type string
data
type string | ArrayBufferView<ArrayBufferLike> | Iterable<string | ArrayBufferView<ArrayBufferLike>> | AsyncIterable<...> | Stream
options
type BufferEncoding | (ObjectEncodingOptions & { mode?: Mode | undefined; flag?: OpenMode | undefined; flush?: boolean | undefined; } & Abortable) | null | undefined
default 'utf8'
returns Promise<void>

rm

type (path_to_remove: string, options?: RmOptions | undefined): Promise<void>

path_to_remove
type string
options?
type RmOptions | undefined
optional
returns Promise<void>

mkdir

type (dir_path: string, options?: MakeDirectoryOptions | undefined): Promise<string | undefined>

dir_path
type string
options?
type MakeDirectoryOptions | undefined
optional
returns Promise<string | undefined>

readdir

type (path: PathLike, options?: BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined): Promise<...>

path
type PathLike
options?
type BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined
optional
returns Promise<string[]>

readdir

type (path: PathLike, options?: BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined): Promise<...>

path
type PathLike
options?
type BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined
optional
returns Promise<string[]>

readdir

type (path: PathLike, options?: BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined): Promise<...>

path
type PathLike
options?
type BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined
optional
returns Promise<string[]>

stat

type (path_to_stat: string, options?: StatOptions | undefined): Promise<Stats>

path_to_stat
type string
options?
type StatOptions | undefined
optional
returns Promise<Stats>

stat

type (path_to_stat: string, options?: StatOptions | undefined): Promise<Stats>

path_to_stat
type string
options?
type StatOptions | undefined
optional
returns Promise<Stats>

stat

type (path_to_stat: string, options?: StatOptions | undefined): Promise<Stats>

path_to_stat
type string
options?
type StatOptions | undefined
optional
returns Promise<Stats>

copy_file

type (source: string, destination: string, mode?: number | undefined): Promise<void>

source
type string
destination
type string
mode?
type number | undefined
optional
returns Promise<void>

exists

type (path_to_check: string): Promise<boolean>

path_to_check
type string
returns Promise<boolean>

ScopedFsPath
#

server/scoped_fs.ts view source

$ZodBranded<ZodPipe<ZodString, ZodTransform<string, string>>, "ScopedFsPath">

A branded type for representing safely normalized filesystem paths

Scrollable
#

scrollable.svelte.ts view source

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

target_class

CSS class name to apply when scrolled.

type string

threshold

Threshold in pixels before considering the element scrolled.

type number

scroll_y

The current scroll Y position.

type number

scrolled

Whether element is scrolled past threshold.

type boolean

readonly

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

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

SEED_DEFAULT
#

SerializableDisknode
#

diskfile_types.ts view source

ZodObject<{ id: $ZodBranded<ZodString, "DiskfilePath">; source_dir: $ZodBranded<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, $ZodBranded<...>>, "DiskfileDirectoryPath">; ... 4 more ...; dependencies: ZodArray<...>; }, $strict>

SERVER_HOST
#

Server_Info
#

server/server_info.ts view source

ZodObject<{ version: ZodNumber; pid: ZodNumber; port: ZodNumber; started: ZodString; zzz_version: ZodString; }, $strict>

Information about the running server, stored in server.json

server_info_check_stale
#

server/server_info.ts view source

(zzz_dir: string): Promise<{ version: number; pid: number; port: number; started: string; zzz_version: string; } | null>

Returns server info if running, otherwise deletes stale file and returns null

zzz_dir

type string

returns

Promise<{ version: number; pid: number; port: number; started: string; zzz_version: string; } | null>

server_info_get_path
#

server_info_read
#

server/server_info.ts view source

(zzz_dir: string): Promise<{ version: number; pid: number; port: number; started: string; zzz_version: string; } | null>

Reads and validates server.json, deleting and returning null if corrupt or wrong version

zzz_dir

type string

returns

Promise<{ version: number; pid: number; port: number; started: string; zzz_version: string; } | null>

server_info_remove
#

server/server_info.ts view source

(zzz_dir: string): Promise<void>

Remove server info file (idempotent - ignores if already removed)

zzz_dir

type string

returns

Promise<void>

server_info_write
#

Server_Info_Write_Options
#

SERVER_PROTOCOL
#

SERVER_PROXIED_PORT
#

SERVER_URL
#

ServerCapabilityData
#

session_load_action_spec
#

action_specs.ts view source

{ method: "session_load"; kind: "request_response"; initiator: "frontend"; auth: "public"; side_effects: null; input: ZodOptional<ZodVoid>; output: ZodObject<{ data: ZodObject<{ zzz_dir: $ZodBranded<...>; scoped_dirs: ZodReadonly<...>; files: ZodArray<...>; provider_status: ZodArray<...>; }, $strict>; }, $strict>; a...

set_reorderable_drag_data_transfer
#

reorderable_helpers.ts view source

(dataTransfer: DataTransfer, item_id: ReorderableItemId): void

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
#

should_allow_origin
#

server/security.ts view source

(origin: string, allowed_patterns: RegExp[]): boolean

Tests if a request source (origin or referer) matches any of the allowed patterns. Pattern matching is case-insensitive for domains (as per web standards).

origin

type string

allowed_patterns

type RegExp[]

returns

boolean

should_validate_output
#

action_event_helpers.ts view source

(kind: "request_response" | "remote_notification" | "local_call", phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"): boolean

kind

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

phase

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"

returns

boolean

SingleIndexOptions
#

Socket
#

socket.svelte.ts view source

Socket class for WebSocket connection management with auto-reconnect and message queueing.

inheritance

extends:
  • Cell<typeof SocketJson>

ws

type WebSocket | null

open

type boolean

status

type AsyncStatus

last_send_time

type number | null

last_receive_time

type number | null

last_connect_time

type number | null

heartbeat_timeout

type NodeJS.Timeout | null

reconnect_count

type number

reconnect_attempt

type number

reconnect_timeout

type NodeJS.Timeout | null

current_reconnect_delay

type number

message_queue

type Array<QueuedMessage>

failed_messages

type SvelteMap<string, FailedMessage>

connected

type boolean

readonly

can_send

type boolean

readonly

has_queued_messages

type boolean

readonly

queued_message_count

type number

readonly

failed_message_count

type number

readonly

connection_duration

type number | null

readonly

connection_duration_rounded

type number | null

readonly

constructor

type new (options: SocketOptions): Socket

options

connect

Connects to the WebSocket server.

type (url?: string | null): void

url

The WebSocket URL to connect to

type string | null
default null
returns void

disconnect

Disconnects from the WebSocket server.

type (code?: number): void

code

The close code to use (default: 1000 - normal closure)

type number
default DEFAULT_CLOSE_CODE
returns void

send

Sends a message through the WebSocket.

type (data: object): boolean

data

The data to send

type object
returns boolean

True if the message was sent immediately, false if queued or failed

update_url

Updates the connection URL and reconnects if currently connected.

type (url: string): void

url

The new WebSocket URL

type string
returns void

send_heartbeat

Sends a ping message for heartbeat purposes

type (): Promise<void>

returns Promise<void>

retry_queued_messages

Retry sending all queued messages.

type (): void

returns void

clear_failed_messages

Clear the failed messages list

type (): void

returns void

maybe_reconnect

type (): void

returns void

cancel_reconnect

Cancel any pending reconnection attempt.

type (): void

returns void

add_message_handler

Add a message handler and return a function to remove it.

type (handler: SocketActionHandler): () => void

handler

The message handler to add

returns () => void

A function that removes the handler when called

add_error_handler

Add an error handler and return a function to remove it.

type (handler: SocketErrorHandler): () => void

handler

The error handler to add

returns () => void

A function that removes the handler when called

SocketActionHandler
#

SocketErrorHandler
#

SocketJson
#

socket.svelte.ts view source

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

SocketJsonInput
#

socket.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; url?: string | null | undefined; url_input?: string | undefined; heartbeat_interval?: number | undefined; reconnect_delay?: number | undefined; reconnect_delay_max?: number | undefined; auto_reconnect?: boolean | undefined; }

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>

Create 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>

sort_by_text
#

sortable.svelte.ts view source

<T extends Cell<any>>(key: string, label: string, field: keyof T, direction?: "asc" | "desc"): Sorter<T>

Create 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>

Sortable
#

sortable.svelte.ts view source

Manages the sortable state for a collection of items with reactive data sources.

generics

T

items

type Array<T>

readonly

sorters

type Array<Sorter<T>>

readonly

default_key

type string | undefined

readonly

active_key

Current active sort key

type string

active_sorter

The currently active sorter.

type Sorter<T> | undefined

readonly

active_sort_fn

The sort function from the active sorter.

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

readonly

sorted_items

Sorted items based on the current active sorter.

type Array<T>

readonly

constructor

Create 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
#

Sorter
#

STOP_SEQUENCES_DEFAULT
#

SUPPORTED_CODE_FILETYPE_MATCHER
#

SvelteMapSchema
#

SymlinkNotAllowedError
#

server/scoped_fs.ts view source

Error thrown when a path is a symlink

inheritance

extends:
  • Error

name

constructor

type new (path: string, options?: ErrorOptions | undefined): SymlinkNotAllowedError

path
type string
options?
type ErrorOptions | undefined
optional

SYSTEM_MESSAGE_DEFAULT
#

TEMPERATURE_DEFAULT
#

TextPart
#

part.svelte.ts view source

Text part - stores content directly.

inheritance

extends:
  • Part<typeof TextPartJson>

type

readonly

content

type string

constructor

type new (options: TextPartOptions): TextPart

options

TextPartJson
#

part.svelte.ts view source

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

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; }

TextPartOptions
#

TextPartSchema
#

Thread
#

thread.svelte.ts view source

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

model

type Model

readonly

turns

type IndexedCollection<Turn>

readonly

enabled

type boolean

content

type string

readonly

length

type number

readonly

token_count

type number

readonly

content_preview

type string

readonly

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: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; prompt: string; completion_messages?: { ...; }[] | undefined; } | undefined): Turn

content
type string
request?
type { created: string & $brand<"Datetime">; provider_name: "ollama" | "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>

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">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; model_name: ZodDefault<...>; turns: ZodDefault<...>; enabled: ZodDefault<...>; }, $strict>

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; }

ThreadList
#

ThreadListitem
#

ThreadOptions
#

Threads
#

threads.svelte.ts view source

inheritance

extends:
  • Cell<typeof ThreadsJson>

items

type IndexedCollection<Thread>

readonly

selected_id

type Uuid | null

selected

type Thread | undefined

readonly

selected_id_error

type boolean

readonly

ordered_items

Ordered array of threads derived from the manual_order index.

type Array<Thread>

readonly

constructor

type new (options: ThreadsOptions): Threads

options

add

type (json?: { 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; } | undefined, select?: boolean | undefined): Thread

json?
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; } | undefined
optional
select?
type boolean | undefined
optional
returns Thread

add_thread

type (thread: Thread, select?: boolean | undefined): Thread

thread
type Thread
select?
type boolean | undefined
optional
returns Thread

add_many

type (threads_json: { 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; }[], select?: number | ... 1 more ... | undefined): Thread[]

threads_json
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; }[]
select?
type number | boolean | undefined
optional
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

select

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

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

select_next

type (): void

returns void

reorder_threads

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

from_index
type number
to_index
type number
returns void

ThreadsJson
#

threads.svelte.ts view source

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

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; selected_id?: string |...

ThreadsOptions
#

ThreadToggleButton
#

ThrownJsonrpcError
#

jsonrpc_errors.ts view source

Custom error class for JSON-RPC errors.

inheritance

extends:
  • Error

code

type JsonrpcErrorCode

data

type unknown

constructor

type new (code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">), message: string, data?: unknown, options?: ErrorOptions | undefined): ThrownJsonrpcError

code
type -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)
message
type string
data?
type unknown
optional
options?
type ErrorOptions | undefined
optional

Time
#

time.svelte.ts view source

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.

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

now_timestamp

readonly

now_formatted_short_date

type string

readonly

now_formatted_datetime

type string

readonly

now_formatted_time

type string

readonly

interval

The interval in milliseconds between time updates.

type number

running

Whether the interval timer is currently running.

type boolean

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

destroy

Override Cell's destroy method to ensure timer cleanup.

type (): void

returns void

TimeJson
#

time.svelte.ts view source

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

TimeJsonInput
#

TimeOptions
#

time.svelte.ts view source

TimeOptions

Options for configuring a Time instance.

inheritance

extends:
  • CellOptions<typeof TimeJson>

interval

Interval in milliseconds for updating now.

type number

autostart

Whether to automatically start the timer on initialization.

type boolean

TimeValue
#

TimeWidget
#

to_action_spec_identifier
#

action_helpers.ts view source

(method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): string

method

type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"

returns

string

to_action_spec_input_identifier
#

action_helpers.ts view source

(method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): string

method

type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"

returns

string

to_action_spec_output_identifier
#

action_helpers.ts view source

(method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): string

method

type "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"

returns

string

to_chats_url
#

nav_helpers.ts view source

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

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: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { type: "claude"; value: any; } | { ...; } | { ...; }; } | null | undefined): string | null

Extracts the text content from a completion response

completion_response

type { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { type: "claude"; value: any; } | { ...; } | { ...; }; } | null | undefined

returns

string | null

to_completion_result
#

response_helpers.ts view source

(provider_name: "ollama" | "claude" | "chatgpt" | "gemini", model: string, api_response: unknown, progress_token?: (string & $brand<"Uuid">) | undefined): { completion_response: { ...; }; _meta?: { ...; } | undefined; }

Creates a standardized completion response message from provider-specific responses.

provider_name

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

model

type string

api_response

type unknown

progress_token?

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

returns

{ completion_response: { created: string & $brand<"Datetime">; provider_name: "ollama" | "claude" | "chatgpt" | "gemini"; model: string; data: { type: "ollama"; value: any; } | { ...; } | { ...; } | { ...; }; }; _meta?: { ...; } | undefined; }

to_jsonrpc_message_id
#

to_jsonrpc_params
#

jsonrpc_helpers.ts view source

(input: unknown): Record<string, any> | undefined

Normalizes input to JSON-RPC params format. Returns undefined for null/undefined, wraps primitives in {value}.

input

type unknown

returns

Record<string, any> | undefined

to_jsonrpc_result
#

jsonrpc_helpers.ts view source

(output: unknown): Record<string, any>

Normalizes output to JSON-RPC result format. Returns empty object for null/undefined, wraps primitives in {value}.

output

type unknown

returns

Record<string, any>

to_nav_link_href
#

to_preview
#

helpers.ts view source

(content: string | null | undefined, max_length?: number): string

content

type string | null | undefined

max_length

type number
default CONTENT_PREVIEW_LENGTH

returns

string

to_prompts_url
#

nav_helpers.ts view source

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

chat_id

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

returns

string

to_relative_path
#

to_reordered_list
#

list_helpers.ts view source

<T>(items: T[], from_index: number, to_index: number): T[]

Creates a new reordered array without modifying the original.

items

type T[]

from_index

type number

to_index

type number

returns

T[]

to_serializable_disknode
#

diskfile_helpers.ts view source

(disknode: Disknode, dir: string): { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">; ... 4 more ...; dependencies: [...][]; }

disknode

type Disknode

dir

type string

returns

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

to_subschema
#

zod_helpers.ts view source

(def: $ZodTypeDef): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined

Helper to extract subschema from a Zod def, following Zod 4 patterns.

def

type $ZodTypeDef

returns

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

toggle_main_menu_action_spec
#

action_specs.ts view source

{ method: "toggle_main_menu"; kind: "local_call"; initiator: "frontend"; auth: null; side_effects: true; input: ZodOptional<ZodObject<{ show: ZodOptional<ZodBoolean>; }, $strict>>; output: ZodObject<...>; async: false; }

ToggleButton
#

ToggleButton.svelte view source

active

Current state of the toggle

type boolean
bindable

active_content

Content to display when toggle is active

type Snippet | string

inactive_content

Content to display when toggle is inactive

type Snippet | string

TOP_K_DEFAULT
#

TOP_P_DEFAULT
#

TransitionFunction
#

Transport
#

TransportName
#

Transports
#

transports.ts view source

allow_fallback

Whether to allow fallback to other transports if the current one is not available.

type boolean

register_transport

Registers a transport.

type (transport: Transport): void

transport
returns void

set_current_transport

type (transport_name: string): void

transport_name
type string
returns void

get_transport

Gets either the current transport or the first ready transport depending on allow_fallback, or throws an error.

type (transport_name?: string | undefined): Transport | null

transport_name?

Optional transport to use instead of the current

type string | undefined
optional
returns Transport | null
throws
  • when - no transport available or ready

is_ready

type (): boolean | null

returns boolean | null

get_current_transport

type (): Transport | null

returns Transport | null

get_current_transport_name

type (): string | null

returns string | null

get_transport_by_name

type (transport_name: string): Transport | null

transport_name
type string
returns Transport | null

Turn
#

turn.svelte.ts view source

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>

thread_id

type Uuid | null | undefined

role

type CompletionRole

request

type CompletionRequest | undefined

response

type CompletionResponse | undefined

error_message

type string | undefined

parts

type Array<PartUnion>

readonly

length

type number

readonly

token_count

type number

readonly

raw_content

type string | null | undefined

readonly

is_content_loaded

type boolean

readonly

is_content_empty

type boolean

readonly

pending

type boolean

readonly

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

TurnContextmenu
#

TurnJson
#

turn_types.ts view source

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

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: "ollama" | ... 2 more ... | "gemini"; model: string; prompt: string; created?: string | undefined; completion_message...

TurnList
#

TurnListitem
#

TurnOptions
#

TurnSchema
#

turn_types.ts view source

ZodCustom<Cell<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>, Cell<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>>

TurnView
#

TutorialForChats
#

TutorialForDatabase
#

TutorialForDiskfiles
#

TutorialForPrompts
#

TypeLiteral
#

Ui
#

ui.svelte.ts view source

inheritance

extends:
  • Cell<typeof UiJson>

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

pending_element_to_focus_key

Consumed by components like ContentEditor for focusing elements.

type string | number | null

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

UiJson
#

ui.svelte.ts view source

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

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; tutorial_for_chats?: boolean | undefined; tutorial_for_prompts?: boolean | undefined; tutorial_for_diskfiles?...

UiOptions
#

UNKNOWN_ERROR_MESSAGE
#

update_env_variable
#

server/env_file_helpers.ts view source

(key: string, value: string, options?: UpdateEnvVariableOptions): Promise<void>

Updates or adds an environment variable in the .env file. Preserves existing formatting, comments, and other variables.

Behavior: - Duplicate keys: Updates the LAST occurrence (matches dotenv behavior) - Inline comments: Preserved after the value (e.g., KEY=value # comment) - Quote style: Preserved from original (quoted/unquoted)

key

- The environment variable name (e.g., 'SOME_CONFIGURATION_KEY')

type string

value

- The new value for the environment variable

type string

options

- Optional configuration for file path and operations

default {}

returns

Promise<void>

UpdateEnvVariableOptions
#

server/env_file_helpers.ts view source

UpdateEnvVariableOptions

Options for updating environment variables in a .env file.

env_file_path

Path to the .env file (defaults to ./.env)

type string

read_file

Function to read file contents (defaults to node:fs/promises readFile)

type (path: string, encoding: string) => Promise<string>

write_file

Function to write file contents (defaults to node:fs/promises writeFile)

type (path: string, content: string, encoding: string) => Promise<void>

Uuid
#

UuidWithDefault
#

validate_phase_for_kind
#

action_event_helpers.ts view source

(kind: "request_response" | "remote_notification" | "local_call", phase: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"): void

kind

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

phase

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"

returns

void

validate_phase_transition
#

action_event_helpers.ts view source

(from: "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute", to: "send_request" | "receive_request" | ... 6 more ... | "execute"): void

from

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"

to

type "send_request" | "receive_request" | "send_response" | "receive_response" | "send_error" | "receive_error" | "send" | "receive" | "execute"

returns

void

validate_reorderable_target_index
#

reorderable_helpers.ts view source

(target_index: number, max_index: number): number

Validate and adjust a target index to ensure it's within bounds

target_index

type number

max_index

type number

returns

number

validate_step_transition
#

action_event_helpers.ts view source

(from: "initial" | "parsed" | "handling" | "handled" | "failed", to: "initial" | "parsed" | "handling" | "handled" | "failed"): void

from

type "initial" | "parsed" | "handling" | "handled" | "failed"

to

type "initial" | "parsed" | "handling" | "handled" | "failed"

returns

void

ValueParser
#

cell_helpers.ts view source

ValueParser<TSchema, TKey>

generics

TSchema

constraint z.ZodType

TKey

constraint keyof z.infer<TSchema>
default keyof z.infer<TSchema>

verify_request_source
#

server/security.ts view source

(allowed_patterns: RegExp[]): Handler

Middleware that verifies the request source against an allowlist.

NOT a CSRF protection - this is a simple origin/referer check that: - Checks the Origin header first (if present) - Falls back to Referer header (if no Origin) - Allows requests without Origin/Referer headers (direct access, curl, etc.)

This is useful for: - Protecting locally-running services from being called by untrusted websites as the user browses the web - Restricting which domains can make requests to your API - Preventing embedding of your service in unexpected sites - Basic source verification (but NOT security-critical CSRF protection)

allowed_patterns

- Array of compiled regex patterns from parse_allowed_origins

type RegExp[]

returns

Handler

VocabName
#

WEBSOCKET_PATH
#

WEBSOCKET_URL
#

WEBSOCKET_URL_OBJECT
#

WebsocketCapabilityData
#

capabilities.svelte.ts view source

WebsocketCapabilityData

url

type string | null

connected

type boolean

reconnect_count

type number

last_connect_time

type number | null

last_send_time

type number | null

last_receive_time

type number | null

connection_duration

type number | null

pending_pings

type number

XmlAttribute
#

xml.ts view source

ZodObject<{ id: $ZodBranded<ZodUUID, "Uuid">; key: ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>; value: ZodString; }, $strict>

XmlAttributeEditor
#

XmlAttributeKey
#

xml.ts view source

ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>

XmlAttributeKeyWithDefault
#

xml.ts view source

ZodDefault<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>

XmlAttributeValue
#

XmlAttributeValueWithDefault
#

XmlAttributeWithDefaults
#

xml.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; key: ZodDefault<ZodPipe<ZodPipe<ZodString, ZodTransform<string, string>>, ZodString>>; value: ZodDefault<...>; }, $strict>

XmlTagControls
#

zod_get_schema_keys
#

zod_helpers.ts view source

<T extends z.ZodType>(schema: T): SchemaKeys<T>[]

Gets all property keys from a Zod object schema.

schema

type T

returns

SchemaKeys<T>[]

ZZZ_DIR
#

ZZZ_DIR_CACHE
#

ZZZ_DIR_RUN
#

ZZZ_DIR_STATE
#

ZZZ_DIR_STATE_COMPLETIONS
#

ZZZ_SCOPED_DIRS
#

constants.ts view source

string[]

Comma-separated list of filesystem paths that Zzz can access. Empty array means no scoped filesystem access.

ZzzConfig
#

config_helpers.ts view source

ZzzConfig

providers

type Array<ProviderJsonInput>

models

type Array<ModelJsonInput>

system_message

type string

output_token_max

type number

temperature

type number | undefined

seed

type number | undefined

top_k

type number | undefined

top_p

type number | undefined

frequency_penalty

type number | undefined

presence_penalty

type number | undefined

stop_sequences

type Array<string> | undefined

bots

type { /** * Names things. */ namerbot: ModelName; }

ZzzConfigCreator
#