AS AgentScopeAPI 手册 / API Reference

CollaborationClient

public final class CollaborationClient
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:34–546

Collaboration 客户端,封装与远端服务的连接和调用。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 issue、comments、addComment、team、requestApproval、awaitRuntimeToolApproval。

Issue/Comment/AgentTask client shared by Java external-agent runtimes.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
RuntimeApprovalDecision记录record
承载运行时 Approval 决策数据的记录类型。
A record in io.agentscope.extensions.aistio.transport that carries data used when components deploys, schedules and serves agents.
CollaborationHttpException类class
Collaboration HTTP 异常,表示执行过程中的错误。
Non-2xx response from the collaboration API.

构造器摘要Constructor Summary

构造器Constructor说明Description
public CollaborationClient(ControlPlaneHttpClient http)
初始化 `CollaborationClient` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public JsonNode issue(String issueId, String token)
执行 `issue` 方法。
Performs the issue operation.
public JsonNode comments(String issueId, String token)
执行 `comments` 方法。
Performs the comments operation.
public JsonNode addComment(String issueId, String token, String content, List<Map<String, String>> mentions, String parentId)
添加 `addComment`。
Adds the comment.
public JsonNode team(String teamId, String token)
执行团队相关操作。
Performs the team operation.
public JsonNode requestApproval(String token, Object request)
执行 `requestApproval` 方法。
Performs the request approval operation.
public RuntimeApprovalDecision awaitRuntimeToolApproval(String taskId, String token, String toolUseId, String toolName, Object inputPreview)
执行 `awaitRuntimeToolApproval` 方法。
Requests a fenced runtime tool decision and blocks without holding control-plane threads.
public JsonNode workspaceApplied(String taskId, String token, String digest)
执行 `workspaceApplied` 方法。
Performs the workspace applied operation.
public JsonNode taskContext(String taskId, String token)
执行任务上下文相关操作。
Performs the task context operation.
public JsonNode tools(String taskId, String token)
执行工具相关操作。
Returns the canonical task-scoped collaboration tools advertised by the control plane.
public JsonNode callTool(String taskId, String token, String toolName, Map<String, Object> arguments)
调用工具。
Invokes one canonical task-scoped collaboration tool through the control-plane MCP.
public JsonNode callTool(String taskId, String token, String toolName, Map<String, Object> arguments, String toolCallId)
调用工具。
Invokes a tool while preserving the framework call identity for diagnostics.
public JsonNode createChild(String taskId, String token, Object request)
创建子级。
Creates the child.
public JsonNode acknowledge(String taskId, String token, List<String> inputIds)
执行 `acknowledge` 方法。
Performs the acknowledge operation.
public JsonNode start(String taskId, String token, long expectedVersion)
执行启动相关操作。
Performs the start operation.
public JsonNode progress(String taskId, String token, String content)
执行 `progress` 方法。
Performs the progress operation.
public JsonNode respond(String taskId, String token, String content)
执行 `respond` 方法。
Performs the respond operation.
public JsonNode complete(String taskId, String token, long expectedVersion, String summary, Object result, List<String> processedInputIds, List<String> deferredInputIds)
执行 `complete` 方法。
Performs the complete operation.
public JsonNode finish(String taskId, String token, long expectedVersion, String outcome, String reason, Object result, List<String> processedInputIds, List<String> deferredInputIds)
执行 `finish` 方法。
Submit an explicit business outcome; the server preserves partial results on failure.
public JsonNode fail(String taskId, String token, long expectedVersion, String code, String message)
执行 `fail` 方法。
Performs the fail operation.
public JsonNode run(String taskId, String token)
执行运行相关操作。
Performs the run operation.
public JsonNode runGraph(String taskId, String token)
运行图。
Runs the graph.
public JsonNode completeRunNode(String taskId, String token, Object output)
执行 `completeRunNode` 方法。
Performs the complete run node operation.
public JsonNode failRunNode(String taskId, String token, String code, String message)
执行 `failRunNode` 方法。
Performs the fail run node operation.
public JsonNode replanRun(String taskId, String token, Object node)
执行 `replanRun` 方法。
Performs the replan run operation.
public JsonNode signalRun(String taskId, String token, String name, String idempotencyKey, Object payload)
执行 `signalRun` 方法。
Performs the signal run operation.
public JsonNode runArtifacts(String taskId, String token)
运行 `runArtifacts`。
Runs the artifacts.
public JsonNode uploadArtifact(String taskId, String token, String filename, String contentType, byte[] content, String targetType, String targetRef)
执行 `uploadArtifact` 方法。
Uploads shared bytes; local runtime paths never cross the collaboration boundary.
public byte[] downloadArtifact(String artifactId, String taskId, String token)
执行 `downloadArtifact` 方法。
Performs the download artifact operation.

