mistralai-workflows-cli 1.2.0a2__tar.gz → 1.2.1__tar.gz

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.
Files changed (97) hide show
  1. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/PKG-INFO +1 -1
  2. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/README.md +3 -3
  3. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/getting-started/installation.mdx +1 -1
  4. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/README.md.jinja +1 -1
  5. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/setup.py +80 -1
  6. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/tests/test_setup.py +21 -1
  7. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/.gitignore +0 -0
  8. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/Makefile +0 -0
  9. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/pyproject.toml +0 -0
  10. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/__init__.py +0 -0
  11. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/copier.yml +0 -0
  12. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/SKILL.md +0 -0
  13. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/execution_ids.md +0 -0
  14. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/getting-started/core-concepts.mdx +0 -0
  15. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/getting-started/introduction.mdx +0 -0
  16. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/getting-started/python-sdk.mdx +0 -0
  17. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/getting-started/value-proposition.mdx +0 -0
  18. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/getting-started/your-first-workflow.mdx +0 -0
  19. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/_deployment-patterns.mdx +0 -0
  20. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/activities.mdx +0 -0
  21. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/assist-workflows.mdx +0 -0
  22. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/concurrency.mdx +0 -0
  23. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/dependency-injection.mdx +0 -0
  24. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/diagnostics.md +0 -0
  25. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/durable-agents.mdx +0 -0
  26. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/error-codes.mdx +0 -0
  27. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/handling-large-data.mdx +0 -0
  28. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/limitations.mdx +0 -0
  29. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/local-execution.mdx +0 -0
  30. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/migration-v2-to-v3.mdx +0 -0
  31. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/observability.mdx +0 -0
  32. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/payload-encoding.mdx +0 -0
  33. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/rate-limiting.mdx +0 -0
  34. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/scheduling.mdx +0 -0
  35. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/signals-queries-updates.mdx +0 -0
  36. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/streaming-consumption.mdx +0 -0
  37. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/streaming.mdx +0 -0
  38. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/testing.md +0 -0
  39. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/workflows-exception.mdx +0 -0
  40. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/workflows-plugins.mdx +0 -0
  41. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/guides/workflows.mdx +0 -0
  42. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/pipeline_pattern.md +0 -0
  43. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/references/workflow_testing.md +0 -0
  44. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.agents/skills/workflows/scripts/test_workflow.py +0 -0
  45. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.env.jinja +0 -0
  46. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/.gitignore +0 -0
  47. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/Makefile +0 -0
  48. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/pyproject.toml.jinja +0 -0
  49. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/entrypoints/__init__.py +0 -0
  50. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/entrypoints/dev.py +0 -0
  51. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/entrypoints/start.py +0 -0
  52. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/entrypoints/worker.py +0 -0
  53. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/__init__.py +0 -0
  54. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/README.md +0 -0
  55. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/__init__.py +0 -0
  56. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/activities.py +0 -0
  57. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/models.py +0 -0
  58. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/sample_data/shipping_doc_anomaly.png +0 -0
  59. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/sample_data/shipping_doc_normal.png +0 -0
  60. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/cargo_release/workflow.py +0 -0
  61. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/README.md +0 -0
  62. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/__init__.py +0 -0
  63. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/activities.py +0 -0
  64. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/models.py +0 -0
  65. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/sample_data/legacy_repo/__init__.py +0 -0
  66. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/sample_data/legacy_repo/api_client.py +0 -0
  67. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/sample_data/legacy_repo/processor.py +0 -0
  68. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/sample_data/legacy_repo/utils.py +0 -0
  69. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/sub_workflow.py +0 -0
  70. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/code_modernization/workflow.py +0 -0
  71. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/README.md +0 -0
  72. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/__init__.py +0 -0
  73. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/activities.py +0 -0
  74. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/models.py +0 -0
  75. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/claim_high_severity.json +0 -0
  76. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/claim_low_severity.json +0 -0
  77. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/claim_medium_severity.json +0 -0
  78. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/photos/CREDITS.md +0 -0
  79. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/photos/claim_high_totaled_front.jpg +0 -0
  80. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/photos/claim_high_totaled_side.jpg +0 -0
  81. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/photos/claim_low_scratch_door.jpg +0 -0
  82. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/sample_data/photos/claim_medium_dent_rear.jpg +0 -0
  83. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/insurance_claims/workflow.py +0 -0
  84. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/linear_summarization/README.md +0 -0
  85. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/linear_summarization/__init__.py +0 -0
  86. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/linear_summarization/linear_activities.py +0 -0
  87. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/linear_summarization/summary_activity.py +0 -0
  88. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/linear_summarization/workflow.py +0 -0
  89. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/examples/worker.py +0 -0
  90. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/worker.py +0 -0
  91. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/workflows/__init__.py +0 -0
  92. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/src/workflows/hello.py +0 -0
  93. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_template/template/worker.py +0 -0
  94. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/_version.py +0 -0
  95. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/src/mistral_workflows_cli/main.py +0 -0
  96. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/tests/__init__.py +0 -0
  97. {mistralai_workflows_cli-1.2.0a2 → mistralai_workflows_cli-1.2.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mistralai-workflows-cli
3
- Version: 1.2.0a2
3
+ Version: 1.2.1
4
4
  Summary: CLI to bootstrap Mistral Workflows projects
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: click>=8.0
@@ -11,13 +11,13 @@ both live here, so template and CLI changes ship in a single PR.
11
11
  ## Usage
12
12
 
13
13
  ```bash
14
- uvx mistralai-workflows-cli setup
14
+ uvx mistralai-workflows-cli@latest setup
15
15
  ```
16
16
 
17
17
  Or with options:
18
18
 
19
19
  ```bash
20
- uvx mistralai-workflows-cli setup --api-key sk-... --project-name my-project
20
+ uvx mistralai-workflows-cli@latest setup --api-key sk-... --project-name my-project
21
21
  ```
22
22
 
23
23
  The `setup` command will:
@@ -55,7 +55,7 @@ Workflows are auto-discovered at worker startup. Any class decorated with `@work
55
55
  | ----------------- | ------------------------------------------------------------ |
56
56
  | `project_name` | Name of the project (used in pyproject.toml, workflow names) |
57
57
  | `mistral_api_key` | Mistral API key (written to `.env`, excluded from git) |
58
- | `deployment_name` | Deployment name used to identify the deployment in AI Studio |
58
+ | `deployment_name` | Name identifying the deployment in AI Studio. The CLI sets it to `{hostname}-{project_name}-{adjective}-{noun}` so multiple projects on the same machine don't collide |
59
59
 
60
60
  ## CLI Development
61
61
 
@@ -30,7 +30,7 @@ This will create a virtual environment (if one doesn't exist) and install Workfl
30
30
  If you want to start from a ready-to-run Python project instead of wiring the SDK manually, use `mistralai-workflows-cli`:
31
31
 
32
32
  ```bash
33
- uvx mistralai-workflows-cli setup
33
+ uvx mistralai-workflows-cli@latest setup
34
34
  ```
35
35
 
36
36
  This scaffolds a ready-to-run Python project with the Workflows SDK already configured, a minimal example workflow, and helper commands to register and execute workflows.
@@ -12,7 +12,7 @@ uv sync
12
12
 
13
13
  ### Register workflows in AI Studio
14
14
 
15
- Auto-discovers all workflow classes in `src/workflows/`, registers them with AI Studio, and starts polling for executions. The [deployment name](https://docs.mistral.ai/workflows/managing-workflows-in-production/deployments) is set to your hostname:
15
+ Auto-discovers all workflow classes in `src/workflows/`, registers them with AI Studio, and starts polling for executions. The [deployment name](https://docs.mistral.ai/workflows/managing-workflows-in-production/deployments) is set to `{hostname}-{project}-{adjective}-{noun}` so multiple projects on the same machine stay isolated:
16
16
 
17
17
  ```bash
18
18
  make start-worker
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import os
4
+ import secrets
4
5
  import socket
5
6
  from pathlib import Path
6
7
 
@@ -10,6 +11,84 @@ from rich.prompt import Prompt
10
11
  API_KEYS_URL = "https://console.mistral.ai/api-keys"
11
12
  TEMPLATE_DIR = Path(__file__).parent / "_template"
12
13
 
14
+ _ADJECTIVES = [
15
+ "bold",
16
+ "brave",
17
+ "bright",
18
+ "calm",
19
+ "clever",
20
+ "cool",
21
+ "eager",
22
+ "fair",
23
+ "fast",
24
+ "fierce",
25
+ "gentle",
26
+ "glad",
27
+ "grand",
28
+ "happy",
29
+ "keen",
30
+ "kind",
31
+ "lively",
32
+ "lucky",
33
+ "merry",
34
+ "neat",
35
+ "noble",
36
+ "proud",
37
+ "quick",
38
+ "sharp",
39
+ "silent",
40
+ "smart",
41
+ "steady",
42
+ "swift",
43
+ "vivid",
44
+ "warm",
45
+ "wise",
46
+ "witty",
47
+ ]
48
+
49
+ _NOUNS = [
50
+ "badger",
51
+ "bear",
52
+ "crane",
53
+ "eagle",
54
+ "falcon",
55
+ "fox",
56
+ "hawk",
57
+ "heron",
58
+ "horse",
59
+ "jaguar",
60
+ "lark",
61
+ "lion",
62
+ "lynx",
63
+ "otter",
64
+ "owl",
65
+ "panda",
66
+ "raven",
67
+ "robin",
68
+ "salmon",
69
+ "shark",
70
+ "sparrow",
71
+ "stork",
72
+ "tiger",
73
+ "viper",
74
+ "whale",
75
+ "wolf",
76
+ "wren",
77
+ "zebra",
78
+ ]
79
+
80
+
81
+ def build_deployment_name(project_name: str, hostname: str | None = None) -> str:
82
+ """Build a deployment name unique to this project on this machine.
83
+
84
+ Multiple projects scaffolded on the same machine would otherwise share the
85
+ hostname-based deployment name and register conflicting workers. Combining
86
+ the hostname, project name, and a random word pair keeps them isolated.
87
+ """
88
+ hostname = hostname or socket.gethostname()
89
+ suffix = f"{secrets.choice(_ADJECTIVES)}-{secrets.choice(_NOUNS)}"
90
+ return f"{hostname}-{project_name}-{suffix}"
91
+
13
92
 
14
93
  def run_setup(
15
94
  api_key: str | None,
@@ -60,7 +139,7 @@ def run_setup(
60
139
  data={
61
140
  "project_name": project_name,
62
141
  "mistral_api_key": api_key,
63
- "deployment_name": socket.gethostname(),
142
+ "deployment_name": build_deployment_name(project_name),
64
143
  },
65
144
  unsafe=True,
66
145
  )
@@ -1,12 +1,13 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import re
3
4
  from unittest.mock import patch
4
5
 
5
6
  import pytest
6
7
  from click.testing import CliRunner
7
8
 
8
9
  from mistral_workflows_cli.main import cli
9
- from mistral_workflows_cli.setup import run_setup
10
+ from mistral_workflows_cli.setup import build_deployment_name, run_setup
10
11
 
11
12
 
12
13
  @pytest.fixture
@@ -66,3 +67,22 @@ def test_setup_fails_if_dir_exists(tmp_path: object) -> None:
66
67
  with pytest.raises(SystemExit) as exc_info:
67
68
  run_setup(api_key="sk-test", output_dir=str(tmp_path), project_name="existing")
68
69
  assert exc_info.value.code == 1
70
+
71
+
72
+ def test_build_deployment_name_format() -> None:
73
+ name = build_deployment_name("my-proj", hostname="my-host")
74
+ assert re.fullmatch(r"my-host-my-proj-[a-z]+-[a-z]+", name)
75
+
76
+
77
+ def test_build_deployment_name_suffix_is_random() -> None:
78
+ names = {build_deployment_name("my-proj", hostname="my-host") for _ in range(20)}
79
+ assert len(names) > 1
80
+
81
+
82
+ def test_setup_deployment_name_includes_project(tmp_path: object, monkeypatch: pytest.MonkeyPatch) -> None:
83
+ monkeypatch.setattr("mistral_workflows_cli.setup.socket.gethostname", lambda: "my-host")
84
+ with patch("copier.run_copy") as run_copy:
85
+ run_setup(api_key="sk-test", output_dir=str(tmp_path), project_name="test-proj")
86
+
87
+ deployment_name = run_copy.call_args.kwargs["data"]["deployment_name"]
88
+ assert re.fullmatch(r"my-host-test-proj-[a-z]+-[a-z]+", deployment_name)