Skip to content

feat: add browser-only MapLibre Strands TypeScript example#94

Merged
giswqs merged 2 commits into
mainfrom
feat/browser-maplibre-strands-typescript
May 10, 2026
Merged

feat: add browser-only MapLibre Strands TypeScript example#94
giswqs merged 2 commits into
mainfrom
feat/browser-maplibre-strands-typescript

Conversation

@giswqs

@giswqs giswqs commented May 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Add examples/browser_maplibre_strands_typescript/, a Vite/TypeScript MapLibre client that runs the Strands TypeScript agent directly in the browser.
  • Supports OpenAI, OpenAI Codex, Anthropic, Google Gemini, and Amazon Bedrock providers selectable from the UI, with no Python backend required.
  • Update top-level and examples/ READMEs to point readers to the new example.

Test plan

  • cd examples/browser_maplibre_strands_typescript && npm install && npm run dev
  • Open the dev URL, pick a provider, supply credentials, and confirm the agent can drive the map (add layers, zoom, etc.).
  • Verify npm run build and npx tsc --noEmit succeed.

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.
Copilot AI review requested due to automatic review settings May 10, 2026 15:52
@github-actions

github-actions Bot commented May 10, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 10, 2026 15:53 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md and examples/README.md to 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.

Comment thread README.md Outdated
Comment thread examples/browser_maplibre_strands_typescript/src/main.ts Outdated
Comment thread examples/browser_maplibre_strands_typescript/src/main.ts
Comment thread examples/browser_maplibre_strands_typescript/README.md
Comment thread examples/browser_maplibre_strands_typescript/src/main.ts Outdated
- 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.
@github-actions github-actions Bot temporarily deployed to pull request May 10, 2026 16:01 Inactive
@giswqs giswqs merged commit 7af7621 into main May 10, 2026
9 checks passed
@giswqs giswqs deleted the feat/browser-maplibre-strands-typescript branch May 10, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants