Skip to content

feat: add departure_time to plan_route/distance_matrix + test coverage + payment fix#63

Merged
cablate merged 4 commits intomainfrom
feat/departure-time-and-fixes
Mar 21, 2026
Merged

feat: add departure_time to plan_route/distance_matrix + test coverage + payment fix#63
cablate merged 4 commits intomainfrom
feat/departure-time-and-fixes

Conversation

@cablate
Copy link
Owner

@cablate cablate commented Mar 21, 2026

Summary

Follow-up to #62 — these commits were pushed after the merge window.

  • departure_time parameter: maps_plan_route and maps_distance_matrix now accept optional departure_time (ISO 8601) for traffic-aware routing. Passes through to Routes API departureTime.
  • Test coverage: +9 new assertions (168 total) — verifies new place attributes (primary_type, types, editorial_summary, review language), search result fields (primary_type, price_level), and departure_time in inputSchema.
  • payment_options fix: Strip proto field name aliases (_acceptsCreditCards etc.) from Google gRPC client output.

Changed Files

File Change
src/tools/maps/planRoute.ts Add departure_time to SCHEMA
src/tools/maps/distanceMatrix.ts Add departure_time to SCHEMA + pass to service
src/services/PlacesSearcher.ts Accept departure_time in calculateDistanceMatrix + planRoute
src/services/RoutesService.ts Accept departureTime in computeRouteMatrix
src/services/NewPlacesService.ts Filter _ prefixed keys from paymentOptions
src/cli.ts Pass departure_time in exec mode for distance_matrix
tests/smoke.test.ts +9 assertions for new fields

Test plan

  • npm run format:check — passes
  • npm run build — passes
  • npm test — 168 passed, 0 failed
  • Manual exec test: payment_options no longer has _ prefixed keys

Closes #61 (Phase 2 + Phase 3 verified)

🤖 Generated with Claude Code

cablate and others added 4 commits March 21, 2026 12:49
Both tools now accept an optional departure_time parameter (ISO 8601)
for traffic-aware routing. Passes through to Routes API departureTime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Verify place_details returns types, primary_type, editorial_summary, language in reviews
- Verify search results include primary_type and price_level
- Verify plan_route and distance_matrix have departure_time in inputSchema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removes underscore-prefixed duplicate keys (e.g. _acceptsCreditCards)
that Google's gRPC client includes as proto field name aliases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cablate cablate merged commit 027a168 into main Mar 21, 2026
1 check passed
cablate added a commit that referenced this pull request Mar 21, 2026
… place

Google Places API (New) returns max 5 reviews sorted by relevance.
This change fetches an additional 5 newest reviews via Legacy Place
Details API (which supports reviews_sort=newest), then merges and
deduplicates by author+timestamp.

Result: place_details now returns ~10 reviews instead of 5, with both
high-quality relevant reviews and the most recent ones — enabling
better AI context classification and trend detection.

Also fixes Prettier formatting inconsistencies from PR #63 squash merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cablate added a commit that referenced this pull request Mar 21, 2026
… place (#64)

Google Places API (New) returns max 5 reviews sorted by relevance.
This change fetches an additional 5 newest reviews via Legacy Place
Details API (which supports reviews_sort=newest), then merges and
deduplicates by author+timestamp.

Result: place_details now returns ~10 reviews instead of 5, with both
high-quality relevant reviews and the most recent ones — enabling
better AI context classification and trend detection.

Also fixes Prettier formatting inconsistencies from PR #63 squash merge.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

特定情境或條件下的分析

1 participant