Context#
The tangled issue view command currently displays the author as a raw DID:
Issue #4 [OPEN]
Title: PR Phase 1: Create, List, and View Pull Requests
Author: did:plc:b2mcbcamkwyznc5fkplwlxbf
Created: today
A raw DID like did:plc:b2mcbcamkwyznc5fkplwlxbf is opaque — it carries no meaningful information for a human reader and wastes tokens in LLM workflows. The tangled auth status command already resolves the logged-in user's DID to a handle (@markbennett.ca), so the resolution capability exists in the codebase.
Tasks#
- Create
src/utils/at-handle.tswith aresolveHandle(did: string): Promise<string>function that returns the human-readable handle for a given DID, or falls back to the raw DID if resolution fails. - Audit all commands that display an author, actor, or identity field and update them to use
resolveHandle(). Known locations to update include:-
tangled issue view—Author:field - Any other commands added in future that display a DID to the user
-
- Use the AT Protocol identity resolution (e.g.
com.atproto.identity.resolveHandleor the reverse DID document lookup) to fetch the handle. - Fall back gracefully to displaying the raw DID if resolution fails or is unavailable.
- Cache resolved handles within a single command invocation to avoid redundant network calls when the same DID appears multiple times.
- Add tests for
resolveHandle()covering success, failure/fallback, and cache behaviour.
Notes#
The resolution should live in src/utils/at-handle.ts so it is reusable across all commands, following the project pattern of keeping utilities in src/utils/. This utility will become increasingly useful as more commands (PR view, repo view, etc.) are added that display actor information.