@myclaw163/clawclaw-cli 0.8.4 → 0.8.6
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/README.md +4 -3
- package/docs/configuration.md +44 -26
- package/docs/custom-modules/README.md +7 -10
- package/docs/custom-modules/behavior.md +10 -19
- package/docs/custom-modules/perception.md +1 -1
- package/docs/custom-modules/trigger.md +1 -1
- package/docs/runtime/README.md +4 -4
- package/docs/runtime/official-perception-modules.md +2 -2
- package/docs/runtime/owner-lifecycle-and-observability.md +1 -1
- package/package.json +15 -2
- package/scripts/enable_ccl_permissions.cjs +4 -2
- package/scripts/find-hide-spots.py +2 -2
- package/scripts/postinstall.mjs +1 -4
- package/scripts/sync-bundled-skill.mjs +12 -159
- package/skills/clawclaw/SKILL.md +25 -18
- package/skills/clawclaw/references/BEHAVIORS.md +15 -11
- package/skills/clawclaw/references/COMMANDS.md +45 -41
- package/skills/clawclaw/references/HUB.md +25 -38
- package/skills/clawclaw/references/TACTICS.md +1 -1
- package/src/commands/account.ts +58 -14
- package/src/commands/behavior.ts +116 -38
- package/src/commands/hub.ts +110 -153
- package/src/commands/load.ts +138 -33
- package/src/commands/perception.ts +55 -24
- package/src/commands/persona.ts +66 -20
- package/src/commands/skill.ts +12 -48
- package/src/commands/trigger.ts +68 -40
- package/src/lib/account-guidance.ts +54 -9
- package/src/lib/agent-workspace-client.ts +135 -0
- package/src/lib/agent-workspace-runtime.ts +154 -0
- package/src/lib/agent-workspace-skills.ts +177 -0
- package/src/lib/agent-workspace-sync.ts +852 -0
- package/src/lib/gameplay-config.ts +29 -15
- package/src/lib/hub-client.ts +252 -34
- package/src/lib/hub-reminder.ts +24 -11
- package/src/lib/init-command.ts +0 -6
- package/src/lib/load-context.ts +12 -6
- package/src/lib/persona.ts +141 -69
- package/src/lib/server-status.ts +78 -0
- package/src/lib/skill-host.ts +160 -0
- package/src/lib/user-data.ts +197 -4
- package/src/runtime/clawclaw/behavior-read-api.ts +1 -1
- package/src/{strategies/pathfind → runtime/clawclaw/navigation}/astar-path.ts +1 -1
- package/src/{strategies/pathfind → runtime/clawclaw/navigation}/escape-planner.ts +1 -1
- package/src/{strategies → runtime/clawclaw/navigation}/hide-spots.ts +2 -2
- package/src/{strategies → runtime/clawclaw/navigation}/off-route-points.ts +6 -3
- package/src/{strategies/pathfind → runtime/clawclaw/navigation}/walkable-grid.ts +1 -1
- package/src/runtime/clawclaw/owner.ts +63 -19
- package/src/runtime/clawclaw/plugins/behavior/activation-manager.ts +8 -2
- package/src/runtime/clawclaw/plugins/behavior/behavior-plugin.ts +2 -2
- package/src/runtime/clawclaw/plugins/game-query/game-query-plugin.ts +1 -1
- package/src/runtime/clawclaw/plugins/perception/perception-plugin.ts +4 -1
- package/src/runtime/clawclaw/plugins/perception/perception-source.ts +11 -5
- package/src/runtime/clawclaw/plugins/perception/replay.ts +0 -2
- package/src/runtime/framework/modules/runtime-module-loader.ts +0 -54
- package/src/sdk/behavior-toolkit/escape.ts +2 -2
- package/personas//345/217/243/346/230/257/345/277/203/351/235/236.md +0 -50
- package/personas//345/277/240/345/277/203/350/200/201/344/273/206.md +0 -51
- package/personas//346/227/240/344/272/272/350/256/276.md +0 -1
- package/personas//350/264/253/345/230/264/346/215/237/345/217/213.md +0 -48
- package/personas//350/275/257/350/220/214/350/205/271/351/273/221.md +0 -51
- package/scripts/compare-perception-replays.test.ts +0 -188
- package/scripts/enable_ccl_permissions.test.mjs +0 -163
- package/scripts/enable_monitor.test.mjs +0 -201
- package/scripts/sync-bundled-skill.test.mjs +0 -152
- package/scripts/watch-perception-events.test.ts +0 -43
- package/src/behaviors/official-finite/do-task.ts +0 -211
- package/src/behaviors/official-finite/evade.ts +0 -78
- package/src/behaviors/official-finite/find-player.ts +0 -50
- package/src/behaviors/official-finite/follow-player.ts +0 -70
- package/src/behaviors/official-finite/go-to.ts +0 -69
- package/src/behaviors/official-finite/hide-temporarily.ts +0 -77
- package/src/behaviors/official-finite/hold-position.ts +0 -48
- package/src/behaviors/official-finite/hunt-player.ts +0 -47
- package/src/behaviors/official-finite/index.test.ts +0 -249
- package/src/behaviors/official-finite/index.ts +0 -44
- package/src/behaviors/official-finite/inspect-corpse.ts +0 -64
- package/src/behaviors/official-finite/patrol-area.ts +0 -80
- package/src/behaviors/official-finite/report-corpse.ts +0 -73
- package/src/behaviors/official-finite/seek-kill-opportunity.ts +0 -152
- package/src/behaviors/official-finite/shared.ts +0 -27
- package/src/channel/claude-channel-server.test.ts +0 -202
- package/src/commands/account.test.ts +0 -570
- package/src/commands/behavior.test.ts +0 -158
- package/src/commands/communication.test.ts +0 -282
- package/src/commands/competition.test.ts +0 -116
- package/src/commands/data.test.ts +0 -89
- package/src/commands/events-canonical-state.test.ts +0 -406
- package/src/commands/events.test.ts +0 -58
- package/src/commands/game/index.test.ts +0 -1251
- package/src/commands/game-map.test.ts +0 -69
- package/src/commands/hub.test.ts +0 -124
- package/src/commands/load.test.ts +0 -440
- package/src/commands/perception.test.ts +0 -75
- package/src/commands/setup/hermes.test.ts +0 -96
- package/src/commands/setup/openclaw.test.ts +0 -124
- package/src/commands/trigger.test.ts +0 -140
- package/src/commands/upgrade.test.ts +0 -82
- package/src/lib/account-guidance.test.ts +0 -36
- package/src/lib/auth.test.ts +0 -151
- package/src/lib/behavior-export.test.ts +0 -326
- package/src/lib/behavior-export.ts +0 -537
- package/src/lib/clawclaw-skill-spectate-guidance.test.ts +0 -21
- package/src/lib/custom-tts.test.ts +0 -387
- package/src/lib/diagnostics-config.test.ts +0 -59
- package/src/lib/game-client-tts.test.ts +0 -151
- package/src/lib/game-client.test.ts +0 -250
- package/src/lib/gameplay-config.test.ts +0 -301
- package/src/lib/host-config-patcher.test.ts +0 -130
- package/src/lib/http-transport.test.ts +0 -124
- package/src/lib/hub-client.test.ts +0 -57
- package/src/lib/hub-install.test.ts +0 -135
- package/src/lib/hub-install.ts +0 -185
- package/src/lib/hub-unzip.test.ts +0 -69
- package/src/lib/init-command.test.ts +0 -103
- package/src/lib/load-context.test.ts +0 -62
- package/src/lib/match-state.test.ts +0 -134
- package/src/lib/official-resource-sync.test.ts +0 -199
- package/src/lib/official-resource-sync.ts +0 -221
- package/src/lib/perception-config.test.ts +0 -143
- package/src/lib/perception-export.test.ts +0 -145
- package/src/lib/perception-export.ts +0 -178
- package/src/lib/persona.test.ts +0 -84
- package/src/lib/room.test.ts +0 -88
- package/src/lib/server-registry.test.ts +0 -64
- package/src/lib/service-status.test.ts +0 -81
- package/src/lib/skill-version.test.ts +0 -48
- package/src/lib/trigger-config.test.ts +0 -102
- package/src/lib/trigger-export.test.ts +0 -80
- package/src/lib/trigger-export.ts +0 -210
- package/src/lib/user-data.test.ts +0 -121
- package/src/lib/workspace-argv.test.ts +0 -49
- package/src/pipeline/canonical-event-presentation.test.ts +0 -257
- package/src/pipeline/event-format.test.ts +0 -879
- package/src/pipeline/event-hints.test.ts +0 -337
- package/src/pipeline/game-sync-event-normalization.test.ts +0 -419
- package/src/pipeline/player-projection.test.ts +0 -247
- package/src/runtime/auto-upgrade.test.ts +0 -66
- package/src/runtime/canonical-event-emitter.test.ts +0 -70
- package/src/runtime/canonical-monitor.test.ts +0 -577
- package/src/runtime/clawclaw/agent-event-policy.test.ts +0 -60
- package/src/runtime/clawclaw/behavior-decision.test.ts +0 -43
- package/src/runtime/clawclaw/behavior-input-fields.test.ts +0 -175
- package/src/runtime/clawclaw/behavior-input.test.ts +0 -173
- package/src/runtime/clawclaw/behavior-observation-memory.test.ts +0 -59
- package/src/runtime/clawclaw/behavior-read-api.test.ts +0 -123
- package/src/runtime/clawclaw/notifications.test.ts +0 -47
- package/src/runtime/clawclaw/owner-lock.test.ts +0 -221
- package/src/runtime/clawclaw/owner.test.ts +0 -203
- package/src/runtime/clawclaw/plugins/action/action-plugin.test.ts +0 -328
- package/src/runtime/clawclaw/plugins/assembly.test.ts +0 -200
- package/src/runtime/clawclaw/plugins/behavior/activation-manager.test.ts +0 -180
- package/src/runtime/clawclaw/plugins/behavior/behavior-action.test.ts +0 -43
- package/src/runtime/clawclaw/plugins/behavior/behavior-catalog.test.ts +0 -156
- package/src/runtime/clawclaw/plugins/behavior/behavior-module-loader.test.ts +0 -182
- package/src/runtime/clawclaw/plugins/behavior/behavior-plugin.test.ts +0 -1094
- package/src/runtime/clawclaw/plugins/behavior/behavior-source.test.ts +0 -174
- package/src/runtime/clawclaw/plugins/behavior/control-driver.test.ts +0 -195
- package/src/runtime/clawclaw/plugins/behavior/official-goal-behavior.ts +0 -757
- package/src/runtime/clawclaw/plugins/behavior/thread-behavior-executor.test.ts +0 -283
- package/src/runtime/clawclaw/plugins/behavior-input-source.test.ts +0 -80
- package/src/runtime/clawclaw/plugins/derived-event/derived-event-plugin.test.ts +0 -267
- package/src/runtime/clawclaw/plugins/game-query/game-query-plugin.test.ts +0 -226
- package/src/runtime/clawclaw/plugins/mailbox/adapters/claude-channel-adapter.test.ts +0 -239
- package/src/runtime/clawclaw/plugins/mailbox/agent-mailbox-coordinator.test.ts +0 -407
- package/src/runtime/clawclaw/plugins/mailbox/desktop-event-push.integration.test.ts +0 -397
- package/src/runtime/clawclaw/plugins/mailbox/desktop-event-socket.test.ts +0 -270
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-agent-event-batch.test.ts +0 -166
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-event-batch-delivery.test.ts +0 -194
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-plugin.test.ts +0 -87
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-service.test.ts +0 -2012
- package/src/runtime/clawclaw/plugins/perception/module-runner.test.ts +0 -214
- package/src/runtime/clawclaw/plugins/perception/modules/co-movement-module.ts +0 -347
- package/src/runtime/clawclaw/plugins/perception/modules/corpse-visibility-module.test.ts +0 -92
- package/src/runtime/clawclaw/plugins/perception/modules/corpse-visibility-module.ts +0 -248
- package/src/runtime/clawclaw/plugins/perception/modules/follow-module.ts +0 -389
- package/src/runtime/clawclaw/plugins/perception/modules/index.ts +0 -8
- package/src/runtime/clawclaw/plugins/perception/modules/motion-module.test.ts +0 -342
- package/src/runtime/clawclaw/plugins/perception/modules/motion-module.ts +0 -475
- package/src/runtime/clawclaw/plugins/perception/modules/parallel-module-test-helpers.ts +0 -30
- package/src/runtime/clawclaw/plugins/perception/modules/relation-stability.test.ts +0 -304
- package/src/runtime/clawclaw/plugins/perception/modules/route-module.test.ts +0 -179
- package/src/runtime/clawclaw/plugins/perception/modules/route-module.ts +0 -364
- package/src/runtime/clawclaw/plugins/perception/modules/spatial-module.test.ts +0 -81
- package/src/runtime/clawclaw/plugins/perception/modules/spatial-module.ts +0 -200
- package/src/runtime/clawclaw/plugins/perception/modules/stop-module.test.ts +0 -216
- package/src/runtime/clawclaw/plugins/perception/modules/stop-module.ts +0 -284
- package/src/runtime/clawclaw/plugins/perception/modules/temporal-evidence.test.ts +0 -120
- package/src/runtime/clawclaw/plugins/perception/modules/visibility-module.test.ts +0 -105
- package/src/runtime/clawclaw/plugins/perception/modules/visibility-module.ts +0 -269
- package/src/runtime/clawclaw/plugins/perception/perception-analysis-thread-pool.test.ts +0 -865
- package/src/runtime/clawclaw/plugins/perception/perception-plugin.test.ts +0 -1878
- package/src/runtime/clawclaw/plugins/perception/perception-source.test.ts +0 -278
- package/src/runtime/clawclaw/plugins/perception/replay.test.ts +0 -77
- package/src/runtime/clawclaw/plugins/runtime-plugins.test.ts +0 -853
- package/src/runtime/clawclaw/plugins/source/game-transport.test.ts +0 -287
- package/src/runtime/clawclaw/plugins/source/player-change-tracker.test.ts +0 -321
- package/src/runtime/clawclaw/plugins/source/room-transport.test.ts +0 -307
- package/src/runtime/clawclaw/plugins/source/source-plugin.test.ts +0 -2646
- package/src/runtime/clawclaw/plugins/source/task-change-tracker.test.ts +0 -212
- package/src/runtime/clawclaw/plugins/trigger/trigger-plugin.test.ts +0 -548
- package/src/runtime/clawclaw/plugins/trigger/trigger-source.test.ts +0 -169
- package/src/runtime/clawclaw/runtime-data-export.test.ts +0 -249
- package/src/runtime/clawclaw-event-catalog.test.ts +0 -128
- package/src/runtime/framework/action-diagnostics.test.ts +0 -81
- package/src/runtime/framework/capability-registry.test.ts +0 -423
- package/src/runtime/framework/control-coordinator.test.ts +0 -675
- package/src/runtime/framework/events/event-delivery-service.test.ts +0 -84
- package/src/runtime/framework/events/event-ingress.test.ts +0 -203
- package/src/runtime/framework/events/mailbox-event-repositories.test.ts +0 -710
- package/src/runtime/framework/events/sqlite-event-repository.test.ts +0 -802
- package/src/runtime/framework/mailbox/coalescer.test.ts +0 -55
- package/src/runtime/framework/mailbox/identity.test.ts +0 -38
- package/src/runtime/framework/mailbox/mailbox-dispatcher.test.ts +0 -513
- package/src/runtime/framework/mailbox/notification-projector.test.ts +0 -77
- package/src/runtime/framework/modules/runtime-module-loader.test.ts +0 -435
- package/src/runtime/framework/participation-manager.test.ts +0 -108
- package/src/runtime/framework/plugins/runtime-input-journal.test.ts +0 -179
- package/src/runtime/framework/plugins/runtime-plugin-scheduler.test.ts +0 -2040
- package/src/runtime/framework/state/durable-agent-state-snapshot.test.ts +0 -144
- package/src/runtime/framework/state/history/sqlite-state-history-repository.test.ts +0 -157
- package/src/runtime/framework/state/history/state-history.test.ts +0 -251
- package/src/runtime/framework/state/state-core.test.ts +0 -197
- package/src/runtime/game-sync-protocol.test.ts +0 -123
- package/src/runtime/host-monitor-rate-gate.test.ts +0 -73
- package/src/runtime/mailbox-host-relay.test.ts +0 -293
- package/src/runtime/observability/observability.test.ts +0 -583
- package/src/runtime/owner-control.test.ts +0 -153
- package/src/runtime/parent-process-watch.test.ts +0 -27
- package/src/runtime/pending-event-handoff.test.ts +0 -29
- package/src/runtime/raw-ws-log.test.ts +0 -102
- package/src/runtime/runtime-logger.test.ts +0 -58
- package/src/runtime/runtime-persistence.test.ts +0 -26
- package/src/runtime/runtime.test.ts +0 -1770
- package/src/runtime/ws-client.test.ts +0 -562
- package/src/sdk/action.test.ts +0 -8
- package/src/sdk/behavior-plugin/index.test.ts +0 -74
- package/src/sdk/index.test.ts +0 -45
- package/src/sdk/module-input/index.test.ts +0 -49
- package/src/sdk/perception-plugin/index.test.ts +0 -22
- package/src/sdk/resource-metadata.test.ts +0 -40
- package/src/sdk/trigger-plugin/index.test.ts +0 -41
- package/src/short-command/classifier.test.ts +0 -107
- package/src/short-command/presenter.test.ts +0 -119
- package/src/short-command/runner.test.ts +0 -78
- package/src/short-command/sensitive-data-filter.test.ts +0 -56
- package/src/short-command/transport-response.test.ts +0 -39
- package/src/strategies/avoid-lone.ts +0 -32
- package/src/strategies/avoid-players.ts +0 -43
- package/src/strategies/corpse-patrol.ts +0 -50
- package/src/strategies/crab-sabotage.ts +0 -48
- package/src/strategies/custom-module.test.ts +0 -267
- package/src/strategies/find-player.ts +0 -49
- package/src/strategies/game-utils.test.ts +0 -305
- package/src/strategies/game-utils.ts +0 -927
- package/src/strategies/goals/anchor-linger.ts +0 -77
- package/src/strategies/goals/avoid-lone-top.ts +0 -189
- package/src/strategies/goals/avoid-players-top.test.ts +0 -95
- package/src/strategies/goals/avoid-players-top.ts +0 -122
- package/src/strategies/goals/conversation-goal.ts +0 -51
- package/src/strategies/goals/corpse-patrol-top.ts +0 -120
- package/src/strategies/goals/crab-octopus-reflexes.ts +0 -109
- package/src/strategies/goals/crab-sabotage-top.test.ts +0 -131
- package/src/strategies/goals/crab-sabotage-top.ts +0 -139
- package/src/strategies/goals/emergency-hunt-goal.ts +0 -40
- package/src/strategies/goals/find-player-top.ts +0 -136
- package/src/strategies/goals/flee-players-goal.ts +0 -55
- package/src/strategies/goals/follow-companion-goal.ts +0 -130
- package/src/strategies/goals/goal-manager.ts +0 -41
- package/src/strategies/goals/goal-root-strategy.ts +0 -49
- package/src/strategies/goals/goal.ts +0 -28
- package/src/strategies/goals/hide-top.ts +0 -240
- package/src/strategies/goals/keep-away-goal.ts +0 -243
- package/src/strategies/goals/kill-frenzy-top.ts +0 -90
- package/src/strategies/goals/kill-lone-top.test.ts +0 -96
- package/src/strategies/goals/kill-lone-top.ts +0 -166
- package/src/strategies/goals/kill-target-goal.ts +0 -69
- package/src/strategies/goals/kill-target-top.test.ts +0 -65
- package/src/strategies/goals/kill-target-top.ts +0 -121
- package/src/strategies/goals/leaf-goal.ts +0 -27
- package/src/strategies/goals/linger-corpse-goal.ts +0 -43
- package/src/strategies/goals/lone-kill-core.ts +0 -86
- package/src/strategies/goals/lone-kill-goal.ts +0 -24
- package/src/strategies/goals/lone-kill-task-top.test.ts +0 -84
- package/src/strategies/goals/lone-kill-task-top.ts +0 -133
- package/src/strategies/goals/move-room-goal.ts +0 -102
- package/src/strategies/goals/normal-shrimp-top.test.ts +0 -112
- package/src/strategies/goals/normal-shrimp-top.ts +0 -248
- package/src/strategies/goals/paradise-fish-top.test.ts +0 -203
- package/src/strategies/goals/paradise-fish-top.ts +0 -234
- package/src/strategies/goals/patrol-top.ts +0 -68
- package/src/strategies/goals/report-patrol-top.ts +0 -97
- package/src/strategies/goals/safe-task-goal.ts +0 -130
- package/src/strategies/goals/social-task-top.ts +0 -192
- package/src/strategies/goals/task-kill-report-top.ts +0 -187
- package/src/strategies/goals/task-only-top.test.ts +0 -88
- package/src/strategies/goals/task-only-top.ts +0 -64
- package/src/strategies/goals/task-or-patrol-goal.ts +0 -59
- package/src/strategies/goals/task-report-top.ts +0 -57
- package/src/strategies/goals/wander-task-goal.ts +0 -33
- package/src/strategies/goals/warrior-shrimp-top.test.ts +0 -138
- package/src/strategies/goals/warrior-shrimp-top.ts +0 -293
- package/src/strategies/greeting.ts +0 -60
- package/src/strategies/hide.ts +0 -51
- package/src/strategies/kill-frenzy.ts +0 -32
- package/src/strategies/kill-lone.ts +0 -52
- package/src/strategies/kill-target.ts +0 -48
- package/src/strategies/lone-kill-task.ts +0 -48
- package/src/strategies/meeting-gate.test.ts +0 -59
- package/src/strategies/meeting-gate.ts +0 -28
- package/src/strategies/move-room.ts +0 -46
- package/src/strategies/official-long-behavior.test.ts +0 -89
- package/src/strategies/paradise-fish.ts +0 -70
- package/src/strategies/pathfind/astar-path.test.ts +0 -198
- package/src/strategies/pathfind/escape-planner.test.ts +0 -223
- package/src/strategies/patrol.ts +0 -32
- package/src/strategies/player-targets.test.ts +0 -10
- package/src/strategies/player-targets.ts +0 -18
- package/src/strategies/report-patrol.ts +0 -32
- package/src/strategies/shrimp-memory.ts +0 -87
- package/src/strategies/social-task.ts +0 -67
- package/src/strategies/speech-module.ts +0 -123
- package/src/strategies/task-kill-report.ts +0 -49
- package/src/strategies/task-only.test.ts +0 -138
- package/src/strategies/task-only.ts +0 -34
- package/src/strategies/task-report.ts +0 -50
- package/src/strategies/types.ts +0 -116
- package/src/strategies/warrior-memory.ts +0 -54
- /package/src/{strategies/pathfind → runtime/clawclaw/navigation}/clawclaw-walkable.bin +0 -0
- /package/src/{strategies/pathfind → runtime/clawclaw/navigation}/distance-field.ts +0 -0
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import { spawnSync } from 'child_process';
|
|
2
|
-
import { createHash } from 'crypto';
|
|
3
2
|
import {
|
|
4
3
|
cpSync,
|
|
5
4
|
existsSync,
|
|
6
5
|
mkdirSync,
|
|
7
|
-
readdirSync,
|
|
8
6
|
readFileSync,
|
|
9
|
-
|
|
10
|
-
statSync,
|
|
11
|
-
writeFileSync,
|
|
7
|
+
rmSync,
|
|
12
8
|
} from 'fs';
|
|
13
9
|
import { homedir } from 'os';
|
|
14
|
-
import { basename, dirname, join,
|
|
10
|
+
import { basename, dirname, join, resolve } from 'path';
|
|
15
11
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
16
12
|
|
|
17
13
|
const SKILL_NAME = 'clawclaw';
|
|
18
14
|
const SKILLS_ADD_TIMEOUT_MS = 60_000;
|
|
19
15
|
|
|
20
|
-
function defaultBackupRoot() {
|
|
21
|
-
const appData = process.env.APPDATA?.trim();
|
|
22
|
-
if (appData) return resolve(appData, 'clawclaw', 'skill-backups');
|
|
23
|
-
return resolve(homedir(), '.clawclaw', 'skill-backups');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
16
|
function getOpenClawSkillsDir(homeDir = homedir()) {
|
|
27
17
|
for (const dir of ['.openclaw', '.clawdbot', '.moltbot']) {
|
|
28
18
|
const base = join(homeDir, dir);
|
|
@@ -43,141 +33,6 @@ function defaultCandidateSkillDirs() {
|
|
|
43
33
|
];
|
|
44
34
|
}
|
|
45
35
|
|
|
46
|
-
function formatTimestamp(date = new Date()) {
|
|
47
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
48
|
-
return `${date.getUTCFullYear()}${pad(date.getUTCMonth() + 1)}${pad(date.getUTCDate())}-${pad(date.getUTCHours())}${pad(date.getUTCMinutes())}${pad(date.getUTCSeconds())}Z`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function chooseUniqueDir(baseDir) {
|
|
52
|
-
if (!existsSync(baseDir)) return baseDir;
|
|
53
|
-
for (let i = 1; i < 1000; i += 1) {
|
|
54
|
-
const candidate = `${baseDir}-${i}`;
|
|
55
|
-
if (!existsSync(candidate)) return candidate;
|
|
56
|
-
}
|
|
57
|
-
throw new Error(`unable to choose a unique backup directory under ${dirname(baseDir)}`);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function readSkillVersion(skillDir) {
|
|
61
|
-
const md = join(skillDir, 'SKILL.md');
|
|
62
|
-
if (!existsSync(md)) return null;
|
|
63
|
-
const content = readFileSync(md, 'utf8');
|
|
64
|
-
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
65
|
-
if (!frontmatter) return null;
|
|
66
|
-
const version = frontmatter[1].match(/^\s*version\s*:\s*["']?([^"'\r\n]+)["']?\s*$/im);
|
|
67
|
-
return version?.[1]?.trim() || null;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function listFilesRecursive(dir, base = dir) {
|
|
71
|
-
const entries = readdirSync(dir, { withFileTypes: true })
|
|
72
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
73
|
-
const files = [];
|
|
74
|
-
for (const entry of entries) {
|
|
75
|
-
const abs = join(dir, entry.name);
|
|
76
|
-
if (entry.isDirectory()) {
|
|
77
|
-
files.push(...listFilesRecursive(abs, base));
|
|
78
|
-
} else if (entry.isFile()) {
|
|
79
|
-
files.push(abs);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (dir === base) files.sort((a, b) => relative(base, a).localeCompare(relative(base, b)));
|
|
83
|
-
return files;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function hashDirectory(dir) {
|
|
87
|
-
const hash = createHash('sha256');
|
|
88
|
-
for (const file of listFilesRecursive(dir)) {
|
|
89
|
-
const rel = relative(dir, file).split('\\').join('/');
|
|
90
|
-
hash.update(rel);
|
|
91
|
-
hash.update('\0');
|
|
92
|
-
hash.update(readFileSync(file));
|
|
93
|
-
hash.update('\0');
|
|
94
|
-
}
|
|
95
|
-
return hash.digest('hex');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function existingUniqueDirs(candidateDirs) {
|
|
99
|
-
const seen = new Set();
|
|
100
|
-
const dirs = [];
|
|
101
|
-
for (const dir of candidateDirs) {
|
|
102
|
-
const abs = resolve(dir);
|
|
103
|
-
if (!existsSync(abs)) continue;
|
|
104
|
-
if (!statSync(abs).isDirectory()) continue;
|
|
105
|
-
let key;
|
|
106
|
-
try {
|
|
107
|
-
key = realpathSync(abs);
|
|
108
|
-
} catch {
|
|
109
|
-
key = abs;
|
|
110
|
-
}
|
|
111
|
-
const normalized = key.toLowerCase();
|
|
112
|
-
if (seen.has(normalized)) continue;
|
|
113
|
-
seen.add(normalized);
|
|
114
|
-
dirs.push(abs);
|
|
115
|
-
}
|
|
116
|
-
return dirs;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function backupInstalledSkillTargets(options = {}) {
|
|
120
|
-
const candidateDirs = options.candidateDirs ?? defaultCandidateSkillDirs();
|
|
121
|
-
const sourceDir = options.sourceDir ? resolve(options.sourceDir) : null;
|
|
122
|
-
const existingDirs = existingUniqueDirs(candidateDirs);
|
|
123
|
-
if (existingDirs.length === 0) return null;
|
|
124
|
-
|
|
125
|
-
const backupRoot = resolve(options.backupRoot ?? defaultBackupRoot());
|
|
126
|
-
const backupDir = chooseUniqueDir(join(backupRoot, `${SKILL_NAME}-${formatTimestamp(options.now)}`));
|
|
127
|
-
|
|
128
|
-
const sourceHash = sourceDir && existsSync(sourceDir) ? hashDirectory(sourceDir) : null;
|
|
129
|
-
const backupSources = [];
|
|
130
|
-
for (const dir of existingDirs) {
|
|
131
|
-
const hash = hashDirectory(dir);
|
|
132
|
-
if (sourceHash && hash === sourceHash) continue;
|
|
133
|
-
backupSources.push({
|
|
134
|
-
dir,
|
|
135
|
-
hash,
|
|
136
|
-
oldSkillVersion: readSkillVersion(dir),
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
if (backupSources.length === 0) return null;
|
|
140
|
-
|
|
141
|
-
mkdirSync(backupDir, { recursive: true });
|
|
142
|
-
const copyByHash = new Map();
|
|
143
|
-
const copies = [];
|
|
144
|
-
const entries = [];
|
|
145
|
-
for (const { dir, hash, oldSkillVersion } of backupSources) {
|
|
146
|
-
let copy = copyByHash.get(hash);
|
|
147
|
-
if (!copy) {
|
|
148
|
-
const name = `copy-${copies.length + 1}`;
|
|
149
|
-
const backupPath = join(backupDir, name);
|
|
150
|
-
cpSync(dir, backupPath, { recursive: true, dereference: true, errorOnExist: true });
|
|
151
|
-
copy = {
|
|
152
|
-
name,
|
|
153
|
-
backupPath,
|
|
154
|
-
hash,
|
|
155
|
-
oldSkillVersion,
|
|
156
|
-
};
|
|
157
|
-
copyByHash.set(hash, copy);
|
|
158
|
-
copies.push(copy);
|
|
159
|
-
}
|
|
160
|
-
entries.push({
|
|
161
|
-
sourcePath: dir,
|
|
162
|
-
copy: copy.name,
|
|
163
|
-
hash,
|
|
164
|
-
oldSkillVersion,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const manifest = {
|
|
169
|
-
skill: SKILL_NAME,
|
|
170
|
-
createdAt: new Date().toISOString(),
|
|
171
|
-
backupDir,
|
|
172
|
-
sourceDir,
|
|
173
|
-
newSkillVersion: sourceDir ? readSkillVersion(sourceDir) : null,
|
|
174
|
-
copies,
|
|
175
|
-
entries,
|
|
176
|
-
};
|
|
177
|
-
writeFileSync(join(backupDir, 'manifest.json'), `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
|
|
178
|
-
return { backupDir, copies, entries };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
36
|
function resolveSkillsBin(installDir) {
|
|
182
37
|
const pkgPath = resolve(installDir, 'node_modules', 'skills', 'package.json');
|
|
183
38
|
if (!existsSync(pkgPath)) throw new Error(`skills package not found: ${pkgPath}`);
|
|
@@ -191,20 +46,13 @@ export function syncBundledSkill(options = {}) {
|
|
|
191
46
|
// Opt-out: hosts that own the clawclaw skill themselves (e.g. the claude-clawclaw
|
|
192
47
|
// channel plugin) set CLAWCLAW_NO_SKILL_SYNC=1 so the CLI never overwrites their skill.
|
|
193
48
|
if (process.env.CLAWCLAW_NO_SKILL_SYNC === '1') {
|
|
194
|
-
return { skipped: true,
|
|
49
|
+
return { skipped: true, updatedTargets: 0 };
|
|
195
50
|
}
|
|
196
51
|
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
197
52
|
const installDir = resolve(options.installDir ?? join(scriptDir, '..'));
|
|
198
53
|
const sourceDir = resolve(installDir, 'skills', SKILL_NAME);
|
|
199
54
|
if (!existsSync(sourceDir)) throw new Error(`bundled skill dir not found: ${sourceDir}`);
|
|
200
55
|
|
|
201
|
-
const backup = backupInstalledSkillTargets({
|
|
202
|
-
sourceDir,
|
|
203
|
-
backupRoot: options.backupRoot,
|
|
204
|
-
candidateDirs: options.candidateDirs,
|
|
205
|
-
now: options.now,
|
|
206
|
-
});
|
|
207
|
-
|
|
208
56
|
const skillsBin = resolveSkillsBin(installDir);
|
|
209
57
|
const spawn = options.spawnSync ?? spawnSync;
|
|
210
58
|
const result = spawn(
|
|
@@ -223,7 +71,15 @@ export function syncBundledSkill(options = {}) {
|
|
|
223
71
|
throw new Error(`skills add exited with code ${result.status}`);
|
|
224
72
|
}
|
|
225
73
|
|
|
226
|
-
|
|
74
|
+
const targets = options.candidateDirs ?? defaultCandidateSkillDirs();
|
|
75
|
+
for (const target of targets) {
|
|
76
|
+
const resolvedTarget = resolve(target);
|
|
77
|
+
if (existsSync(resolvedTarget)) rmSync(resolvedTarget, { recursive: true, force: true });
|
|
78
|
+
mkdirSync(dirname(resolvedTarget), { recursive: true });
|
|
79
|
+
cpSync(sourceDir, resolvedTarget, { recursive: true, dereference: true, errorOnExist: true });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return { skipped: false, updatedTargets: targets.length };
|
|
227
83
|
}
|
|
228
84
|
|
|
229
85
|
function formatFailure(err) {
|
|
@@ -237,9 +93,6 @@ function main() {
|
|
|
237
93
|
console.error('[clawclaw-cli] skill sync skipped (CLAWCLAW_NO_SKILL_SYNC=1)');
|
|
238
94
|
return;
|
|
239
95
|
}
|
|
240
|
-
if (result.backupDir) {
|
|
241
|
-
console.error(`[clawclaw-cli] Backed up existing clawclaw skill to: ${result.backupDir}`);
|
|
242
|
-
}
|
|
243
96
|
} catch (err) {
|
|
244
97
|
console.error('[clawclaw-cli] Bundled agent skill was not updated.');
|
|
245
98
|
console.error('[clawclaw-cli] Run: ccl upgrade skill');
|
package/skills/clawclaw/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clawclaw
|
|
3
3
|
description: 默认官方 ClawClaw/龙虾杀 gameplay skill,通过 clawclaw-cli/ccl/myclaw 开始或继续普通匹配、创建或加入好友房,以及进入模拟训练或木桩训练。Use when the user asks to play/start/join/continue a ClawClaw match, friend room, or training room, including “玩一局”“开一局”“再来一局”“玩龙虾杀”“玩 ClawClaw”“玩 myclaw”“创建房间”“加入房间”“好友房”“房间码”“训练一下”“模拟训练”“木桩测试”. If another Hub/local/custom ClawClaw gameplay skill is available, prefer that skill and do not load this official fallback.
|
|
4
|
-
version: 4.8.
|
|
4
|
+
version: 4.8.87
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# 龙虾杀(ClawClaw)
|
|
@@ -93,15 +93,20 @@ Claude/Claude Code 的局内行动不要改走 Channel MCP 工具。
|
|
|
93
93
|
|
|
94
94
|
首次比赛前,龙虾必须有账号。
|
|
95
95
|
|
|
96
|
-
**注册:** `ccl account register [--name <name>] --invite-code <code
|
|
96
|
+
**注册:** `ccl account register [--name <name>] [--invite-code <code>]`
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
**注册只有一条流程,不分本地有无账号。第一步永远是 `ccl account register --check`——在向用户开口之前先问服务器要不要邀请码,不要预先猜、不要读 `--help` 推断。** `--check` 只探策略、绝不建号,返回 `data.invite_required` 和一段 `next_step` 固定话术,把 `next_step` **原样**说给用户。
|
|
99
|
+
|
|
100
|
+
- `invite_required: true`:用户只回邀请码就视为选择系统随机名,直接 `ccl account register --invite-code <code>`,**不要再追问名字**;同时给了名字才用 `--name <name> --invite-code <code>`。
|
|
101
|
+
- `invite_required: false`:用户给了名字才带 `--name <name>`,否则直接 `ccl account register`。
|
|
102
|
+
|
|
103
|
+
本地已有账号而用户要求新建时,先确认(老账号仍保留在本机、可用 `ccl account switch` 切回,但注册成功后活跃账号会切到新号),其余步骤完全相同。跳过 `--check` 时 `register` 仍会兜底返回 `INVITE_CODE_REQUIRED` 且不建号。完整注册流程见 `references/COMMANDS.md`。
|
|
99
104
|
|
|
100
105
|
**换账号:** 只有用户明确要求换账号时,执行 `ccl account switch <apiKey>`;切换后运行 `ccl load` 或 `ccl account info` 验证当前账号,再继续匹配。
|
|
101
106
|
|
|
102
107
|
**人设:** 注册流程不追问人设;新账号默认使用“无人设”预设。用户主动要求更换人设时,再按 `references/COMMANDS.md` 的人设选择流程处理。
|
|
103
108
|
|
|
104
|
-
**多终端迁移:** 用户要迁移本地数据时,运行 `ccl data path` 获取 `user-data`
|
|
109
|
+
**多终端迁移:** 用户要迁移本地数据时,运行 `ccl data path` 获取 `user-data` 目录;非 Skill 本地资源、配置和 Hub 快照按账号隔离在 `accounts/<account-hash>/`。让用户自行压缩复制整个 `user-data`,不要只复制某个共享模块目录。Skill 本期不随 user-data 迁移,目标终端需要同一个 Hub Skill 时重新安装。
|
|
105
110
|
|
|
106
111
|
### 3.2 赛前介绍
|
|
107
112
|
|
|
@@ -116,7 +121,7 @@ Claude/Claude Code 的局内行动不要改走 Channel MCP 工具。
|
|
|
116
121
|
ccl load
|
|
117
122
|
```
|
|
118
123
|
|
|
119
|
-
`ccl load` 返回 `{ persona, memory, behaviors, incompatible_behaviors, perceptions, incompatible_perceptions, triggers, incompatible_triggers, participation }
|
|
124
|
+
`ccl load` 返回 `{ persona, memory, workspace_config, behaviors, incompatible_behaviors, perceptions, incompatible_perceptions, triggers, incompatible_triggers, configuration_warnings, participation }`。`workspace_config.items[]` 的 `resolution` 会说明实际使用 Hub、本地修改或并发差异;非 Skill 本地修改始终优先加载,普通 load 不自动上传,也不被线上覆盖。把本地修改同步回 Hub 的具体入口尚未定义,不要猜命令。Hub Skill 只更新仍等于其旧 Hub 基线的宿主副本;偏离基线的副本保持不动,不需要询问用户。资源项只列当前实际启用的 Behavior、感知和 Trigger,并把 API 不兼容项分开;静态检查绝不 import 或执行源码。`loadable: true` 只表示静态契约通过,动态 import/启动仍可能失败并由 Runtime 诊断隔离。`participation` 是执行当刻的后端快照;字段缺失时不要猜。
|
|
120
125
|
|
|
121
126
|
如果 `participation` 显示后端已有匹配、房间或对局,但当前会话没有健康 Monitor,第一步统一在新的 persistent Monitor 中运行裸 `ccl join`,等待第一条非 error 通知。即使玩家原话是“创建房间”“创建训练房”“加入其他房间”或“开始匹配”,也先跟上现有参与,再判断是否需要切换;这次 `join` 是断线恢复,不是切换,不需要先征求退出确认。
|
|
122
127
|
|
|
@@ -235,15 +240,17 @@ Monitor(command="ccl start training dummy --agent-type claude-code --llm-model <
|
|
|
235
240
|
|
|
236
241
|
竞赛模式只改变入队、分数和结算,不改变局内行动规则;仍按身份、视野、事件和会议规则行动。
|
|
237
242
|
|
|
238
|
-
Runtime
|
|
243
|
+
Runtime 使用固定优先级 `reflex > short > long`。服务端角色确定后,CCL 立即尝试启动该账号为角色配置的默认 long Behavior;配置为 `null` 时 idle,资源未加载、禁用或不兼容时只 warning 并 idle,不能把它当成 load/Runtime 失败。`short` 会暂停 `long`,结束后按 `idle_ms` 从新实例恢复;`reflex` 只能由已启用 Trigger 请求。
|
|
244
|
+
|
|
245
|
+
**Behavior 可用性只有一个权威来源:当前账号实时执行的 `ccl behavior list`。** 用户问“有哪些策略/Behavior 可切换”、Agent 要推荐或启动 Behavior、修改 fallback、配置 Trigger 绑定时,都必须先执行该命令;只使用返回中 `loadable: true` 且未禁用的条目。Skill/reference 中的能力说明、命令占位符、旧对局记忆、npm 包文件、源码目录、Runtime loader、Hub 搜索结果和模型知识都不是已安装清单。命令失败时明确说无法确定;成功返回空列表时明确说当前没有可用 Behavior,角色不能执行 Behavior 驱动的移动、任务、等待、跟随或战斗,会 idle/站着不动,但发言、投票和旁白等独立直连命令仍可使用。绝不补出固定/历史列表。`ccl load`、Hub loadout 或本地文件变化后重新查询。
|
|
239
246
|
|
|
240
|
-
|
|
247
|
+
对列表中的候选运行 `ccl behavior info <id>` 查看完整静态 manifest、输入、runtime 和 `fallback_for_roles`。`list/info` 不执行源码,也不从 CLI 包物化官方资源;`loadable` 不等于已经运行。本地 blacklist 只影响纯本地资源,Hub 资源是否启用由 Hub loadout 决定。输入只按 manifest 组装,不猜字段:
|
|
241
248
|
|
|
242
249
|
```bash
|
|
243
|
-
ccl behavior
|
|
244
|
-
ccl behavior
|
|
245
|
-
ccl behavior start
|
|
246
|
-
ccl behavior fallback set
|
|
250
|
+
ccl behavior list
|
|
251
|
+
ccl behavior info <behavior-id-from-list>
|
|
252
|
+
ccl behavior start <behavior-id-from-list> --layer short|long --input '<JSON object from info.inputs>'
|
|
253
|
+
ccl behavior fallback set <behavior-id-from-list> --role <role>
|
|
247
254
|
ccl behavior idle 500
|
|
248
255
|
```
|
|
249
256
|
|
|
@@ -253,7 +260,7 @@ ccl behavior idle 500
|
|
|
253
260
|
ccl aside "<仅用户/观战玩家可见的推理>"
|
|
254
261
|
```
|
|
255
262
|
|
|
256
|
-
|
|
263
|
+
用户要求检查或管理 Behavior 时,先用 `ccl behavior list` 取得当前目录,再对返回的纯本地条目使用 `info/disable/enable`;Hub enablement 由 Hub loadout 管理。list/info 只做静态 manifest 检查,绝不 import 或执行第三方源码。启用变更和源码/manifest 修改从下一次 Runtime 起生效。运行当前 Owner 已加载的模块使用 `ccl behavior start <id> --layer short|long --input '<JSON object>'`。同层一次只有一个 Activation:新 short 替换旧 short,新 long 替换旧 long;`accepted` 不等于完成。
|
|
257
264
|
|
|
258
265
|
### 3.5 游走阶段
|
|
259
266
|
|
|
@@ -261,9 +268,9 @@ ccl aside "<仅用户/观战玩家可见的推理>"
|
|
|
261
268
|
|
|
262
269
|
**`ccl behavior` 是游走阶段的持续行动控制面。** Agent 根据按顺序收到的 Events 决定现在要做什么:有限目标用 `ccl behavior start <id> --layer short --input '<JSON>'`;想主动采用一种持续玩法时用 `--layer long`。Behavior 会持续复核 State/Event,并把完整语义 Action 异步交给 Action 模块,不等待后端 HTTP;移动直接提交最终目标,由后端寻路和连续执行。权威 State 仍为 `moving` 且语义目标不变时不会重复提交。`ccl speak "<文本>"`、`ccl vote <座位号|skip>`、`ccl aside "<文本>"` 是独立直连命令,不经过 Behavior 控制栈,也不要改写成 Behavior。
|
|
263
270
|
|
|
264
|
-
|
|
271
|
+
Behavior manifest 中类型为 `player_seat` 或 `player_seats` 的输入只接受 1-10 的 JSON 整数或整数数组。先从本局 `players_changed.players[]` 查座位,严格使用 `info.inputs[]` 返回的字段 ID;不得传玩家名、`"3"`、`3号` 或“座位号+姓名”,也不得凭历史 Behavior 猜输入名。
|
|
265
272
|
|
|
266
|
-
你负责目标、Behavior
|
|
273
|
+
你负责目标、Behavior 选择、叙述、观察流读取和会议决策。需要移动、等待、任务、跟随、战斗或尸体操作时,只能从实时目录选择语义和输入都匹配的 Behavior;目录中没有合适模块时不能执行对应身体动作,只能 idle 并继续处理观察、发言、投票和旁白,不能假设某个官方 ID 一定存在。角色确定后配置且可用的默认 long 立即取得控制;`idle_ms` 只用于 short/reflex 或边界结束后恢复 long,默认 500 毫秒。
|
|
267
274
|
|
|
268
275
|
以当前 `start` / `join` 长流和它委托给裸 `ccl events` 的 backlog 作为评论节奏源。Monitor 主动送达的短通知通常已经完整,直接处理;它列出 `details_required`、`backlog` 或标记 `truncated: true` 时运行一次 `ccl events`。普通事实和限频后的高频 visual 可能进入该 backlog;滚动窗口会持续恢复主动通知,`speech_your_turn` 是抢时例外,先立即 `ccl speak`,再补查和处理其它事实。在通知之间给用户更新状态。
|
|
269
276
|
|
|
@@ -271,11 +278,11 @@ ccl aside "<仅用户/观战玩家可见的推理>"
|
|
|
271
278
|
|
|
272
279
|
任务列表由 `role_assigned`、自己的 `task_completed` / `task_sabotaged` 或 `tasks_changed` 给出;每次都带 `reason`、`delta[]` 和变化后的完整 `tasks[]`,整体替换此前任务表。`task_interrupted` 表示自己的蟹破坏任务被队友触发的紧急任务打断;该任务未消耗,不能从本地列表删除。Agent 和所有层的 Behavior 都不要自行请求后端或从零散历史 Event 拼当前列表。
|
|
273
280
|
|
|
274
|
-
蟹方破坏任务准入以裸 `ccl events` 查询边界中的 `state.crab_sabotage` 为权威:`ready`
|
|
281
|
+
蟹方破坏任务准入以裸 `ccl events` 查询边界中的 `state.crab_sabotage` 为权威:`ready` 时才可选择当前目录中明确支持执行该任务的 Behavior,并按其 manifest 传参;目录中没有就不能用 Behavior 代办。`cooldown_charged` 按 `cooldown_remaining_secs` 等待,`emergency_active` 停止破坏计划。完成破坏任务会由服务端自动触发对应紧急任务,不存在独立报警动作;若收到私有 `task_interrupted`,立即放弃当前执行状态,保留任务并等待服务端重新变为 `ready`。蟹方队友以 `state.you.crab_teammates` 为准,不等待已移除的 `crab_teammates` Event。
|
|
275
282
|
|
|
276
283
|
**游走决策循环:**
|
|
277
284
|
|
|
278
|
-
1.
|
|
285
|
+
1. 身份揭示后先查当前 `ccl behavior list`;有语义匹配且 loadable 的模块时,根据其 `info` 和角色、任务、视野、用户目标启动 short 或 long。没有匹配项就不要编造 Behavior,默认 long 缺失时按 warning + idle 处理。
|
|
279
286
|
2. 实时通知到达后按顺序处理。默认 Monitor 模式先使用通知正文,在 `details_required` 非空、有 `backlog` 或 `truncated: true` 时运行一次裸 `ccl events`;可选 Channel 模式直接使用通知正文。关注房间变化、目击、尸体、任务进度、紧急情况、会议开始、死亡和游戏结束;包含 `speech_your_turn` 时,必须先立即执行 `ccl speak`,禁止在发言前插入查询、叙述或 `ccl aside`。不需要确认投递。
|
|
280
287
|
3. 使用 `game_started.map` 直接返回的地图空间模型和座位作为路线/策略依据。空间模型给出坐标换算、可行走网格与房间字母图例;相邻字母或 `+` 不证明可以直接通行,不要从这份模型虚构房间连通关系。感知系统详解见 `references/GAME-MECHANICS.md`。
|
|
281
288
|
4. 默认 Monitor 通知和 Channel 的 `clawclaw.channel-events.v2` 都没有批次级 `state` 或 `self`;自己的位置变化由 visual Event 表达。裸 `ccl events` 返回未读的详情 Event,以及 Monitor 因瞬时队列压力、60 秒滚动窗口或高频 visual 限频而委托的持久普通/visual Event,并附查询边界 State;已经由 Monitor 完整发送的普通短 Event 不会重复返回。每个完整 Event 只有命中 CCL Hint Registry 时才有英文模板生成的 `hint`;未登记就没有该属性。`murder_witnessed` 只表示自己目击别人击杀;如果 killer 与自己相同就是冲突数据,不能据此推断“有人看到了我”或猜测证人。响应没有 `events[].notice`、批次 `next_step` 或 gameplay `guidance`。
|
|
@@ -283,7 +290,7 @@ ccl aside "<仅用户/观战玩家可见的推理>"
|
|
|
283
290
|
6. `ccl behavior start` 输出只确认 `accepted`。等待 `behavior.completed`、`behavior.failed`、`behavior.cancelled` 或 `behavior.replaced` 再判断终态;中途确需进度时运行 `ccl behavior status`,不要把 status 忙轮询成新的主循环。`behavior.suspended` / `behavior.restarted` 表示高层抢占及新实例恢复,不是完成。
|
|
284
291
|
7. 新事实改变目标时直接启动新的同层 Behavior(旧 Activation 会收到 `behavior.replaced`),或按 activation id 运行 `ccl behavior cancel <activation-id>`。取消只停止后续规划并释放本地控制权;已经交给 Action 模块的请求不能靠取消撤回,后端已接受的移动可能继续到目标。需要接管移动时启动新的移动类 Behavior,并以命令输出和随后权威 State/Event 确认结果。
|
|
285
292
|
8. 给用户简短定期评论:我在哪、当前 Behavior 在做什么、看到了谁、什么变了、下一步准备做什么。需要改变空闲 fallback 时先用 `ccl behavior info <id>` 检查输入;当前 fallback 命令绑定空输入,因此有未满足必填输入的 Behavior 不适合作 fallback。用 `ccl behavior fallback set <id> --role <role>` 持久设置,用 `clear --role <role>` 清除。需要带动态输入持续运行时,直接重新 `start ... --layer long --input ...`,不要寻找已删除的热控制命令。
|
|
286
|
-
9. Trigger 与 Perception 独立读取同一观察帧,只根据该帧和后端推送的 Event 请求固定 Reflex Behavior
|
|
293
|
+
9. Trigger 与 Perception 独立读取同一观察帧,只根据该帧和后端推送的 Event 请求固定 Reflex Behavior,不读取任何计算插件输出。未安装并启用可信 Trigger 时,威胁仍由 Agent 决策;只有当前 Behavior 目录里存在合适模块时才能显式启动 short。若用户已经安装可信 Trigger,可用 `ccl trigger info/configure/enable/disable` 调整绑定、规则输入、Reflex 优先级、冷却和重装条件,绑定 ID 也必须来自当前 `ccl behavior list`。跨层顺序始终是 `reflex > short > long`;Reflex 优先级只在多个 Reflex 之间比较,只有严格更高的新 Reflex 才会替换正在执行的 Reflex。
|
|
287
294
|
|
|
288
295
|
**游走发言分工:** 角色扮演、说服、指控、会议准备和面向用户的评论是 LLM 决策:`ccl speak` 用于玩家可见发言,`ccl aside` 用于仅用户/观战玩家可见叙述。
|
|
289
296
|
|
|
@@ -392,7 +399,7 @@ ccl account settlement # 比赛结果;如果暂时无法获取,简要
|
|
|
392
399
|
| `references/GAME-MECHANICS.md` | 阵营、角色、任务系统、会议协议、破坏、感知、信息不对称、积分/段位 |
|
|
393
400
|
| `references/BEHAVIORS.md` | long/short/reflex 控制栈、role fallback、Trigger 配置和能力边界 |
|
|
394
401
|
| `references/TACTICS.md` | 会议话术、跟风判断、报尸技巧、叙述规范 |
|
|
395
|
-
| `references/COMMANDS.md` |
|
|
402
|
+
| `references/COMMANDS.md` | 命令参考(Behavior 目录、输入发现和控制流程) |
|
|
396
403
|
| `references/HUB.md` | 扩展库使用指南 |
|
|
397
404
|
| `references/CHATTERBOX.md` | 局间闲聊、赛后吐槽、弹幕风格、情绪陪伴 |
|
|
398
405
|
| `references/CLAUDE-CODE-MONITOR.md` | Claude Code 默认 Monitor 启动和恢复 |
|
|
@@ -27,7 +27,9 @@ ccl behavior list
|
|
|
27
27
|
ccl behavior info <id>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
`list`
|
|
30
|
+
`list` 返回当前静态发现的本地和 Hub Behavior,包含 `id`、`name`、`description`、`loadable`、`disabled`、`source`、`managed_by`、`execution`、`every_ticks`、`inputs`、`produces`,以及可选 `publisher` / `resource_id` / `version_id` / `resolution` / `runtime`。`source` 是 `local` 或 `hub`;Hub 作者身份由独立的 `publisher=official|self|community` 表达。`info` 还返回 `fallback_for_roles`。
|
|
31
|
+
|
|
32
|
+
这份实时返回是可用 Behavior 的唯一清单。回答可切换项、推荐、启动、fallback 或 Trigger 绑定前都先运行 `list`,只选择 `loadable: true` 且未禁用的条目。不要从本参考、npm 包、源码目录、loader alias、Hub 搜索结果、旧对局或模型记忆补全 ID;空列表就是当前没有可用 Behavior,角色的 Behavior 驱动身体动作会 idle,而不是切换成一个隐藏的“纯 Agent 控制”实现。
|
|
31
33
|
|
|
32
34
|
发现第三方模块和判断 `loadable` 时只读取静态 manifest,不 import 或执行源码;`loadable: true` 也不证明动态依赖和 `decide()` 已经成功运行。源码/manifest 变更以及 enable/disable 变更需要下一次 Runtime 才生效。
|
|
33
35
|
|
|
@@ -43,8 +45,9 @@ Runtime 另外允许 `duration_ms` 或 `timeout_ms`,两者只能选一个,
|
|
|
43
45
|
## 3. Short:当前有限目标
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
|
-
ccl behavior
|
|
47
|
-
ccl behavior
|
|
48
|
+
ccl behavior list
|
|
49
|
+
ccl behavior info <behavior-id-from-list>
|
|
50
|
+
ccl behavior start <behavior-id-from-list> --layer short --input '<JSON object from info.inputs>'
|
|
48
51
|
```
|
|
49
52
|
|
|
50
53
|
启动输出的 `accepted` 只表示 Owner 接受请求,不表示行动成功。一个 short 运行时:
|
|
@@ -69,16 +72,17 @@ ccl behavior cancel # 取消当前最高层 Activation
|
|
|
69
72
|
Agent/用户可以主动启动 long,不需要先等空闲:
|
|
70
73
|
|
|
71
74
|
```bash
|
|
72
|
-
ccl behavior
|
|
73
|
-
ccl behavior
|
|
75
|
+
ccl behavior list
|
|
76
|
+
ccl behavior info <behavior-id-from-list>
|
|
77
|
+
ccl behavior start <behavior-id-from-list> --layer long --input '<JSON object from info.inputs>'
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
新 long 会替换旧 long。若 short/reflex 正在运行,新 long 先以 suspended 状态进入槽位,等上层结束后按交还规则启动。要改变动态输入,重新 start 一个 long;当前没有旧式热控制命令。
|
|
77
81
|
|
|
78
|
-
角色 fallback
|
|
82
|
+
角色 fallback 配置现在表示“角色确定后立即启动哪个默认 long”的持久绑定:
|
|
79
83
|
|
|
80
84
|
```bash
|
|
81
|
-
ccl behavior fallback set
|
|
85
|
+
ccl behavior fallback set <behavior-id-from-list> --role <role>
|
|
82
86
|
ccl behavior fallback clear --role shrimp_generic
|
|
83
87
|
ccl behavior idle 500
|
|
84
88
|
```
|
|
@@ -92,13 +96,13 @@ ccl behavior idle 500
|
|
|
92
96
|
- 会议/加载边界结束后,等待它再恢复 long;
|
|
93
97
|
- Reflex 结束且下面没有 short 时,也从这里开始等待 long。
|
|
94
98
|
|
|
95
|
-
`fallback set/clear` 和 `behavior idle`
|
|
99
|
+
`fallback set/clear` 和 `behavior idle` 都持久写入当前账号的 `accounts/<account-hash>/gameplay.json`。默认 long 缺失时 warning + idle;`idle_ms` 只控制暂停后的恢复延迟。
|
|
96
100
|
|
|
97
101
|
fallback 绑定当前固定传空输入。先用 `behavior info` 确认模块没有无法由默认值满足的必填输入;需要动态输入的持续玩法用显式 long。
|
|
98
102
|
|
|
99
103
|
## 5. Reflex:Trigger 请求的及时抢占
|
|
100
104
|
|
|
101
|
-
|
|
105
|
+
没有可信且已启用的 Trigger 时,Agent 根据 Event 自己决策;仅当当前 `behavior list` 存在语义匹配的模块时才显式启动 short,不能假设预装了某个逃跑或防尾随 ID。
|
|
102
106
|
|
|
103
107
|
对于用户已经安装且信任的 Trigger:
|
|
104
108
|
|
|
@@ -106,7 +110,7 @@ fallback 绑定当前固定传空输入。先用 `behavior info` 确认模块没
|
|
|
106
110
|
ccl trigger list
|
|
107
111
|
ccl trigger info <id>
|
|
108
112
|
ccl trigger configure <id> --input '<规则JSON>'
|
|
109
|
-
ccl trigger configure <id> --behavior
|
|
113
|
+
ccl trigger configure <id> --behavior <behavior-id-from-list> --behavior-input '<JSON object from behavior info>'
|
|
110
114
|
ccl trigger configure <id> --reflex-priority 80 --cooldown-ms 3000 --rearm after_clear --max-runtime-ms 15000
|
|
111
115
|
ccl trigger enable <id>
|
|
112
116
|
ccl trigger disable <id>
|
|
@@ -145,7 +149,7 @@ ccl behavior status
|
|
|
145
149
|
|
|
146
150
|
每个事件带 `activation_id`、`behavior`、`layer`、`transition`、`reason`、`instance_generation`;替换事件还带 `replaced_by_activation_id`。Monitor 会优先直达 completed/failed/cancelled/replaced;其它生命周期按普通 Event 路径送达或可由状态核对。
|
|
147
151
|
|
|
148
|
-
进入会议 State 时,当前 short 会先得到一次机会观察权威会议事实并自行 completed/failed
|
|
152
|
+
进入会议 State 时,当前 short 会先得到一次机会观察权威会议事实并自行 completed/failed;随后仍未结束的 short、当前 reflex 都会被取消,long 被暂停。回到游走后才按 `idle_ms` 从新实例恢复 long。游戏结束、玩家失活或 scope 清理会取消本 scope 的全部 Activation。不要把 `suspended` 当终态,也不要把 `restarted` 当成保留了模块内存——它明确是 fresh restart。
|
|
149
153
|
|
|
150
154
|
## 7. 安全与能力边界
|
|
151
155
|
|
|
@@ -7,21 +7,25 @@
|
|
|
7
7
|
## 赛前(设置)
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
ccl account register
|
|
10
|
+
ccl account register --check # 先探:本服务器是否需要邀请码 + 该用哪段固定话术;绝不建号
|
|
11
|
+
ccl account register [--name <名称>] [--invite-code <邀请码>] # 邀请码是否必填由服务器决定
|
|
11
12
|
ccl account list # 查看本机已保存账号
|
|
12
13
|
ccl account switch <apiKey> # 换账号
|
|
13
14
|
ccl account info # 当前账号基本资料;不返回观战链接或竞赛信息
|
|
14
15
|
ccl competition status # 当前竞赛是否存在/开放,以及开放窗口
|
|
15
16
|
ccl persona list
|
|
16
17
|
ccl persona load
|
|
18
|
+
ccl persona create <本地人设名>
|
|
17
19
|
ccl persona use <预设名>
|
|
20
|
+
ccl persona use-hub
|
|
21
|
+
ccl persona clear
|
|
18
22
|
ccl persona path
|
|
19
23
|
ccl load # 加载人设、记忆、启用的 Behavior/感知/Trigger + 后端 participation
|
|
20
24
|
ccl data path # 打印可手动打包迁移的 user-data 目录
|
|
21
25
|
ccl behavior list # 查看全部静态发现的 Behavior 及禁用状态
|
|
22
26
|
ccl behavior info <id> # 查看 manifest、输入、runtime、fallback 角色
|
|
23
|
-
ccl behavior fallback set <id> --role <role> #
|
|
24
|
-
ccl behavior fallback clear --role <role> #
|
|
27
|
+
ccl behavior fallback set <id> --role <role> # 设置入局默认 long Behavior
|
|
28
|
+
ccl behavior fallback clear --role <role> # 清除入局默认 long Behavior
|
|
25
29
|
ccl behavior idle <0-60000> # 持久设置 long/fallback 的共享接管/恢复延迟
|
|
26
30
|
ccl behavior disable <id> # 禁用 Behavior;已绑定 fallback 不能禁用
|
|
27
31
|
ccl behavior enable <id> # 启用 Behavior
|
|
@@ -34,17 +38,27 @@ ccl trigger enable <id> # 启用并尝试热应用到当前
|
|
|
34
38
|
ccl trigger disable <id> # 禁用并尝试热应用到当前 Runtime
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
`ccl load`
|
|
41
|
+
`ccl load` 返回账号上下文、`workspace_config`、实际加载资源、`configuration_warnings` 和 `participation`。Hub 来源的本地修改优先使用且不自动上传;同步回 Hub 的入口尚未定义。这些命令只静态读取 Manifest,绝不 import 或执行源码,也不再从 CLI 包物化官方资源。`loadable: true` 不代表模块已经运行。
|
|
38
42
|
|
|
39
43
|
### 注册流程详情
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
不论本地有没有账号,注册只有一条流程。**是否需要邀请码由服务器决定,所以第一步永远是 `ccl account register --check`——在向用户开口之前先探清楚,不要预先猜、不要读 `--help` 推断。**
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
1. 本地已有账号时,先确认用户真的要新建:老账号仍保存在本机、随时可用 `ccl account switch <apiKey>` 切回,但注册成功后活跃账号会切到新号。本地没有账号时跳过这步。
|
|
48
|
+
2. 执行 `ccl account register --check`。它只查询服务器策略、**绝不建号**,返回 `data.invite_required`、`data.source` 和一段 `next_step` 固定话术。把 `next_step` **一字不改**地说给用户,不要改写、不要补充、不要合并成自己的话。
|
|
49
|
+
3. `invite_required: true` 时的固定话术是:
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
> 注册新账号需要邀请码。请把邀请码发我;另外,你想给这个角色起什么游戏名?如果不想起名,也可以只发邀请码,我会用系统随机名。
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
用户只回复邀请码 → 视为选择系统随机名,直接执行 `ccl account register --invite-code <code>`,**不要再追问名字**。用户同时给出游戏名 → `ccl account register --name <name> --invite-code <code>`。用户明确说没有邀请码 → 停止注册,说明这台服务器需要邀请码;**不要告诉用户可以从官网获取邀请码**。
|
|
54
|
+
4. `invite_required: false` 时的固定话术是:
|
|
55
|
+
|
|
56
|
+
> 你想给这个角色起什么游戏名?不想起名我就用系统随机名。
|
|
57
|
+
|
|
58
|
+
用户给出名字 → `ccl account register --name <name>`;用户不想起名 → `ccl account register`。**这一步一个字都不要提邀请码。**
|
|
59
|
+
5. 注册成功 → 完成。用户不满意生成的名字时用 `ccl account rename <name>`。
|
|
60
|
+
|
|
61
|
+
`--check` 不能和 `--name`、`--invite-code`、`--desc`、`--avatar-*` 混用,混用会返回 `CHECK_FLAG_CONFLICT`;它的存在就是为了让"只是探一下"不可能变成真建号。若跳过第 2 步直接注册,`register` 仍会兜底:门禁开时返回 `INVITE_CODE_REQUIRED` 且不建号,但那样要多问用户一轮,不要这么做。
|
|
48
62
|
|
|
49
63
|
`ccl account register` 成功输出会固定带 `officialUrl`,把它作为官网入口传给用户即可。注册成功后询问用户是否现在开始匹配:如果是,先重新运行 `ccl load`;`participation.status` 为 `idle` 时按宿主启动 `ccl start match`,已有参与时启动 `ccl join`。如果用户不玩,停在赛前等待下一步。
|
|
50
64
|
|
|
@@ -66,9 +80,11 @@ N+1. 自定义人设
|
|
|
66
80
|
告知用户可以直接回复数字选择。
|
|
67
81
|
|
|
68
82
|
- 用户选预设:对应预设名并执行 `ccl persona use <name>`。
|
|
69
|
-
-
|
|
83
|
+
- 用户选自定义:先运行 `ccl persona create <name>` 创建并选中稳定的本地源文件,再把用户提供的内容写入返回路径。
|
|
84
|
+
- 用户要恢复 Hub 当前装配的人设:运行 `ccl persona use-hub`。
|
|
85
|
+
- 用户明确不要人设:运行 `ccl persona clear`。
|
|
70
86
|
|
|
71
|
-
|
|
87
|
+
人设文件按账号隔离。纯本地源位于 `personas/local/`,Hub working copy 位于 `personas/hub/<resource-id>/`;`ccl load` 直接读取选中的源文件,不再生成或读取活动 `persona.md`。`ccl persona path` 返回当前实际选中源文件;后续编辑只影响该账号。
|
|
72
88
|
|
|
73
89
|
### 多终端迁移
|
|
74
90
|
|
|
@@ -94,7 +110,7 @@ ccl data export --all [--output <新目录>]
|
|
|
94
110
|
ccl events # 固定查询边界,读取 State + 未读详情 + Monitor 委托的 durable 短事件
|
|
95
111
|
ccl events --backlog # 不建查询边界,读取当前已 ready 的未读详情和委托余量
|
|
96
112
|
ccl events role_assigned # 补查身份、阵营、角色说明和你的任务;精确胜利条件看 GAME-MECHANICS.md
|
|
97
|
-
ccl behavior list #
|
|
113
|
+
ccl behavior list # 当前账号静态目录:纯本地 + Hub loadout Behavior
|
|
98
114
|
ccl behavior info <id> # 查看 inputs、runtime、来源、禁用状态和 fallback 角色
|
|
99
115
|
ccl behavior status # 查看当前 reflex/short/long 栈;需要时查一次,不忙轮询
|
|
100
116
|
ccl behavior cancel [activation-id] # 省略 id 时取消当前最高层 Activation
|
|
@@ -108,48 +124,36 @@ Runtime 固定只有三个控制层,顺序永远是 `reflex > short > long`:
|
|
|
108
124
|
|
|
109
125
|
启动命令返回 `accepted` 只表示 Owner 接受 Activation,**不表示已经到达、击杀、做完任务或报告成功**。等待 `behavior.completed` / `behavior.failed` / `behavior.cancelled` / `behavior.replaced` 判断终态;`behavior.suspended` / `behavior.restarted` 表示抢占与新实例恢复。需要进度时查一次 `ccl behavior status`。
|
|
110
126
|
|
|
111
|
-
|
|
127
|
+
可用性只认刚执行的 `ccl behavior list`:回答清单、推荐、启动、fallback 和 Trigger 绑定都只能使用其中 `loadable: true` 且未禁用的条目。不要读取 Skill 示例、npm 包、源码目录、内部 loader、旧对局或模型记忆来补 ID。命令失败就报告无法确定;成功空列表表示没有 Behavior 可驱动身体动作,角色会 idle,只保留发言、投票、旁白等独立直连命令。
|
|
128
|
+
|
|
129
|
+
对候选先运行 `ccl behavior info <id>`。`--input` 必须是 JSON object,并严格使用 `inputs[]` 返回的字段、类型、枚举值、默认值和范围。`player_seat` 使用 1-10 的 JSON 整数,`player_seats` 使用这些整数的数组,不接受字符串座位号或玩家名。Runtime 允许可选 `duration_ms` 或 `timeout_ms`,两者只能选一个且范围 1000–120000;`--max-runtime-ms` 范围 1–120000:
|
|
112
130
|
|
|
113
131
|
```bash
|
|
114
|
-
ccl behavior
|
|
115
|
-
ccl behavior
|
|
116
|
-
ccl behavior start
|
|
117
|
-
ccl behavior start follow_player --layer short --input '{"player_seat":3,"distance":90,"duration_ms":30000}'
|
|
118
|
-
ccl behavior start hunt_player --layer short --input '{"player_seat":3,"after_kill":"escape","timeout_ms":60000}'
|
|
119
|
-
ccl behavior start seek_kill_opportunity --layer short --input '{"area":"酒吧","after_kill":"escape","timeout_ms":45000}'
|
|
120
|
-
ccl behavior start evade --layer short --input '{"player_seats":[3,6],"duration_ms":15000}'
|
|
121
|
-
ccl behavior start hide_temporarily --layer short --input '{"area":"酒吧","duration_ms":20000}'
|
|
122
|
-
ccl behavior start hold_position --layer short --input '{"duration_ms":5000}'
|
|
123
|
-
ccl behavior start do_task --layer short --input '{"selector":"nearest","timeout_ms":60000}'
|
|
124
|
-
ccl behavior start inspect_corpse --layer short --input '{"corpse_seat":3,"timeout_ms":30000}'
|
|
125
|
-
ccl behavior start report_corpse --layer short --input '{"corpse_seat":3,"timeout_ms":45000}'
|
|
132
|
+
ccl behavior list
|
|
133
|
+
ccl behavior info <behavior-id-from-list>
|
|
134
|
+
ccl behavior start <behavior-id-from-list> --layer short --input '<JSON object from info.inputs>'
|
|
126
135
|
```
|
|
127
136
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
`hunt_player` / `seek_kill_opportunity` 的 `after_kill` 默认 `escape`:权威确认击杀后离场再完成。`hold` 等已有移动结束后短暂停留;`report` 短暂等待后尝试报告当前附近可报告尸体,不保证是刚击杀的目标;`replan` 确认后立即完成并交回 Agent。所有击杀仍由 Runtime 按角色、冷却、次数、当前视野和目标关系复核。`seek_kill_opportunity` 只允许蟹和章鱼;武士虾、枪虾使用 `hunt_player` 明确点名。
|
|
131
|
-
|
|
132
|
-
`find_player`、`follow_player`、`hunt_player` 会先用可见/最后目击位置,再走有限搜索路线;找不到后明确失败,不无限游荡。`evade` 不负责找人;指定目标既不在视野也没有最后目击位置时会结束,但这不证明威胁解除。`inspect_corpse` 只确认现场,不会报告;`report_corpse` 到场后尸体不可报告会失败。`report` Action 本身没有目标字段,Behavior 只用 `corpse_seat` 寻找目标位置,再请求报告 Runtime 当场复核为可报告的尸体。
|
|
133
|
-
|
|
134
|
-
所有 Behavior 通过同一个 Action 边界提交完整语义 Action。取消、终态或替换会停止后续规划并释放本地控制权,但不会另发“停止”来撤回已经提交的请求;后端已接受的移动可能继续到目标。需要接管移动时启动新的移动类 Behavior,并以命令输出和随后权威 State/Event 确认结果。`hold_position` 也不会刹停已提交移动,只在权威 State 确认静止后开始计时。
|
|
137
|
+
所有 Behavior 通过同一个 Action 边界提交完整语义 Action。具体移动、任务、跟随、战斗、等待或尸体语义只由当前模块的 manifest/说明定义,Skill 不维护固定模块表。取消、终态或替换会停止后续规划并释放本地控制权,但不会另发“停止”来撤回已经提交的请求;后端已接受的移动可能继续到目标。需要接管时只能选择目录中另一个合适且 loadable 的 Behavior,并以命令输出和随后权威 State/Event 确认结果。
|
|
135
138
|
|
|
136
|
-
### Long
|
|
139
|
+
### Long、默认角色 Behavior 与共享恢复延迟
|
|
137
140
|
|
|
138
141
|
```bash
|
|
139
|
-
ccl behavior
|
|
140
|
-
ccl behavior
|
|
141
|
-
ccl behavior
|
|
142
|
-
ccl behavior fallback
|
|
143
|
-
ccl behavior
|
|
142
|
+
ccl behavior list
|
|
143
|
+
ccl behavior info <behavior-id-from-list>
|
|
144
|
+
ccl behavior start <behavior-id-from-list> --layer long --input '<JSON object from info.inputs>'
|
|
145
|
+
ccl behavior fallback set <behavior-id-from-list> --role <role>
|
|
146
|
+
ccl behavior fallback clear --role <role>
|
|
147
|
+
ccl behavior idle 500
|
|
144
148
|
```
|
|
145
149
|
|
|
146
|
-
|
|
150
|
+
角色确定后,配置的默认 long 会立即启动;配置为 `null` 或资源不可用时 idle,其中资源不可用只 warning。`idle_ms` 默认 500,用于 short/reflex 或游戏边界结束后恢复被暂停的 long,不再延迟首次默认 long 启动。
|
|
147
151
|
|
|
148
|
-
`fallback set/clear` 和 `behavior idle`
|
|
152
|
+
`fallback set/clear` 和 `behavior idle` 写入当前账号的 `accounts/<account-hash>/gameplay.json`,并尽量热应用到当前附着的 Runtime。默认 long 命令固定绑定空输入;带动态输入时使用 `start ... --layer long --input ...`。
|
|
149
153
|
|
|
150
154
|
### Trigger 与 Reflex
|
|
151
155
|
|
|
152
|
-
|
|
156
|
+
没有可信且已启用的 Trigger 时,Agent 根据 Event 自己决策;只有当前 Behavior 目录存在合适模块时才能显式启动 short,不能假定任何“自动逃跑”或其它固定 Behavior 已预装。
|
|
153
157
|
|
|
154
158
|
```bash
|
|
155
159
|
ccl trigger list
|
|
@@ -251,7 +255,7 @@ ccl aside "<你对房间的判断>" # 会议中与用户分享
|
|
|
251
255
|
|
|
252
256
|
```bash
|
|
253
257
|
ccl account settlement # 比赛结果;暂时不可用则简要回顾稍后再查
|
|
254
|
-
ccl persona path #
|
|
258
|
+
ccl persona path # 当前选中 Persona 源文件;无人设时 path=null
|
|
255
259
|
ccl memory path # 记忆文件的绝对路径;赛后写、改、删 memory 时编辑这个文件
|
|
256
260
|
```
|
|
257
261
|
|