turf.js tools - #20
Draft
MKartaviciute wants to merge 4 commits into
Draft
Conversation
…r-app into maka/turf.js-tools
MKartaviciute
force-pushed
the
maka/turf.js-tools
branch
from
August 25, 2026 13:12
b5f3771 to
f74d966
Compare
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
Adds a new
@cesium-ai/turf-toolsworkspace package: server-only Turf.js spatial-analysis tools for the AI SDK agent loop, plus ageoJsonAdd/geoJsonRemoveviewer tool pair (in@cesium-ai/tools-schemas/@cesium-ai/tools) so results can be rendered on the globe.What's included
packages/turf-tools/(new package) — session-scoped Turf.js tools with noViewerdependency, run entirely in-process on the backend:turf_register_dataset/turf_get_dataset— store/resolve a GeoJSON Feature or FeatureCollection bydataset_id, so large payloads aren't repeated through tool-call arguments/LLM context.turf_buffer,turf_points_within_polygon,turf_intersect,turf_area,turf_hex_grid— wrap the corresponding Turf functions, chainable viadataset_id.createTurfDatasetStore()— asessionId -> datasetId -> GeoJSONstore with idle-TTL eviction (default 30 min), fixing the reference implementation's unscoped global singleton store. Not yet suitable for multi-instance deployments (see package README for caveats/production notes).geoJsonAdd/geoJsonRemoveviewer tools (tools-schemas,tools) — render/remove GeoJSON on the live CesiumViewer, used to visualizeturf_get_datasetoutput.packages/server/src/agent.tsandchat-router.tsregister the turf tools per-request (one dataset store per session), plus a new env var (see.env.example/backend/src/utils/env.ts).MessageItem.tsx/chat-client.tsupdates to support rendering these new tool calls.docs/packages/turf-tools/index.md,mkdocs.ymlnav entry, updates todocs/packages/index.mdanddocs/packages/tools-schemas/tools.md.dataset-store.test.ts,index.test.ts,geojson.test.ts), a newe2e/turf-tools-live.spec.tslive e2e suite, plus additions toe2e/cesium-viewer-tools-live.spec.tsandbackend/src/app.integration.test.ts.Testing
npx vitest run— unit/integration suite passes.npx playwright test e2e/turf-tools-live.spec.ts— live e2e suite passes.