mise API - v0.0.0
    Preparing search index...

    Interface Surface

    interface Surface {
        capabilities: SurfaceCapabilities;
        aside?<T>(waiting: Promise<T>): Promise<T>;
        fileDeliver(request: FileDeliverRequest): Promise<FileDeliverResult>;
        hold?(holds: string[] | "all"): Promise<() => void>;
        localEdit(request: LocalEditRequest): Promise<LocalEditResult>;
        peers?(): SurfacePeer[];
        pipeSegment(
            command: string,
            input: Buffer,
            signal?: AbortSignal,
        ): Promise<Buffer<ArrayBufferLike>>;
        prompt(request: PromptRequest): Promise<string>;
        shellCommand(command: string, signal?: AbortSignal): Promise<number>;
    }

    Implemented by

    Index
    capabilities: SurfaceCapabilities

    What this surface can do; read by builtins before they interact.

    • Waits without holding the session: the command steps out of its turn while the wait lasts, so other lines run (a pane's reads among them), and takes its turn again before going on. Waiting is not working. A host that runs one command at a time and nothing else has no need of it; the command then simply waits.

      Type Parameters

      • T

      Parameters

      • waiting: Promise<T>

        What the command waits on (a task's next line).

      Returns Promise<T>

      What it resolved with.

    • Places one file where this surface's operator can reach it.

      The mechanics are the surface's: a write to the resolved path for the local CLI, a write on the client machine for a remote CLI, a saved file for a browser. A daemon never writes to its own disk on a surface's behalf, for the same reason it never spawns a shell there.

      Parameters

      Returns Promise<FileDeliverResult>

      Where it landed and how large it was.

      When the surface lacks fileDelivery.

    • Takes a hold on the session for work outside any line the host ran (a joblet): it waits until nothing running holds what the work changes, as a line does, and gives it back when released. A host that runs one line at a time and nothing else has no need of it.

      Parameters

      • holds: string[] | "all"

        The pieces the work changes, or 'all'.

      Returns Promise<() => void>

      Gives the hold back.

    • Opens content in the surface's local editor and returns the result. The editor mechanics are the surface's business — a temp file and $EDITOR for the local CLI, the client's editor for a remote CLI, an editor component in a browser.

      Parameters

      Returns Promise<LocalEditResult>

      The edited content and whether it changed.

      When the surface lacks the localEdit capability.

    • The surfaces attached to this session, when the host knows of more than itself (a daemon does; a local shell is alone). Absent means unknown.

      Returns SurfacePeer[]

    • Runs one pipeline segment against an input, returning its output. Where this runs is the surface's business — in-process for the local CLI, on the client machine for a remote CLI — but never on a daemon host.

      Parameters

      • command: string

        The segment command line (e.g. grep foo).

      • input: Buffer

        The bytes to feed the segment on stdin.

      • Optionalsignal: AbortSignal

        Aborted when the operator cancels the command; a surface that started a process kills it.

      Returns Promise<Buffer<ArrayBufferLike>>

      The segment's stdout.

      When the surface lacks the pipeSegments capability.

    • Prompts for a line of input.

      Parameters

      • request: PromptRequest

        The prompt message and whether to hide the input.

      Returns Promise<string>

      The entered line, trimmed.

      When hidden input is requested but the surface lacks the hiddenInput capability, or the surface cannot prompt.

    • Runs one host-shell command on the surface machine.

      Parameters

      • command: string

        The shell command without the leading !.

      • Optionalsignal: AbortSignal

        Aborted when the operator cancels the command; a surface that started a process kills it.

      Returns Promise<number>

      The process exit code.

      When the surface lacks shellCommands.