108 lines
3.6 KiB
Bash
Executable file
108 lines
3.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Bootstrap OPENKKND2_ROOT and seed legal stubs.
|
|
set -euo pipefail
|
|
|
|
openkknd2_bootstrap() {
|
|
local root="${1:?root}"
|
|
mkdir -p "$root"/{src,include,assets/cinematics,docs,scripts,tests}
|
|
if [[ ! -f "$root/LICENSE" ]]; then
|
|
cat >"$root/LICENSE" <<'L'
|
|
MIT License
|
|
|
|
Copyright (c) 2026 openkknd2 contributors
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
L
|
|
fi
|
|
if [[ ! -f "$root/THIRD_PARTY.md" ]]; then
|
|
cat >"$root/THIRD_PARTY.md" <<'T'
|
|
# Third-party
|
|
|
|
Only permissive / original materials. **Forbidden:** KKnD/KKnD2/Xtreme proprietary assets.
|
|
|
|
| Component | License | Note |
|
|
|-----------|---------|------|
|
|
| (none yet) | | |
|
|
T
|
|
fi
|
|
if [[ ! -f "$root/docs/LORE.md" ]]; then
|
|
cat >"$root/docs/LORE.md" <<'O'
|
|
# Lore (original)
|
|
|
|
Working names (change freely; **do not** use commercial KKnD faction trademarks as official names):
|
|
|
|
- Faction A: **Ashcoat Compact** (scrap tech, discipline)
|
|
- Faction B: **Bloomed** (mutated ecology, swarm tactics)
|
|
|
|
Tone: dry wasteland humor, not a copy of any commercial script.
|
|
O
|
|
fi
|
|
if [[ ! -f "$root/AGENT_LOG.md" ]]; then
|
|
echo "# Agent log" >"$root/AGENT_LOG.md"
|
|
echo "" >>"$root/AGENT_LOG.md"
|
|
echo "Started $(date -u +%Y-%m-%dT%H:%M:%SZ)" >>"$root/AGENT_LOG.md"
|
|
fi
|
|
if [[ ! -f "$root/scripts/ci-headless.sh" ]]; then
|
|
cat >"$root/scripts/ci-headless.sh" <<'C'
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$ROOT"
|
|
# Placeholder until engine exists: legal tree check
|
|
rg -i 'kknd2|krossfire|\.iso\b' --glob '!**/.git/**' . && {
|
|
echo "FORBIDDEN string found" >&2
|
|
exit 2
|
|
} || true
|
|
echo "ci-headless: stub OK (extend when binary exists)"
|
|
C
|
|
chmod +x "$root/scripts/ci-headless.sh"
|
|
fi
|
|
if [[ ! -f "$root/README.md" ]]; then
|
|
cat >"$root/README.md" <<R
|
|
# openkknd2 (worktree)
|
|
|
|
Autonomous agent worktree. **Not** a KKnD remake.
|
|
|
|
\`\`\`bash
|
|
export OPENKKND2_ROOT=$root
|
|
# build/test TBD by agent
|
|
./scripts/ci-headless.sh
|
|
\`\`\`
|
|
|
|
Instructions: \`\$LLM_CONFIGS/instructions/18-openkknd2-autonomous-rebuild.md\`
|
|
R
|
|
fi
|
|
export OPENKKND2_ROOT="$root"
|
|
echo "OPENKKND2_ROOT=$OPENKKND2_ROOT"
|
|
}
|
|
|
|
openkknd2_print_brief() {
|
|
local tool="$1"
|
|
cat <<EOF
|
|
=== openkknd2 agent brief ($tool) ===
|
|
OPENKKND2_ROOT=$OPENKKND2_ROOT
|
|
LLM_CONFIGS=${LLM_CONFIGS:-$HOME/src/llm-configs}
|
|
Knowledge: \$HOME/OsaurusKnowledge/openkknd2/ (or mirror in llm-configs)
|
|
Read and follow:
|
|
\$LLM_CONFIGS/instructions/18-openkknd2-autonomous-rebuild.md
|
|
\$LLM_CONFIGS/instructions/19-openkknd2-cinematics.md
|
|
Rules: original/permissive assets only; autonomous; headless tests after each chunk.
|
|
Cinematics params: MEDIA_WIDTH/HEIGHT/FPS/SECONDS via llm-configs/media/
|
|
EOF
|
|
}
|