vessels-sdk 0.13.0 → 0.14.0

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/index.cjs CHANGED
@@ -214,6 +214,11 @@ var WebhookInteractionResponsePayloadSchema = zod.z.object({
214
214
  vessel: WebhookVesselSchema
215
215
  })
216
216
  });
217
+ var SupersededInteractionSchema = zod.z.object({
218
+ message_id: zod.z.string(),
219
+ interaction_type: InteractionTypeSchema,
220
+ prompt: zod.z.string().nullable()
221
+ });
217
222
  var WebhookUserMessagePayloadSchema = zod.z.object({
218
223
  event: zod.z.literal("message.user"),
219
224
  vessel_id: zod.z.string(),
@@ -223,7 +228,8 @@ var WebhookUserMessagePayloadSchema = zod.z.object({
223
228
  message_id: zod.z.string(),
224
229
  content: zod.z.string(),
225
230
  vessel: WebhookVesselSchema,
226
- context: zod.z.array(WebhookContextMessageSchema)
231
+ context: zod.z.array(WebhookContextMessageSchema),
232
+ superseded_interaction: SupersededInteractionSchema.optional()
227
233
  })
228
234
  });
229
235
  var WebhookVesselCreatedPayloadSchema = zod.z.object({
@@ -669,7 +675,12 @@ var Vessels = class {
669
675
  timestamp: e.timestamp,
670
676
  vessel,
671
677
  message: { id: e.message?.id, content: e.message?.content ?? null },
672
- context: []
678
+ context: [],
679
+ supersededInteraction: e.superseded_interaction ? {
680
+ messageId: e.superseded_interaction.message_id,
681
+ interactionType: e.superseded_interaction.interaction_type,
682
+ prompt: e.superseded_interaction.prompt ?? null
683
+ } : null
673
684
  };
674
685
  });
675
686
  return { ok: true, events, hasMore: data.has_more ?? false };
@@ -770,7 +781,12 @@ var Vessels = class {
770
781
  source: m.source,
771
782
  content: m.content ?? null,
772
783
  createdAt: m.created_at
773
- }))
784
+ })),
785
+ supersededInteraction: raw.data.superseded_interaction ? {
786
+ messageId: raw.data.superseded_interaction.message_id,
787
+ interactionType: raw.data.superseded_interaction.interaction_type,
788
+ prompt: raw.data.superseded_interaction.prompt ?? null
789
+ } : null
774
790
  };
775
791
  }
776
792
  return null;
package/dist/index.d.cts CHANGED
@@ -178,6 +178,16 @@ interface UserMessageEvent {
178
178
  content: string | null;
179
179
  createdAt: string;
180
180
  }>;
181
+ /**
182
+ * Set when this message arrived while an agent interaction was still live — it
183
+ * expired that card. The "they ignored what I presented and said this instead"
184
+ * signal; null when the message didn't supersede anything.
185
+ */
186
+ supersededInteraction: {
187
+ messageId: string;
188
+ interactionType: _vessels_types.InteractionType;
189
+ prompt: string | null;
190
+ } | null;
181
191
  }
182
192
  /**
183
193
  * Fired when a human opens a new typed vessel from the app (user-initiated
package/dist/index.d.ts CHANGED
@@ -178,6 +178,16 @@ interface UserMessageEvent {
178
178
  content: string | null;
179
179
  createdAt: string;
180
180
  }>;
181
+ /**
182
+ * Set when this message arrived while an agent interaction was still live — it
183
+ * expired that card. The "they ignored what I presented and said this instead"
184
+ * signal; null when the message didn't supersede anything.
185
+ */
186
+ supersededInteraction: {
187
+ messageId: string;
188
+ interactionType: _vessels_types.InteractionType;
189
+ prompt: string | null;
190
+ } | null;
181
191
  }
182
192
  /**
183
193
  * Fired when a human opens a new typed vessel from the app (user-initiated
package/dist/index.js CHANGED
@@ -212,6 +212,11 @@ var WebhookInteractionResponsePayloadSchema = z.object({
212
212
  vessel: WebhookVesselSchema
213
213
  })
214
214
  });
215
+ var SupersededInteractionSchema = z.object({
216
+ message_id: z.string(),
217
+ interaction_type: InteractionTypeSchema,
218
+ prompt: z.string().nullable()
219
+ });
215
220
  var WebhookUserMessagePayloadSchema = z.object({
216
221
  event: z.literal("message.user"),
217
222
  vessel_id: z.string(),
@@ -221,7 +226,8 @@ var WebhookUserMessagePayloadSchema = z.object({
221
226
  message_id: z.string(),
222
227
  content: z.string(),
223
228
  vessel: WebhookVesselSchema,
224
- context: z.array(WebhookContextMessageSchema)
229
+ context: z.array(WebhookContextMessageSchema),
230
+ superseded_interaction: SupersededInteractionSchema.optional()
225
231
  })
226
232
  });
227
233
  var WebhookVesselCreatedPayloadSchema = z.object({
@@ -667,7 +673,12 @@ var Vessels = class {
667
673
  timestamp: e.timestamp,
668
674
  vessel,
669
675
  message: { id: e.message?.id, content: e.message?.content ?? null },
670
- context: []
676
+ context: [],
677
+ supersededInteraction: e.superseded_interaction ? {
678
+ messageId: e.superseded_interaction.message_id,
679
+ interactionType: e.superseded_interaction.interaction_type,
680
+ prompt: e.superseded_interaction.prompt ?? null
681
+ } : null
671
682
  };
672
683
  });
673
684
  return { ok: true, events, hasMore: data.has_more ?? false };
@@ -768,7 +779,12 @@ var Vessels = class {
768
779
  source: m.source,
769
780
  content: m.content ?? null,
770
781
  createdAt: m.created_at
771
- }))
782
+ })),
783
+ supersededInteraction: raw.data.superseded_interaction ? {
784
+ messageId: raw.data.superseded_interaction.message_id,
785
+ interactionType: raw.data.superseded_interaction.interaction_type,
786
+ prompt: raw.data.superseded_interaction.prompt ?? null
787
+ } : null
772
788
  };
773
789
  }
774
790
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vessels-sdk",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Let your agent reach you. Official Vessels SDK.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,7 +20,13 @@
20
20
  "build": "tsup",
21
21
  "dev": "tsup --watch"
22
22
  },
23
- "keywords": ["ai", "agents", "vessels", "llm", "notifications"],
23
+ "keywords": [
24
+ "ai",
25
+ "agents",
26
+ "vessels",
27
+ "llm",
28
+ "notifications"
29
+ ],
24
30
  "license": "MIT",
25
31
  "dependencies": {
26
32
  "zod": "^3.22"