@myclaw163/clawclaw-cli 0.6.90 → 0.6.92

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.
@@ -338,6 +338,7 @@ export async function runStrategyLoop(strategyId: string, args?: string[]): Prom
338
338
  lastProgressNotifyAt: 0,
339
339
  teammates,
340
340
  alarmDone: false,
341
+ alarmOnCooldown: false,
341
342
  rooms: [],
342
343
  playerNamesBySeat,
343
344
  forcePatrolAdvance: false,
@@ -417,6 +418,10 @@ export async function runStrategyLoop(strategyId: string, args?: string[]): Prom
417
418
  if (actionType === 'task' || actionType === 'kill' || actionType === 'report' || actionType === 'trigger_alarm') {
418
419
  activeMoveTarget = null;
419
420
  }
421
+ if (actionType === 'trigger_alarm') {
422
+ // on_cooldown = 撞上 20s 阵营共享 CD,破坏仍装填、CD 好后可补打——透给蟹策略回滚乐观去重、退避重试。
423
+ ctx.alarmOnCooldown = errorMessage.includes('on_cooldown');
424
+ }
420
425
  if (actionType === 'kill' && errorMessage.includes('cannot_kill_teammate')) {
421
426
  const target = action.toJSON().target;
422
427
  if (typeof target === 'string' && target.length > 0) teammates.add(target);
@@ -464,6 +469,7 @@ export async function runStrategyLoop(strategyId: string, args?: string[]): Prom
464
469
  }
465
470
 
466
471
  if (!failed && actionType === 'trigger_alarm') {
472
+ ctx.alarmOnCooldown = false;
467
473
  activeMoveTarget = null;
468
474
  }
469
475
 
@@ -76,6 +76,11 @@ export interface StrategyContext {
76
76
  lastProgressNotifyAt: number;
77
77
  teammates: Set<string>;
78
78
  alarmDone: boolean;
79
+ /**
80
+ * loop→蟹策略回传:上一发 trigger_alarm 是否撞了 20s 阵营共享 CD 被服务端拒(on_cooldown)。
81
+ * 蟹策略据此撤销乐观去重标记并退避补打;仅 crab-sabotage 用,其余策略不涉及,故可选。
82
+ */
83
+ alarmOnCooldown?: boolean;
79
84
  rooms: RoomTarget[];
80
85
  playerNamesBySeat: Record<string, string>;
81
86
  /** Set by strategy-loop when a move target is unreachable too many times. Patrol strategies should advance past the current room. */