aicodeman 1.24.6 → 1.25.0
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/cli.d.ts.map +1 -1
- package/dist/cli.js +17 -2
- package/dist/cli.js.map +1 -1
- package/dist/config/base-path.d.ts +55 -0
- package/dist/config/base-path.d.ts.map +1 -0
- package/dist/config/base-path.js +105 -0
- package/dist/config/base-path.js.map +1 -0
- package/dist/config/cli-registry/schema.d.ts +2 -0
- package/dist/config/cli-registry/schema.d.ts.map +1 -1
- package/dist/config/cli-registry/schema.js +1 -1
- package/dist/config/cli-registry/schema.js.map +1 -1
- package/dist/config/cli-registry/stock.d.ts.map +1 -1
- package/dist/config/cli-registry/stock.js +4 -1
- package/dist/config/cli-registry/stock.js.map +1 -1
- package/dist/config/cli-registry/types.d.ts +9 -0
- package/dist/config/cli-registry/types.d.ts.map +1 -1
- package/dist/daemon-control.d.ts +2 -0
- package/dist/daemon-control.d.ts.map +1 -1
- package/dist/daemon-control.js +2 -0
- package/dist/daemon-control.js.map +1 -1
- package/dist/docker-export.d.ts.map +1 -1
- package/dist/docker-export.js +8 -1
- package/dist/docker-export.js.map +1 -1
- package/dist/docker-hosts.d.ts +97 -3
- package/dist/docker-hosts.d.ts.map +1 -1
- package/dist/docker-hosts.js +260 -4
- package/dist/docker-hosts.js.map +1 -1
- package/dist/hooks-config.d.ts.map +1 -1
- package/dist/hooks-config.js +39 -3
- package/dist/hooks-config.js.map +1 -1
- package/dist/session.d.ts +31 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +101 -5
- package/dist/session.js.map +1 -1
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +54 -8
- package/dist/tmux-manager.js.map +1 -1
- package/dist/types/api.d.ts +19 -1
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/api.js.map +1 -1
- package/dist/types/session.d.ts +49 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js.map +1 -1
- package/dist/types/update.d.ts +51 -3
- package/dist/types/update.d.ts.map +1 -1
- package/dist/types/update.js +4 -0
- package/dist/types/update.js.map +1 -1
- package/dist/web/middleware/auth.d.ts +3 -3
- package/dist/web/middleware/auth.d.ts.map +1 -1
- package/dist/web/middleware/auth.js +13 -11
- package/dist/web/middleware/auth.js.map +1 -1
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/app.3a89ac57.js +38 -0
- package/dist/web/public/app.3a89ac57.js.br +0 -0
- package/dist/web/public/app.3a89ac57.js.gz +0 -0
- package/dist/web/public/approvals-ui.js.gz +0 -0
- package/dist/web/public/{constants.7bd482dc.js → constants.7a635e34.js} +58 -0
- package/dist/web/public/constants.7a635e34.js.br +0 -0
- package/dist/web/public/constants.7a635e34.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/entrance-animations.js.gz +0 -0
- package/dist/web/public/home-sessions.js.gz +0 -0
- package/dist/web/public/i18n.9db8c4e0.js +1 -0
- package/dist/web/public/i18n.9db8c4e0.js.br +0 -0
- package/dist/web/public/i18n.9db8c4e0.js.gz +0 -0
- package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
- package/dist/web/public/index.html +46 -17
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.87f14251.js.gz +0 -0
- package/dist/web/public/{keyboard-accessory.0454a3e9.js → keyboard-accessory.daf18302.js} +8 -4
- package/dist/web/public/keyboard-accessory.daf18302.js.br +0 -0
- package/dist/web/public/keyboard-accessory.daf18302.js.gz +0 -0
- package/dist/web/public/manifest.json +2 -1
- package/dist/web/public/mobile-handlers.0f83a608.js.gz +0 -0
- package/dist/web/public/mobile-overview.js.gz +0 -0
- package/dist/web/public/{mobile.87674154.css → mobile.7112f27d.css} +1 -1
- package/dist/web/public/{mobile.87674154.css.br → mobile.7112f27d.css.br} +0 -0
- package/dist/web/public/mobile.7112f27d.css.gz +0 -0
- package/dist/web/public/{notification-manager.5d229063.js → notification-manager.36ea4624.js} +1 -1
- package/dist/web/public/notification-manager.36ea4624.js.br +0 -0
- package/dist/web/public/notification-manager.36ea4624.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/{panels-ui.e6e06034.js → panels-ui.db4785bf.js} +8 -8
- package/dist/web/public/panels-ui.db4785bf.js.br +0 -0
- package/dist/web/public/panels-ui.db4785bf.js.gz +0 -0
- package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
- package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
- package/dist/web/public/readmymind-ui.js.gz +0 -0
- package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
- package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
- package/dist/web/public/session-lineage.js.gz +0 -0
- package/dist/web/public/session-ui.58116fce.js +68 -0
- package/dist/web/public/session-ui.58116fce.js.br +0 -0
- package/dist/web/public/session-ui.58116fce.js.gz +0 -0
- package/dist/web/public/{settings-ui.95b333c6.js → settings-ui.554f9cdd.js} +1 -1
- package/dist/web/public/settings-ui.554f9cdd.js.br +0 -0
- package/dist/web/public/settings-ui.554f9cdd.js.gz +0 -0
- package/dist/web/public/{styles.421b36d4.css → styles.2a35729d.css} +1 -1
- package/dist/web/public/styles.2a35729d.css.br +0 -0
- package/dist/web/public/{styles.421b36d4.css.gz → styles.2a35729d.css.gz} +0 -0
- package/dist/web/public/subagent-windows.e6ca799f.js.gz +0 -0
- package/dist/web/public/sw.js +13 -6
- package/dist/web/public/sw.js.br +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/tab-rail-resize.42c24949.js.gz +0 -0
- package/dist/web/public/terminal-ui.70445f81.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-predictive-echo.bd6882b8.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.6fee72f2.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/{voice-input.4ec670b0.js → voice-input.c4b51eb6.js} +1 -1
- package/dist/web/public/voice-input.c4b51eb6.js.br +0 -0
- package/dist/web/public/voice-input.c4b51eb6.js.gz +0 -0
- package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
- package/dist/web/public/webview-tabs.js +3 -1
- package/dist/web/public/webview-tabs.js.br +0 -0
- package/dist/web/public/webview-tabs.js.gz +0 -0
- package/dist/web/route-helpers.d.ts.map +1 -1
- package/dist/web/route-helpers.js +5 -0
- package/dist/web/route-helpers.js.map +1 -1
- package/dist/web/routes/admin-routes.d.ts.map +1 -1
- package/dist/web/routes/admin-routes.js +6 -1
- package/dist/web/routes/admin-routes.js.map +1 -1
- package/dist/web/routes/case-routes.d.ts.map +1 -1
- package/dist/web/routes/case-routes.js +188 -4
- package/dist/web/routes/case-routes.js.map +1 -1
- package/dist/web/routes/file-routes.d.ts.map +1 -1
- package/dist/web/routes/file-routes.js +62 -4
- package/dist/web/routes/file-routes.js.map +1 -1
- package/dist/web/routes/hook-event-routes.d.ts.map +1 -1
- package/dist/web/routes/hook-event-routes.js +29 -3
- package/dist/web/routes/hook-event-routes.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +121 -56
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/routes/system-routes.d.ts.map +1 -1
- package/dist/web/routes/system-routes.js +3 -0
- package/dist/web/routes/system-routes.js.map +1 -1
- package/dist/web/routes/webview-routes.d.ts +2 -2
- package/dist/web/routes/webview-routes.d.ts.map +1 -1
- package/dist/web/routes/webview-routes.js +62 -27
- package/dist/web/routes/webview-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +29 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +75 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/self-update.d.ts +92 -2
- package/dist/web/self-update.d.ts.map +1 -1
- package/dist/web/self-update.js +275 -13
- package/dist/web/self-update.js.map +1 -1
- package/dist/web/server.d.ts +4 -2
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +55 -11
- package/dist/web/server.js.map +1 -1
- package/dist/web/sse-events.d.ts +4 -2
- package/dist/web/sse-events.d.ts.map +1 -1
- package/dist/web/sse-events.js +4 -2
- package/dist/web/sse-events.js.map +1 -1
- package/dist/web/webview-egress-policy.d.ts +35 -0
- package/dist/web/webview-egress-policy.d.ts.map +1 -0
- package/dist/web/webview-egress-policy.js +163 -0
- package/dist/web/webview-egress-policy.js.map +1 -0
- package/dist/web/webview-egress.d.ts +71 -0
- package/dist/web/webview-egress.d.ts.map +1 -0
- package/dist/web/webview-egress.js +127 -0
- package/dist/web/webview-egress.js.map +1 -0
- package/dist/web/webview-proxy.d.ts +16 -7
- package/dist/web/webview-proxy.d.ts.map +1 -1
- package/dist/web/webview-proxy.js +40 -15
- package/dist/web/webview-proxy.js.map +1 -1
- package/dist/webview-capabilities.d.ts +19 -3
- package/dist/webview-capabilities.d.ts.map +1 -1
- package/dist/webview-capabilities.js +21 -2
- package/dist/webview-capabilities.js.map +1 -1
- package/package.json +9 -7
- package/skills/codeman/reference/endpoints.md +1 -0
- package/skills/codeman/reference/verbs.md +11 -1
- package/dist/web/public/app.a5d2fc08.js +0 -38
- package/dist/web/public/app.a5d2fc08.js.br +0 -0
- package/dist/web/public/app.a5d2fc08.js.gz +0 -0
- package/dist/web/public/constants.7bd482dc.js.br +0 -0
- package/dist/web/public/constants.7bd482dc.js.gz +0 -0
- package/dist/web/public/i18n.9ae15b51.js +0 -1
- package/dist/web/public/i18n.9ae15b51.js.br +0 -0
- package/dist/web/public/i18n.9ae15b51.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.0454a3e9.js.br +0 -0
- package/dist/web/public/keyboard-accessory.0454a3e9.js.gz +0 -0
- package/dist/web/public/mobile.87674154.css.gz +0 -0
- package/dist/web/public/notification-manager.5d229063.js.br +0 -0
- package/dist/web/public/notification-manager.5d229063.js.gz +0 -0
- package/dist/web/public/panels-ui.e6e06034.js.br +0 -0
- package/dist/web/public/panels-ui.e6e06034.js.gz +0 -0
- package/dist/web/public/session-ui.c558f981.js +0 -68
- package/dist/web/public/session-ui.c558f981.js.br +0 -0
- package/dist/web/public/session-ui.c558f981.js.gz +0 -0
- package/dist/web/public/settings-ui.95b333c6.js.br +0 -0
- package/dist/web/public/settings-ui.95b333c6.js.gz +0 -0
- package/dist/web/public/styles.421b36d4.css.br +0 -0
- package/dist/web/public/voice-input.4ec670b0.js.br +0 -0
- package/dist/web/public/voice-input.4ec670b0.js.gz +0 -0
package/dist/web/server.js
CHANGED
|
@@ -40,6 +40,7 @@ import fs from 'node:fs/promises';
|
|
|
40
40
|
import { execSync } from 'node:child_process';
|
|
41
41
|
import { hostname as getHostname } from 'node:os';
|
|
42
42
|
import { dataPath, getDataDir, CODEMAN_INSTANCE } from '../config/instance.js';
|
|
43
|
+
import { normalizeBasePath, stripBasePath, joinBasePath } from '../config/base-path.js';
|
|
43
44
|
import { GLYPH, palette } from '../cli-style.js';
|
|
44
45
|
import { getHookSecret } from '../config/hook-secret.js';
|
|
45
46
|
import { EventEmitter } from 'node:events';
|
|
@@ -164,6 +165,8 @@ export class WebServer extends EventEmitter {
|
|
|
164
165
|
port;
|
|
165
166
|
host;
|
|
166
167
|
https;
|
|
168
|
+
/** Reverse-proxy sub-path prefix (normalized: '' for root, or '/foo'). */
|
|
169
|
+
basePath;
|
|
167
170
|
testMode;
|
|
168
171
|
mux;
|
|
169
172
|
// Centralized cleanup for standalone timers (intervals + resettable timeouts)
|
|
@@ -206,19 +209,26 @@ export class WebServer extends EventEmitter {
|
|
|
206
209
|
/** Opt-in hooks-only listener on the docker bridge gateway (CODEMAN_DOCKER_BRIDGE_HOOKS). */
|
|
207
210
|
_dockerBridgeServer = null;
|
|
208
211
|
teamWatcherHandlers = null;
|
|
209
|
-
constructor(port = 3000, https = false, testMode = false, host = '127.0.0.1', titleHostname, allowUnauthenticatedNetwork = false) {
|
|
212
|
+
constructor(port = 3000, https = false, testMode = false, host = '127.0.0.1', titleHostname, allowUnauthenticatedNetwork = false, basePath = '') {
|
|
210
213
|
super();
|
|
211
214
|
this.setMaxListeners(0);
|
|
212
215
|
this.host = host;
|
|
213
216
|
this.port = port;
|
|
214
217
|
this.https = https;
|
|
218
|
+
// Normalize so callers may pass raw operator input; '' == mounted at root.
|
|
219
|
+
this.basePath = normalizeBasePath(basePath || process.env.CODEMAN_BASE_URL);
|
|
215
220
|
this.testMode = testMode;
|
|
216
221
|
this.allowUnauthenticatedNetwork =
|
|
217
222
|
allowUnauthenticatedNetwork || isExplicitlyEnabled(process.env.CODEMAN_ALLOW_UNAUTHENTICATED_NETWORK);
|
|
218
223
|
this.titleHostname = titleHostname || getHostname();
|
|
219
224
|
this.windowTitle = `codeman:${this.titleHostname}`;
|
|
220
225
|
this.indexHtmlTemplate = readFileSync(join(__dirname, 'public', 'index.html'), 'utf-8');
|
|
221
|
-
|
|
226
|
+
// Ingress: strip the reverse-proxy prefix so all internal routing stays
|
|
227
|
+
// prefix-agnostic (routes are still declared at `/api/...`, `/`, `/ws/...`).
|
|
228
|
+
// Requests that arrive WITHOUT the prefix (hooks, health checks, the docker
|
|
229
|
+
// bridge — all hitting the raw port) pass through unchanged. Then apply the
|
|
230
|
+
// existing /api/v1 alias rewrite.
|
|
231
|
+
const rewriteUrl = (req) => rewriteApiV1Url(stripBasePath(this.basePath, req.url || ''));
|
|
222
232
|
if (https) {
|
|
223
233
|
const { key, cert } = getOrCreateSelfSignedCert();
|
|
224
234
|
this.app = Fastify({ logger: false, https: { key, cert }, rewriteUrl });
|
|
@@ -573,6 +583,20 @@ export class WebServer extends EventEmitter {
|
|
|
573
583
|
});
|
|
574
584
|
// Cookie plugin (needed for auth session tokens)
|
|
575
585
|
await this.app.register(fastifyCookie);
|
|
586
|
+
// Egress: when mounted under a reverse-proxy sub-path, any root-absolute
|
|
587
|
+
// `Location` we emit (redirects in system/webview/file routes, `/`, `/api/...`)
|
|
588
|
+
// must carry the prefix or the browser resolves it against the origin root and
|
|
589
|
+
// escapes the mount. One hook covers every current and future redirect, mirroring
|
|
590
|
+
// the ingress strip in `rewriteUrl`. No-op when mounted at root (basePath === '').
|
|
591
|
+
if (this.basePath) {
|
|
592
|
+
this.app.addHook('onSend', (_req, reply, payload, done) => {
|
|
593
|
+
const loc = reply.getHeader('location');
|
|
594
|
+
if (typeof loc === 'string') {
|
|
595
|
+
reply.header('location', joinBasePath(this.basePath, loc));
|
|
596
|
+
}
|
|
597
|
+
done(null, payload);
|
|
598
|
+
});
|
|
599
|
+
}
|
|
576
600
|
// Uniform response envelope (stable HTTP contract — docs/api-reference.md):
|
|
577
601
|
// wrap bare JSON payloads as { success:true, data } and map { success:false }
|
|
578
602
|
// error envelopes to a conventional HTTP status (instead of 200). Skips
|
|
@@ -599,9 +623,9 @@ export class WebServer extends EventEmitter {
|
|
|
599
623
|
// Anti-DNS-rebinding Host allowlist + cross-site (CSRF) Origin guard. Registered
|
|
600
624
|
// before auth so forged cross-site / rebound requests are rejected up front, even
|
|
601
625
|
// on the default no-password install. See docs/reports/security-review-2026-06-09.md.
|
|
602
|
-
registerHostGuard(this.app, () => this.getHostPolicy());
|
|
626
|
+
registerHostGuard(this.app, () => this.getHostPolicy(), this.basePath);
|
|
603
627
|
// Auth middleware (Basic Auth + session cookies + rate limiting)
|
|
604
|
-
const authState = registerAuthMiddleware(this.app, this.https);
|
|
628
|
+
const authState = registerAuthMiddleware(this.app, this.https, this.basePath);
|
|
605
629
|
if (authState) {
|
|
606
630
|
this.authSessions = authState.authSessions;
|
|
607
631
|
this.authFailures = authState.authFailures;
|
|
@@ -623,7 +647,7 @@ export class WebServer extends EventEmitter {
|
|
|
623
647
|
},
|
|
624
648
|
});
|
|
625
649
|
// Security headers + CORS
|
|
626
|
-
registerSecurityHeaders(this.app, this.https);
|
|
650
|
+
registerSecurityHeaders(this.app, this.https, this.basePath);
|
|
627
651
|
this.app.get('/', async (_req, reply) => {
|
|
628
652
|
return reply
|
|
629
653
|
.header('Cache-Control', 'no-cache')
|
|
@@ -787,7 +811,7 @@ export class WebServer extends EventEmitter {
|
|
|
787
811
|
// rescue. Reaching this handler at all already proves no Codeman route matched,
|
|
788
812
|
// and the relay declines unless the Referer carries a live capability, so
|
|
789
813
|
// genuinely unknown `/api` paths still get the envelope below.
|
|
790
|
-
if (await tryWebviewRefererFallback(req, reply))
|
|
814
|
+
if (await tryWebviewRefererFallback(req, reply, this.basePath))
|
|
791
815
|
return reply;
|
|
792
816
|
if (req.url.startsWith('/api')) {
|
|
793
817
|
return reply.code(404).send(createErrorResponse(ApiErrorCode.NOT_FOUND, notFound));
|
|
@@ -864,7 +888,7 @@ export class WebServer extends EventEmitter {
|
|
|
864
888
|
registerMeRoutes(this.app, ctx);
|
|
865
889
|
registerAdminRoutes(this.app, ctx);
|
|
866
890
|
registerOrchestratorRoutes(this.app, ctx);
|
|
867
|
-
registerWebviewRoutes(this.app, ctx);
|
|
891
|
+
registerWebviewRoutes(this.app, ctx, this.basePath);
|
|
868
892
|
registerTabLayoutRoutes(this.app, ctx);
|
|
869
893
|
// Cron: build the service from the same context, recompute
|
|
870
894
|
// due times for any persisted jobs, then expose it to its routes.
|
|
@@ -1180,6 +1204,17 @@ export class WebServer extends EventEmitter {
|
|
|
1180
1204
|
this.windowTitle = `${displayName === 'Codeman' ? 'codeman' : displayName}:${this.titleHostname}`;
|
|
1181
1205
|
}
|
|
1182
1206
|
let html = this.indexHtmlTemplate.replace('<title>Codeman</title>', `<title>${escapeHtmlText(this.windowTitle)}</title>`);
|
|
1207
|
+
// Reverse-proxy sub-path support. The template ships `<base href="/">` and all
|
|
1208
|
+
// static asset refs are RELATIVE, so pointing the base at the mount prefix
|
|
1209
|
+
// rewrites every asset URL for free. `window.__CODEMAN_BASE__` gives the
|
|
1210
|
+
// frontend the same prefix for the root-absolute URLs it builds at runtime
|
|
1211
|
+
// (fetch/SSE/WS), which `<base>` cannot touch. Injected right after `<base>`
|
|
1212
|
+
// so it is set before any (deferred) script runs. ONLY when a base is set —
|
|
1213
|
+
// at root ('') the template is left byte-identical to the historical output
|
|
1214
|
+
// (the frontend reads a missing `__CODEMAN_BASE__` as root anyway).
|
|
1215
|
+
if (this.basePath) {
|
|
1216
|
+
html = html.replace('<base href="/">', `<base href="${escapeHtmlText(this.basePath + '/')}">\n <script>window.__CODEMAN_BASE__=${JSON.stringify(this.basePath)};</script>`);
|
|
1217
|
+
}
|
|
1183
1218
|
// Cache-bust same-origin module scripts + stylesheets so a normal reload
|
|
1184
1219
|
// always serves the latest (static assets carry a 1-year immutable cache).
|
|
1185
1220
|
html = this.cacheBustAssets(html);
|
|
@@ -1274,7 +1309,9 @@ export class WebServer extends EventEmitter {
|
|
|
1274
1309
|
html = html.replace('</head>', `<script>window.__codemanGestureAvailable=true;</script>\n</head>`);
|
|
1275
1310
|
if (settings.gestureControlEnabled === true) {
|
|
1276
1311
|
const v = this.gestureBundleVersion();
|
|
1277
|
-
|
|
1312
|
+
// Relative src so the injected `<base href>` resolves it under the mount
|
|
1313
|
+
// prefix (a root-absolute `/gesture/...` would escape a sub-path mount).
|
|
1314
|
+
html = html.replace('</head>', `<script type="module" src="gesture/gesture-codeman.js${v}"></script>\n</head>`);
|
|
1278
1315
|
}
|
|
1279
1316
|
}
|
|
1280
1317
|
return html;
|
|
@@ -2164,7 +2201,10 @@ export class WebServer extends EventEmitter {
|
|
|
2164
2201
|
const displayHost = this.host === '0.0.0.0' ? 'localhost' : this.host;
|
|
2165
2202
|
// The only startup banner: `codeman web` used to print its own copy of this
|
|
2166
2203
|
// line, but the daemon and service launch paths never go through the CLI.
|
|
2167
|
-
console.log(palette.ok(`${GLYPH.ok} Codeman web interface running at ${protocol}://${displayHost}:${this.port}`));
|
|
2204
|
+
console.log(palette.ok(`${GLYPH.ok} Codeman web interface running at ${protocol}://${displayHost}:${this.port}${this.basePath}${this.basePath ? '/' : ''}`));
|
|
2205
|
+
if (this.basePath) {
|
|
2206
|
+
console.log(palette.muted(` Mounted under base path ${this.basePath} (front it with a reverse proxy that forwards ${this.basePath}/ unchanged).`));
|
|
2207
|
+
}
|
|
2168
2208
|
// Opt-in: also serve the HOOK endpoints on the docker bridge gateway so
|
|
2169
2209
|
// in-container hooks (permission/idle/stop callbacks) can reach a loopback-bound
|
|
2170
2210
|
// server. Hooks-only + secret-gated, and the bridge is host-internal (not the LAN).
|
|
@@ -2422,6 +2462,10 @@ export class WebServer extends EventEmitter {
|
|
|
2422
2462
|
// the launch conversation until the user types again, even though
|
|
2423
2463
|
// the re-attached CLI is on a post-`/clear` one.
|
|
2424
2464
|
lastSubmitAt: savedState?.lastSubmitAt,
|
|
2465
|
+
// Conversations this pane provably owned, oldest first. Its tail is
|
|
2466
|
+
// the conversation the CLI was on when the server stopped, which is
|
|
2467
|
+
// what a re-attach must point the viewer at instead of the launch id.
|
|
2468
|
+
claudeSessionChain: savedState?.claudeSessionChain,
|
|
2425
2469
|
// The pane's last output, previous run's value. Without it every
|
|
2426
2470
|
// restart restamped all sessions "now" (constructor + the attach
|
|
2427
2471
|
// repaint within the same second), flattening the home screens'
|
|
@@ -2896,8 +2940,8 @@ export class WebServer extends EventEmitter {
|
|
|
2896
2940
|
await this.app.close();
|
|
2897
2941
|
}
|
|
2898
2942
|
}
|
|
2899
|
-
export async function startWebServer(port = 3000, https = false, testMode = false, host = '127.0.0.1', titleHostname, allowUnauthenticatedNetwork = false) {
|
|
2900
|
-
const server = new WebServer(port, https, testMode, host, titleHostname, allowUnauthenticatedNetwork);
|
|
2943
|
+
export async function startWebServer(port = 3000, https = false, testMode = false, host = '127.0.0.1', titleHostname, allowUnauthenticatedNetwork = false, basePath = '') {
|
|
2944
|
+
const server = new WebServer(port, https, testMode, host, titleHostname, allowUnauthenticatedNetwork, basePath);
|
|
2901
2945
|
await server.start();
|
|
2902
2946
|
return server;
|
|
2903
2947
|
}
|