import type { InstallOptions, InstallRecord } from './install.ts'; import type { Accepted, Inherited, Minimum, Review } from './review.ts'; import type { Signer } from './policy.ts'; import type { FoundSuite, SuiteMember } from './suite.ts'; /** A suite, as installed here. */ export interface InstalledSuite { /** The suite's name: what it is known by here, and the key in the record. */ name: string; /** Where it is asked again: the `at://` address of the suite, with the DID in it; the domain that publishes it; or the URL that serves it. */ source: string; /** What it was installed as, as typed: `@/`. Only identifies. */ label?: string | undefined; /** Where its apps go, when it was installed with `--dir`. */ dir?: string | undefined; /** * What it says now, as a hash (`suiteHash()`): an attestation of that * counts for its members. Updated whenever the suite is asked again. */ hash?: string | undefined; members: MemberState[]; /** When it was installed, or its members last changed, ISO 8601. */ at: string; } /** One member of an installed suite: as the suite says, and what became of it here. */ export interface MemberState extends SuiteMember { /** The install it is: the name of its record in `installed.json`, once installed. */ install?: string | undefined; /** Installed by the suite, rather than there already: uninstalling the suite removes it. */ brought?: boolean | undefined; /** Uninstalled by the person: left out from then on, until it is installed again. */ removed?: boolean | undefined; } /** What became of one member. */ export interface MemberResult { listing: string; /** * `installed` — the suite installed it. `present` — installed already, * now the suite's too. `left-out` — uninstalled by the person, and left * so. `removed` — no longer a member, and uninstalled. `kept` — no longer * a member, but stays: it was there before the suite, or another suite * has it. Otherwise it is not installed — refused by its review or the * suite's floor, declined, needing a decision nobody was there to make, * or failed — and the next update tries again. */ state: 'installed' | 'present' | 'left-out' | 'removed' | 'kept' | 'refused' | 'declined' | 'unconfirmed' | 'failed'; install?: string | undefined; reason?: string | undefined; review?: Review | undefined; } /** What installing, updating or uninstalling a suite did. */ export interface SuiteResult { suite: InstalledSuite; members: MemberResult[]; /** Why the suite could not be asked; its members were left as they were. */ problem?: string | undefined; } /** Everyone a suite expects its members to carry, offered to be accepted once. */ export interface Offer { signers: (Signer & { members: string[]; })[]; attesters: { did: string; kind?: string | undefined; members: string[]; }[]; } export interface SuiteOptions extends InstallOptions { /** The suite, fetched and verified already — as `install()` hands it on. */ suite?: FoundSuite | undefined; /** * Shown everyone the suite expects, once, before anything is installed: * return those to accept for every member that names them. Without it, * nothing is accepted up front, and each member is its own question. */ confirm?: ((offer: Offer, about: { name: string; source: string; }) => Promise) | undefined; } /** Where the record of installed suites lives. */ export declare function suitesPath(): string; /** Every suite installed, by name. */ export declare function suites(): Record; /** * The floors an install answers to: what each suite it belongs to requires of * it. Empty for an install no suite has. */ export declare function minimumsFor(name: string): Minimum[]; /** * The suites an install is in, as hashes whose attestations count as its * own: so that a suite attested `permitted` by an IT department permits each * member installed from it. */ export declare function inheritFor(name: string): Inherited[]; /** * Which installed suite `which` means — its name, its `at://` address, * `@/`, or what it was installed as — or undefined. */ export declare function findSuite(which: string): string | undefined; /** The suites an install belongs to, by name. */ export declare function suitesOf(name: string): string[]; /** The installs a suite has, by name. */ export declare function installsOf(suite: InstalledSuite): string[]; /** * Install a suite: `target` is `@/`, its `at://` * address, a domain whose `nsuite:` TXT record names where it is served, or * the `https:` URL that serves it; * and `options.suite` the suite when it has been found already. * What every member came to is returned; one that is refused or declined does * not stop the rest. */ export declare function installSuite(target: string, options?: SuiteOptions): Promise; /** * The suite `target` names — `@/`, an `at://` address, * an `https:` URL that serves it, or a domain whose `nsuite:` record names one. */ export declare function fetchTarget(target: string, options?: SuiteOptions): Promise; /** * Bring installed suites in step with what they say now — `which` as * `findSuite()` takes it, or all of them. A suite that cannot be asked, or * has been taken down, is left as it is, and says why. Updating the members * already installed is `update()`'s job, not this. */ export declare function updateSuites(which: string | undefined, options?: SuiteOptions): Promise; /** * Uninstall a suite — `which` as `findSuite()` takes it — and what it brought, * unless another suite has that too. What was there before it, or installed * by hand since, stays. */ export declare function uninstallSuite(which: string): Promise; /** * An install made by hand that a suite has too: it is the person's own now, * and stays when the suite goes. A member they had uninstalled, installed * again, is the suite's member again. */ export declare function adopt(record: InstallRecord, source: string): void; /** * Installs that are gone. Those the person uninstalled (`removed`) are left * out of their suites from then on; the others (`along`) — plugins that went * with their app — are installed again by an update, once their app is back. * The suites that had any of them, by name. */ export declare function forget(removed: string[], along?: string[]): string[]; /** * What has been said of a suite itself, by the hash of what it says: fetched * from everyone the policy names, whoever has said something of it before, * and whoever the backlink index knows of. A bad verdict from an attester the * policy (or `--block`) blocks on refuses the suite; any other is a warning. * Good verdicts are said, and count for its members as they are installed. */ export declare function judgeSuite(name: string, members: SuiteMember[], options?: SuiteOptions): Promise<{ did: string; kind?: string | undefined; verdict: 'good' | 'bad'; }[]>; /** Everyone `members` expect to carry: signers as identity and issuer both, and attesters. */ export declare function offerFor(members: SuiteMember[], label?: (member: SuiteMember) => string): Offer; //# sourceMappingURL=suite-install.d.ts.map