wherever-dev 0.19.2 → 0.20.1
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/CHANGELOG.md +12 -0
- package/dist/index.js +41 -1
- package/dist/index.js.map +1 -1
- package/dist/session-pool.d.ts +19 -0
- package/dist/session-pool.d.ts.map +1 -1
- package/dist/session-pool.js +31 -7
- package/dist/session-pool.js.map +1 -1
- package/dist/session-stars.d.ts +61 -0
- package/dist/session-stars.d.ts.map +1 -0
- package/dist/session-stars.js +193 -0
- package/dist/session-stars.js.map +1 -0
- package/dist/session-types.d.ts +5 -0
- package/dist/session-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/_app/immutable/assets/{0.Be_gG-_m.css → 0.BKJ49K71.css} +1 -1
- package/public/_app/immutable/chunks/CKtNUuuK.js +2 -0
- package/public/_app/immutable/chunks/{DuS4tUIT.js.map → CKtNUuuK.js.map} +1 -1
- package/public/_app/immutable/chunks/{BQPpGHw6.js → CnKeGUZw.js} +2 -2
- package/public/_app/immutable/chunks/{BQPpGHw6.js.map → CnKeGUZw.js.map} +1 -1
- package/public/_app/immutable/chunks/{DxTGwxLe.js → DZNZyGFX.js} +2 -2
- package/public/_app/immutable/chunks/{DxTGwxLe.js.map → DZNZyGFX.js.map} +1 -1
- package/public/_app/immutable/entry/{app.D0o7KH5i.js → app.DXzDsTnW.js} +3 -3
- package/public/_app/immutable/entry/{app.D0o7KH5i.js.map → app.DXzDsTnW.js.map} +1 -1
- package/public/_app/immutable/entry/start.DrUK-rWm.js +2 -0
- package/public/_app/immutable/entry/start.DrUK-rWm.js.map +1 -0
- package/public/_app/immutable/nodes/{0.QmgixO0O.js → 0.CYKsT2Fe.js} +3 -3
- package/public/_app/immutable/nodes/{0.QmgixO0O.js.map → 0.CYKsT2Fe.js.map} +1 -1
- package/public/_app/immutable/nodes/{1.1znPEWAi.js → 1.BI1ByR-G.js} +2 -2
- package/public/_app/immutable/nodes/{1.1znPEWAi.js.map → 1.BI1ByR-G.js.map} +1 -1
- package/public/_app/immutable/nodes/2.Btaz1jhq.js +120 -0
- package/public/_app/immutable/nodes/2.Btaz1jhq.js.map +1 -0
- package/public/_app/version.json +1 -1
- package/public/index.html +11 -11
- package/public/service-worker.js +1 -1
- package/public/_app/immutable/chunks/DuS4tUIT.js +0 -2
- package/public/_app/immutable/entry/start.UO7O7dio.js +0 -2
- package/public/_app/immutable/entry/start.UO7O7dio.js.map +0 -1
- package/public/_app/immutable/nodes/2._c_bFISu.js +0 -120
- package/public/_app/immutable/nodes/2._c_bFISu.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# wherever-dev
|
|
2
2
|
|
|
3
|
+
## 0.20.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6f0725a: Coming back to the PWA no longer reconnects slower than a page reload. When the page becomes visible again, the client probes the existing socket with a 2 s grace (was 5 s), replaces a dead socket at once instead of after the reconnect backoff, resets a backoff that grew while the app was in the background, and restarts a handshake still pending after 8 s. A dead socket on return used to cost 7 to 20 s of "Reconnecting...".
|
|
8
|
+
|
|
9
|
+
## 0.20.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- bd85970: Star sessions to come back to them later. A ☆ button in the top bar (and on each session row in the sidebar) marks a session, and the ★ stays visible on its sidebar row. Typical use: a session hands a prompt off to a new session and waits on it; the new session takes the top of the list, so star the original to find it again. Stars are stored on the server (`starred-sessions.json` in the state dir) so they show on every device, are exempt from `sessions.maxAgeDays` / `sessions.maxSessions`, and are dropped when the session is deleted. New endpoint: `POST /sessions/star`.
|
|
14
|
+
|
|
3
15
|
## 0.19.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { connect as netConnect } from 'node:net';
|
|
|
5
5
|
import { WebSocketServer, WebSocket } from 'ws';
|
|
6
6
|
import { SessionPool, RELOADING_REFUSAL, getWhereverConfig, getWhereverCertsDir, getWhereverStateDir, detectRemoteRepo, normalizePath, invalidateFolderExistence } from './session-pool.js';
|
|
7
7
|
import { readDrafts, addDraft, deleteDraft, validateDraftInput } from './drafts.js';
|
|
8
|
+
import { readStarredSet, setSessionStarred, validateStarInput, forgetStar } from './session-stars.js';
|
|
8
9
|
import { piSdkInfo } from './pi-sdk.js';
|
|
9
10
|
import { searchConversations } from './conversation-search.js';
|
|
10
11
|
import { matchRemoteRepoRule, resolveRemoteCandidates } from './remote-candidates.js';
|
|
@@ -883,7 +884,7 @@ async function main() {
|
|
|
883
884
|
debugEnabled = debug;
|
|
884
885
|
console.log(`[wherever] pi SDK ${piSdkInfo.version}: ` +
|
|
885
886
|
(piSdkInfo.tier === 'bundled' ? `bundled (${piSdkInfo.why})` : `${piSdkInfo.tier}, from ${piSdkInfo.root} (${piSdkInfo.why})`));
|
|
886
|
-
const sessionPool = new SessionPool(idleTimeout);
|
|
887
|
+
const sessionPool = new SessionPool(idleTimeout, { getStarred: readStarredSet });
|
|
887
888
|
await sessionPool.initialize();
|
|
888
889
|
// Abandoned partial uploads (untouched for 24 h) are collected at startup and
|
|
889
890
|
// then hourly. A no-op when the staging dir was never created. The startup
|
|
@@ -1264,6 +1265,43 @@ async function main() {
|
|
|
1264
1265
|
sendJSON(res, 200, { folders, activeSessions: active });
|
|
1265
1266
|
return;
|
|
1266
1267
|
}
|
|
1268
|
+
// --- Starred sessions ("come back to this") ------------------------------
|
|
1269
|
+
// Server-side like drafts, so a star set on one device shows on every other.
|
|
1270
|
+
// `/sessions` reports each session's `starred` flag; this toggles one and
|
|
1271
|
+
// broadcasts `sessions_updated` so every open dashboard re-lists. POST with
|
|
1272
|
+
// an explicit boolean (not a toggle) so a retried request is idempotent.
|
|
1273
|
+
if (pathname === '/sessions/star' && req.method === 'POST') {
|
|
1274
|
+
let parsed;
|
|
1275
|
+
try {
|
|
1276
|
+
parsed = JSON.parse((await readBody(req)) || '{}');
|
|
1277
|
+
}
|
|
1278
|
+
catch {
|
|
1279
|
+
sendJSON(res, 400, { error: 'Invalid request' });
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
const invalid = validateStarInput(parsed);
|
|
1283
|
+
if (invalid) {
|
|
1284
|
+
sendJSON(res, 400, { error: invalid });
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
const resolved = path.resolve(parsed.sessionFile);
|
|
1288
|
+
// Only paths inside the sessions dir (an arbitrary path would just be junk
|
|
1289
|
+
// in the store). The file need not exist yet: a brand-new session can be
|
|
1290
|
+
// starred from the top bar before its transcript is first written.
|
|
1291
|
+
if (!sessionPool.isSessionFile(resolved)) {
|
|
1292
|
+
sendJSON(res, 400, { error: 'Invalid session file: not a session in the sessions directory' });
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
try {
|
|
1296
|
+
const stars = setSessionStarred(resolved, parsed.starred);
|
|
1297
|
+
broadcastSessionsUpdated();
|
|
1298
|
+
sendJSON(res, 200, { starred: stars });
|
|
1299
|
+
}
|
|
1300
|
+
catch (err) {
|
|
1301
|
+
sendJSON(res, 500, { error: err.message || 'Failed to update star' });
|
|
1302
|
+
}
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1267
1305
|
// Full-text search over every past session, backed by the memonaut index.
|
|
1268
1306
|
// Same token gate as /sessions (via isApiRequest above). A missing index is
|
|
1269
1307
|
// answered with status:'not-indexed', never built inline: memonaut's indexer
|
|
@@ -1766,6 +1804,8 @@ async function main() {
|
|
|
1766
1804
|
if (fs.existsSync(resolved)) {
|
|
1767
1805
|
fs.unlinkSync(resolved);
|
|
1768
1806
|
}
|
|
1807
|
+
// A deleted session's star would otherwise linger in the store forever.
|
|
1808
|
+
forgetStar(resolved);
|
|
1769
1809
|
// Tell all connected clients the list changed. Throttled: deleting a
|
|
1770
1810
|
// whole folder fires one DELETE per session in parallel, and each one
|
|
1771
1811
|
// would otherwise make every client refetch the entire list.
|