MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveWorkflowAliasPath

Function resolveWorkflowAliasPath

apps/sim/lib/copilot/vfs/workflow-aliases.ts:249–264  ·  view source on GitHub ↗
(
  path: string,
  workflows: WorkflowAliasWorkflow[]
)

Source from the content-addressed store, hash-verified

247}
248
249export function resolveWorkflowAliasPath(
250 path: string,
251 workflows: WorkflowAliasWorkflow[]
252): WorkflowAliasTarget | null {
253 const normalizedPath = path.trim().replace(/^\/+|\/+$/g, '')
254 if (!normalizedPath.startsWith('workflows/')) return null
255
256 const bySpecificity = [...workflows].sort(
257 (a, b) => workflowVfsPath(b).length - workflowVfsPath(a).length
258 )
259 for (const workflow of bySpecificity) {
260 const target = workflowAliasTargetForPath(workflow, normalizedPath)
261 if (target) return target
262 }
263 return null
264}
265
266export function isWorkflowAliasPath(path: string): boolean {
267 const normalizedPath = path.trim().replace(/^\/+|\/+$/g, '')

Callers 3

HomeFunction · 0.90

Calls 3

workflowVfsPathFunction · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected