@musnows/scriverse 1.1.0 → 1.1.1
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/dist/public/ai-skill-menu.js +25 -5
- package/dist/public/app.js +285 -97
- package/dist/public/chapter-directory.d.ts +22 -0
- package/dist/public/chapter-directory.js +22 -0
- package/dist/public/index.html +2 -2
- package/dist/public/styles.css +6 -3
- package/dist/store.js +15 -8
- package/dist/store.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -2,12 +2,24 @@ export const AI_SKILL_COMMAND_OPTIONS = Object.freeze([
|
|
|
2
2
|
Object.freeze({
|
|
3
3
|
name: "continue-writing",
|
|
4
4
|
label: "续写正文",
|
|
5
|
-
description: "延续当前章节,并保持情节、人物与设定一致。"
|
|
5
|
+
description: "延续当前章节,并保持情节、人物与设定一致。",
|
|
6
|
+
kind: "skill"
|
|
6
7
|
}),
|
|
7
8
|
Object.freeze({
|
|
8
9
|
name: "polish-writing",
|
|
9
10
|
label: "润色选中文本",
|
|
10
|
-
description: "润色当前章节的精确选区,并生成可确认的替换建议。"
|
|
11
|
+
description: "润色当前章节的精确选区,并生成可确认的替换建议。",
|
|
12
|
+
kind: "skill"
|
|
13
|
+
})
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
export const AI_SLASH_COMMAND_OPTIONS = Object.freeze([
|
|
17
|
+
...AI_SKILL_COMMAND_OPTIONS,
|
|
18
|
+
Object.freeze({
|
|
19
|
+
name: "compact",
|
|
20
|
+
label: "压缩上下文",
|
|
21
|
+
description: "主动将较早的对话整理为长期记忆。",
|
|
22
|
+
kind: "action"
|
|
11
23
|
})
|
|
12
24
|
]);
|
|
13
25
|
|
|
@@ -23,13 +35,21 @@ export function findAiSkillCommand(value, cursor = String(value ?? "").length) {
|
|
|
23
35
|
};
|
|
24
36
|
}
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
function listAiCommandOptions(options, query = "") {
|
|
27
39
|
const keyword = String(query).trim().toLocaleLowerCase("zh-CN");
|
|
28
|
-
if (!keyword) return [...
|
|
29
|
-
return
|
|
40
|
+
if (!keyword) return [...options];
|
|
41
|
+
return options.filter((skill) => [skill.name, skill.label]
|
|
30
42
|
.some((value) => value.toLocaleLowerCase("zh-CN").includes(keyword)));
|
|
31
43
|
}
|
|
32
44
|
|
|
45
|
+
export function listAiSkillOptions(query = "") {
|
|
46
|
+
return listAiCommandOptions(AI_SKILL_COMMAND_OPTIONS, query);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function listAiSlashOptions(query = "") {
|
|
50
|
+
return listAiCommandOptions(AI_SLASH_COMMAND_OPTIONS, query);
|
|
51
|
+
}
|
|
52
|
+
|
|
33
53
|
export function applyAiSkillCommand(value, match, skillName) {
|
|
34
54
|
const text = String(value ?? "");
|
|
35
55
|
const command = `/${String(skillName).trim()}`;
|