ZDDC/training-data/build-interaction-collector.sh
ZDDC ea385b5366 Initial commit
ZDDC — Zero Day Document Control. A file-naming convention plus five
single-file HTML tools (archive, transmittal, classifier, mdedit,
landing) and an optional Go HTTP server (zddc-server) with ACL and a
virtual archive index. Self-contained, offline-capable, dependency-free.

See README.md for an overview, AGENTS.md and ARCHITECTURE.md for the
build/release/architecture detail, bootstrap/README.md for the
two-level deployment install pattern, and zddc/README.md for the
HTTP server.
2026-04-27 11:05:47 -05:00

55 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
# build-interaction-collector.sh
# Install dependencies for the interaction collector
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Installing Node.js Dependencies ==="
# Check if Node.js is available
if ! command -v node &> /dev/null; then
echo "Error: Node.js is not installed"
echo "Please install Node.js 18+ from https://nodejs.org/"
exit 1
fi
NODE_VERSION=$(node --version)
echo "Node.js version: $NODE_VERSION"
# Check minimal version
NODE_MAJOR=$(echo $NODE_VERSION | cut -c2- | cut -d. -f1)
if [ "$NODE_MAJOR" -lt 18 ]; then
echo "Error: Node.js 18+ is required"
exit 1
fi
echo "✓ Node.js version check passed"
# Create package.json if it doesn't exist
if [ ! -f package.json ]; then
cat > package.json << 'EOF'
{
"name": "zddc-training-data",
"version": "1.0.0",
"description": "Training data collection for ZDDC fine-tuning",
"type": "module",
"main": "collect-interaction.js",
"scripts": {
"collect": "node collect-interaction.js"
},
"keywords": ["zddc", "training", "lora"],
"license": "MIT"
}
EOF
fi
echo "✓ Created/verified package.json"
echo ""
echo "=== Ready to use ==="
echo "Usage: node collect-interaction.js --query \"...\" --qwen \"...\" --expert \"...\""
echo " node collect-interaction.js --query \"How do I...\" --qwen \"[Qwen answer]\" --expert \"[Expert answer]\""
echo ""
echo "To batch process interactions, use process.sh"