vessels-sdk 0.8.0 → 0.9.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 +21 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +21 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -218,10 +218,21 @@ var WebhookVesselCreatedPayloadSchema = zod.z.object({
|
|
|
218
218
|
})
|
|
219
219
|
})
|
|
220
220
|
});
|
|
221
|
+
var WebhookMessageCancelledPayloadSchema = zod.z.object({
|
|
222
|
+
event: zod.z.literal("message.cancelled"),
|
|
223
|
+
vessel_id: zod.z.string(),
|
|
224
|
+
workspace_id: zod.z.string(),
|
|
225
|
+
timestamp: zod.z.string(),
|
|
226
|
+
data: zod.z.object({
|
|
227
|
+
message_id: zod.z.string(),
|
|
228
|
+
vessel: WebhookVesselSchema
|
|
229
|
+
})
|
|
230
|
+
});
|
|
221
231
|
var WebhookPayloadSchema = zod.z.discriminatedUnion("event", [
|
|
222
232
|
WebhookInteractionResponsePayloadSchema,
|
|
223
233
|
WebhookUserMessagePayloadSchema,
|
|
224
|
-
WebhookVesselCreatedPayloadSchema
|
|
234
|
+
WebhookVesselCreatedPayloadSchema,
|
|
235
|
+
WebhookMessageCancelledPayloadSchema
|
|
225
236
|
]);
|
|
226
237
|
|
|
227
238
|
// src/index.ts
|
|
@@ -547,6 +558,15 @@ var Vessels = class {
|
|
|
547
558
|
user: raw.data.user ?? null
|
|
548
559
|
};
|
|
549
560
|
}
|
|
561
|
+
if (raw.event === "message.cancelled") {
|
|
562
|
+
return {
|
|
563
|
+
id: raw.data.message_id,
|
|
564
|
+
type: "message.cancelled",
|
|
565
|
+
timestamp: raw.timestamp,
|
|
566
|
+
vessel,
|
|
567
|
+
messageId: raw.data.message_id
|
|
568
|
+
};
|
|
569
|
+
}
|
|
550
570
|
if (raw.event === "message.user") {
|
|
551
571
|
return {
|
|
552
572
|
id: raw.data.message_id,
|
package/dist/index.d.cts
CHANGED
|
@@ -116,6 +116,20 @@ interface VesselCreatedEvent {
|
|
|
116
116
|
content: string | null;
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Fired when a human taps "Stop" on an in-progress (working) agent message in
|
|
121
|
+
* the app. Vessels does NOT force-stop anything — you decide what to do (abort
|
|
122
|
+
* a task, stop polling, ignore it). Delivery is synchronous: the app tells the
|
|
123
|
+
* human whether your handler accepted it (return 2xx) so they know cancel is
|
|
124
|
+
* wired up. `messageId` is the working agent message the human wants stopped.
|
|
125
|
+
*/
|
|
126
|
+
interface MessageCancelledEvent {
|
|
127
|
+
id: string;
|
|
128
|
+
type: 'message.cancelled';
|
|
129
|
+
timestamp: string;
|
|
130
|
+
vessel: VesselContext;
|
|
131
|
+
messageId: string;
|
|
132
|
+
}
|
|
119
133
|
/** A message in a vessel, as returned by getMessages — the human-facing record. */
|
|
120
134
|
interface Message {
|
|
121
135
|
id: string;
|
|
@@ -207,7 +221,7 @@ declare class Vessels {
|
|
|
207
221
|
}): _vessels_types.ConfirmPreviewInteraction;
|
|
208
222
|
poll(options?: PollOptions): Promise<PollResponse>;
|
|
209
223
|
verifyWebhook(body: string, signature: string, webhookSecret: string): Promise<boolean>;
|
|
210
|
-
parseWebhookEvent(body: string, signature: string, webhookSecret: string): Promise<InteractionResponseEvent | UserMessageEvent | VesselCreatedEvent | null>;
|
|
224
|
+
parseWebhookEvent(body: string, signature: string, webhookSecret: string): Promise<InteractionResponseEvent | UserMessageEvent | VesselCreatedEvent | MessageCancelledEvent | null>;
|
|
211
225
|
}
|
|
212
226
|
|
|
213
|
-
export { AgentActivityTypes, type InteractionResponseEvent, type Message, type OriginMessage, type PollEvent, type PollOptions, type PollResponse, type PushManyResult, type PushResponse, type UserMessageEvent, type VesselContext, type VesselCreatedEvent, Vessels, VesselsAuthError, type VesselsConfig, VesselsConflictError, VesselsRateLimitError, VesselsValidationError };
|
|
227
|
+
export { AgentActivityTypes, type InteractionResponseEvent, type Message, type MessageCancelledEvent, type OriginMessage, type PollEvent, type PollOptions, type PollResponse, type PushManyResult, type PushResponse, type UserMessageEvent, type VesselContext, type VesselCreatedEvent, Vessels, VesselsAuthError, type VesselsConfig, VesselsConflictError, VesselsRateLimitError, VesselsValidationError };
|
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,20 @@ interface VesselCreatedEvent {
|
|
|
116
116
|
content: string | null;
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Fired when a human taps "Stop" on an in-progress (working) agent message in
|
|
121
|
+
* the app. Vessels does NOT force-stop anything — you decide what to do (abort
|
|
122
|
+
* a task, stop polling, ignore it). Delivery is synchronous: the app tells the
|
|
123
|
+
* human whether your handler accepted it (return 2xx) so they know cancel is
|
|
124
|
+
* wired up. `messageId` is the working agent message the human wants stopped.
|
|
125
|
+
*/
|
|
126
|
+
interface MessageCancelledEvent {
|
|
127
|
+
id: string;
|
|
128
|
+
type: 'message.cancelled';
|
|
129
|
+
timestamp: string;
|
|
130
|
+
vessel: VesselContext;
|
|
131
|
+
messageId: string;
|
|
132
|
+
}
|
|
119
133
|
/** A message in a vessel, as returned by getMessages — the human-facing record. */
|
|
120
134
|
interface Message {
|
|
121
135
|
id: string;
|
|
@@ -207,7 +221,7 @@ declare class Vessels {
|
|
|
207
221
|
}): _vessels_types.ConfirmPreviewInteraction;
|
|
208
222
|
poll(options?: PollOptions): Promise<PollResponse>;
|
|
209
223
|
verifyWebhook(body: string, signature: string, webhookSecret: string): Promise<boolean>;
|
|
210
|
-
parseWebhookEvent(body: string, signature: string, webhookSecret: string): Promise<InteractionResponseEvent | UserMessageEvent | VesselCreatedEvent | null>;
|
|
224
|
+
parseWebhookEvent(body: string, signature: string, webhookSecret: string): Promise<InteractionResponseEvent | UserMessageEvent | VesselCreatedEvent | MessageCancelledEvent | null>;
|
|
211
225
|
}
|
|
212
226
|
|
|
213
|
-
export { AgentActivityTypes, type InteractionResponseEvent, type Message, type OriginMessage, type PollEvent, type PollOptions, type PollResponse, type PushManyResult, type PushResponse, type UserMessageEvent, type VesselContext, type VesselCreatedEvent, Vessels, VesselsAuthError, type VesselsConfig, VesselsConflictError, VesselsRateLimitError, VesselsValidationError };
|
|
227
|
+
export { AgentActivityTypes, type InteractionResponseEvent, type Message, type MessageCancelledEvent, type OriginMessage, type PollEvent, type PollOptions, type PollResponse, type PushManyResult, type PushResponse, type UserMessageEvent, type VesselContext, type VesselCreatedEvent, Vessels, VesselsAuthError, type VesselsConfig, VesselsConflictError, VesselsRateLimitError, VesselsValidationError };
|
package/dist/index.js
CHANGED
|
@@ -216,10 +216,21 @@ var WebhookVesselCreatedPayloadSchema = z.object({
|
|
|
216
216
|
})
|
|
217
217
|
})
|
|
218
218
|
});
|
|
219
|
+
var WebhookMessageCancelledPayloadSchema = z.object({
|
|
220
|
+
event: z.literal("message.cancelled"),
|
|
221
|
+
vessel_id: z.string(),
|
|
222
|
+
workspace_id: z.string(),
|
|
223
|
+
timestamp: z.string(),
|
|
224
|
+
data: z.object({
|
|
225
|
+
message_id: z.string(),
|
|
226
|
+
vessel: WebhookVesselSchema
|
|
227
|
+
})
|
|
228
|
+
});
|
|
219
229
|
var WebhookPayloadSchema = z.discriminatedUnion("event", [
|
|
220
230
|
WebhookInteractionResponsePayloadSchema,
|
|
221
231
|
WebhookUserMessagePayloadSchema,
|
|
222
|
-
WebhookVesselCreatedPayloadSchema
|
|
232
|
+
WebhookVesselCreatedPayloadSchema,
|
|
233
|
+
WebhookMessageCancelledPayloadSchema
|
|
223
234
|
]);
|
|
224
235
|
|
|
225
236
|
// src/index.ts
|
|
@@ -545,6 +556,15 @@ var Vessels = class {
|
|
|
545
556
|
user: raw.data.user ?? null
|
|
546
557
|
};
|
|
547
558
|
}
|
|
559
|
+
if (raw.event === "message.cancelled") {
|
|
560
|
+
return {
|
|
561
|
+
id: raw.data.message_id,
|
|
562
|
+
type: "message.cancelled",
|
|
563
|
+
timestamp: raw.timestamp,
|
|
564
|
+
vessel,
|
|
565
|
+
messageId: raw.data.message_id
|
|
566
|
+
};
|
|
567
|
+
}
|
|
548
568
|
if (raw.event === "message.user") {
|
|
549
569
|
return {
|
|
550
570
|
id: raw.data.message_id,
|