@myclaw163/clawclaw-cli 0.8.5 → 0.8.7

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.
Files changed (119) hide show
  1. package/README.md +1 -1
  2. package/docs/configuration.md +2 -1
  3. package/docs/custom-modules/behavior.md +7 -18
  4. package/docs/custom-modules/trigger.md +3 -4
  5. package/docs/runtime/short-commands-and-capabilities.md +1 -1
  6. package/package.json +9 -3
  7. package/scripts/find-hide-spots.py +2 -2
  8. package/skills/clawclaw/SKILL.md +17 -13
  9. package/skills/clawclaw/references/BEHAVIORS.md +13 -9
  10. package/skills/clawclaw/references/COMMANDS.md +17 -29
  11. package/skills/clawclaw/references/TACTICS.md +1 -1
  12. package/src/commands/load.ts +245 -14
  13. package/src/commands/trigger.ts +22 -13
  14. package/src/lib/capability-load-diagnostics.ts +182 -0
  15. package/src/lib/gameplay-config.ts +10 -0
  16. package/src/lib/hub-reminder.ts +3 -5
  17. package/src/lib/trigger-config.ts +2 -10
  18. package/src/runtime/clawclaw/behavior-read-api.ts +1 -1
  19. package/src/{strategies/pathfind → runtime/clawclaw/navigation}/astar-path.ts +1 -1
  20. package/src/{strategies/pathfind → runtime/clawclaw/navigation}/escape-planner.ts +1 -1
  21. package/src/{strategies → runtime/clawclaw/navigation}/hide-spots.ts +2 -2
  22. package/src/{strategies → runtime/clawclaw/navigation}/off-route-points.ts +6 -3
  23. package/src/{strategies/pathfind → runtime/clawclaw/navigation}/walkable-grid.ts +1 -1
  24. package/src/runtime/clawclaw/owner.ts +4 -6
  25. package/src/runtime/clawclaw/plugins/game-query/game-query-plugin.ts +1 -1
  26. package/src/runtime/framework/modules/runtime-module-loader.ts +0 -54
  27. package/src/sdk/behavior-toolkit/escape.ts +2 -2
  28. package/scripts/build-official-hub-behaviors.mjs +0 -136
  29. package/scripts/build-official-hub-behaviors.test.mjs +0 -178
  30. package/scripts/compare-perception-replays.test.ts +0 -188
  31. package/scripts/enable_ccl_permissions.test.mjs +0 -167
  32. package/scripts/enable_monitor.test.mjs +0 -201
  33. package/scripts/sync-bundled-skill.test.mjs +0 -87
  34. package/scripts/watch-perception-events.test.ts +0 -43
  35. package/src/behaviors/official-finite/do-task.ts +0 -211
  36. package/src/behaviors/official-finite/evade.ts +0 -78
  37. package/src/behaviors/official-finite/find-player.ts +0 -50
  38. package/src/behaviors/official-finite/follow-player.ts +0 -70
  39. package/src/behaviors/official-finite/go-to.ts +0 -69
  40. package/src/behaviors/official-finite/hide-temporarily.ts +0 -77
  41. package/src/behaviors/official-finite/hold-position.ts +0 -48
  42. package/src/behaviors/official-finite/hunt-player.ts +0 -47
  43. package/src/behaviors/official-finite/index.ts +0 -44
  44. package/src/behaviors/official-finite/inspect-corpse.ts +0 -64
  45. package/src/behaviors/official-finite/patrol-area.ts +0 -80
  46. package/src/behaviors/official-finite/report-corpse.ts +0 -73
  47. package/src/behaviors/official-finite/seek-kill-opportunity.ts +0 -152
  48. package/src/behaviors/official-finite/shared.ts +0 -27
  49. package/src/hub-official-behaviors/kill-lone.ts +0 -138
  50. package/src/hub-official-behaviors/patrol.ts +0 -30
  51. package/src/hub-official-behaviors/shared.ts +0 -125
  52. package/src/hub-official-behaviors/task-only.ts +0 -158
  53. package/src/runtime/clawclaw/plugins/behavior/official-goal-behavior.ts +0 -757
  54. package/src/strategies/avoid-lone.ts +0 -32
  55. package/src/strategies/avoid-players.ts +0 -43
  56. package/src/strategies/corpse-patrol.ts +0 -50
  57. package/src/strategies/crab-sabotage.ts +0 -48
  58. package/src/strategies/find-player.ts +0 -49
  59. package/src/strategies/game-utils.ts +0 -927
  60. package/src/strategies/goals/anchor-linger.ts +0 -77
  61. package/src/strategies/goals/avoid-lone-top.ts +0 -189
  62. package/src/strategies/goals/avoid-players-top.ts +0 -122
  63. package/src/strategies/goals/conversation-goal.ts +0 -51
  64. package/src/strategies/goals/corpse-patrol-top.ts +0 -120
  65. package/src/strategies/goals/crab-octopus-reflexes.ts +0 -109
  66. package/src/strategies/goals/crab-sabotage-top.ts +0 -139
  67. package/src/strategies/goals/emergency-hunt-goal.ts +0 -40
  68. package/src/strategies/goals/find-player-top.ts +0 -136
  69. package/src/strategies/goals/flee-players-goal.ts +0 -55
  70. package/src/strategies/goals/follow-companion-goal.ts +0 -130
  71. package/src/strategies/goals/goal-manager.ts +0 -41
  72. package/src/strategies/goals/goal-root-strategy.ts +0 -49
  73. package/src/strategies/goals/goal.ts +0 -28
  74. package/src/strategies/goals/hide-top.ts +0 -240
  75. package/src/strategies/goals/keep-away-goal.ts +0 -243
  76. package/src/strategies/goals/kill-frenzy-top.ts +0 -90
  77. package/src/strategies/goals/kill-lone-top.ts +0 -166
  78. package/src/strategies/goals/kill-target-goal.ts +0 -69
  79. package/src/strategies/goals/kill-target-top.ts +0 -121
  80. package/src/strategies/goals/leaf-goal.ts +0 -27
  81. package/src/strategies/goals/linger-corpse-goal.ts +0 -43
  82. package/src/strategies/goals/lone-kill-core.ts +0 -86
  83. package/src/strategies/goals/lone-kill-goal.ts +0 -24
  84. package/src/strategies/goals/lone-kill-task-top.ts +0 -133
  85. package/src/strategies/goals/move-room-goal.ts +0 -102
  86. package/src/strategies/goals/normal-shrimp-top.ts +0 -248
  87. package/src/strategies/goals/paradise-fish-top.ts +0 -234
  88. package/src/strategies/goals/patrol-top.ts +0 -68
  89. package/src/strategies/goals/report-patrol-top.ts +0 -97
  90. package/src/strategies/goals/safe-task-goal.ts +0 -130
  91. package/src/strategies/goals/social-task-top.ts +0 -192
  92. package/src/strategies/goals/task-kill-report-top.ts +0 -187
  93. package/src/strategies/goals/task-only-top.ts +0 -64
  94. package/src/strategies/goals/task-or-patrol-goal.ts +0 -59
  95. package/src/strategies/goals/task-report-top.ts +0 -57
  96. package/src/strategies/goals/wander-task-goal.ts +0 -33
  97. package/src/strategies/goals/warrior-shrimp-top.ts +0 -293
  98. package/src/strategies/greeting.ts +0 -60
  99. package/src/strategies/hide.ts +0 -51
  100. package/src/strategies/kill-frenzy.ts +0 -32
  101. package/src/strategies/kill-lone.ts +0 -52
  102. package/src/strategies/kill-target.ts +0 -48
  103. package/src/strategies/lone-kill-task.ts +0 -48
  104. package/src/strategies/meeting-gate.ts +0 -28
  105. package/src/strategies/move-room.ts +0 -46
  106. package/src/strategies/paradise-fish.ts +0 -70
  107. package/src/strategies/patrol.ts +0 -32
  108. package/src/strategies/player-targets.ts +0 -18
  109. package/src/strategies/report-patrol.ts +0 -32
  110. package/src/strategies/shrimp-memory.ts +0 -87
  111. package/src/strategies/social-task.ts +0 -67
  112. package/src/strategies/speech-module.ts +0 -123
  113. package/src/strategies/task-kill-report.ts +0 -49
  114. package/src/strategies/task-only.ts +0 -34
  115. package/src/strategies/task-report.ts +0 -50
  116. package/src/strategies/types.ts +0 -116
  117. package/src/strategies/warrior-memory.ts +0 -54
  118. /package/src/{strategies/pathfind → runtime/clawclaw/navigation}/clawclaw-walkable.bin +0 -0
  119. /package/src/{strategies/pathfind → runtime/clawclaw/navigation}/distance-field.ts +0 -0
