This commit is contained in:
dengqichen 2025-11-21 18:32:56 +08:00
parent 445b69f2a4
commit 3308b7d1d0
3 changed files with 24 additions and 14 deletions

View File

@ -99,9 +99,7 @@ export class WindsurfAdapter extends BaseAdapter {
async afterWorkflow(context: any, result: any): Promise<void> {
console.log('✅ Windsurf workflow completed');
// TODO: 保存数据到数据库
// const db = this.getTool<DatabaseTool>('database');
// await db.save('accounts', context.data.account);
// 数据库保存已在 yaml 中通过 saveToDatabase handler 完成
}
/**

View File

@ -142,13 +142,15 @@ export class CardGeneratorTool extends BaseTool<CardGeneratorConfig> {
if (canUseAdvancedStrategies) {
const rand = Math.random();
if (rand < 0.2) {
if (rand < 0.5) {
// 50% 权重生成严格按照70张成功案例的统计规律
return this.generateByWeights(selectedPrefix, digitsNeeded, length);
}
if (rand < 0.8) {
if (rand < 0.9) {
// 40% 变异生成从成功案例变异1-2位
return this.generateByMutation(selectedPrefix, successfulPatterns || [], generation.mutationDigits || [1, 1], digitsNeeded, length);
}
// 其余概率走纯随机策略
// 10% 纯随机(保持多样性)
}
if (useLuhn) {
@ -289,15 +291,10 @@ export class CardGeneratorTool extends BaseTool<CardGeneratorConfig> {
return generateLuhnNumber(prefix, totalLength);
}
// 基于60个成功案例的位置权重频率分布
// 基于70个真实成功案例的位置权重后2位不含校验位
const positionWeights = [
[7, 5, 8, 2, 5, 7, 6, 7, 6, 7], // 位置1
[7, 5, 7, 4, 11, 4, 2, 8, 8, 4], // 位置2
[5, 4, 4, 9, 6, 7, 7, 6, 5, 7], // 位置3
[12, 5, 8, 7, 7, 5, 4, 6, 5, 1], // 位置4: 数字0占20%
[9, 6, 7, 3, 5, 6, 3, 9, 7, 5], // 位置5
[10, 4, 5, 9, 7, 8, 4, 5, 6, 2], // 位置6
[7, 3, 7, 2, 9, 6, 4, 6, 9, 7], // 位置7
[12, 7, 10, 7, 8, 5, 5, 9, 6, 1], // 百位: 0占17.1%
[9, 7, 8, 3, 6, 7, 3, 10, 9, 8] // 十位: 7占14.3%
];
if (digitsNeeded > positionWeights.length) {

View File

@ -30,6 +30,21 @@ export const CARD_TYPES: Record<string, CardTypeConfig> = {
unionpay: {
name: '中国银联 (UnionPay)',
// 农业银行622836开头的13位BIN可生成6,500张
successfulPatterns: [
// 原始基础数据16张
'8127', '4196', '4577', '9496', '4005', '1058', '0809', '6490', '7194',
'1288', '3748', '4235', '8483', '1070', '0063', '0548',
// 今天通过的所有卡号后缀54张
'5779', '4030', '8788', '1205', '0744', '8010', '0364', '4288', '2579',
'1755', '3235', '4435', '0627', '5204', '3734', '6732', '0302', '7201',
'7808', '2734', '0148', '0520', '3197', '0049', '1561', '4926', '7000',
'2860', '1592', '2853', '4858', '2832', '3658', '6988', '3159', '8576',
'0064', '3252', '3785', '9976', '0032', '8937', '0241', '0784', '6843',
'2551', '7914', '7930', '1796', '2809', '1254', '7146', '8903', '4460'
],
generation: {
mutationDigits: [1, 2] // 变异1-2位数字
},
prefixes: [
{ bin: '6228367540023', weight: 1, issuer: '中国农业银行', country: 'MO' },
{ bin: '6228367540057', weight: 1, issuer: '中国农业银行', country: 'MO' },