构造器详情Constructor Detail

CollaborationClient

public CollaborationClient(ControlPlaneHttpClient http)

初始化 CollaborationClient 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
httpControlPlaneHttpClientHTTP(类型 `ControlPlaneHttpClient`)。The http.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:39–41

方法详情Method Detail

issue

public JsonNode issue(String issueId, String token)

执行 issue 方法。

Performs the issue operation.

参数Parameters
名称Name类型Type说明Description
issueIdStringissue 标识(类型 `String`)。The issue id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:43–50

comments

public JsonNode comments(String issueId, String token)

执行 comments 方法。

Performs the comments operation.

参数Parameters
名称Name类型Type说明Description
issueIdStringissue 标识(类型 `String`)。The issue id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:52–59

addComment

public JsonNode addComment(String issueId, String token, String content, List<Map<String, String>> mentions, String parentId)

添加 addComment。

Adds the comment.

参数Parameters
名称Name类型Type说明Description
issueIdStringissue 标识(类型 `String`)。The issue id.
tokenString令牌(类型 `String`)。The token.
contentString内容(类型 `String`)。The content.
mentionsList<Map<String, String>>mentions(类型 `List >`)。The mentions.
parentIdString父级标识(类型 `String`)。The parent id.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:61–76

team

public JsonNode team(String teamId, String token)

执行团队相关操作。

Performs the team operation.

参数Parameters
名称Name类型Type说明Description
teamIdString团队标识(类型 `String`)。The team id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:78–85

requestApproval

public JsonNode requestApproval(String token, Object request)

执行 requestApproval 方法。

Performs the request approval operation.

参数Parameters
名称Name类型Type说明Description
tokenString令牌(类型 `String`)。The token.
requestObject请求(类型 `Object`)。The request.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:87–94

awaitRuntimeToolApproval

public RuntimeApprovalDecision awaitRuntimeToolApproval(String taskId, String token, String toolUseId, String toolName, Object inputPreview)

执行 awaitRuntimeToolApproval 方法。

Requests a fenced runtime tool decision and blocks without holding control-plane threads.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
toolUseIdString工具使用标识(类型 `String`)。The tool use id.
toolNameString工具名称(类型 `String`)。The tool name.
inputPreviewObject输入预览(类型 `Object`)。The input preview.
返回Returns RuntimeApprovalDecision
返回RuntimeApprovalDecision。Returns runtime approval decision.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:97–147

workspaceApplied

public JsonNode workspaceApplied(String taskId, String token, String digest)

执行 workspaceApplied 方法。

Performs the workspace applied operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
digestStringdigest(类型 `String`)。The digest.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:152–160

taskContext

public JsonNode taskContext(String taskId, String token)

执行任务上下文相关操作。

Performs the task context operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:162–164

tools

public JsonNode tools(String taskId, String token)

执行工具相关操作。

Returns the canonical task-scoped collaboration tools advertised by the control plane.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:167–169

callTool

public JsonNode callTool(String taskId, String token, String toolName, Map<String, Object> arguments)

调用工具。

Invokes one canonical task-scoped collaboration tool through the control-plane MCP.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
toolNameString工具名称(类型 `String`)。The tool name.
argumentsMap<String, Object>参数(类型 `Map`)。The arguments.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:172–175

callTool

public JsonNode callTool(String taskId, String token, String toolName, Map<String, Object> arguments, String toolCallId)

调用工具。

Invokes a tool while preserving the framework call identity for diagnostics.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
toolNameString工具名称(类型 `String`)。The tool name.
argumentsMap<String, Object>参数(类型 `Map`)。The arguments.
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:178–191

createChild

public JsonNode createChild(String taskId, String token, Object request)

创建子级。

Creates the child.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
requestObject请求(类型 `Object`)。The request.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:193–195

acknowledge

public JsonNode acknowledge(String taskId, String token, List<String> inputIds)

执行 acknowledge 方法。

Performs the acknowledge operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
inputIdsList<String>输入 Ids(类型 `List`)。The input ids.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:197–199

start

public JsonNode start(String taskId, String token, long expectedVersion)

执行启动相关操作。

Performs the start operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
expectedVersionlongexpected 版本(类型 `long`)。The expected version.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:201–209

progress

public JsonNode progress(String taskId, String token, String content)

执行 progress 方法。

Performs the progress operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
contentString内容(类型 `String`)。The content.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:211–214

respond

public JsonNode respond(String taskId, String token, String content)

执行 respond 方法。

Performs the respond operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
contentString内容(类型 `String`)。The content.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:216–224

complete

public JsonNode complete(String taskId, String token, long expectedVersion, String summary, Object result, List<String> processedInputIds, List<String> deferredInputIds)

执行 complete 方法。

