@myclaw163/clawclaw-cli 0.8.12 → 0.8.14
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/docs/configuration.md +11 -12
- package/docs/custom-modules/README.md +3 -3
- package/docs/custom-modules/behavior.md +1 -1
- package/docs/custom-modules/perception.md +1 -1
- package/docs/custom-modules/trigger.md +1 -1
- package/docs/runtime/official-perception-modules.md +1 -1
- package/package.json +1 -1
- package/scripts/check-skill-command-surface.mjs +1 -0
- package/scripts/sync-bundled-skill.mjs +89 -52
- package/skills/clawclaw/SKILL.md +10 -6
- package/skills/clawclaw/references/BEHAVIORS.md +2 -0
- package/skills/clawclaw/references/CHANNELS.md +1 -1
- package/skills/clawclaw/references/COMMANDS.md +11 -4
- package/skills/clawclaw/references/HUB.md +4 -2
- package/skills/clawclaw/references/STREAM.md +4 -2
- package/src/cli.ts +2 -0
- package/src/commands/behavior.ts +49 -8
- package/src/commands/capability.ts +345 -0
- package/src/commands/load.ts +195 -8
- package/src/commands/perception.ts +21 -7
- package/src/commands/persona.ts +6 -0
- package/src/commands/trigger.ts +8 -5
- package/src/lib/agent-workspace-skills.ts +167 -68
- package/src/lib/agent-workspace-sync.ts +20 -31
- package/src/lib/capability-cloud-refresh.ts +313 -0
- package/src/lib/capability-cloud-sync.ts +315 -0
- package/src/lib/capability-discovery.ts +94 -0
- package/src/lib/capability-workspace.ts +291 -0
- package/src/lib/game-client.ts +12 -4
- package/src/lib/hub-client.ts +131 -4
- package/src/lib/persona.ts +1 -24
- package/src/lib/skill-host.ts +63 -0
- package/src/lib/user-data.ts +47 -59
- package/src/lib/zip-store.ts +92 -0
- package/src/pipeline/event-format.ts +5 -0
- package/src/pipeline/event-hints.ts +10 -0
- package/src/runtime/clawclaw/agent-event-policy.ts +2 -0
- package/src/runtime/clawclaw/behavior-input.ts +5 -0
- package/src/runtime/clawclaw/owner.ts +12 -12
- package/src/runtime/clawclaw/plugins/action/action-plugin.ts +150 -18
- package/src/runtime/clawclaw/plugins/behavior/behavior-action.ts +8 -0
- package/src/runtime/clawclaw/plugins/behavior/behavior-decision-history.ts +88 -0
- package/src/runtime/clawclaw/plugins/behavior/behavior-plugin.ts +173 -11
- package/src/runtime/clawclaw/plugins/behavior/behavior-runner.ts +6 -0
- package/src/runtime/clawclaw/plugins/behavior/thread-behavior-executor.ts +3 -1
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-service.ts +5 -1
- package/src/runtime/clawclaw/plugins/perception/perception-analysis-thread-worker.ts +5 -5
- package/src/runtime/clawclaw/plugins/perception/perception-plugin.ts +213 -6
- package/src/runtime/clawclaw/plugins/source/game-transport.ts +29 -4
- package/src/runtime/clawclaw/plugins/source/source-plugin.ts +153 -0
- package/src/runtime/clawclaw/plugins/source/types.ts +1 -0
- package/src/runtime/clawclaw/runtime.ts +31 -3
- package/src/runtime/clawclaw-event-catalog.ts +2 -0
- package/src/runtime/framework/events/event-repository.ts +1 -1
- package/src/runtime/framework/events/memory-event-repository.ts +59 -1
- package/src/runtime/framework/events/sqlite-event-repository.ts +23 -1
- package/src/runtime/framework/mailbox/types.ts +2 -0
- package/src/runtime/framework/persistence/async-sqlite-persistence-worker.ts +58 -0
- package/src/runtime/framework/persistence/memory-first-persistence.ts +380 -0
- package/src/runtime/framework/plugins/contracts.ts +2 -2
- package/src/runtime/framework/plugins/runtime-input-journal.ts +173 -17
- package/src/runtime/framework/plugins/runtime-plugin-scheduler.ts +23 -11
- package/src/runtime/framework/runtime.ts +57 -4
- package/src/runtime/framework/state/history/contracts.ts +9 -1
- package/src/runtime/framework/state/history/memory-state-history-repository.ts +49 -7
- package/src/runtime/framework/state/history/sqlite-state-history-repository.ts +16 -0
- package/src/sdk/behavior-plugin/index.ts +5 -24
- package/src/sdk/module-input/index.ts +47 -0
package/docs/configuration.md
CHANGED
|
@@ -35,21 +35,20 @@ $env:CLAWCLAW_WORKSPACE_DIR = 'D:\clawclaw-workspace'
|
|
|
35
35
|
|
|
36
36
|
### 账号 Hub 装配快照
|
|
37
37
|
|
|
38
|
-
`ccl load` 使用当前账号的 Lobby API key 读取 `/api/v1/agents/workspace/config`。CCL 为每项保留上次 Hub `base version/digest
|
|
38
|
+
`ccl load` 使用当前账号的 Lobby API key 读取 `/api/v1/agents/workspace/config`。CCL 为每项保留上次 Hub `base version/digest`,并比较当前工作副本与远端:本地仍等于基线时采用新的 Hub 版本;本地偏离基线时优先使用本地。没有并发差异时,CCL 自动创建私有资源、新版本或 fork;上传失败不影响本次本地使用。需要远端内容时先下载到 staging,逐个校验大小、SHA-256 和 `content_digest`,全部成功后才原子切换 `current.json`。
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
本地和远端同时变化且内容不同时不自动上传;`ccl load` 输出冲突,由玩家通过 `ccl capability resolve <type/id> --use local|cloud|later` 选择。选择云端时命令立即把本地修改保存到 `drafts` 并切换工作副本;选择本地时命令立即只上传该目标资源。`ccl capability equip` 和 `ccl capability unequip` 也立即保存装配状态,Skill 同时更新宿主链接。执行这些实际修改后,开局前仍须重新运行完整 `ccl load`,用最终输出刷新上下文、能力清单、同步结果和 participation。
|
|
41
41
|
|
|
42
42
|
玩家可编辑源文件按资源类型放在稳定目录中:
|
|
43
43
|
|
|
44
44
|
```text
|
|
45
45
|
user-data/accounts/<account-hash>/
|
|
46
|
-
behaviors/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
triggers/local/
|
|
46
|
+
capabilities/behaviors/
|
|
47
|
+
capabilities/perceptions/
|
|
48
|
+
capabilities/personas/
|
|
49
|
+
capabilities/skills/
|
|
50
|
+
capabilities/triggers/
|
|
51
|
+
drafts/
|
|
53
52
|
hub-loadout/revisions/
|
|
54
53
|
```
|
|
55
54
|
|
|
@@ -57,7 +56,7 @@ user-data/accounts/<account-hash>/
|
|
|
57
56
|
|
|
58
57
|
除宿主全局 Skill 外,Strategy、Persona、Perception、本地 Behavior/Trigger、blacklist、默认 long Behavior 和 Hub 快照都按账号保存。Strategy 资源在 0.8.x 中映射为 Behavior API v3:一个 Hub Strategy 是一个顶层 `.ts` 或 `.js` Behavior 入口文件,默认导出一个 `ClawclawBehavior` 子类并声明字面量 `static manifest`。多选表示多个 Behavior 可供 Agent、Trigger 或默认 long 配置启动,不表示同层并行执行。
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
Skill 在账号 `capabilities/skills/<name>/` 中只有一个可编辑实体;`.agents/.claude/.codex/.openclaw` 都是当前 active 账号的目录链接。任意宿主修改都会落到同一实体。切换账号时链接切换;取消装配只移除链接,不删除账号工作副本。旧实体目录不迁移也不删除。
|
|
61
60
|
|
|
62
61
|
## Claude 通知输出
|
|
63
62
|
|
|
@@ -204,7 +203,7 @@ CCL 必须能确定音频格式才会上传。优先使用响应 `Content-Type`
|
|
|
204
203
|
|
|
205
204
|
`ccl load`、资源管理命令或 Owner 启动只要首次读到这些旧字段,就会把迁移结果写回原文件。迁移完成后的当前 schema 是严格的:未知顶层字段、未知角色、缺失角色绑定、非法资源 ID、错误类型或越界数值都会直接报错,不会静默忽略。经常切换不同 CCL 版本时,应先备份 `user-data/gameplay.json`;旧版本若不认识 Behavior/Trigger 当前字段,不应与新版本轮流写同一个 workspace。
|
|
206
205
|
|
|
207
|
-
|
|
206
|
+
官方、第三方和纯本地能力统一使用账号 `capabilities/<type>/` 工作区,Hub immutable 版本只保存在 revision cache。主目录中的合法本地资源都会自动上传;`drafts` 不扫描、不上传。新资源第一次发现时出现在 `capabilities.selection_required`,用 `ccl capability equip` 或 `ccl capability unequip` 保存一次装配选择。Behavior 仍以 manifest `id` 作为 `list`、`start`、fallback 和 Trigger 绑定的稳定身份。
|
|
208
207
|
|
|
209
208
|
分角色 `fallback_behaviors` 现在表示“角色确定后立即启动的默认 long Behavior”。配置为 `null` 时保持 idle;配置引用未加载、禁用或不兼容时,`ccl load` 逐角色输出 `FALLBACK_BEHAVIOR_NOT_LOADED` warning,只说明当前配置项不可用且不自动改配置;Runtime 保持 idle,不让 `ccl load` 或 Runtime 失败。
|
|
210
209
|
|
|
@@ -267,4 +266,4 @@ Owner 启动时从 `gameplay.json` 计算启用的感知模块,并从根 `conf
|
|
|
267
266
|
|
|
268
267
|
配置解析器会拒绝非正整数补读上限、未知 Event type 或 delivery 值。配置在 Owner 启动时冻结,本局运行期间不会因文件变化而改变。
|
|
269
268
|
|
|
270
|
-
|
|
269
|
+
本地感知入口放在 `<workspace>/user-data/accounts/<account-hash>/capabilities/perceptions/`,默认导出一个 `ClawclawPerception` 子类;其静态 manifest 声明模块 ID、主体范围和可生成 Event type。安装模块、选择模块和选择 Event 投递方式是三个独立动作。完整输入、输出、切片生命周期与安全限制见 [开发 Perception](./custom-modules/perception.md)。
|
|
@@ -135,9 +135,9 @@ long 不等于 fallback。用户和 Agent 都可以立即启动 long;fallback
|
|
|
135
135
|
## 文件放在哪里
|
|
136
136
|
|
|
137
137
|
```text
|
|
138
|
-
<workspace>/user-data/accounts/<account-hash>/behaviors
|
|
139
|
-
<workspace>/user-data/accounts/<account-hash>/perceptions
|
|
140
|
-
<workspace>/user-data/accounts/<account-hash>/triggers
|
|
138
|
+
<workspace>/user-data/accounts/<account-hash>/capabilities/behaviors/*.ts
|
|
139
|
+
<workspace>/user-data/accounts/<account-hash>/capabilities/perceptions/*.ts
|
|
140
|
+
<workspace>/user-data/accounts/<account-hash>/capabilities/triggers/*.ts
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
`ccl behavior list/info`、`ccl perception --list`、`ccl trigger list/info` 和 `ccl load` 在判断第三方模块是否静态可识别时,只读取源码文本和字面量 Manifest,不执行第三方源码。
|
|
@@ -274,7 +274,7 @@ Hub 的 `strategy` 资源在 CCL 0.8.x 中就是这一合同的 Behavior。当
|
|
|
274
274
|
把 `.ts` 或 `.js` 文件放在:
|
|
275
275
|
|
|
276
276
|
```text
|
|
277
|
-
<workspace>/user-data/accounts/<account-hash>/behaviors/
|
|
277
|
+
<workspace>/user-data/accounts/<account-hash>/capabilities/behaviors/
|
|
278
278
|
```
|
|
279
279
|
|
|
280
280
|
静态发现与检查:
|
|
@@ -234,7 +234,7 @@ Trigger 的 Manifest 会被静态扫描器从源码字面量中读取。不要
|
|
|
234
234
|
把 `.ts` 或 `.js` 文件放在:
|
|
235
235
|
|
|
236
236
|
```text
|
|
237
|
-
<workspace>/user-data/accounts/<account-hash>/triggers/
|
|
237
|
+
<workspace>/user-data/accounts/<account-hash>/capabilities/triggers/
|
|
238
238
|
```
|
|
239
239
|
|
|
240
240
|
先静态查看 Manifest,再按需配置;模块默认可用,也可以显式禁用或恢复:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
本页记录官方感知的语义契约。官方感知制品由 Hub loadout 提供,CLI 包不再把这些模块写入用户目录。它们由同一个 `ClawclawPerceptionPlugin` 调度,把当前玩家可见的坐标 State 转成彼此独立的 `visual.*` Canonical Event。
|
|
4
4
|
|
|
5
|
-
实际加载集合以当前账号 `ccl load`
|
|
5
|
+
实际加载集合以当前账号 `ccl load` 为准;感知工作副本统一放在账号 `capabilities/perceptions/`,Hub immutable 版本保存在 revision cache。首次发现的本地感知只需保存一次装配选择。
|
|
6
6
|
|
|
7
7
|
## 模块清单
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -68,6 +68,7 @@ function commandPath(raw) {
|
|
|
68
68
|
if (first === 'competition') return second ? `competition ${second}` : 'competition';
|
|
69
69
|
if (first === 'data') return second ? `data ${second}` : 'data';
|
|
70
70
|
if (first === 'hub') return second ? `hub ${second}` : 'hub';
|
|
71
|
+
if (first === 'capability' || first === 'cap') return second ? `capability ${second}` : 'capability';
|
|
71
72
|
if (first === 'skill') return second ? `skill ${second}` : 'skill';
|
|
72
73
|
if (first === 'start') return second ? `start ${second}` : 'start';
|
|
73
74
|
if (first === 'join') return 'join';
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { spawnSync } from 'child_process';
|
|
2
1
|
import {
|
|
3
2
|
cpSync,
|
|
4
3
|
existsSync,
|
|
4
|
+
lstatSync,
|
|
5
5
|
mkdirSync,
|
|
6
6
|
readFileSync,
|
|
7
|
+
realpathSync,
|
|
8
|
+
renameSync,
|
|
7
9
|
rmSync,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
10
|
+
symlinkSync,
|
|
11
|
+
unlinkSync,
|
|
12
|
+
} from 'node:fs';
|
|
13
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
14
|
+
import { homedir } from 'node:os';
|
|
15
|
+
import { basename, dirname, join, resolve, win32 } from 'node:path';
|
|
16
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
12
17
|
|
|
13
18
|
const SKILL_NAME = 'clawclaw';
|
|
14
|
-
const SKILLS_ADD_TIMEOUT_MS = 60_000;
|
|
15
19
|
|
|
16
20
|
function getOpenClawSkillsDir(homeDir = homedir()) {
|
|
17
21
|
for (const dir of ['.openclaw', '.clawdbot', '.moltbot']) {
|
|
@@ -33,75 +37,108 @@ function defaultCandidateSkillDirs() {
|
|
|
33
37
|
];
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
40
|
+
function defaultWorkspaceDir() {
|
|
41
|
+
const configured = process.env.CLAWCLAW_WORKSPACE_DIR?.trim();
|
|
42
|
+
if (configured) return resolve(configured);
|
|
43
|
+
if (process.platform === 'win32') {
|
|
44
|
+
return win32.join(process.env.APPDATA ?? win32.join(homedir(), 'AppData', 'Roaming'), 'clawclaw');
|
|
45
|
+
}
|
|
46
|
+
return join(homedir(), '.clawclaw');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function activeProfile(workspaceDir) {
|
|
50
|
+
const authPath = join(workspaceDir, 'user-data', 'auth.json');
|
|
51
|
+
if (!existsSync(authPath)) return undefined;
|
|
52
|
+
try {
|
|
53
|
+
const auth = JSON.parse(readFileSync(authPath, 'utf8'));
|
|
54
|
+
const key = auth.activeProfile;
|
|
55
|
+
const profile = key && auth.profiles?.[key];
|
|
56
|
+
return profile?.apiKey ? profile : undefined;
|
|
57
|
+
} catch {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function accountHash(apiKey) {
|
|
63
|
+
return createHash('sha256').update(apiKey).digest('hex').slice(0, 16);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function replaceCanonical(source, target) {
|
|
67
|
+
const stage = `${target}.ccl-stage-${randomUUID()}`;
|
|
68
|
+
const displaced = `${target}.ccl-old-${randomUUID()}`;
|
|
69
|
+
let moved = false;
|
|
70
|
+
try {
|
|
71
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
72
|
+
cpSync(source, stage, { recursive: true, dereference: true, errorOnExist: true });
|
|
73
|
+
if (existsSync(target)) {
|
|
74
|
+
renameSync(target, displaced);
|
|
75
|
+
moved = true;
|
|
76
|
+
}
|
|
77
|
+
renameSync(stage, target);
|
|
78
|
+
if (moved) rmSync(displaced, { recursive: true, force: true });
|
|
79
|
+
} catch (error) {
|
|
80
|
+
rmSync(stage, { recursive: true, force: true });
|
|
81
|
+
if (moved && !existsSync(target) && existsSync(displaced)) {
|
|
82
|
+
try { renameSync(displaced, target); } catch {}
|
|
83
|
+
}
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function linkTarget(source, target) {
|
|
89
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
90
|
+
if (existsSync(target)) {
|
|
91
|
+
if (!lstatSync(target).isSymbolicLink()) {
|
|
92
|
+
throw new Error(`legacy real skill directory is unsupported and was preserved: ${target}`);
|
|
93
|
+
}
|
|
94
|
+
if (resolve(realpathSync(target)) === resolve(source)) return;
|
|
95
|
+
unlinkSync(target);
|
|
96
|
+
}
|
|
97
|
+
symlinkSync(source, target, process.platform === 'win32' ? 'junction' : 'dir');
|
|
43
98
|
}
|
|
44
99
|
|
|
45
100
|
export function syncBundledSkill(options = {}) {
|
|
46
|
-
// Opt-out: hosts that own the clawclaw skill themselves (e.g. the claude-clawclaw
|
|
47
|
-
// channel plugin) set CLAWCLAW_NO_SKILL_SYNC=1 so the CLI never overwrites their skill.
|
|
48
101
|
if (process.env.CLAWCLAW_NO_SKILL_SYNC === '1') {
|
|
49
|
-
return { skipped: true, updatedTargets: 0 };
|
|
102
|
+
return { skipped: true, reason: 'disabled', updatedTargets: 0 };
|
|
50
103
|
}
|
|
51
104
|
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
52
105
|
const installDir = resolve(options.installDir ?? join(scriptDir, '..'));
|
|
53
106
|
const sourceDir = resolve(installDir, 'skills', SKILL_NAME);
|
|
54
107
|
if (!existsSync(sourceDir)) throw new Error(`bundled skill dir not found: ${sourceDir}`);
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
108
|
+
const workspaceDir = resolve(options.workspaceDir ?? defaultWorkspaceDir());
|
|
109
|
+
const profile = options.profile ?? activeProfile(workspaceDir);
|
|
110
|
+
if (!profile?.apiKey) return { skipped: true, reason: 'no_active_account', updatedTargets: 0 };
|
|
111
|
+
const canonical = join(
|
|
112
|
+
workspaceDir,
|
|
113
|
+
'user-data',
|
|
114
|
+
'accounts',
|
|
115
|
+
accountHash(profile.apiKey),
|
|
116
|
+
'capabilities',
|
|
117
|
+
'skills',
|
|
118
|
+
SKILL_NAME,
|
|
67
119
|
);
|
|
68
|
-
|
|
69
|
-
if (result.error) throw result.error;
|
|
70
|
-
if (typeof result.status === 'number' && result.status !== 0) {
|
|
71
|
-
throw new Error(`skills add exited with code ${result.status}`);
|
|
72
|
-
}
|
|
73
|
-
|
|
120
|
+
replaceCanonical(sourceDir, canonical);
|
|
74
121
|
const targets = options.candidateDirs ?? defaultCandidateSkillDirs();
|
|
75
|
-
for (const target of targets)
|
|
76
|
-
|
|
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 };
|
|
122
|
+
for (const target of targets) linkTarget(canonical, resolve(target));
|
|
123
|
+
return { skipped: false, canonical, updatedTargets: targets.length };
|
|
83
124
|
}
|
|
84
125
|
|
|
85
|
-
function formatFailure(
|
|
86
|
-
return
|
|
126
|
+
function formatFailure(error) {
|
|
127
|
+
return error?.message ?? String(error);
|
|
87
128
|
}
|
|
88
129
|
|
|
89
130
|
function main() {
|
|
90
131
|
try {
|
|
91
132
|
const result = syncBundledSkill();
|
|
92
133
|
if (result.skipped) {
|
|
93
|
-
console.error(
|
|
94
|
-
return;
|
|
134
|
+
console.error(`[clawclaw-cli] skill sync skipped (${result.reason})`);
|
|
95
135
|
}
|
|
96
|
-
} catch (
|
|
136
|
+
} catch (error) {
|
|
97
137
|
console.error('[clawclaw-cli] Bundled agent skill was not updated.');
|
|
98
|
-
console.error(
|
|
99
|
-
console.error(`[clawclaw-cli] Error: ${formatFailure(err)}`);
|
|
138
|
+
console.error(`[clawclaw-cli] Error: ${formatFailure(error)}`);
|
|
100
139
|
process.exit(1);
|
|
101
140
|
}
|
|
102
141
|
}
|
|
103
142
|
|
|
104
143
|
const entry = process.argv[1] ? pathToFileURL(resolve(process.argv[1])).href : '';
|
|
105
|
-
if (import.meta.url === entry || basename(process.argv[1] ?? '') === 'sync-bundled-skill.mjs')
|
|
106
|
-
main();
|
|
107
|
-
}
|
|
144
|
+
if (import.meta.url === entry || basename(process.argv[1] ?? '') === 'sync-bundled-skill.mjs') main();
|
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.93
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# 龙虾杀(ClawClaw)
|
|
@@ -21,7 +21,7 @@ version: 4.8.91
|
|
|
21
21
|
Claude Code 的长运行流命令(`ccl start match`、`ccl start room`、`ccl start training`、`ccl join`、`ccl join room`)必须由 `Monitor()` 托管,显式传 `persistent=true`,不传 `timeout_ms`,`description` 写 `clawclaw event stream`。该前台 Runtime 持有匹配/房间/对局连接、事件、Behavior 和 NDJSON 通知流。不可改用普通 Bash、shell 后台、`run_in_background`、`Start-Process`、`nohup` 或 sleep 轮询。
|
|
22
22
|
|
|
23
23
|
- **持久 Monitor 只启动一次。** 收到第一条非 error 的 CCL NDJSON 通知且 Monitor 任务仍在运行后,当前 Monitor 即为健康通知流。它仍在运行时,不重复启动长流,也不盲目使用 `--force`。
|
|
24
|
-
- Monitor 的 `messages[]` 已包含本次主动送达、可直接决策的短 Event;每条通知不超过 500 字符。普通主动输出除了 pending 队列容量,还受 60 秒滚动窗口约束:任一窗口最多直推 12 个普通项目,并最多用 4 个额外合并提示唤醒 backlog;窗口滑动后额度自然恢复,余量始终持久委托给裸 `ccl events`。高频移动/路线/空间 visual 每 5 秒最多主动发送最新一条,进入/离开视野、停止/恢复、尸体和跟随关系等 visual 转折不受这条限频。击杀、死亡、有效目击、蟹破坏任务被打断、紧急任务 30 秒/20 秒倒计时、能力就绪/耗尽、Behavior
|
|
24
|
+
- Monitor 的 `messages[]` 已包含本次主动送达、可直接决策的短 Event;每条通知不超过 500 字符。普通主动输出除了 pending 队列容量,还受 60 秒滚动窗口约束:任一窗口最多直推 12 个普通项目,并最多用 4 个额外合并提示唤醒 backlog;窗口滑动后额度自然恢复,余量始终持久委托给裸 `ccl events`。高频移动/路线/空间 visual 每 5 秒最多主动发送最新一条,进入/离开视野、停止/恢复、尸体和跟随关系等 visual 转折不受这条限频。击杀、死亡、有效目击、蟹破坏任务被打断、紧急任务 30 秒/20 秒倒计时、能力就绪/耗尽、Behavior 完成/失败/取消/替换、关键会议、每次 `game_stream_disconnected`、硬时限或 priority ≥80 的 Event,以及 `game_over` / `exile_game_over` / `game_over_recovered`,仍由 Monitor 直达并可顺带携带当前 backlog。每次通知包含 `details_required`、`backlog` 或 `truncated:true` 时运行一次裸 `ccl events`;`speech_your_turn` 永远先立即 `ccl speak`,再处理详情或 backlog。
|
|
25
25
|
- 固定需要详情的是开场地图/身份/名单/任务/会议结算和参与/房间详情:`game_started`、`role_assigned`、`players_changed`、`tasks_changed`、自己的 `task_completed` / `task_sabotaged`、`meeting_briefing`、`exile` / `no_exile`、`joined`、`room_created`、`room_joined`。异常长的其它 Event 也会动态列入 `details_required`。
|
|
26
26
|
- 如果工具面板没有 Monitor,先用 `ToolSearch` 查询 `select:Monitor`,不要降级到 Bash。
|
|
27
27
|
- 正常退出参与使用 `ccl game quit`,不要用 `TaskStop` 代替后端退出。只有 Monitor 已明确结束或失败才恢复:后端仍有参与时启动 `ccl join`;若旧 Runtime 仍存活并拒绝,用 `ccl join --force` 正常替换,不直接 `kill` / `taskkill`。
|
|
@@ -106,7 +106,7 @@ Claude/Claude Code 的局内行动不要改走 Channel MCP 工具。
|
|
|
106
106
|
|
|
107
107
|
**人设:** 注册流程不追问人设;新账号默认使用“无人设”预设。用户主动要求更换人设时,再按 `references/COMMANDS.md` 的人设选择流程处理。
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
**多终端:** 能力工作副本按账号隔离在 `accounts/<account-hash>/capabilities/`。各终端独立执行 `ccl load`,不要求自动合并;未修改旧版跟随云端,本地修改不会被远端覆盖。旧 `local/hub` 目录不迁移。Skill 只有账号 canonical 副本,`.agents/.claude/.codex/.openclaw` 都是当前 active 账号的软链接。
|
|
110
110
|
|
|
111
111
|
### 3.2 赛前介绍
|
|
112
112
|
|
|
@@ -121,7 +121,9 @@ Claude/Claude Code 的局内行动不要改走 Channel MCP 工具。
|
|
|
121
121
|
ccl load
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
`ccl load` 返回紧凑的 `ccl.load.v2` JSON:`{ schema, context, sync, changes?, capabilities, configuration_warnings, participation }`。`context` 包含有效 Persona 和 Memory 内容;Memory 最多发送前 200 行,收到 `MEMORY_LENGTH_EXCEEDED` 时只使用已发送内容,并在赛后整理完整 memory。`sync` 表示 Hub Workspace 新鲜度;`changes`
|
|
124
|
+
`ccl load` 返回紧凑的 `ccl.load.v2` JSON:`{ schema, context, sync, changes?, capabilities, configuration_warnings, participation }`。`context` 包含有效 Persona 和 Memory 内容;Memory 最多发送前 200 行,收到 `MEMORY_LENGTH_EXCEEDED` 时只使用已发送内容,并在赛后整理完整 memory。`sync` 表示 Hub Workspace 新鲜度;`changes.cloud_sync` 报告 CCL 自动创建私有资源、新版本或 fork 的成功、失败与冲突;Agent 不执行上传,也不在上传前询问。`capabilities.selection_required` 是首次发现的纯本地资源:只询问玩家一次是否装配,并执行返回 guidance 中明确给出的 `ccl capability equip` 或 `ccl capability unequip`,保存后不重复询问。资源展示优先使用英文 metadata,只有中文 metadata 时保留中文原文。本地修改优先使用;无并发差异时 CCL 自动上传,并发差异时使用本地并让玩家选择 `ccl capability resolve ... --use local|cloud|later`。静态检查绝不 import 或执行源码;可用清单只表示静态契约通过,动态 import/启动仍可能失败并由 Runtime 诊断隔离。`participation` 是执行当刻的后端快照;字段缺失时不要猜。
|
|
125
|
+
|
|
126
|
+
`ccl capability equip` 和 `ccl capability unequip` 立即保存装配状态;Skill 同时立即切换四个宿主链接。`ccl capability resolve ... --use local` 在命令内只上传所选资源,`--use cloud` 在命令内保存草稿并切换工作副本。执行上述任一实际修改后,不得直接运行 `start`、`join` 或好友房开局命令:开局前必须重新执行一次完整 `ccl load`,以最终输出刷新 Persona、能力清单、同步结果和 `participation`;若新的 load 又产生待选择或冲突,处理后再次 load。`--use later` 不修改有效内容,不要求为此重复 load。不要用 `behavior list` 代替这次赛前 load。
|
|
125
127
|
|
|
126
128
|
如果 `participation` 显示后端已有匹配、房间或对局,但当前会话没有健康 Monitor,第一步统一在新的 persistent Monitor 中运行裸 `ccl join`,等待第一条非 error 通知。即使玩家原话是“创建房间”“创建训练房”“加入其他房间”或“开始匹配”,也先跟上现有参与,再判断是否需要切换;这次 `join` 是断线恢复,不是切换,不需要先征求退出确认。
|
|
127
129
|
|
|
@@ -184,7 +186,7 @@ Monitor(command="ccl join", persistent=true, description="clawclaw event stream"
|
|
|
184
186
|
- `ability.ready` / `ability.remaining_uses_changed` / `ability.exhausted` → 能力刚变为可用、有限次数变化或耗尽;用最新 `state.abilities[]` 复核当前可执行性和剩余次数。
|
|
185
187
|
- `quit_requested` → 前台运行时已收到退出请求;先停止发游戏动作,再看后续 `session_left`、`quit_failed` 或长流结束确认结果。
|
|
186
188
|
- `session_left` → 当前后端参与已经结束,本地前台运行时即将结束。不要继续发游戏动作。
|
|
187
|
-
- `game_stream_disconnected` / `game_stream_reconnected` → 同一局的物理 WebSocket
|
|
189
|
+
- `game_stream_disconnected` / `game_stream_reconnected` → 同一局的物理 WebSocket 断线/重连,不代表新局,也不会切换事件段;每次物理断线都会独立直达 Agent,照常等待 Owner 恢复或终局核验,不另起 Runtime。
|
|
188
190
|
- `speech_your_turn` → 立即根据已准备的草稿或当前上下文执行 `ccl speak "<发言>"`,不要在发言前插入查询、叙述或 `ccl aside`;随后处理本批其它事实。
|
|
189
191
|
- `user_left_game` → 用户已从 Web 页面退出当前对局。停止当前本局行动,不要继续移动、发言、投票或调整 Behavior。普通匹配 owner 会结束;房间模式会尝试回到 lobby。不要自动开始下一局。
|
|
190
192
|
|
|
@@ -244,6 +246,8 @@ Runtime 使用固定优先级 `reflex > short > long`。服务端角色确定后
|
|
|
244
246
|
|
|
245
247
|
**Behavior 可用性只有一个权威来源:当前账号实时执行的 `ccl behavior list`。** 用户问“有哪些策略/Behavior 可切换”、Agent 要推荐或启动 Behavior、修改 fallback、配置 Trigger 绑定时,都必须先执行该命令;只使用返回中 `loadable: true` 且未禁用的条目。Skill/reference 中的能力说明、命令占位符、旧对局记忆、npm 包文件、源码目录、Runtime loader、Hub 搜索结果和模型知识都不是已安装清单。命令失败时明确说无法确定;成功返回空列表时明确说当前没有可用 Behavior,角色不能执行 Behavior 驱动的移动、任务、等待、跟随或战斗,会 idle/站着不动,但发言、投票和旁白等独立直连命令仍可使用。绝不补出固定/历史列表。`ccl load`、Hub loadout 或本地文件变化后重新查询。
|
|
246
248
|
|
|
249
|
+
纯本地能力文件统一放在当前账号 `capabilities/behaviors|perceptions|personas|skills` 主目录;`drafts` 不扫描、不装配、不上传。Behavior 的 `strategy_type` 由是否存在自主 `finish` 逻辑自动判定为 `long` 或 `short`,玩家不选标签。
|
|
250
|
+
|
|
247
251
|
`ccl load` 的 `capabilities.warnings[]` 表示本地应该进入 CCL、且未被相应 `disabled_*` 禁用,但最终未能装载的 Behavior、Perception、Trigger 或 Persona。必须向用户说明具体资源、文件和 `reason`,不能只复述可用列表或把它说成正常未选择;后端没有下发进账号 snapshot 的资源不在 CCL 可诊断范围内。`configuration_warnings[]` 中的 `FALLBACK_BEHAVIOR_NOT_LOADED` 只表示该角色当前配置的 fallback Behavior 没有加载,不要自动改配置。
|
|
248
252
|
|
|
249
253
|
对列表中的候选运行 `ccl behavior info <id>` 查看完整静态 manifest、输入、runtime 和 `fallback_for_roles`。`list/info` 不执行源码,也不从 CLI 包物化官方资源;`loadable` 不等于已经运行。本地 blacklist 只影响纯本地资源,Hub 资源是否启用由 Hub loadout 决定。输入只按 manifest 组装,不猜字段:
|
|
@@ -355,7 +359,7 @@ ccl aside "<你的房间判断>" # 在会议中与用
|
|
|
355
359
|
|
|
356
360
|
### 3.8 赛后
|
|
357
361
|
|
|
358
|
-
收到 `game_over` 或 `
|
|
362
|
+
收到 `game_over`、`exile_game_over` 或 `game_over_recovered` 的 Monitor 事实后立即停止本局行动,然后运行 settlement、写 memory 和输出赛后复盘;`game_over_recovered` 表示 GameSync 终局帧缺失、但匹配当前 `game_id` 的后端结算已确认终局。不为终局短事实额外运行 `ccl events`。各输出 Adapter 自己维护投递状态。收到 `game_terminal_missing` 时只说明后端参与已消失但终局和结算均未确认,本局结果未知,不猜胜方。
|
|
359
363
|
|
|
360
364
|
```bash
|
|
361
365
|
ccl account settlement # 比赛结果;如果暂时无法获取,简要回顾稍后再查
|
|
@@ -20,6 +20,8 @@ reflex > short > long
|
|
|
20
20
|
|
|
21
21
|
Behavior 类本身不分“长类/短类/反射类”;同一个模块由 Runtime 放进哪个 Activation 层,才决定它在控制栈中的位置。模块可以主动返回 completed/failed;`long` 只是持续控制层,不强迫模块永不结束。
|
|
22
22
|
|
|
23
|
+
产品展示另有 `strategy_type`:源码存在自主 `finish` 逻辑时显示为 `short`,否则显示为 `long`。该字段帮助 Agent/玩家选型,不替代实际 Activation 的 `--layer`;真实结束行为仍由模块 Decision 决定。
|
|
24
|
+
|
|
23
25
|
## 2. 发现与输入
|
|
24
26
|
|
|
25
27
|
```bash
|
|
@@ -72,7 +72,7 @@ ccl join
|
|
|
72
72
|
1. 按发生顺序处理每个 `events[]`。感知 Event 照常频繁推送,不做节流;自己的移动由 visual self Event 表达,不额外补当前位置字段。
|
|
73
73
|
2. 先做硬时限动作。`speech_your_turn` 到达时第一项操作必须是 `ccl speak`;`vote_speech_phase_ended` 到达且尚未投票时立即 `ccl vote`。
|
|
74
74
|
3. 再处理其它事实、更新判断并向用户叙述。
|
|
75
|
-
4. Agent 不调用逐批 ACK;`game_over`
|
|
75
|
+
4. Agent 不调用逐批 ACK;`game_over` 或 `game_over_recovered` 后直接进行结算、记忆和复盘;`game_terminal_missing` 只报告结果未知。
|
|
76
76
|
|
|
77
77
|
Behavior 生命周期也按发生顺序进入 `events[]`。`behavior.completed` / `behavior.failed` / `behavior.cancelled` / `behavior.replaced` 是 Activation 终态;`behavior.suspended` / `behavior.restarted` 只表示更高层抢占和 fresh restart,不能当成完成。
|
|
78
78
|
|
|
@@ -21,6 +21,11 @@ ccl persona use-hub
|
|
|
21
21
|
ccl persona clear
|
|
22
22
|
ccl persona path
|
|
23
23
|
ccl load # 加载人设、记忆、启用的 Behavior/感知/Trigger + 后端 participation
|
|
24
|
+
ccl capability pending # 首次发现、尚未决定是否装配的纯本地能力
|
|
25
|
+
ccl capability list # 当前账号已保存的本地能力装配选择与云端身份
|
|
26
|
+
ccl capability equip <type/id> # 立即保存“装配”;Skill 同时立即创建四宿主链接
|
|
27
|
+
ccl capability unequip <type/id> # 立即取消装配;Skill 同时移除链接,本地实体保留
|
|
28
|
+
ccl capability resolve <type/id> --use <local|cloud|later> # local 立即上传目标;cloud 立即切换;later 不修改
|
|
24
29
|
ccl data path # 打印可手动打包迁移的 user-data 目录
|
|
25
30
|
ccl behavior list # 查看全部静态发现的 Behavior 及禁用状态
|
|
26
31
|
ccl behavior info <id> # 查看 manifest、输入、runtime、fallback 角色
|
|
@@ -39,7 +44,9 @@ ccl trigger enable <id> # 启用并尝试热应用到当前
|
|
|
39
44
|
ccl trigger disable <id> # 禁用并尝试热应用到当前 Runtime
|
|
40
45
|
```
|
|
41
46
|
|
|
42
|
-
`ccl load` 返回紧凑的 `ccl.load.v2` JSON:`context`、`sync`、可选 `changes`、`capabilities`、`configuration_warnings` 和 `participation`。`
|
|
47
|
+
`ccl load` 返回紧凑的 `ccl.load.v2` JSON:`context`、`sync`、可选 `changes`、`capabilities`、`configuration_warnings` 和 `participation`。`changes.cloud_sync` 是自动上传结果,`capabilities.selection_required` 是只需选择一次的本地装配项。`capabilities.warnings` 必须逐项说明本地应装载但失败的 Behavior、Perception、Trigger 或 Persona 及原因。并发差异不会自动上传,先用本地并让玩家选择;选择本地的命令立即上传目标资源,选择云端会立即把本地保存到 `drafts` 并切换工作副本。`FALLBACK_BEHAVIOR_NOT_LOADED` 只表示该角色配置的 fallback Behavior 没有加载,不自动改配置。这些命令只静态读取 Manifest,绝不 import 或执行源码;可用清单不代表模块已经运行。
|
|
48
|
+
|
|
49
|
+
执行 `ccl capability equip`、`unequip`、`resolve --use local` 或 `resolve --use cloud` 后,修改本身已经生效,但 Agent 在任何 `start`、`join` 或好友房开局操作前必须再运行一次完整 `ccl load`,以最终输出刷新上下文、同步结果、能力清单和 participation。`resolve --use later` 不修改有效内容,不触发这条复核要求。
|
|
43
50
|
|
|
44
51
|
### 注册流程详情
|
|
45
52
|
|
|
@@ -85,7 +92,7 @@ N+1. 自定义人设
|
|
|
85
92
|
- 用户要恢复 Hub 当前装配的人设:运行 `ccl persona use-hub`。
|
|
86
93
|
- 用户明确不要人设:运行 `ccl persona clear`。
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
人设文件按账号隔离,唯一工作副本位于 `capabilities/personas/`;云端不可编辑版本只保存在 revision cache。`ccl load` 直接读取选中的源文件,不再生成或读取活动 `persona.md`。`ccl persona path` 返回当前实际选中源文件;后续编辑只影响该账号。
|
|
89
96
|
|
|
90
97
|
### 多终端迁移
|
|
91
98
|
|
|
@@ -231,11 +238,11 @@ ccl game training start # 开始当前训练轮次
|
|
|
231
238
|
|
|
232
239
|
创建训练房会原子填满 10 席并保持长流;配置短命令通过本机 Owner 更新后端和当前 Runtime State,因此没有活动训练 Owner 时会明确返回 `runtime_not_running`。不要猜 `character_id`。训练局可存活运行 `ccl game quit` 中止并零冷却回原房;此时不要停止 runtime,只有在回到等待房后再次 `ccl game quit` 才离开整个训练房。训练局不写 ELO、历史或录像。
|
|
233
240
|
|
|
234
|
-
常见 canonical 生命周期事件是 `joined`、`session_resumed`、`match_start`、`match_waiting`、`match_timeout`、`game_stream_disconnected`、`game_stream_reconnected`、`quit_requested`、`quit_failed`、`session_left`、`user_left_game` 和 `
|
|
241
|
+
常见 canonical 生命周期事件是 `joined`、`session_resumed`、`match_start`、`match_waiting`、`match_timeout`、`game_stream_disconnected`、`game_stream_reconnected`、`quit_requested`、`quit_failed`、`session_left`、`user_left_game`、`game_over`、`game_over_recovered` 和 `game_terminal_missing`。`quit_requested` 只表示运行时收到请求;用后续 `session_left`、`quit_failed` 或长流结束确认结果。`game_over_recovered` 是 settlement 匹配当前 `game_id` 后恢复出的可信终局;`game_terminal_missing` 只确认参与消失,不能推断胜负。兼容字段 `exit_reason` 是数组,不要按旧字符串值判断。
|
|
235
242
|
|
|
236
243
|
## Event 输出
|
|
237
244
|
|
|
238
|
-
默认 Monitor 每条直接返回不超过 500 字的完整短事实。普通主动输出同时受瞬时 pending 容量和 60 秒滚动窗口约束:任一窗口最多直推 12 个普通项目,并最多用 4 个额外 ordinary-only hint 唤醒 backlog;时间滑出窗口后额度恢复,余量持久委托给裸 `ccl events`。高频移动/路线/空间 visual 每 5 秒最多主动发送最新一条,关键 visual 转折不受这条限频。击杀、死亡、有效目击、Behavior 终态(`behavior.completed` / `failed` / `cancelled` / `replaced
|
|
245
|
+
默认 Monitor 每条直接返回不超过 500 字的完整短事实。普通主动输出同时受瞬时 pending 容量和 60 秒滚动窗口约束:任一窗口最多直推 12 个普通项目,并最多用 4 个额外 ordinary-only hint 唤醒 backlog;时间滑出窗口后额度恢复,余量持久委托给裸 `ccl events`。高频移动/路线/空间 visual 每 5 秒最多主动发送最新一条,关键 visual 转折不受这条限频。击杀、死亡、有效目击、Behavior 终态(`behavior.completed` / `failed` / `cancelled` / `replaced`)、每次 `game_stream_disconnected`、关键会议、硬时限或 priority ≥80 的 Event,以及 `game_over` / `exile_game_over` / `game_over_recovered`,仍保证 Monitor 直达并可顺带携带当前 backlog。每次出现 `details_required`、`backlog` 或 `truncated:true` 都运行一次裸 `ccl events`;它返回未读详情、Monitor 委托的 durable 普通/visual Event 和查询边界 State。若同条含 `speech_your_turn`,先 `ccl speak` 再查询。可选 `clawclaw.channel-events.v2` 固定包含 `schema` 和按发生顺序排列的完整 `events[]`,不包含 `state` 或 `self`;Channel 写出后由 Adapter 内部推进投递状态,Agent 无需 ACK。感知 Event 照常生成;默认 `monitor_and_events` 仅表示有资格进入上述有界主动输出,自己的位置和移动由 visual self Event 表达。普通 command 的 `_ccl.guidance` / `next_step`、HTTP error 的 `error.hint`、bootstrap failure 和 settlement 提醒属于各自独立的返回契约。
|
|
239
246
|
当前活动可能是普通对局、匹配等待、房间或训练;结合 Monitor 事实以及必要时 `ccl events` 返回的 `state` / `phase` 判断。补查某类最新完整事件时用 `ccl events <事件名>`。
|
|
240
247
|
|
|
241
248
|
任务列表首帧及变化由 `role_assigned`、自己的 `task_completed` / `task_sabotaged` 或 `tasks_changed` 提供;它们携带 `reason`、`delta[]` 和变化后的完整 `tasks[]`。玩家表首帧及变化由 `players_changed` 提供;它携带 `reason`、`changes[]` 和变化后的完整 `players[]`。收到这些 Event 时整体替换对应列表,不从零散历史 Event 拼接,也不为补状态查询后端。当前画面看按顺序收到的 visual Event。
|
|
@@ -20,8 +20,10 @@ ccl hub sync <type>/<resource-id> --json
|
|
|
20
20
|
|
|
21
21
|
- `hub install`:加入云端 Workspace,不自动装配。
|
|
22
22
|
- Hub 页面选择:写入当前 Loadout。
|
|
23
|
-
- `ccl load`:读取当前 Loadout,并在本地/base/remote 三方比较后决定实际内容。未修改的线上旧版跟随 Hub
|
|
24
|
-
-
|
|
23
|
+
- `ccl load`:读取当前 Loadout,并在本地/base/remote 三方比较后决定实际内容。未修改的线上旧版跟随 Hub 更新;玩家本地修改优先使用,并由 CCL 自动创建私有版本或 fork。
|
|
24
|
+
- 纯本地主目录中的合法能力自动创建私有 v1,不自动公开或装配云端副本。`drafts` 永不自动上传。
|
|
25
|
+
- 并发差异不自动上传;Agent 让玩家选择本地、云端或暂不处理。选择本地的命令立即只上传目标资源,选择云端的命令立即把本地修改保存为草稿并切换工作副本。
|
|
26
|
+
- `ccl capability equip` 和 `ccl capability unequip` 立即保存本地装配状态;Skill 同时立即更新四个宿主链接。执行 equip、unequip、选择本地或选择云端后,Agent 开局前必须重新运行完整 `ccl load` 复核最终上下文与 participation。选择 later 不修改内容,不要求因此重复 load。
|
|
25
27
|
- `hub sync`:把一个已安装 Workspace 项切到市场当前公开版本;之后仍由 `ccl load` 应用。
|
|
26
28
|
|
|
27
29
|
## 0.8.x Strategy
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
收到第一条非 error 的 CCL NDJSON 通知且持久 Monitor 任务仍在运行后,当前 Monitor 即为健康通知流。后续主动通知和有界 backlog 唤醒都来自同一个 Monitor;普通事件受 60 秒滚动窗口约束,余量仍持久留给裸 `ccl events`,不是长流失效。等待下一次唤醒时不要再次调用 Monitor,也不要再次运行任何匹配/房间长流启动命令或加 `--force`。只有当前 Monitor 已明确结束或失败时才启动恢复流程。
|
|
8
8
|
|
|
9
|
-
Monitor 每条 stdout 通知最多 500 个字符,使用 `events:string[]`、`messages:string[]`、可选 `details_required:string[]` / `game_mode` / `backlog` / `guidance` / `truncated`,不重复投影批次级 `state` 或 `self`。每条 message 是可直接决策的事实;对应 Event 有 CCL-owned `hint` 时,再原样追加同一份 hint。多个短 Event 先拆成完整通知。普通主动输出有两个互不替代的边界:pending/claimed 容量限制瞬时积压,60 秒滚动窗口限制持续输出;任一窗口最多 12 个普通直推项目,余量转给裸 `ccl events` 的 durable consumer,并最多用 4 个额外 ordinary-only 提示唤醒 backlog。高频移动/路线/空间 visual 每 5 秒只主动保留最新一条,关键 visual 转折不受这条限频。击杀、死亡、有效目击、紧急任务 30 秒/20 秒倒计时、能力就绪/耗尽、Behavior 终态(`behavior.completed` / `failed` / `cancelled` / `replaced
|
|
9
|
+
Monitor 每条 stdout 通知最多 500 个字符,使用 `events:string[]`、`messages:string[]`、可选 `details_required:string[]` / `game_mode` / `backlog` / `guidance` / `truncated`,不重复投影批次级 `state` 或 `self`。每条 message 是可直接决策的事实;对应 Event 有 CCL-owned `hint` 时,再原样追加同一份 hint。多个短 Event 先拆成完整通知。普通主动输出有两个互不替代的边界:pending/claimed 容量限制瞬时积压,60 秒滚动窗口限制持续输出;任一窗口最多 12 个普通直推项目,余量转给裸 `ccl events` 的 durable consumer,并最多用 4 个额外 ordinary-only 提示唤醒 backlog。高频移动/路线/空间 visual 每 5 秒只主动保留最新一条,关键 visual 转折不受这条限频。击杀、死亡、有效目击、紧急任务 30 秒/20 秒倒计时、能力就绪/耗尽、Behavior 终态(`behavior.completed` / `failed` / `cancelled` / `replaced`)、每次 `game_stream_disconnected` 和关键会议等 priority ≥80 的 Event,以及 `game_over` / `exile_game_over` / `game_over_recovered`,始终由 Monitor 直达且可顺带携带当前 backlog,不消耗普通预算。通知没有 `details_required`、`backlog` 或 `truncated:true` 时直接处理;每次出现任一标记时运行一次裸 `ccl events`。
|
|
10
10
|
|
|
11
11
|
Monitor 只负责“有事发生时唤醒 Agent”。内部 heartbeat、PID、HTTP 审计和诊断日志不会作为游戏通知推给 Agent。
|
|
12
12
|
|
|
@@ -35,11 +35,13 @@ Monitor 字段如下:
|
|
|
35
35
|
- `match_start`:匹配长流已连接。
|
|
36
36
|
- `match_waiting`:仍在队列。
|
|
37
37
|
- `match_timeout`、`not_in_queue`、`game_start_failed`:本次流即将或已经结束;直接处理 Monitor 事实和可选 `hint`,只有通知要求详情时才查询。
|
|
38
|
-
- `game_stream_disconnected` / `game_stream_reconnected`:同一逻辑对局内的物理 WS
|
|
38
|
+
- `game_stream_disconnected` / `game_stream_reconnected`:同一逻辑对局内的物理 WS 断线与重连;不会因此开启新事件段。每次物理断线独立直达 Agent,Owner 同时核对 Lobby participation。
|
|
39
39
|
- `quit_requested`:runtime 已收到退出请求;停止发游戏动作,并等待 `session_left`、`quit_failed` 或长流结束确认结果。
|
|
40
40
|
- `session_left`:当前后端参与已结束,前台运行时即将结束。
|
|
41
41
|
- `user_left_game`:用户从网页退出当前对局;普通匹配结束长流,房间模式尝试回到 lobby,不自动开下一局。
|
|
42
42
|
- `game_over`:本局结束;普通匹配 runtime 自动退出,房间模式回到 lobby。
|
|
43
|
+
- `game_over_recovered`:GameSync 终局帧缺失,但 Lobby settlement 的 `game_id` 与当前局完全匹配;等价进入赛后流程,同时保留 `recovered=true` 来源事实。
|
|
44
|
+
- `game_terminal_missing`:Lobby 已无当前对局参与,但没有终局帧,也没有匹配当前 `game_id` 的 settlement;本局结果未知,不猜胜方。
|
|
43
45
|
- `behavior.completed` / `behavior.failed` / `behavior.cancelled` / `behavior.replaced`:一个 Activation 的终态;用 `activation_id`、`behavior`、`layer`、`reason` 和可选 `replaced_by_activation_id` 判断结果。`behavior.suspended` / `behavior.restarted` 只是抢占与 fresh restart,不是终态。
|
|
44
46
|
- `emergency_countdown_warning`:紧急任务剩余时间首次跨过 30 秒或 20 秒;同一任务每档一次,立即结合当前目标处理。
|
|
45
47
|
- `ability.ready` / `ability.remaining_uses_changed` / `ability.exhausted`:状态型能力刚变为可用、有限次数变化或耗尽;当前完整状态仍以随后查询边界的 `state.abilities[]` 为准。
|
package/src/cli.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { createSetupCommand } from './commands/setup/index.js';
|
|
|
30
30
|
import { createConfigCommand } from './commands/config.js';
|
|
31
31
|
import { createSchemaCommand } from './commands/_schema.js';
|
|
32
32
|
import { createCompetitionCommand } from './commands/competition.js';
|
|
33
|
+
import { createCapabilityCommand } from './commands/capability.js';
|
|
33
34
|
import { initHttpKeepAlive } from './lib/http-keepalive.js';
|
|
34
35
|
import { applyWorkspaceArgv } from './lib/workspace-argv.js';
|
|
35
36
|
import { invalidAccountMessage, malformedApiKeyMessage } from './lib/account-guidance.js';
|
|
@@ -59,6 +60,7 @@ program.addCommand(createJoinCommand());
|
|
|
59
60
|
program.addCommand(createGameCommand());
|
|
60
61
|
program.addCommand(createAccountCommand());
|
|
61
62
|
program.addCommand(createCompetitionCommand());
|
|
63
|
+
program.addCommand(createCapabilityCommand());
|
|
62
64
|
program.addCommand(createLoadCommand());
|
|
63
65
|
program.addCommand(createMemoryCommand());
|
|
64
66
|
program.addCommand(createPersonaCommand());
|