@zhin.js/plugin-content-moderation 1.1.23 → 1.1.25
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/package.json +12 -12
- package/pages/index/index.js +25 -7
- package/pages/index/index.ts +25 -7
- package/plugin.js +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/plugin-content-moderation",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "Content moderation plugin for Zhin.js — inbound/outbound multi-source scanning (Plugin Runtime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
},
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@zhin.js/console-contract": "1.1.
|
|
43
|
-
"@zhin.js/core": "1.1.
|
|
42
|
+
"@zhin.js/console-contract": "1.1.5",
|
|
43
|
+
"@zhin.js/core": "1.1.60",
|
|
44
44
|
"@zhin.js/logger": "1.1.2",
|
|
45
|
-
"@zhin.js/page": "1.1.
|
|
46
|
-
"@zhin.js/skill": "1.1.
|
|
47
|
-
"@zhin.js/tool": "1.1.
|
|
45
|
+
"@zhin.js/page": "1.1.17",
|
|
46
|
+
"@zhin.js/skill": "1.1.16",
|
|
47
|
+
"@zhin.js/tool": "1.1.18"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"typescript": "^6.0.3",
|
|
51
51
|
"vitest": "^4.1.10",
|
|
52
52
|
"zod": "^4.4.3",
|
|
53
|
-
"zhin.js": "1.1.
|
|
53
|
+
"zhin.js": "1.1.25"
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"zod": "^4.0.0",
|
|
95
|
-
"@zhin.js/middleware": "^1.1.
|
|
96
|
-
"@zhin.js/page": "^1.1.
|
|
97
|
-
"@zhin.js/skill": "^1.1.
|
|
98
|
-
"@zhin.js/tool": "^1.1.
|
|
99
|
-
"zhin.js": "^1.1.
|
|
95
|
+
"@zhin.js/middleware": "^1.1.16",
|
|
96
|
+
"@zhin.js/page": "^1.1.17",
|
|
97
|
+
"@zhin.js/skill": "^1.1.16",
|
|
98
|
+
"@zhin.js/tool": "^1.1.18",
|
|
99
|
+
"zhin.js": "^1.1.25"
|
|
100
100
|
},
|
|
101
101
|
"peerDependenciesMeta": {
|
|
102
102
|
"@zhin.js/middleware": {
|
package/pages/index/index.js
CHANGED
|
@@ -17,7 +17,16 @@ export default createDeclarativePage({
|
|
|
17
17
|
{
|
|
18
18
|
key: 'enabled',
|
|
19
19
|
label: { zh: '引擎状态', en: 'Engine Status' },
|
|
20
|
-
value:
|
|
20
|
+
value: {
|
|
21
|
+
$map: {
|
|
22
|
+
path: 'enabled',
|
|
23
|
+
cases: {
|
|
24
|
+
true: { zh: '已启用', en: 'Enabled' },
|
|
25
|
+
false: { zh: '已禁用', en: 'Disabled' },
|
|
26
|
+
},
|
|
27
|
+
default: { zh: '已禁用', en: 'Disabled' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
key: 'sensitivity',
|
|
@@ -61,12 +70,21 @@ export default createDeclarativePage({
|
|
|
61
70
|
{
|
|
62
71
|
id: 'overview',
|
|
63
72
|
title: { zh: '配置概览', en: 'Configuration Overview' },
|
|
64
|
-
entries:
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
entries: [
|
|
74
|
+
{
|
|
75
|
+
label: 'Enabled',
|
|
76
|
+
value: {
|
|
77
|
+
$map: {
|
|
78
|
+
path: 'enabled',
|
|
79
|
+
cases: { true: 'Yes', false: 'No' },
|
|
80
|
+
default: 'No',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{ label: 'Sensitivity', dataKey: 'sensitivity' },
|
|
85
|
+
{ label: 'Providers Count', dataKey: 'providersCount' },
|
|
86
|
+
{ label: 'Whitelist Count', dataKey: 'whitelistCount' },
|
|
87
|
+
{ label: 'Pending Reviews', dataKey: 'pendingReviewsCount' },
|
|
70
88
|
],
|
|
71
89
|
},
|
|
72
90
|
{
|
package/pages/index/index.ts
CHANGED
|
@@ -22,7 +22,16 @@ export default createDeclarativePage<ModerationConsoleStatus>({
|
|
|
22
22
|
{
|
|
23
23
|
key: 'enabled',
|
|
24
24
|
label: { zh: '引擎状态', en: 'Engine Status' },
|
|
25
|
-
value:
|
|
25
|
+
value: {
|
|
26
|
+
$map: {
|
|
27
|
+
path: 'enabled',
|
|
28
|
+
cases: {
|
|
29
|
+
true: { zh: '已启用', en: 'Enabled' },
|
|
30
|
+
false: { zh: '已禁用', en: 'Disabled' },
|
|
31
|
+
},
|
|
32
|
+
default: { zh: '已禁用', en: 'Disabled' },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
26
35
|
},
|
|
27
36
|
{
|
|
28
37
|
key: 'sensitivity',
|
|
@@ -66,12 +75,21 @@ export default createDeclarativePage<ModerationConsoleStatus>({
|
|
|
66
75
|
{
|
|
67
76
|
id: 'overview',
|
|
68
77
|
title: { zh: '配置概览', en: 'Configuration Overview' },
|
|
69
|
-
entries:
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
entries: [
|
|
79
|
+
{
|
|
80
|
+
label: 'Enabled',
|
|
81
|
+
value: {
|
|
82
|
+
$map: {
|
|
83
|
+
path: 'enabled',
|
|
84
|
+
cases: { true: 'Yes', false: 'No' },
|
|
85
|
+
default: 'No',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{ label: 'Sensitivity', dataKey: 'sensitivity' },
|
|
90
|
+
{ label: 'Providers Count', dataKey: 'providersCount' },
|
|
91
|
+
{ label: 'Whitelist Count', dataKey: 'whitelistCount' },
|
|
92
|
+
{ label: 'Pending Reviews', dataKey: 'pendingReviewsCount' },
|
|
75
93
|
],
|
|
76
94
|
},
|
|
77
95
|
{
|
package/plugin.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { definePlugin, definePluginCapabilityGraph, pluginConsoleRpcToken, } from 'zhin.js';
|
|
2
|
+
import { aiCompletionToken, databaseHostToken, definePlugin, definePluginCapabilityGraph, outboundHostToken, pluginConsoleRpcToken, } from 'zhin.js';
|
|
3
|
+
import { groupRuleViolationToken } from '@zhin.js/core/runtime';
|
|
3
4
|
import { createModerationConsoleRpc } from "./lib/console.js";
|
|
4
5
|
import { ModerationEngine } from "./lib/engine.js";
|
|
5
6
|
import { moderationEngineStore } from "./lib/runtime.js";
|
|
@@ -10,10 +11,19 @@ export default definePlugin({
|
|
|
10
11
|
},
|
|
11
12
|
capabilityGraph: definePluginCapabilityGraph({
|
|
12
13
|
provides: [moderationEngineStore, pluginConsoleRpcToken],
|
|
14
|
+
injects: [
|
|
15
|
+
databaseHostToken,
|
|
16
|
+
outboundHostToken,
|
|
17
|
+
groupRuleViolationToken,
|
|
18
|
+
aiCompletionToken,
|
|
19
|
+
],
|
|
13
20
|
features: {
|
|
14
21
|
middlewares: ['inbound', 'outbound'],
|
|
15
22
|
skills: ['content-moderation'],
|
|
16
|
-
tools: [
|
|
23
|
+
tools: [
|
|
24
|
+
'skill/content-moderation/moderation_check',
|
|
25
|
+
'skill/content-moderation/moderation_status',
|
|
26
|
+
],
|
|
17
27
|
pages: ['index'],
|
|
18
28
|
},
|
|
19
29
|
}),
|