eve 0.33.0 → 0.33.2

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 (242) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/src/compiled/.vendor-stamp.json +1 -1
  3. package/dist/src/compiled/@workflow/core/_quickjs-wasi.d.ts +3 -0
  4. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +127 -6
  5. package/dist/src/compiled/@workflow/core/index.js +2 -2
  6. package/dist/src/compiled/@workflow/core/private.d.ts +87 -18
  7. package/dist/src/compiled/@workflow/core/private.js +1 -1
  8. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +15 -1
  9. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +116 -8
  10. package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +36 -1
  11. package/dist/src/compiled/@workflow/core/runtime/quickjs-serde.d.ts +107 -0
  12. package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +5 -14
  13. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +7 -0
  14. package/dist/src/compiled/@workflow/core/runtime/world-compatibility.d.ts +15 -0
  15. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  16. package/dist/src/compiled/@workflow/core/serialization/codec-devalue-vm.d.ts +7 -0
  17. package/dist/src/compiled/@workflow/core/serialization/workflow-vm.d.ts +8 -3
  18. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +23 -0
  19. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  20. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  21. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  22. package/dist/src/compiled/@workflow/world-vercel/index.js +15 -15
  23. package/dist/src/compiled/_chunks/workflow/{attribute-changes-Du5ztewf.js → attribute-changes-6OqdYdi4.js} +2 -2
  24. package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +1 -0
  25. package/dist/src/compiled/_chunks/workflow/functions-CXb61C6h.js +1 -0
  26. package/dist/src/compiled/_chunks/workflow/{functions-ClJbpZhR.js → functions-xMPAeWFr.js} +1 -1
  27. package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +40 -0
  28. package/dist/src/compiled/_chunks/workflow/private-tvMBynnC.js +1 -0
  29. package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +1 -0
  30. package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +1 -0
  31. package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +1 -0
  32. package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +95 -0
  33. package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +15 -0
  34. package/dist/src/compiled/_chunks/workflow/wrapper-CDq65xJV.js +8 -0
  35. package/dist/src/evals/autoevals-client.js +1 -1
  36. package/dist/src/evals/expect/index.js +1 -1
  37. package/dist/src/evals/judge.js +1 -1
  38. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +3 -9
  39. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  40. package/dist/src/execution/durable-session-store.d.ts +5 -0
  41. package/dist/src/execution/durable-session-store.js +1 -1
  42. package/dist/src/execution/parked-delivery-wait.d.ts +8 -0
  43. package/dist/src/execution/parked-delivery-wait.js +1 -1
  44. package/dist/src/execution/route-child-delivery.js +1 -1
  45. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  46. package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -0
  47. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  48. package/dist/src/execution/turn-workflow.js +1 -1
  49. package/dist/src/execution/workflow-entry.js +1 -1
  50. package/dist/src/execution/workflow-steps.d.ts +4 -1
  51. package/dist/src/execution/workflow-steps.js +1 -1
  52. package/dist/src/harness/hitl/approval-input-requests.d.ts +13 -0
  53. package/dist/src/harness/hitl/approval-input-requests.js +1 -0
  54. package/dist/src/harness/hitl/pending-input-resolution.d.ts +51 -0
  55. package/dist/src/harness/hitl/pending-input-resolution.js +1 -0
  56. package/dist/src/harness/hitl/question-input-requests.d.ts +15 -0
  57. package/dist/src/harness/hitl/question-input-requests.js +1 -0
  58. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +10 -0
  59. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -0
  60. package/dist/src/harness/input-requests.d.ts +17 -105
  61. package/dist/src/harness/input-requests.js +1 -1
  62. package/dist/src/harness/pending-input-batches.d.ts +77 -0
  63. package/dist/src/harness/pending-input-batches.js +1 -0
  64. package/dist/src/harness/proxy-input-requests.d.ts +13 -3
  65. package/dist/src/harness/proxy-input-requests.js +1 -1
  66. package/dist/src/harness/session-limit-enforcement.js +1 -1
  67. package/dist/src/harness/tool-loop.js +2 -2
  68. package/dist/src/internal/application/package.js +1 -1
  69. package/dist/src/node_modules/.pnpm/{autoevals@0.0.132_ws@8.21.1_bufferutil@4.1.0_ → autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_}/node_modules/autoevals/jsdist/index.js +1 -1
  70. package/dist/src/setup/scaffold/create/project.js +1 -1
  71. package/dist/src/setup/scaffold/create/web-template.d.ts +9 -0
  72. package/dist/src/setup/scaffold/create/web-template.js +291 -1
  73. package/dist/src/setup/scaffold/index.d.ts +1 -1
  74. package/dist/src/setup/scaffold/update/channels.d.ts +4 -13
  75. package/dist/src/setup/scaffold/update/channels.js +2 -2
  76. package/dist/src/setup/scaffold/update/web-options.d.ts +15 -0
  77. package/dist/src/setup/scaffold/update/web-options.js +1 -0
  78. package/dist/src/setup/vercel-project.js +0 -0
  79. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  80. package/docs/guides/frontend/overview.mdx +31 -10
  81. package/docs/guides/frontend/use-eve-agent-svelte.mdx +37 -15
  82. package/docs/guides/frontend/use-eve-agent-vue.mdx +38 -15
  83. package/docs/tools/human-in-the-loop.md +2 -2
  84. package/package.json +2 -2
  85. package/dist/src/compiled/@workflow/core/correlation-id.d.ts +0 -109
  86. package/dist/src/compiled/@workflow/core/serialization/vm-bundle-entry.d.ts +0 -12
  87. package/dist/src/compiled/_chunks/workflow/dist-CNXUKQCp.js +0 -40
  88. package/dist/src/compiled/_chunks/workflow/env-config-CYoX3muK.js +0 -1
  89. package/dist/src/compiled/_chunks/workflow/private-CiWVdS5v.js +0 -1
  90. package/dist/src/compiled/_chunks/workflow/resume-hook-CT0keOww.js +0 -1
  91. package/dist/src/compiled/_chunks/workflow/run-DBheaFhH.js +0 -1
  92. package/dist/src/compiled/_chunks/workflow/run-id-BdE0MZz9.js +0 -1
  93. package/dist/src/compiled/_chunks/workflow/sleep-BeH4B0Cd.js +0 -1
  94. package/dist/src/compiled/_chunks/workflow/spec-version-C0hBsfu-.js +0 -1
  95. package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +0 -95
  96. package/dist/src/compiled/_chunks/workflow/wait-until-CMX5LUWJ.js +0 -15
  97. package/dist/src/compiled/_chunks/workflow/wrapper-6mlyNCCb.js +0 -8
  98. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/_vendor/partial-json-parser/parser.js +0 -0
  99. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/auth/workload-identity-auth.js +0 -0
  100. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/azure.js +0 -0
  101. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/client.js +0 -0
  102. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/api-promise.js +0 -0
  103. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/error.js +0 -0
  104. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/pagination.js +0 -0
  105. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/resource.js +0 -0
  106. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/streaming.js +0 -0
  107. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/uploads.js +0 -0
  108. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/error.js +0 -0
  109. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/index.js +0 -0
  110. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/decoders/line.js +0 -0
  111. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/detect-platform.js +0 -0
  112. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/errors.js +0 -0
  113. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/headers.js +0 -0
  114. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/parse.js +0 -0
  115. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/formats.js +0 -0
  116. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/stringify.js +0 -0
  117. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/utils.js +0 -0
  118. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/request-options.js +0 -0
  119. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/shims.js +0 -0
  120. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/to-file.js +0 -0
  121. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/tslib.js +0 -0
  122. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/uploads.js +0 -0
  123. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/base64.js +0 -0
  124. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/bytes.js +0 -0
  125. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/env.js +0 -0
  126. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/log.js +0 -0
  127. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/path.js +0 -0
  128. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/query.js +0 -0
  129. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/sleep.js +0 -0
  130. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/uuid.js +0 -0
  131. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/values.js +0 -0
  132. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils.js +0 -0
  133. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -0
  134. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/AssistantStream.js +0 -0
  135. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionRunner.js +0 -0
  136. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionStream.js +0 -0
  137. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -0
  138. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/EventStream.js +0 -0
  139. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ResponsesParser.js +0 -0
  140. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/RunnableFunction.js +0 -0
  141. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/Util.js +0 -0
  142. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/chatCompletionUtils.js +0 -0
  143. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/parser.js +0 -0
  144. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/responses/ResponseStream.js +0 -0
  145. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/admin.js +0 -0
  146. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/admin-api-keys.js +0 -0
  147. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/audit-logs.js +0 -0
  148. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/certificates.js +0 -0
  149. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/data-retention.js +0 -0
  150. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/groups.js +0 -0
  151. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/roles.js +0 -0
  152. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/users.js +0 -0
  153. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/invites.js +0 -0
  154. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/organization.js +0 -0
  155. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/api-keys.js +0 -0
  156. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/certificates.js +0 -0
  157. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/data-retention.js +0 -0
  158. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/groups.js +0 -0
  159. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/roles.js +0 -0
  160. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +0 -0
  161. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/model-permissions.js +0 -0
  162. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/projects.js +0 -0
  163. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/rate-limits.js +0 -0
  164. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/roles.js +0 -0
  165. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/service-accounts.js +0 -0
  166. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +0 -0
  167. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/roles.js +0 -0
  168. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/users.js +0 -0
  169. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/roles.js +0 -0
  170. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/spend-alerts.js +0 -0
  171. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/usage.js +0 -0
  172. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/roles.js +0 -0
  173. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/users.js +0 -0
  174. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/audio.js +0 -0
  175. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/speech.js +0 -0
  176. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/transcriptions.js +0 -0
  177. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/translations.js +0 -0
  178. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/batches.js +0 -0
  179. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/assistants.js +0 -0
  180. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/beta.js +0 -0
  181. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/chatkit.js +0 -0
  182. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/sessions.js +0 -0
  183. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/threads.js +0 -0
  184. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/realtime.js +0 -0
  185. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/sessions.js +0 -0
  186. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/transcription-sessions.js +0 -0
  187. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/messages.js +0 -0
  188. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/runs.js +0 -0
  189. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/steps.js +0 -0
  190. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/threads.js +0 -0
  191. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/chat.js +0 -0
  192. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/completions.js +0 -0
  193. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/index.js +0 -0
  194. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/messages.js +0 -0
  195. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/index.js +0 -0
  196. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/completions.js +0 -0
  197. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/containers.js +0 -0
  198. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/content.js +0 -0
  199. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/files.js +0 -0
  200. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/conversations.js +0 -0
  201. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/items.js +0 -0
  202. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/embeddings.js +0 -0
  203. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/evals.js +0 -0
  204. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/output-items.js +0 -0
  205. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/runs.js +0 -0
  206. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/files.js +0 -0
  207. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/alpha.js +0 -0
  208. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/graders.js +0 -0
  209. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +0 -0
  210. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +0 -0
  211. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -0
  212. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -0
  213. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -0
  214. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/methods.js +0 -0
  215. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/grader-models.js +0 -0
  216. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/graders.js +0 -0
  217. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/images.js +0 -0
  218. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/index.js +0 -0
  219. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/models.js +0 -0
  220. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/moderations.js +0 -0
  221. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/calls.js +0 -0
  222. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/client-secrets.js +0 -0
  223. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/realtime.js +0 -0
  224. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-items.js +0 -0
  225. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-tokens.js +0 -0
  226. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/responses.js +0 -0
  227. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/shared.js +0 -0
  228. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/content.js +0 -0
  229. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/skills.js +0 -0
  230. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/content.js +0 -0
  231. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/versions.js +0 -0
  232. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/parts.js +0 -0
  233. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/uploads.js +0 -0
  234. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/file-batches.js +0 -0
  235. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/files.js +0 -0
  236. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/vector-stores.js +0 -0
  237. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/videos.js +0 -0
  238. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/index.js +0 -0
  239. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/webhooks.js +0 -0
  240. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks.js +0 -0
  241. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/streaming.js +0 -0
  242. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/version.js +0 -0
