产品介绍

Bootstrap

prepare_runtime is the shared entry point for CLI, REST, and SDK hosts. Its stages run in a fixed order.

flowchart LR
  A[Resolve Home and IDs] --> B[Optionally initialize Home]
  B --> C[Load environment]
  C --> D[Merge configuration]
  D --> E[Select read-only inputs]
  E --> F[Locate extensions]
  F --> G[Read MCP declarations]
  G --> H[PreparedRuntime]

Home

The CLI enables init_home. The SDK is read-only by default; explicitly pass LaunchOptions(init_home=True) when templates should be written. Initialization preserves existing files. See path resolution and session bindings for stages and directories. An explicit --config removes the need to write a Home configuration template.

Environment and configuration

Bootstrap selects the environment file and product configuration file independently, applies configuration layers, and prepares plugin and input bindings from the merged result. See environment variables and configuration merging for file selection and precedence.

The default model's $env{...} references expand after merging. The environment snapshot used for expansion retains only variable names referenced by model fields and already present at that time.

Inputs

Default input directories come from dataagent.input_workspaces in the selected YAML. Resuming a session uses the input binding already saved for it in sessions.sqlite.

Every path must be a readable directory. Names and paths must both be unique.

Extension locations

locate_extensions collects:

  • Built-in plugin directories in the package and plugin directories under Home plugins/.
  • Home skills/ with the source label User.
  • Hooks from every configuration layer, retaining each layer's directory.

This step imports no Python. The following stage reads MCP connections from Home and enabled plugin roots, expanding their environment references. Connection values enter PreparedRuntime; preparation does not connect to the services.

StartupReport records applied configuration files, plugin origins, and the explicitly selected environment-file path. It does not retain configuration bodies.

Refresh

refresh_extensions reads extension settings using the Home, explicit configuration, and environment file recorded in PreparedRuntime, returning a candidate runtime. The host publishes it after successful assembly. See extension lifecycle for scope and sequence.