kryptheon 0.1.75 → 0.1.76
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/kryptheon.js +8 -0
- package/kryptheon-dashboard-page.js +72 -1
- package/kryptheon-dashboard.html +11 -0
- package/package.json +2 -2
package/bin/kryptheon.js
CHANGED
|
@@ -3908,6 +3908,14 @@ async function dashboardCommand() {
|
|
|
3908
3908
|
console.log(' It is only reachable from this machine. Everything else is a button');
|
|
3909
3909
|
console.log(' on that page. Press Ctrl+C here to stop it.');
|
|
3910
3910
|
console.log('');
|
|
3911
|
+
// This window IS Kryptheon; the page is only its screen. Closed, or paused by a click inside it (Windows
|
|
3912
|
+
// QuickEdit), every button on the page stops working - said here, where it happens (2026-11-22).
|
|
3913
|
+
console.log(' ==================================================================');
|
|
3914
|
+
console.log(' KEEP THIS WINDOW OPEN while you use Kryptheon.');
|
|
3915
|
+
console.log(' Minimize it - do not close it, and do not click inside it:');
|
|
3916
|
+
console.log(' a click inside pauses it ("Select" in the title). Esc resumes.');
|
|
3917
|
+
console.log(' ==================================================================');
|
|
3918
|
+
console.log('');
|
|
3911
3919
|
|
|
3912
3920
|
// While the page is open, Kryptheon notices changes by itself: once a change
|
|
3913
3921
|
// has settled, it looks, runs the fast checks, and the page shows what
|
|
@@ -95,12 +95,80 @@
|
|
|
95
95
|
body: JSON.stringify(body),
|
|
96
96
|
}).then(function (res) {
|
|
97
97
|
return res.json().then(function (data) {
|
|
98
|
+
// Kryptheon was started again since this page was opened: its token is new, so this page is too old to use.
|
|
99
|
+
if (res.status === 403 && data.why === 'missing or wrong token') {
|
|
100
|
+
window.location.reload();
|
|
101
|
+
throw new Error('Kryptheon was started again - this page is reloading.');
|
|
102
|
+
}
|
|
98
103
|
if (!res.ok || data.ok === false) throw new Error(data.why || 'the dashboard answered ' + res.status);
|
|
99
104
|
return data;
|
|
100
105
|
});
|
|
106
|
+
}, function (err) {
|
|
107
|
+
// No answer at all: the black window - Kryptheon itself - is closed or paused. Never "Failed to fetch".
|
|
108
|
+
if (isNoAnswer(err)) { markStopped(); throw new Error(STOPPED_WORDS); }
|
|
109
|
+
throw err;
|
|
101
110
|
});
|
|
102
111
|
}
|
|
103
112
|
|
|
113
|
+
/* ----------------------------- Kryptheon stopped ----------------------------- */
|
|
114
|
+
|
|
115
|
+
// The page is only a screen; Kryptheon is the black window that opened it. Closed, or paused by a click inside it
|
|
116
|
+
// (Windows QuickEdit), it answers nothing - and every button said "Failed to fetch" (2026-11-22). A heartbeat
|
|
117
|
+
// notices within seconds, a box says what happened and how to start it again, and when Kryptheon is back the
|
|
118
|
+
// page reloads itself: a new start has a new token, so the old page could not press anything.
|
|
119
|
+
var STOPPED_WORDS = 'Kryptheon stopped on this computer - the box on the page says how to start it again.';
|
|
120
|
+
var misses = 0;
|
|
121
|
+
var stopped = false;
|
|
122
|
+
function isNoAnswer(err) { return !!err && (err.name === 'TypeError' || /Failed to fetch|NetworkError|Load failed/i.test(String(err.message))); }
|
|
123
|
+
function startCommand() {
|
|
124
|
+
var root = state && state.project && state.project.root;
|
|
125
|
+
var mac = /Mac/i.test(navigator.platform || '') || /Mac OS X/.test(navigator.userAgent || '');
|
|
126
|
+
if (mac) return (root ? 'cd "' + root + '" && ' : '') + 'npx -y kryptheon@latest dashboard';
|
|
127
|
+
return 'cmd /k ' + (root ? 'cd /d "' + root + '" && ' : '') + 'npx -y kryptheon@latest dashboard';
|
|
128
|
+
}
|
|
129
|
+
function markStopped() {
|
|
130
|
+
if (stopped) return;
|
|
131
|
+
stopped = true;
|
|
132
|
+
var box = byId('stoppedBox');
|
|
133
|
+
if (!box) return;
|
|
134
|
+
var mac = /Mac/i.test(navigator.platform || '') || /Mac OS X/.test(navigator.userAgent || '');
|
|
135
|
+
clear(box);
|
|
136
|
+
var card = el('div', 'stopped-card');
|
|
137
|
+
card.appendChild(el('h2', null, 'Kryptheon stopped on this computer'));
|
|
138
|
+
card.appendChild(el('p', null, 'This page is only the screen. Kryptheon itself is the black window that opened it' +
|
|
139
|
+
(mac ? ' (the Terminal window)' : '') + ' - and it is closed, or paused.'));
|
|
140
|
+
var ways = el('ul');
|
|
141
|
+
ways.appendChild(el('li', null, mac ? 'If the Terminal window is still open: click it. If it shows an error, start it again below.'
|
|
142
|
+
: 'If you see the black window in the taskbar: click it and press Esc. A click inside it pauses it - "Select" in its title means paused.'));
|
|
143
|
+
ways.appendChild(el('li', null, mac ? 'If it is closed: open Terminal, paste this and press Enter:'
|
|
144
|
+
: 'If it is closed: press Win+R, paste this and press Enter:'));
|
|
145
|
+
card.appendChild(ways);
|
|
146
|
+
var line = el('div', 'stopped-cmd');
|
|
147
|
+
var cmd = startCommand();
|
|
148
|
+
line.appendChild(el('code', null, cmd));
|
|
149
|
+
line.appendChild(button('sun sm', 'copy', 'Copy', function () { copy(cmd, 'Copied - paste it ' + (mac ? 'into Terminal' : 'into Win+R') + ' and press Enter'); }));
|
|
150
|
+
card.appendChild(line);
|
|
151
|
+
var wait = el('p', 'stopped-wait');
|
|
152
|
+
wait.appendChild(el('span', 'spin'));
|
|
153
|
+
wait.appendChild(document.createTextNode(' Waiting for Kryptheon - this page comes back by itself as soon as it starts.'));
|
|
154
|
+
card.appendChild(wait);
|
|
155
|
+
card.appendChild(el('p', 'fallback', 'Keep the black window open while you use Kryptheon: minimize it, never close it, never click inside it.'));
|
|
156
|
+
box.appendChild(card);
|
|
157
|
+
box.hidden = false;
|
|
158
|
+
byId('subline').textContent = 'Kryptheon stopped on this computer';
|
|
159
|
+
}
|
|
160
|
+
setInterval(function () {
|
|
161
|
+
fetch('/api/job', { cache: 'no-store' }).then(function (res) {
|
|
162
|
+
if (!res.ok) return;
|
|
163
|
+
misses = 0;
|
|
164
|
+
if (stopped) window.location.reload();
|
|
165
|
+
}, function (err) {
|
|
166
|
+
if (!isNoAnswer(err)) return;
|
|
167
|
+
misses += 1;
|
|
168
|
+
if (misses >= 2) markStopped();
|
|
169
|
+
});
|
|
170
|
+
}, 3000);
|
|
171
|
+
|
|
104
172
|
function setBusy(on) {
|
|
105
173
|
busy = on;
|
|
106
174
|
Array.prototype.forEach.call(document.querySelectorAll('[data-action]'), function (b) { b.disabled = on; });
|
|
@@ -2102,7 +2170,10 @@
|
|
|
2102
2170
|
load.last = text;
|
|
2103
2171
|
render(next);
|
|
2104
2172
|
})
|
|
2105
|
-
.catch(function (err) {
|
|
2173
|
+
.catch(function (err) {
|
|
2174
|
+
if (isNoAnswer(err)) { misses += 1; if (misses >= 2) markStopped(); return; }
|
|
2175
|
+
byId('subline').textContent = 'Could not load: ' + err.message;
|
|
2176
|
+
});
|
|
2106
2177
|
}
|
|
2107
2178
|
|
|
2108
2179
|
renderAI();
|
package/kryptheon-dashboard.html
CHANGED
|
@@ -426,9 +426,20 @@
|
|
|
426
426
|
@media (prefers-reduced-motion: reduce) {
|
|
427
427
|
*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
|
|
428
428
|
}
|
|
429
|
+
/* Kryptheon itself has stopped: over everything, the guide included - no button on the page can work meanwhile. */
|
|
430
|
+
.stopped { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 14, 20, 0.72); }
|
|
431
|
+
.stopped[hidden] { display: none; }
|
|
432
|
+
.stopped-card { width: min(560px, 100%); padding: 26px 26px 20px; color: var(--ink); background: var(--white); border-top: 4px solid var(--orange); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); }
|
|
433
|
+
.stopped-card h2 { margin: 0 0 10px; font-weight: 800; font-stretch: 74%; font-size: 1.6rem; text-transform: uppercase; }
|
|
434
|
+
.stopped-card p, .stopped-card li { font-size: 14px; line-height: 1.55; }
|
|
435
|
+
.stopped-card ul { margin: 10px 0; padding-left: 20px; display: grid; gap: 6px; }
|
|
436
|
+
.stopped-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 10px 12px; background: rgba(18, 22, 29, 0.06); }
|
|
437
|
+
.stopped-cmd code { flex: 1 1 260px; min-width: 0; font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
|
|
438
|
+
.stopped-wait { display: flex; align-items: center; gap: 8px; color: var(--orange-deep); font-weight: 600; }
|
|
429
439
|
</style>
|
|
430
440
|
</head>
|
|
431
441
|
<body>
|
|
442
|
+
<div class="stopped" id="stoppedBox" hidden role="alertdialog" aria-live="assertive"></div>
|
|
432
443
|
<div class="shell">
|
|
433
444
|
<aside class="side">
|
|
434
445
|
<div class="brand">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kryptheon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.76",
|
|
4
4
|
"description": "Record what you do in your app and get plain-language reports when it breaks.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"pg": "^8.23.0"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
|
-
"check": "node kryptheon-store.check.js && node kryptheon-code.check.js && node kryptheon-constdata.check.js && node kryptheon-listitems.check.js && node kryptheon-accept.check.js && node kryptheon-keys.check.js && node kryptheon-dashboard.check.js && node kryptheon-tour.check.js && node kryptheon-upgrade.check.js && node kryptheon-edge.check.js && node kryptheon-reliability.check.js && node kryptheon-fresh.check.js && node kryptheon-payments-dash.check.js && node kryptheon-embedded.check.js && node kryptheon-autostart.check.js && node kryptheon-changes.check.js && node kryptheon-look.check.js && node kryptheon-verify.check.js && node kryptheon-recheck.check.js && node kryptheon-reporter.check.js && node kryptheon-signature.check.js && node kryptheon-signature.stream.check.js && node kryptheon-signature.baseline.check.js && node kryptheon-signature.settle.check.js && node kryptheon-signature.number.check.js && node kryptheon-signature.rows.check.js && node kryptheon-env.check.js && node kryptheon-watchdog.check.js && node kryptheon-phone.check.js && node kryptheon-homedash.check.js && node kryptheon-record.check.js && node kryptheon-selectors.check.js && node kryptheon-recordings.check.js && node kryptheon-testfiles.check.js && node kryptheon-cleanup.check.js && node kryptheon-orphan.check.js && node kryptheon-project.check.js && node kryptheon-setup.check.js && node kryptheon-browser.check.js && node kryptheon-heal.check.js && node kryptheon-load.check.js && node kryptheon-authz.check.js && node kryptheon-roles.check.js && node kryptheon-map.check.js && node kryptheon-api.check.js && node kryptheon-webhook.check.js && node kryptheon-csv.check.js && node kryptheon-witness.check.js && node kryptheon-round34.check.js && node kryptheon-token.check.js && node kryptheon-questions.check.js && node kryptheon-pwbox.check.js && node kryptheon-quiet.check.js && node kryptheon-speed.check.js && node kryptheon-daily.check.js && node kryptheon-live.check.js && node kryptheon-aim.check.js && node kryptheon-peruser.check.js && node kryptheon-aiapp.check.js && node kryptheon-package.check.js && node kryptheon-newer.check.js",
|
|
78
|
+
"check": "node kryptheon-store.check.js && node kryptheon-code.check.js && node kryptheon-constdata.check.js && node kryptheon-listitems.check.js && node kryptheon-accept.check.js && node kryptheon-keys.check.js && node kryptheon-dashboard.check.js && node kryptheon-tour.check.js && node kryptheon-upgrade.check.js && node kryptheon-edge.check.js && node kryptheon-reliability.check.js && node kryptheon-fresh.check.js && node kryptheon-payments-dash.check.js && node kryptheon-embedded.check.js && node kryptheon-autostart.check.js && node kryptheon-changes.check.js && node kryptheon-look.check.js && node kryptheon-verify.check.js && node kryptheon-recheck.check.js && node kryptheon-reporter.check.js && node kryptheon-signature.check.js && node kryptheon-signature.stream.check.js && node kryptheon-signature.baseline.check.js && node kryptheon-signature.settle.check.js && node kryptheon-signature.number.check.js && node kryptheon-signature.rows.check.js && node kryptheon-env.check.js && node kryptheon-watchdog.check.js && node kryptheon-phone.check.js && node kryptheon-homedash.check.js && node kryptheon-record.check.js && node kryptheon-selectors.check.js && node kryptheon-recordings.check.js && node kryptheon-testfiles.check.js && node kryptheon-cleanup.check.js && node kryptheon-orphan.check.js && node kryptheon-project.check.js && node kryptheon-setup.check.js && node kryptheon-browser.check.js && node kryptheon-heal.check.js && node kryptheon-load.check.js && node kryptheon-authz.check.js && node kryptheon-roles.check.js && node kryptheon-map.check.js && node kryptheon-api.check.js && node kryptheon-webhook.check.js && node kryptheon-csv.check.js && node kryptheon-witness.check.js && node kryptheon-round34.check.js && node kryptheon-token.check.js && node kryptheon-questions.check.js && node kryptheon-pwbox.check.js && node kryptheon-quiet.check.js && node kryptheon-speed.check.js && node kryptheon-stopped.check.js && node kryptheon-daily.check.js && node kryptheon-live.check.js && node kryptheon-aim.check.js && node kryptheon-peruser.check.js && node kryptheon-aiapp.check.js && node kryptheon-package.check.js && node kryptheon-newer.check.js",
|
|
79
79
|
"check:store": "node kryptheon-store.check.js",
|
|
80
80
|
"check:code": "node kryptheon-code.check.js",
|
|
81
81
|
"check:constdata": "node kryptheon-constdata.check.js",
|