Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 249 additions & 22 deletions setup/Install-EssAdk.Tests.ps1

Large diffs are not rendered by default.

116 changes: 98 additions & 18 deletions setup/Install-EssAdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,21 @@
Prompts for your Dataverse environment URL and creates a minimal
.local/config.json so FlightCheck can authenticate without running /setup.

.PARAMETER InstallMode
Selects the VS Code experience: 'maker' (chat-first, hidden developer
chrome - was 'lite'), 'developer' (default VS Code layout with /setup
injection - was 'standard'), or 'prompt' (default: this installer
asks the maker in the terminal, defaulting to 'maker' under a
non-interactive shell). The ESS Maker Profile extension is installed
in every mode; only the layout and /setup delivery differ. Explicit
values are respected without a prompt; 'prompt' is the recommended
default for new customers. The legacy values 'lite' and 'standard' are
still accepted and coerced to 'maker' and 'developer' respectively.

.PARAMETER SkipMakerProfile
Skip installing the bundled "ESS Maker Profile" VS Code extension. The
profile hides developer chrome (file tree, tabs, status bar, etc.) and
drops the user into a chat-first surface tailored to the HR/IT admin
persona. Use this switch to keep the stock VS Code layout - typically
only relevant for developers iterating on the kit itself.
Back-compat switch. Equivalent to -InstallMode developer. Retained so
existing bootstrap.ps1 invocations and CI scripts keep working; new
callers should use -InstallMode instead.

.EXAMPLE
# Default invocation. May fail on stock Windows due to PowerShell
Expand All @@ -84,9 +93,74 @@ param(
[switch] $SkipLaunch,
[switch] $UseDsc,
[switch] $FlightCheckOnly,
[ValidateSet('maker', 'developer', 'prompt', 'lite', 'standard')]
[string] $InstallMode = 'prompt',
[switch] $SkipMakerProfile
)

# Back-compat: -SkipMakerProfile forces developer mode even when
# -InstallMode is passed. This preserves the old behaviour where the
# switch was the only way to say "no chat-first layout".
if ($SkipMakerProfile) { $InstallMode = 'developer' }

# Back-compat: legacy value aliases from the pre-rename installer
# (bootstrap-lite.ps1 previously pinned 'lite'; -SkipMakerProfile alias
# previously coerced to 'standard'). Coerce to the new canonical names
# so every downstream reference sees maker|developer|prompt.
if ($InstallMode -eq 'lite') { $InstallMode = 'maker' }
if ($InstallMode -eq 'standard') { $InstallMode = 'developer' }

# When the caller didn't pin a mode (the default one-liner path via
# bootstrap.ps1), prompt the maker in the terminal for their preference.
# Doing it here in the CLI, before we hand off to VS Code, makes the
# choice deterministic: the answer is applied to essMaker.mode before
# any editor UI appears, so there's no race with the theme picker or
# GitHub Copilot sign-in that VS Code renders on first launch.
if ($InstallMode -eq 'prompt') {
$nonInteractive = $env:CI -or $env:TF_BUILD -or $env:GITHUB_ACTIONS -or [Console]::IsInputRedirected
if ($nonInteractive) {
Write-Host ""
Write-Host "Non-interactive environment detected. Defaulting to Maker mode." -ForegroundColor Yellow
$InstallMode = 'maker'
} else {
Write-Host ""
Write-Host "==> Choose your ESS Maker experience" -ForegroundColor Cyan
Write-Host " [1] Maker (recommended)"
Write-Host " Chat-first layout; hides file tree, tabs, and status bar;"
Write-Host " big-button Quick Actions rail. Best if you mostly work in"
Write-Host " chat and want a focused HR/IT admin surface."
Write-Host ""
Write-Host " [2] Developer"
Write-Host " Default VS Code layout with GitHub Copilot Chat in the"
Write-Host " side panel. Best if you plan to inspect or edit files"
Write-Host " directly."
Write-Host ""
$choice = $null
while ($null -eq $choice) {
$answer = Read-Host "Enter 1 for Maker, 2 for Developer (default: 1)"
# ``$answer ?? ''`` would need PS7's null-coalescing operator, but
# the supported Windows path invokes Windows PowerShell 5.1 - the
# 5.1 parser rejects ``??`` before running a line of the installer.
if ($null -eq $answer) { $answer = '' }
$answer = $answer.Trim()
switch -Regex ($answer) {
'^(1|maker|m|)$' { $choice = 'maker' }
'^(2|developer|dev|d)$' { $choice = 'developer' }
default { Write-Host "Please enter 1 or 2." -ForegroundColor Yellow }
}
}
$InstallMode = $choice
Write-Host " Selected: $InstallMode" -ForegroundColor Green
Write-Host ""
}
}

