@voltro/plugin-moderation 0.86.0 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5484 -0
- package/THIRD-PARTY-NOTICES.md +5352 -524
- package/dist/errors.js +1 -2
- package/dist/index.js +1 -2
- package/dist/providers.js +1 -2
- package/package.json +5 -5
package/dist/errors.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/errors.ts
|
|
3
3
|
var t = class extends e.TaggedError()("ContentRejected", {
|
|
4
4
|
tag: e.String,
|
|
5
5
|
categories: e.Array(e.String),
|
|
6
6
|
reason: e.String
|
|
7
7
|
}) {};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { t as ContentRejected };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ContentRejected as e } from "./errors.js";
|
|
|
2
2
|
import { aiProvider as t, keywordProvider as n } from "./providers.js";
|
|
3
3
|
import { Context as r, Effect as i, Layer as a } from "effect";
|
|
4
4
|
import { definePlugin as o, pluginInstanceName as s } from "@voltro/protocol";
|
|
5
|
-
|
|
5
|
+
// src/index.ts
|
|
6
6
|
var c = class extends r.Service()("@voltro/plugin-moderation/ModerationService") {}, l = (e) => i.flatMap(c, (t) => t.moderate(e)), u = (e, t) => {
|
|
7
7
|
if (typeof e != "object" || !e) return "";
|
|
8
8
|
let n = e;
|
|
@@ -122,5 +122,4 @@ var c = class extends r.Service()("@voltro/plugin-moderation/ModerationService")
|
|
|
122
122
|
})
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
|
-
//#endregion
|
|
126
125
|
export { e as ContentRejected, c as ModerationService, t as aiProvider, n as keywordProvider, l as moderate, f as moderationPlugin };
|
package/dist/providers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect as e } from "effect";
|
|
2
2
|
import { createLogger as t } from "@voltro/logger";
|
|
3
|
-
|
|
3
|
+
// src/providers.ts
|
|
4
4
|
var n = t({ scope: "@voltro/plugin-moderation" }), r = { flagged: !1 }, i = /[.*+?^${}()|[\]\\]/g, a = (e) => {
|
|
5
5
|
let t = (e) => e !== void 0 && /[\p{L}\p{N}_]/u.test(e), n = t(e[0]) ? "\\b" : "", r = t(e[e.length - 1]) ? "\\b" : "";
|
|
6
6
|
return RegExp(`${n}${e.replace(i, "\\$&")}${r}`, "u");
|
|
@@ -47,5 +47,4 @@ var n = t({ scope: "@voltro/plugin-moderation" }), r = { flagged: !1 }, i = /[.*
|
|
|
47
47
|
}).pipe(e.catch(() => e.succeed(r)));
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
//#endregion
|
|
51
50
|
export { s as aiProvider, o as keywordProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-moderation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "Content moderation — run an AI / keyword / custom check on user-content fields and block or flag a write before it commits. Declarative per-rpc rules + an in-handler moderate() helper for redact/inline control.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"node": ">=24.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@voltro/logger": "0.
|
|
42
|
-
"@voltro/protocol": "0.
|
|
41
|
+
"@voltro/logger": "0.88.0",
|
|
42
|
+
"@voltro/protocol": "0.88.0"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@voltro/ai": "0.
|
|
45
|
+
"@voltro/ai": "0.88.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"effect": "4.0
|
|
48
|
+
"effect": "4.1.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|