···5353 return { did, handle: account.handle };
5454}
55555656-export function createAgent(session: Session): Agent {
5757- if (session.oauthSession) {
5858- return new Agent(session.oauthSession);
5959- }
6060-6161- // Dev-mode: create agent via app password login
6262- const devPdsUrl = getDevPdsUrl();
6363- if (!devPdsUrl) {
6464- throw new Error("Cannot create agent: no OAuth session and no DEV_PDS_URL");
6565- }
6666-6767- const agent = new Agent(devPdsUrl);
6868- // The agent needs to be logged in before use. Callers should await loginDevAgent().
6969- return agent;
7070-}
7171-7256/**
7357 * Get a fully authenticated agent for the session.
7458 * In production: wraps the OAuth session.
+4-5
src/firehose/index.ts
···11import "../lib/ws-polyfill.ts";
2233-import { IdResolver } from "@atproto/identity";
43import { type Event, Firehose, MemoryRunner } from "@atproto/sync";
55-import { getDevPdsUrl, getDevPlcUrl, getRelayUrl } from "../atproto/env.ts";
44+import { getDevPdsUrl, getRelayUrl } from "../atproto/env.ts";
65import { COLLECTIONS } from "../lib/constants.ts";
66+import { getIdResolver } from "../lib/identity.ts";
77import { getCursor, setCursor } from "../server/db/queries/index.ts";
88import { handleCommitEvent } from "./handlers.ts";
991010const relayUrl = getRelayUrl();
1111-// In dev mode the PDS is ephemeral — each run starts fresh from seq 0.
1111+// In dev mode the PDS is ephemeral -- each run starts fresh from seq 0.
1212// Persisting the cursor across sessions causes "FutureCursor" errors.
1313const isDevMode = !!getDevPdsUrl();
1414const savedCursor = isDevMode ? null : getCursor();
···1818 console.log(`Resuming from cursor ${savedCursor}`);
1919}
20202121-const plcUrl = getDevPlcUrl();
2222-const idResolver = new IdResolver(plcUrl ? { plcUrl } : {});
2121+const idResolver = getIdResolver();
23222423const runner = new MemoryRunner({
2524 ...(savedCursor != null && { startCursor: savedCursor }),
+2-7
src/lib/access.ts
···8686 if (!ctx.wiki) {
8787 throw new NotFoundError("Wiki not found");
8888 }
8989- if (requiredAccess === "admin" && !canManage(ctx.access)) {
9090- throw new ForbiddenError();
9191- }
9292- if (requiredAccess === "edit" && !canEdit(ctx.access)) {
9393- throw new ForbiddenError();
9494- }
9595- if (requiredAccess === "read" && !canRead(ctx.access)) {
8989+ const check = { read: canRead, edit: canEdit, admin: canManage };
9090+ if (!check[requiredAccess](ctx.access)) {
9691 throw new ForbiddenError();
9792 }
9893 return ctx as WikiRequestContext;
···101101 noMembers: "No members yet.",
102102 noRequests: "No pending requests.",
103103 cannotRemoveOwner: "Cannot remove the wiki owner.",
104104+ cannotChangeOwnerRole: "Cannot change the wiki owner's role.",
104105 roleAdmin: "Admin",
105106 roleContributor: "Contributor",
106107 roleViewer: "Viewer",
+2
src/lib/i18n/fr.ts
···102102 noMembers: "Aucun membre pour le moment.",
103103 noRequests: "Aucune demande en attente.",
104104 cannotRemoveOwner: "Impossible de supprimer le propriétaire du wiki.",
105105+ cannotChangeOwnerRole:
106106+ "Impossible de changer le rôle du propriétaire du wiki.",
105107 roleAdmin: "Administrateur",
106108 roleContributor: "Contributeur",
107109 roleViewer: "Lecteur",