@bettergi/types 0.1.18 → 0.1.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettergi/types",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "BetterGI TypeScript 类型定义",
5
5
  "type": "module",
6
6
  "author": "Bread Grocery<https://github.com/breadgrocery>",
@@ -62,6 +62,9 @@ export type BossName =
62
62
  | "霜夜巡天灵主"
63
63
  | "蕴光月幻蝶"
64
64
  | "重拳出击鸭"
65
+ // 至冬
66
+ | "不灭衍生造物"
67
+ | "嵌合翼骏狮"
65
68
  | "" // 未指定
66
69
  | (string & {});
67
70
 
@@ -56,7 +56,7 @@ export interface AutoDomainParam extends Omit<
56
56
  */
57
57
  partyName: string;
58
58
  /**
59
- * 需要刷取的秘境名称;空字符串表示未指定
59
+ * 需要刷取的秘境名称;空字符串表示未指定,`根据提升指南选择秘境` 表示按冒险手册提升指南选择
60
60
  * @since 0.52.0
61
61
  */
62
62
  domainName: DomainName;
@@ -27,10 +27,11 @@ export type ArtifactStar = "1" | "2" | "3" | "4" | (string & {});
27
27
 
28
28
  /**
29
29
  * 可自动刷取的秘境名称
30
- * 来源:`MapLazyAssets` 从 `tp.json` 提取的 BlessDomain / ForgeryDomain / MasteryDomain 点位名
30
+ * 来源:`MapLazyAssets` 从 `tp.json` 提取的 BlessDomain / ForgeryDomain / MasteryDomain 点位名;`根据提升指南选择秘境` 为 `AutoDomainTask.DevelopmentGuideOption` 固定选项
31
31
  * @since 0.52.0
32
32
  */
33
33
  export type DomainName =
34
+ | "根据提升指南选择秘境"
34
35
  | "铭记之谷"
35
36
  | "忘却之峡"
36
37
  | "仲夏庭园"
@@ -119,6 +120,11 @@ declare global {
119
120
  }
120
121
 
121
122
  export interface AutoDomainTaskHostType extends HostType<AutoDomainTask, ReferenceTypeTrait> {
123
+ /**
124
+ * 按提升指南选择秘境的固定选项名
125
+ * @since 0.65.0
126
+ */
127
+ readonly developmentGuideOption: "根据提升指南选择秘境";
122
128
  /**
123
129
  * 使用自动秘境参数创建任务
124
130
  * @param taskParam 自动秘境参数
@@ -25,19 +25,20 @@ export type OnlyPickEliteDropsMode =
25
25
  | (string & {});
26
26
 
27
27
  /**
28
- * 战斗策略名称;`根据队伍自动选择` 表示按当前队伍匹配策略目录,其余为 `User/AutoFight` 下策略文件名(不含扩展名)
28
+ * 战斗策略名称;`根据队伍自动选择` 表示按当前队伍匹配策略目录,`自动连招(实验)` 为 LLM 行为树固定名且不对应策略文件,其余为 `User/AutoFight` 下策略文件名(不含扩展名)
29
29
  * @since 0.52.0
30
30
  */
31
- export type CombatStrategyName = "根据队伍自动选择" | (string & {});
31
+ export type CombatStrategyName = "根据队伍自动选择" | "自动连招(实验)" | (string & {});
32
32
 
33
33
  /**
34
34
  * 战斗策略文件种类标识
35
- * 与上游 `AutoFightParam.ResolveStrategyPath` 返回的第二项对齐:优先命中 `.json`,否则回退 `.txt`;自动选队目录亦标为 `txt`
35
+ * 与上游 `AutoFightParam.ResolveStrategyPath` 返回的第二项对齐:优先命中 `.json`,否则回退 `.txt`;自动选队目录亦标为 `txt`;`自动连招(实验)` 标为 `combo`
36
36
  * @since 0.52.0
37
37
  */
38
38
  export type StrategyFileKind =
39
39
  | "json" // JSON 战斗策略
40
40
  | "txt" // 文本 / 简易策略(含「根据队伍自动选择」目录)
41
+ | "combo" // 自动连招(LLM 行为树),不对应策略文件
41
42
  | (string & {});
42
43
 
43
44
  /**
@@ -74,7 +75,6 @@ export interface AutoFightConfig
74
75
  | "pickDropsAfterFightEnabled"
75
76
  | "pickDropsAfterFightSeconds"
76
77
  | "qinDoublePickUp"
77
- | "skipModel"
78
78
  | "strategyName"
79
79
  | "swimmingEnabled"
80
80
  | "teamNames"
@@ -145,12 +145,12 @@ export interface AutoFightConfig
145
145
  */
146
146
  onlyPickEliteDropsMode: OnlyPickEliteDropsMode;
147
147
  /**
148
- * 是否在战斗结束后拾取掉落物
148
+ * 是否在战斗结束后光柱扫描掉落物,默认开启
149
149
  * @since 0.52.0
150
150
  */
151
151
  pickDropsAfterFightEnabled: boolean;
152
152
  /**
153
- * 战斗结束后拾取掉落物的等待时长,单位秒,默认 15
153
+ * 战斗结束后光柱扫描掉落物的持续时长,单位秒,默认 15
154
154
  * @since 0.52.0
155
155
  */
156
156
  pickDropsAfterFightSeconds: number;
@@ -160,12 +160,7 @@ export interface AutoFightConfig
160
160
  */
161
161
  qinDoublePickUp: boolean;
162
162
  /**
163
- * 是否启用跳过模型
164
- * @since 0.52.0
165
- */
166
- skipModel: boolean;
167
- /**
168
- * 战斗策略名称,`根据队伍自动选择` 表示按当前队伍匹配策略
163
+ * 战斗策略名称,`根据队伍自动选择` 表示按当前队伍匹配策略,`自动连招(实验)` 为 LLM 行为树固定名
169
164
  * @since 0.52.0
170
165
  */
171
166
  strategyName: CombatStrategyName;
@@ -220,8 +215,6 @@ export interface AutoFightConfig_FightFinishDetectConfig
220
215
  extends
221
216
  Omit<
222
217
  CommunityToolkit.Mvvm.ComponentModel.ObservableObject,
223
- | "battleEndProgressBarColor"
224
- | "battleEndProgressBarColorTolerance"
225
218
  | "beforeDetectDelay"
226
219
  | "blockCheckBeforeBattleSeconds"
227
220
  | "checkAfterSwitchAvatar"
@@ -239,16 +232,6 @@ export interface AutoFightConfig_FightFinishDetectConfig
239
232
  System.ComponentModel.INotifyPropertyChangedInput,
240
233
  System.ComponentModel.INotifyPropertyChangingInput {
241
234
  readonly [autoFightConfig_FightFinishDetectConfigBrand]: true;
242
- /**
243
- * 战斗结束进度条颜色容差,`6` 表示三通道相同容差,`6,6,6` 可分别设置,格式为 RGB
244
- * @since 0.52.0
245
- */
246
- battleEndProgressBarColorTolerance: string;
247
- /**
248
- * 判断战斗结束的进度条颜色,`RGB` 格式,默认 `95,235,255`
249
- * @since 0.52.0
250
- */
251
- battleEndProgressBarColor: string;
252
235
  /**
253
236
  * 按下切换队伍后检测屏幕色块的延迟,单位秒,默认 `0.4`,频繁误判时可适当提高
254
237
  * @since 0.52.0
@@ -305,12 +288,12 @@ export interface AutoFightConfig_FightFinishDetectConfig
305
288
  */
306
289
  blockCheckBeforeBattleSeconds: number;
307
290
  /**
308
- * 是否启用派蒙辅助检测;按 L 后当派蒙头像可见时提前跳出战斗结束检测
291
+ * 是否启用派蒙辅助检测;按 L 后当派蒙头像可见时提前跳出战斗结束检测,默认关闭
309
292
  * @since 0.64.0
310
293
  */
311
294
  paimonEndCheckEnabled: boolean;
312
295
  /**
313
- * 派蒙辅助检测延时,单位秒
296
+ * 派蒙辅助检测延时,单位秒,默认 0.2
314
297
  * @since 0.64.0
315
298
  */
316
299
  paimonEndCheckDelay: number;
@@ -69,12 +69,12 @@ export interface AutoFightParam extends Omit<
69
69
  */
70
70
  fightFinishDetectEnabled: boolean;
71
71
  /**
72
- * 是否在战斗结束后拾取掉落物
72
+ * 是否在战斗结束后光柱扫描掉落物,默认开启
73
73
  * @since 0.52.0
74
74
  */
75
75
  pickDropsAfterFightEnabled: boolean;
76
76
  /**
77
- * 战斗结束后拾取掉落物的等待时长,单位秒,默认 15
77
+ * 战斗结束后光柱扫描掉落物的持续时长,单位秒,默认 15
78
78
  * @since 0.52.0
79
79
  */
80
80
  pickDropsAfterFightSeconds: number;
@@ -201,16 +201,6 @@ export interface AutoFightParam extends Omit<
201
201
  declare const autoFightParam_FightFinishDetectConfigBrand: unique symbol;
202
202
  export interface AutoFightParam_FightFinishDetectConfig extends ClrHostValue {
203
203
  readonly [autoFightParam_FightFinishDetectConfigBrand]: true;
204
- /**
205
- * 判断战斗结束的进度条颜色,`RGB` 格式,默认 `95,235,255`
206
- * @since 0.52.0
207
- */
208
- battleEndProgressBarColor: string;
209
- /**
210
- * 战斗结束进度条颜色容差,`6` 表示三通道相同容差,`6,6,6` 可分别设置
211
- * @since 0.52.0
212
- */
213
- battleEndProgressBarColorTolerance: string;
214
204
  /**
215
205
  * 是否启用快速检查战斗结束
216
206
  * @since 0.52.0
@@ -288,6 +278,11 @@ declare global {
288
278
  }
289
279
 
290
280
  export interface AutoFightParamHostType extends HostType<AutoFightParam, ReferenceTypeTrait> {
281
+ /**
282
+ * 自动连招(LLM 行为树)策略的固定名称;不对应策略文件,命中时路由到自动连招任务
283
+ * @since 0.65.0
284
+ */
285
+ readonly comboStrategyName: "自动连招(实验)";
291
286
  /**
292
287
  * 使用指定策略路径与自动战斗配置构造参数
293
288
  * @param path 战斗策略文件或策略目录路径
@@ -311,7 +306,7 @@ export interface AutoFightParamHostType extends HostType<AutoFightParam, Referen
311
306
  */
312
307
  swimmingEnabled: boolean;
313
308
  /**
314
- * 解析策略文件路径,优先检测 `.json`,未命中则回退 `.txt`
309
+ * 解析策略文件路径,优先检测 `.json`,未命中则回退 `.txt`;`自动连招(实验)` 返回策略名本身且种类为 `combo`
315
310
  * @param strategyName 策略名称(不含扩展名)
316
311
  * @returns 完整路径与策略文件种类组成的元组
317
312
  * @since 0.52.0
@@ -11,11 +11,9 @@ import "../../../System/Collections/Generic/Dictionary";
11
11
  import "../../../System/Collections/Generic/List";
12
12
  import "../../../System/DateTime";
13
13
  import "../../../System/Threading/CancellationToken";
14
- import "../../../System/ValueTuple";
15
14
  import "../AutoPathing/Model/WaypointForTrack";
16
15
  import "../ISoloTask";
17
16
  import "./AutoFightParam";
18
- import "./Model/CombatScenes";
19
17
 
20
18
  /**
21
19
  * 自动战斗独立任务
@@ -29,12 +27,6 @@ export interface AutoFightTask extends ClrHostValue, BetterGenshinImpact.GameTas
29
27
  * @since 0.52.0
30
28
  */
31
29
  readonly name: string;
32
- /**
33
- * 识别当前队伍战斗场景,失败时最多重试 5 次
34
- * @returns 已初始化的战斗场景
35
- * @since 0.52.0
36
- */
37
- getCombatScenesWithRetry(): BetterGenshinImpact.GameTask.AutoFight.Model.CombatScenes;
38
30
  /**
39
31
  * 启动自动战斗任务
40
32
  * @param ct 取消令牌
@@ -124,16 +116,6 @@ export interface AutoFightTask_TaskFightFinishDetectConfig extends ClrHostValue
124
116
  * @since 0.64.0
125
117
  */
126
118
  paimonEndCheckDelayMs: number;
127
- /**
128
- * 判断战斗结束的进度条颜色,RGB 三元组
129
- * @since 0.64.0
130
- */
131
- readonly battleEndProgressBarColor: System.ValueTuple<number, number, number>;
132
- /**
133
- * 战斗结束进度条颜色容差,RGB 三元组
134
- * @since 0.64.0
135
- */
136
- readonly battleEndProgressBarColorTolerance: System.ValueTuple<number, number, number>;
137
119
  }
138
120
 
139
121
  export interface AutoFightTask_TaskFightFinishDetectConfigHostType extends HostType<
@@ -11,8 +11,8 @@ import "../../../../OpenCvSharp/Rect";
11
11
  import "../../../../System/DateTime";
12
12
  import "../../../../System/Nullable";
13
13
  import "../../../../System/Threading/CancellationToken";
14
- import "../../../../System/WebSocket";
15
14
  import type { KeyCode } from "../../../Helpers/User32Helper";
15
+ import "../../AutoGeniusInvokation/Exception/RetryException";
16
16
  import "../../Model/Area/ImageRegion";
17
17
  import "../Config/CombatAvatar";
18
18
  import "./CombatScenes";
@@ -469,13 +469,16 @@ export interface AvatarHostType extends HostType<Avatar, ReferenceTypeTrait> {
469
469
  ct: System.Threading.CancellationToken
470
470
  ): VoidResult;
471
471
  /**
472
- * 传送到七天神像恢复角色状态
472
+ * 传送到七天神像恢复角色状态;完成后抛出传入的重试异常
473
473
  * @param ct 取消令牌
474
- * @param ex 触发恢复的异常
474
+ * @param retryException 触发恢复后用于重试当前任务的异常
475
475
  * @returns ClearScript 宿主空结果
476
476
  * @since 0.50.0
477
477
  */
478
- tpForRecover(ct: System.Threading.CancellationToken, ex: System.Exception): VoidResult;
478
+ tpForRecover(
479
+ ct: System.Threading.CancellationToken,
480
+ retryException: BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception.RetryException
481
+ ): VoidResult;
479
482
  /**
480
483
  * 从配置字符串中查找角色冷却秒数
481
484
  * @param avatarName 角色名称
@@ -246,6 +246,12 @@ export interface CombatScenesHostType extends HostType<CombatScenes, ReferenceTy
246
246
  logger: Microsoft.Extensions.Logging.ILogger | null,
247
247
  systemInfo: BetterGenshinImpact.GameTask.Model.ISystemInfo | null
248
248
  ): CombatScenes;
249
+ /**
250
+ * 截屏识别队伍角色并初始化战斗场景,失败时最多重试 5 次,间隔 1 秒
251
+ * @returns 已初始化的战斗场景
252
+ * @since 0.65.0
253
+ */
254
+ getCombatScenesWithRetry(): CombatScenes;
249
255
  }
250
256
 
251
257
  export {};
@@ -0,0 +1,42 @@
1
+ import type {
2
+ HostType,
3
+ PublicDefaultConstructorTrait,
4
+ ReferenceTypeTrait
5
+ } from "../../../../Microsoft/ClearScript/HostType";
6
+ import "../../../../System/Runtime/Serialization/ISerializable";
7
+ import "../../../../System/WebSocket";
8
+
9
+ /**
10
+ * 需要重试当前任务时抛出的异常
11
+ * @since 0.65.0
12
+ */
13
+ declare const retryExceptionBrand: unique symbol;
14
+ export interface RetryException
15
+ extends System.Exception, System.Runtime.Serialization.ISerializableInput {
16
+ readonly [retryExceptionBrand]: true;
17
+ }
18
+
19
+ declare global {
20
+ namespace BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception {
21
+ type RetryException = import("./RetryException").RetryException;
22
+ }
23
+ }
24
+
25
+ export interface RetryExceptionHostType extends HostType<
26
+ RetryException,
27
+ ReferenceTypeTrait & PublicDefaultConstructorTrait
28
+ > {
29
+ /**
30
+ * 构造实例
31
+ * @since 0.65.0
32
+ */
33
+ new (): RetryException;
34
+ /**
35
+ * 使用说明信息构造实例
36
+ * @param message 异常说明
37
+ * @since 0.65.0
38
+ */
39
+ new (message: string): RetryException;
40
+ }
41
+
42
+ export {};
@@ -24,7 +24,6 @@ export interface AutoLeyLineOutcropConfig
24
24
  | "fightConfig"
25
25
  | "friendshipTeam"
26
26
  | "isGoToSynthesizer"
27
- | "isNotification"
28
27
  | "isResinExhaustionMode"
29
28
  | "leyLineOutcropType"
30
29
  | "openModeCountMin"
@@ -32,7 +31,6 @@ export interface AutoLeyLineOutcropConfig
32
31
  | "scanDropsAfterRewardSeconds"
33
32
  | "team"
34
33
  | "timeout"
35
- | "useAdventurerHandbook"
36
34
  | "useFragileResin"
37
35
  | "useTransientResin"
38
36
  >,
@@ -64,11 +62,6 @@ export interface AutoLeyLineOutcropConfig
64
62
  * @since 0.58.0
65
63
  */
66
64
  isGoToSynthesizer: boolean;
67
- /**
68
- * 是否通过 BetterGI 通知系统发送详细通知
69
- * @since 0.58.0
70
- */
71
- isNotification: boolean;
72
65
  /**
73
66
  * 是否开启树脂耗尽模式
74
67
  * @since 0.58.0
@@ -104,11 +97,6 @@ export interface AutoLeyLineOutcropConfig
104
97
  * @since 0.58.0
105
98
  */
106
99
  timeout: number;
107
- /**
108
- * 是否使用冒险之证寻找地脉花
109
- * @since 0.58.0
110
- */
111
- useAdventurerHandbook: boolean;
112
100
  /**
113
101
  * 是否允许使用脆弱树脂
114
102
  * @since 0.58.0
@@ -147,8 +147,6 @@ export interface AutoLeyLineOutcropFightConfig_FightFinishDetectConfig
147
147
  extends
148
148
  Omit<
149
149
  CommunityToolkit.Mvvm.ComponentModel.ObservableObject,
150
- | "battleEndProgressBarColor"
151
- | "battleEndProgressBarColorTolerance"
152
150
  | "beforeDetectDelay"
153
151
  | "blockCheckBeforeBattleSeconds"
154
152
  | "checkAfterSwitchAvatar"
@@ -166,16 +164,6 @@ export interface AutoLeyLineOutcropFightConfig_FightFinishDetectConfig
166
164
  System.ComponentModel.INotifyPropertyChangedInput,
167
165
  System.ComponentModel.INotifyPropertyChangingInput {
168
166
  readonly [autoLeyLineOutcropFightConfig_FightFinishDetectConfigBrand]: true;
169
- /**
170
- * 战斗结束进度条颜色容差,`6` 表示三通道相同容差,`6,6,6` 可分别设置
171
- * @since 0.58.0
172
- */
173
- battleEndProgressBarColorTolerance: string;
174
- /**
175
- * 判断战斗结束的进度条颜色,`RGB` 格式
176
- * @since 0.58.0
177
- */
178
- battleEndProgressBarColor: string;
179
167
  /**
180
168
  * 按下切换队伍后检测屏幕色块的延迟,单位秒
181
169
  * @since 0.58.0
@@ -30,7 +30,6 @@ export interface AutoLeyLineOutcropParam extends Omit<
30
30
  | "fightConfig"
31
31
  | "friendshipTeam"
32
32
  | "isGoToSynthesizer"
33
- | "isNotification"
34
33
  | "isResinExhaustionMode"
35
34
  | "leyLineOutcropType"
36
35
  | "openModeCountMin"
@@ -40,7 +39,6 @@ export interface AutoLeyLineOutcropParam extends Omit<
40
39
  | "setDefault"
41
40
  | "team"
42
41
  | "timeout"
43
- | "useAdventurerHandbook"
44
42
  | "useFragileResin"
45
43
  | "useTransientResin"
46
44
  > {
@@ -70,11 +68,6 @@ export interface AutoLeyLineOutcropParam extends Omit<
70
68
  * @since 0.58.0
71
69
  */
72
70
  isResinExhaustionMode: boolean;
73
- /**
74
- * 是否使用冒险之证寻找地脉花
75
- * @since 0.58.0
76
- */
77
- useAdventurerHandbook: boolean;
78
71
  /**
79
72
  * 好感队名称
80
73
  * @since 0.58.0
@@ -110,11 +103,6 @@ export interface AutoLeyLineOutcropParam extends Omit<
110
103
  * @since 0.58.0
111
104
  */
112
105
  useTransientResin: boolean;
113
- /**
114
- * 是否通过 BetterGI 通知系统发送详细通知
115
- * @since 0.58.0
116
- */
117
- isNotification: boolean;
118
106
  /**
119
107
  * 是否在领取奖励后扫描掉落物光柱
120
108
  * @since 0.59.0