auto-save 2026-05-15 11:29 (+1, ~3)

This commit is contained in:
2026-05-15 11:29:23 +08:00
parent e6b2768482
commit 55a9a9d936
5 changed files with 83 additions and 26 deletions

View File

@@ -1,19 +1,5 @@
{ {
"entries": [ "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, "files_changed": 1,
"message": "Codex 会话活跃 · 最近命令codex · 1 项未提交变更 · 最近提交auto-save 2026-05-13 19:17 (~4)", "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)", "message": "auto-save 2026-05-15 11:18 (+1, ~4)",
"hash": "08aed2a", "hash": "08aed2a",
"files_changed": 6 "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
} }
] ]
} }

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.skg.tk-recreate.api.dev</string>
<key>ProgramArguments</key>
<array>
<string>/bin/zsh</string>
<string>-lc</string>
<string>cd /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/api &amp;&amp; source .venv/bin/activate &amp;&amp; exec .venv/bin/uvicorn main:app --host 127.0.0.1 --port 4291</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/api</string>
<key>StandardOutPath</key>
<string>/Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/api.launchd.log</string>
<key>StandardErrorPath</key>
<string>/Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/api.launchd.err.log</string>
<key>RunAtLoad</key>
<false/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.skg.tk-recreate.web.dev</string>
<key>ProgramArguments</key>
<array>
<string>/bin/zsh</string>
<string>-lc</string>
<string>cd /Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/web &amp;&amp; exec pnpm dev</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/web</string>
<key>StandardOutPath</key>
<string>/Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/web.launchd.log</string>
<key>StandardErrorPath</key>
<string>/Users/kangwan/Projects/business/20260512-20260512-skg-tk-二创验证/.logs/web.launchd.err.log</string>
<key>RunAtLoad</key>
<false/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>

View File

@@ -6,6 +6,10 @@ API_DIR="$ROOT_DIR/api"
WEB_DIR="$ROOT_DIR/web" WEB_DIR="$ROOT_DIR/web"
LOG_DIR="$ROOT_DIR/.logs" LOG_DIR="$ROOT_DIR/.logs"
PID_DIR="$ROOT_DIR/.pids" 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" mkdir -p "$LOG_DIR" "$PID_DIR"
@@ -23,12 +27,9 @@ start_api() {
echo "missing api/.venv/bin/uvicorn" >&2 echo "missing api/.venv/bin/uvicorn" >&2
exit 1 exit 1
fi fi
( launchctl bootout "$LAUNCHD_DOMAIN" "$API_LABEL" >/dev/null 2>&1 || true
cd "$API_DIR" launchctl bootstrap "$LAUNCHD_DOMAIN" "$LAUNCHD_DIR/$API_LABEL.plist"
nohup .venv/bin/uvicorn main:app --host 127.0.0.1 --port 4291 >> "$LOG_DIR/api.log" 2>&1 & echo "api started on 4291 via launchd, log: $LOG_DIR/api.launchd.log"
echo $! > "$PID_DIR/api.pid"
)
echo "api started on 4291, log: $LOG_DIR/api.log"
} }
start_web() { start_web() {
@@ -40,12 +41,9 @@ start_web() {
echo "missing pnpm in PATH" >&2 echo "missing pnpm in PATH" >&2
exit 1 exit 1
fi fi
( launchctl bootout "$LAUNCHD_DOMAIN" "$WEB_LABEL" >/dev/null 2>&1 || true
cd "$WEB_DIR" launchctl bootstrap "$LAUNCHD_DOMAIN" "$LAUNCHD_DIR/$WEB_LABEL.plist"
nohup pnpm dev >> "$LOG_DIR/web.log" 2>&1 & echo "web started on 4290 via launchd, log: $LOG_DIR/web.launchd.log"
echo $! > "$PID_DIR/web.pid"
)
echo "web started on 4290, log: $LOG_DIR/web.log"
} }
start_api start_api

View File

@@ -3,6 +3,16 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PID_DIR="$ROOT_DIR/.pids" 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() { stop_pid_file() {
local name="$1" local name="$1"
@@ -24,3 +34,5 @@ stop_pid_file() {
stop_pid_file api stop_pid_file api
stop_pid_file web stop_pid_file web
stop_launchd_label com.skg.tk-recreate.api.dev
stop_launchd_label com.skg.tk-recreate.web.dev