Files
openclaw/scripts/e2e/parallels/agent-workspace.ts
Peter Steinberger 8604da8e16 Reapply "refactor: move runtime state to SQLite"
This reverts commit 694ca50e97.
2026-05-27 13:27:43 +01:00

26 lines
818 B
TypeScript

export function posixAgentWorkspaceScript(purpose: string): string {
return `set -eu
workspace="\${OPENCLAW_WORKSPACE_DIR:-$HOME/.openclaw/workspace}"
mkdir -p "$workspace"
cat > "$workspace/IDENTITY.md" <<'IDENTITY_EOF'
# Identity
- Name: OpenClaw
- Purpose: ${purpose}
IDENTITY_EOF
rm -f "$workspace/BOOTSTRAP.md"`;
}
export function windowsAgentWorkspaceScript(purpose: string): string {
return `$workspace = $env:OPENCLAW_WORKSPACE_DIR
if (-not $workspace) { $workspace = Join-Path $env:USERPROFILE '.openclaw\\workspace' }
New-Item -ItemType Directory -Path $workspace -Force | Out-Null
@'
# Identity
- Name: OpenClaw
- Purpose: ${purpose}
'@ | Set-Content -Path (Join-Path $workspace 'IDENTITY.md') -Encoding UTF8
Remove-Item (Join-Path $workspace 'BOOTSTRAP.md') -Force -ErrorAction SilentlyContinue`;
}