@xfxstudio/claworld 2026.7.13-testing.4 → 2026.7.14-testing.1
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 +1 -18
- package/openclaw.plugin.json +2 -3
- package/package.json +1 -2
- package/skills/claworld-help/SKILL.md +30 -10
- package/skills/claworld-main-session/SKILL.md +3 -8
- package/skills/claworld-management-session/SKILL.md +8 -28
- package/src/openclaw/plugin/claworld-channel-plugin.js +2 -67
- package/src/openclaw/plugin/register.js +2 -143
- package/src/openclaw/plugin/relay-client-shared.js +0 -14
- package/src/openclaw/runtime/tool-inventory.js +0 -1
- package/src/openclaw/runtime/working-memory.js +8 -12
- package/src/openclaw/runtime/transcript-report-comic-grid.js +0 -475
- package/src/openclaw/runtime/transcript-report-stylekit.js +0 -189
- package/src/openclaw/runtime/transcript-report.js +0 -923
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
const FULL_WIDTH_RANGES = [
|
|
2
|
-
[0x1100, 0x115f],
|
|
3
|
-
[0x231a, 0x231b],
|
|
4
|
-
[0x2329, 0x232a],
|
|
5
|
-
[0x23e9, 0x23ec],
|
|
6
|
-
[0x23f0, 0x23f0],
|
|
7
|
-
[0x23f3, 0x23f3],
|
|
8
|
-
[0x25fd, 0x25fe],
|
|
9
|
-
[0x2614, 0x2615],
|
|
10
|
-
[0x2648, 0x2653],
|
|
11
|
-
[0x267f, 0x267f],
|
|
12
|
-
[0x2693, 0x2693],
|
|
13
|
-
[0x26a1, 0x26a1],
|
|
14
|
-
[0x26aa, 0x26ab],
|
|
15
|
-
[0x26bd, 0x26be],
|
|
16
|
-
[0x26c4, 0x26c5],
|
|
17
|
-
[0x26ce, 0x26ce],
|
|
18
|
-
[0x26d4, 0x26d4],
|
|
19
|
-
[0x26ea, 0x26ea],
|
|
20
|
-
[0x26f2, 0x26f3],
|
|
21
|
-
[0x26f5, 0x26f5],
|
|
22
|
-
[0x26fa, 0x26fa],
|
|
23
|
-
[0x26fd, 0x26fd],
|
|
24
|
-
[0x2705, 0x2705],
|
|
25
|
-
[0x270a, 0x270b],
|
|
26
|
-
[0x2728, 0x2728],
|
|
27
|
-
[0x274c, 0x274c],
|
|
28
|
-
[0x274e, 0x274e],
|
|
29
|
-
[0x2753, 0x2755],
|
|
30
|
-
[0x2757, 0x2757],
|
|
31
|
-
[0x2795, 0x2797],
|
|
32
|
-
[0x27b0, 0x27b0],
|
|
33
|
-
[0x27bf, 0x27bf],
|
|
34
|
-
[0x2b1b, 0x2b1c],
|
|
35
|
-
[0x2b50, 0x2b50],
|
|
36
|
-
[0x2b55, 0x2b55],
|
|
37
|
-
[0x2e80, 0x303e],
|
|
38
|
-
[0x3040, 0xa4cf],
|
|
39
|
-
[0xac00, 0xd7a3],
|
|
40
|
-
[0xf900, 0xfaff],
|
|
41
|
-
[0xfe10, 0xfe19],
|
|
42
|
-
[0xfe30, 0xfe6f],
|
|
43
|
-
[0xff00, 0xff60],
|
|
44
|
-
[0xffe0, 0xffe6],
|
|
45
|
-
[0x1f004, 0x1f004],
|
|
46
|
-
[0x1f0cf, 0x1f0cf],
|
|
47
|
-
[0x1f18e, 0x1f18e],
|
|
48
|
-
[0x1f191, 0x1f19a],
|
|
49
|
-
[0x1f200, 0x1f202],
|
|
50
|
-
[0x1f210, 0x1f23b],
|
|
51
|
-
[0x1f240, 0x1f248],
|
|
52
|
-
[0x1f250, 0x1f251],
|
|
53
|
-
[0x1f300, 0x1f64f],
|
|
54
|
-
[0x1f680, 0x1f6ff],
|
|
55
|
-
[0x1f900, 0x1f9ff],
|
|
56
|
-
[0x20000, 0x3fffd],
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
export function escapeXml(value) {
|
|
60
|
-
return String(value ?? '')
|
|
61
|
-
.replaceAll('&', '&')
|
|
62
|
-
.replaceAll('<', '<')
|
|
63
|
-
.replaceAll('>', '>')
|
|
64
|
-
.replaceAll('"', '"')
|
|
65
|
-
.replaceAll("'", ''');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function fontFamily() {
|
|
69
|
-
return "'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Zen Hei', "
|
|
70
|
-
+ "'Noto Sans CJK SC', 'Noto Sans SC', 'Source Han Sans SC', 'IPA P Gothic', "
|
|
71
|
-
+ "'AR PL UMing CN', 'Arial Unicode MS', -apple-system, BlinkMacSystemFont, "
|
|
72
|
-
+ "'Segoe UI', Arial, sans-serif";
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function isFullWidthCharacter(character) {
|
|
76
|
-
const codePoint = character.codePointAt(0) || 0;
|
|
77
|
-
return FULL_WIDTH_RANGES.some(([start, end]) => codePoint >= start && codePoint <= end);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function charUnits(character) {
|
|
81
|
-
if (character === '\n') return 0;
|
|
82
|
-
if (/\s/u.test(character)) return 0.35;
|
|
83
|
-
return isFullWidthCharacter(character) ? 1 : 0.55;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function textUnits(text) {
|
|
87
|
-
return [...String(text ?? '')].reduce((total, character) => total + charUnits(character), 0);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export function displayCols(text) {
|
|
91
|
-
return [...String(text ?? '')].reduce((total, character) => (
|
|
92
|
-
total + (character === '\n' ? 0 : isFullWidthCharacter(character) ? 2 : 1)
|
|
93
|
-
), 0);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function wrapTokens(paragraph) {
|
|
97
|
-
const tokens = [];
|
|
98
|
-
let current = '';
|
|
99
|
-
const flush = () => {
|
|
100
|
-
if (!current) return;
|
|
101
|
-
tokens.push(current);
|
|
102
|
-
current = '';
|
|
103
|
-
};
|
|
104
|
-
for (const character of [...String(paragraph ?? '')]) {
|
|
105
|
-
if (/\s/u.test(character)) {
|
|
106
|
-
flush();
|
|
107
|
-
tokens.push(' ');
|
|
108
|
-
} else if (isFullWidthCharacter(character)) {
|
|
109
|
-
flush();
|
|
110
|
-
tokens.push(character);
|
|
111
|
-
} else {
|
|
112
|
-
current += character;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
flush();
|
|
116
|
-
return tokens;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function wrapText(text, maxUnits) {
|
|
120
|
-
const lines = [];
|
|
121
|
-
for (const paragraph of String(text ?? '').split(/\r?\n/)) {
|
|
122
|
-
let current = '';
|
|
123
|
-
let currentUnits = 0;
|
|
124
|
-
for (const token of wrapTokens(paragraph)) {
|
|
125
|
-
if (/^\s+$/u.test(token)) {
|
|
126
|
-
const tokenUnits = textUnits(token);
|
|
127
|
-
if (current && currentUnits + tokenUnits <= maxUnits) {
|
|
128
|
-
current += token;
|
|
129
|
-
currentUnits += tokenUnits;
|
|
130
|
-
}
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
const tokenUnits = textUnits(token);
|
|
134
|
-
if (current && currentUnits + tokenUnits > maxUnits) {
|
|
135
|
-
lines.push(current.trimEnd());
|
|
136
|
-
current = '';
|
|
137
|
-
currentUnits = 0;
|
|
138
|
-
}
|
|
139
|
-
if (tokenUnits > maxUnits) {
|
|
140
|
-
for (const character of [...token]) {
|
|
141
|
-
const units = charUnits(character);
|
|
142
|
-
if (current && currentUnits + units > maxUnits) {
|
|
143
|
-
lines.push(current.trimEnd());
|
|
144
|
-
current = '';
|
|
145
|
-
currentUnits = 0;
|
|
146
|
-
}
|
|
147
|
-
current += character;
|
|
148
|
-
currentUnits += units;
|
|
149
|
-
}
|
|
150
|
-
} else {
|
|
151
|
-
current += token;
|
|
152
|
-
currentUnits += tokenUnits;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (current || lines.length === 0) lines.push(current.trimEnd());
|
|
156
|
-
}
|
|
157
|
-
return lines;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function ellipsizeText(text, maxUnits, suffix = '...') {
|
|
161
|
-
const value = String(text ?? '');
|
|
162
|
-
if (textUnits(value) <= maxUnits) return value;
|
|
163
|
-
const allowed = Math.max(0, maxUnits - textUnits(suffix));
|
|
164
|
-
let kept = '';
|
|
165
|
-
let used = 0;
|
|
166
|
-
for (const character of [...value]) {
|
|
167
|
-
const units = charUnits(character);
|
|
168
|
-
if (used + units > allowed) break;
|
|
169
|
-
kept += character;
|
|
170
|
-
used += units;
|
|
171
|
-
}
|
|
172
|
-
return `${kept.trimEnd()}${suffix}`;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function clipDisplay(text, maxCols) {
|
|
176
|
-
const value = String(text ?? '');
|
|
177
|
-
if (displayCols(value) <= maxCols) return value;
|
|
178
|
-
const suffix = '...';
|
|
179
|
-
const target = Math.max(0, maxCols - suffix.length);
|
|
180
|
-
let kept = '';
|
|
181
|
-
let used = 0;
|
|
182
|
-
for (const character of [...value]) {
|
|
183
|
-
const cols = character === '\n' ? 0 : isFullWidthCharacter(character) ? 2 : 1;
|
|
184
|
-
if (used + cols > target) break;
|
|
185
|
-
kept += character;
|
|
186
|
-
used += cols;
|
|
187
|
-
}
|
|
188
|
-
return `${kept.trimEnd()}${suffix}`;
|
|
189
|
-
}
|