pi-mega-compact 0.9.2 → 0.10.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/README.md +3 -2
- package/dist/extensions/dashboard-server/api-contracts/endpoints.js +95 -47
- package/dist/extensions/dashboard-server/api-contracts/index.js +1 -1
- package/dist/extensions/dashboard-server/api-contracts/turns.js +10 -0
- package/dist/extensions/dashboard-server/api-contracts.test.js +3 -2
- package/dist/extensions/dashboard-server/routes-topics.js +87 -0
- package/dist/extensions/dashboard-server/routes-turns.js +251 -0
- package/dist/extensions/dashboard-server/routes.js +3 -1
- package/dist/extensions/dashboard-server/server.js +6 -2
- package/dist/extensions/mega-compact.js +10 -6
- package/dist/extensions/mega-config.js +4 -0
- package/dist/extensions/mega-events/agent-handlers.js +62 -49
- package/dist/extensions/mega-events/context-handler.js +48 -2
- package/dist/extensions/mega-events/session-handlers.js +24 -0
- package/dist/extensions/mega-metrics-cmds.js +90 -0
- package/dist/extensions/mega-pipeline/recall.js +47 -17
- package/dist/extensions/mega-topics-cmds.js +111 -0
- package/dist/extensions/mega-turn-store.js +110 -0
- package/dist/extensions/mega-turn-store.test.js +68 -0
- package/dist/src/config/turns.js +48 -0
- package/dist/src/fork.js +33 -0
- package/dist/src/fork.test.js +81 -0
- package/dist/src/intent.js +51 -0
- package/dist/src/intent.test.js +78 -0
- package/dist/src/metrics/index.js +4 -0
- package/dist/src/metrics/turns.js +118 -0
- package/dist/src/metrics/turns.test.js +152 -0
- package/dist/src/store/sqlite/raw-transcript.js +5 -3
- package/dist/src/store/sqlite.dbmirror.test.js +9 -0
- package/dist/src/store/turns/connection.js +123 -0
- package/dist/src/store/turns/contract-compliance.test.js +428 -0
- package/dist/src/store/turns/index.js +31 -0
- package/dist/src/store/turns/memory-store.js +357 -0
- package/dist/src/store/turns/memory-store.test.js +9 -0
- package/dist/src/store/turns/migrations.js +178 -0
- package/dist/src/store/turns/migrations.test.js +138 -0
- package/dist/src/store/turns/schema.js +115 -0
- package/dist/src/store/turns/sqlite-store.js +455 -0
- package/dist/src/store/turns/sqlite-store.test.js +144 -0
- package/dist/src/store/turns/types.js +16 -0
- package/dist/src/topics/cluster.js +141 -0
- package/dist/src/topics/cluster.test.js +150 -0
- package/dist/src/topics/index.js +6 -0
- package/dist/src/topics/kselection.js +142 -0
- package/dist/src/topics/labels.js +56 -0
- package/dist/src/topics/store.js +119 -0
- package/dist/src/topics/store.test.js +117 -0
- package/dist/src/topics/types.js +8 -0
- package/dist/src/wiki.js +133 -0
- package/dist/src/wiki.test.js +171 -0
- package/extensions/dashboard-client/dist/assets/{AchievementTiles-QPo46Pwg.js → AchievementTiles-DUulvXUY.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AchievementTiles-QPo46Pwg.js.map → AchievementTiles-DUulvXUY.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{AchievementsTab-BDJxRXRY.js → AchievementsTab-Dx0YtCNf.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AchievementsTab-BDJxRXRY.js.map → AchievementsTab-Dx0YtCNf.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-CUMqXQjd.js → CacheTab-DtkaUo1v.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-CUMqXQjd.js.map → CacheTab-DtkaUo1v.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ConfigTab-j1dRzurG.js → ConfigTab-CLa4KfiZ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ConfigTab-j1dRzurG.js.map → ConfigTab-CLa4KfiZ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-CMglXK4p.js → EventsTab-Q6tEIBBi.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-CMglXK4p.js.map → EventsTab-Q6tEIBBi.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{GameTab-fpaDoyxi.js → GameTab-Hq7GNWSY.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{GameTab-fpaDoyxi.js.map → GameTab-Hq7GNWSY.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-CWG2crG_.js → MetricsTab-BtmBV6lU.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-CWG2crG_.js.map → MetricsTab-BtmBV6lU.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BaV2D2nf.js → OverviewTab-CL10PwVU.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BaV2D2nf.js.map → OverviewTab-CL10PwVU.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-C-0kuZ_0.js → ReposTab-DAwANwbI.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-C-0kuZ_0.js.map → ReposTab-DAwANwbI.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CSYhddCA.js → SessionsTab-Ec08TZRQ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CSYhddCA.js.map → SessionsTab-Ec08TZRQ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-Dy4KRjSM.js → TimeSavedCard-COb8dpTy.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-Dy4KRjSM.js.map → TimeSavedCard-COb8dpTy.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/TopicsTab-kvX3F3dY.js +2 -0
- package/extensions/dashboard-client/dist/assets/TopicsTab-kvX3F3dY.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/TurnsTab-CCUE73Aa.js +2 -0
- package/extensions/dashboard-client/dist/assets/TurnsTab-CCUE73Aa.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{index-D_WtU2TV.js → index-UMrussFX.js} +10 -10
- package/extensions/dashboard-client/dist/assets/index-UMrussFX.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{index-og3ghxyY.css → index-gn66lYD2.css} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-C9yVJlGP.js → useSSE-BDHZ7CeS.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-C9yVJlGP.js.map → useSSE-BDHZ7CeS.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +2 -2
- package/extensions/dashboard-client/src/App.tsx +10 -2
- package/extensions/dashboard-client/src/api/client.ts +84 -1
- package/extensions/dashboard-client/src/main.tsx +1 -0
- package/extensions/dashboard-client/src/styles/turns.css +142 -0
- package/extensions/dashboard-client/src/tabs/TopicsTab.tsx +185 -0
- package/extensions/dashboard-client/src/tabs/TurnsTab.tsx +326 -0
- package/extensions/dashboard-server/api-contracts/endpoints.ts +389 -291
- package/extensions/dashboard-server/api-contracts/game-types.ts +141 -88
- package/extensions/dashboard-server/api-contracts/index.ts +153 -133
- package/extensions/dashboard-server/api-contracts/turns.ts +114 -0
- package/extensions/dashboard-server/api-contracts.test.ts +920 -919
- package/extensions/dashboard-server/routes-topics.ts +119 -0
- package/extensions/dashboard-server/routes-turns.ts +282 -0
- package/extensions/dashboard-server/routes.ts +8 -1
- package/extensions/dashboard-server/server.ts +6 -2
- package/extensions/mega-compact.ts +75 -59
- package/extensions/mega-config.ts +232 -220
- package/extensions/mega-events/agent-handlers.ts +194 -151
- package/extensions/mega-events/context-handler.ts +50 -1
- package/extensions/mega-events/session-handlers.ts +23 -0
- package/extensions/mega-metrics-cmds.ts +114 -0
- package/extensions/mega-pipeline/recall.ts +215 -152
- package/extensions/mega-topics-cmds.ts +151 -0
- package/extensions/mega-turn-store.test.ts +108 -0
- package/extensions/mega-turn-store.ts +169 -0
- package/package.json +3 -1
- package/src/config/turns.ts +69 -0
- package/src/fork.test.ts +94 -0
- package/src/fork.ts +78 -0
- package/src/intent.test.ts +87 -0
- package/src/intent.ts +115 -0
- package/src/metrics/index.ts +9 -0
- package/src/metrics/turns.test.ts +165 -0
- package/src/metrics/turns.ts +201 -0
- package/src/store/sqlite/raw-transcript.ts +9 -3
- package/src/store/sqlite.dbmirror.test.ts +10 -0
- package/src/store/turns/connection.ts +137 -0
- package/src/store/turns/contract-compliance.test.ts +562 -0
- package/src/store/turns/index.ts +65 -0
- package/src/store/turns/memory-store.test.ts +15 -0
- package/src/store/turns/memory-store.ts +469 -0
- package/src/store/turns/migrations.test.ts +161 -0
- package/src/store/turns/migrations.ts +203 -0
- package/src/store/turns/schema.ts +158 -0
- package/src/store/turns/sqlite-store.test.ts +161 -0
- package/src/store/turns/sqlite-store.ts +656 -0
- package/src/store/turns/types.ts +181 -0
- package/src/topics/cluster.test.ts +176 -0
- package/src/topics/cluster.ts +191 -0
- package/src/topics/index.ts +18 -0
- package/src/topics/kselection.ts +182 -0
- package/src/topics/labels.ts +67 -0
- package/src/topics/store.test.ts +132 -0
- package/src/topics/store.ts +208 -0
- package/src/topics/types.ts +64 -0
- package/src/wiki.test.ts +217 -0
- package/src/wiki.ts +198 -0
- package/dist/extensions/openclaw-mega-compact.js +0 -291
- package/dist/src/minilm.js +0 -92
- package/dist/src/wordpiece.js +0 -129
- package/extensions/dashboard-client/dist/assets/index-D_WtU2TV.js.map +0 -1
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* related type definitions that previously lived in endpoints.ts.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { GameConfig } from
|
|
9
|
-
import type { SseEvent } from
|
|
8
|
+
import type { GameConfig } from "./game.js";
|
|
9
|
+
import type { SseEvent } from "./index.js";
|
|
10
10
|
|
|
11
11
|
// ─── Game Score & Achievement Types ─────────────────────────────────────────
|
|
12
12
|
|
|
@@ -14,42 +14,42 @@ import type { SseEvent } from './index.js';
|
|
|
14
14
|
* A leaderboard row for GET /api/game-scores. One row per repo per metric.
|
|
15
15
|
*/
|
|
16
16
|
export interface GameScoreRow {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
/** Absolute path to the repo root. */
|
|
18
|
+
readonly repo_root: string;
|
|
19
|
+
/** Score value (interpretation depends on the metric). */
|
|
20
|
+
readonly value: number;
|
|
21
|
+
/** Unix timestamp (milliseconds) when the score was recorded. */
|
|
22
|
+
readonly ts: number;
|
|
23
|
+
/** Optional metadata associated with the score event. */
|
|
24
|
+
readonly meta: unknown;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Query parameters for GET /api/game-scores.
|
|
29
29
|
*/
|
|
30
30
|
export interface GameScoresQuery {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
/** Leaderboard metric (must be one of: cache, dedupe, turns, repos, mega_cache). Optional. */
|
|
32
|
+
readonly metric?: string;
|
|
33
|
+
/** Maximum number of rows to return (default: 10, clamped to [1, 100]). Optional. */
|
|
34
|
+
readonly limit?: number;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* An achievement row for GET /api/achievements. One row per seeded achievement.
|
|
39
39
|
*/
|
|
40
40
|
export interface AchievementRow {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
/** Achievement identifier. */
|
|
42
|
+
readonly id: string;
|
|
43
|
+
/** Display title of the achievement. */
|
|
44
|
+
readonly title: string;
|
|
45
|
+
/** Description of the unlock condition. */
|
|
46
|
+
readonly description: string;
|
|
47
|
+
/** Whether the achievement is hidden (1 = hidden, 0 = visible). */
|
|
48
|
+
readonly hidden: number;
|
|
49
|
+
/** Icon identifier, or null if no icon. */
|
|
50
|
+
readonly icon: string | null;
|
|
51
|
+
/** Unix timestamp (seconds) when unlocked, or null if not yet unlocked. */
|
|
52
|
+
readonly unlocked_at: number | null;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// ─── Sessions Memory Graph (S39) ─────────────────────────────────────────
|
|
@@ -59,26 +59,26 @@ export interface AchievementRow {
|
|
|
59
59
|
* live pi process with its latest token usage and heartbeat.
|
|
60
60
|
*/
|
|
61
61
|
export interface ActiveSession {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
62
|
+
/** OS process ID of the pi process. */
|
|
63
|
+
readonly pid: number;
|
|
64
|
+
/** Session identifier (normalized). */
|
|
65
|
+
readonly sessionId: string;
|
|
66
|
+
/** Absolute path to the repo root, or null if not in a git repo. */
|
|
67
|
+
readonly repoRoot: string | null;
|
|
68
|
+
/** Display name (repo basename or state dir basename). */
|
|
69
|
+
readonly displayName: string;
|
|
70
|
+
/** Model name, or null if not captured. Available from repo_registry join. */
|
|
71
|
+
readonly model: string | null;
|
|
72
|
+
/** Latest context token count, or null if no sample yet. */
|
|
73
|
+
readonly tokens: number | null;
|
|
74
|
+
/** Latest context pressure percentage (0–100), or null. */
|
|
75
|
+
readonly percent: number | null;
|
|
76
|
+
/** Context window size in tokens. */
|
|
77
|
+
readonly ctxWindow: number;
|
|
78
|
+
/** Unix timestamp (ms) of the last heartbeat. */
|
|
79
|
+
readonly lastSeen: number;
|
|
80
|
+
/** State directory of the session. */
|
|
81
|
+
readonly stateDir: string | null;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
@@ -86,34 +86,34 @@ export interface ActiveSession {
|
|
|
86
86
|
* token usage after pruning stale entries.
|
|
87
87
|
*/
|
|
88
88
|
export interface SessionsResponse {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
/** ISO timestamp when the response was generated. */
|
|
90
|
+
readonly updatedAt: string;
|
|
91
|
+
/** Number of stale sessions pruned during this request. */
|
|
92
|
+
readonly pruned: number;
|
|
93
|
+
/** Array of active sessions, sorted by lastSeen descending. */
|
|
94
|
+
readonly sessions: ActiveSession[];
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/** A single time-series data point for a session. */
|
|
98
98
|
export interface SessionDataPoint {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
/** Unix timestamp (ms). */
|
|
100
|
+
readonly ts: number;
|
|
101
|
+
/** Token count at this sample. */
|
|
102
|
+
readonly tokens: number;
|
|
103
|
+
/** Context pressure percentage (0–100). */
|
|
104
|
+
readonly percent: number;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/** A recharts-ready per-session series with a stable color. */
|
|
108
108
|
export interface SessionSeries {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
/** Session identifier. */
|
|
110
|
+
readonly sessionId: string;
|
|
111
|
+
/** Short display label for the legend. */
|
|
112
|
+
readonly label: string;
|
|
113
|
+
/** Stable hex color string (e.g. "#60a5fa"). */
|
|
114
|
+
readonly color: string;
|
|
115
|
+
/** Data points ordered by timestamp ascending. */
|
|
116
|
+
readonly data: SessionDataPoint[];
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/**
|
|
@@ -121,8 +121,8 @@ export interface SessionSeries {
|
|
|
121
121
|
* controls the rolling window size.
|
|
122
122
|
*/
|
|
123
123
|
export interface SessionTimeseriesQuery {
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
/** Rolling window size in minutes (default: 30, clamped to [1, 1440]). */
|
|
125
|
+
readonly minutes?: number;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/**
|
|
@@ -130,14 +130,14 @@ export interface SessionTimeseriesQuery {
|
|
|
130
130
|
* per-session series + a totals array.
|
|
131
131
|
*/
|
|
132
132
|
export interface SessionTimeseriesResponse {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
/** ISO timestamp when the response was generated. */
|
|
134
|
+
readonly updatedAt: string;
|
|
135
|
+
/** Rolling window size in minutes. */
|
|
136
|
+
readonly windowMinutes: number;
|
|
137
|
+
/** Per-session series with stable colors. */
|
|
138
|
+
readonly series: SessionSeries[];
|
|
139
|
+
/** Totals (sum of all sessions) per timestamp. */
|
|
140
|
+
readonly totals: { readonly ts: number; readonly tokens: number }[];
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
// ─── Game State Patch (PUT request body) ────────────────────────────────────
|
|
@@ -148,6 +148,59 @@ export interface SessionTimeseriesResponse {
|
|
|
148
148
|
*/
|
|
149
149
|
export type GameStatePatch = Partial<GameConfig>;
|
|
150
150
|
|
|
151
|
+
// ─── Auto-Categorizing Wiki Topics (S51) ──────────────────────────────────
|
|
152
|
+
|
|
153
|
+
/** A single topic in the GET /api/topics response. */
|
|
154
|
+
export interface TopicRow {
|
|
155
|
+
/** Unique topic identifier. */
|
|
156
|
+
readonly id: string;
|
|
157
|
+
/** TF-IDF label (top discriminative terms). */
|
|
158
|
+
readonly label: string;
|
|
159
|
+
/** Number of memories assigned to this topic. */
|
|
160
|
+
readonly memoryCount: number;
|
|
161
|
+
/** Epoch ms when the topic was last updated. */
|
|
162
|
+
readonly lastUpdated: number;
|
|
163
|
+
/** Top TF-IDF term scores for this topic. */
|
|
164
|
+
readonly termScore: ReadonlyArray<{
|
|
165
|
+
readonly term: string;
|
|
166
|
+
readonly score: number;
|
|
167
|
+
}>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** A single memory-to-topic assignment. */
|
|
171
|
+
export interface TopicAssignmentRow {
|
|
172
|
+
/** Memory (context_chunks) id. */
|
|
173
|
+
readonly memoryId: string;
|
|
174
|
+
/** Topic id the memory belongs to. */
|
|
175
|
+
readonly topicId: string;
|
|
176
|
+
/** Confidence score [0,1]. */
|
|
177
|
+
readonly confidence: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Response for GET /api/topics. */
|
|
181
|
+
export interface TopicsResponse {
|
|
182
|
+
/** ISO timestamp when the response was generated. */
|
|
183
|
+
readonly updatedAt: string;
|
|
184
|
+
/** Total number of topics. */
|
|
185
|
+
readonly totalTopics: number;
|
|
186
|
+
/** Total number of assigned memories. */
|
|
187
|
+
readonly totalAssigned: number;
|
|
188
|
+
/** Epoch ms when the topic model was last rebuilt, or null. */
|
|
189
|
+
readonly lastRebuildAt: number | null;
|
|
190
|
+
/** Topics sorted by memory count descending. */
|
|
191
|
+
readonly topics: TopicRow[];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Response for GET /api/topics/:id. */
|
|
195
|
+
export interface TopicDetailResponse {
|
|
196
|
+
/** Topic metadata. */
|
|
197
|
+
readonly topic: TopicRow;
|
|
198
|
+
/** Assignments for this topic, sorted by confidence DESC. */
|
|
199
|
+
readonly assignments: TopicAssignmentRow[];
|
|
200
|
+
/** Related topics (co-occurrence). */
|
|
201
|
+
readonly relatedTopics: TopicRow[];
|
|
202
|
+
}
|
|
203
|
+
|
|
151
204
|
// ─── SSE Endpoint Definition ────────────────────────────────────────────────
|
|
152
205
|
|
|
153
206
|
/**
|
|
@@ -157,16 +210,16 @@ export type GameStatePatch = Partial<GameConfig>;
|
|
|
157
210
|
* @template Data - The SSE event data type streamed by this endpoint.
|
|
158
211
|
*/
|
|
159
212
|
export interface SseEndpointDef<Data extends SseEvent = SseEvent> {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
213
|
+
/** Discriminator: always 'sse' for streaming endpoints. */
|
|
214
|
+
readonly type: "sse";
|
|
215
|
+
/** HTTP method (always 'GET' for SSE). */
|
|
216
|
+
readonly method: "GET";
|
|
217
|
+
/** URL path of the endpoint. */
|
|
218
|
+
readonly path: string;
|
|
219
|
+
/** Human-readable description of the endpoint. */
|
|
220
|
+
readonly description: string;
|
|
221
|
+
/** SSE event name sent with each data frame. */
|
|
222
|
+
readonly event: string;
|
|
223
|
+
/** The SSE event data type streamed by this endpoint. */
|
|
224
|
+
readonly dataType?: Data;
|
|
172
225
|
}
|
|
@@ -9,160 +9,180 @@
|
|
|
9
9
|
|
|
10
10
|
// Core types
|
|
11
11
|
export type {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from
|
|
12
|
+
HttpMethod,
|
|
13
|
+
EndpointDef,
|
|
14
|
+
SseCompactStart,
|
|
15
|
+
SseCompactEnd,
|
|
16
|
+
SseCompactTrigger,
|
|
17
|
+
SseCompactSkip,
|
|
18
|
+
SseTierChanged,
|
|
19
|
+
SseModelChanged,
|
|
20
|
+
SsePressureLifted,
|
|
21
|
+
SseCheckpointPersisted,
|
|
22
|
+
SseRecallInject,
|
|
23
|
+
SseAnchorsUpdated,
|
|
24
|
+
SseConfigUpdated,
|
|
25
|
+
SseConfigPreset,
|
|
26
|
+
SseCrewPresenceChanged,
|
|
27
|
+
SseCrewTurnChanged,
|
|
28
|
+
SseCrewBanditChosen,
|
|
29
|
+
SseSessionSample,
|
|
30
|
+
} from "./core.js";
|
|
31
31
|
|
|
32
32
|
// Snapshot / store / compression / session
|
|
33
33
|
export type {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} from
|
|
34
|
+
SnapshotResponse,
|
|
35
|
+
TriggerResponse,
|
|
36
|
+
CompressionTotalsResponse,
|
|
37
|
+
CompactHistoryEntry,
|
|
38
|
+
CompactionRequest,
|
|
39
|
+
CompactionResponse,
|
|
40
|
+
} from "./snapshot.js";
|
|
41
41
|
|
|
42
42
|
// Multi-repo index and repo management
|
|
43
43
|
export type {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} from
|
|
44
|
+
RepoListItem,
|
|
45
|
+
RepoSnapshotEntry,
|
|
46
|
+
RepoSnapshotMap,
|
|
47
|
+
IndexesIndexRow,
|
|
48
|
+
IndexesSummaryResponse,
|
|
49
|
+
IndexesDiffEntry,
|
|
50
|
+
DiffRequest,
|
|
51
|
+
SnapshotLike,
|
|
52
|
+
DiffResponse,
|
|
53
|
+
UpdateRepoConfigRequest,
|
|
54
|
+
} from "./multi-repo.js";
|
|
55
55
|
|
|
56
56
|
// Game mode and mega-game
|
|
57
57
|
export type {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} from
|
|
58
|
+
GameConfig,
|
|
59
|
+
GameStateResponse,
|
|
60
|
+
GameRitualStage,
|
|
61
|
+
SseGameRitualStart,
|
|
62
|
+
SseGameRitualStage,
|
|
63
|
+
SseGameRitualEnd,
|
|
64
|
+
SseGameModeChanged,
|
|
65
|
+
SseGameRender,
|
|
66
|
+
} from "./game.js";
|
|
67
67
|
|
|
68
68
|
// Infrastructure, diagnostics, and monitoring
|
|
69
69
|
export type {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
} from
|
|
70
|
+
InfraHealthResponse,
|
|
71
|
+
InfraPerfSampleResponse,
|
|
72
|
+
InfraRateLimitStatus,
|
|
73
|
+
InfraRateLimitResponse,
|
|
74
|
+
ContextLevelState,
|
|
75
|
+
TierOverrideState,
|
|
76
|
+
FallbackState,
|
|
77
|
+
RepeatInjectionState,
|
|
78
|
+
SupersedeGatingState,
|
|
79
|
+
MinHashBandState,
|
|
80
|
+
} from "./infrastructure.js";
|
|
81
81
|
|
|
82
82
|
// Composite SSE event union (domain imports for type composition)
|
|
83
83
|
import type {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} from
|
|
84
|
+
SseGameRitualStart,
|
|
85
|
+
SseGameRitualStage,
|
|
86
|
+
SseGameRitualEnd,
|
|
87
|
+
SseGameModeChanged,
|
|
88
|
+
SseGameRender,
|
|
89
|
+
} from "./game.js";
|
|
90
90
|
|
|
91
91
|
import type {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
} from
|
|
92
|
+
SseCompactStart,
|
|
93
|
+
SseCompactEnd,
|
|
94
|
+
SseCompactTrigger,
|
|
95
|
+
SseCompactSkip,
|
|
96
|
+
SseTierChanged,
|
|
97
|
+
SseModelChanged,
|
|
98
|
+
SsePressureLifted,
|
|
99
|
+
SseCheckpointPersisted,
|
|
100
|
+
SseRecallInject,
|
|
101
|
+
SseAnchorsUpdated,
|
|
102
|
+
SseConfigUpdated,
|
|
103
|
+
SseConfigPreset,
|
|
104
|
+
SseCrewPresenceChanged,
|
|
105
|
+
SseCrewTurnChanged,
|
|
106
|
+
SseCrewBanditChosen,
|
|
107
|
+
SseSessionSample,
|
|
108
|
+
} from "./core.js";
|
|
109
109
|
|
|
110
110
|
// Endpoints registry (Sprint A1)
|
|
111
111
|
export type {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
112
|
+
VersionResponse,
|
|
113
|
+
IndexSummary,
|
|
114
|
+
IndexFallbackResponse,
|
|
115
|
+
ReposQuery,
|
|
116
|
+
ReposResponse,
|
|
117
|
+
SummaryResponse,
|
|
118
|
+
DriftSeverity,
|
|
119
|
+
DriftSignal,
|
|
120
|
+
RepoDrift,
|
|
121
|
+
DriftReportResponse,
|
|
122
|
+
ServerEntry,
|
|
123
|
+
ServersResponse,
|
|
124
|
+
PerfPercentile,
|
|
125
|
+
PerfAverage,
|
|
126
|
+
PerfLatest,
|
|
127
|
+
PerfCacheHit,
|
|
128
|
+
PerfDiag,
|
|
129
|
+
PerfQuery,
|
|
130
|
+
PerfResponse,
|
|
131
|
+
GameScoreRow,
|
|
132
|
+
GameScoresQuery,
|
|
133
|
+
AchievementRow,
|
|
134
|
+
GameStatePatch,
|
|
135
|
+
ActiveSession,
|
|
136
|
+
SessionsResponse,
|
|
137
|
+
SessionDataPoint,
|
|
138
|
+
SessionSeries,
|
|
139
|
+
SessionTimeseriesQuery,
|
|
140
|
+
SessionTimeseriesResponse,
|
|
141
|
+
SseEndpointDef,
|
|
142
|
+
TopicRow,
|
|
143
|
+
TopicAssignmentRow,
|
|
144
|
+
TopicsResponse,
|
|
145
|
+
TopicDetailResponse,
|
|
146
|
+
} from "./endpoints.js";
|
|
143
147
|
|
|
144
|
-
export { ENDPOINTS } from
|
|
148
|
+
export { ENDPOINTS } from "./endpoints.js";
|
|
145
149
|
|
|
146
150
|
/** Union of all SSE event types the client may receive. */
|
|
147
151
|
export type SseEvent =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
| SseCompactStart
|
|
153
|
+
| SseCompactEnd
|
|
154
|
+
| SseCompactTrigger
|
|
155
|
+
| SseCompactSkip
|
|
156
|
+
| SseTierChanged
|
|
157
|
+
| SseModelChanged
|
|
158
|
+
| SsePressureLifted
|
|
159
|
+
| SseCheckpointPersisted
|
|
160
|
+
| SseRecallInject
|
|
161
|
+
| SseAnchorsUpdated
|
|
162
|
+
| SseConfigUpdated
|
|
163
|
+
| SseConfigPreset
|
|
164
|
+
| SseCrewPresenceChanged
|
|
165
|
+
| SseCrewTurnChanged
|
|
166
|
+
| SseCrewBanditChosen
|
|
167
|
+
| SseGameRitualStart
|
|
168
|
+
| SseGameRitualStage
|
|
169
|
+
| SseGameRitualEnd
|
|
170
|
+
| SseGameModeChanged
|
|
171
|
+
| SseGameRender
|
|
172
|
+
| SseSessionSample;
|
|
173
|
+
|
|
174
|
+
// S52 — turn-by-turn memory tracking + recall + rewind
|
|
175
|
+
export type {
|
|
176
|
+
TurnRow,
|
|
177
|
+
RecallHit,
|
|
178
|
+
ConversationSummary,
|
|
179
|
+
TurnsResponse,
|
|
180
|
+
ConversationTurnsResponse,
|
|
181
|
+
RewindIntentsResponse,
|
|
182
|
+
ForkRequest,
|
|
183
|
+
ForkResponse,
|
|
184
|
+
PostIntentRequest,
|
|
185
|
+
PruneRequest,
|
|
186
|
+
PruneTurnsResponse,
|
|
187
|
+
TopicMemoriesResponse,
|
|
188
|
+
} from "./turns.js";
|