@myclaw163/clawclaw-cli 0.7.9 → 0.7.11

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 (39) hide show
  1. package/QUICKSTART_OTHER.md +2 -2
  2. package/docs/configuration.md +1 -1
  3. package/package.json +1 -1
  4. package/scripts/check-skill-command-surface.mjs +2 -0
  5. package/skills/clawclaw/SKILL.md +64 -43
  6. package/skills/clawclaw/references/CHATTERBOX.md +1 -1
  7. package/skills/clawclaw/references/CLAUDE-CODE-MONITOR.md +2 -2
  8. package/skills/clawclaw/references/COMMANDS.md +31 -19
  9. package/skills/clawclaw/references/GAME-MECHANICS.md +3 -3
  10. package/skills/clawclaw/references/STRATEGIES.md +1 -1
  11. package/skills/clawclaw/references/STREAM.md +3 -3
  12. package/src/cli.ts +7 -1
  13. package/src/commands/communication.test.ts +14 -3
  14. package/src/commands/communication.ts +12 -4
  15. package/src/commands/game/index.test.ts +198 -1
  16. package/src/commands/game/index.ts +229 -4
  17. package/src/commands/load.test.ts +68 -1
  18. package/src/commands/load.ts +26 -3
  19. package/src/pipeline/event-format.test.ts +0 -21
  20. package/src/pipeline/event-format.ts +0 -33
  21. package/src/pipeline/event-hints.test.ts +2 -5
  22. package/src/pipeline/event-hints.ts +0 -17
  23. package/src/pipeline/game-sync-event-normalization.test.ts +1 -12
  24. package/src/pipeline/game-sync-event-normalization.ts +0 -13
  25. package/src/runtime/clawclaw/plugins/strategy/strategy-action.ts +11 -4
  26. package/src/runtime/clawclaw-event-catalog.ts +0 -2
  27. package/src/sdk/action.ts +9 -8
  28. package/src/sdk/strategy-plugin/index.test.ts +3 -3
  29. package/src/sdk/strategy-plugin/index.ts +25 -24
  30. package/src/strategies/custom-module.test.ts +1 -1
  31. package/src/strategies/game-utils.test.ts +8 -8
  32. package/src/strategies/game-utils.ts +39 -28
  33. package/src/strategies/goals/crab-octopus-reflexes.ts +11 -7
  34. package/src/strategies/goals/hide-top.ts +2 -1
  35. package/src/strategies/goals/kill-target-goal.ts +2 -1
  36. package/src/strategies/goals/kill-target-top.ts +3 -3
  37. package/src/strategies/goals/lone-kill-core.ts +3 -1
  38. package/src/strategies/goals/task-kill-report-top.ts +2 -1
  39. package/src/strategies/goals/warrior-shrimp-top.ts +2 -1
@@ -34,8 +34,9 @@ export class KillVisibleTargetGoal extends Goal {
34
34
 
35
35
  if (d <= killCommitRange(state.you.role)) {
36
36
  if (canUseKill(state)) {
37
+ if (target.seat == null || target.seat <= 0) return [];
37
38
  ctx.notifications.push(`发现追杀目标${target.name},出刀!`);
38
- return [strategyDecision(Action.kill(target.name), playerStrategyIntent(target, '追杀', 'acting'))];
39
+ return [strategyDecision(Action.kill(target.seat), playerStrategyIntent(target, '追杀', 'acting'))];
39
40
  }
40
41
  if (d > LONE_FOLLOW_DISTANCE) {
41
42
  return [strategyDecision(Action.move({ x: target.x, y: target.y }), playerStrategyIntent(target, '追杀', 'moving'))];
@@ -15,6 +15,7 @@ import {
15
15
  pursueVisibleTarget,
16
16
  setStrategyIntent,
17
17
  strategyPlayerLabel,
18
+ targetSeat,
18
19
  } from '../game-utils.js';
19
20
  import type { BehaviorDecision, StrategyContext } from '../types.js';
20
21
  import { Goal } from './goal.js';
@@ -92,9 +93,8 @@ export class KillTargetTop extends Goal {
92
93
 
93
94
  private isValidTarget(t: string, state: GameState, ctx: StrategyContext): boolean {
94
95
  if (!isTargetAlive(state, t, ctx)) return false;
95
- const nameFromSeat = /^\d+$/.test(t.trim()) ? ctx.playerNamesBySeat[t.trim()] : null;
96
- const resolvedName = nameFromSeat ?? t.trim();
97
- return !ctx.teammates.has(resolvedName);
96
+ const seat = targetSeat(t, ctx);
97
+ return !(seat != null && ctx.teammates.has(String(seat)));
98
98
  }
99
99
 
100
100
  private allTargetsDeadInState(state: GameState, ctx: StrategyContext): boolean {
@@ -76,7 +76,9 @@ export class LoneKillCore {
76
76
  const d = target.distance ?? dist(state.you.x, state.you.y, target.x, target.y);
77
77
  if (d <= killCommitRange(state.you.role) && canUseKill(state)) {
78
78
  ctx.notifications.push(`发现落单目标${target.name},出刀!`);
79
- return strategyDecision(Action.kill(target.name), playerStrategyIntent(target, '追杀', 'acting'));
79
+ if (target.seat != null && target.seat > 0) {
80
+ return strategyDecision(Action.kill(target.seat), playerStrategyIntent(target, '追杀', 'acting'));
81
+ }
80
82
  }
81
83
  if (d > killCommitRange(state.you.role)) ctx.notifications.push(`发现落单目标${target.name},正在靠近!`);
82
84
  return strategyDecision(Action.move({ x: target.x, y: target.y }), playerStrategyIntent(target, '追杀', 'moving'));
@@ -64,8 +64,9 @@ export class TaskKillReportTop extends Goal {
64
64
 
65
65
  if (nearest.dist <= killCommitRange(state.you.role) && killReady) {
66
66
  ctx.notifications.push(`嫌疑目标${nearest.player.name}在攻击范围内,出刀!`);
67
+ if (nearest.player.seat == null || nearest.player.seat <= 0) return this.emitDecisions(state, ctx, [], URGENT_GOAL_PRIORITY);
67
68
  return this.emitDecisions(state, ctx, [strategyDecision(
68
- Action.kill(nearest.player.name),
69
+ Action.kill(nearest.player.seat),
69
70
  playerStrategyIntent(nearest.player, '追杀', 'acting'),
70
71
  )], URGENT_GOAL_PRIORITY);
71
72
  }
@@ -87,7 +87,8 @@ export class WarriorShrimpTop extends Goal {
87
87
  ?? (CORPSE_SCENE_KILL_ENABLED ? this.nearestKillable(state, ctx, visible, false) : null);
88
88
  if (victim) {
89
89
  this.clearSub();
90
- return [strategyDecision(Action.kill(victim.name), playerStrategyIntent(victim, '追杀', 'acting'))];
90
+ if (victim.seat == null || victim.seat <= 0) return [];
91
+ return [strategyDecision(Action.kill(victim.seat), playerStrategyIntent(victim, '追杀', 'acting'))];
91
92
  }
92
93
  }
93
94