@myclaw163/clawclaw-cli 0.7.14 → 0.7.15

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 (42) hide show
  1. package/docs/runtime/strategy-runtime.md +1 -1
  2. package/docs//350/207/252/345/256/232/344/271/211/347/255/226/347/225/245.md +4 -4
  3. package/package.json +1 -1
  4. package/skills/clawclaw/SKILL.md +2 -2
  5. package/skills/clawclaw/references/COMMANDS.md +1 -1
  6. package/skills/clawclaw/references/STRATEGIES.md +4 -4
  7. package/src/lib/strategy-export.test.ts +13 -0
  8. package/src/runtime/clawclaw/plugins/strategy/strategy-module-loader.ts +1 -1
  9. package/src/runtime/clawclaw/plugins/strategy/strategy-plugin.test.ts +22 -0
  10. package/src/runtime/clawclaw/plugins/strategy/strategy-plugin.ts +14 -5
  11. package/src/sdk/index.ts +2 -2
  12. package/src/sdk/strategy-plugin/index.test.ts +10 -4
  13. package/src/sdk/strategy-plugin/index.ts +13 -2
  14. package/src/strategies/avoid-players.ts +4 -5
  15. package/src/strategies/find-player.ts +5 -6
  16. package/src/strategies/game-utils.test.ts +22 -0
  17. package/src/strategies/game-utils.ts +12 -39
  18. package/src/strategies/goals/avoid-players-top.test.ts +2 -2
  19. package/src/strategies/goals/avoid-players-top.ts +1 -1
  20. package/src/strategies/goals/crab-octopus-reflexes.ts +10 -10
  21. package/src/strategies/goals/find-player-top.ts +7 -8
  22. package/src/strategies/goals/kill-lone-top.test.ts +27 -2
  23. package/src/strategies/goals/kill-lone-top.ts +16 -12
  24. package/src/strategies/goals/kill-target-goal.ts +3 -3
  25. package/src/strategies/goals/kill-target-top.test.ts +66 -0
  26. package/src/strategies/goals/kill-target-top.ts +4 -6
  27. package/src/strategies/goals/normal-shrimp-top.test.ts +2 -2
  28. package/src/strategies/goals/normal-shrimp-top.ts +3 -3
  29. package/src/strategies/goals/paradise-fish-top.test.ts +3 -3
  30. package/src/strategies/goals/paradise-fish-top.ts +2 -2
  31. package/src/strategies/goals/social-task-top.ts +3 -3
  32. package/src/strategies/goals/task-kill-report-top.ts +2 -2
  33. package/src/strategies/goals/warrior-shrimp-top.test.ts +3 -3
  34. package/src/strategies/goals/warrior-shrimp-top.ts +11 -7
  35. package/src/strategies/kill-lone.ts +7 -12
  36. package/src/strategies/kill-target.ts +5 -6
  37. package/src/strategies/paradise-fish.ts +8 -8
  38. package/src/strategies/player-targets.ts +0 -8
  39. package/src/strategies/shrimp-memory.ts +13 -13
  40. package/src/strategies/social-task.ts +4 -4
  41. package/src/strategies/task-kill-report.ts +5 -5
  42. package/src/strategies/warrior-memory.ts +7 -12
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  ClawclawGoalStrategy,
3
+ clawclawStrategySeatList,
3
4
  clawclawStrategyStringList,
4
5
  } from '../sdk/strategy-plugin/index.js';
5
6
  import { GoalRootStrategy } from './goals/goal-root-strategy.js';
6
7
  import { NormalShrimpTop } from './goals/normal-shrimp-top.js';
7
8
  import { parseGreetingArgs } from './greeting.js';
8
- import { parseTargetArgs } from './player-targets.js';
9
9
 
