codexmate 0.0.20 → 0.0.21
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.en.md +349 -259
- package/README.md +284 -252
- package/cli/agents-files.js +162 -0
- package/cli/archive-helpers.js +446 -0
- package/cli/auth-profiles.js +359 -0
- package/cli/builtin-proxy.js +580 -0
- package/cli/claude-proxy.js +998 -0
- package/cli/config-bootstrap.js +384 -0
- package/cli/config-health.js +338 -338
- package/cli/openclaw-config.js +629 -0
- package/cli/skills.js +1141 -0
- package/cli/zip-commands.js +510 -0
- package/cli.js +13101 -13497
- package/lib/cli-file-utils.js +151 -151
- package/lib/cli-models-utils.js +419 -311
- package/lib/cli-network-utils.js +164 -164
- package/lib/cli-path-utils.js +69 -0
- package/lib/cli-session-utils.js +121 -121
- package/lib/cli-sessions.js +386 -0
- package/lib/cli-utils.js +155 -155
- package/lib/download-artifacts.js +77 -0
- package/lib/mcp-stdio.js +440 -440
- package/lib/task-orchestrator.js +869 -0
- package/lib/text-diff.js +303 -303
- package/lib/workflow-engine.js +340 -340
- package/package.json +74 -70
- package/res/json5.min.js +1 -1
- package/res/vue.global.prod.js +13 -0
- package/web-ui/app.js +530 -397
- package/web-ui/index.html +33 -30
- package/web-ui/logic.agents-diff.mjs +386 -386
- package/web-ui/logic.claude.mjs +168 -108
- package/web-ui/logic.mjs +5 -5
- package/web-ui/logic.runtime.mjs +124 -124
- package/web-ui/logic.sessions.mjs +581 -263
- package/web-ui/modules/api.mjs +90 -69
- package/web-ui/modules/app.computed.dashboard.mjs +113 -113
- package/web-ui/modules/app.computed.index.mjs +15 -13
- package/web-ui/modules/app.computed.main-tabs.mjs +195 -0
- package/web-ui/modules/app.computed.session.mjs +507 -141
- package/web-ui/modules/app.constants.mjs +15 -15
- package/web-ui/modules/app.methods.agents.mjs +493 -493
- package/web-ui/modules/app.methods.claude-config.mjs +174 -174
- package/web-ui/modules/app.methods.codex-config.mjs +640 -640
- package/web-ui/modules/app.methods.index.mjs +88 -86
- package/web-ui/modules/app.methods.install.mjs +149 -157
- package/web-ui/modules/app.methods.navigation.mjs +619 -478
- package/web-ui/modules/app.methods.openclaw-core.mjs +814 -514
- package/web-ui/modules/app.methods.openclaw-editing.mjs +372 -337
- package/web-ui/modules/app.methods.openclaw-persist.mjs +369 -251
- package/web-ui/modules/app.methods.providers.mjs +363 -265
- package/web-ui/modules/app.methods.runtime.mjs +323 -323
- package/web-ui/modules/app.methods.session-actions.mjs +520 -457
- package/web-ui/modules/app.methods.session-browser.mjs +626 -435
- package/web-ui/modules/app.methods.session-timeline.mjs +448 -441
- package/web-ui/modules/app.methods.session-trash.mjs +422 -419
- package/web-ui/modules/app.methods.startup-claude.mjs +412 -406
- package/web-ui/modules/app.methods.task-orchestration.mjs +471 -0
- package/web-ui/modules/config-mode.computed.mjs +126 -124
- package/web-ui/modules/skills.computed.mjs +107 -107
- package/web-ui/modules/skills.methods.mjs +481 -481
- package/web-ui/partials/index/layout-footer.html +13 -69
- package/web-ui/partials/index/layout-header.html +402 -337
- package/web-ui/partials/index/modal-config-template-agents.html +125 -125
- package/web-ui/partials/index/modal-confirm-toast.html +32 -32
- package/web-ui/partials/index/modal-health-check.html +72 -72
- package/web-ui/partials/index/modal-openclaw-config.html +280 -275
- package/web-ui/partials/index/modal-skills.html +184 -184
- package/web-ui/partials/index/modals-basic.html +156 -196
- package/web-ui/partials/index/panel-config-claude.html +126 -100
- package/web-ui/partials/index/panel-config-codex.html +237 -237
- package/web-ui/partials/index/panel-config-openclaw.html +78 -84
- package/web-ui/partials/index/panel-docs.html +130 -0
- package/web-ui/partials/index/panel-market.html +174 -174
- package/web-ui/partials/index/panel-orchestration.html +397 -0
- package/web-ui/partials/index/panel-sessions.html +292 -387
- package/web-ui/partials/index/panel-settings.html +190 -166
- package/web-ui/partials/index/panel-usage.html +213 -0
- package/web-ui/session-helpers.mjs +559 -362
- package/web-ui/source-bundle.cjs +233 -233
- package/web-ui/styles/base-theme.css +271 -373
- package/web-ui/styles/controls-forms.css +360 -354
- package/web-ui/styles/docs-panel.css +182 -0
- package/web-ui/styles/feedback.css +108 -108
- package/web-ui/styles/health-check-dialog.css +144 -144
- package/web-ui/styles/layout-shell.css +376 -330
- package/web-ui/styles/modals-core.css +464 -449
- package/web-ui/styles/navigation-panels.css +348 -381
- package/web-ui/styles/openclaw-structured.css +266 -266
- package/web-ui/styles/responsive.css +450 -416
- package/web-ui/styles/sessions-list.css +400 -414
- package/web-ui/styles/sessions-preview.css +411 -405
- package/web-ui/styles/sessions-toolbar-trash.css +243 -243
- package/web-ui/styles/sessions-usage.css +628 -276
- package/web-ui/styles/skills-list.css +296 -298
- package/web-ui/styles/skills-market.css +335 -335
- package/web-ui/styles/task-orchestration.css +776 -0
- package/web-ui/styles/titles-cards.css +408 -407
- package/web-ui/styles.css +18 -16
- package/web-ui.html +17 -17
- package/res/screenshot.png +0 -0
- package/res/vue.global.js +0 -18552
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
|
|
5
|
+
const DEFAULT_DOWNLOAD_ARTIFACT_TTL_MS = 10 * 60 * 1000;
|
|
6
|
+
const g_downloadArtifacts = new Map();
|
|
7
|
+
|
|
8
|
+
function registerDownloadArtifact(filePath, options = {}) {
|
|
9
|
+
const token = crypto.randomBytes(16).toString('hex');
|
|
10
|
+
const fileName = typeof options.fileName === 'string' && options.fileName.trim()
|
|
11
|
+
? options.fileName.trim()
|
|
12
|
+
: path.basename(filePath || '');
|
|
13
|
+
const ttlMs = Number.isFinite(options.ttlMs) && options.ttlMs > 0
|
|
14
|
+
? Math.floor(options.ttlMs)
|
|
15
|
+
: DEFAULT_DOWNLOAD_ARTIFACT_TTL_MS;
|
|
16
|
+
const expiresAt = Date.now() + ttlMs;
|
|
17
|
+
const deleteAfterDownload = options.deleteAfterDownload !== false;
|
|
18
|
+
|
|
19
|
+
g_downloadArtifacts.set(token, {
|
|
20
|
+
filePath,
|
|
21
|
+
fileName,
|
|
22
|
+
deleteAfterDownload,
|
|
23
|
+
expiresAt
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
const artifact = g_downloadArtifacts.get(token);
|
|
28
|
+
if (!artifact) return;
|
|
29
|
+
if (Date.now() < artifact.expiresAt) return;
|
|
30
|
+
g_downloadArtifacts.delete(token);
|
|
31
|
+
if (artifact.deleteAfterDownload && artifact.filePath && fs.existsSync(artifact.filePath)) {
|
|
32
|
+
try {
|
|
33
|
+
fs.unlinkSync(artifact.filePath);
|
|
34
|
+
} catch (_) {}
|
|
35
|
+
}
|
|
36
|
+
}, ttlMs + 2000);
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
token,
|
|
40
|
+
fileName,
|
|
41
|
+
downloadPath: `/download/${encodeURIComponent(token)}`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function resolveDownloadArtifact(tokenOrFileName, options = {}) {
|
|
46
|
+
if (!tokenOrFileName) return null;
|
|
47
|
+
const token = typeof tokenOrFileName === 'string' ? tokenOrFileName.trim() : '';
|
|
48
|
+
if (!token) return null;
|
|
49
|
+
|
|
50
|
+
const artifact = g_downloadArtifacts.get(token);
|
|
51
|
+
if (!artifact) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
if (Date.now() > artifact.expiresAt) {
|
|
55
|
+
g_downloadArtifacts.delete(token);
|
|
56
|
+
if (artifact.deleteAfterDownload && artifact.filePath && fs.existsSync(artifact.filePath)) {
|
|
57
|
+
try {
|
|
58
|
+
fs.unlinkSync(artifact.filePath);
|
|
59
|
+
} catch (_) {}
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
if (options && options.consume === true) {
|
|
64
|
+
g_downloadArtifacts.delete(token);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
token,
|
|
68
|
+
...artifact
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
DEFAULT_DOWNLOAD_ARTIFACT_TTL_MS,
|
|
74
|
+
registerDownloadArtifact,
|
|
75
|
+
resolveDownloadArtifact
|
|
76
|
+
};
|
|
77
|
+
|