feat: sync CLI with dashboard@v0.2.9 - #25
Closed
cursor[bot] wants to merge 2 commits into
Closed
Conversation
Vendored types refreshed via:
PHOTON_TYPES_SRC=../dashboard/packages/api-public/dist/index.d.ts \
bun run sync:api
Upstream: dashboard@v0.2.9 (4d796baf5b0f4c9cbb2a5ac51a8f424d6e063eb2)
14 routes added, 1 removed, 0 changed. See UPSTREAM_DIFF.md for the
full route-level summary.
Co-authored-by: citron <lcandy2@users.noreply.github.com>
Upstream dashboard@v0.2.9 removed the single GET
/api/projects/:id/spectrum/avatar-upload-url endpoint and replaced it
with a two-step presign + commit flow:
1. POST /api/projects/:id/spectrum/avatar/upload { contentType }
→ { uploadUrl, key }
2. PUT <uploadUrl> (raw bytes)
3. POST /api/projects/:id/spectrum/avatar/commit { key }
→ { success: true, avatarUrl }
The canonical avatarUrl is no longer known until /commit returns, so
the optional --update-profile PATCH and the recovery hint were rewired
to consume the commit response instead of the presign response. The
Eden treaty call moved from `.spectrum["avatar-upload-url"].get()`
to `.spectrum.avatar.upload.post(...)` to match the new types.
Co-authored-by: citron <lcandy2@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Agent PR Review
Verdict: ✅ Approve
What the agent got right
- Removed route migrated correctly:
GET .spectrum.avatar-upload-urlis fully replaced by the new two-step.spectrum.avatar.upload.post→ S3PUT→.spectrum.avatar.commit.postflow insrc/commands/spectrum/avatar.ts. No stale references remain (rg avatar-upload-url srcis clean). - Eden treaty pattern preserved: Both new calls use
getApi()→api.api.projects({ id }).spectrum.avatar.*.post(...), destructure{ data, error, status }, and throwSessionExpiredErroron 401. The onlyfetch()is the presigned-S3PUT, which is external storage (carried over from the prior implementation) — not a Photon API call. types/api.d.tsis regen-shaped: Diff is purely additive Elysia&-intersection blocks consistent withbun run sync:apioutput; no hand-edits visible.- No forbidden deps / no workflow edits / no snapshot changes:
package.json,bun.lock,.github/**, andtests/**are untouched. PR body's "Snapshot changes: (none)" matches the diff. - Scope discipline: Only the spectrum avatar migration is included; the 13 other added routes (members, voice settings/sip-inbound/imessage-enabled, whatsapp templates,
DELETE avatar) are explicitly deferred in the PR body, matching the "one PR = one upstream version bump" rule. bun run checkis green: 22/22 tests pass, typecheck and build succeed locally.
Concerns
None blocking. Minor style observations (not requesting changes):
src/commands/spectrum/avatar.ts:60-64,92-96— presign and commit responses are cast inline (as { uploadUrl?: string; key?: string; ... }) rather than added tosrc/lib/types.ts. This matches the pre-existing pattern in the same file, so it's consistent, but a future cleanup pass could lift these into shared DTOs per the AGENTS.md soft rule.- No test was added for the new two-step upload flow. There was no pre-existing avatar test either, so this isn't a regression — just worth noting if test coverage is desired before the next sync.
Deferred work (acknowledged in PR body)
GET/POST .projects.:id.members,DELETE .projects.:id.members.:memberUserIdDELETE .projects.:id.spectrum.avatarPATCH .projects.:id.voice.imessage-enabled,GET .projects.:id.voice.settings,PATCH/DELETE .projects.:id.voice.sip-inboundGET/POST .projects.:id.whatsapp.templates,PATCH/DELETE .projects.:id.whatsapp.templates.:templateId
Final note
Clean, minimal, on-rule sync: the one breaking route is correctly migrated, types regenerated, and unrelated new routes properly deferred.
Sent by Cursor Automation: CLI Agent PR Review
Contributor
Author
There was a problem hiding this comment.
Agent PR Review
Verdict: ✅ Approve
What the agent got right
- One upstream bump, scoped change. Diff is exactly the 3 expected files:
UPSTREAM_DIFF.md,types/api.d.ts(regenerated), and the one migration insrc/commands/spectrum/avatar.ts. No drive-by refactors. - Hard rules clean. No
package.jsonchanges (so no forbidden deps), no.github/workflows/orscripts/agent-flow/edits, no snapshot deletions, nochalk/dotenv/zod/etc. introduced. types/api.d.tslooks generated, not hand-edited — the newspectrum.avatar.upload/commit/deleteblocks share the same[x: string]: anyElysia response shape as their siblings, consistent withbun run sync:apioutput.- Removed route fully migrated.
GET /spectrum/avatar-upload-urlis gone from the diff and no longer referenced anywhere insrc/;POST /spectrum/avatar/upload+POST /spectrum/avatar/commitare wired up in the right order. - Eden treaty pattern followed correctly on both new calls: destructures
{ data, error, status }, throwsSessionExpiredErroron 401, surfaces other errors viaformatApiError/die. The one rawfetch()(line 73) is thePUTto the presigned storage URL — that was already present before this PR and is the only sane way to talk to S3-style storage, not an API call. - Style matches
projects.ts. Option ordering (--api-host,-t/--token),c.dim()/c.success()/die()usage, and the inlineas { … }cast at the API boundary all mirror the existing pattern in the same file. - PR body is honest about deferred work (members, voice settings/sip-inbound/imessage-enabled, whatsapp templates,
DELETE avatar) and explicitly defers them per the "don't bundle refactors" rule.
Concerns
- None blocking. Minor observation only: if
/commitfails after thePUTsucceeds, the object is uploaded but orphaned and the user gets no recovery hint (unlike the profile-patch failure path, which does build a recovery command). This is inherent to upstream's new two-step flow and outside the scope of a sync PR, but worth filing as a follow-up.
Deferred work (acknowledged in PR body)
GET/POST api.projects.:id.members,DELETE …members.:memberUserIdDELETE api.projects.:id.spectrum.avatarPATCH api.projects.:id.voice.imessage-enabled,GET …voice.settings,PATCH/DELETE …voice.sip-inboundGET/POST api.projects.:id.whatsapp.templates,PATCH/DELETE …whatsapp.templates.:templateId
Final note
Tight, on-scope sync that correctly migrates the one breaking route and defers the rest — safe to merge once CI is green.
Sent by Cursor Automation: CLI Agent PR Review & Fix
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.


Upstream version
dashboard@v0.2.9(4d796baf5b0f4c9cbb2a5ac51a8f424d6e063eb2) — see release.Routes added/removed/changed
Removed (1) — breaking, required code change:
GET api.projects.:id.spectrum.avatar-upload-urlAdded (14):
GET / POST api.projects.:id.membersDELETE api.projects.:id.members.:memberUserIdPOST api.projects.:id.spectrum.avatar.upload(replaces removed route)POST api.projects.:id.spectrum.avatar.commit(replaces removed route)DELETE api.projects.:id.spectrum.avatarPATCH api.projects.:id.voice.imessage-enabledGET api.projects.:id.voice.settingsPATCH / DELETE api.projects.:id.voice.sip-inboundGET / POST api.projects.:id.whatsapp.templatesPATCH / DELETE api.projects.:id.whatsapp.templates.:templateIdChanged: none.
Full machine-generated breakdown lives in
UPSTREAM_DIFF.mdat the repo root.Code changes
src/commands/spectrum/avatar.ts— migratedphoton spectrum avatar upload <file>to the new two-step flow:POST .spectrum.avatar.upload { contentType }→{ uploadUrl, key }PUT <uploadUrl>(raw bytes)POST .spectrum.avatar.commit { key }→{ success, avatarUrl }The optional
--update-profilePATCH and the manual-recovery hint now consume the avatarUrl returned by/commit(it isn't known until after the commit step in the new flow). All four steps continue to route 401s throughSessionExpiredErrorand surface API errors viaformatApiErrorperAGENTS.md.No other command files reference removed/renamed routes, so no further migrations were needed in this PR. The new member/voice/whatsapp routes are not yet wired up — left for a follow-up per the "don't bundle refactors" rule.
Snapshot changes
New runtime dependencies
Checklist
types/api.d.ts(regenerated viabun run sync:api)bun run checkpasses locally (typecheck + 22 tests + build)Need help on this PR? Tag
@codesmithwith what you need.