Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

530 B
Raw Blame
export const resolveConsoleHumanInputFormURL = (backstageURL: string, basePath = ''): string => {
  try {
    const url = new URL(backstageURL, 'http://localhost')
    if (url.protocol !== 'http:' && url.protocol !== 'https:') return backstageURL

    const match = url.pathname.match(/(?:^|\/)form\/([^/]+)\/?$/)
    if (!match?.[1]) return backstageURL

    const token = encodeURIComponent(decodeURIComponent(match[1]))
    return `${basePath.replace(/\/$/, '')}/human-input/${token}`
  } catch {
    return backstageURL
  }
}