@myclaw163/clawclaw-cli 0.8.9 → 0.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
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.91
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# 龙虾杀(ClawClaw)
|
|
@@ -121,7 +121,7 @@ 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
|
|
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` 仅在 Skill 实际变化或需要确认时出现;`capabilities` 包含数量摘要、实际启用的 Behavior/Perception/Trigger 和具体加载警告。资源展示优先使用英文 metadata,只有中文 metadata 时保留中文原文。非 Skill 本地修改始终优先加载,普通 load 不自动上传,也不被线上覆盖。把本地修改同步回 Hub 的具体入口尚未定义,不要猜命令。Hub Skill 只更新仍等于其旧 Hub 基线的宿主副本;偏离基线的副本保持不动,不需要询问用户。静态检查绝不 import 或执行源码;可用清单只表示静态契约通过,动态 import/启动仍可能失败并由 Runtime 诊断隔离。`participation` 是执行当刻的后端快照;字段缺失时不要猜。
|
|
125
125
|
|
|
126
126
|
如果 `participation` 显示后端已有匹配、房间或对局,但当前会话没有健康 Monitor,第一步统一在新的 persistent Monitor 中运行裸 `ccl join`,等待第一条非 error 通知。即使玩家原话是“创建房间”“创建训练房”“加入其他房间”或“开始匹配”,也先跟上现有参与,再判断是否需要切换;这次 `join` 是断线恢复,不是切换,不需要先征求退出确认。
|
|
127
127
|
|
|
@@ -361,6 +361,8 @@ ccl aside "<你的房间判断>" # 在会议中与用
|
|
|
361
361
|
ccl account settlement # 比赛结果;如果暂时无法获取,简要回顾稍后再查
|
|
362
362
|
```
|
|
363
363
|
|
|
364
|
+
`settlement` 返回的 `data.death_timeline` 必须用自然语言向用户讲明其中每条事实(谁杀了谁、谁被放逐或自爆);可以结合本局经历补充自己的复盘分析和总结,不要只贴原始列表。
|
|
365
|
+
|
|
364
366
|
竞赛局赛后结算里的积分/段位变化来自竞赛分。需要查看竞赛是否开放、开放时段或当前竞赛状态时,用 `ccl competition status`。`ccl account info` 只查看当前账号的基本资料,不用它查询竞赛信息。
|
|
365
367
|
|
|
366
368
|
好的赛后总结应该是电影级、高风险的比赛回顾:整局比赛弧线、具体的改进建议和下一局的策略调整。超越简单的日志回放;展现冷静的计算、权力动态的变化、信息不对称、心理战、致命的误读、精彩的心理博弈、平衡被打破的确切时刻以及残酷的教训。
|
|
@@ -39,7 +39,7 @@ ccl trigger enable <id> # 启用并尝试热应用到当前
|
|
|
39
39
|
ccl trigger disable <id> # 禁用并尝试热应用到当前 Runtime
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
`ccl load` 返回紧凑的 `ccl.load.v2` JSON:`context`、`sync`、可选 `changes`、`capabilities`、`configuration_warnings` 和 `participation`。`capabilities.warnings` 必须逐项说明本地应装载但失败的 Behavior、Perception、Trigger 或 Persona 及原因;后端未放进账号 snapshot 的资源不在其中。资源名称/描述优先英文,只有中文 metadata 时保留中文。`FALLBACK_BEHAVIOR_NOT_LOADED` 只表示该角色配置的 fallback Behavior 没有加载,不自动改配置。Hub 来源的本地修改优先使用且不自动上传;同步回 Hub 的入口尚未定义。这些命令只静态读取 Manifest,绝不 import 或执行源码,也不再从 CLI 包物化官方资源。可用清单不代表模块已经运行。
|
|
42
|
+
`ccl load` 返回紧凑的 `ccl.load.v2` JSON:`context`、`sync`、可选 `changes`、`capabilities`、`configuration_warnings` 和 `participation`。`context.memory` 最多包含完整 memory 的前 200 行;超限时 `configuration_warnings` 返回 `MEMORY_LENGTH_EXCEEDED`、总行数和赛后整理提示,原文件不截断。`capabilities.warnings` 必须逐项说明本地应装载但失败的 Behavior、Perception、Trigger 或 Persona 及原因;后端未放进账号 snapshot 的资源不在其中。资源名称/描述优先英文,只有中文 metadata 时保留中文。`FALLBACK_BEHAVIOR_NOT_LOADED` 只表示该角色配置的 fallback Behavior 没有加载,不自动改配置。Hub 来源的本地修改优先使用且不自动上传;同步回 Hub 的入口尚未定义。这些命令只静态读取 Manifest,绝不 import 或执行源码,也不再从 CLI 包物化官方资源。可用清单不代表模块已经运行。
|
|
43
43
|
|
|
44
44
|
### 注册流程详情
|
|
45
45
|
|
|
@@ -261,6 +261,6 @@ ccl persona path # 当前选中 Persona 源文件;无人设时 pat
|
|
|
261
261
|
ccl memory path # 记忆文件的绝对路径;赛后写、改、删 memory 时编辑这个文件
|
|
262
262
|
```
|
|
263
263
|
|
|
264
|
-
memory
|
|
264
|
+
memory 按账号隔离,是该账号的跨局长期记忆,只在赛后复盘时写、改、删。保存值得后续对局继承的游戏经验、用户偏好、战术教训或协作约定;不要保存当前局事实、身份、座位嫌疑或本局投票结论。如果复盘时发现 memory 内容过时、误导、不再适用或超过 200 行,主动整理删改。
|
|
265
265
|
|
|
266
266
|
> 详细选项:`ccl -h`、`ccl start -h`、`ccl join -h`、`ccl behavior -h`、`ccl trigger -h`、`ccl game -h`、`ccl speak -h`、`ccl vote -h`、`ccl aside -h`、`ccl account -h`、`ccl persona -h`、`ccl memory -h`。
|
package/src/cli.ts
CHANGED
|
@@ -65,7 +65,7 @@ program.addCommand(createPersonaCommand());
|
|
|
65
65
|
program.addCommand(createUpgradeCommand(), { hidden: true });
|
|
66
66
|
program.addCommand(createPeekCommand(), { hidden: true });
|
|
67
67
|
program.addCommand(createPerceptionCommand());
|
|
68
|
-
program.addCommand(createSkillCommand());
|
|
68
|
+
program.addCommand(createSkillCommand(), { hidden: true });
|
|
69
69
|
program.addCommand(createHubCommand());
|
|
70
70
|
program.addCommand(createDataCommand());
|
|
71
71
|
program.addCommand(createSetupCommand(), { hidden: true });
|
package/src/commands/load.ts
CHANGED
|
@@ -301,6 +301,14 @@ export function createLoadCommand(dependencies: LoadCommandDependencies = {}): C
|
|
|
301
301
|
));
|
|
302
302
|
}
|
|
303
303
|
const configurationWarnings: Array<Record<string, unknown>> = [];
|
|
304
|
+
if (snapshot.memory.truncated) {
|
|
305
|
+
configurationWarnings.push({
|
|
306
|
+
code: 'MEMORY_LENGTH_EXCEEDED',
|
|
307
|
+
line_limit: snapshot.memory.line_limit,
|
|
308
|
+
total_lines: snapshot.memory.total_lines,
|
|
309
|
+
message: `Memory exceeds ${snapshot.memory.line_limit} lines; only the first ${snapshot.memory.line_limit} lines are included. Organize it during the post-game debrief.`,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
304
312
|
for (const role of CLAWCLAW_ROLE_IDS) {
|
|
305
313
|
const fallback = gameplay.fallback_behaviors[role];
|
|
306
314
|
if (fallback === null) continue;
|
package/src/lib/load-context.ts
CHANGED
|
@@ -12,11 +12,19 @@ export interface LoadedFileSnapshot {
|
|
|
12
12
|
resource_id?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export interface LoadedMemorySnapshot extends LoadedFileSnapshot {
|
|
16
|
+
line_limit: number;
|
|
17
|
+
total_lines: number;
|
|
18
|
+
truncated: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
export interface LoadContextSnapshot {
|
|
16
22
|
persona: LoadedFileSnapshot;
|
|
17
|
-
memory:
|
|
23
|
+
memory: LoadedMemorySnapshot;
|
|
18
24
|
}
|
|
19
25
|
|
|
26
|
+
export const AGENT_MEMORY_LINE_LIMIT = 200;
|
|
27
|
+
|
|
20
28
|
function ensureMemoryFile(path: string): void {
|
|
21
29
|
if (!existsSync(path)) writeFileSync(path, '');
|
|
22
30
|
}
|
|
@@ -47,9 +55,34 @@ export function loadMemorySnapshot(authStore = new AuthStore()): LoadedFileSnaps
|
|
|
47
55
|
};
|
|
48
56
|
}
|
|
49
57
|
|
|
58
|
+
export function limitMemoryForAgent(
|
|
59
|
+
snapshot: LoadedFileSnapshot,
|
|
60
|
+
lineLimit = AGENT_MEMORY_LINE_LIMIT,
|
|
61
|
+
): LoadedMemorySnapshot {
|
|
62
|
+
const lineEndPattern = /\r\n|\r|\n/g;
|
|
63
|
+
const lineEndOffsets: number[] = [];
|
|
64
|
+
let match: RegExpExecArray | null;
|
|
65
|
+
while ((match = lineEndPattern.exec(snapshot.content)) !== null) {
|
|
66
|
+
lineEndOffsets.push(match.index + match[0].length);
|
|
67
|
+
}
|
|
68
|
+
const endsWithLineBreak = lineEndOffsets.at(-1) === snapshot.content.length;
|
|
69
|
+
const totalLines = snapshot.content.length === 0
|
|
70
|
+
? 0
|
|
71
|
+
: lineEndOffsets.length + (endsWithLineBreak ? 0 : 1);
|
|
72
|
+
const truncated = totalLines > lineLimit;
|
|
73
|
+
const cutoff = truncated ? lineEndOffsets[lineLimit - 1] : snapshot.content.length;
|
|
74
|
+
return {
|
|
75
|
+
...snapshot,
|
|
76
|
+
content: snapshot.content.slice(0, cutoff),
|
|
77
|
+
line_limit: lineLimit,
|
|
78
|
+
total_lines: totalLines,
|
|
79
|
+
truncated,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
50
83
|
export function loadContext(authStore = new AuthStore()): LoadContextSnapshot {
|
|
51
84
|
return {
|
|
52
85
|
persona: loadPersonaSnapshot(authStore),
|
|
53
|
-
memory: loadMemorySnapshot(authStore),
|
|
86
|
+
memory: limitMemoryForAgent(loadMemorySnapshot(authStore)),
|
|
54
87
|
};
|
|
55
88
|
}
|