genshin-persona 4.5.0 → 4.7.0
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/output-styles/in-character.md +1 -1
- package/package.json +3 -3
- package/runtime/package-lock.json +15 -15
- package/scripts/pick.ts +1 -1
- package/scripts/speak.ts +4 -6
- package/scripts/voice.ts +15 -5
- package/src/generated/genshinText/generated/text/ChineseSimplified.json +3 -0
- package/src/generated/genshinText/generated/text/ChineseTraditional.json +3 -0
- package/src/generated/genshinText/generated/text/English.json +3 -0
- package/src/generated/genshinText/generated/text/French.json +3 -0
- package/src/generated/genshinText/generated/text/German.json +3 -0
- package/src/generated/genshinText/generated/text/Indonesian.json +3 -0
- package/src/generated/genshinText/generated/text/Italian.json +3 -0
- package/src/generated/genshinText/generated/text/Japanese.json +3 -0
- package/src/generated/genshinText/generated/text/Korean.json +3 -0
- package/src/generated/genshinText/generated/text/Portuguese.json +3 -0
- package/src/generated/genshinText/generated/text/Russian.json +3 -0
- package/src/generated/genshinText/generated/text/Spanish.json +3 -0
- package/src/generated/genshinText/generated/text/Thai.json +3 -0
- package/src/generated/genshinText/generated/text/Turkish.json +3 -0
- package/src/generated/genshinText/generated/text/Vietnamese.json +3 -0
- package/src/generated/genshinText/models/GameTextKey.ts +3 -0
- package/src/generated/genshinText/services/ElementColorMap.ts +1 -1
- package/src/models/Card.ts +0 -6
- package/src/models/Character.ts +0 -2
- package/src/models/LoreRate.ts +2 -5
- package/src/models/SpeechRequest.ts +3 -3
- package/src/models/ViewerConfiguration.ts +2 -2
- package/src/services/cli/commands/viewerCommand.ts +1 -4
- package/src/services/cli/commands/voiceCommand.ts +1 -1
- package/src/services/constants.ts +9 -12
- package/src/services/createSpokenLineReader.ts +54 -0
- package/src/services/getCard.ts +1 -4
- package/src/services/getLineContent.ts +5 -0
- package/src/services/getLoreRates.ts +1 -2
- package/src/services/getSessionStartOutput.ts +3 -23
- package/src/services/getSpeechRequest.ts +4 -4
- package/src/services/getSpokenLine.ts +25 -0
- package/src/services/getViewerReaction.ts +2 -2
- package/src/services/getWarmRequest.ts +1 -1
- package/src/services/parseVoiceRequest.ts +3 -4
- package/src/services/readMotions.ts +4 -3
- package/src/services/readRoster.ts +0 -1
- package/src/services/setViewer.ts +7 -2
- package/src/services/getSpokenLines.ts +0 -29
|
@@ -9,7 +9,7 @@ The session-start context names a Genshin Impact character and, when one has bee
|
|
|
9
9
|
|
|
10
10
|
- A spoken line is one blockquote — `> ` and one or two short sentences, on a line of its own with a blank line before and after it — in the first person and the present, as the character would say it: in their register, with their lore where it fits, and written for this ask, never a stock line brought back. Plain words only: no markup, code, path, identifier or number inside it, since the line is read aloud and carries no fact a reader needs to use.
|
|
11
11
|
- An ask of the assistant — code, a fix, an explanation, a table, a command, a review of code or a change, anything a reader will use — opens with one spoken line reacting to what was asked or found, answers plainly, and may close with one more: the sign-off, as the card describes it. Never a third.
|
|
12
|
-
- An ask of the character — a joke, a story, a hello, small talk, their opinion of anything or their mood, a question one or two sentences answer with nothing to copy — is answered wholly in spoken lines, each its own blockquote, and nothing plain. Whose ask it is decides the form, never how long or what shape the answer takes: an opinion formed from a pasted page is still the character's, it runs as long as the ask deserves — concise, but colour and invention come before brevity, and no count of lines is ever the measure — and a list is fine, each item its own blockquote line, its marker the one piece of markup a spoken line carries, since the
|
|
12
|
+
- An ask of the character — a joke, a story, a hello, small talk, their opinion of anything or their mood, a question one or two sentences answer with nothing to copy — is answered wholly in spoken lines, each its own blockquote, and nothing plain. Whose ask it is decides the form, never how long or what shape the answer takes: an opinion formed from a pasted page is still the character's, it runs as long as the ask deserves — concise, but colour and invention come before brevity, and no count of lines is ever the measure — and a list is fine, each item its own blockquote line, its marker the one piece of markup a spoken line carries, since the line is read without it. The whole reply is the character's, so no sign-off is added on top of it.
|
|
13
13
|
- A blockquote is a spoken line, and nothing else is written as one.
|
|
14
14
|
- Plain means: the answer, the explanation, the table, the code, the commit message, the error text, written as a neutral assistant would write it — its first person is the assistant's, as the spoken line's is the character's — with every fact, number, warning and caveat, and no character in it.
|
|
15
15
|
- The card's greeting is how the character says hello; the plugin has already shown it as the welcome, so no reply repeats it — the first reply of a session opens on what was asked, like every other.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genshin-persona",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "A Claude Code plugin that speaks as the Genshin Impact character whose birthday is nearest: an answer opens with one spoken line in the character's voice and the rest is plain, a joke or a hello is spoken whole, and every line is read aloud in the character's own cloned voice as the reply is written.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"@typesafe-ai/sdk": "^0.7.0",
|
|
58
58
|
"@wasm-audio-decoders/ogg-vorbis": "^0.1.20",
|
|
59
59
|
"citty": "^0.2.2",
|
|
60
|
-
"genshin-db": "^5.2.
|
|
60
|
+
"genshin-db": "^5.2.15"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=26.13.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "c819fd8f6196452894babddc3df9fb20cb0d6add"
|
|
66
66
|
}
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"node_modules/@huggingface/jinja": {
|
|
23
|
-
"version": "0.5.
|
|
24
|
-
"resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.5.
|
|
25
|
-
"integrity": "sha512-
|
|
23
|
+
"version": "0.5.11",
|
|
24
|
+
"resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.5.11.tgz",
|
|
25
|
+
"integrity": "sha512-YzEzwM5oQf4r0vs7ifWQ+yuVR1YkAHrjERQ+a8WRsStHHp4NRBg+NesjiFc+X2AFUpRvvrIeHDS1xFy9jY/IjQ==",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=18"
|
|
@@ -653,9 +653,9 @@
|
|
|
653
653
|
"license": "BSD-3-Clause"
|
|
654
654
|
},
|
|
655
655
|
"node_modules/@types/node": {
|
|
656
|
-
"version": "26.6.
|
|
657
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.
|
|
658
|
-
"integrity": "sha512-
|
|
656
|
+
"version": "26.6.6",
|
|
657
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
|
|
658
|
+
"integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
|
|
659
659
|
"license": "MIT",
|
|
660
660
|
"dependencies": {
|
|
661
661
|
"undici-types": "~8.9.0"
|
|
@@ -750,9 +750,9 @@
|
|
|
750
750
|
"license": "Apache-2.0"
|
|
751
751
|
},
|
|
752
752
|
"node_modules/global-agent": {
|
|
753
|
-
"version": "4.1.
|
|
754
|
-
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-4.1.
|
|
755
|
-
"integrity": "sha512-
|
|
753
|
+
"version": "4.1.7",
|
|
754
|
+
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-4.1.7.tgz",
|
|
755
|
+
"integrity": "sha512-pxaZqdsMwPA4i7TuRKpDUONm2xGRjvYdRoidCQz7VleUKVuUfh/4p5Q3QDTGrpAE5Kz5TxxcZ+uqEgTkoKRNtg==",
|
|
756
756
|
"license": "BSD-3-Clause",
|
|
757
757
|
"dependencies": {
|
|
758
758
|
"globalthis": "^1.0.2",
|
|
@@ -913,9 +913,9 @@
|
|
|
913
913
|
}
|
|
914
914
|
},
|
|
915
915
|
"node_modules/semver": {
|
|
916
|
-
"version": "7.8.
|
|
917
|
-
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.
|
|
918
|
-
"integrity": "sha512-
|
|
916
|
+
"version": "7.8.6",
|
|
917
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",
|
|
918
|
+
"integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",
|
|
919
919
|
"license": "ISC",
|
|
920
920
|
"bin": {
|
|
921
921
|
"semver": "bin/semver.js"
|
|
@@ -989,9 +989,9 @@
|
|
|
989
989
|
}
|
|
990
990
|
},
|
|
991
991
|
"node_modules/tslib": {
|
|
992
|
-
"version": "2.
|
|
993
|
-
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.
|
|
994
|
-
"integrity": "sha512-
|
|
992
|
+
"version": "2.9.1",
|
|
993
|
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",
|
|
994
|
+
"integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==",
|
|
995
995
|
"license": "0BSD",
|
|
996
996
|
"optional": true
|
|
997
997
|
},
|
package/scripts/pick.ts
CHANGED
|
@@ -41,5 +41,5 @@ if (pick) {
|
|
|
41
41
|
];
|
|
42
42
|
// The warm waits for no more than a synthesizer's bind
|
|
43
43
|
await deliverWarmRequest(character.name, personaCard);
|
|
44
|
-
console.log(getSessionStartOutput(card, remarks, readReplyLanguage() ?? language, language
|
|
44
|
+
console.log(getSessionStartOutput(card, remarks, readReplyLanguage() ?? language, language));
|
|
45
45
|
}
|
package/scripts/speak.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { VoiceRequestType } from "#src/models/VoiceRequestType";
|
|
|
2
2
|
import { checkIsSilent } from "#src/services/checkIsSilent";
|
|
3
3
|
import { deliverVoiceRequest } from "#src/services/deliverVoiceRequest";
|
|
4
4
|
import { getSpeechRequest } from "#src/services/getSpeechRequest";
|
|
5
|
-
import { getSpokenLines } from "#src/services/getSpokenLines";
|
|
6
5
|
import { parseHookInput } from "#src/services/parseHookInput";
|
|
7
6
|
import { readPersonaCard } from "#src/services/readPersonaCard";
|
|
8
7
|
import { readSessionCharacterName } from "#src/services/readSessionCharacterName";
|
|
@@ -11,9 +10,9 @@ import { readVoiceLanguage } from "#src/services/readVoiceLanguage";
|
|
|
11
10
|
import { registerQuietExit } from "#src/services/registerQuietExit";
|
|
12
11
|
|
|
13
12
|
// The MessageDisplay hook, run on every flushed piece of a reply and waited on by the display, so it does the least
|
|
14
|
-
// A hook can: the gates, which are file reads, the
|
|
15
|
-
//
|
|
16
|
-
//
|
|
13
|
+
// A hook can: the gates, which are file reads, and the piece's markdown handed to the synthesizer. The piece goes
|
|
14
|
+
// Whole, one with no spoken line in it too, since the pieces of a reply are numbered and the synthesizer reads them
|
|
15
|
+
// In order however the hooks, which run concurrently, deliver them. Nothing here waits for the engine: a
|
|
17
16
|
// Synthesizer that is not running costs a spawn and a node start to its bind, and the load is its own
|
|
18
17
|
registerQuietExit();
|
|
19
18
|
const language = readVoiceLanguage();
|
|
@@ -30,8 +29,7 @@ if (language && !checkIsSilent()) {
|
|
|
30
29
|
const name = readSessionCharacterName(sessionId);
|
|
31
30
|
if (name) {
|
|
32
31
|
const personaCard = await readPersonaCard(name);
|
|
33
|
-
const
|
|
34
|
-
const request = getSpeechRequest(VoiceRequestType.Speak, name, personaCard, language, lines, {
|
|
32
|
+
const request = getSpeechRequest(VoiceRequestType.Speak, name, personaCard, language, delta, {
|
|
35
33
|
index,
|
|
36
34
|
isFinal,
|
|
37
35
|
messageId,
|
package/scripts/voice.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { createAudioPlayer } from "#src/services/createAudioPlayer";
|
|
|
20
20
|
import { createClipDecoder } from "#src/services/createClipDecoder";
|
|
21
21
|
import { createReadingPlayer } from "#src/services/createReadingPlayer";
|
|
22
22
|
import { createReplyQueue } from "#src/services/createReplyQueue";
|
|
23
|
+
import { createSpokenLineReader } from "#src/services/createSpokenLineReader";
|
|
23
24
|
import { createViewerOpener } from "#src/services/createViewerOpener";
|
|
24
25
|
import { createViewerPlayer } from "#src/services/createViewerPlayer";
|
|
25
26
|
import { createVoiceSynthesizer } from "#src/services/createVoiceSynthesizer";
|
|
@@ -89,10 +90,18 @@ const readSpeaker = async (request: SpeechRequest) => {
|
|
|
89
90
|
speakers.set(key, encoded);
|
|
90
91
|
return encoded;
|
|
91
92
|
};
|
|
93
|
+
// The spoken lines of a piece are read where the pieces run in index order, since the fence a piece sits in was opened
|
|
94
|
+
// By a piece before it
|
|
95
|
+
const readSpokenLines = createSpokenLineReader();
|
|
92
96
|
// Each line is synthesized while the one before it plays; a warm has no player and speaks nothing, and a piece with
|
|
93
97
|
// No line in it is only its place in the reply
|
|
94
|
-
const speak = async (
|
|
95
|
-
|
|
98
|
+
const speak = async (
|
|
99
|
+
request: SpeechRequest,
|
|
100
|
+
lines: string[],
|
|
101
|
+
player: AudioPlayer | undefined,
|
|
102
|
+
checkIsSuperseded: () => boolean,
|
|
103
|
+
) => {
|
|
104
|
+
if (lines.length === 0) return VoiceStatus.Ok;
|
|
96
105
|
|
|
97
106
|
const synthesizer = await synthesizerLoad;
|
|
98
107
|
const speaker = await readSpeaker(request);
|
|
@@ -116,7 +125,7 @@ const speak = async (request: SpeechRequest, player: AudioPlayer | undefined, ch
|
|
|
116
125
|
};
|
|
117
126
|
let playback: Promise<void> = Promise.resolve();
|
|
118
127
|
let status: VoiceStatus = VoiceStatus.Ok;
|
|
119
|
-
for (const line of
|
|
128
|
+
for (const line of lines) {
|
|
120
129
|
// oxlint-disable-next-line no-await-in-loop -- One device: lines synthesize and play back one after another
|
|
121
130
|
const clip = await synthesizer.synthesize(line, speaker);
|
|
122
131
|
if (!clip) {
|
|
@@ -145,13 +154,14 @@ const speak = async (request: SpeechRequest, player: AudioPlayer | undefined, ch
|
|
|
145
154
|
// The player is spawned before the first line is synthesized, so its start is paid under that synthesis rather than
|
|
146
155
|
// In front of the first sound. A request that throws is dropped and keeps the engine
|
|
147
156
|
const queue = createReplyQueue(async (request: SpeechRequest, checkIsSuperseded: () => boolean) => {
|
|
148
|
-
const
|
|
157
|
+
const lines = readSpokenLines(request);
|
|
158
|
+
const isSpoken = request.type === VoiceRequestType.Speak && lines.length > 0;
|
|
149
159
|
// A viewer on file carries the reading, with the stock player behind it; with none, the reading is the stock player's
|
|
150
160
|
const viewer = isSpoken ? await viewerOpener.open() : undefined;
|
|
151
161
|
let player: AudioPlayer | undefined;
|
|
152
162
|
if (isSpoken)
|
|
153
163
|
player = viewer ? createReadingPlayer(viewer, createAudioPlayer, VIEWER_SOUND_FORM) : createAudioPlayer();
|
|
154
|
-
const [outcome] = await Promise.allSettled([speak(request, player, checkIsSuperseded)]);
|
|
164
|
+
const [outcome] = await Promise.allSettled([speak(request, lines, player, checkIsSuperseded)]);
|
|
155
165
|
if (outcome?.status === "fulfilled" && outcome.value === VoiceStatus.Superseded) player?.stop?.();
|
|
156
166
|
await player?.close();
|
|
157
167
|
if (outcome?.status === "fulfilled") return outcome.value;
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "星尘兑换",
|
|
28
28
|
"457891068": "泡泡桔",
|
|
29
29
|
"461826100": "破损的面具",
|
|
30
|
+
"467393276": "能量",
|
|
30
31
|
"490005341": "望风山地",
|
|
31
32
|
"492153948": "墩墩桃",
|
|
32
33
|
"496124396": "退出登录",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "风元素伤害加成",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "风元素抗性",
|
|
278
279
|
"Fontaine": "枫丹",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "护盾",
|
|
279
281
|
"HUNTING_ACCEPT": "接取悬赏",
|
|
280
282
|
"HUNTING_ACCEPTING": "讨伐悬赏进行中",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "正在进行其他的悬赏。接取新的悬赏会放弃进行中的悬赏,确定要接取吗?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "重投骰子",
|
|
519
521
|
"UI_GCG_ACTION_OK": "确定",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "切换角色",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "花费:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "放弃对局",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "回合结束",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "行动阶段",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "星塵兌換",
|
|
28
28
|
"457891068": "泡泡桔",
|
|
29
29
|
"461826100": "破損的面具",
|
|
30
|
+
"467393276": "能量",
|
|
30
31
|
"490005341": "望風山地",
|
|
31
32
|
"492153948": "墩墩桃",
|
|
32
33
|
"496124396": "登出",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "風元素傷害加成",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "風元素抗性",
|
|
278
279
|
"Fontaine": "楓丹",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "護盾",
|
|
279
281
|
"HUNTING_ACCEPT": "接取懸賞",
|
|
280
282
|
"HUNTING_ACCEPTING": "討伐懸賞進行中",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "正在進行其他的懸賞。接取新的懸賞會放棄進行中的懸賞,確定要接取嗎?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "重擲骰子",
|
|
519
521
|
"UI_GCG_ACTION_OK": "確定",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "切換角色",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "花費:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "放棄對局",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "回合結束",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "行動階段",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Stardust Exchange",
|
|
28
28
|
"457891068": "Bulle Fruit",
|
|
29
29
|
"461826100": "Damaged Mask",
|
|
30
|
+
"467393276": "Energy",
|
|
30
31
|
"490005341": "Stormbearer Mountains",
|
|
31
32
|
"492153948": "Zaytun Peach",
|
|
32
33
|
"496124396": "Log Out",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Anemo DMG Bonus",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "Anemo RES",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Shield",
|
|
279
281
|
"HUNTING_ACCEPT": "Accept Bounty",
|
|
280
282
|
"HUNTING_ACCEPTING": "Bounty in progress",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "You already have another Bounty in progress. Accepting a new Bounty now will cause you to abandon your current Bounty. Continue?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Reroll",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Confirm",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Switch Character",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Cost:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Concede",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "End Round",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Action Phase",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Échange Astrions",
|
|
28
28
|
"457891068": "Fruit bullé",
|
|
29
29
|
"461826100": "Masque endommagé",
|
|
30
|
+
"467393276": "Énergie",
|
|
30
31
|
"490005341": "Montagnes du guet",
|
|
31
32
|
"492153948": "Pêche zaytun",
|
|
32
33
|
"496124396": "Déconnexion",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Bonus de DGT Anémo",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "RÉS Anémo",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Bouclier",
|
|
279
281
|
"HUNTING_ACCEPT": "Accepter",
|
|
280
282
|
"HUNTING_ACCEPTING": "Prime en cours",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Vous avez une prime en cours. Si vous en acceptez une nouvelle, celle-ci sera abandonnée. Souhaitez-vous continuer ?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Relancer",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Confirmer",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Changer de personnage",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Coût :",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Abandonner",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Fin de manche",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Phase d'action",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Mit Sternenstaub kaufen",
|
|
28
28
|
"457891068": "Blasenmandarine",
|
|
29
29
|
"461826100": "Zerbrochene Maske",
|
|
30
|
+
"467393276": "Energie",
|
|
30
31
|
"490005341": "Windblickberge",
|
|
31
32
|
"492153948": "Zaytun-Pfirsich",
|
|
32
33
|
"496124396": "Abmelden",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Anemo-SCH-Bonus",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "Anemo-WDS",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Schild",
|
|
279
281
|
"HUNTING_ACCEPT": "Kopfgeldjagd annehmen",
|
|
280
282
|
"HUNTING_ACCEPTING": "Kopfgeldjagd läuft",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Du verfolgst gerade eine andere Kopfgeldjagd. Wenn du eine neue annimmst, verzichtest du auf das Kopfgeld der alten. Willst du die neue wirklich annehmen?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Erneut würfeln",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Okay",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Figur wechseln",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Kosten:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Abbrechen",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Runde beenden",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Zugphase",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Penukaran Stardust",
|
|
28
28
|
"457891068": "Bulle Fruit",
|
|
29
29
|
"461826100": "Damaged Mask",
|
|
30
|
+
"467393276": "Energi",
|
|
30
31
|
"490005341": "Stormbearer Mountains",
|
|
31
32
|
"492153948": "Zaytun Peach",
|
|
32
33
|
"496124396": "Logout",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Anemo DMG Bonus",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "Anemo RES",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Perisai",
|
|
279
281
|
"HUNTING_ACCEPT": "Terima Bounty",
|
|
280
282
|
"HUNTING_ACCEPTING": "Mulai Bounty",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Kamu sedang menjalankan Bounty lainnya. Mengambil quest Bounty yang baru akan membatalkan quest Bounty saat ini. Lanjutkan?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Lempar ulang",
|
|
519
521
|
"UI_GCG_ACTION_OK": "OK",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Tukar Karakter",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Biaya:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Menyerah",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Akhiri Giliran",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Tahap Aksi",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Scambio di Polvere stellare",
|
|
28
28
|
"457891068": "Bulle",
|
|
29
29
|
"461826100": "Maschera danneggiata",
|
|
30
|
+
"467393276": "Energia",
|
|
30
31
|
"490005341": "Montagne Vedetta",
|
|
31
32
|
"492153948": "Pesca di Zaytun",
|
|
32
33
|
"496124396": "Esci",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Bonus DAN da Anemo",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "RES ad Anemo",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Scudo",
|
|
279
281
|
"HUNTING_ACCEPT": "Accetta",
|
|
280
282
|
"HUNTING_ACCEPTING": "Caccia alla taglia in corso",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Hai già un'altra caccia alla taglia in corso. Se ne accetterai una nuova adesso, abbandonerai quella attuale. Continuare?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Rilancia dadi",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Conferma",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Cambia personaggio",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Costo:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Rinuncia alla partita",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Dichiara la fine del turno",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Fase di azione",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "スターダスト交換",
|
|
28
28
|
"457891068": "バブルオレンジ",
|
|
29
29
|
"461826100": "破損した仮面",
|
|
30
|
+
"467393276": "エネルギー",
|
|
30
31
|
"490005341": "望風山地",
|
|
31
32
|
"492153948": "ザイトゥン桃",
|
|
32
33
|
"496124396": "ログアウト",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "風元素ダメージ",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "風元素耐性",
|
|
278
279
|
"Fontaine": "フォンテーヌ",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "シールド",
|
|
279
281
|
"HUNTING_ACCEPT": "引き受ける",
|
|
280
282
|
"HUNTING_ACCEPTING": "討伐懸賞進行中",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "進行中の懸賞があります。新しい懸賞を受け取ると進行中の懸賞を中断しますが、新しい懸賞を受け取りますか?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "リロール",
|
|
519
521
|
"UI_GCG_ACTION_OK": "OK",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "キャラチェンジ",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "コスト:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "対戦を諦める",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "ラウンド終了",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "アクションフェーズ",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "스타더스트 교환",
|
|
28
28
|
"457891068": "풍선귤",
|
|
29
29
|
"461826100": "부서진 가면",
|
|
30
|
+
"467393276": "에너지",
|
|
30
31
|
"490005341": "바람맞이 산",
|
|
31
32
|
"492153948": "뚠뚠 복숭아",
|
|
32
33
|
"496124396": "로그아웃",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "바람 원소 피해 보너스",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "바람 원소 내성",
|
|
278
279
|
"Fontaine": "폰타인",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "보호막",
|
|
279
281
|
"HUNTING_ACCEPT": "현상 토벌 수락",
|
|
280
282
|
"HUNTING_ACCEPTING": "현상 토벌을 진행 중입니다",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "현재 다른 현상 토벌을 진행 중입니다. 현재 의뢰를 포기하고 새로운 현상 토벌을 수락하시겠습니까?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "주사위 다시 굴리기",
|
|
519
521
|
"UI_GCG_ACTION_OK": "확인",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "캐릭터 교체",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "소모:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "기권",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "턴 종료",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "행동 단계",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Resgate de Poeira Estrelar",
|
|
28
28
|
"457891068": "Fruta Bulle",
|
|
29
29
|
"461826100": "Máscara Danificada",
|
|
30
|
+
"467393276": "Energia",
|
|
30
31
|
"490005341": "Montanhas do Precursor do Vento",
|
|
31
32
|
"492153948": "Pêssego Zaytun",
|
|
32
33
|
"496124396": "Sair",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Bônus de Dano Anemo",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "RES Anemo",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Escudo",
|
|
279
281
|
"HUNTING_ACCEPT": "Aceitar caça",
|
|
280
282
|
"HUNTING_ACCEPTING": "Recompensa de Caça em andamento",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Você já está com uma caça em andamento. Aceitar uma nova caça o fará desistir dela, deseja confirmar esta ação?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Rolar mais uma vez",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Confirmar",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Trocar Personagem",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Custo:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Desistir",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Fim do Turno",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Fase de Ação",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Покупается за Звёздную пыль",
|
|
28
28
|
"457891068": "Пузырин",
|
|
29
29
|
"461826100": "Разбитая маска",
|
|
30
|
+
"467393276": "Энергия",
|
|
30
31
|
"490005341": "Горы Буревестника",
|
|
31
32
|
"492153948": "Персик зайтун",
|
|
32
33
|
"496124396": "Выйти",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Бонус Анемо урона",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "Анемо сопротивление",
|
|
278
279
|
"Fontaine": "Фонтейн",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Щит",
|
|
279
281
|
"HUNTING_ACCEPT": "Принять заказ",
|
|
280
282
|
"HUNTING_ACCEPTING": "Выполняется заказ на монстра",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "В данный момент активен заказ на другого монстра. После принятия нового заказа от текущего придётся отказаться. Принять новый заказ?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Повторный бросок",
|
|
519
521
|
"UI_GCG_ACTION_OK": "ОК",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Сменить персонажа",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Стоимость:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Сдаться",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Конец раунда",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Фаза ходов",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Canjear Polvo estelar",
|
|
28
28
|
"457891068": "Burburanja",
|
|
29
29
|
"461826100": "Máscara dañada",
|
|
30
|
+
"467393276": "Energía",
|
|
30
31
|
"490005341": "Montañas Portatormentas",
|
|
31
32
|
"492153948": "Duraznoliva",
|
|
32
33
|
"496124396": "Desconectar",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Bono de Daño Anemo",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "RES Anemo",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Escudo",
|
|
279
281
|
"HUNTING_ACCEPT": "Aceptar cacería",
|
|
280
282
|
"HUNTING_ACCEPTING": "Cacería recompensada en curso",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Tienes otra cacería en curso. Si aceptas una nueva, abandonarás la actual. ¿Seguro que deseas aceptarla?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Lanzar de nuevo",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Confirmar",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Cambiar de personaje",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Coste:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Abandonar",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Fin de la ronda",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Fase de acciones",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "แลกเปลี่ยนด้วย Stardust",
|
|
28
28
|
"457891068": "Bulle Fruit",
|
|
29
29
|
"461826100": "Damaged Mask",
|
|
30
|
+
"467393276": "พลังงาน",
|
|
30
31
|
"490005341": "Stormbearer Mountain",
|
|
31
32
|
"492153948": "Zaytun Peach",
|
|
32
33
|
"496124396": "ล็อกเอาท์",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "โบนัสความเสียหายลม",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "ความต้านทานลม",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "โล่",
|
|
279
281
|
"HUNTING_ACCEPT": "รับเป้าหมาย",
|
|
280
282
|
"HUNTING_ACCEPTING": "กำลังปราบปรามเป้าหมาย",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "คุณอยู่ในระหว่างการปราบปรามเป้าหมายอื่น หากรับเป้าหมายใหม่จะเป็นการยกเลิกเป้าหมายปัจจุบัน ยืนยันรับเป้าหมายใหม่หรือไม่?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "ทอยใหม่",
|
|
519
521
|
"UI_GCG_ACTION_OK": "ยืนยัน",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "เปลี่ยนตัวละคร",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "ค่าร่าย:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "ยกเลิกการดูเอล",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "จบเทิร์น",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "แอ็กชันเฟส",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Yıldız Tozu Takası",
|
|
28
28
|
"457891068": "Bulle Meyvesi",
|
|
29
29
|
"461826100": "Kırık Maske",
|
|
30
|
+
"467393276": "Enerji",
|
|
30
31
|
"490005341": "Fırtınakesen Dağları",
|
|
31
32
|
"492153948": "Zaytun Şeftalisi",
|
|
32
33
|
"496124396": "Çıkış Yap",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Rüzgar Hasarı Bonusu",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "Rüzgar Direnci",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Kalkan",
|
|
279
281
|
"HUNTING_ACCEPT": "Canavar Avını Kabul Et",
|
|
280
282
|
"HUNTING_ACCEPTING": "Canavar Avı devam ediyor",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Zaten bir Canavar Avındasın. Şimdi yeni bir Canavar Avını kabul etmek mevcut Canavar Avını bırakmana sebep olur. Devam et?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Yeniden Zar At",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Onayla",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Karakter Değiştir",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Maliyet:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Teslim Ol",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Turu Sonlandır",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Hamle Aşaması",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"405681154": "Đổi Tinh Trần",
|
|
28
28
|
"457891068": "Trái Bulle",
|
|
29
29
|
"461826100": "Mặt Nạ Vỡ",
|
|
30
|
+
"467393276": "Năng Lượng",
|
|
30
31
|
"490005341": "Núi Vọng Phong",
|
|
31
32
|
"492153948": "Đào Zaytun",
|
|
32
33
|
"496124396": "Thoát Đăng Nhập",
|
|
@@ -276,6 +277,7 @@
|
|
|
276
277
|
"FIGHT_PROP_WIND_ADD_HURT": "Tăng ST Nguyên Tố Phong",
|
|
277
278
|
"FIGHT_PROP_WIND_SUB_HURT": "Kháng Nguyên Tố Phong",
|
|
278
279
|
"Fontaine": "Fontaine",
|
|
280
|
+
"GCG_SKILL_EFFECT_SHIELD": "Khiên",
|
|
279
281
|
"HUNTING_ACCEPT": "Nhận treo thưởng",
|
|
280
282
|
"HUNTING_ACCEPTING": "Đang tiến hành Thưởng Thảo Phạt",
|
|
281
283
|
"HUNTING_ACCEPT_INFO": "Đang tiến hành treo thưởng khác, nhận treo thưởng mới sẽ huỷ bỏ treo thưởng đang tiến hành, chắc chắn muốn nhận?",
|
|
@@ -518,6 +520,7 @@
|
|
|
518
520
|
"UI_GCG_ACTION_HINT_REROLL": "Gieo lại",
|
|
519
521
|
"UI_GCG_ACTION_OK": "Xác Nhận",
|
|
520
522
|
"UI_GCG_ACTION_SWITCH_CHAR": "Đổi Nhân Vật",
|
|
523
|
+
"UI_GCG_CARDDECK_CARDFACE_COST": "Tốn:",
|
|
521
524
|
"UI_GCG_CONFIG_SURRENDER": "Bỏ Cuộc",
|
|
522
525
|
"UI_GCG_PASS_DECLARE": "Kết Thúc Hiệp",
|
|
523
526
|
"UI_GCG_PHASE_ACTION": "Giai Đoạn Hành Động",
|
|
@@ -398,13 +398,16 @@ export const GameTextKey = {
|
|
|
398
398
|
GcgChallenge: "191219274",
|
|
399
399
|
GcgConcede: "UI_GCG_CONFIG_SURRENDER",
|
|
400
400
|
GcgConfirm: "UI_GCG_ACTION_OK",
|
|
401
|
+
GcgCost: "UI_GCG_CARDDECK_CARDFACE_COST",
|
|
401
402
|
GcgDefeat: "UI_GCG_RESULT_LOSE",
|
|
402
403
|
GcgElementalTuning: "UI_GCG_ACTION_ELEMENT_SYNCHO",
|
|
403
404
|
GcgEndRound: "UI_GCG_PASS_DECLARE",
|
|
405
|
+
GcgEnergy: "467393276",
|
|
404
406
|
GcgNowActing: "UI_GCG_PLAYERINFO_ACTION",
|
|
405
407
|
GcgReroll: "UI_GCG_ACTION_HINT_REROLL",
|
|
406
408
|
GcgRollPhase: "UI_GCG_PHASE_THROW",
|
|
407
409
|
GcgRoundTitle: "UI_GCG_PHASE_ROUND_TITLE",
|
|
410
|
+
GcgShield: "GCG_SKILL_EFFECT_SHIELD",
|
|
408
411
|
GcgStartingHand: "UI_GCG_PHASE_SWITCH_HAND",
|
|
409
412
|
GcgSwitchCharacter: "UI_GCG_ACTION_SWITCH_CHAR",
|
|
410
413
|
GcgVictory: "UI_GCG_RESULT_WIN",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copied from `genshin-text` by `pnpm -C scripts genshin:text write`, never edited by hand
|
|
2
|
-
// The game's interface colour for each element, used as the
|
|
2
|
+
// The game's interface colour for each element, used as the persona's fallback
|
|
3
3
|
export const ElementColorMap: Record<string, string> = {
|
|
4
4
|
Anemo: "#33ccb3",
|
|
5
5
|
Cryo: "#98c8e8",
|
package/src/models/Card.ts
CHANGED
|
@@ -6,20 +6,14 @@ import type { PersonaCard } from "#src/models/PersonaCard";
|
|
|
6
6
|
export interface Card {
|
|
7
7
|
// The game's one-line introduction, the lore the model answers from; "" for the player character
|
|
8
8
|
description: string;
|
|
9
|
-
// The game's stable element key, carried on its own line for programs that read the session context
|
|
10
|
-
element: string;
|
|
11
9
|
// The one line of the card a person reads, so it is the interface language's where that language has written
|
|
12
10
|
// It and the card's own otherwise; "" for a character with no card
|
|
13
11
|
greeting: string;
|
|
14
12
|
// The plugin naming who speaks: the name, then the title, element and region the game data holds
|
|
15
13
|
headline: string;
|
|
16
|
-
// The roster's own name, which the context carries on a line of its own for a reader that is not a person
|
|
17
|
-
name: string;
|
|
18
14
|
// The plugin's aside in brackets — the birthday and how far off it is — never a line the character says; "" when
|
|
19
15
|
// The character has no birthday
|
|
20
16
|
note: string;
|
|
21
17
|
// Absent for a character nobody has written a card for yet, which is a character the game data alone describes
|
|
22
18
|
personaCard?: PersonaCard;
|
|
23
|
-
// The character's stars, which the console's Genshin theme draws the star's colour from
|
|
24
|
-
rarity: 4 | 5;
|
|
25
19
|
}
|
package/src/models/Character.ts
CHANGED
|
@@ -17,8 +17,6 @@ export interface Character {
|
|
|
17
17
|
// The English name, which is the identity: the pin, the pick records, the reference clips, the card modules and
|
|
18
18
|
// Every wiki lookup are keyed by it, so it is stable across a change of interface language
|
|
19
19
|
name: string;
|
|
20
|
-
// The character's stars, four or five, as the game data's rarity field spells them
|
|
21
|
-
rarity: 4 | 5;
|
|
22
20
|
region: string;
|
|
23
21
|
title: string;
|
|
24
22
|
// The game patch that introduced the character, as its "major.minor" label
|
package/src/models/LoreRate.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// One row of the welcome's chart: the character's roster name, the name as the interface language spells it, and the
|
|
4
|
-
// Tier's probability for the character. A theme reads these rows from the session-start context to draw the odds
|
|
1
|
+
// One row of the welcome's chart: the character's name as the interface language spells it, and the tier's
|
|
2
|
+
// Probability for the character
|
|
5
3
|
export interface LoreRate {
|
|
6
4
|
displayName: string;
|
|
7
|
-
name: string;
|
|
8
5
|
probability: number;
|
|
9
6
|
}
|
|
@@ -5,9 +5,9 @@ import type { VoiceRequestType } from "#src/models/VoiceRequestType";
|
|
|
5
5
|
// A request that reads a character's reference: spoken, or only warmed
|
|
6
6
|
export interface SpeechRequest extends ReplyPiece {
|
|
7
7
|
language: VoiceLanguage;
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
8
|
+
// The piece as the display flushed it, whose blockquote lines the synthesizer reads in order, each synthesized
|
|
9
|
+
// Whole; a piece with none is sent all the same so the piece after it is not waited for
|
|
10
|
+
markdown: string;
|
|
11
11
|
// The character whose reference reads the lines
|
|
12
12
|
name: string;
|
|
13
13
|
// The reference line's wiki file stem; "" when neither the card nor the generated map names one, and the
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ViewerMoment } from "#src/models/ViewerMoment";
|
|
2
2
|
|
|
3
3
|
// The viewer's socket, the model on it and the motion each moment plays there, as the verb wrote them; a moment
|
|
4
|
-
// With no motion sends nothing
|
|
4
|
+
// With no motion is "" and sends nothing
|
|
5
5
|
export interface ViewerConfiguration {
|
|
6
6
|
address: string;
|
|
7
7
|
modelId: number;
|
|
8
|
-
motions:
|
|
8
|
+
motions: Record<ViewerMoment, string>;
|
|
9
9
|
}
|
|
@@ -42,10 +42,7 @@ export const viewerCommand: SubCommandsDef[string] = defineCommand({
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
writeViewerConfiguration({
|
|
46
|
-
...configuration,
|
|
47
|
-
motions: { ...configuration.motions, [momentName]: motion || undefined },
|
|
48
|
-
});
|
|
45
|
+
writeViewerConfiguration({ ...configuration, motions: { ...configuration.motions, [momentName]: motion } });
|
|
49
46
|
console.log(motion ? strings.viewerMotionSet(momentName, motion) : strings.viewerMotionCleared(momentName));
|
|
50
47
|
return;
|
|
51
48
|
}
|
|
@@ -107,7 +107,7 @@ export const voiceCommand: SubCommandsDef[string] = defineCommand({
|
|
|
107
107
|
|
|
108
108
|
writeVoiceLanguage(dub);
|
|
109
109
|
await sendVoiceRequest(
|
|
110
|
-
getSpeechRequest(VoiceRequestType.Speak, character.name, personaCard, dub,
|
|
110
|
+
getSpeechRequest(VoiceRequestType.Speak, character.name, personaCard, dub, `> ${VOICE_PROOF_TEXT}`),
|
|
111
111
|
);
|
|
112
112
|
console.log(strings.spoke(character.displayName, device ?? ""));
|
|
113
113
|
},
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ReplyPiece } from "#src/models/ReplyPiece";
|
|
2
|
+
import type { ViewerConfiguration } from "#src/models/ViewerConfiguration";
|
|
2
3
|
import type { VoiceDeviceLadder } from "#src/models/VoiceDeviceLadder";
|
|
3
4
|
import type { VoiceDeviceRung } from "#src/models/VoiceDeviceRung";
|
|
4
5
|
|
|
5
6
|
import { GameLanguage } from "#src/generated/genshinText/models/GameLanguage";
|
|
7
|
+
import { ViewerMoment } from "#src/models/ViewerMoment";
|
|
6
8
|
import { ViewerSoundForm } from "#src/models/ViewerSoundForm";
|
|
7
9
|
import { homedir } from "node:os";
|
|
8
10
|
import { join } from "node:path";
|
|
@@ -68,23 +70,13 @@ export const CARD_DETAIL_SEPARATOR = " · ";
|
|
|
68
70
|
// What the model reads the headline under, and what the person reads it under
|
|
69
71
|
export const CONTEXT_HEADLINE_PREFIX = "Persona: ";
|
|
70
72
|
export const NAMEPLATE_PREFIX = "✦ ";
|
|
71
|
-
// The line naming the character for a program rather than a person: the agent console's Genshin theme finds it in the
|
|
72
|
-
// Session-start hook's context, spelled the same on both sides, so neither parses the headline's prose
|
|
73
|
-
export const CHARACTER_LINE_PREFIX = "Character: ";
|
|
74
|
-
// The stable element key beside the character name, for a theme to read without parsing the localized headline
|
|
75
|
-
export const ELEMENT_LINE_PREFIX = "Element: ";
|
|
76
|
-
// The character's stars beside the element, so the star a theme draws for the session is coloured by the game's own rarity
|
|
77
|
-
export const RARITY_LINE_PREFIX = "Rarity: ";
|
|
78
|
-
// The welcome chart's rows as JSON, which a theme draws the odds from; absent unless the lore pick chose the character
|
|
79
|
-
export const LORE_RATES_LINE_PREFIX = "Lore rates: ";
|
|
80
73
|
export const ANSI_RESET = "\u001B[0m";
|
|
81
74
|
// A "#rrggbb" triplet's channels: two hex digits each, 0 to 255
|
|
82
75
|
export const HEX_RADIX = 16;
|
|
83
76
|
export const HEX_CHANNEL_LENGTH = 2;
|
|
84
77
|
export const MAX_COLOR_CHANNEL_VALUE = 255;
|
|
85
78
|
// The surface a character's colour must read on, and the status line's badge a tonal fill over it mixing in this much
|
|
86
|
-
// Of that colour: the design language's tonal button, over dusk's background,
|
|
87
|
-
// Is mostly dark
|
|
79
|
+
// Of that colour: the design language's tonal button, over dusk's background, since a terminal is mostly dark
|
|
88
80
|
export const NAMEPLATE_SURFACE = "#16161e";
|
|
89
81
|
export const NAMEPLATE_TONAL_MIX_PERCENTAGE = 12;
|
|
90
82
|
// Between the fields of a pick record and of the pin
|
|
@@ -93,7 +85,7 @@ export const PICK_RETENTION_DAYS = 7;
|
|
|
93
85
|
// The roster cache's file name is the prefix, the revision of the roster's fields and the installed data package's
|
|
94
86
|
// Version, so a bump or a new field writes a new one: a cache written before a field existed reads it as missing
|
|
95
87
|
export const ROSTER_CACHE_PREFIX = "roster-";
|
|
96
|
-
export const ROSTER_CACHE_REVISION =
|
|
88
|
+
export const ROSTER_CACHE_REVISION = 3;
|
|
97
89
|
export const ROSTER_CACHE_EXTENSION = ".json";
|
|
98
90
|
// Every month and day is measured inside one leap year, so 29 February is a day like any other and the year wraps
|
|
99
91
|
export const LEAP_YEAR = 2000;
|
|
@@ -216,6 +208,11 @@ export const MIN_SPEECH_TOKEN_CEILING = 100;
|
|
|
216
208
|
export const WARM_TEXT = "Ready.";
|
|
217
209
|
// What the `voice` verb speaks once set up, so the person hears the voice before the first reply does
|
|
218
210
|
export const VOICE_PROOF_TEXT = "The voice is set up, and a reply's spoken lines are read from the next session on.";
|
|
211
|
+
// The motion map before a reader maps anything: every moment is there, each with no motion
|
|
212
|
+
export const EMPTY_VIEWER_MOTIONS: ViewerConfiguration["motions"] = {
|
|
213
|
+
[ViewerMoment.Attention]: "",
|
|
214
|
+
[ViewerMoment.TurnEnd]: "",
|
|
215
|
+
};
|
|
219
216
|
// The viewer's socket: the budget a connection and its registration get to answer, the state of an open socket, the
|
|
220
217
|
// Message numbers start, and the channel and volume every sound plays on
|
|
221
218
|
export const VIEWER_CONNECT_TIMEOUT_MS: number = Temporal.Duration.from({ seconds: 3 }).total("milliseconds");
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { SpeechRequest } from "#src/models/SpeechRequest";
|
|
2
|
+
|
|
3
|
+
import { getLineContent } from "#src/services/getLineContent";
|
|
4
|
+
import { getSpokenLine } from "#src/services/getSpokenLine";
|
|
5
|
+
|
|
6
|
+
// An opening fence is three or more backticks or tildes where a line's content begins; a backtick fence's info string
|
|
7
|
+
// Holds no backtick, so inline code that starts a line is not one
|
|
8
|
+
const OPENING_FENCE_REGEX = /^(?<marker>`{3,}(?=[^`]*$)|~{3,})/u;
|
|
9
|
+
// A closing fence carries nothing after its marker but spaces or tabs, so a line of text that begins with one is code
|
|
10
|
+
const CLOSING_FENCE_REGEX = /^(?<marker>`{3,}|~{3,})[ \t]*$/u;
|
|
11
|
+
// A closing fence is the opening fence's character, at least its length
|
|
12
|
+
const isClosingFence = (content: string, opener: string) => {
|
|
13
|
+
const closer = CLOSING_FENCE_REGEX.exec(content)?.groups?.marker ?? "";
|
|
14
|
+
return closer.startsWith(opener.charAt(0)) && closer.length >= opener.length;
|
|
15
|
+
};
|
|
16
|
+
// What the reader holds of a message between two of its pieces: the index of the piece it last read, and the fence
|
|
17
|
+
// That piece left open
|
|
18
|
+
interface MessageReading {
|
|
19
|
+
index: number;
|
|
20
|
+
opener?: string;
|
|
21
|
+
}
|
|
22
|
+
// The spoken lines of each piece of a reply, in the order the pieces run. A fence can open in one piece and close in a
|
|
23
|
+
// Later one, so the fence a message is inside is held per message from one of its pieces to the next. A piece that
|
|
24
|
+
// Does not follow the one before it for its message had a piece missing between them, which may have carried the
|
|
25
|
+
// Fence, so it is read outside any. The reading is dropped with the message's final piece, so an unterminated block
|
|
26
|
+
// Never reaches the next message
|
|
27
|
+
export const createSpokenLineReader = () => {
|
|
28
|
+
const readings = new Map<string, MessageReading>();
|
|
29
|
+
return ({
|
|
30
|
+
index,
|
|
31
|
+
isFinal,
|
|
32
|
+
markdown,
|
|
33
|
+
messageId,
|
|
34
|
+
}: Pick<SpeechRequest, "index" | "isFinal" | "markdown" | "messageId">): string[] => {
|
|
35
|
+
const previous = readings.get(messageId);
|
|
36
|
+
let opener = previous?.index === index - 1 ? previous.opener : undefined;
|
|
37
|
+
const lines: string[] = [];
|
|
38
|
+
for (const line of markdown.split("\n")) {
|
|
39
|
+
const content = getLineContent(line);
|
|
40
|
+
const openingMarker = OPENING_FENCE_REGEX.exec(content)?.groups?.marker;
|
|
41
|
+
if (opener) {
|
|
42
|
+
if (isClosingFence(content, opener)) opener = undefined;
|
|
43
|
+
} else if (openingMarker) opener = openingMarker;
|
|
44
|
+
else {
|
|
45
|
+
const spokenLine = getSpokenLine(line);
|
|
46
|
+
if (spokenLine !== undefined) lines.push(spokenLine);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (isFinal) readings.delete(messageId);
|
|
51
|
+
else readings.set(messageId, { index, opener });
|
|
52
|
+
return lines;
|
|
53
|
+
};
|
|
54
|
+
};
|
package/src/services/getCard.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { getBirthdayNote } from "#src/services/getBirthdayNote";
|
|
|
11
11
|
// And the card's otherwise. The rest of the authored card reaches the model alone and stays as written — a model
|
|
12
12
|
// Reading the habits and the sign-off in English answers in whatever language it was asked to, register intact
|
|
13
13
|
export const getCard = (
|
|
14
|
-
{ birthday, description, displayElement, displayName,
|
|
14
|
+
{ birthday, description, displayElement, displayName, name, region, title }: Character,
|
|
15
15
|
today: Temporal.PlainDate,
|
|
16
16
|
localization: ResolvedLocalization,
|
|
17
17
|
personaCard?: PersonaCard,
|
|
@@ -19,12 +19,9 @@ export const getCard = (
|
|
|
19
19
|
const details = [title, displayElement, region].filter(Boolean).join(CARD_DETAIL_SEPARATOR);
|
|
20
20
|
return {
|
|
21
21
|
description,
|
|
22
|
-
element,
|
|
23
22
|
greeting: localization.characters[name]?.greeting ?? personaCard?.greeting ?? "",
|
|
24
23
|
headline: details ? `${displayName} — ${details}` : displayName,
|
|
25
|
-
name,
|
|
26
24
|
note: getBirthdayNote(birthday, today, localization),
|
|
27
25
|
personaCard,
|
|
28
|
-
rarity,
|
|
29
26
|
};
|
|
30
27
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// The prefix a reply line opens with: its indentation, then a blockquote marker for each quote it sits in. A spoken
|
|
2
|
+
// Line and a fence are both read past it, so the two cannot disagree on where a line's content begins
|
|
3
|
+
const LINE_PREFIX_REGEX = /^(?:\s*>\s?)*\s*/u;
|
|
4
|
+
|
|
5
|
+
export const getLineContent = (line: string): string => line.replace(LINE_PREFIX_REGEX, "");
|
|
@@ -6,7 +6,7 @@ import { LORE_CHART_ROWS } from "#src/services/constants";
|
|
|
6
6
|
import { findCharacterByName } from "#src/services/findCharacterByName";
|
|
7
7
|
|
|
8
8
|
// The rows the welcome's chart shows: the tier's choice first, then the runners-up by probability, at most the chart's
|
|
9
|
-
// Rows
|
|
9
|
+
// Rows
|
|
10
10
|
export const getLoreRates = ({ choice, probabilities }: ChoiceResponse, roster: Character[]): LoreRate[] => {
|
|
11
11
|
const runnersUp = Object.keys(probabilities)
|
|
12
12
|
.filter((name) => name !== choice)
|
|
@@ -18,7 +18,6 @@ export const getLoreRates = ({ choice, probabilities }: ChoiceResponse, roster:
|
|
|
18
18
|
.slice(0, LORE_CHART_ROWS)
|
|
19
19
|
.map(({ name, probability }) => ({
|
|
20
20
|
displayName: findCharacterByName(roster, name)?.displayName ?? name,
|
|
21
|
-
name,
|
|
22
21
|
probability,
|
|
23
22
|
}));
|
|
24
23
|
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import type { Card } from "#src/models/Card";
|
|
2
|
-
import type { LoreRate } from "#src/models/LoreRate";
|
|
3
2
|
import type { SessionStartOutput } from "#src/models/SessionStartOutput";
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
CHARACTER_LINE_PREFIX,
|
|
7
|
-
DEFAULT_LANGUAGE,
|
|
8
|
-
ELEMENT_LINE_PREFIX,
|
|
9
|
-
LORE_RATES_LINE_PREFIX,
|
|
10
|
-
NAMEPLATE_PREFIX,
|
|
11
|
-
RARITY_LINE_PREFIX,
|
|
12
|
-
} from "#src/services/constants";
|
|
4
|
+
import { DEFAULT_LANGUAGE, NAMEPLATE_PREFIX } from "#src/services/constants";
|
|
13
5
|
import { formatCard } from "#src/services/formatCard";
|
|
14
6
|
import { getReplyLanguageInstruction } from "#src/services/getReplyLanguageInstruction";
|
|
15
7
|
|
|
@@ -19,30 +11,18 @@ import { getReplyLanguageInstruction } from "#src/services/getReplyLanguageInstr
|
|
|
19
11
|
// Is a fact the model answers from. The reply language rides in the context rather than in the output style, which
|
|
20
12
|
// Is a file the plugin ships and cannot vary per person, and it is absent only when everything the model reads is
|
|
21
13
|
// English already — the reply language and the card's, which is the interface language's — so the common case
|
|
22
|
-
// Costs nothing and a card in another language never pulls the spoken lines into it.
|
|
23
|
-
// The character for a program — the agent console's Genshin theme — rather than for the model: its stars, and the
|
|
24
|
-
// Welcome chart's rows when the lore pick chose it, which the theme's rates panel shows
|
|
14
|
+
// Costs nothing and a card in another language never pulls the spoken lines into it.
|
|
25
15
|
export const getSessionStartOutput = (
|
|
26
16
|
card: Card,
|
|
27
17
|
remarks: string[],
|
|
28
18
|
replyLanguage: string,
|
|
29
19
|
interfaceLanguage: string,
|
|
30
|
-
loreRates: LoreRate[] = [],
|
|
31
20
|
): string => {
|
|
32
21
|
const isEnglishThroughout = replyLanguage === DEFAULT_LANGUAGE && interfaceLanguage === DEFAULT_LANGUAGE;
|
|
33
22
|
const instruction = isEnglishThroughout ? "" : getReplyLanguageInstruction(replyLanguage);
|
|
34
23
|
const output: SessionStartOutput = {
|
|
35
24
|
hookSpecificOutput: {
|
|
36
|
-
additionalContext: [
|
|
37
|
-
formatCard(card),
|
|
38
|
-
instruction,
|
|
39
|
-
`${CHARACTER_LINE_PREFIX}${card.name}`,
|
|
40
|
-
card.element ? `${ELEMENT_LINE_PREFIX}${card.element}` : "",
|
|
41
|
-
`${RARITY_LINE_PREFIX}${card.rarity}`,
|
|
42
|
-
loreRates.length > 0 ? `${LORE_RATES_LINE_PREFIX}${JSON.stringify(loreRates)}` : "",
|
|
43
|
-
]
|
|
44
|
-
.filter(Boolean)
|
|
45
|
-
.join("\n"),
|
|
25
|
+
additionalContext: [formatCard(card), instruction].filter(Boolean).join("\n"),
|
|
46
26
|
hookEventName: "SessionStart",
|
|
47
27
|
},
|
|
48
28
|
systemMessage: [`${NAMEPLATE_PREFIX}${card.headline}`, card.note, ...remarks, card.greeting]
|
|
@@ -8,19 +8,19 @@ import { getCharacterReference } from "#src/services/getCharacterReference";
|
|
|
8
8
|
import { readVolume } from "#src/services/readVolume";
|
|
9
9
|
|
|
10
10
|
// What a hook sends to be spoken or warmed: the character the session speaks as, with the reference the card or
|
|
11
|
-
// The generated map names for them, the dub the `voice` verb chose, the
|
|
12
|
-
//
|
|
11
|
+
// The generated map names for them, the dub the `voice` verb chose, the piece's markdown, where in the reply it sits
|
|
12
|
+
// And the volume as set
|
|
13
13
|
export const getSpeechRequest = (
|
|
14
14
|
type: SpeechRequest["type"],
|
|
15
15
|
name: string,
|
|
16
16
|
personaCard: PersonaCard | undefined,
|
|
17
17
|
language: VoiceLanguage,
|
|
18
|
-
|
|
18
|
+
markdown: string,
|
|
19
19
|
piece: ReplyPiece = TURNLESS_PIECE,
|
|
20
20
|
): SpeechRequest => ({
|
|
21
21
|
...piece,
|
|
22
22
|
language,
|
|
23
|
-
|
|
23
|
+
markdown,
|
|
24
24
|
name,
|
|
25
25
|
stem: getCharacterReference(name, personaCard),
|
|
26
26
|
type,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { checkIsReadable } from "#src/services/checkIsReadable";
|
|
2
|
+
import { collapseWhitespace } from "#src/services/collapseWhitespace";
|
|
3
|
+
import { getLineContent } from "#src/services/getLineContent";
|
|
4
|
+
|
|
5
|
+
// A spoken line may be a list item, so its marker is layout rather than words
|
|
6
|
+
const LIST_MARKER_REGEX = /^(?:[-+]|\d+\.)\s+/u;
|
|
7
|
+
const INLINE_CODE_REGEX = /`(?<code>[^`]*)`/gu;
|
|
8
|
+
const LINK_REGEX = /\[(?<text>[^\]]*)\]\([^)]*\)/gu;
|
|
9
|
+
const EMPHASIS_REGEX = /[*_~]{1,3}/gu;
|
|
10
|
+
// One line of a reply as it would be read out — the markup the style forbids stripped anyway — or nothing for a line
|
|
11
|
+
// That is not a spoken line or that the engine cannot read. The output style's one rule: a blockquote line is the
|
|
12
|
+
// Character's spoken line, and nothing else is written as one. Whether a line sits inside a fence is the reader's,
|
|
13
|
+
// Since it depends on the lines before it
|
|
14
|
+
export const getSpokenLine = (line: string): string | undefined => {
|
|
15
|
+
if (!line.trimStart().startsWith(">")) return undefined;
|
|
16
|
+
|
|
17
|
+
const spokenLine = collapseWhitespace(
|
|
18
|
+
getLineContent(line)
|
|
19
|
+
.replace(LIST_MARKER_REGEX, "")
|
|
20
|
+
.replaceAll(INLINE_CODE_REGEX, "$<code>")
|
|
21
|
+
.replaceAll(LINK_REGEX, "$<text>")
|
|
22
|
+
.replaceAll(EMPHASIS_REGEX, ""),
|
|
23
|
+
);
|
|
24
|
+
return checkIsReadable(spokenLine) ? spokenLine : undefined;
|
|
25
|
+
};
|
|
@@ -5,10 +5,10 @@ import { ViewerMoment as Moment } from "#src/models/ViewerMoment";
|
|
|
5
5
|
|
|
6
6
|
export interface ViewerReaction {
|
|
7
7
|
isExpressionCleared: boolean;
|
|
8
|
-
motion
|
|
8
|
+
motion: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// What the viewer does at a moment: the motion the reader mapped to it,
|
|
11
|
+
// What the viewer does at a moment: the motion the reader mapped to it, "" for none, and the expression cleared when a
|
|
12
12
|
// Turn is over
|
|
13
13
|
export const getViewerReaction = (moment: ViewerMoment, motions: ViewerConfiguration["motions"]): ViewerReaction => ({
|
|
14
14
|
isExpressionCleared: moment === Moment.TurnEnd,
|
|
@@ -12,4 +12,4 @@ export const getWarmRequest = (
|
|
|
12
12
|
name: string,
|
|
13
13
|
personaCard: PersonaCard | undefined,
|
|
14
14
|
language: VoiceLanguage,
|
|
15
|
-
): SpeechRequest => getSpeechRequest(VoiceRequestType.Warm, name, personaCard, language,
|
|
15
|
+
): SpeechRequest => getSpeechRequest(VoiceRequestType.Warm, name, personaCard, language, `> ${WARM_TEXT}`);
|
|
@@ -9,7 +9,7 @@ import { parseJsonObject } from "#src/services/parseJsonObject";
|
|
|
9
9
|
// On the machine can write to, so every field is checked before the synthesizer acts on it. A line that is not
|
|
10
10
|
// JSON at all throws, and the server answers that as it answers any request that fails
|
|
11
11
|
export const parseVoiceRequest = (line: string): undefined | VoiceRequest => {
|
|
12
|
-
const { index, isFinal, language,
|
|
12
|
+
const { index, isFinal, language, markdown, messageId, name, stem, turnId, type, volume } = parseJsonObject(line);
|
|
13
13
|
if (type === VoiceRequestType.Stop) return { type };
|
|
14
14
|
if (
|
|
15
15
|
(type !== VoiceRequestType.Speak && type !== VoiceRequestType.Warm) ||
|
|
@@ -23,11 +23,10 @@ export const parseVoiceRequest = (line: string): undefined | VoiceRequest => {
|
|
|
23
23
|
typeof index !== "number" ||
|
|
24
24
|
!Number.isInteger(index) ||
|
|
25
25
|
index < 0 ||
|
|
26
|
-
|
|
27
|
-
!lines.every((item) => typeof item === "string") ||
|
|
26
|
+
typeof markdown !== "string" ||
|
|
28
27
|
typeof volume !== "number" ||
|
|
29
28
|
!checkIsVolume(String(volume))
|
|
30
29
|
)
|
|
31
30
|
return undefined;
|
|
32
|
-
else return { index, isFinal, language,
|
|
31
|
+
else return { index, isFinal, language, markdown, messageId, name, stem, turnId, type, volume };
|
|
33
32
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { ViewerConfiguration } from "#src/models/ViewerConfiguration";
|
|
2
2
|
|
|
3
3
|
import { ViewerMoments } from "#src/models/ViewerMoment";
|
|
4
|
+
import { EMPTY_VIEWER_MOTIONS } from "#src/services/constants";
|
|
4
5
|
|
|
5
6
|
export const readMotions = (motions: unknown): ViewerConfiguration["motions"] => {
|
|
6
|
-
|
|
7
|
+
const result = { ...EMPTY_VIEWER_MOTIONS };
|
|
8
|
+
if (typeof motions !== "object" || motions === null) return result;
|
|
7
9
|
|
|
8
|
-
const result: ViewerConfiguration["motions"] = {};
|
|
9
10
|
for (const moment of ViewerMoments) {
|
|
10
11
|
const motion: unknown = Reflect.get(motions, moment);
|
|
11
|
-
if (typeof motion === "string"
|
|
12
|
+
if (typeof motion === "string") result[moment] = motion;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
return result;
|
|
@@ -48,7 +48,6 @@ export const readRoster = (language: string): Character[] => {
|
|
|
48
48
|
displayName: localized.name,
|
|
49
49
|
element: character.elementText,
|
|
50
50
|
name: character.name,
|
|
51
|
-
rarity: character.rarity,
|
|
52
51
|
region: localized.region,
|
|
53
52
|
title: localized.title,
|
|
54
53
|
version: character.version,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { ViewerConfiguration } from "#src/models/ViewerConfiguration";
|
|
2
2
|
import type { ViewerLink } from "#src/models/ViewerLink";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
EMPTY_VIEWER_MOTIONS,
|
|
6
|
+
VIEWER_DEFAULT_FRAME_COLOR,
|
|
7
|
+
VIEWER_PROOF_DURATION_MS,
|
|
8
|
+
VIEWER_TEXT_COLOR,
|
|
9
|
+
} from "#src/services/constants";
|
|
5
10
|
|
|
6
11
|
export interface SetViewerDependencies {
|
|
7
12
|
connect: (address: string) => Promise<undefined | ViewerLink>;
|
|
@@ -21,7 +26,7 @@ export const setViewer = async (
|
|
|
21
26
|
if (!link) return false;
|
|
22
27
|
|
|
23
28
|
link.bubble(modelId, proofText, VIEWER_PROOF_DURATION_MS, VIEWER_DEFAULT_FRAME_COLOR, VIEWER_TEXT_COLOR);
|
|
24
|
-
writeConfiguration({ address, modelId, motions: readConfiguration()?.motions ??
|
|
29
|
+
writeConfiguration({ address, modelId, motions: readConfiguration()?.motions ?? EMPTY_VIEWER_MOTIONS });
|
|
25
30
|
link.close();
|
|
26
31
|
return true;
|
|
27
32
|
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { checkIsReadable } from "#src/services/checkIsReadable";
|
|
2
|
-
import { collapseWhitespace } from "#src/services/collapseWhitespace";
|
|
3
|
-
|
|
4
|
-
// The closing fence is optional so a piece cut mid-block drops the rest of it too, rather than reading code aloud
|
|
5
|
-
const FENCED_CODE_REGEX = /```[\s\S]*?(?:```|$)/gu;
|
|
6
|
-
// The output style's one rule: a blockquote line is the character's spoken line, and nothing else is written as one
|
|
7
|
-
const SPOKEN_LINE_REGEX = /^\s*>\s?(?<line>.*)$/u;
|
|
8
|
-
// A spoken line may be a list item, so its marker is layout rather than words
|
|
9
|
-
const LIST_MARKER_REGEX = /^(?:[-+]|\d+\.)\s+/u;
|
|
10
|
-
const INLINE_CODE_REGEX = /`(?<code>[^`]*)`/gu;
|
|
11
|
-
const LINK_REGEX = /\[(?<text>[^\]]*)\]\([^)]*\)/gu;
|
|
12
|
-
const EMPHASIS_REGEX = /[*_~]{1,3}/gu;
|
|
13
|
-
// The spoken lines in a piece of a reply, as they would be read out — the markup the style forbids stripped
|
|
14
|
-
// Anyway, and only the lines the engine can read, gated here so a piece with none never wakes it. Stateless on
|
|
15
|
-
// Purpose: the tool flushes a reply at line breaks, so a spoken line arrives whole in one piece
|
|
16
|
-
export const getSpokenLines = (markdown: string): string[] =>
|
|
17
|
-
markdown
|
|
18
|
-
.replaceAll(FENCED_CODE_REGEX, "")
|
|
19
|
-
.split("\n")
|
|
20
|
-
.map((line) =>
|
|
21
|
-
collapseWhitespace(
|
|
22
|
-
(SPOKEN_LINE_REGEX.exec(line)?.groups?.line ?? "")
|
|
23
|
-
.replace(LIST_MARKER_REGEX, "")
|
|
24
|
-
.replaceAll(INLINE_CODE_REGEX, "$<code>")
|
|
25
|
-
.replaceAll(LINK_REGEX, "$<text>")
|
|
26
|
-
.replaceAll(EMPHASIS_REGEX, ""),
|
|
27
|
-
),
|
|
28
|
-
)
|
|
29
|
-
.filter((line) => checkIsReadable(line));
|