@character-foundry/character-foundry 0.1.8 → 0.1.9-dev.1765913722

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.
@@ -2508,16 +2508,28 @@ async function handleInbox(body, headers, options) {
2508
2508
  const activityType = activity.type;
2509
2509
  switch (activityType) {
2510
2510
  case "Fork": {
2511
+ const parsed = parseForkActivity(activity);
2512
+ if (!parsed) {
2513
+ return {
2514
+ accepted: false,
2515
+ error: "Invalid Fork activity: missing or malformed required fields"
2516
+ };
2517
+ }
2511
2518
  if (options.onFork) {
2512
- const forkActivity = activity;
2513
- await options.onFork(forkActivity);
2519
+ await options.onFork(activity);
2514
2520
  }
2515
2521
  return { accepted: true, activityType: "Fork" };
2516
2522
  }
2517
2523
  case "Install": {
2524
+ const parsed = parseInstallActivity(activity);
2525
+ if (!parsed) {
2526
+ return {
2527
+ accepted: false,
2528
+ error: "Invalid Install activity: missing or malformed required fields"
2529
+ };
2530
+ }
2518
2531
  if (options.onInstall) {
2519
- const installActivity = activity;
2520
- await options.onInstall(installActivity);
2532
+ await options.onInstall(activity);
2521
2533
  }
2522
2534
  return { accepted: true, activityType: "Install" };
2523
2535
  }