@kenkaiiii/gg-boss 4.3.138 → 4.3.140

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.
@@ -0,0 +1,357 @@
1
+ import {
2
+ DEFAULT_INGEST_URL,
3
+ install,
4
+ isInstallProbeFingerprint,
5
+ source_default,
6
+ verifyInstall
7
+ } from "./chunk-PQAHDHVY.js";
8
+ import {
9
+ init_esm_shims
10
+ } from "./chunk-B2WQ5E5J.js";
11
+
12
+ // ../ggcoder/dist/core/pixel.js
13
+ init_esm_shims();
14
+ import { readFileSync, existsSync } from "fs";
15
+ import { homedir } from "os";
16
+ import { join } from "path";
17
+ async function fetchPixelEntries(opts = {}) {
18
+ const home = opts.homeDir ?? homedir();
19
+ const path = join(home, ".gg", "projects.json");
20
+ const fetchFn = opts.fetchFn ?? fetch;
21
+ if (!existsSync(path))
22
+ return { entries: [], unreachable: [], unmanaged: [], hasProjects: false };
23
+ let map;
24
+ try {
25
+ map = JSON.parse(readFileSync(path, "utf8"));
26
+ } catch {
27
+ return { entries: [], unreachable: [], unmanaged: [], hasProjects: false };
28
+ }
29
+ const projectIds = Object.keys(map);
30
+ if (projectIds.length === 0)
31
+ return { entries: [], unreachable: [], unmanaged: [], hasProjects: false };
32
+ const ingestUrl = (opts.ingestUrl ?? DEFAULT_INGEST_URL).replace(/\/+$/, "");
33
+ const entries = [];
34
+ const unreachable = [];
35
+ const unmanaged = [];
36
+ for (const id of projectIds) {
37
+ const project = map[id];
38
+ if (!project)
39
+ continue;
40
+ if (!project.secret) {
41
+ unmanaged.push(project.name);
42
+ continue;
43
+ }
44
+ try {
45
+ const res = await fetchFn(`${ingestUrl}/api/projects/${id}/errors`, {
46
+ headers: { authorization: `Bearer ${project.secret}` }
47
+ });
48
+ if (!res.ok) {
49
+ unreachable.push(project.name);
50
+ continue;
51
+ }
52
+ const body = await res.json();
53
+ for (const err of body.errors) {
54
+ if (err.status === "merged")
55
+ continue;
56
+ if (isInstallProbeFingerprint(err.fingerprint))
57
+ continue;
58
+ entries.push({
59
+ errorId: err.id,
60
+ projectId: id,
61
+ projectName: project.name,
62
+ projectPath: project.path,
63
+ status: err.status,
64
+ type: err.type ?? "Error",
65
+ message: (err.message ?? "").trim(),
66
+ occurrences: err.occurrences,
67
+ recurrenceCount: err.recurrence_count,
68
+ location: deriveLocation(err.stack, project.path),
69
+ branch: err.branch,
70
+ lastSeenAt: err.last_seen_at
71
+ });
72
+ }
73
+ } catch {
74
+ unreachable.push(project.name);
75
+ }
76
+ }
77
+ const statusOrder = {
78
+ failed: 0,
79
+ open: 1,
80
+ in_progress: 2,
81
+ awaiting_review: 3
82
+ };
83
+ const grouped = /* @__PURE__ */ new Map();
84
+ for (const e of entries) {
85
+ if (!grouped.has(e.projectName))
86
+ grouped.set(e.projectName, []);
87
+ grouped.get(e.projectName).push(e);
88
+ }
89
+ const sorted = [];
90
+ const projectNames = [...grouped.keys()].sort();
91
+ for (const name of projectNames) {
92
+ const group = grouped.get(name);
93
+ group.sort((a, b) => {
94
+ const ord = (statusOrder[a.status] ?? 99) - (statusOrder[b.status] ?? 99);
95
+ if (ord !== 0)
96
+ return ord;
97
+ if (a.recurrenceCount !== b.recurrenceCount)
98
+ return b.recurrenceCount - a.recurrenceCount;
99
+ return b.occurrences - a.occurrences;
100
+ });
101
+ sorted.push(...group);
102
+ }
103
+ return { entries: sorted, unreachable, unmanaged, hasProjects: true };
104
+ }
105
+ function deriveLocation(stack, projectPath) {
106
+ if (!stack)
107
+ return "unknown";
108
+ try {
109
+ const parsed = JSON.parse(stack);
110
+ if (Array.isArray(parsed)) {
111
+ const top = parsed.find((f) => typeof f === "object" && f !== null && "file" in f && "line" in f && "in_app" in f && f.in_app === true) ?? parsed[0];
112
+ if (top && top.file) {
113
+ const rel = relativizeFile(top.file, projectPath);
114
+ return `${rel}:${top.line ?? "?"}`;
115
+ }
116
+ }
117
+ } catch {
118
+ }
119
+ return "unknown";
120
+ }
121
+ function relativizeFile(file, projectPath) {
122
+ let f = file;
123
+ if (f.startsWith("file://"))
124
+ f = f.slice("file://".length);
125
+ if (projectPath && f.startsWith(projectPath + "/"))
126
+ f = f.slice(projectPath.length + 1);
127
+ return f;
128
+ }
129
+ async function listAllErrors(opts = {}) {
130
+ const home = opts.homeDir ?? homedir();
131
+ const path = join(home, ".gg", "projects.json");
132
+ const fetchFn = opts.fetchFn ?? fetch;
133
+ if (!existsSync(path)) {
134
+ printNoProjects();
135
+ return;
136
+ }
137
+ let map;
138
+ try {
139
+ map = JSON.parse(readFileSync(path, "utf8"));
140
+ } catch {
141
+ console.error(source_default.red(`\u2717 ${path} is not valid JSON.`));
142
+ process.exitCode = 1;
143
+ return;
144
+ }
145
+ const projectIds = Object.keys(map);
146
+ if (projectIds.length === 0) {
147
+ printNoProjects();
148
+ return;
149
+ }
150
+ const ingestUrl = (opts.ingestUrl ?? DEFAULT_INGEST_URL).replace(/\/+$/, "");
151
+ let totalOpen = 0;
152
+ let totalAwaiting = 0;
153
+ let totalInProgress = 0;
154
+ let totalFailed = 0;
155
+ for (const id of projectIds) {
156
+ const project = map[id];
157
+ if (!project)
158
+ continue;
159
+ const url = `${ingestUrl}/api/projects/${id}/errors`;
160
+ if (!project.secret) {
161
+ console.log(source_default.hex("#fbbf24")(`\u26A0 ${project.name}: missing bearer secret \u2014 re-run \`ggcoder pixel install\` to refresh management access`));
162
+ continue;
163
+ }
164
+ let body;
165
+ try {
166
+ const res = await fetchFn(url, {
167
+ headers: { authorization: `Bearer ${project.secret}` }
168
+ });
169
+ if (!res.ok) {
170
+ console.log(source_default.red(`\u2717 ${project.name}: failed to fetch (${res.status})`) + source_default.dim(` ${url}`));
171
+ continue;
172
+ }
173
+ body = await res.json();
174
+ } catch (err) {
175
+ console.log(source_default.red(`\u2717 ${project.name}: ${err instanceof Error ? err.message : String(err)}`));
176
+ continue;
177
+ }
178
+ const errors = body.errors.filter((e) => e.status !== "merged" && !isInstallProbeFingerprint(e.fingerprint));
179
+ if (errors.length === 0) {
180
+ console.log(source_default.hex("#4ade80")(`\u2713 ${project.name}`) + source_default.dim(" no open errors"));
181
+ continue;
182
+ }
183
+ console.log("");
184
+ console.log(source_default.hex("#a78bfa").bold(`\u25BE ${project.name}`) + source_default.dim(` ${project.path}`));
185
+ for (const err of errors) {
186
+ switch (err.status) {
187
+ case "open":
188
+ totalOpen++;
189
+ break;
190
+ case "in_progress":
191
+ totalInProgress++;
192
+ break;
193
+ case "awaiting_review":
194
+ totalAwaiting++;
195
+ break;
196
+ case "failed":
197
+ totalFailed++;
198
+ break;
199
+ }
200
+ printError(err);
201
+ }
202
+ }
203
+ printSummary(totalOpen, totalInProgress, totalAwaiting, totalFailed, projectIds.length);
204
+ }
205
+ function printError(err) {
206
+ const stack = parseStack(err.stack);
207
+ const topInApp = stack.find((f) => f.in_app) ?? stack[0];
208
+ const loc = topInApp ? `${topInApp.file}:${topInApp.line}` : "unknown location";
209
+ const statusBadge = badgeFor(err.status);
210
+ const message = (err.message ?? "").trim().slice(0, 100);
211
+ const recurrence = err.recurrence_count > 0 ? source_default.hex("#fbbf24")(` \u21BB${err.recurrence_count}`) : "";
212
+ console.log(" " + statusBadge + " " + source_default.bold(err.type ?? "Error") + source_default.dim(` \xD7${err.occurrences}`) + recurrence);
213
+ if (message)
214
+ console.log(" " + source_default.hex("#cbd5e1")(message));
215
+ console.log(" " + source_default.dim(loc));
216
+ if (err.branch)
217
+ console.log(" " + source_default.dim(`branch: ${err.branch}`));
218
+ }
219
+ function badgeFor(status) {
220
+ const labels = {
221
+ open: source_default.bgHex("#dc2626").white(" OPEN "),
222
+ in_progress: source_default.bgHex("#2563eb").white(" WORKING "),
223
+ awaiting_review: source_default.bgHex("#eab308").black(" REVIEW "),
224
+ failed: source_default.bgHex("#7f1d1d").white(" FAILED ")
225
+ };
226
+ return labels[status] ?? source_default.bgHex("#374151").white(` ${status.toUpperCase()} `);
227
+ }
228
+ function parseStack(raw) {
229
+ if (!raw)
230
+ return [];
231
+ try {
232
+ const parsed = JSON.parse(raw);
233
+ if (Array.isArray(parsed)) {
234
+ return parsed.filter((f) => typeof f === "object" && f !== null && "file" in f && "line" in f && "in_app" in f);
235
+ }
236
+ } catch {
237
+ }
238
+ return [];
239
+ }
240
+ function printNoProjects() {
241
+ console.log("");
242
+ console.log(source_default.dim("No projects registered yet."));
243
+ console.log("");
244
+ console.log("Run " + source_default.hex("#60a5fa").bold("ggcoder pixel install") + " inside any project to wire it up.");
245
+ console.log("");
246
+ }
247
+ function printSummary(open, inProgress, awaiting, failed, projectCount) {
248
+ const total = open + inProgress + awaiting + failed;
249
+ console.log("");
250
+ if (total === 0) {
251
+ console.log(source_default.hex("#4ade80")(`All clean across ${plural(projectCount, "project")}.`));
252
+ console.log("");
253
+ return;
254
+ }
255
+ const parts = [];
256
+ if (open)
257
+ parts.push(source_default.hex("#ef4444")(`${open} open`));
258
+ if (inProgress)
259
+ parts.push(source_default.hex("#60a5fa")(`${inProgress} working`));
260
+ if (awaiting)
261
+ parts.push(source_default.hex("#eab308")(`${awaiting} awaiting review`));
262
+ if (failed)
263
+ parts.push(source_default.hex("#7f1d1d")(`${failed} failed`));
264
+ console.log(parts.join(source_default.dim(" \xB7 ")) + source_default.dim(` across ${plural(projectCount, "project")}`));
265
+ console.log("");
266
+ }
267
+ function plural(n, word) {
268
+ return `${n} ${word}${n === 1 ? "" : "s"}`;
269
+ }
270
+ async function runPixelInstall(opts) {
271
+ const result = await install({
272
+ ingestUrl: opts.ingestUrl,
273
+ projectName: opts.name,
274
+ skipPackageInstall: opts.skipPackageInstall
275
+ });
276
+ console.log("");
277
+ console.log(source_default.hex("#4ade80").bold(result.reused ? "Pixel re-wired (existing project)." : "Pixel installed."));
278
+ console.log(source_default.dim(` Project: `) + result.projectName + source_default.dim(` (${result.projectId})`));
279
+ console.log(source_default.dim(` Kind: `) + result.projectKind);
280
+ console.log(source_default.dim(` Init file: `) + result.initFilePath);
281
+ console.log(source_default.dim(` Env file: `) + result.envFilePath);
282
+ console.log(source_default.dim(` Mapping: `) + result.projectsJsonPath);
283
+ switch (result.entryWiring.kind) {
284
+ case "injected":
285
+ console.log(source_default.dim(` Wired: `) + result.entryWiring.entryPath);
286
+ break;
287
+ case "already_present":
288
+ console.log(source_default.dim(` Entry: `) + result.entryWiring.entryPath + source_default.dim(" (already wired)"));
289
+ break;
290
+ case "no_entry_found":
291
+ console.log(source_default.hex("#fbbf24")(` \u26A0 Could not auto-detect your entry file.`));
292
+ console.log(source_default.dim(` Add to the TOP of your entry: `));
293
+ console.log(" " + source_default.hex("#60a5fa")(`import "./gg-pixel.init.mjs";`));
294
+ break;
295
+ case "skipped":
296
+ console.log(source_default.hex("#fbbf24")(` \u26A0 Entry wiring skipped: ${result.entryWiring.reason}`));
297
+ break;
298
+ }
299
+ if (!result.packageInstalled && !opts.skipPackageInstall) {
300
+ console.log(source_default.hex("#fbbf24")(` \u26A0 Package install via ${result.packageManager} failed. Run it manually.`));
301
+ }
302
+ if (result.secondaryInit) {
303
+ console.log(source_default.dim(` Also wrote: `) + result.secondaryInit.path);
304
+ console.log(source_default.dim(` `) + source_default.dim(result.secondaryInit.description));
305
+ }
306
+ for (const w of result.warnings) {
307
+ console.log(source_default.hex("#fbbf24")(` \u26A0 ${w}`));
308
+ }
309
+ console.log("");
310
+ await runVerification(result, opts.ingestUrl);
311
+ console.log("");
312
+ }
313
+ async function runVerification(result, ingestUrl) {
314
+ if (!canVerify(result.projectKind)) {
315
+ console.log(source_default.dim(" Verification skipped \u2014 not implemented for ") + result.projectKind);
316
+ return;
317
+ }
318
+ console.log(source_default.dim(" Verifying install\u2026"));
319
+ const ingest = (ingestUrl ?? DEFAULT_INGEST_URL).replace(/\/+$/, "");
320
+ let outcome;
321
+ try {
322
+ outcome = await verifyInstall({
323
+ projectId: result.projectId,
324
+ projectKey: result.projectKey,
325
+ projectSecret: result.projectSecret,
326
+ ingestUrl: ingest,
327
+ projectRoot: result.projectRoot,
328
+ // React Native's runtime isn't Node, so don't try to spawn a Node child
329
+ // there — but still attempt direct ingest so we at least confirm the
330
+ // server side of the wiring.
331
+ skipChildProbe: result.projectKind === "react-native"
332
+ });
333
+ } catch (err) {
334
+ console.log(source_default.hex("#ef4444")(` \u2717 Verification crashed: ${err instanceof Error ? err.message : String(err)}`));
335
+ return;
336
+ }
337
+ if (outcome.kind === "ok") {
338
+ const via = outcome.method === "child_process" ? "via spawned probe" : "via direct ingest";
339
+ console.log(source_default.hex("#4ade80")(` \u2713 Pixel verified end-to-end`) + source_default.dim(` (${outcome.latencyMs}ms ${via})`));
340
+ } else {
341
+ console.log(source_default.hex("#ef4444")(` \u2717 Verification failed: ${outcome.reason}`));
342
+ if (outcome.hint) {
343
+ console.log(source_default.dim(` hint: ${outcome.hint}`));
344
+ }
345
+ console.log(source_default.dim(` The install files are written, but no event arrived at the backend. Inspect the project's runtime to see why.`));
346
+ }
347
+ }
348
+ function canVerify(kind) {
349
+ return kind !== "python" && kind !== "go" && kind !== "ruby";
350
+ }
351
+
352
+ export {
353
+ fetchPixelEntries,
354
+ listAllErrors,
355
+ runPixelInstall
356
+ };
357
+ //# sourceMappingURL=chunk-5WNYQQPQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../ggcoder/src/core/pixel.ts"],"sourcesContent":["import { readFileSync, existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport chalk from \"chalk\";\nimport {\n DEFAULT_INGEST_URL,\n install,\n isInstallProbeFingerprint,\n verifyInstall,\n type VerifyOutcome,\n} from \"@kenkaiiii/gg-pixel\";\n\ninterface ProjectMapping {\n name: string;\n path: string;\n /** Bearer secret for /api/* calls. Missing on legacy entries — those projects\n * can't be queried until they're re-installed. */\n secret?: string;\n}\n\ninterface ErrorRow {\n id: string;\n fingerprint: string;\n status: string;\n type: string | null;\n message: string | null;\n stack: string | null;\n occurrences: number;\n recurrence_count: number;\n last_seen_at: number;\n branch: string | null;\n}\n\ninterface ListOptions {\n ingestUrl?: string;\n homeDir?: string;\n fetchFn?: typeof fetch;\n}\n\nexport interface PixelEntry {\n errorId: string;\n projectId: string;\n projectName: string;\n projectPath: string;\n status: string;\n type: string;\n message: string;\n occurrences: number;\n recurrenceCount: number;\n location: string;\n branch: string | null;\n lastSeenAt?: number;\n}\n\nexport interface PixelFetchResult {\n entries: PixelEntry[];\n unreachable: string[];\n /** Project names that exist in projects.json but are missing the bearer\n * secret — they need to be re-installed before they can be managed. */\n unmanaged: string[];\n hasProjects: boolean;\n}\n\nexport async function fetchPixelEntries(opts: ListOptions = {}): Promise<PixelFetchResult> {\n const home = opts.homeDir ?? homedir();\n const path = join(home, \".gg\", \"projects.json\");\n const fetchFn = opts.fetchFn ?? fetch;\n\n if (!existsSync(path)) return { entries: [], unreachable: [], unmanaged: [], hasProjects: false };\n\n let map: Record<string, ProjectMapping>;\n try {\n map = JSON.parse(readFileSync(path, \"utf8\")) as Record<string, ProjectMapping>;\n } catch {\n return { entries: [], unreachable: [], unmanaged: [], hasProjects: false };\n }\n\n const projectIds = Object.keys(map);\n if (projectIds.length === 0)\n return { entries: [], unreachable: [], unmanaged: [], hasProjects: false };\n\n const ingestUrl = (opts.ingestUrl ?? DEFAULT_INGEST_URL).replace(/\\/+$/, \"\");\n const entries: PixelEntry[] = [];\n const unreachable: string[] = [];\n const unmanaged: string[] = [];\n\n for (const id of projectIds) {\n const project = map[id];\n if (!project) continue;\n if (!project.secret) {\n unmanaged.push(project.name);\n continue;\n }\n try {\n const res = await fetchFn(`${ingestUrl}/api/projects/${id}/errors`, {\n headers: { authorization: `Bearer ${project.secret}` },\n });\n if (!res.ok) {\n unreachable.push(project.name);\n continue;\n }\n const body = (await res.json()) as { errors: ErrorRow[] };\n for (const err of body.errors) {\n if (err.status === \"merged\") continue;\n // Hide install-verification probes from the overlay even if the\n // probe-cleanup DELETE didn't land (network blip, etc.).\n if (isInstallProbeFingerprint(err.fingerprint)) continue;\n entries.push({\n errorId: err.id,\n projectId: id,\n projectName: project.name,\n projectPath: project.path,\n status: err.status,\n type: err.type ?? \"Error\",\n message: (err.message ?? \"\").trim(),\n occurrences: err.occurrences,\n recurrenceCount: err.recurrence_count,\n location: deriveLocation(err.stack, project.path),\n branch: err.branch,\n lastSeenAt: err.last_seen_at,\n });\n }\n } catch {\n unreachable.push(project.name);\n }\n }\n\n // Group by project name; within project, order by status priority then count.\n const statusOrder: Record<string, number> = {\n failed: 0,\n open: 1,\n in_progress: 2,\n awaiting_review: 3,\n };\n const grouped = new Map<string, PixelEntry[]>();\n for (const e of entries) {\n if (!grouped.has(e.projectName)) grouped.set(e.projectName, []);\n grouped.get(e.projectName)!.push(e);\n }\n const sorted: PixelEntry[] = [];\n const projectNames = [...grouped.keys()].sort();\n for (const name of projectNames) {\n const group = grouped.get(name)!;\n group.sort((a, b) => {\n const ord = (statusOrder[a.status] ?? 99) - (statusOrder[b.status] ?? 99);\n if (ord !== 0) return ord;\n if (a.recurrenceCount !== b.recurrenceCount) return b.recurrenceCount - a.recurrenceCount;\n return b.occurrences - a.occurrences;\n });\n sorted.push(...group);\n }\n\n return { entries: sorted, unreachable, unmanaged, hasProjects: true };\n}\n\nfunction deriveLocation(stack: string | null, projectPath?: string): string {\n if (!stack) return \"unknown\";\n try {\n const parsed = JSON.parse(stack) as unknown;\n if (Array.isArray(parsed)) {\n const top =\n parsed.find(\n (f): f is { file: string; line: number; in_app: boolean } =>\n typeof f === \"object\" &&\n f !== null &&\n \"file\" in f &&\n \"line\" in f &&\n \"in_app\" in f &&\n (f as { in_app: boolean }).in_app === true,\n ) ?? (parsed[0] as { file?: string; line?: number } | undefined);\n if (top && top.file) {\n const rel = relativizeFile(top.file, projectPath);\n return `${rel}:${top.line ?? \"?\"}`;\n }\n }\n } catch {\n // ignore\n }\n return \"unknown\";\n}\n\nfunction relativizeFile(file: string, projectPath?: string): string {\n let f = file;\n if (f.startsWith(\"file://\")) f = f.slice(\"file://\".length);\n if (projectPath && f.startsWith(projectPath + \"/\")) f = f.slice(projectPath.length + 1);\n return f;\n}\n\nexport async function listAllErrors(opts: ListOptions = {}): Promise<void> {\n const home = opts.homeDir ?? homedir();\n const path = join(home, \".gg\", \"projects.json\");\n const fetchFn = opts.fetchFn ?? fetch;\n\n if (!existsSync(path)) {\n printNoProjects();\n return;\n }\n\n let map: Record<string, ProjectMapping>;\n try {\n map = JSON.parse(readFileSync(path, \"utf8\")) as Record<string, ProjectMapping>;\n } catch {\n console.error(chalk.red(`✗ ${path} is not valid JSON.`));\n process.exitCode = 1;\n return;\n }\n\n const projectIds = Object.keys(map);\n if (projectIds.length === 0) {\n printNoProjects();\n return;\n }\n\n const ingestUrl = (opts.ingestUrl ?? DEFAULT_INGEST_URL).replace(/\\/+$/, \"\");\n\n let totalOpen = 0;\n let totalAwaiting = 0;\n let totalInProgress = 0;\n let totalFailed = 0;\n\n for (const id of projectIds) {\n const project = map[id];\n if (!project) continue;\n const url = `${ingestUrl}/api/projects/${id}/errors`;\n\n if (!project.secret) {\n console.log(\n chalk.hex(\"#fbbf24\")(\n `⚠ ${project.name}: missing bearer secret — re-run \\`ggcoder pixel install\\` to refresh management access`,\n ),\n );\n continue;\n }\n\n let body: { errors: ErrorRow[] };\n try {\n const res = await fetchFn(url, {\n headers: { authorization: `Bearer ${project.secret}` },\n });\n if (!res.ok) {\n console.log(\n chalk.red(`✗ ${project.name}: failed to fetch (${res.status})`) + chalk.dim(` ${url}`),\n );\n continue;\n }\n body = (await res.json()) as { errors: ErrorRow[] };\n } catch (err) {\n console.log(\n chalk.red(`✗ ${project.name}: ${err instanceof Error ? err.message : String(err)}`),\n );\n continue;\n }\n\n const errors = body.errors.filter(\n (e) => e.status !== \"merged\" && !isInstallProbeFingerprint(e.fingerprint),\n );\n if (errors.length === 0) {\n console.log(chalk.hex(\"#4ade80\")(`✓ ${project.name}`) + chalk.dim(\" no open errors\"));\n continue;\n }\n\n console.log(\"\");\n console.log(chalk.hex(\"#a78bfa\").bold(`▾ ${project.name}`) + chalk.dim(` ${project.path}`));\n\n for (const err of errors) {\n switch (err.status) {\n case \"open\":\n totalOpen++;\n break;\n case \"in_progress\":\n totalInProgress++;\n break;\n case \"awaiting_review\":\n totalAwaiting++;\n break;\n case \"failed\":\n totalFailed++;\n break;\n }\n printError(err);\n }\n }\n\n printSummary(totalOpen, totalInProgress, totalAwaiting, totalFailed, projectIds.length);\n}\n\nfunction printError(err: ErrorRow): void {\n const stack = parseStack(err.stack);\n const topInApp = stack.find((f) => f.in_app) ?? stack[0];\n const loc = topInApp ? `${topInApp.file}:${topInApp.line}` : \"unknown location\";\n\n const statusBadge = badgeFor(err.status);\n const message = (err.message ?? \"\").trim().slice(0, 100);\n const recurrence =\n err.recurrence_count > 0 ? chalk.hex(\"#fbbf24\")(` ↻${err.recurrence_count}`) : \"\";\n\n console.log(\n \" \" +\n statusBadge +\n \" \" +\n chalk.bold(err.type ?? \"Error\") +\n chalk.dim(` ×${err.occurrences}`) +\n recurrence,\n );\n if (message) console.log(\" \" + chalk.hex(\"#cbd5e1\")(message));\n console.log(\" \" + chalk.dim(loc));\n if (err.branch) console.log(\" \" + chalk.dim(`branch: ${err.branch}`));\n}\n\nfunction badgeFor(status: string): string {\n const labels: Record<string, string> = {\n open: chalk.bgHex(\"#dc2626\").white(\" OPEN \"),\n in_progress: chalk.bgHex(\"#2563eb\").white(\" WORKING \"),\n awaiting_review: chalk.bgHex(\"#eab308\").black(\" REVIEW \"),\n failed: chalk.bgHex(\"#7f1d1d\").white(\" FAILED \"),\n };\n return labels[status] ?? chalk.bgHex(\"#374151\").white(` ${status.toUpperCase()} `);\n}\n\nfunction parseStack(raw: string | null): Array<{ file: string; line: number; in_app: boolean }> {\n if (!raw) return [];\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (Array.isArray(parsed)) {\n return parsed.filter(\n (f): f is { file: string; line: number; in_app: boolean } =>\n typeof f === \"object\" && f !== null && \"file\" in f && \"line\" in f && \"in_app\" in f,\n );\n }\n } catch {\n // ignore\n }\n return [];\n}\n\nfunction printNoProjects(): void {\n console.log(\"\");\n console.log(chalk.dim(\"No projects registered yet.\"));\n console.log(\"\");\n console.log(\n \"Run \" +\n chalk.hex(\"#60a5fa\").bold(\"ggcoder pixel install\") +\n \" inside any project to wire it up.\",\n );\n console.log(\"\");\n}\n\nfunction printSummary(\n open: number,\n inProgress: number,\n awaiting: number,\n failed: number,\n projectCount: number,\n): void {\n const total = open + inProgress + awaiting + failed;\n console.log(\"\");\n if (total === 0) {\n console.log(chalk.hex(\"#4ade80\")(`All clean across ${plural(projectCount, \"project\")}.`));\n console.log(\"\");\n return;\n }\n const parts: string[] = [];\n if (open) parts.push(chalk.hex(\"#ef4444\")(`${open} open`));\n if (inProgress) parts.push(chalk.hex(\"#60a5fa\")(`${inProgress} working`));\n if (awaiting) parts.push(chalk.hex(\"#eab308\")(`${awaiting} awaiting review`));\n if (failed) parts.push(chalk.hex(\"#7f1d1d\")(`${failed} failed`));\n console.log(\n parts.join(chalk.dim(\" · \")) + chalk.dim(` across ${plural(projectCount, \"project\")}`),\n );\n console.log(\"\");\n}\n\nfunction plural(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? \"\" : \"s\"}`;\n}\n\ninterface InstallCliOptions {\n ingestUrl?: string;\n name?: string;\n skipPackageInstall: boolean;\n}\n\nexport async function runPixelInstall(opts: InstallCliOptions): Promise<void> {\n const result = await install({\n ingestUrl: opts.ingestUrl,\n projectName: opts.name,\n skipPackageInstall: opts.skipPackageInstall,\n });\n\n console.log(\"\");\n console.log(\n chalk\n .hex(\"#4ade80\")\n .bold(result.reused ? \"Pixel re-wired (existing project).\" : \"Pixel installed.\"),\n );\n console.log(\n chalk.dim(` Project: `) + result.projectName + chalk.dim(` (${result.projectId})`),\n );\n console.log(chalk.dim(` Kind: `) + result.projectKind);\n console.log(chalk.dim(` Init file: `) + result.initFilePath);\n console.log(chalk.dim(` Env file: `) + result.envFilePath);\n console.log(chalk.dim(` Mapping: `) + result.projectsJsonPath);\n switch (result.entryWiring.kind) {\n case \"injected\":\n console.log(chalk.dim(` Wired: `) + result.entryWiring.entryPath);\n break;\n case \"already_present\":\n console.log(\n chalk.dim(` Entry: `) + result.entryWiring.entryPath + chalk.dim(\" (already wired)\"),\n );\n break;\n case \"no_entry_found\":\n console.log(chalk.hex(\"#fbbf24\")(` ⚠ Could not auto-detect your entry file.`));\n console.log(chalk.dim(` Add to the TOP of your entry: `));\n console.log(\" \" + chalk.hex(\"#60a5fa\")(`import \"./gg-pixel.init.mjs\";`));\n break;\n case \"skipped\":\n console.log(chalk.hex(\"#fbbf24\")(` ⚠ Entry wiring skipped: ${result.entryWiring.reason}`));\n break;\n }\n if (!result.packageInstalled && !opts.skipPackageInstall) {\n console.log(\n chalk.hex(\"#fbbf24\")(\n ` ⚠ Package install via ${result.packageManager} failed. Run it manually.`,\n ),\n );\n }\n if (result.secondaryInit) {\n console.log(chalk.dim(` Also wrote: `) + result.secondaryInit.path);\n console.log(chalk.dim(` `) + chalk.dim(result.secondaryInit.description));\n }\n for (const w of result.warnings) {\n console.log(chalk.hex(\"#fbbf24\")(` ⚠ ${w}`));\n }\n console.log(\"\");\n\n await runVerification(result, opts.ingestUrl);\n console.log(\"\");\n}\n\n/**\n * Fires a synthetic event end-to-end and waits for it to round-trip through\n * D1. Catches the silent-failure modes that wiring alone can't (stale env,\n * sandboxed renderer, missing dotenv, broken `node_modules`, etc.).\n */\nasync function runVerification(\n result: {\n projectId: string;\n projectKey: string;\n projectSecret: string;\n projectKind: string;\n projectRoot: string;\n },\n ingestUrl: string | undefined,\n): Promise<void> {\n if (!canVerify(result.projectKind)) {\n // Non-JS kinds (python/go/ruby) have their own SDKs; verification path\n // doesn't apply yet. Print a one-line note instead of leaving silence.\n console.log(chalk.dim(\" Verification skipped — not implemented for \") + result.projectKind);\n return;\n }\n console.log(chalk.dim(\" Verifying install…\"));\n const ingest = (ingestUrl ?? DEFAULT_INGEST_URL).replace(/\\/+$/, \"\");\n let outcome: VerifyOutcome;\n try {\n outcome = await verifyInstall({\n projectId: result.projectId,\n projectKey: result.projectKey,\n projectSecret: result.projectSecret,\n ingestUrl: ingest,\n projectRoot: result.projectRoot,\n // React Native's runtime isn't Node, so don't try to spawn a Node child\n // there — but still attempt direct ingest so we at least confirm the\n // server side of the wiring.\n skipChildProbe: result.projectKind === \"react-native\",\n });\n } catch (err) {\n console.log(\n chalk.hex(\"#ef4444\")(\n ` ✗ Verification crashed: ${err instanceof Error ? err.message : String(err)}`,\n ),\n );\n return;\n }\n\n if (outcome.kind === \"ok\") {\n const via = outcome.method === \"child_process\" ? \"via spawned probe\" : \"via direct ingest\";\n console.log(\n chalk.hex(\"#4ade80\")(` ✓ Pixel verified end-to-end`) +\n chalk.dim(` (${outcome.latencyMs}ms ${via})`),\n );\n } else {\n console.log(chalk.hex(\"#ef4444\")(` ✗ Verification failed: ${outcome.reason}`));\n if (outcome.hint) {\n console.log(chalk.dim(` hint: ${outcome.hint}`));\n }\n console.log(\n chalk.dim(\n ` The install files are written, but no event arrived at the backend. Inspect the project's runtime to see why.`,\n ),\n );\n }\n}\n\nfunction canVerify(kind: string): boolean {\n // Python/Go/Ruby SDKs have their own probe paths; not wiring them through\n // the JS verifier yet. Everything else (browser, node, hybrid frameworks,\n // electron, even react-native) gets the round-trip check.\n return kind !== \"python\" && kind !== \"go\" && kind !== \"ruby\";\n}\n"],"mappings":";;;;;;;;;;;;AAAA;SAAS,cAAc,kBAAkB;AACzC,SAAS,eAAe;AACxB,SAAS,YAAY;AA6DrB,eAAsB,kBAAkB,OAAoB,CAAA,GAAE;AAC5D,QAAM,OAAO,KAAK,WAAW,QAAO;AACpC,QAAM,OAAO,KAAK,MAAM,OAAO,eAAe;AAC9C,QAAM,UAAU,KAAK,WAAW;AAEhC,MAAI,CAAC,WAAW,IAAI;AAAG,WAAO,EAAE,SAAS,CAAA,GAAI,aAAa,CAAA,GAAI,WAAW,CAAA,GAAI,aAAa,MAAK;AAE/F,MAAI;AACJ,MAAI;AACF,UAAM,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC;EAC7C,QAAQ;AACN,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CAAC,UAAU,OAAO,WAAW,GAAG;AAGlC,YAAQ,IAAI,eAAM,IAAI,oDAA+C,IAAI,OAAO,WAAW;AAC3F;EACF;AACA,UAAQ,IAAI,eAAM,IAAI,2BAAsB,CAAC;AAC7C,QAAM,UAAU,aAAa,oBAAoB,QAAQ,QAAQ,EAAE;AACnE,MAAI;AACJ,MAAI;AACF,cAAU,MAAM,cAAc;MAC5B,WAAW,OAAO;MAClB,YAAY,OAAO;MACnB,eAAe,OAAO;MACtB,WAAW;MACX,aAAa,OAAO;;;;MAIpB,gBAAgB,OAAO,gBAAgB;KACxC;EACH,SAAS,KAAK;AACZ,YAAQ,IACN,eAAM,IAAI,SAAS,EACjB,kCAA6B,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE,CAChF;AAEH;EACF;AAEA,MAAI,QAAQ,SAAS,MAAM;AACzB,UAAM,MAAM,QAAQ,WAAW,kBAAkB,sBAAsB;AACvE,YAAQ,IACN,eAAM,IAAI,SAAS,EAAE,oCAA+B,IAClD,eAAM,IAAI,KAAK,QAAQ,SAAS,MAAM,GAAG,GAAG,CAAC;EAEnD,OAAO;AACL,YAAQ,IAAI,eAAM,IAAI,SAAS,EAAE,iCAA4B,QAAQ,MAAM,EAAE,CAAC;AAC9E,QAAI,QAAQ,MAAM;AAChB,cAAQ,IAAI,eAAM,IAAI,aAAa,QAAQ,IAAI,EAAE,CAAC;IACpD;AACA,YAAQ,IACN,eAAM,IACJ,mHAAmH,CACpH;EAEL;AACF;AAEA,SAAS,UAAU,MAAY;AAI7B,SAAO,SAAS,YAAY,SAAS,QAAQ,SAAS;AACxD;","names":[]}
@@ -0,0 +1,56 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
36
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
+ mod
38
+ ));
39
+
40
+ // ../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.14_typescript@6.0.3/node_modules/tsup/assets/esm_shims.js
41
+ import path from "path";
42
+ import { fileURLToPath } from "url";
43
+ var init_esm_shims = __esm({
44
+ "../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.14_typescript@6.0.3/node_modules/tsup/assets/esm_shims.js"() {
45
+ "use strict";
46
+ }
47
+ });
48
+
49
+ export {
50
+ __require,
51
+ __commonJS,
52
+ __export,
53
+ __toESM,
54
+ init_esm_shims
55
+ };
56
+ //# sourceMappingURL=chunk-B2WQ5E5J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.14_typescript@6.0.3/node_modules/tsup/assets/esm_shims.js"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAF9B;AAAA;AAAA;AAAA;AAAA;","names":[]}