@getchomp/cli 0.2.43 → 0.2.44
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.
- package/dist/commands/analyze.js +19 -2
- package/dist/commands/ui.d.ts +1 -0
- package/dist/commands/ui.js +44 -3
- package/dist/commands/uninstall.js +8 -2
- package/dist/ports/portHydrator.d.ts +5 -0
- package/dist/ports/portHydrator.js +175 -9
- package/dist/server/graphLayoutState.js +0 -2
- package/dist/server/hostedUiProxy.d.ts +13 -0
- package/dist/server/hostedUiProxy.js +137 -0
- package/dist/server/routes/authSourceRoutes.js +11 -0
- package/dist/server/routes/layoutRoutes.d.ts +5 -0
- package/dist/server/routes/layoutRoutes.js +32 -14
- package/dist/utils/branding.d.ts +56 -13
- package/dist/utils/branding.js +405 -216
- package/dist/visualizer/cloudLayoutClient.d.ts +6 -1
- package/dist/visualizer/cloudLayoutClient.js +15 -1
- package/package.json +5 -5
|
@@ -78,7 +78,12 @@ export interface RequestCloudLayoutOptions {
|
|
|
78
78
|
apiKey?: string;
|
|
79
79
|
/** Force calling the remote Cloud Layout Worker even inside the master monorepo (`--remote`). */
|
|
80
80
|
remote?: boolean;
|
|
81
|
-
/** Request timeout in milliseconds (
|
|
81
|
+
/** Request timeout in milliseconds (defaults to dynamic 30s–90s scaling by graph size). */
|
|
82
82
|
timeoutMs?: number;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Computes the dynamic Cloud Layout Worker timeout (`30s`–`90s`) when an explicit
|
|
86
|
+
* `timeoutMs` is not supplied, preventing premature `15s` aborts on 2,000–3,000+ node monorepos.
|
|
87
|
+
*/
|
|
88
|
+
export declare function computeCloudLayoutTimeoutMs(nodeCount: number, explicitTimeoutMs?: number): number;
|
|
84
89
|
export declare function requestStatelessCloudLayout(rawGraph: RepresentationGraph, repoName: string, diffDelta?: GraphDelta, rulesConfig?: ChompRulesConfig, overlays?: EntityOverlayItem[], options?: RequestCloudLayoutOptions): Promise<LayoutData>;
|
|
@@ -1114,6 +1114,19 @@ export function rehydrateCloudLayout(response, hydrationMap, rawGraph, repoName,
|
|
|
1114
1114
|
...(overlays ? { overlays } : {}),
|
|
1115
1115
|
};
|
|
1116
1116
|
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Computes the dynamic Cloud Layout Worker timeout (`30s`–`90s`) when an explicit
|
|
1119
|
+
* `timeoutMs` is not supplied, preventing premature `15s` aborts on 2,000–3,000+ node monorepos.
|
|
1120
|
+
*/
|
|
1121
|
+
export function computeCloudLayoutTimeoutMs(nodeCount, explicitTimeoutMs) {
|
|
1122
|
+
if (typeof explicitTimeoutMs === "number" &&
|
|
1123
|
+
Number.isFinite(explicitTimeoutMs) &&
|
|
1124
|
+
explicitTimeoutMs > 0) {
|
|
1125
|
+
return explicitTimeoutMs;
|
|
1126
|
+
}
|
|
1127
|
+
const safeNodeCount = Math.max(0, nodeCount);
|
|
1128
|
+
return Math.max(30_000, Math.min(90_000, 20_000 + safeNodeCount * 15));
|
|
1129
|
+
}
|
|
1117
1130
|
export async function requestStatelessCloudLayout(rawGraph, repoName, diffDelta, rulesConfig, overlays, options = {}) {
|
|
1118
1131
|
const { request, hydrationMap } = anonymizeGraphForCloudLayout(rawGraph, diffDelta, rulesConfig, overlays);
|
|
1119
1132
|
const explicitUrl = (options.cloudApiUrl ??
|
|
@@ -1134,8 +1147,9 @@ export async function requestStatelessCloudLayout(rawGraph, repoName, diffDelta,
|
|
|
1134
1147
|
return rehydrateCloudLayout(response, hydrationMap, rawGraph, repoName, overlays);
|
|
1135
1148
|
}
|
|
1136
1149
|
const baseUrl = explicitUrl || DEFAULT_CLOUD_API_URL;
|
|
1150
|
+
const effectiveTimeoutMs = computeCloudLayoutTimeoutMs(rawGraph.nodes.length, options.timeoutMs);
|
|
1137
1151
|
const controller = new AbortController();
|
|
1138
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
1152
|
+
const timeout = setTimeout(() => controller.abort(), effectiveTimeoutMs);
|
|
1139
1153
|
try {
|
|
1140
1154
|
const headers = {
|
|
1141
1155
|
"Content-Type": "application/json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getchomp/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.44",
|
|
4
4
|
"description": "Chomp CLI and local server — map your codebase, check architecture health, and launch Chomp Map.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://getchomp.dev",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"express": "^5.2.1",
|
|
37
37
|
"typescript": "^5.3.0",
|
|
38
38
|
"zod": "^3.23.8",
|
|
39
|
-
"@getchomp/core": "0.2.
|
|
40
|
-
"@getchomp/
|
|
41
|
-
"@getchomp/
|
|
39
|
+
"@getchomp/core": "0.2.44",
|
|
40
|
+
"@getchomp/mcp": "0.2.44",
|
|
41
|
+
"@getchomp/db": "0.2.44"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/better-sqlite3": "^7.6.11",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"build": "tsc -p tsconfig.build.json",
|
|
51
51
|
"dev": "tsx src/index.ts",
|
|
52
52
|
"typecheck": "tsc --noEmit",
|
|
53
|
-
"test": "tsx --test src/utils/masterContext.test.ts src/visualizer/layoutCache.test.ts src/visualizer/rulesConfig.test.ts src/visualizer/pluginPresentationApi.test.ts src/visualizer/cloudLayoutClient.test.ts src/visualizer/sourceAccess.test.ts src/ports/portHydrator.test.ts src/ports/portHydratorWorker.test.ts src/visualizer/visualLinter.test.ts"
|
|
53
|
+
"test": "tsx --test src/server/hostedUiProxy.test.ts src/utils/branding.test.ts src/utils/masterContext.test.ts src/visualizer/layoutCache.test.ts src/visualizer/rulesConfig.test.ts src/visualizer/pluginPresentationApi.test.ts src/visualizer/cloudLayoutClient.test.ts src/visualizer/sourceAccess.test.ts src/ports/portHydrator.test.ts src/ports/portHydratorWorker.test.ts src/visualizer/visualLinter.test.ts"
|
|
54
54
|
}
|
|
55
55
|
}
|