diff --git a/.memory/worklog.json b/.memory/worklog.json
index 4df76a6..6fb06ad 100644
--- a/.memory/worklog.json
+++ b/.memory/worklog.json
@@ -1,19 +1,5 @@
{
"entries": [
- {
- "files_changed": 3,
- "hash": "61a4bec",
- "message": "auto-save 2026-05-13 19:12 (~3)",
- "ts": "2026-05-13T19:12:17+08:00",
- "type": "commit"
- },
- {
- "files_changed": 4,
- "hash": "fda2980",
- "message": "auto-save 2026-05-13 19:17 (~4)",
- "ts": "2026-05-13T19:17:48+08:00",
- "type": "commit"
- },
{
"files_changed": 1,
"message": "Codex 会话活跃 · 最近命令:codex · 1 项未提交变更 · 最近提交:auto-save 2026-05-13 19:17 (~4)",
@@ -3250,6 +3236,19 @@
"message": "auto-save 2026-05-15 11:18 (+1, ~4)",
"hash": "08aed2a",
"files_changed": 6
+ },
+ {
+ "ts": "2026-05-15T11:23:51+08:00",
+ "type": "commit",
+ "message": "auto-save 2026-05-15 11:23 (~1)",
+ "hash": "e6b2768",
+ "files_changed": 1
+ },
+ {
+ "ts": "2026-05-15T03:24:44Z",
+ "type": "session-heartbeat",
+ "message": "Codex 会话活跃 · 最近命令:codex · 1 项未提交变更 · 最近提交:auto-save 2026-05-15 11:23 (~1)",
+ "files_changed": 1
}
]
}
diff --git a/scripts/launchd/com.skg.tk-recreate.api.dev.plist b/scripts/launchd/com.skg.tk-recreate.api.dev.plist
new file mode 100644
index 0000000..0d0271e
--- /dev/null
+++ b/scripts/launchd/com.skg.tk-recreate.api.dev.plist
@@ -0,0 +1,24 @@
+
+
+
+
+ Label
+ com.skg.tk-recreate.api.dev
+ ProgramArguments
+
+ /bin/zsh
+ -lc
+ cd /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/api && source .venv/bin/activate && exec .venv/bin/uvicorn main:app --host 127.0.0.1 --port 4291
+
+ WorkingDirectory
+ /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/api
+ StandardOutPath
+ /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/api.launchd.log
+ StandardErrorPath
+ /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/api.launchd.err.log
+ RunAtLoad
+
+ KeepAlive
+
+
+
diff --git a/scripts/launchd/com.skg.tk-recreate.web.dev.plist b/scripts/launchd/com.skg.tk-recreate.web.dev.plist
new file mode 100644
index 0000000..7e8cd18
--- /dev/null
+++ b/scripts/launchd/com.skg.tk-recreate.web.dev.plist
@@ -0,0 +1,24 @@
+
+
+
+
+ Label
+ com.skg.tk-recreate.web.dev
+ ProgramArguments
+
+ /bin/zsh
+ -lc
+ cd /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/web && exec pnpm dev
+
+ WorkingDirectory
+ /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/web
+ StandardOutPath
+ /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/web.launchd.log
+ StandardErrorPath
+ /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/web.launchd.err.log
+ RunAtLoad
+
+ KeepAlive
+
+
+
diff --git a/scripts/start-dev-background.sh b/scripts/start-dev-background.sh
index 523d3ac..7106db3 100755
--- a/scripts/start-dev-background.sh
+++ b/scripts/start-dev-background.sh
@@ -6,6 +6,10 @@ API_DIR="$ROOT_DIR/api"
WEB_DIR="$ROOT_DIR/web"
LOG_DIR="$ROOT_DIR/.logs"
PID_DIR="$ROOT_DIR/.pids"
+LAUNCHD_DIR="$ROOT_DIR/scripts/launchd"
+LAUNCHD_DOMAIN="gui/$(id -u)"
+API_LABEL="com.skg.tk-recreate.api.dev"
+WEB_LABEL="com.skg.tk-recreate.web.dev"
mkdir -p "$LOG_DIR" "$PID_DIR"
@@ -23,12 +27,9 @@ start_api() {
echo "missing api/.venv/bin/uvicorn" >&2
exit 1
fi
- (
- cd "$API_DIR"
- nohup .venv/bin/uvicorn main:app --host 127.0.0.1 --port 4291 >> "$LOG_DIR/api.log" 2>&1 &
- echo $! > "$PID_DIR/api.pid"
- )
- echo "api started on 4291, log: $LOG_DIR/api.log"
+ launchctl bootout "$LAUNCHD_DOMAIN" "$API_LABEL" >/dev/null 2>&1 || true
+ launchctl bootstrap "$LAUNCHD_DOMAIN" "$LAUNCHD_DIR/$API_LABEL.plist"
+ echo "api started on 4291 via launchd, log: $LOG_DIR/api.launchd.log"
}
start_web() {
@@ -40,12 +41,9 @@ start_web() {
echo "missing pnpm in PATH" >&2
exit 1
fi
- (
- cd "$WEB_DIR"
- nohup pnpm dev >> "$LOG_DIR/web.log" 2>&1 &
- echo $! > "$PID_DIR/web.pid"
- )
- echo "web started on 4290, log: $LOG_DIR/web.log"
+ launchctl bootout "$LAUNCHD_DOMAIN" "$WEB_LABEL" >/dev/null 2>&1 || true
+ launchctl bootstrap "$LAUNCHD_DOMAIN" "$LAUNCHD_DIR/$WEB_LABEL.plist"
+ echo "web started on 4290 via launchd, log: $LOG_DIR/web.launchd.log"
}
start_api
diff --git a/scripts/stop-dev-background.sh b/scripts/stop-dev-background.sh
index 717b691..d0c5cf0 100755
--- a/scripts/stop-dev-background.sh
+++ b/scripts/stop-dev-background.sh
@@ -3,6 +3,16 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PID_DIR="$ROOT_DIR/.pids"
+LAUNCHD_DOMAIN="gui/$(id -u)"
+
+stop_launchd_label() {
+ local label="$1"
+ if launchctl bootout "$LAUNCHD_DOMAIN" "$label" >/dev/null 2>&1; then
+ echo "$label stopped"
+ else
+ echo "$label not loaded"
+ fi
+}
stop_pid_file() {
local name="$1"
@@ -24,3 +34,5 @@ stop_pid_file() {
stop_pid_file api
stop_pid_file web
+stop_launchd_label com.skg.tk-recreate.api.dev
+stop_launchd_label com.skg.tk-recreate.web.dev