@@ -1,32 +0,0 @@
1
- import {
2
- type BehaviorDecision,
3
- type BehaviorInput,
4
- type BehaviorReadApi,
5
- ClawclawBehavior,
6
- } from '../sdk/behavior-plugin/index.js';
7
- import { OfficialGoalBehavior } from '../runtime/clawclaw/plugins/behavior/official-goal-behavior.js';
8
- import { GoalRootStrategy } from './goals/goal-root-strategy.js';
9
- import { AvoidLoneTop } from './goals/avoid-lone-top.js';
10
-
11
- export default class AvoidLoneStrategy extends ClawclawBehavior {
12
- static readonly manifest = {
13
- apiVersion: 3,
14
- id: 'avoid-lone',
15
- name: '结伴',
16
- description: '避免落单。视野里只有一个人时寻路躲避主动避开(推演逃点、持续远离);视野里有两人以上时跟住次近的玩家、把可见人数维持在 ≥2(最近的人本就贴着不会丢,次近的人才是跌回一对一的临界);持续无人或没有当前目标时巡逻。',
17
- execution: 'serial',
18
- produces: ['strategy_alert', 'robot_speak_rule'],
19
- inputs: [],
20
- } as const;
21
-
22
- private readonly goal = new OfficialGoalBehavior({
23
- id: 'avoid-lone',
24
- create: () => new GoalRootStrategy('avoid-lone', () => new AvoidLoneTop(), {
25
- resetOnMeetingResume: false,
26
- }),
27
- });
28
-
29
- override decide(input: BehaviorInput, api: BehaviorReadApi): Promise<BehaviorDecision> {
30
- return this.goal.decide(input, api);
31
- }
32
- }
@@ -1,43 +0,0 @@
1
- import {
2
- type BehaviorDecision,
3
- type BehaviorInput,
4
- type BehaviorReadApi,
5
- ClawclawBehavior,
6
- } from '../sdk/behavior-plugin/index.js';
7
- import {
8
- OfficialGoalBehavior,
9
- } from '../runtime/clawclaw/plugins/behavior/official-goal-behavior.js';
10
- import { GoalRootStrategy } from './goals/goal-root-strategy.js';
11
- import { AvoidPlayersTop } from './goals/avoid-players-top.js';
12
- import { strategySeatList } from './player-targets.js';
13
-
14
- export default class AvoidPlayersStrategy extends ClawclawBehavior {
15
- static readonly manifest = {
16
- apiVersion: 3,
17
- id: 'avoid-players',
18
- name: '避人',
19
- description: '回避玩家:按房间顺序巡逻,视野里出现 targets 指定的玩家就寻路躲避(推演逃点、持续远离),目标消失后恢复巡逻。',
20
- execution: 'serial',
21
- produces: ['strategy_alert', 'robot_speak_rule'],
22
- inputs: [{
23
- id: 'targets',
24
- type: 'player_seats',
25
- description: '需要回避的玩家座位号列表。',
26
- default: [],
27
- }],
28
- } as const;
29
-
30
- private readonly goal = new OfficialGoalBehavior({
31
- id: 'avoid-players',
32
- create: (values) => {
33
- const targets = strategySeatList(values, 'targets');
34
- return new GoalRootStrategy('avoid-players', () => new AvoidPlayersTop(targets), {
35
- resetOnMeetingResume: false,
36
- });
37
- },
38
- });
39
-
40
- override decide(input: BehaviorInput, api: BehaviorReadApi): Promise<BehaviorDecision> {
41
- return this.goal.decide(input, api);
42
- }
43
- }
@@ -1,50 +0,0 @@
1
- import {
2
- type BehaviorDecision,
3
- type BehaviorInput,
4
- type BehaviorReadApi,
5
- ClawclawBehavior,
6
- } from '../sdk/behavior-plugin/index.js';
7
- import {
8
- OfficialGoalBehavior,
9
- clawclawStrategyStringList,
10
- } from '../runtime/clawclaw/plugins/behavior/official-goal-behavior.js';
11
- import { GoalRootStrategy } from './goals/goal-root-strategy.js';
12
- import { CorpsePatrolTop } from './goals/corpse-patrol-top.js';
13
- import { parseGreetingArgs } from './greeting.js';
14
-
15
- class CorpsePatrolStrategy extends GoalRootStrategy {
16
- constructor(greetingPhrases: string[]) {
17
- super('corpse-patrol', () => new CorpsePatrolTop(greetingPhrases), { resetOnMeetingResume: false });
18
- }
19
- }
20
-
21
- export default class CorpsePatrolGoalStrategy extends ClawclawBehavior {
22
- static readonly manifest = {
23
- apiVersion: 3,
24
- id: 'corpse-patrol',
25
- name: '守尸',
26
- description: '发现尸体就在附近40至100距离内随机游荡,但不报告——故意在尸体旁出没制造嫌疑感。没有尸体时巡逻各房间。greetings 控制可配置最多3条打招呼话术;视野内出现人时随机发送一条,之后120秒内不再发言。不做任务,不杀人;但残局(已知存活≤6)出现紧急维修任务时例外,会最高优先级抢着去做。',
27
- execution: 'serial',
28
- produces: ['strategy_alert', 'robot_speak_rule'],
29
- inputs: [{
30
- id: 'greetings',
31
- type: 'string_list',
32
- description: '可选的打招呼话术列表。',
33
- default: [],
34
- maxItems: 3,
35
- }],
36
- } as const;
37
-
38
- private readonly goal = new OfficialGoalBehavior({
39
- id: 'corpse-patrol',
40
- requiresTasks: true,
41
- sidecarSpeech: true,
42
- create: (values) => new CorpsePatrolStrategy(
43
- parseGreetingArgs(clawclawStrategyStringList(values, 'greetings'), 'corpse-patrol'),
44
- ),
45
- });
46
-
47
- override decide(input: BehaviorInput, api: BehaviorReadApi): Promise<BehaviorDecision> {
48
- return this.goal.decide(input, api);
49
- }
50
- }
@@ -1,48 +0,0 @@
1
- import {
2
- type BehaviorDecision,
3
- type BehaviorInput,
4
- type BehaviorReadApi,
5
- ClawclawBehavior,
6
- } from '../sdk/behavior-plugin/index.js';
7
- import { OfficialGoalBehavior } from '../runtime/clawclaw/plugins/behavior/official-goal-behavior.js';
8
- import { GoalRootStrategy } from './goals/goal-root-strategy.js';
9
- import { CrabSabotageTop } from './goals/crab-sabotage-top.js';
10
- import { ConversationGoal } from './goals/conversation-goal.js';
11
- import { SpeechModule, getSpeechConfigForRole } from './speech-module.js';
12
-
13
- function createCrabSabotageGoal(): GoalRootStrategy {
14
- const role = 'crab_generic';
15
- let conversation: ConversationGoal | null = null;
16
- return new GoalRootStrategy('crab-sabotage', () => {
17
- conversation = new ConversationGoal(
18
- () => new CrabSabotageTop(),
19
- new SpeechModule(getSpeechConfigForRole(role)),
20
- );
21
- return conversation;
22
- }, {
23
- resetOnMeetingResume: false,
24
- onUpdateRole: nextRole => conversation?.updateConfig(nextRole),
25
- });
26
- }
27
-
28
- export default class CrabSabotageStrategy extends ClawclawBehavior {
29
- static readonly manifest = {
30
- apiVersion: 3,
31
- id: 'crab-sabotage',
32
- name: '破坏蟹',
33
- description: '优先完成蟹的真实破坏任务(破坏点紧挨已知尸体时会跳过);做完立刻触发紧急警报;警报期照样会被举报、不乱杀,只清真正落单的目标。有紧急事件时跳过破坏流程。视野里只有一个非队友且冷却可用就靠近,进入50距离就立刻出刀,即使正在做破坏任务;刀在冷却时不追不等、改做低优先级任务伪装,冷却好且目标仍落单可见再出刀;正在做任务时不会撇下任务去追猎(贴脸且刀好仍会立刻出刀)。发现尸体且附近有非队友、但当前不能原地出刀时,会靠近并报告尸体。视野里出现两人以上时,暂停攻击10秒并做任务伪装,先做真实任务再做虾的伪装任务;选任务时会跳过紧挨已知尸体(含看见过、已离开视野的)的任务。没有可做任务时按房间巡逻,绝不停在原地。(普通蟹默认)',
34
- execution: 'serial',
35
- produces: ['strategy_alert', 'robot_speak_rule'],
36
- inputs: [],
37
- } as const;
38
-
39
- private readonly goal = new OfficialGoalBehavior({
40
- id: 'crab-sabotage',
41
- requiresTasks: true,
42
- create: () => createCrabSabotageGoal(),
43
- });
44
-
45
- override decide(input: BehaviorInput, api: BehaviorReadApi): Promise<BehaviorDecision> {
46
- return this.goal.decide(input, api);
47
- }
48
- }
@@ -1,49 +0,0 @@
1
- import {
2
- type BehaviorDecision,
3
- type BehaviorInput,
4
- type BehaviorReadApi,
5
- ClawclawBehavior,
6
- } from '../sdk/behavior-plugin/index.js';
7
- import {
8
- OfficialGoalBehavior,
9
- } from '../runtime/clawclaw/plugins/behavior/official-goal-behavior.js';
10
- import { GoalRootStrategy } from './goals/goal-root-strategy.js';
11
- import { FindPlayerTop } from './goals/find-player-top.js';
12
- import { strategySeatList } from './player-targets.js';
13
-
14
- export default class FindPlayerStrategy extends ClawclawBehavior {
15
- static readonly manifest = {
16
- apiVersion: 3,
17
- id: 'find-player',
18
- name: '盯人',
19
- description: '全力寻找并贴身跟踪 targets 控制指定的一个玩家。看到就贴上去近距离尾随(约40距离);跟丢就先奔向最后出现的位置,再按房间顺序不停巡逻直到目标重新出现。只跟踪、不出刀、不做任务、不报告;目标死亡即停。',
20
- execution: 'serial',
21
- produces: ['strategy_alert', 'robot_speak_rule'],
22
- inputs: [{
23
- id: 'targets',
24
- type: 'player_seats',
25
- description: '要寻找并跟踪的单个玩家座位号。',
26
- required: true,
27
- maxItems: 1,
28
- }],
29
- } as const;
30
-
31
- private readonly goal = new OfficialGoalBehavior({
32
- id: 'find-player',
33
- validateParameters: (values) => (
34
- strategySeatList(values, 'targets').length === 1
35
- ? undefined
36
- : '盯人策略必须配置且只能配置一个目标玩家。'
37
- ),
38
- create: (values) => {
39
- const targets = strategySeatList(values, 'targets');
40
- return new GoalRootStrategy('find-player', () => new FindPlayerTop(targets[0]), {
41
- resetOnMeetingResume: false,
42
- });
43
- },
44
- });
45
-
46
- override decide(input: BehaviorInput, api: BehaviorReadApi): Promise<BehaviorDecision> {
47
- return this.goal.decide(input, api);
48
- }
49
- }