#!/usr/bin/env node/**
* water.mjs — ставит океан/небо/мир Ultra-Water (Humpalumps, MIT) в трехмерный
* проект на three.js одной командой.
*
* node ~/.agent-harness/tools/water.mjs [projectDir] [--force] [--dry]
*
* Что делает:
* 1) копирует эталонные модули движка в <project>/src/uw/ (с LICENSE и
* THIRD_PARTY_NOTICES — атрибуция обязательна по MIT);
* 2) кладёт интеграционный слой <project>/src/world/world.ts и страницу
* проверки uw-check.html + src/uwcheck.ts;
* 3) правит package.json (three r186), tsconfig.json (allowJs/checkJs)
* и vite.config (алиас three/addons → three/examples/jsm).
*
* Ничего не перезаписывает без --force. Печатает каждый шаг.
*/importfsfrom'node:fs';importpathfrom'node:path';import{ fileURLToPath }from'node:url';constHERE= path.dirname(fileURLToPath(import.meta.url));// ассеты лежат рядом с инструментом: install.mjs кладёт дерево tools целиком,// поэтому payload переезжает в любой рантайм вместе с инструментомconstASSETS= path.
argv process
flags argv a
positional argv a
root pathpositional process
flags
flags
failed
failed
src path rel
dest pathroot destRel
fsdest
fspathdest
fssrc dest
src path rel
entry fssrc
to
entry to
to
fsfile
fsroot
process
fs
process
pkgPath pathroot
fspkgPath
process
process
pkg pkgPath
pkg
pkg pkg
pkg
pkg
pkg pkg
pkg
nextPkg pkg
nextPkg fspkgPath
fspkgPath nextPkg
tsPath
pathroot f
fsf
tsPath
raw fstsPath
raw raw
next raw
next
next next
fstsPath next
vitePath
pathroot f
fsf
vitePath
file pathroot
fs
file
raw fsvitePath
raw
raw
next raw
next
next next
fsvitePath next
cfgMatch raw raw
cfgMatch
at cfgMatch cfgMatch
next
next
next next
fsvitePath next
processfailed
'npm run dev → откройте /uw-check.html (изолированная проверка движка)'
)
;
log
(
'затем подключите свой слой: import { World } from "./world/world"'
)
;
console
.
log
(
`
Лицензия: MIT. В src/uw/ уже лежат LICENSE и THIRD_PARTY_NOTICES.md —
не удаляйте их: внутри credit'ы three.js (AgX), D. Hoskins (hash),
S. Hillaire (атмосфера).`