spawn/cli/src
A ec210e37af
fix: Result monad for retry logic — prevent duplicate server creation (#1771)
* fix: Result monad for retry logic — prevent duplicate server creation

SSH exit 255 after an interactive session caused runWithRetries to retry
the entire bash script, creating duplicate servers. The old withRetry
also blindly retried all errors including timeouts where the remote
command may have already completed.

Introduces a Result<T> monad (Ok/Err) so callers explicitly signal
whether a failure is retryable (return Err) or fatal (throw). Adds
wrapSshCall() that classifies SSH errors: transient connection failures
are retryable, timeouts are not. Removes retry loop from the top-level
script runner entirely since it spans server creation + interactive
session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: mandate draft-PR-first workflow for all changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add biome lint to CI and pre-commit hook, fix lint violations

- Add Biome lint job to .github/workflows/lint.yml
- Add TypeScript lint check to .githooks/pre-commit
- Fix useBlockStatements violations in ui.ts and tests
- Add biome lint to CLAUDE.md "After Each Change" checklist

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: rename Result.value to Result.data

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: clean up stale pre-commit hook

- Remove dead check for deleted functions (write_oauth_response_file,
  create_oauth_response_html) — they no longer exist in the codebase
- Fix early exit skipping Biome lint when no .sh files are staged
- Replace echo -e with printf (the hook was using the pattern it bans)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve biome lint errors blocking CI

- Fix useImportType: import { type Result } → import type { Result }
- Fix noUnusedImports: remove unused KNOWN_FLAGS import
- Fix noUnusedTemplateLiteral: template literal → string literal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-22 20:39:42 -05:00
..
__tests__ fix: Result monad for retry logic — prevent duplicate server creation (#1771) 2026-02-22 20:39:42 -05:00
aws security: sanitize TERM env var in interactiveSession to prevent shell injection (#1763) 2026-02-22 18:11:09 -05:00
daytona security: sanitize TERM env var in interactiveSession to prevent shell injection (#1763) 2026-02-22 18:11:09 -05:00
digitalocean security: sanitize TERM env var in interactiveSession to prevent shell injection (#1763) 2026-02-22 18:11:09 -05:00
fly security: sanitize TERM env var in interactiveSession to prevent shell injection (#1763) 2026-02-22 18:11:09 -05:00
gcp security: sanitize TERM env var in interactiveSession to prevent shell injection (#1763) 2026-02-22 18:11:09 -05:00
hetzner security: sanitize TERM env var in interactiveSession to prevent shell injection (#1763) 2026-02-22 18:11:09 -05:00
local chore: harden biome lint rules and auto-fix codebase (#1759) 2026-02-22 14:37:47 -08:00
shared fix: Result monad for retry logic — prevent duplicate server creation (#1771) 2026-02-22 20:39:42 -05:00
sprite chore: harden biome lint rules and auto-fix codebase (#1759) 2026-02-22 14:37:47 -08:00
commands.ts fix: Result monad for retry logic — prevent duplicate server creation (#1771) 2026-02-22 20:39:42 -05:00
flags.ts fix: extract flags module to fix KNOWN_FLAGS drift in tests (#1757) 2026-02-22 18:10:07 -05:00
guidance-data.ts chore: harden biome lint rules and auto-fix codebase (#1759) 2026-02-22 14:37:47 -08:00
history.ts feat: add delete sub-menu (destroy/remove) and spawn kill alias (#1765) 2026-02-22 15:23:49 -08:00
index.ts fix: Result monad for retry logic — prevent duplicate server creation (#1771) 2026-02-22 20:39:42 -05:00
manifest.ts chore: harden biome lint rules and auto-fix codebase (#1759) 2026-02-22 14:37:47 -08:00
picker.ts fix: truncate picker lines to terminal width to prevent redraw corruption (#1772) 2026-02-22 17:22:46 -08:00
security.ts chore: harden biome lint rules and auto-fix codebase (#1759) 2026-02-22 14:37:47 -08:00
unicode-detect.ts fix: Switch build target from node to bun to fix UTF-8 mojibake 2026-02-10 09:36:28 +00:00
update-check.ts chore: harden biome lint rules and auto-fix codebase (#1759) 2026-02-22 14:37:47 -08:00