Files
backnotprop__plannotator/apps/pi-extension/server.ts
Devinda Senanayaka 929e8f9f59 perf(pi-extension): use exact .ts relative specifiers (#1106)
The Pi extension is distributed and executed as raw TypeScript through
Pi's jiti loader. Phantom .js paths force jiti through its last-resort
fallback, while extensionless paths still require probing. Exact .ts
paths avoid both and match the files that actually ship.

- rewrite relative .js and extensionless specifiers in hand-written
  sources (the existing noEmit bundler tsconfig permits .ts imports)
- make vendor.sh emit .ts in explicit rewrite rules and normalize both
  source styles across verbatim-copied generated modules
- guard hand-written and generated sources against either inexact form

Extension module import: 43.5ms -> 15ms median (PI_TIMING, n=12
interleaved). bun test: 73/73 (pi-extension), 456/456 (server); all
seven TypeScript project checks and the packed-artifact audit pass.

Co-authored-by: dca123 <dca123@users.noreply.github.com>
Co-authored-by: Michael Ramos <mdramos8@gmail.com>
2026-07-22 16:36:17 -07:00

46 lines
1.1 KiB
TypeScript

/**
* Node-compatible servers for Plannotator Pi extension.
*
* Pi loads extensions via jiti (Node.js), so we can't use Bun.serve().
* These are lightweight node:http servers implementing just the routes
* each UI needs — plan review, code review, and markdown annotation.
*/
export type {
DiffOption,
DiffType,
GitContext,
} from "./generated/review-core.ts";
export type { WorkspaceDiffType } from "./generated/review-workspace.ts";
export type { VcsSelection } from "./server/vcs.ts";
export {
type AnnotateServerResult,
startAnnotateServer,
} from "./server/serverAnnotate.ts";
export {
type PlanServerResult,
startPlanReviewServer,
} from "./server/serverPlan.ts";
export {
type ReviewServerResult,
startReviewServer,
} from "./server/serverReview.ts";
export {
canStageFiles,
detectManagedVcs,
detectRemoteDefaultCompareTarget,
detectVcs,
getGitContext,
getVcsContext,
getVcsDiffFingerprint,
getVcsFileContentsForDiff,
prepareLocalReviewDiff,
resolveInitialDiffType,
resolveVcsCwd,
reviewRuntime,
runGitDiff,
runVcsDiff,
stageFile,
unstageFile,
} from "./server/vcs.ts";