@vibesdotdev/integrations-slack 0.0.0-stage → 1.0.0-rc.3
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/LICENSE +126 -0
- package/README.md +26 -2
- package/dist/client/helper.d.ts +10 -0
- package/dist/client/helper.d.ts.map +1 -0
- package/dist/client/helper.js +11 -0
- package/dist/client/helper.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/runtime-client.d.ts +21 -0
- package/dist/client/runtime-client.d.ts.map +1 -0
- package/dist/client/runtime-client.js +69 -0
- package/dist/client/runtime-client.js.map +1 -0
- package/dist/config/slack.config.descriptor.d.ts +47 -0
- package/dist/config/slack.config.descriptor.d.ts.map +1 -0
- package/dist/config/slack.config.descriptor.js +54 -0
- package/dist/config/slack.config.descriptor.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations-slack.plugin.d.ts +3 -0
- package/dist/integrations-slack.plugin.d.ts.map +1 -0
- package/dist/integrations-slack.plugin.js +54 -0
- package/dist/integrations-slack.plugin.js.map +1 -0
- package/dist/schemas/config.d.ts +11 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +7 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/events.d.ts +87 -0
- package/dist/schemas/events.d.ts.map +1 -0
- package/dist/schemas/events.js +22 -0
- package/dist/schemas/events.js.map +1 -0
- package/dist/schemas/operations.d.ts +120 -0
- package/dist/schemas/operations.d.ts.map +1 -0
- package/dist/schemas/operations.js +52 -0
- package/dist/schemas/operations.js.map +1 -0
- package/dist/schemas/validation.d.ts +4 -0
- package/dist/schemas/validation.d.ts.map +1 -0
- package/dist/schemas/validation.js +11 -0
- package/dist/schemas/validation.js.map +1 -0
- package/dist/slack/index.d.ts +5 -0
- package/dist/slack/index.d.ts.map +1 -0
- package/dist/slack/index.js +4 -0
- package/dist/slack/index.js.map +1 -0
- package/dist/slack/slack-events.descriptors.d.ts +52 -0
- package/dist/slack/slack-events.descriptors.d.ts.map +1 -0
- package/dist/slack/slack-events.descriptors.js +45 -0
- package/dist/slack/slack-events.descriptors.js.map +1 -0
- package/dist/slack/slack-events.impls.d.ts +26 -0
- package/dist/slack/slack-events.impls.d.ts.map +1 -0
- package/dist/slack/slack-events.impls.js +80 -0
- package/dist/slack/slack-events.impls.js.map +1 -0
- package/dist/slack/slack-implementation.d.ts +14 -0
- package/dist/slack/slack-implementation.d.ts.map +1 -0
- package/dist/slack/slack-implementation.js +94 -0
- package/dist/slack/slack-implementation.js.map +1 -0
- package/dist/slack/slack-message-source.descriptor.d.ts +30 -0
- package/dist/slack/slack-message-source.descriptor.d.ts.map +1 -0
- package/dist/slack/slack-message-source.descriptor.js +35 -0
- package/dist/slack/slack-message-source.descriptor.js.map +1 -0
- package/dist/slack/slack-signature-verifier.descriptor.d.ts +19 -0
- package/dist/slack/slack-signature-verifier.descriptor.d.ts.map +1 -0
- package/dist/slack/slack-signature-verifier.descriptor.js +19 -0
- package/dist/slack/slack-signature-verifier.descriptor.js.map +1 -0
- package/dist/slack/slack-signature-verifier.impl.d.ts +16 -0
- package/dist/slack/slack-signature-verifier.impl.d.ts.map +1 -0
- package/dist/slack/slack-signature-verifier.impl.js +23 -0
- package/dist/slack/slack-signature-verifier.impl.js.map +1 -0
- package/dist/slack/slack-signature.d.ts +17 -0
- package/dist/slack/slack-signature.d.ts.map +1 -0
- package/dist/slack/slack-signature.js +36 -0
- package/dist/slack/slack-signature.js.map +1 -0
- package/dist/slack/slack.descriptor.d.ts +69 -0
- package/dist/slack/slack.descriptor.d.ts.map +1 -0
- package/dist/slack/slack.descriptor.js +58 -0
- package/dist/slack/slack.descriptor.js.map +1 -0
- package/package.json +131 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const SlackEventSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
4
|
+
message: "message";
|
|
5
|
+
app_mention: "app_mention";
|
|
6
|
+
reaction_added: "reaction_added";
|
|
7
|
+
}>>;
|
|
8
|
+
team: z.ZodDefault<z.ZodString>;
|
|
9
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
10
|
+
channel_name: z.ZodDefault<z.ZodString>;
|
|
11
|
+
user: z.ZodDefault<z.ZodString>;
|
|
12
|
+
user_name: z.ZodDefault<z.ZodString>;
|
|
13
|
+
text: z.ZodDefault<z.ZodString>;
|
|
14
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
15
|
+
thread_ts: z.ZodDefault<z.ZodString>;
|
|
16
|
+
bot_id: z.ZodDefault<z.ZodString>;
|
|
17
|
+
reaction: z.ZodDefault<z.ZodString>;
|
|
18
|
+
item: z.ZodDefault<z.ZodObject<{
|
|
19
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
20
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const SlackEventInputSchema: z.ZodObject<{
|
|
24
|
+
team: z.ZodDefault<z.ZodString>;
|
|
25
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
26
|
+
channel_name: z.ZodDefault<z.ZodString>;
|
|
27
|
+
user: z.ZodDefault<z.ZodString>;
|
|
28
|
+
user_name: z.ZodDefault<z.ZodString>;
|
|
29
|
+
text: z.ZodDefault<z.ZodString>;
|
|
30
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
31
|
+
thread_ts: z.ZodDefault<z.ZodString>;
|
|
32
|
+
bot_id: z.ZodDefault<z.ZodString>;
|
|
33
|
+
reaction: z.ZodDefault<z.ZodString>;
|
|
34
|
+
item: z.ZodDefault<z.ZodObject<{
|
|
35
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
36
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
message: "message";
|
|
40
|
+
app_mention: "app_mention";
|
|
41
|
+
event_callback: "event_callback";
|
|
42
|
+
reaction_added: "reaction_added";
|
|
43
|
+
}>>;
|
|
44
|
+
event_id: z.ZodOptional<z.ZodString>;
|
|
45
|
+
team_id: z.ZodOptional<z.ZodString>;
|
|
46
|
+
event: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
message: "message";
|
|
49
|
+
app_mention: "app_mention";
|
|
50
|
+
reaction_added: "reaction_added";
|
|
51
|
+
}>>;
|
|
52
|
+
team: z.ZodDefault<z.ZodString>;
|
|
53
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
54
|
+
channel_name: z.ZodDefault<z.ZodString>;
|
|
55
|
+
user: z.ZodDefault<z.ZodString>;
|
|
56
|
+
user_name: z.ZodDefault<z.ZodString>;
|
|
57
|
+
text: z.ZodDefault<z.ZodString>;
|
|
58
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
59
|
+
thread_ts: z.ZodDefault<z.ZodString>;
|
|
60
|
+
bot_id: z.ZodDefault<z.ZodString>;
|
|
61
|
+
reaction: z.ZodDefault<z.ZodString>;
|
|
62
|
+
item: z.ZodDefault<z.ZodObject<{
|
|
63
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
64
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export declare const SlackNormalizedMessageSchema: z.ZodObject<{
|
|
69
|
+
team_id: z.ZodDefault<z.ZodString>;
|
|
70
|
+
channel_id: z.ZodDefault<z.ZodString>;
|
|
71
|
+
channel_name: z.ZodDefault<z.ZodString>;
|
|
72
|
+
user_id: z.ZodDefault<z.ZodString>;
|
|
73
|
+
user_name: z.ZodDefault<z.ZodString>;
|
|
74
|
+
text: z.ZodDefault<z.ZodString>;
|
|
75
|
+
ts: z.ZodDefault<z.ZodString>;
|
|
76
|
+
thread_ts: z.ZodDefault<z.ZodString>;
|
|
77
|
+
bot_id: z.ZodDefault<z.ZodString>;
|
|
78
|
+
is_bot: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare const SlackNormalizedReactionSchema: z.ZodObject<{
|
|
81
|
+
team_id: z.ZodDefault<z.ZodString>;
|
|
82
|
+
channel_id: z.ZodDefault<z.ZodString>;
|
|
83
|
+
user_id: z.ZodDefault<z.ZodString>;
|
|
84
|
+
reaction: z.ZodDefault<z.ZodString>;
|
|
85
|
+
message_ts: z.ZodDefault<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/schemas/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;iBAK3B,CAAC;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK8C,CAAC;AACjF,eAAO,MAAM,4BAA4B;;;;;;;;;;;iBAGvC,CAAC;AACH,eAAO,MAAM,6BAA6B;;;;;;iBAExC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
const text = z.string().default('');
|
|
3
|
+
export const SlackEventSchema = z.object({
|
|
4
|
+
type: z.enum(['message', 'app_mention', 'reaction_added']).optional(),
|
|
5
|
+
team: text, channel: text, channel_name: text, user: text, user_name: text,
|
|
6
|
+
text, ts: text, thread_ts: text, bot_id: text, reaction: text,
|
|
7
|
+
item: z.object({ channel: text, ts: text }).default({ channel: '', ts: '' })
|
|
8
|
+
});
|
|
9
|
+
export const SlackEventInputSchema = SlackEventSchema.extend({
|
|
10
|
+
type: z.enum(['event_callback', 'message', 'app_mention', 'reaction_added']).optional(),
|
|
11
|
+
event_id: z.string().trim().min(1).optional(),
|
|
12
|
+
team_id: z.string().optional(),
|
|
13
|
+
event: SlackEventSchema.optional()
|
|
14
|
+
}).refine(value => value.type !== 'event_callback' || value.event !== undefined);
|
|
15
|
+
export const SlackNormalizedMessageSchema = z.object({
|
|
16
|
+
team_id: text, channel_id: text, channel_name: text, user_id: text, user_name: text,
|
|
17
|
+
text, ts: text, thread_ts: text, bot_id: text, is_bot: z.boolean().default(false)
|
|
18
|
+
});
|
|
19
|
+
export const SlackNormalizedReactionSchema = z.object({
|
|
20
|
+
team_id: text, channel_id: text, user_id: text, reaction: text, message_ts: text
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/schemas/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI;IAC1E,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,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,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI;CAChF,CAAC,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const SlackSendMessageArgsSchema: z.ZodObject<{
|
|
3
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
text: z.ZodString;
|
|
5
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
6
|
+
blocks: z.ZodOptional<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
|
|
7
|
+
metadata: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type SlackSendMessageArgs = z.infer<typeof SlackSendMessageArgsSchema>;
|
|
10
|
+
export declare const SlackSendMessageResultSchema: z.ZodObject<{
|
|
11
|
+
channelId: z.ZodString;
|
|
12
|
+
ts: z.ZodString;
|
|
13
|
+
providerId: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type SlackSendMessageResult = z.infer<typeof SlackSendMessageResultSchema>;
|
|
16
|
+
export declare const SlackCheckResultSchema: z.ZodObject<{
|
|
17
|
+
ok: z.ZodBoolean;
|
|
18
|
+
providerId: z.ZodString;
|
|
19
|
+
botId: z.ZodOptional<z.ZodString>;
|
|
20
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
error: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type SlackCheckResult = z.infer<typeof SlackCheckResultSchema>;
|
|
25
|
+
export declare const SlackCheckArgsSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strict>>>;
|
|
26
|
+
export declare const SlackOperationInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
27
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
text: z.ZodString;
|
|
29
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
30
|
+
blocks: z.ZodOptional<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
|
|
31
|
+
metadata: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
|
|
32
|
+
}, z.core.$strip>, z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strict>>>]>;
|
|
33
|
+
export type SlackOperationInput = z.input<typeof SlackOperationInputSchema>;
|
|
34
|
+
export declare const SlackOperationIdSchema: z.ZodEnum<{
|
|
35
|
+
"send-message": "send-message";
|
|
36
|
+
check: "check";
|
|
37
|
+
}>;
|
|
38
|
+
export declare const SlackOperationOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
39
|
+
channelId: z.ZodString;
|
|
40
|
+
ts: z.ZodString;
|
|
41
|
+
providerId: z.ZodString;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
ok: z.ZodBoolean;
|
|
44
|
+
providerId: z.ZodString;
|
|
45
|
+
botId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
47
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
error: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>]>;
|
|
50
|
+
export type SlackOperationOutput = z.infer<typeof SlackOperationOutputSchema>;
|
|
51
|
+
export declare const SlackClientContextSchema: z.ZodObject<{
|
|
52
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
56
|
+
connectionId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type SlackClientContext = z.infer<typeof SlackClientContextSchema>;
|
|
59
|
+
export declare const SlackIdentitySchema: z.ZodObject<{
|
|
60
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
63
|
+
connectionId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
userId: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const SlackSelectedIdentitySchema: z.ZodObject<{
|
|
67
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
69
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
70
|
+
userId: z.ZodString;
|
|
71
|
+
connectionId: z.ZodString;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export type SlackSelectedIdentity = z.infer<typeof SlackSelectedIdentitySchema>;
|
|
74
|
+
export declare const SlackOptionalOrgSchema: z.ZodOptional<z.ZodString>;
|
|
75
|
+
export declare const SlackConfigurationSchema: z.ZodObject<{
|
|
76
|
+
config: z.ZodObject<{
|
|
77
|
+
defaultChannelId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
79
|
+
socketMode: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
credentials: z.ZodObject<{
|
|
82
|
+
botToken: z.ZodOptional<z.ZodString>;
|
|
83
|
+
signingSecret: z.ZodOptional<z.ZodString>;
|
|
84
|
+
appToken: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare const SlackApiResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
88
|
+
ok: z.ZodLiteral<false>;
|
|
89
|
+
error: z.ZodString;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
ok: z.ZodLiteral<true>;
|
|
92
|
+
ts: z.ZodOptional<z.ZodString>;
|
|
93
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
94
|
+
bot_id: z.ZodOptional<z.ZodString>;
|
|
95
|
+
team_id: z.ZodOptional<z.ZodString>;
|
|
96
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>], "ok">;
|
|
98
|
+
export declare const SlackPostResponseSchema: z.ZodObject<{
|
|
99
|
+
ok: z.ZodLiteral<true>;
|
|
100
|
+
ts: z.ZodString;
|
|
101
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export type SlackApiResponse = z.infer<typeof SlackApiResponseSchema>;
|
|
104
|
+
export declare const SlackPostBodySchema: z.ZodObject<{
|
|
105
|
+
channel: z.ZodString;
|
|
106
|
+
text: z.ZodString;
|
|
107
|
+
thread_ts: z.ZodOptional<z.ZodString>;
|
|
108
|
+
blocks: z.ZodOptional<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
|
|
109
|
+
metadata: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type SlackPostBody = z.infer<typeof SlackPostBodySchema>;
|
|
112
|
+
export declare const SlackHttpBodySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
113
|
+
channel: z.ZodString;
|
|
114
|
+
text: z.ZodString;
|
|
115
|
+
thread_ts: z.ZodOptional<z.ZodString>;
|
|
116
|
+
blocks: z.ZodOptional<z.ZodArray<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>>;
|
|
117
|
+
metadata: z.ZodOptional<z.ZodType<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue, z.core.$ZodTypeInternals<import("@vibesdotdev/kernel/bootstrap").JsonValue, import("@vibesdotdev/kernel/bootstrap").JsonValue>>>;
|
|
118
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strict>]>;
|
|
119
|
+
export type SlackHttpBody = z.infer<typeof SlackHttpBodySchema>;
|
|
120
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/schemas/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,0BAA0B;;;;;;iBAMrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;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AC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,eAAO,MAAM,mBAAmB;;;;;;oDAAqD,CAAC;AACtF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
|
|
3
|
+
export const SlackSendMessageArgsSchema = z.object({
|
|
4
|
+
channelId: z.string().trim().min(1).optional(),
|
|
5
|
+
text: z.string().refine(value => value.trim().length > 0),
|
|
6
|
+
threadTs: z.string().min(1).optional(),
|
|
7
|
+
blocks: z.array(JsonValueSchema).optional(),
|
|
8
|
+
metadata: JsonValueSchema.optional()
|
|
9
|
+
});
|
|
10
|
+
export const SlackSendMessageResultSchema = z.object({
|
|
11
|
+
channelId: z.string().min(1), ts: z.string().min(1), providerId: z.string().min(1)
|
|
12
|
+
});
|
|
13
|
+
export const SlackCheckResultSchema = z.object({
|
|
14
|
+
ok: z.boolean(), providerId: z.string().min(1), botId: z.string().optional(),
|
|
15
|
+
teamId: z.string().optional(), userId: z.string().optional(), error: z.string().optional()
|
|
16
|
+
}).refine(value => value.ok || Boolean(value.error));
|
|
17
|
+
export const SlackCheckArgsSchema = z.strictObject({}).nullish();
|
|
18
|
+
export const SlackOperationInputSchema = z.union([SlackSendMessageArgsSchema, SlackCheckArgsSchema]);
|
|
19
|
+
export const SlackOperationIdSchema = z.enum(['send-message', 'check']);
|
|
20
|
+
export const SlackOperationOutputSchema = z.union([SlackSendMessageResultSchema, SlackCheckResultSchema]);
|
|
21
|
+
export const SlackClientContextSchema = z.object({
|
|
22
|
+
userId: z.string().trim().min(1).optional(),
|
|
23
|
+
orgId: z.string().trim().min(1).optional(),
|
|
24
|
+
organizationId: z.string().trim().min(1).optional(),
|
|
25
|
+
jwt: z.string().min(1).optional(),
|
|
26
|
+
connectionId: z.string().trim().min(1).optional()
|
|
27
|
+
});
|
|
28
|
+
export const SlackIdentitySchema = SlackClientContextSchema.extend({ userId: z.string().trim().min(1) });
|
|
29
|
+
export const SlackSelectedIdentitySchema = SlackIdentitySchema.extend({ connectionId: z.string().trim().min(1) });
|
|
30
|
+
export const SlackOptionalOrgSchema = z.string().trim().min(1).optional();
|
|
31
|
+
export const SlackConfigurationSchema = z.object({
|
|
32
|
+
config: z.object({
|
|
33
|
+
defaultChannelId: z.string().optional(), teamId: z.string().optional(), socketMode: z.boolean().optional()
|
|
34
|
+
}),
|
|
35
|
+
credentials: z.object({ botToken: z.string().min(1).optional(), signingSecret: z.string().optional(), appToken: z.string().optional() })
|
|
36
|
+
});
|
|
37
|
+
export const SlackApiResponseSchema = z.discriminatedUnion('ok', [
|
|
38
|
+
z.object({ ok: z.literal(false), error: z.string().min(1) }),
|
|
39
|
+
z.object({
|
|
40
|
+
ok: z.literal(true), ts: z.string().min(1).optional(), channel: z.string().min(1).optional(),
|
|
41
|
+
bot_id: z.string().optional(), team_id: z.string().optional(), user_id: z.string().optional()
|
|
42
|
+
})
|
|
43
|
+
]);
|
|
44
|
+
export const SlackPostResponseSchema = z.object({
|
|
45
|
+
ok: z.literal(true), ts: z.string().min(1), channel: z.string().min(1).optional()
|
|
46
|
+
});
|
|
47
|
+
export const SlackPostBodySchema = z.object({
|
|
48
|
+
channel: z.string().min(1), text: z.string(),
|
|
49
|
+
thread_ts: z.string().optional(), blocks: z.array(JsonValueSchema).optional(), metadata: JsonValueSchema.optional()
|
|
50
|
+
});
|
|
51
|
+
export const SlackHttpBodySchema = z.union([SlackPostBodySchema, z.strictObject({})]);
|
|
52
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/schemas/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAA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,QAAQ,EAAE;CACnH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/schemas/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,mBAAqC,GAAG,CAAC,CAMlI"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
3
|
+
export function parseSlack(schema, input, reason, code = 'INVALID_INPUT') {
|
|
4
|
+
const result = schema.safeParse(input);
|
|
5
|
+
if (result.success)
|
|
6
|
+
return result.data;
|
|
7
|
+
throw new CapabilityError('Slack boundary validation failed.', code, {
|
|
8
|
+
reason, details: { issues: result.error.issues.map(issue => ({ code: issue.code, path: issue.path.map(String) })) }
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/schemas/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,UAAU,CAAI,MAAoB,EAAE,KAAc,EAAE,MAAc,EAAE,OAA4B,eAAe;IAC9H,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IACvC,MAAM,IAAI,eAAe,CAAC,mCAAmC,EAAE,IAAI,EAAE;QACpE,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;KACnH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as slackDescriptor } from './slack.descriptor.ts';
|
|
2
|
+
export { default as slackMessageSourceDescriptor } from './slack-message-source.descriptor.ts';
|
|
3
|
+
export { SlackIntegrationProvider } from './slack-implementation.ts';
|
|
4
|
+
export type { SlackCheckResult, SlackSendMessageArgs, SlackSendMessageResult } from './slack-implementation.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,YAAY,EACX,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/slack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tools/webhook-event-definition` descriptors for Slack Events API webhooks.
|
|
3
|
+
*
|
|
4
|
+
* Three events: message, app_mention, reaction_added. The router resolves
|
|
5
|
+
* each by filtering on `source === 'slack'` + `event_type === <type>` and
|
|
6
|
+
* calls the bound impl's `parse`, `buildTask`, and (where applicable)
|
|
7
|
+
* `buildOutbox`.
|
|
8
|
+
*
|
|
9
|
+
* `url_verification` is handled as a special case in the router itself —
|
|
10
|
+
* it's not an Events API event in the same sense, just a one-shot handshake.
|
|
11
|
+
*/
|
|
12
|
+
export declare const slackMessageDescriptor: {
|
|
13
|
+
id: string;
|
|
14
|
+
kind: "tools/webhook-event-definition";
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
source: string;
|
|
18
|
+
event_type: string;
|
|
19
|
+
dispatchMode?: "none" | "hook" | undefined;
|
|
20
|
+
tags?: string[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const slackAppMentionDescriptor: {
|
|
23
|
+
id: string;
|
|
24
|
+
kind: "tools/webhook-event-definition";
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
source: string;
|
|
28
|
+
event_type: string;
|
|
29
|
+
dispatchMode?: "none" | "hook" | undefined;
|
|
30
|
+
tags?: string[] | undefined;
|
|
31
|
+
};
|
|
32
|
+
export declare const slackReactionAddedDescriptor: {
|
|
33
|
+
id: string;
|
|
34
|
+
kind: "tools/webhook-event-definition";
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
source: string;
|
|
38
|
+
event_type: string;
|
|
39
|
+
dispatchMode?: "none" | "hook" | undefined;
|
|
40
|
+
tags?: string[] | undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare const slackWebhookEventDescriptors: {
|
|
43
|
+
id: string;
|
|
44
|
+
kind: "tools/webhook-event-definition";
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
source: string;
|
|
48
|
+
event_type: string;
|
|
49
|
+
dispatchMode?: "none" | "hook" | undefined;
|
|
50
|
+
tags?: string[] | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
//# sourceMappingURL=slack-events.descriptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-events.descriptors.d.ts","sourceRoot":"","sources":["../../src/slack/slack-events.descriptors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,sBAAsB;;;;;;;;;CAQjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;CAQpC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;CAQvC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;GAIxC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tools/webhook-event-definition` descriptors for Slack Events API webhooks.
|
|
3
|
+
*
|
|
4
|
+
* Three events: message, app_mention, reaction_added. The router resolves
|
|
5
|
+
* each by filtering on `source === 'slack'` + `event_type === <type>` and
|
|
6
|
+
* calls the bound impl's `parse`, `buildTask`, and (where applicable)
|
|
7
|
+
* `buildOutbox`.
|
|
8
|
+
*
|
|
9
|
+
* `url_verification` is handled as a special case in the router itself —
|
|
10
|
+
* it's not an Events API event in the same sense, just a one-shot handshake.
|
|
11
|
+
*/
|
|
12
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
13
|
+
export const slackMessageDescriptor = createRuntimeAsset({
|
|
14
|
+
kind: 'tools/webhook-event-definition',
|
|
15
|
+
id: 'webhook-event.slack.message',
|
|
16
|
+
name: 'Slack Message',
|
|
17
|
+
description: 'Message posted in a channel the bot is a member of.',
|
|
18
|
+
source: 'slack',
|
|
19
|
+
event_type: 'message',
|
|
20
|
+
tags: ['slack', 'message']
|
|
21
|
+
});
|
|
22
|
+
export const slackAppMentionDescriptor = createRuntimeAsset({
|
|
23
|
+
kind: 'tools/webhook-event-definition',
|
|
24
|
+
id: 'webhook-event.slack.app_mention',
|
|
25
|
+
name: 'Slack App Mention',
|
|
26
|
+
description: 'Bot was @-mentioned.',
|
|
27
|
+
source: 'slack',
|
|
28
|
+
event_type: 'app_mention',
|
|
29
|
+
tags: ['slack', 'mention']
|
|
30
|
+
});
|
|
31
|
+
export const slackReactionAddedDescriptor = createRuntimeAsset({
|
|
32
|
+
kind: 'tools/webhook-event-definition',
|
|
33
|
+
id: 'webhook-event.slack.reaction_added',
|
|
34
|
+
name: 'Slack Reaction Added',
|
|
35
|
+
description: 'Reaction added to a message.',
|
|
36
|
+
source: 'slack',
|
|
37
|
+
event_type: 'reaction_added',
|
|
38
|
+
tags: ['slack', 'reaction']
|
|
39
|
+
});
|
|
40
|
+
export const slackWebhookEventDescriptors = [
|
|
41
|
+
slackMessageDescriptor,
|
|
42
|
+
slackAppMentionDescriptor,
|
|
43
|
+
slackReactionAddedDescriptor
|
|
44
|
+
];
|
|
45
|
+
//# sourceMappingURL=slack-events.descriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-events.descriptors.js","sourceRoot":"","sources":["../../src/slack/slack-events.descriptors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAmC;IAC1F,IAAI,EAAE,gCAAgC;IACtC,EAAE,EAAE,6BAA6B;IACjC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAmC;IAC7F,IAAI,EAAE,gCAAgC;IACtC,EAAE,EAAE,iCAAiC;IACrC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,sBAAsB;IACnC,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,CAAmC;IAChG,IAAI,EAAE,gCAAgC;IACtC,EAAE,EAAE,oCAAoC;IACxC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,8BAA8B;IAC3C,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,gBAAgB;IAC5B,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,sBAAsB;IACtB,yBAAyB;IACzB,4BAA4B;CAC5B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type KindContext, type RuntimeDescriptor } from '@vibesdotdev/kernel';
|
|
2
|
+
import type { JsonObject } from '@vibesdotdev/kernel/schemas/json';
|
|
3
|
+
import { type WebhookEventDefinitionImplementation, type WebhookTaskSpec, type WebhookOutboxSpec } from '@vibesdotdev/tools/webhooks/schemas';
|
|
4
|
+
declare class SlackEvent implements WebhookEventDefinitionImplementation {
|
|
5
|
+
private readonly context;
|
|
6
|
+
readonly descriptor: {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: "tools/webhook-event-definition";
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
source: string;
|
|
12
|
+
event_type: string;
|
|
13
|
+
dispatchMode?: "none" | "hook" | undefined;
|
|
14
|
+
tags?: string[] | undefined;
|
|
15
|
+
};
|
|
16
|
+
constructor(descriptor: RuntimeDescriptor, context: KindContext);
|
|
17
|
+
idempotencyKey(_parsed: JsonObject, raw: JsonObject): string | null;
|
|
18
|
+
parse(raw: JsonObject): JsonObject;
|
|
19
|
+
buildTask(parsed: JsonObject): WebhookTaskSpec;
|
|
20
|
+
buildOutbox(parsed: JsonObject): WebhookOutboxSpec[];
|
|
21
|
+
}
|
|
22
|
+
export declare const slackMessageImpl: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<typeof SlackEvent>;
|
|
23
|
+
export declare const slackAppMentionImpl: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<typeof SlackEvent>;
|
|
24
|
+
export declare const slackReactionAddedImpl: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<typeof SlackEvent>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=slack-events.impls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-events.impls.d.ts","sourceRoot":"","sources":["../../src/slack/slack-events.impls.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EACkC,KAAK,oCAAoC,EACjF,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAC5C,MAAM,qCAAqC,CAAC;AAK7C,cAAM,UAAW,YAAW,oCAAoC;IAEpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IADnE,QAAQ,CAAC,UAAU;;;;;;;;;MAAC;gBACR,UAAU,EAAE,iBAAiB,EAAmB,OAAO,EAAE,WAAW;IAIhF,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAKnE,KAAK,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAiBlC,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe;IA0B9C,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,iBAAiB,EAAE;CASpD;AAED,eAAO,MAAM,gBAAgB,+EAE3B,CAAC;AACH,eAAO,MAAM,mBAAmB,+EAE9B,CAAC;AACH,eAAO,MAAM,sBAAsB,+EAEjC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createRuntimeImplementation } from '@vibesdotdev/kernel';
|
|
2
|
+
import { AgentEventSourceDescriptorSchema } from '@vibesdotdev/tools/agents/schemas/event-source';
|
|
3
|
+
import { WebhookEventDefinitionDescriptorSchema } from '@vibesdotdev/tools/webhooks/schemas';
|
|
4
|
+
import { SlackEventInputSchema, SlackNormalizedMessageSchema, SlackNormalizedReactionSchema } from "../schemas/events.js";
|
|
5
|
+
import { parseSlack } from "../schemas/validation.js";
|
|
6
|
+
import { slackAppMentionDescriptor, slackMessageDescriptor, slackReactionAddedDescriptor } from "./slack-events.descriptors.js";
|
|
7
|
+
class SlackEvent {
|
|
8
|
+
context;
|
|
9
|
+
descriptor;
|
|
10
|
+
constructor(descriptor, context) {
|
|
11
|
+
this.context = context;
|
|
12
|
+
this.descriptor = WebhookEventDefinitionDescriptorSchema.parse(descriptor);
|
|
13
|
+
}
|
|
14
|
+
idempotencyKey(_parsed, raw) {
|
|
15
|
+
const input = parseSlack(SlackEventInputSchema, raw, 'slack-event-invalid');
|
|
16
|
+
return input.event_id ? `slack:${encodeURIComponent(input.event_id)}` : null;
|
|
17
|
+
}
|
|
18
|
+
parse(raw) {
|
|
19
|
+
const input = parseSlack(SlackEventInputSchema, raw, 'slack-event-invalid');
|
|
20
|
+
const event = input.event ?? input;
|
|
21
|
+
const teamId = input.team_id ?? event.team;
|
|
22
|
+
if (this.descriptor.event_type === 'reaction_added') {
|
|
23
|
+
return SlackNormalizedReactionSchema.parse({
|
|
24
|
+
team_id: teamId, channel_id: event.item.channel,
|
|
25
|
+
user_id: event.user, reaction: event.reaction, message_ts: event.item.ts
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return SlackNormalizedMessageSchema.parse({
|
|
29
|
+
team_id: teamId, channel_id: event.channel, channel_name: event.channel_name,
|
|
30
|
+
user_id: event.user, user_name: event.user_name, text: event.text, ts: event.ts,
|
|
31
|
+
thread_ts: event.thread_ts, bot_id: event.bot_id, is_bot: Boolean(event.bot_id)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
buildTask(parsed) {
|
|
35
|
+
// Subscriptions are host composition data on the owning event-source contract.
|
|
36
|
+
const source = this.context.runtime.query('agent/event-source').withId('message.slack').descriptors()[0];
|
|
37
|
+
const routing = AgentEventSourceDescriptorSchema.parse(source);
|
|
38
|
+
const assignedTo = routing.agentIds[0] ?? '';
|
|
39
|
+
if (this.descriptor.event_type === 'reaction_added') {
|
|
40
|
+
const event = parseSlack(SlackNormalizedReactionSchema, parsed, 'slack-event-invalid');
|
|
41
|
+
return {
|
|
42
|
+
title: `Reaction ${event.reaction}`, lane: 'webhook',
|
|
43
|
+
description: `@${event.user_id} reacted with :${event.reaction}:`,
|
|
44
|
+
priority: 'low', assigned_to: assignedTo
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const event = parseSlack(SlackNormalizedMessageSchema, parsed, 'slack-event-invalid');
|
|
48
|
+
if (this.descriptor.event_type === 'app_mention')
|
|
49
|
+
return {
|
|
50
|
+
title: `Mention by @${event.user_name}`, lane: 'webhook',
|
|
51
|
+
description: `@${event.user_name}: ${event.text.slice(0, 200)}`,
|
|
52
|
+
priority: 'high', assigned_to: assignedTo
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
title: event.is_bot ? `Bot message in #${event.channel_name}` : `Message from @${event.user_name}`,
|
|
56
|
+
lane: 'webhook', description: `${event.is_bot ? 'Bot' : '@' + event.user_name}: ${event.text.slice(0, 200)}`,
|
|
57
|
+
priority: 'medium', assigned_to: assignedTo
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
buildOutbox(parsed) {
|
|
61
|
+
if (this.descriptor.event_type !== 'app_mention')
|
|
62
|
+
return [];
|
|
63
|
+
const event = parseSlack(SlackNormalizedMessageSchema, parsed, 'slack-event-invalid');
|
|
64
|
+
return [{
|
|
65
|
+
id: crypto.randomUUID(), source: 'slack', webhook_request_id: '', action: 'create_task',
|
|
66
|
+
payload: { channel_id: event.channel_id, user_id: event.user_id, text: event.text, ts: event.ts },
|
|
67
|
+
status: 'pending', created_at: new Date().toISOString()
|
|
68
|
+
}];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export const slackMessageImpl = createRuntimeImplementation({
|
|
72
|
+
kind: 'tools/webhook-event-definition', id: slackMessageDescriptor.id, implementation: SlackEvent
|
|
73
|
+
});
|
|
74
|
+
export const slackAppMentionImpl = createRuntimeImplementation({
|
|
75
|
+
kind: 'tools/webhook-event-definition', id: slackAppMentionDescriptor.id, implementation: SlackEvent
|
|
76
|
+
});
|
|
77
|
+
export const slackReactionAddedImpl = createRuntimeImplementation({
|
|
78
|
+
kind: 'tools/webhook-event-definition', id: slackReactionAddedDescriptor.id, implementation: SlackEvent
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=slack-events.impls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-events.impls.js","sourceRoot":"","sources":["../../src/slack/slack-events.impls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAA4C,MAAM,qBAAqB,CAAC;AAE5G,OAAO,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EACN,sCAAsC,EAEtC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC1H,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAEhI,MA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;IAC3D,IAAI,EAAE,gCAAgC,EAAE,EAAE,EAAE,sBAAsB,CAAC,EAAE,EAAE,cAAc,EAAE,UAAU;CACjG,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;IAC9D,IAAI,EAAE,gCAAgC,EAAE,EAAE,EAAE,yBAAyB,CAAC,EAAE,EAAE,cAAc,EAAE,UAAU;CACpG,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;IACjE,IAAI,EAAE,gCAAgC,EAAE,EAAE,EAAE,4BAA4B,CAAC,EAAE,EAAE,cAAc,EAAE,UAAU;CACvG,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseIntegrationProvider } from '@vibesdotdev/integrations/kinds/integration';
|
|
2
|
+
import type { IntegrationConfigValue, IntegrationConnectionSelector, IntegrationOperationResult } from '@vibesdotdev/integrations/schemas/integration-descriptor';
|
|
3
|
+
import { type SlackSendMessageResult, type SlackCheckResult } from '../schemas/operations.ts';
|
|
4
|
+
export type { SlackSendMessageArgs, SlackSendMessageResult, SlackCheckResult } from '../schemas/operations.ts';
|
|
5
|
+
export declare class SlackIntegrationProvider extends BaseIntegrationProvider {
|
|
6
|
+
invokeOperation<T = unknown>(opId: string, args?: IntegrationConfigValue): Promise<IntegrationOperationResult<T>>;
|
|
7
|
+
invokeOperationForConnection<T = unknown>(selector: Readonly<IntegrationConnectionSelector>, opId: string, args?: IntegrationConfigValue): Promise<IntegrationOperationResult<T>>;
|
|
8
|
+
private dispatch;
|
|
9
|
+
private configuration;
|
|
10
|
+
sendMessage(args: IntegrationConfigValue | undefined, selector?: Readonly<IntegrationConnectionSelector>): Promise<SlackSendMessageResult>;
|
|
11
|
+
check(selector?: Readonly<IntegrationConnectionSelector>): Promise<SlackCheckResult>;
|
|
12
|
+
private slackFetch;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=slack-implementation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-implementation.d.ts","sourceRoot":"","sources":["../../src/slack/slack-implementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAGlK,OAAO,EAGqC,KAAK,sBAAsB,EACtE,KAAK,gBAAgB,EACrB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE/G,qBAAa,wBAAyB,SAAQ,uBAAuB;IAC3D,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAK1H,4BAA4B,CAAC,CAAC,GAAG,OAAO,EACvC,QAAQ,EAAE,QAAQ,CAAC,6BAA6B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAC5F,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;YAO3B,QAAQ;YAQR,aAAa;IAMrB,WAAW,CAAC,IAAI,EAAE,sBAAsB,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,6BAA6B,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAiB1I,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,6BAA6B,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAoB5E,UAAU;CA0BxB"}
|