hammerkit 2.1.0-next.2 → 2.1.0-next.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.schema.json +39 -18
- package/dist/cli.js +5 -0
- package/dist/dashboard/assets/graph-canvas-D6GMgkoe.js +8 -0
- package/dist/dashboard/assets/index-BNq9j5Jo.js +23 -0
- package/dist/dashboard/assets/index-DP3_hKOe.css +2 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/environment/replace-env-variables.js +8 -5
- package/dist/environment/run-source-envs.js +2 -1
- package/dist/executer/archive-task-entry.js +1 -1
- package/dist/executer/deadline.js +63 -10
- package/dist/executer/event-cache.js +5 -1
- package/dist/executer/execute-work-task.js +15 -3
- package/dist/executer/runner-commands.js +36 -0
- package/dist/file/get-file-context.js +4 -7
- package/dist/harness/connect.js +12 -8
- package/dist/harness/reconnect.js +141 -0
- package/dist/harness/sandbox-client.js +159 -30
- package/dist/harness/service-tools.js +11 -2
- package/dist/kubernetes/cluster-state.js +48 -14
- package/dist/kubernetes/ensure-persistent-data.js +15 -4
- package/dist/kubernetes/follow-pod-logs.js +8 -5
- package/dist/kubernetes/kept-claims.js +26 -5
- package/dist/kubernetes/resources.js +5 -1
- package/dist/kubernetes/sandbox-runner.js +526 -156
- package/dist/kubernetes/store-kubernetes-data.js +18 -3
- package/dist/kubernetes/sync-changes.js +463 -0
- package/dist/kubernetes/volumes.js +23 -1
- package/dist/optimizer/get-work-cache-stats.js +7 -0
- package/dist/optimizer/work-task-cache-description.js +3 -2
- package/dist/planner/image-build.js +5 -0
- package/dist/planner/utils/dependency-outputs.js +7 -6
- package/dist/planner/validate.js +41 -0
- package/dist/planner/work-item-status.js +12 -2
- package/dist/planner/work-runtime-aggregate.js +1 -0
- package/dist/planner/work-runtime-docker.js +33 -6
- package/dist/planner/work-runtime-kubernetes.js +313 -70
- package/dist/planner/work-runtime-local.js +8 -4
- package/dist/planner/work-secret.js +33 -11
- package/dist/planner/work-service-id.js +30 -6
- package/dist/program.js +19 -1
- package/dist/remote/annotations.js +37 -5
- package/dist/remote/bundle.js +6 -8
- package/dist/remote/collect-bundle.js +3 -2
- package/dist/remote/device-login.js +4 -1
- package/dist/remote/remote-commands.js +16 -7
- package/dist/remote/remote-work-commands.js +266 -75
- package/dist/remote/server-client.js +38 -40
- package/dist/schema/build-file-base-task-schema.js +16 -1
- package/dist/schema/build-file-image-build-schema.js +5 -8
- package/dist/schema/reference-parser.js +108 -43
- package/dist/schema/work-scope-parser.js +8 -0
- package/dist/secrets/prefetch-secrets.js +20 -1
- package/dist/server/artifacts-api.js +56 -0
- package/dist/server/definitions-api.js +62 -8
- package/dist/server/executor.js +117 -30
- package/dist/server/http.js +4 -1
- package/dist/server/keep-artifacts.js +230 -0
- package/dist/server/kubernetes-backend.js +186 -59
- package/dist/server/kubernetes-sandbox-storage.js +3 -2
- package/dist/server/overview.js +73 -9
- package/dist/server/paging.js +167 -0
- package/dist/server/plan.js +16 -1
- package/dist/server/run-access.js +24 -0
- package/dist/server/run-artifacts.js +171 -0
- package/dist/server/run-logs.js +25 -1
- package/dist/server/run-request.js +11 -0
- package/dist/server/run-source-environment.js +1 -1
- package/dist/server/run-worker.js +267 -33
- package/dist/server/runs.js +527 -99
- package/dist/server/sandbox-files-api.js +27 -12
- package/dist/server/sandbox-files.js +12 -10
- package/dist/server/sandbox-follow.js +54 -0
- package/dist/server/sandbox-pod.js +1 -1
- package/dist/server/sandbox-storage.js +38 -1
- package/dist/server/sandbox-sync.js +392 -0
- package/dist/server/sandboxes-api.js +116 -19
- package/dist/server/sandboxes.js +38 -3
- package/dist/server/server-config.js +14 -0
- package/dist/server/server.js +169 -38
- package/dist/server/task-order.js +56 -0
- package/dist/utils/project-path.js +20 -0
- package/dist/utils/tar-files.js +52 -0
- package/dist/utils/tar.js +37 -1
- package/package.json +1 -1
- package/dist/dashboard/assets/graph-canvas-DtJSpova.js +0 -8
- package/dist/dashboard/assets/index-BndChMep.css +0 -2
- package/dist/dashboard/assets/index-DRSwIRXd.js +0 -17
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-600:oklch(60% .118 184.704);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-600:oklch(58.8% .158 241.966);--color-sky-700:oklch(50% .134 242.749);--color-sky-900:oklch(39.1% .09 240.876);--color-sky-950:oklch(29.3% .066 243.157);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-700:oklch(49.1% .27 292.581);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-600:oklch(59.1% .293 322.896);--color-stone-50:oklch(98.5% .001 106.423);--color-stone-100:oklch(97% .001 106.424);--color-stone-200:oklch(92.3% .003 48.717);--color-stone-300:oklch(86.9% .005 56.366);--color-stone-400:oklch(70.9% .01 56.259);--color-stone-500:oklch(55.3% .013 58.071);--color-stone-600:oklch(44.4% .011 73.639);--color-stone-700:oklch(37.4% .01 67.558);--color-stone-800:oklch(26.8% .007 34.298);--color-stone-900:oklch(21.6% .006 56.043);--color-stone-950:oklch(14.7% .004 49.25);--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;scrollbar-gutter:stable}@media (prefers-color-scheme:dark){html{--lightningcss-light: ;--lightningcss-dark:initial}}body{background-color:var(--color-stone-50);color:var(--color-stone-900);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){body{background-color:var(--color-stone-950);color:var(--color-stone-100)}}}@layer components{.link{color:var(--color-emerald-700);text-underline-offset:2px}@media (hover:hover){.link:hover{text-decoration-line:underline}}@media (prefers-color-scheme:dark){.link{color:var(--color-emerald-400)}}.log{border-radius:var(--radius-lg);background-color:var(--color-stone-950);padding:calc(var(--spacing) * 3);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);white-space:pre;color:var(--color-stone-200);overflow-x:auto}@media (prefers-color-scheme:dark){.log{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-stone-800)}}}@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.-inset-y-0\.5{inset-block:calc(var(--spacing) * -.5)}.inset-y-0{inset-block:0}.top-0{top:0}.top-full{top:100%}.right-0{right:0}.left-0{left:0}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.order-last{order:9999}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:var(--spacing)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-1{margin-left:var(--spacing)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0{height:0}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-40{height:calc(var(--spacing) * 40)}.h-\[52px\]{height:52px}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-96{max-height:calc(var(--spacing) * 96)}.min-h-0{min-height:0}.min-h-screen{min-height:100vh}.w-1{width:var(--spacing)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-10{width:calc(var(--spacing) * 10)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-\[184px\]{width:184px}.w-full{width:100%}.max-w-6xl{max-width:var(--container-6xl)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-80{max-width:calc(var(--spacing) * 80)}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.min-w-0{min-width:0}.min-w-0\.5{min-width:calc(var(--spacing) * .5)}.min-w-48{min-width:calc(var(--spacing) * 48)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-center{transform-origin:50%}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.\[scrollbar-width\:none\]{scrollbar-width:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[7rem_1fr\]{grid-template-columns:7rem 1fr}.grid-cols-\[9rem_1fr\]{grid-template-columns:9rem 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_auto\]{grid-template-columns:auto auto}.grid-cols-\[max-content_1fr\]{grid-template-columns:max-content 1fr}.grid-cols-\[minmax\(6rem\,max-content\)_1fr_3\.5rem\]{grid-template-columns:minmax(6rem,max-content) 1fr 3.5rem}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-stone-100>:not(:last-child)){border-color:var(--color-stone-100)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-500{border-color:var(--color-amber-500)}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/50{border-color:color-mix(in oklab, var(--color-amber-500) 50%, transparent)}}.border-amber-600\/40{border-color:#dd740066}@supports (color:color-mix(in lab, red, red)){.border-amber-600\/40{border-color:color-mix(in oklab, var(--color-amber-600) 40%, transparent)}}.border-emerald-300{border-color:var(--color-emerald-300)}.border-emerald-500{border-color:var(--color-emerald-500)}.border-emerald-600{border-color:var(--color-emerald-600)}.border-emerald-600\/40{border-color:#00976766}@supports (color:color-mix(in lab, red, red)){.border-emerald-600\/40{border-color:color-mix(in oklab, var(--color-emerald-600) 40%, transparent)}}.border-emerald-600\/50{border-color:#00976780}@supports (color:color-mix(in lab, red, red)){.border-emerald-600\/50{border-color:color-mix(in oklab, var(--color-emerald-600) 50%, transparent)}}.border-emerald-700{border-color:var(--color-emerald-700)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-red-500{border-color:var(--color-red-500)}.border-red-600\/40{border-color:#e4001466}@supports (color:color-mix(in lab, red, red)){.border-red-600\/40{border-color:color-mix(in oklab, var(--color-red-600) 40%, transparent)}}.border-sky-200{border-color:var(--color-sky-200)}.border-sky-300{border-color:var(--color-sky-300)}.border-sky-500{border-color:var(--color-sky-500)}.border-sky-600\/40{border-color:#0084cc66}@supports (color:color-mix(in lab, red, red)){.border-sky-600\/40{border-color:color-mix(in oklab, var(--color-sky-600) 40%, transparent)}}.border-stone-200{border-color:var(--color-stone-200)}.border-stone-300{border-color:var(--color-stone-300)}.border-stone-400{border-color:var(--color-stone-400)}.border-transparent{border-color:#0000}.border-violet-400{border-color:var(--color-violet-400)}.border-violet-500{border-color:var(--color-violet-500)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-700{background-color:var(--color-amber-700)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-300{background-color:var(--color-emerald-300)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/15{background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-600\/30{background-color:#0097674d}@supports (color:color-mix(in lab, red, red)){.bg-emerald-600\/30{background-color:color-mix(in oklab, var(--color-emerald-600) 30%, transparent)}}.bg-fuchsia-400{background-color:var(--color-fuchsia-400)}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/15{background-color:color-mix(in oklab, var(--color-red-500) 15%, transparent)}}.bg-sky-50{background-color:var(--color-sky-50)}.bg-sky-500{background-color:var(--color-sky-500)}.bg-stone-50{background-color:var(--color-stone-50)}.bg-stone-50\/60{background-color:#fafaf999}@supports (color:color-mix(in lab, red, red)){.bg-stone-50\/60{background-color:color-mix(in oklab, var(--color-stone-50) 60%, transparent)}}.bg-stone-100{background-color:var(--color-stone-100)}.bg-stone-200{background-color:var(--color-stone-200)}.bg-stone-300{background-color:var(--color-stone-300)}.bg-stone-400{background-color:var(--color-stone-400)}.bg-teal-600{background-color:var(--color-teal-600)}.bg-violet-400{background-color:var(--color-violet-400)}.bg-white{background-color:var(--color-white)}.fill-current{fill:currentColor}.fill-none{fill:none}.stroke-current{stroke:currentColor}.stroke-none{stroke:none}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\!{padding:calc(var(--spacing) * 3)!important}.p-4{padding:calc(var(--spacing) * 4)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[0\.85em\]{font-size:.85em}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-normal{overflow-wrap:normal;word-break:normal}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-700{color:var(--color-emerald-700)}.text-emerald-800{color:var(--color-emerald-800)}.text-red-300{color:var(--color-red-300)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-sky-400{color:var(--color-sky-400)}.text-sky-700{color:var(--color-sky-700)}.text-sky-900{color:var(--color-sky-900)}.text-stone-400{color:var(--color-stone-400)}.text-stone-500{color:var(--color-stone-500)}.text-stone-600{color:var(--color-stone-600)}.text-stone-700{color:var(--color-stone-700)}.text-stone-800{color:var(--color-stone-800)}.text-stone-900{color:var(--color-stone-900)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.decoration-stone-400\/40{text-decoration-color:#a6a09b66}@supports (color:color-mix(in lab, red, red)){.decoration-stone-400\/40{-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-400) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-400) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-400) 40%, transparent);text-decoration-color:color-mix(in oklab, var(--color-stone-400) 40%, transparent)}}.decoration-stone-400\/70{text-decoration-color:#a6a09bb3}@supports (color:color-mix(in lab, red, red)){.decoration-stone-400\/70{-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-400) 70%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-400) 70%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-400) 70%, transparent);text-decoration-color:color-mix(in oklab, var(--color-stone-400) 70%, transparent)}}.decoration-dotted{text-decoration-style:dotted}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-emerald-600{accent-color:var(--color-emerald-600)}.opacity-35{opacity:.35}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-emerald-500{--tw-ring-color:var(--color-emerald-500)}.ring-white{--tw-ring-color:var(--color-white)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-white{--tw-ring-offset-color:var(--color-white)}.outline-1{outline-style:var(--tw-outline-style);outline-width:1px}.outline-amber-400{outline-color:var(--color-amber-400)}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\:border-stone-300:hover{border-color:var(--color-stone-300)}.hover\:border-stone-400:hover{border-color:var(--color-stone-400)}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-emerald-50:hover{background-color:var(--color-emerald-50)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-stone-50:hover{background-color:var(--color-stone-50)}.hover\:bg-stone-100:hover{background-color:var(--color-stone-100)}.hover\:bg-stone-200:hover{background-color:var(--color-stone-200)}.hover\:text-stone-600:hover{color:var(--color-stone-600)}.hover\:text-stone-900:hover{color:var(--color-stone-900)}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-current:hover{text-decoration-color:currentColor}.hover\:brightness-95:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}}.focus-visible\:rounded-sm:focus-visible{border-radius:var(--radius-sm)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-emerald-500:focus-visible{--tw-ring-color:var(--color-emerald-500)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:text-stone-500:disabled{color:var(--color-stone-500)}.disabled\:no-underline:disabled{text-decoration-line:none}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:ml-auto{margin-left:auto}.sm\:w-80{width:calc(var(--spacing) * 80)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xs{max-width:var(--container-xs)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width>=48rem){.md\:sticky{position:sticky}.md\:top-4{top:calc(var(--spacing) * 4)}.md\:order-none{order:0}.md\:max-h-\[80vh\]{max-height:80vh}.md\:w-auto{width:auto}.md\:flex-1{flex:1}.md\:grid-cols-\[minmax\(12rem\,18rem\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(12rem,18rem) minmax(0,1fr)}.md\:overflow-y-auto{overflow-y:auto}}@media (width>=64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[max-content_1fr\]{grid-template-columns:max-content 1fr}}@media (prefers-color-scheme:dark){:where(.dark\:divide-stone-800>:not(:last-child)){border-color:var(--color-stone-800)}.dark\:border-emerald-400{border-color:var(--color-emerald-400)}.dark\:border-emerald-500{border-color:var(--color-emerald-500)}.dark\:border-emerald-700{border-color:var(--color-emerald-700)}.dark\:border-red-400{border-color:var(--color-red-400)}.dark\:border-red-900{border-color:var(--color-red-900)}.dark\:border-sky-400{border-color:var(--color-sky-400)}.dark\:border-sky-700{border-color:var(--color-sky-700)}.dark\:border-sky-900{border-color:var(--color-sky-900)}.dark\:border-stone-500{border-color:var(--color-stone-500)}.dark\:border-stone-600{border-color:var(--color-stone-600)}.dark\:border-stone-700{border-color:var(--color-stone-700)}.dark\:border-stone-800{border-color:var(--color-stone-800)}.dark\:border-violet-500{border-color:var(--color-violet-500)}.dark\:bg-amber-500{background-color:var(--color-amber-500)}.dark\:bg-amber-900\/50{background-color:#7b330680}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-900\/50{background-color:color-mix(in oklab, var(--color-amber-900) 50%, transparent)}}.dark\:bg-amber-950{background-color:var(--color-amber-950)}.dark\:bg-amber-950\/30{background-color:#4619014d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-950\/30{background-color:color-mix(in oklab, var(--color-amber-950) 30%, transparent)}}.dark\:bg-emerald-400{background-color:var(--color-emerald-400)}.dark\:bg-emerald-400\/30{background-color:#00d2944d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-400\/30{background-color:color-mix(in oklab, var(--color-emerald-400) 30%, transparent)}}.dark\:bg-emerald-500{background-color:var(--color-emerald-500)}.dark\:bg-emerald-700{background-color:var(--color-emerald-700)}.dark\:bg-emerald-900\/50{background-color:#004e3b80}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-900\/50{background-color:color-mix(in oklab, var(--color-emerald-900) 50%, transparent)}}.dark\:bg-emerald-950{background-color:var(--color-emerald-950)}.dark\:bg-fuchsia-600{background-color:var(--color-fuchsia-600)}.dark\:bg-indigo-400{background-color:var(--color-indigo-400)}.dark\:bg-red-400{background-color:var(--color-red-400)}.dark\:bg-red-950{background-color:var(--color-red-950)}.dark\:bg-sky-400{background-color:var(--color-sky-400)}.dark\:bg-sky-950{background-color:var(--color-sky-950)}.dark\:bg-stone-500{background-color:var(--color-stone-500)}.dark\:bg-stone-600{background-color:var(--color-stone-600)}.dark\:bg-stone-700{background-color:var(--color-stone-700)}.dark\:bg-stone-800{background-color:var(--color-stone-800)}.dark\:bg-stone-800\/60{background-color:#29252499}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stone-800\/60{background-color:color-mix(in oklab, var(--color-stone-800) 60%, transparent)}}.dark\:bg-stone-900{background-color:var(--color-stone-900)}.dark\:bg-stone-950{background-color:var(--color-stone-950)}.dark\:bg-stone-950\/30{background-color:#0c0a094d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stone-950\/30{background-color:color-mix(in oklab, var(--color-stone-950) 30%, transparent)}}.dark\:bg-stone-950\/40{background-color:#0c0a0966}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stone-950\/40{background-color:color-mix(in oklab, var(--color-stone-950) 40%, transparent)}}.dark\:bg-teal-600{background-color:var(--color-teal-600)}.dark\:bg-violet-500{background-color:var(--color-violet-500)}.dark\:text-amber-300{color:var(--color-amber-300)}.dark\:text-amber-400{color:var(--color-amber-400)}.dark\:text-emerald-200{color:var(--color-emerald-200)}.dark\:text-emerald-300{color:var(--color-emerald-300)}.dark\:text-emerald-400{color:var(--color-emerald-400)}.dark\:text-red-300{color:var(--color-red-300)}.dark\:text-red-400{color:var(--color-red-400)}.dark\:text-sky-200{color:var(--color-sky-200)}.dark\:text-sky-300{color:var(--color-sky-300)}.dark\:text-stone-100{color:var(--color-stone-100)}.dark\:text-stone-200{color:var(--color-stone-200)}.dark\:text-stone-300{color:var(--color-stone-300)}.dark\:text-stone-400{color:var(--color-stone-400)}.dark\:text-stone-500{color:var(--color-stone-500)}.dark\:text-stone-950{color:var(--color-stone-950)}.dark\:text-violet-300{color:var(--color-violet-300)}.dark\:text-white{color:var(--color-white)}.dark\:decoration-stone-500\/50{text-decoration-color:#79716b80}@supports (color:color-mix(in lab, red, red)){.dark\:decoration-stone-500\/50{-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-500) 50%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-500) 50%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-500) 50%, transparent);text-decoration-color:color-mix(in oklab, var(--color-stone-500) 50%, transparent)}}.dark\:decoration-stone-500\/70{text-decoration-color:#79716bb3}@supports (color:color-mix(in lab, red, red)){.dark\:decoration-stone-500\/70{-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-500) 70%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-500) 70%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-stone-500) 70%, transparent);text-decoration-color:color-mix(in oklab, var(--color-stone-500) 70%, transparent)}}.dark\:ring-stone-900{--tw-ring-color:var(--color-stone-900)}.dark\:ring-offset-stone-950{--tw-ring-offset-color:var(--color-stone-950)}@media (hover:hover){.dark\:hover\:border-stone-500:hover{border-color:var(--color-stone-500)}.dark\:hover\:border-stone-600:hover{border-color:var(--color-stone-600)}.dark\:hover\:bg-emerald-400:hover{background-color:var(--color-emerald-400)}.dark\:hover\:bg-emerald-950:hover{background-color:var(--color-emerald-950)}.dark\:hover\:bg-red-950:hover{background-color:var(--color-red-950)}.dark\:hover\:bg-stone-700:hover{background-color:var(--color-stone-700)}.dark\:hover\:bg-stone-800:hover{background-color:var(--color-stone-800)}.dark\:hover\:bg-stone-800\/40:hover{background-color:#29252466}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-stone-800\/40:hover{background-color:color-mix(in oklab, var(--color-stone-800) 40%, transparent)}}.dark\:hover\:text-stone-300:hover{color:var(--color-stone-300)}.dark\:hover\:text-white:hover{color:var(--color-white)}}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="robots" content="noindex" />
|
|
7
7
|
<link rel="icon" href="/logo.png" type="image/png" />
|
|
8
8
|
<title>hammerkit</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-BNq9j5Jo.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DP3_hKOe.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
|
@@ -37,8 +37,9 @@ function buildEnvironmentVariables(envs, environment, context) {
|
|
|
37
37
|
}
|
|
38
38
|
else if (value.includes('${')) {
|
|
39
39
|
const interpolated = interpolate(value, envs, environment, context, fromProcess);
|
|
40
|
-
if (interpolated.missing) {
|
|
41
|
-
|
|
40
|
+
if (interpolated.missing.length > 0) {
|
|
41
|
+
const [name] = interpolated.missing;
|
|
42
|
+
replacements.push({ key, name, available: false, value: null, missing: interpolated.missing });
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
44
45
|
variables[key] = interpolated.value;
|
|
@@ -53,13 +54,15 @@ function buildEnvironmentVariables(envs, environment, context) {
|
|
|
53
54
|
exports.buildEnvironmentVariables = buildEnvironmentVariables;
|
|
54
55
|
// Each `${NAME}` comes from the process environment or a .env file, else from a
|
|
55
56
|
// literal value of the same build file / task `envs`, else from its
|
|
56
|
-
// `:-default`. A reference without any of them is missing.
|
|
57
|
+
// `:-default`. A reference without any of them is missing; each is listed once.
|
|
57
58
|
function interpolate(value, envs, environment, context, fromProcess) {
|
|
58
|
-
|
|
59
|
+
const missing = [];
|
|
59
60
|
const result = value.replace(INTERPOLATION, (match, name, fallback) => {
|
|
60
61
|
const resolved = resolveReference(name, environment, context, fromProcess) ?? getLiteral(envs, name) ?? fallback ?? null;
|
|
61
62
|
if (resolved === null) {
|
|
62
|
-
|
|
63
|
+
if (!missing.includes(name)) {
|
|
64
|
+
missing.push(name);
|
|
65
|
+
}
|
|
63
66
|
return match;
|
|
64
67
|
}
|
|
65
68
|
return resolved;
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isRunSourceEnv = exports.RUN_SOURCE_ENVS = void 0;
|
|
4
4
|
// The variables a server sets for the process of a run, from what the run is from (see
|
|
5
5
|
// src/server/run-source-environment.ts). Nothing else sets them: the operator's `runs.env`
|
|
6
|
-
// can't name them, and a run that isn't from that source has none of them.
|
|
6
|
+
// can't name them, and a run that isn't from that source has none of them. `validate` reads
|
|
7
|
+
// this list too, so an env that reads one of them isn't a variable set nowhere.
|
|
7
8
|
exports.RUN_SOURCE_ENVS = [
|
|
8
9
|
'HAMMERKIT_RUN_REPO',
|
|
9
10
|
'HAMMERKIT_RUN_REF',
|
|
@@ -16,7 +16,7 @@ stateKey = work.state.current.stateKey) {
|
|
|
16
16
|
const cacheDir = (0, get_cache_directory_1.getCacheDirectory)((0, work_instance_id_1.getWorkInstanceId)(work));
|
|
17
17
|
const { stats } = await (0, get_work_cache_stats_1.getWorkItemCacheStats)(work, environment);
|
|
18
18
|
await (0, cache_metadata_1.writeCacheMetadata)(environment, work, stats, (0, work_task_cache_description_1.getWorkTaskCacheDescription)(work));
|
|
19
|
-
await work.runtime.archive(environment, cacheDir, stateKey ?? undefined);
|
|
19
|
+
await work.runtime.archive(environment, cacheDir, { stateKey: stateKey ?? undefined });
|
|
20
20
|
return cacheDir;
|
|
21
21
|
}
|
|
22
22
|
exports.archiveTaskEntry = archiveTaskEntry;
|
|
@@ -18,23 +18,76 @@ const MAX_TIMER_MS = 2 ** 31 - 1;
|
|
|
18
18
|
// An abort signal that follows `parent` and additionally fires after `timeout`
|
|
19
19
|
// ms, so a task deadline reuses the runtimes' existing abort/cleanup path. A
|
|
20
20
|
// timeout beyond what a timer can wait (about 24.8 days) sets no deadline.
|
|
21
|
+
// `pause` stops the clock and `resume` starts it again with what was left, so a
|
|
22
|
+
// wait that is not the task's to count (its pod refused by the quota) does not use it.
|
|
23
|
+
// The pauses together may last `timeout` as well: then it fires and `waitedOut` says so.
|
|
21
24
|
function withDeadline(parent, timeout) {
|
|
22
25
|
const controller = new AbortController();
|
|
23
|
-
let expired = false;
|
|
24
26
|
const parentListener = (0, abort_event_1.listenOnAbort)(parent, () => controller.abort());
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const limit = timeout !== null && timeout <= MAX_TIMER_MS ? timeout : null;
|
|
28
|
+
// what is left of the time to run, and of the time to wait in pauses
|
|
29
|
+
let left = limit ?? 0;
|
|
30
|
+
let pauseLeft = limit ?? 0;
|
|
31
|
+
let paused = false;
|
|
32
|
+
let closed = false;
|
|
33
|
+
let ended = null;
|
|
34
|
+
let since = performance.now();
|
|
35
|
+
let timer = null;
|
|
36
|
+
// ends the current stretch: what it took comes off its budget
|
|
37
|
+
const stopClock = () => {
|
|
38
|
+
if (timer) {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
timer = null;
|
|
41
|
+
}
|
|
42
|
+
if (limit === null || ended) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const took = performance.now() - since;
|
|
46
|
+
if (paused) {
|
|
47
|
+
pauseLeft = Math.min(limit, Math.max(0, pauseLeft - took));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
left = Math.min(limit, Math.max(0, left - took));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const startClock = () => {
|
|
54
|
+
since = performance.now();
|
|
55
|
+
if (limit === null || controller.signal.aborted) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const end = paused ? 'waited-out' : 'expired';
|
|
59
|
+
timer = setTimeout(() => {
|
|
60
|
+
timer = null;
|
|
61
|
+
ended = end;
|
|
29
62
|
controller.abort();
|
|
30
|
-
},
|
|
63
|
+
}, paused ? pauseLeft : left);
|
|
64
|
+
};
|
|
65
|
+
startClock();
|
|
31
66
|
return {
|
|
32
67
|
signal: controller.signal,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
68
|
+
// it ran for its timeout
|
|
69
|
+
expired: () => ended === 'expired',
|
|
70
|
+
// its pauses together lasted its timeout
|
|
71
|
+
waitedOut: () => ended === 'waited-out',
|
|
72
|
+
pause() {
|
|
73
|
+
if (closed || paused || ended) {
|
|
74
|
+
return;
|
|
37
75
|
}
|
|
76
|
+
stopClock();
|
|
77
|
+
paused = true;
|
|
78
|
+
startClock();
|
|
79
|
+
},
|
|
80
|
+
resume() {
|
|
81
|
+
if (closed || !paused || ended) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
stopClock();
|
|
85
|
+
paused = false;
|
|
86
|
+
startClock();
|
|
87
|
+
},
|
|
88
|
+
clear() {
|
|
89
|
+
stopClock();
|
|
90
|
+
closed = true;
|
|
38
91
|
parentListener.close();
|
|
39
92
|
},
|
|
40
93
|
};
|
|
@@ -35,7 +35,8 @@ async function restoreCache(environment, path, workTree) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
exports.restoreCache = restoreCache;
|
|
38
|
-
|
|
38
|
+
// `only`: the paths of the outputs to archive of a task, every one when left out
|
|
39
|
+
function* getArchivePaths(task, path, only) {
|
|
39
40
|
if (task.type === 'container-service') {
|
|
40
41
|
for (const volume of task.volumes.filter((v) => !v.inherited)) {
|
|
41
42
|
yield {
|
|
@@ -59,6 +60,9 @@ function* getArchivePaths(task, path) {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
for (const { generate, rel } of generates) {
|
|
63
|
+
if (only && !only.includes(generate.path)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
62
66
|
let generateId = rel.split(path_1.posix.sep).join('-');
|
|
63
67
|
if (holders.get(generateId) !== rel) {
|
|
64
68
|
generateId += '-' + (0, crypto_1.createHash)('sha256').update(rel).digest('hex').slice(0, 12);
|
|
@@ -117,19 +117,31 @@ dependents = null) {
|
|
|
117
117
|
daemon: options.daemon,
|
|
118
118
|
publishPorts: false,
|
|
119
119
|
waitForReady: true,
|
|
120
|
-
onQuotaRefused: (refused) =>
|
|
120
|
+
onQuotaRefused: (refused) => {
|
|
121
|
+
// the timeout counts the time it runs, not its wait for room under the quota;
|
|
122
|
+
// that wait may last as long as the timeout in all, besides QUOTA_TIMEOUT
|
|
123
|
+
if (refused) {
|
|
124
|
+
deadline.pause();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
deadline.resume();
|
|
128
|
+
}
|
|
129
|
+
options.processManager.quotaRefused(work, refused);
|
|
130
|
+
},
|
|
121
131
|
});
|
|
122
132
|
}
|
|
123
133
|
finally {
|
|
124
134
|
deadline.clear();
|
|
125
135
|
}
|
|
126
|
-
if (deadline.expired() && timeout !== null) {
|
|
136
|
+
if ((deadline.expired() || deadline.waitedOut()) && timeout !== null) {
|
|
127
137
|
// the runtime saw an abort and cleaned up; report it as a failure
|
|
128
138
|
// (never a cancellation) and stop the run like any failing task
|
|
129
139
|
work.state.set({
|
|
130
140
|
type: 'error',
|
|
131
141
|
stateKey: cacheState.stateKey,
|
|
132
|
-
errorMessage:
|
|
142
|
+
errorMessage: deadline.waitedOut()
|
|
143
|
+
? `gave up waiting for room under the quota of the namespace after ${(0, units_1.formatDuration)(timeout)}, its timeout`
|
|
144
|
+
: `timed out after ${(0, units_1.formatDuration)(timeout)}`,
|
|
133
145
|
});
|
|
134
146
|
if (!options.watch) {
|
|
135
147
|
environment.abortCtrl.abort();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The commands of a run in the runner of a sandbox (see kubernetes/sandbox-runner.ts), as the
|
|
4
|
+
* process of the run and the registry of the server know them. A command runs apart from the
|
|
5
|
+
* process that started it, with its output and exit code in a directory of the sandbox's
|
|
6
|
+
* files, so a run that resumes after a restart of the server takes it up again.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isRunnerCommandsPath = exports.createRunnerCommands = exports.MAX_OUTPUT_COMMANDS = exports.COMMAND_ID_PATTERN = exports.RUNNER_COMMANDS_DIRECTORY = void 0;
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
// Where the directories of the commands are, relative to the root of the sandbox's files:
|
|
12
|
+
// hammerkit's run state, which changes, pushes, the files API and the sources of tasks leave out
|
|
13
|
+
exports.RUNNER_COMMANDS_DIRECTORY = '.hammerkit/commands';
|
|
14
|
+
// the name of the directory of a run's commands, and of each command in it
|
|
15
|
+
exports.COMMAND_ID_PATTERN = /^[0-9a-f]{24}$/;
|
|
16
|
+
// the commands of a run the registry keeps a record of; past it, the records of the commands
|
|
17
|
+
// that ended make way
|
|
18
|
+
exports.MAX_OUTPUT_COMMANDS = 1000;
|
|
19
|
+
function createRunnerCommands(options = {}) {
|
|
20
|
+
// a task of a run that resumes goes on with the execution it was at: the one in flight when
|
|
21
|
+
// the server stopped, or the last one, which ended
|
|
22
|
+
const executions = new Map();
|
|
23
|
+
for (const record of Object.values(options.resumed ?? {})) {
|
|
24
|
+
executions.set(record.task, Math.max(executions.get(record.task) ?? 0, record.execution));
|
|
25
|
+
}
|
|
26
|
+
return { ...options, executions, inUse: new Set() };
|
|
27
|
+
}
|
|
28
|
+
exports.createRunnerCommands = createRunnerCommands;
|
|
29
|
+
// Whether a path is in the directory of the commands of the sandbox whose files are at `root`:
|
|
30
|
+
// only that one, at the root of the files, not a folder of the same name deeper in them
|
|
31
|
+
function isRunnerCommandsPath(path, root) {
|
|
32
|
+
const directory = (0, path_1.join)(root, ...exports.RUNNER_COMMANDS_DIRECTORY.split('/'));
|
|
33
|
+
return path === directory || path.startsWith(`${directory}${path_1.sep}`);
|
|
34
|
+
}
|
|
35
|
+
exports.isRunnerCommandsPath = isRunnerCommandsPath;
|
|
36
|
+
//# sourceMappingURL=runner-commands.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFileContext = void 0;
|
|
4
|
+
const promises_1 = require("stream/promises");
|
|
4
5
|
const fs_1 = require("fs");
|
|
5
6
|
const path_1 = require("path");
|
|
6
7
|
const chokidar_1 = require("chokidar");
|
|
@@ -58,14 +59,10 @@ function getFileContext(cwd) {
|
|
|
58
59
|
writeFile(path, content) {
|
|
59
60
|
return handleCallback((cb) => (0, fs_1.writeFile)(getAbsolutePath(cwd, path), content, cb));
|
|
60
61
|
},
|
|
62
|
+
// a pipeline, so that an error of the stream (a limit it runs into, a broken source) rejects
|
|
63
|
+
// the write as well, and the file is closed
|
|
61
64
|
async writeStream(path, stream) {
|
|
62
|
-
|
|
63
|
-
await new Promise((resolve, reject) => {
|
|
64
|
-
stream
|
|
65
|
-
.pipe(writeStream)
|
|
66
|
-
.on('error', (err) => reject(err))
|
|
67
|
-
.on('close', () => resolve());
|
|
68
|
-
});
|
|
65
|
+
await (0, promises_1.pipeline)(stream, (0, fs_1.createWriteStream)(path));
|
|
69
66
|
},
|
|
70
67
|
createWriteStream(path) {
|
|
71
68
|
return (0, fs_1.createWriteStream)(path);
|
package/dist/harness/connect.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHarnessEnvironment = exports.connectSandbox = exports.connectServer = exports.hasShell = exports.harnessOptionsFromEnv = exports.DEFAULT_SHELL_TASK = void 0;
|
|
3
|
+
exports.getHarnessEnvironment = exports.reuseSandbox = exports.connectSandbox = exports.connectServer = exports.hasShell = exports.harnessOptionsFromEnv = exports.DEFAULT_SHELL_TASK = void 0;
|
|
4
4
|
const get_file_context_1 = require("../file/get-file-context");
|
|
5
5
|
const log_1 = require("../log");
|
|
6
6
|
const work_item_status_1 = require("../planner/work-item-status");
|
|
7
7
|
const host_config_1 = require("../remote/host-config");
|
|
8
8
|
const redact_1 = require("../utils/redact");
|
|
9
9
|
const empty_writable_1 = require("../utils/empty-writable");
|
|
10
|
-
const token_source_1 = require("../remote/token-source");
|
|
11
10
|
const bundle_1 = require("../remote/bundle");
|
|
12
11
|
const sandbox_client_1 = require("./sandbox-client");
|
|
13
12
|
exports.DEFAULT_SHELL_TASK = 'sh';
|
|
@@ -34,7 +33,9 @@ exports.hasShell = hasShell;
|
|
|
34
33
|
* The registered server a harness works on and the published version it runs, checked:
|
|
35
34
|
* what the clients need to list the tasks of the version before they take a sandbox.
|
|
36
35
|
*/
|
|
37
|
-
async function connectServer(environment, options
|
|
36
|
+
async function connectServer(environment, options,
|
|
37
|
+
// where the connection says that it reconnects; stderr when left out
|
|
38
|
+
say) {
|
|
38
39
|
const config = await (0, host_config_1.readHostConfig)(environment);
|
|
39
40
|
const name = (0, host_config_1.chooseServer)(config, options.server || undefined, 'with HAMMERKIT_SERVER or --server');
|
|
40
41
|
if (!options.build) {
|
|
@@ -45,11 +46,13 @@ async function connectServer(environment, options) {
|
|
|
45
46
|
throw new Error(`${options.build} is not the hash of a published version (sha256:...), name it as hammerkit remote publish printed it (HAMMERKIT_BUILD or --build)`);
|
|
46
47
|
}
|
|
47
48
|
const server = (0, host_config_1.getRegisteredServer)(config, name);
|
|
48
|
-
return { name, connection:
|
|
49
|
+
return { name, connection: (0, sandbox_client_1.getServerConnection)(environment, name, server, say), build: options.build };
|
|
49
50
|
}
|
|
50
51
|
exports.connectServer = connectServer;
|
|
51
|
-
async function connectSandbox(environment, options, log
|
|
52
|
-
|
|
52
|
+
async function connectSandbox(environment, options, log) {
|
|
53
|
+
// the environment of a harness that loads hammerkit as a plugin writes nowhere: what the
|
|
54
|
+
// connection says goes where the harness shows what happens
|
|
55
|
+
const { name, connection, build } = await connectServer(environment, options, log);
|
|
53
56
|
let sandbox;
|
|
54
57
|
if (options.sandbox) {
|
|
55
58
|
sandbox = await sandbox_client_1.SandboxClient.get(connection, options.sandbox);
|
|
@@ -57,11 +60,11 @@ async function connectSandbox(environment, options, log = () => undefined) {
|
|
|
57
60
|
else if (options.repo && options.ref) {
|
|
58
61
|
sandbox = await reuseSandbox(connection, options.repo, options.ref);
|
|
59
62
|
if (sandbox) {
|
|
60
|
-
log(`took sandbox ${sandbox.id} of ${sandbox.repo} at ${sandbox.commit} on ${name}, it had no changes`);
|
|
63
|
+
log?.(`took sandbox ${sandbox.id} of ${sandbox.repo} at ${sandbox.commit} on ${name}, it had no changes`);
|
|
61
64
|
}
|
|
62
65
|
else {
|
|
63
66
|
sandbox = await sandbox_client_1.SandboxClient.create(connection, options.repo, options.ref);
|
|
64
|
-
log(`created sandbox ${sandbox.id} of ${sandbox.repo} at ${sandbox.commit} on ${name}, ` +
|
|
67
|
+
log?.(`created sandbox ${sandbox.id} of ${sandbox.repo} at ${sandbox.commit} on ${name}, ` +
|
|
65
68
|
`set HAMMERKIT_SANDBOX=${sandbox.id} to come back to it`);
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -87,6 +90,7 @@ async function reuseSandbox(connection, repo, ref) {
|
|
|
87
90
|
}
|
|
88
91
|
return undefined;
|
|
89
92
|
}
|
|
93
|
+
exports.reuseSandbox = reuseSandbox;
|
|
90
94
|
// What hammerkit needs of its environment to read the host config and the sign-in, for a
|
|
91
95
|
// harness that loads it as a plugin rather than through the command line.
|
|
92
96
|
function getHarnessEnvironment(cwd = process.cwd()) {
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Reconnecting = exports.showUrl = exports.RECONNECT_TIMING = void 0;
|
|
4
|
+
const http_1 = require("../server/http");
|
|
5
|
+
const units_1 = require("../utils/units");
|
|
6
|
+
// a restart of the server takes a few minutes while its new pod starts
|
|
7
|
+
exports.RECONNECT_TIMING = { windowMs: 10 * 60000, firstDelayMs: 1000, maxDelayMs: 15000 };
|
|
8
|
+
// what a proxy or the server answers while the server is away or shuts down
|
|
9
|
+
const AWAY_STATUSES = [502, 503, 504];
|
|
10
|
+
// the call never got to the server. A connect timeout is one: the connection was never
|
|
11
|
+
// made, so nothing of the request was sent.
|
|
12
|
+
const NOT_SENT = ['ECONNREFUSED', 'EAI_AGAIN', 'ENETUNREACH', 'EHOSTUNREACH', 'UND_ERR_CONNECT_TIMEOUT'];
|
|
13
|
+
// the connection broke or timed out, maybe after the server took the call
|
|
14
|
+
const LOST = [
|
|
15
|
+
'ECONNRESET',
|
|
16
|
+
'ECONNABORTED',
|
|
17
|
+
'EPIPE',
|
|
18
|
+
'ETIMEDOUT',
|
|
19
|
+
'UND_ERR_SOCKET',
|
|
20
|
+
'UND_ERR_HEADERS_TIMEOUT',
|
|
21
|
+
'UND_ERR_BODY_TIMEOUT',
|
|
22
|
+
];
|
|
23
|
+
// The codes of the error a fetch failed with: node's fetch keeps it as the cause, with one
|
|
24
|
+
// error for each address it tried when a name has several.
|
|
25
|
+
function failureCodes(e) {
|
|
26
|
+
if (e instanceof Error && e.name === 'TimeoutError') {
|
|
27
|
+
return ['ETIMEDOUT'];
|
|
28
|
+
}
|
|
29
|
+
const cause = e?.cause;
|
|
30
|
+
const codes = cause?.errors?.length ? cause.errors.map((error) => error?.code) : [cause?.code];
|
|
31
|
+
return codes.map((code) => (typeof code === 'string' ? code : ''));
|
|
32
|
+
}
|
|
33
|
+
function isAway(response) {
|
|
34
|
+
return AWAY_STATUSES.includes(response.status);
|
|
35
|
+
}
|
|
36
|
+
function mayRepeat(attempt, repeat) {
|
|
37
|
+
if ('response' in attempt) {
|
|
38
|
+
return repeat === 'always'
|
|
39
|
+
? isAway(attempt.response)
|
|
40
|
+
: attempt.response.status === 503 && attempt.response.headers.get(http_1.RETRY_HEADER) === 'safe';
|
|
41
|
+
}
|
|
42
|
+
const codes = failureCodes(attempt.error);
|
|
43
|
+
return repeat === 'always'
|
|
44
|
+
? codes.some((code) => NOT_SENT.includes(code) || LOST.includes(code))
|
|
45
|
+
: codes.every((code) => NOT_SENT.includes(code));
|
|
46
|
+
}
|
|
47
|
+
// The address of a server as it is said, without a user or password it may hold.
|
|
48
|
+
function showUrl(url) {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = new URL(url);
|
|
51
|
+
if (!parsed.username && !parsed.password) {
|
|
52
|
+
return url;
|
|
53
|
+
}
|
|
54
|
+
parsed.username = '';
|
|
55
|
+
parsed.password = '';
|
|
56
|
+
return url.endsWith('/') ? parsed.toString() : parsed.toString().replace(/\/$/, '');
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return url;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.showUrl = showUrl;
|
|
63
|
+
/**
|
|
64
|
+
* The window of one call: every send of it, a send again after a new token included, waits
|
|
65
|
+
* for the server at most the window, counted from the start of the first try that failed.
|
|
66
|
+
*/
|
|
67
|
+
class Reconnecting {
|
|
68
|
+
constructor(options) {
|
|
69
|
+
this.options = options;
|
|
70
|
+
this.away = false;
|
|
71
|
+
this.delay = options.timing.firstDelayMs;
|
|
72
|
+
}
|
|
73
|
+
// the window ran out
|
|
74
|
+
get exhausted() {
|
|
75
|
+
return this.deadline !== undefined && this.deadline <= Date.now();
|
|
76
|
+
}
|
|
77
|
+
// how long the next try may take: no longer than what is left of the window, once it started
|
|
78
|
+
timeoutMs(own) {
|
|
79
|
+
return this.deadline === undefined ? own : Math.max(1, Math.min(own, this.deadline - Date.now()));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Sends a call until the server answers it, as long as it may be sent again and the server
|
|
83
|
+
* comes back within the window: an answer other than one of a server that is away is the
|
|
84
|
+
* caller's, an error that is no sign of one fails at once.
|
|
85
|
+
*/
|
|
86
|
+
async send(send, repeat) {
|
|
87
|
+
const { url, timing, say, signal, fail } = this.options;
|
|
88
|
+
const shown = showUrl(url);
|
|
89
|
+
for (;;) {
|
|
90
|
+
const started = Date.now();
|
|
91
|
+
const attempt = await send();
|
|
92
|
+
if (!mayRepeat(attempt, repeat)) {
|
|
93
|
+
if ('response' in attempt) {
|
|
94
|
+
if (this.away && !isAway(attempt.response)) {
|
|
95
|
+
this.away = false;
|
|
96
|
+
say?.(`${shown} is back`);
|
|
97
|
+
}
|
|
98
|
+
return attempt.response;
|
|
99
|
+
}
|
|
100
|
+
throw fail(attempt.message);
|
|
101
|
+
}
|
|
102
|
+
const reason = 'response' in attempt ? `${shown} answered ${attempt.response.status}` : attempt.message;
|
|
103
|
+
if ('response' in attempt) {
|
|
104
|
+
await attempt.response.body?.cancel().catch(() => undefined);
|
|
105
|
+
}
|
|
106
|
+
if (timing.windowMs <= 0) {
|
|
107
|
+
// no window: the call is not waited for, so nothing is said about it either
|
|
108
|
+
throw fail(reason);
|
|
109
|
+
}
|
|
110
|
+
const window = (0, units_1.formatDuration)(timing.windowMs);
|
|
111
|
+
this.deadline ?? (this.deadline = started + timing.windowMs);
|
|
112
|
+
if (!this.away) {
|
|
113
|
+
this.away = true;
|
|
114
|
+
say?.(`${reason}, reconnecting for up to ${window}`);
|
|
115
|
+
}
|
|
116
|
+
const left = this.deadline - Date.now();
|
|
117
|
+
if (left <= 0) {
|
|
118
|
+
throw fail(`${shown} did not come back within ${window}: ${reason}`);
|
|
119
|
+
}
|
|
120
|
+
if (signal?.aborted || !(await pause(Math.min(this.delay, left), signal))) {
|
|
121
|
+
throw fail(reason);
|
|
122
|
+
}
|
|
123
|
+
this.delay = Math.min(this.delay * 2, timing.maxDelayMs);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.Reconnecting = Reconnecting;
|
|
128
|
+
// false when the signal ended the pause
|
|
129
|
+
function pause(ms, signal) {
|
|
130
|
+
return new Promise((resolve) => {
|
|
131
|
+
const done = (waited) => {
|
|
132
|
+
clearTimeout(timer);
|
|
133
|
+
signal?.removeEventListener('abort', aborted);
|
|
134
|
+
resolve(waited);
|
|
135
|
+
};
|
|
136
|
+
const aborted = () => done(false);
|
|
137
|
+
const timer = setTimeout(() => done(true), ms);
|
|
138
|
+
signal?.addEventListener('abort', aborted, { once: true });
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=reconnect.js.map
|