@kokorolx/ai-sandbox-wrapper 1.0.0

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 (45) hide show
  1. package/README.md +540 -0
  2. package/bin/ai-debug +116 -0
  3. package/bin/ai-network +144 -0
  4. package/bin/ai-run +631 -0
  5. package/bin/cli.js +83 -0
  6. package/bin/setup-ssh-config +328 -0
  7. package/dockerfiles/AGENTS.md +92 -0
  8. package/dockerfiles/aider/Dockerfile +5 -0
  9. package/dockerfiles/amp/Dockerfile +10 -0
  10. package/dockerfiles/auggie/Dockerfile +12 -0
  11. package/dockerfiles/base/Dockerfile +73 -0
  12. package/dockerfiles/claude/Dockerfile +11 -0
  13. package/dockerfiles/codebuddy/Dockerfile +12 -0
  14. package/dockerfiles/codex/Dockerfile +9 -0
  15. package/dockerfiles/droid/Dockerfile +8 -0
  16. package/dockerfiles/gemini/Dockerfile +9 -0
  17. package/dockerfiles/jules/Dockerfile +12 -0
  18. package/dockerfiles/kilo/Dockerfile +25 -0
  19. package/dockerfiles/opencode/Dockerfile +10 -0
  20. package/dockerfiles/qoder/Dockerfile +12 -0
  21. package/dockerfiles/qwen/Dockerfile +10 -0
  22. package/dockerfiles/shai/Dockerfile +9 -0
  23. package/lib/AGENTS.md +58 -0
  24. package/lib/generate-ai-run.sh +19 -0
  25. package/lib/install-aider.sh +30 -0
  26. package/lib/install-amp.sh +39 -0
  27. package/lib/install-auggie.sh +36 -0
  28. package/lib/install-base.sh +139 -0
  29. package/lib/install-claude.sh +42 -0
  30. package/lib/install-codebuddy.sh +36 -0
  31. package/lib/install-codeserver.sh +171 -0
  32. package/lib/install-codex.sh +40 -0
  33. package/lib/install-droid.sh +27 -0
  34. package/lib/install-gemini.sh +39 -0
  35. package/lib/install-jules.sh +36 -0
  36. package/lib/install-kilo.sh +57 -0
  37. package/lib/install-opencode.sh +39 -0
  38. package/lib/install-qoder.sh +37 -0
  39. package/lib/install-qwen.sh +40 -0
  40. package/lib/install-shai.sh +33 -0
  41. package/lib/install-tool.sh +40 -0
  42. package/lib/install-vscode.sh +219 -0
  43. package/lib/ssh-key-selector.sh +189 -0
  44. package/package.json +46 -0
  45. package/setup.sh +530 -0
