Files
paseo/scripts/dev.ps1
Mohamed Boudra 53c14d9855 Extract client SDK package (#1052)
* Extract client SDK package

* Polish SDK client identity defaults

* Build client before dependent CI jobs

* Restore daemon client server export

* Extract protocol and client SDK packages

* Fix provider override schema validation

* Fix app test daemon client imports

* Simplify workspace build targets

* Fix CLI test server build bootstrap

* Run SDK package tests in CI

* Fix rebase package split drift

* Restore lockfile registry metadata

* Update SDK config test for prompt default

* Move terminal stream router test to client package

* Fix rebase drift for protocol imports

* Fix SDK agent capability fixture

* Restore legacy server client exports

* Fix server export compatibility test

* Advertise custom mode icon client capability

* Remove server daemon-client exports

* Format rebased mode control import

* Fix rebase drift for protocol imports

Files added by upstream PRs (#893, #1147, #1154) referenced the pre-split
shared/ paths that this branch moves into @getpaseo/protocol. Redirect
those imports to the protocol package so typecheck stays green after the
rebase.
2026-05-28 01:58:18 +08:00

61 lines
2.5 KiB
PowerShell

$ErrorActionPreference = "Stop"
# Ensure node_modules/.bin is in PATH
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$env:PATH = "$ScriptDir\..\node_modules\.bin;$env:PATH"
# Derive PASEO_HOME: stable name for worktrees, temporary dir otherwise
if (-not $env:PASEO_HOME) {
$GitDir = git rev-parse --git-dir 2>$null
$GitCommonDir = git rev-parse --git-common-dir 2>$null
if ($GitDir -and $GitCommonDir -and ($GitDir -ne $GitCommonDir)) {
# Inside a worktree — derive a stable home from the worktree name
$WorktreeRoot = git rev-parse --show-toplevel
$WorktreeName = (Split-Path -Leaf $WorktreeRoot).ToLower() -replace '[^a-z0-9-]', '-' -replace '-+', '-' -replace '^-|-$', ''
$env:PASEO_HOME = "$env:USERPROFILE\.paseo-$WorktreeName"
New-Item -ItemType Directory -Force -Path $env:PASEO_HOME | Out-Null
} else {
$env:PASEO_HOME = Join-Path ([System.IO.Path]::GetTempPath()) "paseo-dev-$([System.Guid]::NewGuid().ToString('N').Substring(0,6))"
New-Item -ItemType Directory -Force -Path $env:PASEO_HOME | Out-Null
# Register cleanup on exit
$TempPaseoHome = $env:PASEO_HOME
Register-EngineEvent PowerShell.Exiting -Action {
Remove-Item -Recurse -Force $TempPaseoHome -ErrorAction SilentlyContinue
} | Out-Null
}
}
# Share speech models with the main install to avoid duplicate downloads
if (-not $env:PASEO_LOCAL_MODELS_DIR) {
$env:PASEO_LOCAL_MODELS_DIR = "$env:USERPROFILE\.paseo\models\local-speech"
New-Item -ItemType Directory -Force -Path $env:PASEO_LOCAL_MODELS_DIR | Out-Null
}
Write-Host @"
======================================================
Paseo Dev (Windows)
======================================================
Home: $($env:PASEO_HOME)
Models: $($env:PASEO_LOCAL_MODELS_DIR)
Daemon: localhost:6767
======================================================
"@
# Allow any origin in dev so Electron on random ports all work.
# SECURITY: wildcard CORS is unsafe in production — only acceptable here because
# the daemon binds to localhost and this script is never used for production.
$env:PASEO_CORS_ORIGINS = "*"
# Configure the app to auto-connect to this daemon on localhost
$env:APP_VARIANT = "development"
$env:EXPO_PUBLIC_LOCAL_DAEMON = "localhost:6767"
$env:BROWSER = "none"
# Run both with concurrently
concurrently `
--names "daemon,metro" `
--prefix-colors "cyan,magenta" `
"npm run dev:server" `
"cd packages/app && npx expo start"