deepdebug-local-agent 0.3.17 → 1.0.2
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/.dockerignore +38 -21
- package/.github/workflows/npm-publish.yml +76 -0
- package/Dockerfile +55 -27
- package/build.sh +123 -0
- package/docker-compose.yml +104 -0
- package/docs/ENTERPRISE_DEPLOYMENT_GUIDE.md +462 -0
- package/docs/QUICKSTART.md +193 -0
- package/docs/SECURITY_WHITEPAPER.md +249 -0
- package/env.example +41 -0
- package/helm/Chart.yaml +17 -0
- package/helm/templates/_helpers.tpl +60 -0
- package/helm/templates/deployment.yaml +95 -0
- package/helm/templates/secret.yaml +9 -0
- package/helm/templates/service.yaml +18 -0
- package/helm/values.yaml +162 -0
- package/package.json +55 -20
- package/src/mcp-http-server.js +3 -99
- package/src/runtimes/base-runtime.js +1 -1
- package/src/runtimes/java/java-integrations.js +1 -1
- package/src/runtimes/node/node-integrations.js +1 -1
- package/src/server.js +81 -0
- package/src/workspace/detect-port.js +1 -0
- package/.idea/deepdebug-local-agent.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- /package/{cloudbuild.yaml → cloudbuild.yaml.deprecated} +0 -0
package/.dockerignore
CHANGED
|
@@ -1,25 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build outputs
|
|
5
|
+
dist/
|
|
6
|
+
release/
|
|
7
|
+
*.exe
|
|
8
|
+
|
|
9
|
+
# Environment files
|
|
5
10
|
.env
|
|
6
11
|
.env.*
|
|
7
|
-
|
|
12
|
+
!.env.example
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
*.log
|
|
16
|
+
logs/
|
|
17
|
+
npm-debug.log*
|
|
18
|
+
yarn-debug.log
|
|
19
|
+
yarn-error.log
|
|
20
|
+
|
|
21
|
+
# OS files
|
|
8
22
|
.DS_Store
|
|
23
|
+
*/.DS_Store
|
|
24
|
+
**/.DS_Store
|
|
9
25
|
Thumbs.db
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
|
|
27
|
+
# IDE
|
|
28
|
+
.idea/
|
|
29
|
+
.vscode/
|
|
30
|
+
*.swp
|
|
31
|
+
*.swo
|
|
32
|
+
*.sublime-*
|
|
33
|
+
*.iml
|
|
34
|
+
|
|
35
|
+
# Test coverage
|
|
36
|
+
coverage/
|
|
37
|
+
.nyc_output/
|
|
38
|
+
|
|
39
|
+
# Temp files
|
|
40
|
+
tmp/
|
|
41
|
+
temp/
|
|
42
|
+
*.tmp
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: Publish NPM Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- 'src/**'
|
|
8
|
+
- 'package.json'
|
|
9
|
+
- 'bin/**'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: '20'
|
|
28
|
+
registry-url: 'https://registry.npmjs.org'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm install
|
|
32
|
+
|
|
33
|
+
- name: Configure git
|
|
34
|
+
run: |
|
|
35
|
+
git config user.email "ci@deepdebug.ai"
|
|
36
|
+
git config user.name "CI Bot"
|
|
37
|
+
|
|
38
|
+
- name: Commit lock file if changed
|
|
39
|
+
run: |
|
|
40
|
+
git add package-lock.json || true
|
|
41
|
+
git diff --staged --quiet || git commit -m "chore: update package-lock.json [skip ci]"
|
|
42
|
+
|
|
43
|
+
- name: Bump patch version
|
|
44
|
+
run: |
|
|
45
|
+
npm version patch -m "ci: auto bump to %s [skip ci]"
|
|
46
|
+
git push origin main --follow-tags
|
|
47
|
+
|
|
48
|
+
- name: Check if version exists
|
|
49
|
+
id: version_check
|
|
50
|
+
run: |
|
|
51
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
52
|
+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
53
|
+
echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION exists..."
|
|
54
|
+
|
|
55
|
+
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
|
|
56
|
+
echo "Version $PACKAGE_VERSION already exists on NPM"
|
|
57
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
58
|
+
else
|
|
59
|
+
echo "Version $PACKAGE_VERSION is new"
|
|
60
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
61
|
+
fi
|
|
62
|
+
env:
|
|
63
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
64
|
+
|
|
65
|
+
- name: Publish to NPM
|
|
66
|
+
if: steps.version_check.outputs.exists == 'false'
|
|
67
|
+
run: npm publish --access public
|
|
68
|
+
env:
|
|
69
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
70
|
+
|
|
71
|
+
- name: Skip publish (version exists)
|
|
72
|
+
if: steps.version_check.outputs.exists == 'true'
|
|
73
|
+
run: echo "⏭️ Skipping publish - version already exists on NPM"
|
|
74
|
+
|
|
75
|
+
- name: Show published version
|
|
76
|
+
run: echo "✅ Published $(node -p "require('./package.json').version")"
|
package/Dockerfile
CHANGED
|
@@ -1,46 +1,74 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
1
|
+
# ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
# ║ DeepDebug Local Agent - Enterprise Docker ║
|
|
3
|
+
# ║ ║
|
|
4
|
+
# ║ Security-hardened container for enterprise deployments ║
|
|
5
|
+
# ║ Supports: Kubernetes, OpenShift, Docker Compose ║
|
|
6
|
+
# ╚══════════════════════════════════════════════════════════════╝
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
# ===========================================
|
|
9
|
+
# Stage 1: Build
|
|
10
|
+
# ===========================================
|
|
11
|
+
FROM node:20-alpine AS builder
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
WORKDIR /app
|
|
10
|
-
|
|
11
|
-
# Install git (needed for some operations)
|
|
12
|
-
RUN apk add --no-cache git bash
|
|
13
|
+
WORKDIR /build
|
|
13
14
|
|
|
14
|
-
# Copy package files first
|
|
15
|
+
# Copy package files first (better cache)
|
|
15
16
|
COPY package*.json ./
|
|
16
17
|
|
|
17
18
|
# Install dependencies (production only)
|
|
18
|
-
|
|
19
|
+
# Using npm install instead of npm ci for repos without package-lock.json
|
|
20
|
+
RUN npm install --omit=dev && npm cache clean --force
|
|
19
21
|
|
|
20
22
|
# Copy source code
|
|
21
23
|
COPY src/ ./src/
|
|
22
|
-
COPY index.js ./
|
|
23
24
|
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
# ===========================================
|
|
26
|
+
# Stage 2: Production
|
|
27
|
+
# ===========================================
|
|
28
|
+
FROM node:20-alpine AS production
|
|
29
|
+
|
|
30
|
+
# Security: Add labels for compliance
|
|
31
|
+
LABEL org.opencontainers.image.title="DeepDebug Local Agent"
|
|
32
|
+
LABEL org.opencontainers.image.description="Enterprise debugging agent for code analysis"
|
|
33
|
+
LABEL org.opencontainers.image.vendor="InspTech AI"
|
|
34
|
+
LABEL org.opencontainers.image.version="1.0.0"
|
|
35
|
+
LABEL org.opencontainers.image.licenses="Proprietary"
|
|
36
|
+
LABEL security.scan.required="true"
|
|
27
37
|
|
|
28
|
-
# Create
|
|
29
|
-
RUN
|
|
38
|
+
# Security: Create non-root user
|
|
39
|
+
RUN addgroup -g 1001 -S deepdebug && \
|
|
40
|
+
adduser -u 1001 -S deepdebug -G deepdebug
|
|
30
41
|
|
|
31
|
-
#
|
|
42
|
+
# Security: Install security updates
|
|
43
|
+
RUN apk update && \
|
|
44
|
+
apk upgrade --no-cache && \
|
|
45
|
+
apk add --no-cache \
|
|
46
|
+
dumb-init \
|
|
47
|
+
git \
|
|
48
|
+
curl \
|
|
49
|
+
&& rm -rf /var/cache/apk/*
|
|
50
|
+
|
|
51
|
+
WORKDIR /app
|
|
52
|
+
|
|
53
|
+
# Copy from builder with correct ownership
|
|
54
|
+
COPY --from=builder --chown=deepdebug:deepdebug /build/node_modules ./node_modules
|
|
55
|
+
COPY --from=builder --chown=deepdebug:deepdebug /build/src ./src
|
|
56
|
+
COPY --chown=deepdebug:deepdebug package*.json ./
|
|
57
|
+
|
|
58
|
+
# Security: Switch to non-root user
|
|
32
59
|
USER deepdebug
|
|
33
60
|
|
|
34
|
-
#
|
|
35
|
-
|
|
61
|
+
# Health check
|
|
62
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
63
|
+
CMD curl -f http://localhost:5055/health || exit 1
|
|
36
64
|
|
|
37
|
-
#
|
|
65
|
+
# Environment
|
|
38
66
|
ENV NODE_ENV=production
|
|
39
|
-
ENV PORT=
|
|
67
|
+
ENV PORT=5055
|
|
40
68
|
|
|
41
|
-
#
|
|
42
|
-
|
|
43
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
|
|
69
|
+
# Expose port
|
|
70
|
+
EXPOSE 5055
|
|
44
71
|
|
|
45
|
-
#
|
|
72
|
+
# Security: Use dumb-init to handle signals properly
|
|
73
|
+
ENTRYPOINT ["dumb-init", "--"]
|
|
46
74
|
CMD ["node", "src/server.js"]
|
package/build.sh
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# ╔══════════════════════════════════════════════════════════════╗
|
|
4
|
+
# ║ DeepDebug Local Agent - Build Script ║
|
|
5
|
+
# ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
#
|
|
7
|
+
# This script builds native executables for all platforms
|
|
8
|
+
#
|
|
9
|
+
# Usage:
|
|
10
|
+
# ./build.sh # Build all platforms
|
|
11
|
+
# ./build.sh win # Build Windows only
|
|
12
|
+
# ./build.sh mac # Build macOS only
|
|
13
|
+
# ./build.sh linux # Build Linux only
|
|
14
|
+
# ./build.sh docker # Build Docker image
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
set -e
|
|
18
|
+
|
|
19
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
20
|
+
DIST_DIR="dist"
|
|
21
|
+
RELEASE_DIR="release"
|
|
22
|
+
|
|
23
|
+
echo "╔══════════════════════════════════════════════════════════════╗"
|
|
24
|
+
echo "║ Building DeepDebug Local Agent v${VERSION} ║"
|
|
25
|
+
echo "╚══════════════════════════════════════════════════════════════╝"
|
|
26
|
+
|
|
27
|
+
# Create directories
|
|
28
|
+
mkdir -p $DIST_DIR
|
|
29
|
+
mkdir -p $RELEASE_DIR
|
|
30
|
+
|
|
31
|
+
# Install dependencies
|
|
32
|
+
echo "📦 Installing dependencies..."
|
|
33
|
+
npm ci
|
|
34
|
+
|
|
35
|
+
build_windows() {
|
|
36
|
+
echo "🪟 Building Windows executable..."
|
|
37
|
+
npx pkg . --target node20-win-x64 --output $DIST_DIR/deepdebug-agent-win.exe
|
|
38
|
+
|
|
39
|
+
# Create zip for release
|
|
40
|
+
cd $DIST_DIR
|
|
41
|
+
zip -j ../$RELEASE_DIR/deepdebug-agent-${VERSION}-windows-x64.zip deepdebug-agent-win.exe ../README.md ../LICENSE
|
|
42
|
+
cd ..
|
|
43
|
+
|
|
44
|
+
echo "✅ Windows build complete: $DIST_DIR/deepdebug-agent-win.exe"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
build_macos() {
|
|
48
|
+
echo "🍎 Building macOS executable (Intel)..."
|
|
49
|
+
npx pkg . --target node20-macos-x64 --output $DIST_DIR/deepdebug-agent-macos-x64
|
|
50
|
+
|
|
51
|
+
echo "🍎 Building macOS executable (Apple Silicon)..."
|
|
52
|
+
npx pkg . --target node20-macos-arm64 --output $DIST_DIR/deepdebug-agent-macos-arm64
|
|
53
|
+
|
|
54
|
+
# Create universal binary (optional, requires lipo)
|
|
55
|
+
if command -v lipo &> /dev/null; then
|
|
56
|
+
echo "🍎 Creating universal binary..."
|
|
57
|
+
lipo -create -output $DIST_DIR/deepdebug-agent-macos \
|
|
58
|
+
$DIST_DIR/deepdebug-agent-macos-x64 \
|
|
59
|
+
$DIST_DIR/deepdebug-agent-macos-arm64
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# Create zip for release
|
|
63
|
+
cd $DIST_DIR
|
|
64
|
+
zip -j ../$RELEASE_DIR/deepdebug-agent-${VERSION}-macos-x64.zip deepdebug-agent-macos-x64 ../README.md ../LICENSE
|
|
65
|
+
zip -j ../$RELEASE_DIR/deepdebug-agent-${VERSION}-macos-arm64.zip deepdebug-agent-macos-arm64 ../README.md ../LICENSE
|
|
66
|
+
cd ..
|
|
67
|
+
|
|
68
|
+
echo "✅ macOS build complete"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
build_linux() {
|
|
72
|
+
echo "🐧 Building Linux executable..."
|
|
73
|
+
npx pkg . --target node20-linux-x64 --output $DIST_DIR/deepdebug-agent-linux
|
|
74
|
+
|
|
75
|
+
# Create tar.gz for release
|
|
76
|
+
cd $DIST_DIR
|
|
77
|
+
tar -czvf ../$RELEASE_DIR/deepdebug-agent-${VERSION}-linux-x64.tar.gz deepdebug-agent-linux ../README.md ../LICENSE
|
|
78
|
+
cd ..
|
|
79
|
+
|
|
80
|
+
echo "✅ Linux build complete: $DIST_DIR/deepdebug-agent-linux"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
build_docker() {
|
|
84
|
+
echo "🐳 Building Docker image..."
|
|
85
|
+
docker build -t deepdebug/local-agent:${VERSION} -t deepdebug/local-agent:latest .
|
|
86
|
+
|
|
87
|
+
echo "✅ Docker build complete: deepdebug/local-agent:${VERSION}"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
# Main
|
|
91
|
+
case "$1" in
|
|
92
|
+
win|windows)
|
|
93
|
+
build_windows
|
|
94
|
+
;;
|
|
95
|
+
mac|macos)
|
|
96
|
+
build_macos
|
|
97
|
+
;;
|
|
98
|
+
linux)
|
|
99
|
+
build_linux
|
|
100
|
+
;;
|
|
101
|
+
docker)
|
|
102
|
+
build_docker
|
|
103
|
+
;;
|
|
104
|
+
all|"")
|
|
105
|
+
build_windows
|
|
106
|
+
build_macos
|
|
107
|
+
build_linux
|
|
108
|
+
build_docker
|
|
109
|
+
;;
|
|
110
|
+
*)
|
|
111
|
+
echo "Usage: $0 [win|mac|linux|docker|all]"
|
|
112
|
+
exit 1
|
|
113
|
+
;;
|
|
114
|
+
esac
|
|
115
|
+
|
|
116
|
+
echo ""
|
|
117
|
+
echo "╔══════════════════════════════════════════════════════════════╗"
|
|
118
|
+
echo "║ Build Complete! ║"
|
|
119
|
+
echo "╚══════════════════════════════════════════════════════════════╝"
|
|
120
|
+
echo ""
|
|
121
|
+
echo "📁 Executables: $DIST_DIR/"
|
|
122
|
+
echo "📦 Releases: $RELEASE_DIR/"
|
|
123
|
+
ls -la $DIST_DIR/
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
# ║ DeepDebug Local Agent - Docker Compose (Enterprise) ║
|
|
3
|
+
# ╚══════════════════════════════════════════════════════════════╝
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# docker-compose up -d
|
|
7
|
+
#
|
|
8
|
+
# Configuration:
|
|
9
|
+
# Copy .env.example to .env and configure your settings
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
version: '3.8'
|
|
13
|
+
|
|
14
|
+
services:
|
|
15
|
+
deepdebug-agent:
|
|
16
|
+
image: deepdebug/local-agent:${AGENT_VERSION:-latest}
|
|
17
|
+
container_name: deepdebug-agent
|
|
18
|
+
restart: unless-stopped
|
|
19
|
+
|
|
20
|
+
# ─────────────────────────────────────────
|
|
21
|
+
# Security Settings
|
|
22
|
+
# ─────────────────────────────────────────
|
|
23
|
+
security_opt:
|
|
24
|
+
- no-new-privileges:true
|
|
25
|
+
read_only: true
|
|
26
|
+
cap_drop:
|
|
27
|
+
- ALL
|
|
28
|
+
cap_add:
|
|
29
|
+
- NET_BIND_SERVICE
|
|
30
|
+
|
|
31
|
+
# ─────────────────────────────────────────
|
|
32
|
+
# Resource Limits
|
|
33
|
+
# ─────────────────────────────────────────
|
|
34
|
+
deploy:
|
|
35
|
+
resources:
|
|
36
|
+
limits:
|
|
37
|
+
cpus: '2'
|
|
38
|
+
memory: 2G
|
|
39
|
+
reservations:
|
|
40
|
+
cpus: '0.5'
|
|
41
|
+
memory: 512M
|
|
42
|
+
|
|
43
|
+
# ─────────────────────────────────────────
|
|
44
|
+
# Network
|
|
45
|
+
# ─────────────────────────────────────────
|
|
46
|
+
ports:
|
|
47
|
+
- "127.0.0.1:5055:5055" # Only localhost access
|
|
48
|
+
networks:
|
|
49
|
+
- deepdebug-network
|
|
50
|
+
|
|
51
|
+
# ─────────────────────────────────────────
|
|
52
|
+
# Volumes
|
|
53
|
+
# ─────────────────────────────────────────
|
|
54
|
+
volumes:
|
|
55
|
+
# Project source code (read-only for security)
|
|
56
|
+
- ${PROJECT_PATH:-/path/to/projects}:/workspace:ro
|
|
57
|
+
# Temp directory for container writes
|
|
58
|
+
- agent-tmp:/tmp
|
|
59
|
+
|
|
60
|
+
# ─────────────────────────────────────────
|
|
61
|
+
# Environment
|
|
62
|
+
# ─────────────────────────────────────────
|
|
63
|
+
environment:
|
|
64
|
+
- NODE_ENV=production
|
|
65
|
+
- PORT=5055
|
|
66
|
+
- DEEPDEBUG_API_URL=${DEEPDEBUG_API_URL:-https://api.deepdebug.ai}
|
|
67
|
+
- DEEPDEBUG_TENANT_ID=${DEEPDEBUG_TENANT_ID}
|
|
68
|
+
- DEEPDEBUG_WORKSPACE_PATH=/workspace
|
|
69
|
+
- LOG_LEVEL=${LOG_LEVEL:-info}
|
|
70
|
+
|
|
71
|
+
# ─────────────────────────────────────────
|
|
72
|
+
# Health Check
|
|
73
|
+
# ─────────────────────────────────────────
|
|
74
|
+
healthcheck:
|
|
75
|
+
test: ["CMD", "curl", "-f", "http://localhost:5055/health"]
|
|
76
|
+
interval: 30s
|
|
77
|
+
timeout: 10s
|
|
78
|
+
retries: 3
|
|
79
|
+
start_period: 10s
|
|
80
|
+
|
|
81
|
+
# ─────────────────────────────────────────
|
|
82
|
+
# Logging
|
|
83
|
+
# ─────────────────────────────────────────
|
|
84
|
+
logging:
|
|
85
|
+
driver: "json-file"
|
|
86
|
+
options:
|
|
87
|
+
max-size: "10m"
|
|
88
|
+
max-file: "3"
|
|
89
|
+
|
|
90
|
+
# ─────────────────────────────────────────
|
|
91
|
+
# Networks
|
|
92
|
+
# ─────────────────────────────────────────
|
|
93
|
+
networks:
|
|
94
|
+
deepdebug-network:
|
|
95
|
+
driver: bridge
|
|
96
|
+
driver_opts:
|
|
97
|
+
com.docker.network.bridge.enable_icc: "false"
|
|
98
|
+
|
|
99
|
+
# ─────────────────────────────────────────
|
|
100
|
+
# Volumes
|
|
101
|
+
# ─────────────────────────────────────────
|
|
102
|
+
volumes:
|
|
103
|
+
agent-tmp:
|
|
104
|
+
driver: local
|