@@ -0,0 +1,15 @@
1
+ import{o as e,t}from"./rolldown-runtime-DaDcL9Zw.js";import{A as n,D as r,O as i,S as a,a as o,b as s,c,g as l,h as u,i as d,k as f,l as p,m,p as h,s as g,t as _,u as v}from"./dist-CRTn4Sg8.js";import{a as y,c as b,l as ee,n as te,t as ne}from"./private-tvMBynnC.js";import"./dist-tJoQXAF6.js";import{$n as re,At as ie,Dt as ae,Et as oe,Ft as x,Gt as se,Hn as S,Jn as ce,Ln as C,On as w,Ot as le,Pn as ue,a as T,er as de,hn as E,jt as fe,kn as D,mn as pe,n as me,o as he,t as ge,tr as _e,wt as ve}from"./node-Smb57EnG.js";import{types as O}from"node:util";import{AsyncLocalStorage as ye}from"node:async_hooks";function be(e,t){if(typeof t!=`string`)return null;let[n,r,...i]=t.split(`//`);if(n!==e||!r||i.length===0)return null;let a=i.join(`//`),o=a.split(`/`).at(-1)??``,s=``;return s=r.startsWith(`./`)?r.split(`/`).at(-1)??``:(r.split(`@`).slice(0,-1).join(`@`)||r.split(`@`)[0])?.split(`/`).at(-1)??``,[`default`,`__default`].includes(o)&&s&&(o=s),{shortName:o,moduleSpecifier:r,functionName:a}}function xe(e){return be(`workflow`,e)}function Se(e){return be(`step`,e)}function Ce(e){return Oe(Se(e),e)}function we(e){return Oe(xe(e),e)}function Te(e){return xe(e)?.shortName??De(`workflow`,e)??e}function Ee(e){return Se(e)?.shortName??De(`step`,e)??e}function De(e,t){if(!t.startsWith(`${e}--`))return null;let n=t.split(`--`).filter(Boolean),r=n.at(-1)?.split(`-`).filter(Boolean).at(-1)??``;if([`default`,`__default`].includes(r)){let t=n.at(-2)?.split(`-`).filter(Boolean).at(-1);t&&t!==e&&(r=t)}return r||null}function Oe(e,t){return e?`${e.shortName} (${e.moduleSpecifier})`:t}const ke=(()=>{let e=globalThis.process;return e?.env?e.env.FORCE_COLOR&&e.env.FORCE_COLOR!==`0`?!0:!e.env.NO_COLOR&&!!e.stdout?.isTTY:!1})(),Ae=(e,t)=>n=>ke?`\x1b[${e}m${n}\x1b[${t}m`:n,k={bold:Ae(1,22),dim:Ae(2,22),italic:Ae(3,23),red:Ae(31,39),blue:Ae(34,39),cyan:Ae(36,39),yellow:Ae(33,39),magenta:Ae(35,39)},je={info:k.blue,help:k.cyan,warn:k.yellow,error:k.red};function Me(e){let t=Array.isArray(e)?e.join(`
2
+ `):e;return je.info(`${k.bold(`hint:`)} ${t}`)}function Ne(e){return je.info(`${k.bold(`docs:`)} ${e}`)}function Pe(e){return k.italic(`${k.dim("`")}${e}${k.dim("`")}`)}function A(e){return k.dim(e)}function Fe(e){return k.bold(e)}function Ie(e){return k.red(e)}function Le(e){return k.magenta(e)}function Re(e,t){let n=[e];return t.forEach((e,r)=>{let i=e.split(`
3
+ `),a=r===t.length-1,o=a?`╰▶ `:`├▶ `,s=a?` `:`│ `,c=i.map((e,t)=>`${t===0?o:s}${e}`);n.push(...c)}),n.join(`
4
+ `)}const ze=`$rootRunId`,Be=`$parentRunId`,Ve=fe(D({key:S(),value:de([S(),ae()])}));var He=class extends Error{constructor(e){super(e),this.name=`AttributeValidationError`}};const Ue=e=>new TextEncoder().encode(e).length;function We(e,t={}){return typeof e==`string`?e.length===0?new He(`Attribute key must not be empty`):e.length>256?new He(`Attribute key length ${e.length} exceeds limit 256: ${JSON.stringify(e.slice(0,32))}…`):!t.allowReservedAttributes&&e.startsWith(`$`)?new He(`Attribute key ${JSON.stringify(e)} starts with reserved prefix "\$" — that namespace is reserved for framework/library code. Set { allowReservedAttributes: true } only if your caller is framework-level.`):null:new He(`Attribute key must be a string, got ${typeof e}`)}function Ge(e){if(e===null)return null;if(typeof e!=`string`)return new He(`Attribute value must be a string or null, got ${typeof e}`);let t=Ue(e);return t>256?new He(`Attribute value byte length ${t} exceeds limit 256`):null}function Ke(e,t={}){let n=new Set,r=t.existingKeys===void 0?void 0:t.existingKeys instanceof Set?t.existingKeys:new Set(t.existingKeys),i=0,a=0;for(let o of e){let e=We(o.key,{allowReservedAttributes:t.allowReservedAttributes});if(e)throw e;let s=Ge(o.value);if(s)throw s;if(n.has(o.key))throw new He(`Attribute key ${JSON.stringify(o.key)} appears more than once in the same batch`);n.add(o.key),o.value===null?(r===void 0||r.has(o.key))&&(a+=1):(r===void 0||!r.has(o.key))&&(i+=1)}let o=(r===void 0?0:r.size)+i-a;if(o>64)throw new He(`Run attribute count would exceed limit 64 (post-merge ${o})`)}const j=de([oe(Uint8Array),ie()]),qe=ve([`run_created`,`run_started`,`run_completed`,`run_failed`,`run_cancelled`,`attr_set`,`step_created`,`step_completed`,`step_failed`,`step_retrying`,`step_started`,`hook_created`,`hook_received`,`hook_disposed`,`hook_conflict`,`wait_created`,`wait_completed`]);qe.extract([`run_created`,`run_started`,`run_completed`,`run_failed`,`run_cancelled`]).options;const Je=qe.extract([`run_completed`,`run_failed`,`run_cancelled`]).options;function Ye(e){return Je.includes(e)}qe.extract([`step_created`,`step_completed`,`step_failed`,`step_retrying`,`step_started`]).options,qe.extract([`step_completed`,`step_failed`]).options,qe.extract([`hook_created`,`hook_received`,`hook_disposed`]).options,qe.extract([`hook_disposed`,`hook_received`]).options,qe.extract([`wait_created`,`wait_completed`]).options,qe.extract([`step_created`,`hook_created`,`wait_created`]).options,Object.fromEntries(Object.entries({run_created:`input`,run_started:`input`,run_completed:`output`,run_failed:`error`,step_created:`input`,step_started:`input`,step_completed:`result`,step_failed:`error`,step_retrying:`error`,hook_created:`metadata`,hook_received:`payload`}).map(([e,t])=>[e,[t]]));const M=D({eventType:qe,correlationId:S().optional(),specVersion:w().optional()}),Xe={ttfs:w().optional(),stso:w().optional(),stepCount:w().int().positive().optional(),eventCount:w().int().positive().optional(),rsfs:w().optional(),finalSchedulingReplay:w().optional(),optimizations:fe(S()).optional()},Ze=M.extend({eventType:E(`step_completed`),correlationId:S(),eventData:D({stepName:S().optional(),workflowName:S().optional(),result:j,...Xe})}),Qe=M.extend({eventType:E(`step_failed`),correlationId:S(),eventData:D({stepName:S().optional(),error:j,...Xe})}),$e=M.extend({eventType:E(`step_retrying`),correlationId:S(),eventData:D({stepName:S().optional(),error:j,retryAfter:T().optional()})}),et=M.extend({eventType:E(`step_started`),correlationId:S(),eventData:D({stepName:S().optional(),attempt:w().optional(),workflowName:S().optional(),input:j.optional(),ownerMessageId:S().optional()}).optional()}),tt=M.extend({eventType:E(`step_created`),correlationId:S(),eventData:D({stepName:S(),workflowName:S().optional(),input:j})}),nt=M.extend({eventType:E(`hook_created`),correlationId:S(),eventData:D({token:S(),tokenRetentionUntil:T().optional(),metadata:j.optional(),isWebhook:x().optional(),isSystem:x().optional()})}),rt=M.extend({eventType:E(`hook_received`),correlationId:S(),eventData:D({token:S().optional(),payload:j})}),it=M.extend({eventType:E(`hook_disposed`),correlationId:S(),eventData:D({token:S().optional()}).optional()}),at=M.extend({eventType:E(`hook_conflict`),correlationId:S(),eventData:D({token:S(),conflictingRunId:S().optional()})}),ot=M.extend({eventType:E(`wait_created`),correlationId:S(),eventData:D({resumeAt:T()})}),st=M.extend({eventType:E(`wait_completed`),correlationId:S(),eventData:D({resumeAt:T().optional()}).optional()}),ct=se(`type`,[D({type:E(`workflow`)}),D({type:E(`step`),stepId:S(),attempt:w()})]),lt=M.extend({eventType:E(`attr_set`),correlationId:S().optional(),eventData:D({changes:Ve,writer:ct,allowReservedAttributes:E(!0).optional()})}),ut=M.extend({eventType:E(`run_created`),eventData:D({deploymentId:S(),workflowName:S(),input:j,executionContext:C(S(),ie()).optional(),attributes:C(S(),S()).optional(),allowReservedAttributes:E(!0).optional(),encryptionPublicKey:S().optional()})}),dt=M.extend({eventType:E(`run_started`),eventData:D({input:j.optional(),deploymentId:S().optional(),workflowName:S().optional(),executionContext:C(S(),ie()).optional(),attributes:C(S(),S()).optional(),allowReservedAttributes:E(!0).optional(),encryptionPublicKey:S().optional()}).optional()}),ft=M.extend({eventType:E(`run_completed`),eventData:D({output:j.optional()})}),pt=M.extend({eventType:E(`run_failed`),eventData:D({error:j,errorCode:S().optional()})}),mt=M.extend({eventType:E(`run_cancelled`),eventData:D({cancelReason:S().max(512).optional()}).optional()});se(`eventType`,[ut,dt,ft,pt,mt,lt,tt,Ze,Qe,$e,et,nt,rt,it,ot,st]),se(`eventType`,[ut,dt,ft,pt,mt,lt,tt,Ze,Qe,$e,et,nt,rt,it,at,ot,st]).and(D({runId:S(),eventId:S(),createdAt:T(),occurredAt:T().optional(),specVersion:w().optional(),resumeId:S().optional()}));const ht=ve([`pending`,`running`,`completed`,`failed`,`cancelled`]),gt=ht.extract([`completed`,`failed`,`cancelled`]).options;function _t(e){return gt.includes(e)}const vt=D({runId:S(),status:ht,deploymentId:S(),workflowName:S(),specVersion:w().optional(),executionContext:C(S(),ie()).optional(),input:j.optional(),output:j.optional(),error:j.optional(),errorCode:S().optional(),attributes:C(S(),S()).default({}),encryptionPublicKey:S().optional(),expiredAt:T().optional(),startedAt:T().optional(),completedAt:T().optional(),createdAt:T(),updatedAt:T()});se(`status`,[vt.extend({status:ve([`pending`,`running`]),output:le().optional(),error:le().optional(),completedAt:le().optional()}),vt.extend({status:E(`cancelled`),output:le().optional(),error:le().optional(),completedAt:T()}),vt.extend({status:E(`completed`),output:j,error:le().optional(),completedAt:T()}),vt.extend({status:E(`failed`),output:le().optional(),error:j,completedAt:T()})]),D({runIds:fe(S()).min(1).max(500).refine(e=>new Set(e).size===e.length,{message:`runIds must not contain duplicates`}),cancelReason:S().max(512).optional()});const yt=se(`outcome`,[D({runId:S(),outcome:E(`cancelled`)}),D({runId:S(),outcome:E(`already_cancelled`)}),D({runId:S(),outcome:E(`not_cancellable`),status:S()}),D({runId:S(),outcome:E(`not_found`)}),D({runId:S(),outcome:E(`failed`),code:S(),retryable:x()})]);D({summary:D({requested:w(),cancelled:w(),alreadyCancelled:w(),notCancellable:w(),notFound:w(),failed:w()}),results:fe(yt)});const bt=ve([`pending`,`running`,`completed`,`failed`,`cancelled`]);D({runId:S(),stepId:S(),stepName:S(),status:bt,input:j.optional(),output:j.optional(),error:j.optional(),attempt:w(),startedAt:T().optional(),completedAt:T().optional(),createdAt:T(),updatedAt:T(),retryAfter:T().optional(),specVersion:w().optional()}),bt.extract([`completed`,`failed`,`cancelled`]).options;const xt=ve([`waiting`,`completed`]);D({waitId:S(),runId:S(),status:xt,resumeAt:T().optional(),completedAt:T().optional(),createdAt:T(),updatedAt:T(),specVersion:w().optional()});const St=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?$/,N=ue(e=>typeof e==`string`&&St.test(e)?`${e.replace(` `,`T`)}Z`:e,T()),P=N.nullable().optional(),F=S().nullable().optional(),Ct=x().nullable().optional();D({runId:S(),status:ht,deploymentId:S(),workflowName:S(),specVersion:he().optional(),attributes:C(S(),S()).default({}),createdAt:N,updatedAt:N,startedAt:P,completedAt:P,errorCode:F,workflowCoreVersion:F,workflowEncryptionEnabled:Ct}),D({runId:S(),stepId:S(),stepName:F,status:bt,attempt:w().optional(),createdAt:N,updatedAt:N,startedAt:P,completedAt:P,retryAfter:P,errorCode:F,workflowCoreVersion:F,workflowEncryptionEnabled:Ct,computeInstanceId:F}),D({runId:S(),eventId:S(),eventType:qe,correlationId:F,entityId:F,stepName:F,workflowName:S(),deploymentId:S(),specVersion:he().optional(),runCreatedAt:N,createdAt:N,region:F,vercelId:F,requestId:F,computeInstanceId:F,resumeAt:P,retryAfter:P,errorCode:F,workflowCoreVersion:F,isWebhook:Ct,isSystem:Ct,workflowEncryptionEnabled:Ct}),D({runId:S(),hookId:S(),status:ve([`created`,`received`,`disposed`,`conflict`]),createdAt:N,updatedAt:N,receivedAt:P,disposedAt:P,isWebhook:Ct,isSystem:Ct,workflowCoreVersion:F,workflowEncryptionEnabled:Ct}),D({runId:S(),waitId:S(),status:xt,resumeAt:P,createdAt:N,updatedAt:N,completedAt:P,workflowCoreVersion:F,workflowEncryptionEnabled:Ct}),D({key:S(),runCount:he(),firstSeenAt:T(),lastSeenAt:T()});const wt=new Set;function Tt(e,t){wt.has(e)||(wt.add(e),console.warn(`[workflow] ${t}`))}function Et(e,t,n={}){let r=process.env[e];if(r===void 0||r===``)return t;let{min:i=0,max:a,integer:o=!1}=n,s=Number(r);return!Number.isFinite(s)||o&&!Number.isInteger(s)?(Tt(`${e}=${r}`,`Ignoring ${e}: not a ${o?`finite integer`:`finite number`}; using default ${t}`),t):s<i?(Tt(`${e}=${r}`,`${e} below minimum ${i}; clamped`),i):a!==void 0&&s>a?(Tt(`${e}=${r}`,`${e} above maximum ${a}; clamped`),a):s}S().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_workflow_$/,`Must match __wkf_workflow_ or __{namespace}_wkf_workflow_`),S().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_workflow_.+$/,`Must be a valid queue name with a recognized prefix`);const Dt=S().regex(/^[a-z][a-z0-9]*$/,`Must be lowercase alphanumeric, starting with a letter`);function Ot(e){return e??process.env.WORKFLOW_QUEUE_NAMESPACE??void 0}function kt(e,t){if(e!==`workflow`)throw Error(`Unsupported queue kind: ${e}`);return t===void 0?`__wkf_workflow_`:(Dt.parse(t),`__${t}_wkf_workflow_`)}S().brand().describe(`A stored queue message ID`);const At=C(S(),S()),jt=D({input:_e(),deploymentId:S(),workflowName:S(),specVersion:w(),executionContext:C(S(),ie()).optional(),attributes:C(S(),S()).optional(),allowReservedAttributes:E(!0).optional(),environment:S().optional()}),Mt=D({resumeId:S(),hookId:S(),token:S(),payload:_e(),payloadDigest:S(),deploymentId:S().optional()}),Nt=D({runId:S(),traceCarrier:At.optional(),requestedAt:T().optional(),replayDivergence:D({eventId:S(),count:w().int().positive()}).optional(),preconditionReinvocations:w().int().positive().optional(),serverErrorRetryCount:w().int().optional(),deploymentMismatchRetryCount:w().int().nonnegative().optional(),stepId:S().optional(),stepName:S().optional(),runInput:jt.optional(),hookInput:Mt.optional()}),Pt=D({__healthCheck:E(!0),correlationId:S(),runId:S().optional()});de([Pt,Nt]);const Ft=D({deploymentId:S(),workflowName:S(),runSpecVersion:w().optional(),workflowCoreVersion:S().optional(),traceCarrier:At.optional(),encryptionPublicKey:S().optional(),hookResumeInputVersion:w().optional()}),It=D({hookResumeDedupVersion:w()});D({runId:S(),hookId:S(),token:S(),ownerId:S(),projectId:S(),environment:S(),metadata:j.optional(),createdAt:T(),specVersion:w().optional(),isWebhook:x().optional(),isSystem:x().optional(),tokenRetentionUntil:T().optional(),resumeContext:Ft.optional(),resumeCapabilities:It.optional()});const Lt=pe(()=>de([S(),w(),x(),ae(),fe(Lt),C(S(),Lt)]));D({currentLookbackDays:w(),maxLookbackDays:w(),currentWindowStart:T(),maxWindowStart:T(),upgradeAvailable:x()}),D({message:S(),stack:S().optional(),code:S().optional()});function Rt(e){if(e.length!==26)return!1;for(let t=0;t<10;t++)if(e[t]!==`0`)return!1;for(let t=10;t<26;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}function zt(e){let t=e.indexOf(`_`);return t===-1?e:e.slice(t+1)}function Bt(e){let t=zt(e);if(!Rt(t))return null;let n=Number(t);return Number.isSafeInteger(n)&&n>=1?n:null}function Vt(e){return e==null||e<=1}const Ht=S().ulid(),Ut=ce([`wrun_`,re()]);function Wt(e){if(Rt(e))return null;let t=Ht.safeParse(e);return t.success?new Date(ge(t.data)):null}var Gt=t(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Kt=t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),qt=t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Gt(),a=Kt();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Jt=t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Yt=t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),I=t(((e,t)=>{let n=Kt(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Gt(),{safeRe:a,t:o}=qt(),s=Jt(),{compareIdentifiers:c}=Yt();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Xt=t(((e,t)=>{let n=I();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Zt=t(((e,t)=>{let n=Xt();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Qt=t(((e,t)=>{let n=Xt();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),$t=t(((e,t)=>{let n=I();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),en=t(((e,t)=>{let n=Xt();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),tn=t(((e,t)=>{let n=I();t.exports=(e,t)=>new n(e,t).major})),nn=t(((e,t)=>{let n=I();t.exports=(e,t)=>new n(e,t).minor})),rn=t(((e,t)=>{let n=I();t.exports=(e,t)=>new n(e,t).patch})),an=t(((e,t)=>{let n=Xt();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),L=t(((e,t)=>{let n=I();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),on=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(t,e,r)})),sn=t(((e,t)=>{let n=L();t.exports=(e,t)=>n(e,t,!0)})),cn=t(((e,t)=>{let n=I();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),ln=t(((e,t)=>{let n=cn();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),un=t(((e,t)=>{let n=cn();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),dn=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(e,t,r)>0})),fn=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(e,t,r)<0})),pn=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(e,t,r)===0})),mn=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(e,t,r)!==0})),hn=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(e,t,r)>=0})),gn=t(((e,t)=>{let n=L();t.exports=(e,t,r)=>n(e,t,r)<=0})),_n=t(((e,t)=>{let n=pn(),r=mn(),i=dn(),a=hn(),o=fn(),s=gn();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),vn=t(((e,t)=>{let n=I(),r=Xt(),{safeRe:i,t:a}=qt();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2],c=o[3]||`0`,l=o[4]||`0`,u=t.includePrerelease&&o[5]?`-${o[5]}`:``,d=t.includePrerelease&&o[6]?`+${o[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),yn=t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),R=t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,x(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>oe(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(se(this.set[t],e,this.options))return!0;return!1}};let r=new(yn()),i=Jt(),a=bn(),o=Kt(),s=I(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=qt(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=Gt(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=te(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=re(e,t),o(`xrange`,e),e=ae(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>ee(e,t)).join(` `),ee=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},te=(e,t)=>e.trim().split(/\s+/).map(e=>ne(e,t)).join(` `),ne=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},re=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ie(e,t)).join(` `)),ie=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},ae=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),oe=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),x=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),se=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),bn=t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(t.value,n).test(this.value):t.operator===``?t.value===``||new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=Jt(),{safeRe:i,t:a}=qt(),o=_n(),s=Kt(),c=I(),l=R()})),xn=t(((e,t)=>{let n=R();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Sn=t(((e,t)=>{let n=R();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Cn=t(((e,t)=>{let n=I(),r=R();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),wn=t(((e,t)=>{let n=I(),r=R();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Tn=t(((e,t)=>{let n=I(),r=R(),i=dn();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),En=t(((e,t)=>{let n=R();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),Dn=t(((e,t)=>{let n=I(),r=bn(),{ANY:i}=r,a=R(),o=xn(),s=dn(),c=fn(),l=gn(),u=hn();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),On=t(((e,t)=>{let n=Dn();t.exports=(e,t,r)=>n(e,t,`>`,r)})),kn=t(((e,t)=>{let n=Dn();t.exports=(e,t,r)=>n(e,t,`<`,r)})),An=t(((e,t)=>{let n=R();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),jn=t(((e,t)=>{let n=xn(),r=L();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),Mn=t(((e,t)=>{let n=R(),r=bn(),{ANY:i}=r,a=xn(),o=L(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Nn=t(((e,t)=>{let n=qt(),r=Gt(),i=I(),a=Yt();t.exports={parse:Xt(),valid:Zt(),clean:Qt(),inc:$t(),diff:en(),major:tn(),minor:nn(),patch:rn(),prerelease:an(),compare:L(),rcompare:on(),compareLoose:sn(),compareBuild:cn(),sort:ln(),rsort:un(),gt:dn(),lt:fn(),eq:pn(),neq:mn(),gte:hn(),lte:gn(),cmp:_n(),coerce:vn(),Comparator:bn(),Range:R(),satisfies:xn(),toComparators:Sn(),maxSatisfying:Cn(),minSatisfying:wn(),minVersion:Tn(),validRange:En(),outside:Dn(),gtr:On(),ltr:kn(),intersects:An(),simplifyRange:jn(),subset:Mn(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}));const Pn=2**32-1,Fn=Pn-1;var In=class extends Error{constructor(e,t,n,r){super(e),this.name=`DevalueError`,this.path=t.join(``),this.value=n,this.root=r}};const Ln=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Rn(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Ln}function zn(e){return Object.prototype.toString.call(e).slice(8,-1)}function Bn(e){switch(e){case`"`:return`\\"`;case`<`:return`\\u003C`;case`\\`:return`\\\\`;case`
5
+ `:return`\\n`;case`\r`:return`\\r`;case` `:return`\\t`;case`\b`:return`\\b`;case`\f`:return`\\f`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return e<` `?`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`:``}}function Vn(e){let t=``,n=0,r=e.length;for(let i=0;i<r;i+=1){let r=e[i],a=Bn(r);a&&(t+=e.slice(n,i)+a,n=i+1)}return`"${n===0?e:t+e.slice(n)}"`}function Hn(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}const Un=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Wn(e){return Un.test(e)?`.`+e:`[`+JSON.stringify(e)+`]`}function Gn(e){return!(!Number.isInteger(e)||e<0||e>Fn)}function Kn(e){return!(!Number.isInteger(e)||e<0||e>Pn)}function qn(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return Gn(+e)}function Jn(e){for(var t=e.length-1;t>=0&&!qn(e[t]);t--);return t+1}function Yn(e){let t=Object.keys(e);return t.length=Jn(t),t}function Xn(e){return new Uint8Array(e).toBase64()}function Zn(e){return Uint8Array.fromBase64(e).buffer}function Qn(e){return Buffer.from(e).toString(`base64`)}function $n(e){return Uint8Array.from(Buffer.from(e,`base64`)).buffer}function er(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r){let i=t.subarray(e,e+r);n+=String.fromCharCode.apply(null,i)}return btoa(n)}function tr(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer}const nr=typeof Uint8Array.fromBase64==`function`,rr=typeof process==`object`&&process.versions?.node!==void 0,ir=nr?Xn:rr?Qn:er,ar=nr?Zn:rr?$n:tr;function or(e,t){if(!t)return e;let n={};for(let r of Object.keys(e))n[r]=t[r]??e[r];return n}const sr=Object.freeze({kind:`not-plain`}),cr=Object.freeze({kind:`symbol-keys`}),lr=Object.freeze({identify:e=>e,typeOf:e=>e===null?`null`:typeof e,toPrimitive:e=>e,tagOf:e=>zn(e),isThenable:e=>typeof e.then==`function`,toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?``:e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>({buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>Yn(e),shapeOf:e=>Rn(e)?Hn(e).length>0?cr:{kind:Object.getPrototypeOf(e)===null?`null-proto`:`plain`,keys:Object.keys(e)}:sr,get:(e,t)=>e[t]}),ur=Object.freeze({fromPrimitive:e=>e,fromISOString:e=>new Date(e),fromStringValue:(e,t)=>e===`URL`?new URL(t):e===`URLSearchParams`?new URLSearchParams(t):Temporal[e.slice(9)].from(t),fromArrayBuffer:e=>e,fromRegExpInfo:(e,t)=>new RegExp(e,t),fromViewInfo:(e,t,n,r)=>{let i=globalThis[e];return n===void 0?new i(t):new i(t,n,r)},box:e=>Object(e),createArray:e=>Array(e),createSparseArray:e=>{let t=[];return t[Fn]=void 0,delete t[Fn],t.length=e,t},createObject:()=>({}),createNullPrototypeObject:()=>Object.create(null),createSet:()=>new Set,createMap:()=>new Map,set:(e,t,n)=>{e[t]=n},addValue:(e,t)=>{e.add(t)},addEntry:(e,t,n)=>{e.set(t,n)}});function dr(e,t,n){return fr(JSON.parse(e),t,n)}function fr(e,t,n){let r=or(ur,n?.operations);if(typeof e==`number`)return s(e,!0);if(!Array.isArray(e)||e.length===0)throw Error(`Invalid input`);let i=e,a=Array(i.length),o=null;function s(e,n=!1){if(e===-1)return r.fromPrimitive(void 0);if(e===-3)return r.fromPrimitive(NaN);if(e===-4)return r.fromPrimitive(1/0);if(e===-5)return r.fromPrimitive(-1/0);if(e===-6)return r.fromPrimitive(-0);if(n||typeof e!=`number`)throw Error(`Invalid input`);if(e in a)return a[e];let c=i[e];if(!c||typeof c!=`object`)a[e]=r.fromPrimitive(c);else if(Array.isArray(c))if(typeof c[0]==`string`){let n=c[0],l=t&&Object.hasOwn(t,n)?t[n]:void 0;if(l){let t=c[1];if(typeof t!=`number`&&(t=i.push(c[1])-1),Object.hasOwn(a,t))return a[e]=l(a[t]);if(o??=new Set,o.has(t))throw Error(`Invalid circular reference`);return o.add(t),a[e]=l(s(t)),o.delete(t),a[e]}switch(n){case`Date`:a[e]=r.fromISOString(c[1]);break;case`Set`:let t=r.createSet();a[e]=t;for(let e=1;e<c.length;e+=1)r.addValue(t,s(c[e]));break;case`Map`:let o=r.createMap();a[e]=o;for(let e=1;e<c.length;e+=2)r.addEntry(o,s(c[e]),s(c[e+1]));break;case`RegExp`:a[e]=r.fromRegExpInfo(c[1],c[2]);break;case`Object`:{let t=c[1];if(typeof i[t]==`object`&&i[t][0]!==`BigInt`)throw Error(`Invalid input`);a[e]=r.box(s(t));break}case`BigInt`:a[e]=r.fromPrimitive(BigInt(c[1]));break;case`null`:let l=r.createNullPrototypeObject();a[e]=l;for(let e=1;e<c.length;e+=2){if(c[e]===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(l,c[e],s(c[e+1]))}break;case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Float16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:case`DataView`:{if(i[c[1]][0]!==`ArrayBuffer`)throw Error(`Invalid data`);let t=s(c[1]);a[e]=r.fromViewInfo(n,t,c[2],c[3]);break}case`ArrayBuffer`:{let t=c[1];if(typeof t!=`string`)throw Error(`Invalid ArrayBuffer encoding`);a[e]=r.fromArrayBuffer(ar(t));break}case`URL`:case`URLSearchParams`:case`Temporal.Duration`:case`Temporal.Instant`:case`Temporal.PlainDate`:case`Temporal.PlainTime`:case`Temporal.PlainDateTime`:case`Temporal.PlainMonthDay`:case`Temporal.PlainYearMonth`:case`Temporal.ZonedDateTime`:a[e]=r.fromStringValue(n,c[1]);break;default:throw Error(`Unknown type ${n}`)}}else if(c[0]===-7){let t=c[1];if(!Kn(t))throw Error(`Invalid input`);let n=r.createSparseArray(t);a[e]=n;for(let e=2;e<c.length;e+=2){let i=c[e];if(!Gn(i)||i>=t)throw Error(`Invalid input`);r.set(n,i,s(c[e+1]))}}else{let t=r.createArray(c.length);a[e]=t;for(let e=0;e<c.length;e+=1){let n=c[e];n!==-2&&r.set(t,e,s(n))}}else{let t=r.createObject();a[e]=t;for(let e of Object.keys(c)){if(e===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(t,e,s(c[e]))}}return a[e]}return s(0)}function pr(e,t,n){let r=mr(!1,e,t,n);return typeof r==`string`?r:`[${r.join(`,`)}]`}function mr(e,t,n,r){let i=or(lr,r?.operations),a=[],o=new Map,s=[];if(n)for(let e of Object.getOwnPropertyNames(n))s.push({key:e,fn:n[e]});let c=[],l=0;function u(n,r){let d=i.typeOf(n);if(d===`undefined`)return-1;let f;if(d===`number`){if(f=i.toPrimitive(n),Number.isNaN(f))return-3;if(f===1/0)return-4;if(f===-1/0)return-5;if(f===0&&1/f<0)return-6}let p=i.identify(n);if(o.has(p))return o.get(p);r??=l++,o.set(p,r);for(let{key:e,fn:t}of s){let i=t(n);if(i)return a[r]=`["${e}",${u(i)}]`,r}if(d===`function`)throw new In(`Cannot stringify a function`,c,n,t);if(d===`symbol`)throw new In(`Cannot stringify a Symbol primitive`,c,n,t);let m=``;if(d!==`object`)m=hr(d===`number`?f:i.toPrimitive(n));else if(i.isThenable(n)){if(!e)throw new In(`Cannot stringify a Promise or thenable — use stringifyAsync instead`,c,n,t);m=i.toPromise(n).then(e=>{let t=u(e,r);t<0&&(a[r]=t)})}else{let e=i.tagOf(n);switch(e){case`Number`:case`String`:case`Boolean`:case`BigInt`:m=`["Object",${u(i.unbox(n))}]`;break;case`Date`:m=`["Date","${i.toISOString(n)}"]`;break;case`URL`:m=`["URL",${Vn(i.toStringValue(n))}]`;break;case`URLSearchParams`:m=`["URLSearchParams",${Vn(i.toStringValue(n))}]`;break;case`RegExp`:let{source:r,flags:a}=i.regExpInfo(n);m=a?`["RegExp",${Vn(r)},"${a}"]`:`["RegExp",${Vn(r)}]`;break;case`Array`:{let e=!1,t=i.lengthOf(n);m=`[`;for(let r=0;r<t;r+=1)if(r>0&&(m+=`,`),i.hasOwn(n,r))c.push(`[${r}]`),m+=u(i.get(n,r)),c.pop();else if(e)m+=-2;else{let r=i.indicesOf(n),a=r.length,o=String(t).length;if((t-a)*3>4+o+a*(o+1)){m=`[-7,`+t;for(let e=0;e<r.length;e++){let t=r[e];c.push(`[${t}]`),m+=`,`+t+`,`+u(i.get(n,t)),c.pop()}break}else e=!0,m+=-2}m+=`]`;break}case`Set`:m=`["Set"`;for(let e of i.valuesOf(n))m+=`,${u(e)}`;m+=`]`;break;case`Map`:m=`["Map"`;for(let[e,t]of i.entriesOf(n)){let n=i.typeOf(e),r=n!==`object`&&n!==`function`&&n!==`symbol`;c.push(`.get(${r?hr(i.toPrimitive(e)):`...`})`),m+=`,${u(e)},${u(t)}`,c.pop()}m+=`]`;break;case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Float16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:{let t=i.viewInfo(n);m=`["`+e+`",`+u(t.buffer),t.byteLength!==t.bufferByteLength&&(m+=`,${t.byteOffset},${t.length}`),m+=`]`;break}case`DataView`:{let t=i.viewInfo(n);m=`["`+e+`",`+u(t.buffer),t.byteLength!==t.bufferByteLength&&(m+=`,${t.byteOffset},${t.byteLength}`),m+=`]`;break}case`ArrayBuffer`:m=`["ArrayBuffer","${ir(i.toArrayBuffer(n))}"]`;break;case`Temporal.Duration`:case`Temporal.Instant`:case`Temporal.PlainDate`:case`Temporal.PlainTime`:case`Temporal.PlainDateTime`:case`Temporal.PlainMonthDay`:case`Temporal.PlainYearMonth`:case`Temporal.ZonedDateTime`:m=`["${e}",${Vn(i.toStringValue(n))}]`;break;default:{let e=i.shapeOf(n);if(e.kind===`not-plain`)throw new In(`Cannot stringify arbitrary non-POJOs`,c,n,t);if(e.kind===`symbol-keys`)throw new In(`Cannot stringify POJOs with symbolic keys`,c,n,t);if(e.kind===`null-proto`){m=`["null"`;for(let r of e.keys){if(r===`__proto__`)throw new In(`Cannot stringify objects with __proto__ keys`,c,n,t);c.push(Wn(r)),m+=`,${Vn(r)},${u(i.get(n,r))}`,c.pop()}m+=`]`}else{m=`{`;let r=!1;for(let a of e.keys){if(a===`__proto__`)throw new In(`Cannot stringify objects with __proto__ keys`,c,n,t);r&&(m+=`,`),r=!0,c.push(Wn(a)),m+=`${Vn(a)}:${u(i.get(n,a))}`,c.pop()}m+=`}`}}}}return a[r]=m,r}let d=u(t);return d<0?`${d}`:a}function hr(e){let t=typeof e;return t===`string`?Vn(e):e===void 0?`-1`:e===0&&1/e<0?`-6`:t===`bigint`?`["BigInt","${e}"]`:String(e)}var gr=e(Nn(),1);async function _r(e,t=[`encrypt`,`decrypt`]){if(e.byteLength!==32)throw new r(`Encryption key must be exactly 32 bytes, got ${e.byteLength}`);return globalThis.crypto.subtle.importKey(`raw`,e,`AES-GCM`,!1,t)}async function vr(e,t,n){let r=globalThis.crypto.getRandomValues(new Uint8Array(12)),i;try{i=await globalThis.crypto.subtle.encrypt({name:`AES-GCM`,iv:r,tagLength:128,...n?{additionalData:n}:{}},e,t)}catch(e){throw new h(`AES-256-GCM encryption failed: ${e instanceof Error?e.message:String(e)}`,{cause:e,context:{operation:`encrypt`,byteLength:t.byteLength}})}let a=new Uint8Array(12+i.byteLength);return a.set(r,0),a.set(new Uint8Array(i),12),a}async function yr(e,t,n){if(t.byteLength<28)throw new h(`Encrypted data too short: expected at least 28 bytes, got ${t.byteLength}`,{context:{operation:`decrypt`,byteLength:t.byteLength}});let r=t.subarray(0,12),i=t.subarray(12),a;try{a=await globalThis.crypto.subtle.decrypt({name:`AES-GCM`,iv:r,tagLength:128,...n?{additionalData:n}:{}},e,i)}catch(e){throw new h(`AES-256-GCM decryption failed: ${e instanceof Error?e.message:String(e)}`,{cause:e,context:{operation:`decrypt`,byteLength:t.byteLength}})}return new Uint8Array(a)}const br=Symbol.for(`WORKFLOW_USE_STEP`),xr=Symbol.for(`WORKFLOW_SET_ATTRIBUTES`),Sr=Symbol.for(`WORKFLOW_CREATE_HOOK`),Cr=Symbol.for(`WORKFLOW_SLEEP`),wr=Symbol.for(`WORKFLOW_GET_STREAM_ID`),Tr=Symbol.for(`WORKFLOW_STABLE_ULID`),Er=Symbol.for(`WORKFLOW_STREAM_NAME`),Dr=Symbol.for(`WORKFLOW_STREAM_TYPE`),Or=Symbol.for(`WORKFLOW_STREAM_FRAMING`),kr=Symbol.for(`WORKFLOW_STREAM_SERVER_RUN_ID`),Ar=Symbol.for(`WORKFLOW_STREAM_SERVER_DEPLOYMENT_ID`),jr=Symbol.for(`WORKFLOW_STREAM_SERVER_PUBLIC_KEY`),Mr=Symbol.for(`WORKFLOW_STREAM_DRAIN`),Nr=Symbol.for(`BODY_INIT`),Pr=Symbol.for(`WEBHOOK_RESPONSE_WRITABLE`),Fr=Symbol.for(`workflow-class-registry`),z=Symbol.for(`WORKFLOW_ABORT_STREAM_NAME`),B=Symbol.for(`WORKFLOW_ABORT_HOOK_TOKEN`),Ir=Symbol.for(`WORKFLOW_ABORT_LISTENER_ATTACHED`),Lr=Symbol.for(`WORKFLOW_ABORT_READER_CANCEL`),Rr=()=>Et(`WORKFLOW_STREAM_MAX_INFLIGHT_CHUNKS`,1e3,{integer:!0,min:1}),zr=()=>Et(`WORKFLOW_STREAM_MAX_CHUNKS_PER_BATCH`,1e3,{integer:!0,min:1}),Br=()=>Et(`WORKFLOW_STREAM_MAX_BYTES_PER_BATCH`,1048576,{integer:!0,min:1}),Vr=()=>Et(`WORKFLOW_STREAM_MAX_BUFFERED_BYTES`,8388608,{integer:!0,min:1}),Hr=()=>Et(`WORKFLOW_LOCK_POLL_INTERVAL_MS`,10,{integer:!0,min:1});function Ur(){let e={...ee(),pendingOps:0,doneResolved:!1,streamEnded:!1};return e.promise.catch(()=>{}),e}function Wr(e){if(e.locked)return!1;let t;try{t=e.getWriter()}catch{return!1}try{t.releaseLock()}catch{return!1}return!0}function Gr(e){if(e.locked)return!1;let t;try{t=e.getReader()}catch{return!1}try{t.releaseLock()}catch{return!1}return!0}function Kr(e){let t=e.drainBarrier;if(!t){e.resolve();return}t().then(()=>e.resolve(),t=>e.reject(t))}function qr(e,t){if(t.writablePollingInterval!==void 0)return;let n=setInterval(()=>{if(t.doneResolved||t.streamEnded){clearInterval(n),t.writablePollingInterval=void 0;return}Wr(e)&&t.pendingOps===0&&(t.doneResolved=!0,clearInterval(n),t.writablePollingInterval=void 0,Kr(t))},Hr());t.writablePollingInterval=n}function Jr(e,t){if(t.readablePollingInterval!==void 0)return;let n=setInterval(()=>{if(t.doneResolved||t.streamEnded){clearInterval(n),t.readablePollingInterval=void 0;return}Gr(e)&&t.pendingOps===0&&(t.doneResolved=!0,clearInterval(n),t.readablePollingInterval=void 0,Kr(t))},Hr());t.readablePollingInterval=n}function Yr(e,t,n){let r=t[Mr];return typeof r==`function`&&(n.drainBarrier=r),Xr(e,t,n)}async function Xr(e,t,n){let i=e.getReader(),a=t.getWriter(),o;try{for(;;){if(n.streamEnded)return;let e=await Promise.race([i.read(),a.closed.then(()=>{throw new r(`Writable stream closed prematurely`)})]);if(n.streamEnded)return;if(e.done){n.streamEnded=!0,await a.close(),n.doneResolved||(n.doneResolved=!0,n.resolve());return}n.pendingOps++;try{await a.write(e.value)}finally{n.pendingOps--}}}catch(e){throw n.streamEnded=!0,o=e,n.drainBarrier&&await n.drainBarrier().catch(()=>{}),n.doneResolved||(n.doneResolved=!0,n.reject(e)),e}finally{i.cancel(o).catch(()=>{}),i.releaseLock(),a.releaseLock()}}function Zr(e){let t=e.specVersion;if(!(t!=null&&t>=5&&t<=6))throw new r(`This Workflow runtime supports Worlds with spec version 5 through 6, but the configured World declares spec version ${t??`none`}. Install a World package version compatible with the current Workflow runtime.`)}const Qr=Symbol.for(`@workflow/world//cache`),$r=Symbol.for(`@workflow/world//cachePromise`),ei=Symbol.for(`@workflow/world//getWorldFn`);async function ti(){let e=globalThis;if(e[Qr])return Zr(e[Qr]),e[Qr];if(e[$r])return e[Qr]=await e[$r],Zr(e[Qr]),e[Qr];let t=e[ei];if(t){let e=await t();return Zr(e),e}throw Error("Workflow world runtime was not initialized. Import from the host workflow entrypoints (`workflow`, `workflow/api`, or `workflow/runtime`) so @workflow/core/runtime/world-init can register getWorld before getWorldLazy() is used.")}const ni=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]),ri=new TextEncoder;function ii(e){if(e.byteLength!==32)throw new r(`Run key material must be exactly 32 bytes, got ${e.byteLength}`)}function ai(e,t){if(e.byteLength!==32)throw new r(`${t} must be exactly 32 bytes, got ${e.byteLength}`)}async function oi(e){ii(e);let t=await globalThis.crypto.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveBits`]),n=await globalThis.crypto.subtle.deriveBits({name:`HKDF`,hash:`SHA-256`,salt:new Uint8Array(32),info:ri.encode(`workflow/encp/x25519/v1`)},t,256),r=new Uint8Array(n);return{scalar:r,publicKey:await si(r)}}async function si(e){let t=await ci(e,!0),n=await globalThis.crypto.subtle.exportKey(`jwk`,t);if(!n.x)throw new r(`X25519 JWK export did not include a public key component ("x")`);let i=pi(n.x);if(i.byteLength!==32)throw new r(`X25519 JWK export produced a ${i.byteLength}-byte public key, expected 32`);return i}async function ci(e,t){let n=new Uint8Array(ni.length+e.byteLength);return n.set(ni,0),n.set(e,ni.length),globalThis.crypto.subtle.importKey(`pkcs8`,n,{name:`X25519`},t,[`deriveBits`])}function li(e){return globalThis.crypto.subtle.importKey(`raw`,e,{name:`X25519`},!0,[])}const ui=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function di(e){let t=``;for(let n=0;n<e.length;n+=3){let r=e[n],i=n+1<e.length?e[n+1]:0,a=n+2<e.length?e[n+2]:0;t+=ui[r>>2&63],t+=ui[(r&3)<<4|i>>4&15],t+=n+1<e.length?ui[(i&15)<<2|a>>6&3]:`=`,t+=n+2<e.length?ui[a&63]:`=`}return t}function fi(e){let t=e.length;for(;t>0&&e[t-1]===`=`;)t--;let n=e.slice(0,t);if(n.includes(`=`)||n.length%4==1||t!==e.length&&e.length%4!=0)return;let r=0,i=0,a=[];for(let e=0;e<n.length;e++){let t=ui.indexOf(n[e]);if(t===-1)return;r=r<<6|t,i+=6,i>=8&&(i-=8,a.push(r>>i&255))}if(!(i>0&&r&(1<<i)-1))return new Uint8Array(a)}function pi(e){let t=0,n=0,i=[];for(let a=0;a<e.length;a++){let o=e[a];if(o===`=`)break;let s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.indexOf(o);if(s===-1)throw new r(`Invalid base64url character "${o}" in X25519 JWK key component`);t=t<<6|s,n+=6,n>=8&&(n-=8,i.push(t>>n&255))}return new Uint8Array(i)}async function mi(e,t,n,r){let i=ri.encode(`workflow/encp/aes256gcm/v1`),a=new Uint8Array(i.length+t.length+n.length);a.set(i,0),a.set(t,i.length),a.set(n,i.length+t.length);let o=await globalThis.crypto.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveBits`]),s=await globalThis.crypto.subtle.deriveBits({name:`HKDF`,hash:`SHA-256`,salt:new Uint8Array(32),info:a},o,256);return globalThis.crypto.subtle.importKey(`raw`,new Uint8Array(s),`AES-GCM`,!1,r)}async function hi(e){ai(e,`Recipient public key`);let t;try{t=await li(e)}catch(e){throw new r(`Invalid X25519 recipient public key: ${e instanceof Error?e.message:String(e)}`,{cause:e})}let n=await globalThis.crypto.subtle.generateKey({name:`X25519`},!0,[`deriveBits`]),i=new Uint8Array(await globalThis.crypto.subtle.exportKey(`raw`,n.publicKey)),a;try{a=await globalThis.crypto.subtle.deriveBits({name:`X25519`,public:t},n.privateKey,256)}catch(e){throw new r(`X25519 key agreement failed: the recipient public key is not a valid curve point (low-order point or corrupted key material)`,{cause:e})}return{ephemeralPublicKey:i,contentKey:await mi(new Uint8Array(a),i,e,[`encrypt`])}}async function gi(e,t){if(t.byteLength!==32)throw new h(`Sealed payload has a malformed ephemeral public key: expected 32 bytes, got ${t.byteLength}`,{context:{operation:`decrypt`,byteLength:t.byteLength}});let n;try{let[r,i]=await Promise.all([ci(e.scalar,!1),li(t)]);n=await globalThis.crypto.subtle.deriveBits({name:`X25519`,public:i},r,256)}catch(e){throw new h(`X25519 key agreement failed while opening a sealed payload: ${e instanceof Error?e.message:String(e)}`,{cause:e,context:{operation:`decrypt`,byteLength:t.byteLength}})}return mi(new Uint8Array(n),t,e.publicKey,[`decrypt`])}async function _i(e,t,n){let{ephemeralPublicKey:r,contentKey:i}=await hi(e),a=await vr(i,t,n),o=new Uint8Array(r.byteLength+a.byteLength);return o.set(r,0),o.set(a,r.byteLength),o}async function vi(e,t,n){if(t.byteLength<60)throw new h(`Sealed payload too short: expected at least 60 bytes, got ${t.byteLength}`,{context:{operation:`decrypt`,byteLength:t.byteLength}});let r=t.subarray(0,32),i=t.subarray(32);return yr(await gi(e,r),i,n)}function yi(e,t){let n;return{async seal(r){n??=hi(e);let{ephemeralPublicKey:i,contentKey:a}=await n,o=await vr(a,r,t),s=new Uint8Array(i.byteLength+o.byteLength);return s.set(i,0),s.set(o,i.byteLength),s}}}function bi(e,t){let n,r;return{async open(i){if(i.byteLength<60)throw new h(`Sealed payload too short: expected at least 60 bytes, got ${i.byteLength}`,{context:{operation:`decrypt`,byteLength:i.byteLength}});let a=i.subarray(0,32),o=i.subarray(32),s=xi(a);(s!==n||!r)&&(n=s,r=gi(e,a));let c;try{c=await r}catch(e){throw n=void 0,r=void 0,e}return yr(c,o,t)}}}function xi(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t}function Si(e){if(!e)return;let t=fi(e);if(!(!t||t.byteLength!==32))return t}let Ci=null,wi=null;function Ti(e,t){let n=Ci,r=wi;Ci=e??null,wi=e?new WeakSet:null;try{return t()}finally{Ci=n,wi=r}}const Ei=new WeakSet;function Di(e){return Ei.add(e),e}function Oi(e){return typeof e==`function`&&Ei.has(e)}function ki(e,t){if(!Ci)return;let n={kind:e};t!==void 0&&(n.detail=t),Ci.executions.push(n)}function V(e){!Ci||!wi||wi.has(e)||(wi.add(e),ki(`proxy`))}const H=Function.prototype.bind.bind(Function.prototype.call);function U(e,t){let n=Object.getOwnPropertyDescriptor(e,t)?.get;if(!n)throw Error(`Missing intrinsic getter: ${String(t)}`);return H(n)}const Ai=H(Date.prototype.getDate),ji=H(Date.prototype.getTime),Mi=H(Date.prototype.toISOString),Ni=U(RegExp.prototype,`source`),Pi=U(RegExp.prototype,`flags`),Fi=U(ArrayBuffer.prototype,`byteLength`),Ii=H(Map.prototype.entries),Li=H(Set.prototype.values),Ri=H(Number.prototype.valueOf),zi=H(String.prototype.valueOf),Bi=H(Boolean.prototype.valueOf),Vi=H(BigInt.prototype.valueOf),Hi=Object.getPrototypeOf(Uint8Array.prototype),Ui=U(Hi,Symbol.toStringTag),Wi=U(Hi,`buffer`),Gi=U(Hi,`byteOffset`),Ki=U(Hi,`byteLength`),qi=U(Hi,`length`),Ji=U(DataView.prototype,`buffer`),Yi=U(DataView.prototype,`byteOffset`),Xi=U(DataView.prototype,`byteLength`),Zi=U(SharedArrayBuffer.prototype,`byteLength`),Qi=H(Headers.prototype[Symbol.iterator]),$i=U(URL.prototype,`href`),ea=H(URLSearchParams.prototype.toString),{isProxy:W}=O,ta=H(Function.prototype.toString);function na(e){if(W(e))return!1;let t=Object.getOwnPropertyDescriptor(e,`name`)?.value;return typeof t==`string`&&t.startsWith(`bound `)?!1:ta(e).endsWith(`{ [native code] }`)||Reflect.getPrototypeOf(e)===Function.prototype}function G(e,t){if(e===null||typeof e!=`object`&&typeof e!=`function`)return;if(W(e))return V(e),e[t];let n=e;for(;n!==null;){if(W(n))return V(n),e[t];let r=Object.getOwnPropertyDescriptor(n,t);if(r)return`value`in r?r.value:r.get?(na(r.get)||ki(`getter`,String(t)),r.get.call(e)):void 0;n=Reflect.getPrototypeOf(n)}}function ra(e,t){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;if(W(e))return V(e),t in e;let n=e;for(;n!==null;){if(W(n))return V(n),t in e;if(Object.getOwnPropertyDescriptor(n,t))return!0;n=Reflect.getPrototypeOf(n)}return!1}function K(e,t){if(!t||typeof e!=`object`||!e)return!1;W(e)&&V(e);let n=Reflect.getPrototypeOf(e);for(;n!==null;){if(n===t)return!0;W(n)&&V(n),n=Reflect.getPrototypeOf(n)}return!1}function ia(e){return W(e)?(V(e),e.href):$i(e)}function aa(e){return W(e)?(V(e),String(e)):ea(e)}function oa(e){return W(e)?(V(e),Array.from(e)):[...Qi(e)]}function sa(e){return[...Ii(e)]}function ca(e){return[...Li(e)]}function la(e){return O.isDataView(e)?{buffer:Ji(e),byteOffset:Yi(e),byteLength:Xi(e)}:{buffer:Wi(e),byteOffset:Gi(e),byteLength:Ki(e)}}const ua=new Set([`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Float16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]),da=new Set([`Date`,`RegExp`,`Map`,`Set`,`Array`,`DataView`,`ArrayBuffer`,`SharedArrayBuffer`,`Number`,`String`,`Boolean`,`BigInt`,`URL`,`URLSearchParams`,...ua]);function fa(e){if(O.isDate(e))return`Date`;if(O.isRegExp(e))return`RegExp`;if(O.isMap(e))return`Map`;if(O.isSet(e))return`Set`;if(Array.isArray(e))return`Array`;if(O.isTypedArray(e)){let t=Ui(e);return t!==void 0&&ua.has(t)?t:void 0}if(O.isDataView(e))return`DataView`;if(O.isArrayBuffer(e))return`ArrayBuffer`;if(O.isSharedArrayBuffer(e))return`SharedArrayBuffer`;if(O.isNumberObject(e))return`Number`;if(O.isStringObject(e))return`String`;if(O.isBooleanObject(e))return`Boolean`;if(O.isBigIntObject(e))return`BigInt`;if(K(e,URL.prototype))return`URL`;if(K(e,URLSearchParams.prototype))return`URLSearchParams`}function pa(e){let t=G(e,Symbol.toStringTag);return typeof t==`string`?t:void 0}const ma={tagOf:e=>{if(W(e))return V(e),lr.tagOf(e);let t=fa(e);if(t!==void 0)return t;let n=pa(e);return n===void 0||da.has(n)?`Object`:n},isThenable:e=>O.isPromise(e)?!0:typeof G(e,`then`)==`function`,unbox:e=>O.isNumberObject(e)?Ri(e):O.isStringObject(e)?zi(e):O.isBooleanObject(e)?Bi(e):Vi(e),toISOString:e=>Number.isNaN(Ai(e))?``:Mi(e),toStringValue:e=>K(e,URL.prototype)?ia(e):K(e,URLSearchParams.prototype)?aa(e):(ki(`method`,`toString (${pa(e)??`unknown`})`),e.toString()),regExpInfo:e=>({source:Ni(e),flags:Pi(e)}),valuesOf:e=>ca(e),entriesOf:e=>sa(e),viewInfo:e=>{let t=la(e);return{...t,length:O.isDataView(e)?0:qi(e),bufferByteLength:O.isSharedArrayBuffer(t.buffer)?Zi(t.buffer):Fi(t.buffer)}},shapeOf:e=>(W(e)&&V(e),lr.shapeOf(e)),get:(e,t)=>G(e,t)},ha=Symbol.for(`workflow-serialize`),ga=Symbol.for(`workflow-deserialize`);function _a(e=globalThis){let t=e,n=t[Fr];return n||(n=new Map,t[Fr]=n),n}const va=`class//workflow//Run`;function ya(e,t,n=globalThis){_a(n).set(e,t)}function ba(e,t){return _a(t).get(e)}function xa(){return{Class:e=>{if(typeof e!=`function`)return!1;let t=G(e,`classId`);return typeof t==`string`&&{classId:t}},Instance:e=>{if(typeof e!=`object`||!e)return!1;let t=G(e,`constructor`);if(!t||typeof t!=`function`)return!1;let n=G(t,ha);if(typeof n!=`function`)return!1;let r=G(t,`classId`);if(typeof r!=`string`)throw Error(`Class "${String(G(t,`name`))}" with ${String(ha)} must have a static "classId" property.`);return ki(`method`,`[WORKFLOW_SERIALIZE] (${r})`),{classId:r,data:n.call(t,e)}}}}function Sa(e=globalThis){return{Class:t=>{let n=t.classId,r=ba(n,e);if(!r)throw Error(`Class "${n}" not found. Make sure the class is registered with registerSerializationClass.`);return r},Instance:t=>{let n=t.classId,r=t.data,i=ba(n,e);if(!i)throw Error(`Class "${n}" not found. Make sure the class is registered with registerSerializationClass.`);let a=i[ga];if(typeof a!=`function`)throw Error(`Class "${n}" does not have a static ${String(ga)} method.`);return a.call(i,r)}}}function Ca(e,t,n){if(n===0)return`.`;let r=new Uint8Array(e,t,n);return Buffer.from(r).toString(`base64`)}function q(e){let t=la(e);return Ca(t.buffer,t.byteOffset,t.byteLength)}function J(e,t){let n=e===`.`?``:e,r=Buffer.from(n,`base64`),i=new t.ArrayBuffer(r.length);return new t.Uint8Array(i).set(r),i}function wa(e){return JSON.parse(e)}function Ta(e){let t=Object.getOwnPropertyDescriptor(e,`stack`);return t&&`value`in t?t.value:(ki(`getter`,`stack`),t?.get?t.get.call(e):G(e,`stack`))}function Ea(e){if(!O.isNativeError(e))return!1;let t={message:G(e,`message`),stack:Ta(e)};return ra(e,`cause`)&&(t.cause=G(e,`cause`)),t}function Da(e,t){return!O.isNativeError(t)||G(t,`name`)!==e?!1:Ea(t)}function Oa(e){return t=>Da(e,t)||!1}function ka(e,t){return n=>{let r=n,i=`cause`in r?{cause:r.cause}:void 0,a=e[t],o=new a(r.message,i);return r.stack!==void 0&&(o.stack=r.stack),o}}function Aa(e=globalThis){return{ArrayBuffer:e=>O.isArrayBuffer(e)&&Ca(e,0,Fi(e)),BigInt:e=>typeof e==`bigint`&&String(e),BigInt64Array:e=>O.isBigInt64Array(e)&&q(e),BigUint64Array:e=>O.isBigUint64Array(e)&&q(e),Date:e=>O.isDate(e)?Number.isNaN(Ai(e))?`.`:Mi(e):!1,DOMException:e=>{if(typeof e!=`object`||!e)return!1;let t=G(e,`constructor`);if(!t||G(t,`name`)!==`DOMException`)return!1;let n={message:G(e,`message`),name:G(e,`name`),stack:Ta(e)};return ra(e,`cause`)&&(n.cause=G(e,`cause`)),n},EvalError:Oa(`EvalError`),FatalError:Oa(`FatalError`),HookConflictError:e=>{let t=Da(`HookConflictError`,e);if(!t)return!1;let n={...t,token:G(e,`token`)},r=G(e,`conflictingRunId`);return r!==void 0&&(n.conflictingRunId=r),n},RangeError:Oa(`RangeError`),ReferenceError:Oa(`ReferenceError`),RetryableError:e=>{let t=Da(`RetryableError`,e);if(!t)return!1;let n=G(e,`retryAfter`),r;if(O.isDate(n)){let e=ji(n);r=Number.isNaN(e)?Date.now()+1e3:e}else if(n&&typeof n==`object`){let e=G(n,`getTime`);if(typeof e==`function`){ki(`method`,`getTime`);let t=e.call(n);r=Number.isNaN(t)?Date.now()+1e3:t}else r=Date.now()+1e3}else if(typeof n==`string`||typeof n==`number`){let e=new Date(n).getTime();r=Number.isNaN(e)?Date.now()+1e3:e}else r=Date.now()+1e3;return{...t,retryAfter:r}},RuntimeDecryptionError:e=>{let t=Da(`RuntimeDecryptionError`,e);if(!t)return!1;let n={...t},r=G(e,`context`);return r!==void 0&&(n.context=r),n},SyntaxError:Oa(`SyntaxError`),TypeError:Oa(`TypeError`),URIError:Oa(`URIError`),AggregateError:e=>{let t=Da(`AggregateError`,e);return t?{...t,errors:G(e,`errors`)}:!1},Error:e=>{if(!O.isNativeError(e))return!1;let t={name:G(e,`name`),message:G(e,`message`),stack:Ta(e)};return ra(e,`cause`)&&(t.cause=G(e,`cause`)),t},Float32Array:e=>O.isFloat32Array(e)&&q(e),Float64Array:e=>O.isFloat64Array(e)&&q(e),Headers:e=>K(e,Headers.prototype)&&oa(e),Int8Array:e=>O.isInt8Array(e)&&q(e),Int16Array:e=>O.isInt16Array(e)&&q(e),Int32Array:e=>O.isInt32Array(e)&&q(e),Map:e=>O.isMap(e)&&sa(e),RegExp:e=>O.isRegExp(e)&&{source:Ni(e),flags:Pi(e)},Set:e=>O.isSet(e)&&ca(e),URL:e=>K(e,URL.prototype)&&ia(e),WorkflowFunction:e=>{if(typeof e!=`function`)return!1;let t=G(e,`workflowId`);return typeof t==`string`&&{workflowId:t}},URLSearchParams:e=>{if(!K(e,URLSearchParams.prototype))return!1;let t=aa(e);return t===``?`.`:t},Uint8Array:e=>O.isUint8Array(e)&&q(e),Uint8ClampedArray:e=>O.isUint8ClampedArray(e)&&q(e),Uint16Array:e=>O.isUint16Array(e)&&q(e),Uint32Array:e=>O.isUint32Array(e)&&q(e)}}function ja(e=globalThis){return{ArrayBuffer:t=>J(t,e),BigInt:t=>e.BigInt(t),BigInt64Array:t=>new e.BigInt64Array(J(t,e)),BigUint64Array:t=>new e.BigUint64Array(J(t,e)),Date:t=>new e.Date(t),DOMException:t=>{let n=new e.DOMException(t.message,t.name);return t.stack!==void 0&&(n.stack=t.stack),`cause`in t&&(n.cause=t.cause),n},EvalError:ka(e,`EvalError`),FatalError:t=>{let n=new(e[Symbol.for(`@workflow/errors//FatalError`)]??d)(t.message);return t.stack!==void 0&&(n.stack=t.stack),`cause`in t&&(n.cause=t.cause),n},HookConflictError:t=>{let n=new(e[Symbol.for(`@workflow/errors//HookConflictError`)]??o)(t.token,t.conflictingRunId);return t.stack!==void 0&&(n.stack=t.stack),`cause`in t&&(n.cause=t.cause),n},RangeError:ka(e,`RangeError`),ReferenceError:ka(e,`ReferenceError`),RetryableError:t=>{let n=new(e[Symbol.for(`@workflow/errors//RetryableError`)]??v)(t.message,{retryAfter:new e.Date(t.retryAfter)});return t.stack!==void 0&&(n.stack=t.stack),`cause`in t&&(n.cause=t.cause),n},RuntimeDecryptionError:t=>{let n=e[Symbol.for(`@workflow/errors//RuntimeDecryptionError`)]??h,r={};`cause`in t&&(r.cause=t.cause),t.context!==void 0&&(r.context=t.context);let i=new n(t.message,r);return t.stack!==void 0&&(i.stack=t.stack),i},SyntaxError:ka(e,`SyntaxError`),TypeError:ka(e,`TypeError`),URIError:ka(e,`URIError`),AggregateError:t=>{let n=`cause`in t?{cause:t.cause}:void 0,r=new e.AggregateError(t.errors,t.message,n);return t.stack!==void 0&&(r.stack=t.stack),r},Error:t=>{let n=`cause`in t?{cause:t.cause}:void 0,r=new e.Error(t.message,n);return r.name=t.name,t.stack!==void 0&&(r.stack=t.stack),r},Float32Array:t=>new e.Float32Array(J(t,e)),Float64Array:t=>new e.Float64Array(J(t,e)),Headers:t=>new e.Headers(t),Int8Array:t=>new e.Int8Array(J(t,e)),Int16Array:t=>new e.Int16Array(J(t,e)),Int32Array:t=>new e.Int32Array(J(t,e)),Map:t=>new e.Map(t),RegExp:t=>new e.RegExp(t.source,t.flags),Set:t=>new e.Set(t),URL:t=>new e.URL(t),WorkflowFunction:e=>Object.assign(()=>{throw Error(`Workflow functions cannot be called directly. Use start() to invoke them.`)},{workflowId:e.workflowId}),URLSearchParams:t=>new e.URLSearchParams(t===`.`?``:t),Uint8Array:t=>new e.Uint8Array(J(t,e)),Uint8ClampedArray:t=>new e.Uint8ClampedArray(J(t,e)),Uint16Array:t=>new e.Uint16Array(J(t,e)),Uint32Array:t=>new e.Uint32Array(J(t,e))}}function Ma(){return{StepFunction:e=>{if(typeof e!=`function`)return!1;let t=G(e,`stepId`);if(typeof t!=`string`)return!1;let n=G(e,`__closureVarsFn`),r;typeof n==`function`&&(Oi(n)||ki(`method`,`__closureVarsFn`),r=n());let i=ra(e,`__boundThis`),a=i?G(e,`__boundThis`):void 0,o=G(e,`__boundArgs`),s={stepId:t};return r!==void 0&&(s.closureVars=r),i&&(s.boundThis=a),Array.isArray(o)&&o.length>0&&(s.boundArgs=o),s}}}function Na(e=globalThis){let t=e[Symbol.for(`WORKFLOW_USE_STEP`)];return{StepFunction:e=>{let n=e.stepId,r=e.closureVars;if(!t)throw Error(`WORKFLOW_USE_STEP not found on global object. Step functions cannot be deserialized outside workflow context.`);let i=r?t(n,()=>r):t(n);if(`boundThis`in e){let t=Array.isArray(e.boundArgs)?e.boundArgs:[];return i.bind(e.boundThis,...t)}return i}}}function Pa(e){return e.length===4&&/^[a-z0-9]{4}$/.test(e)}const Y={DEVALUE_V1:`devl`,ENCRYPTED:`encr`,SEALED:`encp`,GZIP:`gzip`,ZSTD:`zstd`},Fa=new TextEncoder,Ia=new TextDecoder;function La(e,t=globalThis,n){let r;switch(e){case`workflow`:r={...xa(),...Ma(),...Aa(t)};break;case`step`:r={...xa(),...Aa(t)};break;case`client`:r={...xa(),...Aa(t)};break}return n?{...r,...n}:r}function Ra(e,t=globalThis,n){let r;switch(e){case`workflow`:r={...Sa(t),...Na(t),...ja(t)};break;case`step`:r={...Sa(t),...ja(t)};break;case`client`:r={...Sa(t),...ja(t),StepFunction:()=>{throw Error(`Step functions cannot be deserialized in client context.`)}};break}return n?{...r,...n}:r}const X={formatPrefix:Y.DEVALUE_V1,serialize(e,t,n){let r=La(t,n?.global,n?.extraReducers),i=Ti(n?.guestCodeStats,()=>pr(e,r,{operations:ma}));return Fa.encode(i)},deserialize(e,t,n){let r=Ra(t,n?.global,n?.extraRevivers);return dr(Ia.decode(e),r)},deserializeLegacy(e,t,n){return fr(e,Ra(t,n?.global,n?.extraRevivers))}},za=new TextEncoder,Ba=new TextDecoder;function Va(e,t){if(!(t instanceof Uint8Array))return t;let n=za.encode(e),r=new Uint8Array(4+t.length);return r.set(n,0),r.set(t,4),r}function Ha(e){if(!(e instanceof Uint8Array)||e.length<4)return null;let t=e.subarray(0,4),n=Ba.decode(t);return Pa(n)?n:null}function Z(e){if(!(e instanceof Uint8Array))return{format:Y.DEVALUE_V1,payload:new TextEncoder().encode(JSON.stringify(e))};if(e.length<4)throw Error(`Data too short to contain format prefix: expected at least 4 bytes, got ${e.length}`);let t=e.subarray(0,4),n=Ba.decode(t);if(!Pa(n))throw Error(`Invalid format prefix: "${n}". Must be 4 characters of [a-z0-9].`);return{format:n,payload:e.subarray(4)}}function Ua(){try{return typeof process<`u`&&process.env?.WORKFLOW_DISABLE_COMPRESSION===`1`}catch{return!1}}function Wa(){try{let e=process.env?.WORKFLOW_COMPRESSION_CODEC;return e===`gzip`||e===`zstd`?e:void 0}catch{return}}function Ga(){try{return globalThis.process?.getBuiltinModule?.(`node:zlib`)}catch{return}}function Ka(){let e=Ga();return typeof e?.zstdCompressSync==`function`&&typeof e?.zstdDecompressSync==`function`}function qa(){return typeof CompressionStream==`function`&&typeof DecompressionStream==`function`}async function Ja(e,t){let n=t.writable.getWriter(),r=n.write(e).then(()=>n.close());r.catch(()=>{});let i=[],a=0,o=t.readable.getReader();for(;;){let{done:e,value:t}=await o.read();if(e)break;i.push(t),a+=t.length}await r;let s=new Uint8Array(a),c=0;for(let e of i)s.set(e,c),c+=e.length;return s}async function Ya(e){return Ja(e,new CompressionStream(`gzip`))}async function Xa(e){return Ja(e,new DecompressionStream(`gzip`))}function Za(e){let t=Ga(),n=t?.constants?.ZSTD_c_compressionLevel,r=n===void 0?void 0:{params:{[n]:3}};return new Uint8Array(t.zstdCompressSync(e,r))}function Qa(e){let t=Ga();if(!t?.zstdDecompressSync)throw Error(`Compressed (zstd) workflow data encountered but node:zlib zstd support is not available in this runtime (requires Node.js 22.15+). In the browser, register a zstd decoder via registerZstdDecoder (serialization-format.ts).`);return new Uint8Array(t.zstdDecompressSync(e))}function $a(e,t,n,r){e&&(e.recorded=!0,e.compressed=t!==`none`,e.codec=t,e.uncompressedBytes=n,e.storedBytes=r)}function eo(){return Wa()===`gzip`?qa()?`gzip`:`none`:Ka()?`zstd`:qa()?`gzip`:`none`}async function to(e,t,n){if(!(e instanceof Uint8Array))return e;if(!t||e.length<1024||Ua())return $a(n,`none`,e.length,e.length),e;let r=eo();if(r===`none`)return $a(n,`none`,e.length,e.length),e;let i=r===`zstd`?Za(e):await Ya(e),a=r===`zstd`?Y.ZSTD:Y.GZIP,o=4+i.length;return o>=e.length*.95?($a(n,`none`,e.length,e.length),e):($a(n,r,e.length,o),Va(a,i))}async function no(e,t){if(!(e instanceof Uint8Array))return e;let n=Ha(e);if(n===Y.ZSTD){let{payload:n}=Z(e),r=Qa(n);return $a(t,`zstd`,r.length,e.length),r}if(n===Y.GZIP){if(!qa())throw Error(`Compressed (gzip) workflow data encountered but DecompressionStream is not available in this runtime. Node.js 18+, browsers, and edge runtimes all support it.`);let{payload:n}=Z(e),r=await Xa(n);return $a(t,`gzip`,r.length,e.length),r}return $a(t,`none`,e.length,e.length),e}const ro=Symbol.for(`workflow.serialization.sealTarget`),io=Symbol.for(`workflow.serialization.runKeys`);function ao(e,t){return{[ro]:!0,recipientPublicKey:e,aad:t}}function oo(e,t,n){return{[io]:!0,aes:e,keyPair:t,aad:n}}async function so(e){let[t,n]=await Promise.all([_r(e),oi(e)]);return oo(t,n)}function co(e){return typeof e==`object`&&!!e&&e[ro]===!0}function lo(e){return typeof e==`object`&&!!e&&e[io]===!0}function uo(e){if(e){if(lo(e))return e.aes;if(!co(e))return e}}async function fo(e){return typeof e==`function`?e():e}async function po(e,t){if(!t||!(e instanceof Uint8Array))return e;if(co(t)){let n=await _i(t.recipientPublicKey,e,t.aad);return Va(Y.SEALED,n)}let n=await vr(lo(t)?t.aes:t,e);return Va(Y.ENCRYPTED,n)}async function mo(e,t){if(!lo(t))throw new h(`Sealed data encountered but no run keypair is available. Opening a sealed payload requires the run's own encryption key material; a symmetric key or a seal-only target cannot decrypt it.`,{context:{operation:`decrypt`,byteLength:e.byteLength,formatPrefix:`encp`}});let{payload:n}=Z(e);try{return await vi(t.keyPair,n,t.aad)}catch(e){throw h.is(e)&&e.context&&(e.context.formatPrefix=Y.SEALED),e}}async function ho(e,t){if(!(e instanceof Uint8Array))return e;let n=Ha(e);if(n===Y.SEALED)return mo(e,t);if(n!==Y.ENCRYPTED)return e;let r=uo(t);if(!r)throw new h(`Encrypted data encountered but no encryption key is available. Encryption is not configured or no key was provided for this run.`,{context:{operation:`decrypt`,byteLength:e.byteLength,formatPrefix:`encr`}});let{payload:i}=Z(e);try{return await yr(r,i)}catch(e){throw h.is(e)&&e.context&&(e.context.formatPrefix=n),e}}function go(e,t,n){let[r,...i]=t.split(`
6
+ `),a=i.join(`
7
+ `),o=_o(r??``,n),s=vo(a),c=[`${e} ${r??``}`];return o&&c.push(o),s&&c.push(s),c.join(`
8
+ `)}function _o(e,t){if(!t||Object.keys(t).length===0)return null;let n=new Set;n.add(`errorStack`),typeof t.errorMessage==`string`&&e.includes(t.errorMessage)&&n.add(`errorMessage`);let r=new Set([`workflowRunId`,`workflowName`,`stepId`,`stepName`,`errorAttribution`,`errorCode`,`errorName`,`errorMessage`,`errorStack`,`hint`,`attempt`,`retryCount`]),i=[],a=bo(t,`errorName`),o=bo(t,`errorAttribution`);if(a||o){let e=o?o===`sdk`?Le(`sdk error`):Ie(`user error`):``,t=a?Fe(a):``,n=e&&t?A(` · `):``;i.push(` ${e}${n}${t}`)}let s=bo(t,`workflowRunId`),c=bo(t,`workflowName`);s?i.push(So(`run`,s,c,we)):c&&i.push(So(`run`,null,c,we));let l=bo(t,`stepId`),u=bo(t,`stepName`);if((l||u)&&i.push(So(`step`,l,u,Ce)),t.attempt!==void 0||t.retryCount!==void 0){let e=t.attempt,n=t.retryCount;e!==void 0&&n!==void 0?i.push(` ${xo(`retry`)} ${e} ${A(`attempts ·`)} ${n} ${A(`max retries`)}`):e!==void 0&&i.push(` ${xo(`retry`)} ${e} ${A(`attempts`)}`)}let d=bo(t,`errorCode`);d&&d!==a&&i.push(` ${xo(`code`)} ${A(d)}`);let f=bo(t,`hint`);f&&i.push(` ${Me(f)}`);let p=Object.entries(t).filter(([e,t])=>!r.has(e)&&!n.has(e)&&t!=null).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of p)i.push(` ${xo(e)} ${Co(t)}`);return i.length?i.join(`
9
+ `):null}function vo(e){if(!e)return null;let t=e.split(`
10
+ `),n=[],r=0,i=0,a=0,o=()=>{r>0&&(n.push(A(` … ${r} more ${r===1?`frame`:`frames`} in framework internals`)),r=0)};for(let e of t){let t=e.trimStart().startsWith(`at `);if(t&&yo(e)){r++;continue}if(t&&i>=6){a++;continue}o(),n.push(e),t&&i++}return o(),a>0&&n.push(A(` … ${a} more ${a===1?`frame`:`frames`} (run \`pnpm wf inspect run <id>\` for the full stack)`)),n.join(`
11
+ `)}function yo(e){let t=e.trimStart();return t.startsWith(`at `)?!!(t.includes(`node:internal/`)||t.includes(`node_modules/.pnpm/`)||t.includes(`node_modules__pnpm_`)||t.includes(`_next_dist_`)||t.includes(`node_modules/next/`)||t.includes(`node_modules/@opentelemetry/`)||t.includes(`node_modules/vitest/`)||t.includes(`node_modules/@vitest/`)):!1}function bo(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:null}function xo(e){return A(e.padEnd(6))}function So(e,t,n,r){let i=t||A(`—`),a=n&&(e===`run`?xe(n):Se(n))?`${A(`·`)} ${r(n)}`:``;return` ${xo(e)} ${i}${a?` `+a:``}`}function Co(e){if(typeof e==`string`)return e.includes(`
12
+ `)?e.split(`
13
+ `).map((e,t)=>t===0?e:` ${e}`).join(`
14
+ `):e;if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}var wo=class e extends Error{steps;globalThis;stepCount;hookCount;waitCount;attributeCount;hookDisposedCount;abortCount;constructor(e,t){let r=[...e.values()],i=0,a=0,o=0,s=0,c=0,l=0;for(let e of r)e.type===`step`?i++:e.type===`hook`?e.disposed?c++:e.abortRequested?l++:a++:e.type===`wait`?o++:e.type===`attribute`&&s++;let u=[];i>0&&u.push(`${i} ${n(`step`,`steps`,i)}`),a>0&&u.push(`${a} ${n(`hook`,`hooks`,a)}`),o>0&&u.push(`${o} ${n(`wait`,`waits`,o)}`),s>0&&u.push(`${s} ${n(`attribute write`,`attribute writes`,s)}`),c>0&&u.push(`${c} hook ${n(`disposal`,`disposals`,c)}`);let d=n(`has`,`have`,i+a+o+s+c),f=+(i>0)+ +(a>0)+ +(o>0)+ +(s>0)+ +(c>0),p;p=f>1?`processed`:i>0?`run`:a>0||o>0?`created`:s>0?`written`:c>0?`processed`:`received`;let m=u.length>0?`${u.join(` and `)} ${d} not been ${p} yet`:`0 steps have not been run yet`;super(m),this.name=`WorkflowSuspension`,this.steps=r,this.globalThis=t,this.stepCount=i,this.hookCount=a,this.waitCount=o,this.attributeCount=s,this.hookDisposedCount=c,this.abortCount=l}static is(t){return t instanceof e}};function To(){throw new r(`This API is not available inside a workflow function. Workflow functions run in a deterministic VM; move the call to a step function for full Node.js access.`)}function Q(...e){return t=>Object.fromEntries(e.map(e=>[e,t]))}const Eo=Q(`workflow.name`),Do=Q(`workflow.operation`),Oo=Q(`workflow.run.id`),ko=Q(`workflow.run.status`),Ao=Q(`workflow.started_at`),jo=Q(`workflow.events.count`),Mo=Q(`workflow.execution.mode`),No=Q(`workflow.events.parked.count`),Po=Q(`workflow.events.parked.event_id`),Fo=Q(`workflow.events.parked.event_type`),Io=Q(`workflow.arguments.count`),Lo=Q(`workflow.result.type`),Ro=Q(`workflow.trace.propagated`),zo=Q(`workflow.trace.mode`),Bo=Q(`workflow.turbo`),Vo=Q(`workflow.error.name`),Ho=Q(`workflow.error.message`),Uo=Q(`workflow.error.code`),Wo=Q(`workflow.steps.created`),Go=Q(`workflow.hooks.created`),Ko=Q(`workflow.waits.created`),qo=Q(`workflow.inline_ownership.owned_recovery_steps`),Jo=Q(`workflow.inline_ownership.backstop_wakes_armed`),Yo=Q(`workflow.route.type`),Xo=Q(`workflow.route.handler_cached`),Zo=Q(`workflow.route.invocation_count`),Qo=Q(`workflow.route.entrypoint_age_ms`),$o=Q(`workflow.route.module_body_init_ms`),es=Q(`faas.instance`),ts=Q(`step.name`),ns=Q(`step.id`),rs=Q(`step.attempt`),is=Q(`step.status`),as=Q(`step.max_retries`),os=Q(`step.ttfs_ms`),ss=Q(`step.stso_ms`),cs=Q(`step.rsfs_ms`),ls=Q(`step.final_scheduling_replay_ms`),us=Q(`step.latency_optimizations`),ds=Q(`step.skipped`),fs=Q(`step.skip_reason`),ps=Q(`step.arguments.count`),ms=Q(`step.result.type`),hs=Q(`step.error.name`),gs=Q(`step.error.message`),_s=Q(`step.fatal_error`),vs=Q(`step.retry.exhausted`),ys=Q(`step.retry.timeout_seconds`),bs=Q(`step.retry.will_retry`),xs=Q(`messaging.system`),Ss=Q(`messaging.destination.name`),Cs=Q(`messaging.message.id`),ws=Q(`messaging.operation.type`),Ts=Q(`workflow.queue.overhead_ms`),Es=Q(`deployment.id`),Ds=Q(`workflow.deployment.pinned_id`),Os=Q(`workflow.deployment_mismatch.retry_count`),ks=Q(`workflow.deployment_mismatch.recovered`),As=Q(`workflow.hook.token`),js=Q(`workflow.hook.id`),Ms=Q(`workflow.hook.found`),Ns=Q(`workflow.hook.resilient_resume`),Ps=Q(`workflow.hook.resilient_resume_materialized`),Fs=Q(`workflow.resume_setup_source`),Is=Q(`workflow.suspension.state`),Ls=Q(`workflow.suspension.hook_count`),Rs=Q(`workflow.suspension.step_count`),zs=Q(`workflow.suspension.wait_count`),Bs=Q(`http.request.method`),Vs=Q(`http.route`),Hs=Q(`http.response.status_code`),Us=Q(`error.type`),Ws=Q(`workflow.events.pages_loaded`),Gs=Q(`workflow.queue.deserialize_time_ms`),Ks=Q(`workflow.queue.execution_time_ms`),qs=Q(`workflow.queue.serialize_time_ms`),Js=Q(`workflow.serialization.operation`),Ys=Q(`workflow.serialization.compressed`),Xs=Q(`workflow.serialization.codec`),Zs=Q(`workflow.serialization.uncompressed_bytes`),Qs=Q(`workflow.serialization.stored_bytes`),$s=Q(`workflow.serialization.compression_ratio`),ec=Q(`workflow.serialization.guest_code_executions`),tc=Q(`workflow.serialization.guest_code_details`),nc=Q(`peer.service`),rc=Q(`rpc.system`),ic=Q(`rpc.service`),ac=Q(`rpc.method`),oc=Q(`error.retryable`),sc=Q(`error.category`),cc=new Set;function lc(){let e=process.env.WORKFLOW_TRACE_MODE;return e===`continuous`?`continuous`:(e&&e!==`linked`&&!cc.has(e)&&(cc.add(e),Nc.warn(`Unrecognized WORKFLOW_TRACE_MODE value "${e}"; expected "linked" or "continuous". Falling back to "linked".`)),`linked`)}function uc(e){return e!==void 0&&Object.keys(e).length>0}function dc(e,t){return e===`linked`&&uc(t)?Promise.resolve(t):pc()}async function fc(e,t){if(e!==`linked`)return Dc();let n=await Oc(uc(t)?t:void 0);return n?[n]:void 0}async function pc(){let e=await gc.value;if(!e)return{};let t={};return e.propagation.inject(e.context.active(),t),t}async function mc(e){let t=await gc.value;if(t)return t.propagation.extract(t.context.active(),e)}async function hc(e,t){if(!e)return t();let n=await gc.value;if(!n)return t();let r=await mc(e);return r?n.context.with(r,async()=>await t()):t()}const gc=b(async()=>{try{return await import(`./src-Cj3P1ChQ.js`).then(t=>e(t.t(),1))}catch{return Nc.info(`OpenTelemetry not available, tracing will be disabled`),null}}),_c=b(async()=>{let e=await gc.value;if(!e)return null;let t=e.trace.getTracer(`workflow`);return yc(e,t),t});let vc=!1;function yc(e,t){let n=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`);if(!(vc||!n)){vc=!0;try{let n=globalThis[Symbol.for(`opentelemetry.js.api.1`)],r=e.trace.getTracerProvider(),i=r.getDelegate?.()??r,a=t.startSpan(`workflow.otel.probe.core`);console.warn(`[workflow:otel-diag] core`,JSON.stringify({globalRegistrationVersion:n?.version??null,providerCtor:r?.constructor?.name??null,delegateCtor:i?.constructor?.name??null,tracerCtor:t?.constructor?.name??null,probeCtor:a?.constructor?.name??null,probeRecording:a.isRecording()})),a.end()}catch(e){console.warn(`[workflow:otel-diag] core failed:`,e instanceof Error?e.message:e)}}}async function bc(e,...t){let[n,r]=await Promise.all([_c.value,gc.value]),{fn:i,opts:a}=typeof t[0]==`function`?{fn:t[0],opts:{}}:{fn:t[1],opts:t[0]};if(!i)throw Error(`Function to trace must be provided`);return!n||!r?await i():n.startActiveSpan(e,a,async e=>{try{let t=await i(e);return e.setStatus({code:r.SpanStatusCode.OK}),t}catch(t){throw wo.is(t)?(e.setStatus({code:r.SpanStatusCode.OK}),Sc(t,e)):e.setStatus({code:r.SpanStatusCode.ERROR,message:t.message}),t}finally{e.end()}})}async function xc(e,t,n){let r=await _c.value;r&&r.startSpan(e,{...n,startTime:t}).end()}function Sc(e,t){t.setAttributes({...Is(`suspended`),...Rs(e.stepCount),...Ls(e.hookCount),...zs(e.waitCount)})}async function Cc(e){let[t,n]=await Promise.all([mc(e),gc.value]);if(!(!t||!n))return n.trace.getSpanContext(t)}async function wc(){return await Ec(e=>e.trace.getActiveSpan())}async function Tc(e){return Ec(t=>t.SpanKind[e])}async function Ec(e){let t=await gc.value;if(t)return await e(t)}function Dc(){return Ec(e=>{let t=e.trace.getActiveSpan()?.spanContext();if(t)return[{context:t}]})}async function Oc(e){if(!e)return;let[t,n]=await Promise.all([Cc(e),gc.value]);if(!(!t||!n)&&n.trace.isSpanContextValid(t))return{context:t}}async function kc(e,t){let n=await gc.value;if(!n)return t();let r=n.propagation.createBaggage({"workflow.run_id":{value:e.workflowRunId},"workflow.name":{value:e.workflowName}}),i=n.propagation.setBaggage(n.context.active(),r);return n.context.with(i,()=>t())}function Ac(e,t){if(!t)return!1;let n=!1;for(let r of t.split(`,`)){let t=r.trim();if(!t)continue;let i=t.startsWith(`-`),a=i?t.slice(1):t;RegExp(`^${a.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`.*`)}$`).test(e)&&(n=!i)}return n}function jc(e,t={}){let n=r=>{let i=n=>t.debugNamespace??`workflow:${e}:${n}`,a=t=>{let n=i(t);return(i,a)=>{let o=Object.keys(r).length>0,s=a&&Object.keys(a).length>0,c=o||s?{...r,...a??{}}:void 0;(t===`error`||t===`warn`)&&(t===`error`?console.error:console.warn)(go(`[workflow-sdk]`,i,c)),Ac(n,process.env.DEBUG)&&(console.debug(`[${n}] ${i}`,c??``),wc().then(n=>{n?.addEvent(`${t}.${e}`,{message:i,...c})}).catch(()=>{}))}};return{debug:a(`debug`),info:a(`info`),warn:a(`warn`),error:a(`error`),child:e=>n({...r,...e}),forRun:(e,t,i)=>n({...r,workflowRunId:e,...t===void 0?{}:{workflowName:t},...i??{}})}};return n({})}const Mc=jc(`step`),Nc=jc(`runtime`),Pc=jc(`webhook`),Fc=jc(`events`);jc(`adapter`),jc(`build`,{debugNamespace:`workflow:build`});function Ic(e){if(h.is(e))throw e}function Lc(e,t){let n=e.includes(`return value`)?`returning`:`passing`,r=`Failed to serialize ${e}`;t instanceof In&&t.path&&(r+=` at path "${t.path}"`);let i=`Ensure you're ${n} workflow serializable types. Check the serialization docs to see what's serializable: https://workflow-sdk.dev/docs/foundations/serialization`;return t instanceof In&&t.value!==void 0&&Nc.error(`Serialization failed`,{context:e,problematicValue:t.value}),{message:r,hint:i}}async function Rc(e,t,n){try{let r=X.serialize(e,`client`,n);return po(await to(Va(Y.DEVALUE_V1,r),n?.compression===!0,n?.compressionStats),t)}catch(e){Ic(e);let{message:t,hint:n}=Lc(`client value`,e);throw new m(t,{hint:n,cause:e})}}async function zc(e,t,n){let r=await no(await ho(e,t),n?.compressionStats);if(!(r instanceof Uint8Array)){if(X.deserializeLegacy)return X.deserializeLegacy(r,`client`,n);throw Error(`Cannot deserialize non-binary data without legacy support`)}let{format:i,payload:a}=Z(r);if(i===Y.DEVALUE_V1)return X.deserialize(a,`client`,n);throw Error(`Unsupported serialization format: ${i}`)}async function Bc(e,t,n){try{let r=X.serialize(e,`step`,n);return po(await to(Va(Y.DEVALUE_V1,r),n?.compression===!0,n?.compressionStats),t)}catch(e){Ic(e);let{message:t,hint:n}=Lc(`step value`,e);throw new m(t,{hint:n,cause:e})}}async function Vc(e,t,n){let r=await no(await ho(e,t),n?.compressionStats);if(!(r instanceof Uint8Array)){if(X.deserializeLegacy)return X.deserializeLegacy(r,`step`,n);throw Error(`Cannot deserialize non-binary data without legacy support`)}let{format:i,payload:a}=Z(r);if(i===Y.DEVALUE_V1)return X.deserialize(a,`step`,n);throw Error(`Unsupported serialization format: ${i}`)}function Hc(e,t){if(!(e instanceof Uint8Array)){if(X.deserializeLegacy)return X.deserializeLegacy(e,`workflow`,t);throw Error(`Cannot deserialize non-binary data without legacy support`)}let{format:n,payload:r}=Z(e);if(n===Y.DEVALUE_V1)return X.deserialize(r,`workflow`,t);throw Error(`Unsupported serialization format: ${n}`)}const Uc=Symbol.for(`WORKFLOW_STEP_CONTEXT_STORAGE`),Wc=(()=>{let e=globalThis;return e[Uc]??=new ye,e[Uc]})();function Gc(e,t,r){if(e===0&&t===0&&r===0)return null;let i=[];e>0&&i.push(`${e} ${n(`step`,`steps`,e)}`),t>0&&i.push(`${t} ${n(`hook`,`hooks`,t)}`),r>0&&i.push(`${r} ${n(`timer`,`timers`,r)}`);let a=[];e>0&&a.push(`steps are completed`),t>0&&a.push(`hooks are received`),r>0&&a.push(`timers have elapsed`);let o=a.join(` and `);return`${i.join(` and `)} to be enqueued\n Workflow will suspend and resume when ${o}`}function Kc(e,t){let n=`${e.replace(`wrun_`,`strm_`)}_user`;return t?`${n}_${Buffer.from(t,`utf-8`).toString(`base64url`)}`:n}function qc(e){return`strm_${e}_system_abort`}function Jc(e){if(!e.startsWith(`abrt_`))throw Error(`Invalid abort hook token format: expected "abrt_" prefix, got "${e}"`);return qc(e.slice(5))}const Yc=()=>Et(`WORKFLOW_DEFERRED_CHECK_DELAY_MS`,100,{integer:!0,min:10}),Xc=new Set([`hook_received`,`hook_conflict`,`wait_completed`,`attr_set`,`run_cancelled`]),Zc=new Set([`wait_completed`]);function Qc(e,t){return`${e}:${t}`}const $c=new Set([`run_completed`,`run_failed`,`run_cancelled`]);var $;(function(e){e[e.Consumed=0]=`Consumed`,e[e.NotConsumed=1]=`NotConsumed`,e[e.Finished=2]=`Finished`})($||={});var el=class{eventIndex;events;callbacks=[];parked=[];resolved=new Set;onConsumedEvent;onUnconsumedEvent;getPromiseQueue;isDeliveryIdle;pendingUnconsumedCheck=null;pendingUnconsumedTimeout=null;unconsumedCheckVersion=0;constructor(e,t){this.events=[...e],this.eventIndex=0,this.onConsumedEvent=t.onConsumedEvent,this.onUnconsumedEvent=t.onUnconsumedEvent,this.getPromiseQueue=t.getPromiseQueue,this.isDeliveryIdle=t.isDeliveryIdle}get strandedEvent(){return this.parked[0]?.event}get parkedSummary(){let e=this.parked[0]?.event;if(e)return{count:this.parked.length,eventId:e.eventId,eventType:e.eventType}}append(e){for(let t of e)this.events.push(t);process.nextTick(this.consume)}subscribe(e){this.callbacks.push(e),this.pendingUnconsumedCheck!==null&&(this.unconsumedCheckVersion++,this.pendingUnconsumedCheck=null,this.pendingUnconsumedTimeout!==null&&(clearTimeout(this.pendingUnconsumedTimeout),this.pendingUnconsumedTimeout=null)),process.nextTick(this.consume)}notifyConsumedEvent(e){if(this.onConsumedEvent)try{this.onConsumedEvent(e)}catch(e){Fc.error(`onConsumedEvent callback threw an error`,{error:e})}}consume=()=>{for(;;){this.drainParked();let e=this.events[this.eventIndex]??null,t=this.offer(e);if(t&&this.eventIndex++,e===null){t||this.handleEndOfLog();return}if(!t){this.scheduleUnconsumedCheck(e,!0);return}}};offer(e){for(let t=0;t<this.callbacks.length;t++){let n=this.callbacks[t],r=$.NotConsumed;try{r=n(e)}catch(e){Fc.error(`EventConsumer callback threw an error`,{error:e})}if(!(r!==$.Consumed&&r!==$.Finished))return e!==null&&(e.correlationId&&Zc.has(e.eventType)&&this.resolved.add(Qc(e.eventType,e.correlationId)),this.notifyConsumedEvent(e)),r===$.Finished&&this.callbacks.splice(t,1),!0}return!1}drainParked(){let e=this.parked.length>0;for(;e;){e=!1;for(let t=0;t<this.parked.length;t++){let n=this.parked[t],r=this.eventIndex;this.eventIndex=n.index;let i;try{i=this.offer(n.event)}finally{this.eventIndex=r}if(i){this.parked.splice(t,1),e=this.parked.length>0;break}}}}park(e){return!Xc.has(e.eventType)||e.correlationId&&this.resolved.has(Qc(e.eventType,e.correlationId))?!1:(this.parked.push({event:e,index:this.eventIndex}),this.eventIndex++,Fc.debug(`Parked an unclaimed event for later delivery`,{eventId:e.eventId,eventType:e.eventType,correlationId:e.correlationId,parked:this.parked.length}),!0)}handleEndOfLog(){if(this.parked.length===0)return;let e=this.events.at(-1);if(!e||!$c.has(e.eventType)){Fc.debug(`Reached the end of the log still holding events`,{eventId:this.parked[0].event.eventId,eventType:this.parked[0].event.eventType,correlationId:this.parked[0].event.correlationId,parked:this.parked.length});return}this.scheduleUnconsumedCheck(this.parked[0].event,!1)}scheduleUnconsumedCheck(e,t){let n=++this.unconsumedCheckVersion;this.pendingUnconsumedCheck=this.getPromiseQueue().then(()=>new Promise(e=>setTimeout(e,0))).then(()=>this.getPromiseQueue()).then(()=>{this.whenDeliveryIdle(n,()=>{this.pendingUnconsumedTimeout=setTimeout(()=>{if(this.pendingUnconsumedTimeout=null,this.unconsumedCheckVersion===n){if(this.pendingUnconsumedCheck=null,t){if(this.events[this.eventIndex]!==e)return;if(this.park(e)){this.consume();return}}this.onUnconsumedEvent(e)}},Yc())})})}whenDeliveryIdle(e,t){let n=()=>{if(this.pendingUnconsumedTimeout=null,this.unconsumedCheckVersion===e){if(this.isDeliveryIdle()){t();return}this.getPromiseQueue().then(()=>{this.unconsumedCheckVersion===e&&(this.pendingUnconsumedTimeout=setTimeout(n,0))})}};n()}},tl=class{aborted=!1;reason=void 0;[z];[B];#e=[];#t=null;get onabort(){return this.#t}set onabort(e){this.#t=e,e&&this.aborted&&e.call(this)}constructor(e,t){this[z]=e,this[B]=t}_setAborted(e){if(!this.aborted){this.aborted=!0,this.reason=e,this.#t&&this.#t.call(this);for(let e of this.#e)e();this.#e=[]}}addEventListener(e,t){if(e===`abort`){if(this.aborted){t();return}this.#e.push(t)}}removeEventListener(e,t){e===`abort`&&(this.#e=this.#e.filter(e=>e!==t))}throwIfAborted(){if(this.aborted)throw this.reason??new DOMException(`The operation was aborted.`,`AbortError`)}};function nl(e){return class{signal;[z];[B];constructor(){let t=e.generateUlid(),n=qc(t),r=`abrt_${t}`;this[z]=n,this[B]=r,this.signal=new tl(n,r);let i=`hook_${e.generateUlid()}`;e.invocationsQueue.set(i,{type:`hook`,correlationId:i,token:r,isWebhook:!1,isSystem:!0}),e.eventsConsumer.subscribe(t=>{if(!t||t.correlationId!==i)return $.NotConsumed;let n=`eventData`in t&&t.eventData&&`token`in t.eventData?t.eventData.token:void 0;if(typeof n==`string`&&n!==this[B])return e.promiseQueue=e.promiseQueue.then(()=>{e.onWorkflowError(new p(`Replay divergence: abort hook event ${t.eventType} for ${i} belongs to token "${n}", but the current abort hook expects "${this[B]}"`,{eventId:t.eventId}))}),$.Finished;if(t.eventType===`hook_created`){let t=e.invocationsQueue.get(i);return t&&t.type===`hook`&&(t.hasCreatedEvent=!0),$.Consumed}if(t.eventType===`hook_received`){let n=t.eventData?.payload,r=e.eventsConsumer.eventIndex,a=y(e,r,`hook`),o=ne(e,r,`hook`);return e.pendingDeliveries++,e.promiseQueue=e.promiseQueue.then(async()=>{let r;try{if(n!==void 0)try{let i=await e.replayPayloadCache.prepareEventPayload(t.eventId,`payload`,n),a=await iu(n,e.runId,e.encryptionKey,e.globalThis,{},i);a&&typeof a==`object`&&`reason`in a&&(r=a.reason)}catch{}}finally{e.pendingDeliveries--}o.then(()=>{a.markDelivered(),this.signal._setAborted(r)})}),e.invocationsQueue.delete(i),$.Consumed}return t.eventType===`hook_disposed`?(e.invocationsQueue.delete(i),$.Finished):$.NotConsumed})}abort(t){if(!this.signal.aborted){this.signal._setAborted(t);for(let[,n]of e.invocationsQueue)if(n.type===`hook`&&n.token===this[B]){n.abortRequested=!0,n.abortReason=t;break}}}}}function rl(){return{abort(e){let t=new tl(``,``);return t._setAborted(e??new DOMException(`The operation was aborted.`,`AbortError`)),t},any(e){let t=new tl(``,``),n=Array.from(e);for(let e of n)if(e.aborted)return t._setAborted(e.reason),t;let r=[],i=()=>{for(let{signal:e,listener:t}of r)e.removeEventListener&&e.removeEventListener(`abort`,t);r.length=0};for(let e of n){if(!e.addEventListener)continue;let n=()=>{t.aborted||(t._setAborted(e.reason),i())};r.push({signal:e,listener:n}),e.addEventListener(`abort`,n)}return t},timeout(){throw Error(`AbortSignal.timeout() is not supported in workflow functions. Use sleep() with an AbortController instead. See: /docs/errors/abort-signal-timeout-in-workflow`)}}}const il=me();function al(e){try{return e.getReader({mode:`byob`}).releaseLock(),`bytes`}catch{}}function ol(e){return Ic(e),e instanceof m&&e.cause!==void 0||e instanceof r&&e.cause!==void 0?e.cause:e}async function sl(e,t){if(e.recorded)try{let n=await wc();if(!n)return;let r=e.uncompressedBytes??0,i=e.storedBytes??0;n.setAttributes({...Js(t),...Ys(e.compressed??!1),...Xs(e.codec??`none`),...Zs(r),...Qs(i),...e.compressed&&r>0?$s(1-i/r):{}})}catch{}}async function cl(e){if(e.executions.length!==0)try{let t=await wc();if(!t)return;let n=[...new Set(e.executions.map(e=>e.detail?`${e.kind} (${e.detail})`:e.kind))];t.setAttributes({...ec(e.executions.length),...tc(n)})}catch{}}function ll(e,t){let n=new TextEncoder,r={resolved:!1,key:void 0},i;return new TransformStream({async transform(a,o){try{r.resolved||(r.key=await fo(t),r.resolved=!0,co(r.key)&&(i=yi(r.key.recipientPublicKey,r.key.aad)));let s=pr(a,e),c=n.encode(s),l=Va(Y.DEVALUE_V1,c);i?l=Va(Y.SEALED,await i.seal(l)):r.key&&(l=await po(l,r.key));let u=new Uint8Array(4+l.length);new DataView(u.buffer).setUint32(0,l.length,!1),u.set(l,4),o.enqueue(u)}catch(e){if(h.is(e)){o.error(e);return}let{message:t,hint:n}=Lc(`stream chunk`,e);o.error(new m(t,{hint:n,cause:e}))}}})}function ul(e,t){let n=new TextDecoder,r=new Uint8Array,i={resolved:!1,key:void 0},a;function o(e){let t=new Uint8Array(r.length+e.length);t.set(r,0),t.set(e,r.length),r=t}async function s(o){for(i.resolved||(i.key=await fo(t),i.resolved=!0,lo(i.key)&&(a=bi(i.key.keyPair,i.key.aad)));r.length>=4;){let t=new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,!1);if(r.length<4+t)break;let s=r.slice(4,4+t);r=r.slice(4+t);let{format:c,payload:l}=Z(s);if(c===Y.ENCRYPTED||c===Y.SEALED){let e=c===Y.SEALED;if(!(e?lo(i.key):uo(i.key)!==void 0)){o.error(new h(e?`Sealed stream data encountered but no run keypair is available. Opening a sealed frame requires the run's own encryption key material.`:`Encrypted stream data encountered but no encryption key is available. Encryption is not configured or no key was provided for this run.`,{context:{operation:`decrypt`,byteLength:l.byteLength,formatPrefix:e?`encp`:`encr`}}));return}let t;try{t=e?await a.open(Z(s).payload):await ho(s,i.key)}catch(e){throw h.is(e)&&e.context&&(e.context.formatPrefix=c),e}({format:c,payload:l}=Z(t))}if(c===Y.DEVALUE_V1){let t=n.decode(l);o.enqueue(dr(t,e))}}}return new TransformStream({async transform(t,i){if(r.length===0&&t.length>=4){let e=new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(0,!1);if(e>0&&e<1e8){o(t),await s(i);return}}else if(r.length>0){o(t),await s(i);return}let a=n.decode(t).split(`
15
+ `);for(let t of a)t.length>0&&i.enqueue(dr(t,e))},async flush(e){r.length>0&&await s(e)}})}const dl=1e8;function fl(){return new TransformStream({transform(e,t){if(e.length===0)return;if(e.length>dl){t.error(new r(`Byte-stream chunk of ${e.length} bytes exceeds the maximum framed chunk size (${dl}). Split the data into smaller chunks before writing.`,{slug:`serialization-failed`}));return}let n=new Uint8Array(4+e.length);new DataView(n.buffer).setUint32(0,e.length,!1),n.set(e,4),t.enqueue(n)}})}function pl(){let e=new Uint8Array;function t(t){let n=new Uint8Array(e.length+t.length);n.set(e,0),n.set(t,e.length),e=n}return new TransformStream({transform(n,i){for(n.length>0&&t(n);e.length>=4;){let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0,!1);if(t>dl){i.error(new r(`Byte-stream frame length ${t} exceeds maximum (${dl}). This usually means a non-framed byte stream is being read as framed.`,{slug:`serialization-failed`}));return}let n=4+t;if(e.length<n)break;i.enqueue(e.slice(4,n)),e=e.slice(n)}},flush(t){e.length>0&&t.error(new r(`Byte-stream ended with ${e.length} bytes of incomplete frame data. The stream was truncated mid-frame.`,{slug:`serialization-failed`}))}})}function ml(e,t,n,r,i){(async()=>{await xc(`workflow.stream.read`,e,{kind:await Tc(`CLIENT`),attributes:{"workflow.run.id":t,"workflow.stream.name":n,"workflow.stream.operation":`read`,"workflow.stream.read.ttfc_ms":Date.now()-e,...typeof i==`number`?{"workflow.stream.read.connect_ms":i}:{},...typeof r==`number`?{"workflow.stream.start_index":r}:{}}})})()}function hl(e,t,n,r,i,a){(async()=>{await xc(`workflow.stream.read.complete`,e,{kind:await Tc(`CLIENT`),attributes:{"workflow.run.id":t,"workflow.stream.name":n,"workflow.stream.operation":`read_complete`,"workflow.stream.read.total_ms":Date.now()-e,"workflow.stream.read.chunks":r,"workflow.stream.read.bytes":i,...typeof a==`number`?{"workflow.stream.read.reconnects":a}:{}}})})()}var gl=class extends ReadableStream{#e;constructor(e,t,n){if(typeof t!=`string`||t.length===0)throw new r(`"name" is required, got "${t}"`);let i,a=!1,o,s=0,c=0;super({type:`bytes`,pull:async r=>{let l=this.#e;if(!l){i===void 0&&(i=Date.now());let r=await ti(),a=Date.now(),s=await r.streams.get(e,t,n);o=Date.now()-a,l=this.#e=s.getReader()}if(!l){r.error(Error(`Failed to get reader`));return}let u=await l.read();u.done?(this.#e=void 0,i!==void 0&&hl(i,e,t,s,c),r.close()):(!a&&u.value.byteLength>0&&i!==void 0&&(a=!0,ml(i,e,t,n,o)),s+=1,c+=u.value.byteLength,r.enqueue(u.value))},cancel:async e=>{this.#e&&=(await this.#e.cancel(e).catch(()=>{}),void 0)}})}};const _l=()=>Et(`WORKFLOW_FRAMED_STREAM_MAX_RECONNECTS`,50,{integer:!0,min:1}),vl=()=>Et(`WORKFLOW_FRAMED_STREAM_MAX_TOTAL_RECONNECTS`,1e3,{integer:!0,min:1});function yl(e,t,n){let r=n===void 0||n>=0,i=n??0,a=0,o=0,s=0,c,l=new Uint8Array,u,d,f=!1,p=0,m=0;async function h(){let o=await ti(),s=r?i+a:n,l=Date.now(),u=await o.streams.get(e,t,s);d===void 0&&(d=Date.now()-l),c=u.getReader()}async function g(){c&&=(await c.cancel().catch(()=>{}),void 0),i+=a,a=0,l=new Uint8Array;let e=_l(),n=vl();for(;;){if(o++,s++,o>e)throw Error(`Stream "${t}" exceeded maximum reconnection attempts (${e})`);if(s>n)throw Error(`Stream "${t}" exceeded maximum total reconnection attempts (${n})`);try{await h();return}catch{}}}return new ReadableStream({pull:async i=>{for(u===void 0&&(u=Date.now());;){if(!c)try{await h()}catch(e){i.error(e);return}let _;try{_=await c.read()}catch(e){if(!r){i.error(e);return}try{await g()}catch(e){i.error(e);return}continue}if(_.done||!_.value){c=void 0,u!==void 0&&hl(u,e,t,p,m,s),i.close();return}let v=_.value;if(v.length>0){let e=new Uint8Array(l.length+v.length);e.set(l,0),e.set(v,l.length),l=e}let y=!1;for(;l.length>=4;){let r=4+new DataView(l.buffer,l.byteOffset,l.byteLength).getUint32(0,!1);if(l.length<r)break;i.enqueue(l.slice(0,r)),l=l.slice(r),a++,p++,m+=r,!f&&u!==void 0&&(f=!0,ml(u,e,t,n,d)),y=!0}if(y){o=0;return}}},cancel:async()=>{c&&=(await c.cancel().catch(e=>{console.warn(`Error closing ReadableStream reader:`,e)}),void 0)}})}const bl=()=>{let e=Et(`WORKFLOW_STREAM_FLUSH_INTERVAL_MS`,NaN,{integer:!0});return Number.isNaN(e)?void 0:e};function xl(e,t,n,r,i,a,o){(async()=>{await xc(`workflow.stream.flush`,e,{kind:await Tc(`CLIENT`),attributes:{"workflow.run.id":n,"workflow.stream.name":r,"workflow.stream.operation":`flush`,"workflow.stream.flush.buffer_dwell_ms":t-e,"workflow.stream.flush.chunks":i,"workflow.stream.flush.bytes":a,"workflow.stream.write.chunk_rtt":o}})})()}function Sl(e,t,n){(async()=>{await xc(`workflow.stream.close`,e,{kind:await Tc(`CLIENT`),attributes:{"workflow.run.id":t,"workflow.stream.name":n,"workflow.stream.operation":`close`,"workflow.stream.close.rpc_ms":Date.now()-e}})})()}var Cl=class extends WritableStream{constructor(e,t,n){if(typeof e!=`string`)throw new r(`"runId" must be a string, got "${typeof e}"`);if(typeof t!=`string`||t.length===0)throw new r(`"name" is required, got "${t}"`);let i=ti(),a=n,o=async()=>{if(a){try{await a}catch{}a=void 0}},s=[],c=0,l=0,u=0,d=null,f=null,p,m=bl(),h=null,g=zr(),_=Br(),v=Rr(),y=Vr(),b,ee=[],te=[],ne=e=>{let t=[...ee,...te];ee=[],te=[];for(let n of t)n.reject(e)},re=()=>{let e=0,t=0;for(let n of s){if(e>=g||e>0&&t+n.byteLength>_)break;e++,t+=n.byteLength}let n=s.slice(0,e);return s=s.slice(e),c-=t,{group:n,bytes:t}},ie=async(n,r,a)=>{await o();let s=await i,c=Date.now();if(typeof s.streams.writeMulti==`function`&&n.length>1)await s.streams.writeMulti(e,t,n);else for(let r of n)await s.streams.write(e,t,r);a!==void 0&&xl(a,c,e,t,n.length,r,Date.now()-c)},ae=async()=>{for(;s.length>0;){d&&=(clearTimeout(d),null);let e=b,t=Date.now(),{group:n,bytes:r}=re();l=n.length,u=r,b=s.length>0?t:void 0;try{await ie(n,r,e),l=0,u=0}catch(t){throw s=n.concat(s),c+=r,l=0,u=0,b=e!==void 0&&b!==void 0?Math.min(e,b):e??b,t}let i=ee;ee=[];for(let e of i)e.resolve()}},oe=()=>{f||p!==void 0||s.length===0||(f=ae().then(()=>{if(f=null,s.length>0){oe();return}let e=te;te=[];for(let t of e)t.resolve()},e=>{f=null,p??=e,ne(p)}))},x=()=>{if(!(d||f)){if(m===void 0){h??=Promise.resolve(i).then(e=>{m=e.streamFlushIntervalMs??0},()=>{m=0}).then(()=>{s.length>0&&x()});return}if(m<=0){oe();return}d=setTimeout(()=>{d=null,oe()},m)}},se=async()=>{for(;;){if(p!==void 0)throw p;if(s.length===0&&!f)return;oe(),await new Promise((e,t)=>{te.push({resolve:e,reject:t})})}};super({async write(e){if(p!==void 0)throw p;for(b===void 0&&(b=Date.now()),s.push(e),c+=e.byteLength,s.length>=g||c>=_?oe():x();p===void 0&&(s.length+l>=v||c+u>=y);)oe(),await new Promise((e,t)=>{ee.push({resolve:e,reject:t})});if(p!==void 0)throw p},async close(){await se(),await o();let n=await i,r=Date.now();await n.streams.close(e,t),Sl(r,e,t)},async abort(e){try{await se()}catch{}d&&=(clearTimeout(d),null),s=[],c=0,p??=e??Error(`Stream aborted`),ne(p)}}),Object.defineProperty(this,Mr,{value:se,enumerable:!1,writable:!1})}};function wl(e=globalThis){let t=b(()=>kl(e,`Request`)),n=b(()=>kl(e,`Response`));return{...xa(),...Ma(),...Aa(e),Request:e=>{if(!K(e,t.value))return!1;let n={method:G(e,`method`),url:G(e,`url`),headers:G(e,`headers`),body:G(e,`body`),duplex:G(e,`duplex`)},r=G(e,Pr);r&&(n.responseWritable=r);let i=G(e,`signal`);return i&&(G(i,`aborted`)||G(i,z))&&(n.signal=i),n},Response:e=>K(e,n.value)?{type:G(e,`type`),url:G(e,`url`),status:G(e,`status`),statusText:G(e,`statusText`),headers:G(e,`headers`),body:G(e,`body`),redirected:G(e,`redirected`)}:!1}}function Tl(e,t,n,r,i,a){let o=t[z],s=t[B];if(!o){let e=(n[Tr]||il)();o=qc(e),s=`abrt_${e}`,t[z]=o,t[B]=s,t.signal&&(t.signal[z]=o,t.signal[B]=s)}return Dl(e,o,i,a,r),{streamName:o,hookToken:s,aborted:e.aborted,reason:e.aborted?e.reason:void 0}}function El(e,t){let n=t[z]??t.signal?.[z],r=t[B]??t.signal?.[B];if(!n)throw Error(`AbortController/AbortSignal stream name is not set`);return{streamName:n,hookToken:r,aborted:e.aborted,reason:e.aborted?e.reason:void 0}}function Dl(e,t,n,r,i){e.aborted||e[Ir]||(e[Ir]=!0,e.addEventListener(`abort`,()=>{i.push((async()=>{try{let i=await fo(r),a=await Zl({aborted:!0,reason:e.reason},n,i),o=new Cl(n,t).getWriter();await o.write(a),await o.close()}catch{}})())},{once:!0}))}function Ol(e=globalThis,t,n,r,i=!1,a){return{...wl(e),ReadableStream:o=>{if(!(o instanceof e.ReadableStream))return!1;if(o.locked)throw new m(`ReadableStream is locked and cannot be passed across a workflow boundary.`,{hint:`Pass the stream before calling .getReader() / .pipeThrough() / .pipeTo(), or tee it with .tee() and pass one of the branches.`});let s=`strm_${(e[Tr]||il)()}`,c=al(o),l=new Cl(n,s,a);c===`bytes`?i?t.push(o.pipeThrough(fl()).pipeTo(l)):t.push(o.pipeTo(l)):t.push(o.pipeThrough(ll(Ol(e,t,n,r,i,a),r)).pipeTo(l));let u={name:s};return c&&(u.type=c),c===`bytes`&&i&&(u.framing=`framed-v1`),u},WritableStream:r=>{if(!(r instanceof e.WritableStream))return!1;let i=r[Er],a=r[kr];if(typeof i==`string`&&typeof a==`string`){let e={name:i,runId:a},t=r[jr];typeof t==`string`&&(e.encryptionPublicKey=t);let n=r[Ar];return typeof n==`string`&&(e.deploymentId=n),e}let o=`strm_${(e[Tr]||il)()}`,s=new gl(n,o);return t.push(s.pipeTo(r)),{name:o}},AbortController:i=>!e.AbortController||typeof e.AbortController!=`function`||!(i instanceof e.AbortController)?!1:Tl(i.signal,i,e,t,n,r),AbortSignal:i=>!e.AbortSignal||typeof e.AbortSignal!=`function`||!(i instanceof e.AbortSignal)?!1:Tl(i,i,e,t,n,r)}}function kl(e,t){let n=G(e,t)??G(globalThis,t);if(typeof n==`function`)return G(n,`prototype`)}function Al(e=globalThis){let t=b(()=>kl(e,`ReadableStream`)),n=b(()=>kl(e,`WritableStream`)),i=b(()=>kl(e,`AbortController`)),a=b(()=>kl(e,`AbortSignal`));return{...wl(e),ReadableStream:e=>{if(!K(e,t.value))return!1;let n=G(e,Nr);if(n!==void 0)return{bodyInit:n};let i=G(e,Er);if(!i)throw new r("ReadableStream `name` is not set");let a={name:i},o=G(e,Dr);o&&(a.type=o);let s=G(e,Or);return s&&(a.framing=s),a},WritableStream:e=>{if(!K(e,n.value))return!1;let t=G(e,Er);if(!t)throw new r("WritableStream `name` is not set");let i={name:t},a=G(e,kr);typeof a==`string`&&(i.runId=a);let o=G(e,Ar);typeof o==`string`&&(i.deploymentId=o);let s=G(e,jr);return typeof s==`string`&&(i.encryptionPublicKey=s),i},AbortController:e=>{if(typeof e!=`object`||!e)return!1;let t=e,n=G(e,z),r=K(e,i.value);if(n===void 0&&!r){let t=G(e,`signal`);if(typeof t!=`object`||!t||G(t,z)===void 0)return!1}let a=G(e,`signal`);return a?El(a,t):!1},AbortSignal:e=>{if(typeof e!=`object`||!e)return!1;let t=G(e,z)!==void 0,n=K(e,a.value);return!t&&!n?!1:El(e,e)}}}function jl(e=globalThis,t,n,r,i=!1,a){return{...wl(e),ReadableStream:o=>{if(!(o instanceof e.ReadableStream))return!1;if(o.locked)throw new m(`ReadableStream is locked and cannot be passed across a workflow boundary.`,{hint:`Pass the stream before calling .getReader() / .pipeThrough() / .pipeTo(), or tee it with .tee() and pass one of the branches.`});let s=o[Er],c=o[Dr],l=o[Or];if(!s){s=`strm_${(e[Tr]||il)()}`,c=al(o),l=c===`bytes`&&i?`framed-v1`:l;let u=new Cl(n,s,a);c===`bytes`?l===`framed-v1`?t.push(o.pipeThrough(fl()).pipeTo(u)):t.push(o.pipeTo(u)):t.push(o.pipeThrough(ll(jl(e,t,n,r,i,a),r)).pipeTo(u))}let u={name:s};return c&&(u.type=c),l&&(u.framing=l),u},WritableStream:i=>{if(!(i instanceof e.WritableStream))return!1;let a=i[Er],o=i[kr];a||(a=`strm_${(e[Tr]||il)()}`,t.push(new gl(n,a).pipeThrough(ul(Hl(e,t,n,r),r)).pipeTo(i)));let s={name:a};typeof o==`string`&&(s.runId=o);let c=i[jr];typeof c==`string`&&(s.encryptionPublicKey=c);let l=i[Ar];return typeof l==`string`&&(s.deploymentId=l),s},AbortController:i=>!e.AbortController||typeof e.AbortController!=`function`||!(i instanceof e.AbortController)?!1:Tl(i.signal,i,e,t,n,r),AbortSignal:i=>!e.AbortSignal||typeof e.AbortSignal!=`function`||!(i instanceof e.AbortSignal)?!1:Tl(i,i,e,t,n,r)}}function Ml(...e){let t=new WeakSet;function n(e){let t=e[Lr];t&&!t.signal.aborted&&t.abort()}function r(e){if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e instanceof AbortController){n(e),n(e.signal);return}if(e instanceof AbortSignal){n(e);return}if(Array.isArray(e)){for(let t of e)r(t);return}if(e instanceof Map){for(let t of e.values())r(t);return}if(e instanceof Set){for(let t of e)r(t);return}if(typeof Request<`u`&&e instanceof Request){r(e.signal);return}for(let t of Object.values(e))r(t)}}for(let t of e)r(t)}function Nl(e,t,n,r){let i=new AbortController;return r.push((async()=>{try{let r=new gl(t,n).getReader(),a=await Promise.race([r.read(),new Promise(e=>{if(i.signal.aborted){e({value:void 0,done:!0});return}i.signal.addEventListener(`abort`,()=>e({value:void 0,done:!0}),{once:!0})})]);if(a.value&&!a.done){try{r.releaseLock()}catch{}try{let n=Wc.getStore(),r=await Ql(a.value,t,n?.encryptionKey);e.abort(r?.reason)}catch{e.abort()}}else r.cancel().catch(()=>{})}catch{}})()),i}function Pl(e,t,n){let r=e,i=e.signal;r[z]=t.streamName,r[B]=t.hookToken,i[z]=t.streamName,i[B]=t.hookToken,n&&(r[Lr]=n,i[Lr]=n)}function Fl(e,t){let n=e,r=t;n[z]!==void 0&&(r[z]=n[z]),n[B]!==void 0&&(r[B]=n[B]),n[Lr]!==void 0&&(r[Lr]=n[Lr])}function Il(e,t,n){let r=new AbortController;e.aborted?(Pl(r,e),r.abort(e.reason)):e.streamName?Pl(r,e,Nl(r,n,e.streamName,t)):Pl(r,e);let i=r.abort.bind(r);return r.abort=t=>{if(r.signal.aborted)return;i(t);let n=Wc.getStore();if(n&&(n.ops.push((async()=>{try{let r=await Zl({aborted:!0,reason:t},n.workflowMetadata.workflowRunId,n.encryptionKey),i=new Cl(n.workflowMetadata.workflowRunId,e.streamName).getWriter();await i.write(r),await i.close()}catch{}})()),e.hookToken)){let r=(async()=>{try{let{resumeHook:n}=await import(`./resume-hook-BrduAuFX.js`).then(e=>e.i);await n(e.hookToken,{aborted:!0,reason:t})}catch{}})();n.preCompletionOps.push(r)}},r}function Ll(e,t,n){let r=new AbortController;return e.aborted?(Pl(r,e),r.abort(e.reason)):e.streamName?Pl(r,e,Nl(r,n,e.streamName,t)):Pl(r,e),r.signal}function Rl(e=globalThis){return{...Sa(e),...ja(e)}}async function zl(e,t,n){let r=Si(n);if(r)return ao(r);let i=await ti();if(!i.getEncryptionKeyForRun)return;let a=t?await i.getEncryptionKeyForRun(e,{deploymentId:t}):await i.getEncryptionKeyForRun(await i.runs.get(e));return a?await _r(a,[`encrypt`]):void 0}function Bl(e=globalThis,t,n,r){return{...Rl(e),StepFunction:()=>{throw new m(`Step functions cannot be deserialized in client context. Step functions should not be returned from workflows.`,{hint:`A step function reference reached the client. Return a serializable value (e.g. the step result) instead of the step itself.`})},WorkflowFunction:e=>Object.assign(()=>{throw new m(`Workflow functions cannot be called directly. Use start() to invoke them.`,{hint:"Wrap the workflow with `start(workflowFn, { ... })` from `workflow` to begin a run instead of invoking it like a normal function."})},{workflowId:e.workflowId}),Request:t=>{let n={method:t.method,headers:new e.Headers(t.headers),body:t.body,duplex:t.duplex};t.signal&&(n.signal=t.signal);let r=new e.Request(t.url,n);return t.signal&&Fl(t.signal,r.signal),r},Response:t=>new e.Response(t.body,{status:t.status,statusText:t.statusText,headers:new e.Headers(t.headers)}),ReadableStream:i=>{if(`bodyInit`in i){let t=i.bodyInit;return new e.Response(t).body}if(i.type===`bytes`){let r=new gl(n,i.name,i.startIndex),a=Ur();t.push(a.promise);let{readable:o,writable:s}=i.framing===`framed-v1`?pl():new e.TransformStream;return Yr(r,s,a).catch(()=>{}),Jr(o,a),o}else{let a=yl(n,i.name,i.startIndex),o=ul(Bl(e,t,n,r),r),s=Ur();return t.push(s.promise),Yr(a,o.writable,s).catch(()=>{}),Jr(o.readable,s),o.readable}},WritableStream:i=>{let a=typeof i.runId==`string`?i.runId:n,o=a===n?r:zl(a,i.deploymentId,i.encryptionPublicKey),s=ll(Ol(e,t,a,o),o),c=new Cl(a,i.name),l=Ur();return t.push(l.promise),Yr(s.readable,c,l).catch(()=>{}),qr(s.writable,l),Object.defineProperty(s.writable,Er,{value:i.name,writable:!1}),Object.defineProperty(s.writable,kr,{value:a,writable:!1}),typeof i.deploymentId==`string`&&Object.defineProperty(s.writable,Ar,{value:i.deploymentId,writable:!1}),typeof i.encryptionPublicKey==`string`&&Object.defineProperty(s.writable,jr,{value:i.encryptionPublicKey,writable:!1}),s.writable},AbortController:e=>Il(e,t,n),AbortSignal:e=>Ll(e,t,n)}}function Vl(e=globalThis){return{...Rl(e),...Na(e),Request:t=>{Object.setPrototypeOf(t,e.Request.prototype);let n=t.responseWritable;return n&&(t[Pr]=n,delete t.responseWritable,t.respondWith=()=>{throw new m("`respondWith()` must be called from within a step function.",{hint:'Move the `respondWith(...)` call inside a `"use step"` function — it cannot be invoked from a workflow context.'})}),t},WorkflowFunction:e=>Object.assign(()=>{throw new m(`Workflow functions cannot be called directly. Use start() to invoke them.`,{hint:"Wrap the workflow with `start(workflowFn, { ... })` from `workflow` to begin a run instead of invoking it like a normal function."})},{workflowId:e.workflowId}),Response:t=>(Object.setPrototypeOf(t,e.Response.prototype),t),ReadableStream:t=>`bodyInit`in t?Object.create(e.ReadableStream.prototype,{[Nr]:{value:t.bodyInit,writable:!1}}):Object.create(e.ReadableStream.prototype,{[Er]:{value:t.name,writable:!1},[Dr]:{value:t.type,writable:!1},[Or]:{value:t.framing,writable:!1}}),WritableStream:t=>{let n={[Er]:{value:t.name,writable:!1}};return typeof t.runId==`string`&&(n[kr]={value:t.runId,writable:!1}),typeof t.deploymentId==`string`&&(n[Ar]={value:t.deploymentId,writable:!1}),typeof t.encryptionPublicKey==`string`&&(n[jr]={value:t.encryptionPublicKey,writable:!1}),Object.create(e.WritableStream.prototype,n)},AbortController:e=>{let t=new tl(e.streamName,e.hookToken);return e.aborted&&t._setAborted(e.reason),{[z]:e.streamName,[B]:e.hookToken,signal:t,abort:()=>{}}},AbortSignal:e=>{let t=new tl(e.streamName,e.hookToken);return e.aborted&&t._setAborted(e.reason),t}}}function Hl(e=globalThis,t,n,i,a){return{...Rl(e),StepFunction:e=>{let t=e.stepId,n=e.closureVars,i=`boundThis`in e,a=i?e.boundThis:void 0,o=Array.isArray(e.boundArgs)?e.boundArgs:[],s=te(t);if(!s)throw new m(`Step function "${t}" not found. Make sure the step function is registered.`,{hint:`Make sure the step file is included in your build (i.e. it is listed in the workflow manifest), and that the SWC plugin is configured for the file.`});if(!n&&!i&&o.length===0)return s;let c=function(...e){let t=i?a:this,c=o.length>0?[...o,...e]:e;if(n){let e=Wc.getStore();if(!e)throw new r(`Cannot call step function with closure variables outside step context`);let i={...e,closureVars:n};return Wc.run(i,()=>s.apply(t,c))}return s.apply(t,c)};return Object.defineProperty(c,"name",{value:s.name}),Object.defineProperty(c,"stepId",{value:t,writable:!1,enumerable:!1,configurable:!1}),s.maxRetries!==void 0&&(c.maxRetries=s.maxRetries),c},WorkflowFunction:e=>Object.assign(()=>{throw new m(`Workflow functions cannot be called directly. Use start() to invoke them.`,{hint:"Wrap the workflow with `start(workflowFn, { ... })` from `workflow` to begin a run instead of invoking it like a normal function."})},{workflowId:e.workflowId}),Request:t=>{let n=t.responseWritable,r={method:t.method,headers:new e.Headers(t.headers),body:t.body,duplex:t.duplex};t.signal&&(r.signal=t.signal);let i=new e.Request(t.url,r);return t.signal&&Fl(t.signal,i.signal),n&&(i.respondWith=async e=>{let t=n.getWriter();await t.write(e),await t.close()}),i},Response:t=>new e.Response(t.body,{status:t.status,statusText:t.statusText,headers:new e.Headers(t.headers)}),ReadableStream:r=>{if(`bodyInit`in r){let t=r.bodyInit;return new e.Response(t).body}let o=new gl(n,r.name);if(r.type===`bytes`){let n=Ur();t.push(n.promise);let{readable:i,writable:a}=r.framing===`framed-v1`?pl():new e.TransformStream;return Yr(o,a,n).catch(()=>{}),Jr(i,n),i}else{let r=ul(Hl(e,t,n,i,a),i),s=Ur();return t.push(s.promise),Yr(o,r.writable,s).catch(()=>{}),Jr(r.readable,s),r.readable}},WritableStream:r=>{let o=typeof r.runId==`string`?r.runId:n,s=typeof r.deploymentId==`string`?r.deploymentId:o===n?a:void 0,c=o===n?i:zl(o,s,r.encryptionPublicKey),l=ll(jl(e,t,o,c),c),u=new Cl(o,r.name),d=Ur();return t.push(d.promise),Yr(l.readable,u,d).catch(()=>{}),qr(l.writable,d),Object.defineProperty(l.writable,Er,{value:r.name,writable:!1}),Object.defineProperty(l.writable,kr,{value:o,writable:!1}),s&&Object.defineProperty(l.writable,Ar,{value:s,writable:!1}),typeof r.encryptionPublicKey!=`string`&&o===n&&lo(i)&&Object.defineProperty(l.writable,jr,{value:di(i.keyPair.publicKey),writable:!1}),typeof r.encryptionPublicKey==`string`&&Object.defineProperty(l.writable,jr,{value:r.encryptionPublicKey,writable:!1}),l.writable},AbortController:e=>Il(e,t,n),AbortSignal:e=>Ll(e,t,n)}}async function Ul(e,t){return await po(e,t)}const Wl=async(e,t)=>{let n={},r=await no(await ho(e,t),n);return await sl(n,`deserialize`),{data:r}};function Gl(e,t=globalThis,n={}){return Hc(e.data,{global:t,extraRevivers:{...su(Vl(t)),...n}})}function Kl(e,t=globalThis,n={}){let{data:r}=e;if(!(r instanceof Uint8Array))return fr(r,{...Vl(t),...n});let{format:i,payload:a}=Z(r);if(i===Y.DEVALUE_V1)return dr(new TextDecoder().decode(a),{...Vl(t),...n});throw Error(`Unsupported serialization format: ${i}`)}async function ql(e,t,n,r=[],i=globalThis,a=!1,o=!1,s=!1){if(a)return wa(pr(e,Ol(i,r,t,n,o)));try{let a={},c=await Rc(e,n,{global:i,extraReducers:ou(Ol(i,r,t,n,o)),compression:s,compressionStats:a});return await sl(a,`serialize`),c}catch(e){let t=ol(e),{message:n,hint:r}=Lc(`workflow arguments`,t);throw new m(n,{hint:r,cause:t})}}async function Jl(e,t,n,r=globalThis,i={},a){return Gl(a??await Wl(e,n),r,i)}async function Yl(e,t,n,r=globalThis,i=!1,a=!1,o){if(i)return wa(pr(e,Al(r)));try{let t={},i=o??{executions:[]},s=await Bc(e,n,{global:r,extraReducers:ou(Al(r)),compression:a,compressionStats:t,guestCodeStats:i});return await sl(t,`serialize`),await cl(i),s}catch(e){let t=ol(e),{message:n,hint:r}=Lc(`workflow return value`,t);throw new m(n,{hint:r,cause:t})}}async function Xl(e,t,n,r=[],i=globalThis,a={}){let o={},s=await zc(e,n,{global:i,extraRevivers:{...su(Bl(i,r,t,n)),...a},compressionStats:o});return await sl(o,`deserialize`),s}async function Zl(e,t,n,r=globalThis,i=!1,a=!1,o){if(i)return wa(pr(e,Al(r)));try{let t={},i=o??{executions:[]},s=await Bc(e,n,{global:r,extraReducers:ou(Al(r)),compression:a,compressionStats:t,guestCodeStats:i});return await sl(t,`serialize`),await cl(i),s}catch(e){let t=ol(e),{message:n,hint:r}=Lc(`step arguments`,t);throw new m(n,{hint:r,cause:t})}}async function Ql(e,t,n,r=[],i=globalThis,a={},o){let s={},c=await Vc(e,n,{global:i,extraRevivers:{...su(Hl(i,r,t,n,o)),...a},compressionStats:s});return await sl(s,`deserialize`),c}async function $l(e,t,n,r=[],i=globalThis,a=!1,o=!1,s=!1,c){if(a)return wa(pr(e,jl(i,r,t,n,o,c)));try{let a={},l=await Bc(e,n,{global:i,extraReducers:ou(jl(i,r,t,n,o,c)),compression:s,compressionStats:a});return await sl(a,`serialize`),l}catch(e){let t=ol(e),{message:n,hint:r}=Lc(`step return value`,t);throw new m(n,{hint:r,cause:t})}}async function eu(e,t,n,r=[],i=globalThis,a=!1){try{let o=pr(e,jl(i,r,t,n)),s=new TextEncoder().encode(o),c=Va(Y.DEVALUE_V1,s),l={},u=await Ul(await to(c,a,l),n);return await sl(l,`serialize`),u}catch(e){let t=ol(e),{message:n,hint:r}=Lc(`step error`,t);throw new m(n,{hint:r,cause:t})}}async function tu(e,t,n,r=globalThis,i={},a){return Kl(a??await Wl(e,n),r,i)}async function nu(e,t,n,r=globalThis,i=!1){try{let t=pr(e,Al(r)),a=new TextEncoder().encode(t),o=Va(Y.DEVALUE_V1,a),s={},c=await Ul(await to(o,i,s),n);return await sl(s,`serialize`),c}catch(e){let t=ol(e),{message:n,hint:r}=Lc(`run error`,t);throw new m(n,{hint:r,cause:t})}}async function ru(e,t,n,r=[],i=globalThis,a={}){let o={},s=await no(await ho(e,n),o);if(await sl(o,`deserialize`),!(s instanceof Uint8Array))return fr(s,{...Bl(i,r,t,n),...a});let{format:c,payload:l}=Z(s);if(c===Y.DEVALUE_V1)return dr(new TextDecoder().decode(l),{...Bl(i,r,t,n),...a});throw Error(`Unsupported serialization format: ${c}`)}async function iu(e,t,n,r=globalThis,i={},a){return Gl(a??await Wl(e,n),r,i)}const au=[`ReadableStream`,`WritableStream`,`Request`,`Response`,`StepFunction`,`AbortController`,`AbortSignal`];function ou(e){let t={};for(let n of au)n in e&&(t[n]=e[n]);return t}function su(e){let t={};for(let n of au)n in e&&(t[n]=e[n]);return t}const cu=[{format:Y.ENCRYPTED,minVersion:`4.2.0-beta.64`},{format:Y.GZIP,minVersion:`5.0.0-beta.18`},{format:Y.ZSTD,minVersion:`5.0.0-beta.18`},{format:Y.SEALED,minVersion:`5.0.0-beta.37`}],lu=[{capability:`framedByteStreams`,minVersion:`5.0.0-beta.15`}],uu=new Set([Y.DEVALUE_V1]);function du(e){if(!e||!gr.default.valid(e))return{supportedFormats:uu,framedByteStreams:!1};let t=new Set(uu);for(let{format:n,minVersion:r}of cu)gr.default.gte(e,r)&&t.add(n);let n={supportedFormats:t,framedByteStreams:!1};for(let{capability:t,minVersion:r}of lu)gr.default.gte(e,r)&&(n[t]=!0);return n}const fu=new Set([`PARSE_ERROR`,`SCHEMA_VALIDATION`,f.WORLD_CONTRACT_ERROR]),pu=new Set([`TRANSPORT`,`TIMEOUT`]),mu=[r.is,u.is,a.is,h.is];function hu(e){if(!i.is(e)||e.status!==void 0)return!1;let t=`cause`in e?e.cause:void 0;return e.code!==void 0&&fu.has(e.code)||e.message.startsWith(`Failed to parse response body for `)||e.message.startsWith(`Schema validation failed for `)||typeof t==`object`&&!!t&&`name`in t&&t.name===`ZodError`}function gu(e){return l.is(e)?!0:i.is(e)?e.status!==void 0&&e.status>=500||e.code!==void 0&&pu.has(e.code):!1}function _u(e){if(p.is(e))return f.REPLAY_DIVERGENCE;if(_.is(e))return f.CORRUPTED_EVENT_LOG;if(g.is(e))return f.MAX_EVENTS_EXCEEDED;if(s.is(e))return f.DEPLOYMENT_MISMATCH;if(hu(e)||gu(e))return f.WORLD_CONTRACT_ERROR;for(let t of mu)if(t(e))return f.RUNTIME_ERROR;return f.USER_ERROR}const vu=`5.0.0-beta.41`,yu=/^[a-zA-Z0-9_\-./@]+$/;function bu(e,t){if(!yu.test(e))throw Error(`Invalid workflow name "${e}": must only contain alphanumeric characters, underscores, hyphens, dots, forward slashes, or at signs`);return`${kt(`workflow`,Ot(t))}${e}`}const xu=me();function Su(e){return`__health_check__${e}`}function Cu(e){let t=Pt.safeParse(e);if(t.success)return t.data}function wu(e){return`wrun_hc_${e}`}async function Tu(e,t){let n=await ti(),r=Su(e.correlationId),i;if(e.runId)try{let t=await n.getEncryptionKeyForRun?.(e.runId);t&&(i=di((await oi(t)).publicKey))}catch(t){Nc.warn(`Health check could not derive a run public key; the caller will fall back to a key lookup`,{correlationId:e.correlationId,error:t instanceof Error?t.message:String(t)})}let a=JSON.stringify({healthy:!0,correlationId:e.correlationId,specVersion:t??5,workflowCoreVersion:vu,hookResumeInputVersion:1,...i?{encryptionPublicKey:i}:{},timestamp:Date.now()}),o=wu(e.correlationId);await n.streams.write(o,r,a),await n.streams.close(o,r)}function Eu(e,t){let n;return Promise.race([e,new Promise((e,r)=>{n=setTimeout(()=>r(Error(`Operation timed out after ${t}ms`)),t)})]).finally(()=>clearTimeout(n))}async function Du(e,t){let n=[],r=!1,i=!1;for(;!r&&!i;){let a=e.read(),o=new Promise(e=>setTimeout(()=>{i=!0,e({done:!0,value:void 0})},t)),s=await Promise.race([a,o]);r=s.done,s.value&&n.push(s.value)}return{chunks:n,timedOut:i}}function Ou(e){if(e.length===0)return null;let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;let i=new TextDecoder().decode(n),a;try{a=JSON.parse(i)}catch{return i.length>0?{healthy:!0}:null}if(typeof a!=`object`||!a||!(`healthy`in a)||typeof a.healthy!=`boolean`)return null;let o=a,s={healthy:o.healthy};return typeof o.specVersion==`number`&&(s.specVersion=o.specVersion),typeof o.workflowCoreVersion==`string`&&(s.workflowCoreVersion=o.workflowCoreVersion),typeof o.encryptionPublicKey==`string`&&(s.encryptionPublicKey=o.encryptionPublicKey),typeof o.hookResumeInputVersion==`number`&&(s.hookResumeInputVersion=o.hookResumeInputVersion),s}async function ku(e,t){let n=t?.timeout??3e4,r=e.createRunId?.()??xu(),i=Su(r),a=`${kt(`workflow`,Ot(t?.namespace))}health_check`,o=Date.now();try{for(await e.queue(a,{__healthCheck:!0,correlationId:r,...t?.runId?{runId:t.runId}:{}},{specVersion:1,deploymentId:t?.deploymentId});Date.now()-o<n;)try{let t=n-(Date.now()-o),a=(await Eu(e.streams.get(wu(r),i),t)).getReader(),{chunks:s,timedOut:c}=await Du(a,500);if(c){try{a.cancel()}catch{}await new Promise(e=>setTimeout(e,100));continue}let l=Ou(s);if(l)return{...l,latencyMs:Date.now()-o};await new Promise(e=>setTimeout(e,100))}catch{await new Promise(e=>setTimeout(e,100))}return{healthy:!1,error:`Health check timed out after ${n}ms`}}catch(e){return{healthy:!1,error:e instanceof Error?e.message:String(e)}}}function Au(e,t){return new i(`Event pagination ${t} for workflow run "${e}".`,{code:f.WORLD_CONTRACT_ERROR})}function ju(e,t,n){if(t){if(n.has(t))throw Au(e,`did not advance`);n.add(t)}}function Mu(e,t,n){if(t.length===0)return;let r=n??new Set(e.map(e=>e.eventId));for(let n of t)r.has(n.eventId)||(r.add(n.eventId),e.push(n))}function Nu(e,t){let n=e.length;for(;n>0;){let r=e[n-1];if(r.eventId===t.eventId)return;if(r.eventId<t.eventId)break;n--}e.splice(n,0,t)}function Pu(e,t,n,r){if(t){if(n===null)throw Au(e,`returned more pages without a cursor`);if(r.has(n))throw Au(e,`repeated a cursor`)}}function Fu(e,t,n){return t!==null&&!n&&i.is(e)&&e.status===400}async function Iu(e,t){let n=t!==void 0;return bc(n?`workflow.loadNewEvents`:`workflow.loadEvents`,async r=>{r?.setAttributes({...Oo(e)});let i=[],a=new Set,o=new Set,s=t??null,c=!0,l=0,u=!1,d=await ti(),f=Date.now();for(;c;){let t=Date.now(),r=s;ju(e,r,o);let f;try{f=await d.events.list({runId:e,pagination:{sortOrder:`asc`,cursor:r??void 0}})}catch(t){if(Fu(t,r,u)){Nc.warn(`Event cursor was rejected; retrying with a full event reload.`,{workflowRunId:e}),i.length=0,a.clear(),o.clear(),s=null,u=!0;continue}throw t}Mu(i,f.data,a),c=f.hasMore,Pu(e,c,f.cursor,o),s=f.cursor??s,l++,Nc.debug(`Loaded event page`,{workflowRunId:e,incremental:n,page:l,pageEvents:f.data.length,totalEvents:i.length,hasMore:c,pageMs:Date.now()-t})}return Nc.debug(`Event load complete`,{workflowRunId:e,incremental:n,totalEvents:i.length,pagesLoaded:l,totalMs:Date.now()-f}),r?.setAttributes({...jo(i.length),...Ws(l)}),{events:i,cursor:s}})}function Lu(){return process.env.WORKFLOW_PRECONDITION_GUARD!==`0`}function Ru(){return process.env.WORKFLOW_SLOT_GAP_CHECK!==`0`}function zu(e){let t;for(let n of e)(t===void 0||n.eventId>t)&&(t=n.eventId);if(t===void 0)return;let n=t,r=n.lastIndexOf(`_`),i=Wt(r===-1?n:n.slice(r+1))?.getTime();if(i===void 0){Nc.debug(`Precondition guard: latest event id is not a decodable ULID; sending no snapshot`,{eventId:n});return}return i}function Bu(e,t){let n=e.length;Mu(e,t);let r=e.length-n;return r>0&&Vu(e)!==void 0&&e.sort((e,t)=>e.eventId<t.eventId?-1:+(e.eventId>t.eventId)),r}function Vu(e){let t;for(let n of e){let e=Bt(n.eventId);if(e===null)return;(t===void 0||e>t)&&(t=e)}return t}function Hu(e){let t=new Set,n=0;for(let r of e){let e=Bt(r.eventId);if(e===null)return;t.add(e),e>n&&(n=e)}if(n===0)return;let r=t.has(1)?1:2;if(t.size===n-r+1)return;let i,a=0;for(let e=r;e<=n;e++)t.has(e)||(i??=e,a++);if(i!==void 0)return{firstMissingSlot:i,missingCount:a,maxSlot:n}}async function Uu(e,t){let n=t,r=Hu(n.events);for(let t=0;r!==void 0&&t<3;t++)await new Promise(e=>setTimeout(e,25*2**t)),n=await Iu(e),r=Hu(n.events);return{log:n,gap:r}}function Wu(e,t){if(!Lu())return{};let n=Vu(e);if(n!==void 0)return{eventCount:n};let r=zu(e);return r===void 0?{}:{stateUpdatedAt:r,stateEventCount:e.length,...t?{stateCursor:t}:{}}}function Gu(e,t){if(!c.is(e))return null;let n=e.details;if(typeof n!=`object`||!n)return null;let{events:r,cursor:i}=n;if(!Array.isArray(r)||r.length===0)return null;for(let e of r)if(typeof e!=`object`||!e||typeof e.eventId!=`string`||e.runId!==t)return null;return{events:r,cursor:typeof i==`string`?i:null}}const Ku={"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`POST, OPTIONS, GET, HEAD`,"Access-Control-Allow-Headers":`Content-Type`};function qu(e,t){return async n=>{let r=new URL(n.url);return r.searchParams.has(`__health`)?n.method===`OPTIONS`?new Response(null,{status:204,headers:Ku}):new Response(JSON.stringify({healthy:!0,endpoint:r.pathname,specVersion:t??5,workflowCoreVersion:vu}),{status:200,headers:{"Content-Type":`application/json`,...Ku}}):await e(n)}}async function Ju(e,...t){let n=t[0];await bc(`queue.publish`,{attributes:{...xs(`vercel-queue`),...Ss(n),...ws(`publish`),...nc(`vercel-queue`),...rc(`vercel-queue`),...ic(`vqs`),...ac(`publish`)},kind:await Tc(`PRODUCER`)},async n=>{let{messageId:r}=await e.queue(...t);r&&n?.setAttributes(Cs(r))})}function Yu(e){if(e.requestedAt)try{return Ts(Date.now()-e.requestedAt.getTime())}catch{return}}function Xu(e,t){let n;return()=>(n||=(async()=>{let n=await e.getEncryptionKeyForRun?.(t);return n?await so(n):void 0})(),n)}function Zu(t){import(`./functions-CXb61C6h.js`).then(t=>e(t.default,1)).then(({waitUntil:e})=>{e(t)})}function Qu(e,t){Zu(e.catch(e=>{if(!(e?.name===`AbortError`||e?.name===`ResponseAborted`))try{t(e)}catch{}}))}async function $u(e){let t=e();return Zu(t.catch(()=>{})),t}export{Pc as $,jr as $n,Jo as $t,$l as A,wo as An,Ks as At,Jl as B,Di as Bn,as as Bt,hu as C,Ao as Cn,Re as Cr,Hs as Ct,nu as D,Bo as Dn,ws as Dt,Ml as E,Ro as En,Te as Er,Cs as Et,ll as F,va as Fn,hs as Ft,$ as G,Zr as Gn,bs as Gt,Wl as H,Si as Hn,ms as Ht,ru as I,ya as In,_s as It,Jc as J,qr as Jn,ds as Jt,el as K,Ur as Kn,cs as Kt,Ql as L,ba as Ln,ls as Lt,Yl as M,lo as Mn,ps as Mt,Ol as N,ao as Nn,rs as Nt,Zl as O,Ko as On,xs as Ot,Bl as P,Y as Pn,gs as Pt,Mc as Q,Ar as Qn,Io as Qt,tu as R,ga as Rn,ns as Rt,gu as S,ko as Sn,Ne as Sr,Bs as St,Cl as T,zo as Tn,Ee as Tr,Ss as Tt,rl as U,oi as Un,vs as Ut,Xl as V,di as Vn,ts as Vt,nl as W,ti as Wn,ys as Wt,Wc as X,Tr as Xn,ss as Xt,Kc as Y,Nr as Yn,is as Yt,Nc as Z,Er as Zn,os as Zt,Ju as _,Zo as _n,Be as _r,js as _t,bu as a,jo as an,Cr as ar,uc as at,vu as b,Oo as bn,Pe as br,Fs as bt,Nu as c,Eo as cn,Ut as cr,bc as ct,Iu as d,Po as dn,kt as dr,Es as dt,ks as en,kr as er,Sc as et,Xu as f,Fo as fn,Ot as fr,sc as ft,Wu as g,Xo as gn,He as gr,Ms as gt,Gu as h,Qo as hn,Ye as hr,es as ht,Yu as i,Vo as in,xr as ir,lc as it,ql as j,so as jn,qs as jt,eu as k,To as kn,Gs as kt,Lu as l,Do as ln,Vt as lr,hc as lt,Cu as m,Lo as mn,_t as mr,Us as mt,$u as n,Uo as nn,Sr as nr,dc as nt,Tu as o,Mo as on,br as or,Oc as ot,Bu as p,No as pn,Et as pr,oc as pt,Gc as q,Yr as qn,fs as qt,Mu as r,Ho as rn,wr as rr,Tc as rt,ku as s,Go as sn,_r as sr,pc as st,Qu as t,Os as tn,Pr as tr,fc as tt,Ru as u,qo as un,Nt as ur,kc as ut,Uu as v,$o as vn,ze as vr,Ns as vt,du as w,Wo as wn,xe as wr,Vs as wt,_u as x,Ds as xn,A as xr,As as xt,qu as y,Yo as yn,Ke as yr,Ps as yt,iu as z,ha as zn,us as zt};
@@ -0,0 +1,8 @@
1
+ import{i as e,n as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";var i=r(((e,t)=>{let n=[`nodebuffer`,`arraybuffer`,`fragments`],r=typeof Blob<`u`;r&&n.push(`blob`),t.exports={BINARY_TYPES:n,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,hasBlob:r,kForOnEventAttribute:Symbol(`kIsForOnEventAttribute`),kListener:Symbol(`kListener`),kStatusCode:Symbol(`status-code`),kWebSocket:Symbol(`websocket`),NOOP:()=>{}}})),a=r(((t,n)=>{var r=e(`fs`),i=e(`path`),a=e(`os`),o=typeof __webpack_require__==`function`?__non_webpack_require__:e,s=process.config&&process.config.variables||{},c=!!process.env.PREBUILDS_ONLY,l=process.versions.modules,u=O()?`electron`:D()?`node-webkit`:`node`,d=process.env.npm_config_arch||a.arch(),f=process.env.npm_config_platform||a.platform(),p=process.env.LIBC||(k(f)?`musl`:`glibc`),m=process.env.ARM_VERSION||(d===`arm64`?`8`:s.arm_version)||``,h=(process.versions.uv||``).split(`.`)[0];n.exports=g;function g(e){return o(g.resolve(e))}g.resolve=g.path=function(e){e=i.resolve(e||`.`);try{var t=o(i.join(e,`package.json`)).name.toUpperCase().replace(/-/g,`_`);process.env[t+`_PREBUILD`]&&(e=process.env[t+`_PREBUILD`])}catch{}if(!c){var n=v(i.join(e,`build/Release`),y);if(n)return n;var r=v(i.join(e,`build/Debug`),y);if(r)return r}var a=T(e);if(a)return a;var s=T(i.dirname(process.execPath));if(s)return s;var g=[`platform=`+f,`arch=`+d,`runtime=`+u,`abi=`+l,`uv=`+h,m?`armv=`+m:``,`libc=`+p,`node=`+process.versions.node,process.versions.electron?`electron=`+process.versions.electron:``,typeof __webpack_require__==`function`?`webpack=true`:``].filter(Boolean).join(` `);throw Error(`No native build was found for `+g+`
2
+ loaded from: `+e+`
3
+ `);function T(e){var t=_(i.join(e,`prebuilds`)).map(b).filter(x(f,d)).sort(S)[0];if(t){var n=i.join(e,`prebuilds`,t.name),r=_(n).map(C).filter(w(u,l)).sort(E(u))[0];if(r)return i.join(n,r.file)}}};function _(e){try{return r.readdirSync(e)}catch{return[]}}function v(e,t){var n=_(e).filter(t);return n[0]&&i.join(e,n[0])}function y(e){return/\.node$/.test(e)}function b(e){var t=e.split(`-`);if(t.length===2){var n=t[0],r=t[1].split(`+`);if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function x(e,t){return function(n){return n==null||n.platform!==e?!1:n.architectures.includes(t)}}function S(e,t){return e.architectures.length-t.architectures.length}function C(e){var t=e.split(`.`),n=t.pop(),r={file:e,specificity:0};if(n===`node`){for(var i=0;i<t.length;i++){var a=t[i];if(a===`node`||a===`electron`||a===`node-webkit`)r.runtime=a;else if(a===`napi`)r.napi=!0;else if(a.slice(0,3)===`abi`)r.abi=a.slice(3);else if(a.slice(0,2)===`uv`)r.uv=a.slice(2);else if(a.slice(0,4)===`armv`)r.armv=a.slice(4);else if(a===`glibc`||a===`musl`)r.libc=a;else continue;r.specificity++}return r}}function w(e,t){return function(n){return!(n==null||n.runtime&&n.runtime!==e&&!T(n)||n.abi&&n.abi!==t&&!n.napi||n.uv&&n.uv!==h||n.armv&&n.armv!==m||n.libc&&n.libc!==p)}}function T(e){return e.runtime===`node`&&e.napi}function E(e){return function(t,n){return t.runtime===n.runtime?t.abi===n.abi?t.specificity===n.specificity?0:t.specificity>n.specificity?-1:1:t.abi?-1:1:t.runtime===e?-1:1}}function D(){return!!(process.versions&&process.versions.nw)}function O(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<`u`&&window.process&&window.process.type===`renderer`}function k(e){return e===`linux`&&r.existsSync(`/etc/alpine-release`)}g.parseTags=C,g.matchTags=w,g.compareTags=E,g.parseTuple=b,g.matchTuple=x,g.compareTuples=S})),o=r(((t,n)=>{let r=typeof __webpack_require__==`function`?__non_webpack_require__:e;typeof r.addon==`function`?n.exports=r.addon.bind(r):n.exports=a()})),s=r(((e,t)=>{t.exports={mask:(e,t,n,r,i)=>{for(var a=0;a<i;a++)n[r+a]=e[a]^t[a&3]},unmask:(e,t)=>{let n=e.length;for(var r=0;r<n;r++)e[r]^=t[r&3]}}})),c=r(((e,t)=>{try{t.exports=o()(__dirname)}catch{t.exports=s()}})),l=r(((e,t)=>{let{EMPTY_BUFFER:n}=i(),r=Buffer[Symbol.species];function a(e,t){if(e.length===0)return n;if(e.length===1)return e[0];let i=Buffer.allocUnsafe(t),a=0;for(let t=0;t<e.length;t++){let n=e[t];i.set(n,a),a+=n.length}return a<t?new r(i.buffer,i.byteOffset,a):i}function o(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[a]^t[a&3]}function s(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}function l(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function u(e){if(u.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new r(e):ArrayBuffer.isView(e)?t=new r(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),u.readOnly=!1),t}if(t.exports={concat:a,mask:o,toArrayBuffer:l,toBuffer:u,unmask:s},!process.env.WS_NO_BUFFER_UTIL)try{let e=c();t.exports.mask=function(t,n,r,i,a){a<48?o(t,n,r,i,a):e.mask(t,n,r,i,a)},t.exports.unmask=function(t,n){t.length<32?s(t,n):e.unmask(t,n)}}catch{}})),u=r(((e,t)=>{let n=Symbol(`kDone`),r=Symbol(`kRun`);t.exports=class{constructor(e){this[n]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[n])}}}})),d=r(((t,n)=>{let r=e(`zlib`),a=l(),o=u(),{kStatusCode:s}=i(),c=Buffer[Symbol.species],d=Buffer.from([0,0,255,255]),f=Symbol(`permessage-deflate`),p=Symbol(`total-length`),m=Symbol(`callback`),h=Symbol(`buffers`),g=Symbol(`error`),_;n.exports=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold===void 0?1024:this._options.threshold,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!_){let e=this._options.concurrencyLimit===void 0?10:this._options.concurrencyLimit;_=new o(e)}}static get extensionName(){return`permessage-deflate`}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits??(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&=(this._inflate.close(),null),this._deflate){let e=this._deflate[m];this._deflate.close(),this._deflate=null,e&&e(Error(`The deflate stream was closed while data was being processed`))}}acceptAsServer(e){let t=this._options,n=e.find(e=>!(t.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==`number`&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==`number`&&(typeof e.client_max_window_bits==`number`?t.clientMaxWindowBits>e.client_max_window_bits:!e.client_max_window_bits)));if(!n)throw Error(`None of the extension offers can be accepted`);return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits==`number`&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits==`number`?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error(`Unexpected parameter "client_no_context_takeover"`);if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits==`number`&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==`number`&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error(`Unexpected or invalid parameter "client_max_window_bits"`);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw Error(`Parameter "${t}" must have only a single value`);if(n=n[0],t===`client_max_window_bits`){if(n!==!0){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else if(t===`server_max_window_bits`){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(t===`client_no_context_takeover`||t===`server_no_context_takeover`){if(n!==!0)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else throw Error(`Unknown parameter "${t}"`);e[t]=n})}),e}decompress(e,t,n){_.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){_.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){let i=this._isServer?`client`:`server`;if(!this._inflate){let e=`${i}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:r.Z_DEFAULT_WINDOWBITS;this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[f]=this,this._inflate[p]=0,this._inflate[h]=[],this._inflate.on(`error`,b),this._inflate.on(`data`,y)}this._inflate[m]=n,this._inflate.write(e),t&&this._inflate.write(d),this._inflate.flush(()=>{let e=this._inflate[g];if(e){this._inflate.close(),this._inflate=null,n(e);return}let r=a.concat(this._inflate[h],this._inflate[p]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[p]=0,this._inflate[h]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,r)})}_compress(e,t,n){let i=this._isServer?`server`:`client`;if(!this._deflate){let e=`${i}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:r.Z_DEFAULT_WINDOWBITS;this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[p]=0,this._deflate[h]=[],this._deflate.on(`data`,v)}this._deflate[m]=n,this._deflate.write(e),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=a.concat(this._deflate[h],this._deflate[p]);t&&(e=new c(e.buffer,e.byteOffset,e.length-4)),this._deflate[m]=null,this._deflate[p]=0,this._deflate[h]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,e)})}};function v(e){this[h].push(e),this[p]+=e.length}function y(e){if(this[p]+=e.length,this[f]._maxPayload<1||this[p]<=this[f]._maxPayload){this[h].push(e);return}this[g]=RangeError(`Max payload size exceeded`),this[g].code=`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`,this[g][s]=1009,this.removeListener(`data`,y),this.reset()}function b(e){if(this[f]._inflate=null,this[g]){this[m](this[g]);return}e[s]=1007,this[m](e)}})),f=r(((t,n)=>{let{isUtf8:r}=e(`buffer`),{hasBlob:a}=i(),o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function s(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function c(e){let t=e.length,n=0;for(;n<t;)if(!(e[n]&128))n++;else if((e[n]&224)==192){if(n+1===t||(e[n+1]&192)!=128||(e[n]&254)==192)return!1;n+=2}else if((e[n]&240)==224){if(n+2>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||e[n]===224&&(e[n+1]&224)==128||e[n]===237&&(e[n+1]&224)==160)return!1;n+=3}else if((e[n]&248)==240){if(n+3>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||(e[n+3]&192)!=128||e[n]===240&&(e[n+1]&240)==128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}function l(e){return a&&typeof e==`object`&&typeof e.arrayBuffer==`function`&&typeof e.type==`string`&&typeof e.stream==`function`&&(e[Symbol.toStringTag]===`Blob`||e[Symbol.toStringTag]===`File`)}if(n.exports={isBlob:l,isValidStatusCode:s,isValidUTF8:c,tokenChars:o},r)n.exports.isValidUTF8=function(e){return e.length<24?c(e):r(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=e(`utf-8-validate`);n.exports.isValidUTF8=function(e){return e.length<32?c(e):t(e)}}catch{}})),p=r(((t,n)=>{let{Writable:r}=e(`stream`),a=d(),{BINARY_TYPES:o,EMPTY_BUFFER:s,kStatusCode:c,kWebSocket:u}=i(),{concat:p,toArrayBuffer:m,unmask:h}=l(),{isValidStatusCode:g,isValidUTF8:_}=f(),v=Buffer[Symbol.species];n.exports=class extends r{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents===void 0||e.allowSynchronousEvents,this._binaryType=e.binaryType||o[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[u]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,n){if(this._opcode===8&&this._state==0)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,`Too many buffered chunks`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let t=this._buffers[0];return this._buffers[0]=new v(t.buffer,t.byteOffset+e,t.length-e),new v(t.buffer,t.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new v(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){e(this.createError(RangeError,`RSV2 and RSV3 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_2_3`));return}let n=(t[0]&64)==64;if(n&&!this._extensions[a.extensionName]){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._fin=(t[0]&128)==128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(!this._fragmented){e(this.createError(RangeError,`invalid opcode 0`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){e(this.createError(RangeError,`FIN must be set`,!0,1002,`WS_ERR_EXPECTED_FIN`));return}if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,`WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH`));return}}else{e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)==128,this._isServer){if(!this._masked){e(this.createError(RangeError,`MASK must be set`,!0,1002,`WS_ERR_EXPECTED_MASK`));return}}else if(this._masked){e(this.createError(RangeError,`MASK must be clear`,!0,1002,`WS_ERR_UNEXPECTED_MASK`));return}this._payloadLength===126?this._state=1:this._payloadLength===127?this._state=2:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>2**21-1){e(this.createError(RangeError,`Unsupported WebSocket frame: payload length > 2^53 - 1`,!1,1009,`WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH`));return}this._payloadLength=n*2**32+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){e(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}this._masked?this._state=3:this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(e){let t=s;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&h(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){e(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}if(this._compressed){this._state=5,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[a.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){t(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}this._fragments.push(n)}this.dataMessage(t),this._state===0&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=0;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let r;r=this._binaryType===`nodebuffer`?p(n,t):this._binaryType===`arraybuffer`?m(p(n,t)):this._binaryType===`blob`?new Blob(n):n,this._allowSynchronousEvents?(this.emit(`message`,r,!0),this._state=0):(this._state=6,setImmediate(()=>{this.emit(`message`,r,!0),this._state=0,this.startLoop(e)}))}else{let r=p(n,t);if(!this._skipUTF8Validation&&!_(r)){e(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._state===5||this._allowSynchronousEvents?(this.emit(`message`,r,!1),this._state=0):(this._state=6,setImmediate(()=>{this.emit(`message`,r,!1),this._state=0,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit(`conclude`,1005,s),this.end();else{let n=e.readUInt16BE(0);if(!g(n)){t(this.createError(RangeError,`invalid status code ${n}`,!0,1002,`WS_ERR_INVALID_CLOSE_CODE`));return}let r=new v(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!_(r)){t(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._loop=!1,this.emit(`conclude`,n,r),this.end()}this._state=0;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?`ping`:`pong`,e),this._state=0):(this._state=6,setImmediate(()=>{this.emit(this._opcode===9?`ping`:`pong`,e),this._state=0,this.startLoop(t)}))}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,this.createError),a.code=i,a[c]=r,a}}})),m=r(((t,n)=>{let{Duplex:r}=e(`stream`),{randomFillSync:a}=e(`crypto`),{types:{isUint8Array:o}}=e(`util`),s=d(),{EMPTY_BUFFER:c,kWebSocket:u,NOOP:p}=i(),{isBlob:m,isValidStatusCode:h}=f(),{mask:g,toBuffer:_}=l(),v=Symbol(`kByteLength`),y=Buffer.alloc(4),b=8*1024,x,S=b;n.exports=class e{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=0,this.onerror=p,this[u]=void 0}static frame(e,t){let n,r=!1,i=2,o=!1;t.mask&&(n=t.maskBuffer||y,t.generateMask?t.generateMask(n):(S===b&&(x===void 0&&(x=Buffer.alloc(b)),a(x,0,b),S=0),n[0]=x[S++],n[1]=x[S++],n[2]=x[S++],n[3]=x[S++]),o=(n[0]|n[1]|n[2]|n[3])===0,i=6);let s;typeof e==`string`?(!t.mask||o)&&t[v]!==void 0?s=t[v]:(e=Buffer.from(e),s=e.length):(s=e.length,r=t.mask&&t.readOnly&&!o);let c=s;s>=65536?(i+=8,c=127):s>125&&(i+=2,c=126);let l=Buffer.allocUnsafe(r?s+i:i);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(s,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(s,4,6)),!t.mask||(l[1]|=128,l[i-4]=n[0],l[i-3]=n[1],l[i-2]=n[2],l[i-1]=n[3],o)?[l,e]:r?(g(e,n,l,i,s),[l]):(g(e,n,e,0,s),[l,e])}close(t,n,r,i){let a;if(t===void 0)a=c;else if(typeof t!=`number`||!h(t))throw TypeError(`First argument must be a valid error code number`);else if(n===void 0||!n.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let e=Buffer.byteLength(n);if(e>123)throw RangeError(`The message must not be greater than 123 bytes`);if(a=Buffer.allocUnsafe(2+e),a.writeUInt16BE(t,0),typeof n==`string`)a.write(n,2);else if(o(n))a.set(n,2);else throw TypeError(`Second argument must be a string or a Uint8Array`)}let s={[v]:a.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state===0?this.sendFrame(e.frame(a,s),i):this.enqueue([this.dispatch,a,!1,s,i])}ping(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):m(t)?(i=t.size,a=!1):(t=_(t),i=t.length,a=_.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[v]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};m(t)?this._state===0?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===0?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}pong(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):m(t)?(i=t.size,a=!1):(t=_(t),i=t.length,a=_.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[v]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};m(t)?this._state===0?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===0?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}send(e,t,n){let r=this._extensions[s.extensionName],i=t.binary?2:1,a=t.compress,o,c;typeof e==`string`?(o=Buffer.byteLength(e),c=!1):m(e)?(o=e.size,c=!1):(e=_(e),o=e.length,c=_.readOnly),this._firstFragment?(this._firstFragment=!1,a&&r&&r.params[r._isServer?`server_no_context_takeover`:`client_no_context_takeover`]&&(a=o>=r._threshold),this._compress=a):(a=!1,i=0),t.fin&&(this._firstFragment=!0);let l={[v]:o,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:a};m(e)?this._state===0?this.getBlobData(e,this._compress,l,n):this.enqueue([this.getBlobData,e,this._compress,l,n]):this._state===0?this.dispatch(e,this._compress,l,n):this.enqueue([this.dispatch,e,this._compress,l,n])}getBlobData(t,n,r,i){this._bufferedBytes+=r[v],this._state=2,t.arrayBuffer().then(t=>{if(this._socket.destroyed){let e=Error(`The socket was closed while the blob was being read`);process.nextTick(C,this,e,i);return}this._bufferedBytes-=r[v];let a=_(t);n?this.dispatch(a,n,r,i):(this._state=0,this.sendFrame(e.frame(a,r),i),this.dequeue())}).catch(e=>{process.nextTick(w,this,e,i)})}dispatch(t,n,r,i){if(!n){this.sendFrame(e.frame(t,r),i);return}let a=this._extensions[s.extensionName];this._bufferedBytes+=r[v],this._state=1,a.compress(t,r.fin,(t,n)=>{if(this._socket.destroyed){let e=Error(`The socket was closed while data was being compressed`);C(this,e,i);return}this._bufferedBytes-=r[v],this._state=0,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()})}dequeue(){for(;this._state===0&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][v],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][v],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};function C(e,t,n){typeof n==`function`&&n(t);for(let n=0;n<e._queue.length;n++){let r=e._queue[n],i=r[r.length-1];typeof i==`function`&&i(t)}}function w(e,t,n){C(e,t,n),e.onerror(t)}})),h=r(((e,t)=>{let{kForOnEventAttribute:n,kListener:r}=i(),a=Symbol(`kCode`),o=Symbol(`kData`),s=Symbol(`kError`),c=Symbol(`kMessage`),l=Symbol(`kReason`),u=Symbol(`kTarget`),d=Symbol(`kType`),f=Symbol(`kWasClean`);var p=class{constructor(e){this[u]=null,this[d]=e}get target(){return this[u]}get type(){return this[d]}};Object.defineProperty(p.prototype,"target",{enumerable:!0}),Object.defineProperty(p.prototype,"type",{enumerable:!0});var m=class extends p{constructor(e,t={}){super(e),this[a]=t.code===void 0?0:t.code,this[l]=t.reason===void 0?``:t.reason,this[f]=t.wasClean!==void 0&&t.wasClean}get code(){return this[a]}get reason(){return this[l]}get wasClean(){return this[f]}};Object.defineProperty(m.prototype,"code",{enumerable:!0}),Object.defineProperty(m.prototype,"reason",{enumerable:!0}),Object.defineProperty(m.prototype,"wasClean",{enumerable:!0});var h=class extends p{constructor(e,t={}){super(e),this[s]=t.error===void 0?null:t.error,this[c]=t.message===void 0?``:t.message}get error(){return this[s]}get message(){return this[c]}};Object.defineProperty(h.prototype,"error",{enumerable:!0}),Object.defineProperty(h.prototype,"message",{enumerable:!0});var g=class extends p{constructor(e,t={}){super(e),this[o]=t.data===void 0?null:t.data}get data(){return this[o]}};Object.defineProperty(g.prototype,"data",{enumerable:!0}),t.exports={CloseEvent:m,ErrorEvent:h,Event:p,EventTarget:{addEventListener(e,t,i={}){for(let a of this.listeners(e))if(!i[n]&&a[r]===t&&!a[n])return;let a;if(e===`message`)a=function(e,n){let r=new g(`message`,{data:n?e:e.toString()});r[u]=this,_(t,this,r)};else if(e===`close`)a=function(e,n){let r=new m(`close`,{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[u]=this,_(t,this,r)};else if(e===`error`)a=function(e){let n=new h(`error`,{error:e,message:e.message});n[u]=this,_(t,this,n)};else if(e===`open`)a=function(){let e=new p(`open`);e[u]=this,_(t,this,e)};else return;a[n]=!!i[n],a[r]=t,i.once?this.once(e,a):this.on(e,a)},removeEventListener(e,t){for(let i of this.listeners(e))if(i[r]===t&&!i[n]){this.removeListener(e,i);break}}},MessageEvent:g};function _(e,t,n){typeof e==`object`&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}})),g=r(((e,t)=>{let{tokenChars:n}=f();function r(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}function i(e){let t=Object.create(null),i=Object.create(null),a=!1,o=!1,s=!1,c,l,u=-1,d=-1,f=-1,p=0;for(;p<e.length;p++)if(d=e.charCodeAt(p),c===void 0)if(f===-1&&n[d]===1)u===-1&&(u=p);else if(p!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);d===44?(r(t,n,i),i=Object.create(null)):c=n,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);else if(l===void 0)if(f===-1&&n[d]===1)u===-1&&(u=p);else if(d===32||d===9)f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),r(i,e.slice(u,f),!0),d===44&&(r(t,c,i),i=Object.create(null),c=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)l=e.slice(u,p),u=f=-1;else throw SyntaxError(`Unexpected character at index ${p}`);else if(o){if(n[d]!==1)throw SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:a||=!0,o=!1}else if(s)if(n[d]===1)u===-1&&(u=p);else if(d===34&&u!==-1)s=!1,f=p;else if(d===92)o=!0;else throw SyntaxError(`Unexpected character at index ${p}`);else if(d===34&&e.charCodeAt(p-1)===61)s=!0;else if(f===-1&&n[d]===1)u===-1&&(u=p);else if(u!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);a&&=(n=n.replace(/\\/g,``),!1),r(i,l,n),d===44&&(r(t,c,i),i=Object.create(null),c=void 0),l=void 0,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);if(u===-1||s||d===32||d===9)throw SyntaxError(`Unexpected end of input`);f===-1&&(f=p);let m=e.slice(u,f);return c===void 0?r(t,m,i):(l===void 0?r(i,m,!0):a?r(i,l,m.replace(/\\/g,``)):r(i,l,m),r(t,c,i)),t}function a(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>e===!0?t:`${t}=${e}`).join(`; `)})).join(`; `)).join(`, `)}).join(`, `)}t.exports={format:a,parse:i}})),_=r(((t,n)=>{let r=e(`events`),a=e(`https`),o=e(`http`),s=e(`net`),c=e(`tls`),{randomBytes:u,createHash:_}=e(`crypto`),{Duplex:v,Readable:y}=e(`stream`),{URL:b}=e(`url`),x=d(),S=p(),C=m(),{isBlob:w}=f(),{BINARY_TYPES:T,CLOSE_TIMEOUT:E,EMPTY_BUFFER:D,GUID:O,kForOnEventAttribute:k,kListener:A,kStatusCode:j,kWebSocket:M,NOOP:N}=i(),{EventTarget:{addEventListener:P,removeEventListener:ee}}=h(),{format:te,parse:ne}=g(),{toBuffer:F}=l(),I=Symbol(`kAborted`),L=[8,13],R=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],z=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;var B=class e extends r{constructor(t,n,r){super(),this._binaryType=T[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=D,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol=``,this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t===null?(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0):(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n==`object`&&n?(r=n,n=[]):n=[n]),V(this,t,n,r))}get binaryType(){return this._binaryType}set binaryType(e){T.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,n,r){let i=new S({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),a=new C(t,this._extensions,r.generateMask);this._receiver=i,this._sender=a,this._socket=t,i[M]=this,a[M]=this,t[M]=this,i.on(`conclude`,re),i.on(`drain`,ie),i.on(`error`,ae),i.on(`message`,oe),i.on(`ping`,se),i.on(`pong`,ce),a.onerror=le,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on(`close`,X),t.on(`data`,Z),t.on(`end`,Q),t.on(`error`,$),this._readyState=e.OPEN,this.emit(`open`)}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit(`close`,this._closeCode,this._closeMessage);return}this._extensions[x.extensionName]&&this._extensions[x.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit(`close`,this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){G(this,this._req,`WebSocket was closed before the connection was established`);return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Y(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof t==`function`?(r=t,t=n=void 0):typeof n==`function`&&(r=n,n=void 0),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){K(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||D,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof t==`function`?(r=t,t=n=void 0):typeof n==`function`&&(r=n,n=void 0),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){K(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||D,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof n==`function`&&(r=n,n={}),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){K(this,t,r);return}let i={binary:typeof t!=`string`,mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[x.extensionName]||(i.compress=!1),this._sender.send(t||D,i,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){G(this,this._req,`WebSocket was closed before the connection was established`);return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(B,"CONNECTING",{enumerable:!0,value:R.indexOf(`CONNECTING`)}),Object.defineProperty(B.prototype,"CONNECTING",{enumerable:!0,value:R.indexOf(`CONNECTING`)}),Object.defineProperty(B,"OPEN",{enumerable:!0,value:R.indexOf(`OPEN`)}),Object.defineProperty(B.prototype,"OPEN",{enumerable:!0,value:R.indexOf(`OPEN`)}),Object.defineProperty(B,"CLOSING",{enumerable:!0,value:R.indexOf(`CLOSING`)}),Object.defineProperty(B.prototype,"CLOSING",{enumerable:!0,value:R.indexOf(`CLOSING`)}),Object.defineProperty(B,"CLOSED",{enumerable:!0,value:R.indexOf(`CLOSED`)}),Object.defineProperty(B.prototype,"CLOSED",{enumerable:!0,value:R.indexOf(`CLOSED`)}),[`binaryType`,`bufferedAmount`,`extensions`,`isPaused`,`protocol`,`readyState`,`url`].forEach(e=>{Object.defineProperty(B.prototype,e,{enumerable:!0})}),[`open`,`error`,`close`,`message`].forEach(e=>{Object.defineProperty(B.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[k])return t[A];return null},set(t){for(let t of this.listeners(e))if(t[k]){this.removeListener(e,t);break}typeof t==`function`&&this.addEventListener(e,t,{[k]:!0})}})}),B.prototype.addEventListener=P,B.prototype.removeEventListener=ee,n.exports=B;function V(e,t,n,r){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:E,protocolVersion:L[1],maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:`GET`,host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,e._closeTimeout=i.closeTimeout,!L.includes(i.protocolVersion))throw RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${L.join(`, `)})`);let s;if(t instanceof b)s=t;else try{s=new b(t)}catch{throw SyntaxError(`Invalid URL: ${t}`)}s.protocol===`http:`?s.protocol=`ws:`:s.protocol===`https:`&&(s.protocol=`wss:`),e._url=s.href;let c=s.protocol===`wss:`,l=s.protocol===`ws+unix:`,d;if(s.protocol!==`ws:`&&!c&&!l?d=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!s.pathname?d=`The URL's pathname is empty`:s.hash&&(d=`The URL contains a fragment identifier`),d){let t=SyntaxError(d);if(e._redirects===0)throw t;H(e,t);return}let f=c?443:80,p=u(16).toString(`base64`),m=c?a.request:o.request,h=new Set,g;if(i.createConnection=i.createConnection||(c?W:U),i.defaultPort=i.defaultPort||f,i.port=s.port||f,i.host=s.hostname.startsWith(`[`)?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:`Upgrade`,Upgrade:`websocket`},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new x({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers[`Sec-WebSocket-Extensions`]=te({[x.extensionName]:g.offer()})),n.length){for(let e of n){if(typeof e!=`string`||!z.test(e)||h.has(e))throw SyntaxError(`An invalid or duplicated subprotocol was specified`);h.add(e)}i.headers[`Sec-WebSocket-Protocol`]=n.join(`,`)}if(i.origin&&(i.protocolVersion<13?i.headers[`Sec-WebSocket-Origin`]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),l){let e=i.path.split(`:`);i.socketPath=e[0],i.path=e[1]}let v;if(i.followRedirects){if(e._redirects===0){e._originalIpc=l,e._originalSecure=c,e._originalHostOrSocketPath=l?i.socketPath:s.host;let t=r&&r.headers;if(r={...r,headers:{}},t)for(let[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(e.listenerCount(`redirect`)===0){let t=l?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:!e._originalIpc&&s.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!c)&&(delete i.headers.authorization,delete i.headers.cookie,t||delete i.headers.host,i.auth=void 0)}i.auth&&!r.headers.authorization&&(r.headers.authorization=`Basic `+Buffer.from(i.auth).toString(`base64`)),v=e._req=m(i),e._redirects&&e.emit(`redirect`,e.url,v)}else v=e._req=m(i);i.timeout&&v.on(`timeout`,()=>{G(e,v,`Opening handshake has timed out`)}),v.on(`error`,t=>{v===null||v[I]||(v=e._req=null,H(e,t))}),v.on(`response`,a=>{let o=a.headers.location,s=a.statusCode;if(o&&i.followRedirects&&s>=300&&s<400){if(++e._redirects>i.maxRedirects){G(e,v,`Maximum redirects exceeded`);return}v.abort();let a;try{a=new b(o,t)}catch{H(e,SyntaxError(`Invalid URL: ${o}`));return}V(e,a,n,r)}else e.emit(`unexpected-response`,v,a)||G(e,v,`Unexpected server response: ${a.statusCode}`)}),v.on(`upgrade`,(t,n,r)=>{if(e.emit(`upgrade`,t),e.readyState!==B.CONNECTING)return;v=e._req=null;let a=t.headers.upgrade;if(a===void 0||a.toLowerCase()!==`websocket`){G(e,n,`Invalid Upgrade header`);return}let o=_(`sha1`).update(p+O).digest(`base64`);if(t.headers[`sec-websocket-accept`]!==o){G(e,n,`Invalid Sec-WebSocket-Accept header`);return}let s=t.headers[`sec-websocket-protocol`],c;if(s===void 0?h.size&&(c=`Server sent no subprotocol`):h.size?h.has(s)||(c=`Server sent an invalid subprotocol`):c=`Server sent a subprotocol but none was requested`,c){G(e,n,c);return}s&&(e._protocol=s);let l=t.headers[`sec-websocket-extensions`];if(l!==void 0){if(!g){G(e,n,`Server sent a Sec-WebSocket-Extensions header but no extension was requested`);return}let t;try{t=ne(l)}catch{G(e,n,`Invalid Sec-WebSocket-Extensions header`);return}let r=Object.keys(t);if(r.length!==1||r[0]!==x.extensionName){G(e,n,`Server indicated an extension that was not requested`);return}try{g.accept(t[x.extensionName])}catch{G(e,n,`Invalid Sec-WebSocket-Extensions header`);return}e._extensions[x.extensionName]=g}e.setSocket(n,r,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(v,e):v.end()}function H(e,t){e._readyState=B.CLOSING,e._errorEmitted=!0,e.emit(`error`,t),e.emitClose()}function U(e){return e.path=e.socketPath,s.connect(e)}function W(e){return e.path=void 0,!e.servername&&e.servername!==``&&(e.servername=s.isIP(e.host)?``:e.host),c.connect(e)}function G(e,t,n){e._readyState=B.CLOSING;let r=Error(n);Error.captureStackTrace(r,G),t.setHeader?(t[I]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(H,e,r)):(t.destroy(r),t.once(`error`,e.emit.bind(e,`error`)),t.once(`close`,e.emitClose.bind(e)))}function K(e,t,n){if(t){let n=w(t)?t.size:F(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){let t=Error(`WebSocket is not open: readyState ${e.readyState} (${R[e.readyState]})`);process.nextTick(n,t)}}function re(e,t){let n=this[M];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[M]!==void 0&&(n._socket.removeListener(`data`,Z),process.nextTick(J,n._socket),e===1005?n.close():n.close(e,t))}function ie(){let e=this[M];e.isPaused||e._socket.resume()}function ae(e){let t=this[M];t._socket[M]!==void 0&&(t._socket.removeListener(`data`,Z),process.nextTick(J,t._socket),t.close(e[j])),t._errorEmitted||(t._errorEmitted=!0,t.emit(`error`,e))}function q(){this[M].emitClose()}function oe(e,t){this[M].emit(`message`,e,t)}function se(e){let t=this[M];t._autoPong&&t.pong(e,!this._isServer,N),t.emit(`ping`,e)}function ce(e){this[M].emit(`pong`,e)}function J(e){e.resume()}function le(e){let t=this[M];t.readyState!==B.CLOSED&&(t.readyState===B.OPEN&&(t._readyState=B.CLOSING,Y(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit(`error`,e)))}function Y(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function X(){let e=this[M];if(this.removeListener(`close`,X),this.removeListener(`data`,Z),this.removeListener(`end`,Q),e._readyState=B.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[M]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on(`error`,q),e._receiver.on(`finish`,q))}function Z(e){this[M]._receiver.write(e)||this.pause()}function Q(){let e=this[M];e._readyState=B.CLOSING,e._receiver.end(),this.end()}function $(){let e=this[M];this.removeListener(`error`,$),this.on(`error`,N),e&&(e._readyState=B.CLOSING,this.destroy())}})),v=r(((t,n)=>{_();let{Duplex:r}=e(`stream`);function i(e){e.emit(`close`)}function a(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o(e){this.removeListener(`error`,o),this.destroy(),this.listenerCount(`error`)===0&&this.emit(`error`,e)}function s(e,t){let n=!0,s=new r({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on(`message`,function(t,n){let r=!n&&s._readableState.objectMode?t.toString():t;s.push(r)||e.pause()}),e.once(`error`,function(e){s.destroyed||(n=!1,s.destroy(e))}),e.once(`close`,function(){s.destroyed||s.push(null)}),s._destroy=function(t,r){if(e.readyState===e.CLOSED){r(t),process.nextTick(i,s);return}let a=!1;e.once(`error`,function(e){a=!0,r(e)}),e.once(`close`,function(){a||r(t),process.nextTick(i,s)}),n&&e.terminate()},s._final=function(t){if(e.readyState===e.CONNECTING){e.once(`open`,function(){s._final(t)});return}e._socket!==null&&(e._socket._writableState.finished?(t(),s._readableState.endEmitted&&s.destroy()):(e._socket.once(`finish`,function(){t()}),e.close()))},s._read=function(){e.isPaused&&e.resume()},s._write=function(t,n,r){if(e.readyState===e.CONNECTING){e.once(`open`,function(){s._write(t,n,r)});return}e.send(t,r)},s.on(`end`,a),s.on(`error`,o),s}n.exports=s})),y=r(((e,t)=>{let{tokenChars:n}=f();function r(e){let t=new Set,r=-1,i=-1,a=0;for(;a<e.length;a++){let o=e.charCodeAt(a);if(i===-1&&n[o]===1)r===-1&&(r=a);else if(a!==0&&(o===32||o===9))i===-1&&r!==-1&&(i=a);else if(o===44){if(r===-1)throw SyntaxError(`Unexpected character at index ${a}`);i===-1&&(i=a);let n=e.slice(r,i);if(t.has(n))throw SyntaxError(`The "${n}" subprotocol is duplicated`);t.add(n),r=i=-1}else throw SyntaxError(`Unexpected character at index ${a}`)}if(r===-1||i!==-1)throw SyntaxError(`Unexpected end of input`);let o=e.slice(r,a);if(t.has(o))throw SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}t.exports={parse:r}})),b=r(((t,n)=>{let r=e(`events`),a=e(`http`),{Duplex:o}=e(`stream`),{createHash:s}=e(`crypto`),c=g(),l=d(),u=y(),f=_(),{CLOSE_TIMEOUT:p,GUID:m,kWebSocket:h}=i(),v=/^[+/0-9A-Za-z]{22}==$/;n.exports=class extends r{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:p,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:f,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw TypeError(`One and only one of the "port", "server", or "noServer" options must be specified`);if(e.port==null?e.server&&(this._server=e.server):(this._server=a.createServer((e,t)=>{let n=a.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":`text/plain`}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)),this._server){let e=this.emit.bind(this,`connection`);this._removeListeners=b(this._server,{listening:this.emit.bind(this,`listening`),error:this.emit.bind(this,`error`),upgrade:(t,n,r)=>{this.handleUpgrade(t,n,r,e)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw Error(`The server is operating in "noServer" mode`);return this._server?this._server.address():null}close(e){if(this._state===2){e&&this.once(`close`,()=>{e(Error(`The server is not running`))}),process.nextTick(x,this);return}if(e&&this.once(`close`,e),this._state!==1)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(x,this);else{let e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close(()=>{x(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf(`?`);if((t===-1?e.url:e.url.slice(0,t))!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on(`error`,S);let i=e.headers[`sec-websocket-key`],a=e.headers.upgrade,o=+e.headers[`sec-websocket-version`];if(e.method!==`GET`){w(this,e,t,405,`Invalid HTTP method`);return}if(a===void 0||a.toLowerCase()!==`websocket`){w(this,e,t,400,`Invalid Upgrade header`);return}if(i===void 0||!v.test(i)){w(this,e,t,400,`Missing or invalid Sec-WebSocket-Key header`);return}if(o!==13&&o!==8){w(this,e,t,400,`Missing or invalid Sec-WebSocket-Version header`,{"Sec-WebSocket-Version":`13, 8`});return}if(!this.shouldHandle(e)){C(t,400);return}let s=e.headers[`sec-websocket-protocol`],d=new Set;if(s!==void 0)try{d=u.parse(s)}catch{w(this,e,t,400,`Invalid Sec-WebSocket-Protocol header`);return}let f=e.headers[`sec-websocket-extensions`],p={};if(this.options.perMessageDeflate&&f!==void 0){let n=new l({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let e=c.parse(f);e[l.extensionName]&&(n.accept(e[l.extensionName]),p[l.extensionName]=n)}catch{w(this,e,t,400,`Invalid or unacceptable Sec-WebSocket-Extensions header`);return}}if(this.options.verifyClient){let a={origin:e.headers[`${o===8?`sec-websocket-origin`:`origin`}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(a,(a,o,s,c)=>{if(!a)return C(t,o||401,s,c);this.completeUpgrade(p,i,d,e,t,n,r)});return}if(!this.options.verifyClient(a))return C(t,401)}this.completeUpgrade(p,i,d,e,t,n,r)}completeUpgrade(e,t,n,r,i,a,o){if(!i.readable||!i.writable)return i.destroy();if(i[h])throw Error(`server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration`);if(this._state>0)return C(i,503);let u=[`HTTP/1.1 101 Switching Protocols`,`Upgrade: websocket`,`Connection: Upgrade`,`Sec-WebSocket-Accept: ${s(`sha1`).update(t+m).digest(`base64`)}`],d=new this.options.WebSocket(null,void 0,this.options);if(n.size){let e=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;e&&(u.push(`Sec-WebSocket-Protocol: ${e}`),d._protocol=e)}if(e[l.extensionName]){let t=e[l.extensionName].params,n=c.format({[l.extensionName]:[t]});u.push(`Sec-WebSocket-Extensions: ${n}`),d._extensions=e}this.emit(`headers`,u,r),i.write(u.concat(`\r
4
+ `).join(`\r
5
+ `)),i.removeListener(`error`,S),d.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on(`close`,()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(x,this)})),o(d,r)}};function b(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function x(e){e._state=2,e.emit(`close`)}function S(){this.destroy()}function C(e,t,n,r){n||=a.STATUS_CODES[t],r={Connection:`close`,"Content-Type":`text/html`,"Content-Length":Buffer.byteLength(n),...r},e.once(`finish`,e.destroy),e.end(`HTTP/1.1 ${t} ${a.STATUS_CODES[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join(`\r
6
+ `)+`\r
7
+ \r
8
+ `+n)}function w(e,t,n,r,i,a){if(e.listenerCount(`wsClientError`)){let r=Error(i);Error.captureStackTrace(r,w),e.emit(`wsClientError`,r,n,t)}else C(n,r,i,a)}})),x;t((()=>{v(),g(),d(),p(),m(),y(),_(),x=n(b(),1)}))();var S=x.default;export{S as WebSocketServer};
@@ -1,2 +1,2 @@
1
- import"../node_modules/.pnpm/autoevals@0.0.132_ws@8.21.1_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js";import{toInputSchema}from"#shared/tool-schema.js";import{resolveProviderHeaders}from"#internal/gateway.js";import{generateText}from"ai";var AutoevalsOpenAIClientAdapter=class{chat;constructor(e){this.chat={completions:{create:isAutoevalsClientConfig(e)?t=>createChatCompletion(t,e):createProbeChatCompletion}}}};function createAutoevalsClient(e){return new AutoevalsOpenAIClientAdapter(e)}function isAutoevalsClientConfig(e){return`languageModel`in e}async function createProbeChatCompletion(){return{choices:[]}}async function createChatCompletion(e,r){let i=convertTools(e.tools),a=await generateText({headers:resolveProviderHeaders(r.languageModel),model:r.languageModel,messages:convertMessages(e.messages??[]),tools:Object.keys(i).length>0?i:void 0,toolChoice:convertToolChoice(e.tool_choice),providerOptions:r.providerOptions}),o=a.toolCalls.map(e=>({id:e.toolCallId,type:`function`,function:{name:e.toolName,arguments:JSON.stringify(e.input??{})}}));return{choices:[{index:0,finish_reason:o.length>0?`tool_calls`:`stop`,message:{role:`assistant`,content:a.text||null,tool_calls:o.length>0?o:void 0}}]}}function convertMessages(e){return e.map(e=>{let t=contentToText(e.content);switch(e.role){case`assistant`:return{role:`assistant`,content:t};case`developer`:case`system`:return{role:`system`,content:t};default:return{role:`user`,content:t}}})}function contentToText(e){return e==null?``:typeof e==`string`?e:e.map(e=>e.text??``).filter(Boolean).join(`
1
+ import"../node_modules/.pnpm/autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js";import{toInputSchema}from"#shared/tool-schema.js";import{resolveProviderHeaders}from"#internal/gateway.js";import{generateText}from"ai";var AutoevalsOpenAIClientAdapter=class{chat;constructor(e){this.chat={completions:{create:isAutoevalsClientConfig(e)?t=>createChatCompletion(t,e):createProbeChatCompletion}}}};function createAutoevalsClient(e){return new AutoevalsOpenAIClientAdapter(e)}function isAutoevalsClientConfig(e){return`languageModel`in e}async function createProbeChatCompletion(){return{choices:[]}}async function createChatCompletion(e,r){let i=convertTools(e.tools),a=await generateText({headers:resolveProviderHeaders(r.languageModel),model:r.languageModel,messages:convertMessages(e.messages??[]),tools:Object.keys(i).length>0?i:void 0,toolChoice:convertToolChoice(e.tool_choice),providerOptions:r.providerOptions}),o=a.toolCalls.map(e=>({id:e.toolCallId,type:`function`,function:{name:e.toolName,arguments:JSON.stringify(e.input??{})}}));return{choices:[{index:0,finish_reason:o.length>0?`tool_calls`:`stop`,message:{role:`assistant`,content:a.text||null,tool_calls:o.length>0?o:void 0}}]}}function convertMessages(e){return e.map(e=>{let t=contentToText(e.content);switch(e.role){case`assistant`:return{role:`assistant`,content:t};case`developer`:case`system`:return{role:`system`,content:t};default:return{role:`user`,content:t}}})}function contentToText(e){return e==null?``:typeof e==`string`?e:e.map(e=>e.text??``).filter(Boolean).join(`
2
2
  `)}function convertTools(t){let n={};for(let r of t??[])r.type!==`function`||r.function?.name===void 0||(n[r.function.name]={description:r.function.description,inputSchema:toInputSchema(r.function.parameters??{})});return n}function convertToolChoice(e){if(e!==void 0)return typeof e==`string`?e:{type:`tool`,toolName:e.function.name}}export{createAutoevalsClient};
@@ -1 +1 @@
1
- import{Levenshtein}from"../../node_modules/.pnpm/autoevals@0.0.132_ws@8.21.1_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js";import{formatDiagnosticValue,toDiagnosticMetadataValue}from"#evals/diagnostics.js";import{deepEquals,testRegExp}from"#evals/match.js";function makeAssertion(e){let evaluate=t=>{let n=e.evaluate(t);return n instanceof Promise?n.then(normalizeEvaluation):normalizeEvaluation(n)};return{name:e.name,severity:e.severity,threshold:e.threshold,evaluate,score(e){let t=evaluate(e);return t instanceof Promise?t.then(e=>e.score):t.score},gate(t){return makeAssertion({...e,severity:`gate`,threshold:t})},soft(t){return makeAssertion({...e,severity:`soft`,threshold:t})},atLeast(t){return makeAssertion({...e,severity:`soft`,threshold:t})}}}function normalizeEvaluation(e){return typeof e==`number`?{score:e}:e}function includes(e){return makeAssertion({name:`includes(${e})`,severity:`gate`,evaluate:n=>{let r=String(n??``);return(typeof e==`string`?r.includes(e):testRegExp(e,r))?1:{score:0,message:`expected ${formatDiagnosticValue(r)} to include ${formatDiagnosticValue(String(e))}`,metadata:{actual:r,expected:String(e)}}}})}function satisfies(e,r){if(r.trim().length===0)throw Error(`satisfies() requires a non-empty label.`);return makeAssertion({name:`satisfies(${r})`,severity:`gate`,evaluate:i=>e(i)?1:{score:0,message:`predicate did not hold for ${formatDiagnosticValue(i)}`,metadata:{actual:toDiagnosticMetadataValue(i),predicate:r}}})}function equals(e){return makeAssertion({name:`equals`,severity:`gate`,evaluate:i=>deepEquals(i,e)?1:{score:0,message:`expected ${formatDiagnosticValue(e)}; received ${formatDiagnosticValue(i)}`,metadata:{actual:toDiagnosticMetadataValue(i),expected:toDiagnosticMetadataValue(e)}}})}function matches(e){return makeAssertion({name:`matches`,severity:`gate`,evaluate:async t=>{let r=await e[`~standard`].validate(t);return!(`issues`in r)||r.issues===void 0?1:{score:0,message:`schema validation failed: ${r.issues.map(formatSchemaIssue).join(`; `)}`,metadata:{actual:toDiagnosticMetadataValue(t),issues:toDiagnosticMetadataValue(r.issues)}}}})}function similarity(n){return makeAssertion({name:`similarity`,severity:`soft`,evaluate:async r=>{let i=String(r??``);return{score:(await Levenshtein({output:i,expected:n})).score??0,message:`expected similarity to ${formatDiagnosticValue(n)}; received ${formatDiagnosticValue(i)}`,metadata:{actual:i,expected:n}}}})}function formatSchemaIssue(e){return`${e.path===void 0?``:`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: `}${e.message}`}export{equals,includes,matches,satisfies,similarity};
1
+ import{Levenshtein}from"../../node_modules/.pnpm/autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js";import{formatDiagnosticValue,toDiagnosticMetadataValue}from"#evals/diagnostics.js";import{deepEquals,testRegExp}from"#evals/match.js";function makeAssertion(e){let evaluate=t=>{let n=e.evaluate(t);return n instanceof Promise?n.then(normalizeEvaluation):normalizeEvaluation(n)};return{name:e.name,severity:e.severity,threshold:e.threshold,evaluate,score(e){let t=evaluate(e);return t instanceof Promise?t.then(e=>e.score):t.score},gate(t){return makeAssertion({...e,severity:`gate`,threshold:t})},soft(t){return makeAssertion({...e,severity:`soft`,threshold:t})},atLeast(t){return makeAssertion({...e,severity:`soft`,threshold:t})}}}function normalizeEvaluation(e){return typeof e==`number`?{score:e}:e}function includes(e){return makeAssertion({name:`includes(${e})`,severity:`gate`,evaluate:n=>{let r=String(n??``);return(typeof e==`string`?r.includes(e):testRegExp(e,r))?1:{score:0,message:`expected ${formatDiagnosticValue(r)} to include ${formatDiagnosticValue(String(e))}`,metadata:{actual:r,expected:String(e)}}}})}function satisfies(e,r){if(r.trim().length===0)throw Error(`satisfies() requires a non-empty label.`);return makeAssertion({name:`satisfies(${r})`,severity:`gate`,evaluate:i=>e(i)?1:{score:0,message:`predicate did not hold for ${formatDiagnosticValue(i)}`,metadata:{actual:toDiagnosticMetadataValue(i),predicate:r}}})}function equals(e){return makeAssertion({name:`equals`,severity:`gate`,evaluate:i=>deepEquals(i,e)?1:{score:0,message:`expected ${formatDiagnosticValue(e)}; received ${formatDiagnosticValue(i)}`,metadata:{actual:toDiagnosticMetadataValue(i),expected:toDiagnosticMetadataValue(e)}}})}function matches(e){return makeAssertion({name:`matches`,severity:`gate`,evaluate:async t=>{let r=await e[`~standard`].validate(t);return!(`issues`in r)||r.issues===void 0?1:{score:0,message:`schema validation failed: ${r.issues.map(formatSchemaIssue).join(`; `)}`,metadata:{actual:toDiagnosticMetadataValue(t),issues:toDiagnosticMetadataValue(r.issues)}}}})}function similarity(n){return makeAssertion({name:`similarity`,severity:`soft`,evaluate:async r=>{let i=String(r??``);return{score:(await Levenshtein({output:i,expected:n})).score??0,message:`expected similarity to ${formatDiagnosticValue(n)}; received ${formatDiagnosticValue(i)}`,metadata:{actual:i,expected:n}}}})}function formatSchemaIssue(e){return`${e.path===void 0?``:`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: `}${e.message}`}export{equals,includes,matches,satisfies,similarity};
@@ -1,2 +1,2 @@
1
- import{ClosedQA,Factuality,Sql,Summary}from"../node_modules/.pnpm/autoevals@0.0.132_ws@8.21.1_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{formatDiagnosticValue}from"#evals/diagnostics.js";import{createAutoevalsClient}from"#evals/autoevals-client.js";function buildJudgeContext(a){function grade(e,t,n,r){let o=t?.on??a.getReply(),s=String(o??``),c=a.getInput(),l=t?.model??a.judge?.model,u=t?.modelOptions??a.judge?.modelOptions;return a.collector.recordValue({name:e,severity:`soft`,score:async()=>{if(l===void 0)throw Error(`${e} needs a judge model. Set \`judge\` on the eval or in evals.config.ts, or pass { model } to the call.`);let t=await r({input:c,output:s,model:l,modelOptions:u}),a=t.error===void 0?{}:{autoevalsError:t.error},o={...t.metadata,...a,judge:formatLanguageModelGatewayId(l),input:c,output:s,[n.label]:n.value,autoevalsName:t.name};return{score:t.score??0,message:formatJudgeDetail(c,s,n,t),metadata:o}}})}return{autoevals:{factuality:(e,n)=>grade(`judge.autoevals.factuality`,n,{label:`expected`,value:e},({input:n,output:r,model:i,modelOptions:a})=>Factuality({input:n,output:r,expected:e,...client(i,a)})),summarizes:(e,t)=>grade(`judge.autoevals.summarizes`,t,{label:`expected`,value:e},({input:t,output:n,model:i,modelOptions:a})=>Summary({input:t,output:n,expected:e,...client(i,a)})),closedQA:(t,n)=>grade(`judge.autoevals.closedQA`,n,{label:`criteria`,value:t},({input:n,output:r,model:i,modelOptions:a})=>ClosedQA({input:n,output:r,criteria:t,...client(i,a)})),sql:(e,t)=>grade(`judge.autoevals.sql`,t,{label:`expected`,value:e},({input:t,output:r,model:i,modelOptions:a})=>Sql({input:t,output:r,expected:e,...client(i,a)}))}}}function formatJudgeDetail(e,t,n,r){let i=[[`prompt`,e],[n.label,n.value],[`response`,t]];return r.metadata?.rationale!==void 0&&i.push([`rationale`,r.metadata.rationale]),r.metadata?.choice!==void 0&&i.push([`choice`,r.metadata.choice]),r.error!==void 0&&i.push([`autoevals error`,r.error]),i.map(([e,t])=>`${e}: ${formatDiagnosticValue(t)}`).join(`
1
+ import{ClosedQA,Factuality,Sql,Summary}from"../node_modules/.pnpm/autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{formatDiagnosticValue}from"#evals/diagnostics.js";import{createAutoevalsClient}from"#evals/autoevals-client.js";function buildJudgeContext(a){function grade(e,t,n,r){let o=t?.on??a.getReply(),s=String(o??``),c=a.getInput(),l=t?.model??a.judge?.model,u=t?.modelOptions??a.judge?.modelOptions;return a.collector.recordValue({name:e,severity:`soft`,score:async()=>{if(l===void 0)throw Error(`${e} needs a judge model. Set \`judge\` on the eval or in evals.config.ts, or pass { model } to the call.`);let t=await r({input:c,output:s,model:l,modelOptions:u}),a=t.error===void 0?{}:{autoevalsError:t.error},o={...t.metadata,...a,judge:formatLanguageModelGatewayId(l),input:c,output:s,[n.label]:n.value,autoevalsName:t.name};return{score:t.score??0,message:formatJudgeDetail(c,s,n,t),metadata:o}}})}return{autoevals:{factuality:(e,n)=>grade(`judge.autoevals.factuality`,n,{label:`expected`,value:e},({input:n,output:r,model:i,modelOptions:a})=>Factuality({input:n,output:r,expected:e,...client(i,a)})),summarizes:(e,t)=>grade(`judge.autoevals.summarizes`,t,{label:`expected`,value:e},({input:t,output:n,model:i,modelOptions:a})=>Summary({input:t,output:n,expected:e,...client(i,a)})),closedQA:(t,n)=>grade(`judge.autoevals.closedQA`,n,{label:`criteria`,value:t},({input:n,output:r,model:i,modelOptions:a})=>ClosedQA({input:n,output:r,criteria:t,...client(i,a)})),sql:(e,t)=>grade(`judge.autoevals.sql`,t,{label:`expected`,value:e},({input:t,output:r,model:i,modelOptions:a})=>Sql({input:t,output:r,expected:e,...client(i,a)}))}}}function formatJudgeDetail(e,t,n,r){let i=[[`prompt`,e],[n.label,n.value],[`response`,t]];return r.metadata?.rationale!==void 0&&i.push([`rationale`,r.metadata.rationale]),r.metadata?.choice!==void 0&&i.push([`choice`,r.metadata.choice]),r.error!==void 0&&i.push([`autoevals error`,r.error]),i.map(([e,t])=>`${e}: ${formatDiagnosticValue(t)}`).join(`
2
2
  `)}function client(e,t){return{model:formatLanguageModelGatewayId(e),client:createAutoevalsClient({languageModel:e,providerOptions:t?.providerOptions})}}export{buildJudgeContext};
@@ -1,13 +1,7 @@
1
1
  /**
2
- * Starts or continues every pending runtime action for the parked parent
3
- * session.
4
- *
5
- * The batch is classified into a dispatch plan first (reject / resume /
6
- * start), then each entry dispatches and emits one
7
- * parent `subagent.called` control-plane event through a single tail.
8
- * Every start commits an agent handle (`starting`) before its side effect
9
- * and confirms it (`running`) once the child reports coordinates, so the
10
- * returned snapshot-bearing state owns every child it may have created.
2
+ * Dispatches every pending runtime action for a parked parent session.
3
+ * Starts commit ownership before their side effect, so the returned state
4
+ * owns every child it may have created.
11
5
  */
12
6
  import type { RuntimeSubagentResult } from "#runtime/actions/types.js";
13
7
  import { type DurableSessionState } from "#execution/durable-session-store.js";
@@ -1 +1 @@
1
- import{createLogger,logError}from"#internal/logging.js";import{callAdapterEventHandler}from"#channel/adapter.js";import{AuthKey,CapabilitiesKey,ChannelInstrumentationKey,InitiatorAuthKey}from"#context/keys.js";import{toErrorMessage}from"#shared/errors.js";import{createSubagentCalledEvent,encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{resolveRemoteAgentForAction,startRemoteAgentSession}from"#execution/remote-agent-dispatch.js";import{SUBAGENT_START_FAILED}from"#harness/agent-handle-errors.js";import{confirmAgentStarted,prepareAgentStart,rejectAgentEffect}from"#harness/handles/transitions.js";import{createWorkflowRuntime,workflowEntryReference}from"#execution/workflow-runtime.js";import{deserializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{getAgentHandleStore}from"#harness/handles/store.js";import{getDynamicSubagentSelection}from"#context/dynamic-subagent-lifecycle.js";import{hydrateDurableSession}from"#execution/session.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{dispatchToAgentHandle,isAgentHandleAction}from"#execution/agent-handle-dispatch.js";import{createAgentContinuationBundle}from"#execution/agent-continuation-bundle.js";import{getPendingRuntimeActionBatch}from"#harness/runtime-actions.js";import{createRecursiveAgentRootOnlyResult,createRemoteAgentStartFailureResult,createUnavailableDynamicSubagentResult,getSubagentName}from"#execution/dispatch-action-failures.js";import{mintStartOperation}from"#execution/dispatch-start-operation.js";import{buildSubagentRunInput}from"#execution/subagent-tool.js";import{readSessionTraceContext}from"#tracing/agent-trace-context-store.js";import{resolveSubagentDepth}from"#harness/subagent-depth.js";const log=createLogger(`execution.dispatch-runtime-actions`);async function dispatchRuntimeActionsStep(e){"use step";let s=await readDurableSession(e.sessionState),p=getPendingRuntimeActionBatch(s.state);if(p===void 0||p.actions.length===0)return{results:[],sessionState:e.sessionState};let m=await deserializeContext(e.serializedContext),h=m.require(BundleKey),g=resolveEffectiveAgentRuntime(h,m),_=hydrateDurableSession({compactionOverrides:{thresholdPercent:g.thresholdPercent},durable:s,turnAgent:g.turnAgent}),v=m.require(ChannelKey),y=m.get(AuthKey)??null,b=m.get(CapabilitiesKey),x=m.get(ChannelInstrumentationKey),S=m.get(InitiatorAuthKey)??null,C=buildAdapterContext(v,m),w=readSessionTraceContext(e.serializedContext,_.sessionId),T=h.resolvedAgent.config?.experimental?.subagentPersistentSessions===!0;getAgentHandleStore(s.state);let E=planDispatch({actions:p.actions,bundle:h,ctx:m,session:_}),D=e.parentWritable.getWriter(),O=E.filter(e=>e.kind===`start`&&e.target.kind===`local`).length,k=_,A=[];try{for(let r of E){if(r.kind===`reject`){A.push(r.result);continue}let i;switch(r.kind){case`resume`:i=await dispatchToAgentHandle({action:r.action,agentId:r.agentId,bundle:createAgentContinuationBundle({action:r.action,bundle:h,dynamicRemoteAgent:r.dynamicRemoteAgent}),currentSession:k,parentToken:e.parentContinuationToken??_.continuationToken,parentTurnId:p.event.turnId});break;case`start`:i=await startSubagent({auth:y,batchEvent:p.event,bundle:h,callbackBaseUrl:e.callbackBaseUrl,capabilities:b,channelMetadata:x,currentSession:k,fanoutSize:O,initiatorAuth:S,parentContinuationToken:e.parentContinuationToken,parentTraceContext:w,persistentSessions:T,session:_,target:r.target});break}if(k=i.session,i.kind===`error`){A.push(i.result);continue}try{let e=await callAdapterEventHandler(v,createSubagentCalledEvent({callId:i.callId,childSessionId:i.address.sessionId,name:i.name,remote:i.address.kind===`agent/remote`?{url:i.address.url}:void 0,sequence:p.event.sequence,sessionId:_.sessionId,toolName:i.toolName,turnId:p.event.turnId,workflowId:workflowEntryReference.workflowId}),C);await D.write(encodeMessageStreamEvent(stampMessageStreamEvent(e)))}catch(e){logError(log,`subagent.called emission failed`,e,{callId:i.callId,childSessionId:i.address.sessionId,toolName:i.toolName})}}}finally{D.releaseLock()}return{results:A,sessionState:k===_?e.sessionState:createDurableSessionState({session:k})}}function planDispatch(e){let t=getAgentHandleStore(e.session.state)?.handles??[];return e.actions.map(n=>{let r=n.input.agentId,i=typeof r==`string`&&r.trim()!==``?r:void 0;if(i!==void 0&&isAgentHandleAction(n)){if(t.some(e=>e.identity.id===i)){let t=e.bundle.subagentRegistry.dynamicNodeIds?.has(n.nodeId)===!0?getDynamicSubagentSelection(e.ctx,n.nodeId):void 0;return{action:n,agentId:i,dynamicRemoteAgent:n.kind===`remote-agent-call`&&t?.kind===`remote`?t.remoteAgent:void 0,kind:`resume`}}log.warn(`unknown agentId on subagent call; starting a new agent`,{agentId:i,callId:n.callId})}return classifyFreshStart({action:n,bundle:e.bundle,ctx:e.ctx,session:e.session})})}function classifyFreshStart(e){let{action:t}=e,n=e.bundle.subagentRegistry.subagentsByNodeId,r=resolveSubagentDepth(e.session),i=e.session.rootSessionId!==void 0||r.currentDepth>0,a=(t.kind===`subagent-call`||t.kind===`remote-agent-call`)&&e.bundle.subagentRegistry.dynamicNodeIds?.has(t.nodeId)===!0,o=a?getDynamicSubagentSelection(e.ctx,t.nodeId):void 0;if(a&&(o===void 0||t.kind===`subagent-call`&&o.kind!==`subagent`||t.kind===`remote-agent-call`&&o.kind!==`remote`)){let e=getSubagentName(t);return log.warn(`dynamic subagent call blocked after availability changed`,{callId:t.callId,nodeId:t.nodeId,subagentName:e}),{kind:`reject`,result:createUnavailableDynamicSubagentResult(t)}}if(isRecursiveAgentAction(t,n)&&i)return log.warn(`recursive agent call blocked outside the root session`,{callId:t.callId,currentDepth:r.currentDepth,nodeId:t.nodeId,subagentName:t.subagentName}),{kind:`reject`,result:createRecursiveAgentRootOnlyResult(t)};switch(t.kind){case`subagent-call`:{let e=o?.kind===`subagent`?o.agentConfig:void 0,r=n.get(t.nodeId),i=e?.description??(r?.definition.kind===`subagent`?r.definition.description:void 0);return{kind:`start`,target:{action:t,dynamicSubagentAgentConfig:e,kind:`local`,source:i===void 0?{type:`runtime`}:{description:i,type:`local`}}}}case`remote-agent-call`:return{kind:`start`,target:{action:t,dynamicRemoteAgent:o?.kind===`remote`?o.remoteAgent:void 0,kind:`remote`}};default:throw Error(`Unsupported runtime action kind "${t.kind}" in workflow runtime.`)}}async function startSubagent(e){switch(e.target.kind){case`local`:return startLocalSubagent({action:e.target.action,auth:e.auth,batchEvent:e.batchEvent,bundle:e.bundle,capabilities:e.capabilities,channelMetadata:e.channelMetadata,currentSession:e.currentSession,dynamicSubagentAgentConfig:e.target.dynamicSubagentAgentConfig,fanoutSize:e.fanoutSize,initiatorAuth:e.initiatorAuth,parentContinuationToken:e.parentContinuationToken,parentTraceContext:e.parentTraceContext,persistentSessions:e.persistentSessions,session:e.session,source:e.target.source});case`remote`:return startRemoteSubagent({action:e.target.action,auth:e.auth,batchEvent:e.batchEvent,bundle:e.bundle,callbackBaseUrl:e.callbackBaseUrl,currentSession:e.currentSession,dynamicRemoteAgent:e.target.dynamicRemoteAgent,initiatorAuth:e.initiatorAuth,parentContinuationToken:e.parentContinuationToken,persistentSessions:e.persistentSessions,session:e.session});default:return e.target}}async function startLocalSubagent(e){let{action:n,source:r}=e,i=createWorkflowRuntime({compiledArtifactsSource:e.bundle.compiledArtifactsSource,dynamicSubagentAgentConfig:e.dynamicSubagentAgentConfig,nodeId:n.nodeId}),{childContinuationToken:a,runInput:o}=buildSubagentRunInput({action:n,auth:e.auth,batchEvent:e.batchEvent,capabilities:e.capabilities,channelMetadata:e.channelMetadata,fanoutSize:e.fanoutSize,initiatorAuth:e.initiatorAuth,parentContinuationToken:e.parentContinuationToken,parentTraceContext:e.parentTraceContext,persistentSessions:e.persistentSessions,session:e.session,source:r}),c=r.type===`runtime`?`agent/self`:`agent/local`,{identity:l,operation:u}=mintStartOperation({callId:n.callId,name:n.subagentName,nodeId:n.nodeId,parentSessionId:e.session.sessionId,parentTurnId:e.batchEvent.turnId}),d=prepareAgentStart(e.currentSession,{identity:l,operation:u,target:{continuationToken:a,kind:c}}),f;try{f=(await i.createSession(o)).sessionId}catch(e){return logError(log,`local subagent start failed`,e,{callId:n.callId,nodeId:n.nodeId,subagentName:n.subagentName}),{kind:`error`,result:{callId:n.callId,isError:!0,kind:`subagent-result`,origin:`dispatch`,output:{code:SUBAGENT_START_FAILED,message:toErrorMessage(e)},subagentName:n.subagentName},session:rejectAgentEffect(d,{disposition:`dead`,operationId:u.id})}}let p={continuationToken:a,kind:c,sessionId:f};return{address:p,callId:n.callId,kind:`called`,name:n.name,session:confirmAgentStarted(d,{address:p,operationId:u.id}),toolName:n.subagentName}}async function startRemoteSubagent(e){let{action:n}=e,r,i;try{if(e.callbackBaseUrl===void 0)throw Error(`Cannot dispatch remote agent without a callback base URL.`);r=e.callbackBaseUrl,i=resolveRemoteAgentForAction({dynamicRemoteAgent:e.dynamicRemoteAgent,nodeId:n.nodeId,remoteAgentName:n.remoteAgentName,registry:e.bundle.subagentRegistry.subagentsByNodeId})}catch(r){return logError(log,`remote agent start failed`,r,{remoteAgentName:n.remoteAgentName,nodeId:n.nodeId,callId:n.callId}),{kind:`error`,result:createRemoteAgentStartFailureResult({action:n,error:r}),session:e.currentSession}}let{identity:a,operation:o}=mintStartOperation({callId:n.callId,name:n.remoteAgentName,nodeId:n.nodeId,parentSessionId:e.session.sessionId,parentTurnId:e.batchEvent.turnId}),s=prepareAgentStart(e.currentSession,{identity:a,operation:o,target:{callbackBaseUrl:r,kind:`agent/remote`,url:i.url}});try{let t=await startRemoteAgentSession({action:n,auth:e.auth,callbackBaseUrl:r,callbackToken:e.parentContinuationToken,initiatorAuth:e.initiatorAuth,persistentSessions:e.persistentSessions,remote:i,session:e.session}),a={callbackBaseUrl:r,kind:`agent/remote`,sessionId:t.sessionId,url:i.url};return{address:a,callId:n.callId,kind:`called`,name:n.name,session:confirmAgentStarted(s,{address:a,operationId:o.id}),toolName:n.remoteAgentName}}catch(e){return logError(log,`remote agent start failed`,e,{remoteAgentName:n.remoteAgentName,nodeId:n.nodeId,callId:n.callId}),{kind:`error`,result:createRemoteAgentStartFailureResult({action:n,error:e}),session:rejectAgentEffect(s,{disposition:`dead`,operationId:o.id})}}}function isRecursiveAgentAction(e,t){return e.kind===`subagent-call`&&e.subagentName===`agent`&&!t.has(e.nodeId)}export{dispatchRuntimeActionsStep};
1
+ import{createLogger,logError}from"#internal/logging.js";import{callAdapterEventHandler}from"#channel/adapter.js";import{AuthKey,CapabilitiesKey,ChannelInstrumentationKey,InitiatorAuthKey}from"#context/keys.js";import{toErrorMessage}from"#shared/errors.js";import{createSubagentCalledEvent,encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{resolveRemoteAgentForAction,startRemoteAgentSession}from"#execution/remote-agent-dispatch.js";import{SUBAGENT_START_FAILED}from"#harness/agent-handle-errors.js";import{confirmAgentStarted,prepareAgentStart,rejectAgentEffect}from"#harness/handles/transitions.js";import{createWorkflowRuntime,workflowEntryReference}from"#execution/workflow-runtime.js";import{deserializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{getAgentHandleStore}from"#harness/handles/store.js";import{getDynamicSubagentSelection}from"#context/dynamic-subagent-lifecycle.js";import{hydrateDurableSession}from"#execution/session.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{dispatchToAgentHandle,isAgentHandleAction}from"#execution/agent-handle-dispatch.js";import{createAgentContinuationBundle}from"#execution/agent-continuation-bundle.js";import{getPendingRuntimeActionBatch,setPendingRuntimeActionBatch}from"#harness/runtime-actions.js";import{createRecursiveAgentRootOnlyResult,createRemoteAgentStartFailureResult,createUnavailableDynamicSubagentResult,getSubagentName}from"#execution/dispatch-action-failures.js";import{mintStartOperation}from"#execution/dispatch-start-operation.js";import{buildSubagentRunInput}from"#execution/subagent-tool.js";import{readSessionTraceContext}from"#tracing/agent-trace-context-store.js";import{resolveSubagentDepth}from"#harness/subagent-depth.js";import{activeTurnId}from"#harness/active-turn-id.js";const log=createLogger(`execution.dispatch-runtime-actions`);async function dispatchRuntimeActionsStep(e){"use step";let s=await readDurableSession(e.sessionState),p=getPendingRuntimeActionBatch(s.state);if(p===void 0||p.actions.length===0)return{results:[],sessionState:e.sessionState};let m=p.event.turnId||activeTurnId(e.sessionState.emissionState),h={...p.event,turnId:m},g=await deserializeContext(e.serializedContext),_=g.require(BundleKey),v=resolveEffectiveAgentRuntime(_,g),y=setPendingRuntimeActionBatch({...p,event:h,session:hydrateDurableSession({compactionOverrides:{thresholdPercent:v.thresholdPercent},durable:s,turnAgent:v.turnAgent})}),b=g.require(ChannelKey),x=g.get(AuthKey)??null,S=g.get(CapabilitiesKey),C=g.get(ChannelInstrumentationKey),w=g.get(InitiatorAuthKey)??null,T=buildAdapterContext(b,g),E=readSessionTraceContext(e.serializedContext,y.sessionId),D=_.resolvedAgent.config?.experimental?.subagentPersistentSessions===!0;getAgentHandleStore(s.state);let O=planDispatch({actions:p.actions,bundle:_,ctx:g,session:y}),k=e.parentWritable.getWriter(),A=O.filter(e=>e.kind===`start`&&e.target.kind===`local`).length,j=y,M=[];try{for(let r of O){if(r.kind===`reject`){M.push(r.result);continue}let i;switch(r.kind){case`resume`:i=await dispatchToAgentHandle({action:r.action,agentId:r.agentId,bundle:createAgentContinuationBundle({action:r.action,bundle:_,dynamicRemoteAgent:r.dynamicRemoteAgent}),currentSession:j,parentToken:e.parentContinuationToken??y.continuationToken,parentTurnId:m});break;case`start`:i=await startSubagent({auth:x,batchEvent:h,bundle:_,callbackBaseUrl:e.callbackBaseUrl,capabilities:S,channelMetadata:C,currentSession:j,fanoutSize:A,initiatorAuth:w,parentContinuationToken:e.parentContinuationToken,parentTraceContext:E,persistentSessions:D,session:y,target:r.target});break}if(j=i.session,i.kind===`error`){M.push(i.result);continue}try{let e=await callAdapterEventHandler(b,createSubagentCalledEvent({callId:i.callId,childSessionId:i.address.sessionId,name:i.name,remote:i.address.kind===`agent/remote`?{url:i.address.url}:void 0,sequence:h.sequence,sessionId:y.sessionId,toolName:i.toolName,turnId:m,workflowId:workflowEntryReference.workflowId}),T);await k.write(encodeMessageStreamEvent(stampMessageStreamEvent(e)))}catch(e){logError(log,`subagent.called emission failed`,e,{callId:i.callId,childSessionId:i.address.sessionId,toolName:i.toolName})}}}finally{k.releaseLock()}return{results:M,sessionState:j===y&&p.event.turnId===m?e.sessionState:createDurableSessionState({session:j})}}function planDispatch(e){let t=getAgentHandleStore(e.session.state)?.handles??[];return e.actions.map(n=>{let r=n.input.agentId,i=typeof r==`string`&&r.trim()!==``?r:void 0;if(i!==void 0&&isAgentHandleAction(n)){if(t.some(e=>e.identity.id===i)){let t=e.bundle.subagentRegistry.dynamicNodeIds?.has(n.nodeId)===!0?getDynamicSubagentSelection(e.ctx,n.nodeId):void 0;return{action:n,agentId:i,dynamicRemoteAgent:n.kind===`remote-agent-call`&&t?.kind===`remote`?t.remoteAgent:void 0,kind:`resume`}}log.warn(`unknown agentId on subagent call; starting a new agent`,{agentId:i,callId:n.callId})}return classifyFreshStart({action:n,bundle:e.bundle,ctx:e.ctx,session:e.session})})}function classifyFreshStart(e){let{action:t}=e,n=e.bundle.subagentRegistry.subagentsByNodeId,r=resolveSubagentDepth(e.session),i=e.session.rootSessionId!==void 0||r.currentDepth>0,a=(t.kind===`subagent-call`||t.kind===`remote-agent-call`)&&e.bundle.subagentRegistry.dynamicNodeIds?.has(t.nodeId)===!0,o=a?getDynamicSubagentSelection(e.ctx,t.nodeId):void 0;if(a&&(o===void 0||t.kind===`subagent-call`&&o.kind!==`subagent`||t.kind===`remote-agent-call`&&o.kind!==`remote`)){let e=getSubagentName(t);return log.warn(`dynamic subagent call blocked after availability changed`,{callId:t.callId,nodeId:t.nodeId,subagentName:e}),{kind:`reject`,result:createUnavailableDynamicSubagentResult(t)}}if(isRecursiveAgentAction(t,n)&&i)return log.warn(`recursive agent call blocked outside the root session`,{callId:t.callId,currentDepth:r.currentDepth,nodeId:t.nodeId,subagentName:t.subagentName}),{kind:`reject`,result:createRecursiveAgentRootOnlyResult(t)};switch(t.kind){case`subagent-call`:{let e=o?.kind===`subagent`?o.agentConfig:void 0,r=n.get(t.nodeId),i=e?.description??(r?.definition.kind===`subagent`?r.definition.description:void 0);return{kind:`start`,target:{action:t,dynamicSubagentAgentConfig:e,kind:`local`,source:i===void 0?{type:`runtime`}:{description:i,type:`local`}}}}case`remote-agent-call`:return{kind:`start`,target:{action:t,dynamicRemoteAgent:o?.kind===`remote`?o.remoteAgent:void 0,kind:`remote`}};default:throw Error(`Unsupported runtime action kind "${t.kind}" in workflow runtime.`)}}async function startSubagent(e){switch(e.target.kind){case`local`:return startLocalSubagent({action:e.target.action,auth:e.auth,batchEvent:e.batchEvent,bundle:e.bundle,capabilities:e.capabilities,channelMetadata:e.channelMetadata,currentSession:e.currentSession,dynamicSubagentAgentConfig:e.target.dynamicSubagentAgentConfig,fanoutSize:e.fanoutSize,initiatorAuth:e.initiatorAuth,parentContinuationToken:e.parentContinuationToken,parentTraceContext:e.parentTraceContext,persistentSessions:e.persistentSessions,session:e.session,source:e.target.source});case`remote`:return startRemoteSubagent({action:e.target.action,auth:e.auth,batchEvent:e.batchEvent,bundle:e.bundle,callbackBaseUrl:e.callbackBaseUrl,currentSession:e.currentSession,dynamicRemoteAgent:e.target.dynamicRemoteAgent,initiatorAuth:e.initiatorAuth,parentContinuationToken:e.parentContinuationToken,persistentSessions:e.persistentSessions,session:e.session});default:return e.target}}async function startLocalSubagent(e){let{action:n,source:r}=e,i=createWorkflowRuntime({compiledArtifactsSource:e.bundle.compiledArtifactsSource,dynamicSubagentAgentConfig:e.dynamicSubagentAgentConfig,nodeId:n.nodeId}),{childContinuationToken:a,runInput:o}=buildSubagentRunInput({action:n,auth:e.auth,batchEvent:e.batchEvent,capabilities:e.capabilities,channelMetadata:e.channelMetadata,fanoutSize:e.fanoutSize,initiatorAuth:e.initiatorAuth,parentContinuationToken:e.parentContinuationToken,parentTraceContext:e.parentTraceContext,persistentSessions:e.persistentSessions,session:e.session,source:r}),c=r.type===`runtime`?`agent/self`:`agent/local`,{identity:l,operation:u}=mintStartOperation({callId:n.callId,name:n.subagentName,nodeId:n.nodeId,parentSessionId:e.session.sessionId,parentTurnId:e.batchEvent.turnId}),d=prepareAgentStart(e.currentSession,{identity:l,operation:u,target:{continuationToken:a,kind:c}}),f;try{f=(await i.createSession(o)).sessionId}catch(e){return logError(log,`local subagent start failed`,e,{callId:n.callId,nodeId:n.nodeId,subagentName:n.subagentName}),{kind:`error`,result:{callId:n.callId,isError:!0,kind:`subagent-result`,origin:`dispatch`,output:{code:SUBAGENT_START_FAILED,message:toErrorMessage(e)},subagentName:n.subagentName},session:rejectAgentEffect(d,{disposition:`dead`,operationId:u.id})}}let p={continuationToken:a,kind:c,sessionId:f};return{address:p,callId:n.callId,kind:`called`,name:n.name,session:confirmAgentStarted(d,{address:p,operationId:u.id}),toolName:n.subagentName}}async function startRemoteSubagent(e){let{action:n}=e,r,i;try{if(e.callbackBaseUrl===void 0)throw Error(`Cannot dispatch remote agent without a callback base URL.`);r=e.callbackBaseUrl,i=resolveRemoteAgentForAction({dynamicRemoteAgent:e.dynamicRemoteAgent,nodeId:n.nodeId,remoteAgentName:n.remoteAgentName,registry:e.bundle.subagentRegistry.subagentsByNodeId})}catch(r){return logError(log,`remote agent start failed`,r,{remoteAgentName:n.remoteAgentName,nodeId:n.nodeId,callId:n.callId}),{kind:`error`,result:createRemoteAgentStartFailureResult({action:n,error:r}),session:e.currentSession}}let{identity:a,operation:o}=mintStartOperation({callId:n.callId,name:n.remoteAgentName,nodeId:n.nodeId,parentSessionId:e.session.sessionId,parentTurnId:e.batchEvent.turnId}),s=prepareAgentStart(e.currentSession,{identity:a,operation:o,target:{callbackBaseUrl:r,kind:`agent/remote`,url:i.url}});try{let t=await startRemoteAgentSession({action:n,auth:e.auth,callbackBaseUrl:r,callbackToken:e.parentContinuationToken,initiatorAuth:e.initiatorAuth,persistentSessions:e.persistentSessions,remote:i,session:e.session}),a={callbackBaseUrl:r,kind:`agent/remote`,sessionId:t.sessionId,url:i.url};return{address:a,callId:n.callId,kind:`called`,name:n.name,session:confirmAgentStarted(s,{address:a,operationId:o.id}),toolName:n.remoteAgentName}}catch(e){return logError(log,`remote agent start failed`,e,{remoteAgentName:n.remoteAgentName,nodeId:n.nodeId,callId:n.callId}),{kind:`error`,result:createRemoteAgentStartFailureResult({action:n,error:e}),session:rejectAgentEffect(s,{disposition:`dead`,operationId:o.id})}}}function isRecursiveAgentAction(e,t){return e.kind===`subagent-call`&&e.subagentName===`agent`&&!t.has(e.nodeId)}export{dispatchRuntimeActionsStep};