feat: location search, photo permission and spots commands - #84
Conversation
- photos list/search: --near lat,lng, --radius (default 1000 m), --sort newest|rating|relevance|distance; photos list also takes --permission. Distance/relevance sorts are refused without the input they rank by. JSON and the table now carry each photo's access level and location. - photos permission <level> <image-ids..> sets private, protected or public, a few photos at a time, reporting each result and exiting 1 if any failed. - New spots group: list (optionally --near, --featured), view <id> and sun <id> --date for sunrise, sunset and golden hour in the spot's time zone. Works signed out. - Pin @rawback/sdk 0.3.4, the release carrying these operations. bun.lock is regenerated once that version is published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzhEsyVbVE2xHqLoqPpERK
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dad80b745a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "@inquirer/prompts": "^8.7.0", | ||
| "@rawback/ccapi-js": "1.1.0", | ||
| "@rawback/sdk": "0.3.3", | ||
| "@rawback/sdk": "0.3.4", |
There was a problem hiding this comment.
Regenerate the lockfile for SDK 0.3.4
The manifest now requires @rawback/sdk 0.3.4, but bun.lock still records 0.3.3 in both the workspace dependency and resolved package entry. Since CI installs with --frozen-lockfile, dependency installation will fail instead of providing the newly imported Spots and photo-permission APIs; regenerate and commit the lockfile with this bump.
AGENTS.md reference: AGENTS.md:L135-L136
Useful? React with 👍 / 👎.
| if (!LOCAL_DATE.test(date) || Number.isNaN(new Date(`${date}T00:00:00Z`).getTime())) { | ||
| throw new Error('--date must be a calendar date, YYYY-MM-DD') | ||
| } |
There was a problem hiding this comment.
Reject normalized nonexistent calendar dates
Validate that parsing round-trips to the supplied date rather than only checking for NaN. JavaScript normalizes inputs such as 2026-02-31 to March 3, so this condition accepts a nonexistent local date and makes the API request even though the command promises calendar-date validation; malformed dates should fail before the network call.
AGENTS.md reference: AGENTS.md:L91-L92
Useful? React with 👍 / 👎.
Summary
Adds three recent server features to the CLI: location search, per-photo permission and public Spots.
photos list/photos search--near lat,lng,--radius <meters>(default 1000, max 500000) and--sort newest|rating|relevance|distance.photos listalso takes--permission private,protected,public.--sort distancewithout--nearand--sort relevancewithout--searchare refused, rather than letting the server silently fall back to newest-first.--jsonand the table now include each photo's access level. JSON also includes location.<image-ids..>'sets the access level for one or more photos.--jsonprints{ permission, results: [{ id, ok, permission, error }], succeeded, failed }.publicmeans.spotsgroup. It works signed out, since Spots are public.spots list [--near --radius] [--featured]spots view <id>spots sun <id> --date YYYY-MM-DDprints sunrise, sunset and golden hours in the spot's own time zone.docs/commands.md,README.md,AGENTS.md.package.jsonpins@rawback/sdk0.3.4, the release that rawback-app/sdk's PR for this feature will cut.bun.lockstill points at 0.3.3, so CI'sbun install --frozen-lockfilewill fail until 0.3.4 is on npm. At that pointbun installregenerates the lockfile, and that follow-up commit makes this PR green.Merge order: server PR → SDK PR (then its release PR) → this PR after the lockfile bump.
Test plan
bun run checkpasses on Bun 1.4.0 against a locally packed tarball of the SDK branch: typecheck, 561 tests, lint, format:check and the standalone build.package.json/bun.lockwere then restored and only the version pin changed.test/photos.test.ts:--near/--radius/--sort/--permission, and the default radius;photos permissionJSON output, a partial failure (keeps going, exits nonzero), the table and publication notice, and bad-input rejection before any request;permissionfield.test/spots.test.ts: list/view/sun variables and output, JSON envelopes, polar-day rendering, not-found handling, and ID/date validation.test/commands-cli.test.ts: help output for the new flags and commands, plus spawn-level validation that runs before authentication.🤖 Generated with Claude Code
https://claude.ai/code/session_01KzhEsyVbVE2xHqLoqPpERK
Generated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.