frontend.svelte.ts

Declarations
#

5 declarations

view source

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

frontend.svelte.ts view source

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

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

Depends on
#

Imported by
#