terse-types 0.0.30 → 0.0.32

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/Tools.js CHANGED
@@ -26,7 +26,6 @@ export const linearIssueAssigneeSchema = z.object({
26
26
  name: z.string(),
27
27
  email: z.string().optional()
28
28
  });
29
- export const linearIssueTeamSchema = linearTeamSchema;
30
29
  export const linearIssueProjectSchema = z.object({
31
30
  id: z.string(),
32
31
  name: z.string()
@@ -44,7 +43,7 @@ export const linearIssueSummarySchema = z.object({
44
43
  updatedAt: dateLikeSchema
45
44
  });
46
45
  export const linearIssueDetailSchema = linearIssueSummarySchema.extend({
47
- team: linearIssueTeamSchema.nullable(),
46
+ team: linearTeamSchema.nullable(),
48
47
  project: linearIssueProjectSchema.nullable(),
49
48
  dueDate: dateLikeSchema.optional(),
50
49
  estimate: z.number().nullable().optional()
@@ -225,7 +224,6 @@ export const notionReadablePropertyValueSchema = z.union([
225
224
  z.array(notionFileReferenceSchema),
226
225
  notionLooseObjectSchema
227
226
  ]);
228
- export const notionPageParentSchema = notionLooseObjectSchema;
229
227
  export const notionPageBlockSchema = z.lazy(() => z.object({
230
228
  id: z.string(),
231
229
  type: z.string(),
@@ -262,7 +260,7 @@ export const notionPageQueryMetadataSchema = z.object({
262
260
  archived: z.boolean().optional(),
263
261
  icon: notionLooseObjectSchema.nullable().optional(),
264
262
  cover: notionLooseObjectSchema.nullable().optional(),
265
- parent: notionPageParentSchema.optional(),
263
+ parent: notionLooseObjectSchema.optional(),
266
264
  created_by: notionUserReferenceSchema.optional(),
267
265
  last_edited_by: notionUserReferenceSchema.optional(),
268
266
  in_trash: z.boolean().optional()
@@ -573,7 +571,7 @@ export const slackReadConversationInputSchema = z.object({
573
571
  export const searchGitHubCodeInputSchema = z.object({
574
572
  repositoryNames: z.array(z.string()).describe("Array of repository full names (owner/repo format) to search in."),
575
573
  query: z.string().describe('The search query. Use natural language or code-specific terms. Examples: "authentication middleware", "class UserRepository", "handleSubmit form validation"'),
576
- language: z.string().nullable().optional().describe('Filter by programming language (e.g., "typescript", "python", "javascript"). Use null to search all languages.'),
574
+ language: z.string().nullable().optional().describe('Filter by programming language (e.g., "typescript", "javascript"). Use null to search all languages.'),
577
575
  filename: z.string().nullable().optional().describe('Filter by filename pattern (e.g., "*.test.ts" for test files, "*.config.*" for config files). Use null to search all files.'),
578
576
  path: z.string().nullable().optional().describe('Filter by path (e.g., "src/components" to only search in that directory). Use null to search everywhere.'),
579
577
  perPage: z.number().int().describe("Number of results to return (default: 10, max: 100)"),
@@ -55,6 +55,11 @@ const TriggerPresenters = {
55
55
  debug: (event) => `WorkOS ${event.eventType}`,
56
56
  display: formatWorkOSDisplay
57
57
  },
58
+ [IntegrationType.HEY_REACH]: {
59
+ formatForAgent: formatHeyReachTrigger,
60
+ debug: (event) => `HeyReach ${event.eventType}${event.lead?.id != null ? ` lead=${event.lead.id}` : ""}`,
61
+ display: formatHeyReachDisplay
62
+ },
58
63
  [IntegrationType.WEBHOOK]: {
59
64
  formatForAgent: formatWebhookTrigger,
60
65
  debug: (event) => `Webhook Trigger (${event.method})`,
@@ -83,6 +88,8 @@ function dispatchPresenter(event, method) {
83
88
  return TriggerPresenters[IntegrationType.LINEAR][method](event);
84
89
  case IntegrationType.WORKOS:
85
90
  return TriggerPresenters[IntegrationType.WORKOS][method](event);
91
+ case IntegrationType.HEY_REACH:
92
+ return TriggerPresenters[IntegrationType.HEY_REACH][method](event);
86
93
  case IntegrationType.WEBHOOK:
87
94
  return TriggerPresenters[IntegrationType.WEBHOOK][method](event);
88
95
  case IntegrationType.CRON_JOB:
@@ -413,6 +420,61 @@ function formatWebMonitorTrigger(event) {
413
420
  }
414
421
  return lines.join("\n\n");
415
422
  }
423
+ function heyReachLeadFullName(event) {
424
+ const lead = event.lead;
425
+ if (!lead)
426
+ return null;
427
+ const composed = [lead.first_name, lead.last_name].filter(Boolean).join(" ").trim() || lead.full_name?.trim() || "";
428
+ const idStr = lead.id != null ? String(lead.id) : null;
429
+ return composed || idStr;
430
+ }
431
+ function formatHeyReachTrigger(event) {
432
+ const lines = [`HeyReach Event: ${event.eventType}`, `Event ID: ${event.eventId}`, `Created At: ${event.createdAt}`];
433
+ const leadName = heyReachLeadFullName(event);
434
+ if (leadName)
435
+ lines.push(`Lead: ${leadName}`);
436
+ if (event.lead?.profile_url)
437
+ lines.push(`LinkedIn URL: ${event.lead.profile_url}`);
438
+ const company = event.lead?.company_name;
439
+ if (company)
440
+ lines.push(`Company: ${company}`);
441
+ if (event.lead?.position)
442
+ lines.push(`Position: ${event.lead.position}`);
443
+ if (event.campaign)
444
+ lines.push(`Campaign: ${event.campaign.name || event.campaign.id || "unknown"}`);
445
+ if (event.linkedInAccount) {
446
+ const acc = event.linkedInAccount;
447
+ const accountName = [acc.first_name, acc.last_name].filter(Boolean).join(" ").trim() || acc.full_name?.trim();
448
+ if (accountName)
449
+ lines.push(`LinkedIn Account: ${accountName}`);
450
+ }
451
+ if ("messageBody" in event && event.messageBody)
452
+ lines.push(`Message:\n${event.messageBody}`);
453
+ if ("postUrl" in event && event.postUrl)
454
+ lines.push(`Post URL: ${event.postUrl}`);
455
+ if ("tags" in event && event.tags?.length)
456
+ lines.push(`Tags: ${event.tags.join(", ")}`);
457
+ lines.push(`\nFull Payload:\n${JSON.stringify(event.rawPayload, null, 2)}`);
458
+ return lines.join("\n");
459
+ }
460
+ function humanizeHeyReachEventType(eventType) {
461
+ return eventType
462
+ .split("_")
463
+ .filter(Boolean)
464
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
465
+ .join(" ");
466
+ }
467
+ function formatHeyReachDisplay(event) {
468
+ const subtitle = humanizeHeyReachEventType(event.eventType);
469
+ const leadName = heyReachLeadFullName(event);
470
+ if (leadName) {
471
+ return { title: leadName, subtitle };
472
+ }
473
+ if (event.campaign?.name) {
474
+ return { title: event.campaign.name, subtitle };
475
+ }
476
+ return { title: "HeyReach event", subtitle };
477
+ }
416
478
  function formatCronTrigger(event) {
417
479
  if (event.isManualTrigger) {
418
480
  let message = `This is a manually triggered event for the channel input ${event.inputId}.`;