pi-mega-compact 0.8.8 → 0.8.10
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/extensions/dashboard-server/api-contracts/core.js +7 -0
- package/dist/extensions/dashboard-server/api-contracts/endpoints.js +104 -0
- package/dist/extensions/dashboard-server/api-contracts/game.js +9 -0
- package/dist/extensions/dashboard-server/api-contracts/index.js +9 -0
- package/dist/extensions/dashboard-server/api-contracts/infrastructure.js +10 -0
- package/dist/extensions/dashboard-server/api-contracts/multi-repo.js +9 -0
- package/dist/extensions/dashboard-server/api-contracts/snapshot.js +8 -0
- package/dist/extensions/dashboard-server/api-contracts.js +8 -0
- package/dist/extensions/dashboard-server/api-contracts.test.js +869 -0
- package/dist/extensions/dashboard-server/auth.js +18 -0
- package/dist/extensions/dashboard-server/helpers.js +37 -0
- package/dist/extensions/dashboard-server/html/all-repos-tab.js +26 -0
- package/dist/extensions/dashboard-server/html/body-open.js +23 -0
- package/dist/extensions/dashboard-server/html/current-repo-tab.js +130 -0
- package/dist/extensions/dashboard-server/html/head-open.js +16 -0
- package/dist/extensions/dashboard-server/html/high-score-tab.js +25 -0
- package/dist/extensions/dashboard-server/html/repo-detail-modal.js +26 -0
- package/dist/extensions/dashboard-server/html/script.js +259 -0
- package/dist/extensions/dashboard-server/html/styles.js +103 -0
- package/dist/extensions/dashboard-server/html/summary-tab.js +19 -0
- package/dist/extensions/dashboard-server/html-template.js +41 -0
- package/dist/extensions/dashboard-server/server.js +191 -39
- package/dist/extensions/dashboard-server/tailscale.js +8 -0
- package/dist/extensions/dashboard-server/types.js +4 -0
- package/dist/src/store/sqlite/connection.js +35 -0
- package/dist/src/store/sqlite/index-store.js +167 -0
- package/dist/src/store/sqlite/memory.js +54 -0
- package/dist/src/store/sqlite/minhash-lsh.js +47 -0
- package/dist/src/store/sqlite/sessions.js +39 -0
- package/dist/src/store/sqlite/transaction.js +19 -0
- package/dist/src/vectorStore/add.js +260 -0
- package/dist/src/vectorStore/dedup.js +52 -0
- package/dist/src/vectorStore/index.js +10 -0
- package/dist/src/vectorStore/queries.js +83 -0
- package/dist/src/vectorStore/search.js +95 -0
- package/dist/src/vectorStore/session.js +19 -0
- package/dist/src/vectorStore/store.js +105 -0
- package/dist/src/vectorStore/types.js +6 -0
- package/dist/src/vectorStore/utils.js +23 -0
- package/extensions/dashboard-client/package-lock.json +1771 -0
- package/extensions/dashboard-client/package.json +27 -0
- package/extensions/dashboard-client/src/App.tsx +82 -0
- package/extensions/dashboard-client/src/api/client.ts +145 -0
- package/extensions/dashboard-client/src/components/CacheStatusPerModel.tsx +44 -0
- package/extensions/dashboard-client/src/components/CompressionCard.tsx +61 -0
- package/extensions/dashboard-client/src/components/ContextGauge.tsx +59 -0
- package/extensions/dashboard-client/src/components/DataSafetyCard.tsx +49 -0
- package/extensions/dashboard-client/src/components/ErrorBoundary.tsx +53 -0
- package/extensions/dashboard-client/src/components/EventCategoryFilter.tsx +16 -0
- package/extensions/dashboard-client/src/components/EventStream.tsx +152 -0
- package/extensions/dashboard-client/src/components/LoadingSpinner.tsx +7 -0
- package/extensions/dashboard-client/src/components/MemoryStatusCard.tsx +24 -0
- package/extensions/dashboard-client/src/components/ModelBadge.tsx +41 -0
- package/extensions/dashboard-client/src/components/PerfChart.tsx +160 -0
- package/extensions/dashboard-client/src/components/RepoDetailModal.tsx +126 -0
- package/extensions/dashboard-client/src/components/RepoTable.tsx +150 -0
- package/extensions/dashboard-client/src/components/SessionInfo.tsx +65 -0
- package/extensions/dashboard-client/src/components/SummaryTiles.tsx +52 -0
- package/extensions/dashboard-client/src/components/TabBar.tsx +34 -0
- package/extensions/dashboard-client/src/components/TriggerStatus.tsx +62 -0
- package/extensions/dashboard-client/src/hooks/useApi.ts +77 -0
- package/extensions/dashboard-client/src/hooks/useSSE.ts +87 -0
- package/extensions/dashboard-client/src/index.html +12 -0
- package/extensions/dashboard-client/src/main.tsx +23 -0
- package/extensions/dashboard-client/src/styles/base.css +121 -0
- package/extensions/dashboard-client/src/styles/overview-events.css +318 -0
- package/extensions/dashboard-client/src/styles/repos-metrics.css +307 -0
- package/extensions/dashboard-client/src/tabs/ConfigTab.tsx +16 -0
- package/extensions/dashboard-client/src/tabs/EventsTab.tsx +37 -0
- package/extensions/dashboard-client/src/tabs/MetricsTab.tsx +49 -0
- package/extensions/dashboard-client/src/tabs/OverviewTab.tsx +80 -0
- package/extensions/dashboard-client/src/tabs/ReposTab.tsx +59 -0
- package/extensions/dashboard-client/tsconfig.json +28 -0
- package/extensions/dashboard-client/vite.config.ts +38 -0
- package/extensions/dashboard-server/api-contracts/core.ts +302 -0
- package/extensions/dashboard-server/api-contracts/endpoints.ts +476 -0
- package/extensions/dashboard-server/api-contracts/game.ts +145 -0
- package/extensions/dashboard-server/api-contracts/index.ts +159 -0
- package/extensions/dashboard-server/api-contracts/infrastructure.ts +465 -0
- package/extensions/dashboard-server/api-contracts/multi-repo.ts +328 -0
- package/extensions/dashboard-server/api-contracts/snapshot.ts +386 -0
- package/extensions/dashboard-server/api-contracts.test.ts +1050 -0
- package/extensions/dashboard-server/api-contracts.ts +96 -0
- package/extensions/dashboard-server/auth.ts +20 -0
- package/extensions/dashboard-server/server.ts +862 -582
- package/extensions/dashboard-server/tailscale.ts +7 -0
- package/extensions/dashboard-server/types.ts +23 -114
- package/package.json +2 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/endpoints.ts — Central registry of all dashboard API endpoints.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for all 13 dashboard API routes. Each entry is an
|
|
5
|
+
* `EndpointDef` (or `SseEndpointDef` for SSE) instance with method, path,
|
|
6
|
+
* description, and typed request/response references.
|
|
7
|
+
*
|
|
8
|
+
* Sprint A1 — PREVENT-PI-004: zero network code (type definitions only).
|
|
9
|
+
* PREVENT-011: no `any` type — all types are explicit.
|
|
10
|
+
*/
|
|
11
|
+
// ─── ENDPOINTS Registry ─────────────────────────────────────────────────────
|
|
12
|
+
/**
|
|
13
|
+
* Central registry of all 13 dashboard API endpoints. Each entry is an
|
|
14
|
+
* `EndpointDef` or `SseEndpointDef` instance serving as the single source of
|
|
15
|
+
* truth for route paths, methods, descriptions, and typed request/response
|
|
16
|
+
* contracts.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* import { ENDPOINTS } from './api-contracts';
|
|
20
|
+
* ENDPOINTS.snapshot.path // '/api/snapshot'
|
|
21
|
+
* ENDPOINTS.snapshot.method // 'GET'
|
|
22
|
+
*/
|
|
23
|
+
export const ENDPOINTS = {
|
|
24
|
+
/** GET /api/snapshot — Full session, store, compression, and context snapshot. */
|
|
25
|
+
snapshot: {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
path: '/api/snapshot',
|
|
28
|
+
description: 'Full session, store, compression, and context snapshot.',
|
|
29
|
+
},
|
|
30
|
+
/** GET /api/version — Dashboard server version string. */
|
|
31
|
+
version: {
|
|
32
|
+
method: 'GET',
|
|
33
|
+
path: '/api/version',
|
|
34
|
+
description: 'Dashboard server version for stale-server detection.',
|
|
35
|
+
},
|
|
36
|
+
/** GET /api/index — Multi-repo aggregate index (or fallback when unavailable). */
|
|
37
|
+
index: {
|
|
38
|
+
method: 'GET',
|
|
39
|
+
path: '/api/index',
|
|
40
|
+
description: 'Machine-wide multi-repo registry with checkpoints, tokens, and model info.',
|
|
41
|
+
},
|
|
42
|
+
/** GET /api/repos — Registry list with optional active-window filter. */
|
|
43
|
+
repos: {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
path: '/api/repos',
|
|
46
|
+
description: 'Repo registry list, optionally filtered by recent activity.',
|
|
47
|
+
},
|
|
48
|
+
/** GET /api/summary — Lightweight header tiles without the full repo list. */
|
|
49
|
+
summary: {
|
|
50
|
+
method: 'GET',
|
|
51
|
+
path: '/api/summary',
|
|
52
|
+
description: 'Aggregate summary with active/total repo counts (no repo list).',
|
|
53
|
+
},
|
|
54
|
+
/** GET /api/drift — Cross-repo drift report. */
|
|
55
|
+
drift: {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
path: '/api/drift',
|
|
58
|
+
description: 'Cross-repo drift report flagging stale repos, compaction lag, and model churn.',
|
|
59
|
+
},
|
|
60
|
+
/** GET /api/servers — Recently-active repo servers with live snapshot data. */
|
|
61
|
+
servers: {
|
|
62
|
+
method: 'GET',
|
|
63
|
+
path: '/api/servers',
|
|
64
|
+
description: 'Recently-active repo servers with live snapshot data.',
|
|
65
|
+
},
|
|
66
|
+
/** GET /api/events — SSE stream of dashboard events. */
|
|
67
|
+
events: {
|
|
68
|
+
type: 'sse',
|
|
69
|
+
method: 'GET',
|
|
70
|
+
path: '/api/events',
|
|
71
|
+
description: 'Server-Sent Events stream of all dashboard events.',
|
|
72
|
+
event: 'data',
|
|
73
|
+
},
|
|
74
|
+
/** GET /api/game-state — Current game-mode settings. */
|
|
75
|
+
getGameState: {
|
|
76
|
+
method: 'GET',
|
|
77
|
+
path: '/api/game-state',
|
|
78
|
+
description: 'Current game-mode configuration and active ritual state.',
|
|
79
|
+
},
|
|
80
|
+
/** PUT /api/game-state — Apply a partial patch to game-mode settings. */
|
|
81
|
+
putGameState: {
|
|
82
|
+
method: 'PUT',
|
|
83
|
+
path: '/api/game-state',
|
|
84
|
+
description: 'Apply a partial patch to game-mode settings and return the updated state.',
|
|
85
|
+
},
|
|
86
|
+
/** GET /api/game-scores — High-score leaderboard for a metric. */
|
|
87
|
+
gameScores: {
|
|
88
|
+
method: 'GET',
|
|
89
|
+
path: '/api/game-scores',
|
|
90
|
+
description: 'High-score leaderboard for a game metric.',
|
|
91
|
+
},
|
|
92
|
+
/** GET /api/perf — Rolling-window performance aggregates. */
|
|
93
|
+
perf: {
|
|
94
|
+
method: 'GET',
|
|
95
|
+
path: '/api/perf',
|
|
96
|
+
description: 'Rolling-window performance aggregates over perf_samples.',
|
|
97
|
+
},
|
|
98
|
+
/** GET /api/achievements — Achievement tiles with unlock state. */
|
|
99
|
+
achievements: {
|
|
100
|
+
method: 'GET',
|
|
101
|
+
path: '/api/achievements',
|
|
102
|
+
description: 'All achievement rows with unlock state.',
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/game.ts — Game mode and mega-game contracts.
|
|
3
|
+
*
|
|
4
|
+
* Contains: GameConfig, GameStateResponse, GameRitualStage,
|
|
5
|
+
* SseGameRitualStart, SseGameRitualStage, SseGameRitualEnd,
|
|
6
|
+
* SseGameModeChanged, SseGameRender.
|
|
7
|
+
* Extracted from api-contracts.ts (Sprint A1 split).
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/index.ts — Barrel re-export for all API contract domains.
|
|
3
|
+
*
|
|
4
|
+
* Import from this file to access all types:
|
|
5
|
+
* import type { SnapshotResponse, RepoListItem } from '../api-contracts';
|
|
6
|
+
* // or explicitly:
|
|
7
|
+
* import type { SnapshotResponse } from '../api-contracts/snapshot';
|
|
8
|
+
*/
|
|
9
|
+
export { ENDPOINTS } from './endpoints.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/infrastructure.ts — Infrastructure, diagnostics, and monitoring contracts.
|
|
3
|
+
*
|
|
4
|
+
* Contains: InfraHealthResponse, InfraPerfSampleResponse,
|
|
5
|
+
* InfraRateLimitStatus, InfraRateLimitResponse, ContextLevelState,
|
|
6
|
+
* TierOverrideState, FallbackState, RepeatInjectionState,
|
|
7
|
+
* SupersedeGatingState, MinHashBandState.
|
|
8
|
+
* Extracted from api-contracts.ts (Sprint A1 split).
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/multi-repo.ts — Multi-repo index and repo management contracts.
|
|
3
|
+
*
|
|
4
|
+
* Contains: RepoListItem, RepoSnapshotEntry, RepoSnapshotMap,
|
|
5
|
+
* IndexesIndexRow, IndexesSummaryResponse, IndexesDiffEntry,
|
|
6
|
+
* DiffRequest, DiffResponse, UpdateRepoConfigRequest.
|
|
7
|
+
* Extracted from api-contracts.ts (Sprint A1 split).
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/snapshot.ts — Snapshot / store / compression / session contracts.
|
|
3
|
+
*
|
|
4
|
+
* Contains: SnapshotResponse, TriggerResponse, CompressionTotalsResponse,
|
|
5
|
+
* CompactHistoryEntry, CompactionRequest, CompactionResponse.
|
|
6
|
+
* Extracted from api-contracts.ts (Sprint A1 split).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from `./api-contracts/index.js` (barrel) instead.
|
|
3
|
+
* This file is retained for backward compatibility. All types are re-exported
|
|
4
|
+
* from domain modules under `api-contracts/`.
|
|
5
|
+
*
|
|
6
|
+
* See: api-contracts/core.ts, snapshot.ts, multi-repo.ts, game.ts, infrastructure.ts
|
|
7
|
+
*/
|
|
8
|
+
export { ENDPOINTS } from './api-contracts/index.js';
|