@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,94 @@
|
|
|
1
|
+
import { BaseIntegrationProvider } from '@vibesdotdev/integrations/kinds/integration';
|
|
2
|
+
import { CapabilityError, valueFreeFailure, CaughtFailureSchema, settle } from '@vibesdotdev/kernel';
|
|
3
|
+
import { resolveSlackBaseUrl } from "../config/slack.config.descriptor.js";
|
|
4
|
+
import { SlackApiResponseSchema, SlackPostResponseSchema, SlackSendMessageArgsSchema, SlackConfigurationSchema, SlackOperationIdSchema, SlackCheckArgsSchema } from "../schemas/operations.js";
|
|
5
|
+
import { parseSlack } from "../schemas/validation.js";
|
|
6
|
+
export class SlackIntegrationProvider extends BaseIntegrationProvider {
|
|
7
|
+
async invokeOperation(opId, args) {
|
|
8
|
+
return this.dispatch(opId, args);
|
|
9
|
+
}
|
|
10
|
+
async invokeOperationForConnection(selector, opId, args) {
|
|
11
|
+
return this.dispatch(opId, args, selector);
|
|
12
|
+
}
|
|
13
|
+
async dispatch(opId, args, selector) {
|
|
14
|
+
const operation = parseSlack(SlackOperationIdSchema, opId, 'slack-operation-unsupported');
|
|
15
|
+
if (operation === 'send-message')
|
|
16
|
+
return { ok: true, data: await this.sendMessage(args, selector) };
|
|
17
|
+
parseSlack(SlackCheckArgsSchema, args, 'slack-input-invalid');
|
|
18
|
+
const data = await this.check(selector);
|
|
19
|
+
return { ok: data.ok, data, errors: data.error ? [data.error] : [] };
|
|
20
|
+
}
|
|
21
|
+
async configuration(selector) {
|
|
22
|
+
// Configuration owners retain their refusal identity (including reconnect errors).
|
|
23
|
+
const configuration = await this.getResolvedConfiguration(selector);
|
|
24
|
+
return parseSlack(SlackConfigurationSchema, configuration, 'slack-configuration-invalid');
|
|
25
|
+
}
|
|
26
|
+
async sendMessage(args, selector) {
|
|
27
|
+
const input = parseSlack(SlackSendMessageArgsSchema, args, 'slack-input-invalid');
|
|
28
|
+
const { config, credentials } = await this.configuration(selector);
|
|
29
|
+
const token = credentials.botToken;
|
|
30
|
+
if (!token)
|
|
31
|
+
throw new CapabilityError('Slack bot credential is missing.', 'AUTH_REQUIRED', { reason: 'slack-token-missing' });
|
|
32
|
+
const channelId = input.channelId ?? config.defaultChannelId;
|
|
33
|
+
if (!channelId)
|
|
34
|
+
throw new CapabilityError('Slack channel is missing.', 'INVALID_INPUT', { reason: 'slack-channel-missing' });
|
|
35
|
+
const body = {
|
|
36
|
+
channel: channelId, text: input.text, thread_ts: input.threadTs, blocks: input.blocks, metadata: input.metadata
|
|
37
|
+
};
|
|
38
|
+
const response = await this.slackFetch('/chat.postMessage', token, body);
|
|
39
|
+
if (!response.ok)
|
|
40
|
+
throw new CapabilityError('Slack refused the operation.', 'UNAVAILABLE', { reason: 'slack-operation-failed' });
|
|
41
|
+
const posted = parseSlack(SlackPostResponseSchema, response, 'slack-response-malformed', 'UNAVAILABLE');
|
|
42
|
+
return { channelId: posted.channel ?? channelId, ts: posted.ts, providerId: this.descriptor.id };
|
|
43
|
+
}
|
|
44
|
+
async check(selector) {
|
|
45
|
+
const { credentials } = await this.configuration(selector);
|
|
46
|
+
if (!credentials.botToken)
|
|
47
|
+
return { ok: false, providerId: this.descriptor.id, error: 'slack-token-missing' };
|
|
48
|
+
const outcome = await settle(() => this.slackFetch('/auth.test', credentials.botToken ?? '', {}));
|
|
49
|
+
if (!outcome.ok) {
|
|
50
|
+
const cause = outcome.cause;
|
|
51
|
+
if (cause instanceof CapabilityError && ['slack-response-malformed', 'slack-http-failed', 'slack-request-failed'].includes(cause.reason)) {
|
|
52
|
+
return { ok: false, providerId: this.descriptor.id, error: cause.reason };
|
|
53
|
+
}
|
|
54
|
+
throw cause;
|
|
55
|
+
}
|
|
56
|
+
const response = outcome.value;
|
|
57
|
+
if (!response.ok)
|
|
58
|
+
return { ok: false, providerId: this.descriptor.id, error: 'slack-operation-failed' };
|
|
59
|
+
return {
|
|
60
|
+
ok: true, providerId: this.descriptor.id, botId: response.bot_id,
|
|
61
|
+
teamId: response.team_id, userId: response.user_id
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async slackFetch(path, token, body) {
|
|
65
|
+
const baseUrl = await resolveSlackBaseUrl(this.context.runtime, this.descriptor.baseUrl);
|
|
66
|
+
let response;
|
|
67
|
+
try {
|
|
68
|
+
response = await fetch(`${baseUrl}${path}`, {
|
|
69
|
+
method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json; charset=utf-8' },
|
|
70
|
+
body: JSON.stringify(body)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (cause) {
|
|
74
|
+
throw new CapabilityError('Slack request failed.', 'UNAVAILABLE', {
|
|
75
|
+
reason: 'slack-request-failed', cause: valueFreeFailure(CaughtFailureSchema.parse(cause))
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (!response.ok)
|
|
79
|
+
throw new CapabilityError('Slack HTTP request failed.', 'UNAVAILABLE', {
|
|
80
|
+
reason: 'slack-http-failed', details: { status: response.status }
|
|
81
|
+
});
|
|
82
|
+
let data;
|
|
83
|
+
try {
|
|
84
|
+
data = await response.json();
|
|
85
|
+
}
|
|
86
|
+
catch (cause) {
|
|
87
|
+
throw new CapabilityError('Slack returned malformed JSON.', 'UNAVAILABLE', {
|
|
88
|
+
reason: 'slack-response-malformed', cause: valueFreeFailure(CaughtFailureSchema.parse(cause))
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return parseSlack(SlackApiResponseSchema, data, 'slack-response-malformed', 'UNAVAILABLE');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=slack-implementation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-implementation.js","sourceRoot":"","sources":["../../src/slack/slack-implementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC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AI,CAAC;YACJ,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,eAAe,CAAC,gCAAgC,EAAE,aAAa,EAAE;gBAC1E,MAAM,EAAE,0BAA0B,EAAE,KAAK,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aAC7F,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,UAAU,CAAC,sBAAsB,EAAE,IAAI,EAAE,0BAA0B,EAAE,aAAa,CAAC,CAAC;IAC5F,CAAC;CACD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
id: string;
|
|
3
|
+
kind: "agent/event-source";
|
|
4
|
+
name: string;
|
|
5
|
+
sourceType: "webhook" | "schedule" | "system" | "channel" | "integration";
|
|
6
|
+
status: "error" | "active" | "paused" | "disconnected";
|
|
7
|
+
agentIds: string[];
|
|
8
|
+
config: Record<string, unknown>;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
filters?: {
|
|
12
|
+
eventTypes?: string[] | undefined;
|
|
13
|
+
channels?: string[] | undefined;
|
|
14
|
+
guilds?: string[] | undefined;
|
|
15
|
+
keywords?: string[] | undefined;
|
|
16
|
+
minPriority?: number | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
integrationId?: string | undefined;
|
|
19
|
+
schedule?: {
|
|
20
|
+
cron?: string | undefined;
|
|
21
|
+
intervalMs?: number | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
userId?: string | undefined;
|
|
24
|
+
projectId?: string | undefined;
|
|
25
|
+
organizationId?: string | undefined;
|
|
26
|
+
hardware?: ("consumer" | "cloud")[] | undefined;
|
|
27
|
+
tags?: string[] | undefined;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
30
|
+
//# sourceMappingURL=slack-message-source.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-message-source.descriptor.d.ts","sourceRoot":"","sources":["../../src/slack/slack-message-source.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAiCG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel/factory';
|
|
2
|
+
export default createRuntimeAsset({
|
|
3
|
+
kind: 'agent/event-source',
|
|
4
|
+
id: 'message.slack',
|
|
5
|
+
name: 'Slack messages',
|
|
6
|
+
description: 'Generic Slack Events API or Socket Mode source. Agent deployments decide which agents subscribe.',
|
|
7
|
+
sourceType: 'integration',
|
|
8
|
+
status: 'disconnected',
|
|
9
|
+
agentIds: [],
|
|
10
|
+
integrationId: 'integration.slack',
|
|
11
|
+
config: {
|
|
12
|
+
provider: 'slack',
|
|
13
|
+
category: 'messaging',
|
|
14
|
+
eventTypes: ['message', 'app_mention', 'event_callback', 'slash_command'],
|
|
15
|
+
credentialKeys: ['botToken', 'signingSecret', 'appToken'],
|
|
16
|
+
operations: ['send-message', 'check'],
|
|
17
|
+
/**
|
|
18
|
+
* How a generic sender addresses this source: the provider operation and, per
|
|
19
|
+
* neutral send field, the operation argument that carries it. Fields without
|
|
20
|
+
* an entry are not supported by the operation and must not be sent.
|
|
21
|
+
*/
|
|
22
|
+
delivery: {
|
|
23
|
+
kind: 'chat',
|
|
24
|
+
operation: 'send-message',
|
|
25
|
+
arguments: { content: 'text', channel: 'channelId', thread: 'threadTs' }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
filters: {
|
|
29
|
+
eventTypes: ['message', 'app_mention', 'event_callback', 'slash_command']
|
|
30
|
+
},
|
|
31
|
+
enabled: true,
|
|
32
|
+
hardware: ['cloud', 'consumer'],
|
|
33
|
+
tags: ['messaging', 'slack', 'agent-event-source']
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=slack-message-source.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-message-source.descriptor.js","sourceRoot":"","sources":["../../src/slack/slack-message-source.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,eAAe,kBAAkB,CAA6B;IAC7D,IAAI,EAAE,oBAAoB;IAC1B,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACV,kGAAkG;IACnG,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE,mBAAmB;IAClC,MAAM,EAAE;QACP,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,WAAW;QACrB,UAAU,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACzE,cAAc,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC;QACzD,UAAU,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC;QACrC;;;;WAIG;QACH,QAAQ,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,cAAc;YACzB,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE;SACxE;KACD;IACD,OAAO,EAAE;QACR,UAAU,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,CAAC;KACzE;IACD,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAC/B,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,oBAAoB,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tools/signature-verifier` descriptor for Slack v0 webhook signatures.
|
|
3
|
+
*
|
|
4
|
+
* Consumed by `processWebhook` in `@vibesdotdev/tools/webhooks/router`. The
|
|
5
|
+
* router filters `tools/signature-verifier` descriptors by
|
|
6
|
+
* `source === 'slack'` and resolves the bound implementation.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: {
|
|
9
|
+
id: string;
|
|
10
|
+
kind: "tools/signature-verifier";
|
|
11
|
+
name: string;
|
|
12
|
+
source: string;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
headerName?: string | undefined;
|
|
15
|
+
signingSecretEnv?: string | undefined;
|
|
16
|
+
tags?: string[] | undefined;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=slack-signature-verifier.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-signature-verifier.descriptor.d.ts","sourceRoot":"","sources":["../../src/slack/slack-signature-verifier.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;AAKH,wBASG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tools/signature-verifier` descriptor for Slack v0 webhook signatures.
|
|
3
|
+
*
|
|
4
|
+
* Consumed by `processWebhook` in `@vibesdotdev/tools/webhooks/router`. The
|
|
5
|
+
* router filters `tools/signature-verifier` descriptors by
|
|
6
|
+
* `source === 'slack'` and resolves the bound implementation.
|
|
7
|
+
*/
|
|
8
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
9
|
+
export default createRuntimeAsset({
|
|
10
|
+
kind: 'tools/signature-verifier',
|
|
11
|
+
id: 'signature-verifier.slack',
|
|
12
|
+
name: 'Slack Webhook Signature Verifier',
|
|
13
|
+
description: 'Verifies Slack v0 signed webhook deliveries (HMAC-SHA256 over v0:timestamp:rawBody).',
|
|
14
|
+
source: 'slack',
|
|
15
|
+
headerName: 'x-slack-signature',
|
|
16
|
+
signingSecretEnv: 'SLACK_SIGNING_SECRET',
|
|
17
|
+
tags: ['slack', 'webhook']
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=slack-signature-verifier.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-signature-verifier.descriptor.js","sourceRoot":"","sources":["../../src/slack/slack-signature-verifier.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,eAAe,kBAAkB,CAA8B;IAC9D,IAAI,EAAE,0BAA0B;IAChC,EAAE,EAAE,0BAA0B;IAC9B,IAAI,EAAE,kCAAkC;IACxC,WAAW,EAAE,sFAAsF;IACnG,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,mBAAmB;IAC/B,gBAAgB,EAAE,sBAAsB;IACxC,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;CAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime implementation for the Slack `tools/signature-verifier` descriptor.
|
|
3
|
+
*
|
|
4
|
+
* Returned by the plugin loader and called from
|
|
5
|
+
* `@vibesdotdev/tools/webhooks/router#processWebhook`. The router supplies
|
|
6
|
+
* the resolved secret (read from `SLACK_SIGNING_SECRET` per the descriptor);
|
|
7
|
+
* the impl does pure v0 HMAC verification (Web Crypto) with no I/O.
|
|
8
|
+
*/
|
|
9
|
+
import type { SignatureVerifierDescriptor, SignatureVerifierImplementation } from '@vibesdotdev/tools/webhooks/schemas';
|
|
10
|
+
declare class SlackSignatureVerifier implements SignatureVerifierImplementation {
|
|
11
|
+
readonly descriptor: SignatureVerifierDescriptor;
|
|
12
|
+
verify(rawBody: string, headers: Record<string, string>, secret: string): Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<SlackSignatureVerifier>;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=slack-signature-verifier.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-signature-verifier.impl.d.ts","sourceRoot":"","sources":["../../src/slack/slack-signature-verifier.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACX,2BAA2B,EAC3B,+BAA+B,EAC/B,MAAM,qCAAqC,CAAC;AAI7C,cAAM,sBAAuB,YAAW,+BAA+B;IACtE,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAc;IAE9D,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG1F;;AAED,wBAIG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime implementation for the Slack `tools/signature-verifier` descriptor.
|
|
3
|
+
*
|
|
4
|
+
* Returned by the plugin loader and called from
|
|
5
|
+
* `@vibesdotdev/tools/webhooks/router#processWebhook`. The router supplies
|
|
6
|
+
* the resolved secret (read from `SLACK_SIGNING_SECRET` per the descriptor);
|
|
7
|
+
* the impl does pure v0 HMAC verification (Web Crypto) with no I/O.
|
|
8
|
+
*/
|
|
9
|
+
import { createRuntimeImplementation } from '@vibesdotdev/kernel';
|
|
10
|
+
import descriptor from "./slack-signature-verifier.descriptor.js";
|
|
11
|
+
import { verifySlackSignature } from "./slack-signature.js";
|
|
12
|
+
class SlackSignatureVerifier {
|
|
13
|
+
descriptor = descriptor;
|
|
14
|
+
verify(rawBody, headers, secret) {
|
|
15
|
+
return verifySlackSignature(rawBody, headers, secret);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export default createRuntimeImplementation({
|
|
19
|
+
kind: 'tools/signature-verifier',
|
|
20
|
+
id: 'signature-verifier.slack',
|
|
21
|
+
implementation: new SlackSignatureVerifier()
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=slack-signature-verifier.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-signature-verifier.impl.js","sourceRoot":"","sources":["../../src/slack/slack-signature-verifier.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAKlE,OAAO,UAAU,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,sBAAsB;IAClB,UAAU,GAAgC,UAAU,CAAC;IAE9D,MAAM,CAAC,OAAe,EAAE,OAA+B,EAAE,MAAc;QACtE,OAAO,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CACD;AAED,eAAe,2BAA2B,CAAC;IAC1C,IAAI,EAAE,0BAA0B;IAChC,EAAE,EAAE,0BAA0B;IAC9B,cAAc,EAAE,IAAI,sBAAsB,EAAE;CAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack v0 webhook signature verification.
|
|
3
|
+
*
|
|
4
|
+
* Slack signs requests as HMAC-SHA256 over `v0:<timestamp>:<rawBody>` with
|
|
5
|
+
* the workspace signing secret. The header `x-slack-signature` carries the
|
|
6
|
+
* digest as `v0=<hex>`; the matching timestamp lives in
|
|
7
|
+
* `x-slack-request-timestamp`. Requests whose timestamp is not a plain
|
|
8
|
+
* epoch-seconds integer within 5 minutes of now (older or newer) are rejected.
|
|
9
|
+
*
|
|
10
|
+
* Uses Web Crypto so the same verifier runs in workerd and consumer runtimes.
|
|
11
|
+
*
|
|
12
|
+
* Reference: https://api.slack.com/authentication/verifying-requests-from-slack
|
|
13
|
+
*/
|
|
14
|
+
export type { SlackSignatureOptions } from '../schemas/config.ts';
|
|
15
|
+
import { type SlackSignatureOptions } from '../schemas/config.ts';
|
|
16
|
+
export declare function verifySlackSignature(rawBody: string, headers: Record<string, string>, secret: string, options?: SlackSignatureOptions): Promise<boolean>;
|
|
17
|
+
//# sourceMappingURL=slack-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-signature.d.ts","sourceRoot":"","sources":["../../src/slack/slack-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAA+B,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAM/F,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GACjC,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack v0 webhook signature verification.
|
|
3
|
+
*
|
|
4
|
+
* Slack signs requests as HMAC-SHA256 over `v0:<timestamp>:<rawBody>` with
|
|
5
|
+
* the workspace signing secret. The header `x-slack-signature` carries the
|
|
6
|
+
* digest as `v0=<hex>`; the matching timestamp lives in
|
|
7
|
+
* `x-slack-request-timestamp`. Requests whose timestamp is not a plain
|
|
8
|
+
* epoch-seconds integer within 5 minutes of now (older or newer) are rejected.
|
|
9
|
+
*
|
|
10
|
+
* Uses Web Crypto so the same verifier runs in workerd and consumer runtimes.
|
|
11
|
+
*
|
|
12
|
+
* Reference: https://api.slack.com/authentication/verifying-requests-from-slack
|
|
13
|
+
*/
|
|
14
|
+
import { constantTimeEqual } from '@vibesdotdev/security';
|
|
15
|
+
const REPLAY_WINDOW_SEC = 300;
|
|
16
|
+
import { SlackSignatureOptionsSchema } from "../schemas/config.js";
|
|
17
|
+
function toHex(bytes) {
|
|
18
|
+
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
19
|
+
}
|
|
20
|
+
export async function verifySlackSignature(rawBody, headers, secret, options = {}) {
|
|
21
|
+
options = SlackSignatureOptionsSchema.parse(options);
|
|
22
|
+
if (!secret)
|
|
23
|
+
return false;
|
|
24
|
+
const sig = headers['x-slack-signature'] || '';
|
|
25
|
+
const ts = headers['x-slack-request-timestamp'] || '';
|
|
26
|
+
if (!sig || !/^\d+$/.test(ts))
|
|
27
|
+
return false;
|
|
28
|
+
const nowSec = Math.floor((options.nowMs ?? Date.now()) / 1000);
|
|
29
|
+
if (!(Math.abs(nowSec - Number(ts)) <= REPLAY_WINDOW_SEC))
|
|
30
|
+
return false;
|
|
31
|
+
const encoder = new TextEncoder();
|
|
32
|
+
const key = await crypto.subtle.importKey('raw', encoder.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']);
|
|
33
|
+
const digest = await crypto.subtle.sign('HMAC', key, encoder.encode(`v0:${ts}:${rawBody}`));
|
|
34
|
+
return constantTimeEqual(sig, `v0=${toHex(digest)}`);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=slack-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-signature.js","sourceRoot":"","sources":["../../src/slack/slack-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAG9B,OAAO,EAAE,2BAA2B,EAA8B,MAAM,sBAAsB,CAAC;AAE/F,SAAS,KAAK,CAAC,KAAkB;IAChC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,MAAM,CAAC,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0,0 +1,69 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
id: string;
|
|
3
|
+
kind: "integration/provider";
|
|
4
|
+
name?: string | undefined;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
tags?: string[] | undefined;
|
|
7
|
+
hardware?: string[] | undefined;
|
|
8
|
+
enabled?: boolean | undefined;
|
|
9
|
+
capabilityId?: string | undefined;
|
|
10
|
+
retention?: string | {
|
|
11
|
+
reason: string;
|
|
12
|
+
maxAgeDays?: number | undefined;
|
|
13
|
+
maxEntries?: number | undefined;
|
|
14
|
+
maxBytes?: number | undefined;
|
|
15
|
+
cascadeFrom?: string | undefined;
|
|
16
|
+
ageField?: string | undefined;
|
|
17
|
+
enforcedBy?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
requiredContext?: string[] | undefined;
|
|
20
|
+
optionalContext?: string[] | undefined;
|
|
21
|
+
provider?: string | undefined;
|
|
22
|
+
category?: "webhook" | "accounting" | "vcs" | "issue-tracker" | "productivity" | "ocr" | "email" | "messaging" | "sms" | "push" | "storage" | "analytics" | "observability" | "crm" | "calendar" | "other" | undefined;
|
|
23
|
+
priority?: number | undefined;
|
|
24
|
+
baseUrl?: string | undefined;
|
|
25
|
+
config?: Record<string, import("@vibesdotdev/kernel/bootstrap").JsonValue> | undefined;
|
|
26
|
+
protectedConfigKeys?: string[] | undefined;
|
|
27
|
+
configurationSource?: "account" | "host" | undefined;
|
|
28
|
+
configSettingKey?: string | undefined;
|
|
29
|
+
credentials?: {
|
|
30
|
+
key: string;
|
|
31
|
+
source: "secret" | "setting";
|
|
32
|
+
reference?: {
|
|
33
|
+
source: "secret";
|
|
34
|
+
key: string;
|
|
35
|
+
store?: string | undefined;
|
|
36
|
+
operation?: object | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
providerType?: string | undefined;
|
|
39
|
+
scope?: "user" | "platform" | "project" | "org" | undefined;
|
|
40
|
+
scopeId?: string | undefined;
|
|
41
|
+
settingKey?: string | undefined;
|
|
42
|
+
required?: boolean | undefined;
|
|
43
|
+
}[] | undefined;
|
|
44
|
+
oauth?: {
|
|
45
|
+
authorizationEndpoint: string;
|
|
46
|
+
tokenEndpoint: string;
|
|
47
|
+
scopes?: string[] | undefined;
|
|
48
|
+
authorizationParams?: Record<string, string> | undefined;
|
|
49
|
+
configFromCallback?: string[] | undefined;
|
|
50
|
+
clientAuthentication?: "form" | "basic" | undefined;
|
|
51
|
+
bodyEncoding?: "form" | "json" | undefined;
|
|
52
|
+
headers?: Record<string, string> | undefined;
|
|
53
|
+
scopeIdCallbackParam?: string | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
operations?: {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
description?: string | undefined;
|
|
59
|
+
requiresOrg?: boolean | undefined;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
connection?: {
|
|
62
|
+
authMode?: "oauth" | "webhook" | "delegated" | "system-config" | undefined;
|
|
63
|
+
connectable?: boolean | undefined;
|
|
64
|
+
checkable?: boolean | undefined;
|
|
65
|
+
requiresProviderAdmin?: boolean | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
};
|
|
68
|
+
export default _default;
|
|
69
|
+
//# sourceMappingURL=slack.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack.descriptor.d.ts","sourceRoot":"","sources":["../../src/slack/slack.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAsDG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createRuntimeAsset } from '@vibesdotdev/kernel/factory';
|
|
2
|
+
import {} from '@vibesdotdev/integrations/schemas/integration-descriptor';
|
|
3
|
+
export default createRuntimeAsset({
|
|
4
|
+
kind: 'integration/provider',
|
|
5
|
+
id: 'integration.slack',
|
|
6
|
+
name: 'Slack',
|
|
7
|
+
description: 'Slack Web API integration for agent message sources and bot replies.',
|
|
8
|
+
provider: 'slack',
|
|
9
|
+
category: 'messaging',
|
|
10
|
+
enabled: true,
|
|
11
|
+
priority: 100,
|
|
12
|
+
baseUrl: 'https://slack.com/api',
|
|
13
|
+
configSettingKey: 'integrations.slack.config',
|
|
14
|
+
config: {
|
|
15
|
+
defaultChannelId: '',
|
|
16
|
+
teamId: '',
|
|
17
|
+
socketMode: false
|
|
18
|
+
},
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
key: 'botToken',
|
|
22
|
+
source: 'secret',
|
|
23
|
+
providerType: 'slack',
|
|
24
|
+
scope: 'org',
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: 'signingSecret',
|
|
29
|
+
source: 'secret',
|
|
30
|
+
providerType: 'slack',
|
|
31
|
+
scope: 'org',
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: 'appToken',
|
|
36
|
+
source: 'secret',
|
|
37
|
+
providerType: 'slack',
|
|
38
|
+
scope: 'org',
|
|
39
|
+
required: false
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
operations: [
|
|
43
|
+
{
|
|
44
|
+
id: 'send-message',
|
|
45
|
+
name: 'Send message',
|
|
46
|
+
description: 'POST /chat.postMessage using the configured Slack bot token.',
|
|
47
|
+
requiresOrg: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'check',
|
|
51
|
+
name: 'Health probe',
|
|
52
|
+
description: 'POST /auth.test to verify the configured Slack bot token.',
|
|
53
|
+
requiresOrg: true
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
tags: ['messaging', 'slack', 'agent-event-source']
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=slack.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack.descriptor.js","sourceRoot":"","sources":["../../src/slack/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}
|
package/package.json
CHANGED
|
@@ -1,6 +1,133 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibesdotdev/integrations-slack",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@vibesdotdev/config": "^1.0.0-rc.0",
|
|
6
|
+
"@vibesdotdev/integrations": "^1.0.0-rc.6",
|
|
7
|
+
"@vibesdotdev/platform": "^1.0.0-rc.0",
|
|
8
|
+
"@vibesdotdev/kernel": "^1.0.0-rc.0",
|
|
9
|
+
"@vibesdotdev/security": "^1.0.0-rc.0",
|
|
10
|
+
"@vibesdotdev/tools": "^1.0.0-rc.0",
|
|
11
|
+
"zod": "^4.6.7"
|
|
12
|
+
},
|
|
13
|
+
"gitHead": "319e9e534fac11da0c374ab44efeed6c9722d3ec",
|
|
14
|
+
"_vibes_source": {
|
|
15
|
+
"repo": "ssh://git@git.vibes.dev/vibesdotdev/integrations.git",
|
|
16
|
+
"sha": "319e9e534fac11da0c374ab44efeed6c9722d3ec",
|
|
17
|
+
"workspaceDigest": "sha256:f6cc33389faefa69732193a4a172086ec06182f4e1490a3f8400785342f7381c"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"bun": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./plugin": {
|
|
28
|
+
"bun": "./dist/integrations-slack.plugin.js",
|
|
29
|
+
"types": "./dist/integrations-slack.plugin.d.ts",
|
|
30
|
+
"import": "./dist/integrations-slack.plugin.js",
|
|
31
|
+
"default": "./dist/integrations-slack.plugin.js"
|
|
32
|
+
},
|
|
33
|
+
"./client": {
|
|
34
|
+
"bun": "./dist/client/index.js",
|
|
35
|
+
"types": "./dist/client/index.d.ts",
|
|
36
|
+
"import": "./dist/client/index.js",
|
|
37
|
+
"default": "./dist/client/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./slack": {
|
|
40
|
+
"bun": "./dist/slack/index.js",
|
|
41
|
+
"types": "./dist/slack/index.d.ts",
|
|
42
|
+
"import": "./dist/slack/index.js",
|
|
43
|
+
"default": "./dist/slack/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./slack/descriptor": {
|
|
46
|
+
"bun": "./dist/slack/slack.descriptor.js",
|
|
47
|
+
"types": "./dist/slack/slack.descriptor.d.ts",
|
|
48
|
+
"import": "./dist/slack/slack.descriptor.js",
|
|
49
|
+
"default": "./dist/slack/slack.descriptor.js"
|
|
50
|
+
},
|
|
51
|
+
"./slack/message-source": {
|
|
52
|
+
"bun": "./dist/slack/slack-message-source.descriptor.js",
|
|
53
|
+
"types": "./dist/slack/slack-message-source.descriptor.d.ts",
|
|
54
|
+
"import": "./dist/slack/slack-message-source.descriptor.js",
|
|
55
|
+
"default": "./dist/slack/slack-message-source.descriptor.js"
|
|
56
|
+
},
|
|
57
|
+
"./slack/signature": {
|
|
58
|
+
"bun": "./dist/slack/slack-signature.js",
|
|
59
|
+
"types": "./dist/slack/slack-signature.d.ts",
|
|
60
|
+
"import": "./dist/slack/slack-signature.js",
|
|
61
|
+
"default": "./dist/slack/slack-signature.js"
|
|
62
|
+
},
|
|
63
|
+
"./slack/signature-verifier": {
|
|
64
|
+
"bun": "./dist/slack/slack-signature-verifier.descriptor.js",
|
|
65
|
+
"types": "./dist/slack/slack-signature-verifier.descriptor.d.ts",
|
|
66
|
+
"import": "./dist/slack/slack-signature-verifier.descriptor.js",
|
|
67
|
+
"default": "./dist/slack/slack-signature-verifier.descriptor.js"
|
|
68
|
+
},
|
|
69
|
+
"./slack/events": {
|
|
70
|
+
"bun": "./dist/slack/slack-events.descriptors.js",
|
|
71
|
+
"types": "./dist/slack/slack-events.descriptors.d.ts",
|
|
72
|
+
"import": "./dist/slack/slack-events.descriptors.js",
|
|
73
|
+
"default": "./dist/slack/slack-events.descriptors.js"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"files": [
|
|
77
|
+
"dist",
|
|
78
|
+
"README.md",
|
|
79
|
+
"LICENSE",
|
|
80
|
+
"!**/.turbo/**",
|
|
81
|
+
"!**/.svelte-kit/**",
|
|
82
|
+
"!**/.vibes/**",
|
|
83
|
+
"!**/__tests__/**",
|
|
84
|
+
"!**/__stubs__/**",
|
|
85
|
+
"!**/*.test.js",
|
|
86
|
+
"!**/*.test.mjs",
|
|
87
|
+
"!**/*.test.cjs",
|
|
88
|
+
"!**/*.test.jsx",
|
|
89
|
+
"!**/*.test.ts",
|
|
90
|
+
"!**/*.test.mts",
|
|
91
|
+
"!**/*.test.cts",
|
|
92
|
+
"!**/*.test.tsx",
|
|
93
|
+
"!**/*.spec.js",
|
|
94
|
+
"!**/*.spec.mjs",
|
|
95
|
+
"!**/*.spec.cjs",
|
|
96
|
+
"!**/*.spec.jsx",
|
|
97
|
+
"!**/*.spec.ts",
|
|
98
|
+
"!**/*.spec.mts",
|
|
99
|
+
"!**/*.spec.cts",
|
|
100
|
+
"!**/*.spec.tsx",
|
|
101
|
+
"!**/SPEC.md",
|
|
102
|
+
"!**/tsconfig.json",
|
|
103
|
+
"!**/tsconfig.*.json",
|
|
104
|
+
"!**/*.tsbuildinfo",
|
|
105
|
+
"!**/.build-ok.json",
|
|
106
|
+
"!**/*.tgz"
|
|
107
|
+
],
|
|
108
|
+
"scripts": {
|
|
109
|
+
"lint": "node ../../node_modules/@vibesdotdev/internal-oxlint-toolchain/ratchet.mjs .",
|
|
110
|
+
"check": "bun --bun tsc -p tsconfig.json --noEmit",
|
|
111
|
+
"test": "bun test test/",
|
|
112
|
+
"build": "tsc -p tsconfig.build.json"
|
|
113
|
+
},
|
|
114
|
+
"repository": {
|
|
115
|
+
"type": "git",
|
|
116
|
+
"url": "ssh://git@git.vibes.dev/vibesdotdev/integrations.git",
|
|
117
|
+
"directory": "integrations/slack"
|
|
118
|
+
},
|
|
119
|
+
"publishConfig": {
|
|
120
|
+
"registry": "https://packages.vibes.dev",
|
|
121
|
+
"access": "public"
|
|
122
|
+
},
|
|
123
|
+
"vibes": {
|
|
124
|
+
"visibility": "public",
|
|
125
|
+
"registry": {
|
|
126
|
+
"repositoryId": "70be51c9-5ab7-4d7e-9f47-801cb17720d8",
|
|
127
|
+
"directory": "integrations/slack"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"type": "module",
|
|
131
|
+
"types": "./dist/index.d.ts",
|
|
132
|
+
"license": "BUSL-1.1"
|
|
133
|
+
}
|