@essentialai/cogent-server 2.0.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/.env.example +68 -0
- package/CHANGELOG.md +16 -0
- package/Caddyfile +8 -0
- package/Dockerfile +46 -0
- package/LICENSE +190 -0
- package/README.md +89 -0
- package/config.json.example +16 -0
- package/dist/__tests__/helpers.d.ts +56 -0
- package/dist/__tests__/helpers.d.ts.map +1 -0
- package/dist/__tests__/helpers.js +138 -0
- package/dist/__tests__/helpers.js.map +1 -0
- package/dist/app.d.ts +38 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +60 -0
- package/dist/app.js.map +1 -0
- package/dist/config.d.ts +88 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +148 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/auth.d.ts +15 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +47 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +14 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/error-handler.js +26 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/not-found.d.ts +8 -0
- package/dist/middleware/not-found.d.ts.map +1 -0
- package/dist/middleware/not-found.js +12 -0
- package/dist/middleware/not-found.js.map +1 -0
- package/dist/middleware/request-logger.d.ts +17 -0
- package/dist/middleware/request-logger.d.ts.map +1 -0
- package/dist/middleware/request-logger.js +65 -0
- package/dist/middleware/request-logger.js.map +1 -0
- package/dist/middleware/ws-auth.d.ts +21 -0
- package/dist/middleware/ws-auth.d.ts.map +1 -0
- package/dist/middleware/ws-auth.js +59 -0
- package/dist/middleware/ws-auth.js.map +1 -0
- package/dist/routes/health.d.ts +11 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +34 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/messages.d.ts +19 -0
- package/dist/routes/messages.d.ts.map +1 -0
- package/dist/routes/messages.js +154 -0
- package/dist/routes/messages.js.map +1 -0
- package/dist/routes/peers.d.ts +17 -0
- package/dist/routes/peers.d.ts.map +1 -0
- package/dist/routes/peers.js +169 -0
- package/dist/routes/peers.js.map +1 -0
- package/dist/routes/poll.d.ts +15 -0
- package/dist/routes/poll.d.ts.map +1 -0
- package/dist/routes/poll.js +97 -0
- package/dist/routes/poll.js.map +1 -0
- package/dist/routes/sessions.d.ts +14 -0
- package/dist/routes/sessions.d.ts.map +1 -0
- package/dist/routes/sessions.js +113 -0
- package/dist/routes/sessions.js.map +1 -0
- package/dist/routes/ui.d.ts +21 -0
- package/dist/routes/ui.d.ts.map +1 -0
- package/dist/routes/ui.js +173 -0
- package/dist/routes/ui.js.map +1 -0
- package/dist/routes/validation-hook.d.ts +18 -0
- package/dist/routes/validation-hook.d.ts.map +1 -0
- package/dist/routes/validation-hook.js +24 -0
- package/dist/routes/validation-hook.js.map +1 -0
- package/dist/services/auth-service.d.ts +48 -0
- package/dist/services/auth-service.d.ts.map +1 -0
- package/dist/services/auth-service.js +63 -0
- package/dist/services/auth-service.js.map +1 -0
- package/dist/services/connection-manager.d.ts +108 -0
- package/dist/services/connection-manager.d.ts.map +1 -0
- package/dist/services/connection-manager.js +216 -0
- package/dist/services/connection-manager.js.map +1 -0
- package/dist/services/message-queue.d.ts +56 -0
- package/dist/services/message-queue.d.ts.map +1 -0
- package/dist/services/message-queue.js +164 -0
- package/dist/services/message-queue.js.map +1 -0
- package/dist/services/peer-cleanup.d.ts +39 -0
- package/dist/services/peer-cleanup.d.ts.map +1 -0
- package/dist/services/peer-cleanup.js +96 -0
- package/dist/services/peer-cleanup.js.map +1 -0
- package/dist/services/session-cleanup.d.ts +44 -0
- package/dist/services/session-cleanup.d.ts.map +1 -0
- package/dist/services/session-cleanup.js +100 -0
- package/dist/services/session-cleanup.js.map +1 -0
- package/dist/services/session-store.d.ts +103 -0
- package/dist/services/session-store.d.ts.map +1 -0
- package/dist/services/session-store.js +292 -0
- package/dist/services/session-store.js.map +1 -0
- package/dist/services/stats-service.d.ts +48 -0
- package/dist/services/stats-service.d.ts.map +1 -0
- package/dist/services/stats-service.js +77 -0
- package/dist/services/stats-service.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/components/Footer.d.ts +7 -0
- package/dist/ui/components/Footer.d.ts.map +1 -0
- package/dist/ui/components/Footer.js +17 -0
- package/dist/ui/components/Footer.js.map +1 -0
- package/dist/ui/components/Layout.d.ts +13 -0
- package/dist/ui/components/Layout.d.ts.map +1 -0
- package/dist/ui/components/Layout.js +11 -0
- package/dist/ui/components/Layout.js.map +1 -0
- package/dist/ui/components/NavBar.d.ts +12 -0
- package/dist/ui/components/NavBar.d.ts.map +1 -0
- package/dist/ui/components/NavBar.js +60 -0
- package/dist/ui/components/NavBar.js.map +1 -0
- package/dist/ui/components/StatCard.d.ts +14 -0
- package/dist/ui/components/StatCard.d.ts.map +1 -0
- package/dist/ui/components/StatCard.js +32 -0
- package/dist/ui/components/StatCard.js.map +1 -0
- package/dist/ui/components/Terminal.d.ts +13 -0
- package/dist/ui/components/Terminal.d.ts.map +1 -0
- package/dist/ui/components/Terminal.js +37 -0
- package/dist/ui/components/Terminal.js.map +1 -0
- package/dist/ui/pages/AdminDashboard.d.ts +13 -0
- package/dist/ui/pages/AdminDashboard.d.ts.map +1 -0
- package/dist/ui/pages/AdminDashboard.js +59 -0
- package/dist/ui/pages/AdminDashboard.js.map +1 -0
- package/dist/ui/pages/HowToPage.d.ts +8 -0
- package/dist/ui/pages/HowToPage.d.ts.map +1 -0
- package/dist/ui/pages/HowToPage.js +312 -0
- package/dist/ui/pages/HowToPage.js.map +1 -0
- package/dist/ui/pages/LandingPage.d.ts +13 -0
- package/dist/ui/pages/LandingPage.d.ts.map +1 -0
- package/dist/ui/pages/LandingPage.js +160 -0
- package/dist/ui/pages/LandingPage.js.map +1 -0
- package/dist/ui/pages/MessageLog.d.ts +25 -0
- package/dist/ui/pages/MessageLog.d.ts.map +1 -0
- package/dist/ui/pages/MessageLog.js +146 -0
- package/dist/ui/pages/MessageLog.js.map +1 -0
- package/dist/ui/pages/SessionDetail.d.ts +14 -0
- package/dist/ui/pages/SessionDetail.d.ts.map +1 -0
- package/dist/ui/pages/SessionDetail.js +165 -0
- package/dist/ui/pages/SessionDetail.js.map +1 -0
- package/dist/ui/pages/SessionList.d.ts +22 -0
- package/dist/ui/pages/SessionList.d.ts.map +1 -0
- package/dist/ui/pages/SessionList.js +88 -0
- package/dist/ui/pages/SessionList.js.map +1 -0
- package/dist/ui/styles/theme.d.ts +35 -0
- package/dist/ui/styles/theme.d.ts.map +1 -0
- package/dist/ui/styles/theme.js +65 -0
- package/dist/ui/styles/theme.js.map +1 -0
- package/dist/ws/frames.d.ts +82 -0
- package/dist/ws/frames.d.ts.map +1 -0
- package/dist/ws/frames.js +68 -0
- package/dist/ws/frames.js.map +1 -0
- package/dist/ws/handler.d.ts +26 -0
- package/dist/ws/handler.d.ts.map +1 -0
- package/dist/ws/handler.js +72 -0
- package/dist/ws/handler.js.map +1 -0
- package/dist/ws/heartbeat.d.ts +18 -0
- package/dist/ws/heartbeat.d.ts.map +1 -0
- package/dist/ws/heartbeat.js +39 -0
- package/dist/ws/heartbeat.js.map +1 -0
- package/docker-compose.yml +38 -0
- package/nginx.conf.example +63 -0
- package/package.json +61 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { SessionStore } from "./session-store.js";
|
|
2
|
+
import type { ConnectionManager } from "./connection-manager.js";
|
|
3
|
+
/**
|
|
4
|
+
* Aggregated server statistics returned by StatsService.
|
|
5
|
+
*/
|
|
6
|
+
export interface ServerStats {
|
|
7
|
+
activeSessions: number;
|
|
8
|
+
connectedAgents: number;
|
|
9
|
+
totalMessagesRelayed: number;
|
|
10
|
+
/** Server uptime in seconds. */
|
|
11
|
+
uptime: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Cached stats aggregation service.
|
|
15
|
+
*
|
|
16
|
+
* Periodically refreshes aggregated counts from SessionStore (disk) and
|
|
17
|
+
* ConnectionManager (in-memory) so that SSE endpoints and UI pages can
|
|
18
|
+
* read stats without per-request disk I/O.
|
|
19
|
+
*/
|
|
20
|
+
export declare class StatsService {
|
|
21
|
+
private cachedStats;
|
|
22
|
+
private readonly sessionStore;
|
|
23
|
+
private readonly connectionManager;
|
|
24
|
+
private readonly startTime;
|
|
25
|
+
private refreshHandle;
|
|
26
|
+
constructor(sessionStore: SessionStore, connectionManager: ConnectionManager, startTime: number);
|
|
27
|
+
/**
|
|
28
|
+
* Refresh cached stats from disk (sessions, messages) and memory (connections).
|
|
29
|
+
* Called periodically by start() and can be called manually.
|
|
30
|
+
*/
|
|
31
|
+
refresh(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Get cached stats with live uptime calculation.
|
|
34
|
+
* Returns a shallow copy so callers cannot mutate the cache.
|
|
35
|
+
*/
|
|
36
|
+
getStats(): ServerStats;
|
|
37
|
+
/**
|
|
38
|
+
* Start periodic stats refresh.
|
|
39
|
+
* Calls refresh() immediately, then sets up an interval.
|
|
40
|
+
* The interval handle is unref'd so it does not block process exit.
|
|
41
|
+
*/
|
|
42
|
+
start(intervalMs?: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Stop periodic stats refresh.
|
|
45
|
+
*/
|
|
46
|
+
stop(): void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=stats-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-service.d.ts","sourceRoot":"","sources":["../../src/services/stats-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,aAAa,CAA+C;gBAGlE,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,MAAM;IAanB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB9B;;;OAGG;IACH,QAAQ,IAAI,WAAW;IAOvB;;;;OAIG;IACH,KAAK,CAAC,UAAU,GAAE,MAAa,GAAG,IAAI;IAUtC;;OAEG;IACH,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cached stats aggregation service.
|
|
3
|
+
*
|
|
4
|
+
* Periodically refreshes aggregated counts from SessionStore (disk) and
|
|
5
|
+
* ConnectionManager (in-memory) so that SSE endpoints and UI pages can
|
|
6
|
+
* read stats without per-request disk I/O.
|
|
7
|
+
*/
|
|
8
|
+
export class StatsService {
|
|
9
|
+
cachedStats;
|
|
10
|
+
sessionStore;
|
|
11
|
+
connectionManager;
|
|
12
|
+
startTime;
|
|
13
|
+
refreshHandle = null;
|
|
14
|
+
constructor(sessionStore, connectionManager, startTime) {
|
|
15
|
+
this.sessionStore = sessionStore;
|
|
16
|
+
this.connectionManager = connectionManager;
|
|
17
|
+
this.startTime = startTime;
|
|
18
|
+
this.cachedStats = {
|
|
19
|
+
activeSessions: 0,
|
|
20
|
+
connectedAgents: 0,
|
|
21
|
+
totalMessagesRelayed: 0,
|
|
22
|
+
uptime: 0,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Refresh cached stats from disk (sessions, messages) and memory (connections).
|
|
27
|
+
* Called periodically by start() and can be called manually.
|
|
28
|
+
*/
|
|
29
|
+
async refresh() {
|
|
30
|
+
const sessionIds = await this.sessionStore.listSessions();
|
|
31
|
+
let totalMessages = 0;
|
|
32
|
+
for (const id of sessionIds) {
|
|
33
|
+
const session = await this.sessionStore.getSession(id);
|
|
34
|
+
if (session)
|
|
35
|
+
totalMessages += session.messages.length;
|
|
36
|
+
}
|
|
37
|
+
this.cachedStats = {
|
|
38
|
+
activeSessions: sessionIds.length,
|
|
39
|
+
connectedAgents: this.connectionManager.getTotalConnectedPeers(),
|
|
40
|
+
totalMessagesRelayed: totalMessages,
|
|
41
|
+
uptime: (Date.now() - this.startTime) / 1000,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get cached stats with live uptime calculation.
|
|
46
|
+
* Returns a shallow copy so callers cannot mutate the cache.
|
|
47
|
+
*/
|
|
48
|
+
getStats() {
|
|
49
|
+
return {
|
|
50
|
+
...this.cachedStats,
|
|
51
|
+
uptime: (Date.now() - this.startTime) / 1000,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Start periodic stats refresh.
|
|
56
|
+
* Calls refresh() immediately, then sets up an interval.
|
|
57
|
+
* The interval handle is unref'd so it does not block process exit.
|
|
58
|
+
*/
|
|
59
|
+
start(intervalMs = 5000) {
|
|
60
|
+
// Initial refresh (fire and forget -- errors logged to stderr)
|
|
61
|
+
this.refresh().catch(console.error);
|
|
62
|
+
this.refreshHandle = setInterval(() => {
|
|
63
|
+
this.refresh().catch(console.error);
|
|
64
|
+
}, intervalMs);
|
|
65
|
+
this.refreshHandle.unref();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Stop periodic stats refresh.
|
|
69
|
+
*/
|
|
70
|
+
stop() {
|
|
71
|
+
if (this.refreshHandle) {
|
|
72
|
+
clearInterval(this.refreshHandle);
|
|
73
|
+
this.refreshHandle = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=stats-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-service.js","sourceRoot":"","sources":["../../src/services/stats-service.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IACf,WAAW,CAAc;IAChB,YAAY,CAAe;IAC3B,iBAAiB,CAAoB;IACrC,SAAS,CAAS;IAC3B,aAAa,GAA0C,IAAI,CAAC;IAEpE,YACE,YAA0B,EAC1B,iBAAoC,EACpC,SAAiB;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG;YACjB,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,CAAC;YAClB,oBAAoB,EAAE,CAAC;YACvB,MAAM,EAAE,CAAC;SACV,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAC1D,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAC5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACvD,IAAI,OAAO;gBAAE,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QACxD,CAAC;QAED,IAAI,CAAC,WAAW,GAAG;YACjB,cAAc,EAAE,UAAU,CAAC,MAAM;YACjC,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,EAAE;YAChE,oBAAoB,EAAE,aAAa;YACnC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI;SAC7C,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAO;YACL,GAAG,IAAI,CAAC,WAAW;YACnB,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI;SAC7C,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAqB,IAAI;QAC7B,+DAA+D;QAC/D,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;YACpC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI;QACF,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAClC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { PeerInfo, MessageRecord, PeerEvent } from "@essentialai/cogent";
|
|
2
|
+
/**
|
|
3
|
+
* An active bearer token entry stored in a session file.
|
|
4
|
+
* Tokens are stored as SHA-256 hashes (never plaintext).
|
|
5
|
+
*/
|
|
6
|
+
export interface TokenEntry {
|
|
7
|
+
tokenHash: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
peerId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A message queued for offline delivery to a peer.
|
|
13
|
+
* Stored in the session file and flushed when the peer reconnects via WebSocket.
|
|
14
|
+
*/
|
|
15
|
+
export interface QueuedMessage {
|
|
16
|
+
/** References MessageRecord.id -- the message this queue entry wraps. */
|
|
17
|
+
messageId: string;
|
|
18
|
+
/** ISO 8601 timestamp when the message was enqueued -- used for 7-day TTL calculation. */
|
|
19
|
+
enqueuedAt: string;
|
|
20
|
+
/** Full message payload for delivery on reconnect. */
|
|
21
|
+
message: MessageRecord;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The full state of a single session, persisted as a JSON file on disk.
|
|
25
|
+
* Each session has its own file: `{sessionId}.json` in the state directory.
|
|
26
|
+
*/
|
|
27
|
+
export interface SessionFileState {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
/** bcrypt hash of the plaintext secret -- never stored in plaintext. */
|
|
31
|
+
secretHash: string;
|
|
32
|
+
/** Active bearer tokens for this session. */
|
|
33
|
+
tokens: TokenEntry[];
|
|
34
|
+
createdAt: string;
|
|
35
|
+
/** IP address of the client that created this session (from X-Forwarded-For or direct). */
|
|
36
|
+
creatorIp?: string;
|
|
37
|
+
/** Registered peers, keyed by peerId. */
|
|
38
|
+
peers: Record<string, PeerInfo>;
|
|
39
|
+
/** Message history for this session. */
|
|
40
|
+
messages: MessageRecord[];
|
|
41
|
+
/** Peer lifecycle events for the poll endpoint. */
|
|
42
|
+
peerEvents: PeerEvent[];
|
|
43
|
+
/**
|
|
44
|
+
* Per-peer offline message queue, keyed by peerId.
|
|
45
|
+
* Optional so existing session files (from Phase 2A) still parse correctly.
|
|
46
|
+
* Default to `{}` on read when absent.
|
|
47
|
+
*/
|
|
48
|
+
messageQueue?: Record<string, QueuedMessage[]>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Hono environment type for server routes.
|
|
52
|
+
* Variables are set by auth middleware and accessible in handlers via c.var.
|
|
53
|
+
*/
|
|
54
|
+
export interface ServerEnv {
|
|
55
|
+
Variables: {
|
|
56
|
+
sessionId: string;
|
|
57
|
+
session: SessionFileState;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAChC,wCAAwC;IACxC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,mDAAmD;IACnD,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,gBAAgB,CAAC;KAC3B,CAAC;CACH"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAanC;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,EAEpB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
2
|
+
import { css } from "hono/css";
|
|
3
|
+
import { colors } from "../styles/theme.js";
|
|
4
|
+
const footerStyle = css `
|
|
5
|
+
text-align: center;
|
|
6
|
+
padding: 2rem 0;
|
|
7
|
+
color: ${colors.textMuted};
|
|
8
|
+
font-size: 0.8rem;
|
|
9
|
+
border-top: 1px solid ${colors.border};
|
|
10
|
+
margin-top: 2rem;
|
|
11
|
+
`;
|
|
12
|
+
/**
|
|
13
|
+
* Simple footer with branding text.
|
|
14
|
+
* Reusable across admin and public pages.
|
|
15
|
+
*/
|
|
16
|
+
export const Footer = () => (_jsxs("div", { class: footerStyle, children: ["COGENT \u2014 Powered by ", _jsx("a", { href: "https://essentialai.uk", style: "color: inherit;", children: "Essential AI Solutions Ltd." }), " \u2014 ", _jsx("a", { href: "/", style: "color: inherit;", children: "cogent.tools" })] }));
|
|
17
|
+
//# sourceMappingURL=Footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/ui/components/Footer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,WAAW,GAA2B,GAAG,CAAA;;;WAGpC,MAAM,CAAC,SAAS;;0BAED,MAAM,CAAC,MAAM;;CAEtC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAO,GAAG,EAAE,CAAC,CAC9B,eAAK,KAAK,EAAE,WAAW,0CAA4B,YAAG,IAAI,EAAC,wBAAwB,EAAC,KAAK,EAAC,iBAAiB,4CAAgC,cAAS,YAAG,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,iBAAiB,6BAAiB,IAAM,CAC/M,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FC } from "hono/jsx";
|
|
2
|
+
/** Props for the Layout component. */
|
|
3
|
+
interface LayoutProps {
|
|
4
|
+
title: string;
|
|
5
|
+
children: any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Base HTML shell with head, meta tags, Google Fonts, and global styles.
|
|
9
|
+
* Wraps every page with consistent document structure.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Layout: FC<LayoutProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAInC,sCAAsC;AACtC,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAsBlC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
2
|
+
import { Style } from "hono/css";
|
|
3
|
+
import { globalStyles } from "../styles/theme.js";
|
|
4
|
+
/**
|
|
5
|
+
* Base HTML shell with head, meta tags, Google Fonts, and global styles.
|
|
6
|
+
* Wraps every page with consistent document structure.
|
|
7
|
+
*/
|
|
8
|
+
export const Layout = ({ title, children }) => (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charset: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), _jsxs("title", { children: [title, " | COGENT"] }), _jsx(Style, {}), _jsx("link", { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap" }), _jsx("link", { rel: "icon", href: "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='2' fill='%230d1117'/><path d='M12 3H5a2 2 0 00-2 2v6a2 2 0 002 2h7v-2H5V5h7V3z' fill='%2300ff41'/></svg>" }), _jsx("script", { async: true, src: "https://www.googletagmanager.com/gtag/js?id=G-6DKTK06CZT" }), _jsx("script", { dangerouslySetInnerHTML: {
|
|
9
|
+
__html: `window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-6DKTK06CZT');`
|
|
10
|
+
} })] }), _jsx("body", { class: globalStyles, children: children })] }));
|
|
11
|
+
//# sourceMappingURL=Layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/ui/components/Layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC9D,gBAAM,IAAI,EAAC,IAAI,aACb,2BACE,eAAM,OAAO,EAAC,OAAO,GAAG,EACxB,eAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACtE,4BAAQ,KAAK,iBAAkB,EAC/B,KAAC,KAAK,KAAG,EACT,eACE,GAAG,EAAC,YAAY,EAChB,IAAI,EAAC,mFAAmF,GACxF,EACF,eACE,GAAG,EAAC,MAAM,EACV,IAAI,EAAC,0NAA0N,GAC/N,EACF,iBAAQ,KAAK,QAAC,GAAG,EAAC,0DAA0D,GAAG,EAC/E,iBAAQ,uBAAuB,EAAE;wBAC/B,MAAM,EAAE,uIAAuI;qBAChJ,GAAI,IACA,EACP,eAAM,KAAK,EAAE,YAAY,YAAG,QAAQ,GAAQ,IACvC,CACR,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC } from "hono/jsx";
|
|
2
|
+
/** Props for the NavBar component. */
|
|
3
|
+
interface NavBarProps {
|
|
4
|
+
active?: "dashboard" | "sessions" | "messages";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Admin navigation bar with links to dashboard, sessions, and messages.
|
|
8
|
+
* Highlights the active page via the `active` prop.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NavBar: FC<NavBarProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=NavBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../../src/ui/components/NavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAInC,sCAAsC;AACtC,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;CAChD;AA0DD;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAyBlC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
2
|
+
import { css } from "hono/css";
|
|
3
|
+
import { colors } from "../styles/theme.js";
|
|
4
|
+
const navStyle = css `
|
|
5
|
+
background: #010409;
|
|
6
|
+
padding: 0.75rem 1.5rem;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 1.5rem;
|
|
10
|
+
border-bottom: 1px solid ${colors.border};
|
|
11
|
+
margin-bottom: 2rem;
|
|
12
|
+
`;
|
|
13
|
+
const linkStyle = css `
|
|
14
|
+
color: ${colors.textMuted};
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
font-size: 0.85rem;
|
|
17
|
+
padding: 0.35rem 0.75rem;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
transition: color 0.15s;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
color: ${colors.text};
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const activeLinkStyle = css `
|
|
27
|
+
color: ${colors.green};
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
font-size: 0.85rem;
|
|
30
|
+
padding: 0.35rem 0.75rem;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
border-bottom: 2px solid ${colors.green};
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const backLink = css `
|
|
39
|
+
margin-left: auto;
|
|
40
|
+
color: ${colors.textMuted};
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
font-size: 0.8rem;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${colors.cyan};
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
const brandText = css `
|
|
50
|
+
color: ${colors.green};
|
|
51
|
+
font-size: 0.85rem;
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
margin-right: 0.5rem;
|
|
54
|
+
`;
|
|
55
|
+
/**
|
|
56
|
+
* Admin navigation bar with links to dashboard, sessions, and messages.
|
|
57
|
+
* Highlights the active page via the `active` prop.
|
|
58
|
+
*/
|
|
59
|
+
export const NavBar = ({ active }) => (_jsxs("nav", { class: navStyle, children: [_jsx("span", { class: brandText, children: "COGENT Admin" }), _jsx("a", { href: "/admin", class: active === "dashboard" ? activeLinkStyle : linkStyle, children: "Dashboard" }), _jsx("a", { href: "/admin/sessions", class: active === "sessions" ? activeLinkStyle : linkStyle, children: "Sessions" }), _jsx("a", { href: "/admin/messages", class: active === "messages" ? activeLinkStyle : linkStyle, children: "Messages" }), _jsx("a", { href: "/", class: backLink, children: "\u2190 Back to Site" })] }));
|
|
60
|
+
//# sourceMappingURL=NavBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavBar.js","sourceRoot":"","sources":["../../../src/ui/components/NavBar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAO5C,MAAM,QAAQ,GAA2B,GAAG,CAAA;;;;;;6BAMf,MAAM,CAAC,MAAM;;CAEzC,CAAC;AAEF,MAAM,SAAS,GAA2B,GAAG,CAAA;WAClC,MAAM,CAAC,SAAS;;;;;;;;aAQd,MAAM,CAAC,IAAI;;;CAGvB,CAAC;AAEF,MAAM,eAAe,GAA2B,GAAG,CAAA;WACxC,MAAM,CAAC,KAAK;;;;;6BAKM,MAAM,CAAC,KAAK;;;;;CAKxC,CAAC;AAEF,MAAM,QAAQ,GAA2B,GAAG,CAAA;;WAEjC,MAAM,CAAC,SAAS;;;;;aAKd,MAAM,CAAC,IAAI;;;CAGvB,CAAC;AAEF,MAAM,SAAS,GAA2B,GAAG,CAAA;WAClC,MAAM,CAAC,KAAK;;;;CAItB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACrD,eAAK,KAAK,EAAE,QAAQ,aAClB,eAAM,KAAK,EAAE,SAAS,6BAAqB,EAC3C,YACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,0BAGzD,EACJ,YACE,IAAI,EAAC,iBAAiB,EACtB,KAAK,EAAE,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,yBAGxD,EACJ,YACE,IAAI,EAAC,iBAAiB,EACtB,KAAK,EAAE,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,yBAGxD,EACJ,YAAG,IAAI,EAAC,GAAG,EAAC,KAAK,EAAE,QAAQ,oCAEvB,IACA,CACP,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC } from "hono/jsx";
|
|
2
|
+
/** Props for the StatCard component. */
|
|
3
|
+
interface StatCardProps {
|
|
4
|
+
id: string;
|
|
5
|
+
value: number;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Stat display card with a large numeric value and descriptive label.
|
|
10
|
+
* The value element uses the `id` attribute for SSE live updates.
|
|
11
|
+
*/
|
|
12
|
+
export declare const StatCard: FC<StatCardProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=StatCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatCard.d.ts","sourceRoot":"","sources":["../../../src/ui/components/StatCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAInC,wCAAwC;AACxC,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AA4BD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAOtC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
2
|
+
import { css } from "hono/css";
|
|
3
|
+
import { colors, fonts } from "../styles/theme.js";
|
|
4
|
+
const cardStyle = css `
|
|
5
|
+
background: ${colors.bgCard};
|
|
6
|
+
border: 1px solid ${colors.border};
|
|
7
|
+
border-radius: 6px;
|
|
8
|
+
padding: 1.5rem;
|
|
9
|
+
text-align: center;
|
|
10
|
+
min-width: 180px;
|
|
11
|
+
flex: 1;
|
|
12
|
+
`;
|
|
13
|
+
const valueStyle = css `
|
|
14
|
+
font-family: ${fonts.mono};
|
|
15
|
+
font-size: 2.5rem;
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
color: ${colors.green};
|
|
18
|
+
margin: 0 0 0.5rem 0;
|
|
19
|
+
`;
|
|
20
|
+
const labelStyle = css `
|
|
21
|
+
font-family: ${fonts.mono};
|
|
22
|
+
font-size: 0.75rem;
|
|
23
|
+
color: ${colors.textMuted};
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
letter-spacing: 0.1em;
|
|
26
|
+
`;
|
|
27
|
+
/**
|
|
28
|
+
* Stat display card with a large numeric value and descriptive label.
|
|
29
|
+
* The value element uses the `id` attribute for SSE live updates.
|
|
30
|
+
*/
|
|
31
|
+
export const StatCard = ({ id, value, label }) => (_jsxs("div", { class: cardStyle, children: [_jsx("div", { id: id, class: valueStyle, children: value }), _jsx("div", { class: labelStyle, children: label })] }));
|
|
32
|
+
//# sourceMappingURL=StatCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatCard.js","sourceRoot":"","sources":["../../../src/ui/components/StatCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AASnD,MAAM,SAAS,GAA2B,GAAG,CAAA;gBAC7B,MAAM,CAAC,MAAM;sBACP,MAAM,CAAC,MAAM;;;;;;CAMlC,CAAC;AAEF,MAAM,UAAU,GAA2B,GAAG,CAAA;iBAC7B,KAAK,CAAC,IAAI;;;WAGhB,MAAM,CAAC,KAAK;;CAEtB,CAAC;AAEF,MAAM,UAAU,GAA2B,GAAG,CAAA;iBAC7B,KAAK,CAAC,IAAI;;WAEhB,MAAM,CAAC,SAAS;;;CAG1B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACnE,eAAK,KAAK,EAAE,SAAS,aACnB,cAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,YAC3B,KAAK,GACF,EACN,cAAK,KAAK,EAAE,UAAU,YAAG,KAAK,GAAO,IACjC,CACP,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FC } from "hono/jsx";
|
|
2
|
+
/** Props for the Terminal component. */
|
|
3
|
+
interface TerminalProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
children: any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Terminal-styled container with optional header bar (colored dots + title)
|
|
9
|
+
* and padded content area. Used to wrap code blocks and guide sections.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Terminal: FC<TerminalProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Terminal.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Terminal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAInC,wCAAwC;AACxC,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;CACf;AAmCD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAYtC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
2
|
+
import { css } from "hono/css";
|
|
3
|
+
import { colors } from "../styles/theme.js";
|
|
4
|
+
const terminalWrapper = css `
|
|
5
|
+
background: ${colors.bgTerminal};
|
|
6
|
+
border: 1px solid ${colors.border};
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
`;
|
|
10
|
+
const headerBar = css `
|
|
11
|
+
background: #010409;
|
|
12
|
+
padding: 0.75rem 1rem;
|
|
13
|
+
border-bottom: 1px solid ${colors.border};
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
`;
|
|
18
|
+
const dot = css `
|
|
19
|
+
width: 12px;
|
|
20
|
+
height: 12px;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
`;
|
|
24
|
+
const titleText = css `
|
|
25
|
+
color: ${colors.textMuted};
|
|
26
|
+
font-size: 0.8rem;
|
|
27
|
+
margin-left: 0.5rem;
|
|
28
|
+
`;
|
|
29
|
+
const contentArea = css `
|
|
30
|
+
padding: 1.5rem;
|
|
31
|
+
`;
|
|
32
|
+
/**
|
|
33
|
+
* Terminal-styled container with optional header bar (colored dots + title)
|
|
34
|
+
* and padded content area. Used to wrap code blocks and guide sections.
|
|
35
|
+
*/
|
|
36
|
+
export const Terminal = ({ title, children }) => (_jsxs("div", { class: terminalWrapper, children: [title && (_jsxs("div", { class: headerBar, children: [_jsx("span", { class: dot, style: "background: #f85149;" }), _jsx("span", { class: dot, style: "background: #e3b341;" }), _jsx("span", { class: dot, style: "background: #00ff41;" }), _jsx("span", { class: titleText, children: title })] })), _jsx("div", { class: contentArea, children: children })] }));
|
|
37
|
+
//# sourceMappingURL=Terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/ui/components/Terminal.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAQ5C,MAAM,eAAe,GAA2B,GAAG,CAAA;gBACnC,MAAM,CAAC,UAAU;sBACX,MAAM,CAAC,MAAM;;;CAGlC,CAAC;AAEF,MAAM,SAAS,GAA2B,GAAG,CAAA;;;6BAGhB,MAAM,CAAC,MAAM;;;;CAIzC,CAAC;AAEF,MAAM,GAAG,GAA2B,GAAG,CAAA;;;;;CAKtC,CAAC;AAEF,MAAM,SAAS,GAA2B,GAAG,CAAA;WAClC,MAAM,CAAC,SAAS;;;CAG1B,CAAC;AAEF,MAAM,WAAW,GAA2B,GAAG,CAAA;;CAE9C,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAClE,eAAK,KAAK,EAAE,eAAe,aACxB,KAAK,IAAI,CACR,eAAK,KAAK,EAAE,SAAS,aACnB,eAAM,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,sBAAsB,GAAG,EACjD,eAAM,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,sBAAsB,GAAG,EACjD,eAAM,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,sBAAsB,GAAG,EACjD,eAAM,KAAK,EAAE,SAAS,YAAG,KAAK,GAAQ,IAClC,CACP,EACD,cAAK,KAAK,EAAE,WAAW,YAAG,QAAQ,GAAO,IACrC,CACP,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FC } from "hono/jsx";
|
|
2
|
+
import type { ServerStats } from "../../services/stats-service.js";
|
|
3
|
+
/** Props for the AdminDashboard page. */
|
|
4
|
+
interface AdminDashboardProps {
|
|
5
|
+
stats: ServerStats;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Admin overview page with summary stats and quick-action links.
|
|
9
|
+
* Renders Layout with NavBar, three stat cards, and navigation buttons.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AdminDashboard: FC<AdminDashboardProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AdminDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminDashboard.d.ts","sourceRoot":"","sources":["../../../src/ui/pages/AdminDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAOnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,yCAAyC;AACzC,UAAU,mBAAmB;IAC3B,KAAK,EAAE,WAAW,CAAC;CACpB;AAuDD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAuClD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
2
|
+
import { css } from "hono/css";
|
|
3
|
+
import { Layout } from "../components/Layout.js";
|
|
4
|
+
import { NavBar } from "../components/NavBar.js";
|
|
5
|
+
import { StatCard } from "../components/StatCard.js";
|
|
6
|
+
import { Footer } from "../components/Footer.js";
|
|
7
|
+
import { colors } from "../styles/theme.js";
|
|
8
|
+
const container = css `
|
|
9
|
+
max-width: 960px;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
padding: 0 1.5rem 2rem;
|
|
12
|
+
`;
|
|
13
|
+
const pageTitle = css `
|
|
14
|
+
font-size: 1.5rem;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
color: ${colors.text};
|
|
17
|
+
margin: 0 0 2rem 0;
|
|
18
|
+
`;
|
|
19
|
+
const statsRow = css `
|
|
20
|
+
display: flex;
|
|
21
|
+
gap: 1.5rem;
|
|
22
|
+
flex-wrap: wrap;
|
|
23
|
+
margin-bottom: 3rem;
|
|
24
|
+
`;
|
|
25
|
+
const quickLinksSection = css `
|
|
26
|
+
margin-top: 1rem;
|
|
27
|
+
`;
|
|
28
|
+
const quickLinksTitle = css `
|
|
29
|
+
font-size: 1rem;
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
color: ${colors.text};
|
|
32
|
+
margin: 0 0 1rem 0;
|
|
33
|
+
`;
|
|
34
|
+
const linkRow = css `
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: 1rem;
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
`;
|
|
39
|
+
const actionLink = css `
|
|
40
|
+
display: inline-block;
|
|
41
|
+
padding: 0.6rem 1.2rem;
|
|
42
|
+
background: ${colors.bgCard};
|
|
43
|
+
border: 1px solid ${colors.border};
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
color: ${colors.cyan};
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
font-size: 0.85rem;
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
border-color: ${colors.cyan};
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
/**
|
|
55
|
+
* Admin overview page with summary stats and quick-action links.
|
|
56
|
+
* Renders Layout with NavBar, three stat cards, and navigation buttons.
|
|
57
|
+
*/
|
|
58
|
+
export const AdminDashboard = ({ stats }) => (_jsxs(Layout, { title: "Admin Dashboard", children: [_jsx(NavBar, { active: "dashboard" }), _jsxs("div", { class: container, children: [_jsx("h1", { class: pageTitle, children: "Dashboard" }), _jsxs("div", { class: statsRow, children: [_jsx(StatCard, { id: "admin-sessions", value: stats.activeSessions, label: "Active Sessions" }), _jsx(StatCard, { id: "admin-agents", value: stats.connectedAgents, label: "Connected Agents" }), _jsx(StatCard, { id: "admin-messages", value: stats.totalMessagesRelayed, label: "Total Messages" })] }), _jsxs("div", { class: quickLinksSection, children: [_jsx("h2", { class: quickLinksTitle, children: "Quick Actions" }), _jsxs("div", { class: linkRow, children: [_jsx("a", { href: "/admin/sessions", class: actionLink, children: "Manage Sessions" }), _jsx("a", { href: "/admin/messages", class: actionLink, children: "View Messages" })] })] }), _jsx(Footer, {})] })] }));
|
|
59
|
+
//# sourceMappingURL=AdminDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminDashboard.js","sourceRoot":"","sources":["../../../src/ui/pages/AdminDashboard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAQ5C,MAAM,SAAS,GAA2B,GAAG,CAAA;;;;CAI5C,CAAC;AAEF,MAAM,SAAS,GAA2B,GAAG,CAAA;;;WAGlC,MAAM,CAAC,IAAI;;CAErB,CAAC;AAEF,MAAM,QAAQ,GAA2B,GAAG,CAAA;;;;;CAK3C,CAAC;AAEF,MAAM,iBAAiB,GAA2B,GAAG,CAAA;;CAEpD,CAAC;AAEF,MAAM,eAAe,GAA2B,GAAG,CAAA;;;WAGxC,MAAM,CAAC,IAAI;;CAErB,CAAC;AAEF,MAAM,OAAO,GAA2B,GAAG,CAAA;;;;CAI1C,CAAC;AAEF,MAAM,UAAU,GAA2B,GAAG,CAAA;;;gBAG9B,MAAM,CAAC,MAAM;sBACP,MAAM,CAAC,MAAM;;WAExB,MAAM,CAAC,IAAI;;;;;oBAKF,MAAM,CAAC,IAAI;;;CAG9B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACpE,MAAC,MAAM,IAAC,KAAK,EAAC,iBAAiB,aAC7B,KAAC,MAAM,IAAC,MAAM,EAAC,WAAW,GAAG,EAC7B,eAAK,KAAK,EAAE,SAAS,aACnB,aAAI,KAAK,EAAE,SAAS,0BAAgB,EAEpC,eAAK,KAAK,EAAE,QAAQ,aAClB,KAAC,QAAQ,IACP,EAAE,EAAC,gBAAgB,EACnB,KAAK,EAAE,KAAK,CAAC,cAAc,EAC3B,KAAK,EAAC,iBAAiB,GACvB,EACF,KAAC,QAAQ,IACP,EAAE,EAAC,cAAc,EACjB,KAAK,EAAE,KAAK,CAAC,eAAe,EAC5B,KAAK,EAAC,kBAAkB,GACxB,EACF,KAAC,QAAQ,IACP,EAAE,EAAC,gBAAgB,EACnB,KAAK,EAAE,KAAK,CAAC,oBAAoB,EACjC,KAAK,EAAC,gBAAgB,GACtB,IACE,EAEN,eAAK,KAAK,EAAE,iBAAiB,aAC3B,aAAI,KAAK,EAAE,eAAe,8BAAoB,EAC9C,eAAK,KAAK,EAAE,OAAO,aACjB,YAAG,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAE,UAAU,gCAEvC,EACJ,YAAG,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAE,UAAU,8BAEvC,IACA,IACF,EAEN,KAAC,MAAM,KAAG,IACN,IACC,CACV,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FC } from "hono/jsx";
|
|
2
|
+
/**
|
|
3
|
+
* Comprehensive "How-To" guide page covering real-world use cases
|
|
4
|
+
* for Cogent Bridge from the perspective of business owners,
|
|
5
|
+
* product owners, and project managers.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HowToPage: FC;
|
|
8
|
+
//# sourceMappingURL=HowToPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HowToPage.d.ts","sourceRoot":"","sources":["../../../src/ui/pages/HowToPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAmTnC;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,EAi0BvB,CAAC"}
|