@myclaw163/clawclaw-cli 0.8.29 → 0.8.31

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": "@myclaw163/clawclaw-cli",
3
- "version": "0.8.29",
3
+ "version": "0.8.31",
4
4
  "type": "module",
5
5
  "description": "ClawClaw social deduction game CLI",
6
6
  "bin": {
@@ -82,7 +82,7 @@ export function discoverLocalCapabilities(
82
82
  return [];
83
83
  }
84
84
  const name = readSkillName(path);
85
- return name ? [registerDiscoveredCapability(workspaceDir, profile, {
85
+ return name && name !== 'clawclaw' ? [registerDiscoveredCapability(workspaceDir, profile, {
86
86
  type: 'skill',
87
87
  path,
88
88
  runtimeId: name,
@@ -279,7 +279,8 @@ export function pendingCapabilitySelections(
279
279
  profile: Pick<AuthProfile, 'apiKey'>,
280
280
  ): readonly CapabilityWorkspaceEntry[] {
281
281
  return Object.values(readCapabilityWorkspaceRegistry(workspaceDir, profile).entries)
282
- .filter((entry) => entry.origin === 'local' && entry.selection === 'pending')
282
+ .filter((entry) => entry.origin === 'local' && entry.selection === 'pending'
283
+ && !(entry.type === 'skill' && entry.runtimeId === 'clawclaw'))
283
284
  .sort((left, right) => left.discoveredAt.localeCompare(right.discoveredAt));
284
285
  }
285
286
 
@@ -120,6 +120,7 @@ export class BehaviorActivationManager {
120
120
  private short?: MutableActivation;
121
121
  private reflex?: MutableActivation;
122
122
  private longEligibleAt?: number;
123
+ private boundaryActive = false;
123
124
  private idleGeneration = 0;
124
125
  private fallbackStartedGeneration = -1;
125
126
  private sequence = 0;
@@ -174,6 +175,7 @@ export class BehaviorActivationManager {
174
175
  * is retained as configuration but must later restart from a fresh runner.
175
176
  */
176
177
  enterBoundary(reason: string, now: number): readonly BehaviorActivationTransition[] {
178
+ this.boundaryActive = true;
177
179
  const transitions: BehaviorActivationTransition[] = [];
178
180
  if (this.reflex) {
179
181
  transitions.push(this.transition(this.reflex, 'cancelled', now, reason));
@@ -193,6 +195,7 @@ export class BehaviorActivationManager {
193
195
 
194
196
  /** Starts the one shared hand-back delay after a meeting/loading boundary. */
195
197
  leaveBoundary(now: number): readonly BehaviorActivationTransition[] {
198
+ this.boundaryActive = false;
196
199
  if (this.reflex || this.short) return [];
197
200
  if (this.long?.state === 'suspended' || (!this.long && this.fallback)) {
198
201
  this.longEligibleAt = now + this.idleMs;
@@ -202,6 +205,7 @@ export class BehaviorActivationManager {
202
205
 
203
206
  /** Ends every Activation in the current game scope while retaining policy bindings. */
204
207
  clearScope(reason: string, now: number): readonly BehaviorActivationTransition[] {
208
+ this.boundaryActive = true;
205
209
  const transitions: BehaviorActivationTransition[] = [];
206
210
  for (const layer of ['reflex', 'short', 'long'] as const) {
207
211
  const activation = this[layer];
@@ -226,9 +230,10 @@ export class BehaviorActivationManager {
226
230
  }
227
231
  this.long = next;
228
232
  this.longEligibleAt = undefined;
229
- if (this.short || this.reflex) {
233
+ if (this.boundaryActive || this.short || this.reflex) {
230
234
  next.state = 'suspended';
231
- transitions.push(this.transition(next, 'suspended', now, 'higher_layer_active'));
235
+ transitions.push(this.transition(next, 'suspended', now,
236
+ this.boundaryActive ? 'phase_boundary' : 'higher_layer_active'));
232
237
  } else {
233
238
  transitions.push(this.transition(next, 'started', now, 'explicit_long_started'));
234
239
  }
@@ -324,6 +329,9 @@ export class BehaviorActivationManager {
324
329
  }
325
330
  }
326
331
  if (this.reflex || this.short) return transitions;
332
+ // Direct Agent Actions may rearm the idle delay during a meeting. Keep the
333
+ // deadline checks above, but never hand long control back inside a boundary.
334
+ if (this.boundaryActive) return transitions;
327
335
 
328
336
  if (this.long?.state === 'suspended') {
329
337
  if (this.longEligibleAt !== undefined && now >= this.longEligibleAt) {
@@ -809,6 +809,18 @@ implements RuntimeEpochPlugin<Record<string, any>>, BehaviorReflexActivationDriv
809
809
  const runtimeState = input.epoch.state;
810
810
 
811
811
  await this.syncRoleFallback(frameForClock, now);
812
+ if (
813
+ !frameForClock
814
+ && isClawclawRuntimeState(runtimeState)
815
+ && runtimeState.stage !== 'game'
816
+ && runtimeState.stage !== 'meeting'
817
+ ) {
818
+ // Room and terminal updates have no authoritative Game State. A pending
819
+ // idle fallback must not start just because this update arrives late.
820
+ await this.applyTransitions(this.manager.enterBoundary('wandering_inactive', now));
821
+ this.boundaryActive = true;
822
+ return this.output(cursor);
823
+ }
812
824
 
813
825
  await this.applyTransitions(this.manager.advance(now));
814
826
  const currentForFrame = this.manager.current();