@kokorolx/ai-sandbox-wrapper 3.4.2 â 3.4.3-beta.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/bin/ai-run +370 -1
- package/bin/cli.js +7 -4
- package/lib/build-sandbox.sh +6 -0
- package/lib/install-base.sh +45 -0
- package/lib/install-open-design.sh +60 -0
- package/package.json +1 -1
- package/setup.sh +71 -6
- package/skills/dd-pup/SKILL.md +186 -0
- package/dockerfiles/base/Dockerfile +0 -74
- package/dockerfiles/base/skills/rtk/SKILL.md +0 -103
- package/dockerfiles/base/skills/rtk-setup/SKILL.md +0 -118
- package/dockerfiles/opencode/Dockerfile +0 -9
- package/dockerfiles/sandbox/Dockerfile +0 -91
- package/dockerfiles/sandbox/skills/rtk/SKILL.md +0 -103
- package/dockerfiles/sandbox/skills/rtk-setup/SKILL.md +0 -118
package/setup.sh
CHANGED
|
@@ -281,8 +281,8 @@ echo "đ Legacy workspaces file: $WORKSPACES_FILE"
|
|
|
281
281
|
WORKSPACE="${WORKSPACES[0]}"
|
|
282
282
|
|
|
283
283
|
# Tool definitions
|
|
284
|
-
TOOL_OPTIONS="amp,opencode,openclaw,droid,claude,gemini,kilo,qwen,codex,qoder,auggie,codebuddy,jules,shai"
|
|
285
|
-
TOOL_DESCS="AI coding assistant from @sourcegraph/amp,Open-source coding tool from opencode-ai,OpenClaw AI gateway (Docker Compose),Factory CLI from factory.ai,Claude Code CLI from Anthropic,Google Gemini CLI (free tier),AI pair programmer (Git-native),Kilo Code (500+ models),Alibaba Qwen CLI (1M context),OpenAI Codex terminal agent,Qoder AI CLI assistant,Augment Auggie CLI,Tencent CodeBuddy CLI,Google Jules CLI,OVHcloud SHAI agent"
|
|
284
|
+
TOOL_OPTIONS="amp,opencode,openclaw,open-design,droid,claude,gemini,kilo,qwen,codex,qoder,auggie,codebuddy,jules,shai"
|
|
285
|
+
TOOL_DESCS="AI coding assistant from @sourcegraph/amp,Open-source coding tool from opencode-ai,OpenClaw AI gateway (Docker Compose),Open Design daemon (HTTP service â agent-driven design generation),Factory CLI from factory.ai,Claude Code CLI from Anthropic,Google Gemini CLI (free tier),AI pair programmer (Git-native),Kilo Code (500+ models),Alibaba Qwen CLI (1M context),OpenAI Codex terminal agent,Qoder AI CLI assistant,Augment Auggie CLI,Tencent CodeBuddy CLI,Google Jules CLI,OVHcloud SHAI agent"
|
|
286
286
|
|
|
287
287
|
# Pre-select previously installed tools
|
|
288
288
|
PRESELECTED_TOOLS=""
|
|
@@ -303,7 +303,7 @@ echo "Installing tools: ${TOOLS[*]}"
|
|
|
303
303
|
|
|
304
304
|
CONTAINERIZED_TOOLS=()
|
|
305
305
|
for tool in "${TOOLS[@]}"; do
|
|
306
|
-
if [[ "$tool" =~ ^(amp|opencode|openclaw|claude|aider|droid|gemini|kilo|qwen|codex|qoder|auggie|codebuddy|jules|shai)$ ]]; then
|
|
306
|
+
if [[ "$tool" =~ ^(amp|opencode|openclaw|open-design|claude|aider|droid|gemini|kilo|qwen|codex|qoder|auggie|codebuddy|jules|shai)$ ]]; then
|
|
307
307
|
CONTAINERIZED_TOOLS+=("$tool")
|
|
308
308
|
fi
|
|
309
309
|
done
|
|
@@ -311,8 +311,8 @@ done
|
|
|
311
311
|
echo ""
|
|
312
312
|
if [[ ${#CONTAINERIZED_TOOLS[@]} -gt 0 ]]; then
|
|
313
313
|
# Category 1: AI Enhancement Tools (spec-driven development, UI/UX, browser automation)
|
|
314
|
-
AI_TOOL_OPTIONS="spec-kit,ux-ui-promax,openspec,playwright,rtk"
|
|
315
|
-
AI_TOOL_DESCS="Spec-driven development toolkit,UI/UX design intelligence tool,OpenSpec - spec-driven development,Browser automation + Chromium/Firefox/WebKit (~500MB),RTK token optimizer - reduces LLM token usage by 60-90% (~5MB)"
|
|
314
|
+
AI_TOOL_OPTIONS="spec-kit,ux-ui-promax,openspec,playwright,rtk,pup,open-design"
|
|
315
|
+
AI_TOOL_DESCS="Spec-driven development toolkit,UI/UX design intelligence tool,OpenSpec - spec-driven development,Browser automation + Chromium/Firefox/WebKit (~500MB),RTK token optimizer - reduces LLM token usage by 60-90% (~5MB),Datadog Pup CLI - AI-agent-ready observability CLI (~10MB),Open Design daemon - AI design generation service (port 7456)"
|
|
316
316
|
|
|
317
317
|
multi_select "Select AI Enhancement Tools (installed in containers)" "$AI_TOOL_OPTIONS" "$AI_TOOL_DESCS"
|
|
318
318
|
AI_ENHANCEMENT_TOOLS=("${SELECTED_ITEMS[@]}")
|
|
@@ -390,6 +390,8 @@ if [[ $NEEDS_BASE_IMAGE -eq 1 ]]; then
|
|
|
390
390
|
INSTALL_CHROME_DEVTOOLS_MCP="${INSTALL_CHROME_DEVTOOLS_MCP:-0}"
|
|
391
391
|
INSTALL_PLAYWRIGHT_MCP="${INSTALL_PLAYWRIGHT_MCP:-0}"
|
|
392
392
|
INSTALL_RTK="${INSTALL_RTK:-0}"
|
|
393
|
+
INSTALL_PUP="${INSTALL_PUP:-0}"
|
|
394
|
+
INSTALL_OPEN_DESIGN="${INSTALL_OPEN_DESIGN:-0}"
|
|
393
395
|
|
|
394
396
|
for addon in "${ADDITIONAL_TOOLS[@]}"; do
|
|
395
397
|
case "$addon" in
|
|
@@ -417,10 +419,16 @@ if [[ $NEEDS_BASE_IMAGE -eq 1 ]]; then
|
|
|
417
419
|
rtk)
|
|
418
420
|
INSTALL_RTK=1
|
|
419
421
|
;;
|
|
422
|
+
pup)
|
|
423
|
+
INSTALL_PUP=1
|
|
424
|
+
;;
|
|
425
|
+
open-design)
|
|
426
|
+
INSTALL_OPEN_DESIGN=1
|
|
427
|
+
;;
|
|
420
428
|
esac
|
|
421
429
|
done
|
|
422
430
|
|
|
423
|
-
export INSTALL_SPEC_KIT INSTALL_UX_UI_PROMAX INSTALL_OPENSPEC INSTALL_PLAYWRIGHT INSTALL_RUBY INSTALL_CHROME_DEVTOOLS_MCP INSTALL_PLAYWRIGHT_MCP INSTALL_RTK
|
|
431
|
+
export INSTALL_SPEC_KIT INSTALL_UX_UI_PROMAX INSTALL_OPENSPEC INSTALL_PLAYWRIGHT INSTALL_RUBY INSTALL_CHROME_DEVTOOLS_MCP INSTALL_PLAYWRIGHT_MCP INSTALL_RTK INSTALL_PUP INSTALL_OPEN_DESIGN
|
|
424
432
|
|
|
425
433
|
# Save MCP selections to ~/.ai-sandbox/config.json for ai-run auto-configuration
|
|
426
434
|
SANDBOX_CONFIG="$HOME/.ai-sandbox/config.json"
|
|
@@ -435,6 +443,54 @@ if [[ $NEEDS_BASE_IMAGE -eq 1 ]]; then
|
|
|
435
443
|
jq --argjson mcp "$MCP_INSTALLED" '.mcp.installed = $mcp' "$SANDBOX_CONFIG" > "$SANDBOX_CONFIG.tmp" && mv "$SANDBOX_CONFIG.tmp" "$SANDBOX_CONFIG"
|
|
436
444
|
chmod 600 "$SANDBOX_CONFIG"
|
|
437
445
|
echo "â
MCP tool selections saved to config"
|
|
446
|
+
|
|
447
|
+
# Auto-detect host browser for ai-run's "Host Chrome CDP mode". That mode
|
|
448
|
+
# is gated on .mcp.chromePath being set in config.json, but setup never
|
|
449
|
+
# wrote it -- users had to manually edit the file. Detect a sensible
|
|
450
|
+
# default the first time an MCP browser tool is selected; preserve any
|
|
451
|
+
# existing value the user set themselves.
|
|
452
|
+
if [[ "$INSTALL_CHROME_DEVTOOLS_MCP" -eq 1 || "$INSTALL_PLAYWRIGHT_MCP" -eq 1 ]]; then
|
|
453
|
+
EXISTING_CHROME_PATH=$(jq -r '.mcp.chromePath // empty' "$SANDBOX_CONFIG" 2>/dev/null)
|
|
454
|
+
if [[ -z "$EXISTING_CHROME_PATH" ]]; then
|
|
455
|
+
DETECTED_CHROME_PATH=""
|
|
456
|
+
case "$(uname -s)" in
|
|
457
|
+
Darwin)
|
|
458
|
+
# Stable Chrome first, then Chromium, then popular forks.
|
|
459
|
+
for candidate in \
|
|
460
|
+
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
|
|
461
|
+
"/Applications/Chromium.app/Contents/MacOS/Chromium" \
|
|
462
|
+
"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" \
|
|
463
|
+
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" \
|
|
464
|
+
"/Applications/Arc.app/Contents/MacOS/Arc"; do
|
|
465
|
+
if [[ -f "$candidate" ]]; then
|
|
466
|
+
DETECTED_CHROME_PATH="$candidate"
|
|
467
|
+
break
|
|
468
|
+
fi
|
|
469
|
+
done
|
|
470
|
+
;;
|
|
471
|
+
Linux)
|
|
472
|
+
for cmd in google-chrome-stable google-chrome chromium chromium-browser brave-browser microsoft-edge; do
|
|
473
|
+
if command -v "$cmd" &>/dev/null; then
|
|
474
|
+
DETECTED_CHROME_PATH=$(command -v "$cmd")
|
|
475
|
+
break
|
|
476
|
+
fi
|
|
477
|
+
done
|
|
478
|
+
;;
|
|
479
|
+
esac
|
|
480
|
+
|
|
481
|
+
if [[ -n "$DETECTED_CHROME_PATH" ]]; then
|
|
482
|
+
jq --arg path "$DETECTED_CHROME_PATH" '.mcp.chromePath = $path' "$SANDBOX_CONFIG" > "$SANDBOX_CONFIG.tmp" \
|
|
483
|
+
&& mv "$SANDBOX_CONFIG.tmp" "$SANDBOX_CONFIG"
|
|
484
|
+
chmod 600 "$SANDBOX_CONFIG"
|
|
485
|
+
echo "đ Host browser detected for CDP: $DETECTED_CHROME_PATH"
|
|
486
|
+
echo " (ai-run will launch this with --remote-debugging-port for MCP browser tools.)"
|
|
487
|
+
echo " To change or disable, edit .mcp.chromePath in $SANDBOX_CONFIG"
|
|
488
|
+
else
|
|
489
|
+
echo "âšī¸ No host browser auto-detected for CDP mode."
|
|
490
|
+
echo " To enable, set .mcp.chromePath in $SANDBOX_CONFIG to a Chrome/Chromium binary."
|
|
491
|
+
fi
|
|
492
|
+
fi
|
|
493
|
+
fi
|
|
438
494
|
fi
|
|
439
495
|
fi
|
|
440
496
|
|
|
@@ -448,8 +504,14 @@ TOOLS="$TOOLS_CSV" \
|
|
|
448
504
|
INSTALL_CHROME_DEVTOOLS_MCP="$INSTALL_CHROME_DEVTOOLS_MCP" \
|
|
449
505
|
INSTALL_PLAYWRIGHT_MCP="$INSTALL_PLAYWRIGHT_MCP" \
|
|
450
506
|
INSTALL_RTK="$INSTALL_RTK" \
|
|
507
|
+
INSTALL_PUP="$INSTALL_PUP" \
|
|
451
508
|
bash "$SCRIPT_DIR/lib/build-sandbox.sh"
|
|
452
509
|
|
|
510
|
+
# Install open-design as a separate daemon container (not part of sandbox image)
|
|
511
|
+
if [[ "${INSTALL_OPEN_DESIGN:-0}" -eq 1 ]]; then
|
|
512
|
+
bash "$SCRIPT_DIR/lib/install-open-design.sh"
|
|
513
|
+
fi
|
|
514
|
+
|
|
453
515
|
OLD_IMAGES=()
|
|
454
516
|
for tool in "${TOOLS[@]}"; do
|
|
455
517
|
if docker image inspect "ai-${tool}:latest" &>/dev/null; then
|
|
@@ -538,6 +600,9 @@ if [[ ${#ADDITIONAL_TOOLS[@]} -gt 0 ]]; then
|
|
|
538
600
|
rtk)
|
|
539
601
|
echo " rtk - Token optimizer for AI coding agents (60-90% savings)"
|
|
540
602
|
;;
|
|
603
|
+
open-design)
|
|
604
|
+
echo " open-design - AI design generation daemon (port 7456)"
|
|
605
|
+
;;
|
|
541
606
|
esac
|
|
542
607
|
done
|
|
543
608
|
fi
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dd-pup
|
|
3
|
+
description: "Datadog CLI (pup) for AI agents. OAuth2 auth with token refresh. Query logs, metrics, monitors, traces, and more."
|
|
4
|
+
compatibility: "OpenCode with pup binary installed"
|
|
5
|
+
metadata:
|
|
6
|
+
author: datadog-labs
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
repository: https://github.com/DataDog/pup
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# pup (Datadog CLI)
|
|
12
|
+
|
|
13
|
+
Pup CLI for Datadog API operations. Supports OAuth2 and API key auth.
|
|
14
|
+
|
|
15
|
+
## Quick Reference
|
|
16
|
+
|
|
17
|
+
| Task | Command |
|
|
18
|
+
|------|---------|
|
|
19
|
+
| Search error logs | `pup logs search --query "status:error" --from 1h` |
|
|
20
|
+
| List monitors | `pup monitors list` |
|
|
21
|
+
| Create downtime | `pup downtime create --file downtime.json` |
|
|
22
|
+
| Find slow traces | `pup traces search --query="@duration:>500000000" --from="1h"` |
|
|
23
|
+
| List incidents | `pup incidents list` |
|
|
24
|
+
| Query metrics | `pup metrics query --query "avg:system.cpu.user{*}"` |
|
|
25
|
+
| List hosts | `pup infrastructure hosts list` |
|
|
26
|
+
| Check SLOs | `pup slos list` |
|
|
27
|
+
| On-call teams | `pup on-call teams list` |
|
|
28
|
+
| Security signals | `pup security signals list --query "*" --from 24h` |
|
|
29
|
+
| Check auth | `pup auth status` |
|
|
30
|
+
| Refresh token | `pup auth refresh` |
|
|
31
|
+
|
|
32
|
+
## Prerequisites
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Install pup via Homebrew (recommended)
|
|
36
|
+
brew tap datadog-labs/pack
|
|
37
|
+
brew install pup
|
|
38
|
+
|
|
39
|
+
# Or build from source
|
|
40
|
+
cargo install --git https://github.com/DataDog/pup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Auth
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pup auth login # OAuth2 browser flow (recommended)
|
|
47
|
+
pup auth status # Check token validity
|
|
48
|
+
pup auth refresh # Refresh expired token (no browser)
|
|
49
|
+
pup auth logout # Clear credentials
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**â ī¸ Tokens expire (~1 hour)**. If a command fails with 401/403:
|
|
53
|
+
```bash
|
|
54
|
+
pup auth refresh # Try refresh first
|
|
55
|
+
pup auth login # If refresh fails, full re-auth
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Headless/CI (no browser)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
export DD_API_KEY=your-api-key
|
|
62
|
+
export DD_APP_KEY=your-app-key
|
|
63
|
+
export DD_SITE=datadoghq.com # or datadoghq.eu, etc.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Command Reference
|
|
67
|
+
|
|
68
|
+
### Monitors
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pup monitors list --limit 10
|
|
72
|
+
pup monitors list --tags "env:prod"
|
|
73
|
+
pup monitors get 12345
|
|
74
|
+
pup monitors search --query "High CPU"
|
|
75
|
+
pup monitors create --file monitor.json
|
|
76
|
+
pup monitors delete 12345
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Logs
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pup logs search --query "status:error" --from 1h
|
|
83
|
+
pup logs search --query "service:payment-api" --from 1h --limit 100
|
|
84
|
+
pup logs aggregate --query "service:api" --compute count --from 1h
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Metrics
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pup metrics query --query "avg:system.cpu.user{*}" --from 1h
|
|
91
|
+
pup metrics list --filter "system.*"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### APM / Services
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pup apm services list --env production
|
|
98
|
+
pup apm services stats --env production
|
|
99
|
+
pup apm dependencies list --env production
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Traces
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pup traces search --query="service:api-gateway" --from="1h"
|
|
106
|
+
pup traces search --query="service:api @duration:>1000000000" --from="1h"
|
|
107
|
+
pup traces aggregate --query="service:api" --compute="avg(@duration)" --group-by="resource_name" --from="1h"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Infrastructure / Hosts
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pup infrastructure hosts list
|
|
114
|
+
pup infrastructure hosts list --filter "env:prod"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Dashboards
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pup dashboards list
|
|
121
|
+
pup dashboards get abc-123
|
|
122
|
+
pup dashboards create --file dashboard.json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### SLOs
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
pup slos list
|
|
129
|
+
pup slos get slo-123
|
|
130
|
+
pup slos status slo-123 --from 30d --to now
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Security
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pup security signals list --query "*" --from 24h
|
|
137
|
+
pup security rules list
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Live Debugger
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pup debugger context my-svc --env prod
|
|
144
|
+
pup symdb search --service my-svc --query MyController --view probe-locations
|
|
145
|
+
pup debugger probes create --service my-svc --env prod \
|
|
146
|
+
--probe-location "com.example.MyController:handleRequest" \
|
|
147
|
+
--capture "request.id" --ttl 1h
|
|
148
|
+
pup debugger probes watch --fields "message,captures,timestamp" --timeout 60
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Subcommand Discovery
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pup --help # List all commands
|
|
155
|
+
pup <cmd> --help # Command-specific help
|
|
156
|
+
pup agent schema # Machine-readable output
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Error Handling
|
|
160
|
+
|
|
161
|
+
| Error | Cause | Fix |
|
|
162
|
+
|-------|-------|-----|
|
|
163
|
+
| 401 Unauthorized | Token expired | `pup auth refresh` |
|
|
164
|
+
| 403 Forbidden | Missing scope | Check app key permissions |
|
|
165
|
+
| 404 Not Found | Wrong ID/resource | Verify resource exists |
|
|
166
|
+
| Rate limited | Too many requests | Add delays between calls |
|
|
167
|
+
|
|
168
|
+
## Sites
|
|
169
|
+
|
|
170
|
+
| Site | `DD_SITE` value |
|
|
171
|
+
|------|-----------------|
|
|
172
|
+
| US1 (default) | `datadoghq.com` |
|
|
173
|
+
| US3 | `us3.datadoghq.com` |
|
|
174
|
+
| US5 | `us5.datadoghq.com` |
|
|
175
|
+
| EU1 | `datadoghq.eu` |
|
|
176
|
+
| AP1 | `ap1.datadoghq.com` |
|
|
177
|
+
| US1-FED | `ddog-gov.com` |
|
|
178
|
+
|
|
179
|
+
## Detection
|
|
180
|
+
|
|
181
|
+
Before using pup commands, verify it's installed:
|
|
182
|
+
```bash
|
|
183
|
+
pup --version
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
If `pup` is not found, skip this skill.
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
FROM node:22-bookworm-slim
|
|
3
|
-
|
|
4
|
-
ARG AGENT_UID=1001
|
|
5
|
-
|
|
6
|
-
RUN apt-get update && apt-get install -y --no-install-recommends git curl ssh ca-certificates jq python3 python3-pip python3-venv python3-dev python3-setuptools build-essential libopenblas-dev pipx unzip xclip wl-clipboard ripgrep tmux vim-nox fd-find sqlite3 poppler-utils qpdf tesseract-ocr && curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/local/bin sh && rm -rf /var/lib/apt/lists/* && pipx ensurepath
|
|
7
|
-
|
|
8
|
-
# Install Python PDF processing tools for PDF skill
|
|
9
|
-
RUN pip3 install --no-cache-dir --break-system-packages pypdf pdfplumber reportlab pytesseract pdf2image
|
|
10
|
-
|
|
11
|
-
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && apt-get update && apt-get install -y gh && rm -rf /var/lib/apt/lists/*
|
|
12
|
-
|
|
13
|
-
# Install bun (used by most AI tool install scripts)
|
|
14
|
-
RUN npm install -g bun
|
|
15
|
-
|
|
16
|
-
# Install pnpm globally using npm (not bun, for stability)
|
|
17
|
-
RUN npm install -g pnpm
|
|
18
|
-
|
|
19
|
-
# Install TypeScript and LSP tools using npm
|
|
20
|
-
RUN npm install -g typescript typescript-language-server pyright vscode-langservers-extracted
|
|
21
|
-
|
|
22
|
-
# Verify installations
|
|
23
|
-
RUN node --version && npm --version && pnpm --version && tsc --version
|
|
24
|
-
|
|
25
|
-
# Install additional tools (if selected)
|
|
26
|
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
27
|
-
libglib2.0-0 \
|
|
28
|
-
libnspr4 \
|
|
29
|
-
libnss3 \
|
|
30
|
-
libdbus-1-3 \
|
|
31
|
-
libatk1.0-0 \
|
|
32
|
-
libatk-bridge2.0-0 \
|
|
33
|
-
libcups2 \
|
|
34
|
-
libxcb1 \
|
|
35
|
-
libxkbcommon0 \
|
|
36
|
-
libatspi2.0-0 \
|
|
37
|
-
libx11-6 \
|
|
38
|
-
libxcomposite1 \
|
|
39
|
-
libxdamage1 \
|
|
40
|
-
libxext6 \
|
|
41
|
-
libxfixes3 \
|
|
42
|
-
libxrandr2 \
|
|
43
|
-
libgbm1 \
|
|
44
|
-
libdrm2 \
|
|
45
|
-
libcairo2 \
|
|
46
|
-
libpango-1.0-0 \
|
|
47
|
-
libasound2 \
|
|
48
|
-
fonts-liberation \
|
|
49
|
-
libappindicator3-1 \
|
|
50
|
-
libu2f-udev \
|
|
51
|
-
libvulkan1 \
|
|
52
|
-
libxshmfence1 \
|
|
53
|
-
xdg-utils \
|
|
54
|
-
wget \
|
|
55
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
56
|
-
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers
|
|
57
|
-
RUN mkdir -p /opt/playwright-browsers && \
|
|
58
|
-
npm install -g @playwright/mcp@latest && \
|
|
59
|
-
touch /opt/.mcp-playwright-installed
|
|
60
|
-
ENV CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1
|
|
61
|
-
RUN npm install -g chrome-devtools-mcp@latest && \
|
|
62
|
-
touch /opt/.mcp-chrome-devtools-installed
|
|
63
|
-
RUN touch /opt/.mcp-playwright-installed
|
|
64
|
-
|
|
65
|
-
# Create workspace
|
|
66
|
-
WORKDIR /workspace
|
|
67
|
-
|
|
68
|
-
# Non-root user for security (match host UID)
|
|
69
|
-
RUN useradd -m -u ${AGENT_UID} -d /home/agent agent && \
|
|
70
|
-
mkdir -p /home/agent/.cache /home/agent/.npm /home/agent/.opencode /home/agent/.config && \
|
|
71
|
-
chown -R agent:agent /home/agent/.cache /home/agent/.npm /home/agent/.opencode /home/agent/.config /workspace && \
|
|
72
|
-
([ -d /opt/playwright-browsers ] && chown -R agent:agent /opt/playwright-browsers || true)
|
|
73
|
-
USER agent
|
|
74
|
-
ENV HOME=/home/agent
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: rtk
|
|
3
|
-
description: "Token optimizer for AI coding agents. Wraps common CLI commands with rtk to reduce LLM token consumption by 60-90%."
|
|
4
|
-
compatibility: "OpenCode with RTK binary installed"
|
|
5
|
-
metadata:
|
|
6
|
-
author: Sisyphus
|
|
7
|
-
version: "1.0.0"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# RTK â Rust Token Killer
|
|
11
|
-
|
|
12
|
-
**Purpose**: Reduce token consumption by 60-90% on shell commands. RTK filters and compresses command output before it reaches your context.
|
|
13
|
-
|
|
14
|
-
## When This Skill Activates
|
|
15
|
-
|
|
16
|
-
This skill is loaded automatically. Once active, **always** prefix supported commands with `rtk`.
|
|
17
|
-
|
|
18
|
-
## Command Mappings (MANDATORY)
|
|
19
|
-
|
|
20
|
-
When running shell commands via Bash tool, use `rtk` prefix for these commands:
|
|
21
|
-
|
|
22
|
-
| Instead of | Use | Savings |
|
|
23
|
-
|-----------|-----|---------|
|
|
24
|
-
| `git status` | `rtk git status` | ~80% |
|
|
25
|
-
| `git diff` | `rtk git diff` | ~75% |
|
|
26
|
-
| `git log` | `rtk git log` | ~80% |
|
|
27
|
-
| `git add/commit/push/pull` | `rtk git add/commit/push/pull` | ~90% |
|
|
28
|
-
| `ls` / `ls -la` | `rtk ls` | ~80% |
|
|
29
|
-
| `cat file` | `rtk read file` | ~70% |
|
|
30
|
-
| `grep pattern .` | `rtk grep pattern .` | ~80% |
|
|
31
|
-
| `rg pattern` | `rtk grep pattern .` | ~80% |
|
|
32
|
-
| `npm test` / `cargo test` / `pytest` | `rtk test <cmd>` | ~90% |
|
|
33
|
-
| `npm run build` / `cargo build` | `rtk err <cmd>` | ~80% |
|
|
34
|
-
| `gh pr list/view` | `rtk gh pr list/view` | ~70% |
|
|
35
|
-
| `docker ps` | `rtk docker ps` | ~80% |
|
|
36
|
-
| `eslint` / `tsc` | `rtk lint` / `rtk tsc` | ~80% |
|
|
37
|
-
|
|
38
|
-
## Searching Inside `node_modules` / Ignored Directories
|
|
39
|
-
|
|
40
|
-
By default, `rtk grep` respects `.gitignore` rules â meaning `node_modules`, `.nuxt`, `dist`, etc. are **excluded**. This is the right behavior 99% of the time.
|
|
41
|
-
|
|
42
|
-
When you **need** to search inside ignored directories (debugging a library, checking an API signature, tracing a dependency bug):
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# Search all files including node_modules (--no-ignore bypasses .gitignore)
|
|
46
|
-
rtk grep "defineStore" . --no-ignore
|
|
47
|
-
|
|
48
|
-
# Search a specific package only (combine --no-ignore with --glob)
|
|
49
|
-
rtk grep "defineStore" . --no-ignore --glob 'node_modules/pinia/**'
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**What does NOT work:**
|
|
53
|
-
- `rtk grep "pattern" node_modules/pinia/` â still excluded even with direct path
|
|
54
|
-
- `rtk grep "pattern" . --glob 'node_modules/**'` â glob alone doesn't override .gitignore
|
|
55
|
-
|
|
56
|
-
**Key flag: `--no-ignore`** â this is the ONLY way to search ignored directories with rtk grep.
|
|
57
|
-
|
|
58
|
-
### Other useful `rtk grep` flags
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
rtk grep "pattern" . -t ts # Filter by file type (ts, py, rust, etc.)
|
|
62
|
-
rtk grep "pattern" . -m 100 # Increase max results (default: 50)
|
|
63
|
-
rtk grep "pattern" . -u # Ultra-compact mode (even fewer tokens)
|
|
64
|
-
rtk grep "pattern" . -l 120 # Max line length before truncation (default: 80)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Commands to NOT Wrap
|
|
68
|
-
|
|
69
|
-
Do NOT prefix these with `rtk` (unsupported or counterproductive):
|
|
70
|
-
|
|
71
|
-
- `npx`, `npm install`, `pip install` (package managers)
|
|
72
|
-
- `node`, `python3`, `ruby` (interpreters)
|
|
73
|
-
- `nano-brain`, `openspec`, `opencode` (custom tools)
|
|
74
|
-
- Heredocs (`<<EOF`)
|
|
75
|
-
- Piped commands (`cmd1 | cmd2`) â wrap only the first command if applicable
|
|
76
|
-
- Commands already prefixed with `rtk`
|
|
77
|
-
|
|
78
|
-
## How RTK Works
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
Without RTK: git status â 50 lines raw output â 2,000 tokens
|
|
82
|
-
With RTK: rtk git status â "3 modified, 1 untracked â" â 200 tokens
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
RTK runs the real command, then filters/compresses the output. The agent sees a compact summary instead of verbose raw output.
|
|
86
|
-
|
|
87
|
-
## Detection
|
|
88
|
-
|
|
89
|
-
Before using RTK commands, verify it's installed:
|
|
90
|
-
```bash
|
|
91
|
-
rtk --version
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
If `rtk` is not found, skip this skill â run commands normally without the `rtk` prefix.
|
|
95
|
-
|
|
96
|
-
## Token Savings Reference
|
|
97
|
-
|
|
98
|
-
Typical 30-min coding session:
|
|
99
|
-
- Without RTK: ~150,000 tokens
|
|
100
|
-
- With RTK: ~45,000 tokens
|
|
101
|
-
- **Savings: ~70%**
|
|
102
|
-
|
|
103
|
-
Biggest wins: test output (`rtk test` â 90%), git operations (`rtk git` â 80%), file reading (`rtk read` â 70%).
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: rtk-setup
|
|
3
|
-
description: "One-time setup + ongoing enforcement of RTK (Rust Token Killer) across sessions and subagents. Persists RTK instructions to AGENTS.md and propagates to delegated tasks."
|
|
4
|
-
compatibility: "OpenCode with RTK binary installed"
|
|
5
|
-
metadata:
|
|
6
|
-
author: Sisyphus
|
|
7
|
-
version: "1.0.0"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# RTK Setup â Persistent RTK Enforcement
|
|
11
|
-
|
|
12
|
-
This skill performs **setup** (persist RTK instructions) and **ongoing enforcement** (use rtk, propagate to subagents).
|
|
13
|
-
|
|
14
|
-
## Phase 1: Detection (ALWAYS run first)
|
|
15
|
-
|
|
16
|
-
Run these checks before anything else:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
rtk --version
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
- If `rtk` is NOT found â **STOP**. Tell the user: "RTK is not installed. Install it first: `cargo install --git https://github.com/rtk-ai/rtk --locked`". Do NOT proceed with setup.
|
|
23
|
-
- If `rtk` IS found â continue.
|
|
24
|
-
|
|
25
|
-
### Check oh-my-opencode
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
ls ~/.config/opencode/oh-my-opencode.json 2>/dev/null
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
- If found â omo is installed. Note this for Phase 2.
|
|
32
|
-
- If not found â skip omo-specific steps.
|
|
33
|
-
|
|
34
|
-
## Phase 2: Setup (persist to AGENTS.md)
|
|
35
|
-
|
|
36
|
-
Check BOTH of these files for the RTK managed block:
|
|
37
|
-
|
|
38
|
-
1. **User-level**: `~/.config/opencode/AGENTS.md`
|
|
39
|
-
2. **Project-level**: `./AGENTS.md` (current workspace)
|
|
40
|
-
|
|
41
|
-
For EACH file, check if `<!-- RTK:START -->` exists. If it does NOT exist, **append** the following managed block to the file (create the file if it doesn't exist). NEVER replace existing content â only append.
|
|
42
|
-
|
|
43
|
-
```markdown
|
|
44
|
-
<!-- RTK:START -->
|
|
45
|
-
<!-- Managed block - do not edit manually. Updated by: rtk-setup skill -->
|
|
46
|
-
|
|
47
|
-
## RTK Token Optimizer
|
|
48
|
-
|
|
49
|
-
This project uses **RTK** (Rust Token Killer) to reduce LLM token consumption by 60-90%.
|
|
50
|
-
|
|
51
|
-
### Rules for ALL agents (including subagents)
|
|
52
|
-
|
|
53
|
-
**ALWAYS** prefix these commands with `rtk`:
|
|
54
|
-
|
|
55
|
-
| Command | Use instead |
|
|
56
|
-
|---------|-------------|
|
|
57
|
-
| `git status/diff/log/add/commit/push/pull` | `rtk git ...` |
|
|
58
|
-
| `ls`, `ls -la` | `rtk ls` |
|
|
59
|
-
| `cat file` | `rtk read file` |
|
|
60
|
-
| `grep pattern .` / `rg pattern` | `rtk grep pattern .` |
|
|
61
|
-
| `npm test` / `cargo test` / `pytest` | `rtk test <cmd>` |
|
|
62
|
-
| `npm run build` / `cargo build` | `rtk err <cmd>` |
|
|
63
|
-
| `gh pr list/view` | `rtk gh pr list/view` |
|
|
64
|
-
| `docker ps` | `rtk docker ps` |
|
|
65
|
-
| `eslint` / `tsc` | `rtk lint` / `rtk tsc` |
|
|
66
|
-
|
|
67
|
-
**Do NOT** prefix: `npx`, `npm install`, `pip install`, `node`, `python3`, heredocs, piped commands.
|
|
68
|
-
|
|
69
|
-
<!-- RTK:END -->
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### If oh-my-opencode is installed
|
|
73
|
-
|
|
74
|
-
After updating AGENTS.md files, check if the omo config at `~/.config/opencode/oh-my-opencode.json` has `prompt_append` fields on agents. If it does, inform the user:
|
|
75
|
-
|
|
76
|
-
> "omo is installed. For maximum coverage, you can add RTK instructions to agent `prompt_append` fields in `oh-my-opencode.json`. This ensures subagents always use rtk even when AGENTS.md is not loaded. Want me to do this?"
|
|
77
|
-
|
|
78
|
-
**Only modify `oh-my-opencode.json` if the user explicitly confirms.** If they confirm, append this line to the `prompt_append` of `sisyphus-junior` agent (the primary coder):
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
\n\nRTK: ALWAYS prefix shell commands with `rtk` when available (git, ls, grep, test, build). Example: `rtk git status` not `git status`.
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Do NOT modify other agents' prompt_append unless asked.
|
|
85
|
-
|
|
86
|
-
## Phase 3: Ongoing Enforcement (EVERY time this skill is loaded)
|
|
87
|
-
|
|
88
|
-
### For the current agent
|
|
89
|
-
|
|
90
|
-
From this point forward in this session, **you MUST**:
|
|
91
|
-
|
|
92
|
-
1. **Use `rtk` prefix** for all supported shell commands (see table above)
|
|
93
|
-
2. **Verify rtk is available** before first use: `rtk --version`
|
|
94
|
-
3. If rtk is not available in the current environment, fall back to normal commands silently
|
|
95
|
-
|
|
96
|
-
### For subagent delegation
|
|
97
|
-
|
|
98
|
-
When delegating ANY task that involves shell commands (via `task()`, `delegate_task()`, or any delegation mechanism), **ALWAYS** add this to the `MUST DO` section of the delegation prompt:
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
- Use `rtk` prefix for shell commands when available (git, ls, grep, test, build). Run `rtk --version` first to check. If not installed, use normal commands. Examples: `rtk git status`, `rtk ls`, `rtk grep pattern .`, `rtk test npm test`.
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
This is NON-NEGOTIABLE. Subagents do not read AGENTS.md, so RTK instructions MUST be passed explicitly in every delegation prompt.
|
|
105
|
-
|
|
106
|
-
### Quick reference for subagent prompts
|
|
107
|
-
|
|
108
|
-
Copy-paste this one-liner into MUST DO sections:
|
|
109
|
-
|
|
110
|
-
> Use `rtk` prefix for all shell commands (git, ls, grep, test, build, docker). Example: `rtk git status` not `git status`. If `rtk` is not found, use normal commands.
|
|
111
|
-
|
|
112
|
-
## Summary
|
|
113
|
-
|
|
114
|
-
| Phase | When | What |
|
|
115
|
-
|-------|------|------|
|
|
116
|
-
| Detection | Always first | Check rtk installed, check omo |
|
|
117
|
-
| Setup | Once (idempotent) | Append RTK block to AGENTS.md (user + project) |
|
|
118
|
-
| Enforcement | Every session | Use rtk yourself, propagate to all subagents |
|