Commit graph

25 commits

Author SHA1 Message Date
Jeremy McSpadden
f0059a5498 fix(extensions): update provides.hooks in 7 extension manifests to match actual registrations (#3157)
Audit found that 7 bundled extensions had incomplete provides.hooks
arrays in their manifests. Updated each to match actual pi.on() calls:

- async-jobs: +session_before_switch, session_shutdown
- bg-shell: +8 hooks (session_compact, session_tree, etc.)
- browser-tools: +session_start
- context7: +session_shutdown
- google-search: +session_shutdown
- gsd: +12 hooks (bash_transform, tool_call, tool_result, etc.)
- search-the-web: +session_start

Closes #3156
2026-03-31 11:54:41 -06:00
TÂCHES
8e2d403179 feat(gsd): add .gsd/RUNTIME.md template for declared runtime context (#1626)
Template for projects to declare stack, build, test, and environment
details. Inlined into execute-task prompts when present.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 12:51:51 -06:00
Jeremy McSpadden
d7bf3d4e72 Improve startup performance with lazy extension loading (#1336) 2026-03-19 07:38:50 -06:00
TÂCHES
92f0b15268 feat: add extension manifest + registry for user-managed enable/disable (#1238)
Every extension gets a declarative extension-manifest.json (id, tier,
provides, dependencies). A persistent registry at ~/.gsd/extensions/registry.json
tracks enabled/disabled state. `gsd extensions` command family (list, enable,
disable, info) lets users manage extensions without touching source code.

Registry gate filters disabled extensions in loader.ts and resource-loader.ts
before paths reach loadExtensions(). Zero breakage: extensions without manifests
default to enabled, fresh installs have an empty registry.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 14:12:19 -06:00
Jeremy McSpadden
45af9f7f9d feat(browser-tools): configurable screenshot resolution, format, and quality (#1152)
Add environment variable overrides for screenshot capture settings so
users can opt into full-resolution output for human review while keeping
the Anthropic vision-optimized defaults:

- SCREENSHOT_MAX_WIDTH (default 1568, set 0 to uncap)
- SCREENSHOT_MAX_HEIGHT (default 8000, set 0 to uncap)
- SCREENSHOT_FORMAT (default jpeg for viewport / png for crops)
- SCREENSHOT_QUALITY (default 80, range 1-100)

Also fixes:
- Integration test viewport/scale mismatch: was 1280x720 scale 1,
  now 1280x800 scale 2 to match production browser context
- Unit test height-limit assertion: test expected <= 1568 but
  MAX_SCREENSHOT_HEIGHT is 8000 — corrected test image and assertions
2026-03-18 08:33:40 -06:00
TÂCHES
9201c0ce16 fix: document silent catch handlers in browser-tools (#1037)
Add descriptive comments to all empty catch blocks explaining why the
error is intentionally swallowed. Covers networkidle timeouts, optional
screenshots, best-effort file writes, response body reads, route
cleanup, and page metadata refreshes.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:33:00 -06:00
TÂCHES
5ecb6c6abb fix(browser-tools): document intentional silent catches, add debug logging for others (#1013)
Replaces 11 silent `.catch(() => {})` patterns with descriptive comments
(for intentional best-effort operations like networkidle waits, dialog
dismissal, browser close) or GSD_DEBUG-gated error logging (for page.goto
restore in device emulation and ensureMutationCounter in settle).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:01:44 -06:00
TÂCHES
b1ad5c431f fix: consolidate duplicate VerificationCheck/Result type definitions (#1008)
Rename browser-tools VerificationCheck/Result to BrowserVerificationCheck/Result
to eliminate name collisions with the semantically different types in gsd/types.ts.
The browser-tools types track UI element state verification (name/passed/value),
while gsd/types.ts types track command execution verification (command/exitCode/stdout).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:01:42 -06:00
TÂCHES
1a85853fd8 Merge pull request #725 from gsd-build/fix/screenshot-squish-constraint
fix: prevent full-page screenshots from being squished
2026-03-16 16:37:43 -06:00
Lex Christopherson
5ae08c4ec5 fix: use independent width/height caps for screenshot constraining
Full-page screenshots were being squished into a 1568x1568 square,
making tall pages unreadable. Now caps width at 1568px and height
at 8000px independently, preserving readability for long pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 16:23:53 -06:00
Tom Boucher
ca299db1c6 feat(browser-tools): add 10 new browser tools (#698)
Implement all features from the browser-tools feature additions proposal:

1. browser_extract — structured data extraction with JSON Schema validation
2. browser_save_state / browser_restore_state — session state persistence
3. browser_generate_test — Playwright test code generation from session
4. browser_mock_route / browser_block_urls / browser_clear_routes — network interception
5. browser_emulate_device — device emulation with 143 Playwright device presets
6. browser_visual_diff — visual regression diffing with baseline management
7. browser_save_pdf — PDF generation (Chromium page.pdf)
8. browser_zoom_region — region capture with upscaling via sharp
9. browser_action_cache — intent→selector caching for repeat visits
10. browser_check_injection — prompt injection detection on page content

Total browser tools: 47 → 60. No new dependencies — uses existing
sharp, ajv, @sinclair/typebox, and Playwright core APIs.
2026-03-16 17:45:11 -04:00
Jeremy McSpadden
6a46c9df1a fix: resolve browser-tools TypeScript type errors in CI
Fix type compatibility issues introduced in the JS→TS conversion:
- Restore PageEntry.page to `any` (holds Playwright Page instance)
- Use Record<string, any> for session parameters in
  buildFailureHypothesis and summarizeBrowserSession (callers pass
  rich objects with extra properties)
- Use Record<string, unknown> for formatTimelineEntries options
- Add explicit type annotations to local variables and callbacks
  to satisfy noImplicitAny in tsconfig.extensions.json
2026-03-16 13:39:14 -05:00
Jeremy McSpadden
9c8a24042f feat: convert browser-tools/core.js to TypeScript, add c8 test coverage
- Convert browser-tools/core.js (1058 lines) to native TypeScript with
  full type annotations from the existing .d.ts file. Remove the
  separate .d.ts declaration file (types are now inline).
- Add c8 test coverage reporting: `npm run test:coverage` generates
  text + lcov reports with 50% statement threshold baseline.
- Add coverage/ to .gitignore

All 712 unit tests, 63 browser-tools tests, and 11 integration tests
pass with zero regressions.
2026-03-16 13:25:52 -05:00
TÂCHES
a5eebd8d98 fix: resolve TypeScript type errors in browser-tools extension (#204) (#212)
- Create core.d.ts with type declarations for the untyped core.js module
- Create tsconfig.extensions.json for type-checking browser-tools in isolation
- Fix collectAssertionState adapter to match ToolDeps signature by wrapping with captureCompactPageState binding
- Fix captureAccessibilityMarkdown adapter to match ToolDeps signature by binding getActiveTarget()
- Add explicit Element | null type annotation to refs.ts parent variable (TS7022 circular inference)
- Fix session.ts timeline.count to timeline.retained (nonexistent property on formatTimelineEntries result)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:35:47 -06:00
Lex Christopherson
788c356a25 fix: auto-detect headless environment for Playwright browser launch (#183)
Browser launch was hardcoded to headless: false, crashing on Linux
servers without a display server ($DISPLAY). Auto-detect headless
environments and also support FORCE_HEADLESS=true override.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:16:26 -06:00
Lex Christopherson
5155d69d55 test(M002/S06): Test coverage
Tasks:
- chore(M002/S06): auto-commit after complete-slice
- chore(M002/S06): auto-commit after complete-slice
- chore(M002/S06/T02): auto-commit after execute-task
- chore(M002/S06/T02): auto-commit after execute-task
- chore(M002/S06/T01): auto-commit after execute-task
- chore(M002/S06/T01): auto-commit after execute-task
- chore(M002/S06): auto-commit after plan-slice
- chore: update state for S06 execution
- docs(S06): add slice plan

Branch: gsd/M002/S06
2026-03-13 08:04:27 -06:00
Lex Christopherson
8c549bd9c7 feat(M002/S05): Intent-ranked retrieval and semantic actions
Tasks:
- chore(M002/S05): auto-commit after complete-slice
- chore(M002/S05): auto-commit after complete-slice
- chore(M002/S05/T01): auto-commit after execute-task
- chore(M002/S05/T01): auto-commit after execute-task
- chore(M002/S05): auto-commit after plan-slice
- docs(S05): add slice plan

Branch: gsd/M002/S05
2026-03-13 08:04:27 -06:00
Lex Christopherson
57f6b0fd90 feat(M002/S04): Form intelligence
Tasks:
- chore(M002/S04): auto-commit after complete-slice
- chore(M002/S04): auto-commit after complete-slice
- chore(M002/S04/T02): auto-commit after execute-task
- chore(M002/S04/T02): auto-commit after execute-task
- chore(M002/S04/T01): auto-commit after execute-task
- chore(M002/S04): auto-commit after plan-slice
- docs(S04): add slice plan

Branch: gsd/M002/S04
2026-03-13 08:04:27 -06:00
Lex Christopherson
68cf10eed5 feat(M002/S03): Screenshot pipeline
Tasks:
- chore(M002/S03): auto-commit after complete-slice
- chore(M002/S03): auto-commit after complete-slice
- chore(M002/S03/T01): auto-commit after execute-task
- chore(M002/S03/T01): auto-commit after execute-task
- chore(M002/S03): auto-commit after plan-slice
- docs(S03): add slice plan

Branch: gsd/M002/S03
2026-03-13 08:04:27 -06:00
Lex Christopherson
3590b32252 feat(M002/S02): Action pipeline performance
Tasks:
- chore(M002/S02): auto-commit after complete-slice
- chore(M002/S02): auto-commit after complete-slice
- chore(M002/S02/T02): auto-commit after execute-task
- chore(M002/S02/T02): auto-commit after execute-task
- chore(M002/S02/T01): auto-commit after execute-task
- fix: expand tool outputs by default and pull main before slice merge
- chore(M002/S02): auto-commit after plan-slice
- docs(S02): add slice plan

Branch: gsd/M002/S02
2026-03-13 08:04:27 -06:00
Lex Christopherson
ee6dce643b chore(M002/S01): auto-commit after reassess-roadmap 2026-03-13 08:04:27 -06:00
Lex Christopherson
c80d640d35 feat: vendor Pi source into workspace monorepo
Vendor all 4 Pi packages (tui, ai, agent-core, coding-agent) from
pi-mono v0.57.1 as @gsd/* workspace packages under packages/. This
replaces the compiled npm dependency (@mariozechner/pi-coding-agent)
and patch-package workflow, giving direct source access for
modifications.

- Copy Pi source from pi-mono v0.57.1 into packages/
- Create workspace package.json + tsconfig.json for each package
- Rename ~240 imports from @mariozechner/pi-* to @gsd/pi-*
- Apply existing patches as source edits (setModel persist, VT input)
- Remove @mariozechner/pi-coding-agent dep and patch-package
- Update build pipeline to build packages in dependency order
- Add pi-upstream git remote for future selective syncing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:55:17 -06:00
Lex Christopherson
d1d0b1acab fix: constrain browser screenshots to 1568px max dimension (#56)
The Anthropic API rejects images exceeding 2000px in multi-image requests.
With deviceScaleFactor=2, viewport screenshots were 2560x1600px, triggering
400 errors that halted execution. Add scale:"css" to all API-facing screenshot
calls and a constrainScreenshot() fallback that downscales oversized images
(e.g. fullPage on tall pages) via the browser's canvas — zero new dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:46:05 -06:00
Lex Christopherson
a32d6fb7b5 fix: handle Windows backspace in masked input + support custom browser path (#36, #34)
- wizard.ts: also check for \b (0x08) which Windows terminals send for backspace
- browser-tools: read BROWSER_PATH env var and pass as executablePath to Playwright

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 07:47:37 -06:00
Lex Christopherson
3bd2f8cb63 Initial commit 2026-03-10 22:28:37 -06:00