@fieldwangai/agentflow 0.1.60 → 0.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,8 @@ export function listAllRunDirs(workspaceRoot, opts = {}) {
28
28
  const root = path.resolve(workspaceRoot);
29
29
  const out = [];
30
30
  const seen = new Set();
31
+ const includeWorkspaceRuns = opts.includeWorkspaceRuns === true || !opts.userId;
32
+ const includeLegacyUserRuns = opts.includeLegacyUserRuns === true || !opts.userId;
31
33
  const add = (flowName, uuid, runDir, source) => {
32
34
  const key = `${flowName}\t${uuid}`;
33
35
  if (seen.has(key)) return;
@@ -64,7 +66,7 @@ export function listAllRunDirs(workspaceRoot, opts = {}) {
64
66
 
65
67
  // 新位置(优先)
66
68
  scanPipelinesDir(getUserPipelinesRoot(opts.userId), "user");
67
- scanPipelinesDir(path.join(root, PIPELINES_DIR), "workspace");
69
+ if (includeWorkspaceRuns) scanPipelinesDir(path.join(root, PIPELINES_DIR), "workspace");
68
70
 
69
71
  // 旧位置(兼容读)
70
72
  const scanLegacyRoot = (runBuildDir, source) => {
@@ -90,8 +92,8 @@ export function listAllRunDirs(workspaceRoot, opts = {}) {
90
92
  }
91
93
  }
92
94
  };
93
- scanLegacyRoot(getWorkspaceRunBuildRoot(root), "legacyWorkspaceRoot");
94
- scanLegacyRoot(getLegacyUserRunBuildRoot(), "legacyUserRoot");
95
+ if (includeWorkspaceRuns) scanLegacyRoot(getWorkspaceRunBuildRoot(root), "legacyWorkspaceRoot");
96
+ if (includeLegacyUserRuns) scanLegacyRoot(getLegacyUserRunBuildRoot(), "legacyUserRoot");
95
97
 
96
98
  return out;
97
99
  }