package/bin/ai-network ADDED
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env bash
2
+ # Network management helper for AI Sandbox Wrapper
3
+ # Usage: ai-network <command> [network-name]
4
+ #
5
+ # Commands:
6
+ # list List configured networks
7
+ # add <name> Add a network to join
8
+ # remove <name> Remove a network
9
+ # check <name> Check if network exists
10
+ # metamcp Quick command to add MetaMCP network
11
+
12
+ set -e
13
+
14
+ NETWORK_FILE="$HOME/.ai-networks"
15
+ COMMAND="${1:-list}"
16
+
17
+ # Ensure network file exists
18
+ touch "$NETWORK_FILE"
19
+
20
+ list_networks() {
21
+ echo "📋 Configured Networks:"
22
+ echo ""
23
+ if [[ -s "$NETWORK_FILE" ]]; then
24
+ while IFS= read -r network; do
25
+ if [[ -n "$network" ]]; then
26
+ if docker network inspect "$network" >/dev/null 2>&1; then
27
+ echo " ✅ $network"
28
+ else
29
+ echo " ❌ $network (not found)"
30
+ fi
31
+ fi
32
+ done < "$NETWORK_FILE"
33
+ else
34
+ echo " No networks configured."
35
+ echo ""
36
+ echo " To add a network:"
37
+ echo " ai-network add <network-name>"
38
+ fi
39
+ }
40
+
41
+ add_network() {
42
+ local network_name="$2"
43
+
44
+ if [[ -z "$network_name" ]]; then
45
+ echo "❌ Error: Network name required"
46
+ echo " Usage: ai-network add <network-name>"
47
+ exit 1
48
+ fi
49
+
50
+ # Check if network exists
51
+ if ! docker network inspect "$network_name" >/dev/null 2>&1; then
52
+ echo "⚠️ Network '$network_name' does not exist yet."
53
+ read -p "Add it anyway? [y/N]: " confirm
54
+ if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
55
+ exit 0
56
+ fi
57
+ fi
58
+
59
+ # Add to config (avoid duplicates)
60
+ if grep -q "^${network_name}$" "$NETWORK_FILE" 2>/dev/null; then
61
+ echo "✅ Network '$network_name' already configured"
62
+ else
63
+ echo "$network_name" >> "$NETWORK_FILE"
64
+ chmod 600 "$NETWORK_FILE"
65
+ echo "✅ Added network: $network_name"
66
+ fi
67
+ }
68
+
69
+ remove_network() {
70
+ local network_name="$2"
71
+
72
+ if [[ -z "$network_name" ]]; then
73
+ echo "❌ Error: Network name required"
74
+ echo " Usage: ai-network remove <network-name>"
75
+ exit 1
76
+ fi
77
+
78
+ if grep -q "^${network_name}$" "$NETWORK_FILE" 2>/dev/null; then
79
+ # Remove the network from file
80
+ grep -v "^${network_name}$" "$NETWORK_FILE" > "$NETWORK_FILE.tmp"
81
+ mv "$NETWORK_FILE.tmp" "$NETWORK_FILE"
82
+ chmod 600 "$NETWORK_FILE"
83
+ echo "✅ Removed network: $network_name"
84
+ else
85
+ echo "⚠️ Network '$network_name' not found in config"
86
+ fi
87
+ }
88
+
89
+ check_network() {
90
+ local network_name="${2:-metamcp_metamcp-network}"
91
+
92
+ if docker network inspect "$network_name" >/dev/null 2>&1; then
93
+ echo "✅ Network '$network_name' exists"
94
+ return 0
95
+ else
96
+ echo "❌ Network '$network_name' not found"
97
+ return 1
98
+ fi
99
+ }
100
+
101
+ add_metamcp() {
102
+ echo "🔗 Adding MetaMCP network..."
103
+ add_network "metamcp_metamcp-network"
104
+ }
105
+
106
+ case "$COMMAND" in
107
+ list)
108
+ list_networks
109
+ ;;
110
+ add)
111
+ add_network "$@"
112
+ ;;
113
+ remove|rm|delete)
114
+ remove_network "$@"
115
+ ;;
116
+ check)
117
+ check_network "$@"
118
+ ;;
119
+ metamcp|meta)
120
+ add_metamcp
121
+ ;;
122
+ help|--help|-h)
123
+ echo "AI Network Manager"
124
+ echo ""
125
+ echo "Usage: ai-network <command> [network-name]"
126
+ echo ""
127
+ echo "Commands:"
128
+ echo " list Show all configured networks"
129
+ echo " add <name> Add a Docker network"
130
+ echo " remove <name> Remove a configured network"
131
+ echo " check [name] Check if a network exists"
132
+ echo " metamcp Quick-add MetaMCP network"
133
+ echo ""
134
+ echo "Examples:"
135
+ echo " ai-network list"
136
+ echo " ai-network add my-network"
137
+ echo " ai-network metamcp"
138
+ ;;
139
+ *)
140
+ echo "Unknown command: $COMMAND"
141
+ echo "Run 'ai-network help' for usage"
142
+ exit 1
143
+ ;;
144
+ esac