shadok-ai 0.15.22 → 0.15.24
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.md +1 -1
- package/package.json +1 -1
- package/public/auth-expiry.js +3 -3
- package/public/index.html +33 -6
package/README.md
CHANGED
|
@@ -121,7 +121,7 @@ Enter to skip; you can add it later from the web UI).
|
|
|
121
121
|
the token itself; the short-lived access token refreshes on its own, so the
|
|
122
122
|
figure shown is the session deadline, not that rotation. A **↻ Re-login to
|
|
123
123
|
Claude** button right there signs you in again without waiting for the lapse,
|
|
124
|
-
and in the last **
|
|
124
|
+
and in the last **48 hours** (or once it has lapsed) a reminder **banner**
|
|
125
125
|
carries the same one-click re-login — so your agents never quietly start
|
|
126
126
|
hitting `401` because nobody renewed the session.
|
|
127
127
|
- **Secret vault** — stored under `~/.shadok-ai`, never in your repo, injected
|
package/package.json
CHANGED
package/public/auth-expiry.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
// token (`accessExpiresAt`, ~6h) rotates on its own and is never what we warn
|
|
10
10
|
// about; see src/claude-creds.ts.
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
export const EXPIRY_WARN_MS =
|
|
12
|
+
/** 48h before the deadline: when the cockpit starts nagging to re-login. */
|
|
13
|
+
export const EXPIRY_WARN_MS = 48 * 60 * 60 * 1000;
|
|
14
14
|
|
|
15
15
|
/** A future instant as "in 22 days" / "in 6 h" / "in 40 min" / "expired". */
|
|
16
16
|
export function fmtExpiry(ts, now = Date.now()) {
|
|
@@ -31,7 +31,7 @@ export function fmtExpiry(ts, now = Date.now()) {
|
|
|
31
31
|
* not a reason to alarm) and never `signed-out` (the sign-in card owns that);
|
|
32
32
|
* - only when the re-login deadline is actually a number (an env-token
|
|
33
33
|
* instance carries none, so it is never nagged);
|
|
34
|
-
* - within
|
|
34
|
+
* - within 48h, INCLUDING already past it — a tab left open across the
|
|
35
35
|
* deadline must still nag, not fall silent.
|
|
36
36
|
*
|
|
37
37
|
* @param {{state?: string, loggedIn?: boolean, tokenExpiresAt?: number}|null} auth
|
package/public/index.html
CHANGED
|
@@ -204,6 +204,24 @@
|
|
|
204
204
|
}
|
|
205
205
|
header .ver:hover { text-decoration: underline; }
|
|
206
206
|
header .ver.stale { color: var(--amber); }
|
|
207
|
+
/* Small badge next to the version: which release channel this instance
|
|
208
|
+
follows (beta by default, alpha on the fast channel). Passive label — the
|
|
209
|
+
version number beside it is what opens the menu. */
|
|
210
|
+
header .ver-chan {
|
|
211
|
+
font-family: var(--mono);
|
|
212
|
+
font-size: 8px;
|
|
213
|
+
letter-spacing: .5px;
|
|
214
|
+
text-transform: uppercase;
|
|
215
|
+
color: var(--text-dim);
|
|
216
|
+
border: 1px solid currentColor;
|
|
217
|
+
border-radius: 3px;
|
|
218
|
+
padding: 0 3px;
|
|
219
|
+
margin-left: 4px;
|
|
220
|
+
vertical-align: 1px;
|
|
221
|
+
opacity: .7;
|
|
222
|
+
}
|
|
223
|
+
header .ver-chan:empty { display: none; }
|
|
224
|
+
header .ver-chan.alpha { color: var(--amber); opacity: .85; }
|
|
207
225
|
#verMenu {
|
|
208
226
|
position: fixed; top: 42px; left: 12px; z-index: 1001;
|
|
209
227
|
background: var(--menu-bg); border: 1px solid var(--line); border-radius: 6px;
|
|
@@ -283,7 +301,7 @@
|
|
|
283
301
|
font-family: var(--mono); font-size: 12px; text-align: center;
|
|
284
302
|
padding: 6px 12px;
|
|
285
303
|
}
|
|
286
|
-
/* The re-login reminder (sign-in within
|
|
304
|
+
/* The re-login reminder (sign-in within 48h / expired). Same top strip as the
|
|
287
305
|
update banner; its own id so the two never share styling by accident. */
|
|
288
306
|
#expiryBanner {
|
|
289
307
|
position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
|
|
@@ -1914,7 +1932,7 @@
|
|
|
1914
1932
|
<body>
|
|
1915
1933
|
|
|
1916
1934
|
<header>
|
|
1917
|
-
<span class="brand"><span class="brand-name" id="brandName" title="Rename this cockpit">shadok-ai</span><span class="brand-edit" id="brandEdit" title="Rename this cockpit" aria-hidden="true">✎</span> <span class="ver" id="verView" title="Running version"></span></span>
|
|
1935
|
+
<span class="brand"><span class="brand-name" id="brandName" title="Rename this cockpit">shadok-ai</span><span class="brand-edit" id="brandEdit" title="Rename this cockpit" aria-hidden="true">✎</span> <span class="ver" id="verView" title="Running version"></span><span class="ver-chan" id="verChan" aria-hidden="true"></span></span>
|
|
1918
1936
|
<span class="spacer"></span>
|
|
1919
1937
|
<div class="gauge quota" id="quota5h" data-window="5h" title="5h rolling limit">
|
|
1920
1938
|
<svg class="dial" viewBox="0 0 56 44" role="img" aria-label="5h rolling limit">
|
|
@@ -6148,6 +6166,7 @@
|
|
|
6148
6166
|
let bootVersion = null;
|
|
6149
6167
|
let lastVersion = null; // last {current, latest, autoUpdate} seen
|
|
6150
6168
|
const verView = document.getElementById("verView");
|
|
6169
|
+
const verChan = document.getElementById("verChan");
|
|
6151
6170
|
const verMenu = document.getElementById("verMenu");
|
|
6152
6171
|
const autoUpdateChk = document.getElementById("autoUpdateChk");
|
|
6153
6172
|
const updChannelSel = document.getElementById("updChannelSel");
|
|
@@ -6178,6 +6197,14 @@
|
|
|
6178
6197
|
verView.textContent = ahead ? "v" + msg.current + " → " + msg.latest : "v" + (msg.current || "?");
|
|
6179
6198
|
verView.classList.toggle("stale", !!ahead);
|
|
6180
6199
|
verView.title = ahead ? "Update available — click for options" : "running version — click for options";
|
|
6200
|
+
// Release channel next to the number: beta by default, alpha on the fast
|
|
6201
|
+
// channel. Honest per instance rather than a hardcoded label.
|
|
6202
|
+
if (verChan) {
|
|
6203
|
+
const ch = msg.updateChannel === "alpha" ? "alpha" : "beta";
|
|
6204
|
+
verChan.textContent = ch;
|
|
6205
|
+
verChan.classList.toggle("alpha", ch === "alpha");
|
|
6206
|
+
verChan.title = "Release channel — click the version for options";
|
|
6207
|
+
}
|
|
6181
6208
|
renderVerMenu();
|
|
6182
6209
|
}
|
|
6183
6210
|
|
|
@@ -6260,9 +6287,9 @@
|
|
|
6260
6287
|
updateExpiryBanner(); // the banner must track the clock even menu-closed
|
|
6261
6288
|
}
|
|
6262
6289
|
|
|
6263
|
-
// ── Re-login reminder banner (sign-in within
|
|
6290
|
+
// ── Re-login reminder banner (sign-in within 48h / expired) ───────────────
|
|
6264
6291
|
// A top strip that nags to re-login before the token lapses and the agents
|
|
6265
|
-
// start getting 401s. The decision (and its
|
|
6292
|
+
// start getting 401s. The decision (and its 48h threshold) is pure —
|
|
6266
6293
|
// window.expiryWarning, public/auth-expiry.js — so only the DOM lives here.
|
|
6267
6294
|
function updateExpiryBanner() {
|
|
6268
6295
|
const w = window.expiryWarning(lastAuth);
|
|
@@ -6357,7 +6384,7 @@
|
|
|
6357
6384
|
.catch(() => {});
|
|
6358
6385
|
// Click outside closes it; clicks inside the menu don't.
|
|
6359
6386
|
document.addEventListener("click", (e) => {
|
|
6360
|
-
if (!verMenu.hidden && !verMenu.contains(e.target) && e.target !== verView) toggleVerMenu(false);
|
|
6387
|
+
if (!verMenu.hidden && !verMenu.contains(e.target) && e.target !== verView && e.target !== verChan) toggleVerMenu(false);
|
|
6361
6388
|
});
|
|
6362
6389
|
autoUpdateChk.addEventListener("change", async () => {
|
|
6363
6390
|
const enabled = autoUpdateChk.checked;
|
|
@@ -9342,7 +9369,7 @@
|
|
|
9342
9369
|
.catch(() => {});
|
|
9343
9370
|
});
|
|
9344
9371
|
setInterval(refreshUsage, 60_000);
|
|
9345
|
-
// The sign-in deadline is days out, so a coarse poll catches the
|
|
9372
|
+
// The sign-in deadline is days out, so a coarse poll catches the 48h crossing
|
|
9346
9373
|
// in good time without hammering /auth (which also re-checks the account).
|
|
9347
9374
|
setInterval(refreshAuthRows, 10 * 60_000);
|
|
9348
9375
|
|