10
10
  class ShrimpMemoryStrategy extends GoalRootStrategy {
11
11
  constructor(
12
12
  greetingPhrases: string[],
13
- hostileTargets: string[],
14
- trustedTargets: string[],
15
- paradiseFishTargets: string[],
13
+ hostileTargets: number[],
14
+ trustedTargets: number[],
15
+ paradiseFishTargets: number[],
16
16
  ) {
17
17
  super('shrimp-memory', () => new NormalShrimpTop(
18
18
  greetingPhrases,
@@ -34,20 +34,20 @@ export default class ShrimpMemoryGoalStrategy extends ClawclawGoalStrategy {
34
34
  controls: [
35
35
  {
36
36
  id: 'hostileTargets',
37
- type: 'player_refs',
38
- description: '需要硬回避的座位号或玩家名列表;与 trustedTargets 重叠时 trustedTargets 优先。',
37
+ type: 'player_seats',
38
+ description: '需要硬回避的玩家座位号列表;与 trustedTargets 重叠时 trustedTargets 优先。',
39
39
  default: [],
40
40
  },
41
41
  {
42
42
  id: 'trustedTargets',
43
- type: 'player_refs',
44
- description: '可信同伴的座位号或玩家名列表。',
43
+ type: 'player_seats',
44
+ description: '可信同伴的玩家座位号列表。',
45
45
  default: [],
46
46
  },
47
47
  {
48
48
  id: 'paradiseFishTargets',
49
- type: 'player_refs',
50
- description: '已确认天堂鱼的座位号或玩家名列表,仅用于尸体旁提示分类。',
49
+ type: 'player_seats',
50
+ description: '已确认天堂鱼的玩家座位号列表,仅用于尸体旁提示分类。',
51
51
  default: [],
52
52
  },
53
53
  {
@@ -67,9 +67,9 @@ export default class ShrimpMemoryGoalStrategy extends ClawclawGoalStrategy {
67
67
  sidecarSpeech: true,
68
68
  create: (values) => new ShrimpMemoryStrategy(
69
69
  parseGreetingArgs(clawclawStrategyStringList(values, 'greetings'), 'shrimp-memory'),
70
- parseTargetArgs(clawclawStrategyStringList(values, 'hostileTargets')),
71
- parseTargetArgs(clawclawStrategyStringList(values, 'trustedTargets')),
72
- parseTargetArgs(clawclawStrategyStringList(values, 'paradiseFishTargets')),
70
+ clawclawStrategySeatList(values, 'hostileTargets'),
71
+ clawclawStrategySeatList(values, 'trustedTargets'),
72
+ clawclawStrategySeatList(values, 'paradiseFishTargets'),
73
73
  ),
74
74
  });
75
75
  }
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ClawclawGoalStrategy,
3
+ clawclawStrategySeatList,
3
4
  clawclawStrategyStringList,
4
5
  } from '../sdk/strategy-plugin/index.js';
5
6
  import { GoalRootStrategy } from './goals/goal-root-strategy.js';
6
7
  import { SocialTaskTop, type SocialTarget } from './goals/social-task-top.js';
7
- import { parseTargetArgs } from './player-targets.js';
8
8
 
9
9
  function controlledSocialTargets(parameters: Readonly<Record<string, unknown>>): SocialTarget[] {
10
- const targets = parseTargetArgs(clawclawStrategyStringList(parameters, 'targets'));
10
+ const targets = clawclawStrategySeatList(parameters, 'targets');
11
11
  const greetings = clawclawStrategyStringList(parameters, 'greetings');
12
12
  return targets.map((target, index) => ({
13
13
  target,
@@ -24,8 +24,8 @@ export default class SocialTaskStrategy extends ClawclawGoalStrategy {
24
24
  controls: [
25
25
  {
26
26
  id: 'targets',
27
- type: 'player_refs',
28
- description: '要接近并互动的玩家列表。',
27
+ type: 'player_seats',
28
+ description: '要接近并互动的玩家座位号列表。',
29
29
  },
30
30
  {
31
31
  id: 'greetings',
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ClawclawGoalStrategy,
3
- clawclawStrategyStringList,
3
+ clawclawStrategySeatList,
4
4
  } from '../sdk/strategy-plugin/index.js';
5
5
  import { GoalRootStrategy } from './goals/goal-root-strategy.js';
6
6
  import { TaskKillReportTop } from './goals/task-kill-report-top.js';
@@ -13,8 +13,8 @@ export default class TaskKillReportStrategy extends ClawclawGoalStrategy {
13
13
  execution: 'parallel_analyze',
14
14
  controls: [{
15
15
  id: 'targets',
16
- type: 'player_refs',
17
- description: '嫌疑目标玩家列表。',
16
+ type: 'player_seats',
17
+ description: '嫌疑目标玩家座位号列表。',
18
18
  }],
19
19
  } as const;
20
20
 
@@ -23,12 +23,12 @@ export default class TaskKillReportStrategy extends ClawclawGoalStrategy {
23
23
  id: 'task-kill-report',
24
24
  requiresTasks: true,
25
25
  validateParameters: (values) => (
26
- clawclawStrategyStringList(values, 'targets').length > 0
26
+ clawclawStrategySeatList(values, 'targets').length > 0
27
27
  ? undefined
28
28
  : '任务追猎策略至少需要配置一个嫌疑目标玩家。'
29
29
  ),
30
30
  create: (values) => {
31
- const targets = clawclawStrategyStringList(values, 'targets');
31
+ const targets = clawclawStrategySeatList(values, 'targets');
32
32
  return new GoalRootStrategy('task-kill-report', () => new TaskKillReportTop(targets), {
33
33
  resetOnMeetingResume: false,
34
34
  });
@@ -1,10 +1,9 @@
1
1
  import {
2
2
  ClawclawGoalStrategy,
3
- clawclawStrategyStringList,
3
+ clawclawStrategySeatList,
4
4
  } from '../sdk/strategy-plugin/index.js';
5
5
  import { GoalRootStrategy } from './goals/goal-root-strategy.js';
6
6
  import { WarriorShrimpTop } from './goals/warrior-shrimp-top.js';
7
- import { parseTargetArgs } from './player-targets.js';
8
7
 
9
8
  export default class WarriorMemoryStrategy extends ClawclawGoalStrategy {
10
9
  static readonly manifest = {
@@ -15,14 +14,14 @@ export default class WarriorMemoryStrategy extends ClawclawGoalStrategy {
15
14
  controls: [
16
15
  {
17
16
  id: 'huntTargets',
18
- type: 'player_refs',
19
- description: '主动猎杀的座位号或玩家名列表。',
17
+ type: 'player_seats',
18
+ description: '主动猎杀的玩家座位号列表。',
20
19
  default: [],
21
20
  },
22
21
  {
23
22
  id: 'trustedTargets',
24
- type: 'player_refs',
25
- description: '可信、永不击杀的座位号或玩家名列表;与 huntTargets 重叠时保护优先。',
23
+ type: 'player_seats',
24
+ description: '可信、永不击杀的玩家座位号列表;与 huntTargets 重叠时保护优先。',
26
25
  default: [],
27
26
  },
28
27
  ],
@@ -34,12 +33,8 @@ export default class WarriorMemoryStrategy extends ClawclawGoalStrategy {
34
33
  requiresTasks: true,
35
34
  routeEvidenceTargets: ['tasks'],
36
35
  create: (values) => {
37
- const huntTargets = parseTargetArgs(
38
- clawclawStrategyStringList(values, 'huntTargets'),
39
- );
40
- const trustedTargets = parseTargetArgs(
41
- clawclawStrategyStringList(values, 'trustedTargets'),
42
- );
36
+ const huntTargets = clawclawStrategySeatList(values, 'huntTargets');
37
+ const trustedTargets = clawclawStrategySeatList(values, 'trustedTargets');
43
38
  return new GoalRootStrategy('warrior-memory', () => new WarriorShrimpTop(huntTargets, trustedTargets), {
44
39
  resetOnMeetingResume: false,
45
40
  });