codeforge-dev 1.4.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.
- package/.devcontainer/.env +22 -0
- package/.devcontainer/CHANGELOG.md +197 -0
- package/.devcontainer/CLAUDE.md +117 -0
- package/.devcontainer/README.md +222 -0
- package/.devcontainer/config/main-system-prompt.md +502 -0
- package/.devcontainer/config/settings.json +47 -0
- package/.devcontainer/devcontainer.json +94 -0
- package/.devcontainer/features/README.md +113 -0
- package/.devcontainer/features/agent-browser/README.md +65 -0
- package/.devcontainer/features/agent-browser/devcontainer-feature.json +23 -0
- package/.devcontainer/features/agent-browser/install.sh +79 -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 +40 -0
- package/.devcontainer/features/lsp-servers/install.sh +116 -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/notify-hook/README.md +86 -0
- package/.devcontainer/features/notify-hook/devcontainer-feature.json +23 -0
- package/.devcontainer/features/notify-hook/install.sh +38 -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/plugins/devs-marketplace/.claude-plugin/marketplace.json +106 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/format-file.py +101 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/scripts/lint-file.py +137 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/.claude-plugin/plugin.json +8 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/claude-code-headless/SKILL.md +387 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/claude-code-headless/references/cli-flags-and-output.md +312 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/claude-code-headless/references/sdk-and-mcp.md +569 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker/SKILL.md +309 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker/references/compose-services.md +438 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker/references/dockerfile-patterns.md +340 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker-py/SKILL.md +412 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker-py/references/container-lifecycle.md +388 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker-py/references/resources-and-security.md +444 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/SKILL.md +344 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/middleware-and-lifespan.md +254 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/pydantic-models.md +245 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/routing-and-dependencies.md +255 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/sse-and-streaming.md +318 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/pydantic-ai/SKILL.md +345 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/pydantic-ai/references/agents-and-tools.md +271 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/pydantic-ai/references/models-and-streaming.md +422 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/SKILL.md +220 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/references/cross-vendor-principles.md +139 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/references/patterns-and-antipatterns.md +376 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/references/skill-authoring-patterns.md +356 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/SKILL.md +329 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/advanced-queries.md +314 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/javascript-patterns.md +323 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/python-patterns.md +354 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/schema-and-pragmas.md +326 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/SKILL.md +356 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/ai-sdk-svelte.md +128 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/component-patterns.md +332 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/layercake.md +203 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/migration-guide.md +350 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/runes-and-reactivity.md +328 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/spa-and-routing.md +262 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/svelte-dnd-action.md +181 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/testing/SKILL.md +414 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/testing/references/fastapi-testing.md +411 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/testing/references/svelte-testing.md +538 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codeforge-lsp/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/scripts/block-dangerous.py +110 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/notify-hook/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/notify-hook/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/guard-protected.py +108 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272create-pr.md +337 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272new.md +166 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272review-commit.md +290 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272work.md +257 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/plugin.json +8 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/system-prompt.md +184 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/.claude-plugin/plugin.json +6 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/config/planning-instructions.md +14 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/functional-conjuring-map.md +989 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/hooks/hooks.json +33 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/__pycache__/post-enhance-task.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhance-planning.py +71 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-plan.sh +68 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-task.sh +120 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-plan.py +133 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-task.py +253 -0
- package/.devcontainer/scripts/setup-aliases.sh +80 -0
- package/.devcontainer/scripts/setup-config.sh +28 -0
- package/.devcontainer/scripts/setup-irie-claude.sh +32 -0
- package/.devcontainer/scripts/setup-plugins.sh +80 -0
- package/.devcontainer/scripts/setup.sh +58 -0
- package/LICENSE.txt +674 -0
- package/README.md +267 -0
- package/package.json +44 -0
- package/setup.js +83 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# ==============================
|
|
5
|
+
# Claude Monitor DevContainer Feature
|
|
6
|
+
# ABSOLUTE, PATH-INDEPENDENT
|
|
7
|
+
# ==============================
|
|
8
|
+
|
|
9
|
+
MONITOR_VERSION="${VERSION:-latest}"
|
|
10
|
+
INSTALLER="${INSTALLER:-uv}"
|
|
11
|
+
USERNAME="${USERNAME:-automatic}"
|
|
12
|
+
|
|
13
|
+
echo "[claude-monitor] Starting installation..."
|
|
14
|
+
|
|
15
|
+
# ---------- USER ----------
|
|
16
|
+
if [[ "${USERNAME}" == "auto" || "${USERNAME}" == "automatic" ]]; then
|
|
17
|
+
for u in vscode node codespace; do
|
|
18
|
+
if id -u "$u" >/dev/null 2>&1; then
|
|
19
|
+
USERNAME="$u"
|
|
20
|
+
break
|
|
21
|
+
fi
|
|
22
|
+
done
|
|
23
|
+
USERNAME="${USERNAME:-root}"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
USER_HOME="$(eval echo "~${USERNAME}")"
|
|
27
|
+
|
|
28
|
+
echo "[claude-monitor] Target user: ${USERNAME}"
|
|
29
|
+
echo "[claude-monitor] Home: ${USER_HOME}"
|
|
30
|
+
echo "[claude-monitor] Installer: ${INSTALLER}"
|
|
31
|
+
|
|
32
|
+
fail() {
|
|
33
|
+
echo "[claude-monitor] ERROR: $1" >&2
|
|
34
|
+
exit 1
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
run_as_user() {
|
|
38
|
+
sudo -u "${USERNAME}" env \
|
|
39
|
+
HOME="${USER_HOME}" \
|
|
40
|
+
"$@"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# ---------- UV DISCOVERY (THE IMPORTANT PART) ----------
|
|
44
|
+
find_uv() {
|
|
45
|
+
# 1. PATH (if lucky)
|
|
46
|
+
command -v uv 2>/dev/null && return 0
|
|
47
|
+
command -v uvx 2>/dev/null && return 0
|
|
48
|
+
|
|
49
|
+
# 2. Known devcontainer locations
|
|
50
|
+
for p in \
|
|
51
|
+
/usr/local/bin/uv \
|
|
52
|
+
/usr/bin/uv \
|
|
53
|
+
/opt/uv/bin/uv \
|
|
54
|
+
/usr/local/bin/uvx \
|
|
55
|
+
/usr/bin/uvx \
|
|
56
|
+
/opt/uv/bin/uvx
|
|
57
|
+
do
|
|
58
|
+
[[ -x "$p" ]] && echo "$p" && return 0
|
|
59
|
+
done
|
|
60
|
+
|
|
61
|
+
# 3. Last resort: shallow filesystem scan (bounded, safe)
|
|
62
|
+
find /usr /opt -maxdepth 4 -type f \( -name uv -o -name uvx \) -executable 2>/dev/null | head -n 1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# ---------- INSTALL ----------
|
|
66
|
+
case "${INSTALLER}" in
|
|
67
|
+
uv)
|
|
68
|
+
UV_BIN="$(find_uv || true)"
|
|
69
|
+
[[ -n "${UV_BIN}" ]] || fail "uv is not installed (devcontainer uv feature missing or broken)"
|
|
70
|
+
|
|
71
|
+
echo "[claude-monitor] Using uv at: ${UV_BIN}"
|
|
72
|
+
|
|
73
|
+
if [[ "${MONITOR_VERSION}" == "latest" ]]; then
|
|
74
|
+
run_as_user "${UV_BIN}" tool install claude-monitor
|
|
75
|
+
else
|
|
76
|
+
run_as_user "${UV_BIN}" tool install "claude-monitor==${MONITOR_VERSION}"
|
|
77
|
+
fi
|
|
78
|
+
;;
|
|
79
|
+
*)
|
|
80
|
+
fail "Only uv is supported in this feature. Use the uv devcontainer feature."
|
|
81
|
+
;;
|
|
82
|
+
esac
|
|
83
|
+
|
|
84
|
+
# === VERIFICATION ===
|
|
85
|
+
echo "[claude-monitor] Verifying installation..."
|
|
86
|
+
|
|
87
|
+
BIN_DIR="${USER_HOME}/.local/bin"
|
|
88
|
+
|
|
89
|
+
if [ -x "${BIN_DIR}/claude-monitor" ]; then
|
|
90
|
+
INSTALLED_VERSION="$("${BIN_DIR}/claude-monitor" --version 2>/dev/null || echo "unknown")"
|
|
91
|
+
echo "[claude-monitor] ✓ claude-monitor installed (${INSTALLED_VERSION})"
|
|
92
|
+
elif [ -x "${BIN_DIR}/cmonitor" ]; then
|
|
93
|
+
INSTALLED_VERSION="$("${BIN_DIR}/cmonitor" --version 2>/dev/null || echo "unknown")"
|
|
94
|
+
echo "[claude-monitor] ✓ cmonitor installed (${INSTALLED_VERSION})"
|
|
95
|
+
else
|
|
96
|
+
echo "[claude-monitor] ERROR: Executable not found in ${BIN_DIR}"
|
|
97
|
+
ls -la "${BIN_DIR}" || true
|
|
98
|
+
exit 1
|
|
99
|
+
fi
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# LSP Servers for Claude Code
|
|
2
|
+
|
|
3
|
+
**Installs language server binaries for Python and TypeScript to enable Claude Code's code intelligence features.**
|
|
4
|
+
|
|
5
|
+
This feature installs the LSP server binaries that Claude Code's code-intelligence plugins require. The binaries must be in `$PATH` for the plugins to function.
|
|
6
|
+
|
|
7
|
+
## What Gets Installed
|
|
8
|
+
|
|
9
|
+
| Language | Binary | Package |
|
|
10
|
+
|----------|--------|---------|
|
|
11
|
+
| Python | `pyright-langserver` | `pyright` |
|
|
12
|
+
| TypeScript | `typescript-language-server` | `typescript-language-server` + `typescript` |
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Add to your `devcontainer.json`:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"features": {
|
|
21
|
+
"ghcr.io/devcontainers/features/node:1": {},
|
|
22
|
+
"./features/lsp-servers": {}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
|
|
29
|
+
| Option | Type | Default | Description |
|
|
30
|
+
|--------|------|---------|-------------|
|
|
31
|
+
| `pyrightVersion` | string | `"latest"` | Pyright package version |
|
|
32
|
+
| `typescriptLspVersion` | string | `"latest"` | typescript-language-server version |
|
|
33
|
+
| `typescriptVersion` | string | `"latest"` | TypeScript package version |
|
|
34
|
+
| `username` | string | `"automatic"` | Container user for fallback install |
|
|
35
|
+
|
|
36
|
+
## Example with Pinned Versions
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"features": {
|
|
41
|
+
"./features/lsp-servers": {
|
|
42
|
+
"pyrightVersion": "1.1.350",
|
|
43
|
+
"typescriptLspVersion": "4.3.0",
|
|
44
|
+
"typescriptVersion": "5.3.0"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Prerequisites
|
|
51
|
+
|
|
52
|
+
- Node.js feature must be installed first (provides npm)
|
|
53
|
+
|
|
54
|
+
## Claude Code Plugin Installation
|
|
55
|
+
|
|
56
|
+
After the container builds, install the Claude Code LSP plugins:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
claude plugin install pyright-lsp@claude-plugins-official
|
|
60
|
+
claude plugin install typescript-lsp@claude-plugins-official
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or use the `setup-lsp.sh` script which handles this automatically.
|
|
64
|
+
|
|
65
|
+
## Verification
|
|
66
|
+
|
|
67
|
+
Check that binaries are available:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pyright-langserver --version
|
|
71
|
+
typescript-language-server --version
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Check Claude Code plugin status:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
/plugin
|
|
78
|
+
# Navigate to Errors tab - should show no "Executable not found" errors
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## See Also
|
|
82
|
+
|
|
83
|
+
- [Claude Code: Discover Plugins](https://code.claude.com/docs/en/discover-plugins#code-intelligence)
|
|
84
|
+
- [Pyright](https://github.com/microsoft/pyright)
|
|
85
|
+
- [TypeScript Language Server](https://github.com/typescript-language-server/typescript-language-server)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "lsp-servers",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"name": "LSP Servers for Claude Code",
|
|
5
|
+
"description": "Installs language server binaries for Python (pyright), TypeScript (typescript-language-server), and Go (gopls)",
|
|
6
|
+
"maintainer": "AnExiledDev",
|
|
7
|
+
"documentationURL": "https://code.claude.com/docs/en/discover-plugins#code-intelligence",
|
|
8
|
+
"options": {
|
|
9
|
+
"pyrightVersion": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Pyright npm package version (e.g., 'latest', '1.1.350')",
|
|
12
|
+
"default": "latest"
|
|
13
|
+
},
|
|
14
|
+
"typescriptLspVersion": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "typescript-language-server npm package version (e.g., 'latest', '4.3.0')",
|
|
17
|
+
"default": "latest"
|
|
18
|
+
},
|
|
19
|
+
"typescriptVersion": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "TypeScript npm package version (e.g., 'latest', '5.3.0')",
|
|
22
|
+
"default": "latest"
|
|
23
|
+
},
|
|
24
|
+
"goplsVersion": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "gopls version (e.g., 'latest', 'v0.16.0')",
|
|
27
|
+
"default": "latest"
|
|
28
|
+
},
|
|
29
|
+
"username": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Container user to install for",
|
|
32
|
+
"default": "automatic"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"installsAfter": [
|
|
36
|
+
"ghcr.io/devcontainers/features/common-utils:2",
|
|
37
|
+
"ghcr.io/devcontainers/features/node:1",
|
|
38
|
+
"ghcr.io/devcontainers/features/go:1"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# LSP Servers for Claude Code
|
|
3
|
+
# Installs pyright, typescript-language-server, and gopls binaries
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
PYRIGHT_VERSION="${PYRIGHTVERSION:-latest}"
|
|
8
|
+
TSLSP_VERSION="${TYPESCRIPTLSPVERSION:-latest}"
|
|
9
|
+
TS_VERSION="${TYPESCRIPTVERSION:-latest}"
|
|
10
|
+
GOPLS_VERSION="${GOPLSVERSION:-latest}"
|
|
11
|
+
USERNAME="${USERNAME:-automatic}"
|
|
12
|
+
|
|
13
|
+
echo "[lsp-servers] Starting installation..."
|
|
14
|
+
echo "[lsp-servers] Pyright version: ${PYRIGHT_VERSION}"
|
|
15
|
+
echo "[lsp-servers] TypeScript LSP version: ${TSLSP_VERSION}"
|
|
16
|
+
echo "[lsp-servers] TypeScript version: ${TS_VERSION}"
|
|
17
|
+
echo "[lsp-servers] gopls version: ${GOPLS_VERSION}"
|
|
18
|
+
|
|
19
|
+
# Source nvm if available
|
|
20
|
+
if [ -f /usr/local/share/nvm/nvm.sh ]; then
|
|
21
|
+
source /usr/local/share/nvm/nvm.sh
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Validate npm is available
|
|
25
|
+
if ! command -v npm &>/dev/null; then
|
|
26
|
+
echo "[lsp-servers] ERROR: npm not available"
|
|
27
|
+
echo " Ensure node feature is installed first"
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Detect user
|
|
32
|
+
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
|
|
33
|
+
if [ -n "${_REMOTE_USER:-}" ]; then
|
|
34
|
+
USERNAME="${_REMOTE_USER}"
|
|
35
|
+
elif getent passwd vscode >/dev/null 2>&1; then
|
|
36
|
+
USERNAME="vscode"
|
|
37
|
+
elif getent passwd node >/dev/null 2>&1; then
|
|
38
|
+
USERNAME="node"
|
|
39
|
+
elif getent passwd codespace >/dev/null 2>&1; then
|
|
40
|
+
USERNAME="codespace"
|
|
41
|
+
else
|
|
42
|
+
USERNAME="root"
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
echo "[lsp-servers] Installing for user: ${USERNAME}"
|
|
47
|
+
|
|
48
|
+
install_npm_package() {
|
|
49
|
+
local name="$1"
|
|
50
|
+
local package="$2"
|
|
51
|
+
local version="$3"
|
|
52
|
+
|
|
53
|
+
if [ "${version}" = "latest" ]; then
|
|
54
|
+
NPM_PACKAGE="${package}"
|
|
55
|
+
else
|
|
56
|
+
NPM_PACKAGE="${package}@${version}"
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
echo "[lsp-servers] Installing ${name}..."
|
|
60
|
+
npm install -g "${NPM_PACKAGE}" 2>/dev/null || {
|
|
61
|
+
echo "[lsp-servers] WARNING: Global install failed for ${name}, trying user install"
|
|
62
|
+
su - "${USERNAME}" -c "npm install -g ${NPM_PACKAGE}" 2>/dev/null || {
|
|
63
|
+
echo "[lsp-servers] ERROR: Failed to install ${name}"
|
|
64
|
+
return 1
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# Install Pyright (Python LSP)
|
|
70
|
+
install_npm_package "pyright" "pyright" "${PYRIGHT_VERSION}"
|
|
71
|
+
|
|
72
|
+
# Install TypeScript (required by typescript-language-server)
|
|
73
|
+
install_npm_package "typescript" "typescript" "${TS_VERSION}"
|
|
74
|
+
|
|
75
|
+
# Install TypeScript Language Server
|
|
76
|
+
install_npm_package "typescript-language-server" "typescript-language-server" "${TSLSP_VERSION}"
|
|
77
|
+
|
|
78
|
+
# Install gopls (Go LSP) - uses go install since it's a Go package
|
|
79
|
+
echo "[lsp-servers] Installing gopls..."
|
|
80
|
+
if command -v go &>/dev/null; then
|
|
81
|
+
if [ "${GOPLS_VERSION}" = "latest" ]; then
|
|
82
|
+
go install "golang.org/x/tools/gopls@latest" || {
|
|
83
|
+
echo "[lsp-servers] WARNING: Failed to install gopls"
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
go install "golang.org/x/tools/gopls@${GOPLS_VERSION}" || {
|
|
87
|
+
echo "[lsp-servers] WARNING: Failed to install gopls"
|
|
88
|
+
}
|
|
89
|
+
fi
|
|
90
|
+
else
|
|
91
|
+
echo "[lsp-servers] WARNING: Go not available, skipping gopls"
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
# Verify installations
|
|
95
|
+
echo ""
|
|
96
|
+
echo "[lsp-servers] Verifying installations..."
|
|
97
|
+
|
|
98
|
+
if command -v pyright-langserver &>/dev/null; then
|
|
99
|
+
echo "[lsp-servers] pyright-langserver: $(pyright-langserver --version 2>/dev/null || echo 'installed')"
|
|
100
|
+
else
|
|
101
|
+
echo "[lsp-servers] WARNING: pyright-langserver not found in PATH"
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
if command -v typescript-language-server &>/dev/null; then
|
|
105
|
+
echo "[lsp-servers] typescript-language-server: $(typescript-language-server --version 2>/dev/null || echo 'installed')"
|
|
106
|
+
else
|
|
107
|
+
echo "[lsp-servers] WARNING: typescript-language-server not found in PATH"
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
if command -v gopls &>/dev/null; then
|
|
111
|
+
echo "[lsp-servers] gopls: $(gopls version 2>/dev/null | head -1 || echo 'installed')"
|
|
112
|
+
else
|
|
113
|
+
echo "[lsp-servers] WARNING: gopls not found in PATH (Go may not be installed)"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
echo "[lsp-servers] Installation complete"
|