codexmate 0.0.22 → 0.0.24
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 +5 -3
- package/README.zh.md +8 -5
- package/cli/auth-profiles.js +23 -7
- package/cli/doctor-core.js +903 -0
- package/cli/import-skills-url.js +334 -0
- package/cli.js +304 -208
- package/lib/cli-models-utils.js +0 -40
- package/lib/cli-network-utils.js +28 -2
- package/package.json +5 -2
- package/plugins/README.md +20 -0
- package/plugins/README.zh-CN.md +20 -0
- package/plugins/prompt-templates/comment-polish/index.mjs +25 -0
- package/plugins/prompt-templates/computed.mjs +253 -0
- package/plugins/prompt-templates/index.mjs +8 -0
- package/plugins/prompt-templates/manifest.mjs +15 -0
- package/plugins/prompt-templates/methods.mjs +619 -0
- package/plugins/prompt-templates/overview.mjs +90 -0
- package/plugins/prompt-templates/ownership.mjs +19 -0
- package/plugins/prompt-templates/rule-ack/index.mjs +21 -0
- package/plugins/prompt-templates/storage.mjs +64 -0
- package/plugins/registry.mjs +16 -0
- package/res/logo-pack.webp +0 -0
- package/web-ui/app.js +68 -34
- package/web-ui/index.html +4 -3
- package/web-ui/modules/app.computed.dashboard.mjs +22 -22
- package/web-ui/modules/app.computed.main-tabs.mjs +9 -2
- package/web-ui/modules/app.methods.agents.mjs +91 -3
- package/web-ui/modules/app.methods.codex-config.mjs +153 -164
- package/web-ui/modules/app.methods.install.mjs +16 -0
- package/web-ui/modules/app.methods.navigation.mjs +76 -0
- package/web-ui/modules/app.methods.runtime.mjs +24 -2
- package/web-ui/modules/app.methods.session-browser.mjs +73 -1
- package/web-ui/modules/app.methods.startup-claude.mjs +12 -0
- package/web-ui/modules/app.methods.task-orchestration.mjs +96 -11
- package/web-ui/modules/config-mode.computed.mjs +1 -3
- package/web-ui/modules/i18n.dict.mjs +2039 -0
- package/web-ui/modules/i18n.mjs +2 -1555
- package/web-ui/modules/plugins.computed.mjs +2 -219
- package/web-ui/modules/plugins.methods.mjs +2 -619
- package/web-ui/modules/plugins.storage.mjs +11 -37
- package/web-ui/modules/sessions-filters-url.mjs +85 -0
- package/web-ui/partials/index/layout-header.html +38 -34
- package/web-ui/partials/index/modal-config-template-agents.html +3 -4
- package/web-ui/partials/index/modal-health-check.html +33 -60
- package/web-ui/partials/index/panel-config-claude.html +56 -15
- package/web-ui/partials/index/panel-config-codex.html +68 -19
- package/web-ui/partials/index/panel-config-openclaw.html +8 -3
- package/web-ui/partials/index/panel-dashboard.html +186 -0
- package/web-ui/partials/index/panel-docs.html +1 -1
- package/web-ui/partials/index/panel-market.html +3 -0
- package/web-ui/partials/index/panel-orchestration.html +105 -111
- package/web-ui/partials/index/panel-plugins.html +48 -12
- package/web-ui/partials/index/panel-sessions.html +12 -3
- package/web-ui/partials/index/panel-settings.html +1 -1
- package/web-ui/partials/index/panel-usage.html +7 -6
- package/web-ui/styles/controls-forms.css +16 -2
- package/web-ui/styles/dashboard.css +274 -0
- package/web-ui/styles/layout-shell.css +11 -5
- package/web-ui/styles/navigation-panels.css +8 -0
- package/web-ui/styles/plugins-panel.css +5 -0
- package/web-ui/styles/sessions-list.css +3 -3
- package/web-ui/styles/sessions-usage.css +37 -0
- package/web-ui/styles/skills-market.css +12 -2
- package/web-ui/styles/task-orchestration.css +57 -11
- package/web-ui/styles.css +1 -0
- package/res/logo.png +0 -0
|
@@ -1,220 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
const safe = item && typeof item === 'object' ? item : {};
|
|
3
|
-
const id = typeof safe.id === 'string' ? safe.id.trim() : '';
|
|
4
|
-
const name = typeof safe.name === 'string' ? safe.name.trim() : '';
|
|
5
|
-
const description = typeof safe.description === 'string' ? safe.description.trim() : '';
|
|
6
|
-
const template = typeof safe.template === 'string' ? safe.template : '';
|
|
7
|
-
const updatedAt = typeof safe.updatedAt === 'string' ? safe.updatedAt : '';
|
|
8
|
-
const createdAt = typeof safe.createdAt === 'string' ? safe.createdAt : updatedAt;
|
|
9
|
-
const isBuiltin = safe.isBuiltin === true;
|
|
10
|
-
return {
|
|
11
|
-
id,
|
|
12
|
-
name,
|
|
13
|
-
description,
|
|
14
|
-
template,
|
|
15
|
-
createdAt,
|
|
16
|
-
updatedAt,
|
|
17
|
-
isBuiltin
|
|
18
|
-
};
|
|
19
|
-
}
|
|
1
|
+
import { createPluginsComputed } from '../../plugins/prompt-templates/computed.mjs';
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function parseTemplateVariables(templateText) {
|
|
24
|
-
const text = typeof templateText === 'string' ? templateText : '';
|
|
25
|
-
const vars = new Set();
|
|
26
|
-
const re = /\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g;
|
|
27
|
-
for (;;) {
|
|
28
|
-
const match = re.exec(text);
|
|
29
|
-
if (!match) break;
|
|
30
|
-
const name = String(match[1] || '').trim();
|
|
31
|
-
if (name) vars.add(name);
|
|
32
|
-
}
|
|
33
|
-
return Array.from(vars).sort((a, b) => a.localeCompare(b, 'en-US'));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function parseTemplateParts(templateText) {
|
|
37
|
-
const text = typeof templateText === 'string' ? templateText : '';
|
|
38
|
-
const parts = [];
|
|
39
|
-
const re = /\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g;
|
|
40
|
-
let lastIndex = 0;
|
|
41
|
-
for (;;) {
|
|
42
|
-
const match = re.exec(text);
|
|
43
|
-
if (!match) break;
|
|
44
|
-
const matchIndex = match.index;
|
|
45
|
-
if (matchIndex > lastIndex) {
|
|
46
|
-
parts.push({ type: 'text', value: text.slice(lastIndex, matchIndex) });
|
|
47
|
-
}
|
|
48
|
-
const name = String(match[1] || '').trim();
|
|
49
|
-
parts.push({ type: 'var', name: name || '' });
|
|
50
|
-
lastIndex = matchIndex + match[0].length;
|
|
51
|
-
}
|
|
52
|
-
if (lastIndex < text.length) {
|
|
53
|
-
parts.push({ type: 'text', value: text.slice(lastIndex) });
|
|
54
|
-
}
|
|
55
|
-
return parts.filter((part) => {
|
|
56
|
-
if (!part) return false;
|
|
57
|
-
if (part.type === 'text') return typeof part.value === 'string' && part.value.length > 0;
|
|
58
|
-
if (part.type === 'var') return typeof part.name === 'string' && part.name.trim().length > 0;
|
|
59
|
-
return false;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getCachedTemplateParts(templateKey, templateText) {
|
|
64
|
-
const cacheKey = `${templateKey}::${templateText}`;
|
|
65
|
-
if (TEMPLATE_PARTS_CACHE.has(cacheKey)) {
|
|
66
|
-
return TEMPLATE_PARTS_CACHE.get(cacheKey);
|
|
67
|
-
}
|
|
68
|
-
const parts = parseTemplateParts(templateText);
|
|
69
|
-
TEMPLATE_PARTS_CACHE.set(cacheKey, parts);
|
|
70
|
-
// simple cap to avoid unbounded growth
|
|
71
|
-
if (TEMPLATE_PARTS_CACHE.size > 64) {
|
|
72
|
-
const firstKey = TEMPLATE_PARTS_CACHE.keys().next().value;
|
|
73
|
-
TEMPLATE_PARTS_CACHE.delete(firstKey);
|
|
74
|
-
}
|
|
75
|
-
return parts;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function formatIsoDateLabel(iso) {
|
|
79
|
-
if (!iso) return '';
|
|
80
|
-
const ms = Date.parse(iso);
|
|
81
|
-
if (!Number.isFinite(ms)) return '';
|
|
82
|
-
const date = new Date(ms);
|
|
83
|
-
const y = String(date.getFullYear());
|
|
84
|
-
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
85
|
-
const d = String(date.getDate()).padStart(2, '0');
|
|
86
|
-
return `${y}-${m}-${d}`;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function renderTemplate(templateText, values = {}) {
|
|
90
|
-
const text = typeof templateText === 'string' ? templateText : '';
|
|
91
|
-
const map = values && typeof values === 'object' ? values : {};
|
|
92
|
-
return text.replace(/\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g, (_whole, key) => {
|
|
93
|
-
const name = String(key || '').trim();
|
|
94
|
-
if (!name) return '';
|
|
95
|
-
const value = map[name];
|
|
96
|
-
return value == null ? '' : String(value);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function createPluginsComputed() {
|
|
101
|
-
return {
|
|
102
|
-
pluginsCatalog() {
|
|
103
|
-
return [
|
|
104
|
-
{
|
|
105
|
-
id: 'prompt-templates',
|
|
106
|
-
title: 'Prompt Templates',
|
|
107
|
-
description: 'Standardized, template-driven prompts with variables and copy/export helpers.',
|
|
108
|
-
statusLabel: 'standard',
|
|
109
|
-
tone: 'configured'
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
promptTemplatesList() {
|
|
115
|
-
const list = Array.isArray(this.promptTemplatesListRaw) ? this.promptTemplatesListRaw : [];
|
|
116
|
-
return list
|
|
117
|
-
.map((item) => normalizePromptTemplateEntry(item))
|
|
118
|
-
.filter((item) => item.id && item.name)
|
|
119
|
-
.map((item) => {
|
|
120
|
-
const vars = parseTemplateVariables(item.template);
|
|
121
|
-
const updatedLabel = formatIsoDateLabel(item.updatedAt || item.createdAt);
|
|
122
|
-
return {
|
|
123
|
-
...item,
|
|
124
|
-
vars,
|
|
125
|
-
varCount: vars.length,
|
|
126
|
-
updatedLabel: updatedLabel || '—'
|
|
127
|
-
};
|
|
128
|
-
})
|
|
129
|
-
.sort((a, b) => {
|
|
130
|
-
const aTime = Date.parse(a.updatedAt || a.createdAt || '') || 0;
|
|
131
|
-
const bTime = Date.parse(b.updatedAt || b.createdAt || '') || 0;
|
|
132
|
-
if (bTime !== aTime) return bTime - aTime;
|
|
133
|
-
return a.name.localeCompare(b.name, 'en-US');
|
|
134
|
-
});
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
filteredPromptTemplates() {
|
|
138
|
-
const keyword = typeof this.promptTemplatesKeyword === 'string'
|
|
139
|
-
? this.promptTemplatesKeyword.trim().toLowerCase()
|
|
140
|
-
: '';
|
|
141
|
-
const list = this.promptTemplatesList;
|
|
142
|
-
if (!keyword) return list;
|
|
143
|
-
return list.filter((item) => {
|
|
144
|
-
return (
|
|
145
|
-
item.name.toLowerCase().includes(keyword)
|
|
146
|
-
|| (item.description && item.description.toLowerCase().includes(keyword))
|
|
147
|
-
|| item.vars.some((v) => v.toLowerCase().includes(keyword))
|
|
148
|
-
);
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
promptTemplateDraft() {
|
|
153
|
-
const draft = this.promptTemplateDraftRaw;
|
|
154
|
-
if (!draft || typeof draft !== 'object') return null;
|
|
155
|
-
const id = typeof draft.id === 'string' ? draft.id : '';
|
|
156
|
-
const name = typeof draft.name === 'string' ? draft.name : '';
|
|
157
|
-
if (!id && !name) return null;
|
|
158
|
-
return normalizePromptTemplateEntry(draft);
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
promptTemplateVars() {
|
|
162
|
-
const draft = this.promptTemplateDraft;
|
|
163
|
-
if (!draft) return [];
|
|
164
|
-
return parseTemplateVariables(draft.template);
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
promptTemplateVarValues() {
|
|
168
|
-
const values = this.promptTemplateVarValuesRaw;
|
|
169
|
-
return values && typeof values === 'object' ? values : {};
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
renderedPrompt() {
|
|
173
|
-
const draft = this.promptTemplateDraft;
|
|
174
|
-
if (!draft) return '';
|
|
175
|
-
return renderTemplate(draft.template, this.promptTemplateVarValues);
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
promptComposerVarValues() {
|
|
179
|
-
const values = this.promptComposerVarValuesRaw;
|
|
180
|
-
return values && typeof values === 'object' ? values : {};
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
promptComposerActiveTemplate() {
|
|
184
|
-
const id = typeof this.promptComposerSelectedTemplateId === 'string'
|
|
185
|
-
? this.promptComposerSelectedTemplateId.trim()
|
|
186
|
-
: '';
|
|
187
|
-
if (!id) return null;
|
|
188
|
-
const list = this.promptTemplatesList;
|
|
189
|
-
return list.find((item) => item.id === id) || null;
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
promptComposerParts() {
|
|
193
|
-
const tpl = this.promptComposerActiveTemplate;
|
|
194
|
-
if (!tpl) return [];
|
|
195
|
-
const key = tpl.id || tpl.name || 'template';
|
|
196
|
-
return getCachedTemplateParts(key, tpl.template);
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
promptComposerRendered() {
|
|
200
|
-
const tpl = this.promptComposerActiveTemplate;
|
|
201
|
-
if (!tpl) return '';
|
|
202
|
-
return renderTemplate(tpl.template, this.promptComposerVarValues);
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
promptComposerPickerList() {
|
|
206
|
-
const keyword = typeof this.promptComposerPickerKeyword === 'string'
|
|
207
|
-
? this.promptComposerPickerKeyword.trim().toLowerCase()
|
|
208
|
-
: '';
|
|
209
|
-
const list = this.promptTemplatesList;
|
|
210
|
-
if (!keyword) return list;
|
|
211
|
-
return list.filter((item) => {
|
|
212
|
-
return (
|
|
213
|
-
item.name.toLowerCase().includes(keyword)
|
|
214
|
-
|| (item.description && item.description.toLowerCase().includes(keyword))
|
|
215
|
-
|| item.vars.some((v) => v.toLowerCase().includes(keyword))
|
|
216
|
-
);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
}
|
|
3
|
+
export { createPluginsComputed };
|