@sibyllinesoft/smith-installer 0.1.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.
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: Detect local system capabilities required for Smith Core installation
3
+ ---
4
+ # Detect System
5
+
6
+ Run:
7
+
8
+ ```bash
9
+ uname -a
10
+ node -v
11
+ docker --version
12
+ docker compose version
13
+ cargo --version
14
+
15
+ if [ "$(uname -s)" = "Darwin" ]; then
16
+ command -v gondolin
17
+ gondolin help >/dev/null
18
+ fi
19
+ ```
20
+
21
+ ## What It Does
22
+
23
+ This skill gathers the minimum environment facts needed before bootstrap.
24
+
25
+ 1. Confirms host OS/kernel information.
26
+ 2. Confirms Node.js runtime availability.
27
+ 3. Confirms Docker engine and Compose plugin availability.
28
+ 4. Confirms Rust toolchain availability.
29
+ 5. On macOS, confirms Gondolin is installed for persistent VM sandbox mode.
30
+ 6. Establishes whether the machine can run the standard Smith Core flow.
31
+
32
+ ## Prerequisites
33
+
34
+ - Shell access in the `smith-core` repository.
35
+ - `bash` available.
36
+
37
+ ## Expected Output
38
+
39
+ Successful environment output includes:
40
+
41
+ ```text
42
+ Linux ...
43
+ v22.x.x
44
+ Docker version ...
45
+ Docker Compose version ...
46
+ cargo 1.xx.x ...
47
+ /usr/bin/gondolin # macOS only
48
+ ```
49
+
50
+ ## Reading Results
51
+
52
+ - Missing `node` means installer and Node workspaces cannot run.
53
+ - Missing `docker compose` means infrastructure cannot start.
54
+ - Missing `cargo` means Rust services cannot build from source.
55
+ - On macOS, missing `gondolin` means persistent VM sandbox sessions cannot start.
56
+
57
+ ## Common Failures
58
+
59
+ | Symptom | Cause | Fix |
60
+ |---------|-------|-----|
61
+ | `node: command not found` | Node.js missing | Install Node 22+ |
62
+ | `docker: command not found` | Docker missing | Install Docker engine |
63
+ | `docker compose` unknown command | Compose plugin missing | Install Docker Compose plugin |
64
+ | `cargo: command not found` | Rust toolchain missing | Install Rust via rustup |
65
+ | `gondolin: command not found` (macOS) | Gondolin missing | Install Gondolin and verify `gondolin help` works |
66
+
67
+ ## Notes
68
+
69
+ This skill is diagnostic only. It does not install packages automatically.
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Generate local mTLS certificates for the Envoy gateway
3
+ ---
4
+ # Generate Certs
5
+
6
+ Run:
7
+
8
+ ```bash
9
+ bash infra/envoy/certs/generate-certs.sh
10
+ ```
11
+
12
+ ## What It Does
13
+
14
+ This skill generates the mTLS certificate chain used by the local Envoy gateway.
15
+
16
+ 1. Creates a self-signed local CA certificate.
17
+ 2. Creates a server certificate for `smith-gateway` / `localhost`.
18
+ 3. Creates a client certificate for bridge-side mTLS calls.
19
+ 4. Writes outputs to `infra/envoy/certs/generated/`.
20
+
21
+ ## Prerequisites
22
+
23
+ - `openssl` must be available on PATH.
24
+ - The repo must contain `infra/envoy/certs/generate-certs.sh`.
25
+
26
+ ## Expected Output
27
+
28
+ The script reports generated artifacts and lists files in:
29
+
30
+ - `infra/envoy/certs/generated/ca.crt`
31
+ - `infra/envoy/certs/generated/ca.key`
32
+ - `infra/envoy/certs/generated/server.crt`
33
+ - `infra/envoy/certs/generated/server.key`
34
+ - `infra/envoy/certs/generated/client.crt`
35
+ - `infra/envoy/certs/generated/client.key`
36
+
37
+ ## Reading Results
38
+
39
+ - If files already exist, the script exits successfully without rotating certs.
40
+ - Set `SMITH_FORCE_CERTS=1` to regenerate certificates intentionally.
41
+ - These certs are mounted into `envoy` by `docker-compose.yaml`.
42
+
43
+ ## Common Failures
44
+
45
+ | Symptom | Cause | Fix |
46
+ |---------|-------|-----|
47
+ | `openssl: command not found` | OpenSSL missing | Install OpenSSL via package manager |
48
+ | `Permission denied` writing files | Directory ownership/permissions issue | Fix permissions for `infra/envoy/certs/generated` |
49
+ | Envoy TLS startup error after generation | Corrupted or partial cert set | Re-run with `SMITH_FORCE_CERTS=1` |
50
+ | Client handshake fails | Client cert paths not wired in runtime env | Set `CLIENT_CERT`, `CLIENT_KEY`, `CA_CERT` correctly |
51
+
52
+ ## Notes
53
+
54
+ For local single-user deployments, generated certs are development trust material and should not be reused across public environments.
@@ -0,0 +1,87 @@
1
+ ---
2
+ description: Generate a pairing code for DM authentication with the chat bridge
3
+ ---
4
+ # Generate Pairing Code
5
+
6
+ Run these read-only inspection commands to understand the current state:
7
+
8
+ ```bash
9
+ # Check DM policy
10
+ grep '^CHAT_BRIDGE_DM_POLICY=' .env 2>/dev/null || echo "CHAT_BRIDGE_DM_POLICY=pairing (default)"
11
+
12
+ # Check if admin token is set
13
+ grep -q '^CHAT_BRIDGE_ADMIN_TOKEN=.' .env 2>/dev/null && echo "ADMIN_TOKEN_SET" || echo "NO_ADMIN_TOKEN"
14
+
15
+ # Check webhook port
16
+ grep '^CHAT_BRIDGE_WEBHOOK_PORT=' .env 2>/dev/null || echo "CHAT_BRIDGE_WEBHOOK_PORT=8092 (default)"
17
+
18
+ # Check if daemon is running
19
+ pgrep -f smith-chat-daemon && echo "DAEMON_RUNNING" || echo "DAEMON_NOT_RUNNING"
20
+ ```
21
+
22
+ ## What It Does
23
+
24
+ This skill generates a short-lived pairing code that a user sends as a DM to the bot on their chat platform. The daemon validates the code and pairs the sender's chat identity with an agent, authorizing future DM conversations.
25
+
26
+ Pairing codes are 6 alphanumeric characters, uppercase, and expire after 5 minutes (`CHAT_BRIDGE_PAIRING_CODE_TTL`, default 300 seconds).
27
+
28
+ ## Prerequisites
29
+
30
+ - **DM policy must be `pairing`** (the default). If `CHAT_BRIDGE_DM_POLICY` is set to `open` or `allowlist`, pairing codes are not needed — inform the user and skip.
31
+ - **Daemon must be running.** If not, tell the user to run the `start-chat-bridge` skill first.
32
+ - **Admin token must be set.** If `CHAT_BRIDGE_ADMIN_TOKEN` is empty or missing, generate one:
33
+
34
+ ```bash
35
+ grep -q '^CHAT_BRIDGE_ADMIN_TOKEN=.' .env || echo "CHAT_BRIDGE_ADMIN_TOKEN=$(openssl rand -hex 32)" >> .env
36
+ ```
37
+
38
+ Note: if you set the admin token after the daemon started, the daemon must be restarted to pick up the new value.
39
+
40
+ ## Mutation Command
41
+
42
+ Generate a pairing code:
43
+
44
+ ```bash
45
+ curl -s -X POST "http://localhost:${CHAT_BRIDGE_WEBHOOK_PORT:-8092}/admin/pairing-codes" \
46
+ -H "Authorization: Bearer ${CHAT_BRIDGE_ADMIN_TOKEN}" \
47
+ -H "Content-Type: application/json" \
48
+ -d "{\"agent_id\": \"${AGENT_ID:-smith-default}\"}"
49
+ ```
50
+
51
+ The response contains the pairing code:
52
+
53
+ ```json
54
+ {
55
+ "code": "A1B2C3",
56
+ "agent_id": "smith-default",
57
+ "expires_in_secs": 300
58
+ }
59
+ ```
60
+
61
+ ## User Instructions
62
+
63
+ After generating the code, tell the user:
64
+
65
+ > Send this 6-character code as a DM to the bot on your chat platform to pair. The code expires in 5 minutes. Once paired, you can chat with the agent directly via DM.
66
+
67
+ ## Expected Output
68
+
69
+ - A JSON response with `code`, `agent_id`, and `expires_in_secs`.
70
+ - The user can then DM the code to the bot to complete pairing.
71
+
72
+ ## Common Failures
73
+
74
+ | Symptom | Cause | Fix |
75
+ |---------|-------|-----|
76
+ | `DAEMON_NOT_RUNNING` | Daemon not started | Run `start-chat-bridge` skill first |
77
+ | `NO_ADMIN_TOKEN` | Admin token not configured | Generate one and add to `.env`, restart daemon |
78
+ | `401 Unauthorized` | Token mismatch | Ensure `.env` token matches what daemon loaded (restart daemon after changes) |
79
+ | `connection refused` on curl | Daemon not listening on expected port | Check `CHAT_BRIDGE_WEBHOOK_PORT` and daemon logs |
80
+ | Code not accepted by bot | Code expired (>5 min) or already redeemed | Generate a new code |
81
+ | `pairing` not required | DM policy is `open` or `allowlist` | No action needed; DMs are already authorized |
82
+
83
+ ## Notes
84
+
85
+ - Each code can only be redeemed once.
86
+ - Active pairings expire after `CHAT_BRIDGE_PAIRING_TTL` seconds (default 86400 = 24 hours).
87
+ - To change the DM policy, set `CHAT_BRIDGE_DM_POLICY` in `.env` to `pairing`, `allowlist`, or `open` and restart the daemon.
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: Build and validate the agentd workspace from source
3
+ ---
4
+ # Install Agentd
5
+
6
+ Run:
7
+
8
+ ```bash
9
+ cargo build --manifest-path agent/agentd/Cargo.toml --features grpc --bin agentd
10
+ ```
11
+
12
+ ## What It Does
13
+
14
+ This skill prepares the `agentd` binary from source.
15
+
16
+ 1. Compiles `agent/agentd` and internal crates.
17
+ 2. Ensures gRPC support is included (`--features grpc`).
18
+ 3. Produces a runnable `agentd` binary for Envoy transcoding flows.
19
+ 4. Validates crate path wiring in the extracted repo.
20
+
21
+ ## Prerequisites
22
+
23
+ - Rust toolchain installed.
24
+ - Cargo dependency resolution functional.
25
+
26
+ ## Expected Output
27
+
28
+ `cargo build --manifest-path agent/agentd/Cargo.toml --features grpc --bin agentd` finishes successfully.
29
+
30
+ ## Reading Results
31
+
32
+ - Compile errors indicate source/API drift in `agentd` components.
33
+ - Successful build enables `cargo run --manifest-path agent/agentd/Cargo.toml --features grpc --bin agentd -- run ...`.
34
+
35
+ ## Common Failures
36
+
37
+ | Symptom | Cause | Fix |
38
+ |---------|-------|-----|
39
+ | Dependency fetch failures | Network issue | Retry when registry/network is available |
40
+ | Compile errors | Code mismatch | Fix code and re-run build |
41
+ | Toolchain mismatch | Old Rust version | Update to current stable toolchain |
42
+ | Linker errors | Missing system build deps | Install compiler/linker prerequisites |
43
+
44
+ ## Notes
45
+
46
+ This is source-build based; no separate package installer is required.
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: Validate container runtime availability for Smith Core services
3
+ ---
4
+ # Install Runtime
5
+
6
+ Run:
7
+
8
+ ```bash
9
+ docker --version
10
+ docker compose version
11
+ ```
12
+
13
+ ## What It Does
14
+
15
+ This skill validates runtime prerequisites for the infrastructure stack.
16
+
17
+ 1. Confirms Docker engine availability.
18
+ 2. Confirms Compose plugin availability.
19
+ 3. Blocks bootstrap early if runtime prerequisites are missing.
20
+ 4. Keeps installer behavior deterministic.
21
+
22
+ ## Prerequisites
23
+
24
+ - Docker installed on host.
25
+ - Active user has permission to run Docker commands.
26
+
27
+ ## Expected Output
28
+
29
+ Both commands return version information without errors.
30
+
31
+ ## Reading Results
32
+
33
+ - If both commands succeed, proceed to stack startup.
34
+ - If either command fails, runtime must be installed/configured first.
35
+ - On macOS, also ensure `gondolin` is installed before enabling persistent VM sessions.
36
+
37
+ ## Common Failures
38
+
39
+ | Symptom | Cause | Fix |
40
+ |---------|-------|-----|
41
+ | `docker: command not found` | Docker not installed | Install Docker |
42
+ | `permission denied` on daemon socket | User not authorized | Add user to Docker group or use sudo |
43
+ | `docker compose` missing | Compose plugin not installed | Install Docker Compose plugin |
44
+ | Daemon not running | Docker service stopped | Start Docker daemon |
45
+ | `gondolin` missing on macOS | Gondolin not installed | Install Gondolin and confirm `gondolin help` succeeds |
46
+
47
+ ## Notes
48
+
49
+ Installer does not perform OS-level package installation in this repo version.
@@ -0,0 +1,86 @@
1
+ ---
2
+ description: Collect preflight state for installer decision making
3
+ ---
4
+ # Preflight
5
+
6
+ Run:
7
+
8
+ ```bash
9
+ mkdir -p var/installer
10
+ ENV_SOURCE=".env"
11
+ if [ ! -f "$ENV_SOURCE" ]; then
12
+ ENV_SOURCE=".env.example"
13
+ fi
14
+
15
+ read_env_value() {
16
+ local key="$1"
17
+ if [ ! -f "$ENV_SOURCE" ]; then
18
+ echo ""
19
+ return
20
+ fi
21
+ awk -F= -v k="$key" '$1 == k {sub(/^[ \t]+/, "", $2); print $2; exit}' "$ENV_SOURCE"
22
+ }
23
+
24
+ POSTGRES_PASSWORD="$(read_env_value POSTGRES_PASSWORD)"
25
+ MCP_INDEX_API_TOKEN="$(read_env_value MCP_INDEX_API_TOKEN)"
26
+ CLOUDFLARE_TUNNEL_TOKEN="$(read_env_value CLOUDFLARE_TUNNEL_TOKEN)"
27
+ TAILSCALE_AUTHKEY="$(read_env_value TAILSCALE_AUTHKEY)"
28
+
29
+ cat > var/installer/preflight.json <<JSON
30
+ {
31
+ "env_source": "'${ENV_SOURCE}'",
32
+ "node": "'$(node -v 2>/dev/null || echo missing)'",
33
+ "docker": "'$(docker --version 2>/dev/null || echo missing)'",
34
+ "compose": "'$(docker compose version 2>/dev/null || echo missing)'",
35
+ "cargo": "'$(cargo --version 2>/dev/null || echo missing)'",
36
+ "postgres_password_default": "'$( [ "${POSTGRES_PASSWORD}" = "smith-dev" ] && echo yes || echo no )'",
37
+ "mcp_index_token_set": "'$( [ -n "${MCP_INDEX_API_TOKEN}" ] && echo yes || echo no )'",
38
+ "cloudflare_tunnel_hint": "'$( [ -n "${CLOUDFLARE_TUNNEL_TOKEN}" ] && echo yes || echo no )'",
39
+ "tailscale_hint": "'$( [ -n "${TAILSCALE_AUTHKEY}" ] && echo yes || echo no )'"
40
+ }
41
+ JSON
42
+ cat var/installer/preflight.json
43
+ ```
44
+
45
+ ## What It Does
46
+
47
+ This skill creates a lightweight local preflight snapshot for the installer agent.
48
+
49
+ 1. Creates `var/installer/` if needed.
50
+ 2. Captures key runtime version information.
51
+ 3. Writes a JSON state file the agent can reference.
52
+ 4. Avoids repeated probing throughout the install session.
53
+
54
+ ## Prerequisites
55
+
56
+ - Repository write access.
57
+ - Basic shell utilities.
58
+
59
+ ## Expected Output
60
+
61
+ A JSON document exists at `var/installer/preflight.json` and includes:
62
+
63
+ - `env_source`
64
+ - `node`
65
+ - `docker`
66
+ - `compose`
67
+ - `cargo`
68
+ - `postgres_password_default`
69
+ - `mcp_index_token_set`
70
+ - `cloudflare_tunnel_hint`
71
+ - `tailscale_hint`
72
+
73
+ ## Reading Results
74
+
75
+ - Any `missing` value is a hard blocker for full bootstrap.
76
+ - If all values are present, continue with stack startup/build steps.
77
+ - If password defaults or missing private-network hints are detected, continue but emit loud warnings.
78
+
79
+ ## Common Failures
80
+
81
+ | Symptom | Cause | Fix |
82
+ |---------|-------|-----|
83
+ | Cannot create `var/installer` | Permission issue | Fix directory permissions |
84
+ | Empty JSON values | Command substitution failed | Re-run with full shell output |
85
+ | `cat: ... no such file` | Preflight command not run | Re-run preflight block |
86
+ | Missing tunnel hints | VPN/tunnel env not configured yet | Continue with warning and recommend Cloudflare Tunnel or Tailscale |
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: Configure optional ActivityWatch integration guidance for local installs
3
+ ---
4
+ # Setup ActivityWatch
5
+
6
+ Run:
7
+
8
+ ```bash
9
+ echo "ActivityWatch integration is optional in smith-core"
10
+ ```
11
+
12
+ ## What It Does
13
+
14
+ This skill captures optional guidance for ActivityWatch-related tooling.
15
+
16
+ 1. Marks ActivityWatch as non-blocking for core installation.
17
+ 2. Prevents installer flow from failing on optional telemetry extras.
18
+ 3. Documents that ActivityWatch setup should be explicit and user-driven.
19
+ 4. Keeps bootstrap focused on required services.
20
+
21
+ ## Prerequisites
22
+
23
+ - None; this step can be skipped safely.
24
+
25
+ ## Expected Output
26
+
27
+ A clear statement that ActivityWatch is optional and skipped by default.
28
+
29
+ ## Reading Results
30
+
31
+ - If user requires ActivityWatch, configure it separately and then integrate endpoints.
32
+ - If not required, continue directly to build/start/verify steps.
33
+
34
+ ## Common Failures
35
+
36
+ | Symptom | Cause | Fix |
37
+ |---------|-------|-----|
38
+ | User expects ActivityWatch by default | Legacy installer assumptions | Clarify it is optional |
39
+ | Missing ActivityWatch MCP server | Not provisioned in repo stack | Add external server configuration |
40
+ | Agent tries to depend on ActivityWatch metrics | Over-eager automation | Keep optional path disabled unless requested |
41
+
42
+ ## Notes
43
+
44
+ Core Smith Core install success does not depend on ActivityWatch.