/** * Resolve a repo's committed subscriptions against the account's bundles. * * **This is what makes the committed id load-bearing rather than decorative.** * Slice 0 writes `{id, slug}` into `/.auden/config.json`; without this * step the sync still addressed bundles by *slug*, and a slug is unique per * user — the server's index is `(user_id, slug)`. So a teammate cloning the repo * resolved `standards` against their own account and silently synced a different * bundle that happened to share the name, which is the exact failure the * `{id, slug}` format exists to remove (`unified-item-sync-plan.md` → "A * subscription names a bundle id, not a slug"). Raised by Codex on PR #547. * * The API stays slug-addressed; the plan sanctions resolving id → slug once per * sync rather than forcing an id-addressed endpoint. What changes is *which* * slug: the one the id currently maps to, not the one written in the file. * * Kept free of citty/console so it unit-tests directly — the caller renders. */ import type { BundleSubscription } from './repo-config.js'; /** The subset of a listed bundle this resolution needs. */ export type ListedBundle = { id: string; slug: string; }; /** A subscription that names a bundle the caller cannot see. */ export type UnresolvedSubscription = { /** The committed id that matched nothing in the account's listing. */ id: string; /** The label committed beside it, for a message a human can act on. */ slug: string; }; export type ResolvedSubscriptions = { /** * Bundle slugs to sync, in committed order — each one current as of this * listing, so a bundle renamed in the dashboard keeps syncing rather than * 404ing on the stale label in the file. */ slugs: string[]; /** * Committed subscriptions whose id is not in the caller's listing. Reported, * never dropped silently: the plan's requirement is "a non-member gets a named * failure, not deletion advice", because the line was put in the config * deliberately by whoever owns the repo. */ unresolved: UnresolvedSubscription[]; }; /** * Map committed subscriptions onto the slugs to sync. * * Three cases, and the middle one is the point of the whole format change: * * - **No id** — a legacy slug-only entry, from a checkout made before the * migration. Used as written. This is a compatibility path, not the intended * one; it resolves against whoever is running the sync, with all the ambiguity * that implies. * - **Id present and known** — resolved to that bundle's *current* slug. * - **Id present and unknown** — reported as unresolved. Not skipped quietly and * not fallen back to the committed slug: falling back is precisely the bug, * because it would sync a same-named bundle from the wrong account and look * like it worked. */ export declare function resolveSubscribedSlugs(subscriptions: readonly BundleSubscription[], bundles: readonly ListedBundle[]): ResolvedSubscriptions; /** * The message a user sees for a subscription they cannot resolve. * * Deliberately not "remove this line from your config": the line was committed * on purpose by whoever owns the repo, and telling a teammate to delete it turns * a permissions problem into a lost subscription for everyone else too. */ export declare function unresolvedSubscriptionMessage(entry: UnresolvedSubscription): string; //# sourceMappingURL=resolve-subscriptions.d.ts.map