# Canonical mode label used throughout this script for both telemetry and
# the VS Code settings write. Kept in $modeLabel so all downstream
# references (5c extension install, launch, telemetry) share one source
# of truth.
$modeLabel = $InstallMode

$ErrorActionPreference = 'Stop'

function Write-Step { param([string]$m) Write-Host "`n==> $m" -ForegroundColor Cyan; try { Write-EssInstallStep -Step (Get-EssStepKey $m) } catch {} }
Expand Down Expand Up @@ -413,8 +487,8 @@ if (-not $essTelLoaded) {
function Complete-EssInstallTelemetry { param($Outcome, $ErrorRecord) }
}

$essInstaller = if ($FlightCheckOnly) { 'flightcheck' } elseif ($SkipMakerProfile) { 'adk' } else { 'lite' }
Initialize-EssInstallTelemetry -Installer $essInstaller
$essInstaller = if ($FlightCheckOnly) { 'flightcheck' } else { 'adk' }
Initialize-EssInstallTelemetry -Installer $essInstaller -InstallMode $modeLabel

try {

Expand Down Expand Up @@ -964,10 +1038,12 @@ if (-not $FlightCheckOnly) {
# Skipped in FlightCheckOnly mode (no VS Code launch) and when the user
# passes -SkipExtensions (IT-locked-down boxes that block VSIX installs).
if (-not $FlightCheckOnly -and -not $SkipExtensions) {
# Install the ESS Maker Profile extension in both modes. In lite mode it
# applies the chat-first layout; in standard mode it only handles /setup
# injection after the welcome wizard closes (no visual changes).
$modeLabel = if ($SkipMakerProfile) { 'standard' } else { 'lite' }
# Install the ESS Maker Profile extension in every mode. In maker mode
# it applies the chat-first layout; in developer mode it only handles
# /setup injection after the welcome wizard closes (no visual
# changes). $modeLabel is always 'maker' or 'developer' by this
# point - the CLI prompt above resolves 'prompt' before we reach any
# of the install steps.
Write-Step "Installing ESS Maker Profile ($modeLabel mode)"

$code = Resolve-CodeCommand
Expand Down Expand Up @@ -1022,12 +1098,13 @@ if (-not $FlightCheckOnly -and -not $SkipExtensions) {
}

# Write the mode setting so the extension knows whether to apply
# the lite layout or inject /setup (standard mode).
# the maker (chat-first) layout or inject /setup (developer mode).
# Uses string manipulation to preserve JSONC comments in settings.json.
$settingsDir = Join-Path $env:APPDATA 'Code\User'
if (-not (Test-Path $settingsDir)) { New-Item -ItemType Directory -Path $settingsDir -Force | Out-Null }
$settingsFile = Join-Path $settingsDir 'settings.json'
$modeEntry = "`"essMaker.mode`": `"$modeLabel`""
$settingsModeValue = $modeLabel
$modeEntry = "`"essMaker.mode`": `"$settingsModeValue`""
if (Test-Path $settingsFile) {
$raw = Get-Content $settingsFile -Raw
if ($raw -match '"essMaker\.mode"\s*:') {
Expand Down Expand Up @@ -1404,14 +1481,17 @@ if (-not $SkipLaunch) {
$codePath = if ($code.Source) { $code.Source } elseif ($code.FullName) { $code.FullName } else { $null }
if ($codePath) {
# Launch strategy depends on mode:
# - Lite mode: just open the workspace. The ESS Maker Profile extension
# - Maker mode: just open the workspace. The ESS Maker Profile extension
# handles layout + /setup injection after the welcome wizard closes.
# - Standard mode: use `code chat '/setup'` which opens Copilot Chat in
# - Developer mode: use `code chat '/setup'` which opens Copilot Chat in
# the sidebar panel on the right (the standard chat experience).
# By the time we get here $modeLabel is always 'maker' or 'developer'
# (the CLI prompt above resolves 'prompt' before we reach any launch
# code), so there is no third fall-through branch to handle.
Push-Location $workspace
try {
if ($SkipMakerProfile) {
# Standard mode - use code chat to open /setup in sidebar panel
if ($modeLabel -eq 'developer') {
# Developer mode - use code chat to open /setup in sidebar panel
Write-Step 'Opening workspace in VS Code and requesting /setup in Copilot Chat'
$chatOutput = Invoke-Native { & $codePath chat '/setup' }
$chatExit = $LASTEXITCODE
Expand All @@ -1428,7 +1508,7 @@ if (-not $SkipLaunch) {
Write-Host "If /setup does not start after trust/sign-in, open Copilot Chat manually and run /setup." -ForegroundColor Yellow
}
} else {
# Lite mode - extension handles /setup after welcome wizard
# Maker mode - extension handles /setup after welcome wizard
Write-Step 'Opening workspace in VS Code'
Start-Process -FilePath $codePath -ArgumentList @('.') | Out-Null
Write-Ok "Launched VS Code at $workspace"
Expand Down
48 changes: 35 additions & 13 deletions setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,44 @@ iex (irm https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/main/setup/bootstrap-mac.sh)"
```

Once complete, VS Code opens at `solutions/ess-maker-skills/` and `/setup` is automatically requested in Copilot Chat. You'll be prompted to trust the workspace and sign in to GitHub/Copilot — accept these prompts and `/setup` will connect the workspace to an existing editable DA Dev agent.
Once complete, the installer asks in the terminal which experience you want — **Maker** (chat-first, big-button layout — recommended) or **Developer** (default VS Code view with Copilot Chat in the side panel). Under a non-interactive shell (CI, piped input) the installer silently picks Maker. VS Code then opens at `solutions/ess-maker-skills/` and `/setup` is automatically requested in Copilot Chat. You'll be prompted to trust the workspace and sign in to GitHub/Copilot — accept these prompts and `/setup` will connect the workspace to an existing editable DA Dev agent.

> **GitHub Copilot subscription is required** for the in-editor maker experience. This script installs the toolchain and extension scaffolding; it does not grant the Copilot entitlement.

## Lite Mode (Chat-First Layout)
## Maker Mode (Chat-First Layout) and Developer Mode

For users who prefer a simplified, chat-first experience that hides developer chrome (file tree, tabs, status bar) and shows a "Quick Actions" button rail:
The one-shot installer (`bootstrap.ps1` / `bootstrap-mac.sh`) asks you to choose between **Maker** and **Developer** in the terminal before VS Code launches, so mode selection is a one-line choice from the main installer — no separate command needed. Maker was previously called "Lite" and Developer was previously called "Standard"; the old names still work for pinned scripts and previously-installed users.

For scripts and docs that need to pin the choice up front (bypassing the terminal prompt), mode-specific shortcuts are available:

**Windows** (PowerShell):

```powershell
# Maker mode (chat-first)
iex (irm https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/main/setup/bootstrap-lite.ps1)

# Developer mode (default VS Code layout)
iex (irm https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/main/setup/bootstrap-dev.ps1)
```

**macOS** (Terminal):

```bash
# Maker mode (chat-first)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/main/setup/bootstrap-lite-mac.sh)"

# Developer mode (default VS Code layout)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/main/setup/bootstrap-dev-mac.sh)"
```

This installs everything the standard installer does, plus the **ESS Maker Profile** extension which provides:
> `bootstrap-lite.ps1` / `bootstrap-lite-mac.sh` are kept at their original URLs for back-compat with existing docs and links, and now pin **Maker** mode (the renamed Lite mode).

Maker mode is the same install as Developer mode plus the **ESS Maker Profile** extension applying:
- A chat-only layout with all developer surfaces hidden
- Big-button "Quick Actions" rail for common tasks (Connect, Customize landing page, Create, Scan, FlightCheck, Push)
- A built-in tutorial explaining each button

You can switch between lite mode and standard VS Code at any time using the toggle buttons in the Quick Actions panel.
You can switch between Maker mode and Developer mode at any time using the toggle buttons in the Quick Actions panel.

## GitHub Codespaces (no local install)

Expand Down Expand Up @@ -120,11 +132,13 @@ cd ~/source/Employee-Self-Service-Agent-Developer-Kit/solutions/ess-maker-skills
|---|---|
| `Install-EssAdk.ps1` | Windows orchestrator. Installs toolchain via winget, pip dependencies, clones repo, installs extensions, launches VS Code. With `-FlightCheckOnly`, installs minimal toolchain and runs FlightCheck. |
| `install-ess-adk.sh` | macOS orchestrator. Same as above but uses Homebrew. Set `FLIGHTCHECK_ONLY=true` for FlightCheck-only mode. |
| `bootstrap.ps1` | Windows one-liner entry point (standard VS Code layout). |
| `bootstrap-lite.ps1` | Windows one-liner entry point (lite mode — chat-first layout). |
| `bootstrap.ps1` | Windows one-liner entry point (asks Maker vs Developer in the terminal before VS Code launches). |
| `bootstrap-lite.ps1` | Windows one-liner entry point (Maker mode - chat-first layout; previously named "Lite"). |
| `bootstrap-dev.ps1` | Windows one-liner entry point (Developer mode - default VS Code layout; previously named "Standard"). |
| `bootstrap-flightcheck.ps1` | Windows one-liner entry point (FlightCheck only). |
| `bootstrap-mac.sh` | macOS one-liner entry point (standard VS Code layout). |
| `bootstrap-lite-mac.sh` | macOS one-liner entry point (lite mode — chat-first layout). |
| `bootstrap-mac.sh` | macOS one-liner entry point (asks Maker vs Developer in the terminal before VS Code launches). |
| `bootstrap-lite-mac.sh` | macOS one-liner entry point (Maker mode - chat-first layout; previously named "Lite"). |
| `bootstrap-dev-mac.sh` | macOS one-liner entry point (Developer mode - default VS Code layout; previously named "Standard"). |
| `bootstrap-flightcheck-mac.sh` | macOS one-liner entry point (FlightCheck only). |
| `ess-adk-setup.winget.yaml` | Declarative DSC config consumed by `winget configure` (optional Windows path). |
| `telemetry/install-telemetry.ps1` | Installer telemetry emitter (PowerShell). Fail-open; emits install start/step/completion to Aria/1DS. |
Expand Down Expand Up @@ -219,7 +233,9 @@ powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -SkipEx
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -SkipClone # skip git clone (toolchain only)
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -SkipLaunch # don't open VS Code at the end
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -FlightCheckOnly # minimal install for FlightCheck only
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -SkipMakerProfile # standard VS Code (no lite mode)
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -InstallMode maker # pin Maker mode (chat-first)
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -InstallMode developer # pin Developer mode (default VS Code layout)
powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-EssAdk.ps1 -SkipMakerProfile # legacy alias: coerced to Developer mode
```

For air-gapped / locked-down environments, IT can mirror the files internally and serve them from an intranet URL by passing `-SourceBaseUrl`.
Expand All @@ -229,11 +245,17 @@ For air-gapped / locked-down environments, IT can mirror the files internally an
From this folder:

```bash
# Full installer:
# Full installer (asks Maker or Developer in the terminal before VS Code launches):
bash install-ess-adk.sh

# Full installer with lite mode (chat-first layout):
SKIP_MAKER_PROFILE=false bash install-ess-adk.sh
# Pin Maker mode (chat-first layout):
INSTALL_MODE=maker bash install-ess-adk.sh

# Pin Developer mode (default VS Code layout):
INSTALL_MODE=developer bash install-ess-adk.sh

# Legacy alias (still accepted; coerced to INSTALL_MODE=developer):
SKIP_MAKER_PROFILE=true bash install-ess-adk.sh

# FlightCheck only:
FLIGHTCHECK_ONLY=true bash install-ess-adk.sh
Expand Down
61 changes: 61 additions & 0 deletions setup/bootstrap-dev-mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
# ---------------------------------------------------------------------------
# ESS ADK - macOS Bootstrap (Developer Mode)
#
# One-liner entry point:
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/main/setup/bootstrap-dev-mac.sh)"
#
# Installs the full maker kit and lands the maker in the default VS Code
# layout (activity bar, file explorer, status bar visible) with /setup
# injected into Copilot Chat. Shortcut for makers who already know they want
# the Developer experience and want to skip the terminal mode prompt.
# ---------------------------------------------------------------------------
set -euo pipefail

# Developer mode: pin INSTALL_MODE so install-ess-adk.sh uses `code chat`
# to open /setup in the sidebar panel, skips the terminal mode prompt, and
# does not apply the chat-first layout.
export INSTALL_MODE="developer"

# Parse optional --branch / --source-base-url arguments
BRANCH="main"
SOURCE_BASE_URL=""
while [[ $# -gt 0 ]]; do
case "$1" in
--branch) BRANCH="$2"; shift 2 ;;
--source-base-url) SOURCE_BASE_URL="$2"; shift 2 ;;
*) shift ;;
esac
done
SOURCE_BASE_URL="${SOURCE_BASE_URL:-${ESS_ADK_SOURCE_URL:-https://raw.githubusercontent.com/microsoft/Employee-Self-Service-Agent-Developer-Kit/$BRANCH/setup}}"

TEMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TEMP_DIR"' EXIT

echo "Fetching ESS ADK installer to $TEMP_DIR"
INSTALLER_URL="$SOURCE_BASE_URL/install-ess-adk.sh"
echo " $INSTALLER_URL"

if ! curl -fsSL "$INSTALLER_URL" -o "$TEMP_DIR/install-ess-adk.sh"; then
echo " [ERR] Failed to download: $INSTALLER_URL" >&2
echo " If raw.githubusercontent.com is blocked by your firewall/proxy," >&2
echo " clone the repo manually and run: INSTALL_MODE=developer setup/install-ess-adk.sh" >&2
exit 1
fi

# Verify the downloaded file looks like a valid script
if [[ ! -s "$TEMP_DIR/install-ess-adk.sh" ]] || ! head -1 "$TEMP_DIR/install-ess-adk.sh" | grep -q '^#!/'; then
echo " [ERR] Downloaded file appears invalid (empty or not a shell script)" >&2
echo " A corporate proxy may be intercepting the request." >&2
exit 1
fi

# Best-effort: fetch the installer telemetry emitter (fail-open - a telemetry
# download failure must never block the install).
if curl -fsSL "$SOURCE_BASE_URL/telemetry/install-telemetry.sh" -o "$TEMP_DIR/install-telemetry.sh" 2>/dev/null; then
export ESS_INSTALL_TELEMETRY_LIB="$TEMP_DIR/install-telemetry.sh"
fi

# Run the downloaded installer in a subshell to avoid issues if it calls exit
export ESS_ADK_BRANCH="$BRANCH"
bash "$TEMP_DIR/install-ess-adk.sh"
Loading
Loading