Add agent_task_sessions table for per-task session state keyed by (agent, adapter, taskKey). Add AgentTaskSession type, resetAgentSessionSchema validator, and sessionDisplayId/sessionParamsJson to AgentRuntimeState. Rework migration hash-resolution fallback ordering to prefer hash-based matching over timestamp-based journal matching. Move backup-db.sh logic into packages/db/src/backup.ts for programmatic use and simplify the shell script to call the TypeScript implementation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
406 B
Bash
Executable File
17 lines
406 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Backup the embedded PostgreSQL database to data/backups/
|
|
#
|
|
# Usage:
|
|
# ./scripts/backup-db.sh
|
|
# pnpm db:backup
|
|
#
|
|
# The embedded postgres must be running (start with: pnpm dev)
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
cd "$PROJECT_ROOT"
|
|
exec pnpm --filter @paperclip/db exec tsx src/backup.ts "$@"
|