@primitive.ai/prim 0.1.0-alpha.10 → 0.1.0-alpha.11
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/hooks/pre-commit.js +11 -2
- package/package.json +1 -1
package/dist/hooks/pre-commit.js
CHANGED
|
@@ -90,12 +90,21 @@ async function syncAffectedSpecs(deps = defaultDeps) {
|
|
|
90
90
|
console.log(` [skip] ${contextId} \u2014 no diff content`);
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
await client.post(
|
|
93
|
+
const response = await client.post(
|
|
94
94
|
`/api/cli/contexts/${contextId}/sync-diff`,
|
|
95
95
|
{ diffContent, affectedFiles: affected.matchedFiles },
|
|
96
96
|
{ signal: AbortSignal.timeout(HOOK_TIMEOUT_MS) }
|
|
97
97
|
);
|
|
98
|
-
|
|
98
|
+
const name = ctx.name ?? "(unnamed)";
|
|
99
|
+
if (response.truncated && response.sizeChars && response.limitChars) {
|
|
100
|
+
const sizeKiB = Math.round(response.sizeChars / 1024);
|
|
101
|
+
const limitKiB = Math.round(response.limitChars / 1024);
|
|
102
|
+
console.log(
|
|
103
|
+
` [synced] ${contextId} \u2014 ${name} (truncated: ${String(sizeKiB)} KiB \u2192 ${String(limitKiB)} KiB analyzed)`
|
|
104
|
+
);
|
|
105
|
+
} else {
|
|
106
|
+
console.log(` [synced] ${contextId} \u2014 ${name}`);
|
|
107
|
+
}
|
|
99
108
|
synced.push(contextId);
|
|
100
109
|
} catch (error) {
|
|
101
110
|
const message = error instanceof Error ? error.message : String(error);
|