Tangled
Tangled
Spoken by TangledProvider. Same resources, same shapes, its own quirks kept inside.
Access
CreatecreateProvider("tangled")
Importimport { TangledProvider } from"@agntn/forges/tangled"
EnvTANGLED_HANDLE, TANGLED_PASSWORD
CLInone, set the handle and an app password
- Header
- Authorization: Bearer
- Anonymous
- public repositories, no token in sight
- Threads
- none, review comments ride on the pull request
- Code search
- unsupported, explicit error
- Templates
- none
Read a Tangled repository
import { createProvider, resolveToken } from "@agntn/forges";
const tangled = await createProvider("tangled", resolveToken("tangled") ? {} : { token: "" });
const repo = { owner: "tangled.org", repo: "core" };
const core = await tangled.repos.get(repo);
const issues = await tangled.issues.list(repo, { state: "all" });
const editorconfig = await tangled.repos.readContents(repo, { path: ".editorconfig" });
Tangled runs on atproto, the AT Protocol behind Bluesky. Its accounts have handles and underlying DIDs. Which one goes in owner? Either. forges resolves handles to DIDs.
The default baseURL is the appview root, https://tangled.org. The MCP server and Pi/OMP extensions read FORGES_TANGLED_BASE_URL.
Where does the password come from?
Tangled uses an atproto app password, not a token. The password needs its account handle or DID.
@agntn/credentials/tangled checks these sources in order:
- Explicit
{ username, token }. The username is the handle or DID. The token is the app password. TANGLED_HANDLEandTANGLED_PASSWORD.
Half a pair finds nothing. There's no CLI login to read. TANGLED_PDS_URL can specify the PDS. Otherwise, forges finds it from the handle.
forges signs in at the account's PDS using com.atproto.server.createSession. It then sends the session as a Bearer token.
A password without username? forges answers 400 before any request. Nobody can sign in as nobody. Pass { token: "" } for anonymous public reads. Writes and users.authenticated need the app password.
What it reads
Every public resource below works without a login.
| Resource | Where it goes |
|---|---|
| Repositories, issues, pull requests, comments and events | Tangled's index at api.tangled.org |
| Handles and users | The handle resolver, the PLC directory and the account's PDS |
| Files, directories, tags, commits and comparisons | The git mirror, also on api.tangled.org |
| Pull request files | The mirror, from the latest round's patch |
Tangled calls its git servers knots. tangled.org/core lives on knot1.tangled.sh, and forges never tugs on it directly. Every git read goes through the mirror, so no knot gets untied.
What comes back
- A repository's
idis its own DID.fullNameandowner.loginkeep the handle. For example,fullNamecan betangled.org/core. - Issues and pull requests are both tickets. They share one number sequence. Reading either as the other returns 404.
- Review comments are plain pull request comments. Tangled doesn't have review threads.
- A merged pull request has
mergedAtand the head SHA.mergeCommitShastays empty because the model doesn't carry it. - Directory reads return one level. The mirror doesn't list deeper entries.
entriesCompleteistrue. - Comparisons return head side commits, oldest first.
behindByandstatusarenull.mergeBaseShais set. Files arrive on the first page.filesCompleteisnull. - An unknown owner handle fails resolution with 400. A missing repository returns 404.
- Repository, issue, pull request, file, directory, commit and comparison reads were checked live on
tangled.org/coreandtangled.org/site.
Gotchas
Why does a file read cost four requests?
repos.readContents resolves the ref to a commit first. It then checks the parent directory for type and size. The sequence is resolve, tree, entry and blob.
A file over the read limit returns 413 before fetching bytes. A submodule returns 422 with an explanation. A missing path returns 404 with No file or directory at <path>.
Why can't I compare every range?
The mirror can refuse a range as too large. forges returns 413 and suggests closer refs. This happened live for v1.20.0...v1.20.1 on tangled.org/core.
commits.list supports ref and path filters. It rejects since and until with 501 before any request. The mirror would silently drop those filters. Returning the whole history instead would be misleading.
The explorer at forges.agntn.dev doesn't run Tangled.
What isn't there
These operations return 501.
Tangled has no:
- Releases, CI runs or checks.
- Review verdicts or review threads.
- Contribution templates, code search or sub issues.
Tangled has it, forges doesn't use it yet:
- Reactions, issue and pull request search, and
commits.readPatch. The adapter has them, forges doesn't wire them up yet.
Recursive repos.listTree also returns 501. The mirror only lists one directory level. The since and until commit filters return 501 too.
Where it lives
TangledProvider lives in src/providers/tangled.ts. Import it from @agntn/forges/tangled.
It builds on the upstream forges/tangled adapter and @agntn/credentials/tangled.