{"record":{"id":"8f9073806dafbdcb","repo":"langchain-ai/deepagents","slug":"please-enter-a-marketplace-source","errorCode":null,"errorMessage":"Please enter a marketplace source","messagePattern":"Please enter a marketplace source","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"warning","filePath":"libs/code/deepagents_code/plugins/marketplace.py","lineNumber":157,"sourceCode":"    )\n\n\ndef parse_marketplace_source(raw: str) -> MarketplaceSource:\n    \"\"\"Parse a user-provided marketplace source.\n\n    Args:\n        raw: GitHub shorthand, Git URL, marketplace JSON URL, file, or directory.\n\n    Returns:\n        Parsed marketplace source.\n\n    Raises:\n        MarketplaceError: If the source string is empty or unsupported.\n    \"\"\"\n    value = raw.strip()\n    if not value:\n        msg = \"Please enter a marketplace source\"\n        raise MarketplaceError(msg)\n\n    ssh_match = _SSH_GIT_RE.match(value)\n    if ssh_match:\n        return RepositoryMarketplaceSource(\n            source_type=\"git\", value=ssh_match.group(1), ref=ssh_match.group(2)\n        )\n\n    if value.startswith(\"http://\"):\n        msg = \"Remote marketplace sources must use https\"\n        raise MarketplaceError(msg)\n    if value.startswith(\"https://\"):\n        url, _, ref = value.partition(\"#\")\n        try:\n            parsed = urlparse(url)\n        except ValueError as exc:\n            msg = \"Invalid marketplace URL\"\n            raise MarketplaceError(msg) from exc\n        path = parsed.path","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/marketplace.py#L139-L175","documentation":"`parse_marketplace_source` accepts GitHub shorthand, git URLs (including SSH scp-like syntax), marketplace JSON URLs, and local file/directory paths. An entirely empty (after stripping whitespace) input is rejected immediately with this `MarketplaceError` — it is the friendly prompt shown when the user submits nothing in the add-marketplace flow.","triggerScenarios":"Calling `parse_marketplace_source(\"\")` or with a whitespace-only string; in the UI, submitting the add-marketplace modal with an empty source field.","commonSituations":"User pressed Enter in the add-marketplace dialog without typing anything; an environment variable or config value intended to hold the source was unset/blank; a script interpolated an empty variable into the source argument.","solutions":["Enter a nonempty marketplace source (e.g. `owner/repo`, a git URL, or a path to a marketplace JSON/file/directory).","If driven by a variable, ensure it is set before invoking: check `echo \"$MARKETPLACE_SOURCE\"`.","In scripts, guard with an early check so you never call with an empty string."],"exampleFix":"# before\nparse_marketplace_source(os.environ[\"MKT\"])  # MKT unset -> ''\n# after\nsrc = os.environ.get(\"MKT\", \"\").strip()\nif not src:\n    raise SystemExit(\"MKT must be set to a marketplace source\")\nparse_marketplace_source(src)","handlingStrategy":"validation","validationCode":"raw = (user_input or \"\").strip()\nif not raw:\n    raise SystemExit(\"Please enter a marketplace source\")","typeGuard":null,"tryCatchPattern":"try:\n    source = parse_marketplace_source(user_input)\nexcept MarketplaceError as exc:\n    show_dialog_error(str(exc))  # empty or unsupported source","preventionTips":["Strip whitespace from user input before parsing.","In UI flows, disable submit until the source field is nonempty.","In scripts, fail fast on empty/blank environment variables holding the source.","Accept the supported forms: `owner/repo`, git/SSH URLs, or a local/remote marketplace JSON path."],"tags":["plugins","marketplace","input-validation","ux"],"backgroundTag":"empty-marketplace-source","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}