claudepod 1.1.2 โ 1.2.1
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.
- package/.devcontainer/.env +18 -0
- package/.devcontainer/CHANGELOG.md +68 -0
- package/.devcontainer/CLAUDE.md +100 -0
- package/.devcontainer/README.md +220 -0
- package/.devcontainer/config/main-system-prompt.md +118 -0
- package/.devcontainer/config/settings.json +41 -0
- package/.devcontainer/devcontainer.json +71 -113
- package/.devcontainer/features/README.md +113 -0
- package/.devcontainer/features/ast-grep/README.md +24 -0
- package/.devcontainer/features/ast-grep/devcontainer-feature.json +24 -0
- package/.devcontainer/features/ast-grep/install.sh +51 -0
- package/.devcontainer/features/ccstatusline/README.md +296 -0
- package/.devcontainer/features/ccstatusline/devcontainer-feature.json +19 -0
- package/.devcontainer/features/ccstatusline/install.sh +290 -0
- package/.devcontainer/features/ccusage/README.md +205 -0
- package/.devcontainer/features/ccusage/devcontainer-feature.json +38 -0
- package/.devcontainer/features/ccusage/install.sh +132 -0
- package/.devcontainer/features/claude-code/README.md +498 -0
- package/.devcontainer/features/claude-code/config/settings.json +36 -0
- package/.devcontainer/features/claude-code/config/system-prompt.md +118 -0
- package/.devcontainer/features/claude-code/config/world-building-sp.md +1432 -0
- package/.devcontainer/features/claude-code/devcontainer-feature.json +42 -0
- package/.devcontainer/features/claude-code/install.sh +466 -0
- package/.devcontainer/features/claude-monitor/README.md +74 -0
- package/.devcontainer/features/claude-monitor/devcontainer-feature.json +38 -0
- package/.devcontainer/features/claude-monitor/install.sh +99 -0
- package/.devcontainer/features/lsp-servers/README.md +85 -0
- package/.devcontainer/features/lsp-servers/devcontainer-feature.json +34 -0
- package/.devcontainer/features/lsp-servers/install.sh +92 -0
- package/.devcontainer/features/mcp-qdrant/CHANGES.md +399 -0
- package/.devcontainer/features/mcp-qdrant/README.md +474 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +57 -0
- package/.devcontainer/features/mcp-qdrant/install.sh +295 -0
- package/.devcontainer/features/mcp-qdrant/poststart-hook.sh +129 -0
- package/.devcontainer/features/mcp-reasoner/README.md +177 -0
- package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +20 -0
- package/.devcontainer/features/mcp-reasoner/install.sh +177 -0
- package/.devcontainer/features/mcp-reasoner/poststart-hook.sh +67 -0
- package/.devcontainer/features/splitrail/README.md +140 -0
- package/.devcontainer/features/splitrail/devcontainer-feature.json +34 -0
- package/.devcontainer/features/splitrail/install.sh +129 -0
- package/.devcontainer/features/tree-sitter/README.md +138 -0
- package/.devcontainer/features/tree-sitter/devcontainer-feature.json +52 -0
- package/.devcontainer/features/tree-sitter/install.sh +173 -0
- package/.devcontainer/scripts/setup-aliases.sh +52 -0
- package/.devcontainer/scripts/setup-config.sh +28 -0
- package/.devcontainer/scripts/setup-irie-claude.sh +32 -0
- package/.devcontainer/scripts/setup-lsp.sh +20 -0
- package/.devcontainer/scripts/setup-plugins.sh +31 -0
- package/.devcontainer/scripts/setup.sh +60 -0
- package/README.md +153 -187
- package/package.json +5 -9
- package/setup.js +2 -2
- package/.devcontainer/config/claude/mcp.json +0 -76
- package/.devcontainer/config/claude/mcp.json.template +0 -117
- package/.devcontainer/config/claude/output-styles/strict-development.md +0 -158
- package/.devcontainer/config/claude/settings.json +0 -10
- package/.devcontainer/config/claude/system-prompt.md +0 -3
- package/.devcontainer/config/searxng/ods_config.json +0 -22
- package/.devcontainer/config/searxng/searxng_env_template +0 -71
- package/.devcontainer/config/serena/serena_config.yml +0 -72
- package/.devcontainer/config/taskmaster/config.json +0 -37
- package/.devcontainer/ods_config.json +0 -21
- package/.devcontainer/post-create.sh +0 -1077
- package/.devcontainer/post-start.sh +0 -551
- package/.devcontainer/sanitize-system-prompt.sh +0 -31
- package/.devcontainer/scripts/config/claude-core.sh +0 -210
- package/.devcontainer/scripts/config/searxng.sh +0 -411
- package/.devcontainer/scripts/config/serena.sh +0 -47
- package/.devcontainer/scripts/config/taskmaster.sh +0 -41
- package/.devcontainer/scripts/generate-mcp-config.js +0 -205
- package/.devcontainer/scripts/install/claude-code.sh +0 -112
- package/.devcontainer/scripts/shell/zsh-config.sh +0 -271
- package/.devcontainer/scripts/utils.sh +0 -44
- package/.devcontainer/setup-zsh.sh +0 -234
|
@@ -1,551 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# ClaudePod Post-Start Script - Phase 3: MCP Server Installation
|
|
5
|
-
# This script handles MCP server installations that don't require API keys
|
|
6
|
-
|
|
7
|
-
echo "๐ Starting ClaudePod MCP server setup..."
|
|
8
|
-
|
|
9
|
-
# Initial NVM setup will be handled in main() to avoid conflicts
|
|
10
|
-
|
|
11
|
-
# Source shared utility functions
|
|
12
|
-
source "/workspace/.devcontainer/scripts/utils.sh"
|
|
13
|
-
|
|
14
|
-
# Function to install uv via pipx
|
|
15
|
-
install_uv() {
|
|
16
|
-
echo "๐ฆ Installing uv package manager..."
|
|
17
|
-
|
|
18
|
-
# Ensure we have the user's local bin in PATH
|
|
19
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
20
|
-
|
|
21
|
-
# Check if uv/uvx is already available
|
|
22
|
-
if command -v uvx &> /dev/null; then
|
|
23
|
-
echo "โ
uvx already available"
|
|
24
|
-
return 0
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
# Set PIPX_HOME and PIPX_BIN_DIR to user-writable locations
|
|
28
|
-
export PIPX_HOME="$HOME/.local/pipx"
|
|
29
|
-
export PIPX_BIN_DIR="$HOME/.local/bin"
|
|
30
|
-
|
|
31
|
-
# Create directories if they don't exist
|
|
32
|
-
mkdir -p "$PIPX_HOME" "$PIPX_BIN_DIR"
|
|
33
|
-
|
|
34
|
-
# Check if pipx is available from Python feature
|
|
35
|
-
if ! command -v pipx &> /dev/null; then
|
|
36
|
-
echo "โ ๏ธ pipx not found. Checking if it's installed via Python feature..."
|
|
37
|
-
|
|
38
|
-
# The Python feature should install pipx, but it might not be in PATH yet
|
|
39
|
-
if [ -f "/usr/local/py-utils/bin/pipx" ]; then
|
|
40
|
-
# Use the pipx from Python feature but with user directories
|
|
41
|
-
alias pipx="/usr/local/py-utils/bin/pipx"
|
|
42
|
-
echo "โ
Found pipx in Python feature directory"
|
|
43
|
-
else
|
|
44
|
-
echo "โ ๏ธ pipx not available. Skipping uv installation."
|
|
45
|
-
return 1
|
|
46
|
-
fi
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# Install uv with user directories
|
|
50
|
-
if retry_command 3 5 /usr/local/py-utils/bin/pipx install uv; then
|
|
51
|
-
echo "โ
uv installed successfully"
|
|
52
|
-
|
|
53
|
-
# Verify uvx is available
|
|
54
|
-
if [ -f "$HOME/.local/bin/uvx" ] || command -v uvx &> /dev/null; then
|
|
55
|
-
echo "โ
uvx command available"
|
|
56
|
-
return 0
|
|
57
|
-
else
|
|
58
|
-
echo "โ ๏ธ uvx command not found after uv installation"
|
|
59
|
-
return 1
|
|
60
|
-
fi
|
|
61
|
-
else
|
|
62
|
-
echo "โ Failed to install uv"
|
|
63
|
-
return 1
|
|
64
|
-
fi
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
# Function to validate MCP configuration
|
|
68
|
-
validate_mcp_configuration() {
|
|
69
|
-
echo "๐ Validating MCP configuration..."
|
|
70
|
-
|
|
71
|
-
local mcp_config="/workspace/.devcontainer/config/claude/mcp.json"
|
|
72
|
-
|
|
73
|
-
# Check if file exists
|
|
74
|
-
if [ ! -f "$mcp_config" ]; then
|
|
75
|
-
echo "โ ๏ธ MCP configuration file not found at $mcp_config"
|
|
76
|
-
return 1
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
# Basic JSON validation
|
|
80
|
-
if ! node -e "JSON.parse(require('fs').readFileSync('$mcp_config', 'utf8'))" 2>/dev/null; then
|
|
81
|
-
echo "โ MCP configuration is not valid JSON"
|
|
82
|
-
# Restore from backup if available
|
|
83
|
-
if [ -f "${mcp_config}.backup" ]; then
|
|
84
|
-
echo "๐ฆ Restoring from backup..."
|
|
85
|
-
cp "${mcp_config}.backup" "$mcp_config"
|
|
86
|
-
fi
|
|
87
|
-
return 1
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
# Test if Claude can read the configuration (if Claude is available)
|
|
91
|
-
if command -v claude &> /dev/null; then
|
|
92
|
-
echo "๐งช Testing Claude MCP integration..."
|
|
93
|
-
if timeout 10 claude --mcp-config "$mcp_config" --print "test" &>/dev/null; then
|
|
94
|
-
echo "โ
Claude MCP configuration valid"
|
|
95
|
-
else
|
|
96
|
-
echo "โ ๏ธ Claude cannot load MCP configuration (authentication may be needed)"
|
|
97
|
-
fi
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
echo "โ
MCP configuration validation completed"
|
|
101
|
-
return 0
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# Function to verify MCP configuration
|
|
105
|
-
verify_mcp_config() {
|
|
106
|
-
echo "๐ฆ Verifying MCP server configuration..."
|
|
107
|
-
|
|
108
|
-
# Check if MCP configuration file exists
|
|
109
|
-
local mcp_config="/workspace/.claude/mcp.json"
|
|
110
|
-
if [ ! -f "$mcp_config" ]; then
|
|
111
|
-
echo "โ ๏ธ MCP configuration file not found at $mcp_config"
|
|
112
|
-
echo " This should have been copied during post-create phase"
|
|
113
|
-
return 1
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
echo "โ
MCP configuration file found"
|
|
117
|
-
|
|
118
|
-
# Verify Docker is available for GitHub MCP server
|
|
119
|
-
if [ -n "$GITHUB_PERSONAL_ACCESS_TOKEN" ] && command -v docker &> /dev/null; then
|
|
120
|
-
echo "๐ณ Pre-pulling GitHub MCP server Docker image..."
|
|
121
|
-
if docker pull ghcr.io/github/github-mcp-server:latest; then
|
|
122
|
-
echo "โ
GitHub MCP server image ready"
|
|
123
|
-
else
|
|
124
|
-
echo "โ ๏ธ Failed to pull GitHub MCP server Docker image"
|
|
125
|
-
fi
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
# Verify and setup SearXNG MCP server files when enabled (including container rebuilds)
|
|
129
|
-
if [ "${ENABLE_SEARXNG_ENHANCED_MCP:-true}" = "true" ]; then
|
|
130
|
-
echo "๐ Verifying SearXNG MCP server installation..."
|
|
131
|
-
local searxng_server="/usr/local/mcp-servers/searxng/mcp_server.py"
|
|
132
|
-
local searxng_config="/home/node/.claude/ods_config.json"
|
|
133
|
-
local config_template="/workspace/.devcontainer/config/searxng/ods_config.json"
|
|
134
|
-
|
|
135
|
-
if [ -f "$searxng_server" ]; then
|
|
136
|
-
echo "โ
SearXNG MCP server files found"
|
|
137
|
-
|
|
138
|
-
# Handle configuration during container rebuilds with existence check
|
|
139
|
-
if [ -f "$searxng_config" ]; then
|
|
140
|
-
echo "โ
SearXNG configuration file ready"
|
|
141
|
-
else
|
|
142
|
-
echo "๐ SearXNG configuration not found, copying from template..."
|
|
143
|
-
|
|
144
|
-
# Source searxng script to get setup functions
|
|
145
|
-
if [ -f "/workspace/.devcontainer/scripts/config/searxng.sh" ]; then
|
|
146
|
-
source "/workspace/.devcontainer/scripts/config/searxng.sh"
|
|
147
|
-
|
|
148
|
-
# Call configuration setup function
|
|
149
|
-
setup_searxng_config || {
|
|
150
|
-
echo "โ ๏ธ Failed to setup SearXNG configuration during container rebuild"
|
|
151
|
-
echo " You can manually copy with: cp $config_template $searxng_config"
|
|
152
|
-
}
|
|
153
|
-
else
|
|
154
|
-
echo "โ ๏ธ SearXNG setup script not found, performing basic copy..."
|
|
155
|
-
|
|
156
|
-
# Ensure Claude directory exists
|
|
157
|
-
mkdir -p "/home/node/.claude"
|
|
158
|
-
|
|
159
|
-
# Copy configuration file if template exists
|
|
160
|
-
if [ -f "$config_template" ]; then
|
|
161
|
-
cp "$config_template" "$searxng_config"
|
|
162
|
-
chown node:node "$searxng_config"
|
|
163
|
-
chmod 600 "$searxng_config"
|
|
164
|
-
echo "๐ SearXNG configuration copied from template"
|
|
165
|
-
else
|
|
166
|
-
echo "โ ๏ธ SearXNG configuration template not found at $config_template"
|
|
167
|
-
fi
|
|
168
|
-
fi
|
|
169
|
-
fi
|
|
170
|
-
else
|
|
171
|
-
echo "โ SearXNG MCP server not found at $searxng_server"
|
|
172
|
-
echo " Installation may have failed during post-create phase"
|
|
173
|
-
echo " Try running: bash /workspace/.devcontainer/scripts/config/searxng.sh"
|
|
174
|
-
fi
|
|
175
|
-
fi
|
|
176
|
-
|
|
177
|
-
return 0
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
# Function to validate environment variables and provide feedback
|
|
181
|
-
validate_environment_variables() {
|
|
182
|
-
echo "๐ Validating environment configuration..."
|
|
183
|
-
|
|
184
|
-
local missing_keys=()
|
|
185
|
-
local optional_keys=()
|
|
186
|
-
|
|
187
|
-
# Check optional API keys and track status
|
|
188
|
-
if [ "${ENABLE_TAVILY_MCP:-false}" = "true" ]; then
|
|
189
|
-
if [ -z "$TAVILY_API_KEY" ]; then
|
|
190
|
-
missing_keys+=("TAVILY_API_KEY")
|
|
191
|
-
fi
|
|
192
|
-
fi
|
|
193
|
-
|
|
194
|
-
if [ "${ENABLE_REF_TOOLS_MCP:-false}" = "true" ]; then
|
|
195
|
-
if [ -z "$REF_TOOLS_API_KEY" ]; then
|
|
196
|
-
missing_keys+=("REF_TOOLS_API_KEY")
|
|
197
|
-
fi
|
|
198
|
-
fi
|
|
199
|
-
|
|
200
|
-
if [ "${ENABLE_GITHUB_MCP:-false}" = "true" ]; then
|
|
201
|
-
if [ -z "$GITHUB_PERSONAL_ACCESS_TOKEN" ]; then
|
|
202
|
-
missing_keys+=("GITHUB_PERSONAL_ACCESS_TOKEN")
|
|
203
|
-
fi
|
|
204
|
-
fi
|
|
205
|
-
|
|
206
|
-
# Report validation results
|
|
207
|
-
if [ ${#missing_keys[@]} -eq 0 ]; then
|
|
208
|
-
echo "โ
All required environment variables configured"
|
|
209
|
-
else
|
|
210
|
-
echo "โ ๏ธ Missing API keys for enabled services:"
|
|
211
|
-
for key in "${missing_keys[@]}"; do
|
|
212
|
-
echo " โข $key"
|
|
213
|
-
done
|
|
214
|
-
echo " ๐ Add missing keys to .devcontainer/.env or disable services"
|
|
215
|
-
fi
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
# Function to display startup status summary
|
|
219
|
-
display_startup_status() {
|
|
220
|
-
echo ""
|
|
221
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
222
|
-
echo "โ ๐ ClaudePod Status Summary โ"
|
|
223
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
224
|
-
|
|
225
|
-
# Core tools status
|
|
226
|
-
echo ""
|
|
227
|
-
echo "๐ ๏ธ Core Tools:"
|
|
228
|
-
local claude_version=$(claude --version 2>/dev/null || echo "Not available")
|
|
229
|
-
echo " Claude Code: $claude_version"
|
|
230
|
-
|
|
231
|
-
local ccusage_version=$(ccusage --version 2>/dev/null || echo "Not available")
|
|
232
|
-
echo " ccusage: $ccusage_version"
|
|
233
|
-
|
|
234
|
-
# Check Node.js with proper environment sourcing
|
|
235
|
-
local node_version="Not available"
|
|
236
|
-
if command -v node &>/dev/null; then
|
|
237
|
-
node_version=$(node --version 2>/dev/null || echo "Not available")
|
|
238
|
-
elif [ -s "/usr/local/share/nvm/nvm.sh" ]; then
|
|
239
|
-
# Try sourcing NVM if Node.js not found in PATH (permissions should now be fixed)
|
|
240
|
-
if source "/usr/local/share/nvm/nvm.sh"; then
|
|
241
|
-
if command -v node &>/dev/null; then
|
|
242
|
-
node_version=$(node --version 2>/dev/null || echo "Not available")
|
|
243
|
-
fi
|
|
244
|
-
else
|
|
245
|
-
node_version="NVM sourcing failed"
|
|
246
|
-
fi
|
|
247
|
-
fi
|
|
248
|
-
echo " Node.js: $node_version"
|
|
249
|
-
|
|
250
|
-
local uvx_status=$(command -v uvx &>/dev/null && echo "Available" || echo "Not available")
|
|
251
|
-
echo " uvx: $uvx_status"
|
|
252
|
-
|
|
253
|
-
# MCP servers status
|
|
254
|
-
echo ""
|
|
255
|
-
echo "๐ MCP Servers:"
|
|
256
|
-
local enabled_count=0
|
|
257
|
-
local disabled_count=0
|
|
258
|
-
|
|
259
|
-
# Core servers (enabled by default)
|
|
260
|
-
# for server in "serena:ENABLE_SERENA_MCP:semantic code analysis" \
|
|
261
|
-
# "deepwiki:ENABLE_DEEPWIKI_MCP:documentation search" \
|
|
262
|
-
# "taskmaster:ENABLE_TASKMASTER_MCP:project management" \
|
|
263
|
-
# "sequential-thinking:ENABLE_SEQUENTIAL_THINKING_MCP:structured analysis" \
|
|
264
|
-
# "ccusage:ENABLE_CCUSAGE_MCP:usage analytics"; do
|
|
265
|
-
# IFS=':' read -r name var desc <<< "$server"
|
|
266
|
-
# if [ "${!var:-true}" = "true" ]; then
|
|
267
|
-
# echo " โ
$name ($desc)"
|
|
268
|
-
# ((enabled_count++))
|
|
269
|
-
# else
|
|
270
|
-
# echo " โ $name (disabled)"
|
|
271
|
-
# ((disabled_count++))
|
|
272
|
-
# fi
|
|
273
|
-
# done
|
|
274
|
-
|
|
275
|
-
# Optional servers (require API keys)
|
|
276
|
-
# for server in "tavily:ENABLE_TAVILY_MCP:TAVILY_API_KEY:web search" \
|
|
277
|
-
# "ref-tools:ENABLE_REF_TOOLS_MCP:REF_TOOLS_API_KEY:reference docs" \
|
|
278
|
-
# "github:ENABLE_GITHUB_MCP:GITHUB_PERSONAL_ACCESS_TOKEN:repository integration"; do
|
|
279
|
-
# IFS=':' read -r name var key desc <<< "$server"
|
|
280
|
-
# if [ "${!var:-false}" = "true" ] && [ -n "${!key}" ]; then
|
|
281
|
-
# echo " โ
$name ($desc)"
|
|
282
|
-
# ((enabled_count++))
|
|
283
|
-
# elif [ "${!var:-false}" = "true" ]; then
|
|
284
|
-
# echo " โ ๏ธ $name (missing $key)"
|
|
285
|
-
# ((disabled_count++))
|
|
286
|
-
# else
|
|
287
|
-
# echo " โ $name (disabled)"
|
|
288
|
-
# ((disabled_count++))
|
|
289
|
-
# fi
|
|
290
|
-
# done
|
|
291
|
-
|
|
292
|
-
# Shell shortcuts
|
|
293
|
-
echo ""
|
|
294
|
-
echo "โจ๏ธ Shell Shortcuts:"
|
|
295
|
-
echo " gs (git status) gd (git diff) gc (git commit)"
|
|
296
|
-
echo " gp (git push) gl (git log) ll (list files)"
|
|
297
|
-
|
|
298
|
-
# Summary and next steps
|
|
299
|
-
echo ""
|
|
300
|
-
echo "๐ Summary: $enabled_count servers enabled, $disabled_count disabled"
|
|
301
|
-
echo ""
|
|
302
|
-
echo "๐ Ready to start:"
|
|
303
|
-
echo " claude # Start Claude Code with MCP servers"
|
|
304
|
-
echo " claude mcp list # Verify MCP server connectivity"
|
|
305
|
-
echo " ccusage # View usage analytics"
|
|
306
|
-
|
|
307
|
-
# Add SearXNG info if it exists
|
|
308
|
-
local searxng_local_dir="${SEARXNG_LOCAL_INSTALL_DIR:-/opt/searxng-local}"
|
|
309
|
-
if [ "${ENABLE_SEARXNG_LOCAL:-true}" = "true" ] && [ -d "$searxng_local_dir" ] && [ -f "$searxng_local_dir/docker-compose.yaml" ]; then
|
|
310
|
-
echo ""
|
|
311
|
-
echo "๐ Local SearXNG Instance:"
|
|
312
|
-
echo " http://localhost:8080 # SearXNG web interface"
|
|
313
|
-
echo " MCP server configured for zero rate limiting"
|
|
314
|
-
echo " Location: $searxng_local_dir (persistent volume)"
|
|
315
|
-
fi
|
|
316
|
-
echo ""
|
|
317
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
# Function to start local SearXNG containers if configured
|
|
321
|
-
start_local_searxng() {
|
|
322
|
-
# Check if SearXNG local instance is enabled
|
|
323
|
-
if [ "${ENABLE_SEARXNG_LOCAL:-true}" != "true" ]; then
|
|
324
|
-
echo " โน๏ธ SearXNG local instance is disabled (using public instances)"
|
|
325
|
-
return 0
|
|
326
|
-
fi
|
|
327
|
-
|
|
328
|
-
# Source the searxng configuration functions
|
|
329
|
-
source "/workspace/.devcontainer/scripts/config/searxng.sh"
|
|
330
|
-
|
|
331
|
-
# Use the new function to start the persistent local instance
|
|
332
|
-
start_searxng_local_instance
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
# Function to display completion message
|
|
336
|
-
display_completion_message() {
|
|
337
|
-
# Validate environment first
|
|
338
|
-
validate_environment_variables
|
|
339
|
-
|
|
340
|
-
echo ""
|
|
341
|
-
echo "โ
ClaudePod Phase 3 MCP setup complete!"
|
|
342
|
-
|
|
343
|
-
# Display comprehensive startup status
|
|
344
|
-
display_startup_status
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
# Main execution
|
|
348
|
-
main() {
|
|
349
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
350
|
-
echo "๐ณ ClaudePod Post-Start Setup - Phase 3: MCP Servers"
|
|
351
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
352
|
-
|
|
353
|
-
# Ensure .claude directory exists and preserve optimized settings
|
|
354
|
-
echo "๐ง Configuring Claude Code settings..."
|
|
355
|
-
mkdir -p /workspace/.claude
|
|
356
|
-
|
|
357
|
-
# Only create basic settings if optimized settings don't exist
|
|
358
|
-
if [ ! -f "/workspace/.claude/settings.json" ]; then
|
|
359
|
-
echo " Creating basic Claude settings..."
|
|
360
|
-
cat > /workspace/.claude/settings.json << 'EOF'
|
|
361
|
-
{
|
|
362
|
-
"includeCoAuthoredBy": false,
|
|
363
|
-
"model": "claude-sonnet-4-0",
|
|
364
|
-
"forceLoginMethod": "claudeai"
|
|
365
|
-
}
|
|
366
|
-
EOF
|
|
367
|
-
echo " โน๏ธ Basic settings created (optimized settings not found)"
|
|
368
|
-
else
|
|
369
|
-
# Check if settings contain the optimized permissions
|
|
370
|
-
if grep -q '"permissions"' "/workspace/.claude/settings.json" 2>/dev/null; then
|
|
371
|
-
local allowed_count=$(grep -o '"allow"' "/workspace/.claude/settings.json" | wc -l)
|
|
372
|
-
local denied_count=$(grep -o '"deny"' "/workspace/.claude/settings.json" | wc -l)
|
|
373
|
-
echo " โ
Preserving optimized Claude settings (permissions configured)"
|
|
374
|
-
else
|
|
375
|
-
echo " โ ๏ธ Existing settings found but no optimized permissions detected"
|
|
376
|
-
fi
|
|
377
|
-
fi
|
|
378
|
-
|
|
379
|
-
echo "โ
Claude Code settings configured"
|
|
380
|
-
|
|
381
|
-
# Ensure Serena configuration exists and preserve optimized settings
|
|
382
|
-
echo "๐ง Configuring Serena settings..."
|
|
383
|
-
mkdir -p /workspace/.serena
|
|
384
|
-
|
|
385
|
-
if [ ! -f "/workspace/.serena/serena_config.yml" ]; then
|
|
386
|
-
echo " โน๏ธ No existing Serena configuration found (will use defaults)"
|
|
387
|
-
else
|
|
388
|
-
echo " โ
Preserving existing Serena configuration"
|
|
389
|
-
fi
|
|
390
|
-
|
|
391
|
-
# Ensure TaskMaster configuration exists and preserve optimized settings
|
|
392
|
-
echo "๐ง Configuring TaskMaster settings..."
|
|
393
|
-
mkdir -p /workspace/.taskmaster
|
|
394
|
-
|
|
395
|
-
if [ ! -f "/workspace/.taskmaster/config.json" ]; then
|
|
396
|
-
echo " โน๏ธ No existing TaskMaster configuration found (will use defaults)"
|
|
397
|
-
else
|
|
398
|
-
# Check if settings contain the optimized model configuration
|
|
399
|
-
if grep -q '"claude-code"' "/workspace/.taskmaster/config.json" 2>/dev/null; then
|
|
400
|
-
echo " โ
Preserving optimized TaskMaster configuration (Claude Code integration)"
|
|
401
|
-
else
|
|
402
|
-
echo " โ ๏ธ Existing TaskMaster configuration found but no Claude Code integration detected"
|
|
403
|
-
fi
|
|
404
|
-
fi
|
|
405
|
-
|
|
406
|
-
echo "โ
MCP configurations ready"
|
|
407
|
-
|
|
408
|
-
# Environment variables already loaded in post-create.sh
|
|
409
|
-
# Set environment for proper Node.js and Claude Code operation
|
|
410
|
-
echo "๐ง Configuring Node.js environment..."
|
|
411
|
-
|
|
412
|
-
# Source NVM to make Node.js and npm available (needed for MCP config generation)
|
|
413
|
-
export NVM_DIR="/usr/local/share/nvm"
|
|
414
|
-
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
415
|
-
echo "๐ง Sourcing NVM in post-start..."
|
|
416
|
-
. "$NVM_DIR/nvm.sh"
|
|
417
|
-
|
|
418
|
-
# Handle potential npm prefix conflicts with NVM
|
|
419
|
-
if command -v nvm &> /dev/null && command -v node &> /dev/null; then
|
|
420
|
-
echo "๐ง Checking NVM/npm prefix conflicts..."
|
|
421
|
-
# Only run nvm use if there's actually a prefix conflict, not just because Node.js exists
|
|
422
|
-
local current_prefix=$(npm config get prefix 2>/dev/null || echo "")
|
|
423
|
-
local expected_prefix="/home/node/.local"
|
|
424
|
-
|
|
425
|
-
if [ -n "$current_prefix" ] && [ "$current_prefix" != "$expected_prefix" ]; then
|
|
426
|
-
echo "๐ง Resolving npm prefix conflict by removing conflicting settings"
|
|
427
|
-
# Remove prefix settings that conflict with NVM instead of setting them
|
|
428
|
-
npm config delete prefix 2>/dev/null || true
|
|
429
|
-
npm config delete globalconfig 2>/dev/null || true
|
|
430
|
-
echo "โ
Removed conflicting npm prefix settings for NVM compatibility"
|
|
431
|
-
else
|
|
432
|
-
echo "โ
NVM/npm prefix already correct"
|
|
433
|
-
fi
|
|
434
|
-
fi
|
|
435
|
-
|
|
436
|
-
# Verify Node.js is now available
|
|
437
|
-
if command -v node &> /dev/null; then
|
|
438
|
-
echo "โ
Node.js available for MCP generation: $(node --version)"
|
|
439
|
-
else
|
|
440
|
-
echo "โ ๏ธ Node.js still not available after sourcing NVM"
|
|
441
|
-
fi
|
|
442
|
-
else
|
|
443
|
-
echo "โ ๏ธ NVM not found at $NVM_DIR/nvm.sh"
|
|
444
|
-
fi
|
|
445
|
-
|
|
446
|
-
# Set PATH and HOME for proper Claude Code operation
|
|
447
|
-
export PATH="/home/node/.local/bin:$PATH"
|
|
448
|
-
export HOME="/home/node"
|
|
449
|
-
|
|
450
|
-
# Ensure proper ownership of .local directory
|
|
451
|
-
chown -R node:node /home/node/.local 2>/dev/null || true
|
|
452
|
-
|
|
453
|
-
# CRITICAL: Re-load environment variables from .devcontainer/.env
|
|
454
|
-
# Why this is needed AGAIN after post-create.sh:
|
|
455
|
-
# - Environment variables set in post-create.sh are only available during that shell session
|
|
456
|
-
# - Container restarts/rebuilds lose those environment variables since they're not persisted
|
|
457
|
-
# - MCP config generation happens during post-start phase and requires API keys from .env
|
|
458
|
-
# - Without this re-loading, MCP servers requiring API keys will be disabled due to missing env vars
|
|
459
|
-
if [ -f "/workspace/.devcontainer/.env" ]; then
|
|
460
|
-
echo "๐ Re-loading environment variables from .devcontainer/.env (required after container rebuild)"
|
|
461
|
-
set -a # Export all variables
|
|
462
|
-
source "/workspace/.devcontainer/.env"
|
|
463
|
-
set +a # Stop exporting
|
|
464
|
-
echo "โ
Environment variables reloaded for MCP server configuration"
|
|
465
|
-
else
|
|
466
|
-
echo "โ ๏ธ .devcontainer/.env file not found - MCP servers requiring API keys will be disabled"
|
|
467
|
-
fi
|
|
468
|
-
|
|
469
|
-
# Generate MCP configuration from template
|
|
470
|
-
echo "๐ง Generating MCP configuration from template..."
|
|
471
|
-
if [ -f "/workspace/.devcontainer/config/claude/mcp.json.template" ]; then
|
|
472
|
-
# Use Node.js to generate configuration with environment loaded
|
|
473
|
-
if command -v node &> /dev/null; then
|
|
474
|
-
# Ensure script is executable and run with explicit node
|
|
475
|
-
# Note: The script now uses dotenv to load environment variables directly
|
|
476
|
-
chmod +x /workspace/.devcontainer/scripts/generate-mcp-config.js
|
|
477
|
-
if node /workspace/.devcontainer/scripts/generate-mcp-config.js; then
|
|
478
|
-
echo "โ
MCP configuration generated successfully"
|
|
479
|
-
# Validate generated configuration
|
|
480
|
-
validate_mcp_configuration
|
|
481
|
-
else
|
|
482
|
-
echo "โ ๏ธ Failed to generate MCP configuration from template"
|
|
483
|
-
echo " Fallback: using existing mcp.json if available"
|
|
484
|
-
fi
|
|
485
|
-
else
|
|
486
|
-
echo "โ ๏ธ Node.js not available - cannot generate MCP configuration"
|
|
487
|
-
echo " Using existing mcp.json configuration"
|
|
488
|
-
fi
|
|
489
|
-
else
|
|
490
|
-
echo "โน๏ธ No MCP template found - using existing configuration"
|
|
491
|
-
fi
|
|
492
|
-
|
|
493
|
-
# Check if Claude is available with detailed debugging
|
|
494
|
-
echo "๐ Checking Claude Code availability..."
|
|
495
|
-
echo " PATH: $PATH"
|
|
496
|
-
echo " Current user: $(whoami)"
|
|
497
|
-
echo " Home directory: $HOME"
|
|
498
|
-
|
|
499
|
-
if command -v claude &> /dev/null; then
|
|
500
|
-
echo "โ
Claude Code found in PATH: $(which claude)"
|
|
501
|
-
elif [ -f "/home/node/.local/bin/claude" ]; then
|
|
502
|
-
echo "โ
Claude Code found at: /home/node/.local/bin/claude"
|
|
503
|
-
# Ensure it's executable
|
|
504
|
-
chmod +x /home/node/.local/bin/claude
|
|
505
|
-
else
|
|
506
|
-
echo "โ Claude Code not found. Checking installation..."
|
|
507
|
-
echo " Contents of /home/node/.local/bin/:"
|
|
508
|
-
ls -la /home/node/.local/bin/ 2>/dev/null || echo " Directory not found"
|
|
509
|
-
echo " Searching for claude binary:"
|
|
510
|
-
find /home/node/.local -name "claude*" -type f 2>/dev/null || echo " No claude binary found"
|
|
511
|
-
echo ""
|
|
512
|
-
echo " Please ensure Phase 2 (post-create) completed successfully."
|
|
513
|
-
echo " You can manually install Claude Code with:"
|
|
514
|
-
echo " npm install -g @anthropic-ai/claude-code"
|
|
515
|
-
exit 1
|
|
516
|
-
fi
|
|
517
|
-
|
|
518
|
-
echo "โ
Claude Code is available"
|
|
519
|
-
|
|
520
|
-
# Test Claude MCP functionality
|
|
521
|
-
echo "๐งช Testing Claude MCP functionality..."
|
|
522
|
-
if claude mcp list &>/dev/null; then
|
|
523
|
-
echo "โ
Claude MCP commands working"
|
|
524
|
-
else
|
|
525
|
-
echo "โ ๏ธ Claude MCP commands may not be fully initialized"
|
|
526
|
-
echo " This is normal for first run - continuing with installation..."
|
|
527
|
-
fi
|
|
528
|
-
|
|
529
|
-
echo "โ
Node.js environment configured"
|
|
530
|
-
|
|
531
|
-
# Install uv (for future MCP servers that might need it)
|
|
532
|
-
install_uv || echo "โ ๏ธ Continuing without uv/uvx..."
|
|
533
|
-
|
|
534
|
-
# Start SearXNG containers if configured for local instance
|
|
535
|
-
echo "๐ Checking SearXNG container setup..."
|
|
536
|
-
start_local_searxng
|
|
537
|
-
|
|
538
|
-
# Verify MCP configuration instead of installing servers
|
|
539
|
-
if verify_mcp_config; then
|
|
540
|
-
display_completion_message
|
|
541
|
-
exit 0
|
|
542
|
-
else
|
|
543
|
-
echo "โ ๏ธ MCP configuration verification failed."
|
|
544
|
-
echo " MCP servers are configured via mcp.json file."
|
|
545
|
-
echo " Check that the file was copied correctly during post-create phase."
|
|
546
|
-
exit 0
|
|
547
|
-
fi
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
# Execute main function
|
|
551
|
-
main
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Sanitize system prompt markdown for Claude CLI usage
|
|
3
|
-
# This script converts a markdown file to a format suitable for --append-system-prompt
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
if [ $# -eq 0 ]; then
|
|
8
|
-
echo "Usage: $0 <markdown-file>"
|
|
9
|
-
exit 1
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
|
-
MARKDOWN_FILE="$1"
|
|
13
|
-
|
|
14
|
-
if [ ! -f "$MARKDOWN_FILE" ]; then
|
|
15
|
-
echo "Error: File '$MARKDOWN_FILE' not found"
|
|
16
|
-
exit 1
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
# Read the markdown file and perform sanitization
|
|
20
|
-
cat "$MARKDOWN_FILE" | \
|
|
21
|
-
# Remove leading/trailing whitespace from each line
|
|
22
|
-
sed 's/^[[:space:]]*//; s/[[:space:]]*$//' | \
|
|
23
|
-
# Escape double quotes
|
|
24
|
-
sed 's/"/\\"/g' | \
|
|
25
|
-
# Escape backslashes
|
|
26
|
-
sed 's/\\/\\\\/g' | \
|
|
27
|
-
# Join all lines with literal \n
|
|
28
|
-
tr '\n' '\001' | \
|
|
29
|
-
sed 's/\001/\\n/g' | \
|
|
30
|
-
# Remove any trailing \n
|
|
31
|
-
sed 's/\\n$//'
|