koishi-plugin-chatluna-character 0.0.30 → 0.0.32
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/lib/index.d.ts +5 -9
- package/lib/index.js +24 -20
- package/lib/plugins/chat.js +26 -20
- package/lib/plugins/commands.js +3 -4
- package/lib/plugins/config.d.ts +1 -1
- package/lib/plugins/config.js +2 -1
- package/lib/plugins/filter.js +10 -8
- package/lib/preset.js +1 -2
- package/lib/service/message.d.ts +15 -4
- package/lib/service/message.js +10 -2
- package/lib/service/sticker.js +1 -2
- package/package.json +73 -73
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { Context,
|
|
1
|
+
import { Context, Schema } from 'koishi';
|
|
2
2
|
import { ChatLunaPlugin } from 'koishi-plugin-chatluna/lib/services/chat';
|
|
3
|
-
import { MessageCollector } from './service/message';
|
|
4
|
-
import { StickerService } from './service/sticker';
|
|
5
|
-
import { Preset } from './preset';
|
|
6
|
-
export declare let service: MessageCollector;
|
|
7
|
-
export declare let stickerService: StickerService;
|
|
8
|
-
export declare let preset: Preset;
|
|
9
|
-
export declare let logger: Logger;
|
|
10
3
|
export declare function apply(ctx: Context, config: Config): void;
|
|
4
|
+
export declare const inject: {
|
|
5
|
+
required: string[];
|
|
6
|
+
optional: string[];
|
|
7
|
+
};
|
|
11
8
|
export interface Config extends ChatLunaPlugin.Config {
|
|
12
9
|
model: string;
|
|
13
10
|
maxMessages: number;
|
|
@@ -25,5 +22,4 @@ export interface Config extends ChatLunaPlugin.Config {
|
|
|
25
22
|
disableChatHub: boolean;
|
|
26
23
|
}
|
|
27
24
|
export declare const Config: Schema<Config>;
|
|
28
|
-
export declare const inject: string[];
|
|
29
25
|
export declare const name = "chatluna-character";
|
package/lib/index.js
CHANGED
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.name = exports.
|
|
3
|
+
exports.name = exports.Config = exports.inject = exports.apply = void 0;
|
|
4
4
|
/* eslint-disable max-len */
|
|
5
5
|
const koishi_1 = require("koishi");
|
|
6
6
|
const plugin_1 = require("./plugin");
|
|
7
7
|
const message_1 = require("./service/message");
|
|
8
|
-
const sticker_1 = require("./service/sticker");
|
|
9
|
-
const preset_1 = require("./preset");
|
|
10
|
-
const logger_1 = require("koishi-plugin-chatluna/lib/utils/logger");
|
|
11
8
|
function apply(ctx, config) {
|
|
12
|
-
|
|
9
|
+
const disposables = [];
|
|
13
10
|
ctx.on('ready', async () => {
|
|
14
|
-
|
|
15
|
-
exports.stickerService = new sticker_1.StickerService(ctx, config);
|
|
16
|
-
exports.preset = new preset_1.Preset(ctx);
|
|
17
|
-
await exports.stickerService.init();
|
|
18
|
-
await exports.preset.loadAllPreset();
|
|
19
|
-
await (0, plugin_1.plugins)(ctx, config);
|
|
11
|
+
ctx.plugin(message_1.MessageCollector, config);
|
|
20
12
|
});
|
|
21
|
-
ctx.
|
|
22
|
-
|
|
13
|
+
ctx.plugin({
|
|
14
|
+
apply: async (ctx, config) => {
|
|
15
|
+
await ctx.chatluna_character.stickerService.init();
|
|
16
|
+
await ctx.chatluna_character.preset.loadAllPreset();
|
|
17
|
+
await (0, plugin_1.plugins)(ctx, config);
|
|
18
|
+
},
|
|
19
|
+
inject: {
|
|
20
|
+
required: exports.inject.required.concat('chatluna', 'chatluna_character')
|
|
21
|
+
},
|
|
22
|
+
name: 'chatluna_entry_point'
|
|
23
|
+
}, config);
|
|
24
|
+
disposables.push(ctx.on('message', async (session) => {
|
|
25
|
+
if (!ctx.chatluna_character) {
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
25
28
|
if (!session.isDirect &&
|
|
26
29
|
config.applyGroup.some((group) => group === session.guildId)) {
|
|
27
|
-
await
|
|
30
|
+
await ctx.chatluna_character.broadcast(session);
|
|
28
31
|
}
|
|
29
|
-
});
|
|
30
|
-
ctx.on('dispose',
|
|
31
|
-
|
|
32
|
-
exports.stickerService = null;
|
|
33
|
-
exports.preset = null;
|
|
32
|
+
}));
|
|
33
|
+
ctx.on('dispose', () => {
|
|
34
|
+
disposables.forEach((disposable) => disposable());
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
exports.apply = apply;
|
|
38
|
+
exports.inject = {
|
|
39
|
+
required: ['chatluna', 'cache'],
|
|
40
|
+
optional: ['chatluna_character']
|
|
41
|
+
};
|
|
37
42
|
exports.Config = koishi_1.Schema.intersect([
|
|
38
43
|
koishi_1.Schema.object({
|
|
39
44
|
applyGroup: koishi_1.Schema.array(koishi_1.Schema.string()).description('应用到的群组'),
|
|
@@ -98,5 +103,4 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
98
103
|
.default('旧梦旧念')
|
|
99
104
|
})
|
|
100
105
|
]);
|
|
101
|
-
exports.inject = ['chatluna'];
|
|
102
106
|
exports.name = 'chatluna-character';
|
package/lib/plugins/chat.js
CHANGED
|
@@ -2,30 +2,36 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.apply = void 0;
|
|
4
4
|
const koishi_1 = require("koishi");
|
|
5
|
-
const __1 = require("..");
|
|
6
5
|
const count_tokens_1 = require("koishi-plugin-chatluna/lib/llm-core/utils/count_tokens");
|
|
7
6
|
const schema_1 = require("langchain/schema");
|
|
7
|
+
let logger;
|
|
8
8
|
async function apply(ctx, config) {
|
|
9
|
+
const service = ctx.chatluna_character;
|
|
10
|
+
const preset = service.preset;
|
|
11
|
+
const stickerService = service.stickerService;
|
|
12
|
+
logger = service.logger;
|
|
9
13
|
const [platform, modelName] = (0, count_tokens_1.parseRawModelName)(config.model);
|
|
14
|
+
await ctx.chatluna.awaitLoadPlatform(platform);
|
|
10
15
|
const model = (await ctx.chatluna.createChatModel(platform, modelName));
|
|
11
|
-
|
|
16
|
+
logger.info('chatluna model loaded %c', config.model);
|
|
17
|
+
const selectedPreset = await preset.getPreset(config.defaultPreset);
|
|
12
18
|
const systemPrompt = selectedPreset.system;
|
|
13
19
|
const completionPrompt = selectedPreset.input;
|
|
14
|
-
|
|
20
|
+
service.collect(async (session, messages) => {
|
|
15
21
|
const [recentMessage, lastMessage] = await formatMessage(messages, config, model, systemPrompt.template, completionPrompt.template);
|
|
16
|
-
const temp = await
|
|
22
|
+
const temp = await service.getTemp(session);
|
|
17
23
|
const formattedSystemPrompt = await systemPrompt.format({
|
|
18
24
|
time: new Date().toLocaleString()
|
|
19
25
|
});
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
logger.debug('messages_new: ' + JSON.stringify(recentMessage));
|
|
27
|
+
logger.debug('messages_last: ' + JSON.stringify(lastMessage));
|
|
22
28
|
const humanMessage = new schema_1.HumanMessage(await completionPrompt.format({
|
|
23
29
|
history_new: recentMessage,
|
|
24
30
|
history_last: lastMessage,
|
|
25
31
|
time: new Date().toLocaleString()
|
|
26
32
|
}));
|
|
27
33
|
const completionMessages = await formatCompletionMessages([new schema_1.SystemMessage(formattedSystemPrompt)].concat(temp.completionMessages), humanMessage, config, model);
|
|
28
|
-
|
|
34
|
+
logger.debug('completion message: ' +
|
|
29
35
|
JSON.stringify(completionMessages.map((it) => it.content)));
|
|
30
36
|
let responseMessage;
|
|
31
37
|
for (let i = 0; i < 3; i++) {
|
|
@@ -34,12 +40,12 @@ async function apply(ctx, config) {
|
|
|
34
40
|
break;
|
|
35
41
|
}
|
|
36
42
|
catch (e) {
|
|
37
|
-
|
|
43
|
+
logger.error(e);
|
|
38
44
|
await (0, koishi_1.sleep)(2000);
|
|
39
45
|
continue;
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
|
-
|
|
48
|
+
logger.debug('model response: ' + responseMessage.content);
|
|
43
49
|
const response = parseResponse(responseMessage.content);
|
|
44
50
|
temp.completionMessages.push(humanMessage, responseMessage);
|
|
45
51
|
if (temp.completionMessages.length > 30) {
|
|
@@ -48,7 +54,7 @@ async function apply(ctx, config) {
|
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
if (response.length < 1) {
|
|
51
|
-
|
|
57
|
+
service.mute(session, config.muteTime);
|
|
52
58
|
return;
|
|
53
59
|
}
|
|
54
60
|
const random = new koishi_1.Random();
|
|
@@ -60,12 +66,12 @@ async function apply(ctx, config) {
|
|
|
60
66
|
await (0, koishi_1.sleep)(random.int(maxTime / 2, maxTime));
|
|
61
67
|
session.send(elements);
|
|
62
68
|
}
|
|
63
|
-
const sticker = await
|
|
69
|
+
const sticker = await stickerService.randomStick();
|
|
64
70
|
if (sticker) {
|
|
65
71
|
session.send(sticker);
|
|
66
72
|
}
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
service.mute(session, config.coolDownTime * 1000);
|
|
74
|
+
service.broadcastOnBot(session, response.flat());
|
|
69
75
|
});
|
|
70
76
|
}
|
|
71
77
|
exports.apply = apply;
|
|
@@ -74,25 +80,25 @@ function parseResponse(response) {
|
|
|
74
80
|
try {
|
|
75
81
|
const match = response.matchAll(/\[.*?\]/g);
|
|
76
82
|
message = [...match].pop()?.[0] ?? '';
|
|
77
|
-
|
|
83
|
+
logger.debug('message: ' + message);
|
|
78
84
|
message = message.match(/\[.*(:|:).*(:|:)(.*)\]/)?.[3] ?? '';
|
|
79
85
|
message = message.match(/"(.*)"/)?.[1] ?? message;
|
|
80
|
-
|
|
86
|
+
logger.debug('message: ' + message);
|
|
81
87
|
if (typeof message !== 'string') {
|
|
82
|
-
|
|
88
|
+
logger.error('Failed to parse response: ' + response);
|
|
83
89
|
return [];
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
catch (e) {
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
logger.error(e);
|
|
94
|
+
logger.error('Failed to parse response: ' + response);
|
|
89
95
|
return [];
|
|
90
96
|
}
|
|
91
97
|
const resultElements = [];
|
|
92
98
|
const currentElements = [];
|
|
93
99
|
// match [at:name:id] -> id
|
|
94
100
|
const atMatch = matchAt(message);
|
|
95
|
-
|
|
101
|
+
logger.debug('atMatch: ' + JSON.stringify(atMatch));
|
|
96
102
|
if (atMatch.length > 0) {
|
|
97
103
|
let lastAtIndex = 0;
|
|
98
104
|
for (const at of atMatch) {
|
|
@@ -243,7 +249,7 @@ async function formatCompletionMessages(messages, humanMessage, config, model) {
|
|
|
243
249
|
currentTokens += messageTokens;
|
|
244
250
|
result.unshift(message);
|
|
245
251
|
}
|
|
246
|
-
|
|
252
|
+
logger.debug(`maxTokens: ${maxTokens}, currentTokens: ${currentTokens}`);
|
|
247
253
|
result.unshift(systemMessage);
|
|
248
254
|
return result;
|
|
249
255
|
}
|
package/lib/plugins/commands.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.apply = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
4
|
const filter_1 = require("./filter");
|
|
6
5
|
function apply(ctx, config) {
|
|
7
|
-
ctx.command('
|
|
8
|
-
ctx.command('
|
|
6
|
+
ctx.command('chatluna.character', '角色扮演相关命令');
|
|
7
|
+
ctx.command('chatluna.character.clear [group]', '清除群组的聊天记录').action(async ({ session }, group) => {
|
|
9
8
|
if (!session.isDirect) {
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
@@ -19,7 +18,7 @@ function apply(ctx, config) {
|
|
|
19
18
|
}
|
|
20
19
|
groupInfo.messageCount = 0;
|
|
21
20
|
groupInfo.messageSendProbability = 0;
|
|
22
|
-
|
|
21
|
+
ctx.chatluna_character.clear(groupId);
|
|
23
22
|
return `已清除群组 ${groupId} 的聊天记录`;
|
|
24
23
|
});
|
|
25
24
|
}
|
package/lib/plugins/config.d.ts
CHANGED
package/lib/plugins/config.js
CHANGED
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.apply = void 0;
|
|
4
4
|
const koishi_1 = require("koishi");
|
|
5
5
|
const types_1 = require("koishi-plugin-chatluna/lib/llm-core/platform/types");
|
|
6
|
-
function apply(ctx, config) {
|
|
6
|
+
async function apply(ctx, config) {
|
|
7
7
|
ctx.on('chatluna/model-added', async (service) => {
|
|
8
8
|
ctx.schema.set('model', koishi_1.Schema.union(await getModelNames(service)));
|
|
9
9
|
});
|
|
10
10
|
ctx.on('chatluna/model-removed', async (service) => {
|
|
11
11
|
ctx.schema.set('model', koishi_1.Schema.union(await getModelNames(service)));
|
|
12
12
|
});
|
|
13
|
+
ctx.schema.set('model', koishi_1.Schema.union(await getModelNames(ctx.chatluna.platform)));
|
|
13
14
|
}
|
|
14
15
|
exports.apply = apply;
|
|
15
16
|
async function getModelNames(service) {
|
package/lib/plugins/filter.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.apply = exports.groupInfos = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
4
|
exports.groupInfos = {};
|
|
6
5
|
async function apply(ctx, config) {
|
|
7
6
|
const maxMessages = config.messageInterval;
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const service = ctx.chatluna_character;
|
|
8
|
+
const preset = service.preset;
|
|
9
|
+
const logger = service.logger;
|
|
10
|
+
const selectedPreset = await preset.getPreset(config.defaultPreset);
|
|
11
|
+
service.addFilter((session, message) => {
|
|
10
12
|
const info = exports.groupInfos[session.guildId] || {
|
|
11
13
|
messageCount: 0,
|
|
12
14
|
messageSendProbability: 1
|
|
@@ -16,8 +18,8 @@ async function apply(ctx, config) {
|
|
|
16
18
|
if (config.isForceMute && selectedPreset.mute_keyword?.length > 0) {
|
|
17
19
|
const needMute = selectedPreset.mute_keyword.some((value) => message.content.includes(value));
|
|
18
20
|
if (needMute) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
logger.debug(`mute content: ${message.content}`);
|
|
22
|
+
service.mute(session, config.muteTime);
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
// 保底必出
|
|
@@ -26,7 +28,7 @@ async function apply(ctx, config) {
|
|
|
26
28
|
session.stripped.appel ||
|
|
27
29
|
(config.isNickname &&
|
|
28
30
|
selectedPreset.nick_name.some((value) => message.content.startsWith(value)))) &&
|
|
29
|
-
!
|
|
31
|
+
!service.isMute(session)) {
|
|
30
32
|
info.messageCount = 0;
|
|
31
33
|
info.messageSendProbability = 1;
|
|
32
34
|
exports.groupInfos[session.guildId] = info;
|
|
@@ -34,13 +36,13 @@ async function apply(ctx, config) {
|
|
|
34
36
|
}
|
|
35
37
|
// 按照概率出
|
|
36
38
|
if (Math.random() > messageSendProbability &&
|
|
37
|
-
!
|
|
39
|
+
!service.isMute(session)) {
|
|
38
40
|
info.messageCount = 0;
|
|
39
41
|
info.messageSendProbability = 1;
|
|
40
42
|
exports.groupInfos[session.guildId] = info;
|
|
41
43
|
return true;
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
logger.debug(`messageCount: ${messageCount}, messageSendProbability: ${messageSendProbability}. content: ${JSON.stringify(message)}`);
|
|
44
46
|
messageCount++;
|
|
45
47
|
messageSendProbability -= (1 / maxMessages) * 0.15;
|
|
46
48
|
info.messageCount = messageCount;
|
package/lib/preset.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.loadPreset = exports.Preset = void 0;
|
|
7
7
|
const koishi_1 = require("koishi");
|
|
8
8
|
const error_1 = require("koishi-plugin-chatluna/lib/utils/error");
|
|
9
|
-
const _1 = require(".");
|
|
10
9
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
11
10
|
const js_yaml_1 = require("js-yaml");
|
|
12
11
|
const prompts_1 = require("langchain/prompts");
|
|
@@ -101,7 +100,7 @@ class Preset {
|
|
|
101
100
|
const fileStat = await promises_1.default.stat(filePath);
|
|
102
101
|
if (fileStat.isFile()) {
|
|
103
102
|
await promises_1.default.mkdir(currentPresetDir, { recursive: true });
|
|
104
|
-
|
|
103
|
+
this.ctx.chatluna_character.logger.debug(`copy preset file ${filePath} to ${currentPresetDir}`);
|
|
105
104
|
await promises_1.default.copyFile(filePath, path_1.default.join(currentPresetDir, file));
|
|
106
105
|
}
|
|
107
106
|
}
|
package/lib/service/message.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { h, Session } from 'koishi';
|
|
1
|
+
import { Context, h, Logger, Service, Session } from 'koishi';
|
|
2
2
|
import { GroupTemp, Message } from '../types';
|
|
3
3
|
import { Config } from '..';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { StickerService } from './sticker';
|
|
5
|
+
import { Preset } from '../preset';
|
|
6
|
+
export declare class MessageCollector extends Service {
|
|
7
|
+
readonly ctx: Context;
|
|
8
|
+
_config: Config;
|
|
6
9
|
private _messages;
|
|
7
10
|
private _eventEmitter;
|
|
8
11
|
private _filters;
|
|
9
12
|
private _groupLocks;
|
|
10
13
|
private _groupTemp;
|
|
11
|
-
|
|
14
|
+
stickerService: StickerService;
|
|
15
|
+
preset: Preset;
|
|
16
|
+
logger: Logger;
|
|
17
|
+
constructor(ctx: Context, _config: Config);
|
|
12
18
|
addFilter(filter: MessageCollectorFilter): void;
|
|
13
19
|
mute(session: Session, time: number): void;
|
|
14
20
|
collect(func: (session: Session, messages: Message[]) => Promise<void>): void;
|
|
@@ -24,4 +30,9 @@ export declare class MessageCollector {
|
|
|
24
30
|
broadcast(session: Session): Promise<void>;
|
|
25
31
|
}
|
|
26
32
|
type MessageCollectorFilter = (session: Session, message: Message) => boolean;
|
|
33
|
+
declare module 'koishi' {
|
|
34
|
+
interface Context {
|
|
35
|
+
chatluna_character: MessageCollector;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
27
38
|
export {};
|
package/lib/service/message.js
CHANGED
|
@@ -6,14 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.MessageCollector = void 0;
|
|
7
7
|
const koishi_1 = require("koishi");
|
|
8
8
|
const events_1 = __importDefault(require("events"));
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const sticker_1 = require("./sticker");
|
|
10
|
+
const preset_1 = require("../preset");
|
|
11
|
+
const logger_1 = require("koishi-plugin-chatluna/lib/utils/logger");
|
|
12
|
+
class MessageCollector extends koishi_1.Service {
|
|
13
|
+
constructor(ctx, _config) {
|
|
14
|
+
super(ctx, 'chatluna_character');
|
|
15
|
+
this.ctx = ctx;
|
|
11
16
|
this._config = _config;
|
|
12
17
|
this._messages = {};
|
|
13
18
|
this._eventEmitter = new events_1.default();
|
|
14
19
|
this._filters = [];
|
|
15
20
|
this._groupLocks = {};
|
|
16
21
|
this._groupTemp = {};
|
|
22
|
+
this.stickerService = new sticker_1.StickerService(ctx, _config);
|
|
23
|
+
this.logger = (0, logger_1.createLogger)(ctx, 'chatluna-character');
|
|
24
|
+
this.preset = new preset_1.Preset(ctx);
|
|
17
25
|
}
|
|
18
26
|
addFilter(filter) {
|
|
19
27
|
this._filters.push(filter);
|
package/lib/service/sticker.js
CHANGED
|
@@ -30,7 +30,6 @@ exports.StickerService = void 0;
|
|
|
30
30
|
const koishi_1 = require("koishi");
|
|
31
31
|
const path_1 = __importDefault(require("path"));
|
|
32
32
|
const promises_1 = __importStar(require("fs/promises"));
|
|
33
|
-
const __1 = require("..");
|
|
34
33
|
class StickerService {
|
|
35
34
|
constructor(_ctx, _config) {
|
|
36
35
|
this._ctx = _ctx;
|
|
@@ -64,7 +63,7 @@ class StickerService {
|
|
|
64
63
|
if (!sticker) {
|
|
65
64
|
return null;
|
|
66
65
|
}
|
|
67
|
-
|
|
66
|
+
this._ctx.root.chatluna_character.logger.debug(`send sticker: ${sticker}`);
|
|
68
67
|
return koishi_1.h.image(await (0, promises_1.readFile)(sticker), `image/${getFileType(sticker)}`);
|
|
69
68
|
}
|
|
70
69
|
}
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
"name": "koishi-plugin-chatluna-character",
|
|
3
|
+
"description": "Let the large language model play a role, disguise as a group friend",
|
|
4
|
+
"version": "0.0.32",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"typings": "lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"dist",
|
|
10
|
+
"resources"
|
|
11
|
+
],
|
|
12
|
+
"license": "AGPL-3.0",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"chatbot",
|
|
15
|
+
"koishi",
|
|
16
|
+
"plugin",
|
|
17
|
+
"service",
|
|
18
|
+
"chatgpt",
|
|
19
|
+
"chatluna",
|
|
20
|
+
"preset",
|
|
21
|
+
"market"
|
|
22
|
+
],
|
|
23
|
+
"author": "dingyi222666 <dingyi222666@foxmail.com>",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/ChatLunaLab/chatluna-character.git",
|
|
27
|
+
"directory": "."
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/ChatLunaLab/chatluna-character/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/ChatLunaLab/chatluna-character#readme",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"js-yaml": "^4.1.0",
|
|
35
|
+
"langchain": "^0.0.176"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
39
|
+
"@typescript-eslint/parser": "^6.10.0",
|
|
40
|
+
"atsc": "^1.2.2",
|
|
41
|
+
"esbuild": "^0.17.19",
|
|
42
|
+
"esbuild-register": "^3.5.0",
|
|
43
|
+
"eslint": "^8.53.0",
|
|
44
|
+
"eslint-config-prettier": "^9.0.0",
|
|
45
|
+
"eslint-config-standard": "^17.1.0",
|
|
46
|
+
"eslint-plugin-import": "^2.29.0",
|
|
47
|
+
"eslint-plugin-n": "^16.3.0",
|
|
48
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
49
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
50
|
+
"koishi": "^4.15.4"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"koishi-plugin-chatluna": "^1.0.0-beta.21",
|
|
54
|
+
"koishi": "^4.15.0"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18.0.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "yakumo build",
|
|
61
|
+
"bump": "yakumo version",
|
|
62
|
+
"dep": "yakumo upgrade",
|
|
63
|
+
"pub": "yakumo publish"
|
|
64
|
+
},
|
|
65
|
+
"koishi": {
|
|
66
|
+
"description": {
|
|
67
|
+
"zh": "让大语言模型进行角色扮演,伪装成群友"
|
|
28
68
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"js-yaml": "^4.1.0",
|
|
35
|
-
"langchain": "^0.0.176"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
39
|
-
"@typescript-eslint/parser": "^6.9.1",
|
|
40
|
-
"atsc": "^1.2.2",
|
|
41
|
-
"esbuild": "^0.17.19",
|
|
42
|
-
"esbuild-register": "^3.5.0",
|
|
43
|
-
"eslint": "^8.53.0",
|
|
44
|
-
"eslint-config-prettier": "^9.0.0",
|
|
45
|
-
"eslint-config-standard": "^17.1.0",
|
|
46
|
-
"eslint-plugin-import": "^2.29.0",
|
|
47
|
-
"eslint-plugin-n": "^16.2.0",
|
|
48
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
49
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
50
|
-
"koishi": "^4.15.3"
|
|
51
|
-
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"koishi-plugin-chatluna": "^1.0.0-beta.10",
|
|
54
|
-
"koishi": "^4.15.3"
|
|
55
|
-
},
|
|
56
|
-
"engines": {
|
|
57
|
-
"node": ">=18.0.0"
|
|
58
|
-
},
|
|
59
|
-
"scripts": {
|
|
60
|
-
"build": "yakumo build",
|
|
61
|
-
"bump": "yakumo version",
|
|
62
|
-
"dep": "yakumo upgrade",
|
|
63
|
-
"pub": "yakumo publish"
|
|
64
|
-
},
|
|
65
|
-
"koishi": {
|
|
66
|
-
"description": {
|
|
67
|
-
"zh": "让大语言模型进行角色扮演,伪装成群友"
|
|
68
|
-
},
|
|
69
|
-
"preview": true,
|
|
70
|
-
"service": {
|
|
71
|
-
"required": [
|
|
72
|
-
"chathub"
|
|
73
|
-
]
|
|
74
|
-
}
|
|
69
|
+
"preview": true,
|
|
70
|
+
"service": {
|
|
71
|
+
"required": [
|
|
72
|
+
"chatluna"
|
|
73
|
+
]
|
|
75
74
|
}
|
|
76
|
-
}
|
|
75
|
+
}
|
|
76
|
+
}
|