Skip to content

feat: location search, photo permission and spots commands - #84

Merged
AnnatarHe merged 1 commit into
mainfrom
claude/trusting-gauss-j2z95n
Sep 25, 2026
Merged

AnnatarHe merged 1 commit into
mainfrom
claude/trusting-gauss-j2z95n

Conversation

@AnnatarHe

@AnnatarHe AnnatarHe commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds three recent server features to the CLI: location search, per-photo permission and public Spots.

  • photos list / photos search
    • New options: --near lat,lng, --radius <meters> (default 1000, max 500000) and --sort newest|rating|relevance|distance.
    • photos list also takes --permission private,protected,public.
    • Everything is validated before any request. In particular, --sort distance without --near and --sort relevance without --search are refused, rather than letting the server silently fall back to newest-first.
    • --json and the table now include each photo's access level. JSON also includes location.
  • `photos permission &lt;image-ids..&gt;' sets the access level for one or more photos.
    • Levels: private (only you), protected (any signed-in user), public (anyone, and listed in Spots when the photo has GPS).
    • IDs are sent four at a time. One photo failing doesn't stop the rest, but the command exits 1 if any failed.
    • --json prints { permission, results: [{ id, ok, permission, error }], succeeded, failed }.
    • The help text and table output warn what public means.
  • New spots group. It works signed out, since Spots are public.
    • spots list [--near --radius] [--featured]
    • spots view <id>
    • spots sun <id> --date YYYY-MM-DD prints sunrise, sunset and golden hours in the spot's own time zone.
  • Docs: docs/commands.md, README.md, AGENTS.md.

⚠️ Depends on an unreleased SDK — CI will fail until it is published

package.json pins @rawback/sdk 0.3.4, the release that rawback-app/sdk's PR for this feature will cut. bun.lock still points at 0.3.3, so CI's bun install --frozen-lockfile will fail until 0.3.4 is on npm. At that point bun install regenerates 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 check passes 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.lock were then restored and only the version pin changed.
  • test/photos.test.ts:
    • variables sent for --near/--radius/--sort/--permission, and the default radius;
    • every validation error;
    • photos permission JSON output, a partial failure (keeps going, exits nonzero), the table and publication notice, and bad-input rejection before any request;
    • fixtures updated for the new non-null permission field.
  • New 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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

- 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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T06:01:15.958201Z dad80b7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread package.json
"@inquirer/prompts": "^8.7.0",
"@rawback/ccapi-js": "1.1.0",
"@rawback/sdk": "0.3.3",
"@rawback/sdk": "0.3.4",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread src/spots.ts
Comment on lines +181 to +183
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')
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@AnnatarHe
AnnatarHe merged commit e03b55e into main Sep 25, 2026
5 of 11 checks passed
@AnnatarHe
AnnatarHe deleted the claude/trusting-gauss-j2z95n branch September 25, 2026 06:07
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