MCPcopy Create free account
hub / github.com/HKUDS/AgentSpace / getDaemonRemoteTaskWorkDirPath

Function getDaemonRemoteTaskWorkDirPath

packages/db/src/storage-paths.ts:76–88  ·  view source on GitHub ↗
(
  stateDir: string,
  input: {
    taskId: string;
    workspaceId?: string;
  },
)

Source from the content-addressed store, hash-verified

74}
75
76export function getDaemonRemoteTaskWorkDirPath(
77 stateDir: string,
78 input: {
79 taskId: string;
80 workspaceId?: string;
81 },
82): string {
83 return join(
84 getDaemonWorkspaceExecutionRootDir(stateDir, input.workspaceId ?? DEFAULT_WORKSPACE_ID),
85 "remote-workdirs",
86 sanitizeStoragePathSegment(input.taskId, "task"),
87 );
88}
89
90export function sanitizeStoragePathSegment(value: string, fallback = "item"): string {
91 const normalized = value.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "");

Callers 3

Tested by

no test coverage detected