@helyx/bot 1.2.0 → 1.2.1
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Load the embedded Auto Moderation engine only for a self-hosted runtime with its
|
|
8
|
+
scanner provider installed. Core-only and public-module installations no longer
|
|
9
|
+
require the optional Testing module to import or start the bot. Refresh the
|
|
10
|
+
self-host catalogue to reference the corrected bot release.
|
|
11
|
+
|
|
3
12
|
## 1.2.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -401,7 +401,7 @@ async function startUnshardedBot(processEnvironment) {
|
|
|
401
401
|
platformServices.set(HELYX_SERVICE_NAMES.memberRoles, memberRoles);
|
|
402
402
|
platformServices.set(HELYX_SERVICE_NAMES.memberRoleGrants, new PlatformMemberRoleGrantOwnershipService(new PostgresMemberRoleGrantOwnershipStore(database), memberRoles));
|
|
403
403
|
platformServices.set(HELYX_SERVICE_NAMES.discordResources, new DiscordResourceInspection(client));
|
|
404
|
-
const moderationPlatformServices = installModerationPlatformServices({
|
|
404
|
+
const moderationPlatformServices = await installModerationPlatformServices({
|
|
405
405
|
services: platformServices,
|
|
406
406
|
serviceAccess,
|
|
407
407
|
client,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModuleDefinition, ServiceAccess } from "@helyx/sdk";
|
|
2
2
|
import type { Client } from "discord.js";
|
|
3
3
|
import { BotAutoModerationScannerRegistry } from "./auto-moderation-scanner-registry.js";
|
|
4
|
-
import { EmbeddedAutoModerationScanner } from "./embedded-auto-moderation-scanner.js";
|
|
4
|
+
import type { EmbeddedAutoModerationScanner } from "./embedded-auto-moderation-scanner.js";
|
|
5
5
|
import { TransientViolationEvidenceStore } from "./transient-violation-evidence.js";
|
|
6
6
|
export interface ModerationPlatformServiceHandle {
|
|
7
7
|
evidenceStore: TransientViolationEvidenceStore;
|
|
@@ -23,5 +23,5 @@ export declare function installModerationPlatformServices(input: {
|
|
|
23
23
|
maximumItemsPerGuild: number;
|
|
24
24
|
refreshIntervalMs: number;
|
|
25
25
|
};
|
|
26
|
-
}): ModerationPlatformServiceHandle
|
|
26
|
+
}): Promise<ModerationPlatformServiceHandle>;
|
|
27
27
|
//# sourceMappingURL=moderation-platform-services.d.ts.map
|
|
@@ -4,11 +4,10 @@ import { DiscordAutoModerationAdapter } from "./discord-auto-moderation-service.
|
|
|
4
4
|
import { DiscordMessageEnforcementAdapter } from "./discord-message-enforcement-service.js";
|
|
5
5
|
import { DiscordViolationEvidenceDeliveryAdapter, DiscordViolationThreadAdapter, } from "./discord-violation-thread-service.js";
|
|
6
6
|
import { BotModerationActionRegistry } from "./moderation-action-registry.js";
|
|
7
|
-
import { EmbeddedAutoModerationScanner } from "./embedded-auto-moderation-scanner.js";
|
|
8
7
|
import { TransientViolationEvidenceStore } from "./transient-violation-evidence.js";
|
|
9
8
|
import { installModerationCaseDisassociation } from "./moderation-case-disassociation.js";
|
|
10
9
|
/** Installs bounded moderation adapters; no module or Ecko lifecycle starts here. */
|
|
11
|
-
export function installModerationPlatformServices(input) {
|
|
10
|
+
export async function installModerationPlatformServices(input) {
|
|
12
11
|
const evidenceStore = new TransientViolationEvidenceStore();
|
|
13
12
|
installModerationCaseDisassociation({
|
|
14
13
|
modules: input.modules,
|
|
@@ -22,8 +21,12 @@ export function installModerationPlatformServices(input) {
|
|
|
22
21
|
input.services.set(HELYX_SERVICE_NAMES.violationThreads, new DiscordViolationThreadAdapter(input.client));
|
|
23
22
|
input.services.set(HELYX_SERVICE_NAMES.moderationActions, new BotModerationActionRegistry(input.modules, input.serviceAccess, evidenceDelivery));
|
|
24
23
|
input.services.set(HELYX_SERVICE_NAMES.automodScannerProvider, scannerRegistry);
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
let embeddedScanner;
|
|
25
|
+
if (input.runtimeProfile === "self-hosted" &&
|
|
26
|
+
input.modules.some((module) => module.autoModerationScannerProvider)) {
|
|
27
|
+
// The engine is an optional module peer, not a core startup dependency.
|
|
28
|
+
const { EmbeddedAutoModerationScanner } = await import("./embedded-auto-moderation-scanner.js");
|
|
29
|
+
embeddedScanner = new EmbeddedAutoModerationScanner({
|
|
27
30
|
registry: scannerRegistry,
|
|
28
31
|
evidenceStore,
|
|
29
32
|
environment: input.deploymentEnvironment ?? "self-hosted",
|
|
@@ -34,8 +37,8 @@ export function installModerationPlatformServices(input) {
|
|
|
34
37
|
maximumItemsPerGuild: input.embedded?.maximumItemsPerGuild ?? 100,
|
|
35
38
|
},
|
|
36
39
|
refreshIntervalMs: input.embedded?.refreshIntervalMs ?? 300_000,
|
|
37
|
-
})
|
|
38
|
-
|
|
40
|
+
});
|
|
41
|
+
}
|
|
39
42
|
if (embeddedScanner)
|
|
40
43
|
input.services.set(HELYX_SERVICE_NAMES.automodScannerObservations, embeddedScanner);
|
|
41
44
|
return {
|
package/dist/shard-worker.js
CHANGED
|
@@ -257,7 +257,7 @@ export async function startShardWorker(processEnvironment = process.env, identit
|
|
|
257
257
|
platformServices.set(HELYX_SERVICE_NAMES.memberRoles, memberRoles);
|
|
258
258
|
platformServices.set(HELYX_SERVICE_NAMES.memberRoleGrants, new PlatformMemberRoleGrantOwnershipService(new PostgresMemberRoleGrantOwnershipStore(database), memberRoles));
|
|
259
259
|
platformServices.set(HELYX_SERVICE_NAMES.discordResources, new DiscordResourceInspection(client));
|
|
260
|
-
const moderationPlatformServices = installModerationPlatformServices({
|
|
260
|
+
const moderationPlatformServices = await installModerationPlatformServices({
|
|
261
261
|
services: platformServices,
|
|
262
262
|
serviceAccess,
|
|
263
263
|
client,
|