@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.
@@ -2597,16 +2597,28 @@ async function handleInbox(body, headers, options) {
2597
2597
  const activityType = activity.type;
2598
2598
  switch (activityType) {
2599
2599
  case "Fork": {
2600
+ const parsed = parseForkActivity(activity);
2601
+ if (!parsed) {
2602
+ return {
2603
+ accepted: false,
2604
+ error: "Invalid Fork activity: missing or malformed required fields"
2605
+ };
2606
+ }
2600
2607
  if (options.onFork) {
2601
- const forkActivity = activity;
2602
- await options.onFork(forkActivity);
2608
+ await options.onFork(activity);
2603
2609
  }
2604
2610
  return { accepted: true, activityType: "Fork" };
2605
2611
  }
2606
2612
  case "Install": {
2613
+ const parsed = parseInstallActivity(activity);
2614
+ if (!parsed) {
2615
+ return {
2616
+ accepted: false,
2617
+ error: "Invalid Install activity: missing or malformed required fields"
2618
+ };
2619
+ }
2607
2620
  if (options.onInstall) {
2608
- const installActivity = activity;
2609
- await options.onInstall(installActivity);
2621
+ await options.onInstall(activity);
2610
2622
  }
2611
2623
  return { accepted: true, activityType: "Install" };
2612
2624
  }