@trops/dash-core 0.1.706 → 0.1.707

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.
@@ -78934,9 +78934,18 @@ const LIMITS = {
78934
78934
  description: 2000,
78935
78935
  instructions: 50000,
78936
78936
  prompt: 5000,
78937
+ // A trigger's note to the triggered bot (botSchema MAX_NOTE).
78938
+ note: 2000,
78937
78939
  short: 200,
78938
78940
  };
78939
78941
 
78942
+ /** A wiring entry, with its note when it has one. */
78943
+ function wiringEntry(role, on, note) {
78944
+ const entry = { role, on: { role: on.role, event: on.event } };
78945
+ if (typeof note === "string" && note.trim()) entry.note = note.trim();
78946
+ return entry;
78947
+ }
78948
+
78940
78949
  const ROLE_RE = /^[a-z0-9][a-z0-9-]{0,39}$/;
78941
78950
  const EVENT_RE = /^(completed|failed|tool\.[A-Za-z0-9_.:-]{1,200})$/;
78942
78951
 
@@ -79024,10 +79033,13 @@ function buildTeamManifest$2({ name, description = "", bots, providers }) {
79024
79033
  const src = (sub && sub.source) || {};
79025
79034
  const label = (sub && (sub.label || sub.eventType)) || "a trigger";
79026
79035
  if (src.kind === "bot" && roleOf.has(src.instanceId)) {
79027
- wiring.push({
79028
- role: roleOf.get(bot.id),
79029
- on: { role: roleOf.get(src.instanceId), event: src.event },
79030
- });
79036
+ wiring.push(
79037
+ wiringEntry(
79038
+ roleOf.get(bot.id),
79039
+ { role: roleOf.get(src.instanceId), event: src.event },
79040
+ sub.note,
79041
+ ),
79042
+ );
79031
79043
  } else if (src.kind === "bot") {
79032
79044
  notIncluded.push(
79033
79045
  `${bot.name}: the trigger "${label}" (a bot outside this team)`,
@@ -79205,7 +79217,13 @@ function validateTeamManifest$2(input) {
79205
79217
  errors.push(`${where}: unknown event`);
79206
79218
  return;
79207
79219
  }
79208
- wiring.push({ role: w.role, on: { role: on.role, event: on.event } });
79220
+ if (w.note != null && !str$1(w.note, LIMITS.note)) {
79221
+ errors.push(
79222
+ `${where}: note must be text of at most ${LIMITS.note} characters`,
79223
+ );
79224
+ return;
79225
+ }
79226
+ wiring.push(wiringEntry(w.role, on, w.note));
79209
79227
  });
79210
79228
  }
79211
79229
 
@@ -79303,10 +79321,7 @@ function planTeamInstall$1(
79303
79321
  };
79304
79322
  });
79305
79323
 
79306
- const copy = (w) => ({
79307
- role: w.role,
79308
- on: { role: w.on.role, event: w.on.event },
79309
- });
79324
+ const copy = (w) => wiringEntry(w.role, w.on, w.note);
79310
79325
  return {
79311
79326
  name: manifest.name,
79312
79327
  members,
@@ -79354,6 +79369,7 @@ function wireTeam$1(wiring, created) {
79354
79369
  event: w.on.event,
79355
79370
  },
79356
79371
  label: `${src.name} › ${eventLabel(w.on.event)}`,
79372
+ ...(typeof w.note === "string" && w.note ? { note: w.note } : {}),
79357
79373
  });
79358
79374
  }
79359
79375
  return out;