Return the install-script command that adds `extra` to dcode. The promoted install path is the install script (see `scripts/install.sh`). This helper is display-only and avoids uv receipt introspection so unsupported installs can surface method-specific guidance before any uv receip
(
extra: str,
*,
distribution_name: str = "deepagents-code",
)
| 2406 | |
| 2407 | |
| 2408 | def install_extra_command( |
| 2409 | extra: str, |
| 2410 | *, |
| 2411 | distribution_name: str = "deepagents-code", |
| 2412 | ) -> str: |
| 2413 | """Return the install-script command that adds `extra` to dcode. |
| 2414 | |
| 2415 | The promoted install path is the install script (see `scripts/install.sh`). |
| 2416 | This helper is display-only and avoids uv receipt introspection so |
| 2417 | unsupported installs can surface method-specific guidance before any uv |
| 2418 | receipt is read. Already-detected extras from distribution metadata are |
| 2419 | included when available, so following the command does not drop them. |
| 2420 | |
| 2421 | Args: |
| 2422 | extra: The extra name (e.g. `'quickjs'`, `'daytona'`, `'fireworks'`). |
| 2423 | Validated internally against PEP 508 grammar before interpolation |
| 2424 | into the shell command. |
| 2425 | distribution_name: Name of the installed distribution to inspect for |
| 2426 | already-installed extras. |
| 2427 | |
| 2428 | Returns: |
| 2429 | Shell command string suitable for display in error messages. |
| 2430 | |
| 2431 | Raises: |
| 2432 | ValueError: If `extra` fails PEP 508 validation. |
| 2433 | """ |
| 2434 | if not is_valid_extra_name(extra): |
| 2435 | msg = ( |
| 2436 | f"Invalid extra name {extra!r}: must match PEP 508 " |
| 2437 | f"({_EXTRA_NAME_RE.pattern})" |
| 2438 | ) |
| 2439 | raise ValueError(msg) |
| 2440 | from deepagents_code.extras_info import installed_extra_names |
| 2441 | |
| 2442 | extras = installed_extra_names(distribution_name) |
| 2443 | extras.add(extra) |
| 2444 | return install_extras_command(extras) |
| 2445 | |
| 2446 | |
| 2447 | def install_extra_recovery_command(extra: str) -> str: |
searching dependent graphs…