@codeyam-editor/codeyam-editor 0.1.3 → 0.1.5

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 (66) hide show
  1. package/npm/cloud-branch-switch.js +1 -1
  2. package/npm/cloud.js +1693 -96
  3. package/npm/container.js +14 -0
  4. package/npm/disk-pressure.js +167 -0
  5. package/npm/editor-dev.js +107 -15
  6. package/npm/editor.js +97 -37
  7. package/npm/fleet-auth-health.js +75 -0
  8. package/npm/fleet-auth.js +6 -1
  9. package/npm/fleet-build-data.js +130 -0
  10. package/npm/fleet-cleanup.js +145 -7
  11. package/npm/fleet-destroy-safety.js +55 -0
  12. package/npm/fleet-effect-status.js +33 -32
  13. package/npm/fleet-host.js +74 -0
  14. package/npm/fleet-job-badge.js +46 -2
  15. package/npm/fleet-launchd.js +171 -0
  16. package/npm/fleet-live-status.js +123 -0
  17. package/npm/fleet-plans.js +231 -0
  18. package/npm/fleet-prewarm.js +165 -0
  19. package/npm/fleet-public-url.js +160 -0
  20. package/npm/fleet-queue.js +38 -1
  21. package/npm/fleet-reconcile.js +100 -1
  22. package/npm/fleet-reset.js +298 -13
  23. package/npm/fleet-roster.js +6 -8
  24. package/npm/fleet-self-update.js +142 -0
  25. package/npm/fleet-setup-steps.js +105 -0
  26. package/npm/fleet-sleep-status.js +33 -0
  27. package/npm/fleet-strand.js +150 -0
  28. package/npm/fleet-stuck-status.js +111 -0
  29. package/npm/fleet-vm-access.js +234 -0
  30. package/npm/fleet-vm-readiness.js +104 -0
  31. package/npm/fleet-vm-slugs.js +116 -0
  32. package/npm/google-ingress.js +211 -0
  33. package/npm/ingress-invoke.js +292 -0
  34. package/npm/launch-config.js +310 -4
  35. package/npm/scenario-check.js +684 -33
  36. package/npm/scenario-handlers.js +94 -12
  37. package/npm/scenario-metrics.js +116 -1
  38. package/npm/scenario-mocks.js +20 -0
  39. package/npm/scenario-playwright.js +366 -29
  40. package/npm/script-drift.js +81 -0
  41. package/npm/utils.js +453 -43
  42. package/npm/vm-urls.js +69 -8
  43. package/package.json +5 -5
  44. package/ui/dist/assets/ContainerInspector-D7VZkkaj.js +2 -0
  45. package/ui/dist/assets/EditorShell-DHhIaotd.css +1 -0
  46. package/ui/dist/assets/EditorShell-r-796N_W.js +191 -0
  47. package/ui/dist/assets/{Markdown-BHBqz-Mj.js → Markdown-BoLHHFXH.js} +1 -1
  48. package/ui/dist/assets/ProjectLauncherScreen-Ck-XWkQN.js +1 -0
  49. package/ui/dist/assets/ScenarioDataPanel-B9iDSUpA.js +5 -0
  50. package/ui/dist/assets/ScenarioDataPanelFullPage-CBLTGC4-.js +1 -0
  51. package/ui/dist/assets/ScenarioRenderer-BhLfT-nX.js +21 -0
  52. package/ui/dist/assets/StepsSimulator-BFldWyoX.js +1 -0
  53. package/ui/dist/assets/index-CIXZkwfB.css +1 -0
  54. package/ui/dist/assets/{index-KDFAgt2e.js → index-QsOiOG9x.js} +9 -9
  55. package/ui/dist/assets/useEvents-DHkLJZR4.js +1 -0
  56. package/ui/dist/codeyam-mark.svg +4 -0
  57. package/ui/dist/codeyam-wordmark.svg +5 -0
  58. package/ui/dist/index.html +2 -2
  59. package/ui/dist/assets/ContainerInspector-C8EkH4PP.js +0 -2
  60. package/ui/dist/assets/EditorShell-CGsBSA6u.js +0 -186
  61. package/ui/dist/assets/ScenarioDataPanel-nuLXJzLf.js +0 -5
  62. package/ui/dist/assets/ScenarioDataPanelFullPage-Bnghtj8a.js +0 -1
  63. package/ui/dist/assets/ScenarioRenderer-B_Za9jL8.js +0 -1
  64. package/ui/dist/assets/StepsSimulator-CRtmlyNZ.js +0 -1
  65. package/ui/dist/assets/index-Bih6HJ_u.css +0 -1
  66. package/ui/dist/assets/useEvents-DggWrtHe.js +0 -1
@@ -0,0 +1 @@
1
+ import{b as r}from"./react-CSS0HapR.js";function d(e){return e.scenarioType==="application"||e.scenarioType==="component"?e.scenarioType:e.componentName?"component":"application"}function _(e){return d(e)==="application"}function D(e){return d(e)==="component"}function L(e){return{overrideCounts:{mocks:0,seeds:0,inheritedMocks:0,inheritedSeeds:0},...e,scenarioType:d(e)}}const v=["http_request","db_query","process_output","scenario_switch","health_check","hook_execution","error"],h=new Set(v);function y(e){if(!e)return null;try{const n=JSON.parse(e);return typeof n!="object"||n===null||typeof n.type!="string"||!h.has(n.type)?null:n}catch{return null}}const T=new Set(["simulator-ios","simulator-android"]),w={"simulator-ios":"iOS Simulator","simulator-android":"Android Emulator"};function N(e){return T.has(e)}function k(e){return w[e]??"device window"}function C(e=typeof window<"u"?window:void 0){return e?e.self!==e.top:!1}function M({isInIframe:e,previewKind:n,previewMedium:u,selectedScenario:i}){return e||N(u)?!1:n!=="application"?!0:!i||!_(i)}const A=1e3,b=2e3,O=3e4;function P(e="/api/events"){const[n,u]=r.useState([]),[i,m]=r.useState(!1),t=r.useRef(null),a=r.useRef(null),l=r.useRef(0),f=r.useCallback(()=>{t.current&&(t.current.close(),t.current=null);const c=new EventSource(e);t.current=c,c.onopen=()=>{m(!0),l.current=0},c.onmessage=o=>{const s=y(o.data);s&&u(S=>{const p=[...S,s];return p.length>A?p.slice(-500):p})},c.onerror=()=>{m(!1),c.close(),t.current=null,l.current+=1;const o=l.current,s=Math.min(b*2**(o-1),O);(o===1||o%5===0)&&console.warn(`[events] SSE disconnected (attempt #${o}); reconnecting in ${s}ms`),a.current=setTimeout(f,s)}},[e]);r.useEffect(()=>{if(!C())return f(),()=>{t.current&&(t.current.close(),t.current=null),a.current&&(clearTimeout(a.current),a.current=null)}},[f]);const E=r.useCallback(()=>u([]),[]);return{events:n,connected:i,clear:E}}export{D as a,_ as b,N as c,k as d,C as i,L as n,d as r,M as s,P as u};
@@ -0,0 +1,4 @@
1
+ <svg fill="#171717" width="40" height="28" viewBox="0 0 40 28" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.0391 8.23173H14.5737C15.0795 8.23173 15.5645 8.03081 15.9221 7.6732C16.2797 7.31559 16.4806 6.83057 16.4806 6.32484C16.4806 5.8191 16.2797 5.33408 15.9221 4.97647C15.5645 4.61886 15.0795 4.41797 14.5737 4.41797H12.0477C11.5419 4.41797 11.0569 4.61886 10.6993 4.97647C10.3417 5.33408 10.1408 5.8191 10.1408 6.32484C10.1408 6.57525 10.0915 6.82323 9.99564 7.05458C9.89981 7.28594 9.75934 7.49613 9.58227 7.6732C9.4052 7.85027 9.19498 7.99074 8.96363 8.08657C8.73227 8.1824 8.48432 8.23173 8.2339 8.23173H5.70784C5.20285 8.23173 4.71847 8.43203 4.36099 8.78872C4.0035 9.14541 3.80208 9.62936 3.80095 10.1344C3.80095 10.6394 3.60065 11.1237 3.24396 11.4812C2.88727 11.8387 2.40335 12.0401 1.89835 12.0412C1.3941 12.0435 0.911246 12.2454 0.55548 12.6027C0.199714 12.9601 -5.04736e-06 13.4439 0 13.9481C-1.26644e-06 14.452 0.199853 14.9353 0.55574 15.2919C0.911627 15.6486 1.39449 15.8496 1.89835 15.8507C2.40335 15.8518 2.88727 16.0533 3.24396 16.4107C3.60065 16.7682 3.80095 17.2526 3.80095 17.7576C3.80095 18.2633 4.00187 18.7484 4.35948 19.106C4.71709 19.4636 5.20211 19.6645 5.70784 19.6645H8.2339C8.7389 19.6645 9.22328 19.8648 9.58076 20.2215C9.93825 20.5782 10.1396 21.0621 10.1408 21.5671C10.1408 22.0728 10.3417 22.5579 10.6993 22.9155C11.0569 23.2731 11.5419 23.474 12.0477 23.474H14.5737C14.8239 23.474 15.0717 23.4246 15.3028 23.3287C15.5339 23.2328 15.7439 23.0923 15.9206 22.9152C16.0973 22.7381 16.2374 22.5278 16.3327 22.2965C16.4281 22.0652 16.4769 21.8173 16.4764 21.5671C16.4764 21.0625 16.2759 20.5786 15.9191 20.2217C15.5623 19.8649 15.0783 19.6645 14.5737 19.6645H12.0434C11.5384 19.6633 11.0545 19.4619 10.6978 19.1045C10.3411 18.747 10.1408 18.2626 10.1408 17.7576C10.1408 17.2519 9.93988 16.7668 9.58227 16.4092C9.22466 16.0516 8.73964 15.8507 8.2339 15.8507H5.67798C5.17923 15.8508 4.7004 15.655 4.34456 15.3056C3.98871 14.9561 3.7843 14.4809 3.77536 13.9822C3.77536 13.9822 3.77536 13.9822 3.77536 13.9481C3.77536 13.9481 3.77536 13.9225 3.77536 13.9097C3.7843 13.411 3.98871 12.9358 4.34456 12.5864C4.7004 12.2369 5.17923 12.0411 5.67798 12.0412H8.2339C8.73964 12.0412 9.22466 11.8403 9.58227 11.4827C9.93988 11.1251 10.1408 10.6401 10.1408 10.1344C10.1408 9.63049 10.3407 9.14718 10.6965 8.79049C11.0524 8.4338 11.5353 8.23286 12.0391 8.23173Z"></path>
3
+ <path d="M37.4462 4.49533C36.9404 4.49533 36.4554 4.69622 36.0978 5.05383C35.7402 5.41143 35.5393 5.89646 35.5393 6.40219V10.2117C35.5393 10.4621 35.49 10.7101 35.3942 10.9414C35.2983 11.1728 35.1579 11.383 34.9808 11.5601C34.8037 11.7371 34.5935 11.8776 34.3622 11.9734C34.1308 12.0692 33.8828 12.1186 33.6324 12.1186C33.1274 12.1197 32.6435 12.3211 32.2868 12.6786C31.9301 13.0361 31.7298 13.5205 31.7298 14.0255C31.7287 14.5305 31.5273 15.0144 31.1698 15.3711C30.8123 15.7278 30.3279 15.9281 29.8229 15.9281C29.3179 15.9281 28.8336 15.7278 28.4761 15.3711C28.1186 15.0144 27.9172 14.5305 27.9161 14.0255C27.9161 13.5205 27.7157 13.0361 27.359 12.6786C27.0024 12.3211 26.5184 12.1197 26.0134 12.1186C25.763 12.1186 25.5151 12.0692 25.2837 11.9734C25.0524 11.8776 24.8421 11.7371 24.6651 11.5601C24.488 11.383 24.3475 11.1728 24.2517 10.9414C24.1559 10.7101 24.1065 10.4621 24.1065 10.2117V6.415C24.1187 6.15729 24.0785 5.89977 23.9883 5.65805C23.8981 5.41633 23.7598 5.19543 23.5817 5.00873C23.4036 4.82203 23.1895 4.6734 22.9523 4.57185C22.7151 4.4703 22.4598 4.41797 22.2018 4.41797C21.9438 4.41797 21.6885 4.4703 21.4513 4.57185C21.2141 4.6734 21 4.82203 20.8219 5.00873C20.6439 5.19543 20.5055 5.41633 20.4153 5.65805C20.3251 5.89977 20.2849 6.15729 20.2971 6.415V10.2245C20.2971 10.7295 20.4974 11.2139 20.8541 11.5714C21.2108 11.9288 21.6947 12.1303 22.1997 12.1314C22.7054 12.1314 23.1904 12.3323 23.548 12.6899C23.9057 13.0475 24.1065 13.5325 24.1065 14.0383C24.1077 14.5433 24.3091 15.0272 24.6666 15.3839C25.0241 15.7406 25.5084 15.9409 26.0134 15.9409C26.5162 15.942 26.9982 16.1416 27.3545 16.4964C27.7109 16.8511 27.9127 17.3322 27.9161 17.835V21.6743C27.9161 22.1793 28.1164 22.6637 28.4731 23.0212C28.8297 23.3787 29.3137 23.5801 29.8187 23.5812C30.3244 23.5812 30.8094 23.3803 31.167 23.0227C31.5246 22.6651 31.7256 22.1801 31.7256 21.6743V17.8648C31.7256 17.3598 31.9259 16.8754 32.2825 16.5179C32.6392 16.1605 33.1232 15.9591 33.6281 15.9579C34.1331 15.9579 34.6175 15.7576 34.975 15.4009C35.3325 15.0443 35.5339 14.5603 35.535 14.0553C35.535 13.5496 35.7359 13.0646 36.0935 12.7069C36.4512 12.3493 36.9362 12.1484 37.4419 12.1484C37.9469 12.1473 38.4308 11.9459 38.7875 11.5884C39.1442 11.2309 39.3445 10.7465 39.3445 10.2415V6.415C39.3462 6.16423 39.2984 5.91558 39.2039 5.6833C39.1093 5.45103 38.9699 5.23969 38.7936 5.06138C38.6172 4.88306 38.4075 4.74129 38.1763 4.64415C37.9451 4.54702 37.697 4.49644 37.4462 4.49533Z"></path>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="393" height="47" viewBox="0 0 393 47" fill="#0a0a0a" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M29.1354 9.22952H35.2693C36.4932 9.22952 37.6669 8.74329 38.5324 7.87785C39.3978 7.01242 39.884 5.83864 39.884 4.61473C39.884 3.39082 39.3978 2.21704 38.5324 1.3516C37.6669 0.486167 36.4932 0 35.2693 0H29.156C27.9321 0 26.7584 0.486167 25.8929 1.3516C25.0275 2.21704 24.5413 3.39082 24.5413 4.61473C24.5413 5.22075 24.4219 5.82087 24.19 6.38076C23.9581 6.94065 23.6182 7.44933 23.1896 7.87785C22.7611 8.30637 22.2524 8.64632 21.6925 8.87823C21.1326 9.11014 20.5325 9.22952 19.9265 9.22952H13.8133C12.5912 9.22952 11.419 9.71426 10.5538 10.5775C9.6887 11.4407 9.20125 12.6119 9.19852 13.834C9.19852 15.0561 8.71377 16.2283 7.85057 17.0934C6.98737 17.9586 5.81624 18.446 4.59412 18.4487C3.3738 18.4542 2.20527 18.9428 1.34429 19.8076C0.483318 20.6725 -1.22149e-05 21.8432 2.31528e-10 23.0635C-3.06485e-06 24.2829 0.483655 25.4525 1.34492 26.3157C2.20619 27.1789 3.37474 27.6652 4.59412 27.6679C5.81624 27.6706 6.98737 28.1581 7.85057 29.0232C8.71377 29.8883 9.19852 31.0606 9.19852 32.2827C9.19852 33.5066 9.68475 34.6804 10.5502 35.5458C11.4156 36.4112 12.5894 36.8974 13.8133 36.8974H19.9265C21.1486 36.8974 22.3209 37.3822 23.186 38.2454C24.0511 39.1086 24.5385 40.2797 24.5413 41.5019C24.5413 42.7258 25.0275 43.8996 25.8929 44.765C26.7584 45.6304 27.9321 46.1166 29.156 46.1166H35.2693C35.8748 46.1166 36.4744 45.9972 37.0337 45.7651C37.593 45.5331 38.101 45.193 38.5287 44.7644C38.9564 44.3357 39.2954 43.8269 39.5261 43.2671C39.7569 42.7073 39.8751 42.1074 39.8737 41.5019C39.8737 40.2807 39.3886 39.1096 38.5251 38.2461C37.6616 37.3826 36.4904 36.8974 35.2693 36.8974H29.1457C27.9236 36.8947 26.7525 36.4073 25.8893 35.5422C25.0261 34.677 24.5412 33.5048 24.5413 32.2827C24.5413 31.0588 24.0551 29.885 23.1896 29.0196C22.3242 28.1541 21.1504 27.6679 19.9265 27.6679H13.741C12.534 27.6681 11.3752 27.1943 10.5141 26.3486C9.65292 25.5029 9.15823 24.3528 9.13658 23.146C9.13658 23.146 9.13658 23.1461 9.13658 23.0635C9.13658 23.0635 9.13658 23.0015 9.13658 22.9706C9.15823 21.7638 9.65292 20.6137 10.5141 19.768C11.3752 18.9223 12.534 18.4485 13.741 18.4487H19.9265C21.1504 18.4487 22.3242 17.9625 23.1896 17.0971C24.0551 16.2317 24.5413 15.0579 24.5413 13.834C24.5412 12.6146 25.025 11.445 25.8862 10.5818C26.7475 9.71855 27.916 9.23225 29.1354 9.22952Z" fill="white"></path>
3
+ <path d="M90.6271 0.187208C89.4032 0.187208 88.2295 0.673375 87.364 1.53881C86.4986 2.40425 86.0124 3.57803 86.0124 4.80194V14.0212C86.0124 14.6272 85.893 15.2273 85.6611 15.7872C85.4292 16.347 85.0893 16.8558 84.6608 17.2843C84.2322 17.7128 83.7235 18.0527 83.1637 18.2846C82.6038 18.5165 82.0036 18.6359 81.3976 18.6359C80.1755 18.6387 79.0044 19.126 78.1412 19.9912C77.278 20.8563 76.7932 22.0286 76.7932 23.2507C76.7905 24.4728 76.3031 25.644 75.4379 26.5072C74.5728 27.3704 73.4006 27.8551 72.1784 27.8551C70.9563 27.8551 69.7841 27.3704 68.919 26.5072C68.0538 25.644 67.5664 24.4728 67.5637 23.2507C67.5637 22.0286 67.0789 20.8563 66.2157 19.9912C65.3525 19.126 64.1814 18.6387 62.9593 18.6359C62.3532 18.6359 61.7532 18.5165 61.1933 18.2846C60.6334 18.0527 60.1246 17.7128 59.6961 17.2843C59.2676 16.8558 58.9277 16.347 58.6958 15.7872C58.4638 15.2273 58.3445 14.6272 58.3445 14.0212V4.83294C58.374 4.20925 58.2767 3.58604 58.0583 3.00106C57.84 2.41609 57.5052 1.8815 57.0743 1.42967C56.6433 0.977844 56.1251 0.618149 55.5512 0.3724C54.9772 0.12665 54.3593 0 53.7349 0C53.1105 0 52.4926 0.12665 51.9186 0.3724C51.3446 0.618149 50.8265 0.977844 50.3955 1.42967C49.9646 1.8815 49.6298 2.41609 49.4115 3.00106C49.1931 3.58604 49.0958 4.20925 49.1253 4.83294V14.0521C49.1253 15.2743 49.6101 16.4465 50.4733 17.3116C51.3365 18.1767 52.5076 18.6642 53.7297 18.6669C54.9536 18.6669 56.1274 19.1531 56.9929 20.0185C57.8583 20.884 58.3445 22.0577 58.3445 23.2817C58.3472 24.5038 58.8346 25.6749 59.6998 26.5381C60.5649 27.4013 61.7371 27.8861 62.9593 27.8861C64.176 27.8888 65.3425 28.3719 66.2048 29.2304C67.0671 30.0889 67.5555 31.2531 67.5637 32.4699V41.7614C67.5637 42.9835 68.0485 44.1557 68.9117 45.0208C69.7749 45.886 70.946 46.3734 72.1681 46.3761C73.392 46.3761 74.5658 45.8899 75.4312 45.0245C76.2967 44.1591 76.7829 42.9853 76.7829 41.7614V32.5422C76.7829 31.32 77.2676 30.1478 78.1308 29.2826C78.9941 28.4175 80.1652 27.9301 81.3873 27.9274C82.6094 27.9274 83.7817 27.4426 84.6468 26.5794C85.512 25.7162 85.9993 24.545 86.0021 23.3229C86.0021 22.099 86.4883 20.9252 87.3537 20.0598C88.2191 19.1944 89.3929 18.7082 90.6168 18.7082C91.8389 18.7055 93.0101 18.2181 93.8733 17.3529C94.7365 16.4878 95.2213 15.3155 95.2213 14.0934V4.83294C95.2253 4.22605 95.1097 3.6243 94.8809 3.06218C94.6521 2.50006 94.3147 1.98862 93.8879 1.55708C93.4612 1.12555 92.9535 0.782445 92.394 0.547383C91.8345 0.312321 91.234 0.18991 90.6271 0.187208Z" fill="white"></path>
4
+ <path d="M143.08 43.2244C139.48 43.2244 136.389 42.588 133.807 41.3152C131.225 40.0424 129.115 38.3877 127.479 36.3512C125.879 34.3147 124.697 32.0964 123.933 29.6962C123.17 27.2961 122.788 24.9868 122.788 22.7685V21.5684C122.788 19.0955 123.17 16.659 123.933 14.2588C124.733 11.8586 125.952 9.67668 127.588 7.71291C129.224 5.74914 131.297 4.18539 133.807 3.02168C136.352 1.8216 139.352 1.22156 142.807 1.22156C146.407 1.22156 149.535 1.87615 152.19 3.18533C154.881 4.45814 157.026 6.27645 158.626 8.64024C160.227 10.9677 161.19 13.6951 161.518 16.8226H153.717C153.426 15.0043 152.772 13.4769 151.753 12.2405C150.771 10.9677 149.517 10.0222 147.989 9.40393C146.462 8.74934 144.735 8.42205 142.807 8.42205C140.843 8.42205 139.098 8.76753 137.571 9.45848C136.043 10.1131 134.77 11.0586 133.752 12.295C132.734 13.5315 131.952 14.9861 131.406 16.659C130.897 18.3318 130.643 20.1865 130.643 22.223C130.643 24.1868 130.897 26.0051 131.406 27.6779C131.952 29.3507 132.752 30.8236 133.807 32.0964C134.861 33.3328 136.152 34.2965 137.68 34.9875C139.243 35.6785 141.043 36.0239 143.08 36.0239C146.062 36.0239 148.571 35.2966 150.608 33.842C152.681 32.351 153.935 30.2781 154.372 27.6234H162.172C161.809 30.4599 160.845 33.0601 159.281 35.4239C157.717 37.7877 155.572 39.6787 152.844 41.097C150.117 42.5153 146.862 43.2244 143.08 43.2244ZM182.346 43.2244C179.728 43.2244 177.418 42.8062 175.418 41.9698C173.418 41.1334 171.727 40.006 170.345 38.5877C168.963 37.1331 167.909 35.4966 167.181 33.6783C166.49 31.86 166.145 29.969 166.145 28.0052V26.8597C166.145 24.8232 166.509 22.8958 167.236 21.0775C168 19.2228 169.072 17.5863 170.454 16.168C171.873 14.7134 173.582 13.586 175.582 12.786C177.582 11.9496 179.837 11.5313 182.346 11.5313C184.855 11.5313 187.11 11.9496 189.11 12.786C191.11 13.586 192.801 14.7134 194.183 16.168C195.601 17.5863 196.674 19.2228 197.402 21.0775C198.129 22.8958 198.493 24.8232 198.493 26.8597V28.0052C198.493 29.969 198.129 31.86 197.402 33.6783C196.711 35.4966 195.674 37.1331 194.292 38.5877C192.91 40.006 191.219 41.1334 189.219 41.9698C187.219 42.8062 184.928 43.2244 182.346 43.2244ZM182.346 36.7331C184.201 36.7331 185.764 36.333 187.037 35.533C188.31 34.6966 189.274 33.5874 189.928 32.2055C190.583 30.7872 190.91 29.1871 190.91 27.4052C190.91 25.5869 190.565 23.9867 189.874 22.6048C189.219 21.1866 188.237 20.0774 186.928 19.2773C185.655 18.4409 184.128 18.0227 182.346 18.0227C180.564 18.0227 179.019 18.4409 177.709 19.2773C176.437 20.0774 175.455 21.1866 174.764 22.6048C174.073 23.9867 173.727 25.5869 173.727 27.4052C173.727 29.1871 174.055 30.7872 174.709 32.2055C175.4 33.5874 176.382 34.6966 177.655 35.533C178.928 36.333 180.491 36.7331 182.346 36.7331ZM217.405 43.1699C215.332 43.1699 213.423 42.788 211.678 42.0243C209.932 41.2607 208.423 40.1879 207.15 38.8059C205.877 37.424 204.895 35.8239 204.204 34.0056C203.514 32.1509 203.168 30.1508 203.168 28.0052V26.8597C203.168 24.7504 203.495 22.7685 204.15 20.9138C204.841 19.0591 205.786 17.4408 206.986 16.0589C208.223 14.677 209.696 13.6042 211.405 12.8405C213.151 12.0405 215.078 11.6405 217.187 11.6405C219.515 11.6405 221.551 12.1496 223.297 13.1678C225.079 14.1497 226.497 15.6407 227.552 17.6409C228.606 19.641 229.188 22.1503 229.297 25.1686L227.061 22.5503V2.36709H234.643V42.188H228.643V29.5871H229.952C229.843 32.6055 229.224 35.133 228.097 37.1695C226.97 39.1696 225.479 40.6788 223.624 41.697C221.806 42.6789 219.733 43.1699 217.405 43.1699ZM219.096 36.7876C220.587 36.7876 221.951 36.4603 223.188 35.8057C224.424 35.1148 225.406 34.1329 226.133 32.8601C226.897 31.5509 227.279 30.0235 227.279 28.2779V26.096C227.279 24.3504 226.897 22.8958 226.133 21.732C225.37 20.532 224.369 19.6228 223.133 19.0046C221.897 18.35 220.551 18.0227 219.096 18.0227C217.46 18.0227 216.005 18.4227 214.732 19.2228C213.496 19.9865 212.514 21.0775 211.787 22.4957C211.096 23.914 210.75 25.5687 210.75 27.4597C210.75 29.3507 211.114 31.0054 211.841 32.4237C212.569 33.8056 213.551 34.8784 214.787 35.6421C216.06 36.4058 217.496 36.7876 219.096 36.7876ZM256.529 43.2244C253.983 43.2244 251.747 42.788 249.82 41.9152C247.928 41.0425 246.347 39.8787 245.074 38.4241C243.837 36.9331 242.892 35.2784 242.237 33.4601C241.619 31.6418 241.31 29.7871 241.31 27.8961V26.8597C241.31 24.8959 241.619 23.0049 242.237 21.1866C242.892 19.3319 243.837 17.6954 245.074 16.2771C246.347 14.8225 247.91 13.677 249.765 12.8405C251.62 11.9677 253.765 11.5313 256.202 11.5313C259.402 11.5313 262.075 12.2405 264.22 13.6588C266.402 15.0407 268.039 16.8772 269.13 19.1682C270.221 21.4229 270.766 23.8595 270.766 26.4778V29.2053H244.528V24.5686H266.021L263.675 26.8597C263.675 24.9686 263.402 23.3503 262.857 22.0048C262.311 20.6592 261.475 19.6228 260.347 18.8955C259.257 18.1682 257.875 17.8045 256.202 17.8045C254.529 17.8045 253.111 18.1863 251.947 18.95C250.783 19.7137 249.892 20.8229 249.274 22.2775C248.692 23.6958 248.401 25.405 248.401 27.4052C248.401 29.2598 248.692 30.9145 249.274 32.3691C249.856 33.7874 250.747 34.9148 251.947 35.7512C253.147 36.5512 254.674 36.9513 256.529 36.9513C258.384 36.9513 259.893 36.5876 261.057 35.8603C262.22 35.0966 262.966 34.1693 263.293 33.0783H270.275C269.839 35.1148 269.003 36.8967 267.766 38.4241C266.53 39.9515 264.948 41.1334 263.02 41.9698C261.129 42.8062 258.966 43.2244 256.529 43.2244ZM285.337 26.9688L273.337 2.36709H281.301L290.465 21.6229L288.719 21.0775H293.902L292.047 21.6229L300.393 2.36709H307.921L296.847 26.9688H285.337ZM287.301 42.188V25.7687H294.884V42.188H287.301ZM328.768 42.188V33.4056H327.513V23.6413C327.513 21.9321 327.095 20.6592 326.258 19.8228C325.422 18.9864 324.131 18.5682 322.385 18.5682C321.476 18.5682 320.385 18.5864 319.112 18.6227C317.839 18.6591 316.548 18.7137 315.239 18.7864C313.966 18.8228 312.821 18.8773 311.803 18.95V12.5132C312.639 12.4405 313.585 12.3678 314.639 12.295C315.694 12.2223 316.767 12.1859 317.858 12.1859C318.985 12.1496 320.04 12.1314 321.022 12.1314C324.076 12.1314 326.604 12.5314 328.604 13.3315C330.64 14.1315 332.168 15.3862 333.186 17.0954C334.241 18.8046 334.768 21.0411 334.768 23.8049V42.188H328.768ZM319.221 42.9517C317.076 42.9517 315.185 42.5698 313.548 41.8061C311.948 41.0425 310.694 39.9515 309.784 38.5332C308.912 37.1149 308.475 35.4057 308.475 33.4056C308.475 31.2236 309.003 29.4417 310.057 28.0598C311.148 26.6778 312.657 25.6414 314.585 24.9504C316.548 24.2595 318.84 23.914 321.458 23.914H328.331V28.4416H321.349C319.603 28.4416 318.258 28.878 317.312 29.7508C316.403 30.5872 315.948 31.6782 315.948 33.0237C315.948 34.3693 316.403 35.4603 317.312 36.2967C318.258 37.1331 319.603 37.5513 321.349 37.5513C322.403 37.5513 323.367 37.3695 324.24 37.0058C325.149 36.6058 325.895 35.9512 326.476 35.042C327.095 34.0965 327.44 32.8237 327.513 31.2236L329.368 33.351C329.186 35.4239 328.677 37.1695 327.84 38.5877C327.04 40.006 325.913 41.097 324.458 41.8607C323.04 42.588 321.294 42.9517 319.221 42.9517ZM342.89 42.188V12.5678H348.89V25.2777H348.345C348.345 22.2957 348.727 19.8046 349.49 17.8045C350.254 15.768 351.381 14.2406 352.872 13.2224C354.4 12.1678 356.291 11.6405 358.545 11.6405H358.873C361.164 11.6405 363.055 12.1678 364.546 13.2224C366.073 14.2406 367.201 15.768 367.928 17.8045C368.692 19.8046 369.073 22.2957 369.073 25.2777H367.164C367.164 22.2957 367.546 19.8046 368.31 17.8045C369.11 15.768 370.255 14.2406 371.746 13.2224C373.274 12.1678 375.165 11.6405 377.419 11.6405H377.747C380.038 11.6405 381.947 12.1678 383.474 13.2224C385.002 14.2406 386.147 15.768 386.911 17.8045C387.711 19.8046 388.111 22.2957 388.111 25.2777V42.188H380.529V24.5686C380.529 22.7139 380.056 21.2411 379.11 20.1501C378.165 19.0228 376.819 18.4591 375.074 18.4591C373.328 18.4591 371.928 19.041 370.873 20.2047C369.819 21.332 369.292 22.8594 369.292 24.7868V42.188H361.709V24.5686C361.709 22.7139 361.236 21.2411 360.291 20.1501C359.345 19.0228 358 18.4591 356.254 18.4591C354.509 18.4591 353.109 19.041 352.054 20.2047C350.999 21.332 350.472 22.8594 350.472 24.7868V42.188H342.89Z" fill="white"></path>
5
+ </svg>
@@ -5,10 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>CodeYam</title>
7
7
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />
8
- <script type="module" crossorigin src="/assets/index-KDFAgt2e.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-QsOiOG9x.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/react-CSS0HapR.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/markdown-v0F0UEt3.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-Bih6HJ_u.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-CIXZkwfB.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
@@ -1,2 +0,0 @@
1
- import{j as e}from"./markdown-v0F0UEt3.js";import{b as a}from"./react-CSS0HapR.js";import{u as T}from"./useEvents-DggWrtHe.js";function B({connected:t}){return e.jsx("span",{className:`inline-block rounded-full px-2 py-0.5 text-xs font-medium text-[var(--text-primary)] ${t?"bg-[var(--accent-green)]":"bg-[var(--accent-red)]"}`,children:t?"connected":"reconnecting…"})}function M(){const[t,s]=a.useState(null),[n,r]=a.useState(!0),{events:l}=T(),o=a.useCallback(async()=>{try{const c=await(await fetch("/api/inspector/status")).json();s(c)}catch{}finally{r(!1)}},[]);return a.useEffect(()=>{o()},[o]),a.useEffect(()=>{const i=l[l.length-1];i&&i.type==="scenario_switch"&&o()},[l,o]),{scenario:(t==null?void 0:t.scenario)??null,previewScenario:(t==null?void 0:t.previewScenario)??null,routes:(t==null?void 0:t.routes)??[],routeCount:(t==null?void 0:t.routeCount)??0,loading:n,refetch:o}}function k({title:t}){return e.jsx("h2",{style:{fontSize:14,fontWeight:600,color:"#f0f6fc",margin:"0 0 8px 0",borderBottom:"1px solid #30363d",paddingBottom:8},children:t})}function f({color:t,children:s}){return e.jsx("span",{style:{background:`${t}22`,color:t,border:`1px solid ${t}55`,borderRadius:4,padding:"2px 8px",fontSize:11,fontWeight:600,letterSpacing:"0.5px",whiteSpace:"nowrap"},children:s})}const P={GET:"#D7FF63",POST:"#238636",PUT:"#d29922",DELETE:"#da3633",PATCH:"#bc8cff"};function F({method:t}){const s=P[t.toUpperCase()]??"#8b949e";return e.jsx("span",{style:{color:s,fontWeight:600,fontSize:11,minWidth:48,display:"inline-block"},children:t.toUpperCase()})}function E({color:t,children:s}){return e.jsx("div",{style:{padding:"12px 16px",borderRadius:6,border:`1px solid ${t}44`,background:`${t}11`,color:t},children:s})}const h={padding:"8px 12px",textAlign:"center",color:"#8b949e",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.5px"},u={padding:"6px 12px"},w={background:"#161b22",border:"1px solid #30363d",borderRadius:6,color:"#c9d1d9",padding:"6px 12px",fontSize:13,fontFamily:"inherit"},L={...w,appearance:"none",paddingRight:24,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center"};function z({routes:t}){return e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{borderBottom:"1px solid #30363d"},children:[e.jsx("th",{style:h,children:"Method"}),e.jsx("th",{style:{...h,textAlign:"left"},children:"Pattern"}),e.jsx("th",{style:h,children:"Status"})]})}),e.jsx("tbody",{children:t.map((s,n)=>e.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[e.jsx("td",{style:{...u,textAlign:"center"},children:e.jsx(F,{method:s.method})}),e.jsx("td",{style:u,children:s.pattern}),e.jsx("td",{style:{...u,textAlign:"center",color:"#8b949e"},children:s.status})]},n))})]})}function O(){const{scenario:t,previewScenario:s,routes:n,routeCount:r,loading:l}=M();return e.jsxs("section",{children:[e.jsx(k,{title:"Active Scenario"}),l?e.jsx(E,{color:"#8b949e",children:"Loading..."}):t?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(f,{color:"#238636",children:"ACTIVE"}),e.jsx("span",{style:{color:"#f0f6fc",fontWeight:500},children:t.name}),e.jsxs("span",{style:{color:"#8b949e"},children:["(",t.slug,")"]})]}),e.jsxs("div",{style:{color:"#8b949e",fontSize:12},children:[r," mock route",r!==1?"s":""," loaded"]}),n.length>0&&e.jsx(z,{routes:n})]}):s?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(f,{color:"#D7FF63",children:"PREVIEW"}),e.jsx("span",{style:{color:"#f0f6fc",fontWeight:500},children:s.name}),e.jsxs("span",{style:{color:"#8b949e"},children:["(",s.slug,")"]})]}),e.jsx("div",{style:{color:"#8b949e",fontSize:12},children:"Component preview — no HTTP mocks active"})]}):e.jsx(E,{color:"#d29922",children:"No scenario active — all requests pass through to upstream"})]})}function A(t){try{return new URL(t).pathname}catch{return t}}function D({textUrlFilter:t,onTextUrlFilterChange:s,methodFilter:n,onMethodFilterChange:r,sourceFilter:l,onSourceFilterChange:o}){return e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,alignItems:"center"},children:[e.jsx("input",{type:"text",placeholder:"Filter by URL...",value:t,onChange:i=>s(i.target.value),style:{...w,flex:1,minWidth:0}}),e.jsxs("select",{value:n,onChange:i=>r(i.target.value),style:L,children:[e.jsx("option",{value:"ALL",children:"All Methods"}),e.jsx("option",{value:"GET",children:"GET"}),e.jsx("option",{value:"POST",children:"POST"}),e.jsx("option",{value:"PUT",children:"PUT"}),e.jsx("option",{value:"DELETE",children:"DELETE"}),e.jsx("option",{value:"PATCH",children:"PATCH"})]}),e.jsxs("select",{value:l,onChange:i=>o(i.target.value),style:L,children:[e.jsx("option",{value:"ALL",children:"All Sources"}),e.jsx("option",{value:"MOCKED",children:"Mocked"}),e.jsx("option",{value:"PASSTHROUGH",children:"Passthrough"})]})]})}const I={color:"#8b949e",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:4},R={background:"#161b22",border:"1px solid #30363d",borderRadius:4,padding:"8px 12px",margin:0,fontSize:11,color:"#c9d1d9",fontFamily:"monospace",maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"};function v({label:t,children:s}){return e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("div",{style:I,children:t}),s]})}function H({event:t}){let s=[];try{const o=new URL(t.url,"http://localhost");s=Array.from(o.searchParams.entries())}catch{}const n=t.requestHeaders&&Object.keys(t.requestHeaders).length>0,r=t.requestBody!=null,l=t.responseBody!=null;return e.jsxs("div",{style:{background:"#0d1117",padding:"12px 16px",borderTop:"1px solid #30363d"},children:[s.length>0&&e.jsx(v,{label:"Query Parameters",children:e.jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"2px 12px",fontSize:12},children:s.map(([o,i],c)=>e.jsxs("div",{style:{display:"contents"},children:[e.jsx("span",{style:{color:"#D7FF63",fontFamily:"monospace"},children:o}),e.jsx("span",{style:{color:"#c9d1d9",fontFamily:"monospace"},children:i})]},c))})}),n&&e.jsx(v,{label:"Request Headers",children:e.jsx("pre",{style:R,children:Object.entries(t.requestHeaders).map(([o,i])=>`${o}: ${i}`).join(`
2
- `)})}),r&&e.jsx(v,{label:"Request Body",children:e.jsx("pre",{style:R,children:typeof t.requestBody=="string"?t.requestBody:JSON.stringify(t.requestBody,null,2)})}),l&&e.jsx(v,{label:"Response Body",children:e.jsx("pre",{style:R,children:typeof t.responseBody=="string"?t.responseBody:JSON.stringify(t.responseBody,null,2)})}),s.length===0&&!n&&!r&&!l&&e.jsx("div",{style:{color:"#8b949e",fontSize:12},children:"No additional details available for this request"})]})}function U({event:t}){const[s,n]=a.useState(!1),r=new Date(t.timestampMs).toLocaleTimeString(),l=t.mocked;return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:()=>n(!s),style:{borderBottom:"1px solid #21262d",background:l?"transparent":"rgba(210, 153, 34, 0.05)",cursor:"pointer"},children:[e.jsxs("td",{style:{...u,color:"#8b949e",textAlign:"center"},children:[e.jsx("span",{style:{display:"inline-block",width:12,marginRight:4,fontSize:10,color:"#8b949e",transition:"transform 0.15s",transform:s?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),r]}),e.jsx("td",{style:{...u,textAlign:"center"},children:e.jsx(F,{method:t.method})}),e.jsx("td",{style:{...u,maxWidth:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.url}),e.jsx("td",{style:{...u,textAlign:"center",color:"#8b949e"},children:t.status??"---"}),e.jsxs("td",{style:{...u,textAlign:"center",color:"#8b949e"},children:[t.durationMs,"ms"]}),e.jsx("td",{style:{...u,textAlign:"center"},children:l?t.mockSource==="default"?e.jsx(f,{color:"#1f6feb",children:"MOCKED (default)"}):e.jsx(f,{color:"#238636",children:"MOCKED (scenario)"}):e.jsx(f,{color:"#d29922",children:"PASSTHROUGH"})})]}),s&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,style:{padding:0},children:e.jsx(H,{event:t})})})]})}function W({events:t}){return e.jsx("div",{style:{maxHeight:300,overflowY:"auto",border:"1px solid #30363d",borderRadius:6},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{borderBottom:"1px solid #30363d",position:"sticky",top:0,background:"#0d1117"},children:[e.jsx("th",{style:h,children:"Time"}),e.jsx("th",{style:h,children:"Method"}),e.jsx("th",{style:{...h,textAlign:"left"},children:"URL"}),e.jsx("th",{style:h,children:"Status"}),e.jsx("th",{style:h,children:"Duration"}),e.jsx("th",{style:h,children:"Source"})]})}),e.jsx("tbody",{children:t.map(s=>e.jsx(U,{event:s},s.id))})]})})}function q(t){if(t===void 0)return"checked";if(t==="checked")return"excluded"}function $({chips:t,chipStates:s,onChipStatesChange:n}){if(t.length===0)return null;const r=o=>{const i=new Map(s),c=q(i.get(o));c===void 0?i.delete(o):i.set(o,c),n(i)},l=()=>{n(new Map)};return e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:12},children:[s.size>0&&e.jsx("button",{onClick:l,style:{background:"#da363322",color:"#da3633",border:"1px solid #da363355",borderRadius:4,padding:"2px 8px",fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:"Clear all"}),t.map(({path:o,count:i})=>{const c=s.get(o),d=c==="checked",g=c==="excluded";let j="#30363d",b="#8b949e",S="#30363d",y="";return d?(j="#D7FF6322",b="#D7FF63",S="#D7FF6355",y="✓ "):g&&(j="#da363322",b="#da3633",S="#da363355",y="✗ "),e.jsxs("button",{onClick:()=>r(o),style:{background:j,color:b,border:`1px solid ${S}`,borderRadius:4,padding:"2px 8px",fontSize:11,fontFamily:"monospace",cursor:"pointer",whiteSpace:"nowrap"},children:[y,o,e.jsxs("span",{style:{marginLeft:4,opacity:.6,fontFamily:"inherit"},children:["(",i,")"]})]},o)})]})}function N(){const{events:t}=T(),[s,n]=a.useState(""),[r,l]=a.useState(()=>new Map),[o,i]=a.useState("ALL"),[c,d]=a.useState("ALL"),g=t.filter(p=>p.type==="http_request"),j=a.useMemo(()=>{const p=new Map;for(const x of g){const m=A(x.url);p.set(m,(p.get(m)||0)+1)}return Array.from(p.entries()).sort((x,m)=>m[1]-x[1]).slice(0,10).map(([x,m])=>({path:x,count:m}))},[g]),b=a.useMemo(()=>Array.from(r.values()).some(p=>p==="checked"),[r]),y=g.filter(p=>{if(s&&!p.url.toLowerCase().includes(s.toLowerCase()))return!1;const x=A(p.url);return!(r.get(x)==="excluded"||b&&r.get(x)!=="checked"||o!=="ALL"&&p.method.toUpperCase()!==o||c==="MOCKED"&&!p.mocked||c==="PASSTHROUGH"&&p.mocked)}).slice(-50).reverse();return e.jsxs("section",{children:[e.jsx(k,{title:"Live Traffic"}),e.jsx(D,{textUrlFilter:s,onTextUrlFilterChange:n,methodFilter:o,onMethodFilterChange:i,sourceFilter:c,onSourceFilterChange:p=>d(p)}),e.jsx($,{chips:j,chipStates:r,onChipStatesChange:l}),y.length===0?e.jsx(E,{color:"#8b949e",children:g.length>0?"No matching traffic — try adjusting the filters":"No HTTP traffic yet — requests will appear here in real-time"}):e.jsx(W,{events:y})]})}function G(){const[t,s]=a.useState(null),[n,r]=a.useState(!1);return{explain:a.useCallback(async(o,i)=>{r(!0);try{const d=await(await fetch("/api/inspector/explain",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:o,url:i})})).json();s(d)}catch{}finally{r(!1)}},[]),result:t,loading:n}}function _({result:t}){return e.jsxs("div",{style:{border:"1px solid #30363d",borderRadius:6,padding:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsxs("span",{style:{color:"#f0f6fc",fontWeight:500},children:[t.method," ",t.url]}),t.wouldMatch?e.jsx(f,{color:"#238636",children:"WOULD MATCH"}):e.jsx(f,{color:"#da3633",children:"NO MATCH"})]}),t.attempts.length===0?e.jsx("div",{style:{color:"#8b949e"},children:"No routes loaded to match against"}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.attempts.map((s,n)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:4,background:s.failure?"transparent":"rgba(35, 134, 54, 0.1)"},children:[e.jsx("span",{style:{color:s.failure?"#da3633":"#238636",fontWeight:600,width:16},children:s.failure?"x":"v"}),e.jsx(F,{method:s.method}),e.jsx("span",{children:s.pattern}),s.failure&&e.jsx("span",{style:{color:"#8b949e",fontSize:11},children:s.failure.reason==="methodMismatch"?`method: expected ${s.failure.expected}, got ${s.failure.actual}`:`path "${s.failure.path}" does not match "${s.failure.pattern}"`})]},n))})]})}function K(){const{explain:t,result:s,loading:n}=G(),[r,l]=a.useState("GET"),[o,i]=a.useState(""),c=d=>{d.preventDefault(),o.trim()&&t(r,o.trim())};return e.jsxs("section",{children:[e.jsx(k,{title:"Match Explainer"}),e.jsxs("form",{onSubmit:c,style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("select",{value:r,onChange:d=>l(d.target.value),style:{...w,width:100},children:["GET","POST","PUT","DELETE","PATCH"].map(d=>e.jsx("option",{value:d,children:d},d))}),e.jsx("input",{type:"text",value:o,onChange:d=>i(d.target.value),placeholder:"/api/users",style:{...w,flex:1}}),e.jsx("button",{type:"submit",disabled:n||!o.trim(),style:{background:"#238636",color:"#fff",border:"none",borderRadius:6,padding:"6px 16px",cursor:"pointer",fontSize:12,fontWeight:500,opacity:n||!o.trim()?.5:1},children:n?"Checking...":"Explain"})]}),s&&e.jsx(_,{result:s})]})}const C={"/api/health":"Health check — confirms the proxy and mock engine are running","/api/events":"SSE stream of real-time events (traffic, errors) powering this Inspector","/api/config":"Returns current CodeYam configuration for the project","/api/editor-dev-server":"Polls/controls the dev server status (start, stop, restart)","/api/inspector/status":"Returns active scenario and loaded mock routes","/api/inspector/explain":"Tests which mock route would match a given method + URL","/api/scenarios":"Lists all defined scenarios with metadata","/api/tests":"Returns the AI-maintained test registry joined with per-test-evidence, grouped by file","/api/test-results":"Returns latest test execution results","/api/screenshots/*":"Serves captured scenario screenshots","/api/session-info":"Returns current editor session metadata","/api/data-structure":"Returns the app's data structure definition","/api/dependency-graph":"Returns the project's component dependency graph","/api/app-route-entities":"Lists app routes and their associated entities","/api/glossary":"Returns the project's component glossary","/api/step":"Returns current editor workflow step","/api/editor-commands":"Lists available editor commands"};function J(t){if(C[t])return C[t];for(const[s,n]of Object.entries(C))if(s.endsWith("/*")){const r=s.slice(0,-1);if(t.startsWith(r))return n}}function V(t){const s=new Set([...t,...Object.keys(C)]),n=[];for(const r of Array.from(s).sort()){if(r.endsWith("/*"))continue;const l=J(r);n.push({path:r,description:l??"Application endpoint"})}return n}function Y(){const{events:t}=T(),s=a.useMemo(()=>{const n=[];for(const r of t)r.type==="http_request"&&n.push(A(r.url));return V(n)},[t]);return s.length===0?null:e.jsxs("section",{children:[e.jsx(k,{title:"URL Glossary"}),e.jsx("div",{style:{border:"1px solid #30363d",borderRadius:6,overflow:"hidden"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{borderBottom:"1px solid #30363d",background:"#161b22"},children:[e.jsx("th",{style:{padding:"6px 12px",textAlign:"left",color:"#8b949e",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.5px",width:"30%"},children:"Path"}),e.jsx("th",{style:{padding:"6px 12px",textAlign:"left",color:"#8b949e",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.5px"},children:"Description"})]})}),e.jsx("tbody",{children:s.map(({path:n,description:r})=>e.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[e.jsx("td",{style:{padding:"4px 12px",fontFamily:"monospace",color:"#D7FF63",fontSize:11},children:n}),e.jsx("td",{style:{padding:"4px 12px",color:"#8b949e"},children:r})]},n))})]})})]})}function Q(){const{connected:t}=T();return e.jsxs("div",{style:{background:"#0d1117",color:"#c9d1d9",minHeight:"100vh",fontFamily:"'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:13,padding:24,display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("header",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("h1",{style:{fontSize:18,fontWeight:600,color:"#f0f6fc",margin:0},children:"Container Inspector"}),e.jsx("span",{style:{color:"#8b949e",fontSize:12},children:"Read-only view of proxy and mock engine state"}),e.jsx(B,{connected:t})]}),e.jsx(O,{}),e.jsx(N,{}),e.jsx(K,{}),e.jsx(Y,{})]})}const te=Object.freeze(Object.defineProperty({__proto__:null,ContainerInspector:Q},Symbol.toStringTag,{value:"Module"}));export{f as B,Q as C,U as I,F as M,k as S,E as a,Y as b,$ as c,W as d,D as e,H as f,_ as g,K as h,N as i,z as j,O as k,B as l,te as m,h as t};