codedash-app 1.6.0 → 1.7.0
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/bin/cli.js +50 -0
- package/package.json +1 -1
- package/src/data.js +17 -2
- package/src/frontend/app.js +2 -3
package/bin/cli.js
CHANGED
|
@@ -57,6 +57,53 @@ switch (command) {
|
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
case 'update':
|
|
61
|
+
case 'upgrade': {
|
|
62
|
+
const { execSync: execU } = require('child_process');
|
|
63
|
+
console.log('\n \x1b[36m\x1b[1mUpdating codedash-app...\x1b[0m\n');
|
|
64
|
+
try {
|
|
65
|
+
execU('npm i -g codedash-app@latest', { stdio: 'inherit' });
|
|
66
|
+
const newPkg = require('../package.json');
|
|
67
|
+
console.log(`\n \x1b[32mUpdated to v${newPkg.version}!\x1b[0m`);
|
|
68
|
+
console.log(' Run \x1b[2mcodedash restart\x1b[0m to apply.\n');
|
|
69
|
+
} catch (e) {
|
|
70
|
+
console.error(' \x1b[31mUpdate failed.\x1b[0m Try: npm i -g codedash-app@latest\n');
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
case 'restart': {
|
|
76
|
+
const { execSync } = require('child_process');
|
|
77
|
+
const portArg = args.find(a => a.startsWith('--port='));
|
|
78
|
+
const port = portArg ? parseInt(portArg.split('=')[1]) : DEFAULT_PORT;
|
|
79
|
+
console.log(`\n Stopping codedash on port ${port}...`);
|
|
80
|
+
try {
|
|
81
|
+
execSync(`lsof -ti:${port} | xargs kill -9 2>/dev/null`, { stdio: 'pipe' });
|
|
82
|
+
console.log(' Stopped.');
|
|
83
|
+
} catch {
|
|
84
|
+
console.log(' No running instance found.');
|
|
85
|
+
}
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
console.log(' Starting...\n');
|
|
88
|
+
const noBrowser = args.includes('--no-browser');
|
|
89
|
+
startServer(port, !noBrowser);
|
|
90
|
+
}, 500);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
case 'stop': {
|
|
95
|
+
const { execSync: execS } = require('child_process');
|
|
96
|
+
const pArg = args.find(a => a.startsWith('--port='));
|
|
97
|
+
const p = pArg ? parseInt(pArg.split('=')[1]) : DEFAULT_PORT;
|
|
98
|
+
try {
|
|
99
|
+
execS(`lsof -ti:${p} | xargs kill -9 2>/dev/null`, { stdio: 'pipe' });
|
|
100
|
+
console.log(`\n codedash stopped (port ${p})\n`);
|
|
101
|
+
} catch {
|
|
102
|
+
console.log(`\n No codedash running on port ${p}\n`);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
|
|
60
107
|
case 'export': {
|
|
61
108
|
const outPath = args[1] || `codedash-export-${new Date().toISOString().slice(0,10)}.tar.gz`;
|
|
62
109
|
exportArchive(outPath);
|
|
@@ -90,6 +137,9 @@ switch (command) {
|
|
|
90
137
|
|
|
91
138
|
\x1b[1mUsage:\x1b[0m
|
|
92
139
|
codedash run [port] [--no-browser] Start the dashboard server
|
|
140
|
+
codedash update Update to latest version
|
|
141
|
+
codedash restart [--port=N] Restart the server
|
|
142
|
+
codedash stop [--port=N] Stop the server
|
|
93
143
|
codedash list [limit] List sessions in terminal
|
|
94
144
|
codedash stats Show session statistics
|
|
95
145
|
codedash export [file.tar.gz] Export all sessions to archive
|
package/package.json
CHANGED
package/src/data.js
CHANGED
|
@@ -214,7 +214,7 @@ function loadSessionDetail(sessionId, project) {
|
|
|
214
214
|
const role = entry.payload.role;
|
|
215
215
|
if (role === 'user' || role === 'assistant') {
|
|
216
216
|
const content = extractContent(entry.payload.content);
|
|
217
|
-
if (content && !
|
|
217
|
+
if (content && !isSystemMessage(content)) {
|
|
218
218
|
messages.push({ role: role, content: content.slice(0, 2000), uuid: '' });
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -370,6 +370,21 @@ function findSessionFile(sessionId, project) {
|
|
|
370
370
|
return null;
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
+
function isSystemMessage(text) {
|
|
374
|
+
if (!text) return true;
|
|
375
|
+
var t = text.trim();
|
|
376
|
+
if (t === 'exit' || t === 'quit' || t === '/exit') return true;
|
|
377
|
+
if (t.startsWith('<permissions')) return true;
|
|
378
|
+
if (t.startsWith('<environment_context')) return true;
|
|
379
|
+
if (t.startsWith('<collaboration_mode')) return true;
|
|
380
|
+
if (t.startsWith('# AGENTS.md')) return true;
|
|
381
|
+
if (t.startsWith('<INSTRUCTIONS>')) return true;
|
|
382
|
+
// Codex developer role system prompts
|
|
383
|
+
if (t.startsWith('You are Codex')) return true;
|
|
384
|
+
if (t.startsWith('Filesystem sandboxing')) return true;
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
|
|
373
388
|
function extractContent(raw) {
|
|
374
389
|
if (!raw) return '';
|
|
375
390
|
if (typeof raw === 'string') return raw;
|
|
@@ -410,7 +425,7 @@ function getSessionPreview(sessionId, project, limit) {
|
|
|
410
425
|
if (role === 'user' || role === 'assistant') {
|
|
411
426
|
const content = extractContent(entry.payload.content);
|
|
412
427
|
// Skip system-like messages
|
|
413
|
-
if (content && !
|
|
428
|
+
if (content && !isSystemMessage(content)) {
|
|
414
429
|
messages.push({ role: role, content: content.slice(0, 300) });
|
|
415
430
|
}
|
|
416
431
|
}
|
package/src/frontend/app.js
CHANGED
|
@@ -1373,10 +1373,9 @@ async function checkForUpdates() {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
1375
|
function copyUpdate() {
|
|
1376
|
-
var
|
|
1377
|
-
var cmd = banner ? banner.dataset.cmd : 'npm update -g codedash-app';
|
|
1376
|
+
var cmd = 'codedash update && codedash restart';
|
|
1378
1377
|
navigator.clipboard.writeText(cmd).then(function() {
|
|
1379
|
-
showToast('Copied: ' + cmd);
|
|
1378
|
+
showToast('Copied: ' + cmd + ' (run in terminal)');
|
|
1380
1379
|
});
|
|
1381
1380
|
}
|
|
1382
1381
|
|