@goodandready/dsh-cron 0.2.30 → 0.2.32

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/lib/client.js CHANGED
@@ -3149,7 +3149,7 @@ window.__ModuleLoader__.load({
3149
3149
  },
3150
3150
  React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', marginBottom: '4px' } },
3151
3151
  React.createElement('span', { style: { fontWeight: '600', color: r.status === 'success' ? 'var(--dsh-cron-success)' : 'var(--dsh-cron-danger)' } }, (r.status || 'unknown').toUpperCase()),
3152
- React.createElement('span', { style: { color: 'var(--dsw-alias-label-secondary, #888)' } }, new Date(r.timestamp || r.startedAt || Date.now()).toLocaleString())
3152
+ React.createElement('span', { style: { color: 'var(--dsw-alias-label-secondary, #888)' } }, (r.at || r.timestamp || r.startedAt) ? new Date(r.at || r.timestamp || r.startedAt).toLocaleString() : "")
3153
3153
  ),
3154
3154
  r.durationMs > 0 && React.createElement('div', { style: { color: 'var(--dsw-alias-label-secondary, #888)', marginBottom: '4px' } }, 'Duration: ' + r.durationMs + 'ms'),
3155
3155
  r.error && React.createElement('div', { style: { color: 'var(--dsh-cron-danger)', marginBottom: '4px' } }, 'Error: ' + r.error),
package/lib/store.js CHANGED
@@ -457,7 +457,7 @@ export class TaskStore {
457
457
  const archivePath = path.join(dir, 'tasks-history-archive.json');
458
458
  if (!fs.existsSync(archivePath)) return { runs: [], total: 0 };
459
459
  const archive = JSON.parse(fs.readFileSync(archivePath, 'utf-8')) || {};
460
- let runs = Array.isArray(archive[id]) ? archive[id] : [];
460
+ let runs = Array.isArray(archive[id]) ? [...archive[id]].sort((a, b) => ((b.at || b.timestamp || b.startedAt || 0) - (a.at || a.timestamp || a.startedAt || 0))) : [];
461
461
  if (search && search.trim()) {
462
462
  const q = search.toLowerCase();
463
463
  runs = runs.filter(r => (r.output && r.output.toLowerCase().includes(q)) || (r.error && r.error.toLowerCase().includes(q)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-cron",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "description": "Background automation runner for DSH: isolated agent runs, script/HTTP/SSH/Docker runtimes, cost guard, notifications, heartbeats.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -16,12 +16,6 @@
16
16
  "README.md",
17
17
  "LICENSE"
18
18
  ],
19
- "scripts": {
20
- "test": "node --test test/*.test.mjs",
21
- "build:client": "node scripts/build-client.mjs",
22
- "pretest": "node scripts/build-client.mjs",
23
- "preflight": "node scripts/ci-preflight.mjs"
24
- },
25
19
  "keywords": [
26
20
  "dsh",
27
21
  "dsh-plugin",
@@ -89,5 +83,11 @@
89
83
  "publishConfig": {
90
84
  "registry": "https://registry.npmjs.org",
91
85
  "access": "public"
86
+ },
87
+ "scripts": {
88
+ "test": "node --test test/*.test.mjs",
89
+ "build:client": "node scripts/build-client.mjs",
90
+ "pretest": "node scripts/build-client.mjs",
91
+ "preflight": "node scripts/ci-preflight.mjs"
92
92
  }
93
- }
93
+ }