@getchomp/cli 0.0.0-stage → 0.2.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +39 -2
  2. package/dist/commands/analyze.d.ts +49 -0
  3. package/dist/commands/analyze.js +280 -0
  4. package/dist/commands/connect.d.ts +12 -0
  5. package/dist/commands/connect.js +255 -0
  6. package/dist/commands/export.d.ts +29 -0
  7. package/dist/commands/export.js +356 -0
  8. package/dist/commands/health.d.ts +19 -0
  9. package/dist/commands/health.js +259 -0
  10. package/dist/commands/init.d.ts +40 -0
  11. package/dist/commands/init.js +654 -0
  12. package/dist/commands/mcp.d.ts +2 -0
  13. package/dist/commands/mcp.js +12 -0
  14. package/dist/commands/plugin.d.ts +8 -0
  15. package/dist/commands/plugin.js +198 -0
  16. package/dist/commands/ui.d.ts +20 -0
  17. package/dist/commands/ui.js +250 -0
  18. package/dist/commands/uninstall.d.ts +8 -0
  19. package/dist/commands/uninstall.js +238 -0
  20. package/dist/index.d.ts +3 -0
  21. package/dist/index.js +37 -0
  22. package/dist/ports/portHydrator.d.ts +63 -0
  23. package/dist/ports/portHydrator.js +954 -0
  24. package/dist/ports/portHydratorWorker.d.ts +22 -0
  25. package/dist/ports/portHydratorWorker.js +75 -0
  26. package/dist/server/buildStatusTracker.d.ts +45 -0
  27. package/dist/server/buildStatusTracker.js +122 -0
  28. package/dist/server/graphLayoutState.d.ts +205 -0
  29. package/dist/server/graphLayoutState.js +930 -0
  30. package/dist/server/loopbackSecurity.d.ts +18 -0
  31. package/dist/server/loopbackSecurity.js +57 -0
  32. package/dist/server/routes/authSourceRoutes.d.ts +18 -0
  33. package/dist/server/routes/authSourceRoutes.js +231 -0
  34. package/dist/server/routes/layoutRoutes.d.ts +3 -0
  35. package/dist/server/routes/layoutRoutes.js +857 -0
  36. package/dist/server/routes/pluginRoutes.d.ts +3 -0
  37. package/dist/server/routes/pluginRoutes.js +368 -0
  38. package/dist/server/routes/viewRulesRoutes.d.ts +3 -0
  39. package/dist/server/routes/viewRulesRoutes.js +173 -0
  40. package/dist/server/uiHotkeys.d.ts +26 -0
  41. package/dist/server/uiHotkeys.js +160 -0
  42. package/dist/utils/branding.d.ts +126 -0
  43. package/dist/utils/branding.js +976 -0
  44. package/dist/utils/credentials.d.ts +22 -0
  45. package/dist/utils/credentials.js +126 -0
  46. package/dist/utils/git.d.ts +95 -0
  47. package/dist/utils/git.js +780 -0
  48. package/dist/utils/masterContext.d.ts +102 -0
  49. package/dist/utils/masterContext.js +559 -0
  50. package/dist/visualizer/cloudLayoutClient.d.ts +84 -0
  51. package/dist/visualizer/cloudLayoutClient.js +1200 -0
  52. package/dist/visualizer/layoutCache.d.ts +25 -0
  53. package/dist/visualizer/layoutCache.js +406 -0
  54. package/dist/visualizer/localEngineBridge.d.ts +50 -0
  55. package/dist/visualizer/localEngineBridge.js +80 -0
  56. package/dist/visualizer/pluginPresentationApi.d.ts +111 -0
  57. package/dist/visualizer/pluginPresentationApi.js +432 -0
  58. package/dist/visualizer/rulesConfig.d.ts +11 -0
  59. package/dist/visualizer/rulesConfig.js +266 -0
  60. package/dist/visualizer/sourceAccess.d.ts +45 -0
  61. package/dist/visualizer/sourceAccess.js +204 -0
  62. package/package.json +51 -3
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @fileoverview Isolated child-process entrypoint for Speed 2 Port Valve hydration
3
+ * (`[PAT-VIS-14]`, `[PAT-DB-03]`).
4
+ *
5
+ * Running TypeScript's `ts.createIncrementalProgram()` + `getSemanticDiagnostics()`
6
+ * inside a short-lived forked child process keeps the `chomp ui` main event loop
7
+ * completely responsive (HTTP polling, SSE `/api/status`, raw-mode hotkeys & `Ctrl+C`),
8
+ * isolates `better-sqlite3` safely across OS process boundaries in WAL mode, and ensures
9
+ * TypeScript's compiler heap is reclaimed by the OS immediately upon completion.
10
+ */
11
+ import { type HydratePortValvesResult } from './portHydrator.js';
12
+ export interface PortHydratorWorkerRequest {
13
+ dbPath: string;
14
+ repoPath?: string;
15
+ force?: boolean;
16
+ cacheDir?: string | false;
17
+ }
18
+ export interface PortHydratorWorkerResponse {
19
+ ok: boolean;
20
+ result?: HydratePortValvesResult | null;
21
+ error?: string;
22
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @fileoverview Isolated child-process entrypoint for Speed 2 Port Valve hydration
3
+ * (`[PAT-VIS-14]`, `[PAT-DB-03]`).
4
+ *
5
+ * Running TypeScript's `ts.createIncrementalProgram()` + `getSemanticDiagnostics()`
6
+ * inside a short-lived forked child process keeps the `chomp ui` main event loop
7
+ * completely responsive (HTTP polling, SSE `/api/status`, raw-mode hotkeys & `Ctrl+C`),
8
+ * isolates `better-sqlite3` safely across OS process boundaries in WAL mode, and ensures
9
+ * TypeScript's compiler heap is reclaimed by the OS immediately upon completion.
10
+ */
11
+ import { existsSync } from 'node:fs';
12
+ import { createSQLiteStorage } from '@getchomp/db';
13
+ import { hydrateRepositoryPortValves, } from './portHydrator.js';
14
+ function sendResponseAndExit(payload, exitCode = 0) {
15
+ if (typeof process.send === 'function') {
16
+ process.send(payload, () => {
17
+ process.exit(exitCode);
18
+ });
19
+ // Fallback in case IPC callback does not fire on an already-closed channel
20
+ setTimeout(() => process.exit(exitCode), 250).unref();
21
+ }
22
+ else {
23
+ process.exit(exitCode);
24
+ }
25
+ }
26
+ async function handleRequest(req) {
27
+ if (!req?.dbPath || !existsSync(req.dbPath)) {
28
+ sendResponseAndExit({ ok: true, result: null }, 0);
29
+ return;
30
+ }
31
+ const storage = createSQLiteStorage(req.dbPath);
32
+ try {
33
+ const repos = await storage.listRepositories();
34
+ if (repos.length === 0) {
35
+ sendResponseAndExit({ ok: true, result: null }, 0);
36
+ return;
37
+ }
38
+ const repo = repos[0];
39
+ const graph = await storage.getRepresentationGraph(repo.id);
40
+ if (!graph) {
41
+ sendResponseAndExit({ ok: true, result: null }, 0);
42
+ return;
43
+ }
44
+ const effectiveRepoPath = repo.path || req.repoPath;
45
+ if (!effectiveRepoPath) {
46
+ sendResponseAndExit({ ok: true, result: null }, 0);
47
+ return;
48
+ }
49
+ const result = await hydrateRepositoryPortValves({
50
+ repoPath: effectiveRepoPath,
51
+ repoId: repo.id,
52
+ storage,
53
+ graph,
54
+ force: Boolean(req.force),
55
+ ...(req.cacheDir !== undefined ? { cacheDir: req.cacheDir } : {}),
56
+ });
57
+ await storage.close();
58
+ sendResponseAndExit({ ok: true, result }, 0);
59
+ }
60
+ catch (err) {
61
+ try {
62
+ await storage.close();
63
+ }
64
+ catch {
65
+ // Ignore close errors during failure teardown
66
+ }
67
+ sendResponseAndExit({ ok: false, error: err?.message ? String(err.message) : String(err) }, 1);
68
+ }
69
+ }
70
+ process.on('SIGTERM', () => process.exit(0));
71
+ process.on('SIGINT', () => process.exit(0));
72
+ process.on('disconnect', () => process.exit(0));
73
+ process.once('message', (msg) => {
74
+ void handleRequest(msg);
75
+ });
@@ -0,0 +1,45 @@
1
+ export type LayoutBuildStageId = "extracting_ast" | "tracing_stories" | "zip_merge" | "mapping_grid" | "computing_health_diff";
2
+ export interface LayoutBuildStageDef {
3
+ id: LayoutBuildStageId;
4
+ step: number;
5
+ total: number;
6
+ label: string;
7
+ }
8
+ export declare const LAYOUT_BUILD_STAGES: readonly LayoutBuildStageDef[];
9
+ export interface LayoutBuildStatusSnapshot {
10
+ connected: true;
11
+ state: "idle" | "building" | "ready" | "error";
12
+ building: boolean;
13
+ repoName: string;
14
+ branchName?: string;
15
+ diffMode: boolean;
16
+ stageId: LayoutBuildStageId | null;
17
+ stageLabel: string;
18
+ step: number;
19
+ totalSteps: number;
20
+ contractCount?: number;
21
+ packageCount?: number;
22
+ startedAt?: number;
23
+ updatedAt: number;
24
+ durationMs?: number;
25
+ error?: string;
26
+ }
27
+ export interface BuildStatusTracker {
28
+ getSnapshot: () => LayoutBuildStatusSnapshot;
29
+ begin: (meta: {
30
+ repoName: string;
31
+ branchName?: string;
32
+ diffMode: boolean;
33
+ contractCount?: number;
34
+ packageCount?: number;
35
+ }) => void;
36
+ advance: (stage: LayoutBuildStageDef) => void;
37
+ complete: (durationMs: number) => void;
38
+ fail: (errorMessage: string) => void;
39
+ subscribe: (listener: (snap: LayoutBuildStatusSnapshot) => void) => () => void;
40
+ }
41
+ export declare function createBuildStatusTracker(initialRepoName?: string): BuildStatusTracker;
42
+ /**
43
+ * Subscribes a live single-line TTY spinner to layout build stage transitions.
44
+ */
45
+ export declare function attachTtyBuildProgressSpinner(statusTracker: BuildStatusTracker): () => void;
@@ -0,0 +1,122 @@
1
+ import { ansi } from "../utils/branding.js";
2
+ export const LAYOUT_BUILD_STAGES = [
3
+ { id: "extracting_ast", step: 1, total: 5, label: "Reading repository structure..." },
4
+ { id: "tracing_stories", step: 2, total: 5, label: "Connecting routes & functions..." },
5
+ { id: "zip_merge", step: 3, total: 5, label: "Consolidating shared flows..." },
6
+ { id: "mapping_grid", step: 4, total: 5, label: "Arranging codebase map..." },
7
+ { id: "computing_health_diff", step: 5, total: 5, label: "Finalizing health checks..." },
8
+ ];
9
+ export function createBuildStatusTracker(initialRepoName = "repository") {
10
+ let snapshot = {
11
+ connected: true,
12
+ state: "idle",
13
+ building: false,
14
+ repoName: initialRepoName,
15
+ diffMode: false,
16
+ stageId: null,
17
+ stageLabel: "Idle",
18
+ step: 0,
19
+ totalSteps: LAYOUT_BUILD_STAGES.length,
20
+ updatedAt: Date.now(),
21
+ };
22
+ const listeners = new Set();
23
+ const notify = () => {
24
+ for (const fn of listeners) {
25
+ try {
26
+ fn(snapshot);
27
+ }
28
+ catch {
29
+ // Ignore listener errors
30
+ }
31
+ }
32
+ };
33
+ return {
34
+ getSnapshot: () => ({ ...snapshot }),
35
+ begin: ({ repoName, branchName, diffMode, contractCount, packageCount }) => {
36
+ const first = LAYOUT_BUILD_STAGES[0];
37
+ const now = Date.now();
38
+ snapshot = {
39
+ connected: true,
40
+ state: "building",
41
+ building: true,
42
+ repoName,
43
+ ...(branchName ? { branchName } : {}),
44
+ diffMode,
45
+ stageId: first.id,
46
+ stageLabel: first.label,
47
+ step: first.step,
48
+ totalSteps: first.total,
49
+ ...(typeof contractCount === "number" ? { contractCount } : {}),
50
+ ...(typeof packageCount === "number" ? { packageCount } : {}),
51
+ startedAt: now,
52
+ updatedAt: now,
53
+ };
54
+ notify();
55
+ },
56
+ advance: (stage) => {
57
+ snapshot = {
58
+ ...snapshot,
59
+ state: "building",
60
+ building: true,
61
+ stageId: stage.id,
62
+ stageLabel: stage.label,
63
+ step: stage.step,
64
+ totalSteps: stage.total,
65
+ updatedAt: Date.now(),
66
+ };
67
+ notify();
68
+ },
69
+ complete: (durationMs) => {
70
+ snapshot = {
71
+ ...snapshot,
72
+ state: "ready",
73
+ building: false,
74
+ stageId: "computing_health_diff",
75
+ stageLabel: "Ready",
76
+ step: LAYOUT_BUILD_STAGES.length,
77
+ totalSteps: LAYOUT_BUILD_STAGES.length,
78
+ durationMs,
79
+ updatedAt: Date.now(),
80
+ };
81
+ delete snapshot.error;
82
+ notify();
83
+ },
84
+ fail: (errorMessage) => {
85
+ snapshot = {
86
+ ...snapshot,
87
+ state: "error",
88
+ building: false,
89
+ error: errorMessage,
90
+ updatedAt: Date.now(),
91
+ };
92
+ notify();
93
+ },
94
+ subscribe: (listener) => {
95
+ listeners.add(listener);
96
+ return () => {
97
+ listeners.delete(listener);
98
+ };
99
+ },
100
+ };
101
+ }
102
+ /**
103
+ * Subscribes a live single-line TTY spinner to layout build stage transitions.
104
+ */
105
+ export function attachTtyBuildProgressSpinner(statusTracker) {
106
+ const chompSpinnerFrames = ["◐", "◓", "◑", "◒"];
107
+ let ttyProgressActive = false;
108
+ return statusTracker.subscribe((snap) => {
109
+ if (!process.stdout.isTTY)
110
+ return;
111
+ if (snap.building) {
112
+ ttyProgressActive = true;
113
+ const frame = chompSpinnerFrames[(snap.step - 1) % chompSpinnerFrames.length];
114
+ const modeLabel = snap.diffMode ? " · diff" : "";
115
+ process.stdout.write(`\r\x1b[2K ${ansi.yellowBold(frame)} ${ansi.bold("Chomping layout")} ${ansi.dim(`(${snap.repoName}${modeLabel})`)} ${ansi.cyan(`[${snap.step}/${snap.totalSteps}]`)} ${snap.stageLabel}...`);
116
+ }
117
+ else if (ttyProgressActive) {
118
+ ttyProgressActive = false;
119
+ process.stdout.write("\r\x1b[2K");
120
+ }
121
+ });
122
+ }
@@ -0,0 +1,205 @@
1
+ import { type ChompRulesConfig, type DiffSummaryStats, type EntityOverlayItem, type LayoutData, type LayoutEntitlement, type RepresentationGraph } from "@getchomp/core";
2
+ import { type HydratePortValvesResult, type PortHydrationChildHandle } from "../ports/portHydrator.js";
3
+ import { type ResolvedGitRefCommit } from "../utils/git.js";
4
+ import { type PluginRunMap } from "../visualizer/pluginPresentationApi.js";
5
+ import { type BuildStatusTracker, type LayoutBuildStageDef } from "./buildStatusTracker.js";
6
+ export interface ActiveUiTarget {
7
+ target: string;
8
+ repoName: string;
9
+ dbPath: string;
10
+ }
11
+ export interface BaseGraphCacheRecord {
12
+ key: string;
13
+ mtime: number;
14
+ repo: {
15
+ id: string;
16
+ name?: string;
17
+ path?: string;
18
+ commitSha?: string;
19
+ branchName?: string;
20
+ };
21
+ graph: RepresentationGraph;
22
+ /** Every overlay, as stored (used by `/api/overlays`). */
23
+ overlays: EntityOverlayItem[];
24
+ /** Overlays as `/api/layout` and `/api/graph` carry them: plugin presentations deferred to `/api/plugins/*`. */
25
+ structuralOverlays: EntityOverlayItem[];
26
+ /** Overlays carrying a plugin presentation, served separately by `/api/plugins/*` ([PAT-VIS-36]). */
27
+ pluginOverlays: EntityOverlayItem[];
28
+ /** Content fingerprint of the structure; unaffected by plugin writes. */
29
+ structureFp: string;
30
+ }
31
+ export interface UiServerState {
32
+ port: number;
33
+ resolvedTarget: string;
34
+ repoName: string;
35
+ dbPath: string;
36
+ explicitDbOption?: string;
37
+ pinToResolvedTarget: boolean;
38
+ resolvedIsWorktree: boolean;
39
+ debug: boolean;
40
+ cloudUrl?: string;
41
+ remote: boolean;
42
+ resolvedCloudApiUrl: string;
43
+ isMasterLocalMode: boolean;
44
+ localWebDir: string | null;
45
+ localDaemonUrl: string;
46
+ url: string;
47
+ latestEntitlement?: LayoutEntitlement;
48
+ statusTracker: BuildStatusTracker;
49
+ layoutCache: Map<string, LayoutData>;
50
+ layoutInFlight: Map<string, Promise<LayoutData>>;
51
+ loggedBoardRevisions: Set<string>;
52
+ pluginRuns: PluginRunMap;
53
+ baseGraphCache: BaseGraphCacheRecord | null;
54
+ baseGraphInFlight: Promise<BaseGraphCacheRecord | null> | null;
55
+ liveGraphCache: {
56
+ key: string;
57
+ liveGraph: RepresentationGraph;
58
+ } | null;
59
+ workingTreeSnapshotCache: {
60
+ repoPath: string;
61
+ snapshotAt: string;
62
+ wtFingerprint: string;
63
+ liveGraph: RepresentationGraph;
64
+ } | null;
65
+ latestDiffSummary: {
66
+ fingerprintKey: string;
67
+ summary: DiffSummaryStats;
68
+ } | null;
69
+ portHydrationInFlight: Promise<HydratePortValvesResult | null> | null;
70
+ activePortHydrationHandle: PortHydrationChildHandle | null;
71
+ portHydrationQueued: boolean;
72
+ portHydrationForceQueued: boolean;
73
+ initialPortHydrationTriggered: boolean;
74
+ designSystemReportCache: {
75
+ key: string;
76
+ payload: any;
77
+ } | null;
78
+ viewValidationCache: {
79
+ key: string;
80
+ payload: any;
81
+ } | null;
82
+ }
83
+ export declare function createUiServerState(params: {
84
+ port: number;
85
+ resolvedTarget: string;
86
+ repoName: string;
87
+ dbPath: string;
88
+ explicitDbOption?: string;
89
+ pinToResolvedTarget?: boolean;
90
+ resolvedIsWorktree?: boolean;
91
+ debug: boolean;
92
+ cloudUrl?: string;
93
+ remote: boolean;
94
+ resolvedCloudApiUrl: string;
95
+ isMasterLocalMode: boolean;
96
+ localWebDir: string | null;
97
+ localDaemonUrl: string;
98
+ url: string;
99
+ statusTracker: BuildStatusTracker;
100
+ }): UiServerState;
101
+ export declare function getActiveUiTarget(state: UiServerState): ActiveUiTarget;
102
+ export declare function cancelActivePortHydration(state: UiServerState): void;
103
+ export declare function invalidateAllServerCaches(state: UiServerState): void;
104
+ export declare function invalidateAuthCachesOnly(state: UiServerState, activeDbPath: string): void;
105
+ export declare function getCurrentDbMtime(targetDbPath: string): number;
106
+ export declare function getLocalShimsFileFp(targetRepoPath: string | undefined): string;
107
+ export declare function getAuthModeFingerprint(state: UiServerState): string;
108
+ export declare function loadBaseGraphCached(state: UiServerState): Promise<BaseGraphCacheRecord | null>;
109
+ export declare function hydratePluginRunsForRepo(state: UiServerState, repoPath?: string): Record<string, import("@getchomp/core").PluginRunStatus>;
110
+ export declare function getPluginRegistryMeta(repoPath?: string): {
111
+ lastRun?: {
112
+ error?: string | undefined;
113
+ presentationWarnings?: string[] | undefined;
114
+ overlayCount?: number | undefined;
115
+ status: "error" | "ok";
116
+ startedAt: string;
117
+ finishedAt: string;
118
+ durationMs: number;
119
+ } | undefined;
120
+ mcpTools?: import("@getchomp/core").PluginToolDescriptorSummary[] | undefined;
121
+ envStatus?: Record<string, boolean> | undefined;
122
+ settings?: Record<string, import("@getchomp/core").PluginSettingValue> | undefined;
123
+ settingsSchema?: import("@getchomp/core").PluginSettingField[] | undefined;
124
+ stateDir: string;
125
+ inspectorScopes?: import("@getchomp/core").PluginInspectorScope[] | undefined;
126
+ layer: string;
127
+ defaultEnabled: boolean;
128
+ order?: number | undefined;
129
+ name: string;
130
+ displayName: string | undefined;
131
+ description: string;
132
+ version: string;
133
+ }[];
134
+ export declare function getDirtyRepoPathsForDiff(repoPath: string): Set<string> | null;
135
+ export declare function getChangedRepoPathsBetweenCommits(repoPath: string, baseSha: string, targetSha: string): Set<string> | null;
136
+ export declare function resolveScopedDiffPaths(repoPath: string, baseSha: string | undefined, targetSha: string | undefined, isWorkingTree: boolean): Set<string> | null;
137
+ export declare function readGitBlobForDiff(repoPath: string, commitSha: string, relPath: string, dirtyPaths: Set<string> | null): string | null;
138
+ export declare function hasGitCommitForDiff(repoPath: string, commitSha: string | undefined): commitSha is string;
139
+ export declare function extractFilteredLiveUserGraph(repoPath: string): RepresentationGraph;
140
+ export interface ResolvedRefGraphResult {
141
+ ref: string;
142
+ commitSha: string;
143
+ fullCommitSha: string;
144
+ branchName?: string;
145
+ commitMessage?: string;
146
+ graph: RepresentationGraph;
147
+ tier: "memory" | "disk-cache" | "worktree-db" | "git-archive";
148
+ }
149
+ export interface InMemoryBaseGraphContext {
150
+ activeDbPath: string;
151
+ baseData: BaseGraphCacheRecord;
152
+ activeCommitSha?: string;
153
+ workingTreeDirty?: boolean;
154
+ }
155
+ export declare function seedRefGraphDiskCache(params: {
156
+ repoPath: string;
157
+ dbPath: string;
158
+ fullCommitSha: string;
159
+ branchName?: string;
160
+ commitMessage?: string;
161
+ graph: RepresentationGraph;
162
+ }): void;
163
+ export declare function tryReuseInMemoryBaseGraph(ctx: InMemoryBaseGraphContext, refInfo: ResolvedGitRefCommit): ResolvedRefGraphResult | null;
164
+ /**
165
+ * Resolves the Layer 0 `RepresentationGraph` for any committed Git branch or SHA
166
+ * using a 4-tier fast path:
167
+ * 0. Clean in-memory `baseData.graph` match (`0ms` memory hit)
168
+ * 1. `.chomp/cache/ref-graph-<sha12>.json` (`<5ms` disk hit across local or primary worktree cache)
169
+ * 2. Checked-out local Git worktree `.chomp/graph.db` matching `fullCommitSha` (`<15ms` SQLite hit)
170
+ * 3. Clean `git archive <sha>` extraction + `analyzeTarget`, persisted to `.chomp/cache/`
171
+ */
172
+ export declare function resolveCommittedRefGraph(repoPath: string, refOrBranch: string, options?: {
173
+ dbPath?: string;
174
+ forceRefresh?: boolean;
175
+ resolvedRef?: ResolvedGitRefCommit | null;
176
+ inMemoryBase?: InMemoryBaseGraphContext;
177
+ }): Promise<ResolvedRefGraphResult>;
178
+ export declare function resolveWorkingTreeSnapshotGraph(state: UiServerState, repoPath: string, wtFingerprint: string, forceRefresh?: boolean): {
179
+ snapshotAt: string;
180
+ liveGraph: RepresentationGraph;
181
+ };
182
+ export interface BuildLayoutDiffOptions {
183
+ baseGraph?: RepresentationGraph;
184
+ baseCommitSha?: string;
185
+ baseFullCommitSha?: string;
186
+ baseRef?: string;
187
+ baseCommitMessage?: string;
188
+ targetGraph?: RepresentationGraph;
189
+ targetCommitSha?: string;
190
+ targetFullCommitSha?: string;
191
+ targetRef?: string;
192
+ targetCommitMessage?: string;
193
+ isWorkingTreeSnapshot?: boolean;
194
+ snapshotAt?: string;
195
+ }
196
+ export declare function buildLayout(graph: RepresentationGraph, repoPath: string | undefined, diffMode: boolean, repoName?: string, cachedLiveGraph?: RepresentationGraph, rulesConfig?: ChompRulesConfig, overlays?: EntityOverlayItem[], debugMode?: boolean, cloudApiUrl?: string, onStage?: (stage: LayoutBuildStageDef) => void | Promise<void>, remoteMode?: boolean, diffOptions?: BuildLayoutDiffOptions): Promise<{
197
+ layout: LayoutData;
198
+ liveGraph?: RepresentationGraph;
199
+ }>;
200
+ /**
201
+ * Speed 2 Background Port Valve Verification (`[PAT-VIS-14]`, `[PAT-DB-03]`).
202
+ * Runs in an isolated forked child process so TypeScript compilation never blocks the UI event loop.
203
+ */
204
+ export declare function scheduleBackgroundPortHydration(state: UiServerState, force?: boolean): Promise<HydratePortValvesResult | null>;
205
+ export declare function triggerInitialPortHydrationAfterLayout(state: UiServerState): void;