For AI agents: the complete documentation index is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms.txt, the full documentation bundle is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms-full.txt, and this page is available as Markdown at https://scriptedalchemy.github.io/agent-bundle/zh/api/web-host.md.
跳至主要内容
  • 简体中文
  • Module: web-host

    Info

    API 参考仅提供英文版本;正文与英文站点相同。

    Interfaces

    ServeAppReadyLine

    Plain Node entry bundled into generated executables; do not add Effect or compiler imports (#564).

    Properties

    app

    readonly app: string

    tool

    readonly tool: string

    url

    readonly url: string


    WebCommandOptions

    Plain Node entry bundled into generated executables; do not import Effect or compiler modules (#564).

    Properties

    argv

    readonly argv: readonly string[]

    manifestPath

    readonly manifestPath: string

    name?

    readonly optional name?: string

    pageScript

    readonly pageScript: string

    pluginRoot

    readonly pluginRoot: string

    signal

    readonly signal: AbortSignal

    writeErr

    readonly writeErr: (text) => void

    Parameters
    text

    string

    Returns

    void

    writeOut

    readonly writeOut: (text) => void

    Parameters
    text

    string

    Returns

    void


    WebManifest

    Properties

    apps

    readonly apps: readonly WebManifestApp[]

    open

    readonly open: "browser" | "never"


    WebManifestApp

    Properties

    allow

    readonly allow: readonly ("call-tool" | "download-file" | "open-external-link" | "request-display-mode")[]

    app

    readonly app: string

    input?

    readonly optional input?: Readonly<Record<string, unknown>>

    name

    readonly name: string

    resourceUri

    readonly resourceUri: string

    server

    readonly server: string

    The configured server name; its launch is the executables.mcpServers[] row of that name.

    tool?

    readonly optional tool?: string

    Variables

    formatServeAppReadyLine

    const formatServeAppReadyLine: ({ app, tool, url }) => string

    The stdout line agent-bundle serve-app prints once the host is listening.

    Parameters

    { app, tool, url }

    ServeAppReadyLine

    Returns

    string


    parseServeAppReadyLine

    const parseServeAppReadyLine: (line) => ServeAppReadyLine | undefined

    The ready line's fields, or undefined for any other line of output.

    Parameters

    line

    string

    Returns

    ServeAppReadyLine | undefined


    parseWebManifest

    const parseWebManifest: (value) => WebManifest

    Parameters

    value

    unknown

    Returns

    WebManifest


    readWebManifest

    const readWebManifest: (manifestPath) => Promise<WebManifest | undefined>

    Parameters

    manifestPath

    string

    Returns

    Promise<WebManifest | undefined>


    runWebCommand

    const runWebCommand: (options, runtime?) => Promise<number>

    Parameters

    options

    WebCommandOptions

    runtime?

    WebCommandRuntime

    Returns

    Promise<number>


    WEB_HOST_TOKEN_HEADER

    const WEB_HOST_TOKEN_HEADER: "x-agent-bundle-web-host" = "x-agent-bundle-web-host"

    Shared header for a standalone host's per-launch credential.