diff --git a/.gitignore b/.gitignore index 8099e28231f..c3779e9d503 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,4 @@ apps/streams/data/ # Generated by setup.sh Caddyfile +superset-dev-data/ diff --git a/.superset/setup.sh b/.superset/setup.sh index 53dc3adaa5d..d714cb12dba 100755 --- a/.superset/setup.sh +++ b/.superset/setup.sh @@ -10,11 +10,44 @@ NC='\033[0m' # Step tracking declare -a FAILED_STEPS=() declare -a SKIPPED_STEPS=() +FORCE_OVERWRITE_DATA=0 error() { echo -e "${RED}โœ—${NC} $1"; } success() { echo -e "${GREEN}โœ“${NC} $1"; } warn() { echo -e "${YELLOW}!${NC} $1"; } +print_usage() { + cat < /dev/null; then + sqlite3 "$dest_db" "PRAGMA wal_checkpoint(TRUNCATE);" &> /dev/null || true + fi + + success "Local DB seeded from $source_db" + return 0 +} + main() { + if ! parse_args "$@"; then + return 1 + fi + echo "๐Ÿš€ Setting up Superset workspace..." echo "" @@ -495,17 +587,22 @@ main() { step_failed "Install dependencies" fi - # Step 4: Setup Neon branch + # Step 4: Seed local DB into superset-dev-data/ + if ! step_seed_local_db; then + step_failed "Seed local DB" + fi + + # Step 5: Setup Neon branch if ! step_setup_neon_branch; then step_failed "Setup Neon branch" fi - # Step 5: Start Electric SQL + # Step 6: Start Electric SQL if ! step_start_electric; then step_failed "Start Electric SQL" fi - # Step 6: Write .env file + # Step 7: Write .env file if ! step_write_env; then step_failed "Write .env file" fi diff --git a/.superset/teardown.sh b/.superset/teardown.sh index e049943743c..c8c47d0fa35 100755 --- a/.superset/teardown.sh +++ b/.superset/teardown.sh @@ -10,11 +10,44 @@ NC='\033[0m' # Step tracking declare -a FAILED_STEPS=() declare -a SKIPPED_STEPS=() +REMOVE_DEV_DATA=0 error() { echo -e "${RED}โœ—${NC} $1"; } success() { echo -e "${GREEN}โœ“${NC} $1"; } warn() { echo -e "${YELLOW}!${NC} $1"; } +print_usage() { + cat < { describe("mapEventType", () => { diff --git a/apps/desktop/src/main/lib/notifications/server.ts b/apps/desktop/src/main/lib/notifications/server.ts index 7f4e849d50b..54e54b8d542 100644 --- a/apps/desktop/src/main/lib/notifications/server.ts +++ b/apps/desktop/src/main/lib/notifications/server.ts @@ -5,6 +5,7 @@ import { env } from "shared/env.shared"; import type { AgentLifecycleEvent } from "shared/notification-types"; import { appState } from "../app-state"; import { HOOK_PROTOCOL_VERSION } from "../terminal/env"; +import { mapEventType } from "./map-event-type"; // Re-export types for backwards compatibility export type { @@ -36,36 +37,6 @@ app.use((req, res, next) => { next(); }); -/** - * Maps incoming event types to canonical lifecycle events. - * Handles variations from different agent CLIs. - * - * Returns null for unknown events - caller should ignore these gracefully - * to maintain forward compatibility with newer hook versions. - * - * Note: We no longer default missing eventType to "Stop" to prevent - * parse failures from being treated as completions. - * - * @internal Exported for testing - */ -export function mapEventType( - eventType: string | undefined, -): "Start" | "Stop" | "PermissionRequest" | null { - if (!eventType) { - return null; // Missing eventType should be ignored, not treated as Stop - } - if (eventType === "Start" || eventType === "UserPromptSubmit") { - return "Start"; - } - if (eventType === "PermissionRequest") { - return "PermissionRequest"; - } - if (eventType === "Stop" || eventType === "agent-turn-complete") { - return "Stop"; - } - return null; // Unknown events are ignored for forward compatibility -} - /** * Resolves paneId from tabId or workspaceId using synced tabs state. * Falls back to focused pane in active tab.