Performs the complete operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
expectedVersionlongexpected 版本(类型 `long`)。The expected version.
summaryString摘要(类型 `String`)。The summary.
resultObject结果(类型 `Object`)。The result.
processedInputIdsList<String>processed 输入 Ids(类型 `List`)。The processed input ids.
deferredInputIdsList<String>deferred 输入 Ids(类型 `List`)。The deferred input ids.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:226–248

finish

public JsonNode finish(String taskId, String token, long expectedVersion, String outcome, String reason, Object result, List<String> processedInputIds, List<String> deferredInputIds)

执行 finish 方法。

Submit an explicit business outcome; the server preserves partial results on failure.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
expectedVersionlongexpected 版本(类型 `long`)。The expected version.
outcomeStringoutcome(类型 `String`)。The outcome.
reasonString原因(类型 `String`)。The reason.
resultObject结果(类型 `Object`)。The result.
processedInputIdsList<String>processed 输入 Ids(类型 `List`)。The processed input ids.
deferredInputIdsList<String>deferred 输入 Ids(类型 `List`)。The deferred input ids.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:251–279

fail

public JsonNode fail(String taskId, String token, long expectedVersion, String code, String message)

执行 fail 方法。

Performs the fail operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
expectedVersionlongexpected 版本(类型 `long`)。The expected version.
codeStringcode(类型 `String`)。The code.
messageString消息(类型 `String`)。The message.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:281–293

run

public JsonNode run(String taskId, String token)

执行运行相关操作。

Performs the run operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:295–297

runGraph

public JsonNode runGraph(String taskId, String token)

运行图。

Runs the graph.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:299–301

completeRunNode

public JsonNode completeRunNode(String taskId, String token, Object output)

执行 completeRunNode 方法。

Performs the complete run node operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
outputObject输出(类型 `Object`)。The output.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:303–311

failRunNode

public JsonNode failRunNode(String taskId, String token, String code, String message)

执行 failRunNode 方法。

Performs the fail run node operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
codeStringcode(类型 `String`)。The code.
messageString消息(类型 `String`)。The message.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:313–321

replanRun

public JsonNode replanRun(String taskId, String token, Object node)

执行 replanRun 方法。

Performs the replan run operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
nodeObject节点(类型 `Object`)。The node.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:323–325

signalRun

public JsonNode signalRun(String taskId, String token, String name, String idempotencyKey, Object payload)

执行 signalRun 方法。

Performs the signal run operation.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
nameString名称(类型 `String`)。The name.
idempotencyKeyStringidempotency 键(类型 `String`)。The idempotency key.
payloadObject负载(类型 `Object`)。The payload.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:327–340

runArtifacts

public JsonNode runArtifacts(String taskId, String token)

运行 runArtifacts。

Runs the artifacts.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:342–344

uploadArtifact

public JsonNode uploadArtifact(String taskId, String token, String filename, String contentType, byte[] content, String targetType, String targetRef)

执行 uploadArtifact 方法。

Uploads shared bytes; local runtime paths never cross the collaboration boundary.

参数Parameters
名称Name类型Type说明Description
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
filenameStringfilename(类型 `String`)。The filename.
contentTypeString内容类型(类型 `String`)。The content type.
contentbyte[]内容(类型 `byte[]`)。The content.
targetTypeString目标类型(类型 `String`)。The target type.
targetRefString目标引用(类型 `String`)。The target ref.
返回Returns JsonNode
返回JsonNode。Returns json node.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:347–395

downloadArtifact

public byte[] downloadArtifact(String artifactId, String taskId, String token)

执行 downloadArtifact 方法。

Performs the download artifact operation.

参数Parameters
名称Name类型Type说明Description
artifactIdStringartifact 标识(类型 `String`)。The artifact id.
taskIdString任务标识(类型 `String`)。The task id.
tokenString令牌(类型 `String`)。The token.
返回Returns byte[]
返回byte[]。Returns byte.
源码Source io/agentscope/extensions/aistio/transport/CollaborationClient.java:397–422

嵌套类详情Nested Class Detail

RuntimeApprovalDecision

public record RuntimeApprovalDecision( String approvalId, long decisionVersion, boolean allow, String denyMessage)

承载运行时 Approval 决策数据的记录类型。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 approvalId、decisionVersion、allow、denyMessage。

A record in io.agentscope.extensions.aistio.transport that carries data used when components deploys, schedules and serves agents. Declared in io.agentscope.extensions.aistio.transport.

CollaborationHttpException

public static final class CollaborationHttpException extends RuntimeException

Collaboration HTTP 异常,表示执行过程中的错误。位于 io.agentscope.extensions.aistio.transport 包,继承自 RuntimeException。核心成员包括 status、responseBody、CollaborationHttpException。

Non-2xx response from the collaboration API.

基于官方固定版本源码静态生成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.