CodingBootstrap
public final class CodingBootstrap
io/agentscope/harness/coding/CodingBootstrap.java:87–781Coding Bootstrap,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.coding 包。核心成员包括 builder、loadConfig、loadConfigFile、chatUiChannel、start、stop。
Single API class for assembling, configuring, and running the agentscope harness.
Build phase — #builder()
Loads ~/.agentscope/codingagent/agentscope.json (the per-app home, isolated from other
harness apps and from the cwd the JVM was launched in), merges file-based agent definitions with
programmatic Builder configuration, and produces HarnessAgent instances wired
with SessionsTool and a shared SessionAgentManager + HarnessGateway.
Runtime phase — two entry points
-
#chatUiChannel()— obtain aChatUiChannelfor direct programmatic interaction (embedded UIs, CLIs, tests). Ready immediately; no#start()required. -
#start()— initialize and start all pre-registered channel adapters.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | 构建器,用于构建并配置目标实例。 A class in io.agentscope.harness.coding that deploys, schedules and serves agents. |
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
DEFAULT_WORKSPACE_ROOTstaticfinal | Path | 默认工作区根字段。 Default workspace root for every coding-agent instance. |
DEFAULT_CONFIG_PATHstaticfinal | Path | 默认配置路径字段。 Default location of the `agentscope.json` config file. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Builder builder()static | 返回构建器实例。 Returns the builder. |
public static AgentscopeConfig loadConfig() throws IOExceptionstatic | 加载配置。 Loads the config. |
public static AgentscopeConfig loadConfigFile(Path configPath) throws IOExceptionstatic | 加载配置文件。 Loads the config file. |
public ChatUiChannel chatUiChannel() | 返回聊天 Ui 渠道。 Returns the chat ui channel. |
public ChatUiChannel chatUiChannel(ChannelConfig config) | 设置聊天 Ui 渠道。 Performs the chat ui channel operation. |
public CodingBootstrap start() | 返回启动。 Returns the start. |
public void start(Channel... channels) | 设置启动。 Performs the start operation. |
public void stop() | 执行停止相关操作。 Stops all channels managed by the channel manager. |
public HarnessGateway gateway() | 返回网关。 Returns the gateway. |
public ChannelManager channelManager() | 返回渠道管理器。 The channel manager for channel lifecycle and outbound delivery. |
字段详情Field Detail
DEFAULT_WORKSPACE_ROOT
public static final Path DEFAULT_WORKSPACE_ROOT
默认工作区根字段。声明为 public static final Path DEFAULT_WORKSPACE_ROOT。
Default workspace root for every coding-agent instance.
io/agentscope/harness/coding/CodingBootstrap.java:98–99DEFAULT_CONFIG_PATH
public static final Path DEFAULT_CONFIG_PATH
默认配置路径字段。声明为 public static final Path DEFAULT_CONFIG_PATH。
Default location of the agentscope.json config file.
io/agentscope/harness/coding/CodingBootstrap.java:106–111方法详情Method Detail
builder
public static Builder builder()
返回构建器实例。
Returns the builder.
Builderio/agentscope/harness/coding/CodingBootstrap.java:150–152loadConfig
public static AgentscopeConfig loadConfig() throws IOException
加载配置。
Loads the config.
AgentscopeConfigIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.
io/agentscope/harness/coding/CodingBootstrap.java:154–156loadConfigFile
public static AgentscopeConfig loadConfigFile(Path configPath) throws IOException
加载配置文件。
Loads the config file.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
configPath | Path | 配置路径(类型 `Path`)。The config path. |
AgentscopeConfigIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.
io/agentscope/harness/coding/CodingBootstrap.java:158–166chatUiChannel
public ChatUiChannel chatUiChannel()
返回聊天 Ui 渠道。
Returns the chat ui channel.
ChatUiChannelio/agentscope/harness/coding/CodingBootstrap.java:172–174chatUiChannel
public ChatUiChannel chatUiChannel(ChannelConfig config)
设置聊天 Ui 渠道。
Performs the chat ui channel operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | ChannelConfig | 配置对象(类型 `ChannelConfig`)。The config. |
ChatUiChannelio/agentscope/harness/coding/CodingBootstrap.java:176–178start
public CodingBootstrap start()
返回启动。
Returns the start.
CodingBootstrapio/agentscope/harness/coding/CodingBootstrap.java:180–183start
public void start(Channel... channels)
设置启动。
Performs the start operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channels varargs | Channel... | 渠道(类型 `Channel...`)。The channels. |
io/agentscope/harness/coding/CodingBootstrap.java:185–204stop
public void stop()
执行停止相关操作。
Stops all channels managed by the channel manager.
io/agentscope/harness/coding/CodingBootstrap.java:207–211gateway
public HarnessGateway gateway()
返回网关。
Returns the gateway.
HarnessGatewayio/agentscope/harness/coding/CodingBootstrap.java:249–251channelManager
public ChannelManager channelManager()
返回渠道管理器。
The channel manager for channel lifecycle and outbound delivery.
ChannelManagerio/agentscope/harness/coding/CodingBootstrap.java:254–256嵌套类详情Nested Class Detail
Builder
public static final class Builder构建器,用于构建并配置目标实例。位于 io.agentscope.harness.coding 包。核心成员包括 cwd、configPath、skipConfigFile、model、abstractFilesystem、mainAgent。
A class in io.agentscope.harness.coding that deploys, schedules and serves agents. Declared in io.agentscope.harness.coding.