fix: setup to org/lisp dirs, TUI protocol, deploy test
- Rewrite setup_system: deploy to org/ and lisp/ instead of harness/ and skills/ - Rewrite doctor_repair: same paths - TUI: add fallback for tui subcommand (matching daemon) - Fix send-message: use ~s instead of (~a) to avoid double-wrapping - Fix input-submit: send proper (:type :event :payload ...) plist format - Remove :timeout arg from get-char (croatoan doesn't support it) - Remove debug log-message from event loop (was noisy) - Verify: TUI runs from XDG deploy, sends messages, daemon processes
This commit is contained in:
63
passepartout
63
passepartout
@@ -83,7 +83,7 @@ setup_system() {
|
||||
|
||||
echo -e "${BLUE}=== Passepartout: Configure ===${NC}"
|
||||
mkdir -p "$PASSEPARTOUT_CONFIG_DIR" "$PASSEPARTOUT_DATA_DIR" "$PASSEPARTOUT_STATE_DIR" "$PASSEPARTOUT_BIN_DIR"
|
||||
mkdir -p "$PASSEPARTOUT_DATA_DIR/harness" "$PASSEPARTOUT_DATA_DIR/tests" "$PASSEPARTOUT_DATA_DIR/skills"
|
||||
mkdir -p "$PASSEPARTOUT_DATA_DIR/org" "$PASSEPARTOUT_DATA_DIR/lisp" "$PASSEPARTOUT_DATA_DIR/tests"
|
||||
|
||||
check_dependencies
|
||||
|
||||
@@ -98,39 +98,22 @@ setup_system() {
|
||||
|
||||
echo -e "${YELLOW}--- Deploying Engine to $PASSEPARTOUT_DATA_DIR ---${NC}"
|
||||
cp "$SCRIPT_DIR/passepartout.asd" "$PASSEPARTOUT_DATA_DIR/"
|
||||
mkdir -p "$PASSEPARTOUT_DATA_DIR/harness" "$PASSEPARTOUT_DATA_DIR/tests" "$PASSEPARTOUT_DATA_DIR/skills"
|
||||
mkdir -p "$PASSEPARTOUT_DATA_DIR/org" "$PASSEPARTOUT_DATA_DIR/lisp" "$PASSEPARTOUT_DATA_DIR/tests"
|
||||
export INSTALL_DIR="$PASSEPARTOUT_DATA_DIR"
|
||||
|
||||
cp "$SCRIPT_DIR/org"/*.org "$PASSEPARTOUT_DATA_DIR/harness/"
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/harness" && emacs -Q --batch \
|
||||
--eval "(require 'org)" \
|
||||
--eval "(setq org-confirm-babel-evaluate nil)" \
|
||||
--eval "(org-babel-tangle-file \"manifest.org\")") >/dev/null 2>&1 || true
|
||||
for f in "$PASSEPARTOUT_DATA_DIR/harness"/*.org; do
|
||||
fname=$(basename "$f" .org)
|
||||
[ "$fname" = "manifest" ] && continue
|
||||
echo "Tangling harness/$fname.org..."
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/harness" && emacs -Q --batch \
|
||||
--eval "(require 'org)" \
|
||||
--eval "(setq org-confirm-babel-evaluate nil)" \
|
||||
--eval "(org-babel-tangle-file \"${fname}.org\")") >/dev/null 2>&1 || true
|
||||
done
|
||||
find "$PASSEPARTOUT_DATA_DIR/harness" -name "*-tests.lisp" -exec mv {} "$PASSEPARTOUT_DATA_DIR/tests/" \; 2>/dev/null || true
|
||||
rm -f "$PASSEPARTOUT_DATA_DIR/harness"/*.org
|
||||
|
||||
# Tangle all org files into lisp/
|
||||
for f in "$SCRIPT_DIR/org"/*.org; do
|
||||
[ -f "$f" ] || continue
|
||||
fname=$(basename "$f" .org)
|
||||
echo "Tangling skills/$fname.org..."
|
||||
cp "$f" "$PASSEPARTOUT_DATA_DIR/skills/"
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/skills" && emacs -Q --batch \
|
||||
echo "Tangling $fname..."
|
||||
cp "$f" "$PASSEPARTOUT_DATA_DIR/org/"
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/org" && emacs -Q --batch \
|
||||
--eval "(require 'org)" \
|
||||
--eval "(setq org-confirm-babel-evaluate nil)" \
|
||||
--eval "(org-babel-tangle-file \"${fname}.org\")") >/dev/null 2>&1 || true
|
||||
rm -f "$PASSEPARTOUT_DATA_DIR/skills/$fname.org"
|
||||
done
|
||||
find "$PASSEPARTOUT_DATA_DIR/skills" -name "*-tests.lisp" -exec mv {} "$PASSEPARTOUT_DATA_DIR/tests/" \; 2>/dev/null || true
|
||||
[ -f "$PASSEPARTOUT_DATA_DIR/run-all-tests.lisp" ] && mv "$PASSEPARTOUT_DATA_DIR/run-all-tests.lisp" "$PASSEPARTOUT_DATA_DIR/harness/"
|
||||
rm -f "$PASSEPARTOUT_DATA_DIR/harness"/*.org "$PASSEPARTOUT_DATA_DIR/skills"/*.org
|
||||
# Move test files to tests/ directory
|
||||
find "$PASSEPARTOUT_DATA_DIR/lisp" -name "*-tests.lisp" -exec mv {} "$PASSEPARTOUT_DATA_DIR/tests/" \; 2>/dev/null || true
|
||||
|
||||
ln -sf "$SCRIPT_DIR/passepartout.sh" "$PASSEPARTOUT_BIN_DIR/passepartout"
|
||||
|
||||
@@ -160,38 +143,23 @@ doctor_repair() {
|
||||
echo -e "${BLUE}=== Passepartout: Repair Mode ===${NC}"
|
||||
check_dependencies
|
||||
mkdir -p "$PASSEPARTOUT_CONFIG_DIR" "$PASSEPARTOUT_DATA_DIR" "$PASSEPARTOUT_STATE_DIR" "$PASSEPARTOUT_BIN_DIR"
|
||||
mkdir -p "$PASSEPARTOUT_DATA_DIR/harness" "$PASSEPARTOUT_DATA_DIR/tests" "$PASSEPARTOUT_DATA_DIR/skills"
|
||||
mkdir -p "$PASSEPARTOUT_DATA_DIR/org" "$PASSEPARTOUT_DATA_DIR/lisp" "$PASSEPARTOUT_DATA_DIR/tests"
|
||||
for f in "$SCRIPT_DIR/org"/*.org; do
|
||||
[ -f "$f" ] || continue
|
||||
fname=$(basename "$f" .org)
|
||||
echo " Checking harness/$fname..."
|
||||
echo " Checking $fname..."
|
||||
if ! sbcl --non-interactive \
|
||||
--eval "(load \"$PASSEPARTOUT_DATA_DIR/harness/${fname}.lisp\")" \
|
||||
--eval "(load \"$PASSEPARTOUT_DATA_DIR/lisp/${fname}.lisp\")" \
|
||||
--eval "(format t \"OK~%\")" 2>/dev/null | grep -q "OK"; then
|
||||
echo " Re-tangling $fname.org..."
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/harness" && emacs -Q --batch \
|
||||
--eval "(require 'org)" \
|
||||
--eval "(setq org-confirm-babel-evaluate nil)" \
|
||||
--eval "(org-babel-tangle-file \"$f\")") >/dev/null 2>&1 || true
|
||||
fi
|
||||
done
|
||||
for f in "$SCRIPT_DIR/org"/*.org; do
|
||||
[ -f "$f" ] || continue
|
||||
fname=$(basename "$f" .org)
|
||||
echo " Checking skill/$fname..."
|
||||
if ! sbcl --non-interactive \
|
||||
--eval "(load \"$PASSEPARTOUT_DATA_DIR/skills/${fname}.lisp\")" \
|
||||
--eval "(format t \"OK~%\")" 2>/dev/null | grep -q "OK"; then
|
||||
echo " Re-tangling $fname.org..."
|
||||
cp "$f" "$PASSEPARTOUT_DATA_DIR/skills/"
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/skills" && emacs -Q --batch \
|
||||
cp "$f" "$PASSEPARTOUT_DATA_DIR/org/"
|
||||
(cd "$PASSEPARTOUT_DATA_DIR/org" && emacs -Q --batch \
|
||||
--eval "(require 'org)" \
|
||||
--eval "(setq org-confirm-babel-evaluate nil)" \
|
||||
--eval "(org-babel-tangle-file \"${fname}.org\")") >/dev/null 2>&1 || true
|
||||
rm -f "$PASSEPARTOUT_DATA_DIR/skills/$fname.org"
|
||||
fi
|
||||
done
|
||||
rm -f "$PASSEPARTOUT_DATA_DIR/harness"/*.org "$PASSEPARTOUT_DATA_DIR/skills"/*.org 2>/dev/null || true
|
||||
find "$PASSEPARTOUT_DATA_DIR/lisp" -name "*-tests.lisp" -exec mv {} "$PASSEPARTOUT_DATA_DIR/tests/" \; 2>/dev/null || true
|
||||
echo -e "${GREEN}--- Repair Complete ---${NC}"
|
||||
}
|
||||
|
||||
@@ -397,6 +365,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
tui)
|
||||
check_dependencies
|
||||
export PASSEPARTOUT_DATA_DIR="${PASSEPARTOUT_DATA_DIR:-$SCRIPT_DIR}"
|
||||
if ! ss -tln 2>/dev/null | grep -q 9105 && ! netstat -tln 2>/dev/null | grep -q 9105; then
|
||||
echo "Starting daemon first..."
|
||||
$0 daemon
|
||||
|
||||
Reference in New Issue
Block a user