codexmate 0.0.37 → 0.0.39

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.
Files changed (38) hide show
  1. package/cli/analytics-export-args.js +68 -0
  2. package/cli/builtin-proxy.js +626 -207
  3. package/cli/openai-bridge.js +541 -210
  4. package/cli/session-usage.js +187 -1
  5. package/cli.js +84 -2
  6. package/package.json +1 -1
  7. package/web-ui/app.js +12 -3
  8. package/web-ui/modules/app.computed.main-tabs.mjs +37 -30
  9. package/web-ui/modules/app.methods.claude-config.mjs +111 -9
  10. package/web-ui/modules/app.methods.openclaw-editing.mjs +48 -0
  11. package/web-ui/modules/app.methods.openclaw-persist.mjs +13 -7
  12. package/web-ui/modules/app.methods.providers.mjs +36 -10
  13. package/web-ui/modules/app.methods.runtime.mjs +76 -1
  14. package/web-ui/modules/app.methods.startup-claude.mjs +1 -0
  15. package/web-ui/modules/config-mode.computed.mjs +3 -3
  16. package/web-ui/modules/i18n.dict.mjs +13 -0
  17. package/web-ui/modules/i18n.mjs +65 -16
  18. package/web-ui/modules/skills.methods.mjs +1 -1
  19. package/web-ui/partials/index/layout-header.html +16 -46
  20. package/web-ui/partials/index/modal-openclaw-config.html +135 -71
  21. package/web-ui/partials/index/modal-webhook.html +8 -8
  22. package/web-ui/partials/index/modals-basic.html +56 -16
  23. package/web-ui/partials/index/panel-config-claude.html +20 -20
  24. package/web-ui/partials/index/panel-config-codex.html +5 -5
  25. package/web-ui/partials/index/panel-config-openclaw.html +70 -64
  26. package/web-ui/partials/index/panel-dashboard.html +62 -77
  27. package/web-ui/partials/index/panel-settings.html +28 -7
  28. package/web-ui/partials/index/panel-trash.html +14 -14
  29. package/web-ui/res/web-ui-render.precompiled.js +846 -539
  30. package/web-ui/styles/controls-forms.css +6 -0
  31. package/web-ui/styles/dashboard.css +46 -14
  32. package/web-ui/styles/layout-shell.css +45 -0
  33. package/web-ui/styles/navigation-panels.css +3 -3
  34. package/web-ui/styles/openclaw-structured.css +383 -33
  35. package/web-ui/styles/responsive.css +68 -0
  36. package/web-ui/styles/sessions-usage.css +105 -9
  37. package/web-ui/styles/settings-panel.css +4 -0
  38. package/web-ui/partials/index/panel-config-codex.html.bak +0 -337
@@ -0,0 +1,68 @@
1
+ function parseAnalyticsExportArgs(args = []) {
2
+ const options = {
3
+ format: 'csv',
4
+ source: 'all',
5
+ output: ''
6
+ };
7
+ const errors = [];
8
+ for (let index = 0; index < args.length; index += 1) {
9
+ const token = String(args[index] || '');
10
+ const readValue = (flag) => {
11
+ if (token.startsWith(`${flag}=`)) {
12
+ return token.slice(flag.length + 1);
13
+ }
14
+ const value = args[index + 1];
15
+ index += 1;
16
+ return value;
17
+ };
18
+ if (token === '--format' || token.startsWith('--format=')) {
19
+ options.format = String(readValue('--format') || '').trim().toLowerCase();
20
+ continue;
21
+ }
22
+ if (token === '--from' || token.startsWith('--from=')) {
23
+ options.from = String(readValue('--from') || '').trim();
24
+ continue;
25
+ }
26
+ if (token === '--to' || token.startsWith('--to=')) {
27
+ options.to = String(readValue('--to') || '').trim();
28
+ continue;
29
+ }
30
+ if (token === '--model' || token.startsWith('--model=')) {
31
+ options.model = String(readValue('--model') || '').trim();
32
+ continue;
33
+ }
34
+ if (token === '--source' || token.startsWith('--source=')) {
35
+ options.source = String(readValue('--source') || '').trim().toLowerCase();
36
+ continue;
37
+ }
38
+ if (token === '--output' || token === '-o' || token.startsWith('--output=')) {
39
+ options.output = String(readValue(token === '-o' ? '-o' : '--output') || '').trim();
40
+ continue;
41
+ }
42
+ if (token === '--force-refresh') {
43
+ options.forceRefresh = true;
44
+ continue;
45
+ }
46
+ if (token === '--help' || token === '-h') {
47
+ options.help = true;
48
+ continue;
49
+ }
50
+ if (token) {
51
+ errors.push(`未知参数 ${token}`);
52
+ }
53
+ }
54
+ if (options.format !== 'csv' && options.format !== 'json') {
55
+ errors.push('--format 必须是 csv 或 json');
56
+ }
57
+ if (options.source && !['codex', 'claude', 'gemini', 'codebuddy', 'all'].includes(options.source)) {
58
+ errors.push('--source 必须是 codex、claude、gemini、codebuddy 或 all');
59
+ }
60
+ return {
61
+ options,
62
+ error: errors.join(';')
63
+ };
64
+ }
65
+
66
+ module.exports = {
67
+ parseAnalyticsExportArgs
68
+ };