AS AgentScopeAPI 手册 / API Reference

CodingBootstrap

public final class CodingBootstrap
源码Source io/agentscope/harness/coding/CodingBootstrap.java:87–781

Coding 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 a ChatUiChannel for 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_ROOT
staticfinal
Path
默认工作区根字段。
Default workspace root for every coding-agent instance.
DEFAULT_CONFIG_PATH
staticfinal
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 IOException
static
加载配置。
Loads the config.
public static AgentscopeConfig loadConfigFile(Path configPath) throws IOException
static
加载配置文件。
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
staticfinal

默认工作区根字段。声明为 public static final Path DEFAULT_WORKSPACE_ROOT。

Default workspace root for every coding-agent instance.

源码Source io/agentscope/harness/coding/CodingBootstrap.java:98–99

DEFAULT_CONFIG_PATH

public static final Path DEFAULT_CONFIG_PATH
staticfinal

默认配置路径字段。声明为 public static final Path DEFAULT_CONFIG_PATH。

Default location of the agentscope.json config file.

源码Source io/agentscope/harness/coding/CodingBootstrap.java:106–111

方法详情Method Detail

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:150–152

loadConfig

public static AgentscopeConfig loadConfig() throws IOException
static

加载配置。

Loads the config.

返回Returns AgentscopeConfig
返回AgentscopeConfig。Returns agentscope config.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:154–156

loadConfigFile

public static AgentscopeConfig loadConfigFile(Path configPath) throws IOException
static

加载配置文件。

Loads the config file.

参数Parameters
名称Name类型Type说明Description
configPathPath配置路径(类型 `Path`)。The config path.
返回Returns AgentscopeConfig
返回AgentscopeConfig。Returns agentscope config.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:158–166

chatUiChannel

public ChatUiChannel chatUiChannel()

返回聊天 Ui 渠道。

Returns the chat ui channel.

返回Returns ChatUiChannel
返回ChatUiChannel。Returns chat ui channel.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:172–174

chatUiChannel

public ChatUiChannel chatUiChannel(ChannelConfig config)

设置聊天 Ui 渠道。

Performs the chat ui channel operation.

参数Parameters
名称Name类型Type说明Description
configChannelConfig配置对象(类型 `ChannelConfig`)。The config.
返回Returns ChatUiChannel
返回ChatUiChannel。Returns chat ui channel.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:176–178

start

public CodingBootstrap start()

返回启动。

Returns the start.

返回Returns CodingBootstrap
返回CodingBootstrap。Returns coding bootstrap.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:180–183

start

public void start(Channel... channels)

设置启动。

Performs the start operation.

参数Parameters
名称Name类型Type说明Description
channels varargsChannel...渠道(类型 `Channel...`)。The channels.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:185–204

stop

public void stop()

执行停止相关操作。

Stops all channels managed by the channel manager.

源码Source io/agentscope/harness/coding/CodingBootstrap.java:207–211

gateway

public HarnessGateway gateway()

返回网关。

Returns the gateway.

返回Returns HarnessGateway
返回HarnessGateway。Returns harness gateway.
源码Source io/agentscope/harness/coding/CodingBootstrap.java:249–251

channelManager

public ChannelManager channelManager()

返回渠道管理器。

The channel manager for channel lifecycle and outbound delivery.

返回Returns ChannelManager
返回ChannelManager。Returns channel manager.
源码Source io/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.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.