feat(office): autonomous agent management layer (#914)
This commit is contained in:
@@ -58,6 +58,7 @@ help:
|
||||
@echo " dev-backend Run backend in development mode (port 38429)"
|
||||
@echo " dev-web Run web app in development mode (port 37429)"
|
||||
@echo " dev Note: Uses apps/cli launcher (auto ports)"
|
||||
@echo " doctor Idempotently wire up pre-commit hooks (runs automatically before dev)"
|
||||
@echo ""
|
||||
@echo "Production Commands:"
|
||||
@echo " start Install deps, build, and start backend + web in production mode"
|
||||
@@ -120,8 +121,37 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
# Idempotent: wires the pre-commit framework into git's hook system
|
||||
# (.pre-commit-config.yaml at the repo root drives it). Runs as a
|
||||
# dependency of `dev` so every fresh clone / worktree picks up the
|
||||
# format + lint hooks the first time a contributor starts the dev
|
||||
# server, without anyone having to remember a setup step.
|
||||
#
|
||||
# Silent unless pre-commit is missing — in that case it prints a
|
||||
# one-line note instead of failing, because `make dev` should not
|
||||
# block on an optional tool. CI still runs the real linters.
|
||||
#
|
||||
# Quirks handled:
|
||||
# - pre-commit refuses to install when core.hooksPath is set, even
|
||||
# when it's set to the default location (a leftover from a stale
|
||||
# setup). Detect that exact case and unset it before installing.
|
||||
# - core.hooksPath is shared between the main repo and every
|
||||
# worktree, so a single install covers all of them.
|
||||
.PHONY: doctor
|
||||
doctor:
|
||||
@if ! command -v pre-commit >/dev/null 2>&1; then \
|
||||
echo "⚠ pre-commit not found on PATH — install with 'pip install pre-commit' to enable hook-based format/lint on commit."; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
default_hooks="$$(git rev-parse --git-common-dir)/hooks"; \
|
||||
current="$$(git config --get core.hooksPath 2>/dev/null || true)"; \
|
||||
if [ -n "$$current" ] && [ "$$current" = "$$default_hooks" ]; then \
|
||||
git config --unset core.hooksPath 2>/dev/null || true; \
|
||||
fi; \
|
||||
pre-commit install -t pre-commit -t commit-msg --overwrite >/dev/null 2>&1 || true
|
||||
|
||||
.PHONY: dev
|
||||
dev:
|
||||
dev: doctor
|
||||
ifneq ($(HOST_IS_LINUX_AMD64),1)
|
||||
@echo "Building Linux agentctl for remote executors..."
|
||||
@$(MAKE) -C $(BACKEND_DIR) build-agentctl-linux
|
||||
|
||||
Reference in New Issue
Block a user