@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
package/LICENSE
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: VIBES DEV LLC
|
|
6
|
+
Licensed Work: @vibesdotdev/integrations-slack
|
|
7
|
+
The Licensed Work is (c) 2026 VIBES DEV LLC.
|
|
8
|
+
Additional Use Grant: In this grant, "Vibes Platform" means the hosted services VIBES DEV LLC
|
|
9
|
+
operates at vibes.dev and its subdomains.
|
|
10
|
+
|
|
11
|
+
You may make production use of the Licensed Work, including commercial
|
|
12
|
+
use, subject to the limits below. Permitted production use includes:
|
|
13
|
+
building, operating and selling your own applications, agents and services
|
|
14
|
+
on or with the Vibes Platform; self-hosting the Licensed Work for use inside
|
|
15
|
+
your own organization; and providing consulting, integration or development
|
|
16
|
+
services to clients who build on the Vibes Platform.
|
|
17
|
+
|
|
18
|
+
The production use permitted above does not include use that:
|
|
19
|
+
|
|
20
|
+
(a) offers third parties a hosted, managed or embedded service that
|
|
21
|
+
substitutes for the Vibes Platform or a material part of it (including
|
|
22
|
+
agent hosting; fleet, sandbox or container provisioning; package
|
|
23
|
+
registry; source hosting and continuous integration; and managed AI,
|
|
24
|
+
storage, secrets or messaging), where the Licensed Work provides a
|
|
25
|
+
material part of that service's value and that service earns more than
|
|
26
|
+
US$1,000,000 in gross revenue in any twelve-month period;
|
|
27
|
+
(b) sells, rents, sublicenses or white-labels the Licensed Work, or access
|
|
28
|
+
to Vibes Platform functionality, as a product in its own right;
|
|
29
|
+
(c) removes, disables or works around entitlement checks, usage metering,
|
|
30
|
+
quotas or plan limits, or reaches Vibes Platform features the user's
|
|
31
|
+
account is not entitled to;
|
|
32
|
+
(d) scrapes, bulk-exports or harvests data or content from the Vibes
|
|
33
|
+
Platform or its users other than through documented interfaces and
|
|
34
|
+
within their terms, or uses outputs or data obtained from the Vibes
|
|
35
|
+
Platform to train or improve a product that competes with it;
|
|
36
|
+
(e) violates applicable law, infringes anyone's rights, commits fraud or
|
|
37
|
+
deception, conducts unlawful surveillance or harassment, distributes
|
|
38
|
+
malware, or accesses systems without authorization; or
|
|
39
|
+
(f) violates applicable antitrust or competition law.
|
|
40
|
+
|
|
41
|
+
A written permission from the Licensor extends this grant.
|
|
42
|
+
Change Date: Four years from the date the Licensed Work is published.
|
|
43
|
+
Change License: MIT
|
|
44
|
+
|
|
45
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
46
|
+
contact VIBES DEV LLC through https://vibes.dev.
|
|
47
|
+
|
|
48
|
+
Notice
|
|
49
|
+
|
|
50
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
51
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
52
|
+
under an Open Source License, as stated in this License.
|
|
53
|
+
|
|
54
|
+
-----------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
Business Source License 1.1
|
|
57
|
+
|
|
58
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
59
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
60
|
+
|
|
61
|
+
Terms
|
|
62
|
+
|
|
63
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
64
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
65
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
66
|
+
production use.
|
|
67
|
+
|
|
68
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
69
|
+
available distribution of a specific version of the Licensed Work under this
|
|
70
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
71
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
72
|
+
above terminate.
|
|
73
|
+
|
|
74
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
75
|
+
currently in effect as described in this License, you must purchase a
|
|
76
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
77
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
78
|
+
|
|
79
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
80
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
81
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
82
|
+
for each version of the Licensed Work released by Licensor.
|
|
83
|
+
|
|
84
|
+
You must conspicuously display this License on each original or modified copy
|
|
85
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
86
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
87
|
+
License apply to your use of that work.
|
|
88
|
+
|
|
89
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
90
|
+
terminate your rights under this License for the current and all other
|
|
91
|
+
versions of the Licensed Work.
|
|
92
|
+
|
|
93
|
+
This License does not grant you any right in any trademark or logo of
|
|
94
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
95
|
+
Licensor as expressly required by this License).
|
|
96
|
+
|
|
97
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
98
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
99
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
100
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
101
|
+
TITLE.
|
|
102
|
+
|
|
103
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
104
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
105
|
+
as long as you comply with the Covenants of Licensor below.
|
|
106
|
+
|
|
107
|
+
Covenants of Licensor
|
|
108
|
+
|
|
109
|
+
In consideration of the right to use this License’s text and the “Business
|
|
110
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
111
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
112
|
+
|
|
113
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
114
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
115
|
+
where “compatible” means that software provided under the Change License can
|
|
116
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
117
|
+
later version. Licensor may specify additional Change Licenses without
|
|
118
|
+
limitation.
|
|
119
|
+
|
|
120
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
121
|
+
impose any additional restriction on the right granted in this License, as
|
|
122
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
123
|
+
|
|
124
|
+
3. To specify a Change Date.
|
|
125
|
+
|
|
126
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Slack integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@vibesdotdev/integrations-slack` provides schema-validated Web API operations,
|
|
4
|
+
signature verification and normalized webhook events.
|
|
5
|
+
|
|
6
|
+
Compose `./plugin` with integrations, tools and agent event-source kinds.
|
|
7
|
+
Resolve `getVibesSlackClient(runtime)` from `./client` for
|
|
8
|
+
`messages.send({ text, channelId, threadTs, blocks, metadata })` and
|
|
9
|
+
`messages.check()`. Selected sends pass an explicit user and connection ID to
|
|
10
|
+
`invokeForConnection`; the host owns account authorization and storage.
|
|
11
|
+
|
|
12
|
+
The root exports contracts and semantic helpers. Concrete provider access
|
|
13
|
+
remains at `./slack`. Webhook tasks use the first composed
|
|
14
|
+
`message.slack.agentIds` subscriber, or remain unassigned; no application agent
|
|
15
|
+
is hardcoded. Operation failures carry stable `CapabilityError` reasons;
|
|
16
|
+
health checks report unhealthy results for Slack and transport failures.
|
|
17
|
+
|
|
18
|
+
Run `bun run check`, `bun run test`, `bun run build`, the package's configured
|
|
19
|
+
Oxlint ratchet, and `workspace-rules`. Check includes test support; build uses
|
|
20
|
+
`tsconfig.build.json` for production-only output.
|
|
21
|
+
|
|
22
|
+
See [SPEC.md](./SPEC.md) for exports, boundary validation, origin precedence,
|
|
23
|
+
refusals and the saved-account proof. Tests execute the production Platform
|
|
24
|
+
receiver, account lifecycle, store and authorized secret resolution in-process;
|
|
25
|
+
only outgoing Slack HTTP is faked. Overlapping sends use each account's stored
|
|
26
|
+
channel and credential, and a disconnected account returns HTTP 412 without
|
|
27
|
+
sending to Slack.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
import type { SlackClient } from './runtime-client.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the canonical `SlackClient`.
|
|
5
|
+
*
|
|
6
|
+
* Equivalent to `runtime.query('runtime/client').withId('slack').resolve()`.
|
|
7
|
+
* Requires the integrations-slack plugin to be composed into the runtime.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getVibesSlackClient(runtime: VibesRuntime): Promise<SlackClient>;
|
|
10
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/client/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAErF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getVibesClient } from '@vibesdotdev/kernel/client';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the canonical `SlackClient`.
|
|
4
|
+
*
|
|
5
|
+
* Equivalent to `runtime.query('runtime/client').withId('slack').resolve()`.
|
|
6
|
+
* Requires the integrations-slack plugin to be composed into the runtime.
|
|
7
|
+
*/
|
|
8
|
+
export async function getVibesSlackClient(runtime) {
|
|
9
|
+
return getVibesClient('slack', runtime);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/client/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAqB;IAC9D,OAAO,cAAc,CAAc,OAAO,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { KindContext } from '@vibesdotdev/kernel';
|
|
2
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
3
|
+
import { BaseRuntimeClient, type RuntimeClientDescriptor } from '@vibesdotdev/kernel/client';
|
|
4
|
+
import { type SlackOperationInput, type SlackClientContext, type SlackSelectedIdentity, type SlackSendMessageArgs, type SlackSendMessageResult, type SlackCheckResult } from '../schemas/operations.ts';
|
|
5
|
+
export type { SlackClientContext } from '../schemas/operations.ts';
|
|
6
|
+
export declare class SlackClient extends BaseRuntimeClient {
|
|
7
|
+
readonly messages: MessagesNamespace;
|
|
8
|
+
private readonly contextOverride;
|
|
9
|
+
constructor(descriptor?: RuntimeClientDescriptor, context?: SlackClientContext | KindContext, runtime?: VibesRuntime);
|
|
10
|
+
get integrationId(): string;
|
|
11
|
+
invokeForConnection<T = unknown>(operationId: string, args: SlackOperationInput, identity: SlackSelectedIdentity): Promise<T>;
|
|
12
|
+
invoke<T = unknown>(operationId: string, args?: SlackOperationInput, identity?: SlackClientContext): Promise<T>;
|
|
13
|
+
private optionalContext;
|
|
14
|
+
}
|
|
15
|
+
declare class MessagesNamespace {
|
|
16
|
+
private readonly client;
|
|
17
|
+
constructor(client: SlackClient);
|
|
18
|
+
send(options: SlackSendMessageArgs): Promise<SlackSendMessageResult>;
|
|
19
|
+
check(): Promise<SlackCheckResult>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=runtime-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-client.d.ts","sourceRoot":"","sources":["../../src/client/runtime-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EAGN,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EAC7E,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,KAAK,gBAAgB,EAC7E,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAInE,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA4B;gBAG3D,UAAU,GAAE,uBAAiE,EAC7E,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW,EAC1C,OAAO,CAAC,EAAE,YAAY;IAQvB,IAAI,aAAa,IAAI,MAAM,CAAiC;IAE5D,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,qBAAqB,GAAG,OAAO,CAAC,CAAC,CAAC;IAM7H,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB,EAAE,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;YA2BjG,eAAe;CAQ7B;AAED,cAAM,iBAAiB;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIpE,KAAK,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAGxC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
2
|
+
import { BaseRuntimeClient } from '@vibesdotdev/kernel/client';
|
|
3
|
+
import { getVibesPlatformInternalClient } from '@vibesdotdev/platform/internal-api';
|
|
4
|
+
import { SlackClientContextSchema, SlackIdentitySchema, SlackSelectedIdentitySchema, SlackOptionalOrgSchema, SlackOperationIdSchema, SlackCheckArgsSchema, SlackSendMessageArgsSchema, SlackSendMessageResultSchema, SlackCheckResultSchema } from "../schemas/operations.js";
|
|
5
|
+
import { parseSlack } from "../schemas/validation.js";
|
|
6
|
+
const SLACK_INTEGRATION_ID = 'integration.slack';
|
|
7
|
+
export class SlackClient extends BaseRuntimeClient {
|
|
8
|
+
messages;
|
|
9
|
+
contextOverride;
|
|
10
|
+
constructor(descriptor = { id: 'slack', kind: 'runtime/client' }, context, runtime) {
|
|
11
|
+
super(descriptor, context && 'runtime' in context ? context : undefined, runtime);
|
|
12
|
+
this.contextOverride = context && !('runtime' in context)
|
|
13
|
+
? parseSlack(SlackClientContextSchema, context, 'slack-identity-invalid', 'AUTH_REQUIRED') : null;
|
|
14
|
+
this.messages = new MessagesNamespace(this);
|
|
15
|
+
}
|
|
16
|
+
get integrationId() { return SLACK_INTEGRATION_ID; }
|
|
17
|
+
async invokeForConnection(operationId, args, identity) {
|
|
18
|
+
const selected = parseSlack(SlackSelectedIdentitySchema, identity, 'slack-identity-invalid', 'AUTH_REQUIRED');
|
|
19
|
+
return this.invoke(operationId, args, selected);
|
|
20
|
+
}
|
|
21
|
+
async invoke(operationId, args, identity) {
|
|
22
|
+
const operation = parseSlack(SlackOperationIdSchema, operationId, 'slack-operation-unsupported');
|
|
23
|
+
const input = operation === 'send-message'
|
|
24
|
+
? parseSlack(SlackSendMessageArgsSchema, args, 'slack-input-invalid')
|
|
25
|
+
: parseSlack(SlackCheckArgsSchema, args, 'slack-input-invalid');
|
|
26
|
+
const override = identity ?? this.contextOverride;
|
|
27
|
+
const userId = identity ? identity.userId : this.contextOverride?.userId ?? await this.optionalContext('userId');
|
|
28
|
+
const orgId = identity ? identity.organizationId ?? identity.orgId
|
|
29
|
+
: this.contextOverride?.organizationId ?? this.contextOverride?.orgId ?? await this.optionalContext('orgId');
|
|
30
|
+
const actor = parseSlack(SlackIdentitySchema, {
|
|
31
|
+
...override, userId, organizationId: orgId
|
|
32
|
+
}, 'slack-identity-invalid', 'AUTH_REQUIRED');
|
|
33
|
+
const client = await getVibesPlatformInternalClient(this.runtime);
|
|
34
|
+
// Platform owns the ok/data envelope; Slack owns the operation-specific data.
|
|
35
|
+
// Supplying the schema makes an arbitrary success payload fail at the HTTP boundary.
|
|
36
|
+
const outputSchema = operation === 'send-message' ? SlackSendMessageResultSchema : SlackCheckResultSchema;
|
|
37
|
+
const result = await client.integrations.invoke({
|
|
38
|
+
userId: actor.userId, organizationId: actor.organizationId,
|
|
39
|
+
connectionId: actor.connectionId, actorJwt: actor.jwt,
|
|
40
|
+
integrationId: SLACK_INTEGRATION_ID, operationId: operation, args: input
|
|
41
|
+
}, outputSchema);
|
|
42
|
+
if (!result.ok)
|
|
43
|
+
throw new CapabilityError('Slack operation failed.', 'UNAVAILABLE', { reason: 'slack-operation-failed' });
|
|
44
|
+
return parseSlack(outputSchema, result.data, 'slack-response-malformed', 'UNAVAILABLE');
|
|
45
|
+
}
|
|
46
|
+
async optionalContext(id) {
|
|
47
|
+
try {
|
|
48
|
+
return parseSlack(SlackOptionalOrgSchema, await this.runtime.context(id), 'slack-identity-invalid', 'AUTH_REQUIRED');
|
|
49
|
+
}
|
|
50
|
+
catch (cause) {
|
|
51
|
+
if (cause instanceof Error && CapabilityError.isAbsenceOf(cause, 'context', id))
|
|
52
|
+
return undefined;
|
|
53
|
+
throw cause;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class MessagesNamespace {
|
|
58
|
+
client;
|
|
59
|
+
constructor(client) {
|
|
60
|
+
this.client = client;
|
|
61
|
+
}
|
|
62
|
+
async send(options) {
|
|
63
|
+
return this.client.invoke('send-message', options);
|
|
64
|
+
}
|
|
65
|
+
async check() {
|
|
66
|
+
return this.client.invoke('check');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=runtime-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-client.js","sourceRoot":"","sources":["../../src/client/runtime-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAgC,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EACN,wBAAwB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,sBAAsB,EAClG,sBAAsB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,sBAAsB,EAG9H,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEjD,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IACxC,QAAQ,CAAoB;IACpB,eAAe,CAA4B;IAE5D,YACC,aAAsC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,gBAA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,CAAC,CAAC;IACzF,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,EAAsB;QACnD,IAAI,CAAC;YACJ,OAAO,UAAU,CAAC,sBAAsB,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,wBAAwB,EAAE,eAAe,CAAC,CAAC;QACtH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,KAAK,YAAY,KAAK,IAAI,eAAe,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC;gBAAE,OAAO,SAAS,CAAC;YAClG,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;CACD;AAED,MAAM,iBAAiB;IACO;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,OAA6B;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAyB,cAAc,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,KAAK;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAmB,OAAO,CAAC,CAAC;IACtD,CAAC;CACD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack settings — the `integrations.slack` config manifest.
|
|
3
|
+
*/
|
|
4
|
+
import { type SlackSettings } from '../schemas/config.ts';
|
|
5
|
+
export { SlackSettingsSchema, SLACK_DEFAULT_BASE_URL } from '../schemas/config.ts';
|
|
6
|
+
export type { SlackSettings } from '../schemas/config.ts';
|
|
7
|
+
import { type RuntimeRef } from '@vibesdotdev/kernel';
|
|
8
|
+
export declare const SLACK_SETTINGS_MANIFEST_ID = "integrations.slack";
|
|
9
|
+
export declare function loadSlackSettings(runtime: RuntimeRef): Promise<SlackSettings>;
|
|
10
|
+
export declare function resolveSlackBaseUrl(runtime: RuntimeRef, declared?: string): Promise<string>;
|
|
11
|
+
export declare const slackSettingsDescriptor: {
|
|
12
|
+
kind: "config/manifest";
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
namespace: string;
|
|
16
|
+
description: string;
|
|
17
|
+
tier: string;
|
|
18
|
+
category: string;
|
|
19
|
+
schema: import("zod").ZodObject<{
|
|
20
|
+
baseUrl: import("zod").ZodDefault<import("zod").ZodURL>;
|
|
21
|
+
}, import("zod/v4/core").$strip>;
|
|
22
|
+
fields: {
|
|
23
|
+
baseUrl: {
|
|
24
|
+
ui: {
|
|
25
|
+
label: string;
|
|
26
|
+
component: string;
|
|
27
|
+
group: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
groups: {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
}[];
|
|
35
|
+
allowedAdapters: string[];
|
|
36
|
+
defaultAdapter: string;
|
|
37
|
+
scope: string;
|
|
38
|
+
customTables: boolean;
|
|
39
|
+
version: number;
|
|
40
|
+
internal: boolean;
|
|
41
|
+
context: {
|
|
42
|
+
surfaces: string[];
|
|
43
|
+
};
|
|
44
|
+
enabled: true;
|
|
45
|
+
};
|
|
46
|
+
export default slackSettingsDescriptor;
|
|
47
|
+
//# sourceMappingURL=slack.config.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack.config.descriptor.d.ts","sourceRoot":"","sources":["../../src/config/slack.config.descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAA+C,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE3F,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,aAAa,CAAC,CAUxB;AAED,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,UAAU,EACnB,QAAQ,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBlC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack settings — the `integrations.slack` config manifest.
|
|
3
|
+
*/
|
|
4
|
+
import { SlackSettingsSchema, SLACK_DEFAULT_BASE_URL } from "../schemas/config.js";
|
|
5
|
+
export { SlackSettingsSchema, SLACK_DEFAULT_BASE_URL } from "../schemas/config.js";
|
|
6
|
+
import { parseSlack } from "../schemas/validation.js";
|
|
7
|
+
import { ConfigManifest } from '@vibesdotdev/config';
|
|
8
|
+
import { CapabilityError, createRuntimeAsset } from '@vibesdotdev/kernel';
|
|
9
|
+
export const SLACK_SETTINGS_MANIFEST_ID = 'integrations.slack';
|
|
10
|
+
export async function loadSlackSettings(runtime) {
|
|
11
|
+
if (!runtime.hasKind('config/manifest'))
|
|
12
|
+
return SlackSettingsSchema.parse({});
|
|
13
|
+
try {
|
|
14
|
+
return await ConfigManifest.forRuntime(runtime, SLACK_SETTINGS_MANIFEST_ID).load();
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (error instanceof CapabilityError && error.reason === 'config-manifest-unregistered') {
|
|
18
|
+
return SlackSettingsSchema.parse({});
|
|
19
|
+
}
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export async function resolveSlackBaseUrl(runtime, declared) {
|
|
24
|
+
const configured = (await loadSlackSettings(runtime)).baseUrl;
|
|
25
|
+
// A user-set origin in the `integrations.slack` settings outranks the descriptor's
|
|
26
|
+
// declared origin; an unset setting resolves to the manifest default, which defers to
|
|
27
|
+
// the descriptor (so an alternate descriptor origin still applies).
|
|
28
|
+
const origin = configured !== SLACK_DEFAULT_BASE_URL ? configured : (declared ?? configured);
|
|
29
|
+
return parseSlack(SlackSettingsSchema, { baseUrl: origin }, 'slack-configuration-invalid').baseUrl.replace(/\/+$/, '');
|
|
30
|
+
}
|
|
31
|
+
export const slackSettingsDescriptor = createRuntimeAsset({
|
|
32
|
+
kind: 'config/manifest',
|
|
33
|
+
id: SLACK_SETTINGS_MANIFEST_ID,
|
|
34
|
+
name: 'Slack',
|
|
35
|
+
namespace: 'integrations',
|
|
36
|
+
description: 'Slack Web API origin',
|
|
37
|
+
tier: 'user',
|
|
38
|
+
category: 'integrations',
|
|
39
|
+
schema: SlackSettingsSchema,
|
|
40
|
+
fields: {
|
|
41
|
+
baseUrl: { ui: { label: 'API origin', component: 'text', group: 'slack' } }
|
|
42
|
+
},
|
|
43
|
+
groups: [{ id: 'slack', label: 'Slack' }],
|
|
44
|
+
allowedAdapters: ['storage.localdb', 'storage.json'],
|
|
45
|
+
defaultAdapter: 'storage.localdb',
|
|
46
|
+
scope: 'auto',
|
|
47
|
+
customTables: false,
|
|
48
|
+
version: 1,
|
|
49
|
+
internal: false,
|
|
50
|
+
context: { surfaces: ['cli', 'tui'] },
|
|
51
|
+
enabled: true
|
|
52
|
+
});
|
|
53
|
+
export default slackSettingsDescriptor;
|
|
54
|
+
//# sourceMappingURL=slack.config.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack.config.descriptor.js","sourceRoot":"","sources":["../../src/config/slack.config.descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAsB,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,cAAc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AAE,EAAE,0BAA0B;IAC9B,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE;QACP,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;KAC3E;IACD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IACzC,eAAe,EAAE,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACpD,cAAc,EAAE,iBAAiB;IACjC,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;IACrC,OAAO,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default, integrationsSlackPlugin } from './integrations-slack.plugin.ts';
|
|
2
|
+
export { default as slackDescriptor } from './slack/slack.descriptor.ts';
|
|
3
|
+
export { default as slackMessageSourceDescriptor } from './slack/slack-message-source.descriptor.ts';
|
|
4
|
+
export * from './schemas/operations.ts';
|
|
5
|
+
export * from './schemas/events.ts';
|
|
6
|
+
export * from './schemas/config.ts';
|
|
7
|
+
export type { SlackCheckResult, SlackSendMessageArgs, SlackSendMessageResult } from './slack/slack-implementation.ts';
|
|
8
|
+
export { SlackClient, getVibesSlackClient } from './client/index.ts';
|
|
9
|
+
export { verifySlackSignature } from './slack/slack-signature.ts';
|
|
10
|
+
export { default as slackSignatureVerifierDescriptor } from './slack/slack-signature-verifier.descriptor.ts';
|
|
11
|
+
export { slackMessageDescriptor, slackAppMentionDescriptor, slackReactionAddedDescriptor, slackWebhookEventDescriptors } from './slack/slack-events.descriptors.ts';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,uBAAuB,EACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EACN,OAAO,IAAI,4BAA4B,EACvC,MAAM,4CAA4C,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACX,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAC7G,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,MAAM,qCAAqC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default, integrationsSlackPlugin } from "./integrations-slack.plugin.js";
|
|
2
|
+
export { default as slackDescriptor } from "./slack/slack.descriptor.js";
|
|
3
|
+
export { default as slackMessageSourceDescriptor } from "./slack/slack-message-source.descriptor.js";
|
|
4
|
+
export * from "./schemas/operations.js";
|
|
5
|
+
export * from "./schemas/events.js";
|
|
6
|
+
export * from "./schemas/config.js";
|
|
7
|
+
export { SlackClient, getVibesSlackClient } from "./client/index.js";
|
|
8
|
+
export { verifySlackSignature } from "./slack/slack-signature.js";
|
|
9
|
+
export { default as slackSignatureVerifierDescriptor } from "./slack/slack-signature-verifier.descriptor.js";
|
|
10
|
+
export { slackMessageDescriptor, slackAppMentionDescriptor, slackReactionAddedDescriptor, slackWebhookEventDescriptors } from "./slack/slack-events.descriptors.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,uBAAuB,EACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EACN,OAAO,IAAI,4BAA4B,EACvC,MAAM,4CAA4C,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAMpC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAC7G,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations-slack.plugin.d.ts","sourceRoot":"","sources":["../src/integrations-slack.plugin.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,uBAAuB,6CA4ClC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRuntimePlugin, loader } from '@vibesdotdev/kernel/factory';
|
|
2
|
+
import slackDescriptor from "./slack/slack.descriptor.js";
|
|
3
|
+
import slackMessageSourceDescriptor from "./slack/slack-message-source.descriptor.js";
|
|
4
|
+
import slackSignatureVerifierDescriptor from "./slack/slack-signature-verifier.descriptor.js";
|
|
5
|
+
import { slackWebhookEventDescriptors } from "./slack/slack-events.descriptors.js";
|
|
6
|
+
import slackSettingsDescriptor from "./config/slack.config.descriptor.js";
|
|
7
|
+
const SIGNATURE_VERIFIER = { kind: 'tools/signature-verifier' };
|
|
8
|
+
const WEBHOOK_EVENT_DEFINITION = { kind: 'tools/webhook-event-definition' };
|
|
9
|
+
export const integrationsSlackPlugin = createRuntimePlugin({
|
|
10
|
+
id: 'integrations-slack',
|
|
11
|
+
name: 'Slack Messaging Integration',
|
|
12
|
+
description: 'Slack provider pack for Web API operations, agent message-source discovery, and webhook signature verification + event definitions.',
|
|
13
|
+
dependencies: ['integrations', 'tools/agents', 'tools'],
|
|
14
|
+
descriptors: [
|
|
15
|
+
slackSettingsDescriptor,
|
|
16
|
+
slackDescriptor,
|
|
17
|
+
{
|
|
18
|
+
id: 'slack',
|
|
19
|
+
kind: 'runtime/client',
|
|
20
|
+
description: 'Canonical Slack client — messages namespace over declared operations'
|
|
21
|
+
},
|
|
22
|
+
slackMessageSourceDescriptor,
|
|
23
|
+
slackSignatureVerifierDescriptor,
|
|
24
|
+
...slackWebhookEventDescriptors
|
|
25
|
+
],
|
|
26
|
+
loaders: [
|
|
27
|
+
loader(slackDescriptor.id, { kind: 'integration/provider' }, async () => {
|
|
28
|
+
const { SlackIntegrationProvider } = await import("./slack/slack-implementation.js");
|
|
29
|
+
return { default: SlackIntegrationProvider };
|
|
30
|
+
}),
|
|
31
|
+
loader('slack', { kind: 'runtime/client' }, async () => {
|
|
32
|
+
const { SlackClient } = await import("./client/runtime-client.js");
|
|
33
|
+
return { impl: SlackClient };
|
|
34
|
+
}),
|
|
35
|
+
loader(slackSignatureVerifierDescriptor.id, SIGNATURE_VERIFIER, async () => {
|
|
36
|
+
const mod = await import("./slack/slack-signature-verifier.impl.js");
|
|
37
|
+
return mod.default;
|
|
38
|
+
}),
|
|
39
|
+
loader('webhook-event.slack.message', WEBHOOK_EVENT_DEFINITION, async () => {
|
|
40
|
+
const mod = await import("./slack/slack-events.impls.js");
|
|
41
|
+
return mod.slackMessageImpl;
|
|
42
|
+
}),
|
|
43
|
+
loader('webhook-event.slack.app_mention', WEBHOOK_EVENT_DEFINITION, async () => {
|
|
44
|
+
const mod = await import("./slack/slack-events.impls.js");
|
|
45
|
+
return mod.slackAppMentionImpl;
|
|
46
|
+
}),
|
|
47
|
+
loader('webhook-event.slack.reaction_added', WEBHOOK_EVENT_DEFINITION, async () => {
|
|
48
|
+
const mod = await import("./slack/slack-events.impls.js");
|
|
49
|
+
return mod.slackReactionAddedImpl;
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
export default integrationsSlackPlugin;
|
|
54
|
+
//# sourceMappingURL=integrations-slack.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations-slack.plugin.js","sourceRoot":"","sources":["../src/integrations-slack.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,4BAA4B,MAAM,4CAA4C,CAAC;AACtF,OAAO,gCAAgC,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,uBAAuB,MAAM,qCAAqC,CAAC;AAE1E,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,0BAA0B,EAAW,CAAC;AACzE,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,gCAAgC,EAAW,CAAC;AAErF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;IAC1D,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,6BAA6B;IACnC,WAAW,EACV,qIAAqI;IACtI,YAAY,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,CAAC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AC,CAAC;QACF,MAAM,CAAC,oCAAoC,EAAE,wBAAwB,EAAE,KAAK,IAAI,EAAE;YACjF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;YAC1D,OAAO,GAAG,CAAC,sBAAsB,CAAC;QACnC,CAAC,CAAC;KACF;CACD,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const SLACK_DEFAULT_BASE_URL = "https://slack.com/api";
|
|
3
|
+
export declare const SlackSettingsSchema: z.ZodObject<{
|
|
4
|
+
baseUrl: z.ZodDefault<z.ZodURL>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type SlackSettings = z.infer<typeof SlackSettingsSchema>;
|
|
7
|
+
export declare const SlackSignatureOptionsSchema: z.ZodObject<{
|
|
8
|
+
nowMs: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type SlackSignatureOptions = z.infer<typeof SlackSignatureOptionsSchema>;
|
|
11
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/schemas/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAC9D,eAAO,MAAM,mBAAmB;;iBAE9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,eAAO,MAAM,2BAA2B;;iBAAsD,CAAC;AAC/F,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export const SLACK_DEFAULT_BASE_URL = 'https://slack.com/api';
|
|
3
|
+
export const SlackSettingsSchema = z.object({
|
|
4
|
+
baseUrl: z.url().default(SLACK_DEFAULT_BASE_URL)
|
|
5
|
+
});
|
|
6
|
+
export const SlackSignatureOptionsSchema = z.object({ nowMs: z.number().finite().optional() });
|
|
7
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/schemas/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,sBAAsB,CAAC;CAChD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC"}
|