@rine-kit/pubg-reply 0.1.3 → 0.1.5

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.
@@ -10,6 +10,7 @@ export type Part = {
10
10
  arguments?: unknown;
11
11
  };
12
12
  export declare const FACT_TOOLS: Set<string>;
13
+ export declare const FACT: RegExp;
13
14
  export declare const BARE_RECORD_TTL_MS = 120000;
14
15
  export declare const SAFE_REPLY = "\u8FD9\u6B21 PUBG \u6218\u7EE9\u6CA1\u6709\u5B8C\u6210\u672C\u8F6E\u6570\u636E\u6838\u9A8C\uFF0C\u6211\u4E0D\u80FD\u786E\u8BA4\u7ED3\u679C\u3002\u8BF7\u518D\u8BD5\u4E00\u6B21\u3002";
15
16
  export declare function isBareRecordRequest(request: unknown): boolean;
package/dist/evidence.js CHANGED
@@ -4,7 +4,7 @@ export const FACT_TOOLS = new Set([
4
4
  'pubg_get_review_facts', 'pubg_get_period_review', 'pubg_query_team_damage',
5
5
  ]);
6
6
  const REQUEST = /PUBG|绝地求生|吃鸡|战绩|对局|几局|击杀|KD|K\/D/u;
7
- const FACT = /PUBG|绝地求生|吃鸡|战绩|对局|击杀|伤害|KD|K\/D|no_matches|\d+\s*(?:局|杀|场|次)|一局都没有|没有.{0,8}战绩/u;
7
+ export const FACT = /PUBG|绝地求生|吃鸡|战绩|对局|击杀|伤害|KD|K\/D|no_matches|\d+\s*(?:局|杀|场|次)|一局都没有|没有.{0,8}战绩/u;
8
8
  const TEAM = /全队|整队|队伍|小队|我们|咱们|大家|所有人|全员|team|squad/iu;
9
9
  // A bare record request names no one ("昨日战绩", "@Kurisu 今天战绩"); in the squad it means the whole team.
10
10
  const BARE_RECORD = /^(?:\s|@\S+\s*)*(?:今天|今日|昨天|昨日|前天|本周|这周|上周|最近)?\s*(?:的)?\s*(?:PUBG|吃鸡)?\s*(?:战绩|战况)\s*[??!!。.~]*\s*$/iu;
package/dist/persona.d.ts CHANGED
@@ -10,7 +10,14 @@ export interface AddressingRecord {
10
10
  externalId: string;
11
11
  }>;
12
12
  }
13
- export declare function renderGroupRoster(entries: readonly AddressingRecord[]): string | undefined;
13
+ /**
14
+ * Who decided the forms of address, as the roster's heading says it. Lab's own wording is the default (its roster is
15
+ * reviewed by Arthur); a host with another authority passes its own, e.g. RINE: the room's admins decide.
16
+ */
17
+ export declare const LAB_ROSTER_AUTHORITY = "Arthur \u5BA1\u6838\u8FC7\u7684\u957F\u671F\u8BBE\u5B9A";
18
+ export declare function renderGroupRoster<T extends AddressingRecord>(entries: readonly T[], options?: {
19
+ authority?: string;
20
+ }): string | undefined;
14
21
  /**
15
22
  * Group voice anchor: a squad group's session resets daily, which also drops the long in-character replies that kept
16
23
  * Kurisu talkative. This block restores the register on every turn without adding facts or capabilities.
package/dist/persona.js CHANGED
@@ -2,7 +2,12 @@
2
2
  * Moved unchanged from Lab's plugins/amadeus/src/group-roster.ts: the squad's forms of address and the group voice
3
3
  * anchor (Kurisu). Hosts decide where the entries come from (Lab: its identity store; RINE: the room's roster).
4
4
  */
5
- export function renderGroupRoster(entries) {
5
+ /**
6
+ * Who decided the forms of address, as the roster's heading says it. Lab's own wording is the default (its roster is
7
+ * reviewed by Arthur); a host with another authority passes its own, e.g. RINE: the room's admins decide.
8
+ */
9
+ export const LAB_ROSTER_AUTHORITY = 'Arthur 审核过的长期设定';
10
+ export function renderGroupRoster(entries, options = {}) {
6
11
  if (!entries.length)
7
12
  return undefined;
8
13
  const lines = entries.map((entry) => {
@@ -13,7 +18,7 @@ export function renderGroupRoster(entries) {
13
18
  return `- ${who}:称呼「${entry.addressAs}」${entry.avoid.length ? `;不要叫:${entry.avoid.join('、')}` : ''}${entry.note ? `;${entry.note}` : ''}`;
14
19
  });
15
20
  return [
16
- '本群成员的称呼(成员约定、Arthur 审核过的长期设定;与聊天记录里的旧叫法冲突时以这里为准):',
21
+ `本群成员的称呼(成员约定、${options.authority ?? LAB_ROSTER_AUTHORITY};与聊天记录里的旧叫法冲突时以这里为准):`,
17
22
  ...lines,
18
23
  '称呼成员时用这里的叫法。查询战绩、确认身份仍按身份与 PUBG 工具,不要从称呼推断账号。',
19
24
  ].join('\n');
@@ -1,10 +1,32 @@
1
1
  import { type PubgPresentation } from '@rine-kit/presentation';
2
+ /** The squad members the worked examples talk about: three players (name and PUBG account) and one clean-record player. */
3
+ export interface ExampleSquad {
4
+ a: {
5
+ name: string;
6
+ account: string;
7
+ };
8
+ b: {
9
+ name: string;
10
+ account: string;
11
+ };
12
+ c: {
13
+ name: string;
14
+ account: string;
15
+ };
16
+ d: {
17
+ name: string;
18
+ };
19
+ }
20
+ /** Lab's squad, as the examples have always named it: the default, so Lab's output does not change. */
21
+ export declare const LAB_EXAMPLE_SQUAD: ExampleSquad;
2
22
  /** Worked examples in a squad's voice, one per answer type that has one. */
3
23
  export interface PubgReplyExamples {
4
24
  stats?: string;
5
25
  teamDamage?: string;
6
26
  }
7
- /** Lab's examples (Kurisu): the default voice. */
27
+ /** The Kurisu worked examples about the given squad (the voice and layout are the same for every squad). */
28
+ export declare function kurisuReplyExamples(squad?: ExampleSquad): PubgReplyExamples;
29
+ /** Lab's examples (Kurisu, about Lab's squad): the default voice. */
8
30
  export declare const KURISU_REPLY_EXAMPLES: PubgReplyExamples;
9
31
  /** The shared guide for the result, followed by the given worked example when one exists for its type. */
10
32
  export declare function replyGuideWith(examples: PubgReplyExamples): (presentation: PubgPresentation) => string | undefined;
@@ -3,18 +3,18 @@ import { pubgReplyGuide } from '@rine-kit/presentation';
3
3
  * The squad chat's reply guide: the shared rules from @rine-kit/presentation plus a worked example in this squad's
4
4
  * voice (Kurisu, the group's 称呼). The example is what keeps the model on the rich 战报 shape after a session reset.
5
5
  */
6
- const STATS_EXAMPLE = [
6
+ const STATS_TEMPLATE = [
7
7
  '写法示例(数字仅示意,实际以 displayText 为准):',
8
- '……变态猴!下午还嚷嚷着让我吃子弹,晚上一查战绩,你这火力全倾泻在敌人身上了啊?!',
8
+ '……{{b.name}}!下午还嚷嚷着让我吃子弹,晚上一查战绩,你这火力全倾泻在敌人身上了啊?!',
9
9
  '',
10
10
  '🏆 10月18日星期日 全天战报',
11
11
  '',
12
- '🥇 **效率杀手:Nori(kim_kkl)**',
12
+ '🥇 **效率杀手:{{a.name}}({{a.account}})**',
13
13
  '• **出战 3 局**:**5 杀**,1 助攻,1283.7 伤害,9 击倒,1 救援,2 爆头,2 次前十',
14
14
  '• 个人数据:**KD 1.67**,场均伤害 427.9,最远击杀 314.3m,3 死',
15
15
  '• AI 锐评:只玩了三把,KD 1.67 全队最高,场均 427.9 伤害,每把都在暴力抽靶,打完就跑,标准的效率派。',
16
16
  '',
17
- '🥈 **火力真大核·反派逆袭:变态猴(SG_LabmemNo004)**',
17
+ '🥈 **火力真大核·反派逆袭:{{b.name}}({{b.account}})**',
18
18
  '• **出战 8 局**:**10 杀**,**11 助攻(全队助攻王)**,**2743.0 伤害(全队伤害第一)**,**15 击倒(破点王)**,3 救援,3 爆头,6 次前十,**1 吃鸡**',
19
19
  '• 个人数据:**KD 1.43**,场均伤害 342.9,最远击杀 318.5m,7 死',
20
20
  '• AI 锐评:下午还在问自己是不是反派,今晚直接化身终极大 BOSS!8 局轰了 2700 多伤害外加 11 个助攻,这火力确实没得黑。',
@@ -23,13 +23,13 @@ const STATS_EXAMPLE = [
23
23
  '',
24
24
  '**团队合计:29 杀,6779.9 伤害,40 击倒,18 助攻,14 救援,团队 KD 1.00,吃鸡 1**',
25
25
  '',
26
- '变态猴单人砍了 2743 点输出,看来考完试脑神经元彻底释放了。都快半夜了,战报查爽了就赶紧关电脑睡觉去,笨蛋!',
26
+ '{{b.name}}单人砍了 2743 点输出,看来考完试脑神经元彻底释放了。都快半夜了,战报查爽了就赶紧关电脑睡觉去,笨蛋!',
27
27
  '',
28
28
  '🔗 (displayText 里的分享链接)',
29
29
  ].join('\n');
30
- const TEAM_DAMAGE_EXAMPLE = [
30
+ const TEAM_DAMAGE_TEMPLATE = [
31
31
  '写法示例(数字仅示意):',
32
- '……刚自封完「天上天下唯我独尊」,一转头就来对账了是吧,变态猴!',
32
+ '……刚自封完「天上天下唯我独尊」,一转头就来对账了是吧,{{b.name}}!',
33
33
  '',
34
34
  '🥊 10月18日星期日 队内误伤账本',
35
35
  '• 总误伤:**738.8 点**',
@@ -38,24 +38,36 @@ const TEAM_DAMAGE_EXAMPLE = [
38
38
  '───',
39
39
  '',
40
40
  '**互相伤害明细(共 4 个方向):**',
41
- '1. **狂气压制:Arthur(SG_LabmemNo007) ➡️ 变态猴(SG_LabmemNo004)**',
41
+ '1. **狂气压制:{{c.name}}({{c.account}}) ➡️ {{b.name}}({{b.account}})**',
42
42
  ' • 总输出:**16 次命中,造成 334.7 伤害**(飞踢 16 次)',
43
43
  ' • 狂气所长只要近身,脚尖就焊死在你身上,单向对内输出全场最高!',
44
- '2. **疯狂反扑:变态猴(SG_LabmemNo004) ➡️ Arthur(SG_LabmemNo007)**',
44
+ '2. **疯狂反扑:{{b.name}}({{b.account}}) ➡️ {{c.name}}({{c.account}})**',
45
45
  ' • 总输出:**16 次命中,造成 267.0 伤害**(飞踢 14 次、重拳 2 次)',
46
46
  ' • 你们俩今天整整 32 次肉搏互换,对攻 601.7 点,占全队内讧的 81%!',
47
47
  '',
48
48
  '───',
49
49
  '',
50
50
  '**名场面:**',
51
- '• 第 9 局(米拉玛 #12,21:01):单局 **263.5 点(12 次命中)**:Arthur ➡️ 变态猴 7 次 174.5 点;变态猴 ➡️ Arthur 5 次 89.0 点。两人踢得尘土飞扬!',
51
+ '• 第 9 局(米拉玛 #12,21:01):单局 **263.5 点(12 次命中)**:{{c.name}} ➡️ {{b.name}} 7 次 174.5 点;{{b.name}} ➡️ {{c.name}} 5 次 89.0 点。两人踢得尘土飞扬!',
52
52
  '',
53
- '清白名单:打工战士今天继续保持清白,0 次主动队内输出。',
53
+ '清白名单:{{d.name}}今天继续保持清白,0 次主动队内输出。',
54
54
  '',
55
55
  '总结:对外你是 MVP,对内你挨了 334 点、还了 267 点,稳稳领跑全场内耗核心!账本焊死在这了,赶紧关机睡觉去,最强肉盾猴!',
56
56
  ].join('\n');
57
- /** Lab's examples (Kurisu): the default voice. */
58
- export const KURISU_REPLY_EXAMPLES = { stats: STATS_EXAMPLE, teamDamage: TEAM_DAMAGE_EXAMPLE };
57
+ /** Lab's squad, as the examples have always named it: the default, so Lab's output does not change. */
58
+ export const LAB_EXAMPLE_SQUAD = {
59
+ a: { name: 'Nori', account: 'kim_kkl' },
60
+ b: { name: '变态猴', account: 'SG_LabmemNo004' },
61
+ c: { name: 'Arthur', account: 'SG_LabmemNo007' },
62
+ d: { name: '打工战士' },
63
+ };
64
+ const fill = (template, squad) => template.replace(/\{\{([abcd])\.(name|account)\}\}/gu, (_all, who, field) => field === 'account' ? squad[who].account ?? '' : squad[who].name);
65
+ /** The Kurisu worked examples about the given squad (the voice and layout are the same for every squad). */
66
+ export function kurisuReplyExamples(squad = LAB_EXAMPLE_SQUAD) {
67
+ return { stats: fill(STATS_TEMPLATE, squad), teamDamage: fill(TEAM_DAMAGE_TEMPLATE, squad) };
68
+ }
69
+ /** Lab's examples (Kurisu, about Lab's squad): the default voice. */
70
+ export const KURISU_REPLY_EXAMPLES = kurisuReplyExamples();
59
71
  /** The shared guide for the result, followed by the given worked example when one exists for its type. */
60
72
  export function replyGuideWith(examples) {
61
73
  return (presentation) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rine-kit/pubg-reply",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "How a PUBG tool result reaches the model and the chat: the presentation glue (displayText in the chat layout, replyGuide, share link), the squad voice and roster, the PUBG rules text, the bare-record scope guard and the outbound evidence check. Moved unchanged from Lab's plugins/pubg and plugins/amadeus; hosts add only delivery.",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@rine-kit/presentation": "0.1.3",
22
- "@rine-kit/pubg-domain": "0.1.3"
21
+ "@rine-kit/presentation": "0.1.5",
22
+ "@rine-kit/pubg-domain": "0.1.5"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^26.6.5",