shadok-ai 0.7.4 → 0.7.6
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/dist/claude-home.js +24 -6
- package/dist/claude-home.js.map +1 -1
- package/package.json +1 -1
- package/public/index.html +21 -2
package/dist/claude-home.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
/** The per-project keys that answer the trust dialog. */
|
|
6
|
-
const
|
|
6
|
+
const ADDITIVE_PROJECT_KEYS = ["hasCompletedProjectOnboarding"];
|
|
7
7
|
/** Pure: the semver out of `claude --version` ("2.1.226 (Claude Code)"). */
|
|
8
8
|
export function parseClaudeVersion(stdout) {
|
|
9
9
|
const m = stdout.match(/^\s*(\d+\.\d+\.\d+[^\s(]*)/);
|
|
@@ -34,7 +34,19 @@ export function seedPlan(existing, opts) {
|
|
|
34
34
|
const projects = { ...(existing.projects ?? {}) };
|
|
35
35
|
const entry = { ...(projects[opts.cwd] ?? {}) };
|
|
36
36
|
let entryChanged = false;
|
|
37
|
-
|
|
37
|
+
// THE one exception to the additive rule, and it is deliberate.
|
|
38
|
+
//
|
|
39
|
+
// shadok is what chose this directory: the user expressed trust by pointing
|
|
40
|
+
// an agent at it. A `hasTrustDialogAccepted: false` left by anything —
|
|
41
|
+
// an older shadok, a restored config, a hand-run `claude` — would survive
|
|
42
|
+
// forever under "never overwrite", and the trust dialog would greet every
|
|
43
|
+
// single spawn. That is not preserving a choice, it is defeating the module.
|
|
44
|
+
if (entry.hasTrustDialogAccepted !== true) {
|
|
45
|
+
entry.hasTrustDialogAccepted = true;
|
|
46
|
+
entryChanged = true;
|
|
47
|
+
}
|
|
48
|
+
// Everything else stays additive: a value already there is the CLI's.
|
|
49
|
+
for (const key of ADDITIVE_PROJECT_KEYS) {
|
|
38
50
|
if (!(key in entry)) {
|
|
39
51
|
entry[key] = true;
|
|
40
52
|
entryChanged = true;
|
|
@@ -112,15 +124,21 @@ function seed(cwd) {
|
|
|
112
124
|
try {
|
|
113
125
|
const file = homeFile();
|
|
114
126
|
const existing = readHome(file);
|
|
115
|
-
if (existing === null)
|
|
116
|
-
|
|
127
|
+
if (existing === null) {
|
|
128
|
+
// Saying nothing here cost a long investigation: a seeding that never ran
|
|
129
|
+
// looked exactly like one that ran, and the first-run screens that came
|
|
130
|
+
// back had no explanation anywhere.
|
|
131
|
+
console.log(`claude-home: ${file} is unreadable — left alone, so first-run screens may appear`);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
117
134
|
const plan = seedPlan(existing, { version: claudeVersion(), cwd });
|
|
118
135
|
if (plan)
|
|
119
136
|
writeHome(file, plan);
|
|
120
137
|
}
|
|
121
|
-
catch {
|
|
138
|
+
catch (e) {
|
|
122
139
|
// A failed seed must never take down the boot path or a spawn — same rule
|
|
123
|
-
// as ensureSshIdentity.
|
|
140
|
+
// as ensureSshIdentity — but it must not be invisible either.
|
|
141
|
+
console.log(`claude-home: could not seed — ${e instanceof Error ? e.message : String(e)}`);
|
|
124
142
|
}
|
|
125
143
|
}
|
|
126
144
|
/** Called once at boot: the globals, plus the settings that kill the upsell. */
|
package/dist/claude-home.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-home.js","sourceRoot":"","sources":["../src/claude-home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AA4B7B,yDAAyD;AACzD,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-home.js","sourceRoot":"","sources":["../src/claude-home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,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P,QAAQ,GAAG,IAAI,CAAC,CAAC,mDAAmD;YACtE,CAAC;QACH,CAAC;QACD,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO;QAC9B,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,GAAG,IAAI,WAAW,OAAO,CAAC,GAAG,MAAM,CAAC;QAChD,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,iCAAiC;IACnC,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,CAAC,GAAG,CAAC,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -389,8 +389,11 @@
|
|
|
389
389
|
.tab-row1 { display: flex; align-items: center; gap: 8px; }
|
|
390
390
|
/* Context-window usage: tiny number + thin bar at the bottom of the tab. */
|
|
391
391
|
.tab .ctxnum { font-size: 9px; color: var(--text-dim); flex: none; }
|
|
392
|
-
/* Time of the last message
|
|
393
|
-
|
|
392
|
+
/* Time of the last message (the flex:1 name pushes it right). Colour is the
|
|
393
|
+
full foreground, not the dim one: the age is carried by OPACITY, set per
|
|
394
|
+
tab in JS (ageOpacity) — bright when fresh, nearly gone when old. The
|
|
395
|
+
transition makes the 30s refresh a fade rather than a step. */
|
|
396
|
+
.tab .lastat { font-size: 9px; color: var(--text); flex: none; line-height: 1.1; font-variant-numeric: tabular-nums; transition: opacity 0.6s ease; }
|
|
394
397
|
.tab .ctxbar {
|
|
395
398
|
position: absolute;
|
|
396
399
|
left: 10px;
|
|
@@ -3333,11 +3336,27 @@
|
|
|
3333
3336
|
if (h < 24) return h + "h ago";
|
|
3334
3337
|
return Math.round(h / 24) + "d ago";
|
|
3335
3338
|
}
|
|
3339
|
+
/**
|
|
3340
|
+
* Age → opacity for the tab's "xxx ago": full strength when fresh, fading to
|
|
3341
|
+
* a floor as it gets old, on a LOG scale so both minutes and days get a slice
|
|
3342
|
+
* of the ramp (a linear fade would sit at the floor within the first hour).
|
|
3343
|
+
* Opacity, not colour, so it dims toward the background whatever the theme.
|
|
3344
|
+
*/
|
|
3345
|
+
function ageOpacity(ageMs) {
|
|
3346
|
+
const FRESH = 60_000; // ≤ 1 min: freshly spoken, full white
|
|
3347
|
+
const OLD = 7 * 24 * 3600_000; // ~1 week: as faint as it gets
|
|
3348
|
+
const FLOOR = 0.22; // never fully gone — still there on hover
|
|
3349
|
+
if (!(ageMs > FRESH)) return 1;
|
|
3350
|
+
if (ageMs >= OLD) return FLOOR;
|
|
3351
|
+
const t = Math.log(ageMs / FRESH) / Math.log(OLD / FRESH);
|
|
3352
|
+
return +(1 - t * (1 - FLOOR)).toFixed(3);
|
|
3353
|
+
}
|
|
3336
3354
|
/** (Re)paints the last message's relative time on the tab. */
|
|
3337
3355
|
function renderLastAt(tab) {
|
|
3338
3356
|
if (!tab.lastAtEl) return;
|
|
3339
3357
|
if (!Number.isFinite(tab.lastMsgAt)) { tab.lastAtEl.textContent = ""; return; }
|
|
3340
3358
|
tab.lastAtEl.textContent = relTime(tab.lastMsgAt);
|
|
3359
|
+
tab.lastAtEl.style.opacity = String(ageOpacity(Date.now() - tab.lastMsgAt));
|
|
3341
3360
|
tab.lastAtEl.title = new Date(tab.lastMsgAt).toLocaleString();
|
|
3342
3361
|
}
|
|
3343
3362
|
// The relative time ages on its own: refresh every tab periodically.
|