agentworks-cli 0.2.1__py3-none-any.whl

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 (59) hide show
  1. agentworks/__init__.py +1 -0
  2. agentworks/agents/__init__.py +0 -0
  3. agentworks/agents/manager.py +1095 -0
  4. agentworks/agents/templates.py +145 -0
  5. agentworks/catalog.py +264 -0
  6. agentworks/catalog.toml +131 -0
  7. agentworks/cli.py +1462 -0
  8. agentworks/completions/__init__.py +33 -0
  9. agentworks/completions/bash.py +179 -0
  10. agentworks/completions/install.py +122 -0
  11. agentworks/completions/powershell.py +270 -0
  12. agentworks/completions/spec.py +216 -0
  13. agentworks/completions/zsh.py +256 -0
  14. agentworks/config.py +894 -0
  15. agentworks/db.py +1083 -0
  16. agentworks/doctor.py +430 -0
  17. agentworks/git_credentials/__init__.py +0 -0
  18. agentworks/git_credentials/azdo.py +29 -0
  19. agentworks/git_credentials/base.py +71 -0
  20. agentworks/git_credentials/github.py +22 -0
  21. agentworks/nerf-config.yaml +16 -0
  22. agentworks/output.py +296 -0
  23. agentworks/remote_exec.py +286 -0
  24. agentworks/sample-config.toml +289 -0
  25. agentworks/sessions/__init__.py +0 -0
  26. agentworks/sessions/console.py +164 -0
  27. agentworks/sessions/manager.py +1297 -0
  28. agentworks/sessions/templates.py +101 -0
  29. agentworks/sessions/tmux.py +503 -0
  30. agentworks/sources.py +303 -0
  31. agentworks/ssh.py +759 -0
  32. agentworks/ssh_config.py +255 -0
  33. agentworks/vm_hosts/__init__.py +0 -0
  34. agentworks/vm_hosts/manager.py +86 -0
  35. agentworks/vms/__init__.py +0 -0
  36. agentworks/vms/backup.py +409 -0
  37. agentworks/vms/base.py +56 -0
  38. agentworks/vms/bootstrap_script.py +185 -0
  39. agentworks/vms/cloud_init.py +55 -0
  40. agentworks/vms/initializer.py +1523 -0
  41. agentworks/vms/manager.py +1122 -0
  42. agentworks/vms/provisioners/__init__.py +0 -0
  43. agentworks/vms/provisioners/azure.py +602 -0
  44. agentworks/vms/provisioners/lima.py +295 -0
  45. agentworks/vms/provisioners/proxmox.py +279 -0
  46. agentworks/vms/provisioners/proxmox_api.py +261 -0
  47. agentworks/vms/provisioners/wsl2.py +340 -0
  48. agentworks/vms/templates.py +152 -0
  49. agentworks/workspaces/__init__.py +0 -0
  50. agentworks/workspaces/backends/__init__.py +0 -0
  51. agentworks/workspaces/backends/local.py +119 -0
  52. agentworks/workspaces/backends/vm.py +175 -0
  53. agentworks/workspaces/manager.py +1080 -0
  54. agentworks/workspaces/templates.py +76 -0
  55. agentworks/workspaces/tmuxinator.py +80 -0
  56. agentworks_cli-0.2.1.dist-info/METADATA +635 -0
  57. agentworks_cli-0.2.1.dist-info/RECORD +59 -0
  58. agentworks_cli-0.2.1.dist-info/WHEEL +4 -0
  59. agentworks_cli-0.2.1.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,55 @@
1
+ """Cloud-init wrapper for Azure VM provisioning.
2
+
3
+ Wraps a bootstrap script in a #cloud-config YAML that delivers and executes
4
+ it via write_files + runcmd. This lets Azure VMs run the same bootstrap script
5
+ that Lima uses via its provision block.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import textwrap
11
+
12
+ # Minimal packages needed during provisioning (cloud-init/bootstrap).
13
+ # Only what is required to get the VM to a state where init can SSH in.
14
+ PROVISIONING_PACKAGES = [
15
+ "openssh-server",
16
+ "curl",
17
+ "sudo",
18
+ "ca-certificates",
19
+ "gnupg",
20
+ ]
21
+
22
+ # System packages installed during init (every create/reinit).
23
+ # These are always installed regardless of operator config.
24
+ INIT_SYSTEM_PACKAGES = [
25
+ "git",
26
+ "unzip",
27
+ "tmux",
28
+ "tmuxinator",
29
+ "acl",
30
+ "jq",
31
+ "mise",
32
+ "zstd",
33
+ ]
34
+
35
+
36
+ def generate_cloud_init(bootstrap_script: str) -> str:
37
+ """Generate a #cloud-config YAML that runs the bootstrap script.
38
+
39
+ Uses write_files to place the script on disk and runcmd to execute it.
40
+ This is the delivery mechanism for Azure; the script itself is the same
41
+ one Lima embeds in its provision block.
42
+ """
43
+ # Indent the script content for YAML embedding (8 spaces for write_files content block)
44
+ indented = textwrap.indent(bootstrap_script, " ")
45
+
46
+ return (
47
+ "#cloud-config\n"
48
+ "write_files:\n"
49
+ " - path: /tmp/agentworks-bootstrap.sh\n"
50
+ " permissions: '0755'\n"
51
+ " content: |\n"
52
+ f"{indented}\n"
53
+ "runcmd:\n"
54
+ ' - ["/bin/bash", "/tmp/agentworks-bootstrap.sh"]\n'
55
+ )