AS AgentScopeAPI 手册 / API Reference

SharedWorkspacePaths

public final class SharedWorkspacePaths
源码Source io/agentscope/builder/web/workspace/SharedWorkspacePaths.java:29–103

共享工作区 Paths,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.workspace 包。核心成员包括 resolveSessionDataPath、workspaceRoot、resolveAgentDataPath、SharedWorkspacePaths。

Resolves on-disk paths derived from the platform-wide shared workspace root, without composing any filesystem instances. Owning the routing/composition responsibility is the harness; this utility only exists so platform features that need a stable side-channel directory (notably the per-user marketplaces git-clone cache and per-agent workspace scaffolding) can derive a predictable path without reinventing the layout.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SharedWorkspacePaths(Path workspaceRoot)
初始化 `SharedWorkspacePaths` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public Path resolveSessionDataPath(String ownerId, String sessionId)
解析会话数据路径。
Stable, non-user-controlled directory for a single authenticated session.
public Path workspaceRoot()
返回工作区根。
Returns the workspace root.
public Path resolveAgentDataPath(String workspacePath, String fallbackAgentId)
解析智能体数据路径。
Resolves the user-supplied workspace path for an agent into an absolute on-disk data root.

构造器详情Constructor Detail

SharedWorkspacePaths

public SharedWorkspacePaths(Path workspaceRoot)

初始化 SharedWorkspacePaths 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
workspaceRootPath工作区根(类型 `Path`)。The workspace root.
源码Source io/agentscope/builder/web/workspace/SharedWorkspacePaths.java:33–35

方法详情Method Detail

resolveSessionDataPath

public Path resolveSessionDataPath(String ownerId, String sessionId)

解析会话数据路径。

Stable, non-user-controlled directory for a single authenticated session.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns Path
返回路径。Returns path.
源码Source io/agentscope/builder/web/workspace/SharedWorkspacePaths.java:42–64

workspaceRoot

public Path workspaceRoot()

返回工作区根。

Returns the workspace root.

返回Returns Path
返回路径。Returns path.
源码Source io/agentscope/builder/web/workspace/SharedWorkspacePaths.java:66–68

resolveAgentDataPath

public Path resolveAgentDataPath(String workspacePath, String fallbackAgentId)

解析智能体数据路径。

Resolves the user-supplied workspace path for an agent into an absolute on-disk data root.

参数Parameters
名称Name类型Type说明Description
workspacePathString工作区路径(类型 `String`)。The workspace path.
fallbackAgentIdString回退智能体标识(类型 `String`)。The fallback agent id.
返回Returns Path
返回路径。Returns path.
源码Source io/agentscope/builder/web/workspace/SharedWorkspacePaths.java:82–102
基于官方固定版本源码静态生成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.