← Public packages
@kentcdodds/ship-pr
Progressive ship-pr loop for agents: PR status, Bugbot, review sort, 7-day decisions, merge, deploy, wrap-up.
src/brain.ts
15 lines · 670 B · TypeScriptimport { fetchSnapshot } from './github.ts'
import type { PrLocator } from './input.ts'
import { computeShip, type ComputeOptions } from './status.ts'
import { listDecisions, listEvents } from './storage.ts'
/** Fetch PR state + active decisions/events and compute the progressive report. */
export async function loadShip(locator: PrLocator, options: Omit<ComputeOptions, 'now'>) {
const [snapshot, decisions, events] = await Promise.all([
fetchSnapshot(locator),
listDecisions(locator.key),
listEvents(locator.key),
])
const report = computeShip(snapshot, decisions, events, { ...options, now: Date.now() })
return { snapshot, decisions, events, report }
}