feat: add browser-only MapLibre Strands TypeScript example#94
Merged
Conversation
Provides a Vite/TypeScript MapLibre client that runs the Strands TypeScript agent directly in the browser, with selectable OpenAI, Anthropic, Gemini, and Bedrock providers and no Python backend.
|
🚀 Deployed on https://6a00abf2b3ae589d6d351f78--opengeos.netlify.app |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new browser-only MapLibre Vite/TypeScript example that runs a Strands TypeScript agent directly in the page (no Python WebSocket backend), and updates repository docs to reference it.
Changes:
- Added
examples/browser_maplibre_strands_typescript/with a MapLibre UI, provider selection, and in-page map tools wired into a Strands agent. - Updated top-level
README.mdandexamples/README.mdto link to the new example. - Implemented UI styling and TypeScript config for the new example.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds a pointer to the new browser-only Strands MapLibre TypeScript example. |
| examples/README.md | Lists the new browser-only Strands MapLibre TypeScript example among repo examples. |
| examples/browser_maplibre_strands_typescript/tsconfig.json | TypeScript compiler settings for the Vite example. |
| examples/browser_maplibre_strands_typescript/src/styles.css | UI styles for the panel/log/map controls. |
| examples/browser_maplibre_strands_typescript/src/main.ts | Implements the MapLibre app, Strands agent wiring, provider selection, and browser map tools (including optional JS execution). |
| examples/browser_maplibre_strands_typescript/README.md | Documents how to run the example and available providers/tools. |
| examples/browser_maplibre_strands_typescript/package.json | Declares dependencies (Strands SDK + provider SDKs) and Vite/TS scripts. |
| examples/browser_maplibre_strands_typescript/index.html | Vite entry HTML for mounting the app and loading main.ts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- README: drop OpenAI Codex / Bedrock from the provider list since the example UI only ships OpenAI Responses, OpenAI Chat, Anthropic, and Google Gemini. - main.ts: default the MapLibre JS toggle to off so run_maplibre_script is opt-in instead of being enabled on first load. - main.ts: wrap run_maplibre_script helpers so removeOverlay enforces the layer-removal gate, and replace the raw overlays Map with a read-only overlayNames() accessor. - main.ts: soften the system prompt wording so it no longer implies run_maplibre_script is a hard safety boundary. - example README: document that API keys are persisted in sessionStorage and that the MapLibre JS escape hatch can read it; note the toggle is off by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/browser_maplibre_strands_typescript/, a Vite/TypeScript MapLibre client that runs the Strands TypeScript agent directly in the browser.examples/READMEs to point readers to the new example.Test plan
cd examples/browser_maplibre_strands_typescript && npm install && npm run devnpm run buildandnpx tsc --noEmitsucceed.