agim-cli 1.2.71 → 1.2.72
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 +37 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +16 -41
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/_app.js +0 -248
- package/dist/web/public/memos.html +0 -352
- package/dist/web/public/reminders.html +0 -332
- package/dist/web/public/settings.html +0 -2488
- package/dist/web/public/tasks.html +0 -3724
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,43 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.2.72] - 2026-05-26
|
|
8
|
+
|
|
9
|
+
### Removed
|
|
10
|
+
|
|
11
|
+
- **Legacy v1 web admin: gone for good.** The `IMHUB_WEB_V2` env gate
|
|
12
|
+
is removed; v2 SPA is the only web admin path now. Multiple
|
|
13
|
+
operators kept hitting "white screen / wrong page" because the
|
|
14
|
+
default env (`unset`) was being misread on some installs, and the
|
|
15
|
+
back-out hatch added more confusion than it solved.
|
|
16
|
+
- **Deleted files** (~7100 lines total):
|
|
17
|
+
- `src/web/public/settings.html` (2488 lines)
|
|
18
|
+
- `src/web/public/tasks.html` (3724 lines)
|
|
19
|
+
- `src/web/public/reminders.html` (332 lines)
|
|
20
|
+
- `src/web/public/memos.html` (352 lines)
|
|
21
|
+
- `src/web/public/_app.js` (248 lines — shared v1 theme / i18n /
|
|
22
|
+
auth-aware fetch; replaced by the v2 SPA's bundle)
|
|
23
|
+
- **Removed routes** in `web/server.ts`:
|
|
24
|
+
- The `process.env.IMHUB_WEB_V2 !== '0'` env gate is gone — SPA
|
|
25
|
+
fallback is now unconditional for GET requests.
|
|
26
|
+
- The legacy `/settings` / `/tasks` / `/reminders` / `/memos`
|
|
27
|
+
direct-HTML routing block deleted.
|
|
28
|
+
- The `/_app.js` static handler deleted.
|
|
29
|
+
- `/_app.js` removed from `PUBLIC_EXACT_PATHS` allowlist.
|
|
30
|
+
- **No back-out hatch.** Operators who were on v1 (last shipped
|
|
31
|
+
default-ON 1.2.20 → flipped default-v2 1.2.21, knob preserved until
|
|
32
|
+
1.2.71) flipped over automatically when they upgraded. Anyone who
|
|
33
|
+
still set `IMHUB_WEB_V2=0` in `~/.agim/env` can safely delete the
|
|
34
|
+
line — the value is ignored.
|
|
35
|
+
|
|
36
|
+
### Notes
|
|
37
|
+
|
|
38
|
+
- `IMHUB_ENABLE_GLOBAL_IM` / `IMHUB_ENABLE_REMOTE_AGENT` /
|
|
39
|
+
`IMHUB_PLATFORM_BLACKLIST` etc. are unaffected — those gate IM
|
|
40
|
+
platform visibility inside the SPA, not the SPA itself.
|
|
41
|
+
- `/loc` / `/loc.html` SSR pages and `/login.html` stay (they're not
|
|
42
|
+
part of the SPA).
|
|
43
|
+
|
|
7
44
|
## [1.2.71] - 2026-05-26
|
|
8
45
|
|
|
9
46
|
### Fixed
|
package/dist/web/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAwQA,wBAAgB,iBAAiB,IAAI,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAOrE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAspC/C"}
|
package/dist/web/server.js
CHANGED
|
@@ -40,7 +40,6 @@ const PUBLIC_EXACT_PATHS = new Set([
|
|
|
40
40
|
'/login', '/login.html',
|
|
41
41
|
'/api/auth/login',
|
|
42
42
|
'/api/health',
|
|
43
|
-
'/_app.js',
|
|
44
43
|
'/loc', '/loc.html',
|
|
45
44
|
// POST /api/loc (the bare path, no trailing slash) is the H5 page's
|
|
46
45
|
// "submit my coordinates" endpoint. It's authenticated by the single-use
|
|
@@ -361,28 +360,27 @@ export async function startWebServer(options) {
|
|
|
361
360
|
// Loopback peers + the public paths below bypass.
|
|
362
361
|
if (!checkAuth(req, res, url))
|
|
363
362
|
return;
|
|
364
|
-
// v2 SPA
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
//
|
|
370
|
-
//
|
|
363
|
+
// v1.2.72 — v2 SPA is the only web admin. The legacy v1 monolithic
|
|
364
|
+
// HTML pages (settings.html / tasks.html / reminders.html /
|
|
365
|
+
// memos.html / _app.js) have been removed; the `IMHUB_WEB_V2` env
|
|
366
|
+
// gate is gone — there is no v1 fallback anymore. Operators who
|
|
367
|
+
// were on the legacy layout flipped over automatically when they
|
|
368
|
+
// upgraded past 1.2.21 (default switch); the env knob remained as
|
|
369
|
+
// a back-out hatch through 1.2.71 and is retired here.
|
|
371
370
|
//
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
//
|
|
377
|
-
if (
|
|
371
|
+
// This branch serves the SPA chunks under `/assets/*.js`, the
|
|
372
|
+
// favicon / manifest, and falls back to `index.html` for any
|
|
373
|
+
// client-side route. Without it a fresh install hits a white
|
|
374
|
+
// screen because `<script src="/assets/…js">` 404s — no other
|
|
375
|
+
// handler claims that path.
|
|
376
|
+
if (req.method === 'GET') {
|
|
378
377
|
const p = url.pathname;
|
|
379
378
|
const isApi = p.startsWith('/api/');
|
|
380
379
|
const isWs = p.startsWith('/ws');
|
|
381
380
|
const isSse = p === '/events';
|
|
382
381
|
const isVendor = p.startsWith('/vendor/');
|
|
383
|
-
const isLegacyShared = p === '/_app.js' || p === '/_shell.css';
|
|
384
382
|
const isPublicSsr = p === '/loc' || p === '/loc.html' || p.startsWith('/l/') || p.startsWith('/v/');
|
|
385
|
-
if (!isApi && !isWs && !isSse && !isVendor && !
|
|
383
|
+
if (!isApi && !isWs && !isSse && !isVendor && !isPublicSsr) {
|
|
386
384
|
// SPA static asset (assets/index-xxx.js, /manifest.webmanifest,
|
|
387
385
|
// /favicon.svg) → return the file if it exists in PUBLIC_DIR.
|
|
388
386
|
// Otherwise fall back to /index.html so the router handles it.
|
|
@@ -403,22 +401,6 @@ export async function startWebServer(options) {
|
|
|
403
401
|
}
|
|
404
402
|
// Falls through to API / WS / SSR-page handlers below.
|
|
405
403
|
}
|
|
406
|
-
// Static pages — direct serve, no auth gate. This is the v1
|
|
407
|
-
// routing path; v2 takes precedence when IMHUB_WEB_V2=1 (above).
|
|
408
|
-
if (url.pathname === '/' || url.pathname === '/index.html' ||
|
|
409
|
-
url.pathname === '/settings' || url.pathname === '/settings.html' ||
|
|
410
|
-
url.pathname === '/tasks' || url.pathname === '/tasks.html' ||
|
|
411
|
-
url.pathname === '/reminders' || url.pathname === '/reminders.html' ||
|
|
412
|
-
url.pathname === '/memos' || url.pathname === '/memos.html') {
|
|
413
|
-
const fileMap = {
|
|
414
|
-
'/': 'index.html', '/index.html': 'index.html',
|
|
415
|
-
'/settings': 'settings.html', '/settings.html': 'settings.html',
|
|
416
|
-
'/tasks': 'tasks.html', '/tasks.html': 'tasks.html',
|
|
417
|
-
'/reminders': 'reminders.html', '/reminders.html': 'reminders.html',
|
|
418
|
-
'/memos': 'memos.html', '/memos.html': 'memos.html',
|
|
419
|
-
};
|
|
420
|
-
return servePageHtml(res, join(PUBLIC_DIR, fileMap[url.pathname]));
|
|
421
|
-
}
|
|
422
404
|
// M4: /api/health is intentionally public (k8s liveness probe friendly)
|
|
423
405
|
// — declare it BEFORE the /api/* token gate so callers don't need to
|
|
424
406
|
// know the web token. Returns only operational status, not config.
|
|
@@ -436,13 +418,6 @@ export async function startWebServer(options) {
|
|
|
436
418
|
if (url.pathname === '/login' && req.method === 'GET') {
|
|
437
419
|
return serveStatic(res, join(PUBLIC_DIR, 'login.html'), 'text/html; charset=utf-8');
|
|
438
420
|
}
|
|
439
|
-
// Shared web-console utilities (theme manager + i18n + error boundary
|
|
440
|
-
// + auth-aware fetch). Loaded synchronously by every static page in
|
|
441
|
-
// <head> so the theme can apply before first paint. No secrets — safe
|
|
442
|
-
// to serve un-authenticated.
|
|
443
|
-
if (url.pathname === '/_app.js' && req.method === 'GET') {
|
|
444
|
-
return serveStatic(res, join(PUBLIC_DIR, '_app.js'), 'application/javascript; charset=utf-8');
|
|
445
|
-
}
|
|
446
421
|
// v1.2.3 — vendored third-party assets (Chart.js etc). Whitelist by
|
|
447
422
|
// filename pattern to keep the static surface tight. Public on
|
|
448
423
|
// purpose — no auth gate (third-party libs aren't secrets).
|
|
@@ -1793,8 +1768,8 @@ function validateWorkspacePayload(raw, expectedId) {
|
|
|
1793
1768
|
}
|
|
1794
1769
|
/**
|
|
1795
1770
|
* Persist the workspaces array back to ~/.agim/config.json so changes
|
|
1796
|
-
* survive a restart. We do not touch other config fields —
|
|
1797
|
-
* has its own /api/config PUT for that. Best-effort: a write failure is
|
|
1771
|
+
* survive a restart. We do not touch other config fields — the SPA
|
|
1772
|
+
* settings page has its own /api/config PUT for that. Best-effort: a write failure is
|
|
1798
1773
|
* logged but the in-memory registry has already been updated, so the
|
|
1799
1774
|
* change is live until the next process boot.
|
|
1800
1775
|
*/
|