@posthog/wizard 2.73.2 → 2.74.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.
Files changed (109) hide show
  1. package/README.md +40 -36
  2. package/dist/README.md +11 -4
  3. package/dist/{add-mcp-server-to-clients-BaVuIyoj.js → add-mcp-server-to-clients-CBtInAoH.js} +4 -4
  4. package/dist/{add-mcp-server-to-clients-BaVuIyoj.js.map → add-mcp-server-to-clients-CBtInAoH.js.map} +1 -1
  5. package/dist/{agent-interface-Dm28tBj-.js → agent-interface-lCIi_alS.js} +485 -339
  6. package/dist/agent-interface-lCIi_alS.js.map +1 -0
  7. package/dist/{agent-prompt-loader-Dv9HIHm1.js → agent-prompt-loader-CSxm81TM.js} +6 -7
  8. package/dist/agent-prompt-loader-CSxm81TM.js.map +1 -0
  9. package/dist/{agent-runner-C1Dwg9sa.js → agent-runner-DVrkOFDA.js} +52 -69
  10. package/dist/agent-runner-DVrkOFDA.js.map +1 -0
  11. package/dist/analytics-3H_AlflZ.js +2 -0
  12. package/dist/{analytics-BY4qZ0AC.js → analytics-CeVMOExk.js} +2 -2
  13. package/dist/{analytics-BY4qZ0AC.js.map → analytics-CeVMOExk.js.map} +1 -1
  14. package/dist/{api-DwWMv1Qc.js → api-2nAofyKY.js} +3 -3
  15. package/dist/{api-DwWMv1Qc.js.map → api-2nAofyKY.js.map} +1 -1
  16. package/dist/bin.js +59 -54
  17. package/dist/bin.js.map +1 -1
  18. package/dist/{bounded-fs-DIYnGoSv.js → bounded-fs-DmcmFPRq.js} +3 -3
  19. package/dist/{bounded-fs-DIYnGoSv.js.map → bounded-fs-DmcmFPRq.js.map} +1 -1
  20. package/dist/{ci-install-BL5ObQ3S.js → ci-install-lwYLQ4Yw.js} +21 -24
  21. package/dist/ci-install-lwYLQ4Yw.js.map +1 -0
  22. package/dist/{debug-CY2VLyCW.js → debug-BvheXnxB.js} +1 -1
  23. package/dist/{debug-BrWB-OAq.js → debug-GxjVplPx.js} +20 -353
  24. package/dist/debug-GxjVplPx.js.map +1 -0
  25. package/dist/{env-api-key-C6XP1N9g.js → env-api-key-BMXH7_4u.js} +2 -2
  26. package/dist/{env-api-key-C6XP1N9g.js.map → env-api-key-BMXH7_4u.js.map} +1 -1
  27. package/dist/{environment-CXxQd0SR.js → environment-C3nfPBu-.js} +4 -4
  28. package/dist/{environment-CXxQd0SR.js.map → environment-C3nfPBu-.js.map} +1 -1
  29. package/dist/{errors-u8z27V-x.js → errors--OqLxmWR.js} +34 -3
  30. package/dist/errors--OqLxmWR.js.map +1 -0
  31. package/dist/{file-watcher-Duj0RMwi.js → file-watcher-BGElIpJi.js} +2 -2
  32. package/dist/{file-watcher-Duj0RMwi.js.map → file-watcher-BGElIpJi.js.map} +1 -1
  33. package/dist/{headless-ui-B1hA9Rx8.js → headless-ui-jkS2Dm_G.js} +2 -2
  34. package/dist/{headless-ui-B1hA9Rx8.js.map → headless-ui-jkS2Dm_G.js.map} +1 -1
  35. package/dist/{interactive-B2OUN9yB.js → interactive-CrQWwMr2.js} +3 -3
  36. package/dist/{interactive-B2OUN9yB.js.map → interactive-CrQWwMr2.js.map} +1 -1
  37. package/dist/{mcp-BkHaEmEn.js → mcp-S3yX8Uz1.js} +2 -2
  38. package/dist/{mcp-BkHaEmEn.js.map → mcp-S3yX8Uz1.js.map} +1 -1
  39. package/dist/{mcp-prompt-streaming-hV0rkw9s.js → mcp-prompt-streaming-BvvCZBYa.js} +5 -5
  40. package/dist/mcp-prompt-streaming-BvvCZBYa.js.map +1 -0
  41. package/dist/{non-interactive-ByaO-qoX.js → non-interactive-B-MIn3vt.js} +3 -3
  42. package/dist/{non-interactive-ByaO-qoX.js.map → non-interactive-B-MIn3vt.js.map} +1 -1
  43. package/dist/{orchestrator-tools-pBKJnRjl.js → orchestrator-tools-CefodRf2.js} +3 -3
  44. package/dist/{orchestrator-tools-pBKJnRjl.js.map → orchestrator-tools-CefodRf2.js.map} +1 -1
  45. package/dist/{package-manager-CIm2MNel.js → package-manager-pB6S0gyu.js} +2 -2
  46. package/dist/{package-manager-CIm2MNel.js.map → package-manager-pB6S0gyu.js.map} +1 -1
  47. package/dist/{pi-Dj0EHErj.js → pi-Dbw8VakI.js} +35 -20
  48. package/dist/pi-Dbw8VakI.js.map +1 -0
  49. package/dist/{playground-UJyt6uLu.js → playground-C7DwGktN.js} +12 -69
  50. package/dist/playground-C7DwGktN.js.map +1 -0
  51. package/dist/{posthog-BuIPmmdp.js → posthog-B3RuLfxH.js} +2 -2
  52. package/dist/{posthog-BuIPmmdp.js.map → posthog-B3RuLfxH.js.map} +1 -1
  53. package/dist/{posthog-integration-HXLZnann.js → posthog-integration-su2LXi3-.js} +13 -13
  54. package/dist/{posthog-integration-HXLZnann.js.map → posthog-integration-su2LXi3-.js.map} +1 -1
  55. package/dist/{provisioning-B9kEzRE_.js → provisioning-B4Lr3-aS.js} +4 -10
  56. package/dist/provisioning-B4Lr3-aS.js.map +1 -0
  57. package/dist/{queue-tools-CDqueOnz.js → queue-tools-BveMVXQm.js} +21 -35
  58. package/dist/queue-tools-BveMVXQm.js.map +1 -0
  59. package/dist/{registry-Cl77fAHR.js → registry-D8MIZ9kJ.js} +5 -5
  60. package/dist/{registry-Cl77fAHR.js.map → registry-D8MIZ9kJ.js.map} +1 -1
  61. package/dist/{security-CfoEOKN4.js → security-B_Eo15wD.js} +5 -5
  62. package/dist/{security-CfoEOKN4.js.map → security-B_Eo15wD.js.map} +1 -1
  63. package/dist/{setup-utils-BVQaFad8.js → setup-utils-D3OK2RE_.js} +9 -15
  64. package/dist/setup-utils-D3OK2RE_.js.map +1 -0
  65. package/dist/smoke-test-ci.sh +5 -2
  66. package/dist/{start-tui-DJGq1bFx.js → start-tui-B7u962uh.js} +22 -22
  67. package/dist/{start-tui-DJGq1bFx.js.map → start-tui-B7u962uh.js.map} +1 -1
  68. package/dist/{steps-BLrL5Kst.js → steps-D4mHkYX4.js} +7 -7
  69. package/dist/{steps-BLrL5Kst.js.map → steps-D4mHkYX4.js.map} +1 -1
  70. package/dist/{store-l1aCLB7H.js → store-Cn1VK6U0.js} +8 -27
  71. package/dist/store-Cn1VK6U0.js.map +1 -0
  72. package/dist/{subagent-BAU9BElX.js → subagent-1UEmD7bE.js} +2 -2
  73. package/dist/{subagent-BAU9BElX.js.map → subagent-1UEmD7bE.js.map} +1 -1
  74. package/dist/{task-B7LbltJW.js → task-DNHNZMO0.js} +36 -21
  75. package/dist/task-DNHNZMO0.js.map +1 -0
  76. package/dist/{task-stream-Du_99Tv-.js → task-stream-BJrRzR9K.js} +5 -5
  77. package/dist/{task-stream-Du_99Tv-.js.map → task-stream-BJrRzR9K.js.map} +1 -1
  78. package/dist/{tasks-7XjlfAbk.js → tasks-DSEJ8GZC.js} +2 -2
  79. package/dist/{tasks-7XjlfAbk.js.map → tasks-DSEJ8GZC.js.map} +1 -1
  80. package/dist/{telemetry-CW5a6Bog.js → telemetry-DWkTy6TJ.js} +3 -3
  81. package/dist/{telemetry-CW5a6Bog.js.map → telemetry-DWkTy6TJ.js.map} +1 -1
  82. package/dist/{terminal-DMZIApv7.js → terminal-DNnNkvFu.js} +16 -59
  83. package/dist/terminal-DNnNkvFu.js.map +1 -0
  84. package/dist/{tools-CIkbTll3.js → tools-HHK4XbnC.js} +6 -6
  85. package/dist/{tools-CIkbTll3.js.map → tools-HHK4XbnC.js.map} +1 -1
  86. package/dist/{wizard-abort-DcuNitMi.js → wizard-abort-BVmjqUAQ.js} +4 -4
  87. package/dist/{wizard-abort-DcuNitMi.js.map → wizard-abort-BVmjqUAQ.js.map} +1 -1
  88. package/dist/{wizard-abort-serrH83C.js → wizard-abort-CG_xzEFN.js} +1 -1
  89. package/dist/yara-hooks-BOMbtTOr.js +2 -0
  90. package/dist/{yara-hooks-BKhDtn2N.js → yara-hooks-qRkdjYiV.js} +4 -4
  91. package/dist/{yara-hooks-BKhDtn2N.js.map → yara-hooks-qRkdjYiV.js.map} +1 -1
  92. package/package.json +1 -1
  93. package/dist/agent-interface-Dm28tBj-.js.map +0 -1
  94. package/dist/agent-prompt-loader-Dv9HIHm1.js.map +0 -1
  95. package/dist/agent-runner-C1Dwg9sa.js.map +0 -1
  96. package/dist/analytics-Bhw7ODc0.js +0 -2
  97. package/dist/ci-install-BL5ObQ3S.js.map +0 -1
  98. package/dist/debug-BrWB-OAq.js.map +0 -1
  99. package/dist/errors-u8z27V-x.js.map +0 -1
  100. package/dist/mcp-prompt-streaming-hV0rkw9s.js.map +0 -1
  101. package/dist/pi-Dj0EHErj.js.map +0 -1
  102. package/dist/playground-UJyt6uLu.js.map +0 -1
  103. package/dist/provisioning-B9kEzRE_.js.map +0 -1
  104. package/dist/queue-tools-CDqueOnz.js.map +0 -1
  105. package/dist/setup-utils-BVQaFad8.js.map +0 -1
  106. package/dist/store-l1aCLB7H.js.map +0 -1
  107. package/dist/task-B7LbltJW.js.map +0 -1
  108. package/dist/terminal-DMZIApv7.js.map +0 -1
  109. package/dist/yara-hooks-rZT6WNop.js +0 -2
@@ -69,31 +69,26 @@ const TASK_RUN_ID = runtimeEnv("POSTHOG_TASK_RUN_ID") || void 0;
69
69
  const TASK_ID = runtimeEnv("POSTHOG_TASK_ID") || void 0;
70
70
  //#endregion
71
71
  //#region src/lib/version.ts
72
- const VERSION = "2.73.2";
72
+ const VERSION = "2.74.1";
73
73
  //#endregion
74
74
  //#region src/lib/constants.ts
75
75
  /**
76
76
  * Shared constants for the PostHog wizard.
77
77
  */
78
+ /** Next sonnet generation (a `MODEL_FLAG_VARIANTS` key in the switchboard). */
79
+ const SONNET_5_MODEL = "claude-sonnet-5";
78
80
  /**
79
81
  * Default model for agent runs. Bare model IDs (no `anthropic/` prefix) so the
80
82
  * LLM gateway's Bedrock fallback can match map_to_bedrock_model().
81
83
  */
82
- const DEFAULT_AGENT_MODEL = "claude-sonnet-4-6";
83
- /** Next sonnet generation (a `MODEL_FLAG_VARIANTS` key in the switchboard). */
84
- const SONNET_5_MODEL = "claude-sonnet-5";
84
+ const DEFAULT_AGENT_MODEL = SONNET_5_MODEL;
85
+ /** Undated haiku, for scan triage. The alias tracks the current 4.5 release rather than pinning one. */
86
+ const HAIKU_TRIAGE_MODEL = "claude-haiku-4-5";
85
87
  /**
86
88
  * Cheaper, faster model for mechanical agent work (e.g. repo classification
87
89
  * during source-map detection). Passed via AgentConfig.modelOverride.
88
90
  */
89
- const HAIKU_MODEL = "claude-haiku-4-5-20251001";
90
- /** Undated haiku, for scan triage — the alias tracks the current 4.5 release rather than pinning one. */
91
- const HAIKU_TRIAGE_MODEL = "claude-haiku-4-5";
92
- /**
93
- * Larger model for planning / hard work. Named the switchboard could route to
94
- * from `PROGRAM_BINDINGS[id].model` or `contextMillOverride`.
95
- */
96
- const OPUS_MODEL = "claude-opus-4-8";
91
+ const HAIKU_MODEL = HAIKU_TRIAGE_MODEL;
97
92
  const GPT5_6_LUNA_MODEL = "openai/gpt-5.6-luna";
98
93
  const GPT5_6_TERRA_MODEL = "openai/gpt-5.6-terra";
99
94
  const GPT5_6_SOL_MODEL = "openai/gpt-5.6-sol";
@@ -300,10 +295,6 @@ const WIZARD_USER_AGENT = `posthog/wizard; version: ${VERSION}`;
300
295
  function wizardUserAgentForProgram(programId) {
301
296
  return programId ? `${WIZARD_USER_AGENT}; program: ${programId}` : WIZARD_USER_AGENT;
302
297
  }
303
- /** Header prefix for PostHog properties (e.g. X-POSTHOG-PROPERTY-VARIANT). */
304
- const POSTHOG_PROPERTY_HEADER_PREFIX = "X-POSTHOG-PROPERTY-";
305
- /** Header prefix for PostHog feature flags. */
306
- const POSTHOG_FLAG_HEADER_PREFIX = "X-POSTHOG-FLAG-";
307
298
  /** Timeout for framework / project detection probes (ms). */
308
299
  const DETECTION_TIMEOUT_MS = 1e4;
309
300
  /** Timeout for the agentic project scan (ms); past it the run falls back to root detection. */
@@ -331,181 +322,6 @@ function isTaskStatus(value) {
331
322
  return Object.values(TaskStatus).includes(value);
332
323
  }
333
324
  //#endregion
334
- //#region src/lib/health-checks/statuspage.ts
335
- function mapIndicator(v) {
336
- switch (v) {
337
- case "none": return "healthy";
338
- case "minor": return "degraded";
339
- case "major":
340
- case "critical": return "down";
341
- default: return "degraded";
342
- }
343
- }
344
- function mapComponentRaw(v) {
345
- switch (v) {
346
- case "operational": return "healthy";
347
- case "degraded_performance":
348
- case "under_maintenance": return "degraded";
349
- case "partial_outage":
350
- case "major_outage": return "down";
351
- default: return "degraded";
352
- }
353
- }
354
- function errResult$1(error) {
355
- return {
356
- status: "degraded",
357
- error
358
- };
359
- }
360
- async function fetchStatuspageIndicator(url, timeoutMs = 5e3) {
361
- try {
362
- const controller = new AbortController();
363
- const tid = setTimeout(() => controller.abort(), timeoutMs);
364
- const res = await fetch(url, { signal: controller.signal });
365
- clearTimeout(tid);
366
- if (!res.ok) return errResult$1(`HTTP ${res.status}`);
367
- const indicator = (await res.json()).status?.indicator ?? null;
368
- return {
369
- status: mapIndicator(indicator),
370
- rawIndicator: indicator ?? void 0
371
- };
372
- } catch (e) {
373
- if (e instanceof Error && e.name === "AbortError") return errResult$1("Request timed out");
374
- return errResult$1(e instanceof Error ? e.message : "Unknown error");
375
- }
376
- }
377
- async function fetchStatuspageSummary(url, timeoutMs = 5e3) {
378
- try {
379
- const controller = new AbortController();
380
- const tid = setTimeout(() => controller.abort(), timeoutMs);
381
- const res = await fetch(url, { signal: controller.signal });
382
- clearTimeout(tid);
383
- if (!res.ok) return errResult$1(`HTTP ${res.status}`);
384
- const data = await res.json();
385
- const indicator = data.status?.indicator ?? null;
386
- const overall = mapIndicator(indicator);
387
- const affected = (data.components ?? []).map((c) => ({
388
- name: c.name,
389
- status: mapComponentRaw(c.status),
390
- rawStatus: c.status
391
- })).filter((c) => c.status !== "healthy");
392
- return {
393
- status: affected.length > 0 ? "degraded" : overall,
394
- rawIndicator: indicator ?? void 0,
395
- degradedOrDownComponents: affected.length > 0 ? affected : void 0
396
- };
397
- } catch (e) {
398
- if (e instanceof Error && e.name === "AbortError") return errResult$1("Request timed out");
399
- return errResult$1(e instanceof Error ? e.message : "Unknown error");
400
- }
401
- }
402
- const checkAnthropicHealth = () => fetchStatuspageIndicator("https://status.claude.com/api/v2/status.json");
403
- const checkGithubHealth = () => fetchStatuspageIndicator("https://www.githubstatus.com/api/v2/status.json");
404
- const checkNpmOverallHealth = () => fetchStatuspageIndicator("https://status.npmjs.org/api/v2/status.json");
405
- const checkNpmComponentHealth = () => fetchStatuspageSummary("https://status.npmjs.org/api/v2/summary.json");
406
- const checkCloudflareOverallHealth = () => fetchStatuspageIndicator("https://www.cloudflarestatus.com/api/v2/status.json");
407
- const checkCloudflareComponentHealth = () => fetchStatuspageSummary("https://www.cloudflarestatus.com/api/v2/summary.json");
408
- //#endregion
409
- //#region src/lib/health-checks/incidentio.ts
410
- function mapIncidentImpact(impact) {
411
- switch (impact) {
412
- case "full_outage": return "down";
413
- case "partial_outage":
414
- case "degraded_performance": return "degraded";
415
- default: return "degraded";
416
- }
417
- }
418
- function mapComponentStatus(status) {
419
- switch (status) {
420
- case "operational": return "healthy";
421
- case "full_outage": return "down";
422
- case "partial_outage":
423
- case "degraded_performance": return "degraded";
424
- default: return "degraded";
425
- }
426
- }
427
- /**
428
- * Build an error result for fetch failures. The kind matters for
429
- * downstream reconciliation:
430
- *
431
- * - 'http' (incident.io returned a bad status code) → `Down`. We
432
- * reached the status page but it told us something is wrong on
433
- * its side. We have a definitive response.
434
- * - 'network' (timeout, DNS failure, TCP/TLS failure) → `NoConnection`.
435
- * We never reached the status page. Treating this as `Degraded`
436
- * (the previous behavior) silently flipped the reconciliation in
437
- * `readiness.ts` from "soft" to "confirmed outage" whenever the
438
- * user's own network was flaky — exactly the false positive this
439
- * module is meant to help diagnose.
440
- */
441
- function errResult(error, kind) {
442
- return {
443
- status: kind === "http" ? "down" : "no-connection",
444
- error
445
- };
446
- }
447
- const POSTHOG_STATUS_URL = "https://www.posthogstatus.com/api/v1/summary";
448
- async function fetchPosthogStatus(timeoutMs = 5e3) {
449
- try {
450
- const controller = new AbortController();
451
- const tid = setTimeout(() => controller.abort(), timeoutMs);
452
- const res = await fetch(POSTHOG_STATUS_URL, { signal: controller.signal });
453
- clearTimeout(tid);
454
- if (!res.ok) {
455
- const err = errResult(`HTTP ${res.status}`, "http");
456
- return {
457
- overall: err,
458
- components: err
459
- };
460
- }
461
- const incidents = (await res.json()).ongoing_incidents ?? [];
462
- if (incidents.length === 0) return {
463
- overall: { status: "healthy" },
464
- components: { status: "healthy" }
465
- };
466
- let worstOverall = "degraded";
467
- const affected = [];
468
- for (const incident of incidents) {
469
- if (mapIncidentImpact(incident.current_worst_impact) === "down") worstOverall = "down";
470
- for (const comp of incident.affected_components ?? []) {
471
- const compStatus = mapComponentStatus(comp.current_status);
472
- if (compStatus !== "healthy") affected.push({
473
- name: comp.group_name ? `${comp.group_name} — ${comp.name}` : comp.name,
474
- status: compStatus,
475
- rawStatus: comp.current_status
476
- });
477
- }
478
- }
479
- return {
480
- overall: { status: worstOverall },
481
- components: {
482
- status: affected.length > 0 ? "degraded" : worstOverall,
483
- degradedOrDownComponents: affected.length > 0 ? affected : void 0
484
- }
485
- };
486
- } catch (e) {
487
- if (e instanceof Error && e.name === "AbortError") {
488
- const err = errResult("Request timed out", "network");
489
- return {
490
- overall: err,
491
- components: err
492
- };
493
- }
494
- const err = errResult(e instanceof Error ? e.message : "Unknown error", "network");
495
- return {
496
- overall: err,
497
- components: err
498
- };
499
- }
500
- }
501
- let _cache = null;
502
- function getPosthogHealth() {
503
- if (!_cache) _cache = fetchPosthogStatus();
504
- return _cache;
505
- }
506
- const checkPosthogOverallHealth = async () => (await getPosthogHealth()).overall;
507
- const checkPosthogComponentHealth = async () => (await getPosthogHealth()).components;
508
- //#endregion
509
325
  //#region src/lib/health-checks/endpoints.ts
510
326
  function noConnectionResult(error, attempts) {
511
327
  return {
@@ -572,12 +388,11 @@ async function fetchEndpointHealth(url, timeoutMs = 5e3, isExpectedStatus = (s)
572
388
  }
573
389
  lastError = outcome.timedOut ? `Request timed out after ${timeoutMs}ms` : outcome.error.message;
574
390
  }
575
- const result = lastHttpStatus !== null ? downResult(`HTTP ${lastHttpStatus} (attempts=${attempts})`, lastHttpStatus) : noConnectionResult(lastError, attempts);
391
+ const result = lastHttpStatus !== null ? downResult(`HTTP ${lastHttpStatus} (attempts=${attempts})`) : noConnectionResult(lastError, attempts);
576
392
  logToFile(`[health-checks] GET ${url} -> ${result.status} (attempts=${attempts}, ${result.error})`);
577
393
  return result;
578
394
  }
579
- const checkLlmGatewayHealth = () => fetchEndpointHealth("https://gateway.us.posthog.com/_liveness");
580
- const checkMcpHealth = () => fetchEndpointHealth("https://mcp.posthog.com/", 5e3, (s) => s >= 200 && s < 400, "manual");
395
+ const checkLlmGatewayHealth = (gatewayUrl) => fetchEndpointHealth(new URL("/readyz", gatewayUrl).href);
581
396
  /**
582
397
  * Skills are published to two origins under the same filenames and
583
398
  * `fetchWithRetry` fails over between them, so the run is only blocked when
@@ -611,112 +426,11 @@ function withIndicatorSuffix(result, suffix) {
611
426
  }
612
427
  //#endregion
613
428
  //#region src/lib/health-checks/readiness.ts
614
- const SERVICE_LABELS = {
615
- anthropic: "Anthropic",
616
- posthogOverall: "PostHog",
617
- posthogComponents: "PostHog (components)",
618
- github: "GitHub",
619
- npmOverall: "npm",
620
- npmComponents: "npm (components)",
621
- cloudflareOverall: "Cloudflare",
622
- cloudflareComponents: "Cloudflare (components)",
623
- llmGateway: "LLM Gateway",
624
- mcp: "MCP",
625
- skillsOrigin: "Skills download"
626
- };
627
- /**
628
- * See README section "Health checks" for the full rationale.
629
- * Adjust these arrays to change what blocks a wizard run.
630
- */
631
- const DEFAULT_WIZARD_READINESS_CONFIG = {
632
- downBlocksRun: [
633
- "anthropic",
634
- "npmOverall",
635
- "llmGateway",
636
- "mcp",
637
- "skillsOrigin"
638
- ],
639
- degradedBlocksRun: ["anthropic"]
640
- };
641
- /**
642
- * Reduced readiness config for --signup provisioning flows.
643
- *
644
- * Provisioning only needs PostHog and the LLM Gateway - it doesn't
645
- * use Anthropic directly, npm, the skills origins, or MCP.
646
- */
647
- const SIGNUP_WIZARD_READINESS_CONFIG = { downBlocksRun: ["posthogOverall", "llmGateway"] };
429
+ const SERVICE_LABELS = { skillsOrigin: "Skills download" };
430
+ const DEFAULT_WIZARD_READINESS_CONFIG = { downBlocksRun: ["skillsOrigin"] };
431
+ const SIGNUP_WIZARD_READINESS_CONFIG = DEFAULT_WIZARD_READINESS_CONFIG;
648
432
  async function checkAllExternalServices() {
649
- const [anthropic, posthogOverall, posthogComponents, github, npmOverall, npmComponents, cloudflareOverall, cloudflareComponents, llmGateway, mcp, skillsOrigin] = await Promise.all([
650
- checkAnthropicHealth(),
651
- checkPosthogOverallHealth(),
652
- checkPosthogComponentHealth(),
653
- checkGithubHealth(),
654
- checkNpmOverallHealth(),
655
- checkNpmComponentHealth(),
656
- checkCloudflareOverallHealth(),
657
- checkCloudflareComponentHealth(),
658
- checkLlmGatewayHealth(),
659
- checkMcpHealth(),
660
- checkSkillsOriginHealth()
661
- ]);
662
- return reconcilePosthogReachability({
663
- anthropic,
664
- posthogOverall,
665
- posthogComponents,
666
- github,
667
- npmOverall,
668
- npmComponents,
669
- cloudflareOverall,
670
- cloudflareComponents,
671
- llmGateway,
672
- mcp,
673
- skillsOrigin
674
- });
675
- }
676
- /**
677
- * When a PostHog-owned endpoint probe returns `NoConnection`, decide
678
- * whether it's a real outage or a likely-local issue by checking the
679
- * official status page (`posthogstatus.com`):
680
- *
681
- * - Status page says PostHog is `Down` / `Degraded` → upgrade
682
- * llmGateway / mcp to `Down`. The status page corroborates.
683
- * - Status page is `Healthy` → keep `NoConnection`. The status page
684
- * contradicts; this is probably the user's network.
685
- * - Status page is also `NoConnection` → keep `NoConnection`. User
686
- * can't reach two independent PostHog properties; almost
687
- * certainly their network. (This case relies on incidentio.ts
688
- * correctly emitting `NoConnection` for fetch failures rather
689
- * than the previous `Degraded`, which used to silently flip the
690
- * reconciliation into a false positive.)
691
- *
692
- * Why `Degraded` corroborates: a `Degraded` reading here only fires
693
- * when incident.io's API parsed successfully and reported a real
694
- * `partial_outage` or `degraded_performance` for some component. That's
695
- * PostHog acknowledging an issue, even if narrower than a full outage.
696
- * If our gateway probe is also failing, those two signals together
697
- * justify pointing at PostHog rather than the user.
698
- *
699
- * A narrower variant — only corroborate when the affected component is
700
- * gateway-related (LLM, US/EU Cloud, app) — would be more precise. We
701
- * have the data in `posthogComponents` but don't use it here. If the
702
- * analytics show false positives concentrated in this case, it's a
703
- * cheap follow-up.
704
- *
705
- * Mutates a copy of `health` and returns it.
706
- */
707
- function reconcilePosthogReachability(health) {
708
- const posthogStatus = health.posthogOverall.status;
709
- if (!(posthogStatus === "down" || posthogStatus === "degraded")) return health;
710
- const upgrade = (r) => r.status === "no-connection" ? {
711
- ...r,
712
- status: "down",
713
- error: r.error ? `${r.error} (corroborated by status page)` : "corroborated by status page"
714
- } : r;
715
- return {
716
- ...health,
717
- llmGateway: upgrade(health.llmGateway),
718
- mcp: upgrade(health.mcp)
719
- };
433
+ return { skillsOrigin: await checkSkillsOriginHealth() };
720
434
  }
721
435
  function describeResult(label, h) {
722
436
  const parts = [`${label}: ${h.status}`];
@@ -724,26 +438,12 @@ function describeResult(label, h) {
724
438
  if (h.error) parts.push(h.error);
725
439
  return parts.join(" — ");
726
440
  }
727
- const MAX_COMPONENT_NAMES = 8;
728
- function describeComponents(label, h) {
729
- const affected = h.degradedOrDownComponents;
730
- if (!affected || affected.length === 0) return `${label} components: all operational`;
731
- const shown = affected.slice(0, MAX_COMPONENT_NAMES).map((c) => `${c.name} (${c.status})`);
732
- const suffix = affected.length > MAX_COMPONENT_NAMES ? `, +${affected.length - MAX_COMPONENT_NAMES} more` : "";
733
- return `${label} components impacted: ${shown.join(", ")}${suffix}`;
734
- }
735
441
  const READINESS_TIMEOUT_MS = 2e4;
736
442
  async function evaluateWizardReadiness(config = DEFAULT_WIZARD_READINESS_CONFIG) {
737
443
  try {
738
444
  const health = await Promise.race([checkAllExternalServices(), new Promise((resolve) => setTimeout(() => resolve(allUnknown("Health check timed out")), READINESS_TIMEOUT_MS))]);
739
- const reasons = [];
740
- for (const key of Object.keys(health)) {
741
- const result = health[key];
742
- const label = SERVICE_LABELS[key];
743
- reasons.push(describeResult(label, result));
744
- if ("degradedOrDownComponents" in result) reasons.push(describeComponents(label, result));
745
- }
746
445
  const blockingKeys = getBlockingServiceKeys(health, config);
446
+ const reasons = blockingKeys.map((key) => describeResult(SERVICE_LABELS[key], health[key]));
747
447
  if (blockingKeys.length > 0) {
748
448
  logToFile(`[health-checks] blocked by: ${blockingKeys.map((key) => {
749
449
  const h = health[key];
@@ -755,11 +455,6 @@ async function evaluateWizardReadiness(config = DEFAULT_WIZARD_READINESS_CONFIG)
755
455
  reasons
756
456
  };
757
457
  }
758
- if (Object.values(health).some((h) => h.status !== "healthy")) return {
759
- decision: "yes_with_warnings",
760
- health,
761
- reasons
762
- };
763
458
  return {
764
459
  decision: "yes",
765
460
  health,
@@ -770,27 +465,12 @@ async function evaluateWizardReadiness(config = DEFAULT_WIZARD_READINESS_CONFIG)
770
465
  return {
771
466
  decision: "yes",
772
467
  health: allUnknown("Unexpected error"),
773
- reasons: ["Health check failed unexpectedly — proceeding anyway"]
468
+ reasons: []
774
469
  };
775
470
  }
776
471
  }
777
- /** Keys that are component-level detail, not top-level services. */
778
- const COMPONENT_KEYS = [
779
- "posthogComponents",
780
- "npmComponents",
781
- "cloudflareComponents"
782
- ];
783
- /**
784
- * Get the keys of services that would block a wizard run per the given config.
785
- *
786
- * `NoConnection` blocks the same services as `Down` — the wizard genuinely
787
- * can't continue if it can't reach the gateway. The screen shows softer
788
- * framing in that case (HealthCheckScreen) so we don't falsely accuse
789
- * PostHog of an outage when the user's network is the likely cause.
790
- */
791
472
  function getBlockingServiceKeys(health, config = DEFAULT_WIZARD_READINESS_CONFIG) {
792
473
  return Object.keys(health).filter((key) => {
793
- if (COMPONENT_KEYS.includes(key)) return false;
794
474
  const result = health[key];
795
475
  if (config.downBlocksRun.includes(key) && (result.status === "down" || result.status === "no-connection")) return true;
796
476
  if ((config.degradedBlocksRun ?? []).includes(key) && result.status !== "healthy") return true;
@@ -799,23 +479,10 @@ function getBlockingServiceKeys(health, config = DEFAULT_WIZARD_READINESS_CONFIG
799
479
  }
800
480
  /** Build an AllServicesHealth where every service is Degraded with the given error. */
801
481
  function allUnknown(error) {
802
- const base = {
482
+ return { skillsOrigin: {
803
483
  status: "degraded",
804
484
  error
805
- };
806
- return {
807
- anthropic: base,
808
- posthogOverall: base,
809
- posthogComponents: { ...base },
810
- github: base,
811
- npmOverall: base,
812
- npmComponents: { ...base },
813
- cloudflareOverall: base,
814
- cloudflareComponents: { ...base },
815
- llmGateway: base,
816
- mcp: base,
817
- skillsOrigin: base
818
- };
485
+ } };
819
486
  }
820
487
  //#endregion
821
488
  //#region src/ui/logging-ui.ts
@@ -1033,7 +700,7 @@ let reportedLogFailure = false;
1033
700
  function reportLogFailureOnce(err) {
1034
701
  if (reportedLogFailure) return;
1035
702
  reportedLogFailure = true;
1036
- import("./analytics-Bhw7ODc0.js").then(({ analytics }) => analytics.captureException(err instanceof Error ? err : new Error(String(err)), {
703
+ import("./analytics-3H_AlflZ.js").then(({ analytics }) => analytics.captureException(err instanceof Error ? err : new Error(String(err)), {
1037
704
  source: "log-file-write",
1038
705
  log_path: logFilePath,
1039
706
  platform: process.platform
@@ -1077,6 +744,6 @@ function enableDebugLogs() {
1077
744
  consoleLoggingEnabled = true;
1078
745
  }
1079
746
  //#endregion
1080
- export { POSTHOG_TERMS_URL as $, DUMMY_PROJECT_API_KEY as A, OAUTH_PORTS as B, ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY as C, headlessOption as Ct, CONTEXT_MILL_URL as D, CONTEXT_MILL_RELEASES_URL as E, HAIKU_MODEL as F, POSTHOG_DOCS_URL as G, OPUS_MODEL as H, HAIKU_TRIAGE_MODEL as I, POSTHOG_ORG_AI_SETTINGS_URL as J, POSTHOG_EU_CLIENT_ID as K, Harness as L, GPT5_6_LUNA_MODEL as M, GPT5_6_SOL_MODEL as N, DEFAULT_AGENT_MODEL as O, GPT5_6_TERRA_MODEL as P, POSTHOG_STATUS_PAGE_URL as Q, ISSUES_URL as R, ANALYTICS_HOST_URL as S, runtimeEnv as St, AWS_SKILLS_BASE_URL as T, regionOption as Tt, POSTHOG_APP_URL as U, OAUTH_TIMEOUT_MS as V, POSTHOG_DEV_CLIENT_ID as W, POSTHOG_PROPERTY_HEADER_PREFIX as X, POSTHOG_PRIVACY_URL as Y, POSTHOG_PROXY_CLIENT_ID as Z, evaluateWizardReadiness as _, VERSION as _t, getLogFilePath as a, WIZARD_FLAG_KEYS as at, isTaskStatus as b, TASK_ID as bt, WIZARD_BENCHMARK_FILE as c, WIZARD_ORCHESTRATOR_FLAG_KEY as ct, relativeToInstallDir as d, WIZARD_PROVISIONING_SCOPES as dt, POSTHOG_US_CLIENT_ID as et, getUI as f, WIZARD_REMARK_EVENT_NAME as ft, SIGNUP_WIZARD_READINESS_CONFIG as g, wizardUserAgentForProgram as gt, SERVICE_LABELS as h, getSkillsBaseUrl as ht, enableDebugLogs as i, WIZARD_CONTACT_EMAIL as it, GITHUB_SKILLS_BASE_URL as j, DETECTION_TIMEOUT_MS as k, WIZARD_LOG_FILE as l, WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY as lt, LoggingUI as m, WIZARD_USER_AGENT as mt, configureLogFileFromEnvironment as n, Sequence as nt, initLogFile as o, WIZARD_INTERACTION_EVENT_NAME as ot, setUI as p, WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY as pt, POSTHOG_FLAG_HEADER_PREFIX as q, debug as r, WIZARD_BASIC_INTEGRATION_AGENTIC_DETECTION_FLAG_KEY as rt, logToFile as s, WIZARD_OAUTH_SCOPES as st, configureLogFile as t, SONNET_5_MODEL as tt, WIZARD_YARA_REPORT_FILE as u, WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY as ut, getBlockingServiceKeys as v, NODE_ENV as vt, ANALYTICS_TEAM_TAG as w, isHeadless as wt, AGENTIC_DETECTION_TIMEOUT_MS as x, TASK_RUN_ID as xt, TaskStatus as y, RUN_SURFACE as yt, Integration as z };
747
+ export { SONNET_5_MODEL as $, DETECTION_TIMEOUT_MS as A, Integration as B, ANALYTICS_HOST_URL as C, regionOption as Ct, CONTEXT_MILL_RELEASES_URL as D, AWS_SKILLS_BASE_URL as E, GPT5_6_TERRA_MODEL as F, POSTHOG_DOCS_URL as G, OAUTH_TIMEOUT_MS as H, HAIKU_MODEL as I, POSTHOG_PRIVACY_URL as J, POSTHOG_EU_CLIENT_ID as K, HAIKU_TRIAGE_MODEL as L, GITHUB_SKILLS_BASE_URL as M, GPT5_6_LUNA_MODEL as N, CONTEXT_MILL_URL as O, GPT5_6_SOL_MODEL as P, POSTHOG_US_CLIENT_ID as Q, Harness as R, AGENTIC_DETECTION_TIMEOUT_MS as S, isHeadless as St, ANALYTICS_TEAM_TAG as T, POSTHOG_APP_URL as U, OAUTH_PORTS as V, POSTHOG_DEV_CLIENT_ID as W, POSTHOG_STATUS_PAGE_URL as X, POSTHOG_PROXY_CLIENT_ID as Y, POSTHOG_TERMS_URL as Z, evaluateWizardReadiness as _, RUN_SURFACE as _t, getLogFilePath as a, WIZARD_OAUTH_SCOPES as at, TaskStatus as b, runtimeEnv as bt, WIZARD_BENCHMARK_FILE as c, WIZARD_ORCHESTRATOR_SEEDED_TASKS_FLAG_KEY as ct, relativeToInstallDir as d, WIZARD_SELF_DRIVING_USE_PI_HARNESS_FLAG_KEY as dt, Sequence as et, getUI as f, WIZARD_USER_AGENT as ft, SIGNUP_WIZARD_READINESS_CONFIG as g, NODE_ENV as gt, SERVICE_LABELS as h, VERSION as ht, enableDebugLogs as i, WIZARD_INTERACTION_EVENT_NAME as it, DUMMY_PROJECT_API_KEY as j, DEFAULT_AGENT_MODEL as k, WIZARD_LOG_FILE as l, WIZARD_PROVISIONING_SCOPES as lt, LoggingUI as m, wizardUserAgentForProgram as mt, configureLogFileFromEnvironment as n, WIZARD_CONTACT_EMAIL as nt, initLogFile as o, WIZARD_ORCHESTRATOR_FLAG_KEY as ot, setUI as p, getSkillsBaseUrl as pt, POSTHOG_ORG_AI_SETTINGS_URL as q, debug as r, WIZARD_FLAG_KEYS as rt, logToFile as s, WIZARD_ORCHESTRATOR_OVERRIDE_FLAG_KEY as st, configureLogFile as t, WIZARD_BASIC_INTEGRATION_AGENTIC_DETECTION_FLAG_KEY as tt, WIZARD_YARA_REPORT_FILE as u, WIZARD_REMARK_EVENT_NAME as ut, getBlockingServiceKeys as v, TASK_ID as vt, ANALYTICS_POSTHOG_PUBLIC_PROJECT_WRITE_KEY as w, isTaskStatus as x, headlessOption as xt, checkLlmGatewayHealth as y, TASK_RUN_ID as yt, ISSUES_URL as z };
1081
748
 
1082
- //# sourceMappingURL=debug-BrWB-OAq.js.map
749
+ //# sourceMappingURL=debug-GxjVplPx.js.map