@korso/shepherd 0.11.3 → 0.11.4

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 (2) hide show
  1. package/dist/index.js +20 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -358,6 +358,7 @@ var ChangeReportEntry = z2.object({
358
358
  message: z2.string().max(4096).nullable(),
359
359
  paths: z2.array(z2.string().min(1).max(1024)).min(1).max(500)
360
360
  });
361
+ var CHANGE_REPORT_MAX_BYTES = 48 * 1024;
361
362
  var ChangeReport = z2.object({
362
363
  branch: z2.string().max(512),
363
364
  baseBranch: z2.string().max(512),
@@ -1217,13 +1218,30 @@ async function buildChangeReport(cwd, config) {
1217
1218
  });
1218
1219
  }
1219
1220
  }
1220
- return {
1221
+ return fitToBudget({
1221
1222
  branch: branch ?? "HEAD",
1222
1223
  baseBranch: base ?? UNRESOLVED_BASE,
1223
1224
  head: head ?? "",
1224
1225
  truncated,
1225
1226
  entries
1226
- };
1227
+ });
1228
+ }
1229
+ function serializedBytes(report) {
1230
+ return Buffer.byteLength(JSON.stringify(report));
1231
+ }
1232
+ function fitToBudget(report) {
1233
+ if (serializedBytes(report) <= CHANGE_REPORT_MAX_BYTES) return report;
1234
+ report.truncated = true;
1235
+ while (report.entries.length > 0 && report.entries[report.entries.length - 1].kind === "committed" && serializedBytes(report) > CHANGE_REPORT_MAX_BYTES) {
1236
+ report.entries.pop();
1237
+ }
1238
+ const dirty = report.entries[0];
1239
+ if (dirty?.kind === "uncommitted") {
1240
+ while (dirty.paths.length > 1 && serializedBytes(report) > CHANGE_REPORT_MAX_BYTES) {
1241
+ dirty.paths.length = Math.ceil(dirty.paths.length / 2);
1242
+ }
1243
+ }
1244
+ return report;
1227
1245
  }
1228
1246
 
1229
1247
  // src/inbox.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korso/shepherd",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "Shepherd MCP server — gives any MCP-capable agent (Claude Code, Codex, etc.) advisory cross-session coordination tools (work/done/announce/sync, plus link/unlink/decline) backed by the shared Shepherd hub. Joins the workspace automatically and ships standing instructions so the agent self-coordinates.",
5
5
  "homepage": "https://github.com/Korso-AI/shepherd#readme",
6
6
  "bugs": {