import type { TwinPack } from './src/packRegistry.js'; export type PackFacts = { /** Explicit vendor-server backing; this entry declares no pack protocol or factory. */ serverBacking?: { command: string }; maxRequestBodySize?: number; adoption?: { sdks?: string[]; pypi?: string[]; scopes?: string[]; envStems?: string[]; worldIds?: string[]; tools?: Array<{ package: string; usage: 'build' | 'deployment' }>; configFiles?: Array<{ file: string; usage: 'application' | 'build' | 'deployment'; when?: string }>; modules?: string[] }; hosts?: Array<{ host?: string; suffix?: string; hostPattern?: string; pathPattern?: string; demandPathPattern?: string | false; key?: string; exclude?: true; basic?: string }>; hostsNone?: string; hostsClaimed?: { door: string; note: string }; /** The subject types the twin projects (packRegistry `resources`) — invariant R2 at the resource * level checks a replay creates every one of them. */ resources?: string[]; /** The wire transport class (packRegistry PackTransport) — the invariant matrix keys * variants off it too (a raw-tcp twin has no workerd fetch path, so R12b is n/a). */ transport?: string; /** Optional native frontend of the same state owner, selected explicitly on the pack CLI. */ /** The descriptor's serve family. */ archetype?: string; /** R16: the protocol major the package targets and its standing against this kernel. */ protocol?: { declared?: string; major: number; standing: 'current' | 'refused' }; /** R20: pack-shipped asset paths (relative to the pack dir) the serve path reads through the seam. */ assets?: string[]; /** R2: declared types no replay can create, each with its reason (adopted debt, legible). */ resourcesUnreachable?: Record; endpointEnv?: TwinPack['endpointEnv']; endpointEnvNone?: string; /** The door that issues the application a credential the twin accepts (see TwinPack.credentialDoor). */ credentialDoor?: TwinPack['credentialDoor']; credentialIssuer?: string; /** DERIVED, never declared: the twins this pack cannot work without, read from its package's non-optional * `@volter/twin-*` peer dependencies (an optional peer is a twin it can use, not one it requires), so `init` brings * them with the pack as it brings its credential issuer (architecture, "requires"). */ requires?: string[]; /** The Prisma driver adapter this database twin is reached through (see TwinPack.prismaAdapter). */ prismaAdapter?: { adapter: string; export: string; urlEnv: string }; /** The managed-infrastructure kind this pack is the World's backing for (architecture.md, "The descriptor"). */ managedService?: { kind: 'redis' | 'mongodb' | 'clickhouse'; scheme: string; note: string; configurationArg?: '--configuration'; originalInputs?: { version: 1; manifestArg: '--original-inputs'; rootArg: '--original-root'; digestArg: '--original-inputs-sha256'; paths: string[] } }; /** The selected twin's private SQL identity and credential field (see TwinPack.managedDatabase). */ managedDatabase?: { kind: 'postgres'; arg: string; user: string; database: string; clock: 'wall'; credentialField: string; note: string }; /** Listeners the twin opens beside its main port (see TwinPack.sidePorts). */ sidePorts?: Array<{ name: string; option: string; flag: string; path?: string; scheme?: string; note: string }>; /** The vendor's own requests a World's generated seed makes (see TwinPack.seed). */ seed?: TwinPack['seed']; /** DERIVED, never declared: the pack's `createTwinServer` factory export — the * `({port,root,readOnly}) => {port,stop}` contract the colocated host mounts * (world-runtime/src/host.ts). Read off the module's own exports because the name is not * mechanically derivable from the vendor string (createUpstashRedisTwinServer, * createGoogleOAuthTwinServer); the export itself is the single source of truth. Consumed * by `volter world init` to emit `colocate:` service entries (runtime contract R2a). */ serveExport?: string; }; export type PackFactsDocument = { packs: Record; installed: string[]; [key: string]: unknown }; export function packFacts(env?: Readonly>): PackFactsDocument; export function extendPackFacts(files: string[] | undefined): PackFactsDocument; /** Merge installed facts into this process's routing facts. */ export function addPackFacts(packs: Record): PackFactsDocument; /** Materialize the selected remote World's facts in its attacher's private temporary directory. */ export function writeAttachmentPackFacts(packs: Record, directory: string): string;