plugin-sensitive-filter-xr 0.1.20 → 0.1.21
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/README.md +2 -4
- package/dist/lib/sensitiveFilter.d.ts.map +1 -1
- package/dist/lib/sensitiveFilter.js +47 -43
- package/dist/lib/types.d.ts +27 -49
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
- `beforeAgent`: evaluates and optionally rewrites/blocks input
|
|
11
11
|
- `wrapModelCall`: evaluates and optionally rewrites/blocks output
|
|
12
|
-
- `afterAgent`: sends matched alerts to configured WeCom group webhooks
|
|
12
|
+
- `afterAgent`: writes audit snapshot and sends matched alerts to configured WeCom group webhooks
|
|
13
13
|
|
|
14
14
|
## Configuration
|
|
15
15
|
|
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
| --- | --- | --- | --- | --- |
|
|
31
31
|
| `enabled` | `boolean` | No | `true` | Turn notification on/off. |
|
|
32
32
|
| `groups` | `Array<{name?, webhookUrl}>` | Runtime-required for sending | `[]` | One or more WeCom group webhook targets. |
|
|
33
|
-
| `mentionedList` | `string[]` | No | `[]` | Optional `@member` list. |
|
|
34
|
-
| `mentionedMobileList` | `string[]` | No | `[]` | Optional `@mobile` list. |
|
|
35
33
|
| `timeoutMs` | `number` | No | `10000` | Per webhook request timeout (max `120000`). |
|
|
36
34
|
|
|
37
35
|
### Rule Mode (`mode=rule`)
|
|
@@ -102,6 +100,6 @@ Current behavior:
|
|
|
102
100
|
- Ensure `model/scope/rulePrompt` are all present.
|
|
103
101
|
|
|
104
102
|
3. Unexpected rewrites in LLM mode:
|
|
105
|
-
- Check runtime logs for entries with `source=error-policy` and `reason` starting with `llm-error:`.
|
|
103
|
+
- Check audit records or runtime logs for entries with `source=error-policy` and `reason` starting with `llm-error:`.
|
|
106
104
|
|
|
107
105
|
## Validation Commands
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensitiveFilter.d.ts","sourceRoot":"","sources":["../../src/lib/sensitiveFilter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAa,oBAAoB,EAA8B,MAAM,kBAAkB,CAAA;AAGnG,OAAO,EACL,eAAe,EAGf,uBAAuB,EACvB,wBAAwB,EAEzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAML,qBAAqB,EAMtB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"sensitiveFilter.d.ts","sourceRoot":"","sources":["../../src/lib/sensitiveFilter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAa,oBAAoB,EAA8B,MAAM,kBAAkB,CAAA;AAGnG,OAAO,EACL,eAAe,EAGf,uBAAuB,EACvB,wBAAwB,EAEzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAML,qBAAqB,EAMtB,MAAM,YAAY,CAAA;AA67BnB,qBAEa,yBAA0B,YAAW,wBAAwB,CAAC,qBAAqB,CAAC;IAE/F,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IAEvC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAuQlC;IAEK,gBAAgB,CACpB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,eAAe,CAAC;IAa3B,OAAO,CAAC,wBAAwB;IA6ThC,OAAO,CAAC,uBAAuB;CA0gBhC;AAED,YAAY,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -33,19 +33,6 @@ function toNonEmptyString(value) {
|
|
|
33
33
|
const trimmed = value.trim();
|
|
34
34
|
return trimmed ? trimmed : null;
|
|
35
35
|
}
|
|
36
|
-
function normalizeStringList(value) {
|
|
37
|
-
if (!Array.isArray(value)) {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
const unique = new Set();
|
|
41
|
-
for (const item of value) {
|
|
42
|
-
const normalized = toNonEmptyString(item);
|
|
43
|
-
if (normalized) {
|
|
44
|
-
unique.add(normalized);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return [...unique];
|
|
48
|
-
}
|
|
49
36
|
function resolveRuntimeWecomConfig(config) {
|
|
50
37
|
if (!isRecord(config) || config.enabled === false) {
|
|
51
38
|
return null;
|
|
@@ -74,8 +61,6 @@ function resolveRuntimeWecomConfig(config) {
|
|
|
74
61
|
return {
|
|
75
62
|
groups,
|
|
76
63
|
timeoutMs,
|
|
77
|
-
mentionedList: normalizeStringList(config.mentionedList),
|
|
78
|
-
mentionedMobileList: normalizeStringList(config.mentionedMobileList),
|
|
79
64
|
};
|
|
80
65
|
}
|
|
81
66
|
function buildInternalModelConfig(model) {
|
|
@@ -134,22 +119,59 @@ function extractInputText(state, runtime) {
|
|
|
134
119
|
return '';
|
|
135
120
|
}
|
|
136
121
|
function buildMatchedNotificationMessage(input) {
|
|
122
|
+
const modeLabel = input.mode === 'rule' ? '规则模式' : 'LLM 模式';
|
|
123
|
+
const finalActionLabel = input.finalAction === 'block' ? '已拦截' : input.finalAction === 'rewrite' ? '已改写' : '放行';
|
|
124
|
+
const phaseLabel = (phase) => (phase === 'input' ? '输入' : '输出');
|
|
125
|
+
const actionLabel = (action) => {
|
|
126
|
+
if (action === 'block') {
|
|
127
|
+
return '拦截';
|
|
128
|
+
}
|
|
129
|
+
if (action === 'rewrite') {
|
|
130
|
+
return '改写';
|
|
131
|
+
}
|
|
132
|
+
return '未指定';
|
|
133
|
+
};
|
|
134
|
+
const sourceLabel = (source) => {
|
|
135
|
+
if (source === 'rule') {
|
|
136
|
+
return '规则';
|
|
137
|
+
}
|
|
138
|
+
if (source === 'llm') {
|
|
139
|
+
return 'LLM';
|
|
140
|
+
}
|
|
141
|
+
return '异常兜底策略';
|
|
142
|
+
};
|
|
143
|
+
const reasonLabel = (reason) => {
|
|
144
|
+
if (!reason) {
|
|
145
|
+
return '无';
|
|
146
|
+
}
|
|
147
|
+
if (reason.startsWith('rule:')) {
|
|
148
|
+
return `命中规则 ${reason.replace('rule:', '')}`;
|
|
149
|
+
}
|
|
150
|
+
if (reason.startsWith('llm-error:')) {
|
|
151
|
+
return `LLM判定异常: ${reason.replace('llm-error:', '')}`;
|
|
152
|
+
}
|
|
153
|
+
if (reason.startsWith('llm-fail-open:')) {
|
|
154
|
+
return `LLM故障放行: ${reason.replace('llm-fail-open:', '')}`;
|
|
155
|
+
}
|
|
156
|
+
return reason;
|
|
157
|
+
};
|
|
137
158
|
const matched = input.records.filter((entry) => entry.matched);
|
|
138
159
|
const lines = [
|
|
139
|
-
'
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
160
|
+
'【敏感内容告警】',
|
|
161
|
+
`节点:${input.nodeTitle || SENSITIVE_FILTER_MIDDLEWARE_NAME}`,
|
|
162
|
+
`模式:${modeLabel}`,
|
|
163
|
+
`处理结果:${finalActionLabel}`,
|
|
164
|
+
`命中数量:${matched.length}`,
|
|
144
165
|
];
|
|
145
166
|
if (input.runtimeConfigurable?.thread_id) {
|
|
146
|
-
lines.push(
|
|
167
|
+
lines.push(`会话ID:${input.runtimeConfigurable.thread_id}`);
|
|
147
168
|
}
|
|
148
169
|
if (input.runtimeConfigurable?.executionId) {
|
|
149
|
-
lines.push(
|
|
170
|
+
lines.push(`执行ID:${input.runtimeConfigurable.executionId}`);
|
|
150
171
|
}
|
|
172
|
+
lines.push('命中详情:');
|
|
151
173
|
matched.forEach((entry, index) => {
|
|
152
|
-
lines.push(`${index + 1}.
|
|
174
|
+
lines.push(`${index + 1}. 阶段=${phaseLabel(entry.phase)},来源=${sourceLabel(entry.source)},动作=${actionLabel(entry.action)},依据=${reasonLabel(entry.reason)}`);
|
|
153
175
|
});
|
|
154
176
|
return lines.join('\n');
|
|
155
177
|
}
|
|
@@ -612,8 +634,6 @@ async function dispatchWecomNotification(wecomConfig, message) {
|
|
|
612
634
|
msgtype: 'text',
|
|
613
635
|
text: {
|
|
614
636
|
content: message,
|
|
615
|
-
mentioned_list: wecomConfig.mentionedList,
|
|
616
|
-
mentioned_mobile_list: wecomConfig.mentionedMobileList,
|
|
617
637
|
},
|
|
618
638
|
};
|
|
619
639
|
for (const group of wecomConfig.groups) {
|
|
@@ -925,20 +945,6 @@ let SensitiveFilterMiddleware = class SensitiveFilterMiddleware {
|
|
|
925
945
|
type: 'number',
|
|
926
946
|
title: { en_US: 'Timeout (ms)', zh_Hans: '请求超时(毫秒)' },
|
|
927
947
|
},
|
|
928
|
-
mentionedList: {
|
|
929
|
-
type: 'array',
|
|
930
|
-
title: { en_US: 'Mentioned List', zh_Hans: '@成员列表' },
|
|
931
|
-
items: {
|
|
932
|
-
type: 'string',
|
|
933
|
-
},
|
|
934
|
-
},
|
|
935
|
-
mentionedMobileList: {
|
|
936
|
-
type: 'array',
|
|
937
|
-
title: { en_US: 'Mentioned Mobile List', zh_Hans: '@手机号列表' },
|
|
938
|
-
items: {
|
|
939
|
-
type: 'string',
|
|
940
|
-
},
|
|
941
|
-
},
|
|
942
948
|
groups: {
|
|
943
949
|
type: 'array',
|
|
944
950
|
title: { en_US: 'Group Webhooks', zh_Hans: '群聊 Webhook 配置' },
|
|
@@ -1242,6 +1248,7 @@ let SensitiveFilterMiddleware = class SensitiveFilterMiddleware {
|
|
|
1242
1248
|
return replaceModelResponseText(response, rewrittenOutput);
|
|
1243
1249
|
},
|
|
1244
1250
|
afterAgent: async () => {
|
|
1251
|
+
await persistAuditSnapshot();
|
|
1245
1252
|
const matchedRecords = auditEntries.filter((entry) => entry.matched);
|
|
1246
1253
|
if (matchedRecords.length > 0) {
|
|
1247
1254
|
const notification = buildMatchedNotificationMessage({
|
|
@@ -1253,8 +1260,6 @@ let SensitiveFilterMiddleware = class SensitiveFilterMiddleware {
|
|
|
1253
1260
|
});
|
|
1254
1261
|
await dispatchWecomNotification(wecomConfig, notification);
|
|
1255
1262
|
}
|
|
1256
|
-
// Keep audit persistence implementation for future fallback.
|
|
1257
|
-
// await persistAuditSnapshot()
|
|
1258
1263
|
return undefined;
|
|
1259
1264
|
},
|
|
1260
1265
|
};
|
|
@@ -1673,6 +1678,7 @@ let SensitiveFilterMiddleware = class SensitiveFilterMiddleware {
|
|
|
1673
1678
|
return replaceModelResponseText(response, toNonEmptyString(decision.replacementText) ?? llmConfig.rewriteFallbackText);
|
|
1674
1679
|
},
|
|
1675
1680
|
afterAgent: async () => {
|
|
1681
|
+
await persistAuditSnapshot();
|
|
1676
1682
|
const matchedRecords = auditEntries.filter((entry) => entry.matched);
|
|
1677
1683
|
if (matchedRecords.length > 0) {
|
|
1678
1684
|
const notification = buildMatchedNotificationMessage({
|
|
@@ -1684,8 +1690,6 @@ let SensitiveFilterMiddleware = class SensitiveFilterMiddleware {
|
|
|
1684
1690
|
});
|
|
1685
1691
|
await dispatchWecomNotification(wecomConfig, notification);
|
|
1686
1692
|
}
|
|
1687
|
-
// Keep audit persistence implementation for future fallback.
|
|
1688
|
-
// await persistAuditSnapshot()
|
|
1689
1693
|
return undefined;
|
|
1690
1694
|
},
|
|
1691
1695
|
};
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -46,8 +46,6 @@ export type WecomNotifyGroup = {
|
|
|
46
46
|
export type WecomNotifyConfig = {
|
|
47
47
|
enabled?: boolean;
|
|
48
48
|
groups?: Array<WecomNotifyGroup | null>;
|
|
49
|
-
mentionedList?: string[] | null;
|
|
50
|
-
mentionedMobileList?: string[] | null;
|
|
51
49
|
timeoutMs?: number | null;
|
|
52
50
|
};
|
|
53
51
|
export type LlmDecision = {
|
|
@@ -105,32 +103,25 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
105
103
|
name?: string;
|
|
106
104
|
webhookUrl?: string;
|
|
107
105
|
}>>, "many">>>;
|
|
108
|
-
mentionedList: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>;
|
|
109
|
-
mentionedMobileList: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>;
|
|
110
106
|
timeoutMs: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
111
107
|
}, "strip", z.ZodTypeAny, {
|
|
112
|
-
timeoutMs?: number;
|
|
113
108
|
enabled?: boolean;
|
|
114
109
|
groups?: {
|
|
115
110
|
name?: string;
|
|
116
111
|
webhookUrl?: string;
|
|
117
112
|
}[];
|
|
118
|
-
mentionedList?: string[];
|
|
119
|
-
mentionedMobileList?: string[];
|
|
120
|
-
}, {
|
|
121
113
|
timeoutMs?: number;
|
|
114
|
+
}, {
|
|
122
115
|
enabled?: boolean;
|
|
123
116
|
groups?: {
|
|
124
117
|
name?: string;
|
|
125
118
|
webhookUrl?: string;
|
|
126
119
|
}[];
|
|
127
|
-
|
|
128
|
-
mentionedMobileList?: string[];
|
|
120
|
+
timeoutMs?: number;
|
|
129
121
|
}>>>>;
|
|
130
122
|
llm: z.ZodOptional<z.ZodUnknown>;
|
|
131
123
|
generalPack: z.ZodOptional<z.ZodUnknown>;
|
|
132
124
|
}, "strip", z.ZodTypeAny, {
|
|
133
|
-
llm?: unknown;
|
|
134
125
|
mode?: "rule";
|
|
135
126
|
rules?: {
|
|
136
127
|
id?: string;
|
|
@@ -144,18 +135,16 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
144
135
|
caseSensitive?: boolean;
|
|
145
136
|
normalize?: boolean;
|
|
146
137
|
wecom?: {
|
|
147
|
-
timeoutMs?: number;
|
|
148
138
|
enabled?: boolean;
|
|
149
139
|
groups?: {
|
|
150
140
|
name?: string;
|
|
151
141
|
webhookUrl?: string;
|
|
152
142
|
}[];
|
|
153
|
-
|
|
154
|
-
mentionedMobileList?: string[];
|
|
143
|
+
timeoutMs?: number;
|
|
155
144
|
};
|
|
145
|
+
llm?: unknown;
|
|
156
146
|
generalPack?: unknown;
|
|
157
147
|
}, {
|
|
158
|
-
llm?: unknown;
|
|
159
148
|
mode?: "rule";
|
|
160
149
|
rules?: {
|
|
161
150
|
id?: string;
|
|
@@ -169,15 +158,14 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
169
158
|
caseSensitive?: boolean;
|
|
170
159
|
normalize?: boolean;
|
|
171
160
|
wecom?: {
|
|
172
|
-
timeoutMs?: number;
|
|
173
161
|
enabled?: boolean;
|
|
174
162
|
groups?: {
|
|
175
163
|
name?: string;
|
|
176
164
|
webhookUrl?: string;
|
|
177
165
|
}[];
|
|
178
|
-
|
|
179
|
-
mentionedMobileList?: string[];
|
|
166
|
+
timeoutMs?: number;
|
|
180
167
|
};
|
|
168
|
+
llm?: unknown;
|
|
181
169
|
generalPack?: unknown;
|
|
182
170
|
}>, z.ZodObject<{
|
|
183
171
|
mode: z.ZodLiteral<"llm">;
|
|
@@ -194,6 +182,7 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
194
182
|
timeoutMs: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
195
183
|
}, "strip", z.ZodTypeAny, {
|
|
196
184
|
scope?: "input" | "output" | "both";
|
|
185
|
+
timeoutMs?: number;
|
|
197
186
|
model?: ICopilotModel;
|
|
198
187
|
rulePrompt?: string;
|
|
199
188
|
systemPrompt?: string;
|
|
@@ -202,9 +191,9 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
202
191
|
errorRewriteText?: string;
|
|
203
192
|
blockMessage?: string;
|
|
204
193
|
rewriteFallbackText?: string;
|
|
205
|
-
timeoutMs?: number;
|
|
206
194
|
}, {
|
|
207
195
|
scope?: "input" | "output" | "both";
|
|
196
|
+
timeoutMs?: number;
|
|
208
197
|
model?: ICopilotModel;
|
|
209
198
|
rulePrompt?: string;
|
|
210
199
|
systemPrompt?: string;
|
|
@@ -213,7 +202,6 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
213
202
|
errorRewriteText?: string;
|
|
214
203
|
blockMessage?: string;
|
|
215
204
|
rewriteFallbackText?: string;
|
|
216
|
-
timeoutMs?: number;
|
|
217
205
|
}>>>>;
|
|
218
206
|
wecom: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
219
207
|
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -227,63 +215,42 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
227
215
|
name?: string;
|
|
228
216
|
webhookUrl?: string;
|
|
229
217
|
}>>, "many">>>;
|
|
230
|
-
mentionedList: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>;
|
|
231
|
-
mentionedMobileList: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>;
|
|
232
218
|
timeoutMs: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
233
219
|
}, "strip", z.ZodTypeAny, {
|
|
234
|
-
timeoutMs?: number;
|
|
235
220
|
enabled?: boolean;
|
|
236
221
|
groups?: {
|
|
237
222
|
name?: string;
|
|
238
223
|
webhookUrl?: string;
|
|
239
224
|
}[];
|
|
240
|
-
mentionedList?: string[];
|
|
241
|
-
mentionedMobileList?: string[];
|
|
242
|
-
}, {
|
|
243
225
|
timeoutMs?: number;
|
|
226
|
+
}, {
|
|
244
227
|
enabled?: boolean;
|
|
245
228
|
groups?: {
|
|
246
229
|
name?: string;
|
|
247
230
|
webhookUrl?: string;
|
|
248
231
|
}[];
|
|
249
|
-
|
|
250
|
-
mentionedMobileList?: string[];
|
|
232
|
+
timeoutMs?: number;
|
|
251
233
|
}>>>>;
|
|
252
234
|
rules: z.ZodOptional<z.ZodUnknown>;
|
|
253
235
|
caseSensitive: z.ZodOptional<z.ZodUnknown>;
|
|
254
236
|
normalize: z.ZodOptional<z.ZodUnknown>;
|
|
255
237
|
generalPack: z.ZodOptional<z.ZodUnknown>;
|
|
256
238
|
}, "strip", z.ZodTypeAny, {
|
|
257
|
-
llm?: {
|
|
258
|
-
scope?: "input" | "output" | "both";
|
|
259
|
-
model?: ICopilotModel;
|
|
260
|
-
rulePrompt?: string;
|
|
261
|
-
systemPrompt?: string;
|
|
262
|
-
outputMethod?: "functionCalling" | "jsonMode" | "jsonSchema";
|
|
263
|
-
onLlmError?: "block" | "rewrite";
|
|
264
|
-
errorRewriteText?: string;
|
|
265
|
-
blockMessage?: string;
|
|
266
|
-
rewriteFallbackText?: string;
|
|
267
|
-
timeoutMs?: number;
|
|
268
|
-
};
|
|
269
239
|
mode?: "llm";
|
|
270
240
|
rules?: unknown;
|
|
271
241
|
caseSensitive?: unknown;
|
|
272
242
|
normalize?: unknown;
|
|
273
243
|
wecom?: {
|
|
274
|
-
timeoutMs?: number;
|
|
275
244
|
enabled?: boolean;
|
|
276
245
|
groups?: {
|
|
277
246
|
name?: string;
|
|
278
247
|
webhookUrl?: string;
|
|
279
248
|
}[];
|
|
280
|
-
|
|
281
|
-
mentionedMobileList?: string[];
|
|
249
|
+
timeoutMs?: number;
|
|
282
250
|
};
|
|
283
|
-
generalPack?: unknown;
|
|
284
|
-
}, {
|
|
285
251
|
llm?: {
|
|
286
252
|
scope?: "input" | "output" | "both";
|
|
253
|
+
timeoutMs?: number;
|
|
287
254
|
model?: ICopilotModel;
|
|
288
255
|
rulePrompt?: string;
|
|
289
256
|
systemPrompt?: string;
|
|
@@ -292,21 +259,32 @@ export declare const sensitiveFilterConfigSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
292
259
|
errorRewriteText?: string;
|
|
293
260
|
blockMessage?: string;
|
|
294
261
|
rewriteFallbackText?: string;
|
|
295
|
-
timeoutMs?: number;
|
|
296
262
|
};
|
|
263
|
+
generalPack?: unknown;
|
|
264
|
+
}, {
|
|
297
265
|
mode?: "llm";
|
|
298
266
|
rules?: unknown;
|
|
299
267
|
caseSensitive?: unknown;
|
|
300
268
|
normalize?: unknown;
|
|
301
269
|
wecom?: {
|
|
302
|
-
timeoutMs?: number;
|
|
303
270
|
enabled?: boolean;
|
|
304
271
|
groups?: {
|
|
305
272
|
name?: string;
|
|
306
273
|
webhookUrl?: string;
|
|
307
274
|
}[];
|
|
308
|
-
|
|
309
|
-
|
|
275
|
+
timeoutMs?: number;
|
|
276
|
+
};
|
|
277
|
+
llm?: {
|
|
278
|
+
scope?: "input" | "output" | "both";
|
|
279
|
+
timeoutMs?: number;
|
|
280
|
+
model?: ICopilotModel;
|
|
281
|
+
rulePrompt?: string;
|
|
282
|
+
systemPrompt?: string;
|
|
283
|
+
outputMethod?: "functionCalling" | "jsonMode" | "jsonSchema";
|
|
284
|
+
onLlmError?: "block" | "rewrite";
|
|
285
|
+
errorRewriteText?: string;
|
|
286
|
+
blockMessage?: string;
|
|
287
|
+
rewriteFallbackText?: string;
|
|
310
288
|
};
|
|
311
289
|
generalPack?: unknown;
|
|
312
290
|
}>]>;
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;IACzB,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAClC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CA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AAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,wSAA8R,CAAA;AA+D9T,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAuD,CAAA;AAE/F,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAA"}
|
package/dist/lib/types.js
CHANGED
|
@@ -33,8 +33,6 @@ const wecomNotifyGroupSchema = z
|
|
|
33
33
|
const wecomNotifyConfigSchema = z.object({
|
|
34
34
|
enabled: z.boolean().optional().default(true),
|
|
35
35
|
groups: z.array(wecomNotifyGroupSchema).optional().default([]),
|
|
36
|
-
mentionedList: z.array(z.string()).optional().nullable().default([]),
|
|
37
|
-
mentionedMobileList: z.array(z.string()).optional().nullable().default([]),
|
|
38
36
|
timeoutMs: z.number().int().positive().max(120000).optional().nullable(),
|
|
39
37
|
});
|
|
40
38
|
const ruleModeConfigSchema